diff --git "a/final_benchmark_uniform/python_seed42_sanitized.jsonl" "b/final_benchmark_uniform/python_seed42_sanitized.jsonl" --- "a/final_benchmark_uniform/python_seed42_sanitized.jsonl" +++ "b/final_benchmark_uniform/python_seed42_sanitized.jsonl" @@ -1,900 +1,900 @@ -{"case_ids": ["p03997_case_000", "p03997_case_001", "p03997_case_002", "p03997_case_003", "p03997_case_004", "p03997_case_005", "p03997_case_006", "p03997_case_007", "p03997_case_008", "p03997_case_009", "p03997_case_010", "p03997_case_011", "p03997_case_012", "p03997_case_013", "p03997_case_014", "p03997_case_015", "p03997_case_016", "p03997_case_017", "p03997_case_018", "p03997_case_019", "p03997_case_020", "p03997_case_021", "p03997_case_022", "p03997_case_023", "p03997_case_024", "p03997_case_025", "p03997_case_026", "p03997_case_027", "p03997_case_028", "p03997_case_029", "p03997_case_030", "p03997_case_031", "p03997_case_032", "p03997_case_033", "p03997_case_034", "p03997_case_035", "p03997_case_036", "p03997_case_037", "p03997_case_038", "p03997_case_039", "p03997_case_040", "p03997_case_041", "p03997_case_042", "p03997_case_043", "p03997_case_044", "p03997_case_045", "p03997_case_046", "p03997_case_047", "p03997_case_048", "p03997_case_049", "p03997_case_050", "p03997_case_051", "p03997_case_052", "p03997_case_053", "p03997_case_054", "p03997_case_055", "p03997_case_056", "p03997_case_057", "p03997_case_058", "p03997_case_059", "p03997_case_060", "p03997_case_061", "p03997_case_062", "p03997_case_063", "p03997_case_064", "p03997_case_065", "p03997_case_066", "p03997_case_067", "p03997_case_068", "p03997_case_069", "p03997_case_070", "p03997_case_071", "p03997_case_072", "p03997_case_073", "p03997_case_074", "p03997_case_075", "p03997_case_076", "p03997_case_077", "p03997_case_078", "p03997_case_079", "p03997_case_080", "p03997_case_081", "p03997_case_082", "p03997_case_083", "p03997_case_084", "p03997_case_085", "p03997_case_086", "p03997_case_087", "p03997_case_088", "p03997_case_089", "p03997_case_090", "p03997_case_091", "p03997_case_092", "p03997_case_093", "p03997_case_094", "p03997_case_095", "p03997_case_096", "p03997_case_097", "p03997_case_098", "p03997_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "a = int(eval(input()))\nb = int(eval(input()))\nh = int(eval(input()))\nS = (a + b) * h // 2\nprint(S)\n", "fast_code_sha256": "507845f433863f847e02a6b3b8e7a862d616a4495992f9c0fa8bf62ca2f74894", "fast_id": "p03997_507845f433863f847e02a6b3b8e7a862d616a4495992f9c0fa8bf62ca2f74894", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "a = int(eval(input()))\nb = int(eval(input()))\nh = int(eval(input()))\nS = (a + b) * h // 2\nprint(S)\n", "measured_fast_code_sha256": "507845f433863f847e02a6b3b8e7a862d616a4495992f9c0fa8bf62ca2f74894", "measured_slow_code": "from collections import deque\nfrom heapq import heapify, heappop, heappush, heappushpop\nfrom copy import copy, deepcopy\nfrom itertools import product, permutations, combinations, combinations_with_replacement\nfrom collections import defaultdict, Counter\nfrom bisect import bisect_left, bisect_right\n\n# from math import gcd,ceil,floor,factorial\n# from fractions import gcd\nfrom functools import reduce\nfrom pprint import pprint\n\nINF = float(\"inf\")\n\n\ndef myinput():\n return list(map(int, input().split()))\n\n\ndef mylistinput(n):\n return [list(myinput()) for _ in range(n)]\n\n\ndef mycol(data, col):\n return [row[col] for row in data]\n\n\ndef mysort(data, col, reverse_flag):\n data.sort(key=lambda x: x[col], reverse=reverse_flag)\n return data\n\n\ndef mymax(data):\n M = -1 * float(\"inf\")\n for i in range(len(data)):\n m = max(data[i])\n M = max(M, m)\n return M\n\n\ndef mymin(data):\n m = float(\"inf\")\n for i in range(len(data)):\n M = min(data[i])\n m = min(m, M)\n return m\n\n\ndef mycount(ls, x):\n # lsはソート済みであること\n l = bisect_left(ls, x)\n r = bisect_right(ls, x)\n return r - l\n\n\ndef myoutput(ls, space=True):\n if space:\n if len(ls) == 0:\n print(\" \")\n elif type(ls[0]) == str:\n print((\" \".join(ls)))\n elif type(ls[0]) == int:\n print((\" \".join(map(str, ls))))\n else:\n print(\"Output Error\")\n else:\n if len(ls) == 0:\n print(\"\")\n elif type(ls[0]) == str:\n print((\"\".join(ls)))\n elif type(ls[0]) == int:\n print((\"\".join(map(str, ls))))\n else:\n print(\"Output Error\")\n\n\ndef I():\n return int(eval(input()))\n\n\ndef MI():\n return list(map(int, input().split()))\n\n\ndef RI():\n return list(map(int, input().split()))\n\n\ndef CI(n):\n return [int(eval(input())) for _ in range(n)]\n\n\ndef LI(n):\n return [list(map(int, input().split())) for _ in range(n)]\n\n\ndef S():\n return eval(input())\n\n\ndef MS():\n return input().split()\n\n\ndef RS():\n return list(input().split())\n\n\ndef CS(n):\n return [eval(input()) for _ in range(n)]\n\n\ndef LS(n):\n return [list(input().split()) for _ in range(n)]\n\n\na = I()\nb = I()\nh = I()\nans = (a + b) * h // 2\nprint(ans)\n", "measured_slow_code_sha256": "129dfa97cf673053bafcd5386b6c9bb8fa560bfcf12b57413a4401ec172217cc", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 19.50649458825729, "pair_id": "python_v2_19402716b40ab29f763d2298", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03997", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03997_507845f433863f847e02a6b3b8e7a862d616a4495992f9c0fa8bf62ca2f74894.jsonl.gz", "inputs": "reproduction/python/inputs/p03997.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03997_129dfa97cf673053bafcd5386b6c9bb8fa560bfcf12b57413a4401ec172217cc.jsonl.gz"}, "slow_code": "from collections import deque\nfrom heapq import heapify, heappop, heappush, heappushpop\nfrom copy import copy, deepcopy\nfrom itertools import product, permutations, combinations, combinations_with_replacement\nfrom collections import defaultdict, Counter\nfrom bisect import bisect_left, bisect_right\n\n\nfrom functools import reduce\nfrom pprint import pprint\n\nINF = float(\"inf\")\n\n\ndef myinput():\n return list(map(int, input().split()))\n\n\ndef mylistinput(n):\n return [list(myinput()) for _ in range(n)]\n\n\ndef mycol(data, col):\n return [row[col] for row in data]\n\n\ndef mysort(data, col, reverse_flag):\n data.sort(key=lambda x: x[col], reverse=reverse_flag)\n return data\n\n\ndef mymax(data):\n M = -1 * float(\"inf\")\n for i in range(len(data)):\n m = max(data[i])\n M = max(M, m)\n return M\n\n\ndef mymin(data):\n m = float(\"inf\")\n for i in range(len(data)):\n M = min(data[i])\n m = min(m, M)\n return m\n\n\ndef mycount(ls, x):\n\n l = bisect_left(ls, x)\n r = bisect_right(ls, x)\n return r - l\n\n\ndef myoutput(ls, space=True):\n if space:\n if len(ls) == 0:\n print(\" \")\n elif type(ls[0]) == str:\n print((\" \".join(ls)))\n elif type(ls[0]) == int:\n print((\" \".join(map(str, ls))))\n else:\n print(\"Output Error\")\n else:\n if len(ls) == 0:\n print(\"\")\n elif type(ls[0]) == str:\n print((\"\".join(ls)))\n elif type(ls[0]) == int:\n print((\"\".join(map(str, ls))))\n else:\n print(\"Output Error\")\n\n\ndef I():\n return int(eval(input()))\n\n\ndef MI():\n return list(map(int, input().split()))\n\n\ndef RI():\n return list(map(int, input().split()))\n\n\ndef CI(n):\n return [int(eval(input())) for _ in range(n)]\n\n\ndef LI(n):\n return [list(map(int, input().split())) for _ in range(n)]\n\n\ndef S():\n return eval(input())\n\n\ndef MS():\n return input().split()\n\n\ndef RS():\n return list(input().split())\n\n\ndef CS(n):\n return [eval(input()) for _ in range(n)]\n\n\ndef LS(n):\n return [list(input().split()) for _ in range(n)]\n\n\na = I()\nb = I()\nh = I()\nans = (a + b) * h // 2\nprint(ans)\n", "slow_code_sha256": "a0278d8d61cb13b55d2cf50ffbda8d5966ed6ff493506f6257fe60d5b1e9f259", "slow_id": "p03997_129dfa97cf673053bafcd5386b6c9bb8fa560bfcf12b57413a4401ec172217cc", "speedup": 19.46839568080414, "stratum": "8+", "within_pair_jaccard": 0.08602150537634409, "workload": {"case_count": 100, "description": "Compute the area of a trapezoid with integer bases a and b and even integer height h. Observed inputs: a=1..100; b=1..100; h=2..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 12, "median": 9.0, "min": 6}, "input_format": ["a\nb\nh"], "input_format_status": "source_input_section", "input_lines": {"max": 3, "median": 3.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3, "median": 3.0, "min": 3}}} -{"case_ids": ["p03806_case_000", "p03806_case_001", "p03806_case_002", "p03806_case_003", "p03806_case_004", "p03806_case_005", "p03806_case_006", "p03806_case_007", "p03806_case_008", "p03806_case_009", "p03806_case_010", "p03806_case_011", "p03806_case_012", "p03806_case_013", "p03806_case_014", "p03806_case_015", "p03806_case_016", "p03806_case_017", "p03806_case_018", "p03806_case_019", "p03806_case_020", "p03806_case_021", "p03806_case_022", "p03806_case_023", "p03806_case_024", "p03806_case_025", "p03806_case_026", "p03806_case_027", "p03806_case_028", "p03806_case_029", "p03806_case_030", "p03806_case_031", "p03806_case_032", "p03806_case_033", "p03806_case_034", "p03806_case_035", "p03806_case_036", "p03806_case_037", "p03806_case_038", "p03806_case_039", "p03806_case_040", "p03806_case_041", "p03806_case_042", "p03806_case_043", "p03806_case_044", "p03806_case_045", "p03806_case_046", "p03806_case_047", "p03806_case_048", "p03806_case_049", "p03806_case_050", "p03806_case_051", "p03806_case_052", "p03806_case_053", "p03806_case_054", "p03806_case_055", "p03806_case_056", "p03806_case_057", "p03806_case_058", "p03806_case_059", "p03806_case_060", "p03806_case_061", "p03806_case_062", "p03806_case_063", "p03806_case_064", "p03806_case_065", "p03806_case_066", "p03806_case_067", "p03806_case_068", "p03806_case_069", "p03806_case_070", "p03806_case_071", "p03806_case_072", "p03806_case_073", "p03806_case_074", "p03806_case_075", "p03806_case_076", "p03806_case_077", "p03806_case_078", "p03806_case_079", "p03806_case_080", "p03806_case_081", "p03806_case_082", "p03806_case_083", "p03806_case_084", "p03806_case_085", "p03806_case_086", "p03806_case_087", "p03806_case_088", "p03806_case_089", "p03806_case_090", "p03806_case_091", "p03806_case_092", "p03806_case_093", "p03806_case_094", "p03806_case_095", "p03806_case_096", "p03806_case_097", "p03806_case_098", "p03806_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n, ma, mb = list(map(int, input().split()))\nel = [list(map(int, input().split())) for i in range(n)]\nsa = sum(i[0] for i in el)\nsb = sum(i[1] for i in el)\n\ninf = 10000000000\nx = [[inf for j in range(sb + 1)] for i in range(sa + 1)]\nx[0][0] = 0\nfor i in range(n):\n now = el[i]\n x_sub = [[0 for j in range(sb + 1)] for i in range(sa + 1)]\n for k in range(sa + 1):\n for l in range(sb + 1):\n if x[k][l] != inf and k + now[0] < sa + 1 and l + now[1] < sb + 1:\n x_sub[k + now[0]][l + now[1]] = x[k][l] + now[2]\n for k in range(sa + 1):\n for l in range(sb + 1):\n if x_sub[k][l] != 0:\n x[k][l] = min(x[k][l], x_sub[k][l])\nmi = min(sa // ma, sb // mb)\nans = inf\nfor i in range(1, mi + 1):\n ans = min(ans, x[ma * i][mb * i])\nif ans == inf:\n print((-1))\nelse:\n print(ans)\n", "fast_code_sha256": "94e63a2cd248c4c88e94a13fc795fdc0e6bf4f709e0b917000e629e8c325a5af", "fast_id": "p03806_3a93dfbbb4602fb981c3e3d6b740a1d955e2eacee2b555b48db86d382db19c56", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n, ma, mb = list(map(int, input().split()))\nel = [list(map(int, input().split())) for i in range(n)]\nsa = sum(i[0] for i in el)\nsb = sum(i[1] for i in el)\n# mi=min(sa//ma,sb//mb)\ninf = 10000000000\nx = [[inf for j in range(sb + 1)] for i in range(sa + 1)]\nx[0][0] = 0\nfor i in range(n):\n now = el[i]\n x_sub = [[0 for j in range(sb + 1)] for i in range(sa + 1)]\n for k in range(sa + 1):\n for l in range(sb + 1):\n if x[k][l] != inf and k + now[0] < sa + 1 and l + now[1] < sb + 1:\n x_sub[k + now[0]][l + now[1]] = x[k][l] + now[2]\n for k in range(sa + 1):\n for l in range(sb + 1):\n if x_sub[k][l] != 0:\n x[k][l] = min(x[k][l], x_sub[k][l])\nmi = min(sa // ma, sb // mb)\nans = inf\nfor i in range(1, mi + 1):\n ans = min(ans, x[ma * i][mb * i])\nif ans == inf:\n print((-1))\nelse:\n print(ans)\n", "measured_fast_code_sha256": "3a93dfbbb4602fb981c3e3d6b740a1d955e2eacee2b555b48db86d382db19c56", "measured_slow_code": "def main():\n n, ma, mb = list(map(int, input().split()))\n dp = [\n [[float(\"inf\") for _ in range(401)] for _ in range(401)] for _ in range(n + 1)\n ]\n dp[0][0][0] = 0\n for i in range(1, n + 1):\n a, b, c = list(map(int, input().split()))\n for j in range(401):\n for k in range(401):\n if a <= j and b <= k:\n dp[i][j][k] = min(dp[i - 1][j][k], dp[i - 1][j - a][k - b] + c)\n else:\n dp[i][j][k] = dp[i - 1][j][k]\n ans = float(\"inf\")\n for i in range(1, 401):\n for j in range(1, 401):\n if i * mb == j * ma:\n ans = min(ans, dp[n][i][j])\n if ans == float(\"inf\"):\n print((-1))\n else:\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "447c80beaa8d7ecc746ea531c4fee01e494d9827b685cf74b6b676499a17dddf", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 26.06985582429079, "pair_id": "python_v2_e3a0fae0ee59417bec9e9775", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03806", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03806_3a93dfbbb4602fb981c3e3d6b740a1d955e2eacee2b555b48db86d382db19c56.jsonl.gz", "inputs": "reproduction/python/inputs/p03806.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03806_447c80beaa8d7ecc746ea531c4fee01e494d9827b685cf74b6b676499a17dddf.jsonl.gz"}, "slow_code": "def main():\n n, ma, mb = list(map(int, input().split()))\n dp = [\n [[float(\"inf\") for _ in range(401)] for _ in range(401)] for _ in range(n + 1)\n ]\n dp[0][0][0] = 0\n for i in range(1, n + 1):\n a, b, c = list(map(int, input().split()))\n for j in range(401):\n for k in range(401):\n if a <= j and b <= k:\n dp[i][j][k] = min(dp[i - 1][j][k], dp[i - 1][j - a][k - b] + c)\n else:\n dp[i][j][k] = dp[i - 1][j][k]\n ans = float(\"inf\")\n for i in range(1, 401):\n for j in range(1, 401):\n if i * mb == j * ma:\n ans = min(ans, dp[n][i][j])\n if ans == float(\"inf\"):\n print((-1))\n else:\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "447c80beaa8d7ecc746ea531c4fee01e494d9827b685cf74b6b676499a17dddf", "slow_id": "p03806_447c80beaa8d7ecc746ea531c4fee01e494d9827b685cf74b6b676499a17dddf", "speedup": 43.72495124888867, "stratum": "8+", "within_pair_jaccard": 0.5111111111111111, "workload": {"case_count": 100, "description": "Choose a nonempty subset of N packages to obtain substances A and B in ratio M_a:M_b at minimum total cost. Package i supplies amounts a_i and b_i at cost c_i. Observed inputs: N=1..40 (median 20); M_a=1..10; M_b=1..10; a_i=1..10; b_i=1..10; c_i=1..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 298, "median": 150.0, "min": 13}, "input_format": ["N M_a M_b\na_1 b_1 c_1\n...\na_N b_N c_N"], "input_format_status": "source_input_section", "input_lines": {"max": 41, "median": 21.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 123, "median": 63.0, "min": 6}}} -{"case_ids": ["p00033_case_000", "p00033_case_001", "p00033_case_002", "p00033_case_003", "p00033_case_004", "p00033_case_005", "p00033_case_006", "p00033_case_007", "p00033_case_008", "p00033_case_009", "p00033_case_010", "p00033_case_011", "p00033_case_012", "p00033_case_013", "p00033_case_014", "p00033_case_015", "p00033_case_016", "p00033_case_017", "p00033_case_018", "p00033_case_019", "p00033_case_020", "p00033_case_021", "p00033_case_022", "p00033_case_023", "p00033_case_024", "p00033_case_025", "p00033_case_026", "p00033_case_027", "p00033_case_028", "p00033_case_029", "p00033_case_030", "p00033_case_031", "p00033_case_032", "p00033_case_033", "p00033_case_034", "p00033_case_035", "p00033_case_036", "p00033_case_037", "p00033_case_038", "p00033_case_039", "p00033_case_040", "p00033_case_041", "p00033_case_042", "p00033_case_043", "p00033_case_044", "p00033_case_045", "p00033_case_046", "p00033_case_047", "p00033_case_048", "p00033_case_049", "p00033_case_050", "p00033_case_051", "p00033_case_052", "p00033_case_053", "p00033_case_054", "p00033_case_055", "p00033_case_056", "p00033_case_057", "p00033_case_058", "p00033_case_059", "p00033_case_060", "p00033_case_061", "p00033_case_062", "p00033_case_063", "p00033_case_064", "p00033_case_065", "p00033_case_066", "p00033_case_067", "p00033_case_068", "p00033_case_069", "p00033_case_070", "p00033_case_071", "p00033_case_072", "p00033_case_073", "p00033_case_074", "p00033_case_075", "p00033_case_076", "p00033_case_077", "p00033_case_078", "p00033_case_079", "p00033_case_080", "p00033_case_081", "p00033_case_082", "p00033_case_083", "p00033_case_084", "p00033_case_085", "p00033_case_086", "p00033_case_087", "p00033_case_088", "p00033_case_089", "p00033_case_090", "p00033_case_091", "p00033_case_092", "p00033_case_093", "p00033_case_094", "p00033_case_095", "p00033_case_096", "p00033_case_097", "p00033_case_098", "p00033_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def s(a):\n b = c = 0\n for i in a:\n if i > b:\n b = i\n elif i > c:\n c = i\n else:\n return False\n return True\n\n\nfor n in range(int(input())):\n print(\"YES\" if s(list(map(int, input().split()))) else \"NO\")\n", "fast_code_sha256": "97e7a463a7ae5a9432cd2c67f456ba04ff30cb7374fc001a0ff9009ec3d6048a", "fast_id": "p00033_97e7a463a7ae5a9432cd2c67f456ba04ff30cb7374fc001a0ff9009ec3d6048a", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def s(a):\n b = c = 0\n for i in a:\n if i > b:\n b = i\n elif i > c:\n c = i\n else:\n return False\n return True\n\n\nfor n in range(int(input())):\n print(\"YES\" if s(list(map(int, input().split()))) else \"NO\")\n", "measured_fast_code_sha256": "97e7a463a7ae5a9432cd2c67f456ba04ff30cb7374fc001a0ff9009ec3d6048a", "measured_slow_code": "def dfs(i, b, c):\n if i == 11:\n return b == sorted(b) and c == sorted(c)\n if dfs(i + 1, b + [balls[i - 1]], c):\n return True\n if dfs(i + 1, b, c + [balls[i - 1]]):\n return True\n return False\n\n\nif __name__ == \"__main__\":\n N = int(eval(input()))\n for i in range(N):\n balls = list(map(int, input().split()))\n if dfs(1, [], []):\n print(\"YES\")\n else:\n print(\"NO\")\n", "measured_slow_code_sha256": "d554547e32ca76dca1697e6003a53c8f9386d6f728fbbf5b97a6fa1bed6629c2", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 41.51698810229546, "pair_id": "python_v2_4e1aafd24aedb7b3f06debcb", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p00033", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p00033_97e7a463a7ae5a9432cd2c67f456ba04ff30cb7374fc001a0ff9009ec3d6048a.jsonl.gz", "inputs": "reproduction/python/inputs/p00033.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p00033_d554547e32ca76dca1697e6003a53c8f9386d6f728fbbf5b97a6fa1bed6629c2.jsonl.gz"}, "slow_code": "def dfs(i, b, c):\n if i == 11:\n return b == sorted(b) and c == sorted(c)\n if dfs(i + 1, b + [balls[i - 1]], c):\n return True\n if dfs(i + 1, b, c + [balls[i - 1]]):\n return True\n return False\n\n\nif __name__ == \"__main__\":\n N = int(eval(input()))\n for i in range(N):\n balls = list(map(int, input().split()))\n if dfs(1, [], []):\n print(\"YES\")\n else:\n print(\"NO\")\n", "slow_code_sha256": "d554547e32ca76dca1697e6003a53c8f9386d6f728fbbf5b97a6fa1bed6629c2", "slow_id": "p00033_d554547e32ca76dca1697e6003a53c8f9386d6f728fbbf5b97a6fa1bed6629c2", "speedup": 30.89808368091805, "stratum": "8+", "within_pair_jaccard": 0.5714285714285714, "workload": {"case_count": 100, "description": "For each permutation of 1..10, decide whether it can be assigned in arrival order to two stacks so that values increase from bottom to top in each stack. The first integer gives the number of datasets. Observed inputs: datasets=1..10 (median 7); permutation_length=10.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 213, "median": 149.0, "min": 23}, "input_format": ["N\n[permutation of 1..10]\n... (N permutation lines)"], "input_format_status": "source_input_section", "input_lines": {"max": 11, "median": 8.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 101, "median": 71.0, "min": 11}}} -{"case_ids": ["p02706_case_000", "p02706_case_001", "p02706_case_002", "p02706_case_003", "p02706_case_004", "p02706_case_005", "p02706_case_006", "p02706_case_007", "p02706_case_008", "p02706_case_009", "p02706_case_010", "p02706_case_011", "p02706_case_012", "p02706_case_013", "p02706_case_014", "p02706_case_015", "p02706_case_016", "p02706_case_017", "p02706_case_018", "p02706_case_019", "p02706_case_020", "p02706_case_021", "p02706_case_022", "p02706_case_023", "p02706_case_024", "p02706_case_025", "p02706_case_026", "p02706_case_027", "p02706_case_028", "p02706_case_029", "p02706_case_030", "p02706_case_031", "p02706_case_032", "p02706_case_033", "p02706_case_034", "p02706_case_035", "p02706_case_036", "p02706_case_037", "p02706_case_038", "p02706_case_039", "p02706_case_040", "p02706_case_041", "p02706_case_042", "p02706_case_043", "p02706_case_044", "p02706_case_045", "p02706_case_046", "p02706_case_047", "p02706_case_048", "p02706_case_049", "p02706_case_050", "p02706_case_051", "p02706_case_052", "p02706_case_053", "p02706_case_054", "p02706_case_055", "p02706_case_056", "p02706_case_057", "p02706_case_058", "p02706_case_059", "p02706_case_060", "p02706_case_061", "p02706_case_062", "p02706_case_063", "p02706_case_064", "p02706_case_065", "p02706_case_066", "p02706_case_067", "p02706_case_068", "p02706_case_069", "p02706_case_070", "p02706_case_071", "p02706_case_072", "p02706_case_073", "p02706_case_074", "p02706_case_075", "p02706_case_076", "p02706_case_077", "p02706_case_078", "p02706_case_079", "p02706_case_080", "p02706_case_081", "p02706_case_082", "p02706_case_083", "p02706_case_084", "p02706_case_085", "p02706_case_086", "p02706_case_087", "p02706_case_088", "p02706_case_089", "p02706_case_090", "p02706_case_091", "p02706_case_092", "p02706_case_093", "p02706_case_094", "p02706_case_095", "p02706_case_096", "p02706_case_097", "p02706_case_098", "p02706_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n, m = list(map(int, input().split()))\na = list(map(int, input().split()))\nprint((-1 if n < sum(a) else n - sum(a)))\n", "fast_code_sha256": "df2fdf64192ea024f21faa2a065a251f9cb6070d08dfe07d31c00dc252617caf", "fast_id": "p02706_df2fdf64192ea024f21faa2a065a251f9cb6070d08dfe07d31c00dc252617caf", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n, m = list(map(int, input().split()))\na = list(map(int, input().split()))\nprint((-1 if n < sum(a) else n - sum(a)))\n", "measured_fast_code_sha256": "df2fdf64192ea024f21faa2a065a251f9cb6070d08dfe07d31c00dc252617caf", "measured_slow_code": "import numpy as np\nimport math\n\nn, m = list(map(int, input().split()))\nA = list(map(int, input().split()))\na = sum(A)\nif n < a:\n print((-1))\nelse:\n print((n - a))\n", "measured_slow_code_sha256": "89bf5646ac16bde646209d2509249ed7377541f5a03b9f9c5553553af3b07c63", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 58.578135236387624, "pair_id": "python_v2_7c0779e0420a2ef58f5e2df1", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02706", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02706_df2fdf64192ea024f21faa2a065a251f9cb6070d08dfe07d31c00dc252617caf.jsonl.gz", "inputs": "reproduction/python/inputs/p02706.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02706_89bf5646ac16bde646209d2509249ed7377541f5a03b9f9c5553553af3b07c63.jsonl.gz"}, "slow_code": "import numpy as np\nimport math\n\nn, m = list(map(int, input().split()))\nA = list(map(int, input().split()))\na = sum(A)\nif n < a:\n print((-1))\nelse:\n print((n - a))\n", "slow_code_sha256": "89bf5646ac16bde646209d2509249ed7377541f5a03b9f9c5553553af3b07c63", "slow_id": "p02706_89bf5646ac16bde646209d2509249ed7377541f5a03b9f9c5553553af3b07c63", "speedup": 175.1805217412293, "stratum": "8+", "within_pair_jaccard": 0.6842105263157895, "workload": {"case_count": 100, "description": "During N vacation days, complete M assignments requiring A_i days each, with no simultaneous assignments. Maximize days left free, or report -1 if all assignments cannot fit. Observed inputs: N=1..1000000 (median 1000); M=1..10000 (median 6445); A_i=1..10000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 60014, "median": 15213.0, "min": 6}, "input_format": ["N M\nA_1 ... A_M"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 10002, "median": 6447.0, "min": 3}}} -{"case_ids": ["p02934_case_000", "p02934_case_001", "p02934_case_002", "p02934_case_003", "p02934_case_004", "p02934_case_005", "p02934_case_006", "p02934_case_007", "p02934_case_008", "p02934_case_009", "p02934_case_010", "p02934_case_011", "p02934_case_012", "p02934_case_013", "p02934_case_014", "p02934_case_015", "p02934_case_016", "p02934_case_017", "p02934_case_018", "p02934_case_019", "p02934_case_020", "p02934_case_021", "p02934_case_022", "p02934_case_023", "p02934_case_024", "p02934_case_025", "p02934_case_026", "p02934_case_027", "p02934_case_028", "p02934_case_029", "p02934_case_030", "p02934_case_031", "p02934_case_032", "p02934_case_033", "p02934_case_034", "p02934_case_035", "p02934_case_036", "p02934_case_037", "p02934_case_038", "p02934_case_039", "p02934_case_040", "p02934_case_041", "p02934_case_042", "p02934_case_043", "p02934_case_044", "p02934_case_045", "p02934_case_046", "p02934_case_047", "p02934_case_048", "p02934_case_049", "p02934_case_050", "p02934_case_051", "p02934_case_052", "p02934_case_053", "p02934_case_054", "p02934_case_055", "p02934_case_056", "p02934_case_057", "p02934_case_058", "p02934_case_059", "p02934_case_060", "p02934_case_061", "p02934_case_062", "p02934_case_063", "p02934_case_064", "p02934_case_065", "p02934_case_066", "p02934_case_067", "p02934_case_068", "p02934_case_069", "p02934_case_070", "p02934_case_071", "p02934_case_072", "p02934_case_073", "p02934_case_074", "p02934_case_075", "p02934_case_076", "p02934_case_077", "p02934_case_078", "p02934_case_079", "p02934_case_080", "p02934_case_081", "p02934_case_082", "p02934_case_083", "p02934_case_084", "p02934_case_085", "p02934_case_086", "p02934_case_087", "p02934_case_088", "p02934_case_089", "p02934_case_090", "p02934_case_091", "p02934_case_092", "p02934_case_093", "p02934_case_094", "p02934_case_095", "p02934_case_096", "p02934_case_097", "p02934_case_098", "p02934_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def inpl():\n return list(map(int, input().split()))\n\n\nN = int(eval(input()))\nprint((1 / sum([1 / v for v in inpl()])))\n", "fast_code_sha256": "50679c41a1acd870dba5cdfb9fbd76d0194c111d72b043c33c43e9e5e80f6c1f", "fast_id": "p02934_50679c41a1acd870dba5cdfb9fbd76d0194c111d72b043c33c43e9e5e80f6c1f", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def inpl():\n return list(map(int, input().split()))\n\n\nN = int(eval(input()))\nprint((1 / sum([1 / v for v in inpl()])))\n", "measured_fast_code_sha256": "50679c41a1acd870dba5cdfb9fbd76d0194c111d72b043c33c43e9e5e80f6c1f", "measured_slow_code": "import sys\n\ninput = sys.stdin.readline\nsys.setrecursionlimit(10**7)\nimport numpy as np\n\nN = int(eval(input()))\nA = np.array(input().split(), np.int32)\nanswer = 1 / (1 / A).sum()\nprint(answer)\n", "measured_slow_code_sha256": "60cac70fa0810c2893d2009a00d5b734023fa86b7674974a1bd139ed2b0fd20e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1018.2358738313089, "pair_id": "python_v2_2b0e5550fecdec7e14643add", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02934", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02934_50679c41a1acd870dba5cdfb9fbd76d0194c111d72b043c33c43e9e5e80f6c1f.jsonl.gz", "inputs": "reproduction/python/inputs/p02934.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02934_60cac70fa0810c2893d2009a00d5b734023fa86b7674974a1bd139ed2b0fd20e.jsonl.gz"}, "slow_code": "import sys\n\ninput = sys.stdin.readline\nsys.setrecursionlimit(10**7)\nimport numpy as np\n\nN = int(eval(input()))\nA = np.array(input().split(), np.int32)\nanswer = 1 / (1 / A).sum()\nprint(answer)\n", "slow_code_sha256": "60cac70fa0810c2893d2009a00d5b734023fa86b7674974a1bd139ed2b0fd20e", "slow_id": "p02934_60cac70fa0810c2893d2009a00d5b734023fa86b7674974a1bd139ed2b0fd20e", "speedup": 1040.1368604327902, "stratum": "8+", "within_pair_jaccard": 0.26666666666666666, "workload": {"case_count": 100, "description": "Compute the reciprocal of the sum of reciprocals of N positive input integers A_i, as a real number. Observed inputs: N=1..100 (median 50); A_i=1..1000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 504, "median": 114.0, "min": 4}, "input_format": ["N\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 101, "median": 51.0, "min": 2}}} -{"case_ids": ["p03292_case_000", "p03292_case_001", "p03292_case_002", "p03292_case_003", "p03292_case_004", "p03292_case_005", "p03292_case_006", "p03292_case_007", "p03292_case_008", "p03292_case_009", "p03292_case_010", "p03292_case_011", "p03292_case_012", "p03292_case_013", "p03292_case_014", "p03292_case_015", "p03292_case_016", "p03292_case_017", "p03292_case_018", "p03292_case_019", "p03292_case_020", "p03292_case_021", "p03292_case_022", "p03292_case_023", "p03292_case_024", "p03292_case_025", "p03292_case_026", "p03292_case_027", "p03292_case_028", "p03292_case_029", "p03292_case_030", "p03292_case_031", "p03292_case_032", "p03292_case_033", "p03292_case_034", "p03292_case_035", "p03292_case_036", "p03292_case_037", "p03292_case_038", "p03292_case_039", "p03292_case_040", "p03292_case_041", "p03292_case_042", "p03292_case_043", "p03292_case_044", "p03292_case_045", "p03292_case_046", "p03292_case_047", "p03292_case_048", "p03292_case_049", "p03292_case_050", "p03292_case_051", "p03292_case_052", "p03292_case_053", "p03292_case_054", "p03292_case_055", "p03292_case_056", "p03292_case_057", "p03292_case_058", "p03292_case_059", "p03292_case_060", "p03292_case_061", "p03292_case_062", "p03292_case_063", "p03292_case_064", "p03292_case_065", "p03292_case_066", "p03292_case_067", "p03292_case_068", "p03292_case_069", "p03292_case_070", "p03292_case_071", "p03292_case_072", "p03292_case_073", "p03292_case_074", "p03292_case_075", "p03292_case_076", "p03292_case_077", "p03292_case_078", "p03292_case_079", "p03292_case_080", "p03292_case_081", "p03292_case_082", "p03292_case_083", "p03292_case_084", "p03292_case_085", "p03292_case_086", "p03292_case_087", "p03292_case_088", "p03292_case_089", "p03292_case_090", "p03292_case_091", "p03292_case_092", "p03292_case_093", "p03292_case_094", "p03292_case_095", "p03292_case_096", "p03292_case_097", "p03292_case_098", "p03292_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "A = list(map(int, input().split()))\nprint((max(A) - min(A)))\n", "fast_code_sha256": "aee36ed359645013f33bf9f97ed4e523dfedf9af80fc7a780cda5ad00b8fe3a0", "fast_id": "p03292_aee36ed359645013f33bf9f97ed4e523dfedf9af80fc7a780cda5ad00b8fe3a0", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "A = list(map(int, input().split()))\nprint((max(A) - min(A)))\n", "measured_fast_code_sha256": "aee36ed359645013f33bf9f97ed4e523dfedf9af80fc7a780cda5ad00b8fe3a0", "measured_slow_code": "a, b, c = list(map(int, input().split()))\nans = 9999\nans = min(ans, abs(a - b) + abs(b - c), abs(a - c) + abs(c - b))\nans = min(ans, abs(b - a) + abs(a - c), abs(b - c) + abs(c - a))\nans = min(ans, abs(c - a) + abs(a - b), abs(c - b) + abs(b - a))\nprint(ans)\n", "measured_slow_code_sha256": "f60b0a699a2d92dfcbb5b26a370092e660bc85afffa65c600089419b521caefb", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.181294237470873, "pair_id": "python_v2_c602e147a4bca735e2dfc4cd", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03292", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03292_aee36ed359645013f33bf9f97ed4e523dfedf9af80fc7a780cda5ad00b8fe3a0.jsonl.gz", "inputs": "reproduction/python/inputs/p03292.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03292_f60b0a699a2d92dfcbb5b26a370092e660bc85afffa65c600089419b521caefb.jsonl.gz"}, "slow_code": "a, b, c = list(map(int, input().split()))\nans = 9999\nans = min(ans, abs(a - b) + abs(b - c), abs(a - c) + abs(c - b))\nans = min(ans, abs(b - a) + abs(a - c), abs(b - c) + abs(c - a))\nans = min(ans, abs(c - a) + abs(a - b), abs(c - b) + abs(b - a))\nprint(ans)\n", "slow_code_sha256": "f60b0a699a2d92dfcbb5b26a370092e660bc85afffa65c600089419b521caefb", "slow_id": "p03292_f60b0a699a2d92dfcbb5b26a370092e660bc85afffa65c600089419b521caefb", "speedup": 3.179613395643815, "stratum": "2-4", "within_pair_jaccard": 0.4666666666666667, "workload": {"case_count": 100, "description": "Complete three tasks in any order. The first costs zero; moving from task i to task j costs |A_j-A_i|. Minimize total cost while completing all tasks. Observed inputs: A_i=1..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 12, "median": 9.0, "min": 6}, "input_format": ["A_1 A_2 A_3"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3, "median": 3.0, "min": 3}}} -{"case_ids": ["p03025_case_000", "p03025_case_001", "p03025_case_002", "p03025_case_003", "p03025_case_004", "p03025_case_005", "p03025_case_006", "p03025_case_007", "p03025_case_008", "p03025_case_009", "p03025_case_010", "p03025_case_011", "p03025_case_012", "p03025_case_013", "p03025_case_014", "p03025_case_015", "p03025_case_016", "p03025_case_017", "p03025_case_018", "p03025_case_019", "p03025_case_020", "p03025_case_021", "p03025_case_022", "p03025_case_023", "p03025_case_024", "p03025_case_025", "p03025_case_026", "p03025_case_027", "p03025_case_028", "p03025_case_029", "p03025_case_030", "p03025_case_031", "p03025_case_032", "p03025_case_033", "p03025_case_034", "p03025_case_035", "p03025_case_036", "p03025_case_037", "p03025_case_038", "p03025_case_039", "p03025_case_040", "p03025_case_041", "p03025_case_042", "p03025_case_043", "p03025_case_044", "p03025_case_045", "p03025_case_046", "p03025_case_047", "p03025_case_048", "p03025_case_049", "p03025_case_050", "p03025_case_051", "p03025_case_052", "p03025_case_053", "p03025_case_054", "p03025_case_055", "p03025_case_056", "p03025_case_057", "p03025_case_058", "p03025_case_059", "p03025_case_060", "p03025_case_061", "p03025_case_062", "p03025_case_063", "p03025_case_064", "p03025_case_065", "p03025_case_066", "p03025_case_067", "p03025_case_068", "p03025_case_069", "p03025_case_070", "p03025_case_071", "p03025_case_072", "p03025_case_073", "p03025_case_074", "p03025_case_075", "p03025_case_076", "p03025_case_077", "p03025_case_078", "p03025_case_079", "p03025_case_080", "p03025_case_081", "p03025_case_082", "p03025_case_083", "p03025_case_084", "p03025_case_085", "p03025_case_086", "p03025_case_087", "p03025_case_088", "p03025_case_089", "p03025_case_090", "p03025_case_091", "p03025_case_092", "p03025_case_093", "p03025_case_094", "p03025_case_095", "p03025_case_096", "p03025_case_097", "p03025_case_098", "p03025_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "M = 10**9 + 7\nN, A, B, C = list(map(int, input().split()))\nf = [1]\nfor i in range(1, 2 * N):\n f.append(f[-1] * i % M)\nt = pow(A + B, M - 2, M)\nA *= t\nB *= t\na = pow(A, N, M)\nb = pow(B, N, M)\nz = 0\nfor i in range(N):\n z += (\n (N + i)\n * 100\n * pow(100 - C, M - 2, M)\n * f[N + i - 1]\n * pow(f[N - 1] * f[i], M - 2, M)\n * (a + b)\n )\n z %= M\n a = a * B % M\n b = b * A % M\nprint(z)\n", "fast_code_sha256": "8b2d08aced4ae3491db744bb1ac3ecb0e43549f0f0f9fcaf5fd28737de41460a", "fast_id": "p03025_8b2d08aced4ae3491db744bb1ac3ecb0e43549f0f0f9fcaf5fd28737de41460a", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "M = 10**9 + 7\nN, A, B, C = list(map(int, input().split()))\nf = [1]\nfor i in range(1, 2 * N):\n f.append(f[-1] * i % M)\nt = pow(A + B, M - 2, M)\nA *= t\nB *= t\na = pow(A, N, M)\nb = pow(B, N, M)\nz = 0\nfor i in range(N):\n z += (\n (N + i)\n * 100\n * pow(100 - C, M - 2, M)\n * f[N + i - 1]\n * pow(f[N - 1] * f[i], M - 2, M)\n * (a + b)\n )\n z %= M\n a = a * B % M\n b = b * A % M\nprint(z)\n", "measured_fast_code_sha256": "8b2d08aced4ae3491db744bb1ac3ecb0e43549f0f0f9fcaf5fd28737de41460a", "measured_slow_code": "N, A, B, C = list(map(int, input().split()))\nmod = 10**9 + 7\n# factorial,facotiralの逆数を事前計算.\n# N=10**5あたりまで有効\nFACT = [1]\nfor i in range(1, 2 * 10**5 + 1):\n FACT.append(FACT[-1] * i % mod)\nFACT_INV = [pow(FACT[-1], mod - 2, mod)]\nfor i in range(2 * 10**5, 0, -1):\n FACT_INV.append(FACT_INV[-1] * i % mod)\nFACT_INV = FACT_INV[::-1]\n\n\ndef Combi(N, K):\n return FACT[N] * FACT_INV[N - K] * FACT_INV[K] % mod\n\n\nANS = 0\nSUM = A + B\nA_n = pow(A, N, mod) * pow(pow(SUM, mod - 2, mod), N, mod) % mod\nB_n = pow(B, N, mod) * pow(pow(SUM, mod - 2, mod), N, mod) % mod\nSUMINV = pow(SUM, mod - 2, mod)\nfor i in range(N):\n ANS = (\n ANS\n + (A_n * pow(B, i, mod) + B_n * pow(A, i, mod))\n * Combi(N - 1 + i, i)\n * pow(SUMINV, i, mod)\n * (N + i)\n ) % mod\nprint((ANS * 100 * pow(100 - C, mod - 2, mod) % mod))\n", "measured_slow_code_sha256": "d7b2d9b6e229f1a07afd72ead27dc8b9e9c2526297125bbec66c65aff70af3d1", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 0.9846304521915032, "pair_id": "python_v2_b050de877b0aa69084bcc91d", "per_case_slow_code_faster_fraction": 0.51, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03025", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03025_8b2d08aced4ae3491db744bb1ac3ecb0e43549f0f0f9fcaf5fd28737de41460a.jsonl.gz", "inputs": "reproduction/python/inputs/p03025.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03025_d7b2d9b6e229f1a07afd72ead27dc8b9e9c2526297125bbec66c65aff70af3d1.jsonl.gz"}, "slow_code": "N, A, B, C = list(map(int, input().split()))\nmod = 10**9 + 7\n\n\nFACT = [1]\nfor i in range(1, 2 * 10**5 + 1):\n FACT.append(FACT[-1] * i % mod)\nFACT_INV = [pow(FACT[-1], mod - 2, mod)]\nfor i in range(2 * 10**5, 0, -1):\n FACT_INV.append(FACT_INV[-1] * i % mod)\nFACT_INV = FACT_INV[::-1]\n\n\ndef Combi(N, K):\n return FACT[N] * FACT_INV[N - K] * FACT_INV[K] % mod\n\n\nANS = 0\nSUM = A + B\nA_n = pow(A, N, mod) * pow(pow(SUM, mod - 2, mod), N, mod) % mod\nB_n = pow(B, N, mod) * pow(pow(SUM, mod - 2, mod), N, mod) % mod\nSUMINV = pow(SUM, mod - 2, mod)\nfor i in range(N):\n ANS = (\n ANS\n + (A_n * pow(B, i, mod) + B_n * pow(A, i, mod))\n * Combi(N - 1 + i, i)\n * pow(SUMINV, i, mod)\n * (N + i)\n ) % mod\nprint((ANS * 100 * pow(100 - C, mod - 2, mod) % mod))\n", "slow_code_sha256": "dbe00cc3d9bfb03b1058e58ae449186d8037b31cc79ff86312c4a398d12bce4d", "slow_id": "p03025_d7b2d9b6e229f1a07afd72ead27dc8b9e9c2526297125bbec66c65aff70af3d1", "speedup": 5.068048527411397, "stratum": "4-8", "within_pair_jaccard": 0.5476190476190477, "workload": {"case_count": 100, "description": "Repeat games until either player has N wins. Per-game outcomes are first-player win with probability A percent, second-player win B percent, or draw C percent; A+B+C=100 and A+B>0. Output the expected game count modulo 1000000007 as P*Q^(-1). Observed inputs: N=1..100000 (median 42922); A=0..100; B=0..100; C=0..99.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 16, "median": 13.0, "min": 9}, "input_format": ["N A B C"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 4, "median": 4.0, "min": 4}}} -{"case_ids": ["p03291_case_000", "p03291_case_001", "p03291_case_002", "p03291_case_003", "p03291_case_004", "p03291_case_005", "p03291_case_006", "p03291_case_007", "p03291_case_008", "p03291_case_009", "p03291_case_010", "p03291_case_011", "p03291_case_012", "p03291_case_013", "p03291_case_014", "p03291_case_015", "p03291_case_016", "p03291_case_017", "p03291_case_018", "p03291_case_019", "p03291_case_020", "p03291_case_021", "p03291_case_022", "p03291_case_023", "p03291_case_024", "p03291_case_025", "p03291_case_026", "p03291_case_027", "p03291_case_028", "p03291_case_029", "p03291_case_030", "p03291_case_031", "p03291_case_032", "p03291_case_033", "p03291_case_034", "p03291_case_035", "p03291_case_036", "p03291_case_037", "p03291_case_038", "p03291_case_039", "p03291_case_040", "p03291_case_041", "p03291_case_042", "p03291_case_043", "p03291_case_044", "p03291_case_045", "p03291_case_046", "p03291_case_047", "p03291_case_048", "p03291_case_049", "p03291_case_050", "p03291_case_051", "p03291_case_052", "p03291_case_053", "p03291_case_054", "p03291_case_055", "p03291_case_056", "p03291_case_057", "p03291_case_058", "p03291_case_059", "p03291_case_060", "p03291_case_061", "p03291_case_062", "p03291_case_063", "p03291_case_064", "p03291_case_065", "p03291_case_066", "p03291_case_067", "p03291_case_068", "p03291_case_069", "p03291_case_070", "p03291_case_071", "p03291_case_072", "p03291_case_073", "p03291_case_074", "p03291_case_075", "p03291_case_076", "p03291_case_077", "p03291_case_078", "p03291_case_079", "p03291_case_080", "p03291_case_081", "p03291_case_082", "p03291_case_083", "p03291_case_084", "p03291_case_085", "p03291_case_086", "p03291_case_087", "p03291_case_088", "p03291_case_089", "p03291_case_090", "p03291_case_091", "p03291_case_092", "p03291_case_093", "p03291_case_094", "p03291_case_095", "p03291_case_096", "p03291_case_097", "p03291_case_098", "p03291_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "s = input().rstrip()\ndp = [0] * 4\ndp[0] = 1\nfor i in range(len(s)):\n if s[i] == \"A\":\n dp[1] += dp[0]\n elif s[i] == \"B\":\n dp[2] += dp[1]\n elif s[i] == \"C\":\n dp[3] += dp[2]\n else:\n dp = [dp[0] * 3, dp[1] * 3 + dp[0], dp[2] * 3 + dp[1], dp[3] * 3 + dp[2]]\n dp = list([x % (10**9 + 7) for x in dp])\nprint((dp[3]))\n", "fast_code_sha256": "50ab91c4c0c0068715690c125df31cb262652d04cfb2311aeba2c6d2e9a558be", "fast_id": "p03291_50ab91c4c0c0068715690c125df31cb262652d04cfb2311aeba2c6d2e9a558be", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "s = input().rstrip()\ndp = [0] * 4\ndp[0] = 1\nfor i in range(len(s)):\n if s[i] == \"A\":\n dp[1] += dp[0]\n elif s[i] == \"B\":\n dp[2] += dp[1]\n elif s[i] == \"C\":\n dp[3] += dp[2]\n else:\n dp = [dp[0] * 3, dp[1] * 3 + dp[0], dp[2] * 3 + dp[1], dp[3] * 3 + dp[2]]\n dp = list([x % (10**9 + 7) for x in dp])\nprint((dp[3]))\n", "measured_fast_code_sha256": "50ab91c4c0c0068715690c125df31cb262652d04cfb2311aeba2c6d2e9a558be", "measured_slow_code": "import sys\n\nreadline = sys.stdin.readline\nS = readline().rstrip()\nDIV = 10**9 + 7\ndp = [[0] * 4 for i in range(len(S) + 1)]\n# dp[i + 1][0] : i文字目まで見たとき、ABCの部分文字列がまだ始まっていない場合の数\n# dp[i + 1][1] : i文字目まで見たとき、ABCのAまで一致した場合の数\n# dp[i + 1][2] : i文字目まで見たとき、ABCのBまで一致した場合の数\n# dp[i + 1][3] : i文字目まで見たとき、ABCのCまで一致した場合の数\ndp[0][0] = 1\nfor i in range(len(S)):\n if S[i] == \"A\" or S[i] == \"?\":\n dp[i + 1][0] += dp[i][0] # まだ始まっていない状態をそのまま\n dp[i + 1][1] += dp[i][1] # まだ始まっていない状態をそのまま\n dp[i + 1][2] += dp[i][2] # まだ始まっていない状態をそのまま\n dp[i + 1][3] += dp[i][3] # まだ始まっていない状態をそのまま\n dp[i + 1][1] += dp[i][0] # 開始状態に遷移することが出来る\n if S[i] == \"B\" or S[i] == \"?\":\n dp[i + 1][0] += dp[i][0] # その文字を選ばない場合\n dp[i + 1][1] += dp[i][1] # その文字を選ばない場合\n dp[i + 1][2] += dp[i][2] # その文字を選ばない場合\n dp[i + 1][3] += dp[i][3] # その文字を選ばない場合\n dp[i + 1][2] += dp[i][1] # Bを使用した状態に遷移\n if S[i] == \"C\" or S[i] == \"?\":\n dp[i + 1][0] += dp[i][0] # その文字を選ばない場合\n dp[i + 1][1] += dp[i][1] # その文字を選ばない場合\n dp[i + 1][2] += dp[i][2] # その文字を選ばない場合\n dp[i + 1][3] += dp[i][3] # その文字を選ばない場合\n dp[i + 1][3] += dp[i][2] # Cを使用した状態に遷移\n for j in range(4):\n dp[i + 1][j] %= DIV\n# 最後の文字まで見たとき、Cまで一致した場合の数が答え\nprint((dp[len(S)][3]))\n", "measured_slow_code_sha256": "779114b7df427d693de3af90dfa08e7786175a435b3b9452dcde04bae557f05c", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.7024369251162756, "pair_id": "python_v2_d511116c2ba273d2ab233512", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03291", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03291_50ab91c4c0c0068715690c125df31cb262652d04cfb2311aeba2c6d2e9a558be.jsonl.gz", "inputs": "reproduction/python/inputs/p03291.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03291_779114b7df427d693de3af90dfa08e7786175a435b3b9452dcde04bae557f05c.jsonl.gz"}, "slow_code": "import sys\n\nreadline = sys.stdin.readline\nS = readline().rstrip()\nDIV = 10**9 + 7\ndp = [[0] * 4 for i in range(len(S) + 1)]\n\n\ndp[0][0] = 1\nfor i in range(len(S)):\n if S[i] == \"A\" or S[i] == \"?\":\n dp[i + 1][0] += dp[i][0]\n dp[i + 1][1] += dp[i][1]\n dp[i + 1][2] += dp[i][2]\n dp[i + 1][3] += dp[i][3]\n dp[i + 1][1] += dp[i][0]\n if S[i] == \"B\" or S[i] == \"?\":\n dp[i + 1][0] += dp[i][0]\n dp[i + 1][1] += dp[i][1]\n dp[i + 1][2] += dp[i][2]\n dp[i + 1][3] += dp[i][3]\n dp[i + 1][2] += dp[i][1]\n if S[i] == \"C\" or S[i] == \"?\":\n dp[i + 1][0] += dp[i][0]\n dp[i + 1][1] += dp[i][1]\n dp[i + 1][2] += dp[i][2]\n dp[i + 1][3] += dp[i][3]\n dp[i + 1][3] += dp[i][2]\n for j in range(4):\n dp[i + 1][j] %= DIV\n\nprint((dp[len(S)][3]))\n", "slow_code_sha256": "bc8b996b668505e4e304571caa360d13a1ae1d85a2eb813c7156a4cbeca12747", "slow_id": "p03291_779114b7df427d693de3af90dfa08e7786175a435b3b9452dcde04bae557f05c", "speedup": 2.7657577683455035, "stratum": "2-4", "within_pair_jaccard": 0.5882352941176471, "workload": {"case_count": 100, "description": "For each replacement of every ? in S by A,B or C, count triples i 0:\n new_dp[j + X[i]] += dp[j]\n dp = new_dp\nprint((dp[0] - 1))\n", "fast_code_sha256": "b2b548a4d89c995371b30030d01bc119904ddb71f7c52f4ed4b5fa042bd4ea71", "fast_id": "p04015_b2b548a4d89c995371b30030d01bc119904ddb71f7c52f4ed4b5fa042bd4ea71", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N, A = list(map(int, input().split()))\nX = list([int(x) - A for x in input().split()])\ndp = [0] * 10000\ndp[0] = 1\nfor i in range(N):\n new_dp = dp[:]\n for j in range(-3000, 3000):\n if dp[j] > 0:\n new_dp[j + X[i]] += dp[j]\n dp = new_dp\nprint((dp[0] - 1))\n", "measured_fast_code_sha256": "b2b548a4d89c995371b30030d01bc119904ddb71f7c52f4ed4b5fa042bd4ea71", "measured_slow_code": "n, a = list(map(int, input().split()))\nx = list(map(int, input().split()))\ndp = [[[0] * (n * 50 + 1) for i in range(n + 1)] for i in range(n)]\n# dp[i][j][k]=i番目まででj枚のカードを選んだ時の合計がkになる組み合わせ\ndp[0][0][0] = 1\ndp[0][1][x[0]] = 1\nfor i in range(1, n):\n for j in range(n + 1):\n for k in range(n * 50 + 1):\n if dp[i - 1][j][k] == 0:\n continue\n # 入れるとき\n dp[i][j + 1][k + x[i]] += dp[i - 1][j][k]\n # 入れない時\n dp[i][j][k] += dp[i - 1][j][k]\nans = 0\nfor j in range(1, n + 1):\n for k in range(n * 50 + 1):\n if a * j == k:\n ans += dp[-1][j][k]\nprint(ans)\n# print(*dp[-1],sep='\\n')\n", "measured_slow_code_sha256": "5ed596884989c1cb95a8cdb1d55f87f4193d5ec23fb229d7e8609fcad31672d4", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 37.154085276524874, "pair_id": "python_v2_9d0383a3173b6f6907315c29", "per_case_slow_code_faster_fraction": 0.22105263157894736, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p04015", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p04015_b2b548a4d89c995371b30030d01bc119904ddb71f7c52f4ed4b5fa042bd4ea71.jsonl.gz", "inputs": "reproduction/python/inputs/p04015.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p04015_5ed596884989c1cb95a8cdb1d55f87f4193d5ec23fb229d7e8609fcad31672d4.jsonl.gz"}, "slow_code": "n, a = list(map(int, input().split()))\nx = list(map(int, input().split()))\ndp = [[[0] * (n * 50 + 1) for i in range(n + 1)] for i in range(n)]\n\ndp[0][0][0] = 1\ndp[0][1][x[0]] = 1\nfor i in range(1, n):\n for j in range(n + 1):\n for k in range(n * 50 + 1):\n if dp[i - 1][j][k] == 0:\n continue\n\n dp[i][j + 1][k + x[i]] += dp[i - 1][j][k]\n\n dp[i][j][k] += dp[i - 1][j][k]\nans = 0\nfor j in range(1, n + 1):\n for k in range(n * 50 + 1):\n if a * j == k:\n ans += dp[-1][j][k]\nprint(ans)\n", "slow_code_sha256": "1e2ace225af337b2f023fb7e1839de0de8cbf265842f6ca41ac5311221f212f9", "slow_id": "p04015_5ed596884989c1cb95a8cdb1d55f87f4193d5ec23fb229d7e8609fcad31672d4", "speedup": 7.818445300753514, "stratum": "4-8", "within_pair_jaccard": 0.5714285714285714, "workload": {"case_count": 95, "description": "Count nonempty subsets of N indexed cards whose values x_i have arithmetic mean exactly A. Cards with equal values but different indices are distinct choices. Observed inputs: N=1..50 (median 50); A=1..50 (median 25); x_i=1..50.", "description_revision": "semantic-review-20261020", "distinct_input_count": 95, "input_bytes": {"max": 156, "median": 105, "min": 6}, "input_format": ["N A\nx_1 ... x_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 52, "median": 52, "min": 3}}} -{"case_ids": ["p02830_case_000", "p02830_case_001", "p02830_case_002", "p02830_case_003", "p02830_case_004", "p02830_case_005", "p02830_case_006", "p02830_case_007", "p02830_case_008", "p02830_case_009", "p02830_case_010", "p02830_case_011", "p02830_case_012", "p02830_case_013", "p02830_case_014", "p02830_case_015", "p02830_case_016", "p02830_case_017", "p02830_case_018", "p02830_case_019", "p02830_case_020", "p02830_case_021", "p02830_case_022", "p02830_case_023", "p02830_case_024", "p02830_case_025", "p02830_case_026", "p02830_case_027", "p02830_case_028", "p02830_case_029", "p02830_case_030", "p02830_case_031", "p02830_case_032", "p02830_case_033", "p02830_case_034", "p02830_case_035", "p02830_case_036", "p02830_case_037", "p02830_case_038", "p02830_case_039", "p02830_case_040", "p02830_case_041", "p02830_case_042", "p02830_case_043", "p02830_case_044", "p02830_case_045", "p02830_case_046", "p02830_case_047", "p02830_case_048", "p02830_case_049", "p02830_case_050", "p02830_case_051", "p02830_case_052", "p02830_case_053", "p02830_case_054", "p02830_case_055", "p02830_case_056", "p02830_case_057", "p02830_case_058", "p02830_case_059", "p02830_case_060", "p02830_case_061", "p02830_case_062", "p02830_case_063", "p02830_case_064", "p02830_case_065", "p02830_case_066", "p02830_case_067", "p02830_case_068", "p02830_case_069", "p02830_case_070", "p02830_case_071", "p02830_case_072", "p02830_case_073", "p02830_case_074", "p02830_case_075", "p02830_case_076", "p02830_case_077", "p02830_case_078", "p02830_case_079", "p02830_case_080", "p02830_case_081", "p02830_case_082", "p02830_case_083", "p02830_case_084", "p02830_case_085", "p02830_case_086", "p02830_case_087", "p02830_case_088", "p02830_case_089", "p02830_case_090", "p02830_case_091", "p02830_case_092", "p02830_case_093", "p02830_case_094", "p02830_case_095", "p02830_case_096", "p02830_case_097", "p02830_case_098", "p02830_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def main():\n import sys\n\n input = sys.stdin.readline\n sys.setrecursionlimit(10**7)\n from collections import Counter, deque\n\n from itertools import combinations, permutations, accumulate, groupby\n\n from bisect import bisect_left, bisect_right\n from heapq import heapify, heappop, heappush\n from math import floor, ceil\n\n n = int(eval(input()))\n s, t = input().rstrip().split()\n res = \"\"\n for i in range(n):\n res += s[i]\n res += t[i]\n print(res)\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "9d1e473514c6a71a3244a0027e10b89e0236728afc6e0ba30cdceb79e515e8aa", "fast_id": "p02830_56ce968a0eb7b0bfb6e6f7c8c3c05db41af520c88dc8b8c3377c4aef5519887b", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def main():\n import sys\n\n input = sys.stdin.readline\n sys.setrecursionlimit(10**7)\n from collections import Counter, deque\n\n # from collections import defaultdict\n from itertools import combinations, permutations, accumulate, groupby\n\n # from itertools import product\n from bisect import bisect_left, bisect_right\n from heapq import heapify, heappop, heappush\n from math import floor, ceil\n\n # from operator import itemgetter\n # inf = 10**17\n # mod = 10**9 + 7\n n = int(eval(input()))\n s, t = input().rstrip().split()\n res = \"\"\n for i in range(n):\n res += s[i]\n res += t[i]\n print(res)\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "56ce968a0eb7b0bfb6e6f7c8c3c05db41af520c88dc8b8c3377c4aef5519887b", "measured_slow_code": "from collections import Counter, defaultdict, deque\nfrom heapq import heappop, heappush, heapify\nimport sys, bisect, math, itertools, fractions, pprint\n\nsys.setrecursionlimit(10**8)\nmod = 10**9 + 7\nmod2 = 998244353\nINF = float(\"inf\")\n\n\ndef inp():\n return int(sys.stdin.readline())\n\n\ndef inpl():\n return list(map(int, sys.stdin.readline().split()))\n\n\ndef inpln(n):\n return list(int(sys.stdin.readline()) for i in range(n))\n\n\nn = inp()\ns, t = input().split()\nres = \"\"\nfor i in range(n):\n res += s[i] + t[i]\nprint(res)\n", "measured_slow_code_sha256": "241afa9a4a462ffb4a4454131541737b779c1c29e81784f31982be1ef01be8e4", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 14.344034232517373, "pair_id": "python_v2_d9ea16159608508899d32a39", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02830", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02830_56ce968a0eb7b0bfb6e6f7c8c3c05db41af520c88dc8b8c3377c4aef5519887b.jsonl.gz", "inputs": "reproduction/python/inputs/p02830.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02830_241afa9a4a462ffb4a4454131541737b779c1c29e81784f31982be1ef01be8e4.jsonl.gz"}, "slow_code": "from collections import Counter, defaultdict, deque\nfrom heapq import heappop, heappush, heapify\nimport sys, bisect, math, itertools, fractions, pprint\n\nsys.setrecursionlimit(10**8)\nmod = 10**9 + 7\nmod2 = 998244353\nINF = float(\"inf\")\n\n\ndef inp():\n return int(sys.stdin.readline())\n\n\ndef inpl():\n return list(map(int, sys.stdin.readline().split()))\n\n\ndef inpln(n):\n return list(int(sys.stdin.readline()) for i in range(n))\n\n\nn = inp()\ns, t = input().split()\nres = \"\"\nfor i in range(n):\n res += s[i] + t[i]\nprint(res)\n", "slow_code_sha256": "241afa9a4a462ffb4a4454131541737b779c1c29e81784f31982be1ef01be8e4", "slow_id": "p02830_241afa9a4a462ffb4a4454131541737b779c1c29e81784f31982be1ef01be8e4", "speedup": 14.406417231327593, "stratum": "8+", "within_pair_jaccard": 0.5, "workload": {"case_count": 100, "description": "Interleave two lowercase strings S and T, both of length N, taking S_1,T_1,S_2,T_2,...,S_N,T_N. Observed inputs: N=1..100 (median 50).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 206, "median": 105.0, "min": 6}, "input_format": ["N\nS T"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3, "median": 3.0, "min": 3}}} -{"case_ids": ["p03805_case_000", "p03805_case_001", "p03805_case_002", "p03805_case_003", "p03805_case_004", "p03805_case_005", "p03805_case_006", "p03805_case_007", "p03805_case_008", "p03805_case_009", "p03805_case_010", "p03805_case_011", "p03805_case_012", "p03805_case_013", "p03805_case_014", "p03805_case_015", "p03805_case_016", "p03805_case_017", "p03805_case_018", "p03805_case_019", "p03805_case_020", "p03805_case_021", "p03805_case_022", "p03805_case_023", "p03805_case_024", "p03805_case_025", "p03805_case_026", "p03805_case_027", "p03805_case_028", "p03805_case_029", "p03805_case_030", "p03805_case_031", "p03805_case_032", "p03805_case_033", "p03805_case_034", "p03805_case_035", "p03805_case_036", "p03805_case_037", "p03805_case_038", "p03805_case_039", "p03805_case_040", "p03805_case_041", "p03805_case_042", "p03805_case_043", "p03805_case_044", "p03805_case_045", "p03805_case_046", "p03805_case_047", "p03805_case_048", "p03805_case_049", "p03805_case_050", "p03805_case_051", "p03805_case_052", "p03805_case_053", "p03805_case_054", "p03805_case_055", "p03805_case_056", "p03805_case_057", "p03805_case_058", "p03805_case_059", "p03805_case_060", "p03805_case_061", "p03805_case_062", "p03805_case_063", "p03805_case_064", "p03805_case_065", "p03805_case_066", "p03805_case_067", "p03805_case_068", "p03805_case_069", "p03805_case_070", "p03805_case_071", "p03805_case_072", "p03805_case_073", "p03805_case_074", "p03805_case_075", "p03805_case_076", "p03805_case_077", "p03805_case_078", "p03805_case_079", "p03805_case_080", "p03805_case_081", "p03805_case_082", "p03805_case_083", "p03805_case_084", "p03805_case_085", "p03805_case_086", "p03805_case_087", "p03805_case_088", "p03805_case_089", "p03805_case_090", "p03805_case_091", "p03805_case_092", "p03805_case_093", "p03805_case_094", "p03805_case_095", "p03805_case_096", "p03805_case_097", "p03805_case_098", "p03805_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from collections import defaultdict\nfrom itertools import permutations\n\n\ndef main():\n N, M = list(map(int, input().split()))\n g = defaultdict(list)\n for _ in range(M):\n a, b = list(map(int, input().split()))\n g[a].append(b)\n g[b].append(a)\n ans = 0\n for route in permutations(list(range(2, N + 1)), N - 1):\n ok = True\n now = 1\n for r in route:\n if r in g[now]:\n now = r\n else:\n ok = False\n if ok:\n ans += 1\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "70e594db7e9e5b3f798f721895d1b80bda5c2b03a463302099ca6355a9ef42ad", "fast_id": "p03805_70e594db7e9e5b3f798f721895d1b80bda5c2b03a463302099ca6355a9ef42ad", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from collections import defaultdict\nfrom itertools import permutations\n\n\ndef main():\n N, M = list(map(int, input().split()))\n g = defaultdict(list)\n for _ in range(M):\n a, b = list(map(int, input().split()))\n g[a].append(b)\n g[b].append(a)\n ans = 0\n for route in permutations(list(range(2, N + 1)), N - 1):\n ok = True\n now = 1\n for r in route:\n if r in g[now]:\n now = r\n else:\n ok = False\n if ok:\n ans += 1\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "70e594db7e9e5b3f798f721895d1b80bda5c2b03a463302099ca6355a9ef42ad", "measured_slow_code": "from typing import List, Tuple\n\n\ndef main():\n n, m = list(map(int, input().split()))\n g = []\n for _ in range(m):\n a, b = list(map(int, input().split()))\n g.append((a, b))\n print((osp(n, g)))\n\n\ndef osp(n: int, g: List[Tuple[int, int]]) -> int:\n v = [False] * n\n g = set(g)\n return dfs(0, v, n, g)\n\n\ndef dfs(i, v, n, g):\n v[i] = True\n if all(v):\n v[i] = False\n return 1\n cnt = 0\n for j in range(n):\n if v[j]:\n continue\n if not ((i + 1, j + 1) in g or (j + 1, i + 1) in g):\n continue\n cnt += dfs(j, v, n, g)\n v[i] = False\n return cnt\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "562f6e02e8417832e28d70eb3bf85554d0ed3aeb8b43d97c409d2d577ce8e26f", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 7.596083542882136, "pair_id": "python_v2_4b19cc5393850ccc5d34eb10", "per_case_slow_code_faster_fraction": 0.16, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03805", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03805_70e594db7e9e5b3f798f721895d1b80bda5c2b03a463302099ca6355a9ef42ad.jsonl.gz", "inputs": "reproduction/python/inputs/p03805.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03805_562f6e02e8417832e28d70eb3bf85554d0ed3aeb8b43d97c409d2d577ce8e26f.jsonl.gz"}, "slow_code": "from typing import List, Tuple\n\n\ndef main():\n n, m = list(map(int, input().split()))\n g = []\n for _ in range(m):\n a, b = list(map(int, input().split()))\n g.append((a, b))\n print((osp(n, g)))\n\n\ndef osp(n: int, g: List[Tuple[int, int]]) -> int:\n v = [False] * n\n g = set(g)\n return dfs(0, v, n, g)\n\n\ndef dfs(i, v, n, g):\n v[i] = True\n if all(v):\n v[i] = False\n return 1\n cnt = 0\n for j in range(n):\n if v[j]:\n continue\n if not ((i + 1, j + 1) in g or (j + 1, i + 1) in g):\n continue\n cnt += dfs(j, v, n, g)\n v[i] = False\n return cnt\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "562f6e02e8417832e28d70eb3bf85554d0ed3aeb8b43d97c409d2d577ce8e26f", "slow_id": "p03805_562f6e02e8417832e28d70eb3bf85554d0ed3aeb8b43d97c409d2d577ce8e26f", "speedup": 3.9329678535066988, "stratum": "2-4", "within_pair_jaccard": 0.45454545454545453, "workload": {"case_count": 100, "description": "Count paths starting at vertex 1 and visiting all N vertices exactly once in a simple unweighted undirected graph. Disconnected graphs and zero edges are allowed. Edges use 1-based endpoints a_i= x:\n tmp.append(A[i])\n else:\n B.append(tmp)\n tmp = []\n B.append(tmp)\n # 数列B内の各数列から、使える要素を集める\n C = []\n for li in B:\n m = len(li)\n if m - K + 1 >= 1:\n li.sort()\n C += li[: m - K + 1]\n # 集めた要素からQ個をクエリで使うので、小さい方からQ番目が使う要素の最大値y\n C.sort()\n if len(C) < Q:\n continue\n y = C[Q - 1]\n ans = min(ans, y - x)\nprint(ans)\n", "measured_slow_code_sha256": "d3ddc9032d72667751284d07a5476c420b8766450a022df883dd1a2fa4ed31f6", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1019.9021786588479, "pair_id": "python_v2_d8b58a6b091fb7c16d7c344f", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03343", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03343_bfc4c1ae7dba827465bf8486f4249db0d38b97d72f9334848abff56e1a4fce08.jsonl.gz", "inputs": "reproduction/python/inputs/p03343.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03343_d3ddc9032d72667751284d07a5476c420b8766450a022df883dd1a2fa4ed31f6.jsonl.gz"}, "slow_code": "import sys\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef list2d(a, b, c):\n return [[c] * b for i in range(a)]\n\n\ndef list3d(a, b, c, d):\n return [[[d] * c for j in range(b)] for i in range(a)]\n\n\ndef list4d(a, b, c, d, e):\n return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]\n\n\ndef ceil(x, y=1):\n return int(-(-x // y))\n\n\ndef INT():\n return int(eval(input()))\n\n\ndef MAP():\n return list(map(int, input().split()))\n\n\ndef LIST(N=None):\n return list(MAP()) if N is None else [INT() for i in range(N)]\n\n\ndef Yes():\n print(\"Yes\")\n\n\ndef No():\n print(\"No\")\n\n\ndef YES():\n print(\"YES\")\n\n\ndef NO():\n print(\"NO\")\n\n\nsys.setrecursionlimit(10**9)\nINF = 10**18\nMOD = 10**9 + 7\nN, K, Q = MAP()\nA = LIST()\nans = INF\n\nfor x in A:\n\n B = []\n tmp = []\n for i in range(N):\n if A[i] >= x:\n tmp.append(A[i])\n else:\n B.append(tmp)\n tmp = []\n B.append(tmp)\n\n C = []\n for li in B:\n m = len(li)\n if m - K + 1 >= 1:\n li.sort()\n C += li[: m - K + 1]\n\n C.sort()\n if len(C) < Q:\n continue\n y = C[Q - 1]\n ans = min(ans, y - x)\nprint(ans)\n", "slow_code_sha256": "7488c929e8b3d65a47a4f6f1e17951da209714f6e8f251e4843a3635aa459b59", "slow_id": "p03343_d3ddc9032d72667751284d07a5476c420b8766450a022df883dd1a2fa4ed31f6", "speedup": 346.97474890290965, "stratum": "8+", "within_pair_jaccard": 0.3150684931506849, "workload": {"case_count": 100, "description": "Repeat Q times: choose K consecutive entries of the current sequence and remove one minimum entry from that block. Minimize the largest removed value minus the smallest over all Q removals. Observed inputs: N=1..2000 (median 2000); K=1..2000 (median 1000); Q=1..2000 (median 1000); A_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 22012, "median": 19779.0, "min": 8}, "input_format": ["N K Q\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2003, "median": 2003.0, "min": 4}}} -{"case_ids": ["p02712_case_000", "p02712_case_001", "p02712_case_002", "p02712_case_003", "p02712_case_004", "p02712_case_005", "p02712_case_006", "p02712_case_007", "p02712_case_008", "p02712_case_009", "p02712_case_010", "p02712_case_011", "p02712_case_012", "p02712_case_013", "p02712_case_014", "p02712_case_015", "p02712_case_016", "p02712_case_017", "p02712_case_018", "p02712_case_019", "p02712_case_020", "p02712_case_021", "p02712_case_022", "p02712_case_023", "p02712_case_024", "p02712_case_025", "p02712_case_026", "p02712_case_027", "p02712_case_028", "p02712_case_029", "p02712_case_030", "p02712_case_031", "p02712_case_032", "p02712_case_033", "p02712_case_034", "p02712_case_035", "p02712_case_036", "p02712_case_037", "p02712_case_038", "p02712_case_039", "p02712_case_040", "p02712_case_041", "p02712_case_042", "p02712_case_043", "p02712_case_044", "p02712_case_045", "p02712_case_046", "p02712_case_047", "p02712_case_048", "p02712_case_049", "p02712_case_050", "p02712_case_051", "p02712_case_052", "p02712_case_053", "p02712_case_054", "p02712_case_055", "p02712_case_056", "p02712_case_057", "p02712_case_058", "p02712_case_059", "p02712_case_060", "p02712_case_061", "p02712_case_062", "p02712_case_063", "p02712_case_064", "p02712_case_065", "p02712_case_066", "p02712_case_067", "p02712_case_068", "p02712_case_069", "p02712_case_070", "p02712_case_071", "p02712_case_072", "p02712_case_073", "p02712_case_074", "p02712_case_075", "p02712_case_076", "p02712_case_077", "p02712_case_078", "p02712_case_079", "p02712_case_080", "p02712_case_081", "p02712_case_082", "p02712_case_083", "p02712_case_084", "p02712_case_085", "p02712_case_086", "p02712_case_087", "p02712_case_088", "p02712_case_089", "p02712_case_090", "p02712_case_091", "p02712_case_092", "p02712_case_093", "p02712_case_094", "p02712_case_095", "p02712_case_096", "p02712_case_097", "p02712_case_098", "p02712_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\nSum = 0.5 * n * (1 + n)\n\nSum3_5 = 0.5 * (int(n / 3) * (3 + 3 * int(n / 3)) + int(n / 5) * (5 + 5 * int(n / 5)))\nSum15 = 0.5 * (int(n / 15) * (15 + int(n / 15) * 15))\n\nprint((int(Sum - Sum3_5 + Sum15)))\n", "fast_code_sha256": "6b214377e8830c8ef5db7c76491715d4e576ebe795031bc7baac3fb1f62576d7", "fast_id": "p02712_d8727d4315cce76f463c0482d83aebba7c2a66cd445b285570e301539aee7ccf", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\nSum = 0.5 * n * (1 + n)\n# n < 3やn < 5のときでもint(n/3) = int(n/5) = 0のため問題なし\nSum3_5 = 0.5 * (int(n / 3) * (3 + 3 * int(n / 3)) + int(n / 5) * (5 + 5 * int(n / 5)))\nSum15 = 0.5 * (int(n / 15) * (15 + int(n / 15) * 15))\n# 問題の回答が整数値のため\nprint((int(Sum - Sum3_5 + Sum15)))\n", "measured_fast_code_sha256": "d8727d4315cce76f463c0482d83aebba7c2a66cd445b285570e301539aee7ccf", "measured_slow_code": "# 入力N\nN = int(eval(input()))\nary2 = []\nfor x in list(range(1, N + 1, 1)):\n if x % 3 != 0 and x % 5 != 0:\n ary2.append(x)\nprint((sum(ary2)))\n", "measured_slow_code_sha256": "33180e8f8531ab7beba61b81c75e8fa954c1f6958e5a3a1431e3ef4377cc1302", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1229.6257029269145, "pair_id": "python_v2_3f85b46f400dde5ab17ba027", "per_case_slow_code_faster_fraction": 0.14, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02712", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02712_d8727d4315cce76f463c0482d83aebba7c2a66cd445b285570e301539aee7ccf.jsonl.gz", "inputs": "reproduction/python/inputs/p02712.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02712_33180e8f8531ab7beba61b81c75e8fa954c1f6958e5a3a1431e3ef4377cc1302.jsonl.gz"}, "slow_code": "N = int(eval(input()))\nary2 = []\nfor x in list(range(1, N + 1, 1)):\n if x % 3 != 0 and x % 5 != 0:\n ary2.append(x)\nprint((sum(ary2)))\n", "slow_code_sha256": "8c66b41e3f6703973067b14827b6d2d0357c8992b486cfc019d662a0d4e9c927", "slow_id": "p02712_33180e8f8531ab7beba61b81c75e8fa954c1f6958e5a3a1431e3ef4377cc1302", "speedup": 359.833573126783, "stratum": "8+", "within_pair_jaccard": 0.3333333333333333, "workload": {"case_count": 100, "description": "Sum numeric terms among the first N FizzBuzz terms: multiples of 3 or 5 are words, and every other term i is the number i. Observed inputs: N=1..1000000 (median 360236).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 8, "median": 7.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p00022_case_000", "p00022_case_001", "p00022_case_002", "p00022_case_003", "p00022_case_004", "p00022_case_005", "p00022_case_006", "p00022_case_007", "p00022_case_008", "p00022_case_009", "p00022_case_010", "p00022_case_011", "p00022_case_012", "p00022_case_013", "p00022_case_014", "p00022_case_015", "p00022_case_016", "p00022_case_017", "p00022_case_018", "p00022_case_019", "p00022_case_020", "p00022_case_021", "p00022_case_022", "p00022_case_023", "p00022_case_024", "p00022_case_025", "p00022_case_026", "p00022_case_027", "p00022_case_028", "p00022_case_029", "p00022_case_030", "p00022_case_031", "p00022_case_032", "p00022_case_033", "p00022_case_034", "p00022_case_035", "p00022_case_036", "p00022_case_037", "p00022_case_038", "p00022_case_039", "p00022_case_040", "p00022_case_041", "p00022_case_042", "p00022_case_043", "p00022_case_044", "p00022_case_045", "p00022_case_046", "p00022_case_047", "p00022_case_048", "p00022_case_049", "p00022_case_050", "p00022_case_051", "p00022_case_052", "p00022_case_053", "p00022_case_054", "p00022_case_055", "p00022_case_056", "p00022_case_057", "p00022_case_058", "p00022_case_059", "p00022_case_060", "p00022_case_061", "p00022_case_062", "p00022_case_063", "p00022_case_064", "p00022_case_065", "p00022_case_066", "p00022_case_067", "p00022_case_068", "p00022_case_069", "p00022_case_070", "p00022_case_071", "p00022_case_072", "p00022_case_073", "p00022_case_074", "p00022_case_075", "p00022_case_076", "p00022_case_077", "p00022_case_078", "p00022_case_079", "p00022_case_080", "p00022_case_081", "p00022_case_082", "p00022_case_083", "p00022_case_084", "p00022_case_085", "p00022_case_086", "p00022_case_087", "p00022_case_088", "p00022_case_089", "p00022_case_090", "p00022_case_091", "p00022_case_092", "p00022_case_093", "p00022_case_094", "p00022_case_095", "p00022_case_096", "p00022_case_097", "p00022_case_098", "p00022_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\ns = \"\"\nfor i in sys.stdin:\n n = int(i)\n if n == 0:\n break\n max = -100000\n sum = int(input())\n for i in range(n - 1):\n m = int(input())\n if sum < 0 and sum < m:\n sum = m\n else:\n if m < 0 and max < sum:\n max = sum\n sum += m\n if sum > max:\n s += str(sum) + \"\\n\"\n else:\n s += str(max) + \"\\n\"\nprint(s, end=\"\")\n", "fast_code_sha256": "aeb029ccb1764c1fd274dd9751a266b42b26f693bc3d8596ea07575f4d617a96", "fast_id": "p00022_aeb029ccb1764c1fd274dd9751a266b42b26f693bc3d8596ea07575f4d617a96", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\ns = \"\"\nfor i in sys.stdin:\n n = int(i)\n if n == 0:\n break\n max = -100000\n sum = int(input())\n for i in range(n - 1):\n m = int(input())\n if sum < 0 and sum < m:\n sum = m\n else:\n if m < 0 and max < sum:\n max = sum\n sum += m\n if sum > max:\n s += str(sum) + \"\\n\"\n else:\n s += str(max) + \"\\n\"\nprint(s, end=\"\")\n", "measured_fast_code_sha256": "aeb029ccb1764c1fd274dd9751a266b42b26f693bc3d8596ea07575f4d617a96", "measured_slow_code": "while True:\n n = int(eval(input()))\n if n == 0:\n break\n else:\n a = [int(eval(input())) for i in range(n)]\n for i in range(1, n):\n a[i] = max(a[i - 1] + a[i], a[i])\n print((max(a)))\n", "measured_slow_code_sha256": "0bfdaa35e05b154c6df76410062f0f983b54174945c77f6668b8a03d87066b50", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4.202003228749339, "pair_id": "python_v2_1fc6135d8ccb4cf44217e5bf", "per_case_slow_code_faster_fraction": 0.19, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p00022", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p00022_aeb029ccb1764c1fd274dd9751a266b42b26f693bc3d8596ea07575f4d617a96.jsonl.gz", "inputs": "reproduction/python/inputs/p00022.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p00022_0bfdaa35e05b154c6df76410062f0f983b54174945c77f6668b8a03d87066b50.jsonl.gz"}, "slow_code": "while True:\n n = int(eval(input()))\n if n == 0:\n break\n else:\n a = [int(eval(input())) for i in range(n)]\n for i in range(1, n):\n a[i] = max(a[i - 1] + a[i], a[i])\n print((max(a)))\n", "slow_code_sha256": "0bfdaa35e05b154c6df76410062f0f983b54174945c77f6668b8a03d87066b50", "slow_id": "p00022_0bfdaa35e05b154c6df76410062f0f983b54174945c77f6668b8a03d87066b50", "speedup": 2.4259667818564, "stratum": "2-4", "within_pair_jaccard": 0.5, "workload": {"case_count": 100, "description": "For each integer sequence, find the maximum sum of a nonempty contiguous subsequence. Each dataset supplies n followed by n values, one value per line; a final zero ends the input. Observed inputs: datasets=1..10 (median 1); n=1..5000; total_records=1..50000 (median 1000); a_i=-100000..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 319550, "median": 6388.0, "min": 9}, "input_format": ["n_1\na_1\n...\na_(n_1)\n[next datasets]\n0"], "input_format_status": "source_input_section", "input_lines": {"max": 50011, "median": 1002.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 50011, "median": 1002.0, "min": 3}}} -{"case_ids": ["p03693_case_000", "p03693_case_001", "p03693_case_002", "p03693_case_003", "p03693_case_004", "p03693_case_005", "p03693_case_006", "p03693_case_007", "p03693_case_008", "p03693_case_009", "p03693_case_010", "p03693_case_011", "p03693_case_012", "p03693_case_013", "p03693_case_014", "p03693_case_015", "p03693_case_016", "p03693_case_017", "p03693_case_018", "p03693_case_019", "p03693_case_020", "p03693_case_021", "p03693_case_022", "p03693_case_023", "p03693_case_024", "p03693_case_025", "p03693_case_026", "p03693_case_027", "p03693_case_028", "p03693_case_029", "p03693_case_030", "p03693_case_031", "p03693_case_032", "p03693_case_033", "p03693_case_034", "p03693_case_035", "p03693_case_036", "p03693_case_037", "p03693_case_038", "p03693_case_039", "p03693_case_040", "p03693_case_041", "p03693_case_042", "p03693_case_043", "p03693_case_044", "p03693_case_045", "p03693_case_046", "p03693_case_047", "p03693_case_048", "p03693_case_049", "p03693_case_050", "p03693_case_051", "p03693_case_052", "p03693_case_053", "p03693_case_054", "p03693_case_055", "p03693_case_056", "p03693_case_057", "p03693_case_058", "p03693_case_059", "p03693_case_060", "p03693_case_061", "p03693_case_062", "p03693_case_063", "p03693_case_064", "p03693_case_065", "p03693_case_066", "p03693_case_067", "p03693_case_068", "p03693_case_069", "p03693_case_070", "p03693_case_071", "p03693_case_072", "p03693_case_073", "p03693_case_074", "p03693_case_075", "p03693_case_076", "p03693_case_077", "p03693_case_078", "p03693_case_079", "p03693_case_080", "p03693_case_081", "p03693_case_082", "p03693_case_083", "p03693_case_084", "p03693_case_085", "p03693_case_086", "p03693_case_087", "p03693_case_088", "p03693_case_089", "p03693_case_090", "p03693_case_091", "p03693_case_092", "p03693_case_093", "p03693_case_094", "p03693_case_095", "p03693_case_096", "p03693_case_097", "p03693_case_098", "p03693_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "r, g, b = list(map(int, input().split()))\nprint((\"YES\" if (g * 10 + b) % 4 == 0 else \"NO\"))\n", "fast_code_sha256": "89a723c9e0a14a694c4ac8d157679314ac1ce818c0cbdc7e6f23dc9a1e3d72fb", "fast_id": "p03693_89a723c9e0a14a694c4ac8d157679314ac1ce818c0cbdc7e6f23dc9a1e3d72fb", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "r, g, b = list(map(int, input().split()))\nprint((\"YES\" if (g * 10 + b) % 4 == 0 else \"NO\"))\n", "measured_fast_code_sha256": "89a723c9e0a14a694c4ac8d157679314ac1ce818c0cbdc7e6f23dc9a1e3d72fb", "measured_slow_code": "import numpy as np\n\nr, g, b = list(map(int, input().split()))\nif (100 * r + 10 * g + b) % 4 == 0:\n print(\"YES\")\nelse:\n print(\"NO\")\n", "measured_slow_code_sha256": "a8d7956b0cbea162ca1db60ee520eccf4efc73cdccbed5370688af05e67aaca2", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1986.7745468434732, "pair_id": "python_v2_99147c60c6d1429ef1394fca", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03693", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03693_89a723c9e0a14a694c4ac8d157679314ac1ce818c0cbdc7e6f23dc9a1e3d72fb.jsonl.gz", "inputs": "reproduction/python/inputs/p03693.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03693_a8d7956b0cbea162ca1db60ee520eccf4efc73cdccbed5370688af05e67aaca2.jsonl.gz"}, "slow_code": "import numpy as np\n\nr, g, b = list(map(int, input().split()))\nif (100 * r + 10 * g + b) % 4 == 0:\n print(\"YES\")\nelse:\n print(\"NO\")\n", "slow_code_sha256": "a8d7956b0cbea162ca1db60ee520eccf4efc73cdccbed5370688af05e67aaca2", "slow_id": "p03693_a8d7956b0cbea162ca1db60ee520eccf4efc73cdccbed5370688af05e67aaca2", "speedup": 1984.5295697201238, "stratum": "8+", "within_pair_jaccard": 0.7619047619047619, "workload": {"case_count": 100, "description": "Read three nonzero decimal digits r,g,b and determine whether the three-digit integer formed in that order is divisible by 4. Observed inputs: r=1..9; g=1..9; b=1..9.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 6, "median": 6.0, "min": 6}, "input_format": ["r g b"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3, "median": 3.0, "min": 3}}} -{"case_ids": ["p03282_case_000", "p03282_case_001", "p03282_case_002", "p03282_case_003", "p03282_case_004", "p03282_case_005", "p03282_case_006", "p03282_case_007", "p03282_case_008", "p03282_case_009", "p03282_case_010", "p03282_case_011", "p03282_case_012", "p03282_case_013", "p03282_case_014", "p03282_case_015", "p03282_case_016", "p03282_case_017", "p03282_case_018", "p03282_case_019", "p03282_case_020", "p03282_case_021", "p03282_case_022", "p03282_case_023", "p03282_case_024", "p03282_case_025", "p03282_case_026", "p03282_case_027", "p03282_case_028", "p03282_case_029", "p03282_case_030", "p03282_case_031", "p03282_case_032", "p03282_case_033", "p03282_case_034", "p03282_case_035", "p03282_case_036", "p03282_case_037", "p03282_case_038", "p03282_case_039", "p03282_case_040", "p03282_case_041", "p03282_case_042", "p03282_case_043", "p03282_case_044", "p03282_case_045", "p03282_case_046", "p03282_case_047", "p03282_case_048", "p03282_case_049", "p03282_case_050", "p03282_case_051", "p03282_case_052", "p03282_case_053", "p03282_case_054", "p03282_case_055", "p03282_case_056", "p03282_case_057", "p03282_case_058", "p03282_case_059", "p03282_case_060", "p03282_case_061", "p03282_case_062", "p03282_case_063", "p03282_case_064", "p03282_case_065", "p03282_case_066", "p03282_case_067", "p03282_case_068", "p03282_case_069", "p03282_case_070", "p03282_case_071", "p03282_case_072", "p03282_case_073", "p03282_case_074", "p03282_case_075", "p03282_case_076", "p03282_case_077", "p03282_case_078", "p03282_case_079", "p03282_case_080", "p03282_case_081", "p03282_case_082", "p03282_case_083", "p03282_case_084", "p03282_case_085", "p03282_case_086", "p03282_case_087", "p03282_case_088", "p03282_case_089", "p03282_case_090", "p03282_case_091", "p03282_case_092", "p03282_case_093", "p03282_case_094", "p03282_case_095", "p03282_case_096", "p03282_case_097", "p03282_case_098", "p03282_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "print((input()[: int(eval(input()))].replace(\"1\", \"\")[:1] or \"1\"))\n", "fast_code_sha256": "d4905e9b61671370e5e84353722edf6439791a5a316b6df8cc32ad8ec3d7785e", "fast_id": "p03282_d4905e9b61671370e5e84353722edf6439791a5a316b6df8cc32ad8ec3d7785e", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "print((input()[: int(eval(input()))].replace(\"1\", \"\")[:1] or \"1\"))\n", "measured_fast_code_sha256": "d4905e9b61671370e5e84353722edf6439791a5a316b6df8cc32ad8ec3d7785e", "measured_slow_code": "import numpy as np\n\nS = np.array(list(map(str, input().rstrip())))\nK = int(eval(input()))\ncnt = 0\nans = 1\nfor i, s in enumerate(S):\n if s != \"1\":\n cnt = i + 1\n ans = s\n break\nif cnt > K:\n print((1))\nelse:\n print((int(ans)))\n", "measured_slow_code_sha256": "c6afbfabb4f57c620b796822aa793c63e616de41f9eb4e63aa7e8f88e45d1110", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2193.93539713659, "pair_id": "python_v2_3a620c2186767f7b36b1df05", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03282", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03282_d4905e9b61671370e5e84353722edf6439791a5a316b6df8cc32ad8ec3d7785e.jsonl.gz", "inputs": "reproduction/python/inputs/p03282.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03282_c6afbfabb4f57c620b796822aa793c63e616de41f9eb4e63aa7e8f88e45d1110.jsonl.gz"}, "slow_code": "import numpy as np\n\nS = np.array(list(map(str, input().rstrip())))\nK = int(eval(input()))\ncnt = 0\nans = 1\nfor i, s in enumerate(S):\n if s != \"1\":\n cnt = i + 1\n ans = s\n break\nif cnt > K:\n print((1))\nelse:\n print((int(ans)))\n", "slow_code_sha256": "c6afbfabb4f57c620b796822aa793c63e616de41f9eb4e63aa7e8f88e45d1110", "slow_id": "p03282_c6afbfabb4f57c620b796822aa793c63e616de41f9eb4e63aa7e8f88e45d1110", "speedup": 2184.8784467954997, "stratum": "8+", "within_pair_jaccard": 0.1724137931034483, "workload": {"case_count": 100, "description": "On each day, simultaneously replace digit d by d copies of itself, for digits 1..9. Find the 1-based K-th character after 5*10^15 days starting from S; the expanded string is guaranteed long enough. Observed inputs: S_length=1..100 (median 100); K=1..1000000000000000000; digit=1..9.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 121, "median": 103.0, "min": 4}, "input_format": ["S\nK"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p03309_case_000", "p03309_case_001", "p03309_case_002", "p03309_case_003", "p03309_case_004", "p03309_case_005", "p03309_case_006", "p03309_case_007", "p03309_case_008", "p03309_case_009", "p03309_case_010", "p03309_case_011", "p03309_case_012", "p03309_case_013", "p03309_case_014", "p03309_case_015", "p03309_case_016", "p03309_case_017", "p03309_case_018", "p03309_case_019", "p03309_case_020", "p03309_case_021", "p03309_case_022", "p03309_case_023", "p03309_case_024", "p03309_case_025", "p03309_case_026", "p03309_case_027", "p03309_case_028", "p03309_case_029", "p03309_case_030", "p03309_case_031", "p03309_case_032", "p03309_case_033", "p03309_case_034", "p03309_case_035", "p03309_case_036", "p03309_case_037", "p03309_case_038", "p03309_case_039", "p03309_case_040", "p03309_case_041", "p03309_case_042", "p03309_case_043", "p03309_case_044", "p03309_case_045", "p03309_case_046", "p03309_case_047", "p03309_case_048", "p03309_case_049", "p03309_case_050", "p03309_case_051", "p03309_case_052", "p03309_case_053", "p03309_case_054", "p03309_case_055", "p03309_case_056", "p03309_case_057", "p03309_case_058", "p03309_case_059", "p03309_case_060", "p03309_case_061", "p03309_case_062", "p03309_case_063", "p03309_case_064", "p03309_case_065", "p03309_case_066", "p03309_case_067", "p03309_case_068", "p03309_case_069", "p03309_case_070", "p03309_case_071", "p03309_case_072", "p03309_case_073", "p03309_case_074", "p03309_case_075", "p03309_case_076", "p03309_case_077", "p03309_case_078", "p03309_case_079", "p03309_case_080", "p03309_case_081", "p03309_case_082", "p03309_case_083", "p03309_case_084", "p03309_case_085", "p03309_case_086", "p03309_case_087", "p03309_case_088", "p03309_case_089", "p03309_case_090", "p03309_case_091", "p03309_case_092", "p03309_case_093", "p03309_case_094", "p03309_case_095", "p03309_case_096", "p03309_case_097", "p03309_case_098", "p03309_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\nA = list(map(int, input().split()))\nA = [A[i] - (i + 1) for i in range(n)]\nA.sort()\nif n == 1:\n print((0))\n exit()\nans = 10**100\nfor i in [n // 2 - 1, n // 2]:\n ans = min(ans, sum([abs(A[j] - A[i]) for j in range(n)]))\nprint(ans)\n", "fast_code_sha256": "c362ad37028fc3b8fa56ecfd76632913fe940ee198ee9f64806a141185618805", "fast_id": "p03309_ee68236b8904bb12166a28b46506ba74d64d6f03534469cbf2bb47d3bf8a48d8", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "# -*- coding: utf-8 -*-\nn = int(eval(input()))\nA = list(map(int, input().split()))\nA = [A[i] - (i + 1) for i in range(n)]\nA.sort()\nif n == 1:\n print((0))\n exit()\nans = 10**100\nfor i in [n // 2 - 1, n // 2]:\n ans = min(ans, sum([abs(A[j] - A[i]) for j in range(n)]))\nprint(ans)\n", "measured_fast_code_sha256": "ee68236b8904bb12166a28b46506ba74d64d6f03534469cbf2bb47d3bf8a48d8", "measured_slow_code": "# -*- coding: utf-8 -*-\n# AtCoder Beginner Contest\nif __name__ == \"__main__\":\n from statistics import median\n\n n = int(eval(input()))\n a = list(map(int, input().split()))\n total = 0\n # See:\n # https://www.youtube.com/watch?v=UX4AuiCVtN4\n # https://beta.atcoder.jp/contests/abc102/submissions/2768315\n mod_a = sorted([ai - i for i, ai in enumerate(a, 1)])\n b = median(mod_a)\n for i in range(n):\n total += abs(mod_a[i] - b)\n print((int(total)))\n", "measured_slow_code_sha256": "cc6340aab617e7100bd4d51ff3921118d5d3dad1bda63cfcf3f2026a849def46", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.3943225687601197, "pair_id": "python_v2_d43440849e8ad95ebc8f923d", "per_case_slow_code_faster_fraction": 0.42, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03309", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03309_ee68236b8904bb12166a28b46506ba74d64d6f03534469cbf2bb47d3bf8a48d8.jsonl.gz", "inputs": "reproduction/python/inputs/p03309.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03309_cc6340aab617e7100bd4d51ff3921118d5d3dad1bda63cfcf3f2026a849def46.jsonl.gz"}, "slow_code": "if __name__ == \"__main__\":\n from statistics import median\n\n n = int(eval(input()))\n a = list(map(int, input().split()))\n total = 0\n\n mod_a = sorted([ai - i for i, ai in enumerate(a, 1)])\n b = median(mod_a)\n for i in range(n):\n total += abs(mod_a[i] - b)\n print((int(total)))\n", "slow_code_sha256": "364f3596fd84d0acd37a6dd5d8da1a36ebb61efbb957346157757658db88473b", "slow_id": "p03309_cc6340aab617e7100bd4d51ff3921118d5d3dad1bda63cfcf3f2026a849def46", "speedup": 3.576914646352117, "stratum": "2-4", "within_pair_jaccard": 0.42105263157894735, "workload": {"case_count": 100, "description": "Choose any integer b to minimize sum_i |A_i-(b+i)| for a sequence with positions indexed from 1 through N. Observed inputs: N=1..200000 (median 1000); A_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 2000226, "median": 9899.5, "min": 4}, "input_format": ["N\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200001, "median": 1001.0, "min": 2}}} -{"case_ids": ["p03331_case_000", "p03331_case_001", "p03331_case_002", "p03331_case_003", "p03331_case_004", "p03331_case_005", "p03331_case_006", "p03331_case_007", "p03331_case_008", "p03331_case_009", "p03331_case_010", "p03331_case_011", "p03331_case_012", "p03331_case_013", "p03331_case_014", "p03331_case_015", "p03331_case_016", "p03331_case_017", "p03331_case_018", "p03331_case_019", "p03331_case_020", "p03331_case_021", "p03331_case_022", "p03331_case_023", "p03331_case_024", "p03331_case_025", "p03331_case_026", "p03331_case_027", "p03331_case_028", "p03331_case_029", "p03331_case_030", "p03331_case_031", "p03331_case_032", "p03331_case_033", "p03331_case_034", "p03331_case_035", "p03331_case_036", "p03331_case_037", "p03331_case_038", "p03331_case_039", "p03331_case_040", "p03331_case_041", "p03331_case_042", "p03331_case_043", "p03331_case_044", "p03331_case_045", "p03331_case_046", "p03331_case_047", "p03331_case_048", "p03331_case_049", "p03331_case_050", "p03331_case_051", "p03331_case_052", "p03331_case_053", "p03331_case_054", "p03331_case_055", "p03331_case_056", "p03331_case_057", "p03331_case_058", "p03331_case_059", "p03331_case_060", "p03331_case_061", "p03331_case_062", "p03331_case_063", "p03331_case_064", "p03331_case_065", "p03331_case_066", "p03331_case_067", "p03331_case_068", "p03331_case_069", "p03331_case_070", "p03331_case_071", "p03331_case_072", "p03331_case_073", "p03331_case_074", "p03331_case_075", "p03331_case_076", "p03331_case_077", "p03331_case_078", "p03331_case_079", "p03331_case_080", "p03331_case_081", "p03331_case_082", "p03331_case_083", "p03331_case_084", "p03331_case_085", "p03331_case_086", "p03331_case_087", "p03331_case_088", "p03331_case_089", "p03331_case_090", "p03331_case_091", "p03331_case_092", "p03331_case_093", "p03331_case_094", "p03331_case_095", "p03331_case_096", "p03331_case_097", "p03331_case_098", "p03331_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import math\n\nn = int(eval(input()))\nm = math.log10(n)\nif int(m) == m:\n print((10))\n exit()\nans = sum(map(int, list(str(n))))\nprint(ans)\n", "fast_code_sha256": "284a8c35e2eafc9aefdfd8aea3724dceaddb6694fb0e85ae17f2e4abdc89ffd1", "fast_id": "p03331_8c8462ab78a9cd9c5b23cab4ea1172c4e2ca8e2ac0f69de77b0da618078d98d4", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "#!/usr/bin/env python\nimport math\n\nn = int(eval(input()))\nm = math.log10(n)\nif int(m) == m:\n print((10))\n exit()\nans = sum(map(int, list(str(n))))\nprint(ans)\n", "measured_fast_code_sha256": "8c8462ab78a9cd9c5b23cab4ea1172c4e2ca8e2ac0f69de77b0da618078d98d4", "measured_slow_code": "N = int(eval(input()))\n\n\ndef sumof(N):\n sum = 0\n while N > 0:\n sum += N % 10\n N //= 10\n return sum\n\n\nminsum = 9 * 10\nfor i in range(1, N // 2 + 1):\n minsum = min(minsum, sumof(i) + sumof(N - i))\nprint(minsum)\n", "measured_slow_code_sha256": "b6670f56c83800cdd6e6a56684f3be34fb1da4a6429d8c0f65a35c79c406bdf1", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1048.81650576239, "pair_id": "python_v2_01ba697f145a234e618d9c3e", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03331", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03331_8c8462ab78a9cd9c5b23cab4ea1172c4e2ca8e2ac0f69de77b0da618078d98d4.jsonl.gz", "inputs": "reproduction/python/inputs/p03331.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03331_b6670f56c83800cdd6e6a56684f3be34fb1da4a6429d8c0f65a35c79c406bdf1.jsonl.gz"}, "slow_code": "N = int(eval(input()))\n\n\ndef sumof(N):\n sum = 0\n while N > 0:\n sum += N % 10\n N //= 10\n return sum\n\n\nminsum = 9 * 10\nfor i in range(1, N // 2 + 1):\n minsum = min(minsum, sumof(i) + sumof(N - i))\nprint(minsum)\n", "slow_code_sha256": "b6670f56c83800cdd6e6a56684f3be34fb1da4a6429d8c0f65a35c79c406bdf1", "slow_id": "p03331_b6670f56c83800cdd6e6a56684f3be34fb1da4a6429d8c0f65a35c79c406bdf1", "speedup": 346.93838956251443, "stratum": "8+", "within_pair_jaccard": 0.1935483870967742, "workload": {"case_count": 100, "description": "Split N into two positive integers A+B=N, minimizing the sum of their decimal digit sums. Observed inputs: N=2..100000 (median 58160.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 7, "median": 6.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p02989_case_000", "p02989_case_001", "p02989_case_002", "p02989_case_003", "p02989_case_004", "p02989_case_005", "p02989_case_006", "p02989_case_007", "p02989_case_008", "p02989_case_009", "p02989_case_010", "p02989_case_011", "p02989_case_012", "p02989_case_013", "p02989_case_014", "p02989_case_015", "p02989_case_016", "p02989_case_017", "p02989_case_018", "p02989_case_019", "p02989_case_020", "p02989_case_021", "p02989_case_022", "p02989_case_023", "p02989_case_024", "p02989_case_025", "p02989_case_026", "p02989_case_027", "p02989_case_028", "p02989_case_029", "p02989_case_030", "p02989_case_031", "p02989_case_032", "p02989_case_033", "p02989_case_034", "p02989_case_035", "p02989_case_036", "p02989_case_037", "p02989_case_038", "p02989_case_039", "p02989_case_040", "p02989_case_041", "p02989_case_042", "p02989_case_043", "p02989_case_044", "p02989_case_045", "p02989_case_046", "p02989_case_047", "p02989_case_048", "p02989_case_049", "p02989_case_050", "p02989_case_051", "p02989_case_052", "p02989_case_053", "p02989_case_054", "p02989_case_055", "p02989_case_056", "p02989_case_057", "p02989_case_058", "p02989_case_059", "p02989_case_060", "p02989_case_061", "p02989_case_062", "p02989_case_063", "p02989_case_064", "p02989_case_065", "p02989_case_066", "p02989_case_067", "p02989_case_068", "p02989_case_069", "p02989_case_070", "p02989_case_071", "p02989_case_072", "p02989_case_073", "p02989_case_074", "p02989_case_075", "p02989_case_076", "p02989_case_077", "p02989_case_078", "p02989_case_079", "p02989_case_080", "p02989_case_081", "p02989_case_082", "p02989_case_083", "p02989_case_084", "p02989_case_085", "p02989_case_086", "p02989_case_087", "p02989_case_088", "p02989_case_089", "p02989_case_090", "p02989_case_091", "p02989_case_092", "p02989_case_093", "p02989_case_094", "p02989_case_095", "p02989_case_096", "p02989_case_097", "p02989_case_098", "p02989_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\n\ndi = []\nfor i in map(int, input().split()):\n di.append(i)\ndi.sort()\nn1 = int(n / 2)\nm = di[n1] - di[n1 - 1]\nprint(m)\n", "fast_code_sha256": "d18285c05de08731ba250af2afcd3a324cfda4a48a15f0191ae3f6fd94eddb4f", "fast_id": "p02989_e8c114f6f462185d88e5d977f36e01cc5417d9f65f39cba2b1740a2fe466adcb", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\n# print(n)\ndi = []\nfor i in map(int, input().split()):\n di.append(i)\ndi.sort()\nn1 = int(n / 2)\nm = di[n1] - di[n1 - 1]\nprint(m)\n", "measured_fast_code_sha256": "e8c114f6f462185d88e5d977f36e01cc5417d9f65f39cba2b1740a2fe466adcb", "measured_slow_code": "from bisect import bisect_left\n\nn = int(eval(input()))\nd = list(map(int, input().split()))\nd = sorted(d)\nans = 0\nfor i in range(1, 10**5 + 1):\n p = bisect_left(d, i)\n ans += 1 if p == (n - p) else 0\nprint(ans)\n", "measured_slow_code_sha256": "bee7326f5d65117847c8daffc9f8e9e9508be71f70ad2064bdf47643f0632c7e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 620.2489970934375, "pair_id": "python_v2_58c5ebea7c7d5f5fb04500f9", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02989", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02989_e8c114f6f462185d88e5d977f36e01cc5417d9f65f39cba2b1740a2fe466adcb.jsonl.gz", "inputs": "reproduction/python/inputs/p02989.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02989_bee7326f5d65117847c8daffc9f8e9e9508be71f70ad2064bdf47643f0632c7e.jsonl.gz"}, "slow_code": "from bisect import bisect_left\n\nn = int(eval(input()))\nd = list(map(int, input().split()))\nd = sorted(d)\nans = 0\nfor i in range(1, 10**5 + 1):\n p = bisect_left(d, i)\n ans += 1 if p == (n - p) else 0\nprint(ans)\n", "slow_code_sha256": "bee7326f5d65117847c8daffc9f8e9e9508be71f70ad2064bdf47643f0632c7e", "slow_id": "p02989_bee7326f5d65117847c8daffc9f8e9e9508be71f70ad2064bdf47643f0632c7e", "speedup": 165.06721478353904, "stratum": "8+", "within_pair_jaccard": 0.34375, "workload": {"case_count": 100, "description": "For an even number N of difficulties d_i, count integer thresholds K splitting the entries equally into values below K and values at least K. Observed inputs: N=2..100000 (median 100); d_i=1..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 600025, "median": 596.0, "min": 6}, "input_format": ["N\nd_1 ... d_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100001, "median": 101.0, "min": 3}}} -{"case_ids": ["p02783_case_000", "p02783_case_001", "p02783_case_002", "p02783_case_003", "p02783_case_004", "p02783_case_005", "p02783_case_006", "p02783_case_007", "p02783_case_008", "p02783_case_009", "p02783_case_010", "p02783_case_011", "p02783_case_012", "p02783_case_013", "p02783_case_014", "p02783_case_015", "p02783_case_016", "p02783_case_017", "p02783_case_018", "p02783_case_019", "p02783_case_020", "p02783_case_021", "p02783_case_022", "p02783_case_023", "p02783_case_024", "p02783_case_025", "p02783_case_026", "p02783_case_027", "p02783_case_028", "p02783_case_029", "p02783_case_030", "p02783_case_031", "p02783_case_032", "p02783_case_033", "p02783_case_034", "p02783_case_035", "p02783_case_036", "p02783_case_037", "p02783_case_038", "p02783_case_039", "p02783_case_040", "p02783_case_041", "p02783_case_042", "p02783_case_043", "p02783_case_044", "p02783_case_045", "p02783_case_046", "p02783_case_047", "p02783_case_048", "p02783_case_049", "p02783_case_050", "p02783_case_051", "p02783_case_052", "p02783_case_053", "p02783_case_054", "p02783_case_055", "p02783_case_056", "p02783_case_057", "p02783_case_058", "p02783_case_059", "p02783_case_060", "p02783_case_061", "p02783_case_062", "p02783_case_063", "p02783_case_064", "p02783_case_065", "p02783_case_066", "p02783_case_067", "p02783_case_068", "p02783_case_069", "p02783_case_070", "p02783_case_071", "p02783_case_072", "p02783_case_073", "p02783_case_074", "p02783_case_075", "p02783_case_076", "p02783_case_077", "p02783_case_078", "p02783_case_079", "p02783_case_080", "p02783_case_081", "p02783_case_082", "p02783_case_083", "p02783_case_084", "p02783_case_085", "p02783_case_086", "p02783_case_087", "p02783_case_088", "p02783_case_089", "p02783_case_090", "p02783_case_091", "p02783_case_092", "p02783_case_093", "p02783_case_094", "p02783_case_095", "p02783_case_096", "p02783_case_097", "p02783_case_098", "p02783_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "h, a = list(map(int, input().split()))\ni = 0\nwhile i < 10**4:\n i += 1\n h = h - a\n if h <= 0:\n print(i)\n break\n", "fast_code_sha256": "7e06929601a1851966d2b62fd0a3ad5e22204fad82ba6574b1c05ce567f7fba9", "fast_id": "p02783_7e06929601a1851966d2b62fd0a3ad5e22204fad82ba6574b1c05ce567f7fba9", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "h, a = list(map(int, input().split()))\ni = 0\nwhile i < 10**4:\n i += 1\n h = h - a\n if h <= 0:\n print(i)\n break\n", "measured_fast_code_sha256": "7e06929601a1851966d2b62fd0a3ad5e22204fad82ba6574b1c05ce567f7fba9", "measured_slow_code": "import itertools\nimport math\nimport fractions\nimport functools\n\nh, a = list(map(int, input().split()))\nprint((math.ceil(h / a)))\n", "measured_slow_code_sha256": "184009488c3f9f1105e8c0ddedd3260f6b8f0dac17d692456499911136230497", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 34.326437928081035, "pair_id": "python_v2_76d048e8ad6e74fe43bcc2b6", "per_case_slow_code_faster_fraction": 0.01, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02783", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02783_7e06929601a1851966d2b62fd0a3ad5e22204fad82ba6574b1c05ce567f7fba9.jsonl.gz", "inputs": "reproduction/python/inputs/p02783.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02783_184009488c3f9f1105e8c0ddedd3260f6b8f0dac17d692456499911136230497.jsonl.gz"}, "slow_code": "import itertools\nimport math\nimport fractions\nimport functools\n\nh, a = list(map(int, input().split()))\nprint((math.ceil(h / a)))\n", "slow_code_sha256": "184009488c3f9f1105e8c0ddedd3260f6b8f0dac17d692456499911136230497", "slow_id": "p02783_184009488c3f9f1105e8c0ddedd3260f6b8f0dac17d692456499911136230497", "speedup": 32.430847025698675, "stratum": "8+", "within_pair_jaccard": 0.36363636363636365, "workload": {"case_count": 100, "description": "A monster starts with health H; each attack reduces it by A. Find the number of attacks required to reduce health to zero or below. Observed inputs: H=1..10000 (median 5766.5); A=1..10000 (median 4105.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 12, "median": 10.0, "min": 8}, "input_format": ["H A"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p03566_case_000", "p03566_case_001", "p03566_case_002", "p03566_case_003", "p03566_case_004", "p03566_case_005", "p03566_case_006", "p03566_case_007", "p03566_case_008", "p03566_case_009", "p03566_case_010", "p03566_case_011", "p03566_case_012", "p03566_case_013", "p03566_case_014", "p03566_case_015", "p03566_case_016", "p03566_case_017", "p03566_case_018", "p03566_case_019", "p03566_case_020", "p03566_case_021", "p03566_case_022", "p03566_case_023", "p03566_case_024", "p03566_case_025", "p03566_case_026", "p03566_case_027", "p03566_case_028", "p03566_case_029", "p03566_case_030", "p03566_case_031", "p03566_case_032", "p03566_case_033", "p03566_case_034", "p03566_case_035", "p03566_case_036", "p03566_case_037", "p03566_case_038", "p03566_case_039", "p03566_case_040", "p03566_case_041", "p03566_case_042", "p03566_case_043", "p03566_case_044", "p03566_case_045", "p03566_case_046", "p03566_case_047", "p03566_case_048", "p03566_case_049", "p03566_case_050", "p03566_case_051", "p03566_case_052", "p03566_case_053", "p03566_case_054", "p03566_case_055", "p03566_case_056", "p03566_case_057", "p03566_case_058", "p03566_case_059", "p03566_case_060", "p03566_case_061", "p03566_case_062", "p03566_case_063", "p03566_case_064", "p03566_case_065", "p03566_case_066", "p03566_case_067", "p03566_case_068", "p03566_case_069", "p03566_case_070", "p03566_case_071", "p03566_case_072", "p03566_case_073", "p03566_case_074", "p03566_case_075", "p03566_case_076", "p03566_case_077", "p03566_case_078", "p03566_case_079", "p03566_case_080", "p03566_case_081", "p03566_case_082", "p03566_case_083", "p03566_case_084", "p03566_case_085", "p03566_case_086", "p03566_case_087", "p03566_case_088", "p03566_case_089", "p03566_case_090", "p03566_case_091", "p03566_case_092", "p03566_case_093", "p03566_case_094", "p03566_case_095", "p03566_case_096", "p03566_case_097", "p03566_case_098", "p03566_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n, *L = list(map(int, open(0).read().split()))\nT, V = L[:n], L[n:]\ns = sum(T)\na = [0]\nfor t, v1, v2 in zip(T, V, V[1:] + [0]):\n a += [v1] * (2 * t - 1) + [min(v1, v2)]\nfor i in range(2 * s):\n a[i + 1] = min(a[i + 1], a[i] + 0.5)\nfor i in range(2 * s, 0, -1):\n a[i - 1] = min(a[i - 1], a[i] + 0.5)\nprint((sum(a) / 2))\n", "fast_code_sha256": "ab815b85a4537e81e1348c2b4ba89888e4f3820924ed2588c7c1926e4e867484", "fast_id": "p03566_ab815b85a4537e81e1348c2b4ba89888e4f3820924ed2588c7c1926e4e867484", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n, *L = list(map(int, open(0).read().split()))\nT, V = L[:n], L[n:]\ns = sum(T)\na = [0]\nfor t, v1, v2 in zip(T, V, V[1:] + [0]):\n a += [v1] * (2 * t - 1) + [min(v1, v2)]\nfor i in range(2 * s):\n a[i + 1] = min(a[i + 1], a[i] + 0.5)\nfor i in range(2 * s, 0, -1):\n a[i - 1] = min(a[i - 1], a[i] + 0.5)\nprint((sum(a) / 2))\n", "measured_fast_code_sha256": "ab815b85a4537e81e1348c2b4ba89888e4f3820924ed2588c7c1926e4e867484", "measured_slow_code": "N = int(eval(input()))\nt = list(map(int, input().split()))\nv = list(map(int, input().split()))\n# if N == 1: #最初の1区間だけ\n# if t[0] % 2 == 1: #奇数秒\n# if t[0]/2 < v[0]:\n# print ((t[0]/2) ** 2)\n# exit()\n# print ('t', t)\n# print ('v', v)\nN_INF = -(10**15)\nDP = [\n [N_INF] * (102) for _ in range(100 * 200 + 2)\n] # DP[T][V] := 時刻Tに速度Dで走っているときの時刻Tまでの走行距離の最大値\nDP[0][0] = 0\n# print (DP[0][0:5])\ntime = 1\nfor i in range(N):\n # print (i)\n # print ('time', time)\n for j in range(time, time + t[i]): # 時刻\n # print (j, end = ' ')\n for k in range(0, v[i] + 1): # 速度\n if k == 0: # 速度0-->加速して速度0になることはない\n # print (j, k)\n # print (max(DP[j - 1][0], DP[j - 1][1] + 1/2))\n DP[j][k] = max(DP[j - 1][0] + 0.25, DP[j - 1][1] + 1 / 2)\n elif k != v[i]: # 加速してくるときも減速してくることもある\n DP[j][k] = max(\n DP[j - 1][k - 1] + k - 1 / 2,\n DP[j - 1][k] + k + 0.25,\n DP[j - 1][k + 1] + k + 1 / 2,\n )\n else: # (k == v[i] and j != time) #減速してくることはない\n DP[j][k] = max(DP[j - 1][k - 1] + k - 1 / 2, DP[j - 1][k] + k)\n # print (DP[j][0:5])\n time += t[i]\n# print (time)\nprint((DP[time - 1][0]))\n# print ('T = 6, V = 6', DP[6][6])\n# print ('T = 12, V = 2', DP[12][2])\n# print ('T = 12, V = 3', DP[12][3])\n# print ('T = 13, V = 2', DP[13][2])\n# print ('T = 26 V = 2', DP[26][2])\n# print ('T = 27 V = 2', DP[27][2])\n", "measured_slow_code_sha256": "e292bb8e38a60f55175b6de37be1a88f4e5bd92a06a086d8bcc3fbb7a4e57ba7", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 32.135750546067314, "pair_id": "python_v2_5932ef6f8c5f666d3f88d986", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03566", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03566_ab815b85a4537e81e1348c2b4ba89888e4f3820924ed2588c7c1926e4e867484.jsonl.gz", "inputs": "reproduction/python/inputs/p03566.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03566_e292bb8e38a60f55175b6de37be1a88f4e5bd92a06a086d8bcc3fbb7a4e57ba7.jsonl.gz"}, "slow_code": "N = int(eval(input()))\nt = list(map(int, input().split()))\nv = list(map(int, input().split()))\n\n\nN_INF = -(10**15)\nDP = [[N_INF] * (102) for _ in range(100 * 200 + 2)]\nDP[0][0] = 0\n\ntime = 1\nfor i in range(N):\n\n for j in range(time, time + t[i]):\n\n for k in range(0, v[i] + 1):\n if k == 0:\n\n DP[j][k] = max(DP[j - 1][0] + 0.25, DP[j - 1][1] + 1 / 2)\n elif k != v[i]:\n DP[j][k] = max(\n DP[j - 1][k - 1] + k - 1 / 2,\n DP[j - 1][k] + k + 0.25,\n DP[j - 1][k + 1] + k + 1 / 2,\n )\n else:\n DP[j][k] = max(DP[j - 1][k - 1] + k - 1 / 2, DP[j - 1][k] + k)\n\n time += t[i]\n\nprint((DP[time - 1][0]))\n", "slow_code_sha256": "33ceef3163e2732e94f8f8c1e32def7f26d8b82c4e0fd1b51892314740a603b1", "slow_id": "p03566_e292bb8e38a60f55175b6de37be1a88f4e5bd92a06a086d8bcc3fbb7a4e57ba7", "speedup": 38.0629179796697, "stratum": "8+", "within_pair_jaccard": 0.2765957446808511, "workload": {"case_count": 100, "description": "Maximize distance traveled over N consecutive time segments of durations t_i with speed caps v_i. Speed is nonnegative, starts and ends at zero, and acceleration stays between -1 and 1 distance-units per second squared. Observed inputs: N=1..100 (median 60); t_i=1..200; v_i=1..100; total_duration=1..20000 (median 4520.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 804, "median": 390.5, "min": 6}, "input_format": ["N\nt_1 ... t_N\nv_1 ... v_N"], "input_format_status": "source_input_section", "input_lines": {"max": 3, "median": 3.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 201, "median": 121.0, "min": 3}}} -{"case_ids": ["p02570_case_000", "p02570_case_001", "p02570_case_002", "p02570_case_003", "p02570_case_004", "p02570_case_005", "p02570_case_006", "p02570_case_007", "p02570_case_008", "p02570_case_009", "p02570_case_010", "p02570_case_011", "p02570_case_012", "p02570_case_013", "p02570_case_014", "p02570_case_015", "p02570_case_016", "p02570_case_017", "p02570_case_018", "p02570_case_019", "p02570_case_020", "p02570_case_021", "p02570_case_022", "p02570_case_023", "p02570_case_024", "p02570_case_025", "p02570_case_026", "p02570_case_027", "p02570_case_028", "p02570_case_029", "p02570_case_030", "p02570_case_031", "p02570_case_032", "p02570_case_033", "p02570_case_034", "p02570_case_035", "p02570_case_036", "p02570_case_037", "p02570_case_038", "p02570_case_039", "p02570_case_040", "p02570_case_041", "p02570_case_042", "p02570_case_043", "p02570_case_044", "p02570_case_045", "p02570_case_046", "p02570_case_047", "p02570_case_048", "p02570_case_049", "p02570_case_050", "p02570_case_051", "p02570_case_052", "p02570_case_053", "p02570_case_054", "p02570_case_055", "p02570_case_056", "p02570_case_057", "p02570_case_058", "p02570_case_059", "p02570_case_060", "p02570_case_061", "p02570_case_062", "p02570_case_063", "p02570_case_064", "p02570_case_065", "p02570_case_066", "p02570_case_067", "p02570_case_068", "p02570_case_069", "p02570_case_070", "p02570_case_071", "p02570_case_072", "p02570_case_073", "p02570_case_074", "p02570_case_075", "p02570_case_076", "p02570_case_077", "p02570_case_078", "p02570_case_079", "p02570_case_080", "p02570_case_081", "p02570_case_082", "p02570_case_083", "p02570_case_084", "p02570_case_085", "p02570_case_086", "p02570_case_087", "p02570_case_088", "p02570_case_089", "p02570_case_090", "p02570_case_091", "p02570_case_092", "p02570_case_093", "p02570_case_094", "p02570_case_095", "p02570_case_096", "p02570_case_097", "p02570_case_098", "p02570_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "executable_AST_equal_except_explicit_explanatory_string_removal_and_all_frozen_inputs_checker_pass", "fast_code": "X = input().split()\nD = int(X[0])\nT = int(X[1])\nS = int(X[2])\ntime = D / S\nif time <= T:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "fast_code_sha256": "8facf72be6f94eaaca96212696f14fa1652f6a2dfc73c4dc2f3b7a218d94be37", "fast_id": "p02570_8facf72be6f94eaaca96212696f14fa1652f6a2dfc73c4dc2f3b7a218d94be37", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "X = input().split()\nD = int(X[0])\nT = int(X[1])\nS = int(X[2])\ntime = D / S\nif time <= T:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "measured_fast_code_sha256": "8facf72be6f94eaaca96212696f14fa1652f6a2dfc73c4dc2f3b7a218d94be37", "measured_slow_code": "def LI():\n return list(map(int, input().split()))\n\n\ndef II():\n return int(input())\n\n\ndef yes():\n return print(\"Yes\")\n\n\ndef no():\n return print(\"No\")\n\n\nINF = float(\"inf\")\nfrom collections import deque, defaultdict, Counter\nfrom heapq import heappop, heappush\nfrom itertools import product, combinations\nfrom functools import reduce, lru_cache\nfrom math import pi, gcd\nfrom decimal import Decimal\n\n\nclass Combination:\n \"\"\"\n O(n)の前計算を1回行うことで,O(1)でnCr mod mを求められる\n n_max = 10**6のとき前処理は約950ms (PyPyなら約340ms, 10**7で約1800ms)\n 使用例:\n comb = Combination(1000000)\n print(comb(5, 3)) # 10\n \"\"\"\n\n def __init__(self, n_max, mod=10**9 + 7):\n self.mod = mod\n self.modinv = self.make_modinv_list(n_max)\n self.fac, self.facinv = self.make_factorial_list(n_max)\n\n def __call__(self, n, r):\n return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n - r] % self.mod\n\n def make_factorial_list(self, n):\n # 階乗のリストと階乗のmod逆元のリストを返す O(n)\n # self.make_modinv_list()が先に実行されている必要がある\n fac = [1]\n facinv = [1]\n for i in range(1, n + 1):\n fac.append(fac[i - 1] * i % self.mod)\n facinv.append(facinv[i - 1] * self.modinv[i] % self.mod)\n return fac, facinv\n\n def make_modinv_list(self, n):\n # 0からnまでのmod逆元のリストを返す O(n)\n modinv = [0] * (n + 1)\n modinv[1] = 1\n for i in range(2, n + 1):\n modinv[i] = self.mod - self.mod // i * modinv[self.mod % i] % self.mod\n return modinv\n\n\nclass Unionfind:\n def __init__(self, N):\n self.p = list(range(N))\n self.rank = [0] * N\n self.size = [1] * N\n\n def root(self, x):\n if self.p[x] != x:\n self.p[x] = self.root(self.p[x])\n return self.p[x]\n\n def same(self, x, y):\n return self.root(x) == self.root(y)\n\n def unite(self, x, y):\n u = self.root(x)\n v = self.root(y)\n if u == v:\n return\n if self.rank[u] < self.rank[v]:\n self.p[u] = v\n self.size[v] += self.size[u]\n self.size[u] = 0\n else:\n self.p[v] = u\n self.size[u] += self.size[v]\n self.size[v] = 0\n if self.rank[u] == self.rank[v]:\n self.rank[u] += 1\n\n def count(self, x):\n return self.size[self.root(x)]\n\n\nd, t, s = LI()\nif d <= t * s:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "measured_slow_code_sha256": "c18a3a7e4014bde24e915dc4b9c7a40ca0c367289dfe9b646d5af979ad55733c", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 23.4915201118448, "pair_id": "python_v2_47a5e78c1676230abc980e92", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02570", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02570_8facf72be6f94eaaca96212696f14fa1652f6a2dfc73c4dc2f3b7a218d94be37.jsonl.gz", "inputs": "reproduction/python/inputs/p02570.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02570_c18a3a7e4014bde24e915dc4b9c7a40ca0c367289dfe9b646d5af979ad55733c.jsonl.gz"}, "slow_code": "def LI():\n return list(map(int, input().split()))\n\n\ndef II():\n return int(input())\n\n\ndef yes():\n return print(\"Yes\")\n\n\ndef no():\n return print(\"No\")\n\n\nINF = float(\"inf\")\nfrom collections import deque, defaultdict, Counter\nfrom heapq import heappop, heappush\nfrom itertools import product, combinations\nfrom functools import reduce, lru_cache\nfrom math import pi, gcd\nfrom decimal import Decimal\n\n\nclass Combination:\n\n def __init__(self, n_max, mod=10**9 + 7):\n self.mod = mod\n self.modinv = self.make_modinv_list(n_max)\n self.fac, self.facinv = self.make_factorial_list(n_max)\n\n def __call__(self, n, r):\n return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n - r] % self.mod\n\n def make_factorial_list(self, n):\n\n fac = [1]\n facinv = [1]\n for i in range(1, n + 1):\n fac.append(fac[i - 1] * i % self.mod)\n facinv.append(facinv[i - 1] * self.modinv[i] % self.mod)\n return fac, facinv\n\n def make_modinv_list(self, n):\n\n modinv = [0] * (n + 1)\n modinv[1] = 1\n for i in range(2, n + 1):\n modinv[i] = self.mod - self.mod // i * modinv[self.mod % i] % self.mod\n return modinv\n\n\nclass Unionfind:\n def __init__(self, N):\n self.p = list(range(N))\n self.rank = [0] * N\n self.size = [1] * N\n\n def root(self, x):\n if self.p[x] != x:\n self.p[x] = self.root(self.p[x])\n return self.p[x]\n\n def same(self, x, y):\n return self.root(x) == self.root(y)\n\n def unite(self, x, y):\n u = self.root(x)\n v = self.root(y)\n if u == v:\n return\n if self.rank[u] < self.rank[v]:\n self.p[u] = v\n self.size[v] += self.size[u]\n self.size[u] = 0\n else:\n self.p[v] = u\n self.size[u] += self.size[v]\n self.size[v] = 0\n if self.rank[u] == self.rank[v]:\n self.rank[u] += 1\n\n def count(self, x):\n return self.size[self.root(x)]\n\n\nd, t, s = LI()\nif d <= t * s:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "slow_code_sha256": "a6a6da28ea21eb5c6cfeb4da55db52d83b5c9e592e210fb6c9a771a885099c2e", "slow_id": "p02570_c18a3a7e4014bde24e915dc4b9c7a40ca0c367289dfe9b646d5af979ad55733c", "speedup": 23.484755576480545, "stratum": "8+", "within_pair_jaccard": 0.1134020618556701, "workload": {"case_count": 100, "description": "Determine whether traveling distance D meters at constant speed S meters per minute reaches the destination within T minutes. Observed inputs: D=1..10000 (median 823); T=1..10000 (median 471); S=1..10000 (median 523).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 18, "median": 12.0, "min": 6}, "input_format": ["D T S"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3, "median": 3.0, "min": 3}}} -{"case_ids": ["p03606_case_000", "p03606_case_001", "p03606_case_002", "p03606_case_003", "p03606_case_004", "p03606_case_005", "p03606_case_006", "p03606_case_007", "p03606_case_008", "p03606_case_009", "p03606_case_010", "p03606_case_011", "p03606_case_012", "p03606_case_013", "p03606_case_014", "p03606_case_015", "p03606_case_016", "p03606_case_017", "p03606_case_018", "p03606_case_019", "p03606_case_020", "p03606_case_021", "p03606_case_022", "p03606_case_023", "p03606_case_024", "p03606_case_025", "p03606_case_026", "p03606_case_027", "p03606_case_028", "p03606_case_029", "p03606_case_030", "p03606_case_031", "p03606_case_032", "p03606_case_033", "p03606_case_034", "p03606_case_035", "p03606_case_036", "p03606_case_037", "p03606_case_038", "p03606_case_039", "p03606_case_040", "p03606_case_041", "p03606_case_042", "p03606_case_043", "p03606_case_044", "p03606_case_045", "p03606_case_046", "p03606_case_047", "p03606_case_048", "p03606_case_049", "p03606_case_050", "p03606_case_051", "p03606_case_052", "p03606_case_053", "p03606_case_054", "p03606_case_055", "p03606_case_056", "p03606_case_057", "p03606_case_058", "p03606_case_059", "p03606_case_060", "p03606_case_061", "p03606_case_062", "p03606_case_063", "p03606_case_064", "p03606_case_065", "p03606_case_066", "p03606_case_067", "p03606_case_068", "p03606_case_069", "p03606_case_070", "p03606_case_071", "p03606_case_072", "p03606_case_073", "p03606_case_074", "p03606_case_075", "p03606_case_076", "p03606_case_077", "p03606_case_078", "p03606_case_079", "p03606_case_080", "p03606_case_081", "p03606_case_082", "p03606_case_083", "p03606_case_084", "p03606_case_085", "p03606_case_086", "p03606_case_087", "p03606_case_088", "p03606_case_089", "p03606_case_090", "p03606_case_091", "p03606_case_092", "p03606_case_093", "p03606_case_094", "p03606_case_095", "p03606_case_096", "p03606_case_097", "p03606_case_098", "p03606_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "c = 0\nn = int(eval(input()))\nfor i in range(n):\n l, r = list(map(int, input().split()))\n c += r - l + 1\nprint(c)\n", "fast_code_sha256": "ec5374b39ca6490501cd813d8de881ed4ee532e2d0685784e6ccee268842a9c0", "fast_id": "p03606_ec5374b39ca6490501cd813d8de881ed4ee532e2d0685784e6ccee268842a9c0", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "c = 0\nn = int(eval(input()))\nfor i in range(n):\n l, r = list(map(int, input().split()))\n c += r - l + 1\nprint(c)\n", "measured_fast_code_sha256": "ec5374b39ca6490501cd813d8de881ed4ee532e2d0685784e6ccee268842a9c0", "measured_slow_code": "n = int(eval(input()))\nseat = [0] * (10**5 + 1)\nfor i in range(n):\n l, r = list(map(int, input().split()))\n seat[l - 1] += 1\n seat[r] -= 1\nfor i in range(1, 10**5):\n seat[i] += seat[i - 1]\nres = 0\nfor i in range(10**5):\n if seat[i] == 1:\n res += 1\nprint(res)\n", "measured_slow_code_sha256": "6790d9b5b286f2b0604f26a16037686fecf24cfd7e5138b01f649861516811f7", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 747.2848836984574, "pair_id": "python_v2_feed3063e7adbd6f1e686e63", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03606", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03606_ec5374b39ca6490501cd813d8de881ed4ee532e2d0685784e6ccee268842a9c0.jsonl.gz", "inputs": "reproduction/python/inputs/p03606.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03606_6790d9b5b286f2b0604f26a16037686fecf24cfd7e5138b01f649861516811f7.jsonl.gz"}, "slow_code": "n = int(eval(input()))\nseat = [0] * (10**5 + 1)\nfor i in range(n):\n l, r = list(map(int, input().split()))\n seat[l - 1] += 1\n seat[r] -= 1\nfor i in range(1, 10**5):\n seat[i] += seat[i - 1]\nres = 0\nfor i in range(10**5):\n if seat[i] == 1:\n res += 1\nprint(res)\n", "slow_code_sha256": "6790d9b5b286f2b0604f26a16037686fecf24cfd7e5138b01f649861516811f7", "slow_id": "p03606_6790d9b5b286f2b0604f26a16037686fecf24cfd7e5138b01f649861516811f7", "speedup": 310.7094017790718, "stratum": "8+", "within_pair_jaccard": 0.7272727272727273, "workload": {"case_count": 100, "description": "N groups occupy disjoint inclusive seat intervals [l_i,r_i] in a theater with seats 1..100000. Count the total seated people. Intervals need not be listed in order. Observed inputs: N=1..1000 (median 2); l_i=1..99992; r_i=5..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 11813, "median": 26.0, "min": 11}, "input_format": ["N\nl_1 r_1\n...\nl_N r_N"], "input_format_status": "source_input_section", "input_lines": {"max": 1001, "median": 3.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2001, "median": 5.0, "min": 3}}} -{"case_ids": ["p03329_case_000", "p03329_case_001", "p03329_case_002", "p03329_case_003", "p03329_case_004", "p03329_case_005", "p03329_case_006", "p03329_case_007", "p03329_case_008", "p03329_case_009", "p03329_case_010", "p03329_case_011", "p03329_case_012", "p03329_case_013", "p03329_case_014", "p03329_case_015", "p03329_case_016", "p03329_case_017", "p03329_case_018", "p03329_case_019", "p03329_case_020", "p03329_case_021", "p03329_case_022", "p03329_case_023", "p03329_case_024", "p03329_case_025", "p03329_case_026", "p03329_case_027", "p03329_case_028", "p03329_case_029", "p03329_case_030", "p03329_case_031", "p03329_case_032", "p03329_case_033", "p03329_case_034", "p03329_case_035", "p03329_case_036", "p03329_case_037", "p03329_case_038", "p03329_case_039", "p03329_case_040", "p03329_case_041", "p03329_case_042", "p03329_case_043", "p03329_case_044", "p03329_case_045", "p03329_case_046", "p03329_case_047", "p03329_case_048", "p03329_case_049", "p03329_case_050", "p03329_case_051", "p03329_case_052", "p03329_case_053", "p03329_case_054", "p03329_case_055", "p03329_case_056", "p03329_case_057", "p03329_case_058", "p03329_case_059", "p03329_case_060", "p03329_case_061", "p03329_case_062", "p03329_case_063", "p03329_case_064", "p03329_case_065", "p03329_case_066", "p03329_case_067", "p03329_case_068", "p03329_case_069", "p03329_case_070", "p03329_case_071", "p03329_case_072", "p03329_case_073", "p03329_case_074", "p03329_case_075", "p03329_case_076", "p03329_case_077", "p03329_case_078", "p03329_case_079", "p03329_case_080", "p03329_case_081", "p03329_case_082", "p03329_case_083", "p03329_case_084", "p03329_case_085", "p03329_case_086", "p03329_case_087", "p03329_case_088", "p03329_case_089", "p03329_case_090", "p03329_case_091", "p03329_case_092", "p03329_case_093", "p03329_case_094", "p03329_case_095", "p03329_case_096", "p03329_case_097", "p03329_case_098", "p03329_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N = int(eval(input()))\nsixs = [6**i for i in range(1, 7)]\nnines = [9**i for i in range(1, 6)]\ntmp = {}\n\n\ndef dfs(n):\n if n < 6:\n return n\n if n in tmp:\n return tmp[n]\n m = 10**9 + 7\n if n >= 9:\n max_nine = max(nine for nine in nines if nine <= n)\n if n % max_nine == 0:\n m = min(m, n // max_nine)\n else:\n m = min(m, dfs(n - max_nine) + 1)\n max_six = max(six for six in sixs if six <= n)\n if n % max_six == 0:\n m = min(m, n // max_six)\n tmp[n] = min(m, dfs(n - max_six) + 1)\n return tmp[n]\n\n\nprint((dfs(N)))\n", "fast_code_sha256": "8a16d58ba1b2f27049215d9a438bbca28f84c608e831115d5306f1aa2c301a6d", "fast_id": "p03329_8a16d58ba1b2f27049215d9a438bbca28f84c608e831115d5306f1aa2c301a6d", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N = int(eval(input()))\nsixs = [6**i for i in range(1, 7)]\nnines = [9**i for i in range(1, 6)]\ntmp = {}\n\n\ndef dfs(n):\n if n < 6:\n return n\n if n in tmp:\n return tmp[n]\n m = 10**9 + 7\n if n >= 9:\n max_nine = max(nine for nine in nines if nine <= n)\n if n % max_nine == 0:\n m = min(m, n // max_nine)\n else:\n m = min(m, dfs(n - max_nine) + 1)\n max_six = max(six for six in sixs if six <= n)\n if n % max_six == 0:\n m = min(m, n // max_six)\n tmp[n] = min(m, dfs(n - max_six) + 1)\n return tmp[n]\n\n\nprint((dfs(N)))\n", "measured_fast_code_sha256": "8a16d58ba1b2f27049215d9a438bbca28f84c608e831115d5306f1aa2c301a6d", "measured_slow_code": "n = int(eval(input()))\ndp = [float(\"inf\")] * 100010\ndp[0] = 0\nfor i in range(1, 100000 + 1):\n power = 1\n while power <= i:\n dp[i] = min(dp[i], dp[i - power] + 1)\n power *= 6\n power = 1\n while power <= i:\n dp[i] = min(dp[i], dp[i - power] + 1)\n power *= 9\nprint((dp[n]))\n", "measured_slow_code_sha256": "d420a4a47c3d63ccc8bf0d67f00fb6eac614ba4a541aaa7d9741e0a6de148e33", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2568.6784449311353, "pair_id": "python_v2_30797ec6f1a0bd684d1d591d", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03329", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03329_8a16d58ba1b2f27049215d9a438bbca28f84c608e831115d5306f1aa2c301a6d.jsonl.gz", "inputs": "reproduction/python/inputs/p03329.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03329_d420a4a47c3d63ccc8bf0d67f00fb6eac614ba4a541aaa7d9741e0a6de148e33.jsonl.gz"}, "slow_code": "n = int(eval(input()))\ndp = [float(\"inf\")] * 100010\ndp[0] = 0\nfor i in range(1, 100000 + 1):\n power = 1\n while power <= i:\n dp[i] = min(dp[i], dp[i - power] + 1)\n power *= 6\n power = 1\n while power <= i:\n dp[i] = min(dp[i], dp[i - power] + 1)\n power *= 9\nprint((dp[n]))\n", "slow_code_sha256": "d420a4a47c3d63ccc8bf0d67f00fb6eac614ba4a541aaa7d9741e0a6de148e33", "slow_id": "p03329_d420a4a47c3d63ccc8bf0d67f00fb6eac614ba4a541aaa7d9741e0a6de148e33", "speedup": 2403.5012080608553, "stratum": "8+", "within_pair_jaccard": 0.3684210526315789, "workload": {"case_count": 100, "description": "Withdraw exactly N units with minimum operations. Each operation withdraws 1, a positive integer power of 6, or a positive integer power of 9. Withdrawn money cannot be redeposited. Observed inputs: N=1..100000 (median 5282.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 7, "median": 5.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p02244_case_000", "p02244_case_001", "p02244_case_002", "p02244_case_003", "p02244_case_004", "p02244_case_005", "p02244_case_006", "p02244_case_007", "p02244_case_008", "p02244_case_009", "p02244_case_010", "p02244_case_011", "p02244_case_012", "p02244_case_013", "p02244_case_014", "p02244_case_015", "p02244_case_016", "p02244_case_017", "p02244_case_018", "p02244_case_019", "p02244_case_020", "p02244_case_021", "p02244_case_022", "p02244_case_023", "p02244_case_024", "p02244_case_025", "p02244_case_026", "p02244_case_027", "p02244_case_028", "p02244_case_029", "p02244_case_030", "p02244_case_031", "p02244_case_032", "p02244_case_033", "p02244_case_034", "p02244_case_035", "p02244_case_036", "p02244_case_037", "p02244_case_038", "p02244_case_039", "p02244_case_040", "p02244_case_041", "p02244_case_042", "p02244_case_043", "p02244_case_044", "p02244_case_045", "p02244_case_046", "p02244_case_047", "p02244_case_048", "p02244_case_049", "p02244_case_050", "p02244_case_051", "p02244_case_052", "p02244_case_053", "p02244_case_054", "p02244_case_055", "p02244_case_056", "p02244_case_057", "p02244_case_058", "p02244_case_059", "p02244_case_060", "p02244_case_061", "p02244_case_062", "p02244_case_063", "p02244_case_064", "p02244_case_065", "p02244_case_066", "p02244_case_067", "p02244_case_068", "p02244_case_069", "p02244_case_070", "p02244_case_071", "p02244_case_072", "p02244_case_073", "p02244_case_074", "p02244_case_075", "p02244_case_076", "p02244_case_077", "p02244_case_078", "p02244_case_079", "p02244_case_080", "p02244_case_081", "p02244_case_082", "p02244_case_083", "p02244_case_084", "p02244_case_085", "p02244_case_086", "p02244_case_087", "p02244_case_088", "p02244_case_089", "p02244_case_090", "p02244_case_091", "p02244_case_092", "p02244_case_093", "p02244_case_094", "p02244_case_095", "p02244_case_096", "p02244_case_097", "p02244_case_098", "p02244_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "row = [False] * 8\ncol = [False] * 8\ndpos = [False] * 15\ndneg = [False] * 15\nboard = [[\".\", \".\", \".\", \".\", \".\", \".\", \".\", \".\"] for i in range(8)]\nimport sys\n\nfile_input = sys.stdin\nk = int(file_input.readline())\nfor line in file_input:\n r, c = list(map(int, line.split()))\n row[r] = True\n col[c] = True\n dpos[r + c] = True\n dneg[r - c + 7] = True\n board[r][c] = \"Q\"\n\n\ndef dfs(i=0):\n if i == 8:\n for line in board:\n print((\"\".join(line)))\n elif row[i]:\n dfs(i + 1)\n else:\n for j in range(8):\n if col[j] or dpos[i + j] or dneg[i - j + 7]:\n continue\n row[i] = True\n col[j] = True\n dpos[i + j] = True\n dneg[i - j + 7] = True\n board[i][j] = \"Q\"\n dfs(i + 1)\n row[i] = False\n col[j] = False\n dpos[i + j] = False\n dneg[i - j + 7] = False\n board[i][j] = \".\"\n\n\ndfs()\n", "fast_code_sha256": "97b737f05f0830b14579e16256f0ec5f9380e4ef62fc98a570bb8aeb2204470e", "fast_id": "p02244_97b737f05f0830b14579e16256f0ec5f9380e4ef62fc98a570bb8aeb2204470e", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "row = [False] * 8\ncol = [False] * 8\ndpos = [False] * 15\ndneg = [False] * 15\nboard = [[\".\", \".\", \".\", \".\", \".\", \".\", \".\", \".\"] for i in range(8)]\nimport sys\n\nfile_input = sys.stdin\nk = int(file_input.readline())\nfor line in file_input:\n r, c = list(map(int, line.split()))\n row[r] = True\n col[c] = True\n dpos[r + c] = True\n dneg[r - c + 7] = True\n board[r][c] = \"Q\"\n\n\ndef dfs(i=0):\n if i == 8:\n for line in board:\n print((\"\".join(line)))\n elif row[i]:\n dfs(i + 1)\n else:\n for j in range(8):\n if col[j] or dpos[i + j] or dneg[i - j + 7]:\n continue\n row[i] = True\n col[j] = True\n dpos[i + j] = True\n dneg[i - j + 7] = True\n board[i][j] = \"Q\"\n dfs(i + 1)\n row[i] = False\n col[j] = False\n dpos[i + j] = False\n dneg[i - j + 7] = False\n board[i][j] = \".\"\n\n\ndfs()\n", "measured_fast_code_sha256": "97b737f05f0830b14579e16256f0ec5f9380e4ef62fc98a570bb8aeb2204470e", "measured_slow_code": "from itertools import product\nfrom copy import deepcopy, copy\n\n\nclass QueenMAP:\n __slots__ = [\"yoko\", \"tate\", \"naname1\", \"naname2\", \"MAP\"]\n\n def __init__(self):\n self.yoko = set()\n self.tate = set()\n self.naname1 = set()\n self.naname2 = set()\n self.MAP = [[\".\"] * 8 for _ in range(8)]\n\n def add(self, y, x):\n self.MAP[y][x] = \"Q\"\n self.yoko.add(y)\n self.tate.add(x)\n self.naname1.add(y - x)\n self.naname2.add(x + y)\n\n def check(self, y, x):\n if (\n y in self.yoko\n or x in self.tate\n or (y - x) in self.naname1\n or (x + y) in self.naname2\n ):\n return False\n return True\n\n def allcheck(self):\n for i in range(8):\n if not \"Q\" in self.MAP[i]:\n return False\n return True\n\n\ndef MAIN():\n f = lambda M: \"\\n\".join(\"\".join(map(str, m)) for m in M)\n QM = QueenMAP()\n n = int(eval(input()))\n for _ in range(n):\n a, b = list(map(int, input().split()))\n QM.add(a, b)\n dp = [(deepcopy(QM), n)]\n while dp:\n Q, cnt = dp.pop()\n if cnt == 8:\n if Q.allcheck():\n print((f(Q.MAP)))\n break\n continue\n cnt += 1\n for i in range(8):\n for j in range(8):\n if Q.check(i, j):\n CQ = deepcopy(Q)\n CQ.add(i, j)\n dp.append((CQ, cnt))\n\n\nMAIN()\n", "measured_slow_code_sha256": "de9c1ea405f9a9a020b43e0f2c02b75f368b6c2931a4313be78d5a5d6b52ed14", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 9.901871364004869, "pair_id": "python_v2_f175e6a23a15b4f82e803feb", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02244", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02244_97b737f05f0830b14579e16256f0ec5f9380e4ef62fc98a570bb8aeb2204470e.jsonl.gz", "inputs": "reproduction/python/inputs/p02244.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02244_de9c1ea405f9a9a020b43e0f2c02b75f368b6c2931a4313be78d5a5d6b52ed14.jsonl.gz"}, "slow_code": "from itertools import product\nfrom copy import deepcopy, copy\n\n\nclass QueenMAP:\n __slots__ = [\"yoko\", \"tate\", \"naname1\", \"naname2\", \"MAP\"]\n\n def __init__(self):\n self.yoko = set()\n self.tate = set()\n self.naname1 = set()\n self.naname2 = set()\n self.MAP = [[\".\"] * 8 for _ in range(8)]\n\n def add(self, y, x):\n self.MAP[y][x] = \"Q\"\n self.yoko.add(y)\n self.tate.add(x)\n self.naname1.add(y - x)\n self.naname2.add(x + y)\n\n def check(self, y, x):\n if (\n y in self.yoko\n or x in self.tate\n or (y - x) in self.naname1\n or (x + y) in self.naname2\n ):\n return False\n return True\n\n def allcheck(self):\n for i in range(8):\n if not \"Q\" in self.MAP[i]:\n return False\n return True\n\n\ndef MAIN():\n f = lambda M: \"\\n\".join(\"\".join(map(str, m)) for m in M)\n QM = QueenMAP()\n n = int(eval(input()))\n for _ in range(n):\n a, b = list(map(int, input().split()))\n QM.add(a, b)\n dp = [(deepcopy(QM), n)]\n while dp:\n Q, cnt = dp.pop()\n if cnt == 8:\n if Q.allcheck():\n print((f(Q.MAP)))\n break\n continue\n cnt += 1\n for i in range(8):\n for j in range(8):\n if Q.check(i, j):\n CQ = deepcopy(Q)\n CQ.add(i, j)\n dp.append((CQ, cnt))\n\n\nMAIN()\n", "slow_code_sha256": "de9c1ea405f9a9a020b43e0f2c02b75f368b6c2931a4313be78d5a5d6b52ed14", "slow_id": "p02244_de9c1ea405f9a9a020b43e0f2c02b75f368b6c2931a4313be78d5a5d6b52ed14", "speedup": 12.998843370737097, "stratum": "8+", "within_pair_jaccard": 0.25301204819277107, "workload": {"case_count": 100, "description": "Complete an 8-by-8 board to eight nonattacking queens while preserving k fixed placements. Queens must differ in row, column and diagonal; coordinates are 0-based. The saved input has exactly one completion. Output Q for queens and . for empty cells. Observed inputs: k=2..8 (median 4); row=0..7; column=0..7.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 34, "median": 18.0, "min": 10}, "input_format": ["k\nr_1 c_1\n...\nr_k c_k"], "input_format_status": "source_input_section", "input_lines": {"max": 9, "median": 5.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 17, "median": 9.0, "min": 5}}} -{"case_ids": ["p02549_case_000", "p02549_case_001", "p02549_case_002", "p02549_case_003", "p02549_case_004", "p02549_case_005", "p02549_case_006", "p02549_case_007", "p02549_case_008", "p02549_case_009", "p02549_case_010", "p02549_case_011", "p02549_case_012", "p02549_case_013", "p02549_case_014", "p02549_case_015", "p02549_case_016", "p02549_case_017", "p02549_case_018", "p02549_case_019", "p02549_case_020", "p02549_case_021", "p02549_case_022", "p02549_case_023", "p02549_case_024", "p02549_case_025", "p02549_case_026", "p02549_case_027", "p02549_case_028", "p02549_case_029", "p02549_case_030", "p02549_case_031", "p02549_case_032", "p02549_case_033", "p02549_case_034", "p02549_case_035", "p02549_case_036", "p02549_case_037", "p02549_case_038", "p02549_case_039", "p02549_case_040", "p02549_case_041", "p02549_case_042", "p02549_case_043", "p02549_case_044", "p02549_case_045", "p02549_case_046", "p02549_case_047", "p02549_case_048", "p02549_case_049", "p02549_case_050", "p02549_case_051", "p02549_case_052", "p02549_case_053", "p02549_case_054", "p02549_case_055", "p02549_case_056", "p02549_case_057", "p02549_case_058", "p02549_case_059", "p02549_case_060", "p02549_case_061", "p02549_case_062", "p02549_case_063", "p02549_case_064", "p02549_case_065", "p02549_case_066", "p02549_case_067", "p02549_case_068", "p02549_case_069", "p02549_case_070", "p02549_case_071", "p02549_case_072", "p02549_case_073", "p02549_case_074", "p02549_case_075", "p02549_case_076", "p02549_case_077", "p02549_case_078", "p02549_case_079", "p02549_case_080", "p02549_case_081", "p02549_case_082", "p02549_case_083", "p02549_case_084", "p02549_case_085", "p02549_case_086", "p02549_case_087", "p02549_case_088", "p02549_case_089", "p02549_case_090", "p02549_case_091", "p02549_case_092", "p02549_case_093", "p02549_case_094", "p02549_case_095", "p02549_case_096", "p02549_case_097", "p02549_case_098", "p02549_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N, K = list(map(int, input().split()))\nmod = 998244353\nL = []\nfor _ in range(K):\n a, b = list(map(int, input().split()))\n b += 1\n L.append([a, b])\nruiwa = [0] * (N + 1)\ndp = [0] * (N + 1)\ndp[1] = 1\nruiwa[1] = 1\nfor i in range(2, N + 1):\n for l, r in L:\n l = i - l\n r = i - r\n l, r = r, l\n if r < 0:\n continue\n elif l >= 0:\n\n dp[i] += (ruiwa[r] - ruiwa[l]) % mod\n else:\n dp[i] += ruiwa[r] % mod\n ruiwa[i] = (ruiwa[i - 1] + dp[i]) % mod\nprint((dp[-1] % mod))\n", "fast_code_sha256": "78ec77edabf6eaf0668e692aaa191f6e7f95b867c9c8fc3d77fca781803df23c", "fast_id": "p02549_103c0b0fa57d0b7965817c715e5fef817ae5761d08d6804775b746d49c092239", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N, K = list(map(int, input().split()))\nmod = 998244353\nL = []\nfor _ in range(K):\n a, b = list(map(int, input().split()))\n b += 1\n L.append([a, b])\nruiwa = [0] * (N + 1)\ndp = [0] * (N + 1)\ndp[1] = 1\nruiwa[1] = 1\nfor i in range(2, N + 1):\n for l, r in L:\n l = i - l\n r = i - r\n l, r = r, l\n if r < 0:\n continue\n elif l >= 0:\n # print(ruiwa, r, l)\n dp[i] += (ruiwa[r] - ruiwa[l]) % mod\n else:\n dp[i] += ruiwa[r] % mod\n ruiwa[i] = (ruiwa[i - 1] + dp[i]) % mod\nprint((dp[-1] % mod))\n", "measured_fast_code_sha256": "103c0b0fa57d0b7965817c715e5fef817ae5761d08d6804775b746d49c092239", "measured_slow_code": "mod = 998244353\nn, k = list(map(int, input().split()))\nK = [list(map(int, input().split())) for i in range(k)]\ndp = [0] * (n + 5)\ndp[1] = 1\ndp2 = [0] * (n + 5)\nfor i in range(1, n + 1):\n dp[i] = (dp[i] + dp2[i] + dp2[i - 1]) % mod\n dp2[i] = (dp2[i] + dp2[i - 1]) % mod\n for l, r in K:\n dp2[min(i + l, n + 2)] += dp[i]\n dp2[min(i + l, n + 2)] %= mod\n dp2[min(i + r + 1, n + 2)] -= dp[i]\n dp2[min(i + r + 1, n + 2)] %= mod\nprint((dp[n] % mod))\n", "measured_slow_code_sha256": "44c9516e92f38f09d76b47812276c2878e77eeefdb8dab9cc1137c27ddfc7b8e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.5454638358864488, "pair_id": "python_v2_94b365ffbdeb258a8838e0bd", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02549", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02549_103c0b0fa57d0b7965817c715e5fef817ae5761d08d6804775b746d49c092239.jsonl.gz", "inputs": "reproduction/python/inputs/p02549.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02549_44c9516e92f38f09d76b47812276c2878e77eeefdb8dab9cc1137c27ddfc7b8e.jsonl.gz"}, "slow_code": "mod = 998244353\nn, k = list(map(int, input().split()))\nK = [list(map(int, input().split())) for i in range(k)]\ndp = [0] * (n + 5)\ndp[1] = 1\ndp2 = [0] * (n + 5)\nfor i in range(1, n + 1):\n dp[i] = (dp[i] + dp2[i] + dp2[i - 1]) % mod\n dp2[i] = (dp2[i] + dp2[i - 1]) % mod\n for l, r in K:\n dp2[min(i + l, n + 2)] += dp[i]\n dp2[min(i + l, n + 2)] %= mod\n dp2[min(i + r + 1, n + 2)] -= dp[i]\n dp2[min(i + r + 1, n + 2)] %= mod\nprint((dp[n] % mod))\n", "slow_code_sha256": "44c9516e92f38f09d76b47812276c2878e77eeefdb8dab9cc1137c27ddfc7b8e", "slow_id": "p02549_44c9516e92f38f09d76b47812276c2878e77eeefdb8dab9cc1137c27ddfc7b8e", "speedup": 2.212795107933837, "stratum": "2-4", "within_pair_jaccard": 0.5428571428571428, "workload": {"case_count": 100, "description": "Count paths from cell 1 to N, modulo 998244353, moving forward by a length in the union of K disjoint inclusive intervals [L_i,R_i], without leaving the row. Observed inputs: N=2..200000 (median 5500); K=1..10 (median 5); L_i=1..200000; R_i=1..200000; allowed_step_count=1..170805 (median 10).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 150, "median": 49.0, "min": 8}, "input_format": ["N K\nL_1 R_1\n...\nL_K R_K"], "input_format_status": "source_input_section", "input_lines": {"max": 11, "median": 6.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 22, "median": 12.0, "min": 4}}} -{"case_ids": ["p00033_case_000", "p00033_case_001", "p00033_case_002", "p00033_case_003", "p00033_case_004", "p00033_case_005", "p00033_case_006", "p00033_case_007", "p00033_case_008", "p00033_case_009", "p00033_case_010", "p00033_case_011", "p00033_case_012", "p00033_case_013", "p00033_case_014", "p00033_case_015", "p00033_case_016", "p00033_case_017", "p00033_case_018", "p00033_case_019", "p00033_case_020", "p00033_case_021", "p00033_case_022", "p00033_case_023", "p00033_case_024", "p00033_case_025", "p00033_case_026", "p00033_case_027", "p00033_case_028", "p00033_case_029", "p00033_case_030", "p00033_case_031", "p00033_case_032", "p00033_case_033", "p00033_case_034", "p00033_case_035", "p00033_case_036", "p00033_case_037", "p00033_case_038", "p00033_case_039", "p00033_case_040", "p00033_case_041", "p00033_case_042", "p00033_case_043", "p00033_case_044", "p00033_case_045", "p00033_case_046", "p00033_case_047", "p00033_case_048", "p00033_case_049", "p00033_case_050", "p00033_case_051", "p00033_case_052", "p00033_case_053", "p00033_case_054", "p00033_case_055", "p00033_case_056", "p00033_case_057", "p00033_case_058", "p00033_case_059", "p00033_case_060", "p00033_case_061", "p00033_case_062", "p00033_case_063", "p00033_case_064", "p00033_case_065", "p00033_case_066", "p00033_case_067", "p00033_case_068", "p00033_case_069", "p00033_case_070", "p00033_case_071", "p00033_case_072", "p00033_case_073", "p00033_case_074", "p00033_case_075", "p00033_case_076", "p00033_case_077", "p00033_case_078", "p00033_case_079", "p00033_case_080", "p00033_case_081", "p00033_case_082", "p00033_case_083", "p00033_case_084", "p00033_case_085", "p00033_case_086", "p00033_case_087", "p00033_case_088", "p00033_case_089", "p00033_case_090", "p00033_case_091", "p00033_case_092", "p00033_case_093", "p00033_case_094", "p00033_case_095", "p00033_case_096", "p00033_case_097", "p00033_case_098", "p00033_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "executable_AST_equal_except_explicit_explanatory_string_removal_and_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\nsys.setrecursionlimit(10**6)\n\n\ndef dfs(balls, B=-1, C=-1, cp=0):\n if cp == len(balls):\n return True\n ball = balls[cp]\n if B < ball:\n is_find = dfs(balls, ball, C, cp + 1)\n if is_find:\n return True\n if C < ball:\n is_find = dfs(balls, B, ball, cp + 1)\n if is_find:\n return True\n return False\n\n\ndef main():\n N = int(input().strip())\n for _ in range(N):\n balls = list(map(int, input().split(\" \")))\n is_find = dfs(balls)\n if is_find:\n print(\"YES\")\n else:\n print(\"NO\")\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "5bf7be962f5a393bed61c95c4456ace4b339801f145936066b0a4f113de5cd02", "fast_id": "p00033_f59db75acfcf498259bacfe1d852ac4ab0eb85100491de83289b21e5898a337b", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "# -*- coding: utf-8 -*-\nimport sys\n\nsys.setrecursionlimit(10**6)\n\n\ndef dfs(balls, B=-1, C=-1, cp=0):\n if cp == len(balls):\n return True\n ball = balls[cp]\n if B < ball:\n is_find = dfs(balls, ball, C, cp + 1)\n if is_find:\n return True\n if C < ball:\n is_find = dfs(balls, B, ball, cp + 1)\n if is_find:\n return True\n return False\n\n\ndef main():\n N = int(input().strip())\n for _ in range(N):\n balls = list(map(int, input().split(\" \")))\n is_find = dfs(balls)\n if is_find:\n print(\"YES\")\n else:\n print(\"NO\")\n\n\nif __name__ == \"__main__\":\n main()\n\"\"\"\n2\n3 1 4 2 5 6 7 8 9 10\n10 9 8 7 6 5 4 3 2 1\n\"\"\"\n", "measured_fast_code_sha256": "f59db75acfcf498259bacfe1d852ac4ab0eb85100491de83289b21e5898a337b", "measured_slow_code": "def dfs(i, b, c):\n if i == 11:\n return b == sorted(b) and c == sorted(c)\n if dfs(i + 1, b + [balls[i - 1]], c):\n return True\n if dfs(i + 1, b, c + [balls[i - 1]]):\n return True\n return False\n\n\nif __name__ == \"__main__\":\n N = int(eval(input()))\n for i in range(N):\n balls = list(map(int, input().split()))\n if dfs(1, [], []):\n print(\"YES\")\n else:\n print(\"NO\")\n", "measured_slow_code_sha256": "d554547e32ca76dca1697e6003a53c8f9386d6f728fbbf5b97a6fa1bed6629c2", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 20.856015282201007, "pair_id": "python_v2_73cabfc1dd310aa1ee1a9389", "per_case_slow_code_faster_fraction": 0.04, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p00033", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p00033_f59db75acfcf498259bacfe1d852ac4ab0eb85100491de83289b21e5898a337b.jsonl.gz", "inputs": "reproduction/python/inputs/p00033.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p00033_d554547e32ca76dca1697e6003a53c8f9386d6f728fbbf5b97a6fa1bed6629c2.jsonl.gz"}, "slow_code": "def dfs(i, b, c):\n if i == 11:\n return b == sorted(b) and c == sorted(c)\n if dfs(i + 1, b + [balls[i - 1]], c):\n return True\n if dfs(i + 1, b, c + [balls[i - 1]]):\n return True\n return False\n\n\nif __name__ == \"__main__\":\n N = int(eval(input()))\n for i in range(N):\n balls = list(map(int, input().split()))\n if dfs(1, [], []):\n print(\"YES\")\n else:\n print(\"NO\")\n", "slow_code_sha256": "d554547e32ca76dca1697e6003a53c8f9386d6f728fbbf5b97a6fa1bed6629c2", "slow_id": "p00033_d554547e32ca76dca1697e6003a53c8f9386d6f728fbbf5b97a6fa1bed6629c2", "speedup": 15.077045489145817, "stratum": "8+", "within_pair_jaccard": 0.4423076923076923, "workload": {"case_count": 100, "description": "For each permutation of 1..10, decide whether it can be assigned in arrival order to two stacks so that values increase from bottom to top in each stack. The first integer gives the number of datasets. Observed inputs: datasets=1..10 (median 7); permutation_length=10.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 213, "median": 149.0, "min": 23}, "input_format": ["N\n[permutation of 1..10]\n... (N permutation lines)"], "input_format_status": "source_input_section", "input_lines": {"max": 11, "median": 8.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 101, "median": 71.0, "min": 11}}} -{"case_ids": ["p02572_case_000", "p02572_case_001", "p02572_case_002", "p02572_case_003", "p02572_case_004", "p02572_case_005", "p02572_case_006", "p02572_case_007", "p02572_case_008", "p02572_case_009", "p02572_case_010", "p02572_case_011", "p02572_case_012", "p02572_case_013", "p02572_case_014", "p02572_case_015", "p02572_case_016", "p02572_case_017", "p02572_case_018", "p02572_case_019", "p02572_case_020", "p02572_case_021", "p02572_case_022", "p02572_case_023", "p02572_case_024", "p02572_case_025", "p02572_case_026", "p02572_case_027", "p02572_case_028", "p02572_case_029", "p02572_case_030", "p02572_case_031", "p02572_case_032", "p02572_case_033", "p02572_case_034", "p02572_case_035", "p02572_case_036", "p02572_case_037", "p02572_case_038", "p02572_case_039", "p02572_case_040", "p02572_case_041", "p02572_case_042", "p02572_case_043", "p02572_case_044", "p02572_case_045", "p02572_case_046", "p02572_case_047", "p02572_case_048", "p02572_case_049", "p02572_case_050", "p02572_case_051", "p02572_case_052", "p02572_case_053", "p02572_case_054", "p02572_case_055", "p02572_case_056", "p02572_case_057", "p02572_case_058", "p02572_case_059", "p02572_case_060", "p02572_case_061", "p02572_case_062", "p02572_case_063", "p02572_case_064", "p02572_case_065", "p02572_case_066", "p02572_case_067", "p02572_case_068", "p02572_case_069", "p02572_case_070", "p02572_case_071", "p02572_case_072", "p02572_case_073", "p02572_case_074", "p02572_case_075", "p02572_case_076", "p02572_case_077", "p02572_case_078", "p02572_case_079", "p02572_case_080", "p02572_case_081", "p02572_case_082", "p02572_case_083", "p02572_case_084", "p02572_case_085", "p02572_case_086", "p02572_case_087", "p02572_case_088", "p02572_case_089", "p02572_case_090", "p02572_case_091", "p02572_case_092", "p02572_case_093", "p02572_case_094", "p02572_case_095", "p02572_case_096", "p02572_case_097", "p02572_case_098", "p02572_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\na = list(map(int, input().split()))\nk = 0\nnum = sum(a)\nimport math\n\nfor i in range(n):\n reje = num - a[i]\n k += reje * a[i]\nx = k // 2\nt = 10**9 + 7\nans = x % t\nprint(ans)\n", "fast_code_sha256": "2613d9f8aca6f0a2ad5694268aadca2cf120425eb7f71a5017b90abe73680871", "fast_id": "p02572_2613d9f8aca6f0a2ad5694268aadca2cf120425eb7f71a5017b90abe73680871", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\na = list(map(int, input().split()))\nk = 0\nnum = sum(a)\nimport math\n\nfor i in range(n):\n reje = num - a[i]\n k += reje * a[i]\nx = k // 2\nt = 10**9 + 7\nans = x % t\nprint(ans)\n", "measured_fast_code_sha256": "2613d9f8aca6f0a2ad5694268aadca2cf120425eb7f71a5017b90abe73680871", "measured_slow_code": "import numpy as np\n\nN = int(eval(input()))\nA = np.array([int(i) for i in input().split()])\nsum = 0\n# 累積和、二乗和の両方で1項ずつ求めてmodをとる\nfor x in A:\n sum += x\n sum %= 10**9 + 7\n# sum = A.sum() % (10**9+7)\nsum2 = 0\nfor x in A:\n sum2 += x * x\n sum2 %= 10**9 + 7\n# sum2 = (A**2).sum() % (10**9+7)\nans = (sum**2 - sum2) % (10**9 + 7)\nif ans < 0:\n ans += 10**9 + 7\nans *= int((10**9 + 7 + 1) / 2)\nans %= 10**9 + 7\nprint((int(ans)))\n", "measured_slow_code_sha256": "bbd0765504a43af57f1013eba7a9f2f567f1ff7927a5e42c81e85596c0a9b856", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4.225636412167716, "pair_id": "python_v2_0dadc9ca876a7d7f76114cf8", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02572", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02572_2613d9f8aca6f0a2ad5694268aadca2cf120425eb7f71a5017b90abe73680871.jsonl.gz", "inputs": "reproduction/python/inputs/p02572.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02572_bbd0765504a43af57f1013eba7a9f2f567f1ff7927a5e42c81e85596c0a9b856.jsonl.gz"}, "slow_code": "import numpy as np\n\nN = int(eval(input()))\nA = np.array([int(i) for i in input().split()])\nsum = 0\n\nfor x in A:\n sum += x\n sum %= 10**9 + 7\n\nsum2 = 0\nfor x in A:\n sum2 += x * x\n sum2 %= 10**9 + 7\n\nans = (sum**2 - sum2) % (10**9 + 7)\nif ans < 0:\n ans += 10**9 + 7\nans *= int((10**9 + 7 + 1) / 2)\nans %= 10**9 + 7\nprint((int(ans)))\n", "slow_code_sha256": "7f0c885ecc7c1eef39e171a852b966e4e09f436f2d91513c561c1cef1169003a", "slow_id": "p02572_bbd0765504a43af57f1013eba7a9f2f567f1ff7927a5e42c81e85596c0a9b856", "speedup": 25.92575870254105, "stratum": "8+", "within_pair_jaccard": 0.4444444444444444, "workload": {"case_count": 100, "description": "For an array of N integers, sum a_i*a_j over all index pairs i 1:\n m = (r + l) // 2\n if pattern_num_ge_x(m) < M:\n r = m\n else:\n l = m\n\nS = [0] + list(reversed(A[:]))\nfor i in range(1, N + 1):\n S[i] += S[i - 1]\nans = 0\nfor a in A:\n idx = bisect.bisect_left(A, r - a)\n ans += a * (N - idx) + S[N - idx]\n M -= N - idx\n\nans += l * M\nprint(ans)\n", "fast_code_sha256": "4bb9fcf1562c655a6cb303039c1fe9a0ab3ae893d8705c11288f6f979b3bfe19", "fast_id": "p02821_db6e30853f216497b887bf9c61bdf47f5f4aa3bed3a7ffd1ef1b74c86f6e9a9c", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import bisect\n\nN, M = list(map(int, input().split()))\nA = list(map(int, input().split()))\nA.sort()\n# 和がx以上になる組み合わせの総数を求める関数\ndef pattern_num_ge_x(x):\n p = 0\n for a in A:\n p += N - bisect.bisect_left(A, x - a)\n return p\n\n\n# pattern_num_ge_x(x)がM未満になる最小のxを探す(=r)\n# lはM以上になる最大のx\nl = -1\nr = 10**5 * 2 + 1\nwhile r - l > 1:\n m = (r + l) // 2\n if pattern_num_ge_x(m) < M:\n r = m\n else:\n l = m\n# 和がr以上になる組み合わせの総和を求める(累積和を使用)\nS = [0] + list(reversed(A[:]))\nfor i in range(1, N + 1):\n S[i] += S[i - 1]\nans = 0\nfor a in A:\n idx = bisect.bisect_left(A, r - a)\n ans += a * (N - idx) + S[N - idx]\n M -= N - idx\n# 回数のあまり分lを足す\nans += l * M\nprint(ans)\n", "measured_fast_code_sha256": "db6e30853f216497b887bf9c61bdf47f5f4aa3bed3a7ffd1ef1b74c86f6e9a9c", "measured_slow_code": "import numpy as np\nimport sys\n\ninput = sys.stdin.readline\n\n\ndef main():\n N, M = list(map(int, input().split()))\n A = np.array(sorted([int(i) for i in input().split()]))\n left = 0\n right = A[-1] * 2 + 5\n while right - left > 1:\n x = (left + right) // 2\n count = N**2 - np.searchsorted(A, x - A).sum()\n if count >= M:\n left = x\n else:\n right = x\n bound = np.searchsorted(A, left - A)\n count = N**2 - bound.sum()\n diff = count - M\n ans = ((N - bound) * A * 2).sum() - diff * left\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "f8690910de5a01bf00d05cddb4b11fb05a0b5d435dec0066a396506b32432a1b", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 5.686127427919374, "pair_id": "python_v2_66ac50c8608351be97c31200", "per_case_slow_code_faster_fraction": 0.43, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02821", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02821_db6e30853f216497b887bf9c61bdf47f5f4aa3bed3a7ffd1ef1b74c86f6e9a9c.jsonl.gz", "inputs": "reproduction/python/inputs/p02821.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02821_f8690910de5a01bf00d05cddb4b11fb05a0b5d435dec0066a396506b32432a1b.jsonl.gz"}, "slow_code": "import numpy as np\nimport sys\n\ninput = sys.stdin.readline\n\n\ndef main():\n N, M = list(map(int, input().split()))\n A = np.array(sorted([int(i) for i in input().split()]))\n left = 0\n right = A[-1] * 2 + 5\n while right - left > 1:\n x = (left + right) // 2\n count = N**2 - np.searchsorted(A, x - A).sum()\n if count >= M:\n left = x\n else:\n right = x\n bound = np.searchsorted(A, left - A)\n count = N**2 - bound.sum()\n diff = count - M\n ans = ((N - bound) * A * 2).sum() - diff * left\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "f8690910de5a01bf00d05cddb4b11fb05a0b5d435dec0066a396506b32432a1b", "slow_id": "p02821_f8690910de5a01bf00d05cddb4b11fb05a0b5d435dec0066a396506b32432a1b", "speedup": 5.807879251083015, "stratum": "4-8", "within_pair_jaccard": 0.4107142857142857, "workload": {"case_count": 100, "description": "Choose M distinct ordered pairs (x,y) of guests among N, allowing x=y. Pair (x,y) yields happiness A_x+A_y. Maximize total happiness; reversing unequal IDs gives a different pair. Observed inputs: N=1..100000 (median 1000); M=1..10000000000 (median 1000000); A_i=1..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 700019, "median": 5888.0, "min": 8}, "input_format": ["N M\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100002, "median": 1002.0, "min": 3}}} -{"case_ids": ["p03207_case_000", "p03207_case_001", "p03207_case_002", "p03207_case_003", "p03207_case_004", "p03207_case_005", "p03207_case_006", "p03207_case_007", "p03207_case_008", "p03207_case_009", "p03207_case_010", "p03207_case_011", "p03207_case_012", "p03207_case_013", "p03207_case_014", "p03207_case_015", "p03207_case_016", "p03207_case_017", "p03207_case_018", "p03207_case_019", "p03207_case_020", "p03207_case_021", "p03207_case_022", "p03207_case_023", "p03207_case_024", "p03207_case_025", "p03207_case_026", "p03207_case_027", "p03207_case_028", "p03207_case_029", "p03207_case_030", "p03207_case_031", "p03207_case_032", "p03207_case_033", "p03207_case_034", "p03207_case_035", "p03207_case_036", "p03207_case_037", "p03207_case_038", "p03207_case_039", "p03207_case_040", "p03207_case_041", "p03207_case_042", "p03207_case_043", "p03207_case_044", "p03207_case_045", "p03207_case_046", "p03207_case_047", "p03207_case_048", "p03207_case_049", "p03207_case_050", "p03207_case_051", "p03207_case_052", "p03207_case_053", "p03207_case_054", "p03207_case_055", "p03207_case_056", "p03207_case_057", "p03207_case_058", "p03207_case_059", "p03207_case_060", "p03207_case_061", "p03207_case_062", "p03207_case_063", "p03207_case_064", "p03207_case_065", "p03207_case_066", "p03207_case_067", "p03207_case_068", "p03207_case_069", "p03207_case_070", "p03207_case_071", "p03207_case_072", "p03207_case_073", "p03207_case_074", "p03207_case_075", "p03207_case_076", "p03207_case_077", "p03207_case_078", "p03207_case_079", "p03207_case_080", "p03207_case_081", "p03207_case_082", "p03207_case_083", "p03207_case_084", "p03207_case_085", "p03207_case_086", "p03207_case_087", "p03207_case_088", "p03207_case_089", "p03207_case_090", "p03207_case_091", "p03207_case_092", "p03207_case_093", "p03207_case_094", "p03207_case_095", "p03207_case_096", "p03207_case_097", "p03207_case_098", "p03207_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\np = [int(eval(input())) for i in range(n)]\nprint((sum(p) - max(p) // 2))\n", "fast_code_sha256": "6a558eaa1a914a14f163d02e745d120ea8c898e86db963087cc5eac889c092e3", "fast_id": "p03207_6a558eaa1a914a14f163d02e745d120ea8c898e86db963087cc5eac889c092e3", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\np = [int(eval(input())) for i in range(n)]\nprint((sum(p) - max(p) // 2))\n", "measured_fast_code_sha256": "6a558eaa1a914a14f163d02e745d120ea8c898e86db963087cc5eac889c092e3", "measured_slow_code": "#!/usr/bin/env python3\n# encoding:utf-8\nimport copy\nimport random\nimport bisect # bisect_left これで二部探索の大小検索が行える\nimport fractions # 最小公倍数などはこっち\nimport math\nimport sys\nimport collections\nfrom decimal import Decimal # 10進数で考慮できる\n\nmod = 10**9 + 7\nsys.setrecursionlimit(mod) # 再帰回数上限はでdefault1000\nd = collections.deque()\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\nN = int(eval(input()))\np = [0 for i in range(N)]\nfor i in range(N):\n p[i] = int(eval(input()))\np.sort()\nans = sum(p)\nans -= p[-1] // 2\nprint(ans)\n", "measured_slow_code_sha256": "5cb7a4c7cf0d8a71a4fd49887b2da818d3766f3e397b1d44bc46374144eeebdc", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 26.28361516213696, "pair_id": "python_v2_4ea3f53aa93a4095bdd5b619", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03207", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03207_6a558eaa1a914a14f163d02e745d120ea8c898e86db963087cc5eac889c092e3.jsonl.gz", "inputs": "reproduction/python/inputs/p03207.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03207_5cb7a4c7cf0d8a71a4fd49887b2da818d3766f3e397b1d44bc46374144eeebdc.jsonl.gz"}, "slow_code": "import copy\nimport random\nimport bisect\nimport fractions\nimport math\nimport sys\nimport collections\nfrom decimal import Decimal\n\nmod = 10**9 + 7\nsys.setrecursionlimit(mod)\nd = collections.deque()\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\nN = int(eval(input()))\np = [0 for i in range(N)]\nfor i in range(N):\n p[i] = int(eval(input()))\np.sort()\nans = sum(p)\nans -= p[-1] // 2\nprint(ans)\n", "slow_code_sha256": "fe2f7e4c4fa4bf811a1052a7e9a8cc8bf127a2538fd41f3ded0df182a9217e19", "slow_id": "p03207_5cb7a4c7cf0d8a71a4fd49887b2da818d3766f3e397b1d44bc46374144eeebdc", "speedup": 26.34256478293373, "stratum": "8+", "within_pair_jaccard": 0.23255813953488372, "workload": {"case_count": 100, "description": "Buy all N items, using one coupon to halve the price of one highest-priced item. Other items retain full price; every p_i is even. Output total payment. Observed inputs: N=2..10 (median 5); p_i=100..10000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 63, "median": 24.0, "min": 10}, "input_format": ["N\np_1\n...\np_N"], "input_format_status": "source_input_section", "input_lines": {"max": 11, "median": 6.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 11, "median": 6.0, "min": 3}}} -{"case_ids": ["p02783_case_000", "p02783_case_001", "p02783_case_002", "p02783_case_003", "p02783_case_004", "p02783_case_005", "p02783_case_006", "p02783_case_007", "p02783_case_008", "p02783_case_009", "p02783_case_010", "p02783_case_011", "p02783_case_012", "p02783_case_013", "p02783_case_014", "p02783_case_015", "p02783_case_016", "p02783_case_017", "p02783_case_018", "p02783_case_019", "p02783_case_020", "p02783_case_021", "p02783_case_022", "p02783_case_023", "p02783_case_024", "p02783_case_025", "p02783_case_026", "p02783_case_027", "p02783_case_028", "p02783_case_029", "p02783_case_030", "p02783_case_031", "p02783_case_032", "p02783_case_033", "p02783_case_034", "p02783_case_035", "p02783_case_036", "p02783_case_037", "p02783_case_038", "p02783_case_039", "p02783_case_040", "p02783_case_041", "p02783_case_042", "p02783_case_043", "p02783_case_044", "p02783_case_045", "p02783_case_046", "p02783_case_047", "p02783_case_048", "p02783_case_049", "p02783_case_050", "p02783_case_051", "p02783_case_052", "p02783_case_053", "p02783_case_054", "p02783_case_055", "p02783_case_056", "p02783_case_057", "p02783_case_058", "p02783_case_059", "p02783_case_060", "p02783_case_061", "p02783_case_062", "p02783_case_063", "p02783_case_064", "p02783_case_065", "p02783_case_066", "p02783_case_067", "p02783_case_068", "p02783_case_069", "p02783_case_070", "p02783_case_071", "p02783_case_072", "p02783_case_073", "p02783_case_074", "p02783_case_075", "p02783_case_076", "p02783_case_077", "p02783_case_078", "p02783_case_079", "p02783_case_080", "p02783_case_081", "p02783_case_082", "p02783_case_083", "p02783_case_084", "p02783_case_085", "p02783_case_086", "p02783_case_087", "p02783_case_088", "p02783_case_089", "p02783_case_090", "p02783_case_091", "p02783_case_092", "p02783_case_093", "p02783_case_094", "p02783_case_095", "p02783_case_096", "p02783_case_097", "p02783_case_098", "p02783_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "a, b = list(map(int, input().split()))\nprint((0 - -a // b))\n", "fast_code_sha256": "1f1f09c062c70abfa7a9061bb8cfd50f38717113e3d3b88f55dac5f7530ea385", "fast_id": "p02783_1f1f09c062c70abfa7a9061bb8cfd50f38717113e3d3b88f55dac5f7530ea385", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "a, b = list(map(int, input().split()))\nprint((0 - -a // b))\n", "measured_fast_code_sha256": "1f1f09c062c70abfa7a9061bb8cfd50f38717113e3d3b88f55dac5f7530ea385", "measured_slow_code": "import sys\nimport socket\n\nhostname = socket.gethostname()\nif hostname == \"F451C\":\n sys.stdin = open(\"a1.in\")\n\n\ndef read_int_list():\n return list(map(int, input().split()))\n\n\ndef read_str_list():\n return input().split()\n\n\ndef read_int():\n return int(eval(input()))\n\n\ndef read_str():\n return eval(input())\n\n\ndef main_0():\n H, A = read_int_list()\n res = 0\n for i in range(10001):\n H = H - A\n res += 1\n if H <= 0:\n break\n print(res)\n\n\ndef main_1():\n H, A = read_int_list()\n res = H // A\n if H % A != 0:\n res += 1\n print(res)\n\n\ndef main():\n H, A = read_int_list()\n res = 0\n while H > 0:\n H -= A\n res += 1\n print(res)\n\n\nmain()\n", "measured_slow_code_sha256": "d5fe1e3cebc325b88118764de6cebe3ff7e094ae5446fe951fc1767a79f70b68", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 70.77141270556463, "pair_id": "python_v2_7dc68ef818a4074aad68c16d", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02783", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02783_1f1f09c062c70abfa7a9061bb8cfd50f38717113e3d3b88f55dac5f7530ea385.jsonl.gz", "inputs": "reproduction/python/inputs/p02783.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02783_d5fe1e3cebc325b88118764de6cebe3ff7e094ae5446fe951fc1767a79f70b68.jsonl.gz"}, "slow_code": "import sys\nimport socket\n\nhostname = socket.gethostname()\nif hostname == \"F451C\":\n sys.stdin = open(\"a1.in\")\n\n\ndef read_int_list():\n return list(map(int, input().split()))\n\n\ndef read_str_list():\n return input().split()\n\n\ndef read_int():\n return int(eval(input()))\n\n\ndef read_str():\n return eval(input())\n\n\ndef main_0():\n H, A = read_int_list()\n res = 0\n for i in range(10001):\n H = H - A\n res += 1\n if H <= 0:\n break\n print(res)\n\n\ndef main_1():\n H, A = read_int_list()\n res = H // A\n if H % A != 0:\n res += 1\n print(res)\n\n\ndef main():\n H, A = read_int_list()\n res = 0\n while H > 0:\n H -= A\n res += 1\n print(res)\n\n\nmain()\n", "slow_code_sha256": "d5fe1e3cebc325b88118764de6cebe3ff7e094ae5446fe951fc1767a79f70b68", "slow_id": "p02783_d5fe1e3cebc325b88118764de6cebe3ff7e094ae5446fe951fc1767a79f70b68", "speedup": 71.13225463541039, "stratum": "8+", "within_pair_jaccard": 0.175, "workload": {"case_count": 100, "description": "A monster starts with health H; each attack reduces it by A. Find the number of attacks required to reduce health to zero or below. Observed inputs: H=1..10000 (median 5766.5); A=1..10000 (median 4105.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 12, "median": 10.0, "min": 8}, "input_format": ["H A"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p02595_case_000", "p02595_case_001", "p02595_case_002", "p02595_case_003", "p02595_case_004", "p02595_case_005", "p02595_case_006", "p02595_case_007", "p02595_case_008", "p02595_case_009", "p02595_case_010", "p02595_case_011", "p02595_case_012", "p02595_case_013", "p02595_case_014", "p02595_case_015", "p02595_case_016", "p02595_case_017", "p02595_case_018", "p02595_case_019", "p02595_case_020", "p02595_case_021", "p02595_case_022", "p02595_case_023", "p02595_case_024", "p02595_case_025", "p02595_case_026", "p02595_case_027", "p02595_case_028", "p02595_case_029", "p02595_case_030", "p02595_case_031", "p02595_case_032", "p02595_case_033", "p02595_case_034", "p02595_case_035", "p02595_case_036", "p02595_case_037", "p02595_case_038", "p02595_case_039", "p02595_case_040", "p02595_case_041", "p02595_case_042", "p02595_case_043", "p02595_case_044", "p02595_case_045", "p02595_case_046", "p02595_case_047", "p02595_case_048", "p02595_case_049", "p02595_case_050", "p02595_case_051", "p02595_case_052", "p02595_case_053", "p02595_case_054", "p02595_case_055", "p02595_case_056", "p02595_case_057", "p02595_case_058", "p02595_case_059", "p02595_case_060", "p02595_case_061", "p02595_case_062", "p02595_case_063", "p02595_case_064", "p02595_case_065", "p02595_case_066", "p02595_case_067", "p02595_case_068", "p02595_case_069", "p02595_case_070", "p02595_case_071", "p02595_case_072", "p02595_case_073", "p02595_case_074", "p02595_case_075", "p02595_case_076", "p02595_case_077", "p02595_case_078", "p02595_case_079", "p02595_case_080", "p02595_case_081", "p02595_case_082", "p02595_case_083", "p02595_case_084", "p02595_case_085", "p02595_case_086", "p02595_case_087", "p02595_case_088", "p02595_case_089", "p02595_case_090", "p02595_case_091", "p02595_case_092", "p02595_case_093", "p02595_case_094", "p02595_case_095", "p02595_case_096", "p02595_case_097", "p02595_case_098", "p02595_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n, d = list(map(int, input().split()))\nans = 0\nd = d**2\nfor i in range(n):\n x, y = list(map(int, input().split()))\n if d >= x**2 + y**2:\n ans += 1\nprint(ans)\n", "fast_code_sha256": "d9ff430bc8ea080e528cda29abbbe9237aa0ef47408baa025510bd569541c292", "fast_id": "p02595_1880fd82f65524cac8b0fecc254d1238de2e4b2094196bb4071dda25f20a686f", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "# 下手にlist作って呼び出すよりも、逐次計算するほうが早い?\nn, d = list(map(int, input().split()))\nans = 0\nd = d**2\nfor i in range(n):\n x, y = list(map(int, input().split()))\n if d >= x**2 + y**2:\n ans += 1\nprint(ans)\n", "measured_fast_code_sha256": "1880fd82f65524cac8b0fecc254d1238de2e4b2094196bb4071dda25f20a686f", "measured_slow_code": "from decimal import *\n\ngetcontext().prec = 50\nN, D = list(map(int, input().split()))\n\n\ndef distance(x1, x2, y1, y2):\n dx = x2 - x1\n dy = y2 - y1\n return (dx * dx + dy * dy).sqrt()\n\n\nX = [0] * N\nY = [0] * N\nfor i in range(N):\n X[i], Y[i] = list(map(Decimal, input().split()))\nans = 0\nfor i in range(N):\n if distance(0, X[i], 0, Y[i]) <= D:\n ans += 1\nprint(ans)\n", "measured_slow_code_sha256": "1559f276e022453eb8e8e92cd54d60648c4bba1cc009c4b0eef1eaf17b1ef72e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.0446199708549697, "pair_id": "python_v2_6ba0fdc388616825981c8915", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02595", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02595_1880fd82f65524cac8b0fecc254d1238de2e4b2094196bb4071dda25f20a686f.jsonl.gz", "inputs": "reproduction/python/inputs/p02595.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02595_1559f276e022453eb8e8e92cd54d60648c4bba1cc009c4b0eef1eaf17b1ef72e.jsonl.gz"}, "slow_code": "from decimal import *\n\ngetcontext().prec = 50\nN, D = list(map(int, input().split()))\n\n\ndef distance(x1, x2, y1, y2):\n dx = x2 - x1\n dy = y2 - y1\n return (dx * dx + dy * dy).sqrt()\n\n\nX = [0] * N\nY = [0] * N\nfor i in range(N):\n X[i], Y[i] = list(map(Decimal, input().split()))\nans = 0\nfor i in range(N):\n if distance(0, X[i], 0, Y[i]) <= D:\n ans += 1\nprint(ans)\n", "slow_code_sha256": "1559f276e022453eb8e8e92cd54d60648c4bba1cc009c4b0eef1eaf17b1ef72e", "slow_id": "p02595_1559f276e022453eb8e8e92cd54d60648c4bba1cc009c4b0eef1eaf17b1ef72e", "speedup": 4.340593865135875, "stratum": "4-8", "within_pair_jaccard": 0.35, "workload": {"case_count": 100, "description": "Count listed plane points (X_i,Y_i) whose Euclidean distance from the origin is at most D; repeated points count separately. Observed inputs: N=1..200000 (median 100000); D=0..200000 (median 100000); X_i=-200000..200000; Y_i=-200000..200000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 3000082, "median": 1388902.0, "min": 8}, "input_format": ["N D\nX_1 Y_1\n...\nX_N Y_N"], "input_format_status": "source_input_section", "input_lines": {"max": 200001, "median": 100001.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 400002, "median": 200002.0, "min": 4}}} -{"case_ids": ["p03835_case_000", "p03835_case_001", "p03835_case_002", "p03835_case_003", "p03835_case_004", "p03835_case_005", "p03835_case_006", "p03835_case_007", "p03835_case_008", "p03835_case_009", "p03835_case_010", "p03835_case_011", "p03835_case_012", "p03835_case_013", "p03835_case_014", "p03835_case_015", "p03835_case_016", "p03835_case_017", "p03835_case_018", "p03835_case_019", "p03835_case_020", "p03835_case_021", "p03835_case_022", "p03835_case_023", "p03835_case_024", "p03835_case_025", "p03835_case_026", "p03835_case_027", "p03835_case_028", "p03835_case_029", "p03835_case_030", "p03835_case_031", "p03835_case_032", "p03835_case_033", "p03835_case_034", "p03835_case_035", "p03835_case_036", "p03835_case_037", "p03835_case_038", "p03835_case_039", "p03835_case_040", "p03835_case_041", "p03835_case_042", "p03835_case_043", "p03835_case_044", "p03835_case_045", "p03835_case_046", "p03835_case_047", "p03835_case_048", "p03835_case_049", "p03835_case_050", "p03835_case_051", "p03835_case_052", "p03835_case_053", "p03835_case_054", "p03835_case_055", "p03835_case_056", "p03835_case_057", "p03835_case_058", "p03835_case_059", "p03835_case_060", "p03835_case_061", "p03835_case_062", "p03835_case_063", "p03835_case_064", "p03835_case_065", "p03835_case_066", "p03835_case_067", "p03835_case_068", "p03835_case_069", "p03835_case_070", "p03835_case_071", "p03835_case_072", "p03835_case_073", "p03835_case_074", "p03835_case_075", "p03835_case_076", "p03835_case_077", "p03835_case_078", "p03835_case_079", "p03835_case_080", "p03835_case_081", "p03835_case_082", "p03835_case_083", "p03835_case_084", "p03835_case_085", "p03835_case_086", "p03835_case_087", "p03835_case_088", "p03835_case_089", "p03835_case_090", "p03835_case_091", "p03835_case_092", "p03835_case_093", "p03835_case_094", "p03835_case_095", "p03835_case_096", "p03835_case_097", "p03835_case_098", "p03835_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "K, S = list(map(int, input().split()))\ncount = 0\nfor i in range(K + 1):\n if 0 <= S - i < K:\n count += S - i + 1\n elif K <= S - i <= 2 * K:\n count += 2 * K - S + i + 1\n else:\n continue\nprint(count)\n", "fast_code_sha256": "b6fc8ed8192c5f68a9f625043fabee60b0ca872cecc31eb34df8cfab411d7f15", "fast_id": "p03835_b6fc8ed8192c5f68a9f625043fabee60b0ca872cecc31eb34df8cfab411d7f15", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "K, S = list(map(int, input().split()))\ncount = 0\nfor i in range(K + 1):\n if 0 <= S - i < K:\n count += S - i + 1\n elif K <= S - i <= 2 * K:\n count += 2 * K - S + i + 1\n else:\n continue\nprint(count)\n", "measured_fast_code_sha256": "b6fc8ed8192c5f68a9f625043fabee60b0ca872cecc31eb34df8cfab411d7f15", "measured_slow_code": "K, S = list(map(int, input().split()))\ncount = 0\nfor i in range(K + 1):\n for j in range(K + 1):\n if S - K <= i + j <= S:\n count += 1\nprint(count)\n", "measured_slow_code_sha256": "635d8f9332e6bc1c5e85b4adeab9e7a03fc1cd63152cecce14670e5a8c9dd478", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 711.0638528978958, "pair_id": "python_v2_1de2669994f612e5bb76763c", "per_case_slow_code_faster_fraction": 0.07, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03835", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03835_b6fc8ed8192c5f68a9f625043fabee60b0ca872cecc31eb34df8cfab411d7f15.jsonl.gz", "inputs": "reproduction/python/inputs/p03835.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03835_635d8f9332e6bc1c5e85b4adeab9e7a03fc1cd63152cecce14670e5a8c9dd478.jsonl.gz"}, "slow_code": "K, S = list(map(int, input().split()))\ncount = 0\nfor i in range(K + 1):\n for j in range(K + 1):\n if S - K <= i + j <= S:\n count += 1\nprint(count)\n", "slow_code_sha256": "635d8f9332e6bc1c5e85b4adeab9e7a03fc1cd63152cecce14670e5a8c9dd478", "slow_id": "p03835_635d8f9332e6bc1c5e85b4adeab9e7a03fc1cd63152cecce14670e5a8c9dd478", "speedup": 408.65822893083885, "stratum": "8+", "within_pair_jaccard": 0.7619047619047619, "workload": {"case_count": 100, "description": "Count ordered integer triples (X,Y,Z) satisfying 0<=X,Y,Z<=K and X+Y+Z=S. Observed inputs: K=2..2500 (median 1275.5); S=0..7500 (median 1510.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 10, "median": 9.0, "min": 4}, "input_format": ["K S"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p02783_case_000", "p02783_case_001", "p02783_case_002", "p02783_case_003", "p02783_case_004", "p02783_case_005", "p02783_case_006", "p02783_case_007", "p02783_case_008", "p02783_case_009", "p02783_case_010", "p02783_case_011", "p02783_case_012", "p02783_case_013", "p02783_case_014", "p02783_case_015", "p02783_case_016", "p02783_case_017", "p02783_case_018", "p02783_case_019", "p02783_case_020", "p02783_case_021", "p02783_case_022", "p02783_case_023", "p02783_case_024", "p02783_case_025", "p02783_case_026", "p02783_case_027", "p02783_case_028", "p02783_case_029", "p02783_case_030", "p02783_case_031", "p02783_case_032", "p02783_case_033", "p02783_case_034", "p02783_case_035", "p02783_case_036", "p02783_case_037", "p02783_case_038", "p02783_case_039", "p02783_case_040", "p02783_case_041", "p02783_case_042", "p02783_case_043", "p02783_case_044", "p02783_case_045", "p02783_case_046", "p02783_case_047", "p02783_case_048", "p02783_case_049", "p02783_case_050", "p02783_case_051", "p02783_case_052", "p02783_case_053", "p02783_case_054", "p02783_case_055", "p02783_case_056", "p02783_case_057", "p02783_case_058", "p02783_case_059", "p02783_case_060", "p02783_case_061", "p02783_case_062", "p02783_case_063", "p02783_case_064", "p02783_case_065", "p02783_case_066", "p02783_case_067", "p02783_case_068", "p02783_case_069", "p02783_case_070", "p02783_case_071", "p02783_case_072", "p02783_case_073", "p02783_case_074", "p02783_case_075", "p02783_case_076", "p02783_case_077", "p02783_case_078", "p02783_case_079", "p02783_case_080", "p02783_case_081", "p02783_case_082", "p02783_case_083", "p02783_case_084", "p02783_case_085", "p02783_case_086", "p02783_case_087", "p02783_case_088", "p02783_case_089", "p02783_case_090", "p02783_case_091", "p02783_case_092", "p02783_case_093", "p02783_case_094", "p02783_case_095", "p02783_case_096", "p02783_case_097", "p02783_case_098", "p02783_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "h, a = list(map(int, input().split()))\nprint((h // a + (h % a != 0)))\n", "fast_code_sha256": "5f819262a4bf7ab759496af45f54ce6a8a731e1ecbc485904933bc9daabd7720", "fast_id": "p02783_5f819262a4bf7ab759496af45f54ce6a8a731e1ecbc485904933bc9daabd7720", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "h, a = list(map(int, input().split()))\nprint((h // a + (h % a != 0)))\n", "measured_fast_code_sha256": "5f819262a4bf7ab759496af45f54ce6a8a731e1ecbc485904933bc9daabd7720", "measured_slow_code": "import itertools\nimport math\nimport fractions\nimport functools\n\nh, a = list(map(int, input().split()))\nprint((math.ceil(h / a)))\n", "measured_slow_code_sha256": "184009488c3f9f1105e8c0ddedd3260f6b8f0dac17d692456499911136230497", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 48.41317278888127, "pair_id": "python_v2_d334107e98a6aed9bb8a50c3", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02783", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02783_5f819262a4bf7ab759496af45f54ce6a8a731e1ecbc485904933bc9daabd7720.jsonl.gz", "inputs": "reproduction/python/inputs/p02783.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02783_184009488c3f9f1105e8c0ddedd3260f6b8f0dac17d692456499911136230497.jsonl.gz"}, "slow_code": "import itertools\nimport math\nimport fractions\nimport functools\n\nh, a = list(map(int, input().split()))\nprint((math.ceil(h / a)))\n", "slow_code_sha256": "184009488c3f9f1105e8c0ddedd3260f6b8f0dac17d692456499911136230497", "slow_id": "p02783_184009488c3f9f1105e8c0ddedd3260f6b8f0dac17d692456499911136230497", "speedup": 48.37688379317443, "stratum": "8+", "within_pair_jaccard": 0.5714285714285714, "workload": {"case_count": 100, "description": "A monster starts with health H; each attack reduces it by A. Find the number of attacks required to reduce health to zero or below. Observed inputs: H=1..10000 (median 5766.5); A=1..10000 (median 4105.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 12, "median": 10.0, "min": 8}, "input_format": ["H A"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p03962_case_000", "p03962_case_001", "p03962_case_002", "p03962_case_003", "p03962_case_004", "p03962_case_005", "p03962_case_006", "p03962_case_007", "p03962_case_008", "p03962_case_009", "p03962_case_010", "p03962_case_011", "p03962_case_012", "p03962_case_013", "p03962_case_014", "p03962_case_015", "p03962_case_016", "p03962_case_017", "p03962_case_018", "p03962_case_019", "p03962_case_020", "p03962_case_021", "p03962_case_022", "p03962_case_023", "p03962_case_024", "p03962_case_025", "p03962_case_026", "p03962_case_027", "p03962_case_028", "p03962_case_029", "p03962_case_030", "p03962_case_031", "p03962_case_032", "p03962_case_033", "p03962_case_034", "p03962_case_035", "p03962_case_036", "p03962_case_037", "p03962_case_038", "p03962_case_039", "p03962_case_040", "p03962_case_041", "p03962_case_042", "p03962_case_043", "p03962_case_044", "p03962_case_045", "p03962_case_046", "p03962_case_047", "p03962_case_048", "p03962_case_049", "p03962_case_050", "p03962_case_051", "p03962_case_052", "p03962_case_053", "p03962_case_054", "p03962_case_055", "p03962_case_056", "p03962_case_057", "p03962_case_058", "p03962_case_059", "p03962_case_060", "p03962_case_061", "p03962_case_062", "p03962_case_063", "p03962_case_064", "p03962_case_065", "p03962_case_066", "p03962_case_067", "p03962_case_068", "p03962_case_069", "p03962_case_070", "p03962_case_071", "p03962_case_072", "p03962_case_073", "p03962_case_074", "p03962_case_075", "p03962_case_076", "p03962_case_077", "p03962_case_078", "p03962_case_079", "p03962_case_080", "p03962_case_081", "p03962_case_082", "p03962_case_083", "p03962_case_084", "p03962_case_085", "p03962_case_086", "p03962_case_087", "p03962_case_088", "p03962_case_089", "p03962_case_090", "p03962_case_091", "p03962_case_092", "p03962_case_093", "p03962_case_094", "p03962_case_095", "p03962_case_096", "p03962_case_097", "p03962_case_098", "p03962_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "val = input().split()\nprint((len(set(val))))\n", "fast_code_sha256": "f35d664c93547a8f0734929f2a70ef76e32633cb630c84ea37748b64d46b246f", "fast_id": "p03962_f35d664c93547a8f0734929f2a70ef76e32633cb630c84ea37748b64d46b246f", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "val = input().split()\nprint((len(set(val))))\n", "measured_fast_code_sha256": "f35d664c93547a8f0734929f2a70ef76e32633cb630c84ea37748b64d46b246f", "measured_slow_code": "a, b, c = list(map(int, input().split()))\nif a == b == c:\n print((1))\nelif a == c or a == b or b == c:\n print((2))\nelse:\n print((3))\n", "measured_slow_code_sha256": "b860d418d28354f19717276f2ac59e15f9c34db088f6ec4e7e55e82613c6a0bd", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.360793779592499, "pair_id": "python_v2_c47ef491b963311038064221", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03962", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03962_f35d664c93547a8f0734929f2a70ef76e32633cb630c84ea37748b64d46b246f.jsonl.gz", "inputs": "reproduction/python/inputs/p03962.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03962_b860d418d28354f19717276f2ac59e15f9c34db088f6ec4e7e55e82613c6a0bd.jsonl.gz"}, "slow_code": "a, b, c = list(map(int, input().split()))\nif a == b == c:\n print((1))\nelif a == c or a == b or b == c:\n print((2))\nelse:\n print((3))\n", "slow_code_sha256": "b860d418d28354f19717276f2ac59e15f9c34db088f6ec4e7e55e82613c6a0bd", "slow_id": "p03962_b860d418d28354f19717276f2ac59e15f9c34db088f6ec4e7e55e82613c6a0bd", "speedup": 2.3594320804088484, "stratum": "2-4", "within_pair_jaccard": 0.15789473684210525, "workload": {"case_count": 100, "description": "Three paint cans have integer color IDs a,b,c. Count distinct colors among the three, allowing equal IDs. Observed inputs: color_value=1..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 12, "median": 9.0, "min": 6}, "input_format": ["a b c"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3, "median": 3.0, "min": 3}}} -{"case_ids": ["p03775_case_000", "p03775_case_001", "p03775_case_002", "p03775_case_003", "p03775_case_004", "p03775_case_005", "p03775_case_006", "p03775_case_007", "p03775_case_008", "p03775_case_009", "p03775_case_010", "p03775_case_011", "p03775_case_012", "p03775_case_013", "p03775_case_014", "p03775_case_015", "p03775_case_016", "p03775_case_017", "p03775_case_018", "p03775_case_019", "p03775_case_020", "p03775_case_021", "p03775_case_022", "p03775_case_023", "p03775_case_024", "p03775_case_025", "p03775_case_026", "p03775_case_027", "p03775_case_028", "p03775_case_029", "p03775_case_030", "p03775_case_031", "p03775_case_032", "p03775_case_033", "p03775_case_034", "p03775_case_035", "p03775_case_036", "p03775_case_037", "p03775_case_038", "p03775_case_039", "p03775_case_040", "p03775_case_041", "p03775_case_042", "p03775_case_043", "p03775_case_044", "p03775_case_045", "p03775_case_046", "p03775_case_047", "p03775_case_048", "p03775_case_049", "p03775_case_050", "p03775_case_051", "p03775_case_052", "p03775_case_053", "p03775_case_054", "p03775_case_055", "p03775_case_056", "p03775_case_057", "p03775_case_058", "p03775_case_059", "p03775_case_060", "p03775_case_061", "p03775_case_062", "p03775_case_063", "p03775_case_064", "p03775_case_065", "p03775_case_066", "p03775_case_067", "p03775_case_068", "p03775_case_069", "p03775_case_070", "p03775_case_071", "p03775_case_072", "p03775_case_073", "p03775_case_074", "p03775_case_075", "p03775_case_076", "p03775_case_077", "p03775_case_078", "p03775_case_079", "p03775_case_080", "p03775_case_081", "p03775_case_082", "p03775_case_083", "p03775_case_084", "p03775_case_085", "p03775_case_086", "p03775_case_087", "p03775_case_088", "p03775_case_089", "p03775_case_090", "p03775_case_091", "p03775_case_092", "p03775_case_093", "p03775_case_094", "p03775_case_095", "p03775_case_096", "p03775_case_097", "p03775_case_098", "p03775_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def make_divisors(n):\n divisors = []\n for i in range(1, int(n**0.5) + 1):\n if n % i == 0:\n divisors.append(i)\n if i != n // i:\n divisors.append(n // i)\n\n return divisors\n\n\nN = int(eval(input()))\nprint((len(str(make_divisors(N)[-1]))))\n", "fast_code_sha256": "dc52fcca43e4161ca70eff85cf522e1eb8d1d11b0f796475dbf29d5555b3a739", "fast_id": "p03775_acca2850455de4c78e5db21e3945678e4d2ae2960bc5adfd581d28d8eef93501", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def make_divisors(n):\n divisors = []\n for i in range(1, int(n**0.5) + 1):\n if n % i == 0:\n divisors.append(i)\n if i != n // i:\n divisors.append(n // i)\n # divisors.sort()\n return divisors\n\n\nN = int(eval(input()))\nprint((len(str(make_divisors(N)[-1]))))\n", "measured_fast_code_sha256": "acca2850455de4c78e5db21e3945678e4d2ae2960bc5adfd581d28d8eef93501", "measured_slow_code": "n = int(eval(input()))\n\n\ndef cal(a):\n return len(str(a))\n\n\nm = 11\nfor j in range(1, 10**6 + 1):\n if n % j == 0:\n m = min(m, max(cal(j), cal(n // j)))\n # print(m)\nprint(m)\n", "measured_slow_code_sha256": "7ab001f5efb675596da434bf3ef9e7fa9f9ec3b0d345cb8726f7720241f1422c", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 322.1047759598129, "pair_id": "python_v2_a34467088c912653fb3e9fbf", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03775", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03775_acca2850455de4c78e5db21e3945678e4d2ae2960bc5adfd581d28d8eef93501.jsonl.gz", "inputs": "reproduction/python/inputs/p03775.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03775_7ab001f5efb675596da434bf3ef9e7fa9f9ec3b0d345cb8726f7720241f1422c.jsonl.gz"}, "slow_code": "n = int(eval(input()))\n\n\ndef cal(a):\n return len(str(a))\n\n\nm = 11\nfor j in range(1, 10**6 + 1):\n if n % j == 0:\n m = min(m, max(cal(j), cal(n // j)))\n\nprint(m)\n", "slow_code_sha256": "0bd50a29ee4b8ed24f88df4bdfcabb76a7a6778570de4e74b5c8ddab42febd8f", "slow_id": "p03775_7ab001f5efb675596da434bf3ef9e7fa9f9ec3b0d345cb8726f7720241f1422c", "speedup": 246.38014414579163, "stratum": "8+", "within_pair_jaccard": 0.5, "workload": {"case_count": 100, "description": "Among positive integer factorizations A*B=N, minimize the larger decimal digit count of A and B. Observed inputs: N=1..10000000000 (median 15771778).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 12, "median": 9.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p02392_case_000", "p02392_case_001", "p02392_case_002", "p02392_case_003", "p02392_case_004", "p02392_case_005", "p02392_case_006", "p02392_case_007", "p02392_case_008", "p02392_case_009", "p02392_case_010", "p02392_case_011", "p02392_case_012", "p02392_case_013", "p02392_case_014", "p02392_case_015", "p02392_case_016", "p02392_case_017", "p02392_case_018", "p02392_case_019", "p02392_case_020", "p02392_case_021", "p02392_case_022", "p02392_case_023", "p02392_case_024", "p02392_case_025", "p02392_case_026", "p02392_case_027", "p02392_case_028", "p02392_case_029", "p02392_case_030", "p02392_case_031", "p02392_case_032", "p02392_case_033", "p02392_case_034", "p02392_case_035", "p02392_case_036", "p02392_case_037", "p02392_case_038", "p02392_case_039", "p02392_case_040", "p02392_case_041", "p02392_case_042", "p02392_case_043", "p02392_case_044", "p02392_case_045", "p02392_case_046", "p02392_case_047", "p02392_case_048", "p02392_case_049", "p02392_case_050", "p02392_case_051", "p02392_case_052", "p02392_case_053", "p02392_case_054", "p02392_case_055", "p02392_case_056", "p02392_case_057", "p02392_case_058", "p02392_case_059", "p02392_case_060", "p02392_case_061", "p02392_case_062", "p02392_case_063", "p02392_case_064", "p02392_case_065", "p02392_case_066", "p02392_case_067", "p02392_case_068", "p02392_case_069", "p02392_case_070", "p02392_case_071", "p02392_case_072", "p02392_case_073", "p02392_case_074", "p02392_case_075", "p02392_case_076", "p02392_case_077", "p02392_case_078", "p02392_case_079", "p02392_case_080", "p02392_case_081", "p02392_case_082", "p02392_case_083", "p02392_case_084", "p02392_case_085", "p02392_case_086", "p02392_case_087", "p02392_case_088", "p02392_case_089", "p02392_case_090", "p02392_case_091", "p02392_case_092", "p02392_case_093", "p02392_case_094", "p02392_case_095", "p02392_case_096", "p02392_case_097", "p02392_case_098", "p02392_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "[a, b, c] = list(map(int, input().split()))\nprint(({True: \"Yes\", False: \"No\"}[a < b < c]))\n", "fast_code_sha256": "13f6206637df99c95d420fdbd5f7932e864745dc78bd6e36e4163071448074c2", "fast_id": "p02392_13f6206637df99c95d420fdbd5f7932e864745dc78bd6e36e4163071448074c2", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "[a, b, c] = list(map(int, input().split()))\nprint(({True: \"Yes\", False: \"No\"}[a < b < c]))\n", "measured_fast_code_sha256": "13f6206637df99c95d420fdbd5f7932e864745dc78bd6e36e4163071448074c2", "measured_slow_code": "# coding:UTF-8\nimport copy\n\nn = list(map(int, input().split()))\nif n[0] < n[1] < n[2]:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "measured_slow_code_sha256": "de04487b5a08627844d61298f885965ab158d25d2bda51807fc27addaf67096b", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 11.037006554127736, "pair_id": "python_v2_6e5851838c5a974140e9de49", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02392", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02392_13f6206637df99c95d420fdbd5f7932e864745dc78bd6e36e4163071448074c2.jsonl.gz", "inputs": "reproduction/python/inputs/p02392.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02392_de04487b5a08627844d61298f885965ab158d25d2bda51807fc27addaf67096b.jsonl.gz"}, "slow_code": "import copy\n\nn = list(map(int, input().split()))\nif n[0] < n[1] < n[2]:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "slow_code_sha256": "c3d3757a61b38da19ec84678b61451515bf53604660861738644c471aeb44260", "slow_id": "p02392_de04487b5a08627844d61298f885965ab158d25d2bda51807fc27addaf67096b", "speedup": 11.03626647147546, "stratum": "8+", "within_pair_jaccard": 0.38095238095238093, "workload": {"case_count": 100, "description": "Read three integers a,b,c and decide whether a K:\n break\n dp[i + a] = 1\n print((\"First\" if dp[-1] else \"Second\"))\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "a2624425a9b93e6559ac62ba782b26bed674b805c5d6c4a13b00b3b9cc35d295", "fast_id": "p03170_a2624425a9b93e6559ac62ba782b26bed674b805c5d6c4a13b00b3b9cc35d295", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def main():\n N, K, *A = list(map(int, open(0).read().split()))\n dp = [0] * (K + 1)\n for i in range(K):\n if dp[i]:\n continue\n for a in A:\n if i + a > K:\n break\n dp[i + a] = 1\n print((\"First\" if dp[-1] else \"Second\"))\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "a2624425a9b93e6559ac62ba782b26bed674b805c5d6c4a13b00b3b9cc35d295", "measured_slow_code": "N, K = list(map(int, input().split()))\na = list(map(int, input().split()))\ndp = [0] * (K + 1)\nfor i in range(1, K + 1):\n for j in a:\n if i - j >= 0 and dp[i - j] == 0:\n dp[i] = 1\nprint((\"First\" if dp[K] else \"Second\"))\n", "measured_slow_code_sha256": "c085b7a6374193711652498cebb1aaf3bcd497df96941cabfee675a4f16a9afe", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 29.82271955536328, "pair_id": "python_v2_98cc96ef2fdc4d542deb4e67", "per_case_slow_code_faster_fraction": 0.02, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03170", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03170_a2624425a9b93e6559ac62ba782b26bed674b805c5d6c4a13b00b3b9cc35d295.jsonl.gz", "inputs": "reproduction/python/inputs/p03170.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03170_c085b7a6374193711652498cebb1aaf3bcd497df96941cabfee675a4f16a9afe.jsonl.gz"}, "slow_code": "N, K = list(map(int, input().split()))\na = list(map(int, input().split()))\ndp = [0] * (K + 1)\nfor i in range(1, K + 1):\n for j in a:\n if i - j >= 0 and dp[i - j] == 0:\n dp[i] = 1\nprint((\"First\" if dp[K] else \"Second\"))\n", "slow_code_sha256": "c085b7a6374193711652498cebb1aaf3bcd497df96941cabfee675a4f16a9afe", "slow_id": "p03170_c085b7a6374193711652498cebb1aaf3bcd497df96941cabfee675a4f16a9afe", "speedup": 22.525635568528827, "stratum": "8+", "within_pair_jaccard": 0.6129032258064516, "workload": {"case_count": 100, "description": "Two optimal players alternate removing a permitted number of stones from a pile initially of size K. Allowed removals a_i form a strictly increasing set of N integers. The first player unable to move loses; determine the winner. Observed inputs: N=1..100 (median 100); K=1..100000 (median 100000); a_i=1..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 610, "median": 597.5, "min": 6}, "input_format": ["N K\na_1 ... a_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 102, "median": 102.0, "min": 3}}} -{"case_ids": ["p03786_case_000", "p03786_case_001", "p03786_case_002", "p03786_case_003", "p03786_case_004", "p03786_case_005", "p03786_case_006", "p03786_case_007", "p03786_case_008", "p03786_case_009", "p03786_case_010", "p03786_case_011", "p03786_case_012", "p03786_case_013", "p03786_case_014", "p03786_case_015", "p03786_case_016", "p03786_case_017", "p03786_case_018", "p03786_case_019", "p03786_case_020", "p03786_case_021", "p03786_case_022", "p03786_case_023", "p03786_case_024", "p03786_case_025", "p03786_case_026", "p03786_case_027", "p03786_case_028", "p03786_case_029", "p03786_case_030", "p03786_case_031", "p03786_case_032", "p03786_case_033", "p03786_case_034", "p03786_case_035", "p03786_case_036", "p03786_case_037", "p03786_case_038", "p03786_case_039", "p03786_case_040", "p03786_case_041", "p03786_case_042", "p03786_case_043", "p03786_case_044", "p03786_case_045", "p03786_case_046", "p03786_case_047", "p03786_case_048", "p03786_case_049", "p03786_case_050", "p03786_case_051", "p03786_case_052", "p03786_case_053", "p03786_case_054", "p03786_case_055", "p03786_case_056", "p03786_case_057", "p03786_case_058", "p03786_case_059", "p03786_case_060", "p03786_case_061", "p03786_case_062", "p03786_case_063", "p03786_case_064", "p03786_case_065", "p03786_case_066", "p03786_case_067", "p03786_case_068", "p03786_case_069", "p03786_case_070", "p03786_case_071", "p03786_case_072", "p03786_case_073", "p03786_case_074", "p03786_case_075", "p03786_case_076", "p03786_case_077", "p03786_case_078", "p03786_case_079", "p03786_case_080", "p03786_case_081", "p03786_case_082", "p03786_case_083", "p03786_case_084", "p03786_case_085", "p03786_case_086", "p03786_case_087", "p03786_case_088", "p03786_case_089", "p03786_case_090", "p03786_case_091", "p03786_case_092", "p03786_case_093", "p03786_case_094", "p03786_case_095", "p03786_case_096", "p03786_case_097", "p03786_case_098", "p03786_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import heapq\n\nn = int(eval(input()))\nA = list(map(int, input().split()))\nheapq.heapify(A)\ncnt = 1\nprev = heapq.heappop(A)\nwhile A:\n x = heapq.heappop(A)\n if prev > x:\n heapq.heappush(A, prev)\n prev = x\n continue\n if 2 * prev < x:\n cnt = 1\n else:\n cnt += 1\n prev += x\nprint(cnt)\n", "fast_code_sha256": "cd86bc221b6a805ec5c0b4610756b6c0dee20a7d792dce9a278bfe2e5dbc91f2", "fast_id": "p03786_cd86bc221b6a805ec5c0b4610756b6c0dee20a7d792dce9a278bfe2e5dbc91f2", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import heapq\n\nn = int(eval(input()))\nA = list(map(int, input().split()))\nheapq.heapify(A)\ncnt = 1\nprev = heapq.heappop(A)\nwhile A:\n x = heapq.heappop(A)\n if prev > x:\n heapq.heappush(A, prev)\n prev = x\n continue\n if 2 * prev < x:\n cnt = 1\n else:\n cnt += 1\n prev += x\nprint(cnt)\n", "measured_fast_code_sha256": "cd86bc221b6a805ec5c0b4610756b6c0dee20a7d792dce9a278bfe2e5dbc91f2", "measured_slow_code": "n = int(eval(input()))\na = list(map(int, input().split()))\nimport numpy as np\n\na = sorted(a)\ncum = np.cumsum(a)\ncum = list(reversed(cum))\na = list(reversed(a))\nans = 1\nfor i in range(1, n):\n if a[i - 1] <= cum[i] * 2:\n ans += 1\n else:\n break\nprint(ans)\n", "measured_slow_code_sha256": "9c47b5351287e97e1c5de7875f912e9de0349c4286a89e13a6aa097ca0c9f946", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 693.0785556239946, "pair_id": "python_v2_b42ef2850dd53bc85535d39c", "per_case_slow_code_faster_fraction": 0.26, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03786", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03786_cd86bc221b6a805ec5c0b4610756b6c0dee20a7d792dce9a278bfe2e5dbc91f2.jsonl.gz", "inputs": "reproduction/python/inputs/p03786.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03786_9c47b5351287e97e1c5de7875f912e9de0349c4286a89e13a6aa097ca0c9f946.jsonl.gz"}, "slow_code": "n = int(eval(input()))\na = list(map(int, input().split()))\nimport numpy as np\n\na = sorted(a)\ncum = np.cumsum(a)\ncum = list(reversed(cum))\na = list(reversed(a))\nans = 1\nfor i in range(1, n):\n if a[i - 1] <= cum[i] * 2:\n ans += 1\n else:\n break\nprint(ans)\n", "slow_code_sha256": "9c47b5351287e97e1c5de7875f912e9de0349c4286a89e13a6aa097ca0c9f946", "slow_id": "p03786_9c47b5351287e97e1c5de7875f912e9de0349c4286a89e13a6aa097ca0c9f946", "speedup": 83.46545191733904, "stratum": "8+", "within_pair_jaccard": 0.35135135135135137, "workload": {"case_count": 100, "description": "N creatures have distinct colors and sizes A_i. A creature of size A may absorb one of size C<=2*A; its size becomes A+C and its color survives. Count colors that can remain after all creatures merge. Observed inputs: N=2..100000 (median 10); A_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1100007, "median": 101.5, "min": 14}, "input_format": ["N\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100001, "median": 11.0, "min": 3}}} -{"case_ids": ["p03282_case_000", "p03282_case_001", "p03282_case_002", "p03282_case_003", "p03282_case_004", "p03282_case_005", "p03282_case_006", "p03282_case_007", "p03282_case_008", "p03282_case_009", "p03282_case_010", "p03282_case_011", "p03282_case_012", "p03282_case_013", "p03282_case_014", "p03282_case_015", "p03282_case_016", "p03282_case_017", "p03282_case_018", "p03282_case_019", "p03282_case_020", "p03282_case_021", "p03282_case_022", "p03282_case_023", "p03282_case_024", "p03282_case_025", "p03282_case_026", "p03282_case_027", "p03282_case_028", "p03282_case_029", "p03282_case_030", "p03282_case_031", "p03282_case_032", "p03282_case_033", "p03282_case_034", "p03282_case_035", "p03282_case_036", "p03282_case_037", "p03282_case_038", "p03282_case_039", "p03282_case_040", "p03282_case_041", "p03282_case_042", "p03282_case_043", "p03282_case_044", "p03282_case_045", "p03282_case_046", "p03282_case_047", "p03282_case_048", "p03282_case_049", "p03282_case_050", "p03282_case_051", "p03282_case_052", "p03282_case_053", "p03282_case_054", "p03282_case_055", "p03282_case_056", "p03282_case_057", "p03282_case_058", "p03282_case_059", "p03282_case_060", "p03282_case_061", "p03282_case_062", "p03282_case_063", "p03282_case_064", "p03282_case_065", "p03282_case_066", "p03282_case_067", "p03282_case_068", "p03282_case_069", "p03282_case_070", "p03282_case_071", "p03282_case_072", "p03282_case_073", "p03282_case_074", "p03282_case_075", "p03282_case_076", "p03282_case_077", "p03282_case_078", "p03282_case_079", "p03282_case_080", "p03282_case_081", "p03282_case_082", "p03282_case_083", "p03282_case_084", "p03282_case_085", "p03282_case_086", "p03282_case_087", "p03282_case_088", "p03282_case_089", "p03282_case_090", "p03282_case_091", "p03282_case_092", "p03282_case_093", "p03282_case_094", "p03282_case_095", "p03282_case_096", "p03282_case_097", "p03282_case_098", "p03282_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "S = input().strip()\nK = int(eval(input()))\na = \"1\"\nind = len(S)\nfor i in range(len(S)):\n if S[i] != \"1\":\n a = S[i]\n ind = i\n break\nif K <= ind:\n print((1))\nelse:\n print(a)\n", "fast_code_sha256": "1585f7c816c61ee84ae580c4fa815d49f968960ba50b2ab97d6fd0ea6f1e7103", "fast_id": "p03282_1585f7c816c61ee84ae580c4fa815d49f968960ba50b2ab97d6fd0ea6f1e7103", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "S = input().strip()\nK = int(eval(input()))\na = \"1\"\nind = len(S)\nfor i in range(len(S)):\n if S[i] != \"1\":\n a = S[i]\n ind = i\n break\nif K <= ind:\n print((1))\nelse:\n print(a)\n", "measured_fast_code_sha256": "1585f7c816c61ee84ae580c4fa815d49f968960ba50b2ab97d6fd0ea6f1e7103", "measured_slow_code": "import numpy as np\n\nS = np.array(list(map(str, input().rstrip())))\nK = int(eval(input()))\ncnt = 0\nans = 1\nfor i, s in enumerate(S):\n if s != \"1\":\n cnt = i + 1\n ans = s\n break\nif cnt > K:\n print((1))\nelse:\n print((int(ans)))\n", "measured_slow_code_sha256": "c6afbfabb4f57c620b796822aa793c63e616de41f9eb4e63aa7e8f88e45d1110", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1003.1203646400554, "pair_id": "python_v2_ac37d4240f90beee42b6e5b5", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03282", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03282_1585f7c816c61ee84ae580c4fa815d49f968960ba50b2ab97d6fd0ea6f1e7103.jsonl.gz", "inputs": "reproduction/python/inputs/p03282.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03282_c6afbfabb4f57c620b796822aa793c63e616de41f9eb4e63aa7e8f88e45d1110.jsonl.gz"}, "slow_code": "import numpy as np\n\nS = np.array(list(map(str, input().rstrip())))\nK = int(eval(input()))\ncnt = 0\nans = 1\nfor i, s in enumerate(S):\n if s != \"1\":\n cnt = i + 1\n ans = s\n break\nif cnt > K:\n print((1))\nelse:\n print((int(ans)))\n", "slow_code_sha256": "c6afbfabb4f57c620b796822aa793c63e616de41f9eb4e63aa7e8f88e45d1110", "slow_id": "p03282_c6afbfabb4f57c620b796822aa793c63e616de41f9eb4e63aa7e8f88e45d1110", "speedup": 961.1710736225066, "stratum": "8+", "within_pair_jaccard": 0.40625, "workload": {"case_count": 100, "description": "On each day, simultaneously replace digit d by d copies of itself, for digits 1..9. Find the 1-based K-th character after 5*10^15 days starting from S; the expanded string is guaranteed long enough. Observed inputs: S_length=1..100 (median 100); K=1..1000000000000000000; digit=1..9.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 121, "median": 103.0, "min": 4}, "input_format": ["S\nK"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p00741_case_000", "p00741_case_001", "p00741_case_002", "p00741_case_003", "p00741_case_004", "p00741_case_005", "p00741_case_006", "p00741_case_007", "p00741_case_008", "p00741_case_009", "p00741_case_010", "p00741_case_011", "p00741_case_012", "p00741_case_013", "p00741_case_014", "p00741_case_015", "p00741_case_016", "p00741_case_017", "p00741_case_018", "p00741_case_019", "p00741_case_020", "p00741_case_021", "p00741_case_022", "p00741_case_023", "p00741_case_024", "p00741_case_025", "p00741_case_026", "p00741_case_027", "p00741_case_028", "p00741_case_029", "p00741_case_030", "p00741_case_031", "p00741_case_032", "p00741_case_033", "p00741_case_034", "p00741_case_035", "p00741_case_036", "p00741_case_037", "p00741_case_038", "p00741_case_039", "p00741_case_040", "p00741_case_041", "p00741_case_042", "p00741_case_043", "p00741_case_044", "p00741_case_045", "p00741_case_046", "p00741_case_047", "p00741_case_048", "p00741_case_049", "p00741_case_050", "p00741_case_051", "p00741_case_052", "p00741_case_053", "p00741_case_054", "p00741_case_055", "p00741_case_056", "p00741_case_057", "p00741_case_058", "p00741_case_059", "p00741_case_060", "p00741_case_061", "p00741_case_062", "p00741_case_063", "p00741_case_064", "p00741_case_065", "p00741_case_066", "p00741_case_067", "p00741_case_068", "p00741_case_069", "p00741_case_070", "p00741_case_071", "p00741_case_072", "p00741_case_073", "p00741_case_074", "p00741_case_075", "p00741_case_076", "p00741_case_077", "p00741_case_078", "p00741_case_079", "p00741_case_080", "p00741_case_081", "p00741_case_082", "p00741_case_083", "p00741_case_084", "p00741_case_085", "p00741_case_086", "p00741_case_087", "p00741_case_088", "p00741_case_089", "p00741_case_090", "p00741_case_091", "p00741_case_092", "p00741_case_093", "p00741_case_094", "p00741_case_095", "p00741_case_096", "p00741_case_097", "p00741_case_098", "p00741_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\nsys.setrecursionlimit(10**6)\n\n\ndef erase(x, y):\n c[y][x] = \"0\"\n for dx, dy in (\n (1, 0),\n (1, 1),\n (0, 1),\n (-1, 1),\n (-1, 0),\n (-1, -1),\n (0, -1),\n (1, -1),\n ):\n nx, ny = x + dx, y + dy\n if 0 <= nx <= w - 1 and 0 <= ny <= h - 1:\n if c[ny][nx] == \"1\":\n erase(nx, ny)\n\n\nwhile True:\n w, h = list(map(int, input().split()))\n if w == h == 0:\n break\n c = [[i for i in input().split()] for _ in range(h)]\n ans = 0\n for y in range(h):\n for x in range(w):\n if c[y][x] == \"1\":\n ans += 1\n erase(x, y)\n print(ans)\n", "fast_code_sha256": "75bc083c3de58ec3448c04919e6f7253b0131fe4e61bf7c18ee35a3ac4325bdb", "fast_id": "p00741_75bc083c3de58ec3448c04919e6f7253b0131fe4e61bf7c18ee35a3ac4325bdb", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\nsys.setrecursionlimit(10**6)\n\n\ndef erase(x, y):\n c[y][x] = \"0\"\n for dx, dy in (\n (1, 0),\n (1, 1),\n (0, 1),\n (-1, 1),\n (-1, 0),\n (-1, -1),\n (0, -1),\n (1, -1),\n ):\n nx, ny = x + dx, y + dy\n if 0 <= nx <= w - 1 and 0 <= ny <= h - 1:\n if c[ny][nx] == \"1\":\n erase(nx, ny)\n\n\nwhile True:\n w, h = list(map(int, input().split()))\n if w == h == 0:\n break\n c = [[i for i in input().split()] for _ in range(h)]\n ans = 0\n for y in range(h):\n for x in range(w):\n if c[y][x] == \"1\":\n ans += 1\n erase(x, y)\n print(ans)\n", "measured_fast_code_sha256": "75bc083c3de58ec3448c04919e6f7253b0131fe4e61bf7c18ee35a3ac4325bdb", "measured_slow_code": "import sys\nfrom pprint import pprint\n\n\nclass UnionFind:\n def __init__(self):\n self._parent = {}\n self._rank = {}\n self._equiv = {}\n\n def _find(self, x):\n if self._parent[x] == x:\n return self._parent[x]\n else:\n p = self._find(self._parent[x])\n self._parent[x] = p\n return p\n\n def _set_parent(self, child, parent):\n self._parent[child] = parent\n self._equiv[parent].update(self._equiv.pop(child))\n\n def _union(self, x, y):\n x = self._find(x)\n y = self._find(y)\n if x == y:\n return\n if self._rank[x] > self._rank[y]:\n self._set_parent(y, x)\n elif self._rank[x] < self._rank[y]:\n self._set_parent(x, y)\n else:\n self._set_parent(x, y)\n self._rank[x] += 1\n\n def _make_set(self, x):\n self._parent[x] = x\n self._rank[x] = 0\n self._equiv[x] = {x}\n\n def unite(self, *elements):\n if not elements:\n return\n for x in elements:\n if x in self._parent:\n continue\n self._make_set(x)\n x0 = elements[0]\n for x in elements[1:]:\n self._union(x0, x)\n\n def groups(self):\n return [set(e) for e in list(self._equiv.values())]\n\n\ndef solve(ncol, nrow, rows):\n pairs = []\n # ?????????\n for x in range(ncol - 1):\n for y in range(nrow):\n pairs.append([(x, y), (x + 1, y)])\n # ?????????\n for x in range(ncol):\n for y in range(nrow - 1):\n pairs.append([(x, y), (x, y + 1)])\n # ???????????????\n for x in range(ncol - 1):\n for y in range(nrow - 1):\n pairs.append([(x, y), (x + 1, y + 1)])\n # ???????????????\n for x in range(ncol - 1):\n for y in range(1, nrow):\n pairs.append([(x, y), (x + 1, y - 1)])\n f = UnionFind()\n for x in range(ncol):\n for y in range(nrow):\n if rows[y][x]:\n f.unite((x, y))\n for (x1, y1), (x2, y2) in pairs:\n if rows[y1][x1] and rows[y2][x2]:\n f.unite((x1, y1), (x2, y2))\n return len(f.groups())\n\n\ndef main():\n while True:\n ncol, nrow = list(map(int, input().split()))\n if ncol == 0 and nrow == 0:\n break\n rows = []\n for _ in range(nrow):\n row = list(map(int, input().split()))\n rows.append(row)\n # print(ncol, nrow)\n # pprint(rows)\n print((solve(ncol, nrow, rows)))\n\n\nmain()\n", "measured_slow_code_sha256": "8dc05be20af5e5075433e403978246b6c79a92c743c71aa185196282e815a1ee", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.4352622021409083, "pair_id": "python_v2_7d2b5564e89f2907fb20b381", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p00741", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p00741_75bc083c3de58ec3448c04919e6f7253b0131fe4e61bf7c18ee35a3ac4325bdb.jsonl.gz", "inputs": "reproduction/python/inputs/p00741.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p00741_8dc05be20af5e5075433e403978246b6c79a92c743c71aa185196282e815a1ee.jsonl.gz"}, "slow_code": "import sys\nfrom pprint import pprint\n\n\nclass UnionFind:\n def __init__(self):\n self._parent = {}\n self._rank = {}\n self._equiv = {}\n\n def _find(self, x):\n if self._parent[x] == x:\n return self._parent[x]\n else:\n p = self._find(self._parent[x])\n self._parent[x] = p\n return p\n\n def _set_parent(self, child, parent):\n self._parent[child] = parent\n self._equiv[parent].update(self._equiv.pop(child))\n\n def _union(self, x, y):\n x = self._find(x)\n y = self._find(y)\n if x == y:\n return\n if self._rank[x] > self._rank[y]:\n self._set_parent(y, x)\n elif self._rank[x] < self._rank[y]:\n self._set_parent(x, y)\n else:\n self._set_parent(x, y)\n self._rank[x] += 1\n\n def _make_set(self, x):\n self._parent[x] = x\n self._rank[x] = 0\n self._equiv[x] = {x}\n\n def unite(self, *elements):\n if not elements:\n return\n for x in elements:\n if x in self._parent:\n continue\n self._make_set(x)\n x0 = elements[0]\n for x in elements[1:]:\n self._union(x0, x)\n\n def groups(self):\n return [set(e) for e in list(self._equiv.values())]\n\n\ndef solve(ncol, nrow, rows):\n pairs = []\n\n for x in range(ncol - 1):\n for y in range(nrow):\n pairs.append([(x, y), (x + 1, y)])\n\n for x in range(ncol):\n for y in range(nrow - 1):\n pairs.append([(x, y), (x, y + 1)])\n\n for x in range(ncol - 1):\n for y in range(nrow - 1):\n pairs.append([(x, y), (x + 1, y + 1)])\n\n for x in range(ncol - 1):\n for y in range(1, nrow):\n pairs.append([(x, y), (x + 1, y - 1)])\n f = UnionFind()\n for x in range(ncol):\n for y in range(nrow):\n if rows[y][x]:\n f.unite((x, y))\n for (x1, y1), (x2, y2) in pairs:\n if rows[y1][x1] and rows[y2][x2]:\n f.unite((x1, y1), (x2, y2))\n return len(f.groups())\n\n\ndef main():\n while True:\n ncol, nrow = list(map(int, input().split()))\n if ncol == 0 and nrow == 0:\n break\n rows = []\n for _ in range(nrow):\n row = list(map(int, input().split()))\n rows.append(row)\n\n print((solve(ncol, nrow, rows)))\n\n\nmain()\n", "slow_code_sha256": "98d0d93fa34ee5017dabd2c7cc8ffe301917d35141c767ea46a7bc955a0514a7", "slow_id": "p00741_8dc05be20af5e5075433e403978246b6c79a92c743c71aa185196282e815a1ee", "speedup": 3.6052389586982043, "stratum": "2-4", "within_pair_jaccard": 0.27848101265822783, "workload": {"case_count": 100, "description": "For each binary map of width w and height h, count land components using horizontal, vertical and diagonal adjacency. Values 1 and 0 denote land and sea; outside the map is sea. A final 0 0 ends the maps. Observed inputs: datasets=1..50 (median 1); w=1..50; h=1..50; cells_per_map=1..2500; total_cells=1..12500 (median 2500).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 25034, "median": 5010.0, "min": 10}, "input_format": ["w_1 h_1\n[h_1 rows of w_1 binary integers]\n[next maps]\n0 0"], "input_format_status": "source_input_section", "input_lines": {"max": 551, "median": 52.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 12512, "median": 2504.0, "min": 5}}} -{"case_ids": ["p03448_case_000", "p03448_case_001", "p03448_case_002", "p03448_case_003", "p03448_case_004", "p03448_case_005", "p03448_case_006", "p03448_case_007", "p03448_case_008", "p03448_case_009", "p03448_case_010", "p03448_case_011", "p03448_case_012", "p03448_case_013", "p03448_case_014", "p03448_case_015", "p03448_case_016", "p03448_case_017", "p03448_case_018", "p03448_case_019", "p03448_case_020", "p03448_case_021", "p03448_case_022", "p03448_case_023", "p03448_case_024", "p03448_case_025", "p03448_case_026", "p03448_case_027", "p03448_case_028", "p03448_case_029", "p03448_case_030", "p03448_case_031", "p03448_case_032", "p03448_case_033", "p03448_case_034", "p03448_case_035", "p03448_case_036", "p03448_case_037", "p03448_case_038", "p03448_case_039", "p03448_case_040", "p03448_case_041", "p03448_case_042", "p03448_case_043", "p03448_case_044", "p03448_case_045", "p03448_case_046", "p03448_case_047", "p03448_case_048", "p03448_case_049", "p03448_case_050", "p03448_case_051", "p03448_case_052", "p03448_case_053", "p03448_case_054", "p03448_case_055", "p03448_case_056", "p03448_case_057", "p03448_case_058", "p03448_case_059", "p03448_case_060", "p03448_case_061", "p03448_case_062", "p03448_case_063", "p03448_case_064", "p03448_case_065", "p03448_case_066", "p03448_case_067", "p03448_case_068", "p03448_case_069", "p03448_case_070", "p03448_case_071", "p03448_case_072", "p03448_case_073", "p03448_case_074", "p03448_case_075", "p03448_case_076", "p03448_case_077", "p03448_case_078", "p03448_case_079", "p03448_case_080", "p03448_case_081", "p03448_case_082", "p03448_case_083", "p03448_case_084", "p03448_case_085", "p03448_case_086", "p03448_case_087", "p03448_case_088", "p03448_case_089", "p03448_case_090", "p03448_case_091", "p03448_case_092", "p03448_case_093", "p03448_case_094", "p03448_case_095", "p03448_case_096", "p03448_case_097", "p03448_case_098", "p03448_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "a = int(eval(input()))\nb = int(eval(input()))\nc = int(eval(input()))\nx = int(eval(input()))\ncnt = 0\nfor i in range(a + 1):\n for j in range(b + 1):\n z = x - (500 * i + 100 * j)\n if z < 0:\n break\n if z / 50 <= c:\n cnt += 1\nprint(cnt)\n", "fast_code_sha256": "8404e89cbf1c791684ce4a4f537d312fb41b351a10f8732dc67cba4fa1c1a2cc", "fast_id": "p03448_8404e89cbf1c791684ce4a4f537d312fb41b351a10f8732dc67cba4fa1c1a2cc", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "a = int(eval(input()))\nb = int(eval(input()))\nc = int(eval(input()))\nx = int(eval(input()))\ncnt = 0\nfor i in range(a + 1):\n for j in range(b + 1):\n z = x - (500 * i + 100 * j)\n if z < 0:\n break\n if z / 50 <= c:\n cnt += 1\nprint(cnt)\n", "measured_fast_code_sha256": "8404e89cbf1c791684ce4a4f537d312fb41b351a10f8732dc67cba4fa1c1a2cc", "measured_slow_code": "A, B, C, X = list(map(int, [eval(input()) for _ in range(4)]))\ncount = 0\nfor a in range(A + 1):\n for b in range(B + 1):\n for c in range(C + 1):\n value = 500 * a + 100 * b + 50 * c\n if X == value:\n count += 1\nprint(count)\n", "measured_slow_code_sha256": "fe672ace967cecac7ee687fda0abb1e2ca6a8176a3d010ba0c3a78f9a90d5cad", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.7934007489068557, "pair_id": "python_v2_9d937f21bb2d0cbb332b0080", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03448", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03448_8404e89cbf1c791684ce4a4f537d312fb41b351a10f8732dc67cba4fa1c1a2cc.jsonl.gz", "inputs": "reproduction/python/inputs/p03448.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03448_fe672ace967cecac7ee687fda0abb1e2ca6a8176a3d010ba0c3a78f9a90d5cad.jsonl.gz"}, "slow_code": "A, B, C, X = list(map(int, [eval(input()) for _ in range(4)]))\ncount = 0\nfor a in range(A + 1):\n for b in range(B + 1):\n for c in range(C + 1):\n value = 500 * a + 100 * b + 50 * c\n if X == value:\n count += 1\nprint(count)\n", "slow_code_sha256": "fe672ace967cecac7ee687fda0abb1e2ca6a8176a3d010ba0c3a78f9a90d5cad", "slow_id": "p03448_fe672ace967cecac7ee687fda0abb1e2ca6a8176a3d010ba0c3a78f9a90d5cad", "speedup": 3.315321252259271, "stratum": "2-4", "within_pair_jaccard": 0.5, "workload": {"case_count": 100, "description": "Choose coins totaling X using at most A coins of value 500, B of value 100 and C of value 50. Count distinct denomination-count choices, not permutations of identical coins. X is a multiple of 50. Observed inputs: A=0..50 (median 7); B=0..50 (median 9.5); C=0..50 (median 5.5); X=50..20000 (median 2175).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 15, "median": 12.0, "min": 9}, "input_format": ["A\nB\nC\nX"], "input_format_status": "source_input_section", "input_lines": {"max": 4, "median": 4.0, "min": 4}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 4, "median": 4.0, "min": 4}}} -{"case_ids": ["p03136_case_000", "p03136_case_001", "p03136_case_002", "p03136_case_003", "p03136_case_004", "p03136_case_005", "p03136_case_006", "p03136_case_007", "p03136_case_008", "p03136_case_009", "p03136_case_010", "p03136_case_011", "p03136_case_012", "p03136_case_013", "p03136_case_014", "p03136_case_015", "p03136_case_016", "p03136_case_017", "p03136_case_018", "p03136_case_019", "p03136_case_020", "p03136_case_021", "p03136_case_022", "p03136_case_023", "p03136_case_024", "p03136_case_025", "p03136_case_026", "p03136_case_027", "p03136_case_028", "p03136_case_029", "p03136_case_030", "p03136_case_031", "p03136_case_032", "p03136_case_033", "p03136_case_034", "p03136_case_035", "p03136_case_036", "p03136_case_037", "p03136_case_038", "p03136_case_039", "p03136_case_040", "p03136_case_041", "p03136_case_042", "p03136_case_043", "p03136_case_044", "p03136_case_045", "p03136_case_046", "p03136_case_047", "p03136_case_048", "p03136_case_049", "p03136_case_050", "p03136_case_051", "p03136_case_052", "p03136_case_053", "p03136_case_054", "p03136_case_055", "p03136_case_056", "p03136_case_057", "p03136_case_058", "p03136_case_059", "p03136_case_060", "p03136_case_061", "p03136_case_062", "p03136_case_063", "p03136_case_064", "p03136_case_065", "p03136_case_066", "p03136_case_067", "p03136_case_068", "p03136_case_069", "p03136_case_070", "p03136_case_071", "p03136_case_072", "p03136_case_073", "p03136_case_074", "p03136_case_075", "p03136_case_076", "p03136_case_077", "p03136_case_078", "p03136_case_079", "p03136_case_080", "p03136_case_081", "p03136_case_082", "p03136_case_083", "p03136_case_084", "p03136_case_085", "p03136_case_086", "p03136_case_087", "p03136_case_088", "p03136_case_089", "p03136_case_090", "p03136_case_091", "p03136_case_092", "p03136_case_093", "p03136_case_094", "p03136_case_095", "p03136_case_096", "p03136_case_097", "p03136_case_098", "p03136_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def main():\n N = int(eval(input()))\n L = [int(i) for i in input().split()]\n sumL = sum(L)\n maxL = max(L)\n print((\"Yes\" if maxL < sumL - maxL else \"No\"))\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "ff3746cf83adfe2f7c88f5967b6a444a853ea3af918404ea545937c39eabc9f1", "fast_id": "p03136_ff3746cf83adfe2f7c88f5967b6a444a853ea3af918404ea545937c39eabc9f1", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def main():\n N = int(eval(input()))\n L = [int(i) for i in input().split()]\n sumL = sum(L)\n maxL = max(L)\n print((\"Yes\" if maxL < sumL - maxL else \"No\"))\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "ff3746cf83adfe2f7c88f5967b6a444a853ea3af918404ea545937c39eabc9f1", "measured_slow_code": "import numpy as np\n\nN = int(eval(input()))\nL = np.array(list(map(int, input().split())))\nL[::-1].sort()\nif L[0] < L[1:].sum():\n print(\"Yes\")\nelse:\n print(\"No\")\n", "measured_slow_code_sha256": "c1d13b37a289cb233c6849d4a958851f4c3b4f284375eaec46ef2e5a34eb2366", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 957.7011408437286, "pair_id": "python_v2_9978cc9feca36a37e91ac11a", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03136", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03136_ff3746cf83adfe2f7c88f5967b6a444a853ea3af918404ea545937c39eabc9f1.jsonl.gz", "inputs": "reproduction/python/inputs/p03136.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03136_c1d13b37a289cb233c6849d4a958851f4c3b4f284375eaec46ef2e5a34eb2366.jsonl.gz"}, "slow_code": "import numpy as np\n\nN = int(eval(input()))\nL = np.array(list(map(int, input().split())))\nL[::-1].sort()\nif L[0] < L[1:].sum():\n print(\"Yes\")\nelse:\n print(\"No\")\n", "slow_code_sha256": "c1d13b37a289cb233c6849d4a958851f4c3b4f284375eaec46ef2e5a34eb2366", "slow_id": "p03136_c1d13b37a289cb233c6849d4a958851f4c3b4f284375eaec46ef2e5a34eb2366", "speedup": 957.0505128038776, "stratum": "8+", "within_pair_jaccard": 0.375, "workload": {"case_count": 100, "description": "Determine whether N supplied positive side lengths L_i can form a nondegenerate polygon in the plane; convexity is not required. Observed inputs: N=3..10 (median 6); L_i=1..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 43, "median": 17.0, "min": 8}, "input_format": ["N\nL_1 ... L_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 11, "median": 7.0, "min": 4}}} -{"case_ids": ["p02570_case_000", "p02570_case_001", "p02570_case_002", "p02570_case_003", "p02570_case_004", "p02570_case_005", "p02570_case_006", "p02570_case_007", "p02570_case_008", "p02570_case_009", "p02570_case_010", "p02570_case_011", "p02570_case_012", "p02570_case_013", "p02570_case_014", "p02570_case_015", "p02570_case_016", "p02570_case_017", "p02570_case_018", "p02570_case_019", "p02570_case_020", "p02570_case_021", "p02570_case_022", "p02570_case_023", "p02570_case_024", "p02570_case_025", "p02570_case_026", "p02570_case_027", "p02570_case_028", "p02570_case_029", "p02570_case_030", "p02570_case_031", "p02570_case_032", "p02570_case_033", "p02570_case_034", "p02570_case_035", "p02570_case_036", "p02570_case_037", "p02570_case_038", "p02570_case_039", "p02570_case_040", "p02570_case_041", "p02570_case_042", "p02570_case_043", "p02570_case_044", "p02570_case_045", "p02570_case_046", "p02570_case_047", "p02570_case_048", "p02570_case_049", "p02570_case_050", "p02570_case_051", "p02570_case_052", "p02570_case_053", "p02570_case_054", "p02570_case_055", "p02570_case_056", "p02570_case_057", "p02570_case_058", "p02570_case_059", "p02570_case_060", "p02570_case_061", "p02570_case_062", "p02570_case_063", "p02570_case_064", "p02570_case_065", "p02570_case_066", "p02570_case_067", "p02570_case_068", "p02570_case_069", "p02570_case_070", "p02570_case_071", "p02570_case_072", "p02570_case_073", "p02570_case_074", "p02570_case_075", "p02570_case_076", "p02570_case_077", "p02570_case_078", "p02570_case_079", "p02570_case_080", "p02570_case_081", "p02570_case_082", "p02570_case_083", "p02570_case_084", "p02570_case_085", "p02570_case_086", "p02570_case_087", "p02570_case_088", "p02570_case_089", "p02570_case_090", "p02570_case_091", "p02570_case_092", "p02570_case_093", "p02570_case_094", "p02570_case_095", "p02570_case_096", "p02570_case_097", "p02570_case_098", "p02570_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "executable_AST_equal_except_explicit_explanatory_string_removal_and_all_frozen_inputs_checker_pass", "fast_code": "d, t, s = list(map(int, input().split()))\nif t - d / s >= 0:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "fast_code_sha256": "dff44ce14f7d12b8f44c80ca5b40ce589b58599f08e672b9b8d0ee7c60c5afa0", "fast_id": "p02570_dff44ce14f7d12b8f44c80ca5b40ce589b58599f08e672b9b8d0ee7c60c5afa0", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "d, t, s = list(map(int, input().split()))\nif t - d / s >= 0:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "measured_fast_code_sha256": "dff44ce14f7d12b8f44c80ca5b40ce589b58599f08e672b9b8d0ee7c60c5afa0", "measured_slow_code": "def LI():\n return list(map(int, input().split()))\n\n\ndef II():\n return int(input())\n\n\ndef yes():\n return print(\"Yes\")\n\n\ndef no():\n return print(\"No\")\n\n\n# INF=float(\"inf\")\n# from collections import deque, defaultdict, Counter\n# from heapq import heappop, heappush\n# from itertools import product, combinations\n# from functools import reduce, lru_cache\n# from math import pi, gcd\n# from decimal import Decimal\nclass Combination:\n \"\"\"\n O(n)の前計算を1回行うことで,O(1)でnCr mod mを求められる\n n_max = 10**6のとき前処理は約950ms (PyPyなら約340ms, 10**7で約1800ms)\n 使用例:\n comb = Combination(1000000)\n print(comb(5, 3)) # 10\n \"\"\"\n\n def __init__(self, n_max, mod=10**9 + 7):\n self.mod = mod\n self.modinv = self.make_modinv_list(n_max)\n self.fac, self.facinv = self.make_factorial_list(n_max)\n\n def __call__(self, n, r):\n return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n - r] % self.mod\n\n def make_factorial_list(self, n):\n # 階乗のリストと階乗のmod逆元のリストを返す O(n)\n # self.make_modinv_list()が先に実行されている必要がある\n fac = [1]\n facinv = [1]\n for i in range(1, n + 1):\n fac.append(fac[i - 1] * i % self.mod)\n facinv.append(facinv[i - 1] * self.modinv[i] % self.mod)\n return fac, facinv\n\n def make_modinv_list(self, n):\n # 0からnまでのmod逆元のリストを返す O(n)\n modinv = [0] * (n + 1)\n modinv[1] = 1\n for i in range(2, n + 1):\n modinv[i] = self.mod - self.mod // i * modinv[self.mod % i] % self.mod\n return modinv\n\n\nclass Unionfind:\n def __init__(self, N):\n self.p = list(range(N))\n self.rank = [0] * N\n self.size = [1] * N\n\n def root(self, x):\n if self.p[x] != x:\n self.p[x] = self.root(self.p[x])\n return self.p[x]\n\n def same(self, x, y):\n return self.root(x) == self.root(y)\n\n def unite(self, x, y):\n u = self.root(x)\n v = self.root(y)\n if u == v:\n return\n if self.rank[u] < self.rank[v]:\n self.p[u] = v\n self.size[v] += self.size[u]\n self.size[u] = 0\n else:\n self.p[v] = u\n self.size[u] += self.size[v]\n self.size[v] = 0\n if self.rank[u] == self.rank[v]:\n self.rank[u] += 1\n\n def count(self, x):\n return self.size[self.root(x)]\n\n\nd, t, s = LI()\nif d <= t * s:\n yes()\nelse:\n no()\n", "measured_slow_code_sha256": "7df3ffb5a8416f2149c9ce5f388659f4fb80cc7488ec540c2ef41ccf0a9e9129", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 12.405325553413123, "pair_id": "python_v2_050ec8009666c4b37ba63327", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02570", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02570_dff44ce14f7d12b8f44c80ca5b40ce589b58599f08e672b9b8d0ee7c60c5afa0.jsonl.gz", "inputs": "reproduction/python/inputs/p02570.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02570_7df3ffb5a8416f2149c9ce5f388659f4fb80cc7488ec540c2ef41ccf0a9e9129.jsonl.gz"}, "slow_code": "def LI():\n return list(map(int, input().split()))\n\n\ndef II():\n return int(input())\n\n\ndef yes():\n return print(\"Yes\")\n\n\ndef no():\n return print(\"No\")\n\n\nclass Combination:\n\n def __init__(self, n_max, mod=10**9 + 7):\n self.mod = mod\n self.modinv = self.make_modinv_list(n_max)\n self.fac, self.facinv = self.make_factorial_list(n_max)\n\n def __call__(self, n, r):\n return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n - r] % self.mod\n\n def make_factorial_list(self, n):\n\n fac = [1]\n facinv = [1]\n for i in range(1, n + 1):\n fac.append(fac[i - 1] * i % self.mod)\n facinv.append(facinv[i - 1] * self.modinv[i] % self.mod)\n return fac, facinv\n\n def make_modinv_list(self, n):\n\n modinv = [0] * (n + 1)\n modinv[1] = 1\n for i in range(2, n + 1):\n modinv[i] = self.mod - self.mod // i * modinv[self.mod % i] % self.mod\n return modinv\n\n\nclass Unionfind:\n def __init__(self, N):\n self.p = list(range(N))\n self.rank = [0] * N\n self.size = [1] * N\n\n def root(self, x):\n if self.p[x] != x:\n self.p[x] = self.root(self.p[x])\n return self.p[x]\n\n def same(self, x, y):\n return self.root(x) == self.root(y)\n\n def unite(self, x, y):\n u = self.root(x)\n v = self.root(y)\n if u == v:\n return\n if self.rank[u] < self.rank[v]:\n self.p[u] = v\n self.size[v] += self.size[u]\n self.size[u] = 0\n else:\n self.p[v] = u\n self.size[u] += self.size[v]\n self.size[v] = 0\n if self.rank[u] == self.rank[v]:\n self.rank[u] += 1\n\n def count(self, x):\n return self.size[self.root(x)]\n\n\nd, t, s = LI()\nif d <= t * s:\n yes()\nelse:\n no()\n", "slow_code_sha256": "09b0c0d43abbb6955208c35fb1cca343f1b4cbf34ced526e48c841c54fa3ed5f", "slow_id": "p02570_7df3ffb5a8416f2149c9ce5f388659f4fb80cc7488ec540c2ef41ccf0a9e9129", "speedup": 12.396508833042345, "stratum": "8+", "within_pair_jaccard": 0.2028985507246377, "workload": {"case_count": 100, "description": "Determine whether traveling distance D meters at constant speed S meters per minute reaches the destination within T minutes. Observed inputs: D=1..10000 (median 823); T=1..10000 (median 471); S=1..10000 (median 523).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 18, "median": 12.0, "min": 6}, "input_format": ["D T S"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3, "median": 3.0, "min": 3}}} -{"case_ids": ["p02793_case_000", "p02793_case_001", "p02793_case_002", "p02793_case_003", "p02793_case_004", "p02793_case_005", "p02793_case_006", "p02793_case_007", "p02793_case_008", "p02793_case_009", "p02793_case_010", "p02793_case_011", "p02793_case_012", "p02793_case_013", "p02793_case_014", "p02793_case_015", "p02793_case_016", "p02793_case_017", "p02793_case_018", "p02793_case_019", "p02793_case_020", "p02793_case_021", "p02793_case_022", "p02793_case_023", "p02793_case_024", "p02793_case_025", "p02793_case_026", "p02793_case_027", "p02793_case_028", "p02793_case_029", "p02793_case_030", "p02793_case_031", "p02793_case_032", "p02793_case_033", "p02793_case_034", "p02793_case_035", "p02793_case_036", "p02793_case_037", "p02793_case_038", "p02793_case_039", "p02793_case_040", "p02793_case_041", "p02793_case_042", "p02793_case_043", "p02793_case_044", "p02793_case_045", "p02793_case_046", "p02793_case_047", "p02793_case_048", "p02793_case_049", "p02793_case_050", "p02793_case_051", "p02793_case_052", "p02793_case_053", "p02793_case_054", "p02793_case_055", "p02793_case_056", "p02793_case_057", "p02793_case_058", "p02793_case_059", "p02793_case_060", "p02793_case_061", "p02793_case_062", "p02793_case_063", "p02793_case_064", "p02793_case_065", "p02793_case_066", "p02793_case_067", "p02793_case_068", "p02793_case_069", "p02793_case_070", "p02793_case_071", "p02793_case_072", "p02793_case_073", "p02793_case_074", "p02793_case_075", "p02793_case_076", "p02793_case_077", "p02793_case_078", "p02793_case_079", "p02793_case_080", "p02793_case_081", "p02793_case_082", "p02793_case_083", "p02793_case_084", "p02793_case_085", "p02793_case_086", "p02793_case_087", "p02793_case_088", "p02793_case_089", "p02793_case_090", "p02793_case_091", "p02793_case_092", "p02793_case_093", "p02793_case_094", "p02793_case_095", "p02793_case_096", "p02793_case_097", "p02793_case_098", "p02793_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\ninput = sys.stdin.readline\nsys.setrecursionlimit(10**7)\nn = int(eval(input()))\na = list(map(int, input().split()))\nMOD = 10**9 + 7\nlcm = 1\n\n\nimport math\n\nfor v in a:\n lcm = (lcm // math.gcd(lcm, v)) * v\nans = 0\nfor v in a:\n ans = ans + (lcm // v)\n\nprint((ans % MOD))\n", "fast_code_sha256": "120ded1335fc64b5d45dde432ae51c8ad77f47d621444f65338fe228101bc7cb", "fast_id": "p02793_0fb8de2044d9ab011287ebdaf60c0dfff0bce57f6c42c2805afb2a1ac199ebcc", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\ninput = sys.stdin.readline\nsys.setrecursionlimit(10**7)\nn = int(eval(input()))\na = list(map(int, input().split()))\nMOD = 10**9 + 7\nlcm = 1\n# import collections\n# lcm_pf = collections.defaultdict(int)\n# for i, v in enumerate(a):\n# j = 2\n# pf = {}\n# while j ** 2 <= v:\n# ext = 0\n# while v % j == 0:\n# ext += 1\n# v //= j\n# if ext:\n# pf[j] = ext\n# lcm_pf[j] = max(lcm_pf[j], ext)\n# j += 1\n# if v != 1:\n# pf[v] = 1\n# lcm_pf[v] = max(lcm_pf[v], 1)\n# for p in lcm_pf:\n# lcm = lcm * (p ** lcm_pf[p])\nimport math\n\nfor v in a:\n lcm = (lcm // math.gcd(lcm, v)) * v\nans = 0\nfor v in a:\n ans = ans + (lcm // v)\n # ans = (ans + (lcm // v)) % MOD\nprint((ans % MOD))\n", "measured_fast_code_sha256": "0fb8de2044d9ab011287ebdaf60c0dfff0bce57f6c42c2805afb2a1ac199ebcc", "measured_slow_code": "class PrimeOptimizer:\n def __init__(self, MAX_NUM=10**3):\n is_prime = [True] * MAX_NUM\n is_prime[0] = False\n is_prime[1] = False\n primes = []\n for i in range(MAX_NUM):\n if is_prime[i]:\n primes.append(i)\n for j in range(2 * i, MAX_NUM, i):\n is_prime[j] = False\n self.primes = primes\n\n def prime_factorization(self, x):\n res = {}\n for prime in self.primes:\n while x % prime == 0:\n if not prime in res:\n res[prime] = 0\n res[prime] += 1\n x //= prime\n if x > 1:\n res[x] = 1\n return res\n\n\nMOD = 10**9 + 7\n\n\ndef mod_pow(p, q):\n res = 1\n while q:\n if q & 1:\n res = (res * p) % MOD\n p = (p * p) % MOD\n q //= 2\n return res\n\n\ndef mod_inv(p):\n return mod_pow(p, MOD - 2)\n\n\ndef solve(n, a):\n primeOpt = PrimeOptimizer()\n D = {}\n for i in range(n):\n prime_num_mapping = primeOpt.prime_factorization(a[i])\n for prime, num in list(prime_num_mapping.items()):\n if not prime in D:\n D[prime] = 0\n D[prime] = max(D[prime], num)\n L = 1\n for prime, num in list(D.items()):\n L = (L * mod_pow(prime, num)) % MOD\n res = sum([L * mod_inv(x) % MOD for x in a])\n return res % MOD\n\n\nN = int(eval(input()))\nA = list(map(int, input().split()))\nprint((solve(N, A)))\n", "measured_slow_code_sha256": "66d145443a372a5a43407dc9cf71d71447bec89f203c9422197e66c8dd97343d", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 7.331705891285891, "pair_id": "python_v2_9842462b66894ec95813dfbf", "per_case_slow_code_faster_fraction": 0.01, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02793", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02793_0fb8de2044d9ab011287ebdaf60c0dfff0bce57f6c42c2805afb2a1ac199ebcc.jsonl.gz", "inputs": "reproduction/python/inputs/p02793.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02793_66d145443a372a5a43407dc9cf71d71447bec89f203c9422197e66c8dd97343d.jsonl.gz"}, "slow_code": "class PrimeOptimizer:\n def __init__(self, MAX_NUM=10**3):\n is_prime = [True] * MAX_NUM\n is_prime[0] = False\n is_prime[1] = False\n primes = []\n for i in range(MAX_NUM):\n if is_prime[i]:\n primes.append(i)\n for j in range(2 * i, MAX_NUM, i):\n is_prime[j] = False\n self.primes = primes\n\n def prime_factorization(self, x):\n res = {}\n for prime in self.primes:\n while x % prime == 0:\n if not prime in res:\n res[prime] = 0\n res[prime] += 1\n x //= prime\n if x > 1:\n res[x] = 1\n return res\n\n\nMOD = 10**9 + 7\n\n\ndef mod_pow(p, q):\n res = 1\n while q:\n if q & 1:\n res = (res * p) % MOD\n p = (p * p) % MOD\n q //= 2\n return res\n\n\ndef mod_inv(p):\n return mod_pow(p, MOD - 2)\n\n\ndef solve(n, a):\n primeOpt = PrimeOptimizer()\n D = {}\n for i in range(n):\n prime_num_mapping = primeOpt.prime_factorization(a[i])\n for prime, num in list(prime_num_mapping.items()):\n if not prime in D:\n D[prime] = 0\n D[prime] = max(D[prime], num)\n L = 1\n for prime, num in list(D.items()):\n L = (L * mod_pow(prime, num)) % MOD\n res = sum([L * mod_inv(x) % MOD for x in a])\n return res % MOD\n\n\nN = int(eval(input()))\nA = list(map(int, input().split()))\nprint((solve(N, A)))\n", "slow_code_sha256": "66d145443a372a5a43407dc9cf71d71447bec89f203c9422197e66c8dd97343d", "slow_id": "p02793_66d145443a372a5a43407dc9cf71d71447bec89f203c9422197e66c8dd97343d", "speedup": 7.780264110697636, "stratum": "4-8", "within_pair_jaccard": 0.26153846153846155, "workload": {"case_count": 100, "description": "Choose positive integers B_i so that every A_i*B_i has the same value, minimizing sum B_i. Output that minimum modulo 1000000007. Observed inputs: N=1..10000 (median 1000); A_i=1..1000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 70006, "median": 6279.5, "min": 4}, "input_format": ["N\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 10001, "median": 1001.0, "min": 2}}} -{"case_ids": ["p03606_case_000", "p03606_case_001", "p03606_case_002", "p03606_case_003", "p03606_case_004", "p03606_case_005", "p03606_case_006", "p03606_case_007", "p03606_case_008", "p03606_case_009", "p03606_case_010", "p03606_case_011", "p03606_case_012", "p03606_case_013", "p03606_case_014", "p03606_case_015", "p03606_case_016", "p03606_case_017", "p03606_case_018", "p03606_case_019", "p03606_case_020", "p03606_case_021", "p03606_case_022", "p03606_case_023", "p03606_case_024", "p03606_case_025", "p03606_case_026", "p03606_case_027", "p03606_case_028", "p03606_case_029", "p03606_case_030", "p03606_case_031", "p03606_case_032", "p03606_case_033", "p03606_case_034", "p03606_case_035", "p03606_case_036", "p03606_case_037", "p03606_case_038", "p03606_case_039", "p03606_case_040", "p03606_case_041", "p03606_case_042", "p03606_case_043", "p03606_case_044", "p03606_case_045", "p03606_case_046", "p03606_case_047", "p03606_case_048", "p03606_case_049", "p03606_case_050", "p03606_case_051", "p03606_case_052", "p03606_case_053", "p03606_case_054", "p03606_case_055", "p03606_case_056", "p03606_case_057", "p03606_case_058", "p03606_case_059", "p03606_case_060", "p03606_case_061", "p03606_case_062", "p03606_case_063", "p03606_case_064", "p03606_case_065", "p03606_case_066", "p03606_case_067", "p03606_case_068", "p03606_case_069", "p03606_case_070", "p03606_case_071", "p03606_case_072", "p03606_case_073", "p03606_case_074", "p03606_case_075", "p03606_case_076", "p03606_case_077", "p03606_case_078", "p03606_case_079", "p03606_case_080", "p03606_case_081", "p03606_case_082", "p03606_case_083", "p03606_case_084", "p03606_case_085", "p03606_case_086", "p03606_case_087", "p03606_case_088", "p03606_case_089", "p03606_case_090", "p03606_case_091", "p03606_case_092", "p03606_case_093", "p03606_case_094", "p03606_case_095", "p03606_case_096", "p03606_case_097", "p03606_case_098", "p03606_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\nsys.setrecursionlimit(10**5 + 10)\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef resolve():\n cnt = 0\n N = int(eval(input()))\n for i in range(N):\n l, r = list(map(int, input().split()))\n cnt += r - l + 1\n print(cnt)\n\n\nresolve()\n", "fast_code_sha256": "281290a2b75d05e203b312b432df504793f8b543abd68a7d6b1cda04fc6cb497", "fast_id": "p03606_281290a2b75d05e203b312b432df504793f8b543abd68a7d6b1cda04fc6cb497", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\nsys.setrecursionlimit(10**5 + 10)\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef resolve():\n cnt = 0\n N = int(eval(input()))\n for i in range(N):\n l, r = list(map(int, input().split()))\n cnt += r - l + 1\n print(cnt)\n\n\nresolve()\n", "measured_fast_code_sha256": "281290a2b75d05e203b312b432df504793f8b543abd68a7d6b1cda04fc6cb497", "measured_slow_code": "n = int(eval(input()))\nseat = [0] * 10**6\nfor i in range(n):\n l, r = list(map(int, input().split()))\n for j in range(l, r + 1):\n seat[j - 1] = 1\nres = 0\nfor i in range(10**6):\n if seat[i] == 1:\n res += 1\nprint(res)\n", "measured_slow_code_sha256": "6597de1bd0267fe08bbaa81ee42f4ad5986dea670e9ddc05184b39d177cf7185", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1815.1631941547366, "pair_id": "python_v2_8c4086b9aea803cf21c696e2", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03606", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03606_281290a2b75d05e203b312b432df504793f8b543abd68a7d6b1cda04fc6cb497.jsonl.gz", "inputs": "reproduction/python/inputs/p03606.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03606_6597de1bd0267fe08bbaa81ee42f4ad5986dea670e9ddc05184b39d177cf7185.jsonl.gz"}, "slow_code": "n = int(eval(input()))\nseat = [0] * 10**6\nfor i in range(n):\n l, r = list(map(int, input().split()))\n for j in range(l, r + 1):\n seat[j - 1] = 1\nres = 0\nfor i in range(10**6):\n if seat[i] == 1:\n res += 1\nprint(res)\n", "slow_code_sha256": "6597de1bd0267fe08bbaa81ee42f4ad5986dea670e9ddc05184b39d177cf7185", "slow_id": "p03606_6597de1bd0267fe08bbaa81ee42f4ad5986dea670e9ddc05184b39d177cf7185", "speedup": 942.344832528543, "stratum": "8+", "within_pair_jaccard": 0.47058823529411764, "workload": {"case_count": 100, "description": "N groups occupy disjoint inclusive seat intervals [l_i,r_i] in a theater with seats 1..100000. Count the total seated people. Intervals need not be listed in order. Observed inputs: N=1..1000 (median 2); l_i=1..99992; r_i=5..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 11813, "median": 26.0, "min": 11}, "input_format": ["N\nl_1 r_1\n...\nl_N r_N"], "input_format_status": "source_input_section", "input_lines": {"max": 1001, "median": 3.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2001, "median": 5.0, "min": 3}}} -{"case_ids": ["p03767_case_000", "p03767_case_001", "p03767_case_002", "p03767_case_003", "p03767_case_004", "p03767_case_005", "p03767_case_006", "p03767_case_007", "p03767_case_008", "p03767_case_009", "p03767_case_010", "p03767_case_011", "p03767_case_012", "p03767_case_013", "p03767_case_014", "p03767_case_015", "p03767_case_016", "p03767_case_017", "p03767_case_018", "p03767_case_019", "p03767_case_020", "p03767_case_021", "p03767_case_022", "p03767_case_023", "p03767_case_024", "p03767_case_025", "p03767_case_026", "p03767_case_027", "p03767_case_028", "p03767_case_029", "p03767_case_030", "p03767_case_031", "p03767_case_032", "p03767_case_033", "p03767_case_034", "p03767_case_035", "p03767_case_036", "p03767_case_037", "p03767_case_038", "p03767_case_039", "p03767_case_040", "p03767_case_041", "p03767_case_042", "p03767_case_043", "p03767_case_044", "p03767_case_045", "p03767_case_046", "p03767_case_047", "p03767_case_048", "p03767_case_049", "p03767_case_050", "p03767_case_051", "p03767_case_052", "p03767_case_053", "p03767_case_054", "p03767_case_055", "p03767_case_056", "p03767_case_057", "p03767_case_058", "p03767_case_059", "p03767_case_060", "p03767_case_061", "p03767_case_062", "p03767_case_063", "p03767_case_064", "p03767_case_065", "p03767_case_066", "p03767_case_067", "p03767_case_068", "p03767_case_069", "p03767_case_070", "p03767_case_071", "p03767_case_072", "p03767_case_073", "p03767_case_074", "p03767_case_075", "p03767_case_076", "p03767_case_077", "p03767_case_078", "p03767_case_079", "p03767_case_080", "p03767_case_081", "p03767_case_082", "p03767_case_083", "p03767_case_084", "p03767_case_085", "p03767_case_086", "p03767_case_087", "p03767_case_088", "p03767_case_089", "p03767_case_090", "p03767_case_091", "p03767_case_092", "p03767_case_093", "p03767_case_094", "p03767_case_095", "p03767_case_096", "p03767_case_097", "p03767_case_098", "p03767_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "print(\n sum(\n sorted(list(map(int, exec(\"N=int(input())\") or input().split())))[\n -2 : -2 * N - 1 : -2\n ]\n )\n)\n", "fast_code_sha256": "342f915d160fa027967641f02b8046d86c544829302f09a6df31dd86e40f4c6c", "fast_id": "p03767_342f915d160fa027967641f02b8046d86c544829302f09a6df31dd86e40f4c6c", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "print(\n sum(\n sorted(list(map(int, exec(\"N=int(input())\") or input().split())))[\n -2 : -2 * N - 1 : -2\n ]\n )\n)\n", "measured_fast_code_sha256": "342f915d160fa027967641f02b8046d86c544829302f09a6df31dd86e40f4c6c", "measured_slow_code": "from collections import Counter, defaultdict, deque\nfrom heapq import heappop, heappush, heapify\nimport sys, bisect, math, itertools, fractions, pprint\n\nsys.setrecursionlimit(10**8)\nmod = 10**9 + 7\nINF = float(\"inf\")\n\n\ndef inp():\n return int(sys.stdin.readline())\n\n\ndef inpl():\n return list(map(int, sys.stdin.readline().split()))\n\n\nn = inp()\na = inpl()\na.sort(reverse=True)\ncnt = n\nind = 0\nres = 0\nwhile cnt:\n if ind % 2:\n res += a[ind]\n cnt -= 1\n ind += 1\nprint(res)\n", "measured_slow_code_sha256": "7693ad55686e6fd618fa19be5402464b2c1d8a6534c46b08c3072eed6c243853", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.5387663101507236, "pair_id": "python_v2_d768141df2c7ece87b92d1e1", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03767", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03767_342f915d160fa027967641f02b8046d86c544829302f09a6df31dd86e40f4c6c.jsonl.gz", "inputs": "reproduction/python/inputs/p03767.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03767_7693ad55686e6fd618fa19be5402464b2c1d8a6534c46b08c3072eed6c243853.jsonl.gz"}, "slow_code": "from collections import Counter, defaultdict, deque\nfrom heapq import heappop, heappush, heapify\nimport sys, bisect, math, itertools, fractions, pprint\n\nsys.setrecursionlimit(10**8)\nmod = 10**9 + 7\nINF = float(\"inf\")\n\n\ndef inp():\n return int(sys.stdin.readline())\n\n\ndef inpl():\n return list(map(int, sys.stdin.readline().split()))\n\n\nn = inp()\na = inpl()\na.sort(reverse=True)\ncnt = n\nind = 0\nres = 0\nwhile cnt:\n if ind % 2:\n res += a[ind]\n cnt -= 1\n ind += 1\nprint(res)\n", "slow_code_sha256": "7693ad55686e6fd618fa19be5402464b2c1d8a6534c46b08c3072eed6c243853", "slow_id": "p03767_7693ad55686e6fd618fa19be5402464b2c1d8a6534c46b08c3072eed6c243853", "speedup": 6.292825167573678, "stratum": "4-8", "within_pair_jaccard": 0.12727272727272726, "workload": {"case_count": 100, "description": "Partition 3N participants into N disjoint teams of three. A team strength is its second-largest member strength, counting ties. Maximize the sum of team strengths. Observed inputs: N=1..100000 (median 1000); participants=3..300000 (median 3000); a_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 3300007, "median": 29687.0, "min": 8}, "input_format": ["N\na_1 ... a_(3N)"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 300001, "median": 3001.0, "min": 4}}} -{"case_ids": ["p03147_case_000", "p03147_case_001", "p03147_case_002", "p03147_case_003", "p03147_case_004", "p03147_case_005", "p03147_case_006", "p03147_case_007", "p03147_case_008", "p03147_case_009", "p03147_case_010", "p03147_case_011", "p03147_case_012", "p03147_case_013", "p03147_case_014", "p03147_case_015", "p03147_case_016", "p03147_case_017", "p03147_case_018", "p03147_case_019", "p03147_case_020", "p03147_case_021", "p03147_case_022", "p03147_case_023", "p03147_case_024", "p03147_case_025", "p03147_case_026", "p03147_case_027", "p03147_case_028", "p03147_case_029", "p03147_case_030", "p03147_case_031", "p03147_case_032", "p03147_case_033", "p03147_case_034", "p03147_case_035", "p03147_case_036", "p03147_case_037", "p03147_case_038", "p03147_case_039", "p03147_case_040", "p03147_case_041", "p03147_case_042", "p03147_case_043", "p03147_case_044", "p03147_case_045", "p03147_case_046", "p03147_case_047", "p03147_case_048", "p03147_case_049", "p03147_case_050", "p03147_case_051", "p03147_case_052", "p03147_case_053", "p03147_case_054", "p03147_case_055", "p03147_case_056", "p03147_case_057", "p03147_case_058", "p03147_case_059", "p03147_case_060", "p03147_case_061", "p03147_case_062", "p03147_case_063", "p03147_case_064", "p03147_case_065", "p03147_case_066", "p03147_case_067", "p03147_case_068", "p03147_case_069", "p03147_case_070", "p03147_case_071", "p03147_case_072", "p03147_case_073", "p03147_case_074", "p03147_case_075", "p03147_case_076", "p03147_case_077", "p03147_case_078", "p03147_case_079", "p03147_case_080", "p03147_case_081", "p03147_case_082", "p03147_case_083", "p03147_case_084", "p03147_case_085", "p03147_case_086", "p03147_case_087", "p03147_case_088", "p03147_case_089", "p03147_case_090", "p03147_case_091", "p03147_case_092", "p03147_case_093", "p03147_case_094", "p03147_case_095", "p03147_case_096", "p03147_case_097", "p03147_case_098", "p03147_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\nh = list(map(int, input().split()))\nans = h[0]\nfor i in range(1, n):\n if h[i] > h[i - 1]:\n ans += h[i] - h[i - 1]\nprint(ans)\n", "fast_code_sha256": "4be88f64ca664c2eac79251ecb1a1e87d14707dab8d2ff3d5c3c0cfb067c5fc2", "fast_id": "p03147_4be88f64ca664c2eac79251ecb1a1e87d14707dab8d2ff3d5c3c0cfb067c5fc2", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\nh = list(map(int, input().split()))\nans = h[0]\nfor i in range(1, n):\n if h[i] > h[i - 1]:\n ans += h[i] - h[i - 1]\nprint(ans)\n", "measured_fast_code_sha256": "4be88f64ca664c2eac79251ecb1a1e87d14707dab8d2ff3d5c3c0cfb067c5fc2", "measured_slow_code": "N = int(eval(input()))\nh = list(map(int, input().split()))\nans = 0\ni = 0\nwhile i < N:\n while h[i] == 0:\n i += 1\n if i == N:\n break\n j = i\n if i == N:\n break\n while h[j] > 0:\n h[j] -= 1\n j += 1\n if j == N:\n break\n ans += 1\nprint(ans)\n", "measured_slow_code_sha256": "b1e792dd3810c963171d990481698db953df4fbba41e2b1cb8b22991f36b26d4", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 6.444402032628997, "pair_id": "python_v2_cf68c12702de4f682444b201", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03147", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03147_4be88f64ca664c2eac79251ecb1a1e87d14707dab8d2ff3d5c3c0cfb067c5fc2.jsonl.gz", "inputs": "reproduction/python/inputs/p03147.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03147_b1e792dd3810c963171d990481698db953df4fbba41e2b1cb8b22991f36b26d4.jsonl.gz"}, "slow_code": "N = int(eval(input()))\nh = list(map(int, input().split()))\nans = 0\ni = 0\nwhile i < N:\n while h[i] == 0:\n i += 1\n if i == N:\n break\n j = i\n if i == N:\n break\n while h[j] > 0:\n h[j] -= 1\n j += 1\n if j == N:\n break\n ans += 1\nprint(ans)\n", "slow_code_sha256": "b1e792dd3810c963171d990481698db953df4fbba41e2b1cb8b22991f36b26d4", "slow_id": "p03147_b1e792dd3810c963171d990481698db953df4fbba41e2b1cb8b22991f36b26d4", "speedup": 6.827921040771541, "stratum": "4-8", "within_pair_jaccard": 0.6190476190476191, "workload": {"case_count": 100, "description": "N flower heights start at zero. One operation increments every height in a chosen contiguous interval by 1. Minimize operations to obtain exactly the target heights h_i. Observed inputs: N=1..100 (median 50); h_i=0..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 404, "median": 137.0, "min": 4}, "input_format": ["N\nh_1 ... h_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 101, "median": 51.0, "min": 2}}} -{"case_ids": ["p02982_case_000", "p02982_case_001", "p02982_case_002", "p02982_case_003", "p02982_case_004", "p02982_case_005", "p02982_case_006", "p02982_case_007", "p02982_case_008", "p02982_case_009", "p02982_case_010", "p02982_case_011", "p02982_case_012", "p02982_case_013", "p02982_case_014", "p02982_case_015", "p02982_case_016", "p02982_case_017", "p02982_case_018", "p02982_case_019", "p02982_case_020", "p02982_case_021", "p02982_case_022", "p02982_case_023", "p02982_case_024", "p02982_case_025", "p02982_case_026", "p02982_case_027", "p02982_case_028", "p02982_case_029", "p02982_case_030", "p02982_case_031", "p02982_case_032", "p02982_case_033", "p02982_case_034", "p02982_case_035", "p02982_case_036", "p02982_case_037", "p02982_case_038", "p02982_case_039", "p02982_case_040", "p02982_case_041", "p02982_case_042", "p02982_case_043", "p02982_case_044", "p02982_case_045", "p02982_case_046", "p02982_case_047", "p02982_case_048", "p02982_case_049", "p02982_case_050", "p02982_case_051", "p02982_case_052", "p02982_case_053", "p02982_case_054", "p02982_case_055", "p02982_case_056", "p02982_case_057", "p02982_case_058", "p02982_case_059", "p02982_case_060", "p02982_case_061", "p02982_case_062", "p02982_case_063", "p02982_case_064", "p02982_case_065", "p02982_case_066", "p02982_case_067", "p02982_case_068", "p02982_case_069", "p02982_case_070", "p02982_case_071", "p02982_case_072", "p02982_case_073", "p02982_case_074", "p02982_case_075", "p02982_case_076", "p02982_case_077", "p02982_case_078", "p02982_case_079", "p02982_case_080", "p02982_case_081", "p02982_case_082", "p02982_case_083", "p02982_case_084", "p02982_case_085", "p02982_case_086", "p02982_case_087", "p02982_case_088", "p02982_case_089", "p02982_case_090", "p02982_case_091", "p02982_case_092", "p02982_case_093", "p02982_case_094", "p02982_case_095", "p02982_case_096", "p02982_case_097", "p02982_case_098", "p02982_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N, D = list(map(int, input().split()))\nX = [list(map(int, input().split())) for _ in range(N)]\n\n\ndef nasu(x, y):\n t = 0\n for i in range(D):\n t += (X[x][i] - X[y][i]) ** 2\n t **= 1 / 2\n if t == int(t):\n return 1\n else:\n return 0\n\n\nans = 0\nfor i in range(N - 1):\n for j in range(i + 1, N):\n ans += nasu(i, j)\nprint(ans)\n", "fast_code_sha256": "6cfc2bb869afd4f65a971a78de62e8f0f38f425f40964192e72021fc744587e2", "fast_id": "p02982_6cfc2bb869afd4f65a971a78de62e8f0f38f425f40964192e72021fc744587e2", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N, D = list(map(int, input().split()))\nX = [list(map(int, input().split())) for _ in range(N)]\n\n\ndef nasu(x, y):\n t = 0\n for i in range(D):\n t += (X[x][i] - X[y][i]) ** 2\n t **= 1 / 2\n if t == int(t):\n return 1\n else:\n return 0\n\n\nans = 0\nfor i in range(N - 1):\n for j in range(i + 1, N):\n ans += nasu(i, j)\nprint(ans)\n", "measured_fast_code_sha256": "6cfc2bb869afd4f65a971a78de62e8f0f38f425f40964192e72021fc744587e2", "measured_slow_code": "import numpy as np\n\nN, D = list(map(int, input().split()))\nX = np.zeros((N, D))\nfor i in range(N):\n X[i][:] = list(map(int, input().split()))\nn = 0\nfor i in range(N):\n for j in range(i + 1, N):\n dist = np.linalg.norm(X[i] - X[j])\n if dist.is_integer():\n n += 1\nprint(n)\n", "measured_slow_code_sha256": "3062723b648fda295737e748d4e0d5d9caa11a6c4d2d4160eb2931cf3e53df51", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 465.00908918190987, "pair_id": "python_v2_6d13a4ba056ed263da0fce1d", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02982", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02982_6cfc2bb869afd4f65a971a78de62e8f0f38f425f40964192e72021fc744587e2.jsonl.gz", "inputs": "reproduction/python/inputs/p02982.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02982_3062723b648fda295737e748d4e0d5d9caa11a6c4d2d4160eb2931cf3e53df51.jsonl.gz"}, "slow_code": "import numpy as np\n\nN, D = list(map(int, input().split()))\nX = np.zeros((N, D))\nfor i in range(N):\n X[i][:] = list(map(int, input().split()))\nn = 0\nfor i in range(N):\n for j in range(i + 1, N):\n dist = np.linalg.norm(X[i] - X[j])\n if dist.is_integer():\n n += 1\nprint(n)\n", "slow_code_sha256": "3062723b648fda295737e748d4e0d5d9caa11a6c4d2d4160eb2931cf3e53df51", "slow_id": "p02982_3062723b648fda295737e748d4e0d5d9caa11a6c4d2d4160eb2931cf3e53df51", "speedup": 387.7899233322059, "stratum": "8+", "within_pair_jaccard": 0.4594594594594595, "workload": {"case_count": 100, "description": "Given N distinct points with integer coordinates in D dimensions, count unordered pairs at integer Euclidean distance. Observed inputs: N=2..10 (median 5); D=1..10 (median 3); X_i_j=-20..20.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 321, "median": 50.0, "min": 8}, "input_format": ["N D\nX_1,1 ... X_1,D\n...\nX_N,1 ... X_N,D"], "input_format_status": "source_input_section", "input_lines": {"max": 11, "median": 6.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 102, "median": 17.0, "min": 4}}} -{"case_ids": ["p02995_case_000", "p02995_case_001", "p02995_case_002", "p02995_case_003", "p02995_case_004", "p02995_case_005", "p02995_case_006", "p02995_case_007", "p02995_case_008", "p02995_case_009", "p02995_case_010", "p02995_case_011", "p02995_case_012", "p02995_case_013", "p02995_case_014", "p02995_case_015", "p02995_case_016", "p02995_case_017", "p02995_case_018", "p02995_case_019", "p02995_case_020", "p02995_case_021", "p02995_case_022", "p02995_case_023", "p02995_case_024", "p02995_case_025", "p02995_case_026", "p02995_case_027", "p02995_case_028", "p02995_case_029", "p02995_case_030", "p02995_case_031", "p02995_case_032", "p02995_case_033", "p02995_case_034", "p02995_case_035", "p02995_case_036", "p02995_case_037", "p02995_case_038", "p02995_case_039", "p02995_case_040", "p02995_case_041", "p02995_case_042", "p02995_case_043", "p02995_case_044", "p02995_case_045", "p02995_case_046", "p02995_case_047", "p02995_case_048", "p02995_case_049", "p02995_case_050", "p02995_case_051", "p02995_case_052", "p02995_case_053", "p02995_case_054", "p02995_case_055", "p02995_case_056", "p02995_case_057", "p02995_case_058", "p02995_case_059", "p02995_case_060", "p02995_case_061", "p02995_case_062", "p02995_case_063", "p02995_case_064", "p02995_case_065", "p02995_case_066", "p02995_case_067", "p02995_case_068", "p02995_case_069", "p02995_case_070", "p02995_case_071", "p02995_case_072", "p02995_case_073", "p02995_case_074", "p02995_case_075", "p02995_case_076", "p02995_case_077", "p02995_case_078", "p02995_case_079", "p02995_case_080", "p02995_case_081", "p02995_case_082", "p02995_case_083", "p02995_case_084", "p02995_case_085", "p02995_case_086", "p02995_case_087", "p02995_case_088", "p02995_case_089", "p02995_case_090", "p02995_case_091", "p02995_case_092", "p02995_case_093", "p02995_case_094", "p02995_case_095", "p02995_case_096", "p02995_case_097", "p02995_case_098", "p02995_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\n\ndef S():\n return sys.stdin.readline().rstrip()\n\n\nA, B, C, D = list(map(int, S().split()))\nfrom math import gcd\n\n\ndef f(n):\n return n - n // C - n // D + n // (C * D // gcd(C, D))\n\n\nprint((f(B) - f(A - 1)))\n", "fast_code_sha256": "40c384de9916c20716412ceeb875503501d088f9314d691c5f81bc3c1cf9e892", "fast_id": "p02995_5956a1b2d912bfd23345c485f0ffc7b6e25d46613e1c4f11a08333a208413d78", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\n\ndef S():\n return sys.stdin.readline().rstrip()\n\n\nA, B, C, D = list(map(int, S().split()))\nfrom math import gcd\n\n\ndef f(n): # 1からnまでCでもDでも割り切れない自然数の個数\n return n - n // C - n // D + n // (C * D // gcd(C, D))\n\n\nprint((f(B) - f(A - 1)))\n", "measured_fast_code_sha256": "5956a1b2d912bfd23345c485f0ffc7b6e25d46613e1c4f11a08333a208413d78", "measured_slow_code": "def floor(a, b):\n # return int((a - a%b)/b)\n return a // b\n\n\ndef gcd(a, b):\n while b != 0:\n a, b = b, a % b\n return a\n\n\ndef lcm(a, b):\n return floor((a * b), gcd(a, b))\n\n\ninput = list(map(int, input().split(\" \")))\ntotal_count = input[1] + 1 - input[0]\ndiv_c = floor(input[1], input[2]) - floor(input[0] - 1, input[2])\ndiv_d = floor(input[1], input[3]) - floor(input[0] - 1, input[3])\ndiv_cd = floor(input[1], lcm(input[2], input[3])) - floor(\n input[0] - 1, lcm(input[2], input[3])\n)\nprint((total_count - (div_c + div_d - div_cd)))\n", "measured_slow_code_sha256": "df925af8753272e8ec1984ff302aca1be38e4ae8b71e704a8c242857bf509531", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.0605144314749078, "pair_id": "python_v2_2e9210de0f6c0efb52aac232", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02995", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02995_5956a1b2d912bfd23345c485f0ffc7b6e25d46613e1c4f11a08333a208413d78.jsonl.gz", "inputs": "reproduction/python/inputs/p02995.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02995_df925af8753272e8ec1984ff302aca1be38e4ae8b71e704a8c242857bf509531.jsonl.gz"}, "slow_code": "def floor(a, b):\n\n return a // b\n\n\ndef gcd(a, b):\n while b != 0:\n a, b = b, a % b\n return a\n\n\ndef lcm(a, b):\n return floor((a * b), gcd(a, b))\n\n\ninput = list(map(int, input().split(\" \")))\ntotal_count = input[1] + 1 - input[0]\ndiv_c = floor(input[1], input[2]) - floor(input[0] - 1, input[2])\ndiv_d = floor(input[1], input[3]) - floor(input[0] - 1, input[3])\ndiv_cd = floor(input[1], lcm(input[2], input[3])) - floor(\n input[0] - 1, lcm(input[2], input[3])\n)\nprint((total_count - (div_c + div_d - div_cd)))\n", "slow_code_sha256": "6fc5067dd8ac941ec31580f2241fcd08dc5630fd6446ba8de71c3aa9f59aa2c9", "slow_id": "p02995_df925af8753272e8ec1984ff302aca1be38e4ae8b71e704a8c242857bf509531", "speedup": 2.0556819340761883, "stratum": "2-4", "within_pair_jaccard": 0.25, "workload": {"case_count": 100, "description": "Count integers in inclusive interval [A,B] divisible by neither C nor D. The interval is given by endpoints, not by listing its members. Observed inputs: A=1..992930041683160624; B=1..1000000000000000000; C=1..1000000000; D=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 58, "median": 58.0, "min": 8}, "input_format": ["A B C D"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 4, "median": 4.0, "min": 4}}} -{"case_ids": ["p00150_case_000", "p00150_case_001", "p00150_case_002", "p00150_case_003", "p00150_case_004", "p00150_case_005", "p00150_case_006", "p00150_case_007", "p00150_case_008", "p00150_case_009", "p00150_case_010", "p00150_case_011", "p00150_case_012", "p00150_case_013", "p00150_case_014", "p00150_case_015", "p00150_case_016", "p00150_case_017", "p00150_case_018", "p00150_case_019", "p00150_case_020", "p00150_case_021", "p00150_case_022", "p00150_case_023", "p00150_case_024", "p00150_case_025", "p00150_case_026", "p00150_case_027", "p00150_case_028", "p00150_case_029", "p00150_case_030", "p00150_case_031", "p00150_case_032", "p00150_case_033", "p00150_case_034", "p00150_case_035", "p00150_case_036", "p00150_case_037", "p00150_case_038", "p00150_case_039", "p00150_case_040", "p00150_case_041", "p00150_case_042", "p00150_case_043", "p00150_case_044", "p00150_case_045", "p00150_case_046", "p00150_case_047", "p00150_case_048", "p00150_case_049", "p00150_case_050", "p00150_case_051", "p00150_case_052", "p00150_case_053", "p00150_case_054", "p00150_case_055", "p00150_case_056", "p00150_case_057", "p00150_case_058", "p00150_case_059", "p00150_case_060", "p00150_case_061", "p00150_case_062", "p00150_case_063", "p00150_case_064", "p00150_case_065", "p00150_case_066", "p00150_case_067", "p00150_case_068", "p00150_case_069", "p00150_case_070", "p00150_case_071", "p00150_case_072", "p00150_case_073", "p00150_case_074", "p00150_case_075", "p00150_case_076", "p00150_case_077", "p00150_case_078", "p00150_case_079", "p00150_case_080", "p00150_case_081", "p00150_case_082", "p00150_case_083", "p00150_case_084", "p00150_case_085", "p00150_case_086", "p00150_case_087", "p00150_case_088", "p00150_case_089", "p00150_case_090", "p00150_case_091", "p00150_case_092", "p00150_case_093", "p00150_case_094", "p00150_case_095", "p00150_case_096", "p00150_case_097", "p00150_case_098", "p00150_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import bisect as bs\n\n\ndef prime(m):\n N = list(range(1, m + 1, 2))\n N[0] = 2\n for i in range(1, int(m**0.5) + 1):\n x = N[i]\n if x:\n N[i + x :: x] = [0] * len(N[i + x :: x])\n return [_f for _f in N if _f]\n\n\nP = prime(10000)\nx = [P[i] for i in range(1, len(P)) if P[i] - P[i - 1] == 2]\nwhile 1:\n n = eval(input())\n if n == 0:\n break\n a = x[bs.bisect_right(x, n) - 1]\n print(a - 2, a)\n", "fast_code_sha256": "9ca73476f1131853179fecf70c42d279491ae767fa15807203ecca379aa873a7", "fast_id": "p00150_9ca73476f1131853179fecf70c42d279491ae767fa15807203ecca379aa873a7", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import bisect as bs\n\n\ndef prime(m):\n N = list(range(1, m + 1, 2))\n N[0] = 2\n for i in range(1, int(m**0.5) + 1):\n x = N[i]\n if x:\n N[i + x :: x] = [0] * len(N[i + x :: x])\n return [_f for _f in N if _f]\n\n\nP = prime(10000)\nx = [P[i] for i in range(1, len(P)) if P[i] - P[i - 1] == 2]\nwhile 1:\n n = eval(input())\n if n == 0:\n break\n a = x[bs.bisect_right(x, n) - 1]\n print(a - 2, a)\n", "measured_fast_code_sha256": "9ca73476f1131853179fecf70c42d279491ae767fa15807203ecca379aa873a7", "measured_slow_code": "r = 10001\nsqrt = int(r**0.5)\np = [1] * r\ntwin = [0] * r\np[0] = 0\np[1::2] = [0 for x in range(1, r, 2)]\nfor i in range(2, r, 2):\n if p[i]:\n p[2 * i + 1 :: i + 1] = [0 for x in range(2 * i + 1, r, i + 1)]\n if p[i - 2]:\n twin[i] = 1\nwhile True:\n n = int(input())\n if n == 0:\n break\n i = n - twin[:n][::-1].index(1)\n print(i - 2, i)\n", "measured_slow_code_sha256": "20faefeb67c15aa810ff24a8c45594ce14afc5e4e8f28efcde254ca1f9a3dabc", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4.264261585040613, "pair_id": "python_v2_c8ee53e072b00bf9a21f9f9a", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p00150", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p00150_9ca73476f1131853179fecf70c42d279491ae767fa15807203ecca379aa873a7.jsonl.gz", "inputs": "reproduction/python/inputs/p00150.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p00150_20faefeb67c15aa810ff24a8c45594ce14afc5e4e8f28efcde254ca1f9a3dabc.jsonl.gz"}, "slow_code": "r = 10001\nsqrt = int(r**0.5)\np = [1] * r\ntwin = [0] * r\np[0] = 0\np[1::2] = [0 for x in range(1, r, 2)]\nfor i in range(2, r, 2):\n if p[i]:\n p[2 * i + 1 :: i + 1] = [0 for x in range(2 * i + 1, r, i + 1)]\n if p[i - 2]:\n twin[i] = 1\nwhile True:\n n = int(input())\n if n == 0:\n break\n i = n - twin[:n][::-1].index(1)\n print(i - 2, i)\n", "slow_code_sha256": "20faefeb67c15aa810ff24a8c45594ce14afc5e4e8f28efcde254ca1f9a3dabc", "slow_id": "p00150_20faefeb67c15aa810ff24a8c45594ce14afc5e4e8f28efcde254ca1f9a3dabc", "speedup": 4.2483158966207215, "stratum": "4-8", "within_pair_jaccard": 0.4, "workload": {"case_count": 100, "description": "For each upper bound n, find primes p and q=p+2 with q<=n and q as large as possible. Each line supplies one n; a final zero terminates input. Observed inputs: datasets=1..100 (median 5); n=5..10000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 497, "median": 27.0, "min": 4}, "input_format": ["n_1\n...\nn_D\n0"], "input_format_status": "source_input_section", "input_lines": {"max": 101, "median": 6.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 101, "median": 6.0, "min": 2}}} -{"case_ids": ["p03962_case_000", "p03962_case_001", "p03962_case_002", "p03962_case_003", "p03962_case_004", "p03962_case_005", "p03962_case_006", "p03962_case_007", "p03962_case_008", "p03962_case_009", "p03962_case_010", "p03962_case_011", "p03962_case_012", "p03962_case_013", "p03962_case_014", "p03962_case_015", "p03962_case_016", "p03962_case_017", "p03962_case_018", "p03962_case_019", "p03962_case_020", "p03962_case_021", "p03962_case_022", "p03962_case_023", "p03962_case_024", "p03962_case_025", "p03962_case_026", "p03962_case_027", "p03962_case_028", "p03962_case_029", "p03962_case_030", "p03962_case_031", "p03962_case_032", "p03962_case_033", "p03962_case_034", "p03962_case_035", "p03962_case_036", "p03962_case_037", "p03962_case_038", "p03962_case_039", "p03962_case_040", "p03962_case_041", "p03962_case_042", "p03962_case_043", "p03962_case_044", "p03962_case_045", "p03962_case_046", "p03962_case_047", "p03962_case_048", "p03962_case_049", "p03962_case_050", "p03962_case_051", "p03962_case_052", "p03962_case_053", "p03962_case_054", "p03962_case_055", "p03962_case_056", "p03962_case_057", "p03962_case_058", "p03962_case_059", "p03962_case_060", "p03962_case_061", "p03962_case_062", "p03962_case_063", "p03962_case_064", "p03962_case_065", "p03962_case_066", "p03962_case_067", "p03962_case_068", "p03962_case_069", "p03962_case_070", "p03962_case_071", "p03962_case_072", "p03962_case_073", "p03962_case_074", "p03962_case_075", "p03962_case_076", "p03962_case_077", "p03962_case_078", "p03962_case_079", "p03962_case_080", "p03962_case_081", "p03962_case_082", "p03962_case_083", "p03962_case_084", "p03962_case_085", "p03962_case_086", "p03962_case_087", "p03962_case_088", "p03962_case_089", "p03962_case_090", "p03962_case_091", "p03962_case_092", "p03962_case_093", "p03962_case_094", "p03962_case_095", "p03962_case_096", "p03962_case_097", "p03962_case_098", "p03962_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "print((len({*input().split()})))\n", "fast_code_sha256": "58d5197f8e56470e4bf6371be6a42c8db60f474c0b6b7e6c6e002ba43e31c53c", "fast_id": "p03962_58d5197f8e56470e4bf6371be6a42c8db60f474c0b6b7e6c6e002ba43e31c53c", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "print((len({*input().split()})))\n", "measured_fast_code_sha256": "58d5197f8e56470e4bf6371be6a42c8db60f474c0b6b7e6c6e002ba43e31c53c", "measured_slow_code": "x, y, z = list(map(int, input().split()))\nif x == y and y == z:\n print((1))\nelif x == y or y == z or z == x:\n print((2))\nelse:\n print((3))\n", "measured_slow_code_sha256": "24c7e03eb06391afb178bbc9822c72872960e2ddbc2acbb527389de409e3ad89", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.047981474454856, "pair_id": "python_v2_87d2391f5a78f1b6c4d452c7", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03962", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03962_58d5197f8e56470e4bf6371be6a42c8db60f474c0b6b7e6c6e002ba43e31c53c.jsonl.gz", "inputs": "reproduction/python/inputs/p03962.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03962_24c7e03eb06391afb178bbc9822c72872960e2ddbc2acbb527389de409e3ad89.jsonl.gz"}, "slow_code": "x, y, z = list(map(int, input().split()))\nif x == y and y == z:\n print((1))\nelif x == y or y == z or z == x:\n print((2))\nelse:\n print((3))\n", "slow_code_sha256": "24c7e03eb06391afb178bbc9822c72872960e2ddbc2acbb527389de409e3ad89", "slow_id": "p03962_24c7e03eb06391afb178bbc9822c72872960e2ddbc2acbb527389de409e3ad89", "speedup": 3.047075298215987, "stratum": "2-4", "within_pair_jaccard": 0.16666666666666666, "workload": {"case_count": 100, "description": "Three paint cans have integer color IDs a,b,c. Count distinct colors among the three, allowing equal IDs. Observed inputs: color_value=1..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 12, "median": 9.0, "min": 6}, "input_format": ["a b c"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3, "median": 3.0, "min": 3}}} -{"case_ids": ["p04000_case_000", "p04000_case_001", "p04000_case_002", "p04000_case_003", "p04000_case_004", "p04000_case_005", "p04000_case_006", "p04000_case_007", "p04000_case_008", "p04000_case_009", "p04000_case_010", "p04000_case_011", "p04000_case_012", "p04000_case_013", "p04000_case_014", "p04000_case_015", "p04000_case_016", "p04000_case_017", "p04000_case_018", "p04000_case_019", "p04000_case_020", "p04000_case_021", "p04000_case_022", "p04000_case_023", "p04000_case_024", "p04000_case_025", "p04000_case_026", "p04000_case_027", "p04000_case_028", "p04000_case_029", "p04000_case_030", "p04000_case_031", "p04000_case_032", "p04000_case_033", "p04000_case_034", "p04000_case_035", "p04000_case_036", "p04000_case_037", "p04000_case_038", "p04000_case_039", "p04000_case_040", "p04000_case_041", "p04000_case_042", "p04000_case_043", "p04000_case_044", "p04000_case_045", "p04000_case_046", "p04000_case_047", "p04000_case_048", "p04000_case_049", "p04000_case_050", "p04000_case_051", "p04000_case_052", "p04000_case_053", "p04000_case_054", "p04000_case_055", "p04000_case_056", "p04000_case_057", "p04000_case_058", "p04000_case_059", "p04000_case_060", "p04000_case_061", "p04000_case_062", "p04000_case_063", "p04000_case_064", "p04000_case_065", "p04000_case_066", "p04000_case_067", "p04000_case_068", "p04000_case_069", "p04000_case_070", "p04000_case_071", "p04000_case_072", "p04000_case_073", "p04000_case_074", "p04000_case_075", "p04000_case_076", "p04000_case_077", "p04000_case_078", "p04000_case_079", "p04000_case_080", "p04000_case_081", "p04000_case_082", "p04000_case_083", "p04000_case_084", "p04000_case_085", "p04000_case_086", "p04000_case_087", "p04000_case_088", "p04000_case_089", "p04000_case_090", "p04000_case_091", "p04000_case_092", "p04000_case_093", "p04000_case_094", "p04000_case_095", "p04000_case_096", "p04000_case_097", "p04000_case_098", "p04000_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from collections import defaultdict, Counter\n\nH, W, N = list(map(int, input().split()))\nD = defaultdict(int)\nfor _ in range(N):\n a, b = list(map(int, input().split()))\n for i in range(a - 2, a + 1):\n if 1 <= i <= H - 2:\n for j in range(b - 2, b + 1):\n if 1 <= j <= W - 2:\n D[(i, j)] += 1\nprint(((H - 2) * (W - 2) - len(D)))\nc = Counter(list(D.values()))\nfor i in range(1, 10):\n print((c.get(i, 0)))\n", "fast_code_sha256": "6f01b21aaef3552a9287719c35aa6e3c6365eb107e56c0d0ac4507489ff94d46", "fast_id": "p04000_6f01b21aaef3552a9287719c35aa6e3c6365eb107e56c0d0ac4507489ff94d46", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from collections import defaultdict, Counter\n\nH, W, N = list(map(int, input().split()))\nD = defaultdict(int)\nfor _ in range(N):\n a, b = list(map(int, input().split()))\n for i in range(a - 2, a + 1):\n if 1 <= i <= H - 2:\n for j in range(b - 2, b + 1):\n if 1 <= j <= W - 2:\n D[(i, j)] += 1\nprint(((H - 2) * (W - 2) - len(D)))\nc = Counter(list(D.values()))\nfor i in range(1, 10):\n print((c.get(i, 0)))\n", "measured_fast_code_sha256": "6f01b21aaef3552a9287719c35aa6e3c6365eb107e56c0d0ac4507489ff94d46", "measured_slow_code": "H, W, N = list(map(int, input().split()))\nB = set([])\nfor i in range(N):\n a, b = list(map(int, input().split()))\n a -= 1\n b -= 1\n B.add((a, b))\n# print(B)\nBB = list(B)\nans = [0 for _ in range(10)]\nfor i in range(N):\n cnt = 0\n temp = 0\n x, y = BB[i]\n # print(x,y)\n for sx in range(max(0, x - 2), min(x, H - 3) + 1):\n for sy in range(max(0, y - 2), min(y, W - 3) + 1):\n temp = 0\n for p in range(3):\n for q in range(3):\n if (sx + p, sy + q) in B:\n temp += 1\n # print(sx,sy,temp)\n ans[temp] += 1\nfor i in range(1, 10):\n ans[i] = ans[i] // i\nans[0] = (H - 2) * (W - 2) - sum(ans[1:])\nfor t in ans:\n print(t)\n", "measured_slow_code_sha256": "a36bab8f921599e4ca7482c881bfcc39764a8e5acc14a246031adfce3dcc98b4", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.847027807538202, "pair_id": "python_v2_67d80930043522fcb879ff55", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p04000", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p04000_6f01b21aaef3552a9287719c35aa6e3c6365eb107e56c0d0ac4507489ff94d46.jsonl.gz", "inputs": "reproduction/python/inputs/p04000.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p04000_a36bab8f921599e4ca7482c881bfcc39764a8e5acc14a246031adfce3dcc98b4.jsonl.gz"}, "slow_code": "H, W, N = list(map(int, input().split()))\nB = set([])\nfor i in range(N):\n a, b = list(map(int, input().split()))\n a -= 1\n b -= 1\n B.add((a, b))\n\nBB = list(B)\nans = [0 for _ in range(10)]\nfor i in range(N):\n cnt = 0\n temp = 0\n x, y = BB[i]\n\n for sx in range(max(0, x - 2), min(x, H - 3) + 1):\n for sy in range(max(0, y - 2), min(y, W - 3) + 1):\n temp = 0\n for p in range(3):\n for q in range(3):\n if (sx + p, sy + q) in B:\n temp += 1\n\n ans[temp] += 1\nfor i in range(1, 10):\n ans[i] = ans[i] // i\nans[0] = (H - 2) * (W - 2) - sum(ans[1:])\nfor t in ans:\n print(t)\n", "slow_code_sha256": "12645471e5b932b71064020cd96552bd93299a86ffda13a17e3ba1b8f76a6c83", "slow_id": "p04000_a36bab8f921599e4ca7482c881bfcc39764a8e5acc14a246031adfce3dcc98b4", "speedup": 2.781078105016332, "stratum": "2-4", "within_pair_jaccard": 0.42, "workload": {"case_count": 100, "description": "An H-by-W grid starts white; N distinct listed cells become black. For each j=0..9, count 3-by-3 subrectangles containing exactly j black cells. Only black coordinates are supplied, not the full grid. Observed inputs: H=3..1000000000; W=3..1000000000; N=0..100000 (median 1000); a_i=1..1000000000; b_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1978094, "median": 7447.0, "min": 6}, "input_format": ["H W N\na_1 b_1\n...\na_N b_N"], "input_format_status": "source_input_section", "input_lines": {"max": 100001, "median": 1001.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200003, "median": 2003.0, "min": 3}}} -{"case_ids": ["p02831_case_000", "p02831_case_001", "p02831_case_002", "p02831_case_003", "p02831_case_004", "p02831_case_005", "p02831_case_006", "p02831_case_007", "p02831_case_008", "p02831_case_009", "p02831_case_010", "p02831_case_011", "p02831_case_012", "p02831_case_013", "p02831_case_014", "p02831_case_015", "p02831_case_016", "p02831_case_017", "p02831_case_018", "p02831_case_019", "p02831_case_020", "p02831_case_021", "p02831_case_022", "p02831_case_023", "p02831_case_024", "p02831_case_025", "p02831_case_026", "p02831_case_027", "p02831_case_028", "p02831_case_029", "p02831_case_030", "p02831_case_031", "p02831_case_032", "p02831_case_033", "p02831_case_034", "p02831_case_035", "p02831_case_036", "p02831_case_037", "p02831_case_038", "p02831_case_039", "p02831_case_040", "p02831_case_041", "p02831_case_042", "p02831_case_043", "p02831_case_044", "p02831_case_045", "p02831_case_046", "p02831_case_047", "p02831_case_048", "p02831_case_049", "p02831_case_050", "p02831_case_051", "p02831_case_052", "p02831_case_053", "p02831_case_054", "p02831_case_055", "p02831_case_056", "p02831_case_057", "p02831_case_058", "p02831_case_059", "p02831_case_060", "p02831_case_061", "p02831_case_062", "p02831_case_063", "p02831_case_064", "p02831_case_065", "p02831_case_066", "p02831_case_067", "p02831_case_068", "p02831_case_069", "p02831_case_070", "p02831_case_071", "p02831_case_072", "p02831_case_073", "p02831_case_074", "p02831_case_075", "p02831_case_076", "p02831_case_077", "p02831_case_078", "p02831_case_079", "p02831_case_080", "p02831_case_081", "p02831_case_082", "p02831_case_083", "p02831_case_084", "p02831_case_085", "p02831_case_086", "p02831_case_087", "p02831_case_088", "p02831_case_089", "p02831_case_090", "p02831_case_091", "p02831_case_092", "p02831_case_093", "p02831_case_094", "p02831_case_095", "p02831_case_096", "p02831_case_097", "p02831_case_098", "p02831_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "num1, num2 = list(map(int, input().split()))\nimport math\n\n\ndef gcd(num1, num2):\n for i in range(min(num1, num2), 0, -1):\n if num1 % i == 0 and num2 % i == 0:\n return i\n\n\nprint((int(num1 * num2 / gcd(num1, num2))))\n", "fast_code_sha256": "9a1626365f94b8a7d0331e3eabf1740b93398b58e75f9e3e35d2d82ea57bb14e", "fast_id": "p02831_9a1626365f94b8a7d0331e3eabf1740b93398b58e75f9e3e35d2d82ea57bb14e", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "num1, num2 = list(map(int, input().split()))\nimport math\n\n\ndef gcd(num1, num2):\n for i in range(min(num1, num2), 0, -1):\n if num1 % i == 0 and num2 % i == 0:\n return i\n\n\nprint((int(num1 * num2 / gcd(num1, num2))))\n", "measured_fast_code_sha256": "9a1626365f94b8a7d0331e3eabf1740b93398b58e75f9e3e35d2d82ea57bb14e", "measured_slow_code": "a, b = list(map(int, input().split()))\ngcd = 0\nfor i in range(max(a, b), 0, -1):\n if a % i == 0 and b % i == 0:\n gcd = i\n break\nprint((a * b // gcd))\n", "measured_slow_code_sha256": "3de3fe8bb1afacef9e4d94cddd67b61d71115eb2182c7ba15fc5dcbd918bfe9c", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.2348360744806515, "pair_id": "python_v2_4359552d65a0fa7930cdf810", "per_case_slow_code_faster_fraction": 0.14, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02831", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02831_9a1626365f94b8a7d0331e3eabf1740b93398b58e75f9e3e35d2d82ea57bb14e.jsonl.gz", "inputs": "reproduction/python/inputs/p02831.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02831_3de3fe8bb1afacef9e4d94cddd67b61d71115eb2182c7ba15fc5dcbd918bfe9c.jsonl.gz"}, "slow_code": "a, b = list(map(int, input().split()))\ngcd = 0\nfor i in range(max(a, b), 0, -1):\n if a % i == 0 and b % i == 0:\n gcd = i\n break\nprint((a * b // gcd))\n", "slow_code_sha256": "3de3fe8bb1afacef9e4d94cddd67b61d71115eb2182c7ba15fc5dcbd918bfe9c", "slow_id": "p02831_3de3fe8bb1afacef9e4d94cddd67b61d71115eb2182c7ba15fc5dcbd918bfe9c", "speedup": 5.790126723402872, "stratum": "4-8", "within_pair_jaccard": 0.5769230769230769, "workload": {"case_count": 100, "description": "Find the minimum positive number of indivisible snack pieces that can be distributed equally either to A guests or to B guests, with each guest receiving at least one piece. A and B differ. Observed inputs: A=1..100000 (median 59009.5); B=1..99999 (median 42628).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 13, "median": 12.0, "min": 4}, "input_format": ["A B"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p02994_case_000", "p02994_case_001", "p02994_case_002", "p02994_case_003", "p02994_case_004", "p02994_case_005", "p02994_case_006", "p02994_case_007", "p02994_case_008", "p02994_case_009", "p02994_case_010", "p02994_case_011", "p02994_case_012", "p02994_case_013", "p02994_case_014", "p02994_case_015", "p02994_case_016", "p02994_case_017", "p02994_case_018", "p02994_case_019", "p02994_case_020", "p02994_case_021", "p02994_case_022", "p02994_case_023", "p02994_case_024", "p02994_case_025", "p02994_case_026", "p02994_case_027", "p02994_case_028", "p02994_case_029", "p02994_case_030", "p02994_case_031", "p02994_case_032", "p02994_case_033", "p02994_case_034", "p02994_case_035", "p02994_case_036", "p02994_case_037", "p02994_case_038", "p02994_case_039", "p02994_case_040", "p02994_case_041", "p02994_case_042", "p02994_case_043", "p02994_case_044", "p02994_case_045", "p02994_case_046", "p02994_case_047", "p02994_case_048", "p02994_case_049", "p02994_case_050", "p02994_case_051", "p02994_case_052", "p02994_case_053", "p02994_case_054", "p02994_case_055", "p02994_case_056", "p02994_case_057", "p02994_case_058", "p02994_case_059", "p02994_case_060", "p02994_case_061", "p02994_case_062", "p02994_case_063", "p02994_case_064", "p02994_case_065", "p02994_case_066", "p02994_case_067", "p02994_case_068", "p02994_case_069", "p02994_case_070", "p02994_case_071", "p02994_case_072", "p02994_case_073", "p02994_case_074", "p02994_case_075", "p02994_case_076", "p02994_case_077", "p02994_case_078", "p02994_case_079", "p02994_case_080", "p02994_case_081", "p02994_case_082", "p02994_case_083", "p02994_case_084", "p02994_case_085", "p02994_case_086", "p02994_case_087", "p02994_case_088", "p02994_case_089", "p02994_case_090", "p02994_case_091", "p02994_case_092", "p02994_case_093", "p02994_case_094", "p02994_case_095", "p02994_case_096", "p02994_case_097", "p02994_case_098", "p02994_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n, l = list(map(int, input().split()))\nif l > 0:\n print((sum(range(l + 1, l + n))))\nelif l + n - 1 < 0:\n print((sum(range(l, l + n - 1))))\nelse:\n print((sum(range(l, l + n))))\n", "fast_code_sha256": "9c85e29cf2e084939c6660d9a3ef9d7e6812634748dda97e44d2f7870123e106", "fast_id": "p02994_9c85e29cf2e084939c6660d9a3ef9d7e6812634748dda97e44d2f7870123e106", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n, l = list(map(int, input().split()))\nif l > 0:\n print((sum(range(l + 1, l + n))))\nelif l + n - 1 < 0:\n print((sum(range(l, l + n - 1))))\nelse:\n print((sum(range(l, l + n))))\n", "measured_fast_code_sha256": "9c85e29cf2e084939c6660d9a3ef9d7e6812634748dda97e44d2f7870123e106", "measured_slow_code": "import copy\n\nN, L = list(map(int, input().split()))\nflaver = []\nfor i in range(1, N + 1):\n flaver.append(L + i - 1)\nflaver_sum = sum(flaver)\nfor i in range(len(flaver)):\n c_flaver = copy.deepcopy(flaver)\n del c_flaver[i]\n if i == 0:\n tmp_min = abs(flaver_sum - sum(c_flaver))\n index = i\n if abs(flaver_sum - sum(c_flaver)) < tmp_min:\n tmp_min = abs(flaver_sum - sum(c_flaver))\n index = i\ndel flaver[index]\nprint((sum(flaver)))\n", "measured_slow_code_sha256": "b033c38ec6619d100b0693f703ee7559d8c7c976d73cee1d8a552d7f88a6875e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 119.50905702459258, "pair_id": "python_v2_572a07b4ee52e70ca1aebe9d", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02994", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02994_9c85e29cf2e084939c6660d9a3ef9d7e6812634748dda97e44d2f7870123e106.jsonl.gz", "inputs": "reproduction/python/inputs/p02994.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02994_b033c38ec6619d100b0693f703ee7559d8c7c976d73cee1d8a552d7f88a6875e.jsonl.gz"}, "slow_code": "import copy\n\nN, L = list(map(int, input().split()))\nflaver = []\nfor i in range(1, N + 1):\n flaver.append(L + i - 1)\nflaver_sum = sum(flaver)\nfor i in range(len(flaver)):\n c_flaver = copy.deepcopy(flaver)\n del c_flaver[i]\n if i == 0:\n tmp_min = abs(flaver_sum - sum(c_flaver))\n index = i\n if abs(flaver_sum - sum(c_flaver)) < tmp_min:\n tmp_min = abs(flaver_sum - sum(c_flaver))\n index = i\ndel flaver[index]\nprint((sum(flaver)))\n", "slow_code_sha256": "b033c38ec6619d100b0693f703ee7559d8c7c976d73cee1d8a552d7f88a6875e", "slow_id": "p02994_b033c38ec6619d100b0693f703ee7559d8c7c976d73cee1d8a552d7f88a6875e", "speedup": 89.89077604745616, "stratum": "8+", "within_pair_jaccard": 0.34375, "workload": {"case_count": 100, "description": "N apples have flavors L,L+1,...,L+N-1, possibly negative. Remove one apple to minimize the absolute difference between the remaining flavor sum and the original total; output the remaining sum. Observed inputs: N=2..200 (median 100); L=-100..100 (median -14).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 9, "median": 7.0, "min": 4}, "input_format": ["N L"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p02935_case_000", "p02935_case_001", "p02935_case_002", "p02935_case_003", "p02935_case_004", "p02935_case_005", "p02935_case_006", "p02935_case_007", "p02935_case_008", "p02935_case_009", "p02935_case_010", "p02935_case_011", "p02935_case_012", "p02935_case_013", "p02935_case_014", "p02935_case_015", "p02935_case_016", "p02935_case_017", "p02935_case_018", "p02935_case_019", "p02935_case_020", "p02935_case_021", "p02935_case_022", "p02935_case_023", "p02935_case_024", "p02935_case_025", "p02935_case_026", "p02935_case_027", "p02935_case_028", "p02935_case_029", "p02935_case_030", "p02935_case_031", "p02935_case_032", "p02935_case_033", "p02935_case_034", "p02935_case_035", "p02935_case_036", "p02935_case_037", "p02935_case_038", "p02935_case_039", "p02935_case_040", "p02935_case_041", "p02935_case_042", "p02935_case_043", "p02935_case_044", "p02935_case_045", "p02935_case_046", "p02935_case_047", "p02935_case_048", "p02935_case_049", "p02935_case_050", "p02935_case_051", "p02935_case_052", "p02935_case_053", "p02935_case_054", "p02935_case_055", "p02935_case_056", "p02935_case_057", "p02935_case_058", "p02935_case_059", "p02935_case_060", "p02935_case_061", "p02935_case_062", "p02935_case_063", "p02935_case_064", "p02935_case_065", "p02935_case_066", "p02935_case_067", "p02935_case_068", "p02935_case_069", "p02935_case_070", "p02935_case_071", "p02935_case_072", "p02935_case_073", "p02935_case_074", "p02935_case_075", "p02935_case_076", "p02935_case_077", "p02935_case_078", "p02935_case_079", "p02935_case_080", "p02935_case_081", "p02935_case_082", "p02935_case_083", "p02935_case_084", "p02935_case_085", "p02935_case_086", "p02935_case_087", "p02935_case_088", "p02935_case_089", "p02935_case_090", "p02935_case_091", "p02935_case_092", "p02935_case_093", "p02935_case_094", "p02935_case_095", "p02935_case_096", "p02935_case_097", "p02935_case_098", "p02935_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import bisect\n\n\ndef main():\n N = int(eval(input()))\n v = sorted(list(map(int, input().split())))\n while len(v) > 1:\n num1 = v.pop(0)\n num2 = v.pop(0)\n avg = (num1 + num2) / 2\n idx = bisect.bisect(v, avg)\n v.insert(idx, avg)\n print((v[0]))\n\n\nmain()\n", "fast_code_sha256": "b4826e91253fe6570252ac9e9333745f7f06aa94a31244644ffd8e29e08965e1", "fast_id": "p02935_b4826e91253fe6570252ac9e9333745f7f06aa94a31244644ffd8e29e08965e1", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import bisect\n\n\ndef main():\n N = int(eval(input()))\n v = sorted(list(map(int, input().split())))\n while len(v) > 1:\n num1 = v.pop(0)\n num2 = v.pop(0)\n avg = (num1 + num2) / 2\n idx = bisect.bisect(v, avg)\n v.insert(idx, avg)\n print((v[0]))\n\n\nmain()\n", "measured_fast_code_sha256": "b4826e91253fe6570252ac9e9333745f7f06aa94a31244644ffd8e29e08965e1", "measured_slow_code": "import numpy as np\n\nn = int(eval(input()))\nlista = list(map(int, input().split()))\nlista.sort()\nfor i in range(n - 1):\n lista.append((lista[0] + lista[1]) / 2)\n lista.pop(0)\n lista.pop(0)\n lista.sort()\nprint((lista[0]))\n", "measured_slow_code_sha256": "4fce74aca7d1608f14c76b9fb92532f43bd52c914832f66cdc3ddf21b1636b9b", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 598.4506843521297, "pair_id": "python_v2_f86d776d503fa4bd1773b8f5", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02935", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02935_b4826e91253fe6570252ac9e9333745f7f06aa94a31244644ffd8e29e08965e1.jsonl.gz", "inputs": "reproduction/python/inputs/p02935.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02935_4fce74aca7d1608f14c76b9fb92532f43bd52c914832f66cdc3ddf21b1636b9b.jsonl.gz"}, "slow_code": "import numpy as np\n\nn = int(eval(input()))\nlista = list(map(int, input().split()))\nlista.sort()\nfor i in range(n - 1):\n lista.append((lista[0] + lista[1]) / 2)\n lista.pop(0)\n lista.pop(0)\n lista.sort()\nprint((lista[0]))\n", "slow_code_sha256": "4fce74aca7d1608f14c76b9fb92532f43bd52c914832f66cdc3ddf21b1636b9b", "slow_id": "p02935_4fce74aca7d1608f14c76b9fb92532f43bd52c914832f66cdc3ddf21b1636b9b", "speedup": 587.7742392362107, "stratum": "8+", "within_pair_jaccard": 0.3333333333333333, "workload": {"case_count": 100, "description": "Repeatedly replace two ingredient values x and y by their arithmetic mean (x+y)/2. Starting with N input values v_i, maximize the final value after N-1 replacements. Observed inputs: N=2..50 (median 25); v_i=1..1000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 253, "median": 102.5, "min": 6}, "input_format": ["N\nv_1 ... v_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 51, "median": 26.0, "min": 3}}} -{"case_ids": ["p02804_case_000", "p02804_case_001", "p02804_case_002", "p02804_case_003", "p02804_case_004", "p02804_case_005", "p02804_case_006", "p02804_case_007", "p02804_case_008", "p02804_case_009", "p02804_case_010", "p02804_case_011", "p02804_case_012", "p02804_case_013", "p02804_case_014", "p02804_case_015", "p02804_case_016", "p02804_case_017", "p02804_case_018", "p02804_case_019", "p02804_case_020", "p02804_case_021", "p02804_case_022", "p02804_case_023", "p02804_case_024", "p02804_case_025", "p02804_case_026", "p02804_case_027", "p02804_case_028", "p02804_case_029", "p02804_case_030", "p02804_case_031", "p02804_case_032", "p02804_case_033", "p02804_case_034", "p02804_case_035", "p02804_case_036", "p02804_case_037", "p02804_case_038", "p02804_case_039", "p02804_case_040", "p02804_case_041", "p02804_case_042", "p02804_case_043", "p02804_case_044", "p02804_case_045", "p02804_case_046", "p02804_case_047", "p02804_case_048", "p02804_case_049", "p02804_case_050", "p02804_case_051", "p02804_case_052", "p02804_case_053", "p02804_case_054", "p02804_case_055", "p02804_case_056", "p02804_case_057", "p02804_case_058", "p02804_case_059", "p02804_case_060", "p02804_case_061", "p02804_case_062", "p02804_case_063", "p02804_case_064", "p02804_case_065", "p02804_case_066", "p02804_case_067", "p02804_case_068", "p02804_case_069", "p02804_case_070", "p02804_case_071", "p02804_case_072", "p02804_case_073", "p02804_case_074", "p02804_case_075", "p02804_case_076", "p02804_case_077", "p02804_case_078", "p02804_case_079", "p02804_case_080", "p02804_case_081", "p02804_case_082", "p02804_case_083", "p02804_case_084", "p02804_case_085", "p02804_case_086", "p02804_case_087", "p02804_case_088", "p02804_case_089", "p02804_case_090", "p02804_case_091", "p02804_case_092", "p02804_case_093", "p02804_case_094", "p02804_case_095", "p02804_case_096", "p02804_case_097", "p02804_case_098", "p02804_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N, K = list(map(int, input().split()))\nA = list(map(int, input().split()))\nMOD = 10**9 + 7\ninv_t = [0, 1] + [0] * (N - 1)\nfor i in range(2, N + 1):\n inv_t[i] = inv_t[MOD % i] * (MOD - MOD // i) % MOD\nA.sort()\nans = 0\nC = 1\nfor i in range(K, N + 1):\n ans += (A[i - 1] - A[N - i]) * C\n ans %= MOD\n C = C * i * inv_t[i - K + 1]\n C %= MOD\nprint(ans)\n", "fast_code_sha256": "5ab51d5928ed77e3d5403215430fd9b470d350dbc6470a626b3ee86273e49a45", "fast_id": "p02804_5ab51d5928ed77e3d5403215430fd9b470d350dbc6470a626b3ee86273e49a45", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N, K = list(map(int, input().split()))\nA = list(map(int, input().split()))\nMOD = 10**9 + 7\ninv_t = [0, 1] + [0] * (N - 1)\nfor i in range(2, N + 1):\n inv_t[i] = inv_t[MOD % i] * (MOD - MOD // i) % MOD\nA.sort()\nans = 0\nC = 1\nfor i in range(K, N + 1):\n ans += (A[i - 1] - A[N - i]) * C\n ans %= MOD\n C = C * i * inv_t[i - K + 1]\n C %= MOD\nprint(ans)\n", "measured_fast_code_sha256": "5ab51d5928ed77e3d5403215430fd9b470d350dbc6470a626b3ee86273e49a45", "measured_slow_code": "N_MAX = 10**6\nMOD = 10**9 + 7\nfac, finv, inv = [0] * N_MAX, [0] * N_MAX, [0] * N_MAX\n\n\ndef com_init():\n fac[0], fac[1] = 1, 1\n finv[0], finv[1] = 1, 1\n inv[1] = 1\n for i in range(2, N_MAX):\n fac[i] = fac[i - 1] * i % MOD\n inv[i] = MOD - inv[MOD % i] * (MOD // i) % MOD\n finv[i] = finv[i - 1] * inv[i] % MOD\n\n\ndef com(n, k):\n if n < k:\n return 0\n if n < 0 or k < 0:\n return 0\n return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD\n\n\nn, k = list(map(int, input().split()))\nal = list(map(int, input().split()))\ncom_init()\nal.sort()\nans_max = 0\nans_min = 0\nfor i, a in enumerate(al):\n ans_max += a * com(i, k - 1)\n ans_max %= MOD\n ans_min += a * com(n - 1 - i, k - 1)\n ans_min %= MOD\nprint(((ans_max - ans_min) % MOD))\n", "measured_slow_code_sha256": "7a118ce2764a5719ed366c9c22ffc653766a914f4a46e16d4f0cdc6623af51e1", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4139.230634528081, "pair_id": "python_v2_5eadafafb9527b5bc2af65d7", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02804", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02804_5ab51d5928ed77e3d5403215430fd9b470d350dbc6470a626b3ee86273e49a45.jsonl.gz", "inputs": "reproduction/python/inputs/p02804.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02804_7a118ce2764a5719ed366c9c22ffc653766a914f4a46e16d4f0cdc6623af51e1.jsonl.gz"}, "slow_code": "N_MAX = 10**6\nMOD = 10**9 + 7\nfac, finv, inv = [0] * N_MAX, [0] * N_MAX, [0] * N_MAX\n\n\ndef com_init():\n fac[0], fac[1] = 1, 1\n finv[0], finv[1] = 1, 1\n inv[1] = 1\n for i in range(2, N_MAX):\n fac[i] = fac[i - 1] * i % MOD\n inv[i] = MOD - inv[MOD % i] * (MOD // i) % MOD\n finv[i] = finv[i - 1] * inv[i] % MOD\n\n\ndef com(n, k):\n if n < k:\n return 0\n if n < 0 or k < 0:\n return 0\n return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD\n\n\nn, k = list(map(int, input().split()))\nal = list(map(int, input().split()))\ncom_init()\nal.sort()\nans_max = 0\nans_min = 0\nfor i, a in enumerate(al):\n ans_max += a * com(i, k - 1)\n ans_max %= MOD\n ans_min += a * com(n - 1 - i, k - 1)\n ans_min %= MOD\nprint(((ans_max - ans_min) % MOD))\n", "slow_code_sha256": "7a118ce2764a5719ed366c9c22ffc653766a914f4a46e16d4f0cdc6623af51e1", "slow_id": "p02804_7a118ce2764a5719ed366c9c22ffc653766a914f4a46e16d4f0cdc6623af51e1", "speedup": 540.0319374222177, "stratum": "8+", "within_pair_jaccard": 0.42857142857142855, "workload": {"case_count": 100, "description": "For every choice of K distinct indices among N array positions, take the largest selected value minus the smallest. Sum these differences modulo 1000000007. Equal values at different indices are distinct choices. Observed inputs: N=1..100000 (median 100); K=1..100000 (median 5); A_i=-1000000000..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1200009, "median": 1046.0, "min": 10}, "input_format": ["N K\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100002, "median": 102.0, "min": 3}}} -{"case_ids": ["p03037_case_000", "p03037_case_001", "p03037_case_002", "p03037_case_003", "p03037_case_004", "p03037_case_005", "p03037_case_006", "p03037_case_007", "p03037_case_008", "p03037_case_009", "p03037_case_010", "p03037_case_011", "p03037_case_012", "p03037_case_013", "p03037_case_014", "p03037_case_015", "p03037_case_016", "p03037_case_017", "p03037_case_018", "p03037_case_019", "p03037_case_020", "p03037_case_021", "p03037_case_022", "p03037_case_023", "p03037_case_024", "p03037_case_025", "p03037_case_026", "p03037_case_027", "p03037_case_028", "p03037_case_029", "p03037_case_030", "p03037_case_031", "p03037_case_032", "p03037_case_033", "p03037_case_034", "p03037_case_035", "p03037_case_036", "p03037_case_037", "p03037_case_038", "p03037_case_039", "p03037_case_040", "p03037_case_041", "p03037_case_042", "p03037_case_043", "p03037_case_044", "p03037_case_045", "p03037_case_046", "p03037_case_047", "p03037_case_048", "p03037_case_049", "p03037_case_050", "p03037_case_051", "p03037_case_052", "p03037_case_053", "p03037_case_054", "p03037_case_055", "p03037_case_056", "p03037_case_057", "p03037_case_058", "p03037_case_059", "p03037_case_060", "p03037_case_061", "p03037_case_062", "p03037_case_063", "p03037_case_064", "p03037_case_065", "p03037_case_066", "p03037_case_067", "p03037_case_068", "p03037_case_069", "p03037_case_070", "p03037_case_071", "p03037_case_072", "p03037_case_073", "p03037_case_074", "p03037_case_075", "p03037_case_076", "p03037_case_077", "p03037_case_078", "p03037_case_079", "p03037_case_080", "p03037_case_081", "p03037_case_082", "p03037_case_083", "p03037_case_084", "p03037_case_085", "p03037_case_086", "p03037_case_087", "p03037_case_088", "p03037_case_089", "p03037_case_090", "p03037_case_091", "p03037_case_092", "p03037_case_093", "p03037_case_094", "p03037_case_095", "p03037_case_096", "p03037_case_097", "p03037_case_098", "p03037_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "executable_AST_equal_except_explicit_explanatory_string_removal_and_all_frozen_inputs_checker_pass", "fast_code": "def main():\n n, m = list(map(int, input().split()))\n A = []\n B = []\n for _ in range(m):\n a, b = list(map(int, input().split()))\n A.append(a)\n B.append(b)\n l = max(A)\n r = min(B)\n\n if r >= l:\n return r - l + 1\n else:\n return 0\n\n\nif __name__ == \"__main__\":\n print((main()))\n", "fast_code_sha256": "4121c6a6e3d9aba7df2cb8b2180b806860b4871d736da8750ea301f8d43d7f73", "fast_id": "p03037_e6c0844e7694c12bec45ebbcb9f5c1f747d59875496e8d893324191cb02a6333", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def main():\n n, m = list(map(int, input().split()))\n A = []\n B = []\n for _ in range(m):\n a, b = list(map(int, input().split()))\n A.append(a)\n B.append(b)\n l = max(A)\n r = min(B)\n # print(l, r)\n if r >= l:\n return r - l + 1\n else:\n return 0\n\n\nif __name__ == \"__main__\":\n print((main()))\n\"\"\"\nfor i in range(1, n + 1):\n for j in range(m):\n if gate[j][0] <= i and i <= gate[j][1]:\n if j == len(gate) - 1:\n result += 1\n continue\n else:\n break\n\"\"\"\n", "measured_fast_code_sha256": "e6c0844e7694c12bec45ebbcb9f5c1f747d59875496e8d893324191cb02a6333", "measured_slow_code": "import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, queue, copy\n\nsys.setrecursionlimit(10**7)\ninf = 10**20\nmod = 10**9 + 7\ndd = [(-1, 0), (0, 1), (1, 0), (0, -1)]\nddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef LI_():\n return [int(x) - 1 for x in sys.stdin.readline().split()]\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LS():\n return sys.stdin.readline().split()\n\n\ndef S():\n return eval(input())\n\n\ndef main():\n n, k = LI()\n l = [0] * (n + 1)\n for _ in range(k):\n a, b = LI()\n l[a - 1] += 1\n l[b] -= 1\n for i in range(n - 1):\n l[i + 1] += l[i]\n ans = 0\n for x in l[:-1]:\n if x == k:\n ans += 1\n return ans\n\n\nprint((main()))\n", "measured_slow_code_sha256": "603682b2a1acebd824f0081d6dbfdc82575d41c2aa8f541e6ca8387c5cde8833", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.2385090825715777, "pair_id": "python_v2_2eebf92ddf9b85c670a86297", "per_case_slow_code_faster_fraction": 0.43, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03037", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03037_e6c0844e7694c12bec45ebbcb9f5c1f747d59875496e8d893324191cb02a6333.jsonl.gz", "inputs": "reproduction/python/inputs/p03037.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03037_603682b2a1acebd824f0081d6dbfdc82575d41c2aa8f541e6ca8387c5cde8833.jsonl.gz"}, "slow_code": "import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, queue, copy\n\nsys.setrecursionlimit(10**7)\ninf = 10**20\nmod = 10**9 + 7\ndd = [(-1, 0), (0, 1), (1, 0), (0, -1)]\nddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef LI_():\n return [int(x) - 1 for x in sys.stdin.readline().split()]\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LS():\n return sys.stdin.readline().split()\n\n\ndef S():\n return eval(input())\n\n\ndef main():\n n, k = LI()\n l = [0] * (n + 1)\n for _ in range(k):\n a, b = LI()\n l[a - 1] += 1\n l[b] -= 1\n for i in range(n - 1):\n l[i + 1] += l[i]\n ans = 0\n for x in l[:-1]:\n if x == k:\n ans += 1\n return ans\n\n\nprint((main()))\n", "slow_code_sha256": "603682b2a1acebd824f0081d6dbfdc82575d41c2aa8f541e6ca8387c5cde8833", "slow_id": "p03037_603682b2a1acebd824f0081d6dbfdc82575d41c2aa8f541e6ca8387c5cde8833", "speedup": 5.071980091478483, "stratum": "4-8", "within_pair_jaccard": 0.2602739726027397, "workload": {"case_count": 100, "description": "There are N numbered access cards and M gates. Gate i accepts card IDs in inclusive interval [L_i,R_i]. Count individual cards that each permit passage through every gate. Observed inputs: N=1..100000 (median 99999); M=1..100000 (median 1000); L_i=1..100000; R_i=1..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1200014, "median": 7912.0, "min": 8}, "input_format": ["N M\nL_1 R_1\n...\nL_M R_M"], "input_format_status": "source_input_section", "input_lines": {"max": 100001, "median": 1001.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200002, "median": 2002.0, "min": 4}}} -{"case_ids": ["p03837_case_000", "p03837_case_001", "p03837_case_002", "p03837_case_003", "p03837_case_004", "p03837_case_005", "p03837_case_006", "p03837_case_007", "p03837_case_008", "p03837_case_009", "p03837_case_010", "p03837_case_011", "p03837_case_012", "p03837_case_013", "p03837_case_014", "p03837_case_015", "p03837_case_016", "p03837_case_017", "p03837_case_018", "p03837_case_019", "p03837_case_020", "p03837_case_021", "p03837_case_022", "p03837_case_023", "p03837_case_024", "p03837_case_025", "p03837_case_026", "p03837_case_027", "p03837_case_028", "p03837_case_029", "p03837_case_030", "p03837_case_031", "p03837_case_032", "p03837_case_033", "p03837_case_034", "p03837_case_035", "p03837_case_036", "p03837_case_037", "p03837_case_038", "p03837_case_039", "p03837_case_040", "p03837_case_041", "p03837_case_042", "p03837_case_043", "p03837_case_044", "p03837_case_045", "p03837_case_046", "p03837_case_047", "p03837_case_048", "p03837_case_049", "p03837_case_050", "p03837_case_051", "p03837_case_052", "p03837_case_053", "p03837_case_054", "p03837_case_055", "p03837_case_056", "p03837_case_057", "p03837_case_058", "p03837_case_059", "p03837_case_060", "p03837_case_061", "p03837_case_062", "p03837_case_063", "p03837_case_064", "p03837_case_065", "p03837_case_066", "p03837_case_067", "p03837_case_068", "p03837_case_069", "p03837_case_070", "p03837_case_071", "p03837_case_072", "p03837_case_073", "p03837_case_074", "p03837_case_075", "p03837_case_076", "p03837_case_077", "p03837_case_078", "p03837_case_079", "p03837_case_080", "p03837_case_081", "p03837_case_082", "p03837_case_083", "p03837_case_084", "p03837_case_085", "p03837_case_086", "p03837_case_087", "p03837_case_088", "p03837_case_089", "p03837_case_090", "p03837_case_091", "p03837_case_092", "p03837_case_093", "p03837_case_094", "p03837_case_095", "p03837_case_096", "p03837_case_097", "p03837_case_098", "p03837_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import heapq\n\nN, M = list(map(int, input().split()))\nes = [[] for _ in range(N)]\nfor i in range(M):\n a, b, c = list(map(int, input().split()))\n es[a - 1].append((c, b - 1))\n es[b - 1].append((c, a - 1))\nINF = float(\"inf\")\n\nd = [[INF for _ in range(N)] for _ in range(N)]\nfor i in range(N):\n q = []\n d[i][i] = 0\n heapq.heappush(q, (0, i))\n while q:\n cost, a = heapq.heappop(q)\n if d[i][a] < cost:\n continue\n for c, b in es[a]:\n if d[i][a] + c < d[i][b]:\n d[i][b] = d[i][a] + c\n heapq.heappush(q, (d[i][b], b))\n\n\ncnt = 0\nfor i in range(N):\n for c, b in es[i]:\n if d[i][b] != c:\n cnt += 1\n\nprint((cnt // 2))\n", "fast_code_sha256": "d0049f943120d7271ad75201bb4f4041f116278d93954adfad2543cf4bc98d1f", "fast_id": "p03837_80ecd7a533e7aade9fd037ac5793cdc66dad62fccbad95fa17c7543f12205caa", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import heapq\n\nN, M = list(map(int, input().split()))\nes = [[] for _ in range(N)]\nfor i in range(M):\n a, b, c = list(map(int, input().split()))\n es[a - 1].append((c, b - 1))\n es[b - 1].append((c, a - 1))\nINF = float(\"inf\")\n# 全ノード間の最短距離を求める\nd = [[INF for _ in range(N)] for _ in range(N)]\nfor i in range(N):\n q = []\n d[i][i] = 0\n heapq.heappush(q, (0, i))\n while q:\n cost, a = heapq.heappop(q)\n if d[i][a] < cost:\n continue\n for c, b in es[a]:\n if d[i][a] + c < d[i][b]:\n d[i][b] = d[i][a] + c\n heapq.heappush(q, (d[i][b], b))\n# 全ての辺について、その辺の間の距離cがa->bまでの最短距離か確かめる\n# ある辺がいずれかのノード間の最短経路に含まれるなら、その辺(が結ぶノード)も最短距離になるから。\ncnt = 0\nfor i in range(N):\n for c, b in es[i]:\n if d[i][b] != c:\n cnt += 1\n# 無向グラフなので2方向分カウントされてるから2で割る\nprint((cnt // 2))\n", "measured_fast_code_sha256": "80ecd7a533e7aade9fd037ac5793cdc66dad62fccbad95fa17c7543f12205caa", "measured_slow_code": "N, M = list(map(int, input().split()))\na, b, c = 0, 0, 0\nE = []\nINF = 10**12\nD = [[INF] * N for i in range(N)]\nfor i in range(N):\n D[i][i] = 0\nfor i in range(M):\n a, b, c = list(map(int, input().split()))\n a, b = a - 1, b - 1\n D[a][b] = c\n D[b][a] = c\n E.append((a, b, c))\nfor k in range(N):\n for i in range(N):\n for j in range(N):\n D[i][j] = min(D[i][j], D[i][k] + D[k][j])\nP = 0\nfor i in range(M):\n if D[E[i][0]][E[i][1]] != E[i][2]:\n P += 1\nprint(P)\n", "measured_slow_code_sha256": "aef3a7d1505fcc4a9d9681d96c3dc6e6c95bb553e669bdf3f2274e3ffda2198b", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 5.749884809636896, "pair_id": "python_v2_0188af28be194e47c9ce30b9", "per_case_slow_code_faster_fraction": 0.17, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03837", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03837_80ecd7a533e7aade9fd037ac5793cdc66dad62fccbad95fa17c7543f12205caa.jsonl.gz", "inputs": "reproduction/python/inputs/p03837.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03837_aef3a7d1505fcc4a9d9681d96c3dc6e6c95bb553e669bdf3f2274e3ffda2198b.jsonl.gz"}, "slow_code": "N, M = list(map(int, input().split()))\na, b, c = 0, 0, 0\nE = []\nINF = 10**12\nD = [[INF] * N for i in range(N)]\nfor i in range(N):\n D[i][i] = 0\nfor i in range(M):\n a, b, c = list(map(int, input().split()))\n a, b = a - 1, b - 1\n D[a][b] = c\n D[b][a] = c\n E.append((a, b, c))\nfor k in range(N):\n for i in range(N):\n for j in range(N):\n D[i][j] = min(D[i][j], D[i][k] + D[k][j])\nP = 0\nfor i in range(M):\n if D[E[i][0]][E[i][1]] != E[i][2]:\n P += 1\nprint(P)\n", "slow_code_sha256": "aef3a7d1505fcc4a9d9681d96c3dc6e6c95bb553e669bdf3f2274e3ffda2198b", "slow_id": "p03837_aef3a7d1505fcc4a9d9681d96c3dc6e6c95bb553e669bdf3f2274e3ffda2198b", "speedup": 4.098376470125324, "stratum": "4-8", "within_pair_jaccard": 0.46511627906976744, "workload": {"case_count": 100, "description": "In a connected simple undirected weighted graph with positive weights c_i, count edges that occur in no shortest path between any pair of distinct vertices. Endpoints are 1-based and may be listed in either order. Observed inputs: N=2..100 (median 30); M=1..1000 (median 55); c_i=1..1000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 10569, "median": 461.0, "min": 10}, "input_format": ["N M\na_1 b_1 c_1\n...\na_M b_M c_M"], "input_format_status": "source_input_section", "input_lines": {"max": 1001, "median": 56.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3002, "median": 167.0, "min": 5}}} -{"case_ids": ["p03774_case_000", "p03774_case_001", "p03774_case_002", "p03774_case_003", "p03774_case_004", "p03774_case_005", "p03774_case_006", "p03774_case_007", "p03774_case_008", "p03774_case_009", "p03774_case_010", "p03774_case_011", "p03774_case_012", "p03774_case_013", "p03774_case_014", "p03774_case_015", "p03774_case_016", "p03774_case_017", "p03774_case_018", "p03774_case_019", "p03774_case_020", "p03774_case_021", "p03774_case_022", "p03774_case_023", "p03774_case_024", "p03774_case_025", "p03774_case_026", "p03774_case_027", "p03774_case_028", "p03774_case_029", "p03774_case_030", "p03774_case_031", "p03774_case_032", "p03774_case_033", "p03774_case_034", "p03774_case_035", "p03774_case_036", "p03774_case_037", "p03774_case_038", "p03774_case_039", "p03774_case_040", "p03774_case_041", "p03774_case_042", "p03774_case_043", "p03774_case_044", "p03774_case_045", "p03774_case_046", "p03774_case_047", "p03774_case_048", "p03774_case_049", "p03774_case_050", "p03774_case_051", "p03774_case_052", "p03774_case_053", "p03774_case_054", "p03774_case_055", "p03774_case_056", "p03774_case_057", "p03774_case_058", "p03774_case_059", "p03774_case_060", "p03774_case_061", "p03774_case_062", "p03774_case_063", "p03774_case_064", "p03774_case_065", "p03774_case_066", "p03774_case_067", "p03774_case_068", "p03774_case_069", "p03774_case_070", "p03774_case_071", "p03774_case_072", "p03774_case_073", "p03774_case_074", "p03774_case_075", "p03774_case_076", "p03774_case_077", "p03774_case_078", "p03774_case_079", "p03774_case_080", "p03774_case_081", "p03774_case_082", "p03774_case_083", "p03774_case_084", "p03774_case_085", "p03774_case_086", "p03774_case_087", "p03774_case_088", "p03774_case_089", "p03774_case_090", "p03774_case_091", "p03774_case_092", "p03774_case_093", "p03774_case_094", "p03774_case_095", "p03774_case_096", "p03774_case_097", "p03774_case_098", "p03774_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n, m = list(map(int, input().split()))\na = [[int(j) for j in input().split()] for i in range(n)]\nc = [[int(j) for j in input().split()] for i in range(m)]\nfor i in range(n):\n d = 10e8\n b = 0\n for j in range(m):\n if abs(a[i][0] - c[j][0]) + abs(a[i][1] - c[j][1]) < d:\n d = abs(a[i][0] - c[j][0]) + abs(a[i][1] - c[j][1])\n b = j + 1\n print(b)\n", "fast_code_sha256": "01a2b7b4dd2e51daaa5349fba4b4ff5f7a7392280b64a40b153e1bd226e5b503", "fast_id": "p03774_01a2b7b4dd2e51daaa5349fba4b4ff5f7a7392280b64a40b153e1bd226e5b503", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n, m = list(map(int, input().split()))\na = [[int(j) for j in input().split()] for i in range(n)]\nc = [[int(j) for j in input().split()] for i in range(m)]\nfor i in range(n):\n d = 10e8\n b = 0\n for j in range(m):\n if abs(a[i][0] - c[j][0]) + abs(a[i][1] - c[j][1]) < d:\n d = abs(a[i][0] - c[j][0]) + abs(a[i][1] - c[j][1])\n b = j + 1\n print(b)\n", "measured_fast_code_sha256": "01a2b7b4dd2e51daaa5349fba4b4ff5f7a7392280b64a40b153e1bd226e5b503", "measured_slow_code": "import numpy as np, sys\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\nN, M = LI()\nab = np.array([LI() for _ in range(N)], dtype=int)\ncd = np.array([LI() for _ in range(M)], dtype=int)\nfor x in ab:\n vector = np.sum(np.abs(cd - x), axis=1).tolist()\n print((vector.index(min(vector)) + 1))\n", "measured_slow_code_sha256": "0efc73096e5c454dd629a78888b6096a291ff26f7924fd5a40dea1274e463422", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 211.7408438322059, "pair_id": "python_v2_0dfd9c0be4c0a212734a9717", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03774", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03774_01a2b7b4dd2e51daaa5349fba4b4ff5f7a7392280b64a40b153e1bd226e5b503.jsonl.gz", "inputs": "reproduction/python/inputs/p03774.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03774_0efc73096e5c454dd629a78888b6096a291ff26f7924fd5a40dea1274e463422.jsonl.gz"}, "slow_code": "import numpy as np, sys\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\nN, M = LI()\nab = np.array([LI() for _ in range(N)], dtype=int)\ncd = np.array([LI() for _ in range(M)], dtype=int)\nfor x in ab:\n vector = np.sum(np.abs(cd - x), axis=1).tolist()\n print((vector.index(min(vector)) + 1))\n", "slow_code_sha256": "0efc73096e5c454dd629a78888b6096a291ff26f7924fd5a40dea1274e463422", "slow_id": "p03774_0efc73096e5c454dd629a78888b6096a291ff26f7924fd5a40dea1274e463422", "speedup": 148.2178930659851, "stratum": "8+", "within_pair_jaccard": 0.2127659574468085, "workload": {"case_count": 100, "description": "For each student (a_i,b_i), output the 1-based index of the nearest checkpoint (c_j,d_j) by Manhattan distance. Break ties by the smallest checkpoint index; repeated coordinates are allowed. Observed inputs: N=1..50 (median 16); M=1..50 (median 10); a_i=-100000000..100000000; b_i=-100000000..100000000; c_j=-100000000..100000000; d_j=-100000000..100000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 2106, "median": 458.5, "min": 12}, "input_format": ["N M\na_1 b_1\n...\na_N b_N\nc_1 d_1\n...\nc_M d_M"], "input_format_status": "source_input_section", "input_lines": {"max": 101, "median": 33.5, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 202, "median": 67.0, "min": 6}}} -{"case_ids": ["p02922_case_000", "p02922_case_001", "p02922_case_002", "p02922_case_003", "p02922_case_004", "p02922_case_005", "p02922_case_006", "p02922_case_007", "p02922_case_008", "p02922_case_009", "p02922_case_010", "p02922_case_011", "p02922_case_012", "p02922_case_013", "p02922_case_014", "p02922_case_015", "p02922_case_016", "p02922_case_017", "p02922_case_018", "p02922_case_019", "p02922_case_020", "p02922_case_021", "p02922_case_022", "p02922_case_023", "p02922_case_024", "p02922_case_025", "p02922_case_026", "p02922_case_027", "p02922_case_028", "p02922_case_029", "p02922_case_030", "p02922_case_031", "p02922_case_032", "p02922_case_033", "p02922_case_034", "p02922_case_035", "p02922_case_036", "p02922_case_037", "p02922_case_038", "p02922_case_039", "p02922_case_040", "p02922_case_041", "p02922_case_042", "p02922_case_043", "p02922_case_044", "p02922_case_045", "p02922_case_046", "p02922_case_047", "p02922_case_048", "p02922_case_049", "p02922_case_050", "p02922_case_051", "p02922_case_052", "p02922_case_053", "p02922_case_054", "p02922_case_055", "p02922_case_056", "p02922_case_057", "p02922_case_058", "p02922_case_059", "p02922_case_060", "p02922_case_061", "p02922_case_062", "p02922_case_063", "p02922_case_064", "p02922_case_065", "p02922_case_066", "p02922_case_067", "p02922_case_068", "p02922_case_069", "p02922_case_070", "p02922_case_071", "p02922_case_072", "p02922_case_073", "p02922_case_074", "p02922_case_075", "p02922_case_076", "p02922_case_077", "p02922_case_078", "p02922_case_079", "p02922_case_080", "p02922_case_081", "p02922_case_082", "p02922_case_083", "p02922_case_084", "p02922_case_085", "p02922_case_086", "p02922_case_087", "p02922_case_088", "p02922_case_089", "p02922_case_090", "p02922_case_091", "p02922_case_092", "p02922_case_093", "p02922_case_094", "p02922_case_095", "p02922_case_096", "p02922_case_097", "p02922_case_098", "p02922_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import math\n\na, b = list(map(int, input().split()))\nprint((math.ceil((b - 1) / (a - 1))))\n", "fast_code_sha256": "fcdc55e3c364d8dcff410f85b0164f59ff398cb55eee7e78666ef1081be9b112", "fast_id": "p02922_fcdc55e3c364d8dcff410f85b0164f59ff398cb55eee7e78666ef1081be9b112", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import math\n\na, b = list(map(int, input().split()))\nprint((math.ceil((b - 1) / (a - 1))))\n", "measured_fast_code_sha256": "fcdc55e3c364d8dcff410f85b0164f59ff398cb55eee7e78666ef1081be9b112", "measured_slow_code": "import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, queue, copy\n\nsys.setrecursionlimit(10**7)\ninf = 10**20\nmod = 10**9 + 7\ndd = [(-1, 0), (0, 1), (1, 0), (0, -1)]\nddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef LI_():\n return [int(x) - 1 for x in sys.stdin.readline().split()]\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LS():\n return sys.stdin.readline().split()\n\n\ndef S():\n return eval(input())\n\n\ndef main():\n a, b = LI()\n c = 1\n ans = 0\n while True:\n if c >= b:\n return ans\n ans += 1\n c -= 1\n c += a\n\n\n# main()\nprint((main()))\n", "measured_slow_code_sha256": "8b569fc1e16981f8320c705cea748e4c69f345af35a77c5db73eb42d1431aac6", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 79.44241629428885, "pair_id": "python_v2_98cd48d1d16d48deaac6c430", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02922", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02922_fcdc55e3c364d8dcff410f85b0164f59ff398cb55eee7e78666ef1081be9b112.jsonl.gz", "inputs": "reproduction/python/inputs/p02922.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02922_8b569fc1e16981f8320c705cea748e4c69f345af35a77c5db73eb42d1431aac6.jsonl.gz"}, "slow_code": "import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, queue, copy\n\nsys.setrecursionlimit(10**7)\ninf = 10**20\nmod = 10**9 + 7\ndd = [(-1, 0), (0, 1), (1, 0), (0, -1)]\nddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef LI_():\n return [int(x) - 1 for x in sys.stdin.readline().split()]\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LS():\n return sys.stdin.readline().split()\n\n\ndef S():\n return eval(input())\n\n\ndef main():\n a, b = LI()\n c = 1\n ans = 0\n while True:\n if c >= b:\n return ans\n ans += 1\n c -= 1\n c += a\n\n\nprint((main()))\n", "slow_code_sha256": "d125558241ae3c64a726d724586fb5061b0b0d9b36349b79174daa959a5a79c4", "slow_id": "p02922_8b569fc1e16981f8320c705cea748e4c69f345af35a77c5db73eb42d1431aac6", "speedup": 79.42113019628722, "stratum": "8+", "within_pair_jaccard": 0.16666666666666666, "workload": {"case_count": 100, "description": "Start with one empty electrical socket. Installing a strip consumes one socket and provides A empty sockets. Find the fewest strips needed to have at least B empty sockets. Observed inputs: A=2..20 (median 8); B=1..20 (median 7).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 6, "median": 4.5, "min": 4}, "input_format": ["A B"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p02831_case_000", "p02831_case_001", "p02831_case_002", "p02831_case_003", "p02831_case_004", "p02831_case_005", "p02831_case_006", "p02831_case_007", "p02831_case_008", "p02831_case_009", "p02831_case_010", "p02831_case_011", "p02831_case_012", "p02831_case_013", "p02831_case_014", "p02831_case_015", "p02831_case_016", "p02831_case_017", "p02831_case_018", "p02831_case_019", "p02831_case_020", "p02831_case_021", "p02831_case_022", "p02831_case_023", "p02831_case_024", "p02831_case_025", "p02831_case_026", "p02831_case_027", "p02831_case_028", "p02831_case_029", "p02831_case_030", "p02831_case_031", "p02831_case_032", "p02831_case_033", "p02831_case_034", "p02831_case_035", "p02831_case_036", "p02831_case_037", "p02831_case_038", "p02831_case_039", "p02831_case_040", "p02831_case_041", "p02831_case_042", "p02831_case_043", "p02831_case_044", "p02831_case_045", "p02831_case_046", "p02831_case_047", "p02831_case_048", "p02831_case_049", "p02831_case_050", "p02831_case_051", "p02831_case_052", "p02831_case_053", "p02831_case_054", "p02831_case_055", "p02831_case_056", "p02831_case_057", "p02831_case_058", "p02831_case_059", "p02831_case_060", "p02831_case_061", "p02831_case_062", "p02831_case_063", "p02831_case_064", "p02831_case_065", "p02831_case_066", "p02831_case_067", "p02831_case_068", "p02831_case_069", "p02831_case_070", "p02831_case_071", "p02831_case_072", "p02831_case_073", "p02831_case_074", "p02831_case_075", "p02831_case_076", "p02831_case_077", "p02831_case_078", "p02831_case_079", "p02831_case_080", "p02831_case_081", "p02831_case_082", "p02831_case_083", "p02831_case_084", "p02831_case_085", "p02831_case_086", "p02831_case_087", "p02831_case_088", "p02831_case_089", "p02831_case_090", "p02831_case_091", "p02831_case_092", "p02831_case_093", "p02831_case_094", "p02831_case_095", "p02831_case_096", "p02831_case_097", "p02831_case_098", "p02831_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import math\n\n\ndef lcm(x, y):\n return (x * y) // math.gcd(x, y)\n\n\na, b = list(map(int, input().split()))\nprint((lcm(a, b)))\n", "fast_code_sha256": "1dc21d281e68efeab490e81c2e10af8dd9590cc1b2e00a406cdbf031e728d09a", "fast_id": "p02831_1dc21d281e68efeab490e81c2e10af8dd9590cc1b2e00a406cdbf031e728d09a", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import math\n\n\ndef lcm(x, y):\n return (x * y) // math.gcd(x, y)\n\n\na, b = list(map(int, input().split()))\nprint((lcm(a, b)))\n", "measured_fast_code_sha256": "1dc21d281e68efeab490e81c2e10af8dd9590cc1b2e00a406cdbf031e728d09a", "measured_slow_code": "a, b = list(map(int, input().split()))\ngcd = 0\nfor i in range(max(a, b), 0, -1):\n if a % i == 0 and b % i == 0:\n gcd = i\n break\nprint((a * b // gcd))\n", "measured_slow_code_sha256": "3de3fe8bb1afacef9e4d94cddd67b61d71115eb2182c7ba15fc5dcbd918bfe9c", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 230.57811109023174, "pair_id": "python_v2_5d122b50c023b1bbfcb328cd", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02831", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02831_1dc21d281e68efeab490e81c2e10af8dd9590cc1b2e00a406cdbf031e728d09a.jsonl.gz", "inputs": "reproduction/python/inputs/p02831.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02831_3de3fe8bb1afacef9e4d94cddd67b61d71115eb2182c7ba15fc5dcbd918bfe9c.jsonl.gz"}, "slow_code": "a, b = list(map(int, input().split()))\ngcd = 0\nfor i in range(max(a, b), 0, -1):\n if a % i == 0 and b % i == 0:\n gcd = i\n break\nprint((a * b // gcd))\n", "slow_code_sha256": "3de3fe8bb1afacef9e4d94cddd67b61d71115eb2182c7ba15fc5dcbd918bfe9c", "slow_id": "p02831_3de3fe8bb1afacef9e4d94cddd67b61d71115eb2182c7ba15fc5dcbd918bfe9c", "speedup": 93.09236641269594, "stratum": "8+", "within_pair_jaccard": 0.3076923076923077, "workload": {"case_count": 100, "description": "Find the minimum positive number of indivisible snack pieces that can be distributed equally either to A guests or to B guests, with each guest receiving at least one piece. A and B differ. Observed inputs: A=1..100000 (median 59009.5); B=1..99999 (median 42628).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 13, "median": 12.0, "min": 4}, "input_format": ["A B"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p02603_case_000", "p02603_case_001", "p02603_case_002", "p02603_case_003", "p02603_case_004", "p02603_case_005", "p02603_case_006", "p02603_case_007", "p02603_case_008", "p02603_case_009", "p02603_case_010", "p02603_case_011", "p02603_case_012", "p02603_case_013", "p02603_case_014", "p02603_case_015", "p02603_case_016", "p02603_case_017", "p02603_case_018", "p02603_case_019", "p02603_case_020", "p02603_case_021", "p02603_case_022", "p02603_case_023", "p02603_case_024", "p02603_case_025", "p02603_case_026", "p02603_case_027", "p02603_case_028", "p02603_case_029", "p02603_case_030", "p02603_case_031", "p02603_case_032", "p02603_case_033", "p02603_case_034", "p02603_case_035", "p02603_case_036", "p02603_case_037", "p02603_case_038", "p02603_case_039", "p02603_case_040", "p02603_case_041", "p02603_case_042", "p02603_case_043", "p02603_case_044", "p02603_case_045", "p02603_case_046", "p02603_case_047", "p02603_case_048", "p02603_case_049", "p02603_case_050", "p02603_case_051", "p02603_case_052", "p02603_case_053", "p02603_case_054", "p02603_case_055", "p02603_case_056", "p02603_case_057", "p02603_case_058", "p02603_case_059", "p02603_case_060", "p02603_case_061", "p02603_case_062", "p02603_case_063", "p02603_case_064", "p02603_case_065", "p02603_case_066", "p02603_case_067", "p02603_case_068", "p02603_case_069", "p02603_case_070", "p02603_case_071", "p02603_case_072", "p02603_case_073", "p02603_case_074", "p02603_case_075", "p02603_case_076", "p02603_case_077", "p02603_case_078", "p02603_case_079", "p02603_case_080", "p02603_case_081", "p02603_case_082", "p02603_case_083", "p02603_case_084", "p02603_case_085", "p02603_case_086", "p02603_case_087", "p02603_case_088", "p02603_case_089", "p02603_case_090", "p02603_case_091", "p02603_case_092", "p02603_case_093", "p02603_case_094", "p02603_case_095", "p02603_case_096", "p02603_case_097", "p02603_case_098", "p02603_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n, *l = list(map(int, open(0).read().split()))\na = 1000\nfor i in range(n - 1):\n s, t = l[i : i + 2]\n a += a // s * max(t - s, 0)\nprint(a)\n", "fast_code_sha256": "454b234657cea2322f4260ff571ec862355d35b89f0fd41bc0ecf8d84ff3c105", "fast_id": "p02603_454b234657cea2322f4260ff571ec862355d35b89f0fd41bc0ecf8d84ff3c105", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n, *l = list(map(int, open(0).read().split()))\na = 1000\nfor i in range(n - 1):\n s, t = l[i : i + 2]\n a += a // s * max(t - s, 0)\nprint(a)\n", "measured_fast_code_sha256": "454b234657cea2322f4260ff571ec862355d35b89f0fd41bc0ecf8d84ff3c105", "measured_slow_code": "N = int(eval(input()))\nA = [0] + list(map(int, input().split()))\ndp = [0] * (N + 1)\ndp[1] = 1000\nfor i in range(2, N + 1):\n dp[i] = dp[i - 1]\n for j in range(1, i):\n stock = dp[j] // A[j]\n momey = dp[j] + (A[i] - A[j]) * stock\n dp[i] = max(dp[i], momey)\nprint((dp[N]))\n", "measured_slow_code_sha256": "25faafb2b0ca16cedbeb669295357df971e7c7a40120b3549a7cc9eefa9e9f0e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.1615503655446737, "pair_id": "python_v2_b749d9e6ae69f45a730b9268", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02603", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02603_454b234657cea2322f4260ff571ec862355d35b89f0fd41bc0ecf8d84ff3c105.jsonl.gz", "inputs": "reproduction/python/inputs/p02603.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02603_25faafb2b0ca16cedbeb669295357df971e7c7a40120b3549a7cc9eefa9e9f0e.jsonl.gz"}, "slow_code": "N = int(eval(input()))\nA = [0] + list(map(int, input().split()))\ndp = [0] * (N + 1)\ndp[1] = 1000\nfor i in range(2, N + 1):\n dp[i] = dp[i - 1]\n for j in range(1, i):\n stock = dp[j] // A[j]\n momey = dp[j] + (A[i] - A[j]) * stock\n dp[i] = max(dp[i], momey)\nprint((dp[N]))\n", "slow_code_sha256": "25faafb2b0ca16cedbeb669295357df971e7c7a40120b3549a7cc9eefa9e9f0e", "slow_id": "p02603_25faafb2b0ca16cedbeb669295357df971e7c7a40120b3549a7cc9eefa9e9f0e", "speedup": 4.3028249873389575, "stratum": "4-8", "within_pair_jaccard": 0.4482758620689655, "workload": {"case_count": 100, "description": "Given N daily prices a_i for one stock, maximize final cash starting with 1000 and no shares. Buy or sell whole shares any number of times daily, without borrowing cash or shares. Observed inputs: N=2..80 (median 10); a_i=100..200.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 323, "median": 43.0, "min": 10}, "input_format": ["N\na_1 ... a_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 81, "median": 11.0, "min": 3}}} -{"case_ids": ["p02725_case_000", "p02725_case_001", "p02725_case_002", "p02725_case_003", "p02725_case_004", "p02725_case_005", "p02725_case_006", "p02725_case_007", "p02725_case_008", "p02725_case_009", "p02725_case_010", "p02725_case_011", "p02725_case_012", "p02725_case_013", "p02725_case_014", "p02725_case_015", "p02725_case_016", "p02725_case_017", "p02725_case_018", "p02725_case_019", "p02725_case_020", "p02725_case_021", "p02725_case_022", "p02725_case_023", "p02725_case_024", "p02725_case_025", "p02725_case_026", "p02725_case_027", "p02725_case_028", "p02725_case_029", "p02725_case_030", "p02725_case_031", "p02725_case_032", "p02725_case_033", "p02725_case_034", "p02725_case_035", "p02725_case_036", "p02725_case_037", "p02725_case_038", "p02725_case_039", "p02725_case_040", "p02725_case_041", "p02725_case_042", "p02725_case_043", "p02725_case_044", "p02725_case_045", "p02725_case_046", "p02725_case_047", "p02725_case_048", "p02725_case_049", "p02725_case_050", "p02725_case_051", "p02725_case_052", "p02725_case_053", "p02725_case_054", "p02725_case_055", "p02725_case_056", "p02725_case_057", "p02725_case_058", "p02725_case_059", "p02725_case_060", "p02725_case_061", "p02725_case_062", "p02725_case_063", "p02725_case_064", "p02725_case_065", "p02725_case_066", "p02725_case_067", "p02725_case_068", "p02725_case_069", "p02725_case_070", "p02725_case_071", "p02725_case_072", "p02725_case_073", "p02725_case_074", "p02725_case_075", "p02725_case_076", "p02725_case_077", "p02725_case_078", "p02725_case_079", "p02725_case_080", "p02725_case_081", "p02725_case_082", "p02725_case_083", "p02725_case_084", "p02725_case_085", "p02725_case_086", "p02725_case_087", "p02725_case_088", "p02725_case_089", "p02725_case_090", "p02725_case_091", "p02725_case_092", "p02725_case_093", "p02725_case_094", "p02725_case_095", "p02725_case_096", "p02725_case_097", "p02725_case_098", "p02725_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "k, n = list(map(int, input().split()))\na = list(map(int, input().rstrip().split()))\ntemp = a[0] + k - a[n - 1]\nfor i in range(n - 1):\n temp = max(temp, a[i + 1] - a[i])\nprint((k - temp))\n", "fast_code_sha256": "7b79d1abbb88b784494d168a1fc90bff32bf43f6e27b8ca8d46714b8572a4dbe", "fast_id": "p02725_7b79d1abbb88b784494d168a1fc90bff32bf43f6e27b8ca8d46714b8572a4dbe", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "k, n = list(map(int, input().split()))\na = list(map(int, input().rstrip().split()))\ntemp = a[0] + k - a[n - 1]\nfor i in range(n - 1):\n temp = max(temp, a[i + 1] - a[i])\nprint((k - temp))\n", "measured_fast_code_sha256": "7b79d1abbb88b784494d168a1fc90bff32bf43f6e27b8ca8d46714b8572a4dbe", "measured_slow_code": "import numpy as np\n\nK, N = list(map(int, input().split()))\nA = list(map(int, input().split()))\nA.append(K + A[0])\nD = np.diff(A)\nprint((int(K) - np.max(D)))\n", "measured_slow_code_sha256": "91accdad635aaade3cd21a1cbe15f0f073859089779275b1b10043afbdc41816", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 692.8081911026859, "pair_id": "python_v2_14a10d7d9d16f58df5ae7cc5", "per_case_slow_code_faster_fraction": 0.35, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02725", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02725_7b79d1abbb88b784494d168a1fc90bff32bf43f6e27b8ca8d46714b8572a4dbe.jsonl.gz", "inputs": "reproduction/python/inputs/p02725.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02725_91accdad635aaade3cd21a1cbe15f0f073859089779275b1b10043afbdc41816.jsonl.gz"}, "slow_code": "import numpy as np\n\nK, N = list(map(int, input().split()))\nA = list(map(int, input().split()))\nA.append(K + A[0])\nD = np.diff(A)\nprint((int(K) - np.max(D)))\n", "slow_code_sha256": "91accdad635aaade3cd21a1cbe15f0f073859089779275b1b10043afbdc41816", "slow_id": "p02725_91accdad635aaade3cd21a1cbe15f0f073859089779275b1b10043afbdc41816", "speedup": 32.90266341416066, "stratum": "8+", "within_pair_jaccard": 0.2857142857142857, "workload": {"case_count": 100, "description": "On a circular path of circumference K, houses have strictly increasing clockwise positions A_i. Starting at any house, find the minimum distance along the circle needed to visit all N houses; return to the start is not required. Observed inputs: K=2..1000000 (median 100); N=2..200000 (median 50); A_i=0..999999.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1399579, "median": 156.0, "min": 8}, "input_format": ["K N\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200002, "median": 52.0, "min": 4}}} -{"case_ids": ["p03343_case_000", "p03343_case_001", "p03343_case_002", "p03343_case_003", "p03343_case_004", "p03343_case_005", "p03343_case_006", "p03343_case_007", "p03343_case_008", "p03343_case_009", "p03343_case_010", "p03343_case_011", "p03343_case_012", "p03343_case_013", "p03343_case_014", "p03343_case_015", "p03343_case_016", "p03343_case_017", "p03343_case_018", "p03343_case_019", "p03343_case_020", "p03343_case_021", "p03343_case_022", "p03343_case_023", "p03343_case_024", "p03343_case_025", "p03343_case_026", "p03343_case_027", "p03343_case_028", "p03343_case_029", "p03343_case_030", "p03343_case_031", "p03343_case_032", "p03343_case_033", "p03343_case_034", "p03343_case_035", "p03343_case_036", "p03343_case_037", "p03343_case_038", "p03343_case_039", "p03343_case_040", "p03343_case_041", "p03343_case_042", "p03343_case_043", "p03343_case_044", "p03343_case_045", "p03343_case_046", "p03343_case_047", "p03343_case_048", "p03343_case_049", "p03343_case_050", "p03343_case_051", "p03343_case_052", "p03343_case_053", "p03343_case_054", "p03343_case_055", "p03343_case_056", "p03343_case_057", "p03343_case_058", "p03343_case_059", "p03343_case_060", "p03343_case_061", "p03343_case_062", "p03343_case_063", "p03343_case_064", "p03343_case_065", "p03343_case_066", "p03343_case_067", "p03343_case_068", "p03343_case_069", "p03343_case_070", "p03343_case_071", "p03343_case_072", "p03343_case_073", "p03343_case_074", "p03343_case_075", "p03343_case_076", "p03343_case_077", "p03343_case_078", "p03343_case_079", "p03343_case_080", "p03343_case_081", "p03343_case_082", "p03343_case_083", "p03343_case_084", "p03343_case_085", "p03343_case_086", "p03343_case_087", "p03343_case_088", "p03343_case_089", "p03343_case_090", "p03343_case_091", "p03343_case_092", "p03343_case_093", "p03343_case_094", "p03343_case_095", "p03343_case_096", "p03343_case_097", "p03343_case_098", "p03343_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n, k, q = list(map(int, input().split()))\na = list(map(int, input().split()))\nd = [a]\na = sorted(a)\nans = a[q - 1] - a[0]\nwhile True:\n newd = list()\n li = list()\n for sub in d:\n for c in sub:\n if c != a[0]:\n li.append(c)\n else:\n newd.append(li)\n li = list()\n newd.append(li)\n li = list()\n d = list()\n a = list()\n for li in newd:\n if len(li) < k:\n continue\n else:\n d.append(li)\n li = sorted(li)\n a.extend(li[0 : len(li) - k + 1])\n a.sort()\n if len(a) >= q:\n ans = min(a[q - 1] - a[0], ans)\n else:\n break\nprint(ans)\n", "fast_code_sha256": "381c68a5710828c132f51f0dda6ed0e7e4aedc9227e7bd9deb6c6e6a2312b60c", "fast_id": "p03343_381c68a5710828c132f51f0dda6ed0e7e4aedc9227e7bd9deb6c6e6a2312b60c", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n, k, q = list(map(int, input().split()))\na = list(map(int, input().split()))\nd = [a]\na = sorted(a)\nans = a[q - 1] - a[0]\nwhile True:\n newd = list()\n li = list()\n for sub in d:\n for c in sub:\n if c != a[0]:\n li.append(c)\n else:\n newd.append(li)\n li = list()\n newd.append(li)\n li = list()\n d = list()\n a = list()\n for li in newd:\n if len(li) < k:\n continue\n else:\n d.append(li)\n li = sorted(li)\n a.extend(li[0 : len(li) - k + 1])\n a.sort()\n if len(a) >= q:\n ans = min(a[q - 1] - a[0], ans)\n else:\n break\nprint(ans)\n", "measured_fast_code_sha256": "381c68a5710828c132f51f0dda6ed0e7e4aedc9227e7bd9deb6c6e6a2312b60c", "measured_slow_code": "n, k, q, *a = list(map(int, open(0).read().split()))\ns = sorted\nm = 1e9\nfor b in a:\n i = [i for i, t in enumerate(a) if t < b]\n l = s(sum([s(a[i + 1 : j])[::-1][k - 1 :] for i, j in zip([-1] + i, i + [n])], []))\n if len(l) >= q:\n m = min(m, l[q - 1] - b)\nprint(m)\n", "measured_slow_code_sha256": "9d7afcc5f59d44fe48b93e1a0e26cc6f70642b27ac286eb6ac061aeb1465052e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 846.5660215851711, "pair_id": "python_v2_ab9456c1556855f20e3c8a48", "per_case_slow_code_faster_fraction": 0.03, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03343", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03343_381c68a5710828c132f51f0dda6ed0e7e4aedc9227e7bd9deb6c6e6a2312b60c.jsonl.gz", "inputs": "reproduction/python/inputs/p03343.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03343_9d7afcc5f59d44fe48b93e1a0e26cc6f70642b27ac286eb6ac061aeb1465052e.jsonl.gz"}, "slow_code": "n, k, q, *a = list(map(int, open(0).read().split()))\ns = sorted\nm = 1e9\nfor b in a:\n i = [i for i, t in enumerate(a) if t < b]\n l = s(sum([s(a[i + 1 : j])[::-1][k - 1 :] for i, j in zip([-1] + i, i + [n])], []))\n if len(l) >= q:\n m = min(m, l[q - 1] - b)\nprint(m)\n", "slow_code_sha256": "9d7afcc5f59d44fe48b93e1a0e26cc6f70642b27ac286eb6ac061aeb1465052e", "slow_id": "p03343_9d7afcc5f59d44fe48b93e1a0e26cc6f70642b27ac286eb6ac061aeb1465052e", "speedup": 354.676103931764, "stratum": "8+", "within_pair_jaccard": 0.37777777777777777, "workload": {"case_count": 100, "description": "Repeat Q times: choose K consecutive entries of the current sequence and remove one minimum entry from that block. Minimize the largest removed value minus the smallest over all Q removals. Observed inputs: N=1..2000 (median 2000); K=1..2000 (median 1000); Q=1..2000 (median 1000); A_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 22012, "median": 19779.0, "min": 8}, "input_format": ["N K Q\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2003, "median": 2003.0, "min": 4}}} -{"case_ids": ["p03837_case_000", "p03837_case_001", "p03837_case_002", "p03837_case_003", "p03837_case_004", "p03837_case_005", "p03837_case_006", "p03837_case_007", "p03837_case_008", "p03837_case_009", "p03837_case_010", "p03837_case_011", "p03837_case_012", "p03837_case_013", "p03837_case_014", "p03837_case_015", "p03837_case_016", "p03837_case_017", "p03837_case_018", "p03837_case_019", "p03837_case_020", "p03837_case_021", "p03837_case_022", "p03837_case_023", "p03837_case_024", "p03837_case_025", "p03837_case_026", "p03837_case_027", "p03837_case_028", "p03837_case_029", "p03837_case_030", "p03837_case_031", "p03837_case_032", "p03837_case_033", "p03837_case_034", "p03837_case_035", "p03837_case_036", "p03837_case_037", "p03837_case_038", "p03837_case_039", "p03837_case_040", "p03837_case_041", "p03837_case_042", "p03837_case_043", "p03837_case_044", "p03837_case_045", "p03837_case_046", "p03837_case_047", "p03837_case_048", "p03837_case_049", "p03837_case_050", "p03837_case_051", "p03837_case_052", "p03837_case_053", "p03837_case_054", "p03837_case_055", "p03837_case_056", "p03837_case_057", "p03837_case_058", "p03837_case_059", "p03837_case_060", "p03837_case_061", "p03837_case_062", "p03837_case_063", "p03837_case_064", "p03837_case_065", "p03837_case_066", "p03837_case_067", "p03837_case_068", "p03837_case_069", "p03837_case_070", "p03837_case_071", "p03837_case_072", "p03837_case_073", "p03837_case_074", "p03837_case_075", "p03837_case_076", "p03837_case_077", "p03837_case_078", "p03837_case_079", "p03837_case_080", "p03837_case_081", "p03837_case_082", "p03837_case_083", "p03837_case_084", "p03837_case_085", "p03837_case_086", "p03837_case_087", "p03837_case_088", "p03837_case_089", "p03837_case_090", "p03837_case_091", "p03837_case_092", "p03837_case_093", "p03837_case_094", "p03837_case_095", "p03837_case_096", "p03837_case_097", "p03837_case_098", "p03837_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "executable_AST_equal_except_explicit_explanatory_string_removal_and_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\n\nimport heapq\n\n\ndef dijkstra_heap(s, n, edges):\n\n dist = [float(\"inf\")] * n\n used = [True] * n\n dist[s] = 0\n used[s] = False\n used_edges = set()\n edgelist = []\n for d, e in edges[s]:\n\n heapq.heappush(edgelist, (d, e, s))\n while edgelist:\n d, e, s = heapq.heappop(edgelist)\n if dist[e] >= d:\n if s < e:\n used_edges.add((s, e))\n else:\n used_edges.add((e, s))\n\n if not used[e]:\n continue\n dist[e] = d\n used[e] = False\n for nd, ne in edges[e]:\n if used[ne]:\n heapq.heappush(edgelist, (nd + dist[e], ne, e))\n return dist, used_edges\n\n\nN, M = list(map(int, sys.stdin.readline().strip().split()))\nedges = [[] for _ in range(N)]\nall_edges = set()\nfor _ in range(M):\n a, b, c = list(map(int, sys.stdin.readline().strip().split()))\n edges[a - 1].append((c, b - 1))\n edges[b - 1].append((c, a - 1))\n if a < b:\n all_edges.add((a - 1, b - 1))\n else:\n all_edges.add((b - 1, a - 1))\nfor i in range(N):\n min_d, used_edges = dijkstra_heap(i, N, edges)\n\n all_edges -= used_edges\nprint((len(all_edges)))\n", "fast_code_sha256": "43fc346c98c43f7f36d070397a4022b2ae72cccd3bd525ebbf464c8942e60a93", "fast_id": "p03837_23995c018e13f10d6063770b58497511907be90d8dcf30a4145faf91dac6a3d6", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\n# O(ElogV)\nimport heapq\n\n\ndef dijkstra_heap(s, n, edges):\n # 始点sから各頂点への最短距離\n dist = [float(\"inf\")] * n\n used = [True] * n # True:未確定\n dist[s] = 0\n used[s] = False\n used_edges = set()\n edgelist = []\n for (d, e) in edges[s]:\n # 利用した辺を管理するため、sも入れていることに注意\n heapq.heappush(edgelist, (d, e, s))\n while edgelist:\n d, e, s = heapq.heappop(edgelist)\n if dist[e] >= d:\n if s < e:\n used_edges.add((s, e))\n else:\n used_edges.add((e, s))\n # まだ使われてない頂点の中から最小の距離のものを探す\n if not used[e]:\n continue\n dist[e] = d\n used[e] = False\n \"\"\"\n if s < e:\n used_edges.add((s, e))\n else:\n used_edges.add((e, s))\n \"\"\"\n for (nd, ne) in edges[e]:\n if used[ne]:\n heapq.heappush(edgelist, (nd + dist[e], ne, e))\n return dist, used_edges\n\n\nN, M = list(map(int, sys.stdin.readline().strip().split()))\nedges = [[] for _ in range(N)]\nall_edges = set()\nfor _ in range(M):\n a, b, c = list(map(int, sys.stdin.readline().strip().split()))\n edges[a - 1].append((c, b - 1))\n edges[b - 1].append((c, a - 1))\n if a < b:\n all_edges.add((a - 1, b - 1))\n else:\n all_edges.add((b - 1, a - 1))\nfor i in range(N):\n min_d, used_edges = dijkstra_heap(i, N, edges)\n # 利用した辺を取り除く\n all_edges -= used_edges\nprint((len(all_edges)))\n", "measured_fast_code_sha256": "23995c018e13f10d6063770b58497511907be90d8dcf30a4145faf91dac6a3d6", "measured_slow_code": "INFTY = 10**5 + 10\nN, M = list(map(int, input().split()))\nL = [list(map(int, input().split())) for _ in range(M)]\nG = {i: [] for i in range(1, N + 1)}\ndist = [[INFTY for _ in range(N + 1)] for _ in range(N + 1)]\nfor j in range(M):\n a, b, c = L[j]\n G[a].append(b)\n G[b].append(a)\n dist[a][b] = c\n dist[b][a] = c\nfor k in range(1, N + 1):\n for i in range(1, N + 1):\n for j in range(1, N + 1):\n dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j])\ncnt = 0\nfor j in range(M):\n a, b, c = L[j]\n if dist[a][b] < c:\n cnt += 1\nprint(cnt)\n", "measured_slow_code_sha256": "3eb192aa37f558f56c5f9a914f6fb2d9a626d3e864aa7172ad0427991823182c", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4.991738017587141, "pair_id": "python_v2_48a70116fb69926287b34256", "per_case_slow_code_faster_fraction": 0.17, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03837", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03837_23995c018e13f10d6063770b58497511907be90d8dcf30a4145faf91dac6a3d6.jsonl.gz", "inputs": "reproduction/python/inputs/p03837.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03837_3eb192aa37f558f56c5f9a914f6fb2d9a626d3e864aa7172ad0427991823182c.jsonl.gz"}, "slow_code": "INFTY = 10**5 + 10\nN, M = list(map(int, input().split()))\nL = [list(map(int, input().split())) for _ in range(M)]\nG = {i: [] for i in range(1, N + 1)}\ndist = [[INFTY for _ in range(N + 1)] for _ in range(N + 1)]\nfor j in range(M):\n a, b, c = L[j]\n G[a].append(b)\n G[b].append(a)\n dist[a][b] = c\n dist[b][a] = c\nfor k in range(1, N + 1):\n for i in range(1, N + 1):\n for j in range(1, N + 1):\n dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j])\ncnt = 0\nfor j in range(M):\n a, b, c = L[j]\n if dist[a][b] < c:\n cnt += 1\nprint(cnt)\n", "slow_code_sha256": "3eb192aa37f558f56c5f9a914f6fb2d9a626d3e864aa7172ad0427991823182c", "slow_id": "p03837_3eb192aa37f558f56c5f9a914f6fb2d9a626d3e864aa7172ad0427991823182c", "speedup": 4.2583256170823445, "stratum": "4-8", "within_pair_jaccard": 0.3125, "workload": {"case_count": 100, "description": "In a connected simple undirected weighted graph with positive weights c_i, count edges that occur in no shortest path between any pair of distinct vertices. Endpoints are 1-based and may be listed in either order. Observed inputs: N=2..100 (median 30); M=1..1000 (median 55); c_i=1..1000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 10569, "median": 461.0, "min": 10}, "input_format": ["N M\na_1 b_1 c_1\n...\na_M b_M c_M"], "input_format_status": "source_input_section", "input_lines": {"max": 1001, "median": 56.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3002, "median": 167.0, "min": 5}}} -{"case_ids": ["p02783_case_000", "p02783_case_001", "p02783_case_002", "p02783_case_003", "p02783_case_004", "p02783_case_005", "p02783_case_006", "p02783_case_007", "p02783_case_008", "p02783_case_009", "p02783_case_010", "p02783_case_011", "p02783_case_012", "p02783_case_013", "p02783_case_014", "p02783_case_015", "p02783_case_016", "p02783_case_017", "p02783_case_018", "p02783_case_019", "p02783_case_020", "p02783_case_021", "p02783_case_022", "p02783_case_023", "p02783_case_024", "p02783_case_025", "p02783_case_026", "p02783_case_027", "p02783_case_028", "p02783_case_029", "p02783_case_030", "p02783_case_031", "p02783_case_032", "p02783_case_033", "p02783_case_034", "p02783_case_035", "p02783_case_036", "p02783_case_037", "p02783_case_038", "p02783_case_039", "p02783_case_040", "p02783_case_041", "p02783_case_042", "p02783_case_043", "p02783_case_044", "p02783_case_045", "p02783_case_046", "p02783_case_047", "p02783_case_048", "p02783_case_049", "p02783_case_050", "p02783_case_051", "p02783_case_052", "p02783_case_053", "p02783_case_054", "p02783_case_055", "p02783_case_056", "p02783_case_057", "p02783_case_058", "p02783_case_059", "p02783_case_060", "p02783_case_061", "p02783_case_062", "p02783_case_063", "p02783_case_064", "p02783_case_065", "p02783_case_066", "p02783_case_067", "p02783_case_068", "p02783_case_069", "p02783_case_070", "p02783_case_071", "p02783_case_072", "p02783_case_073", "p02783_case_074", "p02783_case_075", "p02783_case_076", "p02783_case_077", "p02783_case_078", "p02783_case_079", "p02783_case_080", "p02783_case_081", "p02783_case_082", "p02783_case_083", "p02783_case_084", "p02783_case_085", "p02783_case_086", "p02783_case_087", "p02783_case_088", "p02783_case_089", "p02783_case_090", "p02783_case_091", "p02783_case_092", "p02783_case_093", "p02783_case_094", "p02783_case_095", "p02783_case_096", "p02783_case_097", "p02783_case_098", "p02783_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "h, a = list(map(int, input().split()))\nprint((int((h - 1) / a) + 1))\n", "fast_code_sha256": "7cb9911333d82a37d376cf29527c0f4214cf042037a82c628266b50cbb0888f3", "fast_id": "p02783_7cb9911333d82a37d376cf29527c0f4214cf042037a82c628266b50cbb0888f3", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "h, a = list(map(int, input().split()))\nprint((int((h - 1) / a) + 1))\n", "measured_fast_code_sha256": "7cb9911333d82a37d376cf29527c0f4214cf042037a82c628266b50cbb0888f3", "measured_slow_code": "import sys\nimport socket\n\nhostname = socket.gethostname()\nif hostname == \"F451C\":\n sys.stdin = open(\"a1.in\")\n\n\ndef read_int_list():\n return list(map(int, input().split()))\n\n\ndef read_str_list():\n return input().split()\n\n\ndef read_int():\n return int(eval(input()))\n\n\ndef read_str():\n return eval(input())\n\n\ndef main_0():\n H, A = read_int_list()\n res = 0\n for i in range(10001):\n H = H - A\n res += 1\n if H <= 0:\n break\n print(res)\n\n\ndef main_1():\n H, A = read_int_list()\n res = H // A\n if H % A != 0:\n res += 1\n print(res)\n\n\ndef main():\n H, A = read_int_list()\n res = 0\n while H > 0:\n H -= A\n res += 1\n print(res)\n\n\nmain()\n", "measured_slow_code_sha256": "d5fe1e3cebc325b88118764de6cebe3ff7e094ae5446fe951fc1767a79f70b68", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 63.18312711294152, "pair_id": "python_v2_83edd33606d1a1f54b922f16", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02783", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02783_7cb9911333d82a37d376cf29527c0f4214cf042037a82c628266b50cbb0888f3.jsonl.gz", "inputs": "reproduction/python/inputs/p02783.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02783_d5fe1e3cebc325b88118764de6cebe3ff7e094ae5446fe951fc1767a79f70b68.jsonl.gz"}, "slow_code": "import sys\nimport socket\n\nhostname = socket.gethostname()\nif hostname == \"F451C\":\n sys.stdin = open(\"a1.in\")\n\n\ndef read_int_list():\n return list(map(int, input().split()))\n\n\ndef read_str_list():\n return input().split()\n\n\ndef read_int():\n return int(eval(input()))\n\n\ndef read_str():\n return eval(input())\n\n\ndef main_0():\n H, A = read_int_list()\n res = 0\n for i in range(10001):\n H = H - A\n res += 1\n if H <= 0:\n break\n print(res)\n\n\ndef main_1():\n H, A = read_int_list()\n res = H // A\n if H % A != 0:\n res += 1\n print(res)\n\n\ndef main():\n H, A = read_int_list()\n res = 0\n while H > 0:\n H -= A\n res += 1\n print(res)\n\n\nmain()\n", "slow_code_sha256": "d5fe1e3cebc325b88118764de6cebe3ff7e094ae5446fe951fc1767a79f70b68", "slow_id": "p02783_d5fe1e3cebc325b88118764de6cebe3ff7e094ae5446fe951fc1767a79f70b68", "speedup": 63.525085588130324, "stratum": "8+", "within_pair_jaccard": 0.175, "workload": {"case_count": 100, "description": "A monster starts with health H; each attack reduces it by A. Find the number of attacks required to reduce health to zero or below. Observed inputs: H=1..10000 (median 5766.5); A=1..10000 (median 4105.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 12, "median": 10.0, "min": 8}, "input_format": ["H A"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p03209_case_000", "p03209_case_001", "p03209_case_002", "p03209_case_003", "p03209_case_004", "p03209_case_005", "p03209_case_006", "p03209_case_007", "p03209_case_008", "p03209_case_009", "p03209_case_010", "p03209_case_011", "p03209_case_012", "p03209_case_013", "p03209_case_014", "p03209_case_015", "p03209_case_016", "p03209_case_017", "p03209_case_018", "p03209_case_019", "p03209_case_020", "p03209_case_021", "p03209_case_022", "p03209_case_023", "p03209_case_024", "p03209_case_025", "p03209_case_026", "p03209_case_027", "p03209_case_028", "p03209_case_029", "p03209_case_030", "p03209_case_031", "p03209_case_032", "p03209_case_033", "p03209_case_034", "p03209_case_035", "p03209_case_036", "p03209_case_037", "p03209_case_038", "p03209_case_039", "p03209_case_040", "p03209_case_041", "p03209_case_042", "p03209_case_043", "p03209_case_044", "p03209_case_045", "p03209_case_046", "p03209_case_047", "p03209_case_048", "p03209_case_049", "p03209_case_050", "p03209_case_051", "p03209_case_052", "p03209_case_053", "p03209_case_054", "p03209_case_055", "p03209_case_056", "p03209_case_057", "p03209_case_058", "p03209_case_059", "p03209_case_060", "p03209_case_061", "p03209_case_062", "p03209_case_063", "p03209_case_064", "p03209_case_065", "p03209_case_066", "p03209_case_067", "p03209_case_068", "p03209_case_069", "p03209_case_070", "p03209_case_071", "p03209_case_072", "p03209_case_073", "p03209_case_074", "p03209_case_075", "p03209_case_076", "p03209_case_077", "p03209_case_078", "p03209_case_079", "p03209_case_080", "p03209_case_081", "p03209_case_082", "p03209_case_083", "p03209_case_084", "p03209_case_085", "p03209_case_086", "p03209_case_087", "p03209_case_088", "p03209_case_089", "p03209_case_090", "p03209_case_091", "p03209_case_092", "p03209_case_093", "p03209_case_094", "p03209_case_095", "p03209_case_096", "p03209_case_097", "p03209_case_098", "p03209_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\nsys.setrecursionlimit(10**7)\nn, x = list(map(int, input().split()))\na = [0] * (n + 1)\np = [0] * (n + 1)\na[0] = 1\np[0] = 1\nfor i in range(n):\n a[i + 1] = 2 * a[i] + 3\n p[i + 1] = 2 * p[i] + 1\n\n\ndef func(i, x):\n if i == 0:\n if x <= 0:\n return 0\n elif x >= 1:\n return 1\n mid = (a[i] + 1) // 2\n if mid == x:\n return p[i - 1] + 1\n elif mid > x:\n return func(i - 1, x - 1)\n else:\n return p[i - 1] + 1 + func(i - 1, x - mid)\n\n\nprint((func(n, x)))\n", "fast_code_sha256": "a82927eb492dac5d69efb79a88273643a693b2c2fc6de3e1ae41c3f60fa52c4e", "fast_id": "p03209_fb286ca8c8c27ed7f29d63ec8fdd225a1d64cd71162920c90f80533849dde89a", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "# 再帰の深さが1000を超えそうなときはこれをやっておく\nimport sys\n\nsys.setrecursionlimit(10**7)\nn, x = list(map(int, input().split()))\na = [0] * (n + 1)\np = [0] * (n + 1)\na[0] = 1\np[0] = 1\nfor i in range(n):\n a[i + 1] = 2 * a[i] + 3\n p[i + 1] = 2 * p[i] + 1\n\n\ndef func(i, x):\n if i == 0:\n if x <= 0:\n return 0\n elif x >= 1:\n return 1\n mid = (a[i] + 1) // 2\n if mid == x:\n return p[i - 1] + 1\n elif mid > x:\n return func(i - 1, x - 1)\n else:\n return p[i - 1] + 1 + func(i - 1, x - mid)\n\n\nprint((func(n, x)))\n", "measured_fast_code_sha256": "fb286ca8c8c27ed7f29d63ec8fdd225a1d64cd71162920c90f80533849dde89a", "measured_slow_code": "import sys\n\nstdin = sys.stdin\nsys.setrecursionlimit(10**5)\n\n\ndef li():\n return list(map(int, stdin.readline().split()))\n\n\ndef li_():\n return [int(x) - 1 for x in stdin.readline().split()]\n\n\ndef lf():\n return list(map(float, stdin.readline().split()))\n\n\ndef ls():\n return stdin.readline().split()\n\n\ndef ns():\n return stdin.readline().rstrip()\n\n\ndef lc():\n return list(ns())\n\n\ndef ni():\n return int(stdin.readline())\n\n\ndef nf():\n return float(stdin.readline())\n\n\nn, x = li()\ntop = [4 * pow(2, i) - 3 for i in range(n + 1)]\nmed = [pow(2, i + 1) - 1 for i in range(n + 1)]\nbot = [1 for _ in range(n + 1)]\n\n\ndef findPattyNum(level: int, lay: int):\n if level == 0 and lay == 1:\n return 1\n if lay == 4 * pow(2, level) - 3:\n return pow(2, level + 1) - 1\n elif pow(2, level + 1) - 1 < lay < 4 * pow(2, level) - 3:\n return pow(2, level) + findPattyNum(level - 1, lay - (pow(2, level + 1) - 1))\n elif lay == pow(2, level + 1) - 1:\n return pow(2, level)\n elif 1 < lay < pow(2, level + 1) - 1:\n return findPattyNum(level - 1, lay - 1)\n elif lay == 1:\n return 0\n\n\nprint((findPattyNum(n, x)))\n", "measured_slow_code_sha256": "bb7815001602c92a4a4d9be5cdf11f822306f95b9c14ffc6b0f51a943d9f9db5", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.1206943544816466, "pair_id": "python_v2_7ebdc364a4709766385a99d5", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03209", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03209_fb286ca8c8c27ed7f29d63ec8fdd225a1d64cd71162920c90f80533849dde89a.jsonl.gz", "inputs": "reproduction/python/inputs/p03209.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03209_bb7815001602c92a4a4d9be5cdf11f822306f95b9c14ffc6b0f51a943d9f9db5.jsonl.gz"}, "slow_code": "import sys\n\nstdin = sys.stdin\nsys.setrecursionlimit(10**5)\n\n\ndef li():\n return list(map(int, stdin.readline().split()))\n\n\ndef li_():\n return [int(x) - 1 for x in stdin.readline().split()]\n\n\ndef lf():\n return list(map(float, stdin.readline().split()))\n\n\ndef ls():\n return stdin.readline().split()\n\n\ndef ns():\n return stdin.readline().rstrip()\n\n\ndef lc():\n return list(ns())\n\n\ndef ni():\n return int(stdin.readline())\n\n\ndef nf():\n return float(stdin.readline())\n\n\nn, x = li()\ntop = [4 * pow(2, i) - 3 for i in range(n + 1)]\nmed = [pow(2, i + 1) - 1 for i in range(n + 1)]\nbot = [1 for _ in range(n + 1)]\n\n\ndef findPattyNum(level: int, lay: int):\n if level == 0 and lay == 1:\n return 1\n if lay == 4 * pow(2, level) - 3:\n return pow(2, level + 1) - 1\n elif pow(2, level + 1) - 1 < lay < 4 * pow(2, level) - 3:\n return pow(2, level) + findPattyNum(level - 1, lay - (pow(2, level + 1) - 1))\n elif lay == pow(2, level + 1) - 1:\n return pow(2, level)\n elif 1 < lay < pow(2, level + 1) - 1:\n return findPattyNum(level - 1, lay - 1)\n elif lay == 1:\n return 0\n\n\nprint((findPattyNum(n, x)))\n", "slow_code_sha256": "bb7815001602c92a4a4d9be5cdf11f822306f95b9c14ffc6b0f51a943d9f9db5", "slow_id": "p03209_bb7815001602c92a4a4d9be5cdf11f822306f95b9c14ffc6b0f51a943d9f9db5", "speedup": 2.104892065615214, "stratum": "2-4", "within_pair_jaccard": 0.4339622641509434, "workload": {"case_count": 100, "description": "Level-0 burger is one patty. Level L>0 stacks bun, level-(L-1) burger, patty, level-(L-1) burger, bun, from bottom upward. Count patties in the bottom X layers of a level-N burger; the layered object is implicit, not listed. Observed inputs: N=1..50 (median 27.5); X=1..4503599627370493.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 20, "median": 11.0, "min": 4}, "input_format": ["N X"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p03221_case_000", "p03221_case_001", "p03221_case_002", "p03221_case_003", "p03221_case_004", "p03221_case_005", "p03221_case_006", "p03221_case_007", "p03221_case_008", "p03221_case_009", "p03221_case_010", "p03221_case_011", "p03221_case_012", "p03221_case_013", "p03221_case_014", "p03221_case_015", "p03221_case_016", "p03221_case_017", "p03221_case_018", "p03221_case_019", "p03221_case_020", "p03221_case_021", "p03221_case_022", "p03221_case_023", "p03221_case_024", "p03221_case_025", "p03221_case_026", "p03221_case_027", "p03221_case_028", "p03221_case_029", "p03221_case_030", "p03221_case_031", "p03221_case_032", "p03221_case_033", "p03221_case_034", "p03221_case_035", "p03221_case_036", "p03221_case_037", "p03221_case_038", "p03221_case_039", "p03221_case_040", "p03221_case_041", "p03221_case_042", "p03221_case_043", "p03221_case_044", "p03221_case_045", "p03221_case_046", "p03221_case_047", "p03221_case_048", "p03221_case_049", "p03221_case_050", "p03221_case_051", "p03221_case_052", "p03221_case_053", "p03221_case_054", "p03221_case_055", "p03221_case_056", "p03221_case_057", "p03221_case_058", "p03221_case_059", "p03221_case_060", "p03221_case_061", "p03221_case_062", "p03221_case_063", "p03221_case_064", "p03221_case_065", "p03221_case_066", "p03221_case_067", "p03221_case_068", "p03221_case_069", "p03221_case_070", "p03221_case_071", "p03221_case_072", "p03221_case_073", "p03221_case_074", "p03221_case_075", "p03221_case_076", "p03221_case_077", "p03221_case_078", "p03221_case_079", "p03221_case_080", "p03221_case_081", "p03221_case_082", "p03221_case_083", "p03221_case_084", "p03221_case_085", "p03221_case_086", "p03221_case_087", "p03221_case_088", "p03221_case_089", "p03221_case_090", "p03221_case_091", "p03221_case_092", "p03221_case_093", "p03221_case_094", "p03221_case_095", "p03221_case_096", "p03221_case_097", "p03221_case_098", "p03221_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N, M = list(map(int, input().split()))\npref = [[0] for i in range(N + 1)]\nq = []\nfor i in range(M):\n p, y = list(map(int, input().split()))\n pref[p].append(y)\n q.append([p, y])\nfor p in pref:\n p.sort()\nimport bisect\n\nfor p, y in q:\n print((\"%06d%06d\" % (p, bisect.bisect_left(pref[p], y))))\n", "fast_code_sha256": "811904fe07085f5240fa41ae878883738dacd02f328e19ebb95946927e9c2829", "fast_id": "p03221_811904fe07085f5240fa41ae878883738dacd02f328e19ebb95946927e9c2829", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N, M = list(map(int, input().split()))\npref = [[0] for i in range(N + 1)]\nq = []\nfor i in range(M):\n p, y = list(map(int, input().split()))\n pref[p].append(y)\n q.append([p, y])\nfor p in pref:\n p.sort()\nimport bisect\n\nfor p, y in q:\n print((\"%06d%06d\" % (p, bisect.bisect_left(pref[p], y))))\n", "measured_fast_code_sha256": "811904fe07085f5240fa41ae878883738dacd02f328e19ebb95946927e9c2829", "measured_slow_code": "N, M = list(map(int, input().split()))\nP = []\nY = []\narr = [[] for j in range(10**5 + 1)]\nfor i in range(M):\n listA = list(map(int, input().split()))\n P.append(listA[0])\n Y.append(listA[1])\n arr[listA[0]].append(listA[1])\nfor i in range(N + 1):\n arr[i].sort()\nfor i in range(M):\n # 二部探索\n left = 0\n right = len(arr[P[i]]) - 1\n while left <= right:\n mid = (left + right) // 2\n if arr[P[i]][mid] == Y[i]:\n k = mid\n break\n elif arr[P[i]][mid] > Y[i]:\n right = mid - 1\n else:\n left = mid + 1\n print((str(P[i]).rjust(6, \"0\") + str(k + 1).rjust(6, \"0\")))\n", "measured_slow_code_sha256": "bac932e565fc824f54938c4edcf17024edb8ebfd73deb80882c8006e56a416b6", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.8895941972086545, "pair_id": "python_v2_063cd86c049ec3bce7600728", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03221", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03221_811904fe07085f5240fa41ae878883738dacd02f328e19ebb95946927e9c2829.jsonl.gz", "inputs": "reproduction/python/inputs/p03221.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03221_bac932e565fc824f54938c4edcf17024edb8ebfd73deb80882c8006e56a416b6.jsonl.gz"}, "slow_code": "N, M = list(map(int, input().split()))\nP = []\nY = []\narr = [[] for j in range(10**5 + 1)]\nfor i in range(M):\n listA = list(map(int, input().split()))\n P.append(listA[0])\n Y.append(listA[1])\n arr[listA[0]].append(listA[1])\nfor i in range(N + 1):\n arr[i].sort()\nfor i in range(M):\n\n left = 0\n right = len(arr[P[i]]) - 1\n while left <= right:\n mid = (left + right) // 2\n if arr[P[i]][mid] == Y[i]:\n k = mid\n break\n elif arr[P[i]][mid] > Y[i]:\n right = mid - 1\n else:\n left = mid + 1\n print((str(P[i]).rjust(6, \"0\") + str(k + 1).rjust(6, \"0\")))\n", "slow_code_sha256": "9a9b5b8d60f2f6a437fd75f31baba74dc5ed7ac13071d840e26b691e2ff91cac", "slow_id": "p03221_bac932e565fc824f54938c4edcf17024edb8ebfd73deb80882c8006e56a416b6", "speedup": 6.748784949525597, "stratum": "4-8", "within_pair_jaccard": 0.36363636363636365, "workload": {"case_count": 100, "description": "For each city, output a 12-digit ID formed from its prefecture P_i and its 1-based establishment rank within that prefecture, each zero-padded to six digits. Establishment years Y_i are globally distinct. Preserve input city order. Observed inputs: N=1..100000 (median 1000); M=1..100000 (median 1000); P_i=1..100000; Y_i=674542..991757127.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1600014, "median": 13905.0, "min": 16}, "input_format": ["N M\nP_1 Y_1\n...\nP_M Y_M"], "input_format_status": "source_input_section", "input_lines": {"max": 100001, "median": 1001.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200002, "median": 2002.0, "min": 4}}} -{"case_ids": ["p03030_case_000", "p03030_case_001", "p03030_case_002", "p03030_case_003", "p03030_case_004", "p03030_case_005", "p03030_case_006", "p03030_case_007", "p03030_case_008", "p03030_case_009", "p03030_case_010", "p03030_case_011", "p03030_case_012", "p03030_case_013", "p03030_case_014", "p03030_case_015", "p03030_case_016", "p03030_case_017", "p03030_case_018", "p03030_case_019", "p03030_case_020", "p03030_case_021", "p03030_case_022", "p03030_case_023", "p03030_case_024", "p03030_case_025", "p03030_case_026", "p03030_case_027", "p03030_case_028", "p03030_case_029", "p03030_case_030", "p03030_case_031", "p03030_case_032", "p03030_case_033", "p03030_case_034", "p03030_case_035", "p03030_case_036", "p03030_case_037", "p03030_case_038", "p03030_case_039", "p03030_case_040", "p03030_case_041", "p03030_case_042", "p03030_case_043", "p03030_case_044", "p03030_case_045", "p03030_case_046", "p03030_case_047", "p03030_case_048", "p03030_case_049", "p03030_case_050", "p03030_case_051", "p03030_case_052", "p03030_case_053", "p03030_case_054", "p03030_case_055", "p03030_case_056", "p03030_case_057", "p03030_case_058", "p03030_case_059", "p03030_case_060", "p03030_case_061", "p03030_case_062", "p03030_case_063", "p03030_case_064", "p03030_case_065", "p03030_case_066", "p03030_case_067", "p03030_case_068", "p03030_case_069", "p03030_case_070", "p03030_case_071", "p03030_case_072", "p03030_case_073", "p03030_case_074", "p03030_case_075", "p03030_case_076", "p03030_case_077", "p03030_case_078", "p03030_case_079", "p03030_case_080", "p03030_case_081", "p03030_case_082", "p03030_case_083", "p03030_case_084", "p03030_case_085", "p03030_case_086", "p03030_case_087", "p03030_case_088", "p03030_case_089", "p03030_case_090", "p03030_case_091", "p03030_case_092", "p03030_case_093", "p03030_case_094", "p03030_case_095", "p03030_case_096", "p03030_case_097", "p03030_case_098", "p03030_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\nsp = [[input().split(), i + 1] for i in range(n)]\nsp = sorted(sp, key=lambda x: (x[0][0], -int(x[0][1])))\nfor i in range(n):\n print((sp[i][1]))\n", "fast_code_sha256": "a608c3ac8df5a73167a92a04c86f2fdb15d45e00c54253d6e68a9ff5e33ea86b", "fast_id": "p03030_a608c3ac8df5a73167a92a04c86f2fdb15d45e00c54253d6e68a9ff5e33ea86b", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\nsp = [[input().split(), i + 1] for i in range(n)]\nsp = sorted(sp, key=lambda x: (x[0][0], -int(x[0][1])))\nfor i in range(n):\n print((sp[i][1]))\n", "measured_fast_code_sha256": "a608c3ac8df5a73167a92a04c86f2fdb15d45e00c54253d6e68a9ff5e33ea86b", "measured_slow_code": "N = int(eval(input()))\nMAIN = []\nfor i in range(N):\n S, P = list(map(str, input().split()))\n MAIN.append([i + 1, S, int(P)])\n\n\ndef swap(i, j):\n x = MAIN[i]\n MAIN[i] = MAIN[j]\n MAIN[j] = x\n\n\nupdate = True\nwhile update == True:\n update = False\n for i in range(1, N):\n if MAIN[i][1] > MAIN[i - 1][1]:\n continue\n elif MAIN[i][1] == MAIN[i - 1][1]:\n if MAIN[i][2] > MAIN[i - 1][2]:\n swap(i, i - 1)\n update = True\n else:\n swap(i, i - 1)\n update = True\nfor m in MAIN:\n print((m[0]))\n", "measured_slow_code_sha256": "dbe08050a0d6a77d36da9960a8e9921e8d48ac452d52421ae0919461f538c102", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 6.378204574694907, "pair_id": "python_v2_f260d992002646a0f86f5507", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03030", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03030_a608c3ac8df5a73167a92a04c86f2fdb15d45e00c54253d6e68a9ff5e33ea86b.jsonl.gz", "inputs": "reproduction/python/inputs/p03030.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03030_dbe08050a0d6a77d36da9960a8e9921e8d48ac452d52421ae0919461f538c102.jsonl.gz"}, "slow_code": "N = int(eval(input()))\nMAIN = []\nfor i in range(N):\n S, P = list(map(str, input().split()))\n MAIN.append([i + 1, S, int(P)])\n\n\ndef swap(i, j):\n x = MAIN[i]\n MAIN[i] = MAIN[j]\n MAIN[j] = x\n\n\nupdate = True\nwhile update == True:\n update = False\n for i in range(1, N):\n if MAIN[i][1] > MAIN[i - 1][1]:\n continue\n elif MAIN[i][1] == MAIN[i - 1][1]:\n if MAIN[i][2] > MAIN[i - 1][2]:\n swap(i, i - 1)\n update = True\n else:\n swap(i, i - 1)\n update = True\nfor m in MAIN:\n print((m[0]))\n", "slow_code_sha256": "dbe08050a0d6a77d36da9960a8e9921e8d48ac452d52421ae0919461f538c102", "slow_id": "p03030_dbe08050a0d6a77d36da9960a8e9921e8d48ac452d52421ae0919461f538c102", "speedup": 5.246022867186872, "stratum": "4-8", "within_pair_jaccard": 0.3157894736842105, "workload": {"case_count": 100, "description": "Sort restaurants by lowercase city name lexicographically, breaking equal-city ties by decreasing score P_i, and output their original 1-based IDs. All scores are distinct. Observed inputs: N=1..100 (median 50); name_length=1..10; P_i=0..100; distinct_cities=1..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1395, "median": 463.0, "min": 7}, "input_format": ["N\nS_1 P_1\n...\nS_N P_N"], "input_format_status": "source_input_section", "input_lines": {"max": 101, "median": 51.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 201, "median": 101.0, "min": 3}}} -{"case_ids": ["p03006_case_000", "p03006_case_001", "p03006_case_002", "p03006_case_003", "p03006_case_004", "p03006_case_005", "p03006_case_006", "p03006_case_007", "p03006_case_008", "p03006_case_009", "p03006_case_010", "p03006_case_011", "p03006_case_012", "p03006_case_013", "p03006_case_014", "p03006_case_015", "p03006_case_016", "p03006_case_017", "p03006_case_018", "p03006_case_019", "p03006_case_020", "p03006_case_021", "p03006_case_022", "p03006_case_023", "p03006_case_024", "p03006_case_025", "p03006_case_026", "p03006_case_027", "p03006_case_028", "p03006_case_029", "p03006_case_030", "p03006_case_031", "p03006_case_032", "p03006_case_033", "p03006_case_034", "p03006_case_035", "p03006_case_036", "p03006_case_037", "p03006_case_038", "p03006_case_039", "p03006_case_040", "p03006_case_041", "p03006_case_042", "p03006_case_043", "p03006_case_044", "p03006_case_045", "p03006_case_046", "p03006_case_047", "p03006_case_048", "p03006_case_049", "p03006_case_050", "p03006_case_051", "p03006_case_052", "p03006_case_053", "p03006_case_054", "p03006_case_055", "p03006_case_056", "p03006_case_057", "p03006_case_058", "p03006_case_059", "p03006_case_060", "p03006_case_061", "p03006_case_062", "p03006_case_063", "p03006_case_064", "p03006_case_065", "p03006_case_066", "p03006_case_067", "p03006_case_068", "p03006_case_069", "p03006_case_070", "p03006_case_071", "p03006_case_072", "p03006_case_073", "p03006_case_074", "p03006_case_075", "p03006_case_076", "p03006_case_077", "p03006_case_078", "p03006_case_079", "p03006_case_080", "p03006_case_081", "p03006_case_082", "p03006_case_083", "p03006_case_084", "p03006_case_085", "p03006_case_086", "p03006_case_087", "p03006_case_088", "p03006_case_089", "p03006_case_090", "p03006_case_091", "p03006_case_092", "p03006_case_093", "p03006_case_094", "p03006_case_095", "p03006_case_096", "p03006_case_097", "p03006_case_098", "p03006_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\narr = sorted([list(map(int, input().rstrip().split())) for _ in range(n)])\ncnt = {}\nfor i, j in arr:\n for k, l in arr:\n if (i, j) == (k, l):\n continue\n dif = (k - i, l - j)\n cnt.setdefault(dif, 0)\n cnt[dif] += 1\nprint((n - max(list(cnt.values()), default=0)))\n", "fast_code_sha256": "1796b3dd56792d24729b3767f68becf643f395739fe613fb028da3c5eba51573", "fast_id": "p03006_1796b3dd56792d24729b3767f68becf643f395739fe613fb028da3c5eba51573", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\narr = sorted([list(map(int, input().rstrip().split())) for _ in range(n)])\ncnt = {}\nfor i, j in arr:\n for k, l in arr:\n if (i, j) == (k, l):\n continue\n dif = (k - i, l - j)\n cnt.setdefault(dif, 0)\n cnt[dif] += 1\nprint((n - max(list(cnt.values()), default=0)))\n", "measured_fast_code_sha256": "1796b3dd56792d24729b3767f68becf643f395739fe613fb028da3c5eba51573", "measured_slow_code": "N = int(eval(input()))\nif N == 1:\n print((1))\n exit()\nxy = [tuple(int(e) for e in input().split()) for _ in range(N)]\nd_list = [(i[0] - j[0], i[1] - j[1]) for i in xy for j in xy if i != j]\nitems = list(set(d_list))\ns = 1\nfor item in items:\n c = d_list.count(item)\n if c > s:\n s = c\nprint((N - s))\n", "measured_slow_code_sha256": "7838a318c333827f3472e6350353ce8b4259224d69f85170d3cd9658a4f5e659", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.547369647964395, "pair_id": "python_v2_2171d62daffbaaf824d82134", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03006", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03006_1796b3dd56792d24729b3767f68becf643f395739fe613fb028da3c5eba51573.jsonl.gz", "inputs": "reproduction/python/inputs/p03006.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03006_7838a318c333827f3472e6350353ce8b4259224d69f85170d3cd9658a4f5e659.jsonl.gz"}, "slow_code": "N = int(eval(input()))\nif N == 1:\n print((1))\n exit()\nxy = [tuple(int(e) for e in input().split()) for _ in range(N)]\nd_list = [(i[0] - j[0], i[1] - j[1]) for i in xy for j in xy if i != j]\nitems = list(set(d_list))\ns = 1\nfor item in items:\n c = d_list.count(item)\n if c > s:\n s = c\nprint((N - s))\n", "slow_code_sha256": "7838a318c333827f3472e6350353ce8b4259224d69f85170d3cd9658a4f5e659", "slow_id": "p03006_7838a318c333827f3472e6350353ce8b4259224d69f85170d3cd9658a4f5e659", "speedup": 6.262499506555342, "stratum": "4-8", "within_pair_jaccard": 0.36585365853658536, "workload": {"case_count": 100, "description": "Collect N distinct plane points in any order, choosing one fixed nonzero integer displacement (p,q). A collection costs 0 if its point equals the previously collected point plus (p,q), otherwise 1, including the first. Minimize total cost. Observed inputs: N=1..50 (median 20); x_i=-999595444..998135854; y_i=-998893103..992792936.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1075, "median": 402.5, "min": 23}, "input_format": ["N\nx_1 y_1\n...\nx_N y_N"], "input_format_status": "source_input_section", "input_lines": {"max": 51, "median": 21.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 101, "median": 41.0, "min": 3}}} -{"case_ids": ["p03160_case_000", "p03160_case_001", "p03160_case_002", "p03160_case_003", "p03160_case_004", "p03160_case_005", "p03160_case_006", "p03160_case_007", "p03160_case_008", "p03160_case_009", "p03160_case_010", "p03160_case_011", "p03160_case_012", "p03160_case_013", "p03160_case_014", "p03160_case_015", "p03160_case_016", "p03160_case_017", "p03160_case_018", "p03160_case_019", "p03160_case_020", "p03160_case_021", "p03160_case_022", "p03160_case_023", "p03160_case_024", "p03160_case_025", "p03160_case_026", "p03160_case_027", "p03160_case_028", "p03160_case_029", "p03160_case_030", "p03160_case_031", "p03160_case_032", "p03160_case_033", "p03160_case_034", "p03160_case_035", "p03160_case_036", "p03160_case_037", "p03160_case_038", "p03160_case_039", "p03160_case_040", "p03160_case_041", "p03160_case_042", "p03160_case_043", "p03160_case_044", "p03160_case_045", "p03160_case_046", "p03160_case_047", "p03160_case_048", "p03160_case_049", "p03160_case_050", "p03160_case_051", "p03160_case_052", "p03160_case_053", "p03160_case_054", "p03160_case_055", "p03160_case_056", "p03160_case_057", "p03160_case_058", "p03160_case_059", "p03160_case_060", "p03160_case_061", "p03160_case_062", "p03160_case_063", "p03160_case_064", "p03160_case_065", "p03160_case_066", "p03160_case_067", "p03160_case_068", "p03160_case_069", "p03160_case_070", "p03160_case_071", "p03160_case_072", "p03160_case_073", "p03160_case_074", "p03160_case_075", "p03160_case_076", "p03160_case_077", "p03160_case_078", "p03160_case_079", "p03160_case_080", "p03160_case_081", "p03160_case_082", "p03160_case_083", "p03160_case_084", "p03160_case_085", "p03160_case_086", "p03160_case_087", "p03160_case_088", "p03160_case_089", "p03160_case_090", "p03160_case_091", "p03160_case_092", "p03160_case_093", "p03160_case_094", "p03160_case_095", "p03160_case_096", "p03160_case_097", "p03160_case_098", "p03160_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N = int(eval(input()))\n(*h,) = list(map(int, input().split()))\ndp = [0] * N\nfor i in range(1, N):\n if i == 1:\n dp[i] = dp[i - 1] + abs(h[i] - h[i - 1])\n else:\n dp[i] = min(dp[i - 1] + abs(h[i] - h[i - 1]), dp[i - 2] + abs(h[i] - h[i - 2]))\nprint((dp[-1]))\n", "fast_code_sha256": "b240597eddc90fc3b1c1a836a864a423cb9a000019e8b3849ff5349a39012a09", "fast_id": "p03160_b240597eddc90fc3b1c1a836a864a423cb9a000019e8b3849ff5349a39012a09", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N = int(eval(input()))\n(*h,) = list(map(int, input().split()))\ndp = [0] * N\nfor i in range(1, N):\n if i == 1:\n dp[i] = dp[i - 1] + abs(h[i] - h[i - 1])\n else:\n dp[i] = min(dp[i - 1] + abs(h[i] - h[i - 1]), dp[i - 2] + abs(h[i] - h[i - 2]))\nprint((dp[-1]))\n", "measured_fast_code_sha256": "b240597eddc90fc3b1c1a836a864a423cb9a000019e8b3849ff5349a39012a09", "measured_slow_code": "import numpy as np\n\nN = int(eval(input()))\nhs = [int(i) for i in input().split()]\ndp = np.zeros(N)\nfor i, h in enumerate(hs):\n if i == 0:\n # 0は初期化されている\n dp[i] = 0\n continue\n elif i == 1:\n # 1は1通りしか無い\n dp[i] = dp[i - 1] + abs(hs[i - 1] - h)\n else:\n # 1個前か2個前で、コストが最小になるやつ\n dp[i] = min(dp[i - 1] + abs(hs[i - 1] - h), dp[i - 2] + abs(hs[i - 2] - h))\n# print(dp)\nprint((int(dp[-1])))\n", "measured_slow_code_sha256": "934f379e0e5300fe0fee5440b2de9ab7f1cfdccbfbc9686e36dc49ab293c868e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 49.62173246311458, "pair_id": "python_v2_37a0af81a9f41e25b32610fa", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03160", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03160_b240597eddc90fc3b1c1a836a864a423cb9a000019e8b3849ff5349a39012a09.jsonl.gz", "inputs": "reproduction/python/inputs/p03160.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03160_934f379e0e5300fe0fee5440b2de9ab7f1cfdccbfbc9686e36dc49ab293c868e.jsonl.gz"}, "slow_code": "import numpy as np\n\nN = int(eval(input()))\nhs = [int(i) for i in input().split()]\ndp = np.zeros(N)\nfor i, h in enumerate(hs):\n if i == 0:\n\n dp[i] = 0\n continue\n elif i == 1:\n\n dp[i] = dp[i - 1] + abs(hs[i - 1] - h)\n else:\n\n dp[i] = min(dp[i - 1] + abs(hs[i - 1] - h), dp[i - 2] + abs(hs[i - 2] - h))\n\nprint((int(dp[-1])))\n", "slow_code_sha256": "3c2eb6d041b194aca6e618ed722e1b9ae4cb2dfbc9ca12487589612e2e637390", "slow_id": "p03160_934f379e0e5300fe0fee5440b2de9ab7f1cfdccbfbc9686e36dc49ab293c868e", "speedup": 52.57117358889363, "stratum": "8+", "within_pair_jaccard": 0.6, "workload": {"case_count": 100, "description": "A frog starts at stone 1 and jumps ahead by 1 or 2 stones. A jump from i to j costs |h_i-h_j|. Find the minimum total cost to reach stone N. Observed inputs: N=2..100000 (median 1000); h_i=1..10000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 600007, "median": 4888.5, "min": 6}, "input_format": ["N\nh_1 ... h_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100001, "median": 1001.0, "min": 3}}} -{"case_ids": ["p03476_case_000", "p03476_case_001", "p03476_case_002", "p03476_case_003", "p03476_case_004", "p03476_case_005", "p03476_case_006", "p03476_case_007", "p03476_case_008", "p03476_case_009", "p03476_case_010", "p03476_case_011", "p03476_case_012", "p03476_case_013", "p03476_case_014", "p03476_case_015", "p03476_case_016", "p03476_case_017", "p03476_case_018", "p03476_case_019", "p03476_case_020", "p03476_case_021", "p03476_case_022", "p03476_case_023", "p03476_case_024", "p03476_case_025", "p03476_case_026", "p03476_case_027", "p03476_case_028", "p03476_case_029", "p03476_case_030", "p03476_case_031", "p03476_case_032", "p03476_case_033", "p03476_case_034", "p03476_case_035", "p03476_case_036", "p03476_case_037", "p03476_case_038", "p03476_case_039", "p03476_case_040", "p03476_case_041", "p03476_case_042", "p03476_case_043", "p03476_case_044", "p03476_case_045", "p03476_case_046", "p03476_case_047", "p03476_case_048", "p03476_case_049", "p03476_case_050", "p03476_case_051", "p03476_case_052", "p03476_case_053", "p03476_case_054", "p03476_case_055", "p03476_case_056", "p03476_case_057", "p03476_case_058", "p03476_case_059", "p03476_case_060", "p03476_case_061", "p03476_case_062", "p03476_case_063", "p03476_case_064", "p03476_case_065", "p03476_case_066", "p03476_case_067", "p03476_case_068", "p03476_case_069", "p03476_case_070", "p03476_case_071", "p03476_case_072", "p03476_case_073", "p03476_case_074", "p03476_case_075", "p03476_case_076", "p03476_case_077", "p03476_case_078", "p03476_case_079", "p03476_case_080", "p03476_case_081", "p03476_case_082", "p03476_case_083", "p03476_case_084", "p03476_case_085", "p03476_case_086", "p03476_case_087", "p03476_case_088", "p03476_case_089", "p03476_case_090", "p03476_case_091", "p03476_case_092", "p03476_case_093", "p03476_case_094", "p03476_case_095", "p03476_case_096", "p03476_case_097", "p03476_case_098", "p03476_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from collections import defaultdict, deque, Counter\nfrom heapq import heappush, heappop, heapify\nimport math\nimport bisect\nimport random\nfrom itertools import permutations, accumulate, combinations, product\nimport sys\nimport string\nfrom bisect import bisect_left, bisect_right\nfrom math import factorial, ceil, floor, atan2, degrees\nfrom operator import mul\nfrom functools import reduce\n\nsys.setrecursionlimit(10**8)\nINF = float(\"inf\")\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LS():\n return sys.stdin.readline().split()\n\n\ndef S():\n return sys.stdin.readline().strip()\n\n\ndef IR(n):\n return [I() for i in range(n)]\n\n\ndef LIR(n):\n return [LI() for i in range(n)]\n\n\ndef SR(n):\n return [S() for i in range(n)]\n\n\ndef LSR(n):\n return [LS() for i in range(n)]\n\n\ndef SRL(n):\n return [list(S()) for i in range(n)]\n\n\ndef MSRL(n):\n return [[int(j) for j in list(S())] for i in range(n)]\n\n\nmod = 1000000007\n\n\ndef primes(n):\n is_prime = [1] * (n + 1)\n is_prime[0] = 0\n is_prime[1] = 0\n for i in range(2, int(n**0.5) + 1):\n if not is_prime[i]:\n continue\n for j in range(i * 2, n + 1, i):\n is_prime[j] = 0\n return {i for i in range(n + 1) if is_prime[i]}\n\n\nn = 10**5\nprime_set = primes(n)\nq = I()\nC = [0] * (n + 1)\nfor i in range(n + 1):\n if i % 2 and i in prime_set and (i + 1) // 2 in prime_set:\n C[i] = 1\nacc = list(accumulate(C))\nfor i in range(q):\n l, r = LI()\n print((acc[r] - acc[l - 1]))\n", "fast_code_sha256": "0a2b0f28368d69d7f9a7caf0583898b388fb838ab9df0d734d9469a89241116d", "fast_id": "p03476_0a2b0f28368d69d7f9a7caf0583898b388fb838ab9df0d734d9469a89241116d", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from collections import defaultdict, deque, Counter\nfrom heapq import heappush, heappop, heapify\nimport math\nimport bisect\nimport random\nfrom itertools import permutations, accumulate, combinations, product\nimport sys\nimport string\nfrom bisect import bisect_left, bisect_right\nfrom math import factorial, ceil, floor, atan2, degrees\nfrom operator import mul\nfrom functools import reduce\n\nsys.setrecursionlimit(10**8)\nINF = float(\"inf\")\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LS():\n return sys.stdin.readline().split()\n\n\ndef S():\n return sys.stdin.readline().strip()\n\n\ndef IR(n):\n return [I() for i in range(n)]\n\n\ndef LIR(n):\n return [LI() for i in range(n)]\n\n\ndef SR(n):\n return [S() for i in range(n)]\n\n\ndef LSR(n):\n return [LS() for i in range(n)]\n\n\ndef SRL(n):\n return [list(S()) for i in range(n)]\n\n\ndef MSRL(n):\n return [[int(j) for j in list(S())] for i in range(n)]\n\n\nmod = 1000000007\n\n\ndef primes(n):\n is_prime = [1] * (n + 1)\n is_prime[0] = 0\n is_prime[1] = 0\n for i in range(2, int(n**0.5) + 1):\n if not is_prime[i]:\n continue\n for j in range(i * 2, n + 1, i):\n is_prime[j] = 0\n return {i for i in range(n + 1) if is_prime[i]}\n\n\nn = 10**5\nprime_set = primes(n)\nq = I()\nC = [0] * (n + 1)\nfor i in range(n + 1):\n if i % 2 and i in prime_set and (i + 1) // 2 in prime_set:\n C[i] = 1\nacc = list(accumulate(C))\nfor i in range(q):\n l, r = LI()\n print((acc[r] - acc[l - 1]))\n", "measured_fast_code_sha256": "0a2b0f28368d69d7f9a7caf0583898b388fb838ab9df0d734d9469a89241116d", "measured_slow_code": "import numpy as np\n\nq = int(eval(input()))\n# 高速素数判定\nis_prime = np.ones(100001, dtype=int)\nis_prime[0] = 0\nis_prime[1] = 0\nfor i in range(2, 100001):\n if is_prime[i] == 1:\n j = i + i\n while j <= 100000:\n is_prime[j] = 0\n j += i\nlike2017 = [\n 1 if is_prime[i] and is_prime[(i + 1) // 2] else 0 for i in range(0, 100001)\n]\nfor i in range(1, 100001):\n like2017[i] += like2017[i - 1]\nfor i in range(q):\n l, r = list(map(int, input().split()))\n print((like2017[r] - like2017[l - 1]))\n", "measured_slow_code_sha256": "04049db677f468c331c809085fe1f71be865b70eea78240753e06ca4db53b055", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.6652378022277166, "pair_id": "python_v2_7be0fa6949acf5178c0b3620", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03476", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03476_0a2b0f28368d69d7f9a7caf0583898b388fb838ab9df0d734d9469a89241116d.jsonl.gz", "inputs": "reproduction/python/inputs/p03476.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03476_04049db677f468c331c809085fe1f71be865b70eea78240753e06ca4db53b055.jsonl.gz"}, "slow_code": "import numpy as np\n\nq = int(eval(input()))\n\nis_prime = np.ones(100001, dtype=int)\nis_prime[0] = 0\nis_prime[1] = 0\nfor i in range(2, 100001):\n if is_prime[i] == 1:\n j = i + i\n while j <= 100000:\n is_prime[j] = 0\n j += i\nlike2017 = [\n 1 if is_prime[i] and is_prime[(i + 1) // 2] else 0 for i in range(0, 100001)\n]\nfor i in range(1, 100001):\n like2017[i] += like2017[i - 1]\nfor i in range(q):\n l, r = list(map(int, input().split()))\n print((like2017[r] - like2017[l - 1]))\n", "slow_code_sha256": "b2179070bb2e08d4fd95b95ff67b71105cd4dc2d4e6e31ecedf0506d95c233c1", "slow_id": "p03476_04049db677f468c331c809085fe1f71be865b70eea78240753e06ca4db53b055", "speedup": 3.7983535872695082, "stratum": "2-4", "within_pair_jaccard": 0.21739130434782608, "workload": {"case_count": 100, "description": "For each inclusive odd-endpoint interval [l_i,r_i], count odd integers x for which both x and (x+1)/2 are prime. Process Q independent queries. Observed inputs: Q=1..100000 (median 25000); l_i=1..99999; r_i=1..99999.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1189051, "median": 294556.5, "min": 6}, "input_format": ["Q\nl_1 r_1\n...\nl_Q r_Q"], "input_format_status": "source_input_section", "input_lines": {"max": 100001, "median": 25001.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200001, "median": 50001.0, "min": 3}}} -{"case_ids": ["p03240_case_000", "p03240_case_001", "p03240_case_002", "p03240_case_003", "p03240_case_004", "p03240_case_005", "p03240_case_006", "p03240_case_007", "p03240_case_008", "p03240_case_009", "p03240_case_010", "p03240_case_011", "p03240_case_012", "p03240_case_013", "p03240_case_014", "p03240_case_015", "p03240_case_016", "p03240_case_017", "p03240_case_018", "p03240_case_019", "p03240_case_020", "p03240_case_021", "p03240_case_022", "p03240_case_023", "p03240_case_024", "p03240_case_025", "p03240_case_026", "p03240_case_027", "p03240_case_028", "p03240_case_029", "p03240_case_030", "p03240_case_031", "p03240_case_032", "p03240_case_033", "p03240_case_034", "p03240_case_035", "p03240_case_036", "p03240_case_037", "p03240_case_038", "p03240_case_039", "p03240_case_040", "p03240_case_041", "p03240_case_042", "p03240_case_043", "p03240_case_044", "p03240_case_045", "p03240_case_046", "p03240_case_047", "p03240_case_048", "p03240_case_049", "p03240_case_050", "p03240_case_051", "p03240_case_052", "p03240_case_053", "p03240_case_054", "p03240_case_055", "p03240_case_056", "p03240_case_057", "p03240_case_058", "p03240_case_059", "p03240_case_060", "p03240_case_061", "p03240_case_062", "p03240_case_063", "p03240_case_064", "p03240_case_065", "p03240_case_066", "p03240_case_067", "p03240_case_068", "p03240_case_069", "p03240_case_070", "p03240_case_071", "p03240_case_072", "p03240_case_073", "p03240_case_074", "p03240_case_075", "p03240_case_076", "p03240_case_077", "p03240_case_078", "p03240_case_079", "p03240_case_080", "p03240_case_081", "p03240_case_082", "p03240_case_083", "p03240_case_084", "p03240_case_085", "p03240_case_086", "p03240_case_087", "p03240_case_088", "p03240_case_089", "p03240_case_090", "p03240_case_091", "p03240_case_092", "p03240_case_093", "p03240_case_094", "p03240_case_095", "p03240_case_096", "p03240_case_097", "p03240_case_098", "p03240_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "executable_AST_equal_except_explicit_explanatory_string_removal_and_all_frozen_inputs_checker_pass", "fast_code": "N = int(eval(input()))\n\n\ndef city_dist(x1, y1, x2, y2):\n return abs(x1 - x2) + abs(y1 - y2)\n\n\ndef height(x1, y1, cx, cy, H):\n return max(H - city_dist(x1, y1, cx, cy), 0)\n\n\nx = []\ny = []\nh = []\nnon_zero_index = -1\nfor i in range(N):\n line = [int(a) for a in input().split()]\n x.append(line[0])\n y.append(line[1])\n h.append(line[2])\n if line[2] != 0:\n non_zero_index = i\nfor cx in range(101):\n for cy in range(101):\n H = h[non_zero_index] + city_dist(x[non_zero_index], y[non_zero_index], cx, cy)\n answer = True\n for i in range(N):\n\n if h[i] != height(x[i], y[i], cx, cy, H):\n answer = False\n break\n if answer:\n print((\"{} {} {}\".format(cx, cy, H)))\n break\n if answer:\n break\n", "fast_code_sha256": "d5ba6f06a73df89d257acabb48d927c58a6f0a0239bbeeb139fcb8469201dfce", "fast_id": "p03240_7086c6b25b6454d2c4f20fbd1ec72d8075d08f206bb2d06933fa14a96670b942", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N = int(eval(input()))\n# def height(x, y, h, cx, cz):\ndef city_dist(x1, y1, x2, y2):\n return abs(x1 - x2) + abs(y1 - y2)\n\n\ndef height(x1, y1, cx, cy, H):\n return max(H - city_dist(x1, y1, cx, cy), 0)\n\n\nx = []\ny = []\nh = []\nnon_zero_index = -1\nfor i in range(N):\n line = [int(a) for a in input().split()]\n x.append(line[0])\n y.append(line[1])\n h.append(line[2])\n if line[2] != 0:\n non_zero_index = i\nfor cx in range(101):\n for cy in range(101):\n H = h[non_zero_index] + city_dist(x[non_zero_index], y[non_zero_index], cx, cy)\n answer = True\n for i in range(N):\n # print(cx, cy, H, i, x[i], y[i], h[i], height(x[i], y[i], cx, cy, H))\n if h[i] != height(x[i], y[i], cx, cy, H):\n answer = False\n break\n if answer:\n print((\"{} {} {}\".format(cx, cy, H)))\n break\n if answer:\n break\n", "measured_fast_code_sha256": "7086c6b25b6454d2c4f20fbd1ec72d8075d08f206bb2d06933fa14a96670b942", "measured_slow_code": "import numpy as np\n\nN = int(eval(input()))\nx, y, h = np.array([list(map(int, input().split())) for i in range(N)]).T\n\"\"\"\nx = [0 for i in range(N)]\ny = [0 for i in range(N)]\nh = [0 for i in range(N)]\nfor i in range(N):\n x[i], y[i], h[i] = map(int, input().split())\n\"\"\"\nH = 0\nCx = 0\nCy = 0\nFlag = True\nfor i in range(101):\n for j in range(101):\n Flag = True\n for k in range(N):\n if h[k] != 0:\n H = h[k] + abs(i - x[k]) + abs(j - y[k])\n break\n for k in range(N):\n if h[k] != max(H - abs(i - x[k]) - abs(j - y[k]), 0):\n Flag = False\n break\n if Flag:\n Cx, Cy = i, j\n break\n if Flag:\n break\nprint((\"{} {} {}\".format(Cx, Cy, H)))\n", "measured_slow_code_sha256": "7335b8f814fadff817ea3d797eb47069b6471e295b0639a1a649c1b8aea437e5", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 10.094873340178694, "pair_id": "python_v2_59e42a1fb76544eacb223650", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03240", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03240_7086c6b25b6454d2c4f20fbd1ec72d8075d08f206bb2d06933fa14a96670b942.jsonl.gz", "inputs": "reproduction/python/inputs/p03240.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03240_7335b8f814fadff817ea3d797eb47069b6471e295b0639a1a649c1b8aea437e5.jsonl.gz"}, "slow_code": "import numpy as np\n\nN = int(eval(input()))\nx, y, h = np.array([list(map(int, input().split())) for i in range(N)]).T\nH = 0\nCx = 0\nCy = 0\nFlag = True\nfor i in range(101):\n for j in range(101):\n Flag = True\n for k in range(N):\n if h[k] != 0:\n H = h[k] + abs(i - x[k]) + abs(j - y[k])\n break\n for k in range(N):\n if h[k] != max(H - abs(i - x[k]) - abs(j - y[k]), 0):\n Flag = False\n break\n if Flag:\n Cx, Cy = i, j\n break\n if Flag:\n break\nprint((\"{} {} {}\".format(Cx, Cy, H)))\n", "slow_code_sha256": "2b73a8d0ed51a5904d37fa90f680662d0779f1a36233aa1fe89473f78eb7c3e5", "slow_id": "p03240_7335b8f814fadff817ea3d797eb47069b6471e295b0639a1a649c1b8aea437e5", "speedup": 12.21575340186815, "stratum": "8+", "within_pair_jaccard": 0.4339622641509434, "workload": {"case_count": 100, "description": "Recover unique integer center (C_X,C_Y) in 0..100 and height H>=1 from N distinct observations (x_i,y_i,h_i) satisfying h_i=max(H-|x_i-C_X|-|y_i-C_Y|,0). Observed inputs: N=3..100 (median 50); x_i=0..100; y_i=0..100; h_i=1299707..999999997.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1594, "median": 798.0, "min": 49}, "input_format": ["N\nx_1 y_1 h_1\n...\nx_N y_N h_N"], "input_format_status": "source_input_section", "input_lines": {"max": 101, "median": 51.0, "min": 4}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 301, "median": 151.0, "min": 10}}} -{"case_ids": ["p03077_case_000", "p03077_case_001", "p03077_case_002", "p03077_case_003", "p03077_case_004", "p03077_case_005", "p03077_case_006", "p03077_case_007", "p03077_case_008", "p03077_case_009", "p03077_case_010", "p03077_case_011", "p03077_case_012", "p03077_case_013", "p03077_case_014", "p03077_case_015", "p03077_case_016", "p03077_case_017", "p03077_case_018", "p03077_case_019", "p03077_case_020", "p03077_case_021", "p03077_case_022", "p03077_case_023", "p03077_case_024", "p03077_case_025", "p03077_case_026", "p03077_case_027", "p03077_case_028", "p03077_case_029", "p03077_case_030", "p03077_case_031", "p03077_case_032", "p03077_case_033", "p03077_case_034", "p03077_case_035", "p03077_case_036", "p03077_case_037", "p03077_case_038", "p03077_case_039", "p03077_case_040", "p03077_case_041", "p03077_case_042", "p03077_case_043", "p03077_case_044", "p03077_case_045", "p03077_case_046", "p03077_case_047", "p03077_case_048", "p03077_case_049", "p03077_case_050", "p03077_case_051", "p03077_case_052", "p03077_case_053", "p03077_case_054", "p03077_case_055", "p03077_case_056", "p03077_case_057", "p03077_case_058", "p03077_case_059", "p03077_case_060", "p03077_case_061", "p03077_case_062", "p03077_case_063", "p03077_case_064", "p03077_case_065", "p03077_case_066", "p03077_case_067", "p03077_case_068", "p03077_case_069", "p03077_case_070", "p03077_case_071", "p03077_case_072", "p03077_case_073", "p03077_case_074", "p03077_case_075", "p03077_case_076", "p03077_case_077", "p03077_case_078", "p03077_case_079", "p03077_case_080", "p03077_case_081", "p03077_case_082", "p03077_case_083", "p03077_case_084", "p03077_case_085", "p03077_case_086", "p03077_case_087", "p03077_case_088", "p03077_case_089", "p03077_case_090", "p03077_case_091", "p03077_case_092", "p03077_case_093", "p03077_case_094", "p03077_case_095", "p03077_case_096", "p03077_case_097", "p03077_case_098", "p03077_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from math import ceil\n\nN = int(eval(input()))\nA = int(eval(input()))\nB = int(eval(input()))\nC = int(eval(input()))\nD = int(eval(input()))\nE = int(eval(input()))\nL = [A, B, C, D, E]\nm = min(L)\nprint((4 + ceil(N / m)))\n", "fast_code_sha256": "0321a53369ffe9686f7239df9a6681837256360940a4fa46452119b06d7236d3", "fast_id": "p03077_0321a53369ffe9686f7239df9a6681837256360940a4fa46452119b06d7236d3", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from math import ceil\n\nN = int(eval(input()))\nA = int(eval(input()))\nB = int(eval(input()))\nC = int(eval(input()))\nD = int(eval(input()))\nE = int(eval(input()))\nL = [A, B, C, D, E]\nm = min(L)\nprint((4 + ceil(N / m)))\n", "measured_fast_code_sha256": "0321a53369ffe9686f7239df9a6681837256360940a4fa46452119b06d7236d3", "measured_slow_code": "# -*- coding: utf-8 -*-\nimport sys\nimport numpy as np\n\n\ndef get_num():\n return int(eval(input()))\n\n\ndef get_nums(n):\n res = [0 for _ in range(n)]\n for i in range(n):\n res[i] = int(eval(input()))\n return res\n\n\ndef get_numbers():\n return list(map(int, input().split()))\n\n\nn = get_num()\ncosts = get_nums(5)\nmax_time = 0\nfor cost in costs:\n max_time = max(max_time, int(np.ceil(n / cost)))\nprint((max_time + 4))\n", "measured_slow_code_sha256": "34caf7325f4819bd719f1f977d4c7833f1b8eae1073783274c70d879e08aa59a", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 620.5367055947404, "pair_id": "python_v2_2fab52b07951281ae77d51cb", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03077", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03077_0321a53369ffe9686f7239df9a6681837256360940a4fa46452119b06d7236d3.jsonl.gz", "inputs": "reproduction/python/inputs/p03077.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03077_34caf7325f4819bd719f1f977d4c7833f1b8eae1073783274c70d879e08aa59a.jsonl.gz"}, "slow_code": "import sys\nimport numpy as np\n\n\ndef get_num():\n return int(eval(input()))\n\n\ndef get_nums(n):\n res = [0 for _ in range(n)]\n for i in range(n):\n res[i] = int(eval(input()))\n return res\n\n\ndef get_numbers():\n return list(map(int, input().split()))\n\n\nn = get_num()\ncosts = get_nums(5)\nmax_time = 0\nfor cost in costs:\n max_time = max(max_time, int(np.ceil(n / cost)))\nprint((max_time + 4))\n", "slow_code_sha256": "ab58e9cb16ab933309b0c60e055e71406d283b0d16126adf763de4e9caa5d6fb", "slow_id": "p03077_34caf7325f4819bd719f1f977d4c7833f1b8eae1073783274c70d879e08aa59a", "speedup": 621.3058097451521, "stratum": "8+", "within_pair_jaccard": 0.16279069767441862, "workload": {"case_count": 100, "description": "Move N people through five successive transport links with capacities A,B,C,D,E. Each link takes one minute and dispatches one vehicle at every integer time starting at 0; transfers take no time. Find when everyone can arrive. Observed inputs: N=1..1000000000000000; capacities=1..1000000000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 102, "median": 82.0, "min": 12}, "input_format": ["N\nA\nB\nC\nD\nE"], "input_format_status": "source_input_section", "input_lines": {"max": 6, "median": 6.0, "min": 6}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 6, "median": 6.0, "min": 6}}} -{"case_ids": ["p03713_case_000", "p03713_case_001", "p03713_case_002", "p03713_case_003", "p03713_case_004", "p03713_case_005", "p03713_case_006", "p03713_case_007", "p03713_case_008", "p03713_case_009", "p03713_case_010", "p03713_case_011", "p03713_case_012", "p03713_case_013", "p03713_case_014", "p03713_case_015", "p03713_case_016", "p03713_case_017", "p03713_case_018", "p03713_case_019", "p03713_case_020", "p03713_case_021", "p03713_case_022", "p03713_case_023", "p03713_case_024", "p03713_case_025", "p03713_case_026", "p03713_case_027", "p03713_case_028", "p03713_case_029", "p03713_case_030", "p03713_case_031", "p03713_case_032", "p03713_case_033", "p03713_case_034", "p03713_case_035", "p03713_case_036", "p03713_case_037", "p03713_case_038", "p03713_case_039", "p03713_case_040", "p03713_case_041", "p03713_case_042", "p03713_case_043", "p03713_case_044", "p03713_case_045", "p03713_case_046", "p03713_case_047", "p03713_case_048", "p03713_case_049", "p03713_case_050", "p03713_case_051", "p03713_case_052", "p03713_case_053", "p03713_case_054", "p03713_case_055", "p03713_case_056", "p03713_case_057", "p03713_case_058", "p03713_case_059", "p03713_case_060", "p03713_case_061", "p03713_case_062", "p03713_case_063", "p03713_case_064", "p03713_case_065", "p03713_case_066", "p03713_case_067", "p03713_case_068", "p03713_case_069", "p03713_case_070", "p03713_case_071", "p03713_case_072", "p03713_case_073", "p03713_case_074", "p03713_case_075", "p03713_case_076", "p03713_case_077", "p03713_case_078", "p03713_case_079", "p03713_case_080", "p03713_case_081", "p03713_case_082", "p03713_case_083", "p03713_case_084", "p03713_case_085", "p03713_case_086", "p03713_case_087", "p03713_case_088", "p03713_case_089", "p03713_case_090", "p03713_case_091", "p03713_case_092", "p03713_case_093", "p03713_case_094", "p03713_case_095", "p03713_case_096", "p03713_case_097", "p03713_case_098", "p03713_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "h, w = list(map(int, input().split()))\nif h % 3 == 0 or w % 3 == 0:\n print((0))\nelse:\n a = (h // 3 + 1) * w - (h - 1 - h // 3) * (w // 2)\n b = (h - h // 3) * (w - w // 2) - h // 3 * w\n c = min(h, w)\n h, w = w, h\n d = (h // 3 + 1) * w - (h - 1 - h // 3) * (w // 2)\n e = (h - h // 3) * (w - w // 2) - h // 3 * w\n print((min(a, b, c, d, e)))\n", "fast_code_sha256": "5330746bf5083da4425395b0af3721b5134d290d8ab456ea3489eeb7c223264d", "fast_id": "p03713_5330746bf5083da4425395b0af3721b5134d290d8ab456ea3489eeb7c223264d", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "h, w = list(map(int, input().split()))\nif h % 3 == 0 or w % 3 == 0:\n print((0))\nelse:\n a = (h // 3 + 1) * w - (h - 1 - h // 3) * (w // 2)\n b = (h - h // 3) * (w - w // 2) - h // 3 * w\n c = min(h, w)\n h, w = w, h\n d = (h // 3 + 1) * w - (h - 1 - h // 3) * (w // 2)\n e = (h - h // 3) * (w - w // 2) - h // 3 * w\n print((min(a, b, c, d, e)))\n", "measured_fast_code_sha256": "5330746bf5083da4425395b0af3721b5134d290d8ab456ea3489eeb7c223264d", "measured_slow_code": "def min_value(w, h):\n ans = float(\"inf\")\n for i in range(1, h):\n a = w * i\n v_t = (h - i) // 2 * w\n v_b = (h - i) * w - v_t\n v_re = max(a, v_t, v_b) - min(a, v_t, v_b)\n h_l = (h - i) * (w // 2)\n h_r = (h - i) * w - h_l\n h_re = max(a, h_l, h_r) - min(a, h_l, h_r)\n ans = min(ans, v_re, h_re)\n return ans\n\n\ndef resolve():\n h, w = list(map(int, input().split()))\n a = min_value(w, h)\n b = min_value(h, w)\n print((min(a, b)))\n\n\nresolve()\n", "measured_slow_code_sha256": "486c400a4361520abbeb93fc3ee51b4996c6be1073529f0538f4921c991bd1de", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1574.0723702384457, "pair_id": "python_v2_08f5caa0530acc9eb32c1422", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03713", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03713_5330746bf5083da4425395b0af3721b5134d290d8ab456ea3489eeb7c223264d.jsonl.gz", "inputs": "reproduction/python/inputs/p03713.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03713_486c400a4361520abbeb93fc3ee51b4996c6be1073529f0538f4921c991bd1de.jsonl.gz"}, "slow_code": "def min_value(w, h):\n ans = float(\"inf\")\n for i in range(1, h):\n a = w * i\n v_t = (h - i) // 2 * w\n v_b = (h - i) * w - v_t\n v_re = max(a, v_t, v_b) - min(a, v_t, v_b)\n h_l = (h - i) * (w // 2)\n h_r = (h - i) * w - h_l\n h_re = max(a, h_l, h_r) - min(a, h_l, h_r)\n ans = min(ans, v_re, h_re)\n return ans\n\n\ndef resolve():\n h, w = list(map(int, input().split()))\n a = min_value(w, h)\n b = min_value(h, w)\n print((min(a, b)))\n\n\nresolve()\n", "slow_code_sha256": "486c400a4361520abbeb93fc3ee51b4996c6be1073529f0538f4921c991bd1de", "slow_id": "p03713_486c400a4361520abbeb93fc3ee51b4996c6be1073529f0538f4921c991bd1de", "speedup": 848.4628839949457, "stratum": "8+", "within_pair_jaccard": 0.2894736842105263, "workload": {"case_count": 100, "description": "Divide an H-by-W grid-aligned rectangular bar into exactly three nonempty rectangular pieces along cell borders. Minimize the difference between the largest and smallest areas. The bar is implicit, not listed cell by cell. Observed inputs: H=2..100000 (median 54760.5); W=2..100000 (median 40128.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 14, "median": 11.5, "min": 4}, "input_format": ["H W"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p03774_case_000", "p03774_case_001", "p03774_case_002", "p03774_case_003", "p03774_case_004", "p03774_case_005", "p03774_case_006", "p03774_case_007", "p03774_case_008", "p03774_case_009", "p03774_case_010", "p03774_case_011", "p03774_case_012", "p03774_case_013", "p03774_case_014", "p03774_case_015", "p03774_case_016", "p03774_case_017", "p03774_case_018", "p03774_case_019", "p03774_case_020", "p03774_case_021", "p03774_case_022", "p03774_case_023", "p03774_case_024", "p03774_case_025", "p03774_case_026", "p03774_case_027", "p03774_case_028", "p03774_case_029", "p03774_case_030", "p03774_case_031", "p03774_case_032", "p03774_case_033", "p03774_case_034", "p03774_case_035", "p03774_case_036", "p03774_case_037", "p03774_case_038", "p03774_case_039", "p03774_case_040", "p03774_case_041", "p03774_case_042", "p03774_case_043", "p03774_case_044", "p03774_case_045", "p03774_case_046", "p03774_case_047", "p03774_case_048", "p03774_case_049", "p03774_case_050", "p03774_case_051", "p03774_case_052", "p03774_case_053", "p03774_case_054", "p03774_case_055", "p03774_case_056", "p03774_case_057", "p03774_case_058", "p03774_case_059", "p03774_case_060", "p03774_case_061", "p03774_case_062", "p03774_case_063", "p03774_case_064", "p03774_case_065", "p03774_case_066", "p03774_case_067", "p03774_case_068", "p03774_case_069", "p03774_case_070", "p03774_case_071", "p03774_case_072", "p03774_case_073", "p03774_case_074", "p03774_case_075", "p03774_case_076", "p03774_case_077", "p03774_case_078", "p03774_case_079", "p03774_case_080", "p03774_case_081", "p03774_case_082", "p03774_case_083", "p03774_case_084", "p03774_case_085", "p03774_case_086", "p03774_case_087", "p03774_case_088", "p03774_case_089", "p03774_case_090", "p03774_case_091", "p03774_case_092", "p03774_case_093", "p03774_case_094", "p03774_case_095", "p03774_case_096", "p03774_case_097", "p03774_case_098", "p03774_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n, m = list(map(int, input().split()))\nab = [list(map(int, input().split())) for _ in range(n)]\ncd = [list(map(int, input().split())) for _ in range(m)]\nfor i in range(n):\n s = 0\n t = float(\"inf\")\n for j in range(m):\n p = abs(ab[i][0] - cd[j][0]) + abs(ab[i][1] - cd[j][1])\n if p < t:\n s = j + 1\n t = p\n print(s)\n", "fast_code_sha256": "fb84a22e95d451c0bdf495f056a7ae120b5eff63ca18b6c3e73cb9397286a4e8", "fast_id": "p03774_fb84a22e95d451c0bdf495f056a7ae120b5eff63ca18b6c3e73cb9397286a4e8", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n, m = list(map(int, input().split()))\nab = [list(map(int, input().split())) for _ in range(n)]\ncd = [list(map(int, input().split())) for _ in range(m)]\nfor i in range(n):\n s = 0\n t = float(\"inf\")\n for j in range(m):\n p = abs(ab[i][0] - cd[j][0]) + abs(ab[i][1] - cd[j][1])\n if p < t:\n s = j + 1\n t = p\n print(s)\n", "measured_fast_code_sha256": "fb84a22e95d451c0bdf495f056a7ae120b5eff63ca18b6c3e73cb9397286a4e8", "measured_slow_code": "import numpy as np\n\nN, M = list(map(int, input().split()))\nab = []\nfor i in range(N):\n tmp = list(map(int, input().split()))\n ab.append(tmp)\nab = np.array(ab)\ndist = np.full([N, M], np.inf)\nfor m in range(M):\n tmp = np.array(list(map(int, input().split())))\n for n in range(N):\n dist[n, m] = np.abs(ab[n] - tmp).sum()\ndist = dist.astype(\"int\")\nfor d in dist:\n print((d.argmin() + 1))\n", "measured_slow_code_sha256": "4ab93e91c9006f8793ec4a581894d15fcba322003404950855ee770b9ed45cb3", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 254.48945788815595, "pair_id": "python_v2_fc3c09e7f7254f3320485dd6", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03774", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03774_fb84a22e95d451c0bdf495f056a7ae120b5eff63ca18b6c3e73cb9397286a4e8.jsonl.gz", "inputs": "reproduction/python/inputs/p03774.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03774_4ab93e91c9006f8793ec4a581894d15fcba322003404950855ee770b9ed45cb3.jsonl.gz"}, "slow_code": "import numpy as np\n\nN, M = list(map(int, input().split()))\nab = []\nfor i in range(N):\n tmp = list(map(int, input().split()))\n ab.append(tmp)\nab = np.array(ab)\ndist = np.full([N, M], np.inf)\nfor m in range(M):\n tmp = np.array(list(map(int, input().split())))\n for n in range(N):\n dist[n, m] = np.abs(ab[n] - tmp).sum()\ndist = dist.astype(\"int\")\nfor d in dist:\n print((d.argmin() + 1))\n", "slow_code_sha256": "4ab93e91c9006f8793ec4a581894d15fcba322003404950855ee770b9ed45cb3", "slow_id": "p03774_4ab93e91c9006f8793ec4a581894d15fcba322003404950855ee770b9ed45cb3", "speedup": 175.0166313884244, "stratum": "8+", "within_pair_jaccard": 0.4, "workload": {"case_count": 100, "description": "For each student (a_i,b_i), output the 1-based index of the nearest checkpoint (c_j,d_j) by Manhattan distance. Break ties by the smallest checkpoint index; repeated coordinates are allowed. Observed inputs: N=1..50 (median 16); M=1..50 (median 10); a_i=-100000000..100000000; b_i=-100000000..100000000; c_j=-100000000..100000000; d_j=-100000000..100000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 2106, "median": 458.5, "min": 12}, "input_format": ["N M\na_1 b_1\n...\na_N b_N\nc_1 d_1\n...\nc_M d_M"], "input_format_status": "source_input_section", "input_lines": {"max": 101, "median": 33.5, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 202, "median": 67.0, "min": 6}}} -{"case_ids": ["p02675_case_000", "p02675_case_001", "p02675_case_002", "p02675_case_003", "p02675_case_004", "p02675_case_005", "p02675_case_006", "p02675_case_007", "p02675_case_008", "p02675_case_009", "p02675_case_010", "p02675_case_011", "p02675_case_012", "p02675_case_013", "p02675_case_014", "p02675_case_015", "p02675_case_016", "p02675_case_017", "p02675_case_018", "p02675_case_019", "p02675_case_020", "p02675_case_021", "p02675_case_022", "p02675_case_023", "p02675_case_024", "p02675_case_025", "p02675_case_026", "p02675_case_027", "p02675_case_028", "p02675_case_029", "p02675_case_030", "p02675_case_031", "p02675_case_032", "p02675_case_033", "p02675_case_034", "p02675_case_035", "p02675_case_036", "p02675_case_037", "p02675_case_038", "p02675_case_039", "p02675_case_040", "p02675_case_041", "p02675_case_042", "p02675_case_043", "p02675_case_044", "p02675_case_045", "p02675_case_046", "p02675_case_047", "p02675_case_048", "p02675_case_049", "p02675_case_050", "p02675_case_051", "p02675_case_052", "p02675_case_053", "p02675_case_054", "p02675_case_055", "p02675_case_056", "p02675_case_057", "p02675_case_058", "p02675_case_059", "p02675_case_060", "p02675_case_061", "p02675_case_062", "p02675_case_063", "p02675_case_064", "p02675_case_065", "p02675_case_066", "p02675_case_067", "p02675_case_068", "p02675_case_069", "p02675_case_070", "p02675_case_071", "p02675_case_072", "p02675_case_073", "p02675_case_074", "p02675_case_075", "p02675_case_076", "p02675_case_077", "p02675_case_078", "p02675_case_079", "p02675_case_080", "p02675_case_081", "p02675_case_082", "p02675_case_083", "p02675_case_084", "p02675_case_085", "p02675_case_086", "p02675_case_087", "p02675_case_088", "p02675_case_089", "p02675_case_090", "p02675_case_091", "p02675_case_092", "p02675_case_093", "p02675_case_094", "p02675_case_095", "p02675_case_096", "p02675_case_097", "p02675_case_098", "p02675_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\na = n % 10\nif a == 3:\n print(\"bon\")\nelif a == 0 or a == 1 or a == 6 or a == 8:\n print(\"pon\")\nelse:\n print(\"hon\")\n", "fast_code_sha256": "f9f64d2f044687a8ad37511c5997b4a69ea1ddcad543c0d3e43857539ebdeb82", "fast_id": "p02675_f9f64d2f044687a8ad37511c5997b4a69ea1ddcad543c0d3e43857539ebdeb82", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\na = n % 10\nif a == 3:\n print(\"bon\")\nelif a == 0 or a == 1 or a == 6 or a == 8:\n print(\"pon\")\nelse:\n print(\"hon\")\n", "measured_fast_code_sha256": "f9f64d2f044687a8ad37511c5997b4a69ea1ddcad543c0d3e43857539ebdeb82", "measured_slow_code": "# coding: utf-8\nimport sys\nimport math\nimport collections\nimport itertools\nimport bisect\n\nINF = 10**13\nMOD = 10**9 + 7\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef gcd(x, y):\n return x if y == 0 else gcd(y, x % y)\n\n\ndef lcm(x, y):\n return (x * y) // gcd(x, y)\n\n\ndef I():\n return int(input())\n\n\ndef LI():\n return [int(x) for x in input().split()]\n\n\ndef RI(N):\n return [int(input()) for _ in range(N)]\n\n\ndef LRI(N):\n return [[int(x) for x in input().split()] for _ in range(N)]\n\n\ndef LS():\n return input().split()\n\n\ndef RS(N):\n return [input() for _ in range(N)]\n\n\ndef LRS(N):\n return [input().split() for _ in range(N)]\n\n\ndef PL(L):\n print(*L, sep=\"\\n\")\n\n\ndef YesNo(B):\n print(\"Yes\" if B else \"No\")\n\n\ndef YESNO(B):\n print(\"YES\" if B else \"NO\")\n\n\nN = input()\nn = int(N[-1])\nif n in [2, 4, 5, 7, 9]:\n print(\"hon\")\nelif n in [0, 1, 6, 8]:\n print(\"pon\")\nelse:\n print(\"bon\")\n", "measured_slow_code_sha256": "2d3c735c213ec81bc8c26091e19ebd8461e366cff4fed305d8b06c8c2e49be9d", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 5.785243765917247, "pair_id": "python_v2_b604aa1efdc87e6f42207406", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02675", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02675_f9f64d2f044687a8ad37511c5997b4a69ea1ddcad543c0d3e43857539ebdeb82.jsonl.gz", "inputs": "reproduction/python/inputs/p02675.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02675_2d3c735c213ec81bc8c26091e19ebd8461e366cff4fed305d8b06c8c2e49be9d.jsonl.gz"}, "slow_code": "import sys\nimport math\nimport collections\nimport itertools\nimport bisect\n\nINF = 10**13\nMOD = 10**9 + 7\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef gcd(x, y):\n return x if y == 0 else gcd(y, x % y)\n\n\ndef lcm(x, y):\n return (x * y) // gcd(x, y)\n\n\ndef I():\n return int(input())\n\n\ndef LI():\n return [int(x) for x in input().split()]\n\n\ndef RI(N):\n return [int(input()) for _ in range(N)]\n\n\ndef LRI(N):\n return [[int(x) for x in input().split()] for _ in range(N)]\n\n\ndef LS():\n return input().split()\n\n\ndef RS(N):\n return [input() for _ in range(N)]\n\n\ndef LRS(N):\n return [input().split() for _ in range(N)]\n\n\ndef PL(L):\n print(*L, sep=\"\\n\")\n\n\ndef YesNo(B):\n print(\"Yes\" if B else \"No\")\n\n\ndef YESNO(B):\n print(\"YES\" if B else \"NO\")\n\n\nN = input()\nn = int(N[-1])\nif n in [2, 4, 5, 7, 9]:\n print(\"hon\")\nelif n in [0, 1, 6, 8]:\n print(\"pon\")\nelse:\n print(\"bon\")\n", "slow_code_sha256": "da5a21f4ebfb4d44ad88c7f5db5f559a60e0742e11d07068514eea6e5e1d7a49", "slow_id": "p02675_2d3c735c213ec81bc8c26091e19ebd8461e366cff4fed305d8b06c8c2e49be9d", "speedup": 5.789079415601124, "stratum": "4-8", "within_pair_jaccard": 0.23076923076923078, "workload": {"case_count": 100, "description": "Output a counter pronunciation determined by the last decimal digit of N: hon for 2,4,5,7,9; pon for 0,1,6,8; bon for 3. Observed inputs: N=1..999 (median 404).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 4, "median": 4.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p02695_case_000", "p02695_case_001", "p02695_case_002", "p02695_case_003", "p02695_case_004", "p02695_case_005", "p02695_case_006", "p02695_case_007", "p02695_case_008", "p02695_case_009", "p02695_case_010", "p02695_case_011", "p02695_case_012", "p02695_case_013", "p02695_case_014", "p02695_case_015", "p02695_case_016", "p02695_case_017", "p02695_case_018", "p02695_case_019", "p02695_case_020", "p02695_case_021", "p02695_case_022", "p02695_case_023", "p02695_case_024", "p02695_case_025", "p02695_case_026", "p02695_case_027", "p02695_case_028", "p02695_case_029", "p02695_case_030", "p02695_case_031", "p02695_case_032", "p02695_case_033", "p02695_case_034", "p02695_case_035", "p02695_case_036", "p02695_case_037", "p02695_case_038", "p02695_case_039", "p02695_case_040", "p02695_case_041", "p02695_case_042", "p02695_case_043", "p02695_case_044", "p02695_case_045", "p02695_case_046", "p02695_case_047", "p02695_case_048", "p02695_case_049", "p02695_case_050", "p02695_case_051", "p02695_case_052", "p02695_case_053", "p02695_case_054", "p02695_case_055", "p02695_case_056", "p02695_case_057", "p02695_case_058", "p02695_case_059", "p02695_case_060", "p02695_case_061", "p02695_case_062", "p02695_case_063", "p02695_case_064", "p02695_case_065", "p02695_case_066", "p02695_case_067", "p02695_case_068", "p02695_case_069", "p02695_case_070", "p02695_case_071", "p02695_case_072", "p02695_case_073", "p02695_case_074", "p02695_case_075", "p02695_case_076", "p02695_case_077", "p02695_case_078", "p02695_case_079", "p02695_case_080", "p02695_case_081", "p02695_case_082", "p02695_case_083", "p02695_case_084", "p02695_case_085", "p02695_case_086", "p02695_case_087", "p02695_case_088", "p02695_case_089", "p02695_case_090", "p02695_case_091", "p02695_case_092", "p02695_case_093", "p02695_case_094", "p02695_case_095", "p02695_case_096", "p02695_case_097", "p02695_case_098", "p02695_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import itertools\n\nn, m, q = list(map(int, input().split()))\nquery = [list(map(int, input().split())) for _ in range(q)]\nls = list(range(n + m - 1))\nmx = 0\nfor l in itertools.combinations(ls, m - 1):\n a = [0]\n idx = 0\n val = 1\n for i in range(n + m - 1):\n if idx < m - 1 and i == l[idx]:\n val += 1\n idx += 1\n else:\n a.append(val)\n\n v = 0\n for i in query:\n if a[i[1]] - a[i[0]] == i[2]:\n v += i[3]\n mx = max(v, mx)\nprint(mx)\n", "fast_code_sha256": "0637e9cabdd49c81a34a43aebbe50e41762ac5fce82506e688f107a19229a3c8", "fast_id": "p02695_c7d16eeae23302c0174cc6c3a63e28d624b3c7d6b74e2673b522212c488d195a", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import itertools\n\nn, m, q = list(map(int, input().split()))\nquery = [list(map(int, input().split())) for _ in range(q)]\nls = list(range(n + m - 1))\nmx = 0\nfor l in itertools.combinations(ls, m - 1):\n a = [0]\n idx = 0\n val = 1\n for i in range(n + m - 1):\n if idx < m - 1 and i == l[idx]:\n val += 1\n idx += 1\n else:\n a.append(val)\n # print(l, a)\n v = 0\n for i in query:\n if a[i[1]] - a[i[0]] == i[2]:\n v += i[3]\n mx = max(v, mx)\nprint(mx)\n", "measured_fast_code_sha256": "c7d16eeae23302c0174cc6c3a63e28d624b3c7d6b74e2673b522212c488d195a", "measured_slow_code": "n, m, q = list(map(int, input().split()))\nl = []\nfor i in range(q):\n l1, l2, l3, l4 = list(map(int, input().split()))\n l.append([l1, l2, l3, l4])\nB = []\nfor a in range(1, m + 1):\n for b in range(a, m + 1):\n for c in range(b, m + 1):\n for d in range(c, m + 1):\n for e in range(d, m + 1):\n for f in range(e, m + 1):\n for g in range(f, m + 1):\n for h in range(g, m + 1):\n for i in range(h, m + 1):\n for j in range(i, m + 1):\n L = [a, b, c, d, e, f, g, h, i, j]\n A = []\n for I in range(n):\n A.append(L[I])\n C = 0\n for k in range(q):\n if (\n A[l[k][1] - 1] - A[l[k][0] - 1]\n == l[k][2]\n ):\n C += l[k][3]\n B.append(C)\nprint((max(B)))\n", "measured_slow_code_sha256": "4876c20eabffbc9ea2c633c2d996da20261178a9a9451926be7fe13405bb8582", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.5836876792533783, "pair_id": "python_v2_3ee9484f4d6d7e087c0948cf", "per_case_slow_code_faster_fraction": 0.04, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02695", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02695_c7d16eeae23302c0174cc6c3a63e28d624b3c7d6b74e2673b522212c488d195a.jsonl.gz", "inputs": "reproduction/python/inputs/p02695.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02695_4876c20eabffbc9ea2c633c2d996da20261178a9a9451926be7fe13405bb8582.jsonl.gz"}, "slow_code": "n, m, q = list(map(int, input().split()))\nl = []\nfor i in range(q):\n l1, l2, l3, l4 = list(map(int, input().split()))\n l.append([l1, l2, l3, l4])\nB = []\nfor a in range(1, m + 1):\n for b in range(a, m + 1):\n for c in range(b, m + 1):\n for d in range(c, m + 1):\n for e in range(d, m + 1):\n for f in range(e, m + 1):\n for g in range(f, m + 1):\n for h in range(g, m + 1):\n for i in range(h, m + 1):\n for j in range(i, m + 1):\n L = [a, b, c, d, e, f, g, h, i, j]\n A = []\n for I in range(n):\n A.append(L[I])\n C = 0\n for k in range(q):\n if (\n A[l[k][1] - 1] - A[l[k][0] - 1]\n == l[k][2]\n ):\n C += l[k][3]\n B.append(C)\nprint((max(B)))\n", "slow_code_sha256": "4876c20eabffbc9ea2c633c2d996da20261178a9a9451926be7fe13405bb8582", "slow_id": "p02695_4876c20eabffbc9ea2c633c2d996da20261178a9a9451926be7fe13405bb8582", "speedup": 4.842447305621279, "stratum": "4-8", "within_pair_jaccard": 0.4230769230769231, "workload": {"case_count": 100, "description": "Choose integers 1<=A_1<=...<=A_N<=M to maximize score. Each of Q distinct conditions (a_i,b_i,c_i) awards d_i when A_b_i-A_a_i=c_i. Observed inputs: N=2..10 (median 5); M=1..10 (median 5); Q=1..50 (median 10); c_i=0..9; d_i=1..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 676, "median": 132.0, "min": 14}, "input_format": ["N M Q\na_1 b_1 c_1 d_1\n...\na_Q b_Q c_Q d_Q"], "input_format_status": "source_input_section", "input_lines": {"max": 51, "median": 11.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 203, "median": 43.0, "min": 7}}} -{"case_ids": ["p00033_case_000", "p00033_case_001", "p00033_case_002", "p00033_case_003", "p00033_case_004", "p00033_case_005", "p00033_case_006", "p00033_case_007", "p00033_case_008", "p00033_case_009", "p00033_case_010", "p00033_case_011", "p00033_case_012", "p00033_case_013", "p00033_case_014", "p00033_case_015", "p00033_case_016", "p00033_case_017", "p00033_case_018", "p00033_case_019", "p00033_case_020", "p00033_case_021", "p00033_case_022", "p00033_case_023", "p00033_case_024", "p00033_case_025", "p00033_case_026", "p00033_case_027", "p00033_case_028", "p00033_case_029", "p00033_case_030", "p00033_case_031", "p00033_case_032", "p00033_case_033", "p00033_case_034", "p00033_case_035", "p00033_case_036", "p00033_case_037", "p00033_case_038", "p00033_case_039", "p00033_case_040", "p00033_case_041", "p00033_case_042", "p00033_case_043", "p00033_case_044", "p00033_case_045", "p00033_case_046", "p00033_case_047", "p00033_case_048", "p00033_case_049", "p00033_case_050", "p00033_case_051", "p00033_case_052", "p00033_case_053", "p00033_case_054", "p00033_case_055", "p00033_case_056", "p00033_case_057", "p00033_case_058", "p00033_case_059", "p00033_case_060", "p00033_case_061", "p00033_case_062", "p00033_case_063", "p00033_case_064", "p00033_case_065", "p00033_case_066", "p00033_case_067", "p00033_case_068", "p00033_case_069", "p00033_case_070", "p00033_case_071", "p00033_case_072", "p00033_case_073", "p00033_case_074", "p00033_case_075", "p00033_case_076", "p00033_case_077", "p00033_case_078", "p00033_case_079", "p00033_case_080", "p00033_case_081", "p00033_case_082", "p00033_case_083", "p00033_case_084", "p00033_case_085", "p00033_case_086", "p00033_case_087", "p00033_case_088", "p00033_case_089", "p00033_case_090", "p00033_case_091", "p00033_case_092", "p00033_case_093", "p00033_case_094", "p00033_case_095", "p00033_case_096", "p00033_case_097", "p00033_case_098", "p00033_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def f(x):\n a, b = 0, 0\n for e in x:\n if e > a:\n a = e\n elif e > b:\n b = e\n else:\n return 0\n return 1\n\n\nn = eval(input())\nfor i in range(n):\n D = list(map(int, input().split()))\n s = [\"NO\", \"YES\"][f(D)]\n print(s)\n", "fast_code_sha256": "74d46ca7ddd1ab0ffda87d84b6c14121f04a86b23b8694b427d1d45086c945ef", "fast_id": "p00033_74d46ca7ddd1ab0ffda87d84b6c14121f04a86b23b8694b427d1d45086c945ef", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def f(x):\n a, b = 0, 0\n for e in x:\n if e > a:\n a = e\n elif e > b:\n b = e\n else:\n return 0\n return 1\n\n\nn = eval(input())\nfor i in range(n):\n D = list(map(int, input().split()))\n s = [\"NO\", \"YES\"][f(D)]\n print(s)\n", "measured_fast_code_sha256": "74d46ca7ddd1ab0ffda87d84b6c14121f04a86b23b8694b427d1d45086c945ef", "measured_slow_code": "N = int(eval(input()))\nfor testCase in range(N):\n A = list(map(int, input().split()))\n ok = False\n for i in range(2**10):\n x = []\n y = []\n for j in range(10):\n if i & (1 << j):\n x.append(A[j])\n else:\n y.append(A[j])\n if x == sorted(x) and y == sorted(y):\n ok = True\n if ok:\n print(\"YES\")\n else:\n print(\"NO\")\n", "measured_slow_code_sha256": "e97d5bcfe286f3a777e3a00f68fc161c838b87b600edb795e081e65759bf020d", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 254.45323576936752, "pair_id": "python_v2_9390ae557a2160b8bd09bcc2", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p00033", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p00033_74d46ca7ddd1ab0ffda87d84b6c14121f04a86b23b8694b427d1d45086c945ef.jsonl.gz", "inputs": "reproduction/python/inputs/p00033.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p00033_e97d5bcfe286f3a777e3a00f68fc161c838b87b600edb795e081e65759bf020d.jsonl.gz"}, "slow_code": "N = int(eval(input()))\nfor testCase in range(N):\n A = list(map(int, input().split()))\n ok = False\n for i in range(2**10):\n x = []\n y = []\n for j in range(10):\n if i & (1 << j):\n x.append(A[j])\n else:\n y.append(A[j])\n if x == sorted(x) and y == sorted(y):\n ok = True\n if ok:\n print(\"YES\")\n else:\n print(\"NO\")\n", "slow_code_sha256": "e97d5bcfe286f3a777e3a00f68fc161c838b87b600edb795e081e65759bf020d", "slow_id": "p00033_e97d5bcfe286f3a777e3a00f68fc161c838b87b600edb795e081e65759bf020d", "speedup": 233.78996570964748, "stratum": "8+", "within_pair_jaccard": 0.4146341463414634, "workload": {"case_count": 100, "description": "For each permutation of 1..10, decide whether it can be assigned in arrival order to two stacks so that values increase from bottom to top in each stack. The first integer gives the number of datasets. Observed inputs: datasets=1..10 (median 7); permutation_length=10.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 213, "median": 149.0, "min": 23}, "input_format": ["N\n[permutation of 1..10]\n... (N permutation lines)"], "input_format_status": "source_input_section", "input_lines": {"max": 11, "median": 8.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 101, "median": 71.0, "min": 11}}} -{"case_ids": ["p03835_case_000", "p03835_case_001", "p03835_case_002", "p03835_case_003", "p03835_case_004", "p03835_case_005", "p03835_case_006", "p03835_case_007", "p03835_case_008", "p03835_case_009", "p03835_case_010", "p03835_case_011", "p03835_case_012", "p03835_case_013", "p03835_case_014", "p03835_case_015", "p03835_case_016", "p03835_case_017", "p03835_case_018", "p03835_case_019", "p03835_case_020", "p03835_case_021", "p03835_case_022", "p03835_case_023", "p03835_case_024", "p03835_case_025", "p03835_case_026", "p03835_case_027", "p03835_case_028", "p03835_case_029", "p03835_case_030", "p03835_case_031", "p03835_case_032", "p03835_case_033", "p03835_case_034", "p03835_case_035", "p03835_case_036", "p03835_case_037", "p03835_case_038", "p03835_case_039", "p03835_case_040", "p03835_case_041", "p03835_case_042", "p03835_case_043", "p03835_case_044", "p03835_case_045", "p03835_case_046", "p03835_case_047", "p03835_case_048", "p03835_case_049", "p03835_case_050", "p03835_case_051", "p03835_case_052", "p03835_case_053", "p03835_case_054", "p03835_case_055", "p03835_case_056", "p03835_case_057", "p03835_case_058", "p03835_case_059", "p03835_case_060", "p03835_case_061", "p03835_case_062", "p03835_case_063", "p03835_case_064", "p03835_case_065", "p03835_case_066", "p03835_case_067", "p03835_case_068", "p03835_case_069", "p03835_case_070", "p03835_case_071", "p03835_case_072", "p03835_case_073", "p03835_case_074", "p03835_case_075", "p03835_case_076", "p03835_case_077", "p03835_case_078", "p03835_case_079", "p03835_case_080", "p03835_case_081", "p03835_case_082", "p03835_case_083", "p03835_case_084", "p03835_case_085", "p03835_case_086", "p03835_case_087", "p03835_case_088", "p03835_case_089", "p03835_case_090", "p03835_case_091", "p03835_case_092", "p03835_case_093", "p03835_case_094", "p03835_case_095", "p03835_case_096", "p03835_case_097", "p03835_case_098", "p03835_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "K, S = list(map(int, input().split()))\ncount = 0\nfor i in range(K + 1):\n if 0 <= S - i < K:\n count += S - i + 1\n elif K <= S - i <= 2 * K:\n count += 2 * K - S + i + 1\n else:\n continue\nprint(count)\n", "fast_code_sha256": "b6fc8ed8192c5f68a9f625043fabee60b0ca872cecc31eb34df8cfab411d7f15", "fast_id": "p03835_b6fc8ed8192c5f68a9f625043fabee60b0ca872cecc31eb34df8cfab411d7f15", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "K, S = list(map(int, input().split()))\ncount = 0\nfor i in range(K + 1):\n if 0 <= S - i < K:\n count += S - i + 1\n elif K <= S - i <= 2 * K:\n count += 2 * K - S + i + 1\n else:\n continue\nprint(count)\n", "measured_fast_code_sha256": "b6fc8ed8192c5f68a9f625043fabee60b0ca872cecc31eb34df8cfab411d7f15", "measured_slow_code": "k, s = list(map(int, input().split()))\ncount = 0\nfor x in range(min(s + 1, k + 1)):\n for y in range(min(s + 1 - x, k + 1)):\n if 0 <= s - x - y <= k:\n count += 1\nprint(count)\n", "measured_slow_code_sha256": "3d7320785c61c24a89b1b6741c3ec5ce92d03915fd1321e20d11d8d0742fbcb1", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 426.3787496501179, "pair_id": "python_v2_d8eb852e76915815a26a7efb", "per_case_slow_code_faster_fraction": 0.06, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03835", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03835_b6fc8ed8192c5f68a9f625043fabee60b0ca872cecc31eb34df8cfab411d7f15.jsonl.gz", "inputs": "reproduction/python/inputs/p03835.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03835_3d7320785c61c24a89b1b6741c3ec5ce92d03915fd1321e20d11d8d0742fbcb1.jsonl.gz"}, "slow_code": "k, s = list(map(int, input().split()))\ncount = 0\nfor x in range(min(s + 1, k + 1)):\n for y in range(min(s + 1 - x, k + 1)):\n if 0 <= s - x - y <= k:\n count += 1\nprint(count)\n", "slow_code_sha256": "3d7320785c61c24a89b1b6741c3ec5ce92d03915fd1321e20d11d8d0742fbcb1", "slow_id": "p03835_3d7320785c61c24a89b1b6741c3ec5ce92d03915fd1321e20d11d8d0742fbcb1", "speedup": 125.25413889210309, "stratum": "8+", "within_pair_jaccard": 0.52, "workload": {"case_count": 100, "description": "Count ordered integer triples (X,Y,Z) satisfying 0<=X,Y,Z<=K and X+Y+Z=S. Observed inputs: K=2..2500 (median 1275.5); S=0..7500 (median 1510.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 10, "median": 9.0, "min": 4}, "input_format": ["K S"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p03693_case_000", "p03693_case_001", "p03693_case_002", "p03693_case_003", "p03693_case_004", "p03693_case_005", "p03693_case_006", "p03693_case_007", "p03693_case_008", "p03693_case_009", "p03693_case_010", "p03693_case_011", "p03693_case_012", "p03693_case_013", "p03693_case_014", "p03693_case_015", "p03693_case_016", "p03693_case_017", "p03693_case_018", "p03693_case_019", "p03693_case_020", "p03693_case_021", "p03693_case_022", "p03693_case_023", "p03693_case_024", "p03693_case_025", "p03693_case_026", "p03693_case_027", "p03693_case_028", "p03693_case_029", "p03693_case_030", "p03693_case_031", "p03693_case_032", "p03693_case_033", "p03693_case_034", "p03693_case_035", "p03693_case_036", "p03693_case_037", "p03693_case_038", "p03693_case_039", "p03693_case_040", "p03693_case_041", "p03693_case_042", "p03693_case_043", "p03693_case_044", "p03693_case_045", "p03693_case_046", "p03693_case_047", "p03693_case_048", "p03693_case_049", "p03693_case_050", "p03693_case_051", "p03693_case_052", "p03693_case_053", "p03693_case_054", "p03693_case_055", "p03693_case_056", "p03693_case_057", "p03693_case_058", "p03693_case_059", "p03693_case_060", "p03693_case_061", "p03693_case_062", "p03693_case_063", "p03693_case_064", "p03693_case_065", "p03693_case_066", "p03693_case_067", "p03693_case_068", "p03693_case_069", "p03693_case_070", "p03693_case_071", "p03693_case_072", "p03693_case_073", "p03693_case_074", "p03693_case_075", "p03693_case_076", "p03693_case_077", "p03693_case_078", "p03693_case_079", "p03693_case_080", "p03693_case_081", "p03693_case_082", "p03693_case_083", "p03693_case_084", "p03693_case_085", "p03693_case_086", "p03693_case_087", "p03693_case_088", "p03693_case_089", "p03693_case_090", "p03693_case_091", "p03693_case_092", "p03693_case_093", "p03693_case_094", "p03693_case_095", "p03693_case_096", "p03693_case_097", "p03693_case_098", "p03693_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "a = int(input().replace(\" \", \"\"))\nif a % 4 == 0:\n print(\"YES\")\nelse:\n print(\"NO\")\n", "fast_code_sha256": "49db0678ae9c2031be5dfa2ea46e3f5c47cb6c19768914177f79f71e0a9f4500", "fast_id": "p03693_49db0678ae9c2031be5dfa2ea46e3f5c47cb6c19768914177f79f71e0a9f4500", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "a = int(input().replace(\" \", \"\"))\nif a % 4 == 0:\n print(\"YES\")\nelse:\n print(\"NO\")\n", "measured_fast_code_sha256": "49db0678ae9c2031be5dfa2ea46e3f5c47cb6c19768914177f79f71e0a9f4500", "measured_slow_code": "import numpy as np\n\nr, g, b = list(map(int, input().split()))\nif (100 * r + 10 * g + b) % 4 == 0:\n print(\"YES\")\nelse:\n print(\"NO\")\n", "measured_slow_code_sha256": "a8d7956b0cbea162ca1db60ee520eccf4efc73cdccbed5370688af05e67aaca2", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2330.047101622905, "pair_id": "python_v2_72f8ff9ed2711256af16a97a", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03693", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03693_49db0678ae9c2031be5dfa2ea46e3f5c47cb6c19768914177f79f71e0a9f4500.jsonl.gz", "inputs": "reproduction/python/inputs/p03693.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03693_a8d7956b0cbea162ca1db60ee520eccf4efc73cdccbed5370688af05e67aaca2.jsonl.gz"}, "slow_code": "import numpy as np\n\nr, g, b = list(map(int, input().split()))\nif (100 * r + 10 * g + b) % 4 == 0:\n print(\"YES\")\nelse:\n print(\"NO\")\n", "slow_code_sha256": "a8d7956b0cbea162ca1db60ee520eccf4efc73cdccbed5370688af05e67aaca2", "slow_id": "p03693_a8d7956b0cbea162ca1db60ee520eccf4efc73cdccbed5370688af05e67aaca2", "speedup": 2326.3841885764614, "stratum": "8+", "within_pair_jaccard": 0.391304347826087, "workload": {"case_count": 100, "description": "Read three nonzero decimal digits r,g,b and determine whether the three-digit integer formed in that order is divisible by 4. Observed inputs: r=1..9; g=1..9; b=1..9.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 6, "median": 6.0, "min": 6}, "input_format": ["r g b"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3, "median": 3.0, "min": 3}}} -{"case_ids": ["p03997_case_000", "p03997_case_001", "p03997_case_002", "p03997_case_003", "p03997_case_004", "p03997_case_005", "p03997_case_006", "p03997_case_007", "p03997_case_008", "p03997_case_009", "p03997_case_010", "p03997_case_011", "p03997_case_012", "p03997_case_013", "p03997_case_014", "p03997_case_015", "p03997_case_016", "p03997_case_017", "p03997_case_018", "p03997_case_019", "p03997_case_020", "p03997_case_021", "p03997_case_022", "p03997_case_023", "p03997_case_024", "p03997_case_025", "p03997_case_026", "p03997_case_027", "p03997_case_028", "p03997_case_029", "p03997_case_030", "p03997_case_031", "p03997_case_032", "p03997_case_033", "p03997_case_034", "p03997_case_035", "p03997_case_036", "p03997_case_037", "p03997_case_038", "p03997_case_039", "p03997_case_040", "p03997_case_041", "p03997_case_042", "p03997_case_043", "p03997_case_044", "p03997_case_045", "p03997_case_046", "p03997_case_047", "p03997_case_048", "p03997_case_049", "p03997_case_050", "p03997_case_051", "p03997_case_052", "p03997_case_053", "p03997_case_054", "p03997_case_055", "p03997_case_056", "p03997_case_057", "p03997_case_058", "p03997_case_059", "p03997_case_060", "p03997_case_061", "p03997_case_062", "p03997_case_063", "p03997_case_064", "p03997_case_065", "p03997_case_066", "p03997_case_067", "p03997_case_068", "p03997_case_069", "p03997_case_070", "p03997_case_071", "p03997_case_072", "p03997_case_073", "p03997_case_074", "p03997_case_075", "p03997_case_076", "p03997_case_077", "p03997_case_078", "p03997_case_079", "p03997_case_080", "p03997_case_081", "p03997_case_082", "p03997_case_083", "p03997_case_084", "p03997_case_085", "p03997_case_086", "p03997_case_087", "p03997_case_088", "p03997_case_089", "p03997_case_090", "p03997_case_091", "p03997_case_092", "p03997_case_093", "p03997_case_094", "p03997_case_095", "p03997_case_096", "p03997_case_097", "p03997_case_098", "p03997_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "a, b, h = list(map(int, [eval(input()) for i in range(3)]))\nprint((h * (a + b) // 2))\n", "fast_code_sha256": "6074ba0c982fad312b2df046a843d0a175b8e58f995ed0ecc5dc4de0110c1ff0", "fast_id": "p03997_6074ba0c982fad312b2df046a843d0a175b8e58f995ed0ecc5dc4de0110c1ff0", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "a, b, h = list(map(int, [eval(input()) for i in range(3)]))\nprint((h * (a + b) // 2))\n", "measured_fast_code_sha256": "6074ba0c982fad312b2df046a843d0a175b8e58f995ed0ecc5dc4de0110c1ff0", "measured_slow_code": "from collections import deque\nfrom heapq import heapify, heappop, heappush, heappushpop\nfrom copy import copy, deepcopy\nfrom itertools import product, permutations, combinations, combinations_with_replacement\nfrom collections import defaultdict, Counter\nfrom bisect import bisect_left, bisect_right\n\n# from math import gcd,ceil,floor,factorial\n# from fractions import gcd\nfrom functools import reduce\nfrom pprint import pprint\n\nINF = float(\"inf\")\n\n\ndef myinput():\n return list(map(int, input().split()))\n\n\ndef mylistinput(n):\n return [list(myinput()) for _ in range(n)]\n\n\ndef mycol(data, col):\n return [row[col] for row in data]\n\n\ndef mysort(data, col, reverse_flag):\n data.sort(key=lambda x: x[col], reverse=reverse_flag)\n return data\n\n\ndef mymax(data):\n M = -1 * float(\"inf\")\n for i in range(len(data)):\n m = max(data[i])\n M = max(M, m)\n return M\n\n\ndef mymin(data):\n m = float(\"inf\")\n for i in range(len(data)):\n M = min(data[i])\n m = min(m, M)\n return m\n\n\ndef mycount(ls, x):\n # lsはソート済みであること\n l = bisect_left(ls, x)\n r = bisect_right(ls, x)\n return r - l\n\n\ndef myoutput(ls, space=True):\n if space:\n if len(ls) == 0:\n print(\" \")\n elif type(ls[0]) == str:\n print((\" \".join(ls)))\n elif type(ls[0]) == int:\n print((\" \".join(map(str, ls))))\n else:\n print(\"Output Error\")\n else:\n if len(ls) == 0:\n print(\"\")\n elif type(ls[0]) == str:\n print((\"\".join(ls)))\n elif type(ls[0]) == int:\n print((\"\".join(map(str, ls))))\n else:\n print(\"Output Error\")\n\n\na = int(eval(input()))\nb = int(eval(input()))\nh = int(eval(input()))\nans = (a + b) * h / 2\nprint((int(ans)))\n", "measured_slow_code_sha256": "89a2c802763da09caab2310090bce1a3bd8e29ef5b06b86a35dfdaa7e9205bfe", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 16.184622180997575, "pair_id": "python_v2_98e834dcdc032fd2b8eb438f", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03997", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03997_6074ba0c982fad312b2df046a843d0a175b8e58f995ed0ecc5dc4de0110c1ff0.jsonl.gz", "inputs": "reproduction/python/inputs/p03997.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03997_89a2c802763da09caab2310090bce1a3bd8e29ef5b06b86a35dfdaa7e9205bfe.jsonl.gz"}, "slow_code": "from collections import deque\nfrom heapq import heapify, heappop, heappush, heappushpop\nfrom copy import copy, deepcopy\nfrom itertools import product, permutations, combinations, combinations_with_replacement\nfrom collections import defaultdict, Counter\nfrom bisect import bisect_left, bisect_right\n\n\nfrom functools import reduce\nfrom pprint import pprint\n\nINF = float(\"inf\")\n\n\ndef myinput():\n return list(map(int, input().split()))\n\n\ndef mylistinput(n):\n return [list(myinput()) for _ in range(n)]\n\n\ndef mycol(data, col):\n return [row[col] for row in data]\n\n\ndef mysort(data, col, reverse_flag):\n data.sort(key=lambda x: x[col], reverse=reverse_flag)\n return data\n\n\ndef mymax(data):\n M = -1 * float(\"inf\")\n for i in range(len(data)):\n m = max(data[i])\n M = max(M, m)\n return M\n\n\ndef mymin(data):\n m = float(\"inf\")\n for i in range(len(data)):\n M = min(data[i])\n m = min(m, M)\n return m\n\n\ndef mycount(ls, x):\n\n l = bisect_left(ls, x)\n r = bisect_right(ls, x)\n return r - l\n\n\ndef myoutput(ls, space=True):\n if space:\n if len(ls) == 0:\n print(\" \")\n elif type(ls[0]) == str:\n print((\" \".join(ls)))\n elif type(ls[0]) == int:\n print((\" \".join(map(str, ls))))\n else:\n print(\"Output Error\")\n else:\n if len(ls) == 0:\n print(\"\")\n elif type(ls[0]) == str:\n print((\"\".join(ls)))\n elif type(ls[0]) == int:\n print((\"\".join(map(str, ls))))\n else:\n print(\"Output Error\")\n\n\na = int(eval(input()))\nb = int(eval(input()))\nh = int(eval(input()))\nans = (a + b) * h / 2\nprint((int(ans)))\n", "slow_code_sha256": "b35e7a11385fd8d3cfedbd5906973a53bac70684dd98a901c660194c6fcfc1db", "slow_id": "p03997_89a2c802763da09caab2310090bce1a3bd8e29ef5b06b86a35dfdaa7e9205bfe", "speedup": 16.15888093924342, "stratum": "8+", "within_pair_jaccard": 0.15294117647058825, "workload": {"case_count": 100, "description": "Compute the area of a trapezoid with integer bases a and b and even integer height h. Observed inputs: a=1..100; b=1..100; h=2..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 12, "median": 9.0, "min": 6}, "input_format": ["a\nb\nh"], "input_format_status": "source_input_section", "input_lines": {"max": 3, "median": 3.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3, "median": 3.0, "min": 3}}} -{"case_ids": ["p03448_case_000", "p03448_case_001", "p03448_case_002", "p03448_case_003", "p03448_case_004", "p03448_case_005", "p03448_case_006", "p03448_case_007", "p03448_case_008", "p03448_case_009", "p03448_case_010", "p03448_case_011", "p03448_case_012", "p03448_case_013", "p03448_case_014", "p03448_case_015", "p03448_case_016", "p03448_case_017", "p03448_case_018", "p03448_case_019", "p03448_case_020", "p03448_case_021", "p03448_case_022", "p03448_case_023", "p03448_case_024", "p03448_case_025", "p03448_case_026", "p03448_case_027", "p03448_case_028", "p03448_case_029", "p03448_case_030", "p03448_case_031", "p03448_case_032", "p03448_case_033", "p03448_case_034", "p03448_case_035", "p03448_case_036", "p03448_case_037", "p03448_case_038", "p03448_case_039", "p03448_case_040", "p03448_case_041", "p03448_case_042", "p03448_case_043", "p03448_case_044", "p03448_case_045", "p03448_case_046", "p03448_case_047", "p03448_case_048", "p03448_case_049", "p03448_case_050", "p03448_case_051", "p03448_case_052", "p03448_case_053", "p03448_case_054", "p03448_case_055", "p03448_case_056", "p03448_case_057", "p03448_case_058", "p03448_case_059", "p03448_case_060", "p03448_case_061", "p03448_case_062", "p03448_case_063", "p03448_case_064", "p03448_case_065", "p03448_case_066", "p03448_case_067", "p03448_case_068", "p03448_case_069", "p03448_case_070", "p03448_case_071", "p03448_case_072", "p03448_case_073", "p03448_case_074", "p03448_case_075", "p03448_case_076", "p03448_case_077", "p03448_case_078", "p03448_case_079", "p03448_case_080", "p03448_case_081", "p03448_case_082", "p03448_case_083", "p03448_case_084", "p03448_case_085", "p03448_case_086", "p03448_case_087", "p03448_case_088", "p03448_case_089", "p03448_case_090", "p03448_case_091", "p03448_case_092", "p03448_case_093", "p03448_case_094", "p03448_case_095", "p03448_case_096", "p03448_case_097", "p03448_case_098", "p03448_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "a = int(eval(input()))\nb = int(eval(input()))\nc = int(eval(input()))\nx = int(eval(input()))\nans = 0\nfor count500 in range(a + 1):\n for count100 in range(b + 1):\n value = 500 * count500 + 100 * count100\n delta = x - value\n if delta < 0:\n break\n if delta % 50 == 0 and delta // 50 <= c:\n ans += 1\nprint(ans)\n", "fast_code_sha256": "7d255e94283c50458859cbe0a9333ffdc5a2133b710bbe01aba1a60e3e695ce4", "fast_id": "p03448_7d255e94283c50458859cbe0a9333ffdc5a2133b710bbe01aba1a60e3e695ce4", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "a = int(eval(input()))\nb = int(eval(input()))\nc = int(eval(input()))\nx = int(eval(input()))\nans = 0\nfor count500 in range(a + 1):\n for count100 in range(b + 1):\n value = 500 * count500 + 100 * count100\n delta = x - value\n if delta < 0:\n break\n if delta % 50 == 0 and delta // 50 <= c:\n ans += 1\nprint(ans)\n", "measured_fast_code_sha256": "7d255e94283c50458859cbe0a9333ffdc5a2133b710bbe01aba1a60e3e695ce4", "measured_slow_code": "import sys\n\ninput = sys.stdin.readline\nfrom math import factorial\nfrom itertools import combinations\nfrom collections import Counter\nfrom copy import deepcopy\nfrom operator import mul\nfrom functools import reduce\n\n\ndef main():\n a = int(eval(input()))\n b = int(eval(input()))\n c = int(eval(input()))\n x = int(eval(input()))\n r = 0\n for ia in range(a + 1):\n for ib in range(min(b + 1, (x - ia * 500) // 100 + 1)):\n r += (x - ia * 500 - ib * 100) // 50 <= c\n print(r)\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "4993dfd09e6ff311b6c4ad0f7b90524cb212a96bfb4cd24c73347cba24c2f65e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4.466319485551227, "pair_id": "python_v2_0375919cb74781e1a183da3c", "per_case_slow_code_faster_fraction": 0.02, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03448", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03448_7d255e94283c50458859cbe0a9333ffdc5a2133b710bbe01aba1a60e3e695ce4.jsonl.gz", "inputs": "reproduction/python/inputs/p03448.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03448_4993dfd09e6ff311b6c4ad0f7b90524cb212a96bfb4cd24c73347cba24c2f65e.jsonl.gz"}, "slow_code": "import sys\n\ninput = sys.stdin.readline\nfrom math import factorial\nfrom itertools import combinations\nfrom collections import Counter\nfrom copy import deepcopy\nfrom operator import mul\nfrom functools import reduce\n\n\ndef main():\n a = int(eval(input()))\n b = int(eval(input()))\n c = int(eval(input()))\n x = int(eval(input()))\n r = 0\n for ia in range(a + 1):\n for ib in range(min(b + 1, (x - ia * 500) // 100 + 1)):\n r += (x - ia * 500 - ib * 100) // 50 <= c\n print(r)\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "4993dfd09e6ff311b6c4ad0f7b90524cb212a96bfb4cd24c73347cba24c2f65e", "slow_id": "p03448_4993dfd09e6ff311b6c4ad0f7b90524cb212a96bfb4cd24c73347cba24c2f65e", "speedup": 3.496947253137712, "stratum": "2-4", "within_pair_jaccard": 0.32653061224489793, "workload": {"case_count": 100, "description": "Choose coins totaling X using at most A coins of value 500, B of value 100 and C of value 50. Count distinct denomination-count choices, not permutations of identical coins. X is a multiple of 50. Observed inputs: A=0..50 (median 7); B=0..50 (median 9.5); C=0..50 (median 5.5); X=50..20000 (median 2175).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 15, "median": 12.0, "min": 9}, "input_format": ["A\nB\nC\nX"], "input_format_status": "source_input_section", "input_lines": {"max": 4, "median": 4.0, "min": 4}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 4, "median": 4.0, "min": 4}}} -{"case_ids": ["p03472_case_000", "p03472_case_001", "p03472_case_002", "p03472_case_003", "p03472_case_004", "p03472_case_005", "p03472_case_006", "p03472_case_007", "p03472_case_008", "p03472_case_009", "p03472_case_010", "p03472_case_011", "p03472_case_012", "p03472_case_013", "p03472_case_014", "p03472_case_015", "p03472_case_016", "p03472_case_017", "p03472_case_018", "p03472_case_019", "p03472_case_020", "p03472_case_021", "p03472_case_022", "p03472_case_023", "p03472_case_024", "p03472_case_025", "p03472_case_026", "p03472_case_027", "p03472_case_028", "p03472_case_029", "p03472_case_030", "p03472_case_031", "p03472_case_032", "p03472_case_033", "p03472_case_034", "p03472_case_035", "p03472_case_036", "p03472_case_037", "p03472_case_038", "p03472_case_039", "p03472_case_040", "p03472_case_041", "p03472_case_042", "p03472_case_043", "p03472_case_044", "p03472_case_045", "p03472_case_046", "p03472_case_047", "p03472_case_048", "p03472_case_049", "p03472_case_050", "p03472_case_051", "p03472_case_052", "p03472_case_053", "p03472_case_054", "p03472_case_055", "p03472_case_056", "p03472_case_057", "p03472_case_058", "p03472_case_059", "p03472_case_060", "p03472_case_061", "p03472_case_062", "p03472_case_063", "p03472_case_064", "p03472_case_065", "p03472_case_066", "p03472_case_068", "p03472_case_069", "p03472_case_070", "p03472_case_071", "p03472_case_072", "p03472_case_073", "p03472_case_075", "p03472_case_076", "p03472_case_077", "p03472_case_078", "p03472_case_079", "p03472_case_080", "p03472_case_081", "p03472_case_082", "p03472_case_083", "p03472_case_084", "p03472_case_085", "p03472_case_086", "p03472_case_087", "p03472_case_088", "p03472_case_089", "p03472_case_090", "p03472_case_091", "p03472_case_092", "p03472_case_093", "p03472_case_094", "p03472_case_095", "p03472_case_096", "p03472_case_097", "p03472_case_098", "p03472_case_099", "p03472_v2_152723b81f3e452934a4", "p03472_v2_8069c44687919d0f2aed"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\ninput = sys.stdin.readline\nN, H = list(map(int, input().split()))\nA = []\nB = []\nfor _ in range(N):\n a, b = list(map(int, input().split()))\n A.append(a)\n B.append(b)\nA.sort(reverse=True)\nB.sort(reverse=True)\nans = 0\nmaxA = A[0]\nfor b in B:\n if b <= maxA:\n break\n else:\n H -= b\n ans += 1\n if H <= 0:\n print(ans)\n exit()\nans += (H + maxA - 1) // maxA\nprint(ans)\n", "fast_code_sha256": "90f6053b20f4fd4a820b5193a04b9bd010c7512448f0f47c306b80594bd12de9", "fast_id": "p03472_0c6f8bfb0621d302e3b19d36c0a7479aef1d3a424a9590783b912d843e8d9b99", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\ninput = sys.stdin.readline\nN, H = list(map(int, input().split()))\nA = []\nB = []\nfor _ in range(N):\n a, b = list(map(int, input().split()))\n A.append(a)\n B.append(b)\nA.sort(reverse=True)\nB.sort(reverse=True)\nans = 0\nmaxA = A[0] # 複数回使える最大ダメージ\nfor b in B:\n if b <= maxA:\n break\n else:\n H -= b\n ans += 1\n if H <= 0:\n print(ans)\n exit()\nans += (H + maxA - 1) // maxA\nprint(ans)\n", "measured_fast_code_sha256": "0c6f8bfb0621d302e3b19d36c0a7479aef1d3a424a9590783b912d843e8d9b99", "measured_slow_code": "#!/usr/bin/env python3\n# coding=utf-8\nimport sys\nimport math\nimport numpy as np\n\nn, h = list(map(int, sys.stdin.readline().strip().split(\" \")))\na = []\nb = []\nfor _ in range(n):\n _a, _b = list(map(int, sys.stdin.readline().strip().split(\" \")))\n a.append(_a)\n b.append(_b)\nmax_a = max(a)\ncnt = 0\nb = np.asarray(sorted(b))\nb = b[b > max_a]\nwhile h > 0 and len(b) > 0:\n cnt += 1\n h -= b[-1]\n b = b[:-1]\nif h > 0:\n cnt += math.ceil(h / max_a)\nprint(cnt)\n", "measured_slow_code_sha256": "0789ae9ad831ab5813576bdfc89180cd38032d647a484b2243690be0a9591bf1", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 42.85292570362367, "pair_id": "python_v2_99969f3dc2dd5d5d8182cd09", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03472", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03472_0c6f8bfb0621d302e3b19d36c0a7479aef1d3a424a9590783b912d843e8d9b99.jsonl.gz", "inputs": "reproduction/python/inputs/p03472.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03472_0789ae9ad831ab5813576bdfc89180cd38032d647a484b2243690be0a9591bf1.jsonl.gz"}, "slow_code": "import sys\nimport math\nimport numpy as np\n\nn, h = list(map(int, sys.stdin.readline().strip().split(\" \")))\na = []\nb = []\nfor _ in range(n):\n _a, _b = list(map(int, sys.stdin.readline().strip().split(\" \")))\n a.append(_a)\n b.append(_b)\nmax_a = max(a)\ncnt = 0\nb = np.asarray(sorted(b))\nb = b[b > max_a]\nwhile h > 0 and len(b) > 0:\n cnt += 1\n h -= b[-1]\n b = b[:-1]\nif h > 0:\n cnt += math.ceil(h / max_a)\nprint(cnt)\n", "slow_code_sha256": "58ca7d2969e78880fa1ce15e0d4bb73469edf3592d83f87bf58a9e602bb788dc", "slow_id": "p03472_0789ae9ad831ab5813576bdfc89180cd38032d647a484b2243690be0a9591bf1", "speedup": 23.72748028959203, "stratum": "8+", "within_pair_jaccard": 0.38, "workload": {"case_count": 100, "description": "Defeat health H using N swords. Wield sword i repeatedly for a_i damage, or throw it once for b_i damage and lose it permanently. Each attack counts once; a_i<=b_i. Minimize attacks to deal at least H total damage. Observed inputs: N=1..100000 (median 1000); H=1..1000000000 (median 500000000); a_i=1..1000000000; b_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 2200018, "median": 19446.5, "min": 8}, "input_format": ["N H\na_1 b_1\n...\na_N b_N"], "input_format_status": "source_input_section", "input_lines": {"max": 100001, "median": 1001.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200002, "median": 2002.0, "min": 4}}} -{"case_ids": ["p03860_case_000", "p03860_case_001", "p03860_case_002", "p03860_case_003", "p03860_case_004", "p03860_case_005", "p03860_case_006", "p03860_case_007", "p03860_case_008", "p03860_case_009", "p03860_case_010", "p03860_case_011", "p03860_case_012", "p03860_case_013", "p03860_case_014", "p03860_case_015", "p03860_case_016", "p03860_case_017", "p03860_case_018", "p03860_case_019", "p03860_case_020", "p03860_case_021", "p03860_case_022", "p03860_case_023", "p03860_case_024", "p03860_case_025", "p03860_case_026", "p03860_case_027", "p03860_case_028", "p03860_case_029", "p03860_case_030", "p03860_case_031", "p03860_case_032", "p03860_case_033", "p03860_case_034", "p03860_case_035", "p03860_case_036", "p03860_case_037", "p03860_case_038", "p03860_case_039", "p03860_case_040", "p03860_case_041", "p03860_case_042", "p03860_case_043", "p03860_case_044", "p03860_case_045", "p03860_case_046", "p03860_case_047", "p03860_case_048", "p03860_case_049", "p03860_case_050", "p03860_case_051", "p03860_case_052", "p03860_case_053", "p03860_case_054", "p03860_case_055", "p03860_case_056", "p03860_case_057", "p03860_case_058", "p03860_case_059", "p03860_case_060", "p03860_case_061", "p03860_case_062", "p03860_case_063", "p03860_case_064", "p03860_case_065", "p03860_case_066", "p03860_case_067", "p03860_case_068", "p03860_case_069", "p03860_case_070", "p03860_case_071", "p03860_case_072", "p03860_case_073", "p03860_case_074", "p03860_case_075", "p03860_case_076", "p03860_case_077", "p03860_case_078", "p03860_case_079", "p03860_case_080", "p03860_case_081", "p03860_case_082", "p03860_case_083", "p03860_case_084", "p03860_case_085", "p03860_case_086", "p03860_case_087", "p03860_case_088", "p03860_case_089", "p03860_case_090", "p03860_case_091", "p03860_case_092", "p03860_case_093", "p03860_case_094", "p03860_case_095", "p03860_case_096", "p03860_case_097", "p03860_case_098", "p03860_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "print((\"A%sC\" % input()[8]))\n", "fast_code_sha256": "23a7a790e52fda0a05a39b658a8079d00c1c9bd52c128373255aaf64d9733095", "fast_id": "p03860_23a7a790e52fda0a05a39b658a8079d00c1c9bd52c128373255aaf64d9733095", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "print((\"A%sC\" % input()[8]))\n", "measured_fast_code_sha256": "23a7a790e52fda0a05a39b658a8079d00c1c9bd52c128373255aaf64d9733095", "measured_slow_code": "a, b, c = (i for i in input().split())\nprint((a[0] + b[0] + c[0]))\n", "measured_slow_code_sha256": "9ef1231582fe354d1371d84402c4798862840bfe7b5f006a6f2a81618aaa1d84", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.413767742827803, "pair_id": "python_v2_d46ac5274c8fb28ccbd1d845", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03860", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03860_23a7a790e52fda0a05a39b658a8079d00c1c9bd52c128373255aaf64d9733095.jsonl.gz", "inputs": "reproduction/python/inputs/p03860.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03860_9ef1231582fe354d1371d84402c4798862840bfe7b5f006a6f2a81618aaa1d84.jsonl.gz"}, "slow_code": "a, b, c = (i for i in input().split())\nprint((a[0] + b[0] + c[0]))\n", "slow_code_sha256": "9ef1231582fe354d1371d84402c4798862840bfe7b5f006a6f2a81618aaa1d84", "slow_id": "p03860_9ef1231582fe354d1371d84402c4798862840bfe7b5f006a6f2a81618aaa1d84", "speedup": 2.4106804431291944, "stratum": "2-4", "within_pair_jaccard": 0.15384615384615385, "workload": {"case_count": 100, "description": "Form a three-letter abbreviation from initials of a fixed prefix, title s, and fixed suffix. Prefix/suffix initials are A and C. The title begins with one uppercase letter followed by lowercase letters; both fixed words have 7 letters. Observed inputs: title_length=1..100 (median 50); fixed_word_length=7.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 117, "median": 67.0, "min": 18}, "input_format": ["prefix s suffix"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3, "median": 3.0, "min": 3}}} -{"case_ids": ["p02712_case_000", "p02712_case_001", "p02712_case_002", "p02712_case_003", "p02712_case_004", "p02712_case_005", "p02712_case_006", "p02712_case_007", "p02712_case_008", "p02712_case_009", "p02712_case_010", "p02712_case_011", "p02712_case_012", "p02712_case_013", "p02712_case_014", "p02712_case_015", "p02712_case_016", "p02712_case_017", "p02712_case_018", "p02712_case_019", "p02712_case_020", "p02712_case_021", "p02712_case_022", "p02712_case_023", "p02712_case_024", "p02712_case_025", "p02712_case_026", "p02712_case_027", "p02712_case_028", "p02712_case_029", "p02712_case_030", "p02712_case_031", "p02712_case_032", "p02712_case_033", "p02712_case_034", "p02712_case_035", "p02712_case_036", "p02712_case_037", "p02712_case_038", "p02712_case_039", "p02712_case_040", "p02712_case_041", "p02712_case_042", "p02712_case_043", "p02712_case_044", "p02712_case_045", "p02712_case_046", "p02712_case_047", "p02712_case_048", "p02712_case_049", "p02712_case_050", "p02712_case_051", "p02712_case_052", "p02712_case_053", "p02712_case_054", "p02712_case_055", "p02712_case_056", "p02712_case_057", "p02712_case_058", "p02712_case_059", "p02712_case_060", "p02712_case_061", "p02712_case_062", "p02712_case_063", "p02712_case_064", "p02712_case_065", "p02712_case_066", "p02712_case_067", "p02712_case_068", "p02712_case_069", "p02712_case_070", "p02712_case_071", "p02712_case_072", "p02712_case_073", "p02712_case_074", "p02712_case_075", "p02712_case_076", "p02712_case_077", "p02712_case_078", "p02712_case_079", "p02712_case_080", "p02712_case_081", "p02712_case_082", "p02712_case_083", "p02712_case_084", "p02712_case_085", "p02712_case_086", "p02712_case_087", "p02712_case_088", "p02712_case_089", "p02712_case_090", "p02712_case_091", "p02712_case_092", "p02712_case_093", "p02712_case_094", "p02712_case_095", "p02712_case_096", "p02712_case_097", "p02712_case_098", "p02712_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N = int(eval(input()))\ntotal = int(1 / 2 * N * (N + 1))\nwa3 = (N // 3 * (N // 3 + 1)) // 2 * 3\nwa5 = (N // 5 * (N // 5 + 1)) // 2 * 5\nwa15 = (N // 15 * (N // 15 + 1)) // 2 * 15\nprint((total - wa3 - wa5 + wa15))\n", "fast_code_sha256": "72619107eb329b54610e4085498f85cee6d80295e93784b7b4dded26629f06a8", "fast_id": "p02712_72619107eb329b54610e4085498f85cee6d80295e93784b7b4dded26629f06a8", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N = int(eval(input()))\ntotal = int(1 / 2 * N * (N + 1))\nwa3 = (N // 3 * (N // 3 + 1)) // 2 * 3\nwa5 = (N // 5 * (N // 5 + 1)) // 2 * 5\nwa15 = (N // 15 * (N // 15 + 1)) // 2 * 15\nprint((total - wa3 - wa5 + wa15))\n", "measured_fast_code_sha256": "72619107eb329b54610e4085498f85cee6d80295e93784b7b4dded26629f06a8", "measured_slow_code": "N = int(eval(input()))\nsum = 0\nfor i in range(1, N + 1):\n if i % 3 == 0:\n continue\n elif i % 5 == 0:\n continue\n else:\n sum += i\nprint(sum)\n", "measured_slow_code_sha256": "f910f1b85b0418dda3aa063e8ab589070f47ebfbee439171e431fb7188b5cd6d", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1364.7887426045481, "pair_id": "python_v2_07023f1e67cd9449866af500", "per_case_slow_code_faster_fraction": 0.13, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02712", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02712_72619107eb329b54610e4085498f85cee6d80295e93784b7b4dded26629f06a8.jsonl.gz", "inputs": "reproduction/python/inputs/p02712.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02712_f910f1b85b0418dda3aa063e8ab589070f47ebfbee439171e431fb7188b5cd6d.jsonl.gz"}, "slow_code": "N = int(eval(input()))\nsum = 0\nfor i in range(1, N + 1):\n if i % 3 == 0:\n continue\n elif i % 5 == 0:\n continue\n else:\n sum += i\nprint(sum)\n", "slow_code_sha256": "f910f1b85b0418dda3aa063e8ab589070f47ebfbee439171e431fb7188b5cd6d", "slow_id": "p02712_f910f1b85b0418dda3aa063e8ab589070f47ebfbee439171e431fb7188b5cd6d", "speedup": 393.31606115212577, "stratum": "8+", "within_pair_jaccard": 0.2608695652173913, "workload": {"case_count": 100, "description": "Sum numeric terms among the first N FizzBuzz terms: multiples of 3 or 5 are words, and every other term i is the number i. Observed inputs: N=1..1000000 (median 360236).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 8, "median": 7.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p03037_case_000", "p03037_case_001", "p03037_case_002", "p03037_case_003", "p03037_case_004", "p03037_case_005", "p03037_case_006", "p03037_case_007", "p03037_case_008", "p03037_case_009", "p03037_case_010", "p03037_case_011", "p03037_case_012", "p03037_case_013", "p03037_case_014", "p03037_case_015", "p03037_case_016", "p03037_case_017", "p03037_case_018", "p03037_case_019", "p03037_case_020", "p03037_case_021", "p03037_case_022", "p03037_case_023", "p03037_case_024", "p03037_case_025", "p03037_case_026", "p03037_case_027", "p03037_case_028", "p03037_case_029", "p03037_case_030", "p03037_case_031", "p03037_case_032", "p03037_case_033", "p03037_case_034", "p03037_case_035", "p03037_case_036", "p03037_case_037", "p03037_case_038", "p03037_case_039", "p03037_case_040", "p03037_case_041", "p03037_case_042", "p03037_case_043", "p03037_case_044", "p03037_case_045", "p03037_case_046", "p03037_case_047", "p03037_case_048", "p03037_case_049", "p03037_case_050", "p03037_case_051", "p03037_case_052", "p03037_case_053", "p03037_case_054", "p03037_case_055", "p03037_case_056", "p03037_case_057", "p03037_case_058", "p03037_case_059", "p03037_case_060", "p03037_case_061", "p03037_case_062", "p03037_case_063", "p03037_case_064", "p03037_case_065", "p03037_case_066", "p03037_case_067", "p03037_case_068", "p03037_case_069", "p03037_case_070", "p03037_case_071", "p03037_case_072", "p03037_case_073", "p03037_case_074", "p03037_case_075", "p03037_case_076", "p03037_case_077", "p03037_case_078", "p03037_case_079", "p03037_case_080", "p03037_case_081", "p03037_case_082", "p03037_case_083", "p03037_case_084", "p03037_case_085", "p03037_case_086", "p03037_case_087", "p03037_case_088", "p03037_case_089", "p03037_case_090", "p03037_case_091", "p03037_case_092", "p03037_case_093", "p03037_case_094", "p03037_case_095", "p03037_case_096", "p03037_case_097", "p03037_case_098", "p03037_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N, M = list(map(int, input().split()))\nL = []\nR = []\nfor i in range(M):\n (\n l,\n r,\n ) = list(map(int, input().split()))\n L.append(l)\n R.append(r)\nmax_l = 0\nmin_r = N\nfor i in range(M):\n if max_l < L[i]:\n max_l = L[i]\n if min_r > R[i]:\n min_r = R[i]\nif max_l > min_r:\n print((0))\nelse:\n print((min_r - max_l + 1))\n", "fast_code_sha256": "98589ecfe12c247975eef38491d0a7ce07567e4ad28fb4de0d08727f1404dc4b", "fast_id": "p03037_a6f4398bd13786c1983ff81b03d24372f6ba8f308c52382b75f22e1d7a34c238", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\nN, M = list(map(int, input().split()))\nL = []\nR = []\nfor i in range(M):\n (\n l,\n r,\n ) = list(map(int, input().split()))\n L.append(l)\n R.append(r)\nmax_l = 0\nmin_r = N\nfor i in range(M):\n if max_l < L[i]:\n max_l = L[i]\n if min_r > R[i]:\n min_r = R[i]\nif max_l > min_r:\n print((0))\nelse:\n print((min_r - max_l + 1))\n", "measured_fast_code_sha256": "a6f4398bd13786c1983ff81b03d24372f6ba8f308c52382b75f22e1d7a34c238", "measured_slow_code": "import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, queue, copy\n\nsys.setrecursionlimit(10**7)\ninf = 10**20\nmod = 10**9 + 7\ndd = [(-1, 0), (0, 1), (1, 0), (0, -1)]\nddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef LI_():\n return [int(x) - 1 for x in sys.stdin.readline().split()]\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LS():\n return sys.stdin.readline().split()\n\n\ndef S():\n return eval(input())\n\n\ndef main():\n n, k = LI()\n l = [0] * (n + 1)\n for _ in range(k):\n a, b = LI()\n l[a - 1] += 1\n l[b] -= 1\n for i in range(n - 1):\n l[i + 1] += l[i]\n ans = 0\n for x in l[:-1]:\n if x == k:\n ans += 1\n return ans\n\n\nprint((main()))\n", "measured_slow_code_sha256": "603682b2a1acebd824f0081d6dbfdc82575d41c2aa8f541e6ca8387c5cde8833", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.788932299739562, "pair_id": "python_v2_87bad868ad34d3120c210273", "per_case_slow_code_faster_fraction": 0.43, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03037", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03037_a6f4398bd13786c1983ff81b03d24372f6ba8f308c52382b75f22e1d7a34c238.jsonl.gz", "inputs": "reproduction/python/inputs/p03037.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03037_603682b2a1acebd824f0081d6dbfdc82575d41c2aa8f541e6ca8387c5cde8833.jsonl.gz"}, "slow_code": "import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, queue, copy\n\nsys.setrecursionlimit(10**7)\ninf = 10**20\nmod = 10**9 + 7\ndd = [(-1, 0), (0, 1), (1, 0), (0, -1)]\nddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef LI_():\n return [int(x) - 1 for x in sys.stdin.readline().split()]\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LS():\n return sys.stdin.readline().split()\n\n\ndef S():\n return eval(input())\n\n\ndef main():\n n, k = LI()\n l = [0] * (n + 1)\n for _ in range(k):\n a, b = LI()\n l[a - 1] += 1\n l[b] -= 1\n for i in range(n - 1):\n l[i + 1] += l[i]\n ans = 0\n for x in l[:-1]:\n if x == k:\n ans += 1\n return ans\n\n\nprint((main()))\n", "slow_code_sha256": "603682b2a1acebd824f0081d6dbfdc82575d41c2aa8f541e6ca8387c5cde8833", "slow_id": "p03037_603682b2a1acebd824f0081d6dbfdc82575d41c2aa8f541e6ca8387c5cde8833", "speedup": 4.186314310187106, "stratum": "4-8", "within_pair_jaccard": 0.18461538461538463, "workload": {"case_count": 100, "description": "There are N numbered access cards and M gates. Gate i accepts card IDs in inclusive interval [L_i,R_i]. Count individual cards that each permit passage through every gate. Observed inputs: N=1..100000 (median 99999); M=1..100000 (median 1000); L_i=1..100000; R_i=1..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1200014, "median": 7912.0, "min": 8}, "input_format": ["N M\nL_1 R_1\n...\nL_M R_M"], "input_format_status": "source_input_section", "input_lines": {"max": 100001, "median": 1001.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200002, "median": 2002.0, "min": 4}}} -{"case_ids": ["p02570_case_000", "p02570_case_001", "p02570_case_002", "p02570_case_003", "p02570_case_004", "p02570_case_005", "p02570_case_006", "p02570_case_007", "p02570_case_008", "p02570_case_009", "p02570_case_010", "p02570_case_011", "p02570_case_012", "p02570_case_013", "p02570_case_014", "p02570_case_015", "p02570_case_016", "p02570_case_017", "p02570_case_018", "p02570_case_019", "p02570_case_020", "p02570_case_021", "p02570_case_022", "p02570_case_023", "p02570_case_024", "p02570_case_025", "p02570_case_026", "p02570_case_027", "p02570_case_028", "p02570_case_029", "p02570_case_030", "p02570_case_031", "p02570_case_032", "p02570_case_033", "p02570_case_034", "p02570_case_035", "p02570_case_036", "p02570_case_037", "p02570_case_038", "p02570_case_039", "p02570_case_040", "p02570_case_041", "p02570_case_042", "p02570_case_043", "p02570_case_044", "p02570_case_045", "p02570_case_046", "p02570_case_047", "p02570_case_048", "p02570_case_049", "p02570_case_050", "p02570_case_051", "p02570_case_052", "p02570_case_053", "p02570_case_054", "p02570_case_055", "p02570_case_056", "p02570_case_057", "p02570_case_058", "p02570_case_059", "p02570_case_060", "p02570_case_061", "p02570_case_062", "p02570_case_063", "p02570_case_064", "p02570_case_065", "p02570_case_066", "p02570_case_067", "p02570_case_068", "p02570_case_069", "p02570_case_070", "p02570_case_071", "p02570_case_072", "p02570_case_073", "p02570_case_074", "p02570_case_075", "p02570_case_076", "p02570_case_077", "p02570_case_078", "p02570_case_079", "p02570_case_080", "p02570_case_081", "p02570_case_082", "p02570_case_083", "p02570_case_084", "p02570_case_085", "p02570_case_086", "p02570_case_087", "p02570_case_088", "p02570_case_089", "p02570_case_090", "p02570_case_091", "p02570_case_092", "p02570_case_093", "p02570_case_094", "p02570_case_095", "p02570_case_096", "p02570_case_097", "p02570_case_098", "p02570_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "executable_AST_equal_except_explicit_explanatory_string_removal_and_all_frozen_inputs_checker_pass", "fast_code": "def get_input() -> tuple:\n D, T, S = list(map(int, input().split()))\n return D, T, S\n\n\ndef main(D: int, T: int, S: int) -> None:\n\n ans = str()\n if D <= S * T:\n ans = \"Yes\"\n else:\n ans = \"No\"\n\n print(ans)\n\n\nif __name__ == \"__main__\":\n\n D, T, S = get_input()\n\n main(D, T, S)\n", "fast_code_sha256": "c0c409a8ff3c23b867f319996217b059e009419dc178f8259b4a9d39f79a15fc", "fast_id": "p02570_b2b46f714dc598d3353db705d6d448fdcb3d21762a95d678a1aa79e2444d56f0", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "# -*- coding: utf-8 -*-\ndef get_input() -> tuple:\n \"\"\"\n 標準入力を取得する.\n Returns:\\n\n tuple: 標準入力\n \"\"\"\n D, T, S = list(map(int, input().split()))\n return D, T, S\n\n\ndef main(D: int, T: int, S: int) -> None:\n \"\"\"\n メイン処理.\n Args:\\n\n D (int): 待ち合わせ場所(1 <= D <= 10000)\n T (int): 待ち合わせ時間(1 <= T <= 10000)\n S (int): 分速(1 <= S <= 10000)\n \"\"\"\n # 求解処理\n ans = str()\n if D <= S * T:\n ans = \"Yes\"\n else:\n ans = \"No\"\n # 結果出力\n print(ans)\n\n\nif __name__ == \"__main__\":\n # 標準入力を取得\n D, T, S = get_input()\n # メイン処理\n main(D, T, S)\n", "measured_fast_code_sha256": "b2b46f714dc598d3353db705d6d448fdcb3d21762a95d678a1aa79e2444d56f0", "measured_slow_code": "def LI():\n return list(map(int, input().split()))\n\n\ndef II():\n return int(input())\n\n\ndef yes():\n return print(\"Yes\")\n\n\ndef no():\n return print(\"No\")\n\n\n# INF=float(\"inf\")\n# from collections import deque, defaultdict, Counter\n# from heapq import heappop, heappush\n# from itertools import product, combinations\n# from functools import reduce, lru_cache\n# from math import pi, gcd\n# from decimal import Decimal\nclass Combination:\n \"\"\"\n O(n)の前計算を1回行うことで,O(1)でnCr mod mを求められる\n n_max = 10**6のとき前処理は約950ms (PyPyなら約340ms, 10**7で約1800ms)\n 使用例:\n comb = Combination(1000000)\n print(comb(5, 3)) # 10\n \"\"\"\n\n def __init__(self, n_max, mod=10**9 + 7):\n self.mod = mod\n self.modinv = self.make_modinv_list(n_max)\n self.fac, self.facinv = self.make_factorial_list(n_max)\n\n def __call__(self, n, r):\n return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n - r] % self.mod\n\n def make_factorial_list(self, n):\n # 階乗のリストと階乗のmod逆元のリストを返す O(n)\n # self.make_modinv_list()が先に実行されている必要がある\n fac = [1]\n facinv = [1]\n for i in range(1, n + 1):\n fac.append(fac[i - 1] * i % self.mod)\n facinv.append(facinv[i - 1] * self.modinv[i] % self.mod)\n return fac, facinv\n\n def make_modinv_list(self, n):\n # 0からnまでのmod逆元のリストを返す O(n)\n modinv = [0] * (n + 1)\n modinv[1] = 1\n for i in range(2, n + 1):\n modinv[i] = self.mod - self.mod // i * modinv[self.mod % i] % self.mod\n return modinv\n\n\nclass Unionfind:\n def __init__(self, N):\n self.p = list(range(N))\n self.rank = [0] * N\n self.size = [1] * N\n\n def root(self, x):\n if self.p[x] != x:\n self.p[x] = self.root(self.p[x])\n return self.p[x]\n\n def same(self, x, y):\n return self.root(x) == self.root(y)\n\n def unite(self, x, y):\n u = self.root(x)\n v = self.root(y)\n if u == v:\n return\n if self.rank[u] < self.rank[v]:\n self.p[u] = v\n self.size[v] += self.size[u]\n self.size[u] = 0\n else:\n self.p[v] = u\n self.size[u] += self.size[v]\n self.size[v] = 0\n if self.rank[u] == self.rank[v]:\n self.rank[u] += 1\n\n def count(self, x):\n return self.size[self.root(x)]\n\n\nd, t, s = LI()\nif d <= t * s:\n yes()\nelse:\n no()\n", "measured_slow_code_sha256": "7df3ffb5a8416f2149c9ce5f388659f4fb80cc7488ec540c2ef41ccf0a9e9129", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4.259800258478631, "pair_id": "python_v2_2a2c868b96c332a039115162", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02570", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02570_b2b46f714dc598d3353db705d6d448fdcb3d21762a95d678a1aa79e2444d56f0.jsonl.gz", "inputs": "reproduction/python/inputs/p02570.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02570_7df3ffb5a8416f2149c9ce5f388659f4fb80cc7488ec540c2ef41ccf0a9e9129.jsonl.gz"}, "slow_code": "def LI():\n return list(map(int, input().split()))\n\n\ndef II():\n return int(input())\n\n\ndef yes():\n return print(\"Yes\")\n\n\ndef no():\n return print(\"No\")\n\n\nclass Combination:\n\n def __init__(self, n_max, mod=10**9 + 7):\n self.mod = mod\n self.modinv = self.make_modinv_list(n_max)\n self.fac, self.facinv = self.make_factorial_list(n_max)\n\n def __call__(self, n, r):\n return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n - r] % self.mod\n\n def make_factorial_list(self, n):\n\n fac = [1]\n facinv = [1]\n for i in range(1, n + 1):\n fac.append(fac[i - 1] * i % self.mod)\n facinv.append(facinv[i - 1] * self.modinv[i] % self.mod)\n return fac, facinv\n\n def make_modinv_list(self, n):\n\n modinv = [0] * (n + 1)\n modinv[1] = 1\n for i in range(2, n + 1):\n modinv[i] = self.mod - self.mod // i * modinv[self.mod % i] % self.mod\n return modinv\n\n\nclass Unionfind:\n def __init__(self, N):\n self.p = list(range(N))\n self.rank = [0] * N\n self.size = [1] * N\n\n def root(self, x):\n if self.p[x] != x:\n self.p[x] = self.root(self.p[x])\n return self.p[x]\n\n def same(self, x, y):\n return self.root(x) == self.root(y)\n\n def unite(self, x, y):\n u = self.root(x)\n v = self.root(y)\n if u == v:\n return\n if self.rank[u] < self.rank[v]:\n self.p[u] = v\n self.size[v] += self.size[u]\n self.size[u] = 0\n else:\n self.p[v] = u\n self.size[u] += self.size[v]\n self.size[v] = 0\n if self.rank[u] == self.rank[v]:\n self.rank[u] += 1\n\n def count(self, x):\n return self.size[self.root(x)]\n\n\nd, t, s = LI()\nif d <= t * s:\n yes()\nelse:\n no()\n", "slow_code_sha256": "09b0c0d43abbb6955208c35fb1cca343f1b4cbf34ced526e48c841c54fa3ed5f", "slow_id": "p02570_7df3ffb5a8416f2149c9ce5f388659f4fb80cc7488ec540c2ef41ccf0a9e9129", "speedup": 4.258384329522176, "stratum": "4-8", "within_pair_jaccard": 0.15730337078651685, "workload": {"case_count": 100, "description": "Determine whether traveling distance D meters at constant speed S meters per minute reaches the destination within T minutes. Observed inputs: D=1..10000 (median 823); T=1..10000 (median 471); S=1..10000 (median 523).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 18, "median": 12.0, "min": 6}, "input_format": ["D T S"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3, "median": 3.0, "min": 3}}} -{"case_ids": ["p03456_case_000", "p03456_case_001", "p03456_case_002", "p03456_case_003", "p03456_case_004", "p03456_case_005", "p03456_case_006", "p03456_case_007", "p03456_case_008", "p03456_case_009", "p03456_case_010", "p03456_case_011", "p03456_case_012", "p03456_case_013", "p03456_case_014", "p03456_case_015", "p03456_case_016", "p03456_case_017", "p03456_case_018", "p03456_case_019", "p03456_case_020", "p03456_case_021", "p03456_case_022", "p03456_case_023", "p03456_case_024", "p03456_case_025", "p03456_case_026", "p03456_case_027", "p03456_case_028", "p03456_case_029", "p03456_case_030", "p03456_case_031", "p03456_case_032", "p03456_case_033", "p03456_case_034", "p03456_case_035", "p03456_case_036", "p03456_case_037", "p03456_case_038", "p03456_case_039", "p03456_case_040", "p03456_case_041", "p03456_case_042", "p03456_case_043", "p03456_case_044", "p03456_case_045", "p03456_case_046", "p03456_case_047", "p03456_case_048", "p03456_case_049", "p03456_case_050", "p03456_case_051", "p03456_case_052", "p03456_case_053", "p03456_case_054", "p03456_case_055", "p03456_case_056", "p03456_case_057", "p03456_case_058", "p03456_case_059", "p03456_case_060", "p03456_case_061", "p03456_case_062", "p03456_case_063", "p03456_case_064", "p03456_case_065", "p03456_case_066", "p03456_case_067", "p03456_case_068", "p03456_case_069", "p03456_case_070", "p03456_case_071", "p03456_case_072", "p03456_case_073", "p03456_case_074", "p03456_case_075", "p03456_case_076", "p03456_case_077", "p03456_case_078", "p03456_case_079", "p03456_case_080", "p03456_case_081", "p03456_case_082", "p03456_case_083", "p03456_case_084", "p03456_case_085", "p03456_case_086", "p03456_case_087", "p03456_case_088", "p03456_case_089", "p03456_case_090", "p03456_case_091", "p03456_case_092", "p03456_case_093", "p03456_case_094", "p03456_case_095", "p03456_case_096", "p03456_case_097", "p03456_case_098", "p03456_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "a, b = input().split()\nn = int(a + b)\nflag = False\nfor i in range(1000):\n if i**2 == n:\n flag = True\n break\nprint((\"Yes\" if flag else \"No\"))\n", "fast_code_sha256": "94ce46090efb80fef68cb4c83f8e9898f69f49ac9ed7f750f9db82ace3cd8625", "fast_id": "p03456_94ce46090efb80fef68cb4c83f8e9898f69f49ac9ed7f750f9db82ace3cd8625", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "a, b = input().split()\nn = int(a + b)\nflag = False\nfor i in range(1000):\n if i**2 == n:\n flag = True\n break\nprint((\"Yes\" if flag else \"No\"))\n", "measured_fast_code_sha256": "94ce46090efb80fef68cb4c83f8e9898f69f49ac9ed7f750f9db82ace3cd8625", "measured_slow_code": "import numpy as np\n\na = int(input().replace(\" \", \"\"))\nb = np.sqrt(a)\nc = b - int(b)\nif c == 0.0:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "measured_slow_code_sha256": "7917ed4392d2155273da648b2693fb0163544534d06b0c3c68db07d4c4827be4", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 160.61083524082773, "pair_id": "python_v2_3e12227611a6b1069041c3dc", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03456", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03456_94ce46090efb80fef68cb4c83f8e9898f69f49ac9ed7f750f9db82ace3cd8625.jsonl.gz", "inputs": "reproduction/python/inputs/p03456.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03456_7917ed4392d2155273da648b2693fb0163544534d06b0c3c68db07d4c4827be4.jsonl.gz"}, "slow_code": "import numpy as np\n\na = int(input().replace(\" \", \"\"))\nb = np.sqrt(a)\nc = b - int(b)\nif c == 0.0:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "slow_code_sha256": "7917ed4392d2155273da648b2693fb0163544534d06b0c3c68db07d4c4827be4", "slow_id": "p03456_7917ed4392d2155273da648b2693fb0163544534d06b0c3c68db07d4c4827be4", "speedup": 286.78020609946515, "stratum": "8+", "within_pair_jaccard": 0.3103448275862069, "workload": {"case_count": 100, "description": "Concatenate the decimal representations of positive integers a and b, in that order, and determine whether the resulting integer is a perfect square. Observed inputs: a=1..100 (median 41); b=1..100 (median 48.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 8, "median": 6.0, "min": 4}, "input_format": ["a b"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p02729_case_000", "p02729_case_001", "p02729_case_002", "p02729_case_003", "p02729_case_004", "p02729_case_005", "p02729_case_006", "p02729_case_007", "p02729_case_008", "p02729_case_009", "p02729_case_010", "p02729_case_011", "p02729_case_012", "p02729_case_013", "p02729_case_014", "p02729_case_015", "p02729_case_016", "p02729_case_017", "p02729_case_018", "p02729_case_019", "p02729_case_020", "p02729_case_021", "p02729_case_022", "p02729_case_023", "p02729_case_024", "p02729_case_025", "p02729_case_026", "p02729_case_027", "p02729_case_028", "p02729_case_029", "p02729_case_030", "p02729_case_031", "p02729_case_032", "p02729_case_033", "p02729_case_034", "p02729_case_035", "p02729_case_036", "p02729_case_037", "p02729_case_038", "p02729_case_039", "p02729_case_040", "p02729_case_041", "p02729_case_042", "p02729_case_043", "p02729_case_044", "p02729_case_045", "p02729_case_046", "p02729_case_047", "p02729_case_048", "p02729_case_049", "p02729_case_050", "p02729_case_051", "p02729_case_052", "p02729_case_053", "p02729_case_054", "p02729_case_055", "p02729_case_056", "p02729_case_057", "p02729_case_058", "p02729_case_059", "p02729_case_060", "p02729_case_061", "p02729_case_062", "p02729_case_063", "p02729_case_064", "p02729_case_065", "p02729_case_066", "p02729_case_067", "p02729_case_068", "p02729_case_069", "p02729_case_070", "p02729_case_071", "p02729_case_072", "p02729_case_073", "p02729_case_074", "p02729_case_075", "p02729_case_076", "p02729_case_077", "p02729_case_078", "p02729_case_079", "p02729_case_080", "p02729_case_081", "p02729_case_082", "p02729_case_083", "p02729_case_084", "p02729_case_085", "p02729_case_086", "p02729_case_087", "p02729_case_088", "p02729_case_089", "p02729_case_090", "p02729_case_091", "p02729_case_092", "p02729_case_093", "p02729_case_094", "p02729_case_095", "p02729_case_096", "p02729_case_097", "p02729_case_098", "p02729_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "print((sum([int(i) * (int(i) - 1) // 2 for i in input().split()])))\n", "fast_code_sha256": "925cb2b77ca48e28cc2e769a05417ced8e6c0a980d54ba698f215e776f2e82f4", "fast_id": "p02729_925cb2b77ca48e28cc2e769a05417ced8e6c0a980d54ba698f215e776f2e82f4", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "print((sum([int(i) * (int(i) - 1) // 2 for i in input().split()])))\n", "measured_fast_code_sha256": "925cb2b77ca48e28cc2e769a05417ced8e6c0a980d54ba698f215e776f2e82f4", "measured_slow_code": "N, M = list(map(int, input().split()))\nif N == 1 and M == 1:\n print((0))\nelif N == 1 and M != 1:\n print((int(M * (M - 1) / 2)))\nelif N != 1 and M == 1:\n print((int(N * (N - 1) / 2)))\nelse:\n a = N * (N - 1)\n b = M * (M - 1)\n print((int((a + b) / 2)))\n", "measured_slow_code_sha256": "46e9a227dfeb35218c88779accdc95a5eea2e7b74a5d04e66557f537f5098bcf", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.5277233219837316, "pair_id": "python_v2_c6b2975180df7a98bf4ed3fb", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02729", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02729_925cb2b77ca48e28cc2e769a05417ced8e6c0a980d54ba698f215e776f2e82f4.jsonl.gz", "inputs": "reproduction/python/inputs/p02729.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02729_46e9a227dfeb35218c88779accdc95a5eea2e7b74a5d04e66557f537f5098bcf.jsonl.gz"}, "slow_code": "N, M = list(map(int, input().split()))\nif N == 1 and M == 1:\n print((0))\nelif N == 1 and M != 1:\n print((int(M * (M - 1) / 2)))\nelif N != 1 and M == 1:\n print((int(N * (N - 1) / 2)))\nelse:\n a = N * (N - 1)\n b = M * (M - 1)\n print((int((a + b) / 2)))\n", "slow_code_sha256": "46e9a227dfeb35218c88779accdc95a5eea2e7b74a5d04e66557f537f5098bcf", "slow_id": "p02729_46e9a227dfeb35218c88779accdc95a5eea2e7b74a5d04e66557f537f5098bcf", "speedup": 2.52648092956127, "stratum": "2-4", "within_pair_jaccard": 0.15789473684210525, "workload": {"case_count": 100, "description": "There are N individually distinct balls with even values and M with odd values. Count unordered pairs of different balls whose values sum to an even number. Observed inputs: N=0..100 (median 34.5); M=0..100 (median 31.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 8, "median": 5.0, "min": 4}, "input_format": ["N M"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p02699_case_000", "p02699_case_001", "p02699_case_002", "p02699_case_003", "p02699_case_004", "p02699_case_005", "p02699_case_006", "p02699_case_007", "p02699_case_008", "p02699_case_009", "p02699_case_010", "p02699_case_011", "p02699_case_012", "p02699_case_013", "p02699_case_014", "p02699_case_015", "p02699_case_016", "p02699_case_017", "p02699_case_018", "p02699_case_019", "p02699_case_020", "p02699_case_021", "p02699_case_022", "p02699_case_023", "p02699_case_024", "p02699_case_025", "p02699_case_026", "p02699_case_027", "p02699_case_028", "p02699_case_029", "p02699_case_030", "p02699_case_031", "p02699_case_032", "p02699_case_033", "p02699_case_034", "p02699_case_035", "p02699_case_036", "p02699_case_037", "p02699_case_038", "p02699_case_039", "p02699_case_040", "p02699_case_041", "p02699_case_042", "p02699_case_043", "p02699_case_044", "p02699_case_045", "p02699_case_046", "p02699_case_047", "p02699_case_048", "p02699_case_049", "p02699_case_050", "p02699_case_051", "p02699_case_052", "p02699_case_053", "p02699_case_054", "p02699_case_055", "p02699_case_056", "p02699_case_057", "p02699_case_058", "p02699_case_059", "p02699_case_060", "p02699_case_061", "p02699_case_062", "p02699_case_063", "p02699_case_064", "p02699_case_065", "p02699_case_066", "p02699_case_067", "p02699_case_068", "p02699_case_069", "p02699_case_070", "p02699_case_071", "p02699_case_072", "p02699_case_073", "p02699_case_074", "p02699_case_075", "p02699_case_076", "p02699_case_077", "p02699_case_078", "p02699_case_079", "p02699_case_080", "p02699_case_081", "p02699_case_082", "p02699_case_083", "p02699_case_084", "p02699_case_085", "p02699_case_086", "p02699_case_087", "p02699_case_088", "p02699_case_089", "p02699_case_090", "p02699_case_091", "p02699_case_092", "p02699_case_093", "p02699_case_094", "p02699_case_095", "p02699_case_096", "p02699_case_097", "p02699_case_098", "p02699_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "s, w = list(map(int, input().split()))\nif s > w:\n print(\"safe\")\nelse:\n print(\"unsafe\")\n", "fast_code_sha256": "3c0a060cef9bf5ee175a2546e9be6f83f4b8b290b28c9aa731627fc7d5b5337e", "fast_id": "p02699_3c0a060cef9bf5ee175a2546e9be6f83f4b8b290b28c9aa731627fc7d5b5337e", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "s, w = list(map(int, input().split()))\nif s > w:\n print(\"safe\")\nelse:\n print(\"unsafe\")\n", "measured_fast_code_sha256": "3c0a060cef9bf5ee175a2546e9be6f83f4b8b290b28c9aa731627fc7d5b5337e", "measured_slow_code": "#!/usr/bin/env python3\n# A\nimport sys\nimport math\nfrom bisect import bisect_right as br\nfrom bisect import bisect_left as bl\n\nsys.setrecursionlimit(2147483647)\nfrom heapq import heappush, heappop, heappushpop\nfrom collections import defaultdict\nfrom itertools import accumulate\nfrom collections import Counter\nfrom collections import deque\nfrom operator import itemgetter\nfrom itertools import permutations\n\nmod = 10**9 + 7\ninf = float(\"inf\")\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\ns, w = LI()\nif w >= s:\n print(\"unsafe\")\nelse:\n print(\"safe\")\n", "measured_slow_code_sha256": "084d274c57f95a15e9ad65a8072a788828494b876c9fb00ba76e955369e619b4", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.6082085858355906, "pair_id": "python_v2_e19c453fcba1594acf11c04a", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02699", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02699_3c0a060cef9bf5ee175a2546e9be6f83f4b8b290b28c9aa731627fc7d5b5337e.jsonl.gz", "inputs": "reproduction/python/inputs/p02699.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02699_084d274c57f95a15e9ad65a8072a788828494b876c9fb00ba76e955369e619b4.jsonl.gz"}, "slow_code": "import sys\nimport math\nfrom bisect import bisect_right as br\nfrom bisect import bisect_left as bl\n\nsys.setrecursionlimit(2147483647)\nfrom heapq import heappush, heappop, heappushpop\nfrom collections import defaultdict\nfrom itertools import accumulate\nfrom collections import Counter\nfrom collections import deque\nfrom operator import itemgetter\nfrom itertools import permutations\n\nmod = 10**9 + 7\ninf = float(\"inf\")\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\ns, w = LI()\nif w >= s:\n print(\"unsafe\")\nelse:\n print(\"safe\")\n", "slow_code_sha256": "2b15fcde67ed0713d312a3aaee502dd9087cb59a31e02c65162aa10dcbc89fbe", "slow_id": "p02699_084d274c57f95a15e9ad65a8072a788828494b876c9fb00ba76e955369e619b4", "speedup": 3.606868676913127, "stratum": "2-4", "within_pair_jaccard": 0.22448979591836735, "workload": {"case_count": 100, "description": "Given S sheep and W wolves, report unsafe if wolves are at least as numerous as sheep, and safe otherwise. Observed inputs: S=1..100 (median 38); W=1..100 (median 49.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 8, "median": 6.0, "min": 4}, "input_format": ["S W"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p02729_case_000", "p02729_case_001", "p02729_case_002", "p02729_case_003", "p02729_case_004", "p02729_case_005", "p02729_case_006", "p02729_case_007", "p02729_case_008", "p02729_case_009", "p02729_case_010", "p02729_case_011", "p02729_case_012", "p02729_case_013", "p02729_case_014", "p02729_case_015", "p02729_case_016", "p02729_case_017", "p02729_case_018", "p02729_case_019", "p02729_case_020", "p02729_case_021", "p02729_case_022", "p02729_case_023", "p02729_case_024", "p02729_case_025", "p02729_case_026", "p02729_case_027", "p02729_case_028", "p02729_case_029", "p02729_case_030", "p02729_case_031", "p02729_case_032", "p02729_case_033", "p02729_case_034", "p02729_case_035", "p02729_case_036", "p02729_case_037", "p02729_case_038", "p02729_case_039", "p02729_case_040", "p02729_case_041", "p02729_case_042", "p02729_case_043", "p02729_case_044", "p02729_case_045", "p02729_case_046", "p02729_case_047", "p02729_case_048", "p02729_case_049", "p02729_case_050", "p02729_case_051", "p02729_case_052", "p02729_case_053", "p02729_case_054", "p02729_case_055", "p02729_case_056", "p02729_case_057", "p02729_case_058", "p02729_case_059", "p02729_case_060", "p02729_case_061", "p02729_case_062", "p02729_case_063", "p02729_case_064", "p02729_case_065", "p02729_case_066", "p02729_case_067", "p02729_case_068", "p02729_case_069", "p02729_case_070", "p02729_case_071", "p02729_case_072", "p02729_case_073", "p02729_case_074", "p02729_case_075", "p02729_case_076", "p02729_case_077", "p02729_case_078", "p02729_case_079", "p02729_case_080", "p02729_case_081", "p02729_case_082", "p02729_case_083", "p02729_case_084", "p02729_case_085", "p02729_case_086", "p02729_case_087", "p02729_case_088", "p02729_case_089", "p02729_case_090", "p02729_case_091", "p02729_case_092", "p02729_case_093", "p02729_case_094", "p02729_case_095", "p02729_case_096", "p02729_case_097", "p02729_case_098", "p02729_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n, m = list(map(int, input().split()))\nans = n * (n - 1) // 2 + m * (m - 1) // 2\nprint(ans)\n", "fast_code_sha256": "7a4da1a5e27719159d14135029d39a79cce2dfcc9c3b994ccca9098c6de06d1a", "fast_id": "p02729_7a4da1a5e27719159d14135029d39a79cce2dfcc9c3b994ccca9098c6de06d1a", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n, m = list(map(int, input().split()))\nans = n * (n - 1) // 2 + m * (m - 1) // 2\nprint(ans)\n", "measured_fast_code_sha256": "7a4da1a5e27719159d14135029d39a79cce2dfcc9c3b994ccca9098c6de06d1a", "measured_slow_code": "N, M = list(map(int, input().split()))\nball_numbers = [2 * i for i in range(N)]\nball_numbers.extend([2 * i + 1 for i in range(M)])\ncount = 0\nfor i, num1 in enumerate(ball_numbers):\n for j, num2 in enumerate(ball_numbers):\n if i == j:\n continue\n if (num1 + num2) % 2 == 0:\n count += 1\nprint((count // 2))\n", "measured_slow_code_sha256": "d2ab7f8a064e554c2a10a6a0f691461f4c0930075a45c65fa3daeb66d602c476", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 48.033111902884244, "pair_id": "python_v2_0373176904b5e585ab2e6d0b", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02729", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02729_7a4da1a5e27719159d14135029d39a79cce2dfcc9c3b994ccca9098c6de06d1a.jsonl.gz", "inputs": "reproduction/python/inputs/p02729.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02729_d2ab7f8a064e554c2a10a6a0f691461f4c0930075a45c65fa3daeb66d602c476.jsonl.gz"}, "slow_code": "N, M = list(map(int, input().split()))\nball_numbers = [2 * i for i in range(N)]\nball_numbers.extend([2 * i + 1 for i in range(M)])\ncount = 0\nfor i, num1 in enumerate(ball_numbers):\n for j, num2 in enumerate(ball_numbers):\n if i == j:\n continue\n if (num1 + num2) % 2 == 0:\n count += 1\nprint((count // 2))\n", "slow_code_sha256": "d2ab7f8a064e554c2a10a6a0f691461f4c0930075a45c65fa3daeb66d602c476", "slow_id": "p02729_d2ab7f8a064e554c2a10a6a0f691461f4c0930075a45c65fa3daeb66d602c476", "speedup": 41.40727669190361, "stratum": "8+", "within_pair_jaccard": 0.25925925925925924, "workload": {"case_count": 100, "description": "There are N individually distinct balls with even values and M with odd values. Count unordered pairs of different balls whose values sum to an even number. Observed inputs: N=0..100 (median 34.5); M=0..100 (median 31.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 8, "median": 5.0, "min": 4}, "input_format": ["N M"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p03563_case_000", "p03563_case_001", "p03563_case_002", "p03563_case_003", "p03563_case_004", "p03563_case_005", "p03563_case_006", "p03563_case_007", "p03563_case_008", "p03563_case_009", "p03563_case_010", "p03563_case_011", "p03563_case_012", "p03563_case_013", "p03563_case_014", "p03563_case_015", "p03563_case_016", "p03563_case_017", "p03563_case_018", "p03563_case_019", "p03563_case_020", "p03563_case_021", "p03563_case_022", "p03563_case_023", "p03563_case_024", "p03563_case_025", "p03563_case_026", "p03563_case_027", "p03563_case_028", "p03563_case_029", "p03563_case_030", "p03563_case_031", "p03563_case_032", "p03563_case_033", "p03563_case_034", "p03563_case_035", "p03563_case_036", "p03563_case_037", "p03563_case_038", "p03563_case_039", "p03563_case_040", "p03563_case_041", "p03563_case_042", "p03563_case_043", "p03563_case_044", "p03563_case_045", "p03563_case_046", "p03563_case_047", "p03563_case_048", "p03563_case_049", "p03563_case_050", "p03563_case_051", "p03563_case_052", "p03563_case_053", "p03563_case_054", "p03563_case_055", "p03563_case_056", "p03563_case_057", "p03563_case_058", "p03563_case_059", "p03563_case_060", "p03563_case_061", "p03563_case_062", "p03563_case_063", "p03563_case_064", "p03563_case_065", "p03563_case_066", "p03563_case_067", "p03563_case_068", "p03563_case_069", "p03563_case_070", "p03563_case_071", "p03563_case_072", "p03563_case_073", "p03563_case_074", "p03563_case_075", "p03563_case_076", "p03563_case_077", "p03563_case_078", "p03563_case_079", "p03563_case_080", "p03563_case_081", "p03563_case_082", "p03563_case_083", "p03563_case_084", "p03563_case_085", "p03563_case_086", "p03563_case_087", "p03563_case_088", "p03563_case_089", "p03563_case_090", "p03563_case_091", "p03563_case_092", "p03563_case_093", "p03563_case_094", "p03563_case_095", "p03563_case_096", "p03563_case_097", "p03563_case_098", "p03563_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "current_rating = int(eval(input()))\nfinal_rating = int(eval(input()))\nperformance = final_rating * 2 - current_rating\nprint(performance)\n", "fast_code_sha256": "2743b8c5f26ad19530b3a42804178606b39b522429f37bd1678bca78658fb688", "fast_id": "p03563_2743b8c5f26ad19530b3a42804178606b39b522429f37bd1678bca78658fb688", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "current_rating = int(eval(input()))\nfinal_rating = int(eval(input()))\nperformance = final_rating * 2 - current_rating\nprint(performance)\n", "measured_fast_code_sha256": "2743b8c5f26ad19530b3a42804178606b39b522429f37bd1678bca78658fb688", "measured_slow_code": "import numpy as np\n\nlst = []\nR = int(eval(input()))\nG = int(eval(input()))\nans = G - R + G\nprint(ans)\n", "measured_slow_code_sha256": "59c6641cd1def8a06b45e4c0f0ace3ffa49de62fc97f73e0499cc3875cec5d01", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1663.0801027662615, "pair_id": "python_v2_e2cb5155a7185334d2988ed1", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03563", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03563_2743b8c5f26ad19530b3a42804178606b39b522429f37bd1678bca78658fb688.jsonl.gz", "inputs": "reproduction/python/inputs/p03563.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03563_59c6641cd1def8a06b45e4c0f0ace3ffa49de62fc97f73e0499cc3875cec5d01.jsonl.gz"}, "slow_code": "import numpy as np\n\nlst = []\nR = int(eval(input()))\nG = int(eval(input()))\nans = G - R + G\nprint(ans)\n", "slow_code_sha256": "59c6641cd1def8a06b45e4c0f0ace3ffa49de62fc97f73e0499cc3875cec5d01", "slow_id": "p03563_59c6641cd1def8a06b45e4c0f0ace3ffa49de62fc97f73e0499cc3875cec5d01", "speedup": 1658.9361405395366, "stratum": "8+", "within_pair_jaccard": 0.25, "workload": {"case_count": 100, "description": "A new rating is the arithmetic mean of current rating R and a performance value. Find the performance required for the new rating to equal G; it may be negative. Observed inputs: R=0..4500 (median 2451.5); G=0..4500 (median 1662.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 10, "median": 10.0, "min": 4}, "input_format": ["R\nG"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p03274_case_000", "p03274_case_001", "p03274_case_002", "p03274_case_003", "p03274_case_004", "p03274_case_005", "p03274_case_006", "p03274_case_007", "p03274_case_008", "p03274_case_009", "p03274_case_010", "p03274_case_011", "p03274_case_012", "p03274_case_013", "p03274_case_014", "p03274_case_015", "p03274_case_016", "p03274_case_017", "p03274_case_018", "p03274_case_019", "p03274_case_020", "p03274_case_021", "p03274_case_022", "p03274_case_023", "p03274_case_024", "p03274_case_025", "p03274_case_026", "p03274_case_027", "p03274_case_028", "p03274_case_029", "p03274_case_030", "p03274_case_031", "p03274_case_032", "p03274_case_033", "p03274_case_034", "p03274_case_035", "p03274_case_036", "p03274_case_037", "p03274_case_038", "p03274_case_039", "p03274_case_040", "p03274_case_041", "p03274_case_042", "p03274_case_043", "p03274_case_044", "p03274_case_045", "p03274_case_046", "p03274_case_047", "p03274_case_048", "p03274_case_049", "p03274_case_050", "p03274_case_051", "p03274_case_052", "p03274_case_053", "p03274_case_054", "p03274_case_055", "p03274_case_056", "p03274_case_057", "p03274_case_058", "p03274_case_059", "p03274_case_060", "p03274_case_061", "p03274_case_062", "p03274_case_063", "p03274_case_064", "p03274_case_065", "p03274_case_066", "p03274_case_067", "p03274_case_068", "p03274_case_069", "p03274_case_070", "p03274_case_071", "p03274_case_072", "p03274_case_073", "p03274_case_074", "p03274_case_075", "p03274_case_076", "p03274_case_077", "p03274_case_078", "p03274_case_079", "p03274_case_080", "p03274_case_081", "p03274_case_082", "p03274_case_083", "p03274_case_084", "p03274_case_085", "p03274_case_086", "p03274_case_087", "p03274_case_088", "p03274_case_089", "p03274_case_090", "p03274_case_091", "p03274_case_092", "p03274_case_093", "p03274_case_094", "p03274_case_095", "p03274_case_096", "p03274_case_097", "p03274_case_098", "p03274_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n, k = list(map(int, input().split()))\nX = list(map(int, input().split()))\nans = float(\"inf\")\nfor i in range(n - k + 1):\n l, r = X[i], X[i + k - 1]\n if r <= 0:\n ans = min(abs(l), ans)\n elif 0 <= l:\n ans = min(abs(r), ans)\n else:\n dist = min(abs(l), abs(r)) * 2 + max(abs(l), abs(r))\n ans = min(dist, ans)\nprint(ans)\n", "fast_code_sha256": "2fd935756d3e5a0126da2f77301365ec46fcc5220049601e88d06587621aec96", "fast_id": "p03274_2fd935756d3e5a0126da2f77301365ec46fcc5220049601e88d06587621aec96", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n, k = list(map(int, input().split()))\nX = list(map(int, input().split()))\nans = float(\"inf\")\nfor i in range(n - k + 1):\n l, r = X[i], X[i + k - 1]\n if r <= 0:\n ans = min(abs(l), ans)\n elif 0 <= l:\n ans = min(abs(r), ans)\n else:\n dist = min(abs(l), abs(r)) * 2 + max(abs(l), abs(r))\n ans = min(dist, ans)\nprint(ans)\n", "measured_fast_code_sha256": "2fd935756d3e5a0126da2f77301365ec46fcc5220049601e88d06587621aec96", "measured_slow_code": "import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time\n\nsys.setrecursionlimit(10**7)\ninf = 10**20\nmod = 10**9 + 7\n\n\ndef LI():\n return list(map(int, input().split()))\n\n\ndef I():\n return int(eval(input()))\n\n\ndef LS():\n return input().split()\n\n\ndef S():\n return eval(input())\n\n\ndef main():\n n, k = LI()\n l = LI()\n mn = inf\n for i in range(n - k + 1):\n a = l[i]\n b = l[i + k - 1]\n if a < 0 and b > 0:\n mn = min([mn, abs(a) + abs(b) * 2, abs(a) * 2 + abs(b)])\n else:\n mn = min(mn, max(abs(a), abs(b)))\n return mn\n\n\nprint((main()))\n", "measured_slow_code_sha256": "15cce6db7bc6d79dcd48950e05503001080b8e54791a05cbcc84aecc1f823153", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.9777155421836752, "pair_id": "python_v2_e4f401d8821266c0e2009e27", "per_case_slow_code_faster_fraction": 0.19, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03274", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03274_2fd935756d3e5a0126da2f77301365ec46fcc5220049601e88d06587621aec96.jsonl.gz", "inputs": "reproduction/python/inputs/p03274.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03274_15cce6db7bc6d79dcd48950e05503001080b8e54791a05cbcc84aecc1f823153.jsonl.gz"}, "slow_code": "import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time\n\nsys.setrecursionlimit(10**7)\ninf = 10**20\nmod = 10**9 + 7\n\n\ndef LI():\n return list(map(int, input().split()))\n\n\ndef I():\n return int(eval(input()))\n\n\ndef LS():\n return input().split()\n\n\ndef S():\n return eval(input())\n\n\ndef main():\n n, k = LI()\n l = LI()\n mn = inf\n for i in range(n - k + 1):\n a = l[i]\n b = l[i + k - 1]\n if a < 0 and b > 0:\n mn = min([mn, abs(a) + abs(b) * 2, abs(a) * 2 + abs(b)])\n else:\n mn = min(mn, max(abs(a), abs(b)))\n return mn\n\n\nprint((main()))\n", "slow_code_sha256": "15cce6db7bc6d79dcd48950e05503001080b8e54791a05cbcc84aecc1f823153", "slow_id": "p03274_15cce6db7bc6d79dcd48950e05503001080b8e54791a05cbcc84aecc1f823153", "speedup": 3.4859954126596464, "stratum": "2-4", "within_pair_jaccard": 0.3728813559322034, "workload": {"case_count": 100, "description": "Start at coordinate 0 and travel along a line at unit speed to light K of N candles at strictly increasing positions x_i. Lighting takes negligible time. Minimize elapsed time; return to 0 is not required. Observed inputs: N=1..100000 (median 10000); K=1..100000 (median 75); x_i=-100000000..100000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1000015, "median": 53814.0, "min": 14}, "input_format": ["N K\nx_1 ... x_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100002, "median": 10002.0, "min": 3}}} -{"case_ids": ["p03209_case_000", "p03209_case_001", "p03209_case_002", "p03209_case_003", "p03209_case_004", "p03209_case_005", "p03209_case_006", "p03209_case_007", "p03209_case_008", "p03209_case_009", "p03209_case_010", "p03209_case_011", "p03209_case_012", "p03209_case_013", "p03209_case_014", "p03209_case_015", "p03209_case_016", "p03209_case_017", "p03209_case_018", "p03209_case_019", "p03209_case_020", "p03209_case_021", "p03209_case_022", "p03209_case_023", "p03209_case_024", "p03209_case_025", "p03209_case_026", "p03209_case_027", "p03209_case_028", "p03209_case_029", "p03209_case_030", "p03209_case_031", "p03209_case_032", "p03209_case_033", "p03209_case_034", "p03209_case_035", "p03209_case_036", "p03209_case_037", "p03209_case_038", "p03209_case_039", "p03209_case_040", "p03209_case_041", "p03209_case_042", "p03209_case_043", "p03209_case_044", "p03209_case_045", "p03209_case_046", "p03209_case_047", "p03209_case_048", "p03209_case_049", "p03209_case_050", "p03209_case_051", "p03209_case_052", "p03209_case_053", "p03209_case_054", "p03209_case_055", "p03209_case_056", "p03209_case_057", "p03209_case_058", "p03209_case_059", "p03209_case_060", "p03209_case_061", "p03209_case_062", "p03209_case_063", "p03209_case_064", "p03209_case_065", "p03209_case_066", "p03209_case_067", "p03209_case_068", "p03209_case_069", "p03209_case_070", "p03209_case_071", "p03209_case_072", "p03209_case_073", "p03209_case_074", "p03209_case_075", "p03209_case_076", "p03209_case_077", "p03209_case_078", "p03209_case_079", "p03209_case_080", "p03209_case_081", "p03209_case_082", "p03209_case_083", "p03209_case_084", "p03209_case_085", "p03209_case_086", "p03209_case_087", "p03209_case_088", "p03209_case_089", "p03209_case_090", "p03209_case_091", "p03209_case_092", "p03209_case_093", "p03209_case_094", "p03209_case_095", "p03209_case_096", "p03209_case_097", "p03209_case_098", "p03209_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N, X = [int(elem) for elem in input().split()]\nh_burger = [None] * (N + 1)\np_burger = [None] * (N + 1)\nh_burger[0] = 1\np_burger[0] = 1\nfor i in range(1, N + 1):\n h_burger[i] = h_burger[i - 1] * 2 + 3\n p_burger[i] = p_burger[i - 1] * 2 + 1\n\n\ndef num_patties(l, x):\n if l == 0:\n return 1 if x >= 1 else 0\n else:\n if x <= h_burger[l - 1] + 1:\n return num_patties(l - 1, x - 1)\n elif x == h_burger[l - 1] + 2:\n return p_burger[l - 1] + 1\n else:\n return p_burger[l - 1] + 1 + num_patties(l - 1, x - h_burger[l - 1] - 2)\n\n\nprint(num_patties(N, X))\n", "fast_code_sha256": "aee25fc1c6c7117b0696d60777759058c8b4c7269d39bb9df87e8ea383e0bb31", "fast_id": "p03209_aee25fc1c6c7117b0696d60777759058c8b4c7269d39bb9df87e8ea383e0bb31", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N, X = [int(elem) for elem in input().split()]\nh_burger = [None] * (N + 1)\np_burger = [None] * (N + 1)\nh_burger[0] = 1\np_burger[0] = 1\nfor i in range(1, N + 1):\n h_burger[i] = h_burger[i - 1] * 2 + 3\n p_burger[i] = p_burger[i - 1] * 2 + 1\n\n\ndef num_patties(l, x):\n if l == 0:\n return 1 if x >= 1 else 0\n else:\n if x <= h_burger[l - 1] + 1:\n return num_patties(l - 1, x - 1)\n elif x == h_burger[l - 1] + 2:\n return p_burger[l - 1] + 1\n else:\n return p_burger[l - 1] + 1 + num_patties(l - 1, x - h_burger[l - 1] - 2)\n\n\nprint(num_patties(N, X))\n", "measured_fast_code_sha256": "aee25fc1c6c7117b0696d60777759058c8b4c7269d39bb9df87e8ea383e0bb31", "measured_slow_code": "N, X = list(map(int, input().split()))\n# 層の総数\nT = [1]\nfor i in range(1, 50 + 1):\n T.append(T[i - 1] * 2 + 3)\n\n\ndef hash(n, x):\n return \"{0:d},{1:d}\".format(n, x)\n\n\n# レベルnバーガーの下からx層内のパティの数\nmemo = dict()\n\n\ndef solve(n, x):\n global T, memo\n if hash(n, x) in memo:\n return memo[hash(n, x)]\n if n == 0 and x >= 1:\n memo[hash(n, x)] = 1\n return 1\n if x <= 1:\n memo[hash(n, x)] = 0\n return 0\n memo[hash(n, x)] = solve(n - 1, min(x - 1, T[n - 1]))\n if x >= T[n - 1] + 2:\n memo[hash(n, x)] += 1\n if x >= T[n - 1] + 3:\n memo[hash(n, x)] += solve(n - 1, min(x - 1 - T[n - 1] - 1, T[n - 1]))\n return memo[hash(n, x)]\n\n\nprint((solve(N, X)))\n", "measured_slow_code_sha256": "d810806da4e3ff396dd2f9e6a8463b4981d8f62dd34c3ba133bb44352184e910", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.6198338516971837, "pair_id": "python_v2_d6d95a12f168394003a89a39", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03209", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03209_aee25fc1c6c7117b0696d60777759058c8b4c7269d39bb9df87e8ea383e0bb31.jsonl.gz", "inputs": "reproduction/python/inputs/p03209.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03209_d810806da4e3ff396dd2f9e6a8463b4981d8f62dd34c3ba133bb44352184e910.jsonl.gz"}, "slow_code": "N, X = list(map(int, input().split()))\n\nT = [1]\nfor i in range(1, 50 + 1):\n T.append(T[i - 1] * 2 + 3)\n\n\ndef hash(n, x):\n return \"{0:d},{1:d}\".format(n, x)\n\n\nmemo = dict()\n\n\ndef solve(n, x):\n global T, memo\n if hash(n, x) in memo:\n return memo[hash(n, x)]\n if n == 0 and x >= 1:\n memo[hash(n, x)] = 1\n return 1\n if x <= 1:\n memo[hash(n, x)] = 0\n return 0\n memo[hash(n, x)] = solve(n - 1, min(x - 1, T[n - 1]))\n if x >= T[n - 1] + 2:\n memo[hash(n, x)] += 1\n if x >= T[n - 1] + 3:\n memo[hash(n, x)] += solve(n - 1, min(x - 1 - T[n - 1] - 1, T[n - 1]))\n return memo[hash(n, x)]\n\n\nprint((solve(N, X)))\n", "slow_code_sha256": "dbd3b0158d3748e0d99cec055f9e692949bfea6a1e16dd750ed0447f840bf070", "slow_id": "p03209_d810806da4e3ff396dd2f9e6a8463b4981d8f62dd34c3ba133bb44352184e910", "speedup": 2.3704414221330956, "stratum": "2-4", "within_pair_jaccard": 0.43902439024390244, "workload": {"case_count": 100, "description": "Level-0 burger is one patty. Level L>0 stacks bun, level-(L-1) burger, patty, level-(L-1) burger, bun, from bottom upward. Count patties in the bottom X layers of a level-N burger; the layered object is implicit, not listed. Observed inputs: N=1..50 (median 27.5); X=1..4503599627370493.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 20, "median": 11.0, "min": 4}, "input_format": ["N X"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p02660_case_000", "p02660_case_001", "p02660_case_002", "p02660_case_003", "p02660_case_004", "p02660_case_005", "p02660_case_006", "p02660_case_007", "p02660_case_008", "p02660_case_009", "p02660_case_010", "p02660_case_011", "p02660_case_012", "p02660_case_013", "p02660_case_014", "p02660_case_015", "p02660_case_016", "p02660_case_017", "p02660_case_018", "p02660_case_019", "p02660_case_020", "p02660_case_021", "p02660_case_022", "p02660_case_023", "p02660_case_024", "p02660_case_025", "p02660_case_026", "p02660_case_027", "p02660_case_028", "p02660_case_029", "p02660_case_030", "p02660_case_031", "p02660_case_032", "p02660_case_033", "p02660_case_034", "p02660_case_035", "p02660_case_036", "p02660_case_037", "p02660_case_038", "p02660_case_039", "p02660_case_040", "p02660_case_041", "p02660_case_042", "p02660_case_043", "p02660_case_044", "p02660_case_045", "p02660_case_046", "p02660_case_047", "p02660_case_048", "p02660_case_049", "p02660_case_050", "p02660_case_051", "p02660_case_052", "p02660_case_053", "p02660_case_054", "p02660_case_055", "p02660_case_056", "p02660_case_057", "p02660_case_058", "p02660_case_059", "p02660_case_060", "p02660_case_061", "p02660_case_062", "p02660_case_063", "p02660_case_064", "p02660_case_065", "p02660_case_066", "p02660_case_067", "p02660_case_068", "p02660_case_069", "p02660_case_070", "p02660_case_071", "p02660_case_072", "p02660_case_073", "p02660_case_074", "p02660_case_075", "p02660_case_076", "p02660_case_077", "p02660_case_078", "p02660_case_079", "p02660_case_080", "p02660_case_081", "p02660_case_082", "p02660_case_083", "p02660_case_084", "p02660_case_085", "p02660_case_086", "p02660_case_087", "p02660_case_088", "p02660_case_089", "p02660_case_090", "p02660_case_091", "p02660_case_092", "p02660_case_093", "p02660_case_094", "p02660_case_095", "p02660_case_096", "p02660_case_097", "p02660_case_098", "p02660_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import collections\n\nn = int(eval(input()))\n\n\ndef prime_factorize(n):\n a = []\n while n % 2 == 0:\n a.append(2)\n n //= 2\n f = 3\n while f * f <= n:\n if n % f == 0:\n a.append(f)\n n //= f\n else:\n f += 2\n if n != 1:\n a.append(n)\n return a\n\n\nif n == 1:\n print((0))\n exit()\nc = collections.Counter(prime_factorize(n))\n_, counts = list(zip(*c.most_common()))\nl = list(counts)\nans = 0\nif l == [1]:\n print((1))\n exit()\nfor i in l:\n for j in range(1, i + 1):\n if i >= j:\n i -= j\n ans += 1\nprint(ans)\n", "fast_code_sha256": "6075c97bf0f972f7286afb7cfa0524e287a681f72f4e163a5b359fd4e3f8ec6c", "fast_id": "p02660_acd1cbb7218aac5a6a0561a8aea205eca767858eefdb53ca85ef5c35cb2d3087", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import collections\n\nn = int(eval(input()))\n\n\ndef prime_factorize(n):\n a = []\n while n % 2 == 0:\n a.append(2)\n n //= 2\n f = 3\n while f * f <= n:\n if n % f == 0:\n a.append(f)\n n //= f\n else:\n f += 2\n if n != 1:\n a.append(n)\n return a\n\n\nif n == 1: # 1\n print((0))\n exit()\nc = collections.Counter(prime_factorize(n))\n_, counts = list(zip(*c.most_common()))\nl = list(counts)\nans = 0\nif l == [1]: # prime number\n print((1))\n exit()\nfor i in l:\n for j in range(1, i + 1):\n if i >= j:\n i -= j\n ans += 1\nprint(ans)\n", "measured_fast_code_sha256": "acd1cbb7218aac5a6a0561a8aea205eca767858eefdb53ca85ef5c35cb2d3087", "measured_slow_code": "n = int(eval(input()))\na = p = 1\nwhile p < 6**8:\n c = t = 0\n p += 1\n while n % p < 1:\n n //= p\n x = c == t\n t += x\n c += 1 - t * x\n a += x\nprint((a - (n < 2)))\n", "measured_slow_code_sha256": "8301217799053ca8035ba7e5e9be7529b06a7e4ccf5a0cb39174661c0dc1c031", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2841.665413912927, "pair_id": "python_v2_8c872d6d20df1724b2de46bc", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02660", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02660_acd1cbb7218aac5a6a0561a8aea205eca767858eefdb53ca85ef5c35cb2d3087.jsonl.gz", "inputs": "reproduction/python/inputs/p02660.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02660_8301217799053ca8035ba7e5e9be7529b06a7e4ccf5a0cb39174661c0dc1c031.jsonl.gz"}, "slow_code": "n = int(eval(input()))\na = p = 1\nwhile p < 6**8:\n c = t = 0\n p += 1\n while n % p < 1:\n n //= p\n x = c == t\n t += x\n c += 1 - t * x\n a += x\nprint((a - (n < 2)))\n", "slow_code_sha256": "8301217799053ca8035ba7e5e9be7529b06a7e4ccf5a0cb39174661c0dc1c031", "slow_id": "p02660_8301217799053ca8035ba7e5e9be7529b06a7e4ccf5a0cb39174661c0dc1c031", "speedup": 1158.7164952305395, "stratum": "8+", "within_pair_jaccard": 0.275, "workload": {"case_count": 100, "description": "Starting with integer N, repeatedly divide by a prime power p^e with e>=1 that divides the current value and has never been chosen before. Maximize the number of divisions. Observed inputs: N=1..992540114224 (median 452657355.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 13, "median": 10.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p02789_case_000", "p02789_case_001", "p02789_case_002", "p02789_case_003", "p02789_case_004", "p02789_case_005", "p02789_case_006", "p02789_case_007", "p02789_case_008", "p02789_case_009", "p02789_case_010", "p02789_case_011", "p02789_case_012", "p02789_case_013", "p02789_case_014", "p02789_case_015", "p02789_case_016", "p02789_case_017", "p02789_case_018", "p02789_case_019", "p02789_case_020", "p02789_case_021", "p02789_case_022", "p02789_case_023", "p02789_case_024", "p02789_case_025", "p02789_case_026", "p02789_case_027", "p02789_case_028", "p02789_case_029", "p02789_case_030", "p02789_case_031", "p02789_case_032", "p02789_case_033", "p02789_case_034", "p02789_case_035", "p02789_case_036", "p02789_case_037", "p02789_case_038", "p02789_case_039", "p02789_case_040", "p02789_case_041", "p02789_case_042", "p02789_case_043", "p02789_case_044", "p02789_case_045", "p02789_case_046", "p02789_case_047", "p02789_case_048", "p02789_case_049", "p02789_case_050", "p02789_case_051", "p02789_case_052", "p02789_case_053", "p02789_case_054", "p02789_case_055", "p02789_case_056", "p02789_case_057", "p02789_case_058", "p02789_case_059", "p02789_case_060", "p02789_case_061", "p02789_case_062", "p02789_case_063", "p02789_case_064", "p02789_case_065", "p02789_case_066", "p02789_case_067", "p02789_case_068", "p02789_case_069", "p02789_case_070", "p02789_case_071", "p02789_case_072", "p02789_case_073", "p02789_case_074", "p02789_case_075", "p02789_case_076", "p02789_case_077", "p02789_case_078", "p02789_case_079", "p02789_case_080", "p02789_case_081", "p02789_case_082", "p02789_case_083", "p02789_case_084", "p02789_case_085", "p02789_case_086", "p02789_case_087", "p02789_case_088", "p02789_case_089", "p02789_case_090", "p02789_case_091", "p02789_case_092", "p02789_case_093", "p02789_case_094", "p02789_case_095", "p02789_case_096", "p02789_case_097", "p02789_case_098", "p02789_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n, m = list(map(int, input().split()))\nif m == n:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "fast_code_sha256": "28e9f5b5de0ec96f669439e47f483ca1889df19afb3fbefdc72439020ef1b917", "fast_id": "p02789_28e9f5b5de0ec96f669439e47f483ca1889df19afb3fbefdc72439020ef1b917", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n, m = list(map(int, input().split()))\nif m == n:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "measured_fast_code_sha256": "28e9f5b5de0ec96f669439e47f483ca1889df19afb3fbefdc72439020ef1b917", "measured_slow_code": "# coding: utf-8\n# submission # - User: herp_sy\n# https://atcoder.jp/contests/\n#\n# lang: Python3 (3.4.3)\nimport math\nimport statistics\nimport numpy as np\nimport queue\nimport itertools\n\nn, m = list(map(int, input().split()))\nif n == m:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "measured_slow_code_sha256": "3b3c9592d05d78419094081aeeb834d7351702df4b6152b2850a5ab58ae1e1e1", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2174.3374429107216, "pair_id": "python_v2_119113b5120d7d04f9573e1e", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02789", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02789_28e9f5b5de0ec96f669439e47f483ca1889df19afb3fbefdc72439020ef1b917.jsonl.gz", "inputs": "reproduction/python/inputs/p02789.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02789_3b3c9592d05d78419094081aeeb834d7351702df4b6152b2850a5ab58ae1e1e1.jsonl.gz"}, "slow_code": "import math\nimport statistics\nimport numpy as np\nimport queue\nimport itertools\n\nn, m = list(map(int, input().split()))\nif n == m:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "slow_code_sha256": "b67e95e628852cc5e8281d284b620a3652c42bb82548c79c6e24811247e94916", "slow_id": "p02789_3b3c9592d05d78419094081aeeb834d7351702df4b6152b2850a5ab58ae1e1e1", "speedup": 2171.894796864675, "stratum": "8+", "within_pair_jaccard": 0.6, "workload": {"case_count": 100, "description": "A submission has passed M of its N required test cases. Determine whether it receives acceptance, which requires passing every case. Observed inputs: N=1..100 (median 44); M=0..100 (median 14.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 8, "median": 6.0, "min": 4}, "input_format": ["N M"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p02959_case_000", "p02959_case_001", "p02959_case_002", "p02959_case_003", "p02959_case_004", "p02959_case_005", "p02959_case_006", "p02959_case_007", "p02959_case_008", "p02959_case_009", "p02959_case_010", "p02959_case_011", "p02959_case_012", "p02959_case_013", "p02959_case_014", "p02959_case_015", "p02959_case_016", "p02959_case_017", "p02959_case_018", "p02959_case_019", "p02959_case_020", "p02959_case_021", "p02959_case_022", "p02959_case_023", "p02959_case_024", "p02959_case_025", "p02959_case_026", "p02959_case_027", "p02959_case_028", "p02959_case_029", "p02959_case_030", "p02959_case_031", "p02959_case_032", "p02959_case_033", "p02959_case_034", "p02959_case_035", "p02959_case_036", "p02959_case_037", "p02959_case_038", "p02959_case_039", "p02959_case_040", "p02959_case_041", "p02959_case_042", "p02959_case_043", "p02959_case_044", "p02959_case_045", "p02959_case_046", "p02959_case_047", "p02959_case_048", "p02959_case_049", "p02959_case_050", "p02959_case_051", "p02959_case_052", "p02959_case_053", "p02959_case_054", "p02959_case_055", "p02959_case_056", "p02959_case_057", "p02959_case_058", "p02959_case_059", "p02959_case_060", "p02959_case_061", "p02959_case_062", "p02959_case_063", "p02959_case_064", "p02959_case_065", "p02959_case_066", "p02959_case_067", "p02959_case_068", "p02959_case_069", "p02959_case_070", "p02959_case_071", "p02959_case_072", "p02959_case_073", "p02959_case_074", "p02959_case_075", "p02959_case_076", "p02959_case_077", "p02959_case_078", "p02959_case_079", "p02959_case_080", "p02959_case_081", "p02959_case_082", "p02959_case_083", "p02959_case_084", "p02959_case_085", "p02959_case_086", "p02959_case_087", "p02959_case_088", "p02959_case_089", "p02959_case_090", "p02959_case_091", "p02959_case_092", "p02959_case_093", "p02959_case_094", "p02959_case_095", "p02959_case_096", "p02959_case_097", "p02959_case_098", "p02959_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\na = list(map(int, input().split()))\nb = list(map(int, input().split()))\nb.append(0)\nnum = 0\nc = 0\nfor i in range(n):\n if a[i] <= c:\n num += a[i]\n c = b[i]\n else:\n a[i] -= c\n num += c\n if b[i] >= a[i]:\n num += a[i]\n c = b[i] - a[i]\n else:\n num += b[i]\n c = 0\nif b[n] + c >= a[n]:\n num += a[n]\nelse:\n num += b[n] + c\nprint(num)\n", "fast_code_sha256": "a03425c6657bb779a3ac03139b0087ddc2a33f8be7110bc6cab8bc331b66a921", "fast_id": "p02959_a7e135233c8fee88f261708718fc7f3df5ae20618002c01f2b5ed9b2cf19600d", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\na = list(map(int, input().split()))\nb = list(map(int, input().split()))\nb.append(0) # n+1番目を作っとく\nnum = 0\nc = 0\nfor i in range(n):\n if a[i] <= c:\n num += a[i]\n c = b[i]\n else:\n a[i] -= c\n num += c\n if b[i] >= a[i]:\n num += a[i]\n c = b[i] - a[i]\n else:\n num += b[i]\n c = 0\nif b[n] + c >= a[n]:\n num += a[n]\nelse:\n num += b[n] + c\nprint(num)\n", "measured_fast_code_sha256": "a7e135233c8fee88f261708718fc7f3df5ae20618002c01f2b5ed9b2cf19600d", "measured_slow_code": "N = int(eval(input()))\nA = list(map(int, input().split()))\nB = list(map(int, input().split()))\nans = 0\nfor i in range(N):\n if i % 2 == 0:\n if A[i // 2] >= B[i // 2]:\n A[i // 2] -= B[i // 2]\n ans += B[i // 2]\n B[i // 2] = 0\n else:\n B[i // 2] -= A[i // 2]\n ans += A[i // 2]\n A[i // 2] = 0\n if A[i // 2 + 1] >= B[i // 2]:\n A[i // 2 + 1] -= B[i // 2]\n ans += B[i // 2]\n B[i // 2] = 0\n else:\n B[i // 2] -= A[i // 2 + 1]\n ans += A[i // 2 + 1]\n A[i // 2 + 1] = 0\n else:\n if A[N - i // 2] >= B[N - i // 2 - 1]:\n A[N - i // 2] -= B[N - i // 2 - 1]\n ans += B[N - i // 2 - 1]\n B[N - i // 2 - 1] = 0\n else:\n B[N - i // 2 - 1] -= A[N - i // 2]\n ans += A[N - i // 2]\n A[N - i // 2] = 0\n if A[N - i // 2 - 1] >= B[N - i // 2 - 1]:\n A[N - i // 2 - 1] -= B[N - i // 2 - 1]\n ans += B[N - i // 2 - 1]\n B[N - i // 2 - 1] = 0\n else:\n B[N - i // 2 - 1] -= A[N - i // 2 - 1]\n ans += A[N - i // 2 - 1]\n A[N - i // 2 - 1] = 0\nprint(ans)\n", "measured_slow_code_sha256": "f0395674e51675bd438b96a7f18fa9739566f756efa1ea79ea087d0b83a10e1f", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.313349369348278, "pair_id": "python_v2_1861beebb3778b8953057324", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02959", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02959_a7e135233c8fee88f261708718fc7f3df5ae20618002c01f2b5ed9b2cf19600d.jsonl.gz", "inputs": "reproduction/python/inputs/p02959.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02959_f0395674e51675bd438b96a7f18fa9739566f756efa1ea79ea087d0b83a10e1f.jsonl.gz"}, "slow_code": "N = int(eval(input()))\nA = list(map(int, input().split()))\nB = list(map(int, input().split()))\nans = 0\nfor i in range(N):\n if i % 2 == 0:\n if A[i // 2] >= B[i // 2]:\n A[i // 2] -= B[i // 2]\n ans += B[i // 2]\n B[i // 2] = 0\n else:\n B[i // 2] -= A[i // 2]\n ans += A[i // 2]\n A[i // 2] = 0\n if A[i // 2 + 1] >= B[i // 2]:\n A[i // 2 + 1] -= B[i // 2]\n ans += B[i // 2]\n B[i // 2] = 0\n else:\n B[i // 2] -= A[i // 2 + 1]\n ans += A[i // 2 + 1]\n A[i // 2 + 1] = 0\n else:\n if A[N - i // 2] >= B[N - i // 2 - 1]:\n A[N - i // 2] -= B[N - i // 2 - 1]\n ans += B[N - i // 2 - 1]\n B[N - i // 2 - 1] = 0\n else:\n B[N - i // 2 - 1] -= A[N - i // 2]\n ans += A[N - i // 2]\n A[N - i // 2] = 0\n if A[N - i // 2 - 1] >= B[N - i // 2 - 1]:\n A[N - i // 2 - 1] -= B[N - i // 2 - 1]\n ans += B[N - i // 2 - 1]\n B[N - i // 2 - 1] = 0\n else:\n B[N - i // 2 - 1] -= A[N - i // 2 - 1]\n ans += A[N - i // 2 - 1]\n A[N - i // 2 - 1] = 0\nprint(ans)\n", "slow_code_sha256": "f0395674e51675bd438b96a7f18fa9739566f756efa1ea79ea087d0b83a10e1f", "slow_id": "p02959_f0395674e51675bd438b96a7f18fa9739566f756efa1ea79ea087d0b83a10e1f", "speedup": 2.3829557320095733, "stratum": "2-4", "within_pair_jaccard": 0.56, "workload": {"case_count": 100, "description": "N+1 towns hold A_i monsters. Hero i may defeat at most B_i monsters in total, split between towns i and i+1. Maximize the number defeated by all N cooperating heroes. Observed inputs: N=1..100000 (median 5500); A_i=1..1000000000; B_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 2200018, "median": 70232.0, "min": 8}, "input_format": ["N\nA_1 ... A_(N+1)\nB_1 ... B_N"], "input_format_status": "source_input_section", "input_lines": {"max": 3, "median": 3.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200002, "median": 11002.0, "min": 4}}} -{"case_ids": ["p03774_case_000", "p03774_case_001", "p03774_case_002", "p03774_case_003", "p03774_case_004", "p03774_case_005", "p03774_case_006", "p03774_case_007", "p03774_case_008", "p03774_case_009", "p03774_case_010", "p03774_case_011", "p03774_case_012", "p03774_case_013", "p03774_case_014", "p03774_case_015", "p03774_case_016", "p03774_case_017", "p03774_case_018", "p03774_case_019", "p03774_case_020", "p03774_case_021", "p03774_case_022", "p03774_case_023", "p03774_case_024", "p03774_case_025", "p03774_case_026", "p03774_case_027", "p03774_case_028", "p03774_case_029", "p03774_case_030", "p03774_case_031", "p03774_case_032", "p03774_case_033", "p03774_case_034", "p03774_case_035", "p03774_case_036", "p03774_case_037", "p03774_case_038", "p03774_case_039", "p03774_case_040", "p03774_case_041", "p03774_case_042", "p03774_case_043", "p03774_case_044", "p03774_case_045", "p03774_case_046", "p03774_case_047", "p03774_case_048", "p03774_case_049", "p03774_case_050", "p03774_case_051", "p03774_case_052", "p03774_case_053", "p03774_case_054", "p03774_case_055", "p03774_case_056", "p03774_case_057", "p03774_case_058", "p03774_case_059", "p03774_case_060", "p03774_case_061", "p03774_case_062", "p03774_case_063", "p03774_case_064", "p03774_case_065", "p03774_case_066", "p03774_case_067", "p03774_case_068", "p03774_case_069", "p03774_case_070", "p03774_case_071", "p03774_case_072", "p03774_case_073", "p03774_case_074", "p03774_case_075", "p03774_case_076", "p03774_case_077", "p03774_case_078", "p03774_case_079", "p03774_case_080", "p03774_case_081", "p03774_case_082", "p03774_case_083", "p03774_case_084", "p03774_case_085", "p03774_case_086", "p03774_case_087", "p03774_case_088", "p03774_case_089", "p03774_case_090", "p03774_case_091", "p03774_case_092", "p03774_case_093", "p03774_case_094", "p03774_case_095", "p03774_case_096", "p03774_case_097", "p03774_case_098", "p03774_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "executable_AST_equal_except_explicit_explanatory_string_removal_and_all_frozen_inputs_checker_pass", "fast_code": "[n, m] = [int(i) for i in input().split()]\nab = []\ncd = []\nk = []\nbox = []\nl = 0\nfor i in range(n):\n ab.append([int(j) for j in input().split()])\nfor i in range(m):\n cd.append([int(j) for j in input().split()])\nfor i in range(n):\n for j in range(m):\n k.append(abs(ab[i][0] - cd[j][0]) + abs(ab[i][1] - cd[j][1]))\n\n box.append(k)\n k = []\nfor i in range(n):\n for j in box[i]:\n if j == min(box[i]):\n l = l + 1\n print(l)\n break\n l = l + 1\n l = 0\n", "fast_code_sha256": "384a5d733e76e69b7a0401a837a7ec0dbb7c989f5540024e2bd02472ab2350a6", "fast_id": "p03774_2cb51d7e157dfbed61a69bc179ed26f7dd9330b03553c6190f06c454f346cefc", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "\"\"\"\nhttps://abc057.contest.atcoder.jp/tasks/abc057_b\n\"\"\"\n[n, m] = [int(i) for i in input().split()]\nab = []\ncd = []\nk = []\nbox = []\nl = 0\nfor i in range(n):\n ab.append([int(j) for j in input().split()])\nfor i in range(m):\n cd.append([int(j) for j in input().split()])\nfor i in range(n):\n for j in range(m):\n k.append(abs(ab[i][0] - cd[j][0]) + abs(ab[i][1] - cd[j][1]))\n # kには全てのjについてのマンハッタン距離が入る\n box.append(k)\n k = []\nfor i in range(n):\n for j in box[i]:\n if j == min(box[i]):\n l = l + 1\n print(l)\n break\n l = l + 1\n l = 0\n", "measured_fast_code_sha256": "2cb51d7e157dfbed61a69bc179ed26f7dd9330b03553c6190f06c454f346cefc", "measured_slow_code": "import numpy as np\n\nN, M = list(map(int, input().split()))\nab = []\nfor i in range(N):\n tmp = list(map(int, input().split()))\n ab.append(tmp)\nab = np.array(ab)\ndist = np.full([N, M], np.inf)\nfor m in range(M):\n tmp = np.array(list(map(int, input().split())))\n for n in range(N):\n dist[n, m] = np.abs(ab[n] - tmp).sum()\ndist = dist.astype(\"int\")\nfor d in dist:\n print((d.argmin() + 1))\n", "measured_slow_code_sha256": "4ab93e91c9006f8793ec4a581894d15fcba322003404950855ee770b9ed45cb3", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 193.68469434256423, "pair_id": "python_v2_7096261a9bf4e5484ecb156a", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03774", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03774_2cb51d7e157dfbed61a69bc179ed26f7dd9330b03553c6190f06c454f346cefc.jsonl.gz", "inputs": "reproduction/python/inputs/p03774.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03774_4ab93e91c9006f8793ec4a581894d15fcba322003404950855ee770b9ed45cb3.jsonl.gz"}, "slow_code": "import numpy as np\n\nN, M = list(map(int, input().split()))\nab = []\nfor i in range(N):\n tmp = list(map(int, input().split()))\n ab.append(tmp)\nab = np.array(ab)\ndist = np.full([N, M], np.inf)\nfor m in range(M):\n tmp = np.array(list(map(int, input().split())))\n for n in range(N):\n dist[n, m] = np.abs(ab[n] - tmp).sum()\ndist = dist.astype(\"int\")\nfor d in dist:\n print((d.argmin() + 1))\n", "slow_code_sha256": "4ab93e91c9006f8793ec4a581894d15fcba322003404950855ee770b9ed45cb3", "slow_id": "p03774_4ab93e91c9006f8793ec4a581894d15fcba322003404950855ee770b9ed45cb3", "speedup": 123.95698414216076, "stratum": "8+", "within_pair_jaccard": 0.34146341463414637, "workload": {"case_count": 100, "description": "For each student (a_i,b_i), output the 1-based index of the nearest checkpoint (c_j,d_j) by Manhattan distance. Break ties by the smallest checkpoint index; repeated coordinates are allowed. Observed inputs: N=1..50 (median 16); M=1..50 (median 10); a_i=-100000000..100000000; b_i=-100000000..100000000; c_j=-100000000..100000000; d_j=-100000000..100000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 2106, "median": 458.5, "min": 12}, "input_format": ["N M\na_1 b_1\n...\na_N b_N\nc_1 d_1\n...\nc_M d_M"], "input_format_status": "source_input_section", "input_lines": {"max": 101, "median": 33.5, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 202, "median": 67.0, "min": 6}}} -{"case_ids": ["p03294_case_000", "p03294_case_001", "p03294_case_002", "p03294_case_003", "p03294_case_004", "p03294_case_005", "p03294_case_006", "p03294_case_007", "p03294_case_008", "p03294_case_009", "p03294_case_010", "p03294_case_011", "p03294_case_012", "p03294_case_013", "p03294_case_014", "p03294_case_015", "p03294_case_016", "p03294_case_017", "p03294_case_018", "p03294_case_019", "p03294_case_020", "p03294_case_021", "p03294_case_022", "p03294_case_023", "p03294_case_024", "p03294_case_025", "p03294_case_026", "p03294_case_027", "p03294_case_028", "p03294_case_029", "p03294_case_030", "p03294_case_031", "p03294_case_032", "p03294_case_033", "p03294_case_034", "p03294_case_035", "p03294_case_036", "p03294_case_037", "p03294_case_038", "p03294_case_039", "p03294_case_040", "p03294_case_041", "p03294_case_042", "p03294_case_043", "p03294_case_044", "p03294_case_045", "p03294_case_046", "p03294_case_047", "p03294_case_048", "p03294_case_049", "p03294_case_050", "p03294_case_051", "p03294_case_052", "p03294_case_053", "p03294_case_054", "p03294_case_055", "p03294_case_056", "p03294_case_057", "p03294_case_058", "p03294_case_059", "p03294_case_060", "p03294_case_061", "p03294_case_062", "p03294_case_063", "p03294_case_064", "p03294_case_065", "p03294_case_066", "p03294_case_067", "p03294_case_068", "p03294_case_069", "p03294_case_070", "p03294_case_071", "p03294_case_072", "p03294_case_073", "p03294_case_074", "p03294_case_075", "p03294_case_076", "p03294_case_077", "p03294_case_078", "p03294_case_079", "p03294_case_080", "p03294_case_081", "p03294_case_082", "p03294_case_083", "p03294_case_084", "p03294_case_085", "p03294_case_086", "p03294_case_087", "p03294_case_088", "p03294_case_089", "p03294_case_090", "p03294_case_091", "p03294_case_092", "p03294_case_093", "p03294_case_094", "p03294_case_095", "p03294_case_096", "p03294_case_097", "p03294_case_098", "p03294_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\na = list(map(int, input().split()))\nprint((sum(a) - len(a)))\n", "fast_code_sha256": "be4bf099d4925b23bdb6f325ad17943faa753fc5add8694a2b6b0e21a2989788", "fast_id": "p03294_be4bf099d4925b23bdb6f325ad17943faa753fc5add8694a2b6b0e21a2989788", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\na = list(map(int, input().split()))\nprint((sum(a) - len(a)))\n", "measured_fast_code_sha256": "be4bf099d4925b23bdb6f325ad17943faa753fc5add8694a2b6b0e21a2989788", "measured_slow_code": "import math\n\nn = int(eval(input()))\na = list(map(int, input().split()))\ncommon_num = 1\nfor num in a:\n common_num = (common_num * num) // math.gcd(common_num, num)\ntotal = 0\nfor num in a:\n total += (common_num - 1) % num\nprint(total)\n", "measured_slow_code_sha256": "13a0acff6be960ac2d9102d9dbcb9b4a40285e0396d51e99ee1149098593acf0", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4.712625517584648, "pair_id": "python_v2_a9028adcd4be0c7ddd2637cd", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03294", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03294_be4bf099d4925b23bdb6f325ad17943faa753fc5add8694a2b6b0e21a2989788.jsonl.gz", "inputs": "reproduction/python/inputs/p03294.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03294_13a0acff6be960ac2d9102d9dbcb9b4a40285e0396d51e99ee1149098593acf0.jsonl.gz"}, "slow_code": "import math\n\nn = int(eval(input()))\na = list(map(int, input().split()))\ncommon_num = 1\nfor num in a:\n common_num = (common_num * num) // math.gcd(common_num, num)\ntotal = 0\nfor num in a:\n total += (common_num - 1) % num\nprint(total)\n", "slow_code_sha256": "13a0acff6be960ac2d9102d9dbcb9b4a40285e0396d51e99ee1149098593acf0", "slow_id": "p03294_13a0acff6be960ac2d9102d9dbcb9b4a40285e0396d51e99ee1149098593acf0", "speedup": 6.929157403396712, "stratum": "4-8", "within_pair_jaccard": 0.45, "workload": {"case_count": 100, "description": "For N positive integers a_i, maximize sum_i (m mod a_i) over all nonnegative integers m. Observed inputs: N=2..3000 (median 3000); a_i=2..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 21005, "median": 13229.0, "min": 6}, "input_format": ["N\na_1 ... a_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3001, "median": 3001.0, "min": 3}}} -{"case_ids": ["p02683_case_000", "p02683_case_001", "p02683_case_002", "p02683_case_003", "p02683_case_004", "p02683_case_005", "p02683_case_006", "p02683_case_007", "p02683_case_008", "p02683_case_009", "p02683_case_010", "p02683_case_011", "p02683_case_012", "p02683_case_013", "p02683_case_014", "p02683_case_015", "p02683_case_016", "p02683_case_017", "p02683_case_018", "p02683_case_019", "p02683_case_020", "p02683_case_021", "p02683_case_022", "p02683_case_023", "p02683_case_024", "p02683_case_025", "p02683_case_026", "p02683_case_027", "p02683_case_028", "p02683_case_029", "p02683_case_030", "p02683_case_031", "p02683_case_032", "p02683_case_033", "p02683_case_034", "p02683_case_035", "p02683_case_036", "p02683_case_037", "p02683_case_038", "p02683_case_039", "p02683_case_040", "p02683_case_041", "p02683_case_042", "p02683_case_043", "p02683_case_044", "p02683_case_045", "p02683_case_046", "p02683_case_047", "p02683_case_048", "p02683_case_049", "p02683_case_050", "p02683_case_051", "p02683_case_052", "p02683_case_053", "p02683_case_054", "p02683_case_055", "p02683_case_056", "p02683_case_057", "p02683_case_058", "p02683_case_059", "p02683_case_060", "p02683_case_061", "p02683_case_062", "p02683_case_063", "p02683_case_064", "p02683_case_065", "p02683_case_066", "p02683_case_067", "p02683_case_068", "p02683_case_069", "p02683_case_070", "p02683_case_071", "p02683_case_072", "p02683_case_073", "p02683_case_074", "p02683_case_075", "p02683_case_076", "p02683_case_077", "p02683_case_078", "p02683_case_079", "p02683_case_080", "p02683_case_081", "p02683_case_082", "p02683_case_083", "p02683_case_084", "p02683_case_085", "p02683_case_086", "p02683_case_087", "p02683_case_088", "p02683_case_089", "p02683_case_090", "p02683_case_091", "p02683_case_092", "p02683_case_093", "p02683_case_094", "p02683_case_095", "p02683_case_096", "p02683_case_097", "p02683_case_098", "p02683_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from sys import stdin, stdout\n\nrl = lambda: stdin.readline()\nrll = lambda: stdin.readline().split()\nrli = lambda: list(map(int, stdin.readline().split()))\nINF, NINF = float(\"inf\"), float(\"-inf\")\n\n\ndef submasks(m):\n s = m\n while s > 0:\n s = (s - 1) & m\n yield s\n\n\ndef main():\n n, m, x = rli()\n A = []\n for _ in range(n):\n A.append(list(rli()))\n mask = 0\n for i in range(n):\n mask |= 1 << i\n opt = INF\n\n def process(s):\n nonlocal opt\n i = 0\n cost = 0\n algs = [0 for _ in range(m)]\n while s:\n s, bit = divmod(s, 2)\n if bit:\n cost += A[i][0]\n for j in range(1, m + 1):\n algs[j - 1] += A[i][j]\n i += 1\n if all(skill >= x for skill in algs):\n opt = min(opt, cost)\n\n process(mask)\n for s in submasks(mask):\n process(s)\n print((opt if opt < INF else -1))\n stdout.close()\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "37547d6e3e4fe9151053c9941813a985731299e7d5c6bd11024df690659d7e40", "fast_id": "p02683_37547d6e3e4fe9151053c9941813a985731299e7d5c6bd11024df690659d7e40", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from sys import stdin, stdout\n\nrl = lambda: stdin.readline()\nrll = lambda: stdin.readline().split()\nrli = lambda: list(map(int, stdin.readline().split()))\nINF, NINF = float(\"inf\"), float(\"-inf\")\n\n\ndef submasks(m):\n s = m\n while s > 0:\n s = (s - 1) & m\n yield s\n\n\ndef main():\n n, m, x = rli()\n A = []\n for _ in range(n):\n A.append(list(rli()))\n mask = 0\n for i in range(n):\n mask |= 1 << i\n opt = INF\n\n def process(s):\n nonlocal opt\n i = 0\n cost = 0\n algs = [0 for _ in range(m)]\n while s:\n s, bit = divmod(s, 2)\n if bit:\n cost += A[i][0]\n for j in range(1, m + 1):\n algs[j - 1] += A[i][j]\n i += 1\n if all(skill >= x for skill in algs):\n opt = min(opt, cost)\n\n process(mask)\n for s in submasks(mask):\n process(s)\n print((opt if opt < INF else -1))\n stdout.close()\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "37547d6e3e4fe9151053c9941813a985731299e7d5c6bd11024df690659d7e40", "measured_slow_code": "import numpy as np\n\nN, M, X = list(map(int, input().split()))\nC = [0] * N\nA = np.zeros((N, M), int)\nfor i in range(N):\n C[i], *A[i] = list(map(int, input().split()))\nans = 12345678\nfor bit in range(1, 2**N):\n c = [C[i] for i in range(N) if bit & (1 << i)]\n a = [A[i] for i in range(N) if bit & (1 << i)]\n a = np.array(a)\n if all(a.sum(0) >= X):\n ans = min(ans, sum(c))\nprint((-1 if ans == 12345678 else ans))\n", "measured_slow_code_sha256": "7d2ea19f7649c5638e9e247851b1d4f026b3d507e489e455af46c5e783f4470d", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 94.68089321948597, "pair_id": "python_v2_e709e2adad1ad6b80fb88458", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02683", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02683_37547d6e3e4fe9151053c9941813a985731299e7d5c6bd11024df690659d7e40.jsonl.gz", "inputs": "reproduction/python/inputs/p02683.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02683_7d2ea19f7649c5638e9e247851b1d4f026b3d507e489e455af46c5e783f4470d.jsonl.gz"}, "slow_code": "import numpy as np\n\nN, M, X = list(map(int, input().split()))\nC = [0] * N\nA = np.zeros((N, M), int)\nfor i in range(N):\n C[i], *A[i] = list(map(int, input().split()))\nans = 12345678\nfor bit in range(1, 2**N):\n c = [C[i] for i in range(N) if bit & (1 << i)]\n a = [A[i] for i in range(N) if bit & (1 << i)]\n a = np.array(a)\n if all(a.sum(0) >= X):\n ans = min(ans, sum(c))\nprint((-1 if ans == 12345678 else ans))\n", "slow_code_sha256": "7d2ea19f7649c5638e9e247851b1d4f026b3d507e489e455af46c5e783f4470d", "slow_id": "p02683_7d2ea19f7649c5638e9e247851b1d4f026b3d507e489e455af46c5e783f4470d", "speedup": 39.18942993268453, "stratum": "8+", "within_pair_jaccard": 0.2714285714285714, "workload": {"case_count": 100, "description": "Choose a subset of N books of costs C_i. Reading book i once adds A_i,j to skill j, initially zero. Minimize cost while all M skills reach at least X, or report impossibility. Observed inputs: N=1..12 (median 6); M=1..12 (median 6); X=1..100000 (median 7000); C_i=1..99895; A_i_j=0..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 933, "median": 207.0, "min": 10}, "input_format": ["N M X\nC_1 A_1,1 ... A_1,M\n...\nC_N A_N,1 ... A_N,M"], "input_format_status": "source_input_section", "input_lines": {"max": 13, "median": 7.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 159, "median": 45.0, "min": 5}}} -{"case_ids": ["p03476_case_000", "p03476_case_001", "p03476_case_002", "p03476_case_003", "p03476_case_004", "p03476_case_005", "p03476_case_006", "p03476_case_007", "p03476_case_008", "p03476_case_009", "p03476_case_010", "p03476_case_011", "p03476_case_012", "p03476_case_013", "p03476_case_014", "p03476_case_015", "p03476_case_016", "p03476_case_017", "p03476_case_018", "p03476_case_019", "p03476_case_020", "p03476_case_021", "p03476_case_022", "p03476_case_023", "p03476_case_024", "p03476_case_025", "p03476_case_026", "p03476_case_027", "p03476_case_028", "p03476_case_029", "p03476_case_030", "p03476_case_031", "p03476_case_032", "p03476_case_033", "p03476_case_034", "p03476_case_035", "p03476_case_036", "p03476_case_037", "p03476_case_038", "p03476_case_039", "p03476_case_040", "p03476_case_041", "p03476_case_042", "p03476_case_043", "p03476_case_044", "p03476_case_045", "p03476_case_046", "p03476_case_047", "p03476_case_048", "p03476_case_049", "p03476_case_050", "p03476_case_051", "p03476_case_052", "p03476_case_053", "p03476_case_054", "p03476_case_055", "p03476_case_056", "p03476_case_057", "p03476_case_058", "p03476_case_059", "p03476_case_060", "p03476_case_061", "p03476_case_062", "p03476_case_063", "p03476_case_064", "p03476_case_065", "p03476_case_066", "p03476_case_067", "p03476_case_068", "p03476_case_069", "p03476_case_070", "p03476_case_071", "p03476_case_072", "p03476_case_073", "p03476_case_074", "p03476_case_075", "p03476_case_076", "p03476_case_077", "p03476_case_078", "p03476_case_079", "p03476_case_080", "p03476_case_081", "p03476_case_082", "p03476_case_083", "p03476_case_084", "p03476_case_085", "p03476_case_086", "p03476_case_087", "p03476_case_088", "p03476_case_089", "p03476_case_090", "p03476_case_091", "p03476_case_092", "p03476_case_093", "p03476_case_094", "p03476_case_095", "p03476_case_096", "p03476_case_097", "p03476_case_098", "p03476_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from bisect import bisect_left, bisect_right\n\n\ndef primes(n):\n is_prime = [True] * (n + 1)\n is_prime[0] = False\n is_prime[1] = False\n for i in range(2, int(n**0.5) + 1):\n if not is_prime[i]:\n continue\n for j in range(i * 2, n + 1, i):\n is_prime[j] = False\n return [i for i in range(3, n + 1) if is_prime[i]]\n\n\nprime = primes(10**5)\np_set = set(prime)\nlike = [3]\nfor i in prime:\n if (i + 1) // 2 in p_set:\n like.append(i)\nQ = int(eval(input()))\nfor _ in range(Q):\n l, r = list(map(int, input().split()))\n print((bisect_right(like, r) - bisect_left(like, l)))\n", "fast_code_sha256": "682d751091cf89e1ad70930160ea7a742b6e10b056be71cc733386cc4788dd10", "fast_id": "p03476_682d751091cf89e1ad70930160ea7a742b6e10b056be71cc733386cc4788dd10", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from bisect import bisect_left, bisect_right\n\n\ndef primes(n):\n is_prime = [True] * (n + 1)\n is_prime[0] = False\n is_prime[1] = False\n for i in range(2, int(n**0.5) + 1):\n if not is_prime[i]:\n continue\n for j in range(i * 2, n + 1, i):\n is_prime[j] = False\n return [i for i in range(3, n + 1) if is_prime[i]]\n\n\nprime = primes(10**5)\np_set = set(prime)\nlike = [3]\nfor i in prime:\n if (i + 1) // 2 in p_set:\n like.append(i)\nQ = int(eval(input()))\nfor _ in range(Q):\n l, r = list(map(int, input().split()))\n print((bisect_right(like, r) - bisect_left(like, l)))\n", "measured_fast_code_sha256": "682d751091cf89e1ad70930160ea7a742b6e10b056be71cc733386cc4788dd10", "measured_slow_code": "import math\n\n\ndef is_prime(n):\n if n == 1:\n return False\n for k in range(2, int(math.sqrt(n)) + 1):\n if n % k == 0:\n return False\n return True\n\n\ncount = [0]\nbuf = 0\nfor i in range(1, 10**5 + 2):\n if i % 2 == 0:\n count.append(buf)\n continue\n hantei1 = is_prime(i)\n hantei2 = is_prime((i + 1) // 2)\n if hantei1 and hantei2:\n buf += 1\n count.append(buf)\nq = int(eval(input()))\nfor i in range(q):\n l, r = list(map(int, input().split()))\n print((count[r] - count[l - 1]))\n", "measured_slow_code_sha256": "8aa7b666b84d39afd40676a7baf00d0d5305252089aa4d028b941a7f3531316e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4.264813644255074, "pair_id": "python_v2_e3afc2247c1a509e1dcba46f", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03476", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03476_682d751091cf89e1ad70930160ea7a742b6e10b056be71cc733386cc4788dd10.jsonl.gz", "inputs": "reproduction/python/inputs/p03476.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03476_8aa7b666b84d39afd40676a7baf00d0d5305252089aa4d028b941a7f3531316e.jsonl.gz"}, "slow_code": "import math\n\n\ndef is_prime(n):\n if n == 1:\n return False\n for k in range(2, int(math.sqrt(n)) + 1):\n if n % k == 0:\n return False\n return True\n\n\ncount = [0]\nbuf = 0\nfor i in range(1, 10**5 + 2):\n if i % 2 == 0:\n count.append(buf)\n continue\n hantei1 = is_prime(i)\n hantei2 = is_prime((i + 1) // 2)\n if hantei1 and hantei2:\n buf += 1\n count.append(buf)\nq = int(eval(input()))\nfor i in range(q):\n l, r = list(map(int, input().split()))\n print((count[r] - count[l - 1]))\n", "slow_code_sha256": "8aa7b666b84d39afd40676a7baf00d0d5305252089aa4d028b941a7f3531316e", "slow_id": "p03476_8aa7b666b84d39afd40676a7baf00d0d5305252089aa4d028b941a7f3531316e", "speedup": 5.251963648699255, "stratum": "4-8", "within_pair_jaccard": 0.5490196078431373, "workload": {"case_count": 100, "description": "For each inclusive odd-endpoint interval [l_i,r_i], count odd integers x for which both x and (x+1)/2 are prime. Process Q independent queries. Observed inputs: Q=1..100000 (median 25000); l_i=1..99999; r_i=1..99999.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1189051, "median": 294556.5, "min": 6}, "input_format": ["Q\nl_1 r_1\n...\nl_Q r_Q"], "input_format_status": "source_input_section", "input_lines": {"max": 100001, "median": 25001.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200001, "median": 50001.0, "min": 3}}} -{"case_ids": ["p03719_case_000", "p03719_case_001", "p03719_case_002", "p03719_case_003", "p03719_case_004", "p03719_case_005", "p03719_case_006", "p03719_case_007", "p03719_case_008", "p03719_case_009", "p03719_case_010", "p03719_case_011", "p03719_case_012", "p03719_case_013", "p03719_case_014", "p03719_case_015", "p03719_case_016", "p03719_case_017", "p03719_case_018", "p03719_case_019", "p03719_case_020", "p03719_case_021", "p03719_case_022", "p03719_case_023", "p03719_case_024", "p03719_case_025", "p03719_case_026", "p03719_case_027", "p03719_case_028", "p03719_case_029", "p03719_case_030", "p03719_case_031", "p03719_case_032", "p03719_case_033", "p03719_case_034", "p03719_case_035", "p03719_case_036", "p03719_case_037", "p03719_case_038", "p03719_case_039", "p03719_case_040", "p03719_case_041", "p03719_case_042", "p03719_case_043", "p03719_case_044", "p03719_case_045", "p03719_case_046", "p03719_case_047", "p03719_case_048", "p03719_case_049", "p03719_case_050", "p03719_case_051", "p03719_case_052", "p03719_case_053", "p03719_case_054", "p03719_case_055", "p03719_case_056", "p03719_case_057", "p03719_case_058", "p03719_case_059", "p03719_case_060", "p03719_case_061", "p03719_case_062", "p03719_case_063", "p03719_case_064", "p03719_case_065", "p03719_case_066", "p03719_case_067", "p03719_case_068", "p03719_case_069", "p03719_case_070", "p03719_case_071", "p03719_case_072", "p03719_case_073", "p03719_case_074", "p03719_case_075", "p03719_case_076", "p03719_case_077", "p03719_case_078", "p03719_case_079", "p03719_case_080", "p03719_case_081", "p03719_case_082", "p03719_case_083", "p03719_case_084", "p03719_case_085", "p03719_case_086", "p03719_case_087", "p03719_case_088", "p03719_case_089", "p03719_case_090", "p03719_case_091", "p03719_case_092", "p03719_case_093", "p03719_case_094", "p03719_case_095", "p03719_case_096", "p03719_case_097", "p03719_case_098", "p03719_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "A, B, C = list(map(int, input().split()))\nif A <= C <= B:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "fast_code_sha256": "c90a433994414011a6dc5da39acad2c6a9e60d5b0c9f99a3af31740b5bf36707", "fast_id": "p03719_c90a433994414011a6dc5da39acad2c6a9e60d5b0c9f99a3af31740b5bf36707", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "A, B, C = list(map(int, input().split()))\nif A <= C <= B:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "measured_fast_code_sha256": "c90a433994414011a6dc5da39acad2c6a9e60d5b0c9f99a3af31740b5bf36707", "measured_slow_code": "import functools\nimport os\nimport sys\n\nsys.setrecursionlimit(10000)\nINF = float(\"inf\")\n\n\ndef inp():\n return int(eval(input()))\n\n\ndef inpf():\n return float(eval(input()))\n\n\ndef inps():\n return eval(input())\n\n\ndef inl():\n return list(map(int, input().split()))\n\n\ndef inlf():\n return list(map(float, input().split()))\n\n\ndef inls():\n return input().split()\n\n\ndef inpm(line):\n return [inp() for _ in range(line)]\n\n\ndef inpfm(line):\n return [inpf() for _ in range(line)]\n\n\ndef inpsm(line):\n return [inps() for _ in range(line)]\n\n\ndef inlm(line):\n return [inl() for _ in range(line)]\n\n\ndef inlfm(line):\n return [inlf() for _ in range(line)]\n\n\ndef inlsm(line):\n return [inls() for _ in range(line)]\n\n\ndef Yesif(cond):\n print((\"Yes\" if cond else \"No\"))\n\n\ndef YESIF(cond):\n print((\"YES\" if cond else \"NO\"))\n\n\ndef yesif(cond):\n print((\"yes\" if cond else \"no\"))\n\n\na, b, c = inl()\nYesif(a <= c <= b)\n", "measured_slow_code_sha256": "0acae026c7e63eed2245b851c8d32eee934659ca23b9e50786cb323f85625345", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 7.885238137508689, "pair_id": "python_v2_b4360c738e8c43146db9ea84", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03719", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03719_c90a433994414011a6dc5da39acad2c6a9e60d5b0c9f99a3af31740b5bf36707.jsonl.gz", "inputs": "reproduction/python/inputs/p03719.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03719_0acae026c7e63eed2245b851c8d32eee934659ca23b9e50786cb323f85625345.jsonl.gz"}, "slow_code": "import functools\nimport os\nimport sys\n\nsys.setrecursionlimit(10000)\nINF = float(\"inf\")\n\n\ndef inp():\n return int(eval(input()))\n\n\ndef inpf():\n return float(eval(input()))\n\n\ndef inps():\n return eval(input())\n\n\ndef inl():\n return list(map(int, input().split()))\n\n\ndef inlf():\n return list(map(float, input().split()))\n\n\ndef inls():\n return input().split()\n\n\ndef inpm(line):\n return [inp() for _ in range(line)]\n\n\ndef inpfm(line):\n return [inpf() for _ in range(line)]\n\n\ndef inpsm(line):\n return [inps() for _ in range(line)]\n\n\ndef inlm(line):\n return [inl() for _ in range(line)]\n\n\ndef inlfm(line):\n return [inlf() for _ in range(line)]\n\n\ndef inlsm(line):\n return [inls() for _ in range(line)]\n\n\ndef Yesif(cond):\n print((\"Yes\" if cond else \"No\"))\n\n\ndef YESIF(cond):\n print((\"YES\" if cond else \"NO\"))\n\n\ndef yesif(cond):\n print((\"yes\" if cond else \"no\"))\n\n\na, b, c = inl()\nYesif(a <= c <= b)\n", "slow_code_sha256": "0acae026c7e63eed2245b851c8d32eee934659ca23b9e50786cb323f85625345", "slow_id": "p03719_0acae026c7e63eed2245b851c8d32eee934659ca23b9e50786cb323f85625345", "speedup": 7.885900146853008, "stratum": "4-8", "within_pair_jaccard": 0.18867924528301888, "workload": {"case_count": 100, "description": "Determine whether C is at least A and at most B. The supplied bounds A and B need not be ordered. Observed inputs: A=-100..100 (median -2.5); B=-100..100 (median -17); C=-100..100 (median -9).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 14, "median": 10.0, "min": 7}, "input_format": ["A B C"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3, "median": 3.0, "min": 3}}} -{"case_ids": ["p02683_case_000", "p02683_case_001", "p02683_case_002", "p02683_case_003", "p02683_case_004", "p02683_case_005", "p02683_case_006", "p02683_case_007", "p02683_case_008", "p02683_case_009", "p02683_case_010", "p02683_case_011", "p02683_case_012", "p02683_case_013", "p02683_case_014", "p02683_case_015", "p02683_case_016", "p02683_case_017", "p02683_case_018", "p02683_case_019", "p02683_case_020", "p02683_case_021", "p02683_case_022", "p02683_case_023", "p02683_case_024", "p02683_case_025", "p02683_case_026", "p02683_case_027", "p02683_case_028", "p02683_case_029", "p02683_case_030", "p02683_case_031", "p02683_case_032", "p02683_case_033", "p02683_case_034", "p02683_case_035", "p02683_case_036", "p02683_case_037", "p02683_case_038", "p02683_case_039", "p02683_case_040", "p02683_case_041", "p02683_case_042", "p02683_case_043", "p02683_case_044", "p02683_case_045", "p02683_case_046", "p02683_case_047", "p02683_case_048", "p02683_case_049", "p02683_case_050", "p02683_case_051", "p02683_case_052", "p02683_case_053", "p02683_case_054", "p02683_case_055", "p02683_case_056", "p02683_case_057", "p02683_case_058", "p02683_case_059", "p02683_case_060", "p02683_case_061", "p02683_case_062", "p02683_case_063", "p02683_case_064", "p02683_case_065", "p02683_case_066", "p02683_case_067", "p02683_case_068", "p02683_case_069", "p02683_case_070", "p02683_case_071", "p02683_case_072", "p02683_case_073", "p02683_case_074", "p02683_case_075", "p02683_case_076", "p02683_case_077", "p02683_case_078", "p02683_case_079", "p02683_case_080", "p02683_case_081", "p02683_case_082", "p02683_case_083", "p02683_case_084", "p02683_case_085", "p02683_case_086", "p02683_case_087", "p02683_case_088", "p02683_case_089", "p02683_case_090", "p02683_case_091", "p02683_case_092", "p02683_case_093", "p02683_case_094", "p02683_case_095", "p02683_case_096", "p02683_case_097", "p02683_case_098", "p02683_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "(N, M, X), *T = [[*list(map(int, line.split()))] for line in open(0)]\nans = 12345678\nfor bit in range(1, 2**N):\n t = [T[i] for i in range(N) if bit & (1 << i)]\n c, *a = list(map(sum, list(zip(*t))))\n if all(e >= X for e in a):\n ans = min(ans, c)\nprint((-1 if ans == 12345678 else ans))\n", "fast_code_sha256": "84450493432d4ac002145cf09b3dd6ed1e82364df1f198dbeae66cc936fb1989", "fast_id": "p02683_84450493432d4ac002145cf09b3dd6ed1e82364df1f198dbeae66cc936fb1989", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "(N, M, X), *T = [[*list(map(int, line.split()))] for line in open(0)]\nans = 12345678\nfor bit in range(1, 2**N):\n t = [T[i] for i in range(N) if bit & (1 << i)]\n c, *a = list(map(sum, list(zip(*t))))\n if all(e >= X for e in a):\n ans = min(ans, c)\nprint((-1 if ans == 12345678 else ans))\n", "measured_fast_code_sha256": "84450493432d4ac002145cf09b3dd6ed1e82364df1f198dbeae66cc936fb1989", "measured_slow_code": "import numpy as np\nimport sys\n\nn, m, x = list(map(int, input().split()))\narr = np.array([list(map(int, input().split())) for i in range(n)])\nc = arr.T[0] # c[n-1]まで\na = arr.T[1:].T # a[n-1][m-1]まで\nans = np.inf\nfor i in range(2**n):\n ability = np.zeros(m, np.int64)\n cost = 0\n for j in range(n):\n if (i >> j) & 1:\n ability += a[j]\n cost += c[j]\n # print(ability, cost)\n if all(i >= x for i in ability):\n ans = min(ans, cost)\nans = -1 if ans == np.inf else ans\nprint(ans)\n", "measured_slow_code_sha256": "eb82795067db4535f92eb0432054ed7d6961514cf3395d99fe6cf556965675ad", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 165.88972463754249, "pair_id": "python_v2_79f590cc44ff846e54ab1a6d", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02683", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02683_84450493432d4ac002145cf09b3dd6ed1e82364df1f198dbeae66cc936fb1989.jsonl.gz", "inputs": "reproduction/python/inputs/p02683.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02683_eb82795067db4535f92eb0432054ed7d6961514cf3395d99fe6cf556965675ad.jsonl.gz"}, "slow_code": "import numpy as np\nimport sys\n\nn, m, x = list(map(int, input().split()))\narr = np.array([list(map(int, input().split())) for i in range(n)])\nc = arr.T[0]\na = arr.T[1:].T\nans = np.inf\nfor i in range(2**n):\n ability = np.zeros(m, np.int64)\n cost = 0\n for j in range(n):\n if (i >> j) & 1:\n ability += a[j]\n cost += c[j]\n\n if all(i >= x for i in ability):\n ans = min(ans, cost)\nans = -1 if ans == np.inf else ans\nprint(ans)\n", "slow_code_sha256": "cfb07918685f743bbc33c1600f6b6492a32a7cb9a0df40fa6957f938c00433ba", "slow_id": "p02683_eb82795067db4535f92eb0432054ed7d6961514cf3395d99fe6cf556965675ad", "speedup": 79.2091620548258, "stratum": "8+", "within_pair_jaccard": 0.4166666666666667, "workload": {"case_count": 100, "description": "Choose a subset of N books of costs C_i. Reading book i once adds A_i,j to skill j, initially zero. Minimize cost while all M skills reach at least X, or report impossibility. Observed inputs: N=1..12 (median 6); M=1..12 (median 6); X=1..100000 (median 7000); C_i=1..99895; A_i_j=0..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 933, "median": 207.0, "min": 10}, "input_format": ["N M X\nC_1 A_1,1 ... A_1,M\n...\nC_N A_N,1 ... A_N,M"], "input_format_status": "source_input_section", "input_lines": {"max": 13, "median": 7.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 159, "median": 45.0, "min": 5}}} -{"case_ids": ["p03835_case_000", "p03835_case_001", "p03835_case_002", "p03835_case_003", "p03835_case_004", "p03835_case_005", "p03835_case_006", "p03835_case_007", "p03835_case_008", "p03835_case_009", "p03835_case_010", "p03835_case_011", "p03835_case_012", "p03835_case_013", "p03835_case_014", "p03835_case_015", "p03835_case_016", "p03835_case_017", "p03835_case_018", "p03835_case_019", "p03835_case_020", "p03835_case_021", "p03835_case_022", "p03835_case_023", "p03835_case_024", "p03835_case_025", "p03835_case_026", "p03835_case_027", "p03835_case_028", "p03835_case_029", "p03835_case_030", "p03835_case_031", "p03835_case_032", "p03835_case_033", "p03835_case_034", "p03835_case_035", "p03835_case_036", "p03835_case_037", "p03835_case_038", "p03835_case_039", "p03835_case_040", "p03835_case_041", "p03835_case_042", "p03835_case_043", "p03835_case_044", "p03835_case_045", "p03835_case_046", "p03835_case_047", "p03835_case_048", "p03835_case_049", "p03835_case_050", "p03835_case_051", "p03835_case_052", "p03835_case_053", "p03835_case_054", "p03835_case_055", "p03835_case_056", "p03835_case_057", "p03835_case_058", "p03835_case_059", "p03835_case_060", "p03835_case_061", "p03835_case_062", "p03835_case_063", "p03835_case_064", "p03835_case_065", "p03835_case_066", "p03835_case_067", "p03835_case_068", "p03835_case_069", "p03835_case_070", "p03835_case_071", "p03835_case_072", "p03835_case_073", "p03835_case_074", "p03835_case_075", "p03835_case_076", "p03835_case_077", "p03835_case_078", "p03835_case_079", "p03835_case_080", "p03835_case_081", "p03835_case_082", "p03835_case_083", "p03835_case_084", "p03835_case_085", "p03835_case_086", "p03835_case_087", "p03835_case_088", "p03835_case_089", "p03835_case_090", "p03835_case_091", "p03835_case_092", "p03835_case_093", "p03835_case_094", "p03835_case_095", "p03835_case_096", "p03835_case_097", "p03835_case_098", "p03835_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "k, s = list(map(int, input().split()))\ncnt = 0\nminX = max(s - 2 * k, 0)\nmaxX = min(s, k)\nfor x in range(minX, maxX + 1):\n rest = s - x\n if k >= rest:\n cnt += rest + 1\n else:\n cnt += 2 * k - rest + 1\nprint(cnt)\n", "fast_code_sha256": "f7906a09151fab400b6547bf06f2749bfbc12740deab8aee67e2f15ffdabe2ee", "fast_id": "p03835_f7906a09151fab400b6547bf06f2749bfbc12740deab8aee67e2f15ffdabe2ee", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "k, s = list(map(int, input().split()))\ncnt = 0\nminX = max(s - 2 * k, 0)\nmaxX = min(s, k)\nfor x in range(minX, maxX + 1):\n rest = s - x\n if k >= rest:\n cnt += rest + 1\n else:\n cnt += 2 * k - rest + 1\nprint(cnt)\n", "measured_fast_code_sha256": "f7906a09151fab400b6547bf06f2749bfbc12740deab8aee67e2f15ffdabe2ee", "measured_slow_code": "K, S = input().split()\nK = int(K)\nS = int(S)\nans = 0\nfor l in range(K + 1):\n for m in range(K + 1):\n if l + m <= S and l + m + K >= S:\n ans = ans + 1\nprint(ans)\n", "measured_slow_code_sha256": "10ad4ff275930d94e0dd92b80fd510f84d157671325b17a8982909dfb995bd50", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1501.5012683852856, "pair_id": "python_v2_d55ea2b4343f84f36dd2382e", "per_case_slow_code_faster_fraction": 0.07, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03835", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03835_f7906a09151fab400b6547bf06f2749bfbc12740deab8aee67e2f15ffdabe2ee.jsonl.gz", "inputs": "reproduction/python/inputs/p03835.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03835_10ad4ff275930d94e0dd92b80fd510f84d157671325b17a8982909dfb995bd50.jsonl.gz"}, "slow_code": "K, S = input().split()\nK = int(K)\nS = int(S)\nans = 0\nfor l in range(K + 1):\n for m in range(K + 1):\n if l + m <= S and l + m + K >= S:\n ans = ans + 1\nprint(ans)\n", "slow_code_sha256": "10ad4ff275930d94e0dd92b80fd510f84d157671325b17a8982909dfb995bd50", "slow_id": "p03835_10ad4ff275930d94e0dd92b80fd510f84d157671325b17a8982909dfb995bd50", "speedup": 796.2551203855197, "stratum": "8+", "within_pair_jaccard": 0.3448275862068966, "workload": {"case_count": 100, "description": "Count ordered integer triples (X,Y,Z) satisfying 0<=X,Y,Z<=K and X+Y+Z=S. Observed inputs: K=2..2500 (median 1275.5); S=0..7500 (median 1510.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 10, "median": 9.0, "min": 4}, "input_format": ["K S"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p03806_case_000", "p03806_case_001", "p03806_case_002", "p03806_case_003", "p03806_case_004", "p03806_case_005", "p03806_case_006", "p03806_case_007", "p03806_case_008", "p03806_case_009", "p03806_case_010", "p03806_case_011", "p03806_case_012", "p03806_case_013", "p03806_case_014", "p03806_case_015", "p03806_case_016", "p03806_case_017", "p03806_case_018", "p03806_case_019", "p03806_case_020", "p03806_case_021", "p03806_case_022", "p03806_case_023", "p03806_case_024", "p03806_case_025", "p03806_case_026", "p03806_case_027", "p03806_case_028", "p03806_case_029", "p03806_case_030", "p03806_case_031", "p03806_case_032", "p03806_case_033", "p03806_case_034", "p03806_case_035", "p03806_case_036", "p03806_case_037", "p03806_case_038", "p03806_case_039", "p03806_case_040", "p03806_case_041", "p03806_case_042", "p03806_case_043", "p03806_case_044", "p03806_case_045", "p03806_case_046", "p03806_case_047", "p03806_case_048", "p03806_case_049", "p03806_case_050", "p03806_case_051", "p03806_case_052", "p03806_case_053", "p03806_case_054", "p03806_case_055", "p03806_case_056", "p03806_case_057", "p03806_case_058", "p03806_case_059", "p03806_case_060", "p03806_case_061", "p03806_case_062", "p03806_case_063", "p03806_case_064", "p03806_case_065", "p03806_case_066", "p03806_case_067", "p03806_case_068", "p03806_case_069", "p03806_case_070", "p03806_case_071", "p03806_case_072", "p03806_case_073", "p03806_case_074", "p03806_case_075", "p03806_case_076", "p03806_case_077", "p03806_case_078", "p03806_case_079", "p03806_case_080", "p03806_case_081", "p03806_case_082", "p03806_case_083", "p03806_case_084", "p03806_case_085", "p03806_case_086", "p03806_case_087", "p03806_case_088", "p03806_case_089", "p03806_case_090", "p03806_case_091", "p03806_case_092", "p03806_case_093", "p03806_case_094", "p03806_case_095", "p03806_case_096", "p03806_case_097", "p03806_case_098", "p03806_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def solve():\n N, Ma, Mb = list(map(int, input().split()))\n a, b, c = [], [], []\n for i in range(N):\n ai, bi, ci = list(map(int, input().split()))\n a.append(ai)\n b.append(bi)\n c.append(ci)\n nvals = 99 * N * 2 + 1\n inf = 40 * 100 + 1\n dp = [[inf] * nvals for i in range(N)]\n for i in range(N):\n v = Mb * a[i] - Ma * b[i]\n if i == 0:\n dp[i][v] = c[i]\n continue\n for j in range(-99 * N, 99 * N + 1):\n if -99 * N <= j - v <= 99 * N:\n dp[i][j] = min(dp[i - 1][j], dp[i - 1][j - v] + c[i])\n dp[i][v] = min(dp[i][v], c[i])\n ans = dp[N - 1][0]\n if ans < inf:\n print(ans)\n else:\n print((-1))\n\n\nif __name__ == \"__main__\":\n solve()\n", "fast_code_sha256": "f5de8e4c2a8e4e56b6d84c73a50dbabc2fe1ed51d513e4bcfc7a548c9fb0f0bd", "fast_id": "p03806_f5de8e4c2a8e4e56b6d84c73a50dbabc2fe1ed51d513e4bcfc7a548c9fb0f0bd", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def solve():\n N, Ma, Mb = list(map(int, input().split()))\n a, b, c = [], [], []\n for i in range(N):\n ai, bi, ci = list(map(int, input().split()))\n a.append(ai)\n b.append(bi)\n c.append(ci)\n nvals = 99 * N * 2 + 1\n inf = 40 * 100 + 1\n dp = [[inf] * nvals for i in range(N)]\n for i in range(N):\n v = Mb * a[i] - Ma * b[i]\n if i == 0:\n dp[i][v] = c[i]\n continue\n for j in range(-99 * N, 99 * N + 1):\n if -99 * N <= j - v <= 99 * N:\n dp[i][j] = min(dp[i - 1][j], dp[i - 1][j - v] + c[i])\n dp[i][v] = min(dp[i][v], c[i])\n ans = dp[N - 1][0]\n if ans < inf:\n print(ans)\n else:\n print((-1))\n\n\nif __name__ == \"__main__\":\n solve()\n", "measured_fast_code_sha256": "f5de8e4c2a8e4e56b6d84c73a50dbabc2fe1ed51d513e4bcfc7a548c9fb0f0bd", "measured_slow_code": "N, Ma, Mb = list(map(int, input().split()))\nINF = float(\"inf\")\ndp = [[INF for b in range(401)] for a in range(401)]\ndp[0][0] = 0\nfor i in range(1, N + 1):\n ai, bi, ci = list(map(int, input().split()))\n for a in range(400, -1, -1):\n for b in range(400, -1, -1):\n if a - ai >= 0 and b - bi >= 0:\n dp[a][b] = min(dp[a][b], dp[a - ai][b - bi] + ci)\nans = INF\nfor j in range(1, 401):\n if Ma * j > 400 or Mb * j > 400:\n break\n ans = min(ans, dp[Ma * j][Mb * j])\nprint((ans if ans != INF else -1))\n", "measured_slow_code_sha256": "b9bb99d5fe18775e38a2581a478e2c51755cc41cba7f19b61bf8d3705a660d75", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 48.77601599574393, "pair_id": "python_v2_6308424933d0e18f1527d0be", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03806", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03806_f5de8e4c2a8e4e56b6d84c73a50dbabc2fe1ed51d513e4bcfc7a548c9fb0f0bd.jsonl.gz", "inputs": "reproduction/python/inputs/p03806.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03806_b9bb99d5fe18775e38a2581a478e2c51755cc41cba7f19b61bf8d3705a660d75.jsonl.gz"}, "slow_code": "N, Ma, Mb = list(map(int, input().split()))\nINF = float(\"inf\")\ndp = [[INF for b in range(401)] for a in range(401)]\ndp[0][0] = 0\nfor i in range(1, N + 1):\n ai, bi, ci = list(map(int, input().split()))\n for a in range(400, -1, -1):\n for b in range(400, -1, -1):\n if a - ai >= 0 and b - bi >= 0:\n dp[a][b] = min(dp[a][b], dp[a - ai][b - bi] + ci)\nans = INF\nfor j in range(1, 401):\n if Ma * j > 400 or Mb * j > 400:\n break\n ans = min(ans, dp[Ma * j][Mb * j])\nprint((ans if ans != INF else -1))\n", "slow_code_sha256": "b9bb99d5fe18775e38a2581a478e2c51755cc41cba7f19b61bf8d3705a660d75", "slow_id": "p03806_b9bb99d5fe18775e38a2581a478e2c51755cc41cba7f19b61bf8d3705a660d75", "speedup": 75.79700242827886, "stratum": "8+", "within_pair_jaccard": 0.574468085106383, "workload": {"case_count": 100, "description": "Choose a nonempty subset of N packages to obtain substances A and B in ratio M_a:M_b at minimum total cost. Package i supplies amounts a_i and b_i at cost c_i. Observed inputs: N=1..40 (median 20); M_a=1..10; M_b=1..10; a_i=1..10; b_i=1..10; c_i=1..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 298, "median": 150.0, "min": 13}, "input_format": ["N M_a M_b\na_1 b_1 c_1\n...\na_N b_N c_N"], "input_format_status": "source_input_section", "input_lines": {"max": 41, "median": 21.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 123, "median": 63.0, "min": 6}}} -{"case_ids": ["p03575_case_000", "p03575_case_001", "p03575_case_002", "p03575_case_003", "p03575_case_004", "p03575_case_005", "p03575_case_006", "p03575_case_007", "p03575_case_008", "p03575_case_009", "p03575_case_010", "p03575_case_011", "p03575_case_012", "p03575_case_013", "p03575_case_014", "p03575_case_015", "p03575_case_016", "p03575_case_017", "p03575_case_018", "p03575_case_019", "p03575_case_020", "p03575_case_021", "p03575_case_022", "p03575_case_023", "p03575_case_024", "p03575_case_025", "p03575_case_026", "p03575_case_027", "p03575_case_028", "p03575_case_029", "p03575_case_030", "p03575_case_031", "p03575_case_032", "p03575_case_033", "p03575_case_034", "p03575_case_035", "p03575_case_036", "p03575_case_037", "p03575_case_038", "p03575_case_039", "p03575_case_040", "p03575_case_041", "p03575_case_042", "p03575_case_043", "p03575_case_044", "p03575_case_045", "p03575_case_046", "p03575_case_047", "p03575_case_048", "p03575_case_049", "p03575_case_050", "p03575_case_051", "p03575_case_052", "p03575_case_053", "p03575_case_054", "p03575_case_055", "p03575_case_056", "p03575_case_057", "p03575_case_058", "p03575_case_059", "p03575_case_060", "p03575_case_061", "p03575_case_062", "p03575_case_063", "p03575_case_064", "p03575_case_065", "p03575_case_066", "p03575_case_067", "p03575_case_068", "p03575_case_069", "p03575_case_070", "p03575_case_071", "p03575_case_072", "p03575_case_073", "p03575_case_074", "p03575_case_075", "p03575_case_076", "p03575_case_077", "p03575_case_078", "p03575_case_079", "p03575_case_080", "p03575_case_081", "p03575_case_082", "p03575_case_083", "p03575_case_084", "p03575_case_085", "p03575_case_086", "p03575_case_087", "p03575_case_088", "p03575_case_089", "p03575_case_090", "p03575_case_091", "p03575_case_092", "p03575_case_093", "p03575_case_094", "p03575_case_095", "p03575_case_096", "p03575_case_097", "p03575_case_098", "p03575_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N, M = list(map(int, input().split()))\nG = [[] for i in range(N)]\nE = []\nfor i in range(M):\n a, b = list(map(int, input().split()))\n a, b = a - 1, b - 1\n G[a].append(b)\n G[b].append(a)\n E.append((a, b))\n\n\ndef dfs(v, pre, s, ng):\n if used[v]:\n return\n used[v] = 1\n s.add(v)\n for u in G[v]:\n if u == pre:\n continue\n if (u, v) != ng and (v, u) != ng:\n dfs(u, v, s, ng)\n return\n\n\nnum = 0\nfor i in E:\n used = [0] * N\n s = set()\n dfs(0, -1, s, i)\n if len(s) == N:\n num += 1\nprint((M - num))\n", "fast_code_sha256": "523a040b3d2086d79e6be3a9c4b819c4b076ab91eb2d560674171afbd57c448a", "fast_id": "p03575_523a040b3d2086d79e6be3a9c4b819c4b076ab91eb2d560674171afbd57c448a", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N, M = list(map(int, input().split()))\nG = [[] for i in range(N)]\nE = []\nfor i in range(M):\n a, b = list(map(int, input().split()))\n a, b = a - 1, b - 1\n G[a].append(b)\n G[b].append(a)\n E.append((a, b))\n\n\ndef dfs(v, pre, s, ng):\n if used[v]:\n return\n used[v] = 1\n s.add(v)\n for u in G[v]:\n if u == pre:\n continue\n if (u, v) != ng and (v, u) != ng:\n dfs(u, v, s, ng)\n return\n\n\nnum = 0\nfor i in E:\n used = [0] * N\n s = set()\n dfs(0, -1, s, i)\n if len(s) == N:\n num += 1\nprint((M - num))\n", "measured_fast_code_sha256": "523a040b3d2086d79e6be3a9c4b819c4b076ab91eb2d560674171afbd57c448a", "measured_slow_code": "from heapq import heappush, heappop\nfrom itertools import permutations, accumulate, combinations\nimport math\nimport bisect\nimport numpy as np\nfrom collections import defaultdict, deque\nimport sys\n\ninput = sys.stdin.readline\n# sys.setrecursionlimit(1000000)\n# MOD = 10 ** 9 + 7\n# INF = float(\"inf\")\ndef bfs(s, n, g):\n que = deque([])\n que.append(s)\n check = [-1] * n\n check[s] = 0\n while que:\n u = que.popleft()\n for v in g[u]:\n if check[v] == -1:\n check[v] = check[u] + 1\n que.append(v)\n if -1 in check:\n return True\n else:\n return False\n\n\ndef main():\n n, m = list(map(int, input().split()))\n g = [[] for _ in range(n)]\n gg = deque([])\n for _ in range(m):\n a, b = [int(i) - 1 for i in input().split()]\n g[a].append(b)\n g[b].append(a)\n gg.append((a, b))\n ans = 0\n for i in range(m):\n a, b = gg.popleft()\n g[a].remove(b)\n g[b].remove(a)\n if bfs(0, n, g):\n ans += 1\n g[a].append(b)\n g[b].append(a)\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "5e7c7216970600bec9b00c8c77b42dad7dec0f6fe93d427b1852bced77a5f685", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 171.85155981543326, "pair_id": "python_v2_b891d01b8906c58e1b6e28de", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03575", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03575_523a040b3d2086d79e6be3a9c4b819c4b076ab91eb2d560674171afbd57c448a.jsonl.gz", "inputs": "reproduction/python/inputs/p03575.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03575_5e7c7216970600bec9b00c8c77b42dad7dec0f6fe93d427b1852bced77a5f685.jsonl.gz"}, "slow_code": "from heapq import heappush, heappop\nfrom itertools import permutations, accumulate, combinations\nimport math\nimport bisect\nimport numpy as np\nfrom collections import defaultdict, deque\nimport sys\n\ninput = sys.stdin.readline\n\n\ndef bfs(s, n, g):\n que = deque([])\n que.append(s)\n check = [-1] * n\n check[s] = 0\n while que:\n u = que.popleft()\n for v in g[u]:\n if check[v] == -1:\n check[v] = check[u] + 1\n que.append(v)\n if -1 in check:\n return True\n else:\n return False\n\n\ndef main():\n n, m = list(map(int, input().split()))\n g = [[] for _ in range(n)]\n gg = deque([])\n for _ in range(m):\n a, b = [int(i) - 1 for i in input().split()]\n g[a].append(b)\n g[b].append(a)\n gg.append((a, b))\n ans = 0\n for i in range(m):\n a, b = gg.popleft()\n g[a].remove(b)\n g[b].remove(a)\n if bfs(0, n, g):\n ans += 1\n g[a].append(b)\n g[b].append(a)\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "fdbe8a2a30186389cc5e861eaa33c8ca68cb8a1bd87081938b7a17c713eb13ee", "slow_id": "p03575_5e7c7216970600bec9b00c8c77b42dad7dec0f6fe93d427b1852bced77a5f685", "speedup": 138.33300697161616, "stratum": "8+", "within_pair_jaccard": 0.2876712328767123, "workload": {"case_count": 100, "description": "Count bridges in a connected simple undirected graph: a bridge is an edge whose removal disconnects it. Vertices are numbered 1..N and each listed edge has a_i 2)\nfor _ in range(s - 3):\n a, b, c = b, c, (a + c) % (10**9 + 7)\nprint(c)\n", "fast_code_sha256": "6a882d2a5423b1f6b3f7524d4d393bad5b717d8c1f08a3765c460fbb340b4113", "fast_id": "p02555_6a882d2a5423b1f6b3f7524d4d393bad5b717d8c1f08a3765c460fbb340b4113", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "s = int(eval(input()))\na = b = 0\nc = int(s > 2)\nfor _ in range(s - 3):\n a, b, c = b, c, (a + c) % (10**9 + 7)\nprint(c)\n", "measured_fast_code_sha256": "6a882d2a5423b1f6b3f7524d4d393bad5b717d8c1f08a3765c460fbb340b4113", "measured_slow_code": "s = int(eval(input()))\nmod = 10**9 + 7\n# dp[i]: 最後に切った場所がi\ndp = [0] * (s + 1)\ndp[0] = 1\nfor i in range(1, s + 1):\n for j in range(0, (i - 3) + 1):\n dp[i] += dp[j]\n dp[i] %= mod\nprint((dp[s]))\n", "measured_slow_code_sha256": "be28d9cac8a1e8736627f41a67db426cc354abd2534ebe43d482286cd888d245", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 586.0453653206387, "pair_id": "python_v2_247decd2a2e440e542dfe66a", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02555", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02555_6a882d2a5423b1f6b3f7524d4d393bad5b717d8c1f08a3765c460fbb340b4113.jsonl.gz", "inputs": "reproduction/python/inputs/p02555.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02555_be28d9cac8a1e8736627f41a67db426cc354abd2534ebe43d482286cd888d245.jsonl.gz"}, "slow_code": "s = int(eval(input()))\nmod = 10**9 + 7\n\ndp = [0] * (s + 1)\ndp[0] = 1\nfor i in range(1, s + 1):\n for j in range(0, (i - 3) + 1):\n dp[i] += dp[j]\n dp[i] %= mod\nprint((dp[s]))\n", "slow_code_sha256": "ce854c84bb488b03baf8685f08880ca102a034fd37d460a4819dbdb87cc4e492", "slow_id": "p02555_be28d9cac8a1e8736627f41a67db426cc354abd2534ebe43d482286cd888d245", "speedup": 243.85043340695972, "stratum": "8+", "within_pair_jaccard": 0.5652173913043478, "workload": {"case_count": 100, "description": "Count ordered integer sequences whose entries are at least 3 and sum to S, modulo 1000000007. Observed inputs: S=1..2000 (median 1094).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 5, "median": 5.0, "min": 2}, "input_format": ["S"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p02712_case_000", "p02712_case_001", "p02712_case_002", "p02712_case_003", "p02712_case_004", "p02712_case_005", "p02712_case_006", "p02712_case_007", "p02712_case_008", "p02712_case_009", "p02712_case_010", "p02712_case_011", "p02712_case_012", "p02712_case_013", "p02712_case_014", "p02712_case_015", "p02712_case_016", "p02712_case_017", "p02712_case_018", "p02712_case_019", "p02712_case_020", "p02712_case_021", "p02712_case_022", "p02712_case_023", "p02712_case_024", "p02712_case_025", "p02712_case_026", "p02712_case_027", "p02712_case_028", "p02712_case_029", "p02712_case_030", "p02712_case_031", "p02712_case_032", "p02712_case_033", "p02712_case_034", "p02712_case_035", "p02712_case_036", "p02712_case_037", "p02712_case_038", "p02712_case_039", "p02712_case_040", "p02712_case_041", "p02712_case_042", "p02712_case_043", "p02712_case_044", "p02712_case_045", "p02712_case_046", "p02712_case_047", "p02712_case_048", "p02712_case_049", "p02712_case_050", "p02712_case_051", "p02712_case_052", "p02712_case_053", "p02712_case_054", "p02712_case_055", "p02712_case_056", "p02712_case_057", "p02712_case_058", "p02712_case_059", "p02712_case_060", "p02712_case_061", "p02712_case_062", "p02712_case_063", "p02712_case_064", "p02712_case_065", "p02712_case_066", "p02712_case_067", "p02712_case_068", "p02712_case_069", "p02712_case_070", "p02712_case_071", "p02712_case_072", "p02712_case_073", "p02712_case_074", "p02712_case_075", "p02712_case_076", "p02712_case_077", "p02712_case_078", "p02712_case_079", "p02712_case_080", "p02712_case_081", "p02712_case_082", "p02712_case_083", "p02712_case_084", "p02712_case_085", "p02712_case_086", "p02712_case_087", "p02712_case_088", "p02712_case_089", "p02712_case_090", "p02712_case_091", "p02712_case_092", "p02712_case_093", "p02712_case_094", "p02712_case_095", "p02712_case_096", "p02712_case_097", "p02712_case_098", "p02712_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N = int(eval(input()))\ntotal = int(1 / 2 * N * (N + 1))\nwa3 = (N // 3 * (N // 3 + 1)) // 2 * 3\nwa5 = (N // 5 * (N // 5 + 1)) // 2 * 5\nwa15 = (N // 15 * (N // 15 + 1)) // 2 * 15\nprint((total - wa3 - wa5 + wa15))\n", "fast_code_sha256": "72619107eb329b54610e4085498f85cee6d80295e93784b7b4dded26629f06a8", "fast_id": "p02712_72619107eb329b54610e4085498f85cee6d80295e93784b7b4dded26629f06a8", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N = int(eval(input()))\ntotal = int(1 / 2 * N * (N + 1))\nwa3 = (N // 3 * (N // 3 + 1)) // 2 * 3\nwa5 = (N // 5 * (N // 5 + 1)) // 2 * 5\nwa15 = (N // 15 * (N // 15 + 1)) // 2 * 15\nprint((total - wa3 - wa5 + wa15))\n", "measured_fast_code_sha256": "72619107eb329b54610e4085498f85cee6d80295e93784b7b4dded26629f06a8", "measured_slow_code": "n = int(eval(input()))\nn = list(range(1, n + 1))\nn = [i for i in n if i % 3 != 0]\nn = [i for i in n if i % 5 != 0]\nprint((sum(n)))\n", "measured_slow_code_sha256": "59fdf1e7f42da4920689437ba15d9323b5d573a0e3c1f9dcf35ef6f2509e1c48", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 988.8996381937234, "pair_id": "python_v2_ceb3bc4be66a8b7f5796fc87", "per_case_slow_code_faster_fraction": 0.05, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02712", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02712_72619107eb329b54610e4085498f85cee6d80295e93784b7b4dded26629f06a8.jsonl.gz", "inputs": "reproduction/python/inputs/p02712.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02712_59fdf1e7f42da4920689437ba15d9323b5d573a0e3c1f9dcf35ef6f2509e1c48.jsonl.gz"}, "slow_code": "n = int(eval(input()))\nn = list(range(1, n + 1))\nn = [i for i in n if i % 3 != 0]\nn = [i for i in n if i % 5 != 0]\nprint((sum(n)))\n", "slow_code_sha256": "59fdf1e7f42da4920689437ba15d9323b5d573a0e3c1f9dcf35ef6f2509e1c48", "slow_id": "p02712_59fdf1e7f42da4920689437ba15d9323b5d573a0e3c1f9dcf35ef6f2509e1c48", "speedup": 313.357165922996, "stratum": "8+", "within_pair_jaccard": 0.22727272727272727, "workload": {"case_count": 100, "description": "Sum numeric terms among the first N FizzBuzz terms: multiples of 3 or 5 are words, and every other term i is the number i. Observed inputs: N=1..1000000 (median 360236).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 8, "median": 7.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p00775_case_000", "p00775_case_001", "p00775_case_002", "p00775_case_003", "p00775_case_004", "p00775_case_005", "p00775_case_006", "p00775_case_007", "p00775_case_008", "p00775_case_009", "p00775_case_010", "p00775_case_011", "p00775_case_012", "p00775_case_013", "p00775_case_014", "p00775_case_015", "p00775_case_016", "p00775_case_017", "p00775_case_018", "p00775_case_019", "p00775_case_020", "p00775_case_021", "p00775_case_022", "p00775_case_023", "p00775_case_024", "p00775_case_025", "p00775_case_026", "p00775_case_027", "p00775_case_028", "p00775_case_029", "p00775_case_030", "p00775_case_031", "p00775_case_032", "p00775_case_033", "p00775_case_034", "p00775_case_035", "p00775_case_036", "p00775_case_037", "p00775_case_038", "p00775_case_039", "p00775_case_040", "p00775_case_041", "p00775_case_042", "p00775_case_043", "p00775_case_044", "p00775_case_045", "p00775_case_046", "p00775_case_047", "p00775_case_048", "p00775_case_049", "p00775_case_050", "p00775_case_051", "p00775_case_052", "p00775_case_053", "p00775_case_054", "p00775_case_055", "p00775_case_056", "p00775_case_057", "p00775_case_058", "p00775_case_059", "p00775_case_060", "p00775_case_061", "p00775_case_062", "p00775_case_063", "p00775_case_064", "p00775_case_065", "p00775_case_066", "p00775_case_067", "p00775_case_068", "p00775_case_069", "p00775_case_070", "p00775_case_071", "p00775_case_072", "p00775_case_073", "p00775_case_074", "p00775_case_075", "p00775_case_076", "p00775_case_077", "p00775_case_078", "p00775_case_079", "p00775_case_080", "p00775_case_081", "p00775_case_082", "p00775_case_083", "p00775_case_084", "p00775_case_085", "p00775_case_086", "p00775_case_087", "p00775_case_088", "p00775_case_089", "p00775_case_090", "p00775_case_091", "p00775_case_092", "p00775_case_093", "p00775_case_094", "p00775_case_095", "p00775_case_096", "p00775_case_097", "p00775_case_098", "p00775_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from math import sqrt\n\nwhile True:\n R, N = list(map(int, input().split()))\n if not (R | N):\n break\n geta = 20\n buildings = [0] * (geta * 2)\n for _ in range(N):\n xl, xr, h = list(map(int, input().split()))\n for i in range(xl + geta, xr + geta):\n buildings[i] = max(buildings[i], h)\n print(\n (\n min(\n buildings[i]\n - sqrt(R * R - (i - geta + (i < geta)) * (i - geta + (i < geta)))\n + R\n for i in range(-R + geta, R + geta)\n )\n )\n )\n", "fast_code_sha256": "d01a3b994ea420f84f1fec9d04b81e669100b8678a5fdca6b824945b066ea855", "fast_id": "p00775_d01a3b994ea420f84f1fec9d04b81e669100b8678a5fdca6b824945b066ea855", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from math import sqrt\n\nwhile True:\n R, N = list(map(int, input().split()))\n if not (R | N):\n break\n geta = 20\n buildings = [0] * (geta * 2)\n for _ in range(N):\n xl, xr, h = list(map(int, input().split()))\n for i in range(xl + geta, xr + geta):\n buildings[i] = max(buildings[i], h)\n print(\n (\n min(\n buildings[i]\n - sqrt(R * R - (i - geta + (i < geta)) * (i - geta + (i < geta)))\n + R\n for i in range(-R + geta, R + geta)\n )\n )\n )\n", "measured_fast_code_sha256": "d01a3b994ea420f84f1fec9d04b81e669100b8678a5fdca6b824945b066ea855", "measured_slow_code": "while True:\n R, N = list(map(int, input().split()))\n if not (R | N):\n break\n geta = 20\n buildings = [0] * (geta * 2)\n for _ in range(N):\n xl, xr, h = list(map(int, input().split()))\n for i in range(xl + geta, xr + geta):\n buildings[i] = max(buildings[i], h)\n left, right = 0, 20\n for _ in range(100):\n mid = (left + right) / 2\n flag = True\n for i in range(-R + geta, R + geta):\n if i < geta:\n y = pow(R * R - (i - geta + 1) * (i - geta + 1), 0.5)\n flag &= buildings[i] >= y - R + mid\n else:\n y = pow(R * R - (i - geta) * (i - geta), 0.5)\n flag &= buildings[i] >= y - R + mid\n if flag:\n left = mid\n else:\n right = mid\n print((\"{:.20f}\".format(left)))\n", "measured_slow_code_sha256": "795b09bbdc3e784c88f5123c69e5182a24a5b0dfccc3a43d6572c5a9d5f75406", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 12.481867903970496, "pair_id": "python_v2_54c2c3241998f9191deddd04", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p00775", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p00775_d01a3b994ea420f84f1fec9d04b81e669100b8678a5fdca6b824945b066ea855.jsonl.gz", "inputs": "reproduction/python/inputs/p00775.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p00775_795b09bbdc3e784c88f5123c69e5182a24a5b0dfccc3a43d6572c5a9d5f75406.jsonl.gz"}, "slow_code": "while True:\n R, N = list(map(int, input().split()))\n if not (R | N):\n break\n geta = 20\n buildings = [0] * (geta * 2)\n for _ in range(N):\n xl, xr, h = list(map(int, input().split()))\n for i in range(xl + geta, xr + geta):\n buildings[i] = max(buildings[i], h)\n left, right = 0, 20\n for _ in range(100):\n mid = (left + right) / 2\n flag = True\n for i in range(-R + geta, R + geta):\n if i < geta:\n y = pow(R * R - (i - geta + 1) * (i - geta + 1), 0.5)\n flag &= buildings[i] >= y - R + mid\n else:\n y = pow(R * R - (i - geta) * (i - geta), 0.5)\n flag &= buildings[i] >= y - R + mid\n if flag:\n left = mid\n else:\n right = mid\n print((\"{:.20f}\".format(left)))\n", "slow_code_sha256": "795b09bbdc3e784c88f5123c69e5182a24a5b0dfccc3a43d6572c5a9d5f75406", "slow_id": "p00775_795b09bbdc3e784c88f5123c69e5182a24a5b0dfccc3a43d6572c5a9d5f75406", "speedup": 12.740507331930266, "stratum": "8+", "within_pair_jaccard": 0.6136363636363636, "workload": {"case_count": 100, "description": "For each dataset, find the last t>=0 when the radius-r disk centered at (0,t-r) is entirely covered by n building rectangles [xl_i,xr_i]x[0,h_i] together with y<=0. Rectangles may overlap or touch. A final 0 0 ends input. Observed inputs: datasets=1..5 (median 1); r=1..20; n=0..20; total_rectangles=0..92 (median 16.5); xl_i=-20..19; xr_i=-19..20; h_i=1..20.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 806, "median": 156.5, "min": 8}, "input_format": ["r_1 n_1\n[n_1 lines: xl_i xr_i h_i]\n[next datasets]\n0 0"], "input_format_status": "source_input_section", "input_lines": {"max": 98, "median": 20.5, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 288, "median": 56.0, "min": 4}}} -{"case_ids": ["p02607_case_000", "p02607_case_001", "p02607_case_002", "p02607_case_003", "p02607_case_004", "p02607_case_005", "p02607_case_006", "p02607_case_007", "p02607_case_008", "p02607_case_009", "p02607_case_010", "p02607_case_011", "p02607_case_012", "p02607_case_013", "p02607_case_014", "p02607_case_015", "p02607_case_016", "p02607_case_017", "p02607_case_018", "p02607_case_019", "p02607_case_020", "p02607_case_021", "p02607_case_022", "p02607_case_023", "p02607_case_024", "p02607_case_025", "p02607_case_026", "p02607_case_027", "p02607_case_028", "p02607_case_029", "p02607_case_030", "p02607_case_031", "p02607_case_032", "p02607_case_033", "p02607_case_034", "p02607_case_035", "p02607_case_036", "p02607_case_037", "p02607_case_038", "p02607_case_039", "p02607_case_040", "p02607_case_041", "p02607_case_042", "p02607_case_043", "p02607_case_044", "p02607_case_045", "p02607_case_046", "p02607_case_047", "p02607_case_048", "p02607_case_049", "p02607_case_050", "p02607_case_051", "p02607_case_052", "p02607_case_053", "p02607_case_054", "p02607_case_055", "p02607_case_056", "p02607_case_057", "p02607_case_058", "p02607_case_059", "p02607_case_060", "p02607_case_061", "p02607_case_062", "p02607_case_063", "p02607_case_064", "p02607_case_065", "p02607_case_066", "p02607_case_067", "p02607_case_068", "p02607_case_069", "p02607_case_070", "p02607_case_071", "p02607_case_072", "p02607_case_073", "p02607_case_074", "p02607_case_075", "p02607_case_076", "p02607_case_077", "p02607_case_078", "p02607_case_079", "p02607_case_080", "p02607_case_081", "p02607_case_082", "p02607_case_083", "p02607_case_084", "p02607_case_085", "p02607_case_086", "p02607_case_087", "p02607_case_088", "p02607_case_089", "p02607_case_090", "p02607_case_091", "p02607_case_092", "p02607_case_093", "p02607_case_094", "p02607_case_095", "p02607_case_096", "p02607_case_097", "p02607_case_098", "p02607_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\na = list(map(int, input().split()))\nans = 0\nfor i in range(n):\n if i % 2 == 0 and a[i] % 2:\n ans += 1\nprint(ans)\n", "fast_code_sha256": "2a516c6073b8fdb9467f23f3ca7eab34997e183764079e15906e0a602d415efe", "fast_id": "p02607_2a516c6073b8fdb9467f23f3ca7eab34997e183764079e15906e0a602d415efe", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\na = list(map(int, input().split()))\nans = 0\nfor i in range(n):\n if i % 2 == 0 and a[i] % 2:\n ans += 1\nprint(ans)\n", "measured_fast_code_sha256": "2a516c6073b8fdb9467f23f3ca7eab34997e183764079e15906e0a602d415efe", "measured_slow_code": "import sys\nfrom collections import deque\nimport numpy as np\nimport math\n\nsys.setrecursionlimit(10**6)\n\n\ndef S():\n return sys.stdin.readline().rstrip()\n\n\ndef SL():\n return list(map(str, sys.stdin.readline().rstrip().split()))\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\ndef IL():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef Main():\n n = I()\n a = list(IL())\n c = 0\n for rep in range(0, n, 2):\n if a[rep] % 2:\n c += 1\n print(c)\n return\n\n\nif __name__ == \"__main__\":\n Main()\n", "measured_slow_code_sha256": "80d5226038bdb32cf21a0b535cbd1c7092e4e8009586ccf346a6a6f305bc5b7d", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1037.5926170438975, "pair_id": "python_v2_641ece4de720b1674c990178", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02607", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02607_2a516c6073b8fdb9467f23f3ca7eab34997e183764079e15906e0a602d415efe.jsonl.gz", "inputs": "reproduction/python/inputs/p02607.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02607_80d5226038bdb32cf21a0b535cbd1c7092e4e8009586ccf346a6a6f305bc5b7d.jsonl.gz"}, "slow_code": "import sys\nfrom collections import deque\nimport numpy as np\nimport math\n\nsys.setrecursionlimit(10**6)\n\n\ndef S():\n return sys.stdin.readline().rstrip()\n\n\ndef SL():\n return list(map(str, sys.stdin.readline().rstrip().split()))\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\ndef IL():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef Main():\n n = I()\n a = list(IL())\n c = 0\n for rep in range(0, n, 2):\n if a[rep] % 2:\n c += 1\n print(c)\n return\n\n\nif __name__ == \"__main__\":\n Main()\n", "slow_code_sha256": "80d5226038bdb32cf21a0b535cbd1c7092e4e8009586ccf346a6a6f305bc5b7d", "slow_id": "p02607_80d5226038bdb32cf21a0b535cbd1c7092e4e8009586ccf346a6a6f305bc5b7d", "speedup": 949.3996503715451, "stratum": "8+", "within_pair_jaccard": 0.30434782608695654, "workload": {"case_count": 100, "description": "Count array entries for which both the 1-based position i and the integer value a_i are odd. Observed inputs: N=1..100 (median 30); a_i=1..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 300, "median": 67.5, "min": 4}, "input_format": ["N\na_1 ... a_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 101, "median": 31.0, "min": 2}}} -{"case_ids": ["p03576_case_000", "p03576_case_001", "p03576_case_002", "p03576_case_003", "p03576_case_004", "p03576_case_005", "p03576_case_006", "p03576_case_007", "p03576_case_008", "p03576_case_009", "p03576_case_010", "p03576_case_011", "p03576_case_012", "p03576_case_013", "p03576_case_014", "p03576_case_015", "p03576_case_016", "p03576_case_017", "p03576_case_018", "p03576_case_019", "p03576_case_020", "p03576_case_021", "p03576_case_022", "p03576_case_023", "p03576_case_024", "p03576_case_025", "p03576_case_026", "p03576_case_027", "p03576_case_028", "p03576_case_029", "p03576_case_030", "p03576_case_031", "p03576_case_032", "p03576_case_033", "p03576_case_034", "p03576_case_035", "p03576_case_036", "p03576_case_037", "p03576_case_038", "p03576_case_039", "p03576_case_040", "p03576_case_041", "p03576_case_042", "p03576_case_043", "p03576_case_044", "p03576_case_045", "p03576_case_046", "p03576_case_047", "p03576_case_048", "p03576_case_049", "p03576_case_050", "p03576_case_051", "p03576_case_052", "p03576_case_053", "p03576_case_054", "p03576_case_055", "p03576_case_056", "p03576_case_057", "p03576_case_058", "p03576_case_059", "p03576_case_060", "p03576_case_061", "p03576_case_062", "p03576_case_063", "p03576_case_064", "p03576_case_065", "p03576_case_066", "p03576_case_067", "p03576_case_068", "p03576_case_069", "p03576_case_070", "p03576_case_071", "p03576_case_072", "p03576_case_073", "p03576_case_074", "p03576_case_075", "p03576_case_076", "p03576_case_077", "p03576_case_078", "p03576_case_079", "p03576_case_080", "p03576_case_081", "p03576_case_082", "p03576_case_083", "p03576_case_084", "p03576_case_085", "p03576_case_086", "p03576_case_087", "p03576_case_088", "p03576_case_089", "p03576_case_090", "p03576_case_091", "p03576_case_092", "p03576_case_093", "p03576_case_094", "p03576_case_095", "p03576_case_096", "p03576_case_097", "p03576_case_098", "p03576_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N, K = list(map(int, input().split()))\nXY = [list(map(int, input().split())) for _ in [0] * N]\niX = sorted(x for x, y in XY)\niY = sorted(y for x, y in XY)\nX = {x: i for i, x in enumerate(iX)}\nY = {y: i for i, y in enumerate(iY)}\nc = [[0] * (N + 1) for i in [0] * (N + 1)]\nfor x, y in XY:\n c[Y[y] + 1][X[x] + 1] = 1\nfor i in range(N):\n ci1 = c[i + 1]\n for j in range(N):\n ci1[j + 1] += ci1[j]\nfor i in range(N):\n ci1 = c[i + 1]\n ci = c[i]\n for j in range(N):\n ci1[j + 1] += ci[j + 1]\nans = 10**20\nfor u in range(N):\n for d in range(u + K - 1, N):\n l = 0\n r = 1\n dY = iY[d] - iY[u]\n cd = c[d + 1]\n cu = c[u]\n while r < N:\n if cd[r + 1] + cu[l] - cu[r + 1] - cd[l] >= K:\n ans = min(ans, (iX[r] - iX[l]) * dY)\n l += 1\n else:\n r += 1\nprint(ans)\n", "fast_code_sha256": "b51f27babf7f835801028b4d1b79979c6ee61876bbeba15e97413eb45f9000f8", "fast_id": "p03576_b51f27babf7f835801028b4d1b79979c6ee61876bbeba15e97413eb45f9000f8", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N, K = list(map(int, input().split()))\nXY = [list(map(int, input().split())) for _ in [0] * N]\niX = sorted(x for x, y in XY)\niY = sorted(y for x, y in XY)\nX = {x: i for i, x in enumerate(iX)}\nY = {y: i for i, y in enumerate(iY)}\nc = [[0] * (N + 1) for i in [0] * (N + 1)]\nfor x, y in XY:\n c[Y[y] + 1][X[x] + 1] = 1\nfor i in range(N):\n ci1 = c[i + 1]\n for j in range(N):\n ci1[j + 1] += ci1[j]\nfor i in range(N):\n ci1 = c[i + 1]\n ci = c[i]\n for j in range(N):\n ci1[j + 1] += ci[j + 1]\nans = 10**20\nfor u in range(N):\n for d in range(u + K - 1, N):\n l = 0\n r = 1\n dY = iY[d] - iY[u]\n cd = c[d + 1]\n cu = c[u]\n while r < N:\n if cd[r + 1] + cu[l] - cu[r + 1] - cd[l] >= K:\n ans = min(ans, (iX[r] - iX[l]) * dY)\n l += 1\n else:\n r += 1\nprint(ans)\n", "measured_fast_code_sha256": "b51f27babf7f835801028b4d1b79979c6ee61876bbeba15e97413eb45f9000f8", "measured_slow_code": "N, K = list(map(int, input().split()))\nXY = [list(map(int, input().split())) for _ in [0] * N]\niX = sorted(x for x, y in XY)\niY = sorted(y for x, y in XY)\nX = {x: i for i, x in enumerate(iX)}\nY = {y: i for i, y in enumerate(iY)}\nc = [[0] * (N + 1) for i in [0] * (N + 1)]\nfor x, y in XY:\n c[Y[y] + 1][X[x] + 1] = 1\nfor i in range(N):\n for j in range(N):\n c[i + 1][j + 1] += c[i + 1][j]\nfor i in range(N):\n for j in range(N):\n c[i + 1][j + 1] += c[i][j + 1]\nans = 10**20\nfor l in range(N):\n for u in range(N):\n for r in range(l + 1, N):\n for d in range(u + 1, N):\n if c[d + 1][r + 1] + c[u][l] - c[u][r + 1] - c[d + 1][l] >= K:\n ans = min(ans, (iX[r] - iX[l]) * (iY[d] - iY[u]))\n break\nprint(ans)\n", "measured_slow_code_sha256": "fd20afd963fd30c74ad5f4b82bca4c03fd89aa79658948ac77c21734df8d5853", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.4999761061545778, "pair_id": "python_v2_ae36021ca43da64f67f37673", "per_case_slow_code_faster_fraction": 0.19, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03576", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03576_b51f27babf7f835801028b4d1b79979c6ee61876bbeba15e97413eb45f9000f8.jsonl.gz", "inputs": "reproduction/python/inputs/p03576.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03576_fd20afd963fd30c74ad5f4b82bca4c03fd89aa79658948ac77c21734df8d5853.jsonl.gz"}, "slow_code": "N, K = list(map(int, input().split()))\nXY = [list(map(int, input().split())) for _ in [0] * N]\niX = sorted(x for x, y in XY)\niY = sorted(y for x, y in XY)\nX = {x: i for i, x in enumerate(iX)}\nY = {y: i for i, y in enumerate(iY)}\nc = [[0] * (N + 1) for i in [0] * (N + 1)]\nfor x, y in XY:\n c[Y[y] + 1][X[x] + 1] = 1\nfor i in range(N):\n for j in range(N):\n c[i + 1][j + 1] += c[i + 1][j]\nfor i in range(N):\n for j in range(N):\n c[i + 1][j + 1] += c[i][j + 1]\nans = 10**20\nfor l in range(N):\n for u in range(N):\n for r in range(l + 1, N):\n for d in range(u + 1, N):\n if c[d + 1][r + 1] + c[u][l] - c[u][r + 1] - c[d + 1][l] >= K:\n ans = min(ans, (iX[r] - iX[l]) * (iY[d] - iY[u]))\n break\nprint(ans)\n", "slow_code_sha256": "fd20afd963fd30c74ad5f4b82bca4c03fd89aa79658948ac77c21734df8d5853", "slow_id": "p03576_fd20afd963fd30c74ad5f4b82bca4c03fd89aa79658948ac77c21734df8d5853", "speedup": 6.586906362355319, "stratum": "4-8", "within_pair_jaccard": 0.813953488372093, "workload": {"case_count": 100, "description": "Find the minimum area of an axis-aligned rectangle containing at least K of N plane points, counting boundary points. All x coordinates are distinct, and all y coordinates are distinct. Observed inputs: N=2..50 (median 25); K=2..50 (median 2.5); x_i=-1000000000..997427460; y_i=-1000000000..997398050.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1106, "median": 524.0, "min": 40}, "input_format": ["N K\nx_1 y_1\n...\nx_N y_N"], "input_format_status": "source_input_section", "input_lines": {"max": 51, "median": 26.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 102, "median": 52.0, "min": 6}}} -{"case_ids": ["p02883_case_000", "p02883_case_001", "p02883_case_002", "p02883_case_003", "p02883_case_004", "p02883_case_005", "p02883_case_006", "p02883_case_007", "p02883_case_008", "p02883_case_009", "p02883_case_010", "p02883_case_011", "p02883_case_012", "p02883_case_013", "p02883_case_014", "p02883_case_015", "p02883_case_016", "p02883_case_017", "p02883_case_018", "p02883_case_019", "p02883_case_020", "p02883_case_021", "p02883_case_022", "p02883_case_023", "p02883_case_024", "p02883_case_025", "p02883_case_026", "p02883_case_027", "p02883_case_028", "p02883_case_029", "p02883_case_030", "p02883_case_031", "p02883_case_032", "p02883_case_033", "p02883_case_034", "p02883_case_035", "p02883_case_036", "p02883_case_037", "p02883_case_038", "p02883_case_039", "p02883_case_040", "p02883_case_041", "p02883_case_042", "p02883_case_043", "p02883_case_044", "p02883_case_045", "p02883_case_046", "p02883_case_047", "p02883_case_048", "p02883_case_049", "p02883_case_050", "p02883_case_051", "p02883_case_052", "p02883_case_053", "p02883_case_054", "p02883_case_055", "p02883_case_056", "p02883_case_057", "p02883_case_058", "p02883_case_059", "p02883_case_060", "p02883_case_061", "p02883_case_062", "p02883_case_063", "p02883_case_064", "p02883_case_065", "p02883_case_066", "p02883_case_067", "p02883_case_068", "p02883_case_069", "p02883_case_070", "p02883_case_071", "p02883_case_072", "p02883_case_073", "p02883_case_074", "p02883_case_075", "p02883_case_076", "p02883_case_077", "p02883_case_078", "p02883_case_079", "p02883_case_080", "p02883_case_081", "p02883_case_082", "p02883_case_083", "p02883_case_084", "p02883_case_085", "p02883_case_086", "p02883_case_087", "p02883_case_088", "p02883_case_089", "p02883_case_090", "p02883_case_091", "p02883_case_092", "p02883_case_093", "p02883_case_094", "p02883_case_095", "p02883_case_096", "p02883_case_097", "p02883_case_098", "p02883_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\nsys.setrecursionlimit(10**7)\n\n\ndef main():\n n, k = list(map(int, input().split()))\n a = list(map(int, input().split()))\n f = list(map(int, input().split()))\n a.sort()\n f.sort(reverse=True)\n l = -1\n r = 10**13\n\n def test(x):\n cnt = 0\n for ae, fe in zip(a, f):\n cnt += max(0, ae - x // fe)\n return cnt <= k\n\n while l + 1 < r:\n m = (l + r) // 2\n if test(m):\n r = m\n else:\n l = m\n ans = r\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "4ecb8d0fe079a56634e90fa4f0ff290ca63fe7d8739794251436a0b6966bd79b", "fast_id": "p02883_4ecb8d0fe079a56634e90fa4f0ff290ca63fe7d8739794251436a0b6966bd79b", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\nsys.setrecursionlimit(10**7)\n\n\ndef main():\n n, k = list(map(int, input().split()))\n a = list(map(int, input().split()))\n f = list(map(int, input().split()))\n a.sort()\n f.sort(reverse=True)\n l = -1\n r = 10**13\n\n def test(x):\n cnt = 0\n for ae, fe in zip(a, f):\n cnt += max(0, ae - x // fe)\n return cnt <= k\n\n while l + 1 < r:\n m = (l + r) // 2\n if test(m):\n r = m\n else:\n l = m\n ans = r\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "4ecb8d0fe079a56634e90fa4f0ff290ca63fe7d8739794251436a0b6966bd79b", "measured_slow_code": "import math\n\nN, K = list(map(int, input().split()))\nX = [\n (b, a * b)\n for a, b in zip(\n sorted(list(map(int, input().split()))),\n sorted(list(map(int, input().split())))[::-1],\n )\n]\nm, M, i = 0, 10**12, 1\nexec(\n \"i,M,m=((i+m)//2,i,m) if sum(math.ceil(max(0,c-i)/b)for b, c in X)<=K else((i+M)//2,M,i);\"\n * 50\n)\nprint(M)\n", "measured_slow_code_sha256": "89d6694c33292de91a1011c40ba1f43b8a55e43ab7d13d625a0ff741f7a3effc", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 6.941041554676258, "pair_id": "python_v2_f673d5538c98e9ca32c1c9f2", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02883", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02883_4ecb8d0fe079a56634e90fa4f0ff290ca63fe7d8739794251436a0b6966bd79b.jsonl.gz", "inputs": "reproduction/python/inputs/p02883.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02883_89d6694c33292de91a1011c40ba1f43b8a55e43ab7d13d625a0ff741f7a3effc.jsonl.gz"}, "slow_code": "import math\n\nN, K = list(map(int, input().split()))\nX = [\n (b, a * b)\n for a, b in zip(\n sorted(list(map(int, input().split()))),\n sorted(list(map(int, input().split())))[::-1],\n )\n]\nm, M, i = 0, 10**12, 1\nexec(\n \"i,M,m=((i+m)//2,i,m) if sum(math.ceil(max(0,c-i)/b)for b, c in X)<=K else((i+M)//2,M,i);\"\n * 50\n)\nprint(M)\n", "slow_code_sha256": "89d6694c33292de91a1011c40ba1f43b8a55e43ab7d13d625a0ff741f7a3effc", "slow_id": "p02883_89d6694c33292de91a1011c40ba1f43b8a55e43ab7d13d625a0ff741f7a3effc", "speedup": 4.252102381970589, "stratum": "4-8", "within_pair_jaccard": 0.2830188679245283, "workload": {"case_count": 100, "description": "Assign N people bijectively to N foods to minimize the longest finishing time. Person i has coefficient A_i; food j takes A_i*F_j time. At most K training steps may each reduce a coefficient by 1, never below zero. Observed inputs: N=1..200000 (median 10); K=0..1000000000000000000; A_i=1..1000000; F_i=1..1000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 3200027, "median": 147.0, "min": 8}, "input_format": ["N K\nA_1 ... A_N\nF_1 ... F_N"], "input_format_status": "source_input_section", "input_lines": {"max": 3, "median": 3.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 400002, "median": 22.0, "min": 4}}} -{"case_ids": ["p03997_case_000", "p03997_case_001", "p03997_case_002", "p03997_case_003", "p03997_case_004", "p03997_case_005", "p03997_case_006", "p03997_case_007", "p03997_case_008", "p03997_case_009", "p03997_case_010", "p03997_case_011", "p03997_case_012", "p03997_case_013", "p03997_case_014", "p03997_case_015", "p03997_case_016", "p03997_case_017", "p03997_case_018", "p03997_case_019", "p03997_case_020", "p03997_case_021", "p03997_case_022", "p03997_case_023", "p03997_case_024", "p03997_case_025", "p03997_case_026", "p03997_case_027", "p03997_case_028", "p03997_case_029", "p03997_case_030", "p03997_case_031", "p03997_case_032", "p03997_case_033", "p03997_case_034", "p03997_case_035", "p03997_case_036", "p03997_case_037", "p03997_case_038", "p03997_case_039", "p03997_case_040", "p03997_case_041", "p03997_case_042", "p03997_case_043", "p03997_case_044", "p03997_case_045", "p03997_case_046", "p03997_case_047", "p03997_case_048", "p03997_case_049", "p03997_case_050", "p03997_case_051", "p03997_case_052", "p03997_case_053", "p03997_case_054", "p03997_case_055", "p03997_case_056", "p03997_case_057", "p03997_case_058", "p03997_case_059", "p03997_case_060", "p03997_case_061", "p03997_case_062", "p03997_case_063", "p03997_case_064", "p03997_case_065", "p03997_case_066", "p03997_case_067", "p03997_case_068", "p03997_case_069", "p03997_case_070", "p03997_case_071", "p03997_case_072", "p03997_case_073", "p03997_case_074", "p03997_case_075", "p03997_case_076", "p03997_case_077", "p03997_case_078", "p03997_case_079", "p03997_case_080", "p03997_case_081", "p03997_case_082", "p03997_case_083", "p03997_case_084", "p03997_case_085", "p03997_case_086", "p03997_case_087", "p03997_case_088", "p03997_case_089", "p03997_case_090", "p03997_case_091", "p03997_case_092", "p03997_case_093", "p03997_case_094", "p03997_case_095", "p03997_case_096", "p03997_case_097", "p03997_case_098", "p03997_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "a = int(eval(input()))\nb = int(eval(input()))\nh = int(eval(input()))\ns = int((a + b) * h / 2)\nprint(s)\n", "fast_code_sha256": "6fadcb003e342664a42a30de9847161852f9a4d302a34f053ae26b1a5bfc20b4", "fast_id": "p03997_6fadcb003e342664a42a30de9847161852f9a4d302a34f053ae26b1a5bfc20b4", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "a = int(eval(input()))\nb = int(eval(input()))\nh = int(eval(input()))\ns = int((a + b) * h / 2)\nprint(s)\n", "measured_fast_code_sha256": "6fadcb003e342664a42a30de9847161852f9a4d302a34f053ae26b1a5bfc20b4", "measured_slow_code": "from collections import deque\nfrom heapq import heapify, heappop, heappush, heappushpop\nfrom copy import copy, deepcopy\nfrom itertools import product, permutations, combinations, combinations_with_replacement\nfrom collections import defaultdict, Counter\nfrom bisect import bisect_left, bisect_right\n\n# from math import gcd,ceil,floor,factorial\n# from fractions import gcd\nfrom functools import reduce\nfrom pprint import pprint\n\nINF = float(\"inf\")\n\n\ndef myinput():\n return list(map(int, input().split()))\n\n\ndef mylistinput(n):\n return [list(myinput()) for _ in range(n)]\n\n\ndef mycol(data, col):\n return [row[col] for row in data]\n\n\ndef mysort(data, col, reverse_flag):\n data.sort(key=lambda x: x[col], reverse=reverse_flag)\n return data\n\n\ndef mymax(data):\n M = -1 * float(\"inf\")\n for i in range(len(data)):\n m = max(data[i])\n M = max(M, m)\n return M\n\n\ndef mymin(data):\n m = float(\"inf\")\n for i in range(len(data)):\n M = min(data[i])\n m = min(m, M)\n return m\n\n\ndef mycount(ls, x):\n # lsはソート済��であること\n l = bisect_left(ls, x)\n r = bisect_right(ls, x)\n return r - l\n\n\ndef myoutput(ls, space=True):\n if space:\n if len(ls) == 0:\n print(\" \")\n elif type(ls[0]) == str:\n print((\" \".join(ls)))\n elif type(ls[0]) == int:\n print((\" \".join(map(str, ls))))\n else:\n print(\"Output Error\")\n else:\n if len(ls) == 0:\n print(\"\")\n elif type(ls[0]) == str:\n print((\"\".join(ls)))\n elif type(ls[0]) == int:\n print((\"\".join(map(str, ls))))\n else:\n print(\"Output Error\")\n\n\na = int(eval(input()))\nb = int(eval(input()))\nh = int(eval(input()))\nans = (a + b) * h / 2\nprint((int(ans)))\n", "measured_slow_code_sha256": "89a2c802763da09caab2310090bce1a3bd8e29ef5b06b86a35dfdaa7e9205bfe", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 16.079185355318796, "pair_id": "python_v2_e8d1ab91444506461be36b7e", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03997", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03997_6fadcb003e342664a42a30de9847161852f9a4d302a34f053ae26b1a5bfc20b4.jsonl.gz", "inputs": "reproduction/python/inputs/p03997.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03997_89a2c802763da09caab2310090bce1a3bd8e29ef5b06b86a35dfdaa7e9205bfe.jsonl.gz"}, "slow_code": "from collections import deque\nfrom heapq import heapify, heappop, heappush, heappushpop\nfrom copy import copy, deepcopy\nfrom itertools import product, permutations, combinations, combinations_with_replacement\nfrom collections import defaultdict, Counter\nfrom bisect import bisect_left, bisect_right\n\n\nfrom functools import reduce\nfrom pprint import pprint\n\nINF = float(\"inf\")\n\n\ndef myinput():\n return list(map(int, input().split()))\n\n\ndef mylistinput(n):\n return [list(myinput()) for _ in range(n)]\n\n\ndef mycol(data, col):\n return [row[col] for row in data]\n\n\ndef mysort(data, col, reverse_flag):\n data.sort(key=lambda x: x[col], reverse=reverse_flag)\n return data\n\n\ndef mymax(data):\n M = -1 * float(\"inf\")\n for i in range(len(data)):\n m = max(data[i])\n M = max(M, m)\n return M\n\n\ndef mymin(data):\n m = float(\"inf\")\n for i in range(len(data)):\n M = min(data[i])\n m = min(m, M)\n return m\n\n\ndef mycount(ls, x):\n\n l = bisect_left(ls, x)\n r = bisect_right(ls, x)\n return r - l\n\n\ndef myoutput(ls, space=True):\n if space:\n if len(ls) == 0:\n print(\" \")\n elif type(ls[0]) == str:\n print((\" \".join(ls)))\n elif type(ls[0]) == int:\n print((\" \".join(map(str, ls))))\n else:\n print(\"Output Error\")\n else:\n if len(ls) == 0:\n print(\"\")\n elif type(ls[0]) == str:\n print((\"\".join(ls)))\n elif type(ls[0]) == int:\n print((\"\".join(map(str, ls))))\n else:\n print(\"Output Error\")\n\n\na = int(eval(input()))\nb = int(eval(input()))\nh = int(eval(input()))\nans = (a + b) * h / 2\nprint((int(ans)))\n", "slow_code_sha256": "b35e7a11385fd8d3cfedbd5906973a53bac70684dd98a901c660194c6fcfc1db", "slow_id": "p03997_89a2c802763da09caab2310090bce1a3bd8e29ef5b06b86a35dfdaa7e9205bfe", "speedup": 16.047913948115077, "stratum": "8+", "within_pair_jaccard": 0.09411764705882353, "workload": {"case_count": 100, "description": "Compute the area of a trapezoid with integer bases a and b and even integer height h. Observed inputs: a=1..100; b=1..100; h=2..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 12, "median": 9.0, "min": 6}, "input_format": ["a\nb\nh"], "input_format_status": "source_input_section", "input_lines": {"max": 3, "median": 3.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3, "median": 3.0, "min": 3}}} -{"case_ids": ["p02830_case_000", "p02830_case_001", "p02830_case_002", "p02830_case_003", "p02830_case_004", "p02830_case_005", "p02830_case_006", "p02830_case_007", "p02830_case_008", "p02830_case_009", "p02830_case_010", "p02830_case_011", "p02830_case_012", "p02830_case_013", "p02830_case_014", "p02830_case_015", "p02830_case_016", "p02830_case_017", "p02830_case_018", "p02830_case_019", "p02830_case_020", "p02830_case_021", "p02830_case_022", "p02830_case_023", "p02830_case_024", "p02830_case_025", "p02830_case_026", "p02830_case_027", "p02830_case_028", "p02830_case_029", "p02830_case_030", "p02830_case_031", "p02830_case_032", "p02830_case_033", "p02830_case_034", "p02830_case_035", "p02830_case_036", "p02830_case_037", "p02830_case_038", "p02830_case_039", "p02830_case_040", "p02830_case_041", "p02830_case_042", "p02830_case_043", "p02830_case_044", "p02830_case_045", "p02830_case_046", "p02830_case_047", "p02830_case_048", "p02830_case_049", "p02830_case_050", "p02830_case_051", "p02830_case_052", "p02830_case_053", "p02830_case_054", "p02830_case_055", "p02830_case_056", "p02830_case_057", "p02830_case_058", "p02830_case_059", "p02830_case_060", "p02830_case_061", "p02830_case_062", "p02830_case_063", "p02830_case_064", "p02830_case_065", "p02830_case_066", "p02830_case_067", "p02830_case_068", "p02830_case_069", "p02830_case_070", "p02830_case_071", "p02830_case_072", "p02830_case_073", "p02830_case_074", "p02830_case_075", "p02830_case_076", "p02830_case_077", "p02830_case_078", "p02830_case_079", "p02830_case_080", "p02830_case_081", "p02830_case_082", "p02830_case_083", "p02830_case_084", "p02830_case_085", "p02830_case_086", "p02830_case_087", "p02830_case_088", "p02830_case_089", "p02830_case_090", "p02830_case_091", "p02830_case_092", "p02830_case_093", "p02830_case_094", "p02830_case_095", "p02830_case_096", "p02830_case_097", "p02830_case_098", "p02830_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef mapint():\n return list(map(int, input().split()))\n\n\nsys.setrecursionlimit(10**9)\nN = int(eval(input()))\nS, T = input().split()\nans = \"\"\nfor s, t in zip(list(S), list(T)):\n ans += s + t\nprint(ans)\n", "fast_code_sha256": "a76d0913be2e6f46c10e43d2f92edb769b87ec5c37ab88b6fdc6958fe7b5e732", "fast_id": "p02830_a76d0913be2e6f46c10e43d2f92edb769b87ec5c37ab88b6fdc6958fe7b5e732", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef mapint():\n return list(map(int, input().split()))\n\n\nsys.setrecursionlimit(10**9)\nN = int(eval(input()))\nS, T = input().split()\nans = \"\"\nfor s, t in zip(list(S), list(T)):\n ans += s + t\nprint(ans)\n", "measured_fast_code_sha256": "a76d0913be2e6f46c10e43d2f92edb769b87ec5c37ab88b6fdc6958fe7b5e732", "measured_slow_code": "from collections import Counter, defaultdict, deque\nfrom heapq import heappop, heappush\nfrom bisect import bisect_left, bisect_right\nimport sys, math, itertools, fractions\n\nsys.setrecursionlimit(10**8)\nmod = 10**9 + 7\nINF = float(\"inf\")\n\n\ndef inp():\n return int(sys.stdin.readline())\n\n\ndef inpl():\n return list(map(int, sys.stdin.readline().split()))\n\n\nn = inp()\ns, t = input().split()\nprint((\"\".join([s[i] + t[i] for i in range(n)])))\n", "measured_slow_code_sha256": "992e686444192fb7564ecff1647d9aa6e75db539811d55b3349d5f91772e9ce3", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 15.385191112958715, "pair_id": "python_v2_42ca017b9a9b2788f6ee5214", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02830", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02830_a76d0913be2e6f46c10e43d2f92edb769b87ec5c37ab88b6fdc6958fe7b5e732.jsonl.gz", "inputs": "reproduction/python/inputs/p02830.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02830_992e686444192fb7564ecff1647d9aa6e75db539811d55b3349d5f91772e9ce3.jsonl.gz"}, "slow_code": "from collections import Counter, defaultdict, deque\nfrom heapq import heappop, heappush\nfrom bisect import bisect_left, bisect_right\nimport sys, math, itertools, fractions\n\nsys.setrecursionlimit(10**8)\nmod = 10**9 + 7\nINF = float(\"inf\")\n\n\ndef inp():\n return int(sys.stdin.readline())\n\n\ndef inpl():\n return list(map(int, sys.stdin.readline().split()))\n\n\nn = inp()\ns, t = input().split()\nprint((\"\".join([s[i] + t[i] for i in range(n)])))\n", "slow_code_sha256": "992e686444192fb7564ecff1647d9aa6e75db539811d55b3349d5f91772e9ce3", "slow_id": "p02830_992e686444192fb7564ecff1647d9aa6e75db539811d55b3349d5f91772e9ce3", "speedup": 15.65520944469469, "stratum": "8+", "within_pair_jaccard": 0.3584905660377358, "workload": {"case_count": 100, "description": "Interleave two lowercase strings S and T, both of length N, taking S_1,T_1,S_2,T_2,...,S_N,T_N. Observed inputs: N=1..100 (median 50).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 206, "median": 105.0, "min": 6}, "input_format": ["N\nS T"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3, "median": 3.0, "min": 3}}} -{"case_ids": ["p03816_case_000", "p03816_case_001", "p03816_case_002", "p03816_case_003", "p03816_case_004", "p03816_case_005", "p03816_case_006", "p03816_case_007", "p03816_case_008", "p03816_case_009", "p03816_case_010", "p03816_case_011", "p03816_case_012", "p03816_case_013", "p03816_case_014", "p03816_case_015", "p03816_case_016", "p03816_case_017", "p03816_case_018", "p03816_case_019", "p03816_case_020", "p03816_case_021", "p03816_case_022", "p03816_case_023", "p03816_case_024", "p03816_case_025", "p03816_case_026", "p03816_case_027", "p03816_case_028", "p03816_case_029", "p03816_case_030", "p03816_case_031", "p03816_case_032", "p03816_case_033", "p03816_case_034", "p03816_case_035", "p03816_case_036", "p03816_case_037", "p03816_case_038", "p03816_case_039", "p03816_case_040", "p03816_case_041", "p03816_case_042", "p03816_case_043", "p03816_case_044", "p03816_case_045", "p03816_case_046", "p03816_case_047", "p03816_case_048", "p03816_case_049", "p03816_case_050", "p03816_case_051", "p03816_case_052", "p03816_case_053", "p03816_case_054", "p03816_case_055", "p03816_case_056", "p03816_case_057", "p03816_case_058", "p03816_case_059", "p03816_case_060", "p03816_case_061", "p03816_case_062", "p03816_case_063", "p03816_case_064", "p03816_case_065", "p03816_case_066", "p03816_case_067", "p03816_case_068", "p03816_case_069", "p03816_case_070", "p03816_case_071", "p03816_case_072", "p03816_case_073", "p03816_case_074", "p03816_case_075", "p03816_case_076", "p03816_case_077", "p03816_case_078", "p03816_case_079", "p03816_case_080", "p03816_case_081", "p03816_case_082", "p03816_case_083", "p03816_case_084", "p03816_case_085", "p03816_case_086", "p03816_case_087", "p03816_case_088", "p03816_case_089", "p03816_case_090", "p03816_case_091", "p03816_case_092", "p03816_case_093", "p03816_case_094", "p03816_case_095", "p03816_case_096", "p03816_case_097", "p03816_case_098", "p03816_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N = int(eval(input()))\n(*A,) = list(map(int, input().split()))\nc = {}\nfor a in A:\n c[a] = c.get(a, 0) + 1\nprint((len(c) - sum(v - 1 for v in list(c.values())) % 2))\n", "fast_code_sha256": "e3cf1c1b43aa515906bdaeeb755a7ec7bd63e99990a24f6e83609ff590853bd6", "fast_id": "p03816_e3cf1c1b43aa515906bdaeeb755a7ec7bd63e99990a24f6e83609ff590853bd6", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N = int(eval(input()))\n(*A,) = list(map(int, input().split()))\nc = {}\nfor a in A:\n c[a] = c.get(a, 0) + 1\nprint((len(c) - sum(v - 1 for v in list(c.values())) % 2))\n", "measured_fast_code_sha256": "e3cf1c1b43aa515906bdaeeb755a7ec7bd63e99990a24f6e83609ff590853bd6", "measured_slow_code": "import functools\n\nN = int(eval(input()))\nA = list(map(int, input().split()))\nd = [0 for i in range(10**5 + 1)]\nfor a in A:\n d[a] = 1\ns = sum(d)\nprint((s - (0 if s % 2 else 1)))\n", "measured_slow_code_sha256": "d753095d0d960364791984f90dbd9b20563bbbee29b58abd2419ff94d69b471b", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.4590249061380391, "pair_id": "python_v2_1dbfa010fb2d396128cf3816", "per_case_slow_code_faster_fraction": 0.45, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03816", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03816_e3cf1c1b43aa515906bdaeeb755a7ec7bd63e99990a24f6e83609ff590853bd6.jsonl.gz", "inputs": "reproduction/python/inputs/p03816.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03816_d753095d0d960364791984f90dbd9b20563bbbee29b58abd2419ff94d69b471b.jsonl.gz"}, "slow_code": "import functools\n\nN = int(eval(input()))\nA = list(map(int, input().split()))\nd = [0 for i in range(10**5 + 1)]\nfor a in A:\n d[a] = 1\ns = sum(d)\nprint((s - (0 if s % 2 else 1)))\n", "slow_code_sha256": "d753095d0d960364791984f90dbd9b20563bbbee29b58abd2419ff94d69b471b", "slow_id": "p03816_d753095d0d960364791984f90dbd9b20563bbbee29b58abd2419ff94d69b471b", "speedup": 6.482689938916846, "stratum": "4-8", "within_pair_jaccard": 0.5161290322580645, "workload": {"case_count": 100, "description": "From an odd-sized deck, repeatedly choose three arbitrary cards, discard a largest and a smallest, and return the remaining card. Maximize the number left with all values pairwise distinct. Zero operations are allowed. Observed inputs: N=3..99999 (median 12345); A_i=1..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 600000, "median": 72946.5, "min": 17}, "input_format": ["N\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100000, "median": 12346.0, "min": 4}}} -{"case_ids": ["p03212_case_000", "p03212_case_001", "p03212_case_002", "p03212_case_003", "p03212_case_004", "p03212_case_005", "p03212_case_006", "p03212_case_007", "p03212_case_008", "p03212_case_009", "p03212_case_010", "p03212_case_011", "p03212_case_012", "p03212_case_013", "p03212_case_014", "p03212_case_015", "p03212_case_016", "p03212_case_017", "p03212_case_018", "p03212_case_019", "p03212_case_020", "p03212_case_021", "p03212_case_022", "p03212_case_023", "p03212_case_024", "p03212_case_025", "p03212_case_026", "p03212_case_027", "p03212_case_028", "p03212_case_029", "p03212_case_030", "p03212_case_031", "p03212_case_032", "p03212_case_033", "p03212_case_034", "p03212_case_035", "p03212_case_036", "p03212_case_037", "p03212_case_038", "p03212_case_039", "p03212_case_040", "p03212_case_041", "p03212_case_042", "p03212_case_043", "p03212_case_044", "p03212_case_045", "p03212_case_046", "p03212_case_047", "p03212_case_048", "p03212_case_049", "p03212_case_050", "p03212_case_051", "p03212_case_052", "p03212_case_053", "p03212_case_054", "p03212_case_055", "p03212_case_056", "p03212_case_057", "p03212_case_058", "p03212_case_059", "p03212_case_060", "p03212_case_061", "p03212_case_062", "p03212_case_063", "p03212_case_064", "p03212_case_065", "p03212_case_066", "p03212_case_067", "p03212_case_068", "p03212_case_069", "p03212_case_070", "p03212_case_071", "p03212_case_072", "p03212_case_073", "p03212_case_074", "p03212_case_075", "p03212_case_076", "p03212_case_077", "p03212_case_078", "p03212_case_079", "p03212_case_080", "p03212_case_081", "p03212_case_082", "p03212_case_083", "p03212_case_084", "p03212_case_085", "p03212_case_086", "p03212_case_087", "p03212_case_088", "p03212_case_089", "p03212_case_090", "p03212_case_091", "p03212_case_092", "p03212_case_093", "p03212_case_094", "p03212_case_095", "p03212_case_096", "p03212_case_097", "p03212_case_098", "p03212_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from itertools import *\n\nn = int(eval(input()))\nc = 0\nk = \"357\"\nfor i in range(3, -~len(str(n))):\n for j in product(k, repeat=i):\n if all(j.count(h) for h in k):\n if int(\"\".join(j)) <= n:\n c += 1\nprint(c)\n", "fast_code_sha256": "886a5f595443355c9a559776b553cf8c6e9da6b128a956f856a516a3ff43e7bc", "fast_id": "p03212_159869fce363be0beb07e099fdf5f195612cee8870325e72b5e5fb91c1c05182", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "#!/usr/bin/env python3\nfrom itertools import *\n\nn = int(eval(input()))\nc = 0\nk = \"357\"\nfor i in range(3, -~len(str(n))):\n for j in product(k, repeat=i):\n if all(j.count(h) for h in k):\n if int(\"\".join(j)) <= n:\n c += 1\nprint(c)\n", "measured_fast_code_sha256": "159869fce363be0beb07e099fdf5f195612cee8870325e72b5e5fb91c1c05182", "measured_slow_code": "import copy\n\nword = \"753\"\n\n\ndef dfs(n):\n ret = 0\n num = 0 if not n else int(\"\".join(n))\n if N < num:\n return ret\n ret += 1 if len(set(\"\".join(n)) & set(word)) == len(word) else 0\n for c in word:\n tmp = copy.deepcopy(n)\n n.append(c)\n ret += dfs(n)\n n = tmp\n return ret\n\n\nN = int(eval(input()))\nprint((dfs([])))\n", "measured_slow_code_sha256": "9b823eea975a23a20587bc34ffa695ba9d6a5f099d4923f94ee756f58c3ecb65", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 7.472223888333752, "pair_id": "python_v2_5b37396aca03b1a020f6315a", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03212", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03212_159869fce363be0beb07e099fdf5f195612cee8870325e72b5e5fb91c1c05182.jsonl.gz", "inputs": "reproduction/python/inputs/p03212.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03212_9b823eea975a23a20587bc34ffa695ba9d6a5f099d4923f94ee756f58c3ecb65.jsonl.gz"}, "slow_code": "import copy\n\nword = \"753\"\n\n\ndef dfs(n):\n ret = 0\n num = 0 if not n else int(\"\".join(n))\n if N < num:\n return ret\n ret += 1 if len(set(\"\".join(n)) & set(word)) == len(word) else 0\n for c in word:\n tmp = copy.deepcopy(n)\n n.append(c)\n ret += dfs(n)\n n = tmp\n return ret\n\n\nN = int(eval(input()))\nprint((dfs([])))\n", "slow_code_sha256": "9b823eea975a23a20587bc34ffa695ba9d6a5f099d4923f94ee756f58c3ecb65", "slow_id": "p03212_9b823eea975a23a20587bc34ffa695ba9d6a5f099d4923f94ee756f58c3ecb65", "speedup": 7.570958939310902, "stratum": "4-8", "within_pair_jaccard": 0.32558139534883723, "workload": {"case_count": 100, "description": "Count positive integers at most N whose decimal digits use only 3,5,7 and contain each of those three digits at least once. Observed inputs: N=1..999999999 (median 133260161.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 10, "median": 10.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p02830_case_000", "p02830_case_001", "p02830_case_002", "p02830_case_003", "p02830_case_004", "p02830_case_005", "p02830_case_006", "p02830_case_007", "p02830_case_008", "p02830_case_009", "p02830_case_010", "p02830_case_011", "p02830_case_012", "p02830_case_013", "p02830_case_014", "p02830_case_015", "p02830_case_016", "p02830_case_017", "p02830_case_018", "p02830_case_019", "p02830_case_020", "p02830_case_021", "p02830_case_022", "p02830_case_023", "p02830_case_024", "p02830_case_025", "p02830_case_026", "p02830_case_027", "p02830_case_028", "p02830_case_029", "p02830_case_030", "p02830_case_031", "p02830_case_032", "p02830_case_033", "p02830_case_034", "p02830_case_035", "p02830_case_036", "p02830_case_037", "p02830_case_038", "p02830_case_039", "p02830_case_040", "p02830_case_041", "p02830_case_042", "p02830_case_043", "p02830_case_044", "p02830_case_045", "p02830_case_046", "p02830_case_047", "p02830_case_048", "p02830_case_049", "p02830_case_050", "p02830_case_051", "p02830_case_052", "p02830_case_053", "p02830_case_054", "p02830_case_055", "p02830_case_056", "p02830_case_057", "p02830_case_058", "p02830_case_059", "p02830_case_060", "p02830_case_061", "p02830_case_062", "p02830_case_063", "p02830_case_064", "p02830_case_065", "p02830_case_066", "p02830_case_067", "p02830_case_068", "p02830_case_069", "p02830_case_070", "p02830_case_071", "p02830_case_072", "p02830_case_073", "p02830_case_074", "p02830_case_075", "p02830_case_076", "p02830_case_077", "p02830_case_078", "p02830_case_079", "p02830_case_080", "p02830_case_081", "p02830_case_082", "p02830_case_083", "p02830_case_084", "p02830_case_085", "p02830_case_086", "p02830_case_087", "p02830_case_088", "p02830_case_089", "p02830_case_090", "p02830_case_091", "p02830_case_092", "p02830_case_093", "p02830_case_094", "p02830_case_095", "p02830_case_096", "p02830_case_097", "p02830_case_098", "p02830_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def main():\n import sys\n\n input = sys.stdin.readline\n sys.setrecursionlimit(10**7)\n from collections import Counter, deque\n\n from itertools import combinations, permutations, accumulate, groupby\n\n from bisect import bisect_left, bisect_right\n from heapq import heapify, heappop, heappush\n from math import floor, ceil\n\n n = int(eval(input()))\n s, t = input().rstrip().split()\n res = \"\"\n for a, b in zip(s, t):\n res += a + b\n print(res)\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "9b8c4cfe0b7b0b64a53ebc57e5b9e4b166323eb14ae9b22a1e32128ae71b2c73", "fast_id": "p02830_66687d79dbff10c3e182b72780f54d2b9fbbcbcf038e0bbd64c80444d9b9bd3a", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def main():\n import sys\n\n input = sys.stdin.readline\n sys.setrecursionlimit(10**7)\n from collections import Counter, deque\n\n # from collections import defaultdict\n from itertools import combinations, permutations, accumulate, groupby\n\n # from itertools import product\n from bisect import bisect_left, bisect_right\n from heapq import heapify, heappop, heappush\n from math import floor, ceil\n\n # from operator import itemgetter\n # inf = 10**17\n # mod = 10**9 + 7\n n = int(eval(input()))\n s, t = input().rstrip().split()\n res = \"\"\n for a, b in zip(s, t):\n res += a + b\n print(res)\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "66687d79dbff10c3e182b72780f54d2b9fbbcbcf038e0bbd64c80444d9b9bd3a", "measured_slow_code": "from collections import Counter, defaultdict, deque\nfrom heapq import heappop, heappush, heapify\nimport sys, bisect, math, itertools, fractions, pprint\n\nsys.setrecursionlimit(10**8)\nmod = 10**9 + 7\nmod2 = 998244353\nINF = float(\"inf\")\n\n\ndef inp():\n return int(sys.stdin.readline())\n\n\ndef inpl():\n return list(map(int, sys.stdin.readline().split()))\n\n\ndef inpln(n):\n return list(int(sys.stdin.readline()) for i in range(n))\n\n\nn = inp()\ns, t = input().split()\nres = \"\"\nfor i in range(n):\n res += s[i] + t[i]\nprint(res)\n", "measured_slow_code_sha256": "241afa9a4a462ffb4a4454131541737b779c1c29e81784f31982be1ef01be8e4", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 14.89836193595999, "pair_id": "python_v2_439ab02d85f08e9bacaa0a15", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02830", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02830_66687d79dbff10c3e182b72780f54d2b9fbbcbcf038e0bbd64c80444d9b9bd3a.jsonl.gz", "inputs": "reproduction/python/inputs/p02830.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02830_241afa9a4a462ffb4a4454131541737b779c1c29e81784f31982be1ef01be8e4.jsonl.gz"}, "slow_code": "from collections import Counter, defaultdict, deque\nfrom heapq import heappop, heappush, heapify\nimport sys, bisect, math, itertools, fractions, pprint\n\nsys.setrecursionlimit(10**8)\nmod = 10**9 + 7\nmod2 = 998244353\nINF = float(\"inf\")\n\n\ndef inp():\n return int(sys.stdin.readline())\n\n\ndef inpl():\n return list(map(int, sys.stdin.readline().split()))\n\n\ndef inpln(n):\n return list(int(sys.stdin.readline()) for i in range(n))\n\n\nn = inp()\ns, t = input().split()\nres = \"\"\nfor i in range(n):\n res += s[i] + t[i]\nprint(res)\n", "slow_code_sha256": "241afa9a4a462ffb4a4454131541737b779c1c29e81784f31982be1ef01be8e4", "slow_id": "p02830_241afa9a4a462ffb4a4454131541737b779c1c29e81784f31982be1ef01be8e4", "speedup": 14.948402359385268, "stratum": "8+", "within_pair_jaccard": 0.4461538461538462, "workload": {"case_count": 100, "description": "Interleave two lowercase strings S and T, both of length N, taking S_1,T_1,S_2,T_2,...,S_N,T_N. Observed inputs: N=1..100 (median 50).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 206, "median": 105.0, "min": 6}, "input_format": ["N\nS T"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3, "median": 3.0, "min": 3}}} -{"case_ids": ["p02989_case_000", "p02989_case_001", "p02989_case_002", "p02989_case_003", "p02989_case_004", "p02989_case_005", "p02989_case_006", "p02989_case_007", "p02989_case_008", "p02989_case_009", "p02989_case_010", "p02989_case_011", "p02989_case_012", "p02989_case_013", "p02989_case_014", "p02989_case_015", "p02989_case_016", "p02989_case_017", "p02989_case_018", "p02989_case_019", "p02989_case_020", "p02989_case_021", "p02989_case_022", "p02989_case_023", "p02989_case_024", "p02989_case_025", "p02989_case_026", "p02989_case_027", "p02989_case_028", "p02989_case_029", "p02989_case_030", "p02989_case_031", "p02989_case_032", "p02989_case_033", "p02989_case_034", "p02989_case_035", "p02989_case_036", "p02989_case_037", "p02989_case_038", "p02989_case_039", "p02989_case_040", "p02989_case_041", "p02989_case_042", "p02989_case_043", "p02989_case_044", "p02989_case_045", "p02989_case_046", "p02989_case_047", "p02989_case_048", "p02989_case_049", "p02989_case_050", "p02989_case_051", "p02989_case_052", "p02989_case_053", "p02989_case_054", "p02989_case_055", "p02989_case_056", "p02989_case_057", "p02989_case_058", "p02989_case_059", "p02989_case_060", "p02989_case_061", "p02989_case_062", "p02989_case_063", "p02989_case_064", "p02989_case_065", "p02989_case_066", "p02989_case_067", "p02989_case_068", "p02989_case_069", "p02989_case_070", "p02989_case_071", "p02989_case_072", "p02989_case_073", "p02989_case_074", "p02989_case_075", "p02989_case_076", "p02989_case_077", "p02989_case_078", "p02989_case_079", "p02989_case_080", "p02989_case_081", "p02989_case_082", "p02989_case_083", "p02989_case_084", "p02989_case_085", "p02989_case_086", "p02989_case_087", "p02989_case_088", "p02989_case_089", "p02989_case_090", "p02989_case_091", "p02989_case_092", "p02989_case_093", "p02989_case_094", "p02989_case_095", "p02989_case_096", "p02989_case_097", "p02989_case_098", "p02989_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\nd = sorted(list(map(int, input().split())))\nans = d[n // 2] - d[n // 2 - 1]\nprint(ans)\n", "fast_code_sha256": "cc2b3211d546727b2e8b70a7683b1523d57b0e5a1446587ecda6ed45b220783d", "fast_id": "p02989_cc2b3211d546727b2e8b70a7683b1523d57b0e5a1446587ecda6ed45b220783d", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\nd = sorted(list(map(int, input().split())))\nans = d[n // 2] - d[n // 2 - 1]\nprint(ans)\n", "measured_fast_code_sha256": "cc2b3211d546727b2e8b70a7683b1523d57b0e5a1446587ecda6ed45b220783d", "measured_slow_code": "from collections import Counter\n\nn = int(eval(input()))\nd = list(map(int, input().split()))\nminD = min(d)\nmaxD = max(d)\nc = Counter(d)\nabc = 0\narc = n\nans = 0\nfor i in range(minD, maxD + 1):\n abc += c[i - 1]\n arc -= c[i - 1]\n if abc == arc:\n ans += 1\nprint(ans)\n", "measured_slow_code_sha256": "f57035b7bb87a32b44942a577f637699784efe8a08be08008b173476e76e8522", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 104.94202713408305, "pair_id": "python_v2_841ce2d658c065fec92ff661", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02989", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02989_cc2b3211d546727b2e8b70a7683b1523d57b0e5a1446587ecda6ed45b220783d.jsonl.gz", "inputs": "reproduction/python/inputs/p02989.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02989_f57035b7bb87a32b44942a577f637699784efe8a08be08008b173476e76e8522.jsonl.gz"}, "slow_code": "from collections import Counter\n\nn = int(eval(input()))\nd = list(map(int, input().split()))\nminD = min(d)\nmaxD = max(d)\nc = Counter(d)\nabc = 0\narc = n\nans = 0\nfor i in range(minD, maxD + 1):\n abc += c[i - 1]\n arc -= c[i - 1]\n if abc == arc:\n ans += 1\nprint(ans)\n", "slow_code_sha256": "f57035b7bb87a32b44942a577f637699784efe8a08be08008b173476e76e8522", "slow_id": "p02989_f57035b7bb87a32b44942a577f637699784efe8a08be08008b173476e76e8522", "speedup": 44.47435596912985, "stratum": "8+", "within_pair_jaccard": 0.3448275862068966, "workload": {"case_count": 100, "description": "For an even number N of difficulties d_i, count integer thresholds K splitting the entries equally into values below K and values at least K. Observed inputs: N=2..100000 (median 100); d_i=1..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 600025, "median": 596.0, "min": 6}, "input_format": ["N\nd_1 ... d_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100001, "median": 101.0, "min": 3}}} -{"case_ids": ["p03222_case_000", "p03222_case_001", "p03222_case_002", "p03222_case_003", "p03222_case_004", "p03222_case_005", "p03222_case_006", "p03222_case_007", "p03222_case_008", "p03222_case_009", "p03222_case_010", "p03222_case_011", "p03222_case_012", "p03222_case_013", "p03222_case_014", "p03222_case_015", "p03222_case_016", "p03222_case_017", "p03222_case_018", "p03222_case_019", "p03222_case_020", "p03222_case_021", "p03222_case_022", "p03222_case_023", "p03222_case_024", "p03222_case_025", "p03222_case_026", "p03222_case_027", "p03222_case_028", "p03222_case_029", "p03222_case_030", "p03222_case_031", "p03222_case_032", "p03222_case_033", "p03222_case_034", "p03222_case_035", "p03222_case_036", "p03222_case_037", "p03222_case_038", "p03222_case_039", "p03222_case_040", "p03222_case_041", "p03222_case_042", "p03222_case_043", "p03222_case_044", "p03222_case_045", "p03222_case_046", "p03222_case_047", "p03222_case_048", "p03222_case_049", "p03222_case_050", "p03222_case_051", "p03222_case_052", "p03222_case_053", "p03222_case_054", "p03222_case_055", "p03222_case_056", "p03222_case_057", "p03222_case_058", "p03222_case_059", "p03222_case_060", "p03222_case_061", "p03222_case_062", "p03222_case_063", "p03222_case_064", "p03222_case_065", "p03222_case_066", "p03222_case_067", "p03222_case_068", "p03222_case_069", "p03222_case_070", "p03222_case_071", "p03222_case_072", "p03222_case_073", "p03222_case_074", "p03222_case_075", "p03222_case_076", "p03222_case_077", "p03222_case_078", "p03222_case_079", "p03222_case_080", "p03222_case_081", "p03222_case_082", "p03222_case_083", "p03222_case_084", "p03222_case_085", "p03222_case_086", "p03222_case_087", "p03222_case_088", "p03222_case_089", "p03222_case_090", "p03222_case_091", "p03222_case_092", "p03222_case_093", "p03222_case_094", "p03222_case_095", "p03222_case_096", "p03222_case_097", "p03222_case_098", "p03222_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "mod = 10**9 + 7\nh, w, k = list(map(int, input().split()))\nk -= 1\ndp = [0] * w\ndp[0] = 1\nndp = [0] * w\nfor _ in range(h):\n for bits in range(1 << w - 1):\n if \"11\" in bin(bits):\n continue\n to = list(range(w))\n for i in range(w - 1):\n if (bits >> i) & 1:\n to[i], to[i + 1] = to[i + 1], to[i]\n for i in range(w):\n ndp[to[i]] += dp[i]\n ndp[to[i]] %= mod\n dp = ndp\n ndp = [0] * w\nprint((dp[k]))\n", "fast_code_sha256": "9d8a3dd273c298cf688b529b6d24def7dc29fefbbd6614a45d46b75a639bc579", "fast_id": "p03222_9d8a3dd273c298cf688b529b6d24def7dc29fefbbd6614a45d46b75a639bc579", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "mod = 10**9 + 7\nh, w, k = list(map(int, input().split()))\nk -= 1\ndp = [0] * w\ndp[0] = 1\nndp = [0] * w\nfor _ in range(h):\n for bits in range(1 << w - 1):\n if \"11\" in bin(bits):\n continue\n to = list(range(w))\n for i in range(w - 1):\n if (bits >> i) & 1:\n to[i], to[i + 1] = to[i + 1], to[i]\n for i in range(w):\n ndp[to[i]] += dp[i]\n ndp[to[i]] %= mod\n dp = ndp\n ndp = [0] * w\nprint((dp[k]))\n", "measured_fast_code_sha256": "9d8a3dd273c298cf688b529b6d24def7dc29fefbbd6614a45d46b75a639bc579", "measured_slow_code": "import sys\n\nmod = pow(10, 9) + 7\n\n\ndef mul(a, b):\n return ((a % mod) * (b % mod)) % mod\n\n\ndef cmb(n, r, mod):\n if r < 0 or r > n:\n return 0\n r = min(r, n - r)\n return g1[n] * g2[r] * g2[n - r] % mod\n\n\nNNN = (10**5) * 2\ng1 = [1, 1]\ng2 = [1, 1]\ninverse = [0, 1]\nfor i in range(2, NNN + 1):\n g1.append((g1[-1] * i) % mod)\n inverse.append((-inverse[mod % i] * (mod // i)) % mod)\n g2.append((g2[-1] * inverse[-1]) % mod)\n\n\ndef erabu(aW):\n r = 0\n for i in range(aW // 2 + 1 + 1):\n sp = aW - (2 * i - 1)\n r += cmb(sp + i + 1 - 1, sp, mod)\n return r\n\n\nN, W, K = [int(x) for x in input().strip().split(\" \")]\nhasi = 0\ncc = []\nif W == 1:\n if K == 1:\n print((1))\n else:\n print((0))\n sys.exit()\nelif W == 2:\n cccl = [1, 1]\n cc = [1, 1]\nelif W == 3:\n cccl = [1, 1, 1]\n cc = [2, 1, 2]\nelif W >= 4:\n aW = W - 1\n hW = aW - 2\n nhW = aW - 3\n cc = []\n cccl = []\n for w in range(W):\n nn = max(W - 1 - w - 1, 0)\n nnn = max((W - 1) - nn - 2, 0)\n if w == W - 1:\n nnn += 1\n cc.append(erabu(nn) * erabu(nnn))\n cccl.append(erabu(nn) * erabu(nnn - 1))\ncccl[0] = 0\ncccr = cccl[::-1]\nd = [1] + [0 for x in range(W - 1)]\nfor i in range(N):\n newd = []\n for j in range(W):\n newd.append(0)\n if j != 0:\n newd[j] = (newd[j] + (d[j - 1] * cccl[j])) % mod\n if j != W - 1:\n newd[j] = (newd[j] + (d[j + 1] * cccr[j])) % mod\n newd[j] = (newd[j] + (d[j] * cc[j])) % mod\n d = newd[:]\nprint((d[K - 1]))\n", "measured_slow_code_sha256": "a167fb2840bdcc6405e113c019a821d25f7acfa038b67804c34bff12a9edb446", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 111.94396064703015, "pair_id": "python_v2_ebe0294b03bbd14d5f97014a", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03222", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03222_9d8a3dd273c298cf688b529b6d24def7dc29fefbbd6614a45d46b75a639bc579.jsonl.gz", "inputs": "reproduction/python/inputs/p03222.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03222_a167fb2840bdcc6405e113c019a821d25f7acfa038b67804c34bff12a9edb446.jsonl.gz"}, "slow_code": "import sys\n\nmod = pow(10, 9) + 7\n\n\ndef mul(a, b):\n return ((a % mod) * (b % mod)) % mod\n\n\ndef cmb(n, r, mod):\n if r < 0 or r > n:\n return 0\n r = min(r, n - r)\n return g1[n] * g2[r] * g2[n - r] % mod\n\n\nNNN = (10**5) * 2\ng1 = [1, 1]\ng2 = [1, 1]\ninverse = [0, 1]\nfor i in range(2, NNN + 1):\n g1.append((g1[-1] * i) % mod)\n inverse.append((-inverse[mod % i] * (mod // i)) % mod)\n g2.append((g2[-1] * inverse[-1]) % mod)\n\n\ndef erabu(aW):\n r = 0\n for i in range(aW // 2 + 1 + 1):\n sp = aW - (2 * i - 1)\n r += cmb(sp + i + 1 - 1, sp, mod)\n return r\n\n\nN, W, K = [int(x) for x in input().strip().split(\" \")]\nhasi = 0\ncc = []\nif W == 1:\n if K == 1:\n print((1))\n else:\n print((0))\n sys.exit()\nelif W == 2:\n cccl = [1, 1]\n cc = [1, 1]\nelif W == 3:\n cccl = [1, 1, 1]\n cc = [2, 1, 2]\nelif W >= 4:\n aW = W - 1\n hW = aW - 2\n nhW = aW - 3\n cc = []\n cccl = []\n for w in range(W):\n nn = max(W - 1 - w - 1, 0)\n nnn = max((W - 1) - nn - 2, 0)\n if w == W - 1:\n nnn += 1\n cc.append(erabu(nn) * erabu(nnn))\n cccl.append(erabu(nn) * erabu(nnn - 1))\ncccl[0] = 0\ncccr = cccl[::-1]\nd = [1] + [0 for x in range(W - 1)]\nfor i in range(N):\n newd = []\n for j in range(W):\n newd.append(0)\n if j != 0:\n newd[j] = (newd[j] + (d[j - 1] * cccl[j])) % mod\n if j != W - 1:\n newd[j] = (newd[j] + (d[j + 1] * cccr[j])) % mod\n newd[j] = (newd[j] + (d[j] * cc[j])) % mod\n d = newd[:]\nprint((d[K - 1]))\n", "slow_code_sha256": "a167fb2840bdcc6405e113c019a821d25f7acfa038b67804c34bff12a9edb446", "slow_id": "p03222_a167fb2840bdcc6405e113c019a821d25f7acfa038b67804c34bff12a9edb446", "speedup": 137.23770924754044, "stratum": "8+", "within_pair_jaccard": 0.2191780821917808, "workload": {"case_count": 100, "description": "Count ladder lotteries with W vertical lines and H horizontal levels. At each level, links join adjacent verticals and cannot share endpoints. Following links from the top-left must end at bottom column K. Output modulo 1000000007. Observed inputs: H=1..100 (median 50); W=1..8 (median 5); K=1..8 (median 2.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 8, "median": 7.0, "min": 6}, "input_format": ["H W K"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3, "median": 3.0, "min": 3}}} -{"case_ids": ["p03786_case_000", "p03786_case_001", "p03786_case_002", "p03786_case_003", "p03786_case_004", "p03786_case_005", "p03786_case_006", "p03786_case_007", "p03786_case_008", "p03786_case_009", "p03786_case_010", "p03786_case_011", "p03786_case_012", "p03786_case_013", "p03786_case_014", "p03786_case_015", "p03786_case_016", "p03786_case_017", "p03786_case_018", "p03786_case_019", "p03786_case_020", "p03786_case_021", "p03786_case_022", "p03786_case_023", "p03786_case_024", "p03786_case_025", "p03786_case_026", "p03786_case_027", "p03786_case_028", "p03786_case_029", "p03786_case_030", "p03786_case_031", "p03786_case_032", "p03786_case_033", "p03786_case_034", "p03786_case_035", "p03786_case_036", "p03786_case_037", "p03786_case_038", "p03786_case_039", "p03786_case_040", "p03786_case_041", "p03786_case_042", "p03786_case_043", "p03786_case_044", "p03786_case_045", "p03786_case_046", "p03786_case_047", "p03786_case_048", "p03786_case_049", "p03786_case_050", "p03786_case_051", "p03786_case_052", "p03786_case_053", "p03786_case_054", "p03786_case_055", "p03786_case_056", "p03786_case_057", "p03786_case_058", "p03786_case_059", "p03786_case_060", "p03786_case_061", "p03786_case_062", "p03786_case_063", "p03786_case_064", "p03786_case_065", "p03786_case_066", "p03786_case_067", "p03786_case_068", "p03786_case_069", "p03786_case_070", "p03786_case_071", "p03786_case_072", "p03786_case_073", "p03786_case_074", "p03786_case_075", "p03786_case_076", "p03786_case_077", "p03786_case_078", "p03786_case_079", "p03786_case_080", "p03786_case_081", "p03786_case_082", "p03786_case_083", "p03786_case_084", "p03786_case_085", "p03786_case_086", "p03786_case_087", "p03786_case_088", "p03786_case_089", "p03786_case_090", "p03786_case_091", "p03786_case_092", "p03786_case_093", "p03786_case_094", "p03786_case_095", "p03786_case_096", "p03786_case_097", "p03786_case_098", "p03786_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\nreadline = sys.stdin.readline\nN = int(readline())\nA = list(map(int, readline().split()))\nA = sorted(A)\ncur = 0\nng = 0\nfor i in range(N):\n if A[i] > cur * 2:\n ng = i\n cur += A[i]\nprint((N - ng))\n", "fast_code_sha256": "11386287f983ecaed199b45f8c45c3353a61aefe521f21479373527f68f13aa1", "fast_id": "p03786_11386287f983ecaed199b45f8c45c3353a61aefe521f21479373527f68f13aa1", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\nreadline = sys.stdin.readline\nN = int(readline())\nA = list(map(int, readline().split()))\nA = sorted(A)\ncur = 0\nng = 0\nfor i in range(N):\n if A[i] > cur * 2:\n ng = i\n cur += A[i]\nprint((N - ng))\n", "measured_fast_code_sha256": "11386287f983ecaed199b45f8c45c3353a61aefe521f21479373527f68f13aa1", "measured_slow_code": "import numpy as np\n\nN = int(eval(input()))\nA = list(map(int, input().split()))\nA = sorted(A)\nC = np.cumsum(A)\nans = 0\ncnt = 0\nfor i in range(N - 1):\n if C[i] * 2 >= A[i + 1]:\n cnt += 1\n else:\n cnt = 0\nans = cnt + 1\nprint(ans)\n", "measured_slow_code_sha256": "01e4e104b8cffd408e37f15b9026d222331aea634f5f65862577d6e6a8a42837", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 918.1171588750021, "pair_id": "python_v2_1587fe670dd3fe7300a42967", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03786", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03786_11386287f983ecaed199b45f8c45c3353a61aefe521f21479373527f68f13aa1.jsonl.gz", "inputs": "reproduction/python/inputs/p03786.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03786_01e4e104b8cffd408e37f15b9026d222331aea634f5f65862577d6e6a8a42837.jsonl.gz"}, "slow_code": "import numpy as np\n\nN = int(eval(input()))\nA = list(map(int, input().split()))\nA = sorted(A)\nC = np.cumsum(A)\nans = 0\ncnt = 0\nfor i in range(N - 1):\n if C[i] * 2 >= A[i + 1]:\n cnt += 1\n else:\n cnt = 0\nans = cnt + 1\nprint(ans)\n", "slow_code_sha256": "01e4e104b8cffd408e37f15b9026d222331aea634f5f65862577d6e6a8a42837", "slow_id": "p03786_01e4e104b8cffd408e37f15b9026d222331aea634f5f65862577d6e6a8a42837", "speedup": 143.04607166289418, "stratum": "8+", "within_pair_jaccard": 0.5, "workload": {"case_count": 100, "description": "N creatures have distinct colors and sizes A_i. A creature of size A may absorb one of size C<=2*A; its size becomes A+C and its color survives. Count colors that can remain after all creatures merge. Observed inputs: N=2..100000 (median 10); A_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1100007, "median": 101.5, "min": 14}, "input_format": ["N\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100001, "median": 11.0, "min": 3}}} -{"case_ids": ["p02570_case_000", "p02570_case_001", "p02570_case_002", "p02570_case_003", "p02570_case_004", "p02570_case_005", "p02570_case_006", "p02570_case_007", "p02570_case_008", "p02570_case_009", "p02570_case_010", "p02570_case_011", "p02570_case_012", "p02570_case_013", "p02570_case_014", "p02570_case_015", "p02570_case_016", "p02570_case_017", "p02570_case_018", "p02570_case_019", "p02570_case_020", "p02570_case_021", "p02570_case_022", "p02570_case_023", "p02570_case_024", "p02570_case_025", "p02570_case_026", "p02570_case_027", "p02570_case_028", "p02570_case_029", "p02570_case_030", "p02570_case_031", "p02570_case_032", "p02570_case_033", "p02570_case_034", "p02570_case_035", "p02570_case_036", "p02570_case_037", "p02570_case_038", "p02570_case_039", "p02570_case_040", "p02570_case_041", "p02570_case_042", "p02570_case_043", "p02570_case_044", "p02570_case_045", "p02570_case_046", "p02570_case_047", "p02570_case_048", "p02570_case_049", "p02570_case_050", "p02570_case_051", "p02570_case_052", "p02570_case_053", "p02570_case_054", "p02570_case_055", "p02570_case_056", "p02570_case_057", "p02570_case_058", "p02570_case_059", "p02570_case_060", "p02570_case_061", "p02570_case_062", "p02570_case_063", "p02570_case_064", "p02570_case_065", "p02570_case_066", "p02570_case_067", "p02570_case_068", "p02570_case_069", "p02570_case_070", "p02570_case_071", "p02570_case_072", "p02570_case_073", "p02570_case_074", "p02570_case_075", "p02570_case_076", "p02570_case_077", "p02570_case_078", "p02570_case_079", "p02570_case_080", "p02570_case_081", "p02570_case_082", "p02570_case_083", "p02570_case_084", "p02570_case_085", "p02570_case_086", "p02570_case_087", "p02570_case_088", "p02570_case_089", "p02570_case_090", "p02570_case_091", "p02570_case_092", "p02570_case_093", "p02570_case_094", "p02570_case_095", "p02570_case_096", "p02570_case_097", "p02570_case_098", "p02570_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "executable_AST_equal_except_explicit_explanatory_string_removal_and_all_frozen_inputs_checker_pass", "fast_code": "D, T, S = list(map(float, input().split()))\nif D / S <= T:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "fast_code_sha256": "5343f51941a09a2e5668271538551f10be83cd1f8966e97081cc9dcf5652de05", "fast_id": "p02570_5343f51941a09a2e5668271538551f10be83cd1f8966e97081cc9dcf5652de05", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "D, T, S = list(map(float, input().split()))\nif D / S <= T:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "measured_fast_code_sha256": "5343f51941a09a2e5668271538551f10be83cd1f8966e97081cc9dcf5652de05", "measured_slow_code": "def LI():\n return list(map(int, input().split()))\n\n\ndef II():\n return int(input())\n\n\ndef yes():\n return print(\"Yes\")\n\n\ndef no():\n return print(\"No\")\n\n\nINF = float(\"inf\")\nfrom collections import deque, defaultdict, Counter\nfrom heapq import heappop, heappush\nfrom itertools import product, combinations\nfrom functools import reduce, lru_cache\nfrom math import pi, gcd\nfrom decimal import Decimal\n\n\nclass Combination:\n \"\"\"\n O(n)の前計算を1回行うことで,O(1)でnCr mod mを求められる\n n_max = 10**6のとき前処理は約950ms (PyPyなら約340ms, 10**7で約1800ms)\n 使用例:\n comb = Combination(1000000)\n print(comb(5, 3)) # 10\n \"\"\"\n\n def __init__(self, n_max, mod=10**9 + 7):\n self.mod = mod\n self.modinv = self.make_modinv_list(n_max)\n self.fac, self.facinv = self.make_factorial_list(n_max)\n\n def __call__(self, n, r):\n return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n - r] % self.mod\n\n def make_factorial_list(self, n):\n # 階乗のリストと階乗のmod逆元のリストを返す O(n)\n # self.make_modinv_list()が先に実行されている必要がある\n fac = [1]\n facinv = [1]\n for i in range(1, n + 1):\n fac.append(fac[i - 1] * i % self.mod)\n facinv.append(facinv[i - 1] * self.modinv[i] % self.mod)\n return fac, facinv\n\n def make_modinv_list(self, n):\n # 0からnまでのmod逆元のリストを返す O(n)\n modinv = [0] * (n + 1)\n modinv[1] = 1\n for i in range(2, n + 1):\n modinv[i] = self.mod - self.mod // i * modinv[self.mod % i] % self.mod\n return modinv\n\n\nclass Unionfind:\n def __init__(self, N):\n self.p = list(range(N))\n self.rank = [0] * N\n self.size = [1] * N\n\n def root(self, x):\n if self.p[x] != x:\n self.p[x] = self.root(self.p[x])\n return self.p[x]\n\n def same(self, x, y):\n return self.root(x) == self.root(y)\n\n def unite(self, x, y):\n u = self.root(x)\n v = self.root(y)\n if u == v:\n return\n if self.rank[u] < self.rank[v]:\n self.p[u] = v\n self.size[v] += self.size[u]\n self.size[u] = 0\n else:\n self.p[v] = u\n self.size[u] += self.size[v]\n self.size[v] = 0\n if self.rank[u] == self.rank[v]:\n self.rank[u] += 1\n\n def count(self, x):\n return self.size[self.root(x)]\n\n\nd, t, s = LI()\nif d <= t * s:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "measured_slow_code_sha256": "c18a3a7e4014bde24e915dc4b9c7a40ca0c367289dfe9b646d5af979ad55733c", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 32.68859701198632, "pair_id": "python_v2_8659df7fc22d3f960c0210ac", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02570", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02570_5343f51941a09a2e5668271538551f10be83cd1f8966e97081cc9dcf5652de05.jsonl.gz", "inputs": "reproduction/python/inputs/p02570.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02570_c18a3a7e4014bde24e915dc4b9c7a40ca0c367289dfe9b646d5af979ad55733c.jsonl.gz"}, "slow_code": "def LI():\n return list(map(int, input().split()))\n\n\ndef II():\n return int(input())\n\n\ndef yes():\n return print(\"Yes\")\n\n\ndef no():\n return print(\"No\")\n\n\nINF = float(\"inf\")\nfrom collections import deque, defaultdict, Counter\nfrom heapq import heappop, heappush\nfrom itertools import product, combinations\nfrom functools import reduce, lru_cache\nfrom math import pi, gcd\nfrom decimal import Decimal\n\n\nclass Combination:\n\n def __init__(self, n_max, mod=10**9 + 7):\n self.mod = mod\n self.modinv = self.make_modinv_list(n_max)\n self.fac, self.facinv = self.make_factorial_list(n_max)\n\n def __call__(self, n, r):\n return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n - r] % self.mod\n\n def make_factorial_list(self, n):\n\n fac = [1]\n facinv = [1]\n for i in range(1, n + 1):\n fac.append(fac[i - 1] * i % self.mod)\n facinv.append(facinv[i - 1] * self.modinv[i] % self.mod)\n return fac, facinv\n\n def make_modinv_list(self, n):\n\n modinv = [0] * (n + 1)\n modinv[1] = 1\n for i in range(2, n + 1):\n modinv[i] = self.mod - self.mod // i * modinv[self.mod % i] % self.mod\n return modinv\n\n\nclass Unionfind:\n def __init__(self, N):\n self.p = list(range(N))\n self.rank = [0] * N\n self.size = [1] * N\n\n def root(self, x):\n if self.p[x] != x:\n self.p[x] = self.root(self.p[x])\n return self.p[x]\n\n def same(self, x, y):\n return self.root(x) == self.root(y)\n\n def unite(self, x, y):\n u = self.root(x)\n v = self.root(y)\n if u == v:\n return\n if self.rank[u] < self.rank[v]:\n self.p[u] = v\n self.size[v] += self.size[u]\n self.size[u] = 0\n else:\n self.p[v] = u\n self.size[u] += self.size[v]\n self.size[v] = 0\n if self.rank[u] == self.rank[v]:\n self.rank[u] += 1\n\n def count(self, x):\n return self.size[self.root(x)]\n\n\nd, t, s = LI()\nif d <= t * s:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "slow_code_sha256": "a6a6da28ea21eb5c6cfeb4da55db52d83b5c9e592e210fb6c9a771a885099c2e", "slow_id": "p02570_c18a3a7e4014bde24e915dc4b9c7a40ca0c367289dfe9b646d5af979ad55733c", "speedup": 32.68805460870676, "stratum": "8+", "within_pair_jaccard": 0.10526315789473684, "workload": {"case_count": 100, "description": "Determine whether traveling distance D meters at constant speed S meters per minute reaches the destination within T minutes. Observed inputs: D=1..10000 (median 823); T=1..10000 (median 471); S=1..10000 (median 523).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 18, "median": 12.0, "min": 6}, "input_format": ["D T S"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3, "median": 3.0, "min": 3}}} -{"case_ids": ["p03317_case_000", "p03317_case_001", "p03317_case_002", "p03317_case_003", "p03317_case_004", "p03317_case_005", "p03317_case_006", "p03317_case_007", "p03317_case_008", "p03317_case_009", "p03317_case_010", "p03317_case_011", "p03317_case_012", "p03317_case_013", "p03317_case_014", "p03317_case_015", "p03317_case_016", "p03317_case_017", "p03317_case_018", "p03317_case_019", "p03317_case_020", "p03317_case_021", "p03317_case_022", "p03317_case_023", "p03317_case_024", "p03317_case_025", "p03317_case_026", "p03317_case_027", "p03317_case_028", "p03317_case_029", "p03317_case_030", "p03317_case_031", "p03317_case_032", "p03317_case_033", "p03317_case_034", "p03317_case_035", "p03317_case_036", "p03317_case_037", "p03317_case_038", "p03317_case_039", "p03317_case_040", "p03317_case_041", "p03317_case_042", "p03317_case_043", "p03317_case_044", "p03317_case_045", "p03317_case_046", "p03317_case_047", "p03317_case_048", "p03317_case_049", "p03317_case_050", "p03317_case_051", "p03317_case_052", "p03317_case_053", "p03317_case_054", "p03317_case_055", "p03317_case_056", "p03317_case_057", "p03317_case_058", "p03317_case_059", "p03317_case_060", "p03317_case_061", "p03317_case_062", "p03317_case_063", "p03317_case_064", "p03317_case_065", "p03317_case_066", "p03317_case_067", "p03317_case_068", "p03317_case_069", "p03317_case_070", "p03317_case_071", "p03317_case_072", "p03317_case_073", "p03317_case_074", "p03317_case_075", "p03317_case_076", "p03317_case_077", "p03317_case_078", "p03317_case_079", "p03317_case_080", "p03317_case_081", "p03317_case_082", "p03317_case_083", "p03317_case_084", "p03317_case_085", "p03317_case_086", "p03317_case_087", "p03317_case_088", "p03317_case_089", "p03317_case_090", "p03317_case_091", "p03317_case_092", "p03317_case_093", "p03317_case_094", "p03317_case_095", "p03317_case_096", "p03317_case_097", "p03317_case_098", "p03317_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\n\ndef main():\n n, k, *a = (int(x) for x in sys.stdin.read().split())\n i = a.index(1)\n l = k - 1\n left, right = i, (n - 1) - i\n if left % l == 0:\n if right % l == 0:\n ans = left // l + right // l\n else:\n ans = left // l + right // l + 1\n else:\n if right % l == 0:\n ans = left // l + 1 + right // l\n else:\n if left % l + right % l > l:\n ans = left // l + right // l + 2\n else:\n ans = left // l + right // l + 1\n print(ans)\n\n\nif __name__ == \"__main__\":\n\n main()\n", "fast_code_sha256": "8700fb982859fc8a401824ec74f8b5c6d0583c463e7bf06f22b5229cde5daa2d", "fast_id": "p03317_1215be2398250c13666c56ac5a7eef3a385d457ed17467ca2bfae2b92b89355e", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "# author: kagemeka\n# created: 2019-11-08 13:38:56(JST)\n## internal modules\nimport sys\n\n# import collections\n# import math\n# import string\n# import bisect\n# import re\n# import itertools\n# import statistics\n# import functools\n# import operator\n## external modules\n# import scipy.special # if use comb function on AtCoder,\n# import scipy.misc # select scipy.misc.comb (old version)\ndef main():\n n, k, *a = (int(x) for x in sys.stdin.read().split())\n i = a.index(1)\n l = k - 1\n left, right = i, (n - 1) - i\n if left % l == 0:\n if right % l == 0:\n ans = left // l + right // l\n else:\n ans = left // l + right // l + 1\n else:\n if right % l == 0:\n ans = left // l + 1 + right // l\n else:\n if left % l + right % l > l:\n ans = left // l + right // l + 2\n else:\n ans = left // l + right // l + 1\n print(ans)\n\n\nif __name__ == \"__main__\":\n # execute only if run as a script\n main()\n", "measured_fast_code_sha256": "1215be2398250c13666c56ac5a7eef3a385d457ed17467ca2bfae2b92b89355e", "measured_slow_code": "import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time\n\nsys.setrecursionlimit(10**7)\ninf = 10**20\nmod = 10**9 + 7\n\n\ndef LI():\n return list(map(int, input().split()))\n\n\ndef I():\n return int(eval(input()))\n\n\ndef LS():\n return input().split()\n\n\ndef S():\n return eval(input())\n\n\ndef main():\n a, b = LI()\n l = LI()\n c = 1\n _b = b\n while True:\n if a <= _b:\n break\n else:\n _b += b - 1\n c += 1\n return c\n\n\nprint((main()))\n", "measured_slow_code_sha256": "40f790b9daefbd644d38ba942e539d6681ed03212cd68a297874ac055d84131a", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 13.789370099738964, "pair_id": "python_v2_722e2d1fbbceb5fbc5f7a4e8", "per_case_slow_code_faster_fraction": 0.28, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03317", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03317_1215be2398250c13666c56ac5a7eef3a385d457ed17467ca2bfae2b92b89355e.jsonl.gz", "inputs": "reproduction/python/inputs/p03317.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03317_40f790b9daefbd644d38ba942e539d6681ed03212cd68a297874ac055d84131a.jsonl.gz"}, "slow_code": "import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time\n\nsys.setrecursionlimit(10**7)\ninf = 10**20\nmod = 10**9 + 7\n\n\ndef LI():\n return list(map(int, input().split()))\n\n\ndef I():\n return int(eval(input()))\n\n\ndef LS():\n return input().split()\n\n\ndef S():\n return eval(input())\n\n\ndef main():\n a, b = LI()\n l = LI()\n c = 1\n _b = b\n while True:\n if a <= _b:\n break\n else:\n _b += b - 1\n c += 1\n return c\n\n\nprint((main()))\n", "slow_code_sha256": "40f790b9daefbd644d38ba942e539d6681ed03212cd68a297874ac055d84131a", "slow_id": "p03317_40f790b9daefbd644d38ba942e539d6681ed03212cd68a297874ac055d84131a", "speedup": 4.748927773075219, "stratum": "4-8", "within_pair_jaccard": 0.2, "workload": {"case_count": 100, "description": "Starting with a permutation of 1..N, repeatedly select K consecutive entries and replace all of them by their current minimum. Find the minimum operations needed to make every entry equal. Observed inputs: N=2..100000 (median 100); K=2..100000 (median 5); A_i=1..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 588909, "median": 299.0, "min": 8}, "input_format": ["N K\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100002, "median": 102.0, "min": 4}}} -{"case_ids": ["p03774_case_000", "p03774_case_001", "p03774_case_002", "p03774_case_003", "p03774_case_004", "p03774_case_005", "p03774_case_006", "p03774_case_007", "p03774_case_008", "p03774_case_009", "p03774_case_010", "p03774_case_011", "p03774_case_012", "p03774_case_013", "p03774_case_014", "p03774_case_015", "p03774_case_016", "p03774_case_017", "p03774_case_018", "p03774_case_019", "p03774_case_020", "p03774_case_021", "p03774_case_022", "p03774_case_023", "p03774_case_024", "p03774_case_025", "p03774_case_026", "p03774_case_027", "p03774_case_028", "p03774_case_029", "p03774_case_030", "p03774_case_031", "p03774_case_032", "p03774_case_033", "p03774_case_034", "p03774_case_035", "p03774_case_036", "p03774_case_037", "p03774_case_038", "p03774_case_039", "p03774_case_040", "p03774_case_041", "p03774_case_042", "p03774_case_043", "p03774_case_044", "p03774_case_045", "p03774_case_046", "p03774_case_047", "p03774_case_048", "p03774_case_049", "p03774_case_050", "p03774_case_051", "p03774_case_052", "p03774_case_053", "p03774_case_054", "p03774_case_055", "p03774_case_056", "p03774_case_057", "p03774_case_058", "p03774_case_059", "p03774_case_060", "p03774_case_061", "p03774_case_062", "p03774_case_063", "p03774_case_064", "p03774_case_065", "p03774_case_066", "p03774_case_067", "p03774_case_068", "p03774_case_069", "p03774_case_070", "p03774_case_071", "p03774_case_072", "p03774_case_073", "p03774_case_074", "p03774_case_075", "p03774_case_076", "p03774_case_077", "p03774_case_078", "p03774_case_079", "p03774_case_080", "p03774_case_081", "p03774_case_082", "p03774_case_083", "p03774_case_084", "p03774_case_085", "p03774_case_086", "p03774_case_087", "p03774_case_088", "p03774_case_089", "p03774_case_090", "p03774_case_091", "p03774_case_092", "p03774_case_093", "p03774_case_094", "p03774_case_095", "p03774_case_096", "p03774_case_097", "p03774_case_098", "p03774_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N, M = list(map(int, input().split()))\nn = [list(map(int, input().split())) for _ in range(N)]\nm = [list(map(int, input().split())) for _ in range(M)]\nresult = []\nfor i in range(len(n)):\n result = []\n for j in range(len(m)):\n result.append(abs(n[i][0] - m[j][0]) + abs(n[i][1] - m[j][1]))\n print((result.index(min(result)) + 1))\n", "fast_code_sha256": "d3b14c7a27a0b0a1f81281e9a2739237e41d866056a306990a3b030483de2560", "fast_id": "p03774_d3b14c7a27a0b0a1f81281e9a2739237e41d866056a306990a3b030483de2560", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N, M = list(map(int, input().split()))\nn = [list(map(int, input().split())) for _ in range(N)]\nm = [list(map(int, input().split())) for _ in range(M)]\nresult = []\nfor i in range(len(n)):\n result = []\n for j in range(len(m)):\n result.append(abs(n[i][0] - m[j][0]) + abs(n[i][1] - m[j][1]))\n print((result.index(min(result)) + 1))\n", "measured_fast_code_sha256": "d3b14c7a27a0b0a1f81281e9a2739237e41d866056a306990a3b030483de2560", "measured_slow_code": "import numpy as np, sys\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\nN, M = LI()\nab = np.array([LI() for _ in range(N)])\ncd = np.array([LI() for _ in range(M)])\nfor x in ab:\n print((np.argmin(np.sum(np.abs(cd - x), axis=1)) + 1))\n", "measured_slow_code_sha256": "6db287791de44b1e4185cb571c082a7a658954cf0e76899fa43c862e60866233", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 253.5538774604587, "pair_id": "python_v2_e14746622edfc80f7437ff68", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03774", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03774_d3b14c7a27a0b0a1f81281e9a2739237e41d866056a306990a3b030483de2560.jsonl.gz", "inputs": "reproduction/python/inputs/p03774.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03774_6db287791de44b1e4185cb571c082a7a658954cf0e76899fa43c862e60866233.jsonl.gz"}, "slow_code": "import numpy as np, sys\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\nN, M = LI()\nab = np.array([LI() for _ in range(N)])\ncd = np.array([LI() for _ in range(M)])\nfor x in ab:\n print((np.argmin(np.sum(np.abs(cd - x), axis=1)) + 1))\n", "slow_code_sha256": "6db287791de44b1e4185cb571c082a7a658954cf0e76899fa43c862e60866233", "slow_id": "p03774_6db287791de44b1e4185cb571c082a7a658954cf0e76899fa43c862e60866233", "speedup": 165.4608304748708, "stratum": "8+", "within_pair_jaccard": 0.30952380952380953, "workload": {"case_count": 100, "description": "For each student (a_i,b_i), output the 1-based index of the nearest checkpoint (c_j,d_j) by Manhattan distance. Break ties by the smallest checkpoint index; repeated coordinates are allowed. Observed inputs: N=1..50 (median 16); M=1..50 (median 10); a_i=-100000000..100000000; b_i=-100000000..100000000; c_j=-100000000..100000000; d_j=-100000000..100000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 2106, "median": 458.5, "min": 12}, "input_format": ["N M\na_1 b_1\n...\na_N b_N\nc_1 d_1\n...\nc_M d_M"], "input_format_status": "source_input_section", "input_lines": {"max": 101, "median": 33.5, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 202, "median": 67.0, "min": 6}}} -{"case_ids": ["p02394_case_000", "p02394_case_001", "p02394_case_002", "p02394_case_003", "p02394_case_004", "p02394_case_005", "p02394_case_006", "p02394_case_007", "p02394_case_008", "p02394_case_009", "p02394_case_010", "p02394_case_011", "p02394_case_012", "p02394_case_013", "p02394_case_014", "p02394_case_015", "p02394_case_016", "p02394_case_017", "p02394_case_018", "p02394_case_019", "p02394_case_020", "p02394_case_021", "p02394_case_022", "p02394_case_023", "p02394_case_024", "p02394_case_025", "p02394_case_026", "p02394_case_027", "p02394_case_028", "p02394_case_029", "p02394_case_030", "p02394_case_031", "p02394_case_032", "p02394_case_033", "p02394_case_034", "p02394_case_035", "p02394_case_036", "p02394_case_037", "p02394_case_038", "p02394_case_039", "p02394_case_040", "p02394_case_041", "p02394_case_042", "p02394_case_043", "p02394_case_044", "p02394_case_045", "p02394_case_046", "p02394_case_047", "p02394_case_048", "p02394_case_049", "p02394_case_050", "p02394_case_051", "p02394_case_052", "p02394_case_053", "p02394_case_054", "p02394_case_055", "p02394_case_056", "p02394_case_057", "p02394_case_058", "p02394_case_059", "p02394_case_060", "p02394_case_061", "p02394_case_062", "p02394_case_063", "p02394_case_064", "p02394_case_065", "p02394_case_066", "p02394_case_067", "p02394_case_068", "p02394_case_069", "p02394_case_070", "p02394_case_071", "p02394_case_072", "p02394_case_073", "p02394_case_074", "p02394_case_075", "p02394_case_076", "p02394_case_077", "p02394_case_078", "p02394_case_079", "p02394_case_080", "p02394_case_081", "p02394_case_082", "p02394_case_083", "p02394_case_084", "p02394_case_085", "p02394_case_086", "p02394_case_087", "p02394_case_088", "p02394_case_089", "p02394_case_090", "p02394_case_091", "p02394_case_092", "p02394_case_093", "p02394_case_094", "p02394_case_095", "p02394_case_096", "p02394_case_097", "p02394_case_098", "p02394_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "w, h, x, y, r = list(map(int, input().split()))\nif 0 <= x - r and x + r <= w and 0 <= y - r and y + r <= h:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "fast_code_sha256": "81ba19638c3fa3be36bbc77a262785df5f9ab1a2eca76741fbb3b3e72f63c6fe", "fast_id": "p02394_81ba19638c3fa3be36bbc77a262785df5f9ab1a2eca76741fbb3b3e72f63c6fe", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "w, h, x, y, r = list(map(int, input().split()))\nif 0 <= x - r and x + r <= w and 0 <= y - r and y + r <= h:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "measured_fast_code_sha256": "81ba19638c3fa3be36bbc77a262785df5f9ab1a2eca76741fbb3b3e72f63c6fe", "measured_slow_code": "# coding: utf-8\n# Here your code !\nimport math\n\n\ndef func():\n try:\n line = input().rstrip()\n numbers = line.split(\" \")\n width = float(numbers[0])\n height = float(numbers[1])\n x = float(numbers[2])\n y = float(numbers[3])\n r = abs(float(numbers[4]))\n except:\n print(\"input error\")\n return -1\n wsign = math.copysign(1, width)\n hsign = math.copysign(1, height)\n result = wsign * x + r <= wsign * width\n result = result and (wsign * x - r >= 0)\n result = result and (hsign * y + r <= hsign * height)\n result = result and (hsign * y - r >= 0)\n if result:\n print(\"Yes\")\n else:\n print(\"No\")\n\n\nfunc()\n", "measured_slow_code_sha256": "c88e86f1ad95ddc817ad7ba81628e2daf211ff2d39c36960f050623a40ae12a3", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.7473310693648703, "pair_id": "python_v2_fd3279bd4f9f6f41e0bff1aa", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02394", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02394_81ba19638c3fa3be36bbc77a262785df5f9ab1a2eca76741fbb3b3e72f63c6fe.jsonl.gz", "inputs": "reproduction/python/inputs/p02394.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02394_c88e86f1ad95ddc817ad7ba81628e2daf211ff2d39c36960f050623a40ae12a3.jsonl.gz"}, "slow_code": "import math\n\n\ndef func():\n try:\n line = input().rstrip()\n numbers = line.split(\" \")\n width = float(numbers[0])\n height = float(numbers[1])\n x = float(numbers[2])\n y = float(numbers[3])\n r = abs(float(numbers[4]))\n except:\n print(\"input error\")\n return -1\n wsign = math.copysign(1, width)\n hsign = math.copysign(1, height)\n result = wsign * x + r <= wsign * width\n result = result and (wsign * x - r >= 0)\n result = result and (hsign * y + r <= hsign * height)\n result = result and (hsign * y - r >= 0)\n if result:\n print(\"Yes\")\n else:\n print(\"No\")\n\n\nfunc()\n", "slow_code_sha256": "b3a430d2365496f9f536fa4236fe45d9a45c9a6c0f910f1eae517487e3d1e97c", "slow_id": "p02394_c88e86f1ad95ddc817ad7ba81628e2daf211ff2d39c36960f050623a40ae12a3", "speedup": 2.7474910662304146, "stratum": "2-4", "within_pair_jaccard": 0.3, "workload": {"case_count": 100, "description": "Decide whether the entire circle centered at (x,y) with radius r lies in the closed rectangle [0,W]x[0,H]. Touching the rectangle boundary is allowed. The five supplied values are integers. Observed inputs: W=1..100; H=1..100; x=-100..100; y=-100..100; r=1..96.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 19, "median": 15.5, "min": 10}, "input_format": ["W H x y r"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 5, "median": 5.0, "min": 5}}} -{"case_ids": ["p02244_case_000", "p02244_case_001", "p02244_case_002", "p02244_case_003", "p02244_case_004", "p02244_case_005", "p02244_case_006", "p02244_case_007", "p02244_case_008", "p02244_case_009", "p02244_case_010", "p02244_case_011", "p02244_case_012", "p02244_case_013", "p02244_case_014", "p02244_case_015", "p02244_case_016", "p02244_case_017", "p02244_case_018", "p02244_case_019", "p02244_case_020", "p02244_case_021", "p02244_case_022", "p02244_case_023", "p02244_case_024", "p02244_case_025", "p02244_case_026", "p02244_case_027", "p02244_case_028", "p02244_case_029", "p02244_case_030", "p02244_case_031", "p02244_case_032", "p02244_case_033", "p02244_case_034", "p02244_case_035", "p02244_case_036", "p02244_case_037", "p02244_case_038", "p02244_case_039", "p02244_case_040", "p02244_case_041", "p02244_case_042", "p02244_case_043", "p02244_case_044", "p02244_case_045", "p02244_case_046", "p02244_case_047", "p02244_case_048", "p02244_case_049", "p02244_case_050", "p02244_case_051", "p02244_case_052", "p02244_case_053", "p02244_case_054", "p02244_case_055", "p02244_case_056", "p02244_case_057", "p02244_case_058", "p02244_case_059", "p02244_case_060", "p02244_case_061", "p02244_case_062", "p02244_case_063", "p02244_case_064", "p02244_case_065", "p02244_case_066", "p02244_case_067", "p02244_case_068", "p02244_case_069", "p02244_case_070", "p02244_case_071", "p02244_case_072", "p02244_case_073", "p02244_case_074", "p02244_case_075", "p02244_case_076", "p02244_case_077", "p02244_case_078", "p02244_case_079", "p02244_case_080", "p02244_case_081", "p02244_case_082", "p02244_case_083", "p02244_case_084", "p02244_case_085", "p02244_case_086", "p02244_case_087", "p02244_case_088", "p02244_case_089", "p02244_case_090", "p02244_case_091", "p02244_case_092", "p02244_case_093", "p02244_case_094", "p02244_case_095", "p02244_case_096", "p02244_case_097", "p02244_case_098", "p02244_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from itertools import permutations\n\n\ndef check(queen):\n for r1, c1 in queen:\n if any(\n (r1 != r2 or c1 != c2)\n and (r1 == r2 or c1 == c2 or r1 + c1 == r2 + c2 or r1 - c1 == r2 - c2)\n for r2, c2 in queen\n ):\n return False\n return True\n\n\nN = int(input())\nQ, row, col = [], list(range(8)), list(range(8))\nfor _ in range(N):\n r, c = map(int, input().split())\n Q.append((r, c))\n row.remove(r)\n col.remove(c)\nfor l in permutations(col):\n queen = Q[:] + list(zip(row, l))\n if check(queen):\n board = [\n \"\".join(\"Q\" if (r, c) in queen else \".\" for c in range(8)) for r in range(8)\n ]\n print(*board, sep=\"\\n\")\n break\n", "fast_code_sha256": "4552d6918b293d4e3923d22cae6f6b3d7971edd1b0499db41458e6e81cf27648", "fast_id": "p02244_4552d6918b293d4e3923d22cae6f6b3d7971edd1b0499db41458e6e81cf27648", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from itertools import permutations\n\n\ndef check(queen):\n for r1, c1 in queen:\n if any(\n (r1 != r2 or c1 != c2)\n and (r1 == r2 or c1 == c2 or r1 + c1 == r2 + c2 or r1 - c1 == r2 - c2)\n for r2, c2 in queen\n ):\n return False\n return True\n\n\nN = int(input())\nQ, row, col = [], list(range(8)), list(range(8))\nfor _ in range(N):\n r, c = map(int, input().split())\n Q.append((r, c))\n row.remove(r)\n col.remove(c)\nfor l in permutations(col):\n queen = Q[:] + list(zip(row, l))\n if check(queen):\n board = [\n \"\".join(\"Q\" if (r, c) in queen else \".\" for c in range(8)) for r in range(8)\n ]\n print(*board, sep=\"\\n\")\n break\n", "measured_fast_code_sha256": "4552d6918b293d4e3923d22cae6f6b3d7971edd1b0499db41458e6e81cf27648", "measured_slow_code": "from functools import lru_cache\n\ncc = [[\".\" for i in range(8)] for j in range(8)]\n\n\ndef check(cc, a, b):\n ss = list(zip(*cc))\n if \"Q\" in cc[a]:\n return False\n if \"Q\" in ss[b]:\n return False\n d = []\n for i in range(8):\n for j in range(8):\n try:\n if j + abs(a - i) == b:\n d.append(cc[i][j])\n if j - abs(a - i) == b:\n d.append(cc[i][j])\n except IndexError:\n continue\n if \"Q\" in d:\n return False\n return True\n\n\ndef chess(s, queen):\n if queen == 8:\n return s\n for i in range(8):\n for j in range(8):\n if check(s, i, j):\n sol = s\n sol[i][j] = \"Q\"\n if chess(sol, queen + 1) != [[]]:\n return sol\n else:\n sol[i][j] = \".\"\n return [[]]\n\n\nk = int(eval(input()))\nfor i in range(k):\n a, b = [int(x) for x in input().split()]\n cc[a][b] = \"Q\"\nans = chess(cc, k)\nprint((\"\\n\".join(list([\"\".join(x) for x in ans]))))\n", "measured_slow_code_sha256": "94ec109ccd8bd9441b7a500ac9b67e1cafa7fd6c57f646835c6b0dc73a712deb", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.244764478714198, "pair_id": "python_v2_fee2bdf3fe7e5cc980cda13f", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02244", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02244_4552d6918b293d4e3923d22cae6f6b3d7971edd1b0499db41458e6e81cf27648.jsonl.gz", "inputs": "reproduction/python/inputs/p02244.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02244_94ec109ccd8bd9441b7a500ac9b67e1cafa7fd6c57f646835c6b0dc73a712deb.jsonl.gz"}, "slow_code": "from functools import lru_cache\n\ncc = [[\".\" for i in range(8)] for j in range(8)]\n\n\ndef check(cc, a, b):\n ss = list(zip(*cc))\n if \"Q\" in cc[a]:\n return False\n if \"Q\" in ss[b]:\n return False\n d = []\n for i in range(8):\n for j in range(8):\n try:\n if j + abs(a - i) == b:\n d.append(cc[i][j])\n if j - abs(a - i) == b:\n d.append(cc[i][j])\n except IndexError:\n continue\n if \"Q\" in d:\n return False\n return True\n\n\ndef chess(s, queen):\n if queen == 8:\n return s\n for i in range(8):\n for j in range(8):\n if check(s, i, j):\n sol = s\n sol[i][j] = \"Q\"\n if chess(sol, queen + 1) != [[]]:\n return sol\n else:\n sol[i][j] = \".\"\n return [[]]\n\n\nk = int(eval(input()))\nfor i in range(k):\n a, b = [int(x) for x in input().split()]\n cc[a][b] = \"Q\"\nans = chess(cc, k)\nprint((\"\\n\".join(list([\"\".join(x) for x in ans]))))\n", "slow_code_sha256": "94ec109ccd8bd9441b7a500ac9b67e1cafa7fd6c57f646835c6b0dc73a712deb", "slow_id": "p02244_94ec109ccd8bd9441b7a500ac9b67e1cafa7fd6c57f646835c6b0dc73a712deb", "speedup": 3.551726469815089, "stratum": "2-4", "within_pair_jaccard": 0.3582089552238806, "workload": {"case_count": 100, "description": "Complete an 8-by-8 board to eight nonattacking queens while preserving k fixed placements. Queens must differ in row, column and diagonal; coordinates are 0-based. The saved input has exactly one completion. Output Q for queens and . for empty cells. Observed inputs: k=2..8 (median 4); row=0..7; column=0..7.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 34, "median": 18.0, "min": 10}, "input_format": ["k\nr_1 c_1\n...\nr_k c_k"], "input_format_status": "source_input_section", "input_lines": {"max": 9, "median": 5.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 17, "median": 9.0, "min": 5}}} -{"case_ids": ["p03774_case_000", "p03774_case_001", "p03774_case_002", "p03774_case_003", "p03774_case_004", "p03774_case_005", "p03774_case_006", "p03774_case_007", "p03774_case_008", "p03774_case_009", "p03774_case_010", "p03774_case_011", "p03774_case_012", "p03774_case_013", "p03774_case_014", "p03774_case_015", "p03774_case_016", "p03774_case_017", "p03774_case_018", "p03774_case_019", "p03774_case_020", "p03774_case_021", "p03774_case_022", "p03774_case_023", "p03774_case_024", "p03774_case_025", "p03774_case_026", "p03774_case_027", "p03774_case_028", "p03774_case_029", "p03774_case_030", "p03774_case_031", "p03774_case_032", "p03774_case_033", "p03774_case_034", "p03774_case_035", "p03774_case_036", "p03774_case_037", "p03774_case_038", "p03774_case_039", "p03774_case_040", "p03774_case_041", "p03774_case_042", "p03774_case_043", "p03774_case_044", "p03774_case_045", "p03774_case_046", "p03774_case_047", "p03774_case_048", "p03774_case_049", "p03774_case_050", "p03774_case_051", "p03774_case_052", "p03774_case_053", "p03774_case_054", "p03774_case_055", "p03774_case_056", "p03774_case_057", "p03774_case_058", "p03774_case_059", "p03774_case_060", "p03774_case_061", "p03774_case_062", "p03774_case_063", "p03774_case_064", "p03774_case_065", "p03774_case_066", "p03774_case_067", "p03774_case_068", "p03774_case_069", "p03774_case_070", "p03774_case_071", "p03774_case_072", "p03774_case_073", "p03774_case_074", "p03774_case_075", "p03774_case_076", "p03774_case_077", "p03774_case_078", "p03774_case_079", "p03774_case_080", "p03774_case_081", "p03774_case_082", "p03774_case_083", "p03774_case_084", "p03774_case_085", "p03774_case_086", "p03774_case_087", "p03774_case_088", "p03774_case_089", "p03774_case_090", "p03774_case_091", "p03774_case_092", "p03774_case_093", "p03774_case_094", "p03774_case_095", "p03774_case_096", "p03774_case_097", "p03774_case_098", "p03774_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def dist(x, y):\n return abs(x[0] - y[0]) + abs(x[1] - y[1])\n\n\nN, M = list(map(int, input().split()))\nX = [list(map(int, input().split())) for _ in range(N)]\nY = [list(map(int, input().split())) for _ in range(M)]\nfor i in range(N):\n x, y = X[i]\n ind = M + 1\n dmin = 10**9\n for j in range(M):\n c, d = Y[j]\n d = dist((x, y), (c, d))\n if d < dmin:\n ind = j + 1\n dmin = d\n print(ind)\n", "fast_code_sha256": "75d18c94b1fc224b73f9cd43459683395d453f5bf3def50fdf4be238fe856e78", "fast_id": "p03774_75d18c94b1fc224b73f9cd43459683395d453f5bf3def50fdf4be238fe856e78", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def dist(x, y):\n return abs(x[0] - y[0]) + abs(x[1] - y[1])\n\n\nN, M = list(map(int, input().split()))\nX = [list(map(int, input().split())) for _ in range(N)]\nY = [list(map(int, input().split())) for _ in range(M)]\nfor i in range(N):\n x, y = X[i]\n ind = M + 1\n dmin = 10**9\n for j in range(M):\n c, d = Y[j]\n d = dist((x, y), (c, d))\n if d < dmin:\n ind = j + 1\n dmin = d\n print(ind)\n", "measured_fast_code_sha256": "75d18c94b1fc224b73f9cd43459683395d453f5bf3def50fdf4be238fe856e78", "measured_slow_code": "import numpy as np, sys\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\nN, M = LI()\nab = np.array([LI() for _ in range(N)], dtype=int)\ncd = np.array([LI() for _ in range(M)], dtype=int)\nfor x in ab:\n vector = np.sum(np.abs(cd - x), axis=1).tolist()\n print((vector.index(min(vector)) + 1))\n", "measured_slow_code_sha256": "0efc73096e5c454dd629a78888b6096a291ff26f7924fd5a40dea1274e463422", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 221.99906268468314, "pair_id": "python_v2_2d8514f8a7890f0648d0e206", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03774", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03774_75d18c94b1fc224b73f9cd43459683395d453f5bf3def50fdf4be238fe856e78.jsonl.gz", "inputs": "reproduction/python/inputs/p03774.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03774_0efc73096e5c454dd629a78888b6096a291ff26f7924fd5a40dea1274e463422.jsonl.gz"}, "slow_code": "import numpy as np, sys\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\nN, M = LI()\nab = np.array([LI() for _ in range(N)], dtype=int)\ncd = np.array([LI() for _ in range(M)], dtype=int)\nfor x in ab:\n vector = np.sum(np.abs(cd - x), axis=1).tolist()\n print((vector.index(min(vector)) + 1))\n", "slow_code_sha256": "0efc73096e5c454dd629a78888b6096a291ff26f7924fd5a40dea1274e463422", "slow_id": "p03774_0efc73096e5c454dd629a78888b6096a291ff26f7924fd5a40dea1274e463422", "speedup": 144.2968544030376, "stratum": "8+", "within_pair_jaccard": 0.32, "workload": {"case_count": 100, "description": "For each student (a_i,b_i), output the 1-based index of the nearest checkpoint (c_j,d_j) by Manhattan distance. Break ties by the smallest checkpoint index; repeated coordinates are allowed. Observed inputs: N=1..50 (median 16); M=1..50 (median 10); a_i=-100000000..100000000; b_i=-100000000..100000000; c_j=-100000000..100000000; d_j=-100000000..100000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 2106, "median": 458.5, "min": 12}, "input_format": ["N M\na_1 b_1\n...\na_N b_N\nc_1 d_1\n...\nc_M d_M"], "input_format_status": "source_input_section", "input_lines": {"max": 101, "median": 33.5, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 202, "median": 67.0, "min": 6}}} -{"case_ids": ["p02989_case_000", "p02989_case_001", "p02989_case_002", "p02989_case_003", "p02989_case_004", "p02989_case_005", "p02989_case_006", "p02989_case_007", "p02989_case_008", "p02989_case_009", "p02989_case_010", "p02989_case_011", "p02989_case_012", "p02989_case_013", "p02989_case_014", "p02989_case_015", "p02989_case_016", "p02989_case_017", "p02989_case_018", "p02989_case_019", "p02989_case_020", "p02989_case_021", "p02989_case_022", "p02989_case_023", "p02989_case_024", "p02989_case_025", "p02989_case_026", "p02989_case_027", "p02989_case_028", "p02989_case_029", "p02989_case_030", "p02989_case_031", "p02989_case_032", "p02989_case_033", "p02989_case_034", "p02989_case_035", "p02989_case_036", "p02989_case_037", "p02989_case_038", "p02989_case_039", "p02989_case_040", "p02989_case_041", "p02989_case_042", "p02989_case_043", "p02989_case_044", "p02989_case_045", "p02989_case_046", "p02989_case_047", "p02989_case_048", "p02989_case_049", "p02989_case_050", "p02989_case_051", "p02989_case_052", "p02989_case_053", "p02989_case_054", "p02989_case_055", "p02989_case_056", "p02989_case_057", "p02989_case_058", "p02989_case_059", "p02989_case_060", "p02989_case_061", "p02989_case_062", "p02989_case_063", "p02989_case_064", "p02989_case_065", "p02989_case_066", "p02989_case_067", "p02989_case_068", "p02989_case_069", "p02989_case_070", "p02989_case_071", "p02989_case_072", "p02989_case_073", "p02989_case_074", "p02989_case_075", "p02989_case_076", "p02989_case_077", "p02989_case_078", "p02989_case_079", "p02989_case_080", "p02989_case_081", "p02989_case_082", "p02989_case_083", "p02989_case_084", "p02989_case_085", "p02989_case_086", "p02989_case_087", "p02989_case_088", "p02989_case_089", "p02989_case_090", "p02989_case_091", "p02989_case_092", "p02989_case_093", "p02989_case_094", "p02989_case_095", "p02989_case_096", "p02989_case_097", "p02989_case_098", "p02989_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N = int(eval(input()))\nd = sorted(map(int, input().split()))\nabcmax = d[N // 2 - 1]\narcmin = d[N // 2]\nprint((arcmin - abcmax))\n", "fast_code_sha256": "d6ffc3f4b9190e53ed4e419f2c27d963e7cb5dbc2b6948c35957b55ce00a6dc7", "fast_id": "p02989_d6ffc3f4b9190e53ed4e419f2c27d963e7cb5dbc2b6948c35957b55ce00a6dc7", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N = int(eval(input()))\nd = sorted(map(int, input().split()))\nabcmax = d[N // 2 - 1]\narcmin = d[N // 2]\nprint((arcmin - abcmax))\n", "measured_fast_code_sha256": "d6ffc3f4b9190e53ed4e419f2c27d963e7cb5dbc2b6948c35957b55ce00a6dc7", "measured_slow_code": "from collections import Counter\n\nn = int(eval(input()))\nd = list(map(int, input().split()))\nminD = min(d)\nmaxD = max(d)\nc = Counter(d)\nabc = 0\narc = n\nans = 0\nfor i in range(minD, maxD + 1):\n abc += c[i - 1]\n arc -= c[i - 1]\n if abc == arc:\n ans += 1\nprint(ans)\n", "measured_slow_code_sha256": "f57035b7bb87a32b44942a577f637699784efe8a08be08008b173476e76e8522", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 102.17809005844254, "pair_id": "python_v2_840107d36492786a821d9c5d", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02989", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02989_d6ffc3f4b9190e53ed4e419f2c27d963e7cb5dbc2b6948c35957b55ce00a6dc7.jsonl.gz", "inputs": "reproduction/python/inputs/p02989.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02989_f57035b7bb87a32b44942a577f637699784efe8a08be08008b173476e76e8522.jsonl.gz"}, "slow_code": "from collections import Counter\n\nn = int(eval(input()))\nd = list(map(int, input().split()))\nminD = min(d)\nmaxD = max(d)\nc = Counter(d)\nabc = 0\narc = n\nans = 0\nfor i in range(minD, maxD + 1):\n abc += c[i - 1]\n arc -= c[i - 1]\n if abc == arc:\n ans += 1\nprint(ans)\n", "slow_code_sha256": "f57035b7bb87a32b44942a577f637699784efe8a08be08008b173476e76e8522", "slow_id": "p02989_f57035b7bb87a32b44942a577f637699784efe8a08be08008b173476e76e8522", "speedup": 43.580255725730225, "stratum": "8+", "within_pair_jaccard": 0.21875, "workload": {"case_count": 100, "description": "For an even number N of difficulties d_i, count integer thresholds K splitting the entries equally into values below K and values at least K. Observed inputs: N=2..100000 (median 100); d_i=1..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 600025, "median": 596.0, "min": 6}, "input_format": ["N\nd_1 ... d_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100001, "median": 101.0, "min": 3}}} -{"case_ids": ["p02786_case_000", "p02786_case_001", "p02786_case_002", "p02786_case_003", "p02786_case_004", "p02786_case_005", "p02786_case_006", "p02786_case_007", "p02786_case_008", "p02786_case_009", "p02786_case_010", "p02786_case_011", "p02786_case_012", "p02786_case_013", "p02786_case_014", "p02786_case_015", "p02786_case_016", "p02786_case_017", "p02786_case_018", "p02786_case_019", "p02786_case_020", "p02786_case_021", "p02786_case_022", "p02786_case_023", "p02786_case_024", "p02786_case_025", "p02786_case_026", "p02786_case_027", "p02786_case_028", "p02786_case_029", "p02786_case_030", "p02786_case_031", "p02786_case_032", "p02786_case_033", "p02786_case_034", "p02786_case_035", "p02786_case_036", "p02786_case_037", "p02786_case_038", "p02786_case_039", "p02786_case_040", "p02786_case_041", "p02786_case_042", "p02786_case_043", "p02786_case_044", "p02786_case_045", "p02786_case_046", "p02786_case_047", "p02786_case_048", "p02786_case_049", "p02786_case_050", "p02786_case_051", "p02786_case_052", "p02786_case_053", "p02786_case_054", "p02786_case_055", "p02786_case_056", "p02786_case_057", "p02786_case_058", "p02786_case_059", "p02786_case_060", "p02786_case_061", "p02786_case_062", "p02786_case_063", "p02786_case_064", "p02786_case_065", "p02786_case_066", "p02786_case_067", "p02786_case_068", "p02786_case_069", "p02786_case_070", "p02786_case_071", "p02786_case_072", "p02786_case_073", "p02786_case_074", "p02786_case_075", "p02786_case_076", "p02786_case_077", "p02786_case_078", "p02786_case_079", "p02786_case_080", "p02786_case_081", "p02786_case_082", "p02786_case_083", "p02786_case_084", "p02786_case_085", "p02786_case_086", "p02786_case_087", "p02786_case_088", "p02786_case_089", "p02786_case_090", "p02786_case_091", "p02786_case_092", "p02786_case_093", "p02786_case_094", "p02786_case_095", "p02786_case_096", "p02786_case_097", "p02786_case_098", "p02786_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "H = int(eval(input()))\nh = 0\nwhile H != 1:\n H = int(H / 2)\n h += 1\nprint((2 ** (h + 1) - 1))\n", "fast_code_sha256": "ff908f1d6b2723de5a8ca269d61d70f47d5cc5956ef7342203f3e6a93527a9cc", "fast_id": "p02786_ff908f1d6b2723de5a8ca269d61d70f47d5cc5956ef7342203f3e6a93527a9cc", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "H = int(eval(input()))\nh = 0\nwhile H != 1:\n H = int(H / 2)\n h += 1\nprint((2 ** (h + 1) - 1))\n", "measured_fast_code_sha256": "ff908f1d6b2723de5a8ca269d61d70f47d5cc5956ef7342203f3e6a93527a9cc", "measured_slow_code": "# -*- coding: utf-8 -*-\nimport sys\nimport math\nimport os\nimport itertools\nimport string\nimport heapq\nimport _collections\nfrom collections import Counter\nfrom collections import defaultdict\nfrom collections import deque\nfrom functools import lru_cache\nimport bisect\nimport re\nimport queue\nimport copy\nimport decimal\n\n\nclass Scanner:\n @staticmethod\n def int():\n return int(sys.stdin.readline().rstrip())\n\n @staticmethod\n def string():\n return sys.stdin.readline().rstrip()\n\n @staticmethod\n def map_int():\n return [int(x) for x in Scanner.string().split()]\n\n @staticmethod\n def string_list(n):\n return [Scanner.string() for i in range(n)]\n\n @staticmethod\n def int_list_list(n):\n return [Scanner.map_int() for i in range(n)]\n\n @staticmethod\n def int_cols_list(n):\n return [Scanner.int() for i in range(n)]\n\n\ndef solve():\n N = Scanner.int()\n ans = 0\n tmp = 1\n while N > 1:\n ans += tmp\n tmp *= 2\n N //= 2\n ans += tmp\n print(ans)\n\n\ndef main():\n # sys.setrecursionlimit(1000000)\n # sys.stdin = open(\"sample.txt\")\n solve()\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "5d6617ccb7542ab7ac6370731e16a8d6166b9d7e674b0195c22064d828abd3d2", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 37.63594163941768, "pair_id": "python_v2_66700894c24db55bc742d61e", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02786", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02786_ff908f1d6b2723de5a8ca269d61d70f47d5cc5956ef7342203f3e6a93527a9cc.jsonl.gz", "inputs": "reproduction/python/inputs/p02786.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02786_5d6617ccb7542ab7ac6370731e16a8d6166b9d7e674b0195c22064d828abd3d2.jsonl.gz"}, "slow_code": "import sys\nimport math\nimport os\nimport itertools\nimport string\nimport heapq\nimport _collections\nfrom collections import Counter\nfrom collections import defaultdict\nfrom collections import deque\nfrom functools import lru_cache\nimport bisect\nimport re\nimport queue\nimport copy\nimport decimal\n\n\nclass Scanner:\n @staticmethod\n def int():\n return int(sys.stdin.readline().rstrip())\n\n @staticmethod\n def string():\n return sys.stdin.readline().rstrip()\n\n @staticmethod\n def map_int():\n return [int(x) for x in Scanner.string().split()]\n\n @staticmethod\n def string_list(n):\n return [Scanner.string() for i in range(n)]\n\n @staticmethod\n def int_list_list(n):\n return [Scanner.map_int() for i in range(n)]\n\n @staticmethod\n def int_cols_list(n):\n return [Scanner.int() for i in range(n)]\n\n\ndef solve():\n N = Scanner.int()\n ans = 0\n tmp = 1\n while N > 1:\n ans += tmp\n tmp *= 2\n N //= 2\n ans += tmp\n print(ans)\n\n\ndef main():\n\n solve()\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "ccd6f9587aa7a20c43aac93ef11246453f9abff3b028525d3340cb287fb6e047", "slow_id": "p02786_5d6617ccb7542ab7ac6370731e16a8d6166b9d7e674b0195c22064d828abd3d2", "speedup": 40.16842084166798, "stratum": "8+", "within_pair_jaccard": 0.10526315789473684, "workload": {"case_count": 100, "description": "One monster initially has health H. An attack kills a health-1 monster; a monster of health X>1 instead becomes two monsters of health floor(X/2). Find the minimum attacks to eliminate all monsters. Observed inputs: H=1..1000000000000 (median 9236181246).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 14, "median": 11.5, "min": 2}, "input_format": ["H"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p02854_case_000", "p02854_case_001", "p02854_case_002", "p02854_case_003", "p02854_case_004", "p02854_case_005", "p02854_case_006", "p02854_case_007", "p02854_case_008", "p02854_case_009", "p02854_case_010", "p02854_case_011", "p02854_case_012", "p02854_case_013", "p02854_case_014", "p02854_case_015", "p02854_case_016", "p02854_case_017", "p02854_case_018", "p02854_case_019", "p02854_case_020", "p02854_case_021", "p02854_case_022", "p02854_case_023", "p02854_case_024", "p02854_case_025", "p02854_case_026", "p02854_case_027", "p02854_case_028", "p02854_case_029", "p02854_case_030", "p02854_case_031", "p02854_case_032", "p02854_case_033", "p02854_case_034", "p02854_case_035", "p02854_case_036", "p02854_case_037", "p02854_case_038", "p02854_case_039", "p02854_case_040", "p02854_case_041", "p02854_case_042", "p02854_case_043", "p02854_case_044", "p02854_case_045", "p02854_case_046", "p02854_case_047", "p02854_case_048", "p02854_case_049", "p02854_case_050", "p02854_case_051", "p02854_case_052", "p02854_case_053", "p02854_case_054", "p02854_case_055", "p02854_case_056", "p02854_case_057", "p02854_case_058", "p02854_case_059", "p02854_case_060", "p02854_case_061", "p02854_case_062", "p02854_case_063", "p02854_case_064", "p02854_case_065", "p02854_case_066", "p02854_case_067", "p02854_case_068", "p02854_case_069", "p02854_case_070", "p02854_case_071", "p02854_case_072", "p02854_case_073", "p02854_case_074", "p02854_case_075", "p02854_case_076", "p02854_case_077", "p02854_case_078", "p02854_case_079", "p02854_case_080", "p02854_case_081", "p02854_case_082", "p02854_case_083", "p02854_case_084", "p02854_case_085", "p02854_case_086", "p02854_case_087", "p02854_case_088", "p02854_case_089", "p02854_case_090", "p02854_case_091", "p02854_case_092", "p02854_case_093", "p02854_case_094", "p02854_case_095", "p02854_case_096", "p02854_case_097", "p02854_case_098", "p02854_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from itertools import accumulate, count\nfrom bisect import bisect_right\n\neval(input())\na = [0] + list(accumulate(list(map(int, input().split()))))\ni = bisect_right(a, a[-1] // 2)\nprint((min(2 * a[i] - a[-1], a[-1] - 2 * a[i - 1])))\n", "fast_code_sha256": "18a478db01dd495ea3fad9e396632e5f652c11d9ff33ec9b4eeca5aad4f583d0", "fast_id": "p02854_18a478db01dd495ea3fad9e396632e5f652c11d9ff33ec9b4eeca5aad4f583d0", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from itertools import accumulate, count\nfrom bisect import bisect_right\n\neval(input())\na = [0] + list(accumulate(list(map(int, input().split()))))\ni = bisect_right(a, a[-1] // 2)\nprint((min(2 * a[i] - a[-1], a[-1] - 2 * a[i - 1])))\n", "measured_fast_code_sha256": "18a478db01dd495ea3fad9e396632e5f652c11d9ff33ec9b4eeca5aad4f583d0", "measured_slow_code": "n = int(eval(input()))\na = list(map(int, input().split()))\nans = 0\ns = sum(a)\nal = []\nsum1 = 0\nfor i in range(0, n):\n # if i == 1:\n # sum1 = sum(a[0:i])\n # else:\n # sum1 += a[i]\n sum1 += a[i]\n sum2 = s - sum1\n # print(\"sum1:\"+str(sum1))\n # print(\"sum2:\"+str(sum2))\n al.append(abs(sum1 - sum2))\n if sum1 == sum2:\n print((0))\n exit()\nminDiffIdx = al.index(min(al))\n# print(\"---\")\n# print(minDiffIdx)\n# print(\"---\")\ntmp1 = sum(a[0:minDiffIdx])\ntmp2 = sum(a[minDiffIdx:])\n# print(tmp1)\n# print(tmp2)\ndiff1 = abs(tmp1 - tmp2)\ntmp3 = sum(a[0 : minDiffIdx + 1])\ntmp4 = sum(a[minDiffIdx + 1 :])\n# print(tmp3)\n# print(tmp4)\ndiff2 = abs(tmp3 - tmp4)\nprint((min(diff1, diff2)))\n# d1 = diff1\n# d2 = diff2\n# if d1 < d2:\n# for i in range(n//2):\n# if a[i] > 1:\n# d1 -= a[i]\n# if d1 < 0:\n# ans += diff1 + d1\n# break\n# elif d1 == 0:\n# ans += diff1\n# break\n# if\n# else:\n", "measured_slow_code_sha256": "4de60e0edb003c68afc8588a6fa312bb9c3f4fe04cd967a5d89f04e986a70922", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.095641291437622, "pair_id": "python_v2_86edfe1a2e8fc1a0184ba829", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02854", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02854_18a478db01dd495ea3fad9e396632e5f652c11d9ff33ec9b4eeca5aad4f583d0.jsonl.gz", "inputs": "reproduction/python/inputs/p02854.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02854_4de60e0edb003c68afc8588a6fa312bb9c3f4fe04cd967a5d89f04e986a70922.jsonl.gz"}, "slow_code": "n = int(eval(input()))\na = list(map(int, input().split()))\nans = 0\ns = sum(a)\nal = []\nsum1 = 0\nfor i in range(0, n):\n\n sum1 += a[i]\n sum2 = s - sum1\n\n al.append(abs(sum1 - sum2))\n if sum1 == sum2:\n print((0))\n exit()\nminDiffIdx = al.index(min(al))\n\n\ntmp1 = sum(a[0:minDiffIdx])\ntmp2 = sum(a[minDiffIdx:])\n\n\ndiff1 = abs(tmp1 - tmp2)\ntmp3 = sum(a[0 : minDiffIdx + 1])\ntmp4 = sum(a[minDiffIdx + 1 :])\n\n\ndiff2 = abs(tmp3 - tmp4)\nprint((min(diff1, diff2)))\n", "slow_code_sha256": "df24bf072adc34e3a816768d47c73f69af21583e676303edb8a1a73b6192615f", "slow_id": "p02854_4de60e0edb003c68afc8588a6fa312bb9c3f4fe04cd967a5d89f04e986a70922", "speedup": 2.4991316568670237, "stratum": "2-4", "within_pair_jaccard": 0.2857142857142857, "workload": {"case_count": 100, "description": "A bar consists of N positive-length sections A_i with cuts permitted only between sections. Increasing or decreasing a section by 1 costs 1, and lengths must stay positive. Minimize cost before splitting into equal-length halves. Observed inputs: N=2..200000 (median 1000); A_i=1..2020202020.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 2200007, "median": 10220.5, "min": 6}, "input_format": ["N\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200001, "median": 1001.0, "min": 3}}} -{"case_ids": ["p02706_case_000", "p02706_case_001", "p02706_case_002", "p02706_case_003", "p02706_case_004", "p02706_case_005", "p02706_case_006", "p02706_case_007", "p02706_case_008", "p02706_case_009", "p02706_case_010", "p02706_case_011", "p02706_case_012", "p02706_case_013", "p02706_case_014", "p02706_case_015", "p02706_case_016", "p02706_case_017", "p02706_case_018", "p02706_case_019", "p02706_case_020", "p02706_case_021", "p02706_case_022", "p02706_case_023", "p02706_case_024", "p02706_case_025", "p02706_case_026", "p02706_case_027", "p02706_case_028", "p02706_case_029", "p02706_case_030", "p02706_case_031", "p02706_case_032", "p02706_case_033", "p02706_case_034", "p02706_case_035", "p02706_case_036", "p02706_case_037", "p02706_case_038", "p02706_case_039", "p02706_case_040", "p02706_case_041", "p02706_case_042", "p02706_case_043", "p02706_case_044", "p02706_case_045", "p02706_case_046", "p02706_case_047", "p02706_case_048", "p02706_case_049", "p02706_case_050", "p02706_case_051", "p02706_case_052", "p02706_case_053", "p02706_case_054", "p02706_case_055", "p02706_case_056", "p02706_case_057", "p02706_case_058", "p02706_case_059", "p02706_case_060", "p02706_case_061", "p02706_case_062", "p02706_case_063", "p02706_case_064", "p02706_case_065", "p02706_case_066", "p02706_case_067", "p02706_case_068", "p02706_case_069", "p02706_case_070", "p02706_case_071", "p02706_case_072", "p02706_case_073", "p02706_case_074", "p02706_case_075", "p02706_case_076", "p02706_case_077", "p02706_case_078", "p02706_case_079", "p02706_case_080", "p02706_case_081", "p02706_case_082", "p02706_case_083", "p02706_case_084", "p02706_case_085", "p02706_case_086", "p02706_case_087", "p02706_case_088", "p02706_case_089", "p02706_case_090", "p02706_case_091", "p02706_case_092", "p02706_case_093", "p02706_case_094", "p02706_case_095", "p02706_case_096", "p02706_case_097", "p02706_case_098", "p02706_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n, m = list(map(int, input().split(\" \")))\na = list(map(int, input().split(\" \")))\nasum = sum(a)\nif (n - asum) < 0:\n print(\"-1\")\nelse:\n print((n - asum))\n", "fast_code_sha256": "6cd535b402de6ec9bdfbb998853e9e2b71705be96d70117ffc06e717a6a5fda8", "fast_id": "p02706_6cd535b402de6ec9bdfbb998853e9e2b71705be96d70117ffc06e717a6a5fda8", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n, m = list(map(int, input().split(\" \")))\na = list(map(int, input().split(\" \")))\nasum = sum(a)\nif (n - asum) < 0:\n print(\"-1\")\nelse:\n print((n - asum))\n", "measured_fast_code_sha256": "6cd535b402de6ec9bdfbb998853e9e2b71705be96d70117ffc06e717a6a5fda8", "measured_slow_code": "import numpy as np\nimport math\n\nn, m = list(map(int, input().split()))\nA = list(map(int, input().split()))\na = sum(A)\nif n < a:\n print((-1))\nelse:\n print((n - a))\n", "measured_slow_code_sha256": "89bf5646ac16bde646209d2509249ed7377541f5a03b9f9c5553553af3b07c63", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 61.90362482558755, "pair_id": "python_v2_d041ed0933ea47628befb6aa", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02706", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02706_6cd535b402de6ec9bdfbb998853e9e2b71705be96d70117ffc06e717a6a5fda8.jsonl.gz", "inputs": "reproduction/python/inputs/p02706.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02706_89bf5646ac16bde646209d2509249ed7377541f5a03b9f9c5553553af3b07c63.jsonl.gz"}, "slow_code": "import numpy as np\nimport math\n\nn, m = list(map(int, input().split()))\nA = list(map(int, input().split()))\na = sum(A)\nif n < a:\n print((-1))\nelse:\n print((n - a))\n", "slow_code_sha256": "89bf5646ac16bde646209d2509249ed7377541f5a03b9f9c5553553af3b07c63", "slow_id": "p02706_89bf5646ac16bde646209d2509249ed7377541f5a03b9f9c5553553af3b07c63", "speedup": 167.93026558501714, "stratum": "8+", "within_pair_jaccard": 0.6190476190476191, "workload": {"case_count": 100, "description": "During N vacation days, complete M assignments requiring A_i days each, with no simultaneous assignments. Maximize days left free, or report -1 if all assignments cannot fit. Observed inputs: N=1..1000000 (median 1000); M=1..10000 (median 6445); A_i=1..10000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 60014, "median": 15213.0, "min": 6}, "input_format": ["N M\nA_1 ... A_M"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 10002, "median": 6447.0, "min": 3}}} -{"case_ids": ["p03078_case_000", "p03078_case_001", "p03078_case_002", "p03078_case_003", "p03078_case_004", "p03078_case_005", "p03078_case_006", "p03078_case_007", "p03078_case_008", "p03078_case_009", "p03078_case_010", "p03078_case_011", "p03078_case_012", "p03078_case_013", "p03078_case_014", "p03078_case_015", "p03078_case_016", "p03078_case_017", "p03078_case_018", "p03078_case_019", "p03078_case_020", "p03078_case_021", "p03078_case_022", "p03078_case_023", "p03078_case_024", "p03078_case_025", "p03078_case_026", "p03078_case_027", "p03078_case_028", "p03078_case_029", "p03078_case_030", "p03078_case_031", "p03078_case_032", "p03078_case_033", "p03078_case_034", "p03078_case_035", "p03078_case_036", "p03078_case_037", "p03078_case_038", "p03078_case_039", "p03078_case_040", "p03078_case_041", "p03078_case_042", "p03078_case_043", "p03078_case_044", "p03078_case_045", "p03078_case_046", "p03078_case_047", "p03078_case_048", "p03078_case_049", "p03078_case_050", "p03078_case_051", "p03078_case_052", "p03078_case_053", "p03078_case_054", "p03078_case_055", "p03078_case_056", "p03078_case_057", "p03078_case_059", "p03078_case_060", "p03078_case_061", "p03078_case_062", "p03078_case_063", "p03078_case_064", "p03078_case_065", "p03078_case_066", "p03078_case_067", "p03078_case_069", "p03078_case_070", "p03078_case_071", "p03078_case_072", "p03078_case_073", "p03078_case_074", "p03078_case_075", "p03078_case_076", "p03078_case_077", "p03078_case_078", "p03078_case_079", "p03078_case_080", "p03078_case_081", "p03078_case_082", "p03078_case_083", "p03078_case_084", "p03078_case_085", "p03078_case_086", "p03078_case_087", "p03078_case_088", "p03078_case_089", "p03078_case_090", "p03078_case_091", "p03078_case_092", "p03078_case_093", "p03078_case_094", "p03078_case_095", "p03078_case_096", "p03078_case_097", "p03078_case_098", "p03078_case_099", "p03078_v2_67e3066218a5a534bee9", "p03078_v2_bf0d7ab34a53dfd7f197"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "x, y, z, k = list(map(int, input().split()))\nA = [int(i) for i in input().split()]\nB = [int(i) for i in input().split()]\nC = [int(i) for i in input().split()]\nA.sort(reverse=True)\nB.sort(reverse=True)\nC.sort(reverse=True)\nx = 0\ny = 0\nz = 0\ncakes = []\nfor x, a in enumerate(A):\n if x + 1 > k:\n break\n for y, b in enumerate(B):\n if (x + 1) * (y + 1) > k:\n break\n for z, c in enumerate(C):\n if (x + 1) * (y + 1) * (z + 1) > k:\n break\n cakes.append(a + b + c)\ncakes.sort(reverse=True)\nfor cake in cakes[:k]:\n print(cake)\n", "fast_code_sha256": "3d1031aa59bd9f11118b3c436281be88b6debc1d015f10c514c3bfd4f606c2ec", "fast_id": "p03078_3d1031aa59bd9f11118b3c436281be88b6debc1d015f10c514c3bfd4f606c2ec", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "x, y, z, k = list(map(int, input().split()))\nA = [int(i) for i in input().split()]\nB = [int(i) for i in input().split()]\nC = [int(i) for i in input().split()]\nA.sort(reverse=True)\nB.sort(reverse=True)\nC.sort(reverse=True)\nx = 0\ny = 0\nz = 0\ncakes = []\nfor x, a in enumerate(A):\n if x + 1 > k:\n break\n for y, b in enumerate(B):\n if (x + 1) * (y + 1) > k:\n break\n for z, c in enumerate(C):\n if (x + 1) * (y + 1) * (z + 1) > k:\n break\n cakes.append(a + b + c)\ncakes.sort(reverse=True)\nfor cake in cakes[:k]:\n print(cake)\n", "measured_fast_code_sha256": "3d1031aa59bd9f11118b3c436281be88b6debc1d015f10c514c3bfd4f606c2ec", "measured_slow_code": "def main():\n X, Y, Z, K = list(map(int, input().split()))\n A = list(map(int, input().split()))\n B = list(map(int, input().split()))\n C = list(map(int, input().split()))\n D = []\n for a in A:\n for b in B:\n D.append(a + b)\n D.sort(reverse=True)\n E = []\n for i in range(min(len(D), K)):\n for c in C:\n E.append(D[i] + c)\n E.sort(reverse=True)\n for i in range(K):\n print((E[i]))\n\n\nmain()\n", "measured_slow_code_sha256": "111fe5f3e4b281063d100ddf30040d19f67315bff67e2ba117c756fdb01a6253", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 8.394898046997524, "pair_id": "python_v2_7e8a225b7c1cdaae96031340", "per_case_slow_code_faster_fraction": 0.32, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03078", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03078_3d1031aa59bd9f11118b3c436281be88b6debc1d015f10c514c3bfd4f606c2ec.jsonl.gz", "inputs": "reproduction/python/inputs/p03078.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03078_111fe5f3e4b281063d100ddf30040d19f67315bff67e2ba117c756fdb01a6253.jsonl.gz"}, "slow_code": "def main():\n X, Y, Z, K = list(map(int, input().split()))\n A = list(map(int, input().split()))\n B = list(map(int, input().split()))\n C = list(map(int, input().split()))\n D = []\n for a in A:\n for b in B:\n D.append(a + b)\n D.sort(reverse=True)\n E = []\n for i in range(min(len(D), K)):\n for c in C:\n E.append(D[i] + c)\n E.sort(reverse=True)\n for i in range(K):\n print((E[i]))\n\n\nmain()\n", "slow_code_sha256": "111fe5f3e4b281063d100ddf30040d19f67315bff67e2ba117c756fdb01a6253", "slow_id": "p03078_111fe5f3e4b281063d100ddf30040d19f67315bff67e2ba117c756fdb01a6253", "speedup": 4.96530640066816, "stratum": "4-8", "within_pair_jaccard": 0.4634146341463415, "workload": {"case_count": 100, "description": "Choose one entry from each of arrays A,B,C of lengths X,Y,Z. Print the K largest resulting sums, retaining multiplicities of different index triples. Observed inputs: X=1..1000 (median 100); Y=1..1000 (median 100); Z=1..1000 (median 400); K=1..3000 (median 3000); A_i=1..10000000000; B_i=1..10000000000; C_i=1..10000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 36020, "median": 6015.5, "min": 14}, "input_format": ["X Y Z K\nA_1 ... A_X\nB_1 ... B_Y\nC_1 ... C_Z"], "input_format_status": "source_input_section", "input_lines": {"max": 4, "median": 4.0, "min": 4}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3004, "median": 1804.0, "min": 7}}} -{"case_ids": ["p03695_case_000", "p03695_case_001", "p03695_case_002", "p03695_case_003", "p03695_case_004", "p03695_case_005", "p03695_case_006", "p03695_case_007", "p03695_case_008", "p03695_case_009", "p03695_case_010", "p03695_case_011", "p03695_case_012", "p03695_case_013", "p03695_case_014", "p03695_case_015", "p03695_case_016", "p03695_case_017", "p03695_case_018", "p03695_case_019", "p03695_case_020", "p03695_case_021", "p03695_case_022", "p03695_case_023", "p03695_case_024", "p03695_case_025", "p03695_case_026", "p03695_case_027", "p03695_case_028", "p03695_case_029", "p03695_case_030", "p03695_case_031", "p03695_case_032", "p03695_case_033", "p03695_case_034", "p03695_case_035", "p03695_case_036", "p03695_case_037", "p03695_case_038", "p03695_case_039", "p03695_case_040", "p03695_case_041", "p03695_case_042", "p03695_case_043", "p03695_case_044", "p03695_case_045", "p03695_case_046", "p03695_case_047", "p03695_case_048", "p03695_case_049", "p03695_case_050", "p03695_case_051", "p03695_case_052", "p03695_case_053", "p03695_case_054", "p03695_case_055", "p03695_case_056", "p03695_case_057", "p03695_case_058", "p03695_case_059", "p03695_case_060", "p03695_case_061", "p03695_case_062", "p03695_case_063", "p03695_case_064", "p03695_case_065", "p03695_case_066", "p03695_case_067", "p03695_case_068", "p03695_case_069", "p03695_case_070", "p03695_case_071", "p03695_case_072", "p03695_case_073", "p03695_case_074", "p03695_case_075", "p03695_case_076", "p03695_case_077", "p03695_case_078", "p03695_case_079", "p03695_case_080", "p03695_case_081", "p03695_case_082", "p03695_case_083", "p03695_case_084", "p03695_case_085", "p03695_case_086", "p03695_case_087", "p03695_case_088", "p03695_case_089", "p03695_case_090", "p03695_case_091", "p03695_case_092", "p03695_case_093", "p03695_case_094", "p03695_case_095", "p03695_case_096", "p03695_case_097", "p03695_case_098", "p03695_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(input())\na = list(map(int, input().split()))\nc = [0] * 8\nmx = 0\nfor i in range(n):\n if 1 <= a[i] < 400:\n c[0] = 1\n elif 400 <= a[i] < 800:\n c[1] = 1\n elif 800 <= a[i] < 1200:\n c[2] = 1\n elif 1200 <= a[i] < 1600:\n c[3] = 1\n elif 1600 <= a[i] < 2000:\n c[4] = 1\n elif 2000 <= a[i] < 2400:\n c[5] = 1\n elif 2400 <= a[i] < 2800:\n c[6] = 1\n elif 2800 <= a[i] < 3200:\n c[7] = 1\n else:\n mx += 1\nprint(max(1, sum(c)), sum(c) + mx)\n", "fast_code_sha256": "f461e236e6015c443dce12864d380acf1352b871928b38a7cec7ad6fe70d8437", "fast_id": "p03695_f461e236e6015c443dce12864d380acf1352b871928b38a7cec7ad6fe70d8437", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(input())\na = list(map(int, input().split()))\nc = [0] * 8\nmx = 0\nfor i in range(n):\n if 1 <= a[i] < 400:\n c[0] = 1\n elif 400 <= a[i] < 800:\n c[1] = 1\n elif 800 <= a[i] < 1200:\n c[2] = 1\n elif 1200 <= a[i] < 1600:\n c[3] = 1\n elif 1600 <= a[i] < 2000:\n c[4] = 1\n elif 2000 <= a[i] < 2400:\n c[5] = 1\n elif 2400 <= a[i] < 2800:\n c[6] = 1\n elif 2800 <= a[i] < 3200:\n c[7] = 1\n else:\n mx += 1\nprint(max(1, sum(c)), sum(c) + mx)\n", "measured_fast_code_sha256": "f461e236e6015c443dce12864d380acf1352b871928b38a7cec7ad6fe70d8437", "measured_slow_code": "from bisect import bisect_left\nimport numpy as np\n\nn = int(input())\na = map(int, input().split())\nborder = np.arange(399, 3200, 400)\ncnt = [0] * (len(border) + 1)\nfor i in a:\n cnt[bisect_left(border, i)] += 1\nk = np.count_nonzero(cnt[:-1])\nprint(k, k + cnt[-1]) if k != 0 else print(1, cnt[-1])\n", "measured_slow_code_sha256": "7f271d923060c17e2c49a8d7f271bc0668cd1f8f85b998cc6651cd42c9e43961", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 423.21429775693696, "pair_id": "python_v2_5862d243261a5510f2d438e8", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03695", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03695_f461e236e6015c443dce12864d380acf1352b871928b38a7cec7ad6fe70d8437.jsonl.gz", "inputs": "reproduction/python/inputs/p03695.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03695_7f271d923060c17e2c49a8d7f271bc0668cd1f8f85b998cc6651cd42c9e43961.jsonl.gz"}, "slow_code": "from bisect import bisect_left\nimport numpy as np\n\nn = int(input())\na = map(int, input().split())\nborder = np.arange(399, 3200, 400)\ncnt = [0] * (len(border) + 1)\nfor i in a:\n cnt[bisect_left(border, i)] += 1\nk = np.count_nonzero(cnt[:-1])\nprint(k, k + cnt[-1]) if k != 0 else print(1, cnt[-1])\n", "slow_code_sha256": "7f271d923060c17e2c49a8d7f271bc0668cd1f8f85b998cc6651cd42c9e43961", "slow_id": "p03695_7f271d923060c17e2c49a8d7f271bc0668cd1f8f85b998cc6651cd42c9e43961", "speedup": 379.7415033171919, "stratum": "8+", "within_pair_jaccard": 0.32, "workload": {"case_count": 100, "description": "Ratings below 3200 fix one of eight colors in bands 1..399,400..799,...,2800..3199. Each user rated at least 3200 may choose any color, including new ones. Find minimum and maximum distinct-color counts among N users. Observed inputs: N=1..100 (median 13); a_i=1..4800.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 504, "median": 66.0, "min": 4}, "input_format": ["N\na_1 ... a_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 101, "median": 14.0, "min": 2}}} -{"case_ids": ["p00022_case_000", "p00022_case_001", "p00022_case_002", "p00022_case_003", "p00022_case_004", "p00022_case_005", "p00022_case_006", "p00022_case_007", "p00022_case_008", "p00022_case_009", "p00022_case_010", "p00022_case_011", "p00022_case_012", "p00022_case_013", "p00022_case_014", "p00022_case_015", "p00022_case_016", "p00022_case_017", "p00022_case_018", "p00022_case_019", "p00022_case_020", "p00022_case_021", "p00022_case_022", "p00022_case_023", "p00022_case_024", "p00022_case_025", "p00022_case_026", "p00022_case_027", "p00022_case_028", "p00022_case_029", "p00022_case_030", "p00022_case_031", "p00022_case_032", "p00022_case_033", "p00022_case_034", "p00022_case_035", "p00022_case_036", "p00022_case_037", "p00022_case_038", "p00022_case_039", "p00022_case_040", "p00022_case_041", "p00022_case_042", "p00022_case_043", "p00022_case_044", "p00022_case_045", "p00022_case_046", "p00022_case_047", "p00022_case_048", "p00022_case_049", "p00022_case_050", "p00022_case_051", "p00022_case_052", "p00022_case_053", "p00022_case_054", "p00022_case_055", "p00022_case_056", "p00022_case_057", "p00022_case_058", "p00022_case_059", "p00022_case_060", "p00022_case_061", "p00022_case_062", "p00022_case_063", "p00022_case_064", "p00022_case_065", "p00022_case_066", "p00022_case_067", "p00022_case_068", "p00022_case_069", "p00022_case_070", "p00022_case_071", "p00022_case_072", "p00022_case_073", "p00022_case_074", "p00022_case_075", "p00022_case_076", "p00022_case_077", "p00022_case_078", "p00022_case_079", "p00022_case_080", "p00022_case_081", "p00022_case_082", "p00022_case_083", "p00022_case_084", "p00022_case_085", "p00022_case_086", "p00022_case_087", "p00022_case_088", "p00022_case_089", "p00022_case_090", "p00022_case_091", "p00022_case_092", "p00022_case_093", "p00022_case_094", "p00022_case_095", "p00022_case_096", "p00022_case_097", "p00022_case_098", "p00022_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "while 1:\n n = eval(input())\n if n == 0:\n break\n r = [int(input()) for i in range(n)]\n for i in range(1, n):\n r[i] = max(r[i - 1] + r[i], r[i])\n print(max(r))\n", "fast_code_sha256": "f522ab1c5a929026d0db6ca658dc7a8ef822c62c3950374ddb1e286b2eb1b22f", "fast_id": "p00022_f522ab1c5a929026d0db6ca658dc7a8ef822c62c3950374ddb1e286b2eb1b22f", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "while 1:\n n = eval(input())\n if n == 0:\n break\n r = [int(input()) for i in range(n)]\n for i in range(1, n):\n r[i] = max(r[i - 1] + r[i], r[i])\n print(max(r))\n", "measured_fast_code_sha256": "f522ab1c5a929026d0db6ca658dc7a8ef822c62c3950374ddb1e286b2eb1b22f", "measured_slow_code": "n = eval(input())\nwhile n:\n x = -100000\n m = x\n s = 0\n while n:\n a = eval(input())\n x = max(x, 0) + a\n m = max(m, x)\n n -= 1\n print(m)\n n = eval(input())\n", "measured_slow_code_sha256": "a5086560b3d72499a535710346e1969d90deaa71ee9f102e4fab549979daedfd", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.6289540917325747, "pair_id": "python_v2_8a6aec7bbbf8d0268faba6f7", "per_case_slow_code_faster_fraction": 0.12, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p00022", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p00022_f522ab1c5a929026d0db6ca658dc7a8ef822c62c3950374ddb1e286b2eb1b22f.jsonl.gz", "inputs": "reproduction/python/inputs/p00022.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p00022_a5086560b3d72499a535710346e1969d90deaa71ee9f102e4fab549979daedfd.jsonl.gz"}, "slow_code": "n = eval(input())\nwhile n:\n x = -100000\n m = x\n s = 0\n while n:\n a = eval(input())\n x = max(x, 0) + a\n m = max(m, x)\n n -= 1\n print(m)\n n = eval(input())\n", "slow_code_sha256": "a5086560b3d72499a535710346e1969d90deaa71ee9f102e4fab549979daedfd", "slow_id": "p00022_a5086560b3d72499a535710346e1969d90deaa71ee9f102e4fab549979daedfd", "speedup": 2.29602754947513, "stratum": "2-4", "within_pair_jaccard": 0.38095238095238093, "workload": {"case_count": 100, "description": "For each integer sequence, find the maximum sum of a nonempty contiguous subsequence. Each dataset supplies n followed by n values, one value per line; a final zero ends the input. Observed inputs: datasets=1..10 (median 1); n=1..5000; total_records=1..50000 (median 1000); a_i=-100000..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 319550, "median": 6388.0, "min": 9}, "input_format": ["n_1\na_1\n...\na_(n_1)\n[next datasets]\n0"], "input_format_status": "source_input_section", "input_lines": {"max": 50011, "median": 1002.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 50011, "median": 1002.0, "min": 3}}} -{"case_ids": ["p03609_case_000", "p03609_case_001", "p03609_case_002", "p03609_case_003", "p03609_case_004", "p03609_case_005", "p03609_case_006", "p03609_case_007", "p03609_case_008", "p03609_case_009", "p03609_case_010", "p03609_case_011", "p03609_case_012", "p03609_case_013", "p03609_case_014", "p03609_case_015", "p03609_case_016", "p03609_case_017", "p03609_case_018", "p03609_case_019", "p03609_case_020", "p03609_case_021", "p03609_case_022", "p03609_case_023", "p03609_case_024", "p03609_case_025", "p03609_case_026", "p03609_case_027", "p03609_case_028", "p03609_case_029", "p03609_case_030", "p03609_case_031", "p03609_case_032", "p03609_case_033", "p03609_case_034", "p03609_case_035", "p03609_case_036", "p03609_case_037", "p03609_case_038", "p03609_case_039", "p03609_case_040", "p03609_case_041", "p03609_case_042", "p03609_case_043", "p03609_case_044", "p03609_case_045", "p03609_case_046", "p03609_case_047", "p03609_case_048", "p03609_case_049", "p03609_case_050", "p03609_case_051", "p03609_case_052", "p03609_case_053", "p03609_case_054", "p03609_case_055", "p03609_case_056", "p03609_case_057", "p03609_case_058", "p03609_case_059", "p03609_case_060", "p03609_case_061", "p03609_case_062", "p03609_case_063", "p03609_case_064", "p03609_case_065", "p03609_case_066", "p03609_case_067", "p03609_case_068", "p03609_case_069", "p03609_case_070", "p03609_case_071", "p03609_case_072", "p03609_case_073", "p03609_case_074", "p03609_case_075", "p03609_case_076", "p03609_case_077", "p03609_case_078", "p03609_case_079", "p03609_case_080", "p03609_case_081", "p03609_case_082", "p03609_case_083", "p03609_case_084", "p03609_case_085", "p03609_case_086", "p03609_case_087", "p03609_case_088", "p03609_case_089", "p03609_case_090", "p03609_case_091", "p03609_case_092", "p03609_case_093", "p03609_case_094", "p03609_case_095", "p03609_case_096", "p03609_case_097", "p03609_case_098", "p03609_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "x, t = list(map(int, input().split()))\nif x > t:\n print((x - t))\nelse:\n print((0))\n", "fast_code_sha256": "eeaf509bab666b2036f34e80665c8088d959a8e042fcfbf5282df779854fc46f", "fast_id": "p03609_eeaf509bab666b2036f34e80665c8088d959a8e042fcfbf5282df779854fc46f", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "x, t = list(map(int, input().split()))\nif x > t:\n print((x - t))\nelse:\n print((0))\n", "measured_fast_code_sha256": "eeaf509bab666b2036f34e80665c8088d959a8e042fcfbf5282df779854fc46f", "measured_slow_code": "import numpy as np\n\nx, t = list(map(int, input().split()))\nprint((max(x - t, 0)))\n", "measured_slow_code_sha256": "05c7cfa6f7e3edd14d82845ed4d2e91cd4b96ef2bf5eba445a2670d95ff174d0", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1971.5948562321764, "pair_id": "python_v2_1fedb87cf57c2350561e8a65", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03609", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03609_eeaf509bab666b2036f34e80665c8088d959a8e042fcfbf5282df779854fc46f.jsonl.gz", "inputs": "reproduction/python/inputs/p03609.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03609_05c7cfa6f7e3edd14d82845ed4d2e91cd4b96ef2bf5eba445a2670d95ff174d0.jsonl.gz"}, "slow_code": "import numpy as np\n\nx, t = list(map(int, input().split()))\nprint((max(x - t, 0)))\n", "slow_code_sha256": "05c7cfa6f7e3edd14d82845ed4d2e91cd4b96ef2bf5eba445a2670d95ff174d0", "slow_id": "p03609_05c7cfa6f7e3edd14d82845ed4d2e91cd4b96ef2bf5eba445a2670d95ff174d0", "speedup": 1970.024380669226, "stratum": "8+", "within_pair_jaccard": 0.5625, "workload": {"case_count": 100, "description": "An upper hourglass bulb starts with X grams and loses one gram per second until empty. Report grams remaining after t seconds. Observed inputs: X=1..1000000000 (median 278882159.5); t=1..1000000000 (median 259647859.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 22, "median": 20.0, "min": 4}, "input_format": ["X t"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p03972_case_000", "p03972_case_001", "p03972_case_002", "p03972_case_003", "p03972_case_004", "p03972_case_005", "p03972_case_006", "p03972_case_007", "p03972_case_008", "p03972_case_009", "p03972_case_010", "p03972_case_011", "p03972_case_012", "p03972_case_013", "p03972_case_014", "p03972_case_015", "p03972_case_016", "p03972_case_017", "p03972_case_018", "p03972_case_019", "p03972_case_020", "p03972_case_021", "p03972_case_022", "p03972_case_023", "p03972_case_024", "p03972_case_025", "p03972_case_026", "p03972_case_027", "p03972_case_028", "p03972_case_029", "p03972_case_030", "p03972_case_031", "p03972_case_032", "p03972_case_033", "p03972_case_034", "p03972_case_035", "p03972_case_036", "p03972_case_037", "p03972_case_038", "p03972_case_039", "p03972_case_040", "p03972_case_041", "p03972_case_042", "p03972_case_043", "p03972_case_044", "p03972_case_045", "p03972_case_046", "p03972_case_047", "p03972_case_048", "p03972_case_049", "p03972_case_050", "p03972_case_051", "p03972_case_052", "p03972_case_053", "p03972_case_054", "p03972_case_055", "p03972_case_056", "p03972_case_057", "p03972_case_058", "p03972_case_059", "p03972_case_060", "p03972_case_061", "p03972_case_062", "p03972_case_063", "p03972_case_064", "p03972_case_065", "p03972_case_066", "p03972_case_067", "p03972_case_068", "p03972_case_069", "p03972_case_070", "p03972_case_071", "p03972_case_072", "p03972_case_073", "p03972_case_074", "p03972_case_075", "p03972_case_076", "p03972_case_077", "p03972_case_078", "p03972_case_079", "p03972_case_080", "p03972_case_081", "p03972_case_082", "p03972_case_083", "p03972_case_084", "p03972_case_085", "p03972_case_086", "p03972_case_087", "p03972_case_088", "p03972_case_089", "p03972_case_090", "p03972_case_091", "p03972_case_092", "p03972_case_093", "p03972_case_094", "p03972_case_095", "p03972_case_096", "p03972_case_097", "p03972_case_098", "p03972_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "w, h, *L = list(map(int, open(0).read().split()))\nP = L[:w]\nQ = [-qj for qj in L[w:]]\nx, y, ans = w, h, 0\nfor c in sorted(P + Q, key=abs):\n if c > 0:\n if x:\n ans += c * (y + 1)\n x -= 1\n else:\n if y:\n ans -= c * (x + 1)\n y -= 1\nprint(ans)\n", "fast_code_sha256": "e017ce0a742d01e8892c0abe2d44772f6ec0cff2cca270665ae25ecd66f25668", "fast_id": "p03972_e017ce0a742d01e8892c0abe2d44772f6ec0cff2cca270665ae25ecd66f25668", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "w, h, *L = list(map(int, open(0).read().split()))\nP = L[:w]\nQ = [-qj for qj in L[w:]]\nx, y, ans = w, h, 0\nfor c in sorted(P + Q, key=abs):\n if c > 0:\n if x:\n ans += c * (y + 1)\n x -= 1\n else:\n if y:\n ans -= c * (x + 1)\n y -= 1\nprint(ans)\n", "measured_fast_code_sha256": "e017ce0a742d01e8892c0abe2d44772f6ec0cff2cca270665ae25ecd66f25668", "measured_slow_code": "import sys\n\ninput = sys.stdin.readline\nW, H = list(map(int, input().split()))\nP = [int(eval(input())) for _ in range(W)] + [float(\"inf\")]\nQ = [int(eval(input())) for _ in range(H)] + [float(\"inf\")]\nP.sort(reverse=True)\nQ.sort(reverse=True)\nans = 0\nW += 1\nH += 1\nwhile True:\n if W == H == 1:\n break\n elif Q[-1] < P[-1] or (Q[-1] == P[-1] and W <= H):\n ans += W * Q[-1]\n H -= 1\n Q.pop()\n elif Q[-1] > P[-1] or (Q[-1] == P[-1] and W > H):\n ans += H * P[-1]\n W -= 1\n P.pop()\nprint(ans)\n", "measured_slow_code_sha256": "81be195cfe07dd89bca97eb211d66ec57b3cedb5d5441ba2264251fb7521b3ec", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 6.448195583151614, "pair_id": "python_v2_35c0cf7c6d4e77c09fb97be4", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03972", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03972_e017ce0a742d01e8892c0abe2d44772f6ec0cff2cca270665ae25ecd66f25668.jsonl.gz", "inputs": "reproduction/python/inputs/p03972.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03972_81be195cfe07dd89bca97eb211d66ec57b3cedb5d5441ba2264251fb7521b3ec.jsonl.gz"}, "slow_code": "import sys\n\ninput = sys.stdin.readline\nW, H = list(map(int, input().split()))\nP = [int(eval(input())) for _ in range(W)] + [float(\"inf\")]\nQ = [int(eval(input())) for _ in range(H)] + [float(\"inf\")]\nP.sort(reverse=True)\nQ.sort(reverse=True)\nans = 0\nW += 1\nH += 1\nwhile True:\n if W == H == 1:\n break\n elif Q[-1] < P[-1] or (Q[-1] == P[-1] and W <= H):\n ans += W * Q[-1]\n H -= 1\n Q.pop()\n elif Q[-1] > P[-1] or (Q[-1] == P[-1] and W > H):\n ans += H * P[-1]\n W -= 1\n P.pop()\nprint(ans)\n", "slow_code_sha256": "81be195cfe07dd89bca97eb211d66ec57b3cedb5d5441ba2264251fb7521b3ec", "slow_id": "p03972_81be195cfe07dd89bca97eb211d66ec57b3cedb5d5441ba2264251fb7521b3ec", "speedup": 6.286455599533707, "stratum": "4-8", "within_pair_jaccard": 0.2765957446808511, "workload": {"case_count": 100, "description": "Connect all vertices of a (W+1)-by-(H+1) rectangular grid at minimum total edge cost. Horizontal edge costs at column i are p_i; vertical edge costs at row j are q_j. Observed inputs: W=1..100000 (median 99999); H=1..100000 (median 99999); p_i=1..100000000; q_j=1..100000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 2000014, "median": 888948.0, "min": 8}, "input_format": ["W H\np_0\n...\np_(W-1)\nq_0\n...\nq_(H-1)"], "input_format_status": "source_input_section", "input_lines": {"max": 200001, "median": 100003.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200002, "median": 100004.0, "min": 4}}} -{"case_ids": ["p02554_case_000", "p02554_case_001", "p02554_case_002", "p02554_case_003", "p02554_case_004", "p02554_case_005", "p02554_case_006", "p02554_case_007", "p02554_case_008", "p02554_case_009", "p02554_case_010", "p02554_case_011", "p02554_case_012", "p02554_case_013", "p02554_case_014", "p02554_case_015", "p02554_case_016", "p02554_case_017", "p02554_case_018", "p02554_case_019", "p02554_case_020", "p02554_case_021", "p02554_case_022", "p02554_case_023", "p02554_case_024", "p02554_case_025", "p02554_case_026", "p02554_case_027", "p02554_case_028", "p02554_case_029", "p02554_case_030", "p02554_case_031", "p02554_case_032", "p02554_case_033", "p02554_case_034", "p02554_case_035", "p02554_case_036", "p02554_case_037", "p02554_case_038", "p02554_case_039", "p02554_case_040", "p02554_case_041", "p02554_case_042", "p02554_case_043", "p02554_case_044", "p02554_case_045", "p02554_case_046", "p02554_case_047", "p02554_case_048", "p02554_case_049", "p02554_case_050", "p02554_case_051", "p02554_case_052", "p02554_case_053", "p02554_case_054", "p02554_case_055", "p02554_case_056", "p02554_case_057", "p02554_case_058", "p02554_case_059", "p02554_case_060", "p02554_case_061", "p02554_case_062", "p02554_case_063", "p02554_case_064", "p02554_case_065", "p02554_case_066", "p02554_case_067", "p02554_case_068", "p02554_case_069", "p02554_case_070", "p02554_case_071", "p02554_case_072", "p02554_case_073", "p02554_case_074", "p02554_case_075", "p02554_case_076", "p02554_case_077", "p02554_case_078", "p02554_case_079", "p02554_case_080", "p02554_case_081", "p02554_case_082", "p02554_case_083", "p02554_case_084", "p02554_case_085", "p02554_case_086", "p02554_case_087", "p02554_case_088", "p02554_case_089", "p02554_case_090", "p02554_case_091", "p02554_case_092", "p02554_case_093", "p02554_case_094", "p02554_case_095", "p02554_case_096", "p02554_case_097", "p02554_case_098", "p02554_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "executable_AST_equal_except_explicit_explanatory_string_removal_and_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\nmod = 1000000007\nans = pow(10, n, mod)\nans -= pow(9, n, mod) * 2\nans += pow(8, n, mod)\nprint((ans % mod))\n", "fast_code_sha256": "b991360164b380206f7e775106727a40e8ea5eb62aa82568adc13770334dc75c", "fast_id": "p02554_b991360164b380206f7e775106727a40e8ea5eb62aa82568adc13770334dc75c", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\nmod = 1000000007\nans = pow(10, n, mod)\nans -= pow(9, n, mod) * 2\nans += pow(8, n, mod)\nprint((ans % mod))\n", "measured_fast_code_sha256": "b991360164b380206f7e775106727a40e8ea5eb62aa82568adc13770334dc75c", "measured_slow_code": "MOD = 10**9 + 7\n\n\ndef solve(n):\n \"\"\"\n 0: {}\n 1: {0}\n 2: {9}\n 3: {0,9}\n \"\"\"\n dp = [[0] * 4 for i in range(n + 1)]\n dp[0][0] = 1\n for i in range(n):\n dp[i + 1][3] = (10 * dp[i][3] + dp[i][2] + dp[i][1]) % MOD\n dp[i + 1][2] = (9 * dp[i][2] + dp[i][0]) % MOD\n dp[i + 1][1] = (9 * dp[i][1] + dp[i][0]) % MOD\n dp[i + 1][0] = (8 * dp[i][0]) % MOD\n return dp[n][3]\n\n\nn = int(eval(input()))\nprint((solve(n)))\n", "measured_slow_code_sha256": "1216aa013ca95268c8cea10ef1956fc82ecf53c33048dc021f31f4ae82487ba4", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 10015.677530470188, "pair_id": "python_v2_a22cbd0024ad5ec582e8c0fa", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02554", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02554_b991360164b380206f7e775106727a40e8ea5eb62aa82568adc13770334dc75c.jsonl.gz", "inputs": "reproduction/python/inputs/p02554.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02554_1216aa013ca95268c8cea10ef1956fc82ecf53c33048dc021f31f4ae82487ba4.jsonl.gz"}, "slow_code": "MOD = 10**9 + 7\n\n\ndef solve(n):\n dp = [[0] * 4 for i in range(n + 1)]\n dp[0][0] = 1\n for i in range(n):\n dp[i + 1][3] = (10 * dp[i][3] + dp[i][2] + dp[i][1]) % MOD\n dp[i + 1][2] = (9 * dp[i][2] + dp[i][0]) % MOD\n dp[i + 1][1] = (9 * dp[i][1] + dp[i][0]) % MOD\n dp[i + 1][0] = (8 * dp[i][0]) % MOD\n return dp[n][3]\n\n\nn = int(eval(input()))\nprint((solve(n)))\n", "slow_code_sha256": "d34cbcef17a1809eb9aaea9acac748f4f348edb348ac1a61f3b30198ffe07352", "slow_id": "p02554_1216aa013ca95268c8cea10ef1956fc82ecf53c33048dc021f31f4ae82487ba4", "speedup": 1907.5839591817096, "stratum": "8+", "within_pair_jaccard": 0.3333333333333333, "workload": {"case_count": 100, "description": "Count length-N sequences over digits 0..9 containing both 0 and 9, modulo 1000000007. Observed inputs: N=1..1000000 (median 299407).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 8, "median": 7.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p02709_case_000", "p02709_case_001", "p02709_case_002", "p02709_case_003", "p02709_case_004", "p02709_case_005", "p02709_case_006", "p02709_case_007", "p02709_case_008", "p02709_case_009", "p02709_case_010", "p02709_case_011", "p02709_case_012", "p02709_case_013", "p02709_case_014", "p02709_case_015", "p02709_case_016", "p02709_case_017", "p02709_case_018", "p02709_case_019", "p02709_case_020", "p02709_case_021", "p02709_case_022", "p02709_case_023", "p02709_case_024", "p02709_case_025", "p02709_case_026", "p02709_case_027", "p02709_case_028", "p02709_case_029", "p02709_case_030", "p02709_case_031", "p02709_case_032", "p02709_case_033", "p02709_case_034", "p02709_case_035", "p02709_case_036", "p02709_case_037", "p02709_case_038", "p02709_case_039", "p02709_case_040", "p02709_case_041", "p02709_case_042", "p02709_case_043", "p02709_case_044", "p02709_case_045", "p02709_case_046", "p02709_case_047", "p02709_case_048", "p02709_case_049", "p02709_case_050", "p02709_case_051", "p02709_case_052", "p02709_case_053", "p02709_case_054", "p02709_case_055", "p02709_case_056", "p02709_case_057", "p02709_case_058", "p02709_case_059", "p02709_case_060", "p02709_case_061", "p02709_case_062", "p02709_case_063", "p02709_case_064", "p02709_case_065", "p02709_case_066", "p02709_case_067", "p02709_case_068", "p02709_case_069", "p02709_case_070", "p02709_case_071", "p02709_case_072", "p02709_case_073", "p02709_case_074", "p02709_case_075", "p02709_case_076", "p02709_case_077", "p02709_case_078", "p02709_case_079", "p02709_case_080", "p02709_case_081", "p02709_case_082", "p02709_case_083", "p02709_case_084", "p02709_case_085", "p02709_case_086", "p02709_case_087", "p02709_case_088", "p02709_case_089", "p02709_case_090", "p02709_case_091", "p02709_case_092", "p02709_case_093", "p02709_case_094", "p02709_case_095", "p02709_case_096", "p02709_case_097", "p02709_case_098", "p02709_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\na = list(map(int, input().split()))\nassert len(a) == n\n\np = list(range(n))\np.sort(key=lambda i: a[i])\n\ndp = [0] * (n + 1)\nfor i in range(n):\n for j in range(n - i):\n dp[j] = max(\n dp[j] + a[p[i]] * abs(p[i] - (j + i)), dp[j + 1] + a[p[i]] * abs(p[i] - j)\n )\nprint((dp[0]))\n", "fast_code_sha256": "5adea7f44426da2d5422223ea2db6da159807860edd9cbf9d4b38f456b3990d7", "fast_id": "p02709_cb18f4ae978f2b3977ac57bb4b838eeb9c02a64e588cf9f5a467edcecea0f868", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "# E - Active Infants\nn = int(eval(input()))\na = list(map(int, input().split()))\nassert len(a) == n\n# 添字のリスト\np = list(range(n))\np.sort(key=lambda i: a[i])\n# dp[j] = 位置jから幅iの区間に小さい方からi個を配置したときの最大うれしさ\ndp = [0] * (n + 1)\nfor i in range(n):\n for j in range(n - i):\n dp[j] = max(\n dp[j] + a[p[i]] * abs(p[i] - (j + i)), dp[j + 1] + a[p[i]] * abs(p[i] - j)\n )\nprint((dp[0]))\n", "measured_fast_code_sha256": "cb18f4ae978f2b3977ac57bb4b838eeb9c02a64e588cf9f5a467edcecea0f868", "measured_slow_code": "import sys\nimport numpy as np\n\n\ndef f(n, a_):\n a = []\n for i, ai in enumerate(a_):\n a.append([1 + i, ai])\n a.sort(key=lambda x: x[1], reverse=True)\n dp = np.zeros(\n (n + 1, n + 1), np.int64\n ) # dp[i,j]:i人目までを配置し終えていて、そのうちj人を右に置いた時の最大値。j<=i\n dp[1, 1] = a[0][1] * (n - a[0][0])\n dp[1, 0] = a[0][1] * (a[0][0] - 1)\n for i in range(2, n + 1): # i人目の幼児。a[i-1]\n dp[i, 0] = dp[i - 1, 0] + a[i - 1][1] * abs(\n (a[i - 1][0] - 1 - (i - 1))\n ) # i人目を左にする。その時左に溜まっているのはi-1人\n dp[i, i] = dp[i - 1, i - 1] + a[i - 1][1] * abs(\n (n - a[i - 1][0] - (i - 1))\n ) # i人目を右にする。その時右に溜まっているのはi-1人\n # i人目を左に\n l = dp[i - 1, 1:i] + [\n a[i - 1][1] * abs((a[i - 1][0] - 1 - j)) for j in range(i - 2, -1, -1)\n ] # j:左に溜まっている人数\n # i人目を右に\n r = dp[i - 1, : i - 1] + [\n a[i - 1][1] * abs((n - a[i - 1][0] - j)) for j in range(i - 1)\n ] # j:右に溜まっている人数\n dp[i, 1:i] = np.maximum(l, r)\n return max(dp[n])\n\n\nif __name__ == \"__main__\":\n input = sys.stdin.readline\n n = int(eval(input()))\n a_ = list(map(int, input().split()))\n print((f(n, a_)))\n", "measured_slow_code_sha256": "3d838e07742b6038959605af2d3df1f36b7399126fc563b9a2c8f3bce236aaea", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 0.9649727836743278, "pair_id": "python_v2_5bae71f4ed26e491ebf498e2", "per_case_slow_code_faster_fraction": 0.55, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02709", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02709_cb18f4ae978f2b3977ac57bb4b838eeb9c02a64e588cf9f5a467edcecea0f868.jsonl.gz", "inputs": "reproduction/python/inputs/p02709.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02709_3d838e07742b6038959605af2d3df1f36b7399126fc563b9a2c8f3bce236aaea.jsonl.gz"}, "slow_code": "import sys\nimport numpy as np\n\n\ndef f(n, a_):\n a = []\n for i, ai in enumerate(a_):\n a.append([1 + i, ai])\n a.sort(key=lambda x: x[1], reverse=True)\n dp = np.zeros((n + 1, n + 1), np.int64)\n dp[1, 1] = a[0][1] * (n - a[0][0])\n dp[1, 0] = a[0][1] * (a[0][0] - 1)\n for i in range(2, n + 1):\n dp[i, 0] = dp[i - 1, 0] + a[i - 1][1] * abs((a[i - 1][0] - 1 - (i - 1)))\n dp[i, i] = dp[i - 1, i - 1] + a[i - 1][1] * abs((n - a[i - 1][0] - (i - 1)))\n\n l = dp[i - 1, 1:i] + [\n a[i - 1][1] * abs((a[i - 1][0] - 1 - j)) for j in range(i - 2, -1, -1)\n ]\n\n r = dp[i - 1, : i - 1] + [\n a[i - 1][1] * abs((n - a[i - 1][0] - j)) for j in range(i - 1)\n ]\n dp[i, 1:i] = np.maximum(l, r)\n return max(dp[n])\n\n\nif __name__ == \"__main__\":\n input = sys.stdin.readline\n n = int(eval(input()))\n a_ = list(map(int, input().split()))\n print((f(n, a_)))\n", "slow_code_sha256": "aa98af4784f39634c1b1369b22ff40f05d4ea9461af1aad5cd1db169f1d8c6f4", "slow_id": "p02709_3d838e07742b6038959605af2d3df1f36b7399126fc563b9a2c8f3bce236aaea", "speedup": 10.28839311876437, "stratum": "8+", "within_pair_jaccard": 0.43137254901960786, "workload": {"case_count": 100, "description": "Rearrange N children arbitrarily. Moving the child originally at position x to position y earns A_x*|x-y| happiness. Maximize total happiness. Observed inputs: N=2..2000 (median 1000); A_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 22005, "median": 9885.5, "min": 6}, "input_format": ["N\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2001, "median": 1001.0, "min": 3}}} -{"case_ids": ["p03240_case_000", "p03240_case_001", "p03240_case_002", "p03240_case_003", "p03240_case_004", "p03240_case_005", "p03240_case_006", "p03240_case_007", "p03240_case_008", "p03240_case_009", "p03240_case_010", "p03240_case_011", "p03240_case_012", "p03240_case_013", "p03240_case_014", "p03240_case_015", "p03240_case_016", "p03240_case_017", "p03240_case_018", "p03240_case_019", "p03240_case_020", "p03240_case_021", "p03240_case_022", "p03240_case_023", "p03240_case_024", "p03240_case_025", "p03240_case_026", "p03240_case_027", "p03240_case_028", "p03240_case_029", "p03240_case_030", "p03240_case_031", "p03240_case_032", "p03240_case_033", "p03240_case_034", "p03240_case_035", "p03240_case_036", "p03240_case_037", "p03240_case_038", "p03240_case_039", "p03240_case_040", "p03240_case_041", "p03240_case_042", "p03240_case_043", "p03240_case_044", "p03240_case_045", "p03240_case_046", "p03240_case_047", "p03240_case_048", "p03240_case_049", "p03240_case_050", "p03240_case_051", "p03240_case_052", "p03240_case_053", "p03240_case_054", "p03240_case_055", "p03240_case_056", "p03240_case_057", "p03240_case_058", "p03240_case_059", "p03240_case_060", "p03240_case_061", "p03240_case_062", "p03240_case_063", "p03240_case_064", "p03240_case_065", "p03240_case_066", "p03240_case_067", "p03240_case_068", "p03240_case_069", "p03240_case_070", "p03240_case_071", "p03240_case_072", "p03240_case_073", "p03240_case_074", "p03240_case_075", "p03240_case_076", "p03240_case_077", "p03240_case_078", "p03240_case_079", "p03240_case_080", "p03240_case_081", "p03240_case_082", "p03240_case_083", "p03240_case_084", "p03240_case_085", "p03240_case_086", "p03240_case_087", "p03240_case_088", "p03240_case_089", "p03240_case_090", "p03240_case_091", "p03240_case_092", "p03240_case_093", "p03240_case_094", "p03240_case_095", "p03240_case_096", "p03240_case_097", "p03240_case_098", "p03240_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(input())\nXYH = []\nfor _ in range(n):\n x, y, h = map(int, input().split())\n if h != 0:\n XYH.append([x, y, h])\nflag = False\nans = XYH[0]\nfor i in range(101):\n for j in range(101):\n tempH = abs(XYH[0][0] - i) + abs(XYH[0][1] - j) + XYH[0][2]\n for x, y, h in XYH[1:]:\n if abs(x - i) + abs(y - j) + h != tempH:\n flag = False\n break\n else:\n flag = True\n if flag:\n ans = [i, j, tempH]\n break\n if flag:\n break\nprint(*ans, sep=\" \")\n", "fast_code_sha256": "7d152829fabdaf68d6940ede064ea95c3e04f687d89b63c8893ae52fbdbff32d", "fast_id": "p03240_7d152829fabdaf68d6940ede064ea95c3e04f687d89b63c8893ae52fbdbff32d", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(input())\nXYH = []\nfor _ in range(n):\n x, y, h = map(int, input().split())\n if h != 0:\n XYH.append([x, y, h])\nflag = False\nans = XYH[0]\nfor i in range(101):\n for j in range(101):\n tempH = abs(XYH[0][0] - i) + abs(XYH[0][1] - j) + XYH[0][2]\n for x, y, h in XYH[1:]:\n if abs(x - i) + abs(y - j) + h != tempH:\n flag = False\n break\n else:\n flag = True\n if flag:\n ans = [i, j, tempH]\n break\n if flag:\n break\nprint(*ans, sep=\" \")\n", "measured_fast_code_sha256": "7d152829fabdaf68d6940ede064ea95c3e04f687d89b63c8893ae52fbdbff32d", "measured_slow_code": "n = int(eval(input()))\narr = []\nfor i in range(n):\n x, y, h = list(map(int, input().split()))\n arr.append([x, y, h])\nfor i in range(101):\n for j in range(101):\n for k in range(n):\n if arr[k][2] > 0:\n len1 = abs(arr[k][0] - i) + abs(arr[k][1] - j)\n ch = len1 + arr[k][2]\n break\n else:\n continue\n for k in range(n):\n lenk = abs(arr[k][0] - i) + abs(arr[k][1] - j)\n if max(ch - lenk, 0) == arr[k][2]:\n if k == n - 1:\n print((\"{} {} {}\".format(i, j, ch)))\n else:\n continue\n else:\n break\n", "measured_slow_code_sha256": "4c40bf3895e45939a448db69db467581eaa74fa9efe48781d2fcd0f15aedb4db", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.8179124799784336, "pair_id": "python_v2_c1ac782466cadf6082f81e3a", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03240", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03240_7d152829fabdaf68d6940ede064ea95c3e04f687d89b63c8893ae52fbdbff32d.jsonl.gz", "inputs": "reproduction/python/inputs/p03240.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03240_4c40bf3895e45939a448db69db467581eaa74fa9efe48781d2fcd0f15aedb4db.jsonl.gz"}, "slow_code": "n = int(eval(input()))\narr = []\nfor i in range(n):\n x, y, h = list(map(int, input().split()))\n arr.append([x, y, h])\nfor i in range(101):\n for j in range(101):\n for k in range(n):\n if arr[k][2] > 0:\n len1 = abs(arr[k][0] - i) + abs(arr[k][1] - j)\n ch = len1 + arr[k][2]\n break\n else:\n continue\n for k in range(n):\n lenk = abs(arr[k][0] - i) + abs(arr[k][1] - j)\n if max(ch - lenk, 0) == arr[k][2]:\n if k == n - 1:\n print((\"{} {} {}\".format(i, j, ch)))\n else:\n continue\n else:\n break\n", "slow_code_sha256": "4c40bf3895e45939a448db69db467581eaa74fa9efe48781d2fcd0f15aedb4db", "slow_id": "p03240_4c40bf3895e45939a448db69db467581eaa74fa9efe48781d2fcd0f15aedb4db", "speedup": 5.122474303774008, "stratum": "4-8", "within_pair_jaccard": 0.5609756097560976, "workload": {"case_count": 100, "description": "Recover unique integer center (C_X,C_Y) in 0..100 and height H>=1 from N distinct observations (x_i,y_i,h_i) satisfying h_i=max(H-|x_i-C_X|-|y_i-C_Y|,0). Observed inputs: N=3..100 (median 50); x_i=0..100; y_i=0..100; h_i=1299707..999999997.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1594, "median": 798.0, "min": 49}, "input_format": ["N\nx_1 y_1 h_1\n...\nx_N y_N h_N"], "input_format_status": "source_input_section", "input_lines": {"max": 101, "median": 51.0, "min": 4}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 301, "median": 151.0, "min": 10}}} -{"case_ids": ["p03170_case_000", "p03170_case_001", "p03170_case_002", "p03170_case_003", "p03170_case_004", "p03170_case_005", "p03170_case_006", "p03170_case_007", "p03170_case_008", "p03170_case_009", "p03170_case_010", "p03170_case_011", "p03170_case_012", "p03170_case_013", "p03170_case_014", "p03170_case_015", "p03170_case_016", "p03170_case_017", "p03170_case_018", "p03170_case_019", "p03170_case_020", "p03170_case_021", "p03170_case_022", "p03170_case_023", "p03170_case_024", "p03170_case_025", "p03170_case_026", "p03170_case_027", "p03170_case_028", "p03170_case_029", "p03170_case_030", "p03170_case_031", "p03170_case_032", "p03170_case_033", "p03170_case_034", "p03170_case_035", "p03170_case_036", "p03170_case_037", "p03170_case_038", "p03170_case_039", "p03170_case_040", "p03170_case_041", "p03170_case_042", "p03170_case_043", "p03170_case_044", "p03170_case_045", "p03170_case_046", "p03170_case_047", "p03170_case_048", "p03170_case_049", "p03170_case_050", "p03170_case_051", "p03170_case_052", "p03170_case_053", "p03170_case_054", "p03170_case_055", "p03170_case_056", "p03170_case_057", "p03170_case_058", "p03170_case_059", "p03170_case_060", "p03170_case_061", "p03170_case_062", "p03170_case_063", "p03170_case_064", "p03170_case_065", "p03170_case_066", "p03170_case_067", "p03170_case_068", "p03170_case_069", "p03170_case_070", "p03170_case_071", "p03170_case_072", "p03170_case_073", "p03170_case_074", "p03170_case_075", "p03170_case_076", "p03170_case_077", "p03170_case_078", "p03170_case_079", "p03170_case_080", "p03170_case_081", "p03170_case_082", "p03170_case_083", "p03170_case_084", "p03170_case_085", "p03170_case_086", "p03170_case_087", "p03170_case_088", "p03170_case_089", "p03170_case_090", "p03170_case_091", "p03170_case_092", "p03170_case_093", "p03170_case_094", "p03170_case_095", "p03170_case_096", "p03170_case_097", "p03170_case_098", "p03170_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "executable_AST_equal_except_explicit_explanatory_string_removal_and_all_frozen_inputs_checker_pass", "fast_code": "n, k = list(map(int, input().split()))\na_s = list(map(int, input().split()))\ndp = [\"Second\"] * (k + 1)\nfor i in range(k + 1):\n if dp[i] == \"Second\":\n for a in a_s:\n ii = i + a\n if ii <= k:\n dp[ii] = \"First\"\nprint((dp[-1]))\n", "fast_code_sha256": "4a41a073e30cf40ff9483d06ae31fc65933cc99e121807f0155c63537dd692fb", "fast_id": "p03170_4a41a073e30cf40ff9483d06ae31fc65933cc99e121807f0155c63537dd692fb", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n, k = list(map(int, input().split()))\na_s = list(map(int, input().split()))\ndp = [\"Second\"] * (k + 1)\nfor i in range(k + 1):\n if dp[i] == \"Second\":\n for a in a_s:\n ii = i + a\n if ii <= k:\n dp[ii] = \"First\"\nprint((dp[-1]))\n", "measured_fast_code_sha256": "4a41a073e30cf40ff9483d06ae31fc65933cc99e121807f0155c63537dd692fb", "measured_slow_code": "\"\"\"\nAtCoder Educational DP Contest\nhttps://atcoder.jp/contests/dp/tasks/dp_k\nK - Stones\n\"\"\"\nimport collections\n\n\ndef solve(xs):\n dp = collections.defaultdict(bool)\n dp[0] = False\n for j in range(1, K + 1):\n iterable = ((j >= x) and (not dp[j - x]) for x in xs)\n dp[j] = any(iterable)\n return dp[K]\n\n\nN, K = list(map(int, input().split()))\nchoices = collections.Counter([float(s) for s in input().split()])\nassert len(choices) == N\nres = solve(choices)\nprint((\"First\" if res else \"Second\"))\n", "measured_slow_code_sha256": "44ab44f9e0708ecce80e5a0c02da99cd45ce3cb07c5e61f81167622dfdca55b6", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 5.315877699046185, "pair_id": "python_v2_861d7726b94ba6d9ce702637", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03170", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03170_4a41a073e30cf40ff9483d06ae31fc65933cc99e121807f0155c63537dd692fb.jsonl.gz", "inputs": "reproduction/python/inputs/p03170.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03170_44ab44f9e0708ecce80e5a0c02da99cd45ce3cb07c5e61f81167622dfdca55b6.jsonl.gz"}, "slow_code": "import collections\n\n\ndef solve(xs):\n dp = collections.defaultdict(bool)\n dp[0] = False\n for j in range(1, K + 1):\n iterable = ((j >= x) and (not dp[j - x]) for x in xs)\n dp[j] = any(iterable)\n return dp[K]\n\n\nN, K = list(map(int, input().split()))\nchoices = collections.Counter([float(s) for s in input().split()])\nassert len(choices) == N\nres = solve(choices)\nprint((\"First\" if res else \"Second\"))\n", "slow_code_sha256": "4ece6832a9a333f3309aed083539ed744829fb449cb2b735a264c1214513b29f", "slow_id": "p03170_44ab44f9e0708ecce80e5a0c02da99cd45ce3cb07c5e61f81167622dfdca55b6", "speedup": 4.856416179082469, "stratum": "4-8", "within_pair_jaccard": 0.2692307692307692, "workload": {"case_count": 100, "description": "Two optimal players alternate removing a permitted number of stones from a pile initially of size K. Allowed removals a_i form a strictly increasing set of N integers. The first player unable to move loses; determine the winner. Observed inputs: N=1..100 (median 100); K=1..100000 (median 100000); a_i=1..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 610, "median": 597.5, "min": 6}, "input_format": ["N K\na_1 ... a_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 102, "median": 102.0, "min": 3}}} -{"case_ids": ["p03713_case_000", "p03713_case_001", "p03713_case_002", "p03713_case_003", "p03713_case_004", "p03713_case_005", "p03713_case_006", "p03713_case_007", "p03713_case_008", "p03713_case_009", "p03713_case_010", "p03713_case_011", "p03713_case_012", "p03713_case_013", "p03713_case_014", "p03713_case_015", "p03713_case_016", "p03713_case_017", "p03713_case_018", "p03713_case_019", "p03713_case_020", "p03713_case_021", "p03713_case_022", "p03713_case_023", "p03713_case_024", "p03713_case_025", "p03713_case_026", "p03713_case_027", "p03713_case_028", "p03713_case_029", "p03713_case_030", "p03713_case_031", "p03713_case_032", "p03713_case_033", "p03713_case_034", "p03713_case_035", "p03713_case_036", "p03713_case_037", "p03713_case_038", "p03713_case_039", "p03713_case_040", "p03713_case_041", "p03713_case_042", "p03713_case_043", "p03713_case_044", "p03713_case_045", "p03713_case_046", "p03713_case_047", "p03713_case_048", "p03713_case_049", "p03713_case_050", "p03713_case_051", "p03713_case_052", "p03713_case_053", "p03713_case_054", "p03713_case_055", "p03713_case_056", "p03713_case_057", "p03713_case_058", "p03713_case_059", "p03713_case_060", "p03713_case_061", "p03713_case_062", "p03713_case_063", "p03713_case_064", "p03713_case_065", "p03713_case_066", "p03713_case_067", "p03713_case_068", "p03713_case_069", "p03713_case_070", "p03713_case_071", "p03713_case_072", "p03713_case_073", "p03713_case_074", "p03713_case_075", "p03713_case_076", "p03713_case_077", "p03713_case_078", "p03713_case_079", "p03713_case_080", "p03713_case_081", "p03713_case_082", "p03713_case_083", "p03713_case_084", "p03713_case_085", "p03713_case_086", "p03713_case_087", "p03713_case_088", "p03713_case_089", "p03713_case_090", "p03713_case_091", "p03713_case_092", "p03713_case_093", "p03713_case_094", "p03713_case_095", "p03713_case_096", "p03713_case_097", "p03713_case_098", "p03713_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "H, W = list(map(int, input().split()))\nif H % 3 == 0 or W % 3 == 0:\n print((0))\n exit()\nans = H * W\n\nfor h in range(1, H + 1):\n a = h * W\n\n b = ((H - h) // 2) * W\n c = H * W - a - b\n ans = min(ans, max([a, b, c]) - min([a, b, c]))\n\n b = (H - h) * (W // 2)\n c = H * W - a - b\n ans = min(ans, max([a, b, c]) - min([a, b, c]))\n\nfor w in range(1, W + 1):\n a = H * w\n\n b = (W - w) * (H // 2)\n c = H * W - a - b\n ans = min(ans, max([a, b, c]) - min([a, b, c]))\n\n b = ((W - w) // 2) * H\n c = H * W - a - b\n ans = min(ans, max([a, b, c]) - min([a, b, c]))\nprint(ans)\n", "fast_code_sha256": "180cfaeb3024b07a03347373b5a4375a14383a3c63d95b5ddf25a877245fc491", "fast_id": "p03713_230026fc092eb81d1f28ac162b7d87de026832e26c1b9ee04d7fe6109fd46cfb", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "H, W = list(map(int, input().split()))\nif H % 3 == 0 or W % 3 == 0:\n print((0))\n exit()\nans = H * W\n# 高さを変えて調べる\nfor h in range(1, H + 1):\n a = h * W\n # 残りを高さで割る場合\n b = ((H - h) // 2) * W\n c = H * W - a - b\n ans = min(ans, max([a, b, c]) - min([a, b, c]))\n # 残りを幅で割る場合\n b = (H - h) * (W // 2)\n c = H * W - a - b\n ans = min(ans, max([a, b, c]) - min([a, b, c]))\n# 幅を変えて調べる\nfor w in range(1, W + 1):\n a = H * w\n # 残りを高さで割る場合\n b = (W - w) * (H // 2)\n c = H * W - a - b\n ans = min(ans, max([a, b, c]) - min([a, b, c]))\n # 残りを幅で割る場合\n b = ((W - w) // 2) * H\n c = H * W - a - b\n ans = min(ans, max([a, b, c]) - min([a, b, c]))\nprint(ans)\n", "measured_fast_code_sha256": "230026fc092eb81d1f28ac162b7d87de026832e26c1b9ee04d7fe6109fd46cfb", "measured_slow_code": "H, W = list(map(int, input().split()))\nresult = []\nfor h in range(1, H):\n Sa = W * h\n remain = H - h\n h2 = (remain + 1) // 2\n Sb1 = W * h2\n Sc1 = W * (remain - h2)\n result.append(max(Sa, Sb1, Sc1) - min(Sa, Sb1, Sc1))\n w = (W + 1) // 2\n Sb2 = w * remain\n Sc2 = (W - w) * remain\n result.append(max(Sa, Sb2, Sc2) - min(Sa, Sb2, Sc2))\nfor w in range(1, W):\n Sa = H * w\n remain = W - w\n w3 = (remain + 1) // 2\n Sb1 = H * w3\n Sc1 = H * (remain - w3)\n result.append(max(Sa, Sb1, Sc1) - min(Sa, Sb1, Sc1))\n h = (H + 1) // 2\n Sb2 = h * remain\n Sc2 = (H - h) * remain\n result.append(max(Sa, Sb2, Sc2) - min(Sa, Sb2, Sc2))\nprint((min(result)))\n", "measured_slow_code_sha256": "73da165f272b36503f16ea2a87a7332ca7bf2fb25485361d01c353204b543399", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 0.8519324820754977, "pair_id": "python_v2_9c6a0162a76369242dabd5a3", "per_case_slow_code_faster_fraction": 0.68, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03713", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03713_230026fc092eb81d1f28ac162b7d87de026832e26c1b9ee04d7fe6109fd46cfb.jsonl.gz", "inputs": "reproduction/python/inputs/p03713.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03713_73da165f272b36503f16ea2a87a7332ca7bf2fb25485361d01c353204b543399.jsonl.gz"}, "slow_code": "H, W = list(map(int, input().split()))\nresult = []\nfor h in range(1, H):\n Sa = W * h\n remain = H - h\n h2 = (remain + 1) // 2\n Sb1 = W * h2\n Sc1 = W * (remain - h2)\n result.append(max(Sa, Sb1, Sc1) - min(Sa, Sb1, Sc1))\n w = (W + 1) // 2\n Sb2 = w * remain\n Sc2 = (W - w) * remain\n result.append(max(Sa, Sb2, Sc2) - min(Sa, Sb2, Sc2))\nfor w in range(1, W):\n Sa = H * w\n remain = W - w\n w3 = (remain + 1) // 2\n Sb1 = H * w3\n Sc1 = H * (remain - w3)\n result.append(max(Sa, Sb1, Sc1) - min(Sa, Sb1, Sc1))\n h = (H + 1) // 2\n Sb2 = h * remain\n Sc2 = (H - h) * remain\n result.append(max(Sa, Sb2, Sc2) - min(Sa, Sb2, Sc2))\nprint((min(result)))\n", "slow_code_sha256": "73da165f272b36503f16ea2a87a7332ca7bf2fb25485361d01c353204b543399", "slow_id": "p03713_73da165f272b36503f16ea2a87a7332ca7bf2fb25485361d01c353204b543399", "speedup": 7.783792710901947, "stratum": "4-8", "within_pair_jaccard": 0.45714285714285713, "workload": {"case_count": 100, "description": "Divide an H-by-W grid-aligned rectangular bar into exactly three nonempty rectangular pieces along cell borders. Minimize the difference between the largest and smallest areas. The bar is implicit, not listed cell by cell. Observed inputs: H=2..100000 (median 54760.5); W=2..100000 (median 40128.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 14, "median": 11.5, "min": 4}, "input_format": ["H W"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p02695_case_000", "p02695_case_001", "p02695_case_002", "p02695_case_003", "p02695_case_004", "p02695_case_005", "p02695_case_006", "p02695_case_007", "p02695_case_008", "p02695_case_009", "p02695_case_010", "p02695_case_011", "p02695_case_012", "p02695_case_013", "p02695_case_014", "p02695_case_015", "p02695_case_016", "p02695_case_017", "p02695_case_018", "p02695_case_019", "p02695_case_020", "p02695_case_021", "p02695_case_022", "p02695_case_023", "p02695_case_024", "p02695_case_025", "p02695_case_026", "p02695_case_027", "p02695_case_028", "p02695_case_029", "p02695_case_030", "p02695_case_031", "p02695_case_032", "p02695_case_033", "p02695_case_034", "p02695_case_035", "p02695_case_036", "p02695_case_037", "p02695_case_038", "p02695_case_039", "p02695_case_040", "p02695_case_041", "p02695_case_042", "p02695_case_043", "p02695_case_044", "p02695_case_045", "p02695_case_046", "p02695_case_047", "p02695_case_048", "p02695_case_049", "p02695_case_050", "p02695_case_051", "p02695_case_052", "p02695_case_053", "p02695_case_054", "p02695_case_055", "p02695_case_056", "p02695_case_057", "p02695_case_058", "p02695_case_059", "p02695_case_060", "p02695_case_061", "p02695_case_062", "p02695_case_063", "p02695_case_064", "p02695_case_065", "p02695_case_066", "p02695_case_067", "p02695_case_068", "p02695_case_069", "p02695_case_070", "p02695_case_071", "p02695_case_072", "p02695_case_073", "p02695_case_074", "p02695_case_075", "p02695_case_076", "p02695_case_077", "p02695_case_078", "p02695_case_079", "p02695_case_080", "p02695_case_081", "p02695_case_082", "p02695_case_083", "p02695_case_084", "p02695_case_085", "p02695_case_086", "p02695_case_087", "p02695_case_088", "p02695_case_089", "p02695_case_090", "p02695_case_091", "p02695_case_092", "p02695_case_093", "p02695_case_094", "p02695_case_095", "p02695_case_096", "p02695_case_097", "p02695_case_098", "p02695_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N, M, Q = list(map(int, input().split()))\nabcd = []\nfor _ in range(Q):\n tmp = list(map(int, input().split()))\n abcd.append(tmp)\n\nimport itertools as it\n\nA_candidate = list(it.combinations_with_replacement(list(range(1, M + 1)), N))\nans = 0\nfor i in range(len(A_candidate)):\n tmp = 0\n for j in range(Q):\n ABCD = abcd[j]\n if A_candidate[i][ABCD[1] - 1] - A_candidate[i][ABCD[0] - 1] == ABCD[2]:\n tmp += ABCD[3]\n if ans < tmp:\n ans = tmp\nprint(ans)\n", "fast_code_sha256": "810f5a3a95db8b1e491bc2c02f2b6a12591e9eff6386bf0ebcf735463504df89", "fast_id": "p02695_92881091f8074f20c8701ec39960ab6206e6deb404c33d9db940b597f3751332", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "# 標準入力\nN, M, Q = list(map(int, input().split()))\nabcd = []\nfor _ in range(Q):\n tmp = list(map(int, input().split()))\n abcd.append(tmp)\n# 実装\nimport itertools as it\n\nA_candidate = list(it.combinations_with_replacement(list(range(1, M + 1)), N))\nans = 0\nfor i in range(len(A_candidate)):\n tmp = 0\n for j in range(Q):\n ABCD = abcd[j]\n if A_candidate[i][ABCD[1] - 1] - A_candidate[i][ABCD[0] - 1] == ABCD[2]:\n tmp += ABCD[3]\n if ans < tmp:\n ans = tmp\nprint(ans)\n", "measured_fast_code_sha256": "92881091f8074f20c8701ec39960ab6206e6deb404c33d9db940b597f3751332", "measured_slow_code": "n, m, q = list(map(int, input().split()))\nl = []\nfor i in range(q):\n l1, l2, l3, l4 = list(map(int, input().split()))\n l.append([l1, l2, l3, l4])\nB = []\nfor a in range(1, m + 1):\n for b in range(a, m + 1):\n for c in range(b, m + 1):\n for d in range(c, m + 1):\n for e in range(d, m + 1):\n for f in range(e, m + 1):\n for g in range(f, m + 1):\n for h in range(g, m + 1):\n for i in range(h, m + 1):\n for j in range(i, m + 1):\n L = [a, b, c, d, e, f, g, h, i, j]\n A = []\n for I in range(n):\n A.append(L[I])\n C = 0\n for k in range(q):\n if (\n A[l[k][1] - 1] - A[l[k][0] - 1]\n == l[k][2]\n ):\n C += l[k][3]\n B.append(C)\nprint((max(B)))\n", "measured_slow_code_sha256": "4876c20eabffbc9ea2c633c2d996da20261178a9a9451926be7fe13405bb8582", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.7823266593554083, "pair_id": "python_v2_33db402129ff3b39bd53406e", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02695", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02695_92881091f8074f20c8701ec39960ab6206e6deb404c33d9db940b597f3751332.jsonl.gz", "inputs": "reproduction/python/inputs/p02695.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02695_4876c20eabffbc9ea2c633c2d996da20261178a9a9451926be7fe13405bb8582.jsonl.gz"}, "slow_code": "n, m, q = list(map(int, input().split()))\nl = []\nfor i in range(q):\n l1, l2, l3, l4 = list(map(int, input().split()))\n l.append([l1, l2, l3, l4])\nB = []\nfor a in range(1, m + 1):\n for b in range(a, m + 1):\n for c in range(b, m + 1):\n for d in range(c, m + 1):\n for e in range(d, m + 1):\n for f in range(e, m + 1):\n for g in range(f, m + 1):\n for h in range(g, m + 1):\n for i in range(h, m + 1):\n for j in range(i, m + 1):\n L = [a, b, c, d, e, f, g, h, i, j]\n A = []\n for I in range(n):\n A.append(L[I])\n C = 0\n for k in range(q):\n if (\n A[l[k][1] - 1] - A[l[k][0] - 1]\n == l[k][2]\n ):\n C += l[k][3]\n B.append(C)\nprint((max(B)))\n", "slow_code_sha256": "4876c20eabffbc9ea2c633c2d996da20261178a9a9451926be7fe13405bb8582", "slow_id": "p02695_4876c20eabffbc9ea2c633c2d996da20261178a9a9451926be7fe13405bb8582", "speedup": 5.710327604154938, "stratum": "4-8", "within_pair_jaccard": 0.3090909090909091, "workload": {"case_count": 100, "description": "Choose integers 1<=A_1<=...<=A_N<=M to maximize score. Each of Q distinct conditions (a_i,b_i,c_i) awards d_i when A_b_i-A_a_i=c_i. Observed inputs: N=2..10 (median 5); M=1..10 (median 5); Q=1..50 (median 10); c_i=0..9; d_i=1..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 676, "median": 132.0, "min": 14}, "input_format": ["N M Q\na_1 b_1 c_1 d_1\n...\na_Q b_Q c_Q d_Q"], "input_format_status": "source_input_section", "input_lines": {"max": 51, "median": 11.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 203, "median": 43.0, "min": 7}}} -{"case_ids": ["p03371_case_000", "p03371_case_001", "p03371_case_002", "p03371_case_003", "p03371_case_004", "p03371_case_005", "p03371_case_006", "p03371_case_007", "p03371_case_008", "p03371_case_009", "p03371_case_010", "p03371_case_011", "p03371_case_012", "p03371_case_013", "p03371_case_014", "p03371_case_015", "p03371_case_016", "p03371_case_017", "p03371_case_018", "p03371_case_019", "p03371_case_020", "p03371_case_021", "p03371_case_022", "p03371_case_023", "p03371_case_024", "p03371_case_025", "p03371_case_026", "p03371_case_027", "p03371_case_028", "p03371_case_029", "p03371_case_030", "p03371_case_031", "p03371_case_032", "p03371_case_033", "p03371_case_034", "p03371_case_035", "p03371_case_036", "p03371_case_037", "p03371_case_038", "p03371_case_039", "p03371_case_040", "p03371_case_041", "p03371_case_042", "p03371_case_043", "p03371_case_044", "p03371_case_045", "p03371_case_046", "p03371_case_047", "p03371_case_048", "p03371_case_049", "p03371_case_050", "p03371_case_051", "p03371_case_052", "p03371_case_053", "p03371_case_054", "p03371_case_055", "p03371_case_056", "p03371_case_057", "p03371_case_058", "p03371_case_059", "p03371_case_060", "p03371_case_061", "p03371_case_062", "p03371_case_063", "p03371_case_064", "p03371_case_065", "p03371_case_066", "p03371_case_067", "p03371_case_068", "p03371_case_069", "p03371_case_070", "p03371_case_071", "p03371_case_072", "p03371_case_073", "p03371_case_074", "p03371_case_075", "p03371_case_076", "p03371_case_077", "p03371_case_078", "p03371_case_079", "p03371_case_080", "p03371_case_081", "p03371_case_082", "p03371_case_083", "p03371_case_084", "p03371_case_085", "p03371_case_086", "p03371_case_087", "p03371_case_088", "p03371_case_089", "p03371_case_090", "p03371_case_091", "p03371_case_092", "p03371_case_093", "p03371_case_094", "p03371_case_095", "p03371_case_096", "p03371_case_097", "p03371_case_098", "p03371_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "A, B, C, X, Y = list(map(int, input().split()))\nres = min(A + B, 2 * C) * min(X, Y)\nif X >= Y:\n res += min(A, 2 * C) * (X - Y)\nelse:\n res += min(B, 2 * C) * (Y - X)\nprint(res)\n", "fast_code_sha256": "b2844db904ae363c109faa98e43d593480cefef66631fa02bb4a3968abe932fb", "fast_id": "p03371_b2844db904ae363c109faa98e43d593480cefef66631fa02bb4a3968abe932fb", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "A, B, C, X, Y = list(map(int, input().split()))\nres = min(A + B, 2 * C) * min(X, Y)\nif X >= Y:\n res += min(A, 2 * C) * (X - Y)\nelse:\n res += min(B, 2 * C) * (Y - X)\nprint(res)\n", "measured_fast_code_sha256": "b2844db904ae363c109faa98e43d593480cefef66631fa02bb4a3968abe932fb", "measured_slow_code": "a, b, c, x, y = list(map(int, input().split()))\nmi = 10**10\nfor i in range(10**6):\n cost = c * 2 * i + a * max((x - i), 0) + b * max((y - i), 0)\n if cost < mi:\n mi = cost\nprint(mi)\n", "measured_slow_code_sha256": "d423368c3404af0d794647ac92b41960ae5bb9ea8edef19ff71fb40275e2bb52", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 14987.575332828896, "pair_id": "python_v2_376d280458487abb32772045", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03371", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03371_b2844db904ae363c109faa98e43d593480cefef66631fa02bb4a3968abe932fb.jsonl.gz", "inputs": "reproduction/python/inputs/p03371.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03371_d423368c3404af0d794647ac92b41960ae5bb9ea8edef19ff71fb40275e2bb52.jsonl.gz"}, "slow_code": "a, b, c, x, y = list(map(int, input().split()))\nmi = 10**10\nfor i in range(10**6):\n cost = c * 2 * i + a * max((x - i), 0) + b * max((y - i), 0)\n if cost < mi:\n mi = cost\nprint(mi)\n", "slow_code_sha256": "d423368c3404af0d794647ac92b41960ae5bb9ea8edef19ff71fb40275e2bb52", "slow_id": "p03371_d423368c3404af0d794647ac92b41960ae5bb9ea8edef19ff71fb40275e2bb52", "speedup": 14941.859372021483, "stratum": "8+", "within_pair_jaccard": 0.25806451612903225, "workload": {"case_count": 100, "description": "Whole pizzas of types A and B cost A and B; a mixed half-A/half-B pizza costs C. Buy at least X whole-A and Y whole-B equivalents, combining mixed pizzas in pairs. Minimize cost; surplus is allowed. Observed inputs: A=1..5000; B=1..5000; C=1..5000; X=1..100000 (median 56080.5); Y=1..100000 (median 40245).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 29, "median": 25.5, "min": 10}, "input_format": ["A B C X Y"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 5, "median": 5.0, "min": 5}}} -{"case_ids": ["p04015_case_000", "p04015_case_001", "p04015_case_002", "p04015_case_003", "p04015_case_004", "p04015_case_005", "p04015_case_006", "p04015_case_007", "p04015_case_008", "p04015_case_009", "p04015_case_010", "p04015_case_011", "p04015_case_012", "p04015_case_013", "p04015_case_014", "p04015_case_015", "p04015_case_016", "p04015_case_017", "p04015_case_018", "p04015_case_019", "p04015_case_020", "p04015_case_021", "p04015_case_022", "p04015_case_023", "p04015_case_024", "p04015_case_025", "p04015_case_026", "p04015_case_028", "p04015_case_029", "p04015_case_030", "p04015_case_031", "p04015_case_032", "p04015_case_033", "p04015_case_034", "p04015_case_035", "p04015_case_036", "p04015_case_037", "p04015_case_038", "p04015_case_039", "p04015_case_040", "p04015_case_041", "p04015_case_042", "p04015_case_043", "p04015_case_044", "p04015_case_045", "p04015_case_046", "p04015_case_047", "p04015_case_048", "p04015_case_049", "p04015_case_050", "p04015_case_051", "p04015_case_052", "p04015_case_053", "p04015_case_054", "p04015_case_055", "p04015_case_056", "p04015_case_057", "p04015_case_058", "p04015_case_059", "p04015_case_060", "p04015_case_061", "p04015_case_062", "p04015_case_063", "p04015_case_064", "p04015_case_065", "p04015_case_067", "p04015_case_068", "p04015_case_069", "p04015_case_070", "p04015_case_071", "p04015_case_072", "p04015_case_073", "p04015_case_074", "p04015_case_075", "p04015_case_077", "p04015_case_078", "p04015_case_079", "p04015_case_080", "p04015_case_081", "p04015_case_082", "p04015_case_083", "p04015_case_086", "p04015_case_087", "p04015_case_088", "p04015_case_089", "p04015_case_090", "p04015_case_091", "p04015_case_092", "p04015_case_093", "p04015_case_094", "p04015_case_095", "p04015_case_096", "p04015_case_097", "p04015_case_098", "p04015_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 95, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N, A = list(map(int, input().split()))\nX = [int(x) - A for x in input().split()]\nd = {0: 1}\nfor x in X:\n d_tmp = d.copy()\n for k in d_tmp:\n d[k + x] = d.get(k + x, 0) + d_tmp[k]\nprint((d[0] - 1))\n", "fast_code_sha256": "5dec41285404604d3590b4966e7909e3d13eca3db7182114d873bfa49928727d", "fast_id": "p04015_5dec41285404604d3590b4966e7909e3d13eca3db7182114d873bfa49928727d", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N, A = list(map(int, input().split()))\nX = [int(x) - A for x in input().split()]\nd = {0: 1}\nfor x in X:\n d_tmp = d.copy()\n for k in d_tmp:\n d[k + x] = d.get(k + x, 0) + d_tmp[k]\nprint((d[0] - 1))\n", "measured_fast_code_sha256": "5dec41285404604d3590b4966e7909e3d13eca3db7182114d873bfa49928727d", "measured_slow_code": "#!usr/bin/env python3\nfrom collections import defaultdict, deque, Counter, OrderedDict\nfrom bisect import bisect_left, bisect_right\nfrom functools import reduce, lru_cache\nfrom heapq import heappush, heappop, heapify\nimport itertools\nimport math, fractions\nimport sys, copy\n\n\ndef L():\n return sys.stdin.readline().split()\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\ndef SL():\n return list(sys.stdin.readline().rstrip())\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef LI1():\n return [int(x) - 1 for x in sys.stdin.readline().split()]\n\n\ndef LS():\n return [list(x) for x in sys.stdin.readline().split()]\n\n\ndef R(n):\n return [sys.stdin.readline().strip() for _ in range(n)]\n\n\ndef LR(n):\n return [L() for _ in range(n)]\n\n\ndef IR(n):\n return [I() for _ in range(n)]\n\n\ndef LIR(n):\n return [LI() for _ in range(n)]\n\n\ndef LIR1(n):\n return [LI1() for _ in range(n)]\n\n\ndef SLR(n):\n return [SL() for _ in range(n)]\n\n\ndef LSR(n):\n return [LS() for _ in range(n)]\n\n\ndef perm(n, r):\n return math.factorial(n) // math.factorial(r)\n\n\ndef comb(n, r):\n return math.factorial(n) // (math.factorial(r) * math.factorial(n - r))\n\n\ndef make_list(n, *args, default=0):\n return (\n [make_list(*args, default=default) for _ in range(n)]\n if args\n else [default for _ in range(n)]\n )\n\n\ndire = [[1, 0], [0, 1], [-1, 0], [0, -1]]\ndire8 = [[1, 0], [1, 1], [0, 1], [-1, 1], [-1, 0], [-1, -1], [0, -1], [1, -1]]\nalphabets = \"abcdefghijklmnopqrstuvwxyz\"\nALPHABETS = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\nMOD = 1000000007\nINF = float(\"inf\")\nsys.setrecursionlimit(1000000)\n\n\ndef main():\n N, A = LI()\n X = LI()\n dp = make_list(N + 1, N + 1, 2501)\n dp[0][0][0] = 1\n for i in range(1, N + 1):\n for k in range(i + 1):\n for s in range(2501):\n if X[i - 1] > s:\n dp[i][k][s] = dp[i - 1][k][s]\n else:\n dp[i][k][s] = dp[i - 1][k][s] + dp[i - 1][k - 1][s - X[i - 1]]\n print((sum(dp[N][k][k * A] for k in range(1, N + 1))))\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "8b45717994a5fb48dc2b76199b10d5e4e202c9ce5463bf7869f8add9172f6ff7", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 310.5304980881435, "pair_id": "python_v2_3a750ccb74ca85ec3246c982", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p04015", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p04015_5dec41285404604d3590b4966e7909e3d13eca3db7182114d873bfa49928727d.jsonl.gz", "inputs": "reproduction/python/inputs/p04015.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p04015_8b45717994a5fb48dc2b76199b10d5e4e202c9ce5463bf7869f8add9172f6ff7.jsonl.gz"}, "slow_code": "from collections import defaultdict, deque, Counter, OrderedDict\nfrom bisect import bisect_left, bisect_right\nfrom functools import reduce, lru_cache\nfrom heapq import heappush, heappop, heapify\nimport itertools\nimport math, fractions\nimport sys, copy\n\n\ndef L():\n return sys.stdin.readline().split()\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\ndef SL():\n return list(sys.stdin.readline().rstrip())\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef LI1():\n return [int(x) - 1 for x in sys.stdin.readline().split()]\n\n\ndef LS():\n return [list(x) for x in sys.stdin.readline().split()]\n\n\ndef R(n):\n return [sys.stdin.readline().strip() for _ in range(n)]\n\n\ndef LR(n):\n return [L() for _ in range(n)]\n\n\ndef IR(n):\n return [I() for _ in range(n)]\n\n\ndef LIR(n):\n return [LI() for _ in range(n)]\n\n\ndef LIR1(n):\n return [LI1() for _ in range(n)]\n\n\ndef SLR(n):\n return [SL() for _ in range(n)]\n\n\ndef LSR(n):\n return [LS() for _ in range(n)]\n\n\ndef perm(n, r):\n return math.factorial(n) // math.factorial(r)\n\n\ndef comb(n, r):\n return math.factorial(n) // (math.factorial(r) * math.factorial(n - r))\n\n\ndef make_list(n, *args, default=0):\n return (\n [make_list(*args, default=default) for _ in range(n)]\n if args\n else [default for _ in range(n)]\n )\n\n\ndire = [[1, 0], [0, 1], [-1, 0], [0, -1]]\ndire8 = [[1, 0], [1, 1], [0, 1], [-1, 1], [-1, 0], [-1, -1], [0, -1], [1, -1]]\nalphabets = \"abcdefghijklmnopqrstuvwxyz\"\nALPHABETS = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\nMOD = 1000000007\nINF = float(\"inf\")\nsys.setrecursionlimit(1000000)\n\n\ndef main():\n N, A = LI()\n X = LI()\n dp = make_list(N + 1, N + 1, 2501)\n dp[0][0][0] = 1\n for i in range(1, N + 1):\n for k in range(i + 1):\n for s in range(2501):\n if X[i - 1] > s:\n dp[i][k][s] = dp[i - 1][k][s]\n else:\n dp[i][k][s] = dp[i - 1][k][s] + dp[i - 1][k - 1][s - X[i - 1]]\n print((sum(dp[N][k][k * A] for k in range(1, N + 1))))\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "22f4d78fa24186375c05f8fb9209c535a507fc44a1c54caed7cae5ab1b3bfa98", "slow_id": "p04015_8b45717994a5fb48dc2b76199b10d5e4e202c9ce5463bf7869f8add9172f6ff7", "speedup": 495.69805994931215, "stratum": "8+", "within_pair_jaccard": 0.15217391304347827, "workload": {"case_count": 95, "description": "Count nonempty subsets of N indexed cards whose values x_i have arithmetic mean exactly A. Cards with equal values but different indices are distinct choices. Observed inputs: N=1..50 (median 50); A=1..50 (median 25); x_i=1..50.", "description_revision": "semantic-review-20261020", "distinct_input_count": 95, "input_bytes": {"max": 156, "median": 105, "min": 6}, "input_format": ["N A\nx_1 ... x_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 52, "median": 52, "min": 3}}} -{"case_ids": ["p03476_case_000", "p03476_case_001", "p03476_case_002", "p03476_case_003", "p03476_case_004", "p03476_case_005", "p03476_case_006", "p03476_case_007", "p03476_case_008", "p03476_case_009", "p03476_case_010", "p03476_case_011", "p03476_case_012", "p03476_case_013", "p03476_case_014", "p03476_case_015", "p03476_case_016", "p03476_case_017", "p03476_case_018", "p03476_case_019", "p03476_case_020", "p03476_case_021", "p03476_case_022", "p03476_case_023", "p03476_case_024", "p03476_case_025", "p03476_case_026", "p03476_case_027", "p03476_case_028", "p03476_case_029", "p03476_case_030", "p03476_case_031", "p03476_case_032", "p03476_case_033", "p03476_case_034", "p03476_case_035", "p03476_case_036", "p03476_case_037", "p03476_case_038", "p03476_case_039", "p03476_case_040", "p03476_case_041", "p03476_case_042", "p03476_case_043", "p03476_case_044", "p03476_case_045", "p03476_case_046", "p03476_case_047", "p03476_case_048", "p03476_case_049", "p03476_case_050", "p03476_case_051", "p03476_case_052", "p03476_case_053", "p03476_case_054", "p03476_case_055", "p03476_case_056", "p03476_case_057", "p03476_case_058", "p03476_case_059", "p03476_case_060", "p03476_case_061", "p03476_case_062", "p03476_case_063", "p03476_case_064", "p03476_case_065", "p03476_case_066", "p03476_case_067", "p03476_case_068", "p03476_case_069", "p03476_case_070", "p03476_case_071", "p03476_case_072", "p03476_case_073", "p03476_case_074", "p03476_case_075", "p03476_case_076", "p03476_case_077", "p03476_case_078", "p03476_case_079", "p03476_case_080", "p03476_case_081", "p03476_case_082", "p03476_case_083", "p03476_case_084", "p03476_case_085", "p03476_case_086", "p03476_case_087", "p03476_case_088", "p03476_case_089", "p03476_case_090", "p03476_case_091", "p03476_case_092", "p03476_case_093", "p03476_case_094", "p03476_case_095", "p03476_case_096", "p03476_case_097", "p03476_case_098", "p03476_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "Q = int(eval(input()))\nfact = [True] * (10**5 + 1)\nfact[0] = False\nfact[1] = False\nnum = [0] * (10**5 + 1)\ncur = 0\nfor i in range(len(fact)):\n if fact[i]:\n for j in range(i * 2, len(fact), i):\n fact[j] = False\n if fact[(i + 1) // 2]:\n cur += 1\n num[i] = cur\nfor i in range(Q):\n l, r = list(map(int, input().split()))\n print((num[r] - num[l - 1]))\n", "fast_code_sha256": "15fd4d8ca310dfc18a7a7c742e8a0d16bf92b26a1f1d4e8293bd7cd5e3514bb3", "fast_id": "p03476_15fd4d8ca310dfc18a7a7c742e8a0d16bf92b26a1f1d4e8293bd7cd5e3514bb3", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "Q = int(eval(input()))\nfact = [True] * (10**5 + 1)\nfact[0] = False\nfact[1] = False\nnum = [0] * (10**5 + 1)\ncur = 0\nfor i in range(len(fact)):\n if fact[i]:\n for j in range(i * 2, len(fact), i):\n fact[j] = False\n if fact[(i + 1) // 2]:\n cur += 1\n num[i] = cur\nfor i in range(Q):\n l, r = list(map(int, input().split()))\n print((num[r] - num[l - 1]))\n", "measured_fast_code_sha256": "15fd4d8ca310dfc18a7a7c742e8a0d16bf92b26a1f1d4e8293bd7cd5e3514bb3", "measured_slow_code": "import math\n\n\ndef is_prime(n):\n if n == 1:\n return False\n for k in range(2, int(math.sqrt(n)) + 1):\n if n % k == 0:\n return False\n return True\n\n\ncount = [0]\nbuf = 0\nfor i in range(1, 10**5 + 2):\n if i % 2 == 0:\n count.append(buf)\n continue\n hantei1 = is_prime(i)\n hantei2 = is_prime((i + 1) // 2)\n if hantei1 and hantei2:\n buf += 1\n count.append(buf)\nq = int(eval(input()))\nfor i in range(q):\n l, r = list(map(int, input().split()))\n print((count[r] - count[l - 1]))\n", "measured_slow_code_sha256": "8aa7b666b84d39afd40676a7baf00d0d5305252089aa4d028b941a7f3531316e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.662500175710951, "pair_id": "python_v2_1c09593f592e5c2b6fdea9bc", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03476", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03476_15fd4d8ca310dfc18a7a7c742e8a0d16bf92b26a1f1d4e8293bd7cd5e3514bb3.jsonl.gz", "inputs": "reproduction/python/inputs/p03476.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03476_8aa7b666b84d39afd40676a7baf00d0d5305252089aa4d028b941a7f3531316e.jsonl.gz"}, "slow_code": "import math\n\n\ndef is_prime(n):\n if n == 1:\n return False\n for k in range(2, int(math.sqrt(n)) + 1):\n if n % k == 0:\n return False\n return True\n\n\ncount = [0]\nbuf = 0\nfor i in range(1, 10**5 + 2):\n if i % 2 == 0:\n count.append(buf)\n continue\n hantei1 = is_prime(i)\n hantei2 = is_prime((i + 1) // 2)\n if hantei1 and hantei2:\n buf += 1\n count.append(buf)\nq = int(eval(input()))\nfor i in range(q):\n l, r = list(map(int, input().split()))\n print((count[r] - count[l - 1]))\n", "slow_code_sha256": "8aa7b666b84d39afd40676a7baf00d0d5305252089aa4d028b941a7f3531316e", "slow_id": "p03476_8aa7b666b84d39afd40676a7baf00d0d5305252089aa4d028b941a7f3531316e", "speedup": 3.77069346791889, "stratum": "2-4", "within_pair_jaccard": 0.4883720930232558, "workload": {"case_count": 100, "description": "For each inclusive odd-endpoint interval [l_i,r_i], count odd integers x for which both x and (x+1)/2 are prime. Process Q independent queries. Observed inputs: Q=1..100000 (median 25000); l_i=1..99999; r_i=1..99999.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1189051, "median": 294556.5, "min": 6}, "input_format": ["Q\nl_1 r_1\n...\nl_Q r_Q"], "input_format_status": "source_input_section", "input_lines": {"max": 100001, "median": 25001.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200001, "median": 50001.0, "min": 3}}} -{"case_ids": ["p02804_case_000", "p02804_case_001", "p02804_case_002", "p02804_case_003", "p02804_case_004", "p02804_case_005", "p02804_case_006", "p02804_case_007", "p02804_case_008", "p02804_case_009", "p02804_case_010", "p02804_case_011", "p02804_case_012", "p02804_case_013", "p02804_case_014", "p02804_case_015", "p02804_case_016", "p02804_case_017", "p02804_case_018", "p02804_case_019", "p02804_case_020", "p02804_case_021", "p02804_case_022", "p02804_case_023", "p02804_case_024", "p02804_case_025", "p02804_case_026", "p02804_case_027", "p02804_case_028", "p02804_case_029", "p02804_case_030", "p02804_case_031", "p02804_case_032", "p02804_case_033", "p02804_case_034", "p02804_case_035", "p02804_case_036", "p02804_case_037", "p02804_case_038", "p02804_case_039", "p02804_case_040", "p02804_case_041", "p02804_case_042", "p02804_case_043", "p02804_case_044", "p02804_case_045", "p02804_case_046", "p02804_case_047", "p02804_case_048", "p02804_case_049", "p02804_case_050", "p02804_case_051", "p02804_case_052", "p02804_case_053", "p02804_case_054", "p02804_case_055", "p02804_case_056", "p02804_case_057", "p02804_case_058", "p02804_case_059", "p02804_case_060", "p02804_case_061", "p02804_case_062", "p02804_case_063", "p02804_case_064", "p02804_case_065", "p02804_case_066", "p02804_case_067", "p02804_case_068", "p02804_case_069", "p02804_case_070", "p02804_case_071", "p02804_case_072", "p02804_case_073", "p02804_case_074", "p02804_case_075", "p02804_case_076", "p02804_case_077", "p02804_case_078", "p02804_case_079", "p02804_case_080", "p02804_case_081", "p02804_case_082", "p02804_case_083", "p02804_case_084", "p02804_case_085", "p02804_case_086", "p02804_case_087", "p02804_case_088", "p02804_case_089", "p02804_case_090", "p02804_case_091", "p02804_case_092", "p02804_case_093", "p02804_case_094", "p02804_case_095", "p02804_case_096", "p02804_case_097", "p02804_case_098", "p02804_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "executable_AST_equal_except_explicit_explanatory_string_removal_and_all_frozen_inputs_checker_pass", "fast_code": "p = 1000000007\nN, K = list(map(int, input().split()))\nA = list(map(int, input().split()))\nfac = [0] * (N + 1)\nfac[0] = 1\nfor i in range(N):\n fac[i + 1] = fac[i] * (i + 1) % p\n\n\ndef mcomb(n, k):\n if n == 0 and k == 0:\n return 1\n if n < k or k < 0:\n return 0\n return fac[n] * pow(fac[n - k], p - 2, p) * pow(fac[k], p - 2, p) % p\n\n\nA.sort(reverse=True)\nresult = 0\nfor i in range(N - K + 1):\n result += A[i] * mcomb(N - (i + 1), K - 1)\n result %= p\nA.reverse()\nfor i in range(N - K + 1):\n result -= A[i] * mcomb(N - (i + 1), K - 1)\n result %= p\n\n\nprint(result)\n", "fast_code_sha256": "c4a97a119ec31200442f098867df478f7a5aa2898ce15a55db3c881becef4bc9", "fast_id": "p02804_ca0e9f7eb590be44c97e30f62900eb81c1c0ecd2ce4ab6b96ce3eda14baa82c3", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "p = 1000000007\nN, K = list(map(int, input().split()))\nA = list(map(int, input().split()))\nfac = [0] * (N + 1)\nfac[0] = 1\nfor i in range(N):\n fac[i + 1] = fac[i] * (i + 1) % p\n\n\ndef mcomb(n, k):\n if n == 0 and k == 0:\n return 1\n if n < k or k < 0:\n return 0\n return fac[n] * pow(fac[n - k], p - 2, p) * pow(fac[k], p - 2, p) % p\n\n\nA.sort(reverse=True)\nresult = 0\nfor i in range(N - K + 1):\n result += A[i] * mcomb(N - (i + 1), K - 1)\n result %= p\nA.reverse()\nfor i in range(N - K + 1):\n result -= A[i] * mcomb(N - (i + 1), K - 1)\n result %= p\n# result += p\n# result %= p\nprint(result)\n", "measured_fast_code_sha256": "ca0e9f7eb590be44c97e30f62900eb81c1c0ecd2ce4ab6b96ce3eda14baa82c3", "measured_slow_code": "from collections import defaultdict\n\n\nclass Combination:\n \"\"\"\n O(n)の前計算を1回行うことで,O(1)でnCr mod mを求められる\n n_max = 10**6のとき前処理は約950ms (PyPyなら約340ms, 10**7で約1800ms)\n 使用例:\n comb = Combination(1000000)\n print(comb(5, 3)) # 10\n \"\"\"\n\n def __init__(self, n_max, mod=10**9 + 7):\n self.mod = mod\n self.modinv = self.make_modinv_list(n_max)\n self.fac, self.facinv = self.make_factorial_list(n_max)\n\n def __call__(self, n, r):\n return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n - r] % self.mod\n\n def make_factorial_list(self, n):\n # 階乗のリストと階乗のmod逆元のリストを返す O(n)\n # self.make_modinv_list()が先に実行されている必要がある\n fac = [1]\n facinv = [1]\n for i in range(1, n + 1):\n fac.append(fac[i - 1] * i % self.mod)\n facinv.append(facinv[i - 1] * self.modinv[i] % self.mod)\n return fac, facinv\n\n def make_modinv_list(self, n):\n # 0からnまでのmod逆元のリストを返す O(n)\n modinv = [0] * (n + 1)\n modinv[1] = 1\n for i in range(2, n + 1):\n modinv[i] = self.mod - self.mod // i * modinv[self.mod % i] % self.mod\n return modinv\n\n\ndef main():\n # def cmb(n, r, mod):\n # if ( r<0 or r>n ):\n # return 0\n # r = min(r, n-r)\n # return g1[n] * g2[r] * g2[n-r] % mod\n #\n # mod = 10**9+7 #出力の制限\n # N = 10**4\n # g1 = [1, 1] # 元テーブル\n # g2 = [1, 1] #逆元テーブル\n # inverse = [0, 1] #逆元テーブル計算用テーブル\n #\n # for i in range( 2, N + 1 ):\n # g1.append( ( g1[-1] * i ) % mod )\n # inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )\n # g2.append( (g2[-1] * inverse[-1]) % mod )\n N, K = list(map(int, input().split()))\n A = list(map(int, input().split()))\n A.sort()\n ans = 0\n mod = 10**9 + 7\n comb = Combination(1000000)\n # 最小になる数を求める\n for i, a in enumerate(A):\n if (N - 1 - i) >= K - 1:\n # tmp = cmb(N-1-i,K-1,mod)\n tmp = comb(N - 1 - i, K - 1)\n ans -= a * tmp\n ans %= mod\n else:\n break\n A.sort(reverse=True)\n for i, a in enumerate(A):\n if (N - 1 - i) >= K - 1:\n # tmp = cmb(N-1-i,K-1,mod)\n tmp = comb(N - 1 - i, K - 1)\n ans += a * tmp\n ans %= mod\n else:\n break\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "52e56efda7e8ad6e4fdc8f09b72891b75e6a9de56b6e71746fa44cb90b571757", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1152.6299077655913, "pair_id": "python_v2_8507a5f53d969c777498aee4", "per_case_slow_code_faster_fraction": 0.02, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02804", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02804_ca0e9f7eb590be44c97e30f62900eb81c1c0ecd2ce4ab6b96ce3eda14baa82c3.jsonl.gz", "inputs": "reproduction/python/inputs/p02804.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02804_52e56efda7e8ad6e4fdc8f09b72891b75e6a9de56b6e71746fa44cb90b571757.jsonl.gz"}, "slow_code": "from collections import defaultdict\n\n\nclass Combination:\n\n def __init__(self, n_max, mod=10**9 + 7):\n self.mod = mod\n self.modinv = self.make_modinv_list(n_max)\n self.fac, self.facinv = self.make_factorial_list(n_max)\n\n def __call__(self, n, r):\n return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n - r] % self.mod\n\n def make_factorial_list(self, n):\n\n fac = [1]\n facinv = [1]\n for i in range(1, n + 1):\n fac.append(fac[i - 1] * i % self.mod)\n facinv.append(facinv[i - 1] * self.modinv[i] % self.mod)\n return fac, facinv\n\n def make_modinv_list(self, n):\n\n modinv = [0] * (n + 1)\n modinv[1] = 1\n for i in range(2, n + 1):\n modinv[i] = self.mod - self.mod // i * modinv[self.mod % i] % self.mod\n return modinv\n\n\ndef main():\n\n N, K = list(map(int, input().split()))\n A = list(map(int, input().split()))\n A.sort()\n ans = 0\n mod = 10**9 + 7\n comb = Combination(1000000)\n\n for i, a in enumerate(A):\n if (N - 1 - i) >= K - 1:\n\n tmp = comb(N - 1 - i, K - 1)\n ans -= a * tmp\n ans %= mod\n else:\n break\n A.sort(reverse=True)\n for i, a in enumerate(A):\n if (N - 1 - i) >= K - 1:\n\n tmp = comb(N - 1 - i, K - 1)\n ans += a * tmp\n ans %= mod\n else:\n break\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "c994ccc5a265f81602ec3599210c2d88b03e4417d6b99505fd51e34598f98009", "slow_id": "p02804_52e56efda7e8ad6e4fdc8f09b72891b75e6a9de56b6e71746fa44cb90b571757", "speedup": 229.01688983204502, "stratum": "8+", "within_pair_jaccard": 0.3287671232876712, "workload": {"case_count": 100, "description": "For every choice of K distinct indices among N array positions, take the largest selected value minus the smallest. Sum these differences modulo 1000000007. Equal values at different indices are distinct choices. Observed inputs: N=1..100000 (median 100); K=1..100000 (median 5); A_i=-1000000000..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1200009, "median": 1046.0, "min": 10}, "input_format": ["N K\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100002, "median": 102.0, "min": 3}}} -{"case_ids": ["p02382_case_000", "p02382_case_001", "p02382_case_002", "p02382_case_003", "p02382_case_004", "p02382_case_005", "p02382_case_006", "p02382_case_007", "p02382_case_008", "p02382_case_009", "p02382_case_010", "p02382_case_011", "p02382_case_012", "p02382_case_013", "p02382_case_014", "p02382_case_015", "p02382_case_016", "p02382_case_017", "p02382_case_018", "p02382_case_019", "p02382_case_020", "p02382_case_021", "p02382_case_022", "p02382_case_023", "p02382_case_024", "p02382_case_025", "p02382_case_026", "p02382_case_027", "p02382_case_028", "p02382_case_029", "p02382_case_030", "p02382_case_031", "p02382_case_032", "p02382_case_033", "p02382_case_034", "p02382_case_035", "p02382_case_036", "p02382_case_037", "p02382_case_038", "p02382_case_039", "p02382_case_040", "p02382_case_041", "p02382_case_042", "p02382_case_043", "p02382_case_044", "p02382_case_045", "p02382_case_046", "p02382_case_047", "p02382_case_048", "p02382_case_049", "p02382_case_050", "p02382_case_051", "p02382_case_052", "p02382_case_053", "p02382_case_054", "p02382_case_055", "p02382_case_056", "p02382_case_057", "p02382_case_058", "p02382_case_059", "p02382_case_060", "p02382_case_061", "p02382_case_062", "p02382_case_063", "p02382_case_064", "p02382_case_065", "p02382_case_066", "p02382_case_067", "p02382_case_068", "p02382_case_069", "p02382_case_070", "p02382_case_071", "p02382_case_072", "p02382_case_073", "p02382_case_074", "p02382_case_075", "p02382_case_076", "p02382_case_077", "p02382_case_078", "p02382_case_079", "p02382_case_080", "p02382_case_081", "p02382_case_082", "p02382_case_083", "p02382_case_084", "p02382_case_085", "p02382_case_086", "p02382_case_087", "p02382_case_088", "p02382_case_089", "p02382_case_090", "p02382_case_091", "p02382_case_092", "p02382_case_093", "p02382_case_094", "p02382_case_095", "p02382_case_096", "p02382_case_097", "p02382_case_098", "p02382_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(input())\nx = list(map(int, input().split()))\ny = list(map(int, input().split()))\nd = [abs(s - t) for s, t in zip(x, y)]\nf = lambda n: sum([s**n for s in d]) ** (1 / n)\nprint(f(1), f(2), f(3), max(d), sep=\"\\n\")\n", "fast_code_sha256": "5a8587d9a775ddf801b6b25ab8a9f4895d5899c2a7b8332b712dab13293f721d", "fast_id": "p02382_5a8587d9a775ddf801b6b25ab8a9f4895d5899c2a7b8332b712dab13293f721d", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(input())\nx = list(map(int, input().split()))\ny = list(map(int, input().split()))\nd = [abs(s - t) for s, t in zip(x, y)]\nf = lambda n: sum([s**n for s in d]) ** (1 / n)\nprint(f(1), f(2), f(3), max(d), sep=\"\\n\")\n", "measured_fast_code_sha256": "5a8587d9a775ddf801b6b25ab8a9f4895d5899c2a7b8332b712dab13293f721d", "measured_slow_code": "n = int(eval(input()))\nx = list(map(int, input().split()))\ny = list(map(int, input().split()))\ntmp = [[0 for i in range(6)] for j in range(n + 1)]\nabsDiff = abs(x[0] - y[0])\ntmp[0][3] = tmp[0][0] = absDiff\ntmp[0][4] = tmp[0][1] = absDiff**2\ntmp[0][5] = tmp[0][2] = absDiff**3\nmax = absDiff\nfor i in range(1, n, 1):\n absDiff = abs(x[i] - y[i])\n tmp[i][0] = absDiff\n tmp[i][1] = absDiff**2\n tmp[i][2] = absDiff**3\n tmp[i][3] = tmp[i - 1][3] + tmp[i][0]\n tmp[i][4] = tmp[i - 1][4] + tmp[i][1]\n tmp[i][5] = tmp[i - 1][5] + tmp[i][2]\n if absDiff > max:\n max = absDiff\nprint((tmp[n - 1][3]))\nprint((tmp[n - 1][4] ** (1 / 2)))\nprint((tmp[n - 1][5] ** (1 / 3)))\nprint(max)\n", "measured_slow_code_sha256": "c3f9eb019e3842f0a97bfd8fb04b18e6c2124bd7080dc365df4bf7ed45775194", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.339477019886788, "pair_id": "python_v2_0df848754fac30c443abddec", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02382", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02382_5a8587d9a775ddf801b6b25ab8a9f4895d5899c2a7b8332b712dab13293f721d.jsonl.gz", "inputs": "reproduction/python/inputs/p02382.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02382_c3f9eb019e3842f0a97bfd8fb04b18e6c2124bd7080dc365df4bf7ed45775194.jsonl.gz"}, "slow_code": "n = int(eval(input()))\nx = list(map(int, input().split()))\ny = list(map(int, input().split()))\ntmp = [[0 for i in range(6)] for j in range(n + 1)]\nabsDiff = abs(x[0] - y[0])\ntmp[0][3] = tmp[0][0] = absDiff\ntmp[0][4] = tmp[0][1] = absDiff**2\ntmp[0][5] = tmp[0][2] = absDiff**3\nmax = absDiff\nfor i in range(1, n, 1):\n absDiff = abs(x[i] - y[i])\n tmp[i][0] = absDiff\n tmp[i][1] = absDiff**2\n tmp[i][2] = absDiff**3\n tmp[i][3] = tmp[i - 1][3] + tmp[i][0]\n tmp[i][4] = tmp[i - 1][4] + tmp[i][1]\n tmp[i][5] = tmp[i - 1][5] + tmp[i][2]\n if absDiff > max:\n max = absDiff\nprint((tmp[n - 1][3]))\nprint((tmp[n - 1][4] ** (1 / 2)))\nprint((tmp[n - 1][5] ** (1 / 3)))\nprint(max)\n", "slow_code_sha256": "c3f9eb019e3842f0a97bfd8fb04b18e6c2124bd7080dc365df4bf7ed45775194", "slow_id": "p02382_c3f9eb019e3842f0a97bfd8fb04b18e6c2124bd7080dc365df4bf7ed45775194", "speedup": 2.320438224488248, "stratum": "2-4", "within_pair_jaccard": 0.45714285714285713, "workload": {"case_count": 100, "description": "Compute the Minkowski distances between two n-dimensional integer vectors for p=1,2,3 and infinity, respectively. The infinity case is the maximum absolute coordinate difference. Observed inputs: n=1..100 (median 5); x_i=0..1000; y_i=0..1000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 857, "median": 40.5, "min": 6}, "input_format": ["n\nx_1 ... x_n\ny_1 ... y_n"], "input_format_status": "source_input_section", "input_lines": {"max": 3, "median": 3.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 201, "median": 11.0, "min": 3}}} -{"case_ids": ["p03456_case_000", "p03456_case_001", "p03456_case_002", "p03456_case_003", "p03456_case_004", "p03456_case_005", "p03456_case_006", "p03456_case_007", "p03456_case_008", "p03456_case_009", "p03456_case_010", "p03456_case_011", "p03456_case_012", "p03456_case_013", "p03456_case_014", "p03456_case_015", "p03456_case_016", "p03456_case_017", "p03456_case_018", "p03456_case_019", "p03456_case_020", "p03456_case_021", "p03456_case_022", "p03456_case_023", "p03456_case_024", "p03456_case_025", "p03456_case_026", "p03456_case_027", "p03456_case_028", "p03456_case_029", "p03456_case_030", "p03456_case_031", "p03456_case_032", "p03456_case_033", "p03456_case_034", "p03456_case_035", "p03456_case_036", "p03456_case_037", "p03456_case_038", "p03456_case_039", "p03456_case_040", "p03456_case_041", "p03456_case_042", "p03456_case_043", "p03456_case_044", "p03456_case_045", "p03456_case_046", "p03456_case_047", "p03456_case_048", "p03456_case_049", "p03456_case_050", "p03456_case_051", "p03456_case_052", "p03456_case_053", "p03456_case_054", "p03456_case_055", "p03456_case_056", "p03456_case_057", "p03456_case_058", "p03456_case_059", "p03456_case_060", "p03456_case_061", "p03456_case_062", "p03456_case_063", "p03456_case_064", "p03456_case_065", "p03456_case_066", "p03456_case_067", "p03456_case_068", "p03456_case_069", "p03456_case_070", "p03456_case_071", "p03456_case_072", "p03456_case_073", "p03456_case_074", "p03456_case_075", "p03456_case_076", "p03456_case_077", "p03456_case_078", "p03456_case_079", "p03456_case_080", "p03456_case_081", "p03456_case_082", "p03456_case_083", "p03456_case_084", "p03456_case_085", "p03456_case_086", "p03456_case_087", "p03456_case_088", "p03456_case_089", "p03456_case_090", "p03456_case_091", "p03456_case_092", "p03456_case_093", "p03456_case_094", "p03456_case_095", "p03456_case_096", "p03456_case_097", "p03456_case_098", "p03456_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "a, b = list(map(str, input().split()))\ntarget = int(a + b)\nif (target**0.5).is_integer():\n print(\"Yes\")\nelse:\n print(\"No\")\n", "fast_code_sha256": "5c76f55bb7375b008aae832468c1927f071bea15c20ce5c79f4e53a61685b084", "fast_id": "p03456_5c76f55bb7375b008aae832468c1927f071bea15c20ce5c79f4e53a61685b084", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "a, b = list(map(str, input().split()))\ntarget = int(a + b)\nif (target**0.5).is_integer():\n print(\"Yes\")\nelse:\n print(\"No\")\n", "measured_fast_code_sha256": "5c76f55bb7375b008aae832468c1927f071bea15c20ce5c79f4e53a61685b084", "measured_slow_code": "from sys import stdin\nfrom itertools import combinations\nfrom math import factorial\nimport numpy as np\nimport math\n\na, b = [int(x) for x in stdin.readline().rstrip().split()]\nc = int(str(a) + str(b))\nif int(math.sqrt(c)) ** 2 == c:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "measured_slow_code_sha256": "ddb265e799745c13d88c260b6767a9f7a765687934948fe113d1366dbd4b4060", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1697.3278736389173, "pair_id": "python_v2_31116a7e40bc3c614ca1abd9", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03456", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03456_5c76f55bb7375b008aae832468c1927f071bea15c20ce5c79f4e53a61685b084.jsonl.gz", "inputs": "reproduction/python/inputs/p03456.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03456_ddb265e799745c13d88c260b6767a9f7a765687934948fe113d1366dbd4b4060.jsonl.gz"}, "slow_code": "from sys import stdin\nfrom itertools import combinations\nfrom math import factorial\nimport numpy as np\nimport math\n\na, b = [int(x) for x in stdin.readline().rstrip().split()]\nc = int(str(a) + str(b))\nif int(math.sqrt(c)) ** 2 == c:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "slow_code_sha256": "ddb265e799745c13d88c260b6767a9f7a765687934948fe113d1366dbd4b4060", "slow_id": "p03456_ddb265e799745c13d88c260b6767a9f7a765687934948fe113d1366dbd4b4060", "speedup": 1695.804689807121, "stratum": "8+", "within_pair_jaccard": 0.2777777777777778, "workload": {"case_count": 100, "description": "Concatenate the decimal representations of positive integers a and b, in that order, and determine whether the resulting integer is a perfect square. Observed inputs: a=1..100 (median 41); b=1..100 (median 48.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 8, "median": 6.0, "min": 4}, "input_format": ["a b"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p02642_case_000", "p02642_case_001", "p02642_case_002", "p02642_case_003", "p02642_case_004", "p02642_case_005", "p02642_case_006", "p02642_case_007", "p02642_case_008", "p02642_case_009", "p02642_case_010", "p02642_case_011", "p02642_case_012", "p02642_case_013", "p02642_case_014", "p02642_case_015", "p02642_case_016", "p02642_case_017", "p02642_case_018", "p02642_case_019", "p02642_case_020", "p02642_case_021", "p02642_case_022", "p02642_case_023", "p02642_case_024", "p02642_case_025", "p02642_case_026", "p02642_case_027", "p02642_case_028", "p02642_case_029", "p02642_case_030", "p02642_case_031", "p02642_case_032", "p02642_case_033", "p02642_case_034", "p02642_case_035", "p02642_case_036", "p02642_case_037", "p02642_case_038", "p02642_case_039", "p02642_case_040", "p02642_case_041", "p02642_case_042", "p02642_case_043", "p02642_case_044", "p02642_case_045", "p02642_case_046", "p02642_case_047", "p02642_case_048", "p02642_case_049", "p02642_case_050", "p02642_case_051", "p02642_case_052", "p02642_case_053", "p02642_case_054", "p02642_case_055", "p02642_case_056", "p02642_case_057", "p02642_case_058", "p02642_case_059", "p02642_case_060", "p02642_case_061", "p02642_case_062", "p02642_case_063", "p02642_case_064", "p02642_case_065", "p02642_case_066", "p02642_case_067", "p02642_case_068", "p02642_case_069", "p02642_case_070", "p02642_case_071", "p02642_case_072", "p02642_case_073", "p02642_case_074", "p02642_case_075", "p02642_case_076", "p02642_case_077", "p02642_case_078", "p02642_case_079", "p02642_case_080", "p02642_case_081", "p02642_case_082", "p02642_case_083", "p02642_case_084", "p02642_case_085", "p02642_case_086", "p02642_case_087", "p02642_case_088", "p02642_case_089", "p02642_case_090", "p02642_case_091", "p02642_case_092", "p02642_case_093", "p02642_case_094", "p02642_case_095", "p02642_case_096", "p02642_case_097", "p02642_case_098", "p02642_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\na = list(map(int, input().split()))\na.sort()\nmax_num = a[-1] + 1\ncnt = [0] * (max_num)\na.sort()\nans = 0\nfor i in a:\n cnt[i] += 1\na = set(a)\nfor k in a:\n for l in range(k * 2, (max_num), k):\n cnt[l] += 1\nfor m in a:\n if cnt[m] == 1:\n ans += 1\nprint(ans)\n", "fast_code_sha256": "14d062ba1fdfedcb7da5501ac08db70378afe95bb6ccb7773b4c5b572d572918", "fast_id": "p02642_14d062ba1fdfedcb7da5501ac08db70378afe95bb6ccb7773b4c5b572d572918", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\na = list(map(int, input().split()))\na.sort()\nmax_num = a[-1] + 1\ncnt = [0] * (max_num)\na.sort()\nans = 0\nfor i in a:\n cnt[i] += 1\na = set(a)\nfor k in a:\n for l in range(k * 2, (max_num), k):\n cnt[l] += 1\nfor m in a:\n if cnt[m] == 1:\n ans += 1\nprint(ans)\n", "measured_fast_code_sha256": "14d062ba1fdfedcb7da5501ac08db70378afe95bb6ccb7773b4c5b572d572918", "measured_slow_code": "n = int(eval(input()))\na = [int(i) for i in input().split()]\nmax_a = max(a)\nflag = [True for i in range(max_a + 1)]\ndup = set()\nfor i in range(n):\n if a[i] in dup:\n flag[a[i]] = False\n else:\n dup.add(a[i])\n for j in range(2 * a[i], max_a + 1, a[i]):\n flag[j] = False\nans = 0\nfor i in a:\n ans += flag[i]\nprint(ans)\n", "measured_slow_code_sha256": "812f58e5e74c625583dfedc46d01e059e3015c6446ce2676cf4582b4912570b5", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.006685131389398, "pair_id": "python_v2_69a57c8c6d5e45ca5a89770c", "per_case_slow_code_faster_fraction": 0.21, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02642", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02642_14d062ba1fdfedcb7da5501ac08db70378afe95bb6ccb7773b4c5b572d572918.jsonl.gz", "inputs": "reproduction/python/inputs/p02642.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02642_812f58e5e74c625583dfedc46d01e059e3015c6446ce2676cf4582b4912570b5.jsonl.gz"}, "slow_code": "n = int(eval(input()))\na = [int(i) for i in input().split()]\nmax_a = max(a)\nflag = [True for i in range(max_a + 1)]\ndup = set()\nfor i in range(n):\n if a[i] in dup:\n flag[a[i]] = False\n else:\n dup.add(a[i])\n for j in range(2 * a[i], max_a + 1, a[i]):\n flag[j] = False\nans = 0\nfor i in a:\n ans += flag[i]\nprint(ans)\n", "slow_code_sha256": "812f58e5e74c625583dfedc46d01e059e3015c6446ce2676cf4582b4912570b5", "slow_id": "p02642_812f58e5e74c625583dfedc46d01e059e3015c6446ce2676cf4582b4912570b5", "speedup": 3.8746231475279247, "stratum": "2-4", "within_pair_jaccard": 0.5, "workload": {"case_count": 100, "description": "Count indices i such that no different index j has a value a_j dividing a_i; equal values at different positions are separate entries. Observed inputs: N=5..200000 (median 1000); a_i=1..1000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1600007, "median": 6886.5, "min": 12}, "input_format": ["N\na_1 ... a_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200001, "median": 1001.0, "min": 6}}} -{"case_ids": ["p03796_case_000", "p03796_case_001", "p03796_case_002", "p03796_case_003", "p03796_case_004", "p03796_case_005", "p03796_case_006", "p03796_case_007", "p03796_case_008", "p03796_case_009", "p03796_case_010", "p03796_case_011", "p03796_case_012", "p03796_case_013", "p03796_case_014", "p03796_case_015", "p03796_case_016", "p03796_case_017", "p03796_case_018", "p03796_case_019", "p03796_case_020", "p03796_case_021", "p03796_case_022", "p03796_case_023", "p03796_case_024", "p03796_case_025", "p03796_case_026", "p03796_case_027", "p03796_case_028", "p03796_case_029", "p03796_case_030", "p03796_case_031", "p03796_case_032", "p03796_case_033", "p03796_case_034", "p03796_case_035", "p03796_case_036", "p03796_case_037", "p03796_case_038", "p03796_case_039", "p03796_case_040", "p03796_case_041", "p03796_case_042", "p03796_case_043", "p03796_case_044", "p03796_case_045", "p03796_case_046", "p03796_case_047", "p03796_case_048", "p03796_case_049", "p03796_case_050", "p03796_case_051", "p03796_case_052", "p03796_case_053", "p03796_case_054", "p03796_case_055", "p03796_case_056", "p03796_case_057", "p03796_case_058", "p03796_case_059", "p03796_case_060", "p03796_case_061", "p03796_case_062", "p03796_case_063", "p03796_case_064", "p03796_case_065", "p03796_case_066", "p03796_case_067", "p03796_case_068", "p03796_case_069", "p03796_case_070", "p03796_case_071", "p03796_case_072", "p03796_case_073", "p03796_case_074", "p03796_case_075", "p03796_case_076", "p03796_case_077", "p03796_case_078", "p03796_case_079", "p03796_case_080", "p03796_case_081", "p03796_case_082", "p03796_case_083", "p03796_case_084", "p03796_case_085", "p03796_case_086", "p03796_case_087", "p03796_case_088", "p03796_case_089", "p03796_case_090", "p03796_case_091", "p03796_case_092", "p03796_case_093", "p03796_case_094", "p03796_case_095", "p03796_case_096", "p03796_case_097", "p03796_case_098", "p03796_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N = int(eval(input()))\na = 1\nfor n in range(2, N + 1):\n a = a * n % (10**9 + 7)\nprint(a)\n", "fast_code_sha256": "a60519e763775a806ca7a816aafe8e45cefe3d6fbd682179badf9f9798007f29", "fast_id": "p03796_a60519e763775a806ca7a816aafe8e45cefe3d6fbd682179badf9f9798007f29", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N = int(eval(input()))\na = 1\nfor n in range(2, N + 1):\n a = a * n % (10**9 + 7)\nprint(a)\n", "measured_fast_code_sha256": "a60519e763775a806ca7a816aafe8e45cefe3d6fbd682179badf9f9798007f29", "measured_slow_code": "# ABC 055: B – Training Camp\nfrom math import factorial\n\nn = int(eval(input()))\nprint((factorial(n) % (10**9 + 7)))\n", "measured_slow_code_sha256": "43b257e85e546d9470ced772c67918bde77d5626a2fd04dea2e6a84c615224a5", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4.777611418677454, "pair_id": "python_v2_164e49d3ffe76708ad991e8c", "per_case_slow_code_faster_fraction": 0.35, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03796", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03796_a60519e763775a806ca7a816aafe8e45cefe3d6fbd682179badf9f9798007f29.jsonl.gz", "inputs": "reproduction/python/inputs/p03796.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03796_43b257e85e546d9470ced772c67918bde77d5626a2fd04dea2e6a84c615224a5.jsonl.gz"}, "slow_code": "from math import factorial\n\nn = int(eval(input()))\nprint((factorial(n) % (10**9 + 7)))\n", "slow_code_sha256": "5ff598b9800e1bd896356b079e05a6afa89737def3d95243ef8ae46ed85960b1", "slow_id": "p03796_43b257e85e546d9470ced772c67918bde77d5626a2fd04dea2e6a84c615224a5", "speedup": 2.8873147431290827, "stratum": "2-4", "within_pair_jaccard": 0.42105263157894735, "workload": {"case_count": 100, "description": "Starting with power 1, multiply it by i for i=1..N in order. Output the final power modulo 1000000007. Observed inputs: N=1..100000 (median 31648.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 7, "median": 6.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p03786_case_000", "p03786_case_001", "p03786_case_002", "p03786_case_003", "p03786_case_004", "p03786_case_005", "p03786_case_006", "p03786_case_007", "p03786_case_008", "p03786_case_009", "p03786_case_010", "p03786_case_011", "p03786_case_012", "p03786_case_013", "p03786_case_014", "p03786_case_015", "p03786_case_016", "p03786_case_017", "p03786_case_018", "p03786_case_019", "p03786_case_020", "p03786_case_021", "p03786_case_022", "p03786_case_023", "p03786_case_024", "p03786_case_025", "p03786_case_026", "p03786_case_027", "p03786_case_028", "p03786_case_029", "p03786_case_030", "p03786_case_031", "p03786_case_032", "p03786_case_033", "p03786_case_034", "p03786_case_035", "p03786_case_036", "p03786_case_037", "p03786_case_038", "p03786_case_039", "p03786_case_040", "p03786_case_041", "p03786_case_042", "p03786_case_043", "p03786_case_044", "p03786_case_045", "p03786_case_046", "p03786_case_047", "p03786_case_048", "p03786_case_049", "p03786_case_050", "p03786_case_051", "p03786_case_052", "p03786_case_053", "p03786_case_054", "p03786_case_055", "p03786_case_056", "p03786_case_057", "p03786_case_058", "p03786_case_059", "p03786_case_060", "p03786_case_061", "p03786_case_062", "p03786_case_063", "p03786_case_064", "p03786_case_065", "p03786_case_066", "p03786_case_067", "p03786_case_068", "p03786_case_069", "p03786_case_070", "p03786_case_071", "p03786_case_072", "p03786_case_073", "p03786_case_074", "p03786_case_075", "p03786_case_076", "p03786_case_077", "p03786_case_078", "p03786_case_079", "p03786_case_080", "p03786_case_081", "p03786_case_082", "p03786_case_083", "p03786_case_084", "p03786_case_085", "p03786_case_086", "p03786_case_087", "p03786_case_088", "p03786_case_089", "p03786_case_090", "p03786_case_091", "p03786_case_092", "p03786_case_093", "p03786_case_094", "p03786_case_095", "p03786_case_096", "p03786_case_097", "p03786_case_098", "p03786_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from itertools import accumulate\n\nN = int(eval(input()))\nA = list(map(int, input().split()))\nA.sort()\na = list(accumulate(A))\nanswer = N\nfor i in range(N - 1):\n if a[i] * 2 < A[i + 1]:\n answer = N - (i + 1)\nprint(answer)\n", "fast_code_sha256": "2ce5e490bcfdab8ab7aebeb3c1a35cba3e3d5ba9a02c0729090e10f62b20b9a3", "fast_id": "p03786_2ce5e490bcfdab8ab7aebeb3c1a35cba3e3d5ba9a02c0729090e10f62b20b9a3", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from itertools import accumulate\n\nN = int(eval(input()))\nA = list(map(int, input().split()))\nA.sort()\na = list(accumulate(A))\nanswer = N\nfor i in range(N - 1):\n if a[i] * 2 < A[i + 1]:\n answer = N - (i + 1)\nprint(answer)\n", "measured_fast_code_sha256": "2ce5e490bcfdab8ab7aebeb3c1a35cba3e3d5ba9a02c0729090e10f62b20b9a3", "measured_slow_code": "n = int(eval(input()))\na = list(map(int, input().split()))\nimport numpy as np\n\na = sorted(a)\ncum = np.cumsum(a)\ncum = list(reversed(cum))\na = list(reversed(a))\nans = 1\nfor i in range(1, n):\n if a[i - 1] <= cum[i] * 2:\n ans += 1\n else:\n break\nprint(ans)\n", "measured_slow_code_sha256": "9c47b5351287e97e1c5de7875f912e9de0349c4286a89e13a6aa097ca0c9f946", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 862.5937192677984, "pair_id": "python_v2_fc898751c656cb07b4709455", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03786", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03786_2ce5e490bcfdab8ab7aebeb3c1a35cba3e3d5ba9a02c0729090e10f62b20b9a3.jsonl.gz", "inputs": "reproduction/python/inputs/p03786.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03786_9c47b5351287e97e1c5de7875f912e9de0349c4286a89e13a6aa097ca0c9f946.jsonl.gz"}, "slow_code": "n = int(eval(input()))\na = list(map(int, input().split()))\nimport numpy as np\n\na = sorted(a)\ncum = np.cumsum(a)\ncum = list(reversed(cum))\na = list(reversed(a))\nans = 1\nfor i in range(1, n):\n if a[i - 1] <= cum[i] * 2:\n ans += 1\n else:\n break\nprint(ans)\n", "slow_code_sha256": "9c47b5351287e97e1c5de7875f912e9de0349c4286a89e13a6aa097ca0c9f946", "slow_id": "p03786_9c47b5351287e97e1c5de7875f912e9de0349c4286a89e13a6aa097ca0c9f946", "speedup": 140.04250266695007, "stratum": "8+", "within_pair_jaccard": 0.47058823529411764, "workload": {"case_count": 100, "description": "N creatures have distinct colors and sizes A_i. A creature of size A may absorb one of size C<=2*A; its size becomes A+C and its color survives. Count colors that can remain after all creatures merge. Observed inputs: N=2..100000 (median 10); A_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1100007, "median": 101.5, "min": 14}, "input_format": ["N\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100001, "median": 11.0, "min": 3}}} -{"case_ids": ["p03767_case_000", "p03767_case_001", "p03767_case_002", "p03767_case_003", "p03767_case_004", "p03767_case_005", "p03767_case_006", "p03767_case_007", "p03767_case_008", "p03767_case_009", "p03767_case_010", "p03767_case_011", "p03767_case_012", "p03767_case_013", "p03767_case_014", "p03767_case_015", "p03767_case_016", "p03767_case_017", "p03767_case_018", "p03767_case_019", "p03767_case_020", "p03767_case_021", "p03767_case_022", "p03767_case_023", "p03767_case_024", "p03767_case_025", "p03767_case_026", "p03767_case_027", "p03767_case_028", "p03767_case_029", "p03767_case_030", "p03767_case_031", "p03767_case_032", "p03767_case_033", "p03767_case_034", "p03767_case_035", "p03767_case_036", "p03767_case_037", "p03767_case_038", "p03767_case_039", "p03767_case_040", "p03767_case_041", "p03767_case_042", "p03767_case_043", "p03767_case_044", "p03767_case_045", "p03767_case_046", "p03767_case_047", "p03767_case_048", "p03767_case_049", "p03767_case_050", "p03767_case_051", "p03767_case_052", "p03767_case_053", "p03767_case_054", "p03767_case_055", "p03767_case_056", "p03767_case_057", "p03767_case_058", "p03767_case_059", "p03767_case_060", "p03767_case_061", "p03767_case_062", "p03767_case_063", "p03767_case_064", "p03767_case_065", "p03767_case_066", "p03767_case_067", "p03767_case_068", "p03767_case_069", "p03767_case_070", "p03767_case_071", "p03767_case_072", "p03767_case_073", "p03767_case_074", "p03767_case_075", "p03767_case_076", "p03767_case_077", "p03767_case_078", "p03767_case_079", "p03767_case_080", "p03767_case_081", "p03767_case_082", "p03767_case_083", "p03767_case_084", "p03767_case_085", "p03767_case_086", "p03767_case_087", "p03767_case_088", "p03767_case_089", "p03767_case_090", "p03767_case_091", "p03767_case_092", "p03767_case_093", "p03767_case_094", "p03767_case_095", "p03767_case_096", "p03767_case_097", "p03767_case_098", "p03767_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\na = list(map(int, input().split()))\na = sorted(a, reverse=1)\nprint((sum(a[1 : n * 2 : 2])))\n", "fast_code_sha256": "47e458fe71a0ff420153642de21432b17824cb83abc618c6be588e8cc4329217", "fast_id": "p03767_47e458fe71a0ff420153642de21432b17824cb83abc618c6be588e8cc4329217", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\na = list(map(int, input().split()))\na = sorted(a, reverse=1)\nprint((sum(a[1 : n * 2 : 2])))\n", "measured_fast_code_sha256": "47e458fe71a0ff420153642de21432b17824cb83abc618c6be588e8cc4329217", "measured_slow_code": "from collections import Counter, defaultdict, deque\nfrom heapq import heappop, heappush, heapify\nimport sys, bisect, math, itertools, fractions, pprint\n\nsys.setrecursionlimit(10**8)\nmod = 10**9 + 7\nINF = float(\"inf\")\n\n\ndef inp():\n return int(sys.stdin.readline())\n\n\ndef inpl():\n return list(map(int, sys.stdin.readline().split()))\n\n\nn = inp()\na = inpl()\na.sort(reverse=True)\ncnt = n\nind = 0\nres = 0\nwhile cnt:\n if ind % 2:\n res += a[ind]\n cnt -= 1\n ind += 1\nprint(res)\n", "measured_slow_code_sha256": "7693ad55686e6fd618fa19be5402464b2c1d8a6534c46b08c3072eed6c243853", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.4993275917466686, "pair_id": "python_v2_96019473d7ae748295cdc9b1", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03767", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03767_47e458fe71a0ff420153642de21432b17824cb83abc618c6be588e8cc4329217.jsonl.gz", "inputs": "reproduction/python/inputs/p03767.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03767_7693ad55686e6fd618fa19be5402464b2c1d8a6534c46b08c3072eed6c243853.jsonl.gz"}, "slow_code": "from collections import Counter, defaultdict, deque\nfrom heapq import heappop, heappush, heapify\nimport sys, bisect, math, itertools, fractions, pprint\n\nsys.setrecursionlimit(10**8)\nmod = 10**9 + 7\nINF = float(\"inf\")\n\n\ndef inp():\n return int(sys.stdin.readline())\n\n\ndef inpl():\n return list(map(int, sys.stdin.readline().split()))\n\n\nn = inp()\na = inpl()\na.sort(reverse=True)\ncnt = n\nind = 0\nres = 0\nwhile cnt:\n if ind % 2:\n res += a[ind]\n cnt -= 1\n ind += 1\nprint(res)\n", "slow_code_sha256": "7693ad55686e6fd618fa19be5402464b2c1d8a6534c46b08c3072eed6c243853", "slow_id": "p03767_7693ad55686e6fd618fa19be5402464b2c1d8a6534c46b08c3072eed6c243853", "speedup": 5.97458220505953, "stratum": "4-8", "within_pair_jaccard": 0.18867924528301888, "workload": {"case_count": 100, "description": "Partition 3N participants into N disjoint teams of three. A team strength is its second-largest member strength, counting ties. Maximize the sum of team strengths. Observed inputs: N=1..100000 (median 1000); participants=3..300000 (median 3000); a_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 3300007, "median": 29687.0, "min": 8}, "input_format": ["N\na_1 ... a_(3N)"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 300001, "median": 3001.0, "min": 4}}} -{"case_ids": ["p02956_case_000", "p02956_case_001", "p02956_case_002", "p02956_case_003", "p02956_case_004", "p02956_case_005", "p02956_case_006", "p02956_case_007", "p02956_case_008", "p02956_case_009", "p02956_case_010", "p02956_case_011", "p02956_case_012", "p02956_case_013", "p02956_case_014", "p02956_case_015", "p02956_case_016", "p02956_case_017", "p02956_case_018", "p02956_case_019", "p02956_case_020", "p02956_case_021", "p02956_case_022", "p02956_case_023", "p02956_case_024", "p02956_case_025", "p02956_case_026", "p02956_case_027", "p02956_case_028", "p02956_case_029", "p02956_case_030", "p02956_case_031", "p02956_case_032", "p02956_case_033", "p02956_case_034", "p02956_case_035", "p02956_case_036", "p02956_case_037", "p02956_case_038", "p02956_case_039", "p02956_case_040", "p02956_case_041", "p02956_case_042", "p02956_case_043", "p02956_case_044", "p02956_case_045", "p02956_case_046", "p02956_case_047", "p02956_case_048", "p02956_case_049", "p02956_case_050", "p02956_case_051", "p02956_case_052", "p02956_case_053", "p02956_case_054", "p02956_case_055", "p02956_case_056", "p02956_case_057", "p02956_case_058", "p02956_case_059", "p02956_case_060", "p02956_case_061", "p02956_case_062", "p02956_case_063", "p02956_case_064", "p02956_case_065", "p02956_case_066", "p02956_case_067", "p02956_case_068", "p02956_case_069", "p02956_case_070", "p02956_case_071", "p02956_case_072", "p02956_case_073", "p02956_case_074", "p02956_case_075", "p02956_case_076", "p02956_case_077", "p02956_case_078", "p02956_case_079", "p02956_case_080", "p02956_case_081", "p02956_case_082", "p02956_case_083", "p02956_case_084", "p02956_case_085", "p02956_case_086", "p02956_case_087", "p02956_case_088", "p02956_case_089", "p02956_case_090", "p02956_case_091", "p02956_case_092", "p02956_case_093", "p02956_case_094", "p02956_case_095", "p02956_case_096", "p02956_case_097", "p02956_case_098", "p02956_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "executable_AST_equal_except_explicit_explanatory_string_removal_and_all_frozen_inputs_checker_pass", "fast_code": "N = int(eval(input()))\nxy = [tuple(map(int, input().split())) for _ in range(N)]\nmod = 998244353\n\n\nclass BIT:\n\n def __init__(self, n):\n self.n = n\n self.data = [0] * (n + 1)\n self.el = [0] * (n + 1)\n\n def sum(self, i):\n s = 0\n while i > 0:\n s += self.data[i]\n i -= i & -i\n return s\n\n def add(self, i, x):\n self.el[i] += x\n while i <= self.n:\n self.data[i] += x\n i += i & -i\n\n def query(self, i, j=None):\n if j is None:\n return self.el[i]\n return self.sum(j) - self.sum(i)\n\n\nxy2 = []\nfor i in range(N):\n x, y = xy[i]\n x += 10**9\n y += 10**9\n xy2.append(y << 80 | x << 40 | i)\n\n\nxy2 = sorted(xy2)\nmask = (1 << 40) - 1\ny_order = [0] * N\ny_compress = {}\nfor j, y in enumerate(xy2):\n i = y & mask\n y >>= 40\n x = y & mask\n x -= 10**9\n y >>= 40\n y -= 10**9\n y_order[i] = j\n y_compress[y] = j + 1\nxy2 = []\nfor i in range(N):\n x, y = xy[i]\n x += 10**9\n y += 10**9\n xy2.append(x << 80 | y << 40 | i)\nxy2 = sorted(xy2)\nmask = (1 << 40) - 1\nbit = BIT(N)\nans = 0\nmemo = [0] * N\n\npow2 = [1] * (N + 1)\nfor i in range(1, N + 1):\n pow2[i] = pow2[i - 1] * 2 % mod\nfor x in xy2:\n i = x & mask\n x >>= 40\n y = x & mask\n y -= 10**9\n x >>= 40\n x -= 10**9\n y = y_compress[y]\n bit.add(y, 1)\n n1 = bit.query(y - 1, N) - 1\n n2 = bit.query(0, y) - 1\n n3 = N - y - n1\n n4 = y - n2 - 1\n prod14 = (pow2[n1] - 1) * (pow2[n4] - 1) * pow2[n2 + n3] % mod\n prod23 = (pow2[n2] - 1) * (pow2[n3] - 1) * pow2[n1 + n4] % mod\n prod1234 = (pow2[n1] - 1) * (pow2[n4] - 1) * (pow2[n2] - 1) * (pow2[n3] - 1) % mod\n ans += pow2[N - 1] + prod14 + prod23 - prod1234\n ans %= mod\nprint(ans)\n", "fast_code_sha256": "e0d090130d6b10ccf7d87a7444c23003c3fd9f56cfbf7dbfab8300b3f134c2a2", "fast_id": "p02956_e9bbbe9447a6c60a4b9155498e9380d396e0f3ccdafb34dba39fd6fec9428149", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "# 解説放送の方針\n# 平面走査をし、各点について、左上、左下、右上、右下にある点を数え、計算する。\n# 解説放送ではBITを2本使っていたが、座標圧縮の結果を利用してBIT1本で済むようにした\nN = int(eval(input()))\nxy = [tuple(map(int, input().split())) for _ in range(N)]\nmod = 998244353\n\n\nclass BIT:\n \"\"\"https://tjkendev.github.io/procon-library/python/range_query/bit.html\"\"\"\n\n def __init__(self, n):\n self.n = n\n self.data = [0] * (n + 1)\n self.el = [0] * (n + 1)\n\n def sum(self, i):\n s = 0\n while i > 0:\n s += self.data[i]\n i -= i & -i\n return s\n\n def add(self, i, x):\n self.el[i] += x\n while i <= self.n:\n self.data[i] += x\n i += i & -i\n\n def query(self, i, j=None):\n if j is None:\n return self.el[i]\n return self.sum(j) - self.sum(i)\n\n\n# 平面走査のためのソート(高速化のため1次元にしてソート)\nxy2 = []\nfor i in range(N):\n x, y = xy[i]\n x += 10**9\n y += 10**9\n xy2.append(y << 80 | x << 40 | i)\n# ソート後の復元+座標圧縮用の辞書作成\n# 座標圧縮: 小さいyから順に1,2,3...と値を割り振る。\nxy2 = sorted(xy2)\nmask = (1 << 40) - 1\ny_order = [0] * N\ny_compress = {}\nfor j, y in enumerate(xy2):\n i = y & mask\n y >>= 40\n x = y & mask\n x -= 10**9\n y >>= 40\n y -= 10**9\n y_order[i] = j\n y_compress[y] = j + 1\nxy2 = []\nfor i in range(N):\n x, y = xy[i]\n x += 10**9\n y += 10**9\n xy2.append(x << 80 | y << 40 | i)\nxy2 = sorted(xy2)\nmask = (1 << 40) - 1\nbit = BIT(N)\nans = 0\nmemo = [0] * N\n# いちいち2^nを計算していると遅いのでテーブル作成\npow2 = [1] * (N + 1)\nfor i in range(1, N + 1):\n pow2[i] = pow2[i - 1] * 2 % mod\nfor x in xy2:\n i = x & mask\n x >>= 40\n y = x & mask\n y -= 10**9\n x >>= 40\n x -= 10**9\n y = y_compress[y]\n bit.add(y, 1)\n \"\"\"\n 今現在みている点より左上と左下にある点の個数(今の点は含まない。以下同じ)。\n BITを使って求める。\n \"\"\"\n n1 = bit.query(y - 1, N) - 1\n n2 = bit.query(0, y) - 1\n \"\"\"\n 右上と右下。座標圧縮の結果を利用。(N-y(座標圧縮済))はある点より上にある点の総数。\n そこからn1(走査済みの点の個数)を引くことで、まだ走査していない点の個数を求めることができる。\n \"\"\"\n n3 = N - y - n1\n n4 = y - n2 - 1\n prod14 = (pow2[n1] - 1) * (pow2[n4] - 1) * pow2[n2 + n3] % mod\n prod23 = (pow2[n2] - 1) * (pow2[n3] - 1) * pow2[n1 + n4] % mod\n prod1234 = (pow2[n1] - 1) * (pow2[n4] - 1) * (pow2[n2] - 1) * (pow2[n3] - 1) % mod\n ans += pow2[N - 1] + prod14 + prod23 - prod1234\n ans %= mod\nprint(ans)\n", "measured_fast_code_sha256": "e9bbbe9447a6c60a4b9155498e9380d396e0f3ccdafb34dba39fd6fec9428149", "measured_slow_code": "import sys\n\nreadline = sys.stdin.readline\n\n\nclass BIT:\n # 1-indexed\n def __init__(self, n):\n self.size = n\n self.tree = [0] * (n + 1)\n self.p = 2 ** (n.bit_length() - 1)\n self.dep = n.bit_length()\n\n def get(self, i):\n s = 0\n while i > 0:\n s += self.tree[i]\n i -= i & -i\n return s\n\n def add(self, i, x):\n while i <= self.size:\n self.tree[i] += x\n i += i & -i\n\n def bl(self, v):\n if v <= 0:\n return -1\n s = 0\n k = self.p\n for _ in range(self.dep):\n if s + k <= self.size and self.tree[s + k] < v:\n s += k\n v -= self.tree[s + k]\n k //= 2\n return s + 1\n\n\ndef compress(L):\n L2 = list(set(L))\n L2.sort()\n C = {v: k for k, v in enumerate(L2)}\n return L2, C\n\n\nMOD = 998244353\nN = int(readline())\nXY = [list(map(int, readline().split())) for _ in range(N)]\nXY.sort()\nZ = [-(10**10)]\nfor x, y in XY:\n Z.append(y)\n_, CC = compress(Z)\nXY = [(x, CC[y]) for x, y in XY]\nSS, SB, BS, BB = [None] * N, [None] * N, [None] * N, [None] * N\nT = BIT(N)\nfor i in range(N):\n k = i\n y = XY[i][1]\n l = T.get(y)\n SS[i] = l\n SB[i] = k - l\n T.add(y, 1)\nT = BIT(N)\nfor i in range(N - 1, -1, -1):\n k = N - 1 - i\n y = XY[i][1]\n l = T.get(y)\n BS[i] = l\n BB[i] = k - l\n T.add(y, 1)\nP2 = [1] * 1341398\nfor i in range(1, len(P2)):\n P2[i] = P2[i - 1] * 2 % MOD\nans = 0\nfor i in range(N):\n ss = SS[i]\n sb = SB[i]\n bs = BS[i]\n bb = BB[i]\n ans = (ans + P2[N - 1]) % MOD\n ans = (ans + P2[N - 1 - ss - bb] * (P2[ss] - 1) * (P2[bb] - 1)) % MOD\n ans = (ans + P2[N - 1 - sb - bs] * (P2[sb] - 1) * (P2[bs] - 1)) % MOD\n ans = (ans - (P2[sb] - 1) * (P2[bs] - 1) * (P2[ss] - 1) * (P2[bb] - 1)) % MOD\nprint(ans)\n", "measured_slow_code_sha256": "8042986ea709f7be4a36940bb65dd281b3740a58e66e7c9edcc0eeee56205242", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 31.27422807761866, "pair_id": "python_v2_70834c6afa692f25d7377f3e", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02956", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02956_e9bbbe9447a6c60a4b9155498e9380d396e0f3ccdafb34dba39fd6fec9428149.jsonl.gz", "inputs": "reproduction/python/inputs/p02956.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02956_8042986ea709f7be4a36940bb65dd281b3740a58e66e7c9edcc0eeee56205242.jsonl.gz"}, "slow_code": "import sys\n\nreadline = sys.stdin.readline\n\n\nclass BIT:\n\n def __init__(self, n):\n self.size = n\n self.tree = [0] * (n + 1)\n self.p = 2 ** (n.bit_length() - 1)\n self.dep = n.bit_length()\n\n def get(self, i):\n s = 0\n while i > 0:\n s += self.tree[i]\n i -= i & -i\n return s\n\n def add(self, i, x):\n while i <= self.size:\n self.tree[i] += x\n i += i & -i\n\n def bl(self, v):\n if v <= 0:\n return -1\n s = 0\n k = self.p\n for _ in range(self.dep):\n if s + k <= self.size and self.tree[s + k] < v:\n s += k\n v -= self.tree[s + k]\n k //= 2\n return s + 1\n\n\ndef compress(L):\n L2 = list(set(L))\n L2.sort()\n C = {v: k for k, v in enumerate(L2)}\n return L2, C\n\n\nMOD = 998244353\nN = int(readline())\nXY = [list(map(int, readline().split())) for _ in range(N)]\nXY.sort()\nZ = [-(10**10)]\nfor x, y in XY:\n Z.append(y)\n_, CC = compress(Z)\nXY = [(x, CC[y]) for x, y in XY]\nSS, SB, BS, BB = [None] * N, [None] * N, [None] * N, [None] * N\nT = BIT(N)\nfor i in range(N):\n k = i\n y = XY[i][1]\n l = T.get(y)\n SS[i] = l\n SB[i] = k - l\n T.add(y, 1)\nT = BIT(N)\nfor i in range(N - 1, -1, -1):\n k = N - 1 - i\n y = XY[i][1]\n l = T.get(y)\n BS[i] = l\n BB[i] = k - l\n T.add(y, 1)\nP2 = [1] * 1341398\nfor i in range(1, len(P2)):\n P2[i] = P2[i - 1] * 2 % MOD\nans = 0\nfor i in range(N):\n ss = SS[i]\n sb = SB[i]\n bs = BS[i]\n bb = BB[i]\n ans = (ans + P2[N - 1]) % MOD\n ans = (ans + P2[N - 1 - ss - bb] * (P2[ss] - 1) * (P2[bb] - 1)) % MOD\n ans = (ans + P2[N - 1 - sb - bs] * (P2[sb] - 1) * (P2[bs] - 1)) % MOD\n ans = (ans - (P2[sb] - 1) * (P2[bs] - 1) * (P2[ss] - 1) * (P2[bb] - 1)) % MOD\nprint(ans)\n", "slow_code_sha256": "e43f92f24f0e96eef9c4232af95007e4efdc9b0608e734256316ff5cc0636981", "slow_id": "p02956_8042986ea709f7be4a36940bb65dd281b3740a58e66e7c9edcc0eeee56205242", "speedup": 39.99118136902082, "stratum": "8+", "within_pair_jaccard": 0.2857142857142857, "workload": {"case_count": 100, "description": "For each nonempty subset of N plane points, count all original points in its smallest axis-aligned bounding rectangle, including boundaries. Sum these counts modulo 998244353. All x coordinates are distinct, as are all y coordinates. Observed inputs: N=1..200000 (median 1000); x_i=-1000000000..1000000000; y_i=-1000000000..999999000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 4200009, "median": 20809.0, "min": 20}, "input_format": ["N\nx_1 y_1\n...\nx_N y_N"], "input_format_status": "source_input_section", "input_lines": {"max": 200001, "median": 1001.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 400001, "median": 2001.0, "min": 3}}} -{"case_ids": ["p03136_case_000", "p03136_case_001", "p03136_case_002", "p03136_case_003", "p03136_case_004", "p03136_case_005", "p03136_case_006", "p03136_case_007", "p03136_case_008", "p03136_case_009", "p03136_case_010", "p03136_case_011", "p03136_case_012", "p03136_case_013", "p03136_case_014", "p03136_case_015", "p03136_case_016", "p03136_case_017", "p03136_case_018", "p03136_case_019", "p03136_case_020", "p03136_case_021", "p03136_case_022", "p03136_case_023", "p03136_case_024", "p03136_case_025", "p03136_case_026", "p03136_case_027", "p03136_case_028", "p03136_case_029", "p03136_case_030", "p03136_case_031", "p03136_case_032", "p03136_case_033", "p03136_case_034", "p03136_case_035", "p03136_case_036", "p03136_case_037", "p03136_case_038", "p03136_case_039", "p03136_case_040", "p03136_case_041", "p03136_case_042", "p03136_case_043", "p03136_case_044", "p03136_case_045", "p03136_case_046", "p03136_case_047", "p03136_case_048", "p03136_case_049", "p03136_case_050", "p03136_case_051", "p03136_case_052", "p03136_case_053", "p03136_case_054", "p03136_case_055", "p03136_case_056", "p03136_case_057", "p03136_case_058", "p03136_case_059", "p03136_case_060", "p03136_case_061", "p03136_case_062", "p03136_case_063", "p03136_case_064", "p03136_case_065", "p03136_case_066", "p03136_case_067", "p03136_case_068", "p03136_case_069", "p03136_case_070", "p03136_case_071", "p03136_case_072", "p03136_case_073", "p03136_case_074", "p03136_case_075", "p03136_case_076", "p03136_case_077", "p03136_case_078", "p03136_case_079", "p03136_case_080", "p03136_case_081", "p03136_case_082", "p03136_case_083", "p03136_case_084", "p03136_case_085", "p03136_case_086", "p03136_case_087", "p03136_case_088", "p03136_case_089", "p03136_case_090", "p03136_case_091", "p03136_case_092", "p03136_case_093", "p03136_case_094", "p03136_case_095", "p03136_case_096", "p03136_case_097", "p03136_case_098", "p03136_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\nli = list(map(int, input().split()))\nli.sort()\nif li[-1] * 2 >= sum(li):\n print(\"No\")\nelse:\n print(\"Yes\")\n", "fast_code_sha256": "7299728a192f6d4f1f3bc117c8cc117427a2ea2ae6dca3eec0750daa183876ac", "fast_id": "p03136_7299728a192f6d4f1f3bc117c8cc117427a2ea2ae6dca3eec0750daa183876ac", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\nli = list(map(int, input().split()))\nli.sort()\nif li[-1] * 2 >= sum(li):\n print(\"No\")\nelse:\n print(\"Yes\")\n", "measured_fast_code_sha256": "7299728a192f6d4f1f3bc117c8cc117427a2ea2ae6dca3eec0750daa183876ac", "measured_slow_code": "import numpy as np\n\nN = int(eval(input()))\nL = np.array(list(map(int, input().split())))\nL[::-1].sort()\nif L[0] < L[1:].sum():\n print(\"Yes\")\nelse:\n print(\"No\")\n", "measured_slow_code_sha256": "c1d13b37a289cb233c6849d4a958851f4c3b4f284375eaec46ef2e5a34eb2366", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1321.6715333861027, "pair_id": "python_v2_58431156ed088b2dc9e0f2be", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03136", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03136_7299728a192f6d4f1f3bc117c8cc117427a2ea2ae6dca3eec0750daa183876ac.jsonl.gz", "inputs": "reproduction/python/inputs/p03136.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03136_c1d13b37a289cb233c6849d4a958851f4c3b4f284375eaec46ef2e5a34eb2366.jsonl.gz"}, "slow_code": "import numpy as np\n\nN = int(eval(input()))\nL = np.array(list(map(int, input().split())))\nL[::-1].sort()\nif L[0] < L[1:].sum():\n print(\"Yes\")\nelse:\n print(\"No\")\n", "slow_code_sha256": "c1d13b37a289cb233c6849d4a958851f4c3b4f284375eaec46ef2e5a34eb2366", "slow_id": "p03136_c1d13b37a289cb233c6849d4a958851f4c3b4f284375eaec46ef2e5a34eb2366", "speedup": 1319.8860634778418, "stratum": "8+", "within_pair_jaccard": 0.56, "workload": {"case_count": 100, "description": "Determine whether N supplied positive side lengths L_i can form a nondegenerate polygon in the plane; convexity is not required. Observed inputs: N=3..10 (median 6); L_i=1..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 43, "median": 17.0, "min": 8}, "input_format": ["N\nL_1 ... L_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 11, "median": 7.0, "min": 4}}} -{"case_ids": ["p03173_case_000", "p03173_case_001", "p03173_case_002", "p03173_case_003", "p03173_case_004", "p03173_case_005", "p03173_case_006", "p03173_case_007", "p03173_case_008", "p03173_case_009", "p03173_case_010", "p03173_case_011", "p03173_case_012", "p03173_case_013", "p03173_case_014", "p03173_case_015", "p03173_case_016", "p03173_case_017", "p03173_case_018", "p03173_case_019", "p03173_case_020", "p03173_case_021", "p03173_case_022", "p03173_case_023", "p03173_case_024", "p03173_case_025", "p03173_case_026", "p03173_case_027", "p03173_case_028", "p03173_case_029", "p03173_case_030", "p03173_case_031", "p03173_case_032", "p03173_case_033", "p03173_case_034", "p03173_case_035", "p03173_case_036", "p03173_case_037", "p03173_case_038", "p03173_case_039", "p03173_case_040", "p03173_case_041", "p03173_case_042", "p03173_case_043", "p03173_case_044", "p03173_case_045", "p03173_case_046", "p03173_case_047", "p03173_case_048", "p03173_case_049", "p03173_case_050", "p03173_case_051", "p03173_case_052", "p03173_case_053", "p03173_case_054", "p03173_case_055", "p03173_case_056", "p03173_case_057", "p03173_case_058", "p03173_case_059", "p03173_case_060", "p03173_case_061", "p03173_case_062", "p03173_case_063", "p03173_case_064", "p03173_case_065", "p03173_case_066", "p03173_case_067", "p03173_case_068", "p03173_case_069", "p03173_case_070", "p03173_case_071", "p03173_case_072", "p03173_case_073", "p03173_case_074", "p03173_case_075", "p03173_case_076", "p03173_case_077", "p03173_case_078", "p03173_case_079", "p03173_case_080", "p03173_case_081", "p03173_case_082", "p03173_case_083", "p03173_case_084", "p03173_case_085", "p03173_case_086", "p03173_case_087", "p03173_case_088", "p03173_case_089", "p03173_case_090", "p03173_case_091", "p03173_case_092", "p03173_case_093", "p03173_case_094", "p03173_case_095", "p03173_case_096", "p03173_case_097", "p03173_case_098", "p03173_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def resolve():\n N = int(eval(input()))\n a = list(map(int, input().split()))\n DP = [[2**63 - 1 for _ in range(N + 1)] for _ in range(N)]\n SUM = [[0 for _ in range(N + 1)] for _ in range(N + 1)]\n RANGE = [[0 for _ in range(N + 1)] for _ in range(N + 1)]\n SUM[0][0] = 0\n for i in range(N):\n for j in range(i, N):\n SUM[i][j + 1] = SUM[i][j] + a[j]\n if i < j:\n SUM[i + 1][j] = SUM[i][j] - a[i]\n for i in range(N):\n j = i + 1\n DP[i][j] = 0\n RANGE[i][j] = i\n for w in range(2, N + 1):\n for i in range(N + 1 - w):\n j = i + w\n for k in range(RANGE[i][j - 1], RANGE[i + 1][j] + 1):\n s = DP[i][k] + DP[k][j] + SUM[i][j]\n if DP[i][j] > s:\n DP[i][j] = s\n RANGE[i][j] = k\n print((DP[0][N]))\n\n\nresolve()\n", "fast_code_sha256": "48ff09bc20e8f8798770efd549a5ac6494d01b7553d3e063e63a4ebd4e5dd723", "fast_id": "p03173_48ff09bc20e8f8798770efd549a5ac6494d01b7553d3e063e63a4ebd4e5dd723", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def resolve():\n N = int(eval(input()))\n a = list(map(int, input().split()))\n DP = [[2**63 - 1 for _ in range(N + 1)] for _ in range(N)]\n SUM = [[0 for _ in range(N + 1)] for _ in range(N + 1)]\n RANGE = [[0 for _ in range(N + 1)] for _ in range(N + 1)]\n SUM[0][0] = 0\n for i in range(N):\n for j in range(i, N):\n SUM[i][j + 1] = SUM[i][j] + a[j]\n if i < j:\n SUM[i + 1][j] = SUM[i][j] - a[i]\n for i in range(N):\n j = i + 1\n DP[i][j] = 0\n RANGE[i][j] = i\n for w in range(2, N + 1):\n for i in range(N + 1 - w):\n j = i + w\n for k in range(RANGE[i][j - 1], RANGE[i + 1][j] + 1):\n s = DP[i][k] + DP[k][j] + SUM[i][j]\n if DP[i][j] > s:\n DP[i][j] = s\n RANGE[i][j] = k\n print((DP[0][N]))\n\n\nresolve()\n", "measured_fast_code_sha256": "48ff09bc20e8f8798770efd549a5ac6494d01b7553d3e063e63a4ebd4e5dd723", "measured_slow_code": "from numpy import *\n\nn, a = open(0)\nn = int(n)\na = cumsum(int64([0] + a.split()))\ndp = zeros((n, n + 1), \"i8\")\nfor k in range(1, n):\n l = arange(n - k)\n r = arange(k + 1, n + 1)\n m = (arange(1, k + 1) + l[:, newaxis]).T\n dp[l, r] = amin(dp[l, m] + dp[m, r], 0) + a[r] - a[l]\nprint((dp[0, n]))\n", "measured_slow_code_sha256": "bfaa89da3b2a7dfb7699a6e650ad26181e45afd981d8d5555f6631c8c9e83d02", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 6.698496449000636, "pair_id": "python_v2_0fc4307e787a6fd1c10abcda", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03173", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03173_48ff09bc20e8f8798770efd549a5ac6494d01b7553d3e063e63a4ebd4e5dd723.jsonl.gz", "inputs": "reproduction/python/inputs/p03173.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03173_bfaa89da3b2a7dfb7699a6e650ad26181e45afd981d8d5555f6631c8c9e83d02.jsonl.gz"}, "slow_code": "from numpy import *\n\nn, a = open(0)\nn = int(n)\na = cumsum(int64([0] + a.split()))\ndp = zeros((n, n + 1), \"i8\")\nfor k in range(1, n):\n l = arange(n - k)\n r = arange(k + 1, n + 1)\n m = (arange(1, k + 1) + l[:, newaxis]).T\n dp[l, r] = amin(dp[l, m] + dp[m, r], 0) + a[r] - a[l]\nprint((dp[0, n]))\n", "slow_code_sha256": "bfaa89da3b2a7dfb7699a6e650ad26181e45afd981d8d5555f6631c8c9e83d02", "slow_id": "p03173_bfaa89da3b2a7dfb7699a6e650ad26181e45afd981d8d5555f6631c8c9e83d02", "speedup": 15.739292352347357, "stratum": "8+", "within_pair_jaccard": 0.2222222222222222, "workload": {"case_count": 100, "description": "Repeatedly merge two adjacent slimes of sizes x and y into one of size x+y, paying x+y. Preserve the relative order of remaining slimes and minimize total cost to merge all N. Observed inputs: N=2..400 (median 100); a_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 4404, "median": 404.0, "min": 6}, "input_format": ["N\na_1 ... a_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 401, "median": 101.0, "min": 3}}} -{"case_ids": ["p02792_case_000", "p02792_case_001", "p02792_case_002", "p02792_case_003", "p02792_case_004", "p02792_case_005", "p02792_case_006", "p02792_case_007", "p02792_case_008", "p02792_case_009", "p02792_case_010", "p02792_case_011", "p02792_case_012", "p02792_case_013", "p02792_case_014", "p02792_case_015", "p02792_case_016", "p02792_case_017", "p02792_case_018", "p02792_case_019", "p02792_case_020", "p02792_case_021", "p02792_case_022", "p02792_case_023", "p02792_case_024", "p02792_case_025", "p02792_case_026", "p02792_case_027", "p02792_case_028", "p02792_case_029", "p02792_case_030", "p02792_case_031", "p02792_case_032", "p02792_case_033", "p02792_case_034", "p02792_case_035", "p02792_case_036", "p02792_case_037", "p02792_case_038", "p02792_case_039", "p02792_case_040", "p02792_case_041", "p02792_case_042", "p02792_case_043", "p02792_case_044", "p02792_case_045", "p02792_case_046", "p02792_case_047", "p02792_case_048", "p02792_case_049", "p02792_case_050", "p02792_case_051", "p02792_case_052", "p02792_case_053", "p02792_case_054", "p02792_case_055", "p02792_case_056", "p02792_case_057", "p02792_case_058", "p02792_case_059", "p02792_case_060", "p02792_case_061", "p02792_case_062", "p02792_case_063", "p02792_case_064", "p02792_case_065", "p02792_case_066", "p02792_case_067", "p02792_case_068", "p02792_case_069", "p02792_case_070", "p02792_case_071", "p02792_case_072", "p02792_case_073", "p02792_case_074", "p02792_case_075", "p02792_case_076", "p02792_case_077", "p02792_case_078", "p02792_case_079", "p02792_case_080", "p02792_case_081", "p02792_case_082", "p02792_case_083", "p02792_case_084", "p02792_case_085", "p02792_case_086", "p02792_case_087", "p02792_case_088", "p02792_case_089", "p02792_case_090", "p02792_case_091", "p02792_case_092", "p02792_case_093", "p02792_case_094", "p02792_case_095", "p02792_case_096", "p02792_case_097", "p02792_case_098", "p02792_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from itertools import product\n\n\ndef solve(string):\n d = len(string)\n if d == 1:\n return string\n s0, ss, sn = int(string[0]), int(string[1:-1] or 0), int(string[-1])\n t = [[0] * 10] + [[int(\"1\" * (d - 2) or 0)] * 10 for _ in range(9)]\n for i in range(1, 10):\n t[i][i] += 1\n for i, j in product(list(range(1, s0)), list(range(10))):\n t[i][j] += 10 ** (d - 2)\n for j in range(sn + 1):\n t[s0][j] += ss + 1\n for j in range(sn + 1, 10):\n t[s0][j] += ss\n return str(sum(t[i][j] * t[j][i] for i, j in product(list(range(1, 10)), repeat=2)))\n\n\nif __name__ == \"__main__\":\n import sys\n\n print((solve(sys.stdin.read().strip())))\n", "fast_code_sha256": "3cdff8e4175870a02e4061206fd8f6e8c2d7f81e837019cd00e38a6f5ab341db", "fast_id": "p02792_3cdff8e4175870a02e4061206fd8f6e8c2d7f81e837019cd00e38a6f5ab341db", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from itertools import product\n\n\ndef solve(string):\n d = len(string)\n if d == 1:\n return string\n s0, ss, sn = int(string[0]), int(string[1:-1] or 0), int(string[-1])\n t = [[0] * 10] + [[int(\"1\" * (d - 2) or 0)] * 10 for _ in range(9)]\n for i in range(1, 10):\n t[i][i] += 1\n for i, j in product(list(range(1, s0)), list(range(10))):\n t[i][j] += 10 ** (d - 2)\n for j in range(sn + 1):\n t[s0][j] += ss + 1\n for j in range(sn + 1, 10):\n t[s0][j] += ss\n return str(sum(t[i][j] * t[j][i] for i, j in product(list(range(1, 10)), repeat=2)))\n\n\nif __name__ == \"__main__\":\n import sys\n\n print((solve(sys.stdin.read().strip())))\n", "measured_fast_code_sha256": "3cdff8e4175870a02e4061206fd8f6e8c2d7f81e837019cd00e38a6f5ab341db", "measured_slow_code": "import sys\n\nreadline = sys.stdin.readline\nN = int(readline())\nfrom collections import defaultdict\n\ndic = defaultdict(int)\nfor i in range(1, N + 1):\n s = str(i)\n dic[(int(s[0]), int(s[-1]))] += 1\nans = 0\nfor i in range(1, 10):\n for j in range(1, 10):\n ans += dic[(i, j)] * dic[(j, i)]\nprint(ans)\n", "measured_slow_code_sha256": "b3bc7702b06f82679063b3095f0a30e90403151c8f113bc72663aefe8ab77a82", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.1045357220910677, "pair_id": "python_v2_0a0a723d0ab59ea1ef3d3873", "per_case_slow_code_faster_fraction": 0.44, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02792", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02792_3cdff8e4175870a02e4061206fd8f6e8c2d7f81e837019cd00e38a6f5ab341db.jsonl.gz", "inputs": "reproduction/python/inputs/p02792.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02792_b3bc7702b06f82679063b3095f0a30e90403151c8f113bc72663aefe8ab77a82.jsonl.gz"}, "slow_code": "import sys\n\nreadline = sys.stdin.readline\nN = int(readline())\nfrom collections import defaultdict\n\ndic = defaultdict(int)\nfor i in range(1, N + 1):\n s = str(i)\n dic[(int(s[0]), int(s[-1]))] += 1\nans = 0\nfor i in range(1, 10):\n for j in range(1, 10):\n ans += dic[(i, j)] * dic[(j, i)]\nprint(ans)\n", "slow_code_sha256": "b3bc7702b06f82679063b3095f0a30e90403151c8f113bc72663aefe8ab77a82", "slow_id": "p02792_b3bc7702b06f82679063b3095f0a30e90403151c8f113bc72663aefe8ab77a82", "speedup": 6.304056671502351, "stratum": "4-8", "within_pair_jaccard": 0.32608695652173914, "workload": {"case_count": 100, "description": "Count ordered pairs of positive integers (A,B), each at most N, whose decimal first and last digits are reversed between A and B. Leading zeros are not used. Observed inputs: N=1..200000 (median 106.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 7, "median": 4.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p03695_case_000", "p03695_case_001", "p03695_case_002", "p03695_case_003", "p03695_case_004", "p03695_case_005", "p03695_case_006", "p03695_case_007", "p03695_case_008", "p03695_case_009", "p03695_case_010", "p03695_case_011", "p03695_case_012", "p03695_case_013", "p03695_case_014", "p03695_case_015", "p03695_case_016", "p03695_case_017", "p03695_case_018", "p03695_case_019", "p03695_case_020", "p03695_case_021", "p03695_case_022", "p03695_case_023", "p03695_case_024", "p03695_case_025", "p03695_case_026", "p03695_case_027", "p03695_case_028", "p03695_case_029", "p03695_case_030", "p03695_case_031", "p03695_case_032", "p03695_case_033", "p03695_case_034", "p03695_case_035", "p03695_case_036", "p03695_case_037", "p03695_case_038", "p03695_case_039", "p03695_case_040", "p03695_case_041", "p03695_case_042", "p03695_case_043", "p03695_case_044", "p03695_case_045", "p03695_case_046", "p03695_case_047", "p03695_case_048", "p03695_case_049", "p03695_case_050", "p03695_case_051", "p03695_case_052", "p03695_case_053", "p03695_case_054", "p03695_case_055", "p03695_case_056", "p03695_case_057", "p03695_case_058", "p03695_case_059", "p03695_case_060", "p03695_case_061", "p03695_case_062", "p03695_case_063", "p03695_case_064", "p03695_case_065", "p03695_case_066", "p03695_case_067", "p03695_case_068", "p03695_case_069", "p03695_case_070", "p03695_case_071", "p03695_case_072", "p03695_case_073", "p03695_case_074", "p03695_case_075", "p03695_case_076", "p03695_case_077", "p03695_case_078", "p03695_case_079", "p03695_case_080", "p03695_case_081", "p03695_case_082", "p03695_case_083", "p03695_case_084", "p03695_case_085", "p03695_case_086", "p03695_case_087", "p03695_case_088", "p03695_case_089", "p03695_case_090", "p03695_case_091", "p03695_case_092", "p03695_case_093", "p03695_case_094", "p03695_case_095", "p03695_case_096", "p03695_case_097", "p03695_case_098", "p03695_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "a = int(eval(input()))\nb = list(map(int, input().split()))\nc = {0: 0, 1: 0, 2: 0, 3: 0, 4: 0, 5: 0, 6: 0, 7: 0}\nd = 0\nfor i in b:\n if 1 <= i <= 399:\n c[0] += 1\n elif 400 <= i <= 799:\n c[1] += 1\n elif 800 <= i <= 1199:\n c[2] += 1\n elif 1200 <= i <= 1599:\n c[3] += 1\n elif 1600 <= i <= 1999:\n c[4] += 1\n elif 2000 <= i <= 2399:\n c[5] += 1\n elif 2400 <= i <= 2799:\n c[6] += 1\n elif 2800 <= i <= 3199:\n c[7] += 1\n else:\n d += 1\ne = 0\nfor k, v in list(c.items()):\n if v != 0:\n e += 1\nprint((str(max(e, 1)) + \" \" + str(e + d)))\n", "fast_code_sha256": "f4be1cbc96e84fadced525db45b70d084e5f4671c327df573dbd112c4a9f962c", "fast_id": "p03695_f4be1cbc96e84fadced525db45b70d084e5f4671c327df573dbd112c4a9f962c", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "a = int(eval(input()))\nb = list(map(int, input().split()))\nc = {0: 0, 1: 0, 2: 0, 3: 0, 4: 0, 5: 0, 6: 0, 7: 0}\nd = 0\nfor i in b:\n if 1 <= i <= 399:\n c[0] += 1\n elif 400 <= i <= 799:\n c[1] += 1\n elif 800 <= i <= 1199:\n c[2] += 1\n elif 1200 <= i <= 1599:\n c[3] += 1\n elif 1600 <= i <= 1999:\n c[4] += 1\n elif 2000 <= i <= 2399:\n c[5] += 1\n elif 2400 <= i <= 2799:\n c[6] += 1\n elif 2800 <= i <= 3199:\n c[7] += 1\n else:\n d += 1\ne = 0\nfor k, v in list(c.items()):\n if v != 0:\n e += 1\nprint((str(max(e, 1)) + \" \" + str(e + d)))\n", "measured_fast_code_sha256": "f4be1cbc96e84fadced525db45b70d084e5f4671c327df573dbd112c4a9f962c", "measured_slow_code": "from bisect import bisect_left\nimport numpy as np\n\nn = int(input())\na = map(int, input().split())\nborder = np.arange(399, 3200, 400)\ncnt = [0] * (len(border) + 1)\nfor i in a:\n cnt[bisect_left(border, i)] += 1\nk = np.count_nonzero(cnt[:-1])\nprint(k, k + cnt[-1]) if k != 0 else print(1, cnt[-1])\n", "measured_slow_code_sha256": "7f271d923060c17e2c49a8d7f271bc0668cd1f8f85b998cc6651cd42c9e43961", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 361.9941897381355, "pair_id": "python_v2_86d9fa1367bf91edf7e67e0f", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03695", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03695_f4be1cbc96e84fadced525db45b70d084e5f4671c327df573dbd112c4a9f962c.jsonl.gz", "inputs": "reproduction/python/inputs/p03695.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03695_7f271d923060c17e2c49a8d7f271bc0668cd1f8f85b998cc6651cd42c9e43961.jsonl.gz"}, "slow_code": "from bisect import bisect_left\nimport numpy as np\n\nn = int(input())\na = map(int, input().split())\nborder = np.arange(399, 3200, 400)\ncnt = [0] * (len(border) + 1)\nfor i in a:\n cnt[bisect_left(border, i)] += 1\nk = np.count_nonzero(cnt[:-1])\nprint(k, k + cnt[-1]) if k != 0 else print(1, cnt[-1])\n", "slow_code_sha256": "7f271d923060c17e2c49a8d7f271bc0668cd1f8f85b998cc6651cd42c9e43961", "slow_id": "p03695_7f271d923060c17e2c49a8d7f271bc0668cd1f8f85b998cc6651cd42c9e43961", "speedup": 333.23323495987523, "stratum": "8+", "within_pair_jaccard": 0.26666666666666666, "workload": {"case_count": 100, "description": "Ratings below 3200 fix one of eight colors in bands 1..399,400..799,...,2800..3199. Each user rated at least 3200 may choose any color, including new ones. Find minimum and maximum distinct-color counts among N users. Observed inputs: N=1..100 (median 13); a_i=1..4800.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 504, "median": 66.0, "min": 4}, "input_format": ["N\na_1 ... a_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 101, "median": 14.0, "min": 2}}} -{"case_ids": ["p03294_case_000", "p03294_case_001", "p03294_case_002", "p03294_case_003", "p03294_case_004", "p03294_case_005", "p03294_case_006", "p03294_case_007", "p03294_case_008", "p03294_case_009", "p03294_case_010", "p03294_case_011", "p03294_case_012", "p03294_case_013", "p03294_case_014", "p03294_case_015", "p03294_case_016", "p03294_case_017", "p03294_case_018", "p03294_case_019", "p03294_case_020", "p03294_case_021", "p03294_case_022", "p03294_case_023", "p03294_case_024", "p03294_case_025", "p03294_case_026", "p03294_case_027", "p03294_case_028", "p03294_case_029", "p03294_case_030", "p03294_case_031", "p03294_case_032", "p03294_case_033", "p03294_case_034", "p03294_case_035", "p03294_case_036", "p03294_case_037", "p03294_case_038", "p03294_case_039", "p03294_case_040", "p03294_case_041", "p03294_case_042", "p03294_case_043", "p03294_case_044", "p03294_case_045", "p03294_case_046", "p03294_case_047", "p03294_case_048", "p03294_case_049", "p03294_case_050", "p03294_case_051", "p03294_case_052", "p03294_case_053", "p03294_case_054", "p03294_case_055", "p03294_case_056", "p03294_case_057", "p03294_case_058", "p03294_case_059", "p03294_case_060", "p03294_case_061", "p03294_case_062", "p03294_case_063", "p03294_case_064", "p03294_case_065", "p03294_case_066", "p03294_case_067", "p03294_case_068", "p03294_case_069", "p03294_case_070", "p03294_case_071", "p03294_case_072", "p03294_case_073", "p03294_case_074", "p03294_case_075", "p03294_case_076", "p03294_case_077", "p03294_case_078", "p03294_case_079", "p03294_case_080", "p03294_case_081", "p03294_case_082", "p03294_case_083", "p03294_case_084", "p03294_case_085", "p03294_case_086", "p03294_case_087", "p03294_case_088", "p03294_case_089", "p03294_case_090", "p03294_case_091", "p03294_case_092", "p03294_case_093", "p03294_case_094", "p03294_case_095", "p03294_case_096", "p03294_case_097", "p03294_case_098", "p03294_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\na = list(map(int, input().split()))\nans = sum(a) - n\nprint(ans)\n", "fast_code_sha256": "3372f4f601315791f5fa5074c8f91306b596e20abda63ec14629d9dee61e0933", "fast_id": "p03294_3372f4f601315791f5fa5074c8f91306b596e20abda63ec14629d9dee61e0933", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\na = list(map(int, input().split()))\nans = sum(a) - n\nprint(ans)\n", "measured_fast_code_sha256": "3372f4f601315791f5fa5074c8f91306b596e20abda63ec14629d9dee61e0933", "measured_slow_code": "import numpy as np\n\nN = int(eval(input()))\na = np.array(list(map(int, input().split())))\nprint((np.sum(a - 1)))\n", "measured_slow_code_sha256": "6a8516bb6c02b59ea3266bd536b3072e7db8cc83ba4dc6beff554090e4315ea9", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 106.9632649086833, "pair_id": "python_v2_67373fa64c2795678b528801", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03294", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03294_3372f4f601315791f5fa5074c8f91306b596e20abda63ec14629d9dee61e0933.jsonl.gz", "inputs": "reproduction/python/inputs/p03294.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03294_6a8516bb6c02b59ea3266bd536b3072e7db8cc83ba4dc6beff554090e4315ea9.jsonl.gz"}, "slow_code": "import numpy as np\n\nN = int(eval(input()))\na = np.array(list(map(int, input().split())))\nprint((np.sum(a - 1)))\n", "slow_code_sha256": "6a8516bb6c02b59ea3266bd536b3072e7db8cc83ba4dc6beff554090e4315ea9", "slow_id": "p03294_6a8516bb6c02b59ea3266bd536b3072e7db8cc83ba4dc6beff554090e4315ea9", "speedup": 180.18491104972298, "stratum": "8+", "within_pair_jaccard": 0.5, "workload": {"case_count": 100, "description": "For N positive integers a_i, maximize sum_i (m mod a_i) over all nonnegative integers m. Observed inputs: N=2..3000 (median 3000); a_i=2..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 21005, "median": 13229.0, "min": 6}, "input_format": ["N\na_1 ... a_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3001, "median": 3001.0, "min": 3}}} -{"case_ids": ["p03456_case_000", "p03456_case_001", "p03456_case_002", "p03456_case_003", "p03456_case_004", "p03456_case_005", "p03456_case_006", "p03456_case_007", "p03456_case_008", "p03456_case_009", "p03456_case_010", "p03456_case_011", "p03456_case_012", "p03456_case_013", "p03456_case_014", "p03456_case_015", "p03456_case_016", "p03456_case_017", "p03456_case_018", "p03456_case_019", "p03456_case_020", "p03456_case_021", "p03456_case_022", "p03456_case_023", "p03456_case_024", "p03456_case_025", "p03456_case_026", "p03456_case_027", "p03456_case_028", "p03456_case_029", "p03456_case_030", "p03456_case_031", "p03456_case_032", "p03456_case_033", "p03456_case_034", "p03456_case_035", "p03456_case_036", "p03456_case_037", "p03456_case_038", "p03456_case_039", "p03456_case_040", "p03456_case_041", "p03456_case_042", "p03456_case_043", "p03456_case_044", "p03456_case_045", "p03456_case_046", "p03456_case_047", "p03456_case_048", "p03456_case_049", "p03456_case_050", "p03456_case_051", "p03456_case_052", "p03456_case_053", "p03456_case_054", "p03456_case_055", "p03456_case_056", "p03456_case_057", "p03456_case_058", "p03456_case_059", "p03456_case_060", "p03456_case_061", "p03456_case_062", "p03456_case_063", "p03456_case_064", "p03456_case_065", "p03456_case_066", "p03456_case_067", "p03456_case_068", "p03456_case_069", "p03456_case_070", "p03456_case_071", "p03456_case_072", "p03456_case_073", "p03456_case_074", "p03456_case_075", "p03456_case_076", "p03456_case_077", "p03456_case_078", "p03456_case_079", "p03456_case_080", "p03456_case_081", "p03456_case_082", "p03456_case_083", "p03456_case_084", "p03456_case_085", "p03456_case_086", "p03456_case_087", "p03456_case_088", "p03456_case_089", "p03456_case_090", "p03456_case_091", "p03456_case_092", "p03456_case_093", "p03456_case_094", "p03456_case_095", "p03456_case_096", "p03456_case_097", "p03456_case_098", "p03456_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "a, b = list(map(str, input().split()))\ntarget = int(a + b)\nif (target**0.5).is_integer():\n print(\"Yes\")\nelse:\n print(\"No\")\n", "fast_code_sha256": "5c76f55bb7375b008aae832468c1927f071bea15c20ce5c79f4e53a61685b084", "fast_id": "p03456_5c76f55bb7375b008aae832468c1927f071bea15c20ce5c79f4e53a61685b084", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "a, b = list(map(str, input().split()))\ntarget = int(a + b)\nif (target**0.5).is_integer():\n print(\"Yes\")\nelse:\n print(\"No\")\n", "measured_fast_code_sha256": "5c76f55bb7375b008aae832468c1927f071bea15c20ce5c79f4e53a61685b084", "measured_slow_code": "import numpy as np\n\na = int(input().replace(\" \", \"\"))\nb = np.sqrt(a)\nc = b - int(b)\nif c == 0.0:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "measured_slow_code_sha256": "7917ed4392d2155273da648b2693fb0163544534d06b0c3c68db07d4c4827be4", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1697.8998525590628, "pair_id": "python_v2_ffe8f994de2e27f95985448e", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03456", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03456_5c76f55bb7375b008aae832468c1927f071bea15c20ce5c79f4e53a61685b084.jsonl.gz", "inputs": "reproduction/python/inputs/p03456.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03456_7917ed4392d2155273da648b2693fb0163544534d06b0c3c68db07d4c4827be4.jsonl.gz"}, "slow_code": "import numpy as np\n\na = int(input().replace(\" \", \"\"))\nb = np.sqrt(a)\nc = b - int(b)\nif c == 0.0:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "slow_code_sha256": "7917ed4392d2155273da648b2693fb0163544534d06b0c3c68db07d4c4827be4", "slow_id": "p03456_7917ed4392d2155273da648b2693fb0163544534d06b0c3c68db07d4c4827be4", "speedup": 1696.3460836041195, "stratum": "8+", "within_pair_jaccard": 0.4166666666666667, "workload": {"case_count": 100, "description": "Concatenate the decimal representations of positive integers a and b, in that order, and determine whether the resulting integer is a perfect square. Observed inputs: a=1..100 (median 41); b=1..100 (median 48.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 8, "median": 6.0, "min": 4}, "input_format": ["a b"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p03693_case_000", "p03693_case_001", "p03693_case_002", "p03693_case_003", "p03693_case_004", "p03693_case_005", "p03693_case_006", "p03693_case_007", "p03693_case_008", "p03693_case_009", "p03693_case_010", "p03693_case_011", "p03693_case_012", "p03693_case_013", "p03693_case_014", "p03693_case_015", "p03693_case_016", "p03693_case_017", "p03693_case_018", "p03693_case_019", "p03693_case_020", "p03693_case_021", "p03693_case_022", "p03693_case_023", "p03693_case_024", "p03693_case_025", "p03693_case_026", "p03693_case_027", "p03693_case_028", "p03693_case_029", "p03693_case_030", "p03693_case_031", "p03693_case_032", "p03693_case_033", "p03693_case_034", "p03693_case_035", "p03693_case_036", "p03693_case_037", "p03693_case_038", "p03693_case_039", "p03693_case_040", "p03693_case_041", "p03693_case_042", "p03693_case_043", "p03693_case_044", "p03693_case_045", "p03693_case_046", "p03693_case_047", "p03693_case_048", "p03693_case_049", "p03693_case_050", "p03693_case_051", "p03693_case_052", "p03693_case_053", "p03693_case_054", "p03693_case_055", "p03693_case_056", "p03693_case_057", "p03693_case_058", "p03693_case_059", "p03693_case_060", "p03693_case_061", "p03693_case_062", "p03693_case_063", "p03693_case_064", "p03693_case_065", "p03693_case_066", "p03693_case_067", "p03693_case_068", "p03693_case_069", "p03693_case_070", "p03693_case_071", "p03693_case_072", "p03693_case_073", "p03693_case_074", "p03693_case_075", "p03693_case_076", "p03693_case_077", "p03693_case_078", "p03693_case_079", "p03693_case_080", "p03693_case_081", "p03693_case_082", "p03693_case_083", "p03693_case_084", "p03693_case_085", "p03693_case_086", "p03693_case_087", "p03693_case_088", "p03693_case_089", "p03693_case_090", "p03693_case_091", "p03693_case_092", "p03693_case_093", "p03693_case_094", "p03693_case_095", "p03693_case_096", "p03693_case_097", "p03693_case_098", "p03693_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "r, g, b = list(map(int, input().split()))\nrgb = 100 * r + 10 * g + b\nprint((\"YES\" if rgb % 4 == 0 else \"NO\"))\n", "fast_code_sha256": "d303e58edec6b24cc8e555d07dc9046ba2fd84035cc3ecb56ee6a7834b3d2d01", "fast_id": "p03693_d303e58edec6b24cc8e555d07dc9046ba2fd84035cc3ecb56ee6a7834b3d2d01", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "r, g, b = list(map(int, input().split()))\nrgb = 100 * r + 10 * g + b\nprint((\"YES\" if rgb % 4 == 0 else \"NO\"))\n", "measured_fast_code_sha256": "d303e58edec6b24cc8e555d07dc9046ba2fd84035cc3ecb56ee6a7834b3d2d01", "measured_slow_code": "import numpy as np\n\nr, g, b = list(map(int, input().split()))\nif (100 * r + 10 * g + b) % 4 == 0:\n print(\"YES\")\nelse:\n print(\"NO\")\n", "measured_slow_code_sha256": "a8d7956b0cbea162ca1db60ee520eccf4efc73cdccbed5370688af05e67aaca2", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1770.7461774872854, "pair_id": "python_v2_019805f60c6a5de3b3c5b3b2", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03693", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03693_d303e58edec6b24cc8e555d07dc9046ba2fd84035cc3ecb56ee6a7834b3d2d01.jsonl.gz", "inputs": "reproduction/python/inputs/p03693.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03693_a8d7956b0cbea162ca1db60ee520eccf4efc73cdccbed5370688af05e67aaca2.jsonl.gz"}, "slow_code": "import numpy as np\n\nr, g, b = list(map(int, input().split()))\nif (100 * r + 10 * g + b) % 4 == 0:\n print(\"YES\")\nelse:\n print(\"NO\")\n", "slow_code_sha256": "a8d7956b0cbea162ca1db60ee520eccf4efc73cdccbed5370688af05e67aaca2", "slow_id": "p03693_a8d7956b0cbea162ca1db60ee520eccf4efc73cdccbed5370688af05e67aaca2", "speedup": 1769.232511474867, "stratum": "8+", "within_pair_jaccard": 0.7727272727272727, "workload": {"case_count": 100, "description": "Read three nonzero decimal digits r,g,b and determine whether the three-digit integer formed in that order is divisible by 4. Observed inputs: r=1..9; g=1..9; b=1..9.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 6, "median": 6.0, "min": 6}, "input_format": ["r g b"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3, "median": 3.0, "min": 3}}} -{"case_ids": ["p03835_case_000", "p03835_case_001", "p03835_case_002", "p03835_case_003", "p03835_case_004", "p03835_case_005", "p03835_case_006", "p03835_case_007", "p03835_case_008", "p03835_case_009", "p03835_case_010", "p03835_case_011", "p03835_case_012", "p03835_case_013", "p03835_case_014", "p03835_case_015", "p03835_case_016", "p03835_case_017", "p03835_case_018", "p03835_case_019", "p03835_case_020", "p03835_case_021", "p03835_case_022", "p03835_case_023", "p03835_case_024", "p03835_case_025", "p03835_case_026", "p03835_case_027", "p03835_case_028", "p03835_case_029", "p03835_case_030", "p03835_case_031", "p03835_case_032", "p03835_case_033", "p03835_case_034", "p03835_case_035", "p03835_case_036", "p03835_case_037", "p03835_case_038", "p03835_case_039", "p03835_case_040", "p03835_case_041", "p03835_case_042", "p03835_case_043", "p03835_case_044", "p03835_case_045", "p03835_case_046", "p03835_case_047", "p03835_case_048", "p03835_case_049", "p03835_case_050", "p03835_case_051", "p03835_case_052", "p03835_case_053", "p03835_case_054", "p03835_case_055", "p03835_case_056", "p03835_case_057", "p03835_case_058", "p03835_case_059", "p03835_case_060", "p03835_case_061", "p03835_case_062", "p03835_case_063", "p03835_case_064", "p03835_case_065", "p03835_case_066", "p03835_case_067", "p03835_case_068", "p03835_case_069", "p03835_case_070", "p03835_case_071", "p03835_case_072", "p03835_case_073", "p03835_case_074", "p03835_case_075", "p03835_case_076", "p03835_case_077", "p03835_case_078", "p03835_case_079", "p03835_case_080", "p03835_case_081", "p03835_case_082", "p03835_case_083", "p03835_case_084", "p03835_case_085", "p03835_case_086", "p03835_case_087", "p03835_case_088", "p03835_case_089", "p03835_case_090", "p03835_case_091", "p03835_case_092", "p03835_case_093", "p03835_case_094", "p03835_case_095", "p03835_case_096", "p03835_case_097", "p03835_case_098", "p03835_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "k, s = list(map(int, input().split()))\ncnt = 0\nminX = max(s - 2 * k, 0)\nmaxX = min(s, k)\nfor x in range(minX, maxX + 1):\n rest = s - x\n if k >= rest:\n cnt += rest + 1\n else:\n cnt += 2 * k - rest + 1\nprint(cnt)\n", "fast_code_sha256": "f7906a09151fab400b6547bf06f2749bfbc12740deab8aee67e2f15ffdabe2ee", "fast_id": "p03835_f7906a09151fab400b6547bf06f2749bfbc12740deab8aee67e2f15ffdabe2ee", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "k, s = list(map(int, input().split()))\ncnt = 0\nminX = max(s - 2 * k, 0)\nmaxX = min(s, k)\nfor x in range(minX, maxX + 1):\n rest = s - x\n if k >= rest:\n cnt += rest + 1\n else:\n cnt += 2 * k - rest + 1\nprint(cnt)\n", "measured_fast_code_sha256": "f7906a09151fab400b6547bf06f2749bfbc12740deab8aee67e2f15ffdabe2ee", "measured_slow_code": "K, S = list(map(int, input().split()))\nans = 0\nfor x in range(K + 1):\n for y in range(K + 1):\n z = S - x - y\n if 0 <= z and z <= K:\n ans += 1\nprint(ans)\n", "measured_slow_code_sha256": "c91016cfb4e5e1b40a603c119f92818d382f3e7e9567a5a9fd48af9c96a44f4c", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1401.1832214750652, "pair_id": "python_v2_146d66684271e41bae2c24eb", "per_case_slow_code_faster_fraction": 0.07, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03835", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03835_f7906a09151fab400b6547bf06f2749bfbc12740deab8aee67e2f15ffdabe2ee.jsonl.gz", "inputs": "reproduction/python/inputs/p03835.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03835_c91016cfb4e5e1b40a603c119f92818d382f3e7e9567a5a9fd48af9c96a44f4c.jsonl.gz"}, "slow_code": "K, S = list(map(int, input().split()))\nans = 0\nfor x in range(K + 1):\n for y in range(K + 1):\n z = S - x - y\n if 0 <= z and z <= K:\n ans += 1\nprint(ans)\n", "slow_code_sha256": "c91016cfb4e5e1b40a603c119f92818d382f3e7e9567a5a9fd48af9c96a44f4c", "slow_id": "p03835_c91016cfb4e5e1b40a603c119f92818d382f3e7e9567a5a9fd48af9c96a44f4c", "speedup": 861.9366177741206, "stratum": "8+", "within_pair_jaccard": 0.4482758620689655, "workload": {"case_count": 100, "description": "Count ordered integer triples (X,Y,Z) satisfying 0<=X,Y,Z<=K and X+Y+Z=S. Observed inputs: K=2..2500 (median 1275.5); S=0..7500 (median 1510.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 10, "median": 9.0, "min": 4}, "input_format": ["K S"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p02683_case_000", "p02683_case_001", "p02683_case_002", "p02683_case_003", "p02683_case_004", "p02683_case_005", "p02683_case_006", "p02683_case_007", "p02683_case_008", "p02683_case_009", "p02683_case_010", "p02683_case_011", "p02683_case_012", "p02683_case_013", "p02683_case_014", "p02683_case_015", "p02683_case_016", "p02683_case_017", "p02683_case_018", "p02683_case_019", "p02683_case_020", "p02683_case_021", "p02683_case_022", "p02683_case_023", "p02683_case_024", "p02683_case_025", "p02683_case_026", "p02683_case_027", "p02683_case_028", "p02683_case_029", "p02683_case_030", "p02683_case_031", "p02683_case_032", "p02683_case_033", "p02683_case_034", "p02683_case_035", "p02683_case_036", "p02683_case_037", "p02683_case_038", "p02683_case_039", "p02683_case_040", "p02683_case_041", "p02683_case_042", "p02683_case_043", "p02683_case_044", "p02683_case_045", "p02683_case_046", "p02683_case_047", "p02683_case_048", "p02683_case_049", "p02683_case_050", "p02683_case_051", "p02683_case_052", "p02683_case_053", "p02683_case_054", "p02683_case_055", "p02683_case_056", "p02683_case_057", "p02683_case_058", "p02683_case_059", "p02683_case_060", "p02683_case_061", "p02683_case_062", "p02683_case_063", "p02683_case_064", "p02683_case_065", "p02683_case_066", "p02683_case_067", "p02683_case_068", "p02683_case_069", "p02683_case_070", "p02683_case_071", "p02683_case_072", "p02683_case_073", "p02683_case_074", "p02683_case_075", "p02683_case_076", "p02683_case_077", "p02683_case_078", "p02683_case_079", "p02683_case_080", "p02683_case_081", "p02683_case_082", "p02683_case_083", "p02683_case_084", "p02683_case_085", "p02683_case_086", "p02683_case_087", "p02683_case_088", "p02683_case_089", "p02683_case_090", "p02683_case_091", "p02683_case_092", "p02683_case_093", "p02683_case_094", "p02683_case_095", "p02683_case_096", "p02683_case_097", "p02683_case_098", "p02683_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import math\n\n\ndef solve(C, A, x, k, s, U):\n if k == 0:\n if min(U) >= x:\n return s\n else:\n return math.inf\n else:\n s_use = s + C[k - 1]\n U_use = [u + a for u, a in zip(U, A[k - 1])]\n return min(solve(C, A, x, k - 1, s, U), solve(C, A, x, k - 1, s_use, U_use))\n\n\ndef main():\n from sys import stdin\n\n n, m, x = list(map(int, stdin.readline().rstrip().split()))\n C = []\n A = []\n for _ in range(n):\n temp = list(map(int, stdin.readline().rstrip().split()))\n C.append(temp[0])\n A.append(temp[1:])\n U = [0] * m\n ans = solve(C, A, x, n, 0, U)\n print((ans if ans != math.inf else -1))\n\n\nmain()\n", "fast_code_sha256": "c32c4128e55058c3dcd6bdcb0f3b1ab9e6442e9cf1928c5f0cb9b61b9da29980", "fast_id": "p02683_c32c4128e55058c3dcd6bdcb0f3b1ab9e6442e9cf1928c5f0cb9b61b9da29980", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import math\n\n\ndef solve(C, A, x, k, s, U):\n if k == 0:\n if min(U) >= x:\n return s\n else:\n return math.inf\n else:\n s_use = s + C[k - 1]\n U_use = [u + a for u, a in zip(U, A[k - 1])]\n return min(solve(C, A, x, k - 1, s, U), solve(C, A, x, k - 1, s_use, U_use))\n\n\ndef main():\n from sys import stdin\n\n n, m, x = list(map(int, stdin.readline().rstrip().split()))\n C = []\n A = []\n for _ in range(n):\n temp = list(map(int, stdin.readline().rstrip().split()))\n C.append(temp[0])\n A.append(temp[1:])\n U = [0] * m\n ans = solve(C, A, x, n, 0, U)\n print((ans if ans != math.inf else -1))\n\n\nmain()\n", "measured_fast_code_sha256": "c32c4128e55058c3dcd6bdcb0f3b1ab9e6442e9cf1928c5f0cb9b61b9da29980", "measured_slow_code": "n, m, x = list(map(int, input().split()))\ninn = [list(map(int, input().split())) for _ in range(n)]\nc = [inn[_][0] for _ in range(n)]\nara = [inn[_][1:] for _ in range(n)]\nans = 1e9\nfor mask in range(2**15):\n cost = 0\n cnt = [0 for _ in range(m)]\n for i in range(n):\n if ((1 << i) & mask) == 0:\n continue\n cost += c[i]\n for j in range(m):\n cnt[j] += ara[i][j]\n ok = 1\n for i in range(m):\n if cnt[i] < x:\n ok = 0\n if ok:\n ans = min(ans, cost)\nif ans == 1e9:\n ans = -1\nprint(ans)\n", "measured_slow_code_sha256": "3a953b935633d889972610e2b72a1d2f66172bb0bf1cb8f239c17f21d3ff6a83", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 696.9535018716263, "pair_id": "python_v2_dfbd75926d384127b61c5cf4", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02683", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02683_c32c4128e55058c3dcd6bdcb0f3b1ab9e6442e9cf1928c5f0cb9b61b9da29980.jsonl.gz", "inputs": "reproduction/python/inputs/p02683.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02683_3a953b935633d889972610e2b72a1d2f66172bb0bf1cb8f239c17f21d3ff6a83.jsonl.gz"}, "slow_code": "n, m, x = list(map(int, input().split()))\ninn = [list(map(int, input().split())) for _ in range(n)]\nc = [inn[_][0] for _ in range(n)]\nara = [inn[_][1:] for _ in range(n)]\nans = 1e9\nfor mask in range(2**15):\n cost = 0\n cnt = [0 for _ in range(m)]\n for i in range(n):\n if ((1 << i) & mask) == 0:\n continue\n cost += c[i]\n for j in range(m):\n cnt[j] += ara[i][j]\n ok = 1\n for i in range(m):\n if cnt[i] < x:\n ok = 0\n if ok:\n ans = min(ans, cost)\nif ans == 1e9:\n ans = -1\nprint(ans)\n", "slow_code_sha256": "3a953b935633d889972610e2b72a1d2f66172bb0bf1cb8f239c17f21d3ff6a83", "slow_id": "p02683_3a953b935633d889972610e2b72a1d2f66172bb0bf1cb8f239c17f21d3ff6a83", "speedup": 422.6168207670918, "stratum": "8+", "within_pair_jaccard": 0.30357142857142855, "workload": {"case_count": 100, "description": "Choose a subset of N books of costs C_i. Reading book i once adds A_i,j to skill j, initially zero. Minimize cost while all M skills reach at least X, or report impossibility. Observed inputs: N=1..12 (median 6); M=1..12 (median 6); X=1..100000 (median 7000); C_i=1..99895; A_i_j=0..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 933, "median": 207.0, "min": 10}, "input_format": ["N M X\nC_1 A_1,1 ... A_1,M\n...\nC_N A_N,1 ... A_N,M"], "input_format_status": "source_input_section", "input_lines": {"max": 13, "median": 7.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 159, "median": 45.0, "min": 5}}} -{"case_ids": ["p03563_case_000", "p03563_case_001", "p03563_case_002", "p03563_case_003", "p03563_case_004", "p03563_case_005", "p03563_case_006", "p03563_case_007", "p03563_case_008", "p03563_case_009", "p03563_case_010", "p03563_case_011", "p03563_case_012", "p03563_case_013", "p03563_case_014", "p03563_case_015", "p03563_case_016", "p03563_case_017", "p03563_case_018", "p03563_case_019", "p03563_case_020", "p03563_case_021", "p03563_case_022", "p03563_case_023", "p03563_case_024", "p03563_case_025", "p03563_case_026", "p03563_case_027", "p03563_case_028", "p03563_case_029", "p03563_case_030", "p03563_case_031", "p03563_case_032", "p03563_case_033", "p03563_case_034", "p03563_case_035", "p03563_case_036", "p03563_case_037", "p03563_case_038", "p03563_case_039", "p03563_case_040", "p03563_case_041", "p03563_case_042", "p03563_case_043", "p03563_case_044", "p03563_case_045", "p03563_case_046", "p03563_case_047", "p03563_case_048", "p03563_case_049", "p03563_case_050", "p03563_case_051", "p03563_case_052", "p03563_case_053", "p03563_case_054", "p03563_case_055", "p03563_case_056", "p03563_case_057", "p03563_case_058", "p03563_case_059", "p03563_case_060", "p03563_case_061", "p03563_case_062", "p03563_case_063", "p03563_case_064", "p03563_case_065", "p03563_case_066", "p03563_case_067", "p03563_case_068", "p03563_case_069", "p03563_case_070", "p03563_case_071", "p03563_case_072", "p03563_case_073", "p03563_case_074", "p03563_case_075", "p03563_case_076", "p03563_case_077", "p03563_case_078", "p03563_case_079", "p03563_case_080", "p03563_case_081", "p03563_case_082", "p03563_case_083", "p03563_case_084", "p03563_case_085", "p03563_case_086", "p03563_case_087", "p03563_case_088", "p03563_case_089", "p03563_case_090", "p03563_case_091", "p03563_case_092", "p03563_case_093", "p03563_case_094", "p03563_case_095", "p03563_case_096", "p03563_case_097", "p03563_case_098", "p03563_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "print(-int(input()) + (int(input()) << 1))\n", "fast_code_sha256": "67f88dac57a93649a1993708955430e96781769eb0c10f55453209da1be8978e", "fast_id": "p03563_67f88dac57a93649a1993708955430e96781769eb0c10f55453209da1be8978e", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "print(-int(input()) + (int(input()) << 1))\n", "measured_fast_code_sha256": "67f88dac57a93649a1993708955430e96781769eb0c10f55453209da1be8978e", "measured_slow_code": "import numpy as np\n\nlst = []\nR = int(eval(input()))\nG = int(eval(input()))\nans = G - R + G\nprint(ans)\n", "measured_slow_code_sha256": "59c6641cd1def8a06b45e4c0f0ace3ffa49de62fc97f73e0499cc3875cec5d01", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3441.964576450394, "pair_id": "python_v2_c1c4e2218988f3ab953b88be", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03563", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03563_67f88dac57a93649a1993708955430e96781769eb0c10f55453209da1be8978e.jsonl.gz", "inputs": "reproduction/python/inputs/p03563.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03563_59c6641cd1def8a06b45e4c0f0ace3ffa49de62fc97f73e0499cc3875cec5d01.jsonl.gz"}, "slow_code": "import numpy as np\n\nlst = []\nR = int(eval(input()))\nG = int(eval(input()))\nans = G - R + G\nprint(ans)\n", "slow_code_sha256": "59c6641cd1def8a06b45e4c0f0ace3ffa49de62fc97f73e0499cc3875cec5d01", "slow_id": "p03563_59c6641cd1def8a06b45e4c0f0ace3ffa49de62fc97f73e0499cc3875cec5d01", "speedup": 3436.0167930832827, "stratum": "8+", "within_pair_jaccard": 0.23076923076923078, "workload": {"case_count": 100, "description": "A new rating is the arithmetic mean of current rating R and a performance value. Find the performance required for the new rating to equal G; it may be negative. Observed inputs: R=0..4500 (median 2451.5); G=0..4500 (median 1662.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 10, "median": 10.0, "min": 4}, "input_format": ["R\nG"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p02706_case_000", "p02706_case_001", "p02706_case_002", "p02706_case_003", "p02706_case_004", "p02706_case_005", "p02706_case_006", "p02706_case_007", "p02706_case_008", "p02706_case_009", "p02706_case_010", "p02706_case_011", "p02706_case_012", "p02706_case_013", "p02706_case_014", "p02706_case_015", "p02706_case_016", "p02706_case_017", "p02706_case_018", "p02706_case_019", "p02706_case_020", "p02706_case_021", "p02706_case_022", "p02706_case_023", "p02706_case_024", "p02706_case_025", "p02706_case_026", "p02706_case_027", "p02706_case_028", "p02706_case_029", "p02706_case_030", "p02706_case_031", "p02706_case_032", "p02706_case_033", "p02706_case_034", "p02706_case_035", "p02706_case_036", "p02706_case_037", "p02706_case_038", "p02706_case_039", "p02706_case_040", "p02706_case_041", "p02706_case_042", "p02706_case_043", "p02706_case_044", "p02706_case_045", "p02706_case_046", "p02706_case_047", "p02706_case_048", "p02706_case_049", "p02706_case_050", "p02706_case_051", "p02706_case_052", "p02706_case_053", "p02706_case_054", "p02706_case_055", "p02706_case_056", "p02706_case_057", "p02706_case_058", "p02706_case_059", "p02706_case_060", "p02706_case_061", "p02706_case_062", "p02706_case_063", "p02706_case_064", "p02706_case_065", "p02706_case_066", "p02706_case_067", "p02706_case_068", "p02706_case_069", "p02706_case_070", "p02706_case_071", "p02706_case_072", "p02706_case_073", "p02706_case_074", "p02706_case_075", "p02706_case_076", "p02706_case_077", "p02706_case_078", "p02706_case_079", "p02706_case_080", "p02706_case_081", "p02706_case_082", "p02706_case_083", "p02706_case_084", "p02706_case_085", "p02706_case_086", "p02706_case_087", "p02706_case_088", "p02706_case_089", "p02706_case_090", "p02706_case_091", "p02706_case_092", "p02706_case_093", "p02706_case_094", "p02706_case_095", "p02706_case_096", "p02706_case_097", "p02706_case_098", "p02706_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N, M = list(map(int, input().split()))\nA = list(map(int, input().split()))\nfor i in range(M):\n N -= A[i]\nif N >= 0:\n print(N)\nelif N < 0:\n print((-1))\n", "fast_code_sha256": "4c767d4f54969c91a2200c7dc4c082e4d000559d0edcaadc837a4e6f5afe53cc", "fast_id": "p02706_4c767d4f54969c91a2200c7dc4c082e4d000559d0edcaadc837a4e6f5afe53cc", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N, M = list(map(int, input().split()))\nA = list(map(int, input().split()))\nfor i in range(M):\n N -= A[i]\nif N >= 0:\n print(N)\nelif N < 0:\n print((-1))\n", "measured_fast_code_sha256": "4c767d4f54969c91a2200c7dc4c082e4d000559d0edcaadc837a4e6f5afe53cc", "measured_slow_code": "import numpy as np\nimport math\n\nn, m = list(map(int, input().split()))\nA = list(map(int, input().split()))\na = sum(A)\nif n < a:\n print((-1))\nelse:\n print((n - a))\n", "measured_slow_code_sha256": "89bf5646ac16bde646209d2509249ed7377541f5a03b9f9c5553553af3b07c63", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 29.830857832213553, "pair_id": "python_v2_831878f4c403bb7da854aa85", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02706", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02706_4c767d4f54969c91a2200c7dc4c082e4d000559d0edcaadc837a4e6f5afe53cc.jsonl.gz", "inputs": "reproduction/python/inputs/p02706.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02706_89bf5646ac16bde646209d2509249ed7377541f5a03b9f9c5553553af3b07c63.jsonl.gz"}, "slow_code": "import numpy as np\nimport math\n\nn, m = list(map(int, input().split()))\nA = list(map(int, input().split()))\na = sum(A)\nif n < a:\n print((-1))\nelse:\n print((n - a))\n", "slow_code_sha256": "89bf5646ac16bde646209d2509249ed7377541f5a03b9f9c5553553af3b07c63", "slow_id": "p02706_89bf5646ac16bde646209d2509249ed7377541f5a03b9f9c5553553af3b07c63", "speedup": 103.37418807206339, "stratum": "8+", "within_pair_jaccard": 0.3333333333333333, "workload": {"case_count": 100, "description": "During N vacation days, complete M assignments requiring A_i days each, with no simultaneous assignments. Maximize days left free, or report -1 if all assignments cannot fit. Observed inputs: N=1..1000000 (median 1000); M=1..10000 (median 6445); A_i=1..10000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 60014, "median": 15213.0, "min": 6}, "input_format": ["N M\nA_1 ... A_M"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 10002, "median": 6447.0, "min": 3}}} -{"case_ids": ["p00501_case_000", "p00501_case_001", "p00501_case_002", "p00501_case_003", "p00501_case_004", "p00501_case_005", "p00501_case_006", "p00501_case_007", "p00501_case_008", "p00501_case_009", "p00501_case_010", "p00501_case_011", "p00501_case_012", "p00501_case_013", "p00501_case_014", "p00501_case_015", "p00501_case_016", "p00501_case_017", "p00501_case_018", "p00501_case_019", "p00501_case_020", "p00501_case_021", "p00501_case_022", "p00501_case_023", "p00501_case_024", "p00501_case_025", "p00501_case_026", "p00501_case_027", "p00501_case_028", "p00501_case_029", "p00501_case_030", "p00501_case_031", "p00501_case_032", "p00501_case_033", "p00501_case_034", "p00501_case_035", "p00501_case_036", "p00501_case_037", "p00501_case_038", "p00501_case_039", "p00501_case_040", "p00501_case_041", "p00501_case_042", "p00501_case_043", "p00501_case_044", "p00501_case_045", "p00501_case_046", "p00501_case_047", "p00501_case_048", "p00501_case_049", "p00501_case_050", "p00501_case_051", "p00501_case_052", "p00501_case_053", "p00501_case_054", "p00501_case_055", "p00501_case_056", "p00501_case_057", "p00501_case_058", "p00501_case_059", "p00501_case_060", "p00501_case_061", "p00501_case_062", "p00501_case_063", "p00501_case_064", "p00501_case_065", "p00501_case_066", "p00501_case_067", "p00501_case_068", "p00501_case_069", "p00501_case_070", "p00501_case_071", "p00501_case_072", "p00501_case_073", "p00501_case_074", "p00501_case_075", "p00501_case_076", "p00501_case_077", "p00501_case_078", "p00501_case_079", "p00501_case_080", "p00501_case_081", "p00501_case_082", "p00501_case_083", "p00501_case_084", "p00501_case_085", "p00501_case_086", "p00501_case_087", "p00501_case_088", "p00501_case_089", "p00501_case_090", "p00501_case_091", "p00501_case_092", "p00501_case_093", "p00501_case_094", "p00501_case_095", "p00501_case_096", "p00501_case_097", "p00501_case_098", "p00501_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = eval(input())\na = input()\ncount = 0\nfor r in range(n):\n b = input()\n lb = len(b)\n flag = 0\n for s in range(lb):\n for i in range(lb - (s + 1) * (len(a) - 1)):\n if b[i : i + (s + 1) * len(a) : s + 1] == a:\n count += 1\n flag = 1\n break\n if flag == 1:\n break\nprint(count)\n", "fast_code_sha256": "fb01a453f733b4c61a732f09cd3eaf884d4ec1ebb557cde596e8c204dc60ca60", "fast_id": "p00501_fb01a453f733b4c61a732f09cd3eaf884d4ec1ebb557cde596e8c204dc60ca60", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = eval(input())\na = input()\ncount = 0\nfor r in range(n):\n b = input()\n lb = len(b)\n flag = 0\n for s in range(lb):\n for i in range(lb - (s + 1) * (len(a) - 1)):\n if b[i : i + (s + 1) * len(a) : s + 1] == a:\n count += 1\n flag = 1\n break\n if flag == 1:\n break\nprint(count)\n", "measured_fast_code_sha256": "fb01a453f733b4c61a732f09cd3eaf884d4ec1ebb557cde596e8c204dc60ca60", "measured_slow_code": "n = eval(input())\ns = input()\ncnt = 0\nfor i in range(n):\n judge = False\n p = input()\n for k in range(len(p)):\n if judge:\n break\n for j in range(1, len(p)):\n if judge:\n break\n for l in range(len(s)):\n if k + l * j < len(p) and p[k + l * j] == s[l]:\n if l + 1 >= len(s):\n judge = True\n continue\n break\n if judge == True:\n cnt += 1\nprint(cnt)\n", "measured_slow_code_sha256": "546a560793c50315e95acadb50b40a703bd1c32e68166b92642bbf7d20a35b94", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 15.048649059788627, "pair_id": "python_v2_5c2d27494534841c4d737f9d", "per_case_slow_code_faster_fraction": 0.01, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p00501", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p00501_fb01a453f733b4c61a732f09cd3eaf884d4ec1ebb557cde596e8c204dc60ca60.jsonl.gz", "inputs": "reproduction/python/inputs/p00501.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p00501_546a560793c50315e95acadb50b40a703bd1c32e68166b92642bbf7d20a35b94.jsonl.gz"}, "slow_code": "n = eval(input())\ns = input()\ncnt = 0\nfor i in range(n):\n judge = False\n p = input()\n for k in range(len(p)):\n if judge:\n break\n for j in range(1, len(p)):\n if judge:\n break\n for l in range(len(s)):\n if k + l * j < len(p) and p[k + l * j] == s[l]:\n if l + 1 >= len(s):\n judge = True\n continue\n break\n if judge == True:\n cnt += 1\nprint(cnt)\n", "slow_code_sha256": "546a560793c50315e95acadb50b40a703bd1c32e68166b92642bbf7d20a35b94", "slow_id": "p00501_546a560793c50315e95acadb50b40a703bd1c32e68166b92642bbf7d20a35b94", "speedup": 13.896518282553199, "stratum": "8+", "within_pair_jaccard": 0.4666666666666667, "workload": {"case_count": 100, "description": "Count source strings from which the target string can be selected at equally spaced, increasing character positions. Deletions are allowed; each source contributes at most one regardless of the number of matching selections. All strings contain lowercase letters. Observed inputs: N=1..100 (median 30); target_length=3..25; sign_length=1..100; total_sign_characters=8..7861 (median 1991).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 7986, "median": 2026.5, "min": 29}, "input_format": ["N\ntarget\ns_1\n...\ns_N"], "input_format_status": "source_input_section", "input_lines": {"max": 102, "median": 32.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 102, "median": 32.0, "min": 3}}} -{"case_ids": ["p00741_case_000", "p00741_case_001", "p00741_case_002", "p00741_case_003", "p00741_case_004", "p00741_case_005", "p00741_case_006", "p00741_case_007", "p00741_case_008", "p00741_case_009", "p00741_case_010", "p00741_case_011", "p00741_case_012", "p00741_case_013", "p00741_case_014", "p00741_case_015", "p00741_case_016", "p00741_case_017", "p00741_case_018", "p00741_case_019", "p00741_case_020", "p00741_case_021", "p00741_case_022", "p00741_case_023", "p00741_case_024", "p00741_case_025", "p00741_case_026", "p00741_case_027", "p00741_case_028", "p00741_case_029", "p00741_case_030", "p00741_case_031", "p00741_case_032", "p00741_case_033", "p00741_case_034", "p00741_case_035", "p00741_case_036", "p00741_case_037", "p00741_case_038", "p00741_case_039", "p00741_case_040", "p00741_case_041", "p00741_case_042", "p00741_case_043", "p00741_case_044", "p00741_case_045", "p00741_case_046", "p00741_case_047", "p00741_case_048", "p00741_case_049", "p00741_case_050", "p00741_case_051", "p00741_case_052", "p00741_case_053", "p00741_case_054", "p00741_case_055", "p00741_case_056", "p00741_case_057", "p00741_case_058", "p00741_case_059", "p00741_case_060", "p00741_case_061", "p00741_case_062", "p00741_case_063", "p00741_case_064", "p00741_case_065", "p00741_case_066", "p00741_case_067", "p00741_case_068", "p00741_case_069", "p00741_case_070", "p00741_case_071", "p00741_case_072", "p00741_case_073", "p00741_case_074", "p00741_case_075", "p00741_case_076", "p00741_case_077", "p00741_case_078", "p00741_case_079", "p00741_case_080", "p00741_case_081", "p00741_case_082", "p00741_case_083", "p00741_case_084", "p00741_case_085", "p00741_case_086", "p00741_case_087", "p00741_case_088", "p00741_case_089", "p00741_case_090", "p00741_case_091", "p00741_case_092", "p00741_case_093", "p00741_case_094", "p00741_case_095", "p00741_case_096", "p00741_case_097", "p00741_case_098", "p00741_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\n\ndef visit(x, y, area):\n area[y][x] = 0\n move = [(-1, 0), (0, 1), (1, 0), (0, -1), (1, -1), (1, 1), (-1, 1), (-1, -1)]\n\n for i in move:\n if (\n 0 <= (x + i[0]) < w\n and 0 <= (y + i[1]) < h\n and area[y + i[1]][x + i[0]] == 1\n ):\n visit(x + i[0], y + i[1], area)\n\n\ndef solve():\n area = []\n ans = 0\n for i in range(h):\n area.append(list(map(int, input().split())))\n\n for i in range(h):\n for j in range(w):\n if area[i][j] == 1:\n ans += 1\n visit(j, i, area)\n print(ans)\n\n\nif __name__ == \"__main__\":\n sys.setrecursionlimit(100000)\n while True:\n w, h = 0, 0\n w, h = list(map(int, input().split()))\n if w == 0 and h == 0:\n break\n solve()\n", "fast_code_sha256": "1cb7eebc330e970af0c7b9613f54ac6558d30fa689dd7f3442611e1c0b1e8cb8", "fast_id": "p00741_ae17a2e83d68d5203e0ad48046f52d4408ba065dcbd218ec99faf7c2469b3087", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\n\ndef visit(x, y, area):\n area[y][x] = 0\n move = [(-1, 0), (0, 1), (1, 0), (0, -1), (1, -1), (1, 1), (-1, 1), (-1, -1)]\n # print '(' + str(x) + ',' + str(y) + ')'\n for i in move:\n if (\n 0 <= (x + i[0]) < w\n and 0 <= (y + i[1]) < h\n and area[y + i[1]][x + i[0]] == 1\n ):\n visit(x + i[0], y + i[1], area)\n\n\ndef solve():\n area = []\n ans = 0\n for i in range(h):\n area.append(list(map(int, input().split())))\n # print 'w: ' + str(w) + ',h: ' + str(h)\n for i in range(h):\n for j in range(w):\n if area[i][j] == 1:\n ans += 1\n visit(j, i, area)\n print(ans)\n\n\nif __name__ == \"__main__\":\n sys.setrecursionlimit(100000)\n while True:\n w, h = 0, 0\n w, h = list(map(int, input().split()))\n if w == 0 and h == 0:\n break\n solve()\n", "measured_fast_code_sha256": "ae17a2e83d68d5203e0ad48046f52d4408ba065dcbd218ec99faf7c2469b3087", "measured_slow_code": "import sys\nfrom pprint import pprint\n\n\nclass UnionFind:\n def __init__(self):\n self._parent = {}\n self._rank = {}\n self._equiv = {}\n\n def _find(self, x):\n if self._parent[x] == x:\n return self._parent[x]\n else:\n p = self._find(self._parent[x])\n self._parent[x] = p\n return p\n\n def _set_parent(self, child, parent):\n self._parent[child] = parent\n self._equiv[parent].update(self._equiv.pop(child))\n\n def _union(self, x, y):\n x = self._find(x)\n y = self._find(y)\n if x == y:\n return\n if self._rank[x] > self._rank[y]:\n self._set_parent(y, x)\n elif self._rank[x] < self._rank[y]:\n self._set_parent(x, y)\n else:\n self._set_parent(x, y)\n self._rank[x] += 1\n\n def _make_set(self, x):\n self._parent[x] = x\n self._rank[x] = 0\n self._equiv[x] = {x}\n\n def unite(self, *elements):\n if not elements:\n return\n for x in elements:\n if x in self._parent:\n continue\n self._make_set(x)\n x0 = elements[0]\n for x in elements[1:]:\n self._union(x0, x)\n\n def groups(self):\n return [set(e) for e in list(self._equiv.values())]\n\n\ndef pairs(ncol, nrow):\n # ?????????\n for x in range(ncol - 1):\n for y in range(nrow):\n yield [(x, y), (x + 1, y)]\n # ?????????\n for x in range(ncol):\n for y in range(nrow - 1):\n yield [(x, y), (x, y + 1)]\n # ???????????????\n for x in range(ncol - 1):\n for y in range(nrow - 1):\n yield [(x, y), (x + 1, y + 1)]\n # ???????????????\n for x in range(ncol - 1):\n for y in range(1, nrow):\n yield [(x, y), (x + 1, y - 1)]\n\n\ndef solve(ncol, nrow, rows):\n f = UnionFind()\n for x in range(ncol):\n for y in range(nrow):\n if rows[y][x]:\n f.unite((x, y))\n for (x1, y1), (x2, y2) in pairs(ncol, nrow):\n if rows[y1][x1] and rows[y2][x2]:\n f.unite((x1, y1), (x2, y2))\n return len(f.groups())\n\n\ndef main():\n while True:\n ncol, nrow = list(map(int, input().split()))\n if ncol == 0 and nrow == 0:\n break\n rows = []\n for _ in range(nrow):\n row = list(map(int, input().split()))\n rows.append(row)\n print((solve(ncol, nrow, rows)))\n\n\nmain()\n", "measured_slow_code_sha256": "0735c1a312ae16acc97c209d4348af561ba3d9c718d6566dd5c307d9219cab61", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.891632068647283, "pair_id": "python_v2_36d8e473cfae36867b26ac1c", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p00741", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p00741_ae17a2e83d68d5203e0ad48046f52d4408ba065dcbd218ec99faf7c2469b3087.jsonl.gz", "inputs": "reproduction/python/inputs/p00741.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p00741_0735c1a312ae16acc97c209d4348af561ba3d9c718d6566dd5c307d9219cab61.jsonl.gz"}, "slow_code": "import sys\nfrom pprint import pprint\n\n\nclass UnionFind:\n def __init__(self):\n self._parent = {}\n self._rank = {}\n self._equiv = {}\n\n def _find(self, x):\n if self._parent[x] == x:\n return self._parent[x]\n else:\n p = self._find(self._parent[x])\n self._parent[x] = p\n return p\n\n def _set_parent(self, child, parent):\n self._parent[child] = parent\n self._equiv[parent].update(self._equiv.pop(child))\n\n def _union(self, x, y):\n x = self._find(x)\n y = self._find(y)\n if x == y:\n return\n if self._rank[x] > self._rank[y]:\n self._set_parent(y, x)\n elif self._rank[x] < self._rank[y]:\n self._set_parent(x, y)\n else:\n self._set_parent(x, y)\n self._rank[x] += 1\n\n def _make_set(self, x):\n self._parent[x] = x\n self._rank[x] = 0\n self._equiv[x] = {x}\n\n def unite(self, *elements):\n if not elements:\n return\n for x in elements:\n if x in self._parent:\n continue\n self._make_set(x)\n x0 = elements[0]\n for x in elements[1:]:\n self._union(x0, x)\n\n def groups(self):\n return [set(e) for e in list(self._equiv.values())]\n\n\ndef pairs(ncol, nrow):\n\n for x in range(ncol - 1):\n for y in range(nrow):\n yield [(x, y), (x + 1, y)]\n\n for x in range(ncol):\n for y in range(nrow - 1):\n yield [(x, y), (x, y + 1)]\n\n for x in range(ncol - 1):\n for y in range(nrow - 1):\n yield [(x, y), (x + 1, y + 1)]\n\n for x in range(ncol - 1):\n for y in range(1, nrow):\n yield [(x, y), (x + 1, y - 1)]\n\n\ndef solve(ncol, nrow, rows):\n f = UnionFind()\n for x in range(ncol):\n for y in range(nrow):\n if rows[y][x]:\n f.unite((x, y))\n for (x1, y1), (x2, y2) in pairs(ncol, nrow):\n if rows[y1][x1] and rows[y2][x2]:\n f.unite((x1, y1), (x2, y2))\n return len(f.groups())\n\n\ndef main():\n while True:\n ncol, nrow = list(map(int, input().split()))\n if ncol == 0 and nrow == 0:\n break\n rows = []\n for _ in range(nrow):\n row = list(map(int, input().split()))\n rows.append(row)\n print((solve(ncol, nrow, rows)))\n\n\nmain()\n", "slow_code_sha256": "a10583df4146149ff2d8bb1bf5e10386b85381f734796329c7fab07cb9105b27", "slow_id": "p00741_0735c1a312ae16acc97c209d4348af561ba3d9c718d6566dd5c307d9219cab61", "speedup": 2.9234133695721747, "stratum": "2-4", "within_pair_jaccard": 0.2911392405063291, "workload": {"case_count": 100, "description": "For each binary map of width w and height h, count land components using horizontal, vertical and diagonal adjacency. Values 1 and 0 denote land and sea; outside the map is sea. A final 0 0 ends the maps. Observed inputs: datasets=1..50 (median 1); w=1..50; h=1..50; cells_per_map=1..2500; total_cells=1..12500 (median 2500).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 25034, "median": 5010.0, "min": 10}, "input_format": ["w_1 h_1\n[h_1 rows of w_1 binary integers]\n[next maps]\n0 0"], "input_format_status": "source_input_section", "input_lines": {"max": 551, "median": 52.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 12512, "median": 2504.0, "min": 5}}} -{"case_ids": ["p02289_case_000", "p02289_case_001", "p02289_case_002", "p02289_case_003", "p02289_case_004", "p02289_case_005", "p02289_case_006", "p02289_case_007", "p02289_case_008", "p02289_case_009", "p02289_case_010", "p02289_case_011", "p02289_case_012", "p02289_case_013", "p02289_case_014", "p02289_case_015", "p02289_case_016", "p02289_case_017", "p02289_case_018", "p02289_case_019", "p02289_case_020", "p02289_case_021", "p02289_case_022", "p02289_case_023", "p02289_case_024", "p02289_case_025", "p02289_case_026", "p02289_case_027", "p02289_case_028", "p02289_case_029", "p02289_case_030", "p02289_case_031", "p02289_case_032", "p02289_case_033", "p02289_case_034", "p02289_case_035", "p02289_case_036", "p02289_case_037", "p02289_case_038", "p02289_case_039", "p02289_case_040", "p02289_case_041", "p02289_case_042", "p02289_case_043", "p02289_case_044", "p02289_case_045", "p02289_case_046", "p02289_case_047", "p02289_case_048", "p02289_case_049", "p02289_case_050", "p02289_case_051", "p02289_case_052", "p02289_case_053", "p02289_case_054", "p02289_case_055", "p02289_case_056", "p02289_case_057", "p02289_case_058", "p02289_case_059", "p02289_case_060", "p02289_case_061", "p02289_case_062", "p02289_case_063", "p02289_case_064", "p02289_case_065", "p02289_case_066", "p02289_case_067", "p02289_case_068", "p02289_case_069", "p02289_case_070", "p02289_case_071", "p02289_case_072", "p02289_case_073", "p02289_case_074", "p02289_case_075", "p02289_case_076", "p02289_case_077", "p02289_case_078", "p02289_case_079", "p02289_case_080", "p02289_case_081", "p02289_case_082", "p02289_case_083", "p02289_case_084", "p02289_case_085", "p02289_case_086", "p02289_case_087", "p02289_case_088", "p02289_case_089", "p02289_case_090", "p02289_case_091", "p02289_case_092", "p02289_case_093", "p02289_case_094", "p02289_case_095", "p02289_case_096", "p02289_case_097", "p02289_case_098", "p02289_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from sys import stdin\n\nreadline = stdin.readline\nimport heapq\n\n\ndef main():\n heap = []\n while True:\n line = readline()\n if line[2] == \"t\":\n print((heapq.heappop(heap)[1]))\n elif line[2] == \"s\":\n n = int(line.split()[1])\n heapq.heappush(heap, (-n, n))\n else:\n break\n\n\nmain()\n", "fast_code_sha256": "d05250768fe6cf77a914fb96cb562d62103b2f0586db340b6e9274f071d45972", "fast_id": "p02289_d05250768fe6cf77a914fb96cb562d62103b2f0586db340b6e9274f071d45972", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from sys import stdin\n\nreadline = stdin.readline\nimport heapq\n\n\ndef main():\n heap = []\n while True:\n line = readline()\n if line[2] == \"t\":\n print((heapq.heappop(heap)[1]))\n elif line[2] == \"s\":\n n = int(line.split()[1])\n heapq.heappush(heap, (-n, n))\n else:\n break\n\n\nmain()\n", "measured_fast_code_sha256": "d05250768fe6cf77a914fb96cb562d62103b2f0586db340b6e9274f071d45972", "measured_slow_code": "import sys\n\n\ndef maxHeapify(A, i):\n l = i * 2 + 1\n r = i * 2 + 2\n if l < n:\n largest = l\n if r < n and A[r] > A[l]:\n largest = r\n if A[largest] > A[i]:\n A[i], A[largest] = A[largest], A[i]\n maxHeapify(A, largest)\n\n\ndef insert(S, k):\n global n\n S[n] = k\n n += 1\n i = n - 1\n p = (i - 1) // 2\n while i > 0 and S[i] > S[p]:\n S[i], S[p] = S[p], S[i]\n i = p\n p = (i - 1) // 2\n\n\ndef extractMax(S):\n global n\n if n == 1:\n n -= 1\n return S[0]\n ans = S[0]\n n -= 1\n S[0] = S[n]\n i = 0\n while True:\n l = i * 2 + 1\n r = i * 2 + 2\n if l >= n:\n break\n largest = l\n if r < n and A[r] > A[l]:\n largest = r\n if A[largest] > A[i]:\n A[i], A[largest] = A[largest], A[i]\n i = largest\n else:\n break\n return ans\n\n\nA = [0] * 2000000\nS = []\nn = 0\nfor s in sys.stdin:\n if s[2] == \"s\":\n insert(A, int(s[7:]))\n elif s[2] == \"t\":\n S.append(extractMax(A))\n else:\n break\nprint((\"\\n\".join(map(str, S))))\n", "measured_slow_code_sha256": "14b4ad282f61dc3f0baedf2eb80026c759f35dd9b34a29e093c21234282f17e7", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.8923215824108337, "pair_id": "python_v2_cb9561d458362f229b0ab84e", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02289", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02289_d05250768fe6cf77a914fb96cb562d62103b2f0586db340b6e9274f071d45972.jsonl.gz", "inputs": "reproduction/python/inputs/p02289.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02289_14b4ad282f61dc3f0baedf2eb80026c759f35dd9b34a29e093c21234282f17e7.jsonl.gz"}, "slow_code": "import sys\n\n\ndef maxHeapify(A, i):\n l = i * 2 + 1\n r = i * 2 + 2\n if l < n:\n largest = l\n if r < n and A[r] > A[l]:\n largest = r\n if A[largest] > A[i]:\n A[i], A[largest] = A[largest], A[i]\n maxHeapify(A, largest)\n\n\ndef insert(S, k):\n global n\n S[n] = k\n n += 1\n i = n - 1\n p = (i - 1) // 2\n while i > 0 and S[i] > S[p]:\n S[i], S[p] = S[p], S[i]\n i = p\n p = (i - 1) // 2\n\n\ndef extractMax(S):\n global n\n if n == 1:\n n -= 1\n return S[0]\n ans = S[0]\n n -= 1\n S[0] = S[n]\n i = 0\n while True:\n l = i * 2 + 1\n r = i * 2 + 2\n if l >= n:\n break\n largest = l\n if r < n and A[r] > A[l]:\n largest = r\n if A[largest] > A[i]:\n A[i], A[largest] = A[largest], A[i]\n i = largest\n else:\n break\n return ans\n\n\nA = [0] * 2000000\nS = []\nn = 0\nfor s in sys.stdin:\n if s[2] == \"s\":\n insert(A, int(s[7:]))\n elif s[2] == \"t\":\n S.append(extractMax(A))\n else:\n break\nprint((\"\\n\".join(map(str, S))))\n", "slow_code_sha256": "14b4ad282f61dc3f0baedf2eb80026c759f35dd9b34a29e093c21234282f17e7", "slow_id": "p02289_14b4ad282f61dc3f0baedf2eb80026c759f35dd9b34a29e093c21234282f17e7", "speedup": 3.077228595789579, "stratum": "2-4", "within_pair_jaccard": 0.34, "workload": {"case_count": 100, "description": "Maintain an initially empty max-priority queue. Each insert k adds one integer; each extract removes and prints the current maximum. Commands occur one per line and end terminates input. Duplicate keys are allowed. Observed inputs: operations=10..500000 (median 1000); insertions=5..250192 (median 508); extractions=3..249991 (median 495.5); maximum_queue_size=1..50000 (median 30.5); k=0..2000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 6501924, "median": 12912.5, "min": 130}, "input_format": ["insert k\nextract\n...\nend"], "input_format_status": "source_input_section", "input_lines": {"max": 500001, "median": 1001.0, "min": 11}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 750193, "median": 1509.0, "min": 16}}} -{"case_ids": ["p02669_case_000", "p02669_case_001", "p02669_case_002", "p02669_case_003", "p02669_case_004", "p02669_case_005", "p02669_case_006", "p02669_case_007", "p02669_case_008", "p02669_case_009", "p02669_case_010", "p02669_case_011", "p02669_case_012", "p02669_case_013", "p02669_case_014", "p02669_case_015", "p02669_case_016", "p02669_case_017", "p02669_case_018", "p02669_case_019", "p02669_case_020", "p02669_case_021", "p02669_case_022", "p02669_case_023", "p02669_case_024", "p02669_case_025", "p02669_case_026", "p02669_case_027", "p02669_case_028", "p02669_case_029", "p02669_case_030", "p02669_case_031", "p02669_case_032", "p02669_case_033", "p02669_case_034", "p02669_case_035", "p02669_case_036", "p02669_case_037", "p02669_case_038", "p02669_case_039", "p02669_case_040", "p02669_case_041", "p02669_case_042", "p02669_case_043", "p02669_case_044", "p02669_case_045", "p02669_case_046", "p02669_case_047", "p02669_case_048", "p02669_case_049", "p02669_case_050", "p02669_case_051", "p02669_case_052", "p02669_case_054", "p02669_case_055", "p02669_case_056", "p02669_case_057", "p02669_case_058", "p02669_case_059", "p02669_case_060", "p02669_case_061", "p02669_case_062", "p02669_case_063", "p02669_case_064", "p02669_case_065", "p02669_case_066", "p02669_case_067", "p02669_case_068", "p02669_case_069", "p02669_case_070", "p02669_case_071", "p02669_case_072", "p02669_case_073", "p02669_case_074", "p02669_case_075", "p02669_case_076", "p02669_case_077", "p02669_case_078", "p02669_case_080", "p02669_case_081", "p02669_case_082", "p02669_case_083", "p02669_case_084", "p02669_case_085", "p02669_case_086", "p02669_case_087", "p02669_case_088", "p02669_case_089", "p02669_case_090", "p02669_case_091", "p02669_case_092", "p02669_case_093", "p02669_case_094", "p02669_case_095", "p02669_case_096", "p02669_case_097", "p02669_case_098", "p02669_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 98, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from functools import lru_cache\n\nT = int(eval(input()))\n\n\ndef resolver(a, b, c, d):\n @lru_cache(maxsize=None)\n def _resolver(n):\n if n == 0:\n return 0\n elif n == 1:\n return d\n else:\n div5f = n // 5\n div5c = (n + 4) // 5\n div3f = n // 3\n div3c = (n + 2) // 3\n div2f = n // 2\n div2c = (n + 1) // 2\n return min(\n d * n,\n d * abs(n - div5f * 5) + c + _resolver(div5f),\n d * abs(n - div5c * 5) + c + _resolver(div5c),\n d * abs(n - div3f * 3) + b + _resolver(div3f),\n d * abs(n - div3c * 3) + b + _resolver(div3c),\n d * abs(n - div2f * 2) + a + _resolver(div2f),\n d * abs(n - div2c * 2) + a + _resolver(div2c),\n )\n\n return _resolver\n\n\nfor _ in range(T):\n N, A, B, C, D = list(map(int, input().split(\" \")))\n print((resolver(A, B, C, D)(N)))\n", "fast_code_sha256": "12844c51e354a563287e26419d1faf844b3e4d11f2e2aa8bd04091260f27a73b", "fast_id": "p02669_12844c51e354a563287e26419d1faf844b3e4d11f2e2aa8bd04091260f27a73b", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from functools import lru_cache\n\nT = int(eval(input()))\n\n\ndef resolver(a, b, c, d):\n @lru_cache(maxsize=None)\n def _resolver(n):\n if n == 0:\n return 0\n elif n == 1:\n return d\n else:\n div5f = n // 5\n div5c = (n + 4) // 5\n div3f = n // 3\n div3c = (n + 2) // 3\n div2f = n // 2\n div2c = (n + 1) // 2\n return min(\n d * n,\n d * abs(n - div5f * 5) + c + _resolver(div5f),\n d * abs(n - div5c * 5) + c + _resolver(div5c),\n d * abs(n - div3f * 3) + b + _resolver(div3f),\n d * abs(n - div3c * 3) + b + _resolver(div3c),\n d * abs(n - div2f * 2) + a + _resolver(div2f),\n d * abs(n - div2c * 2) + a + _resolver(div2c),\n )\n\n return _resolver\n\n\nfor _ in range(T):\n N, A, B, C, D = list(map(int, input().split(\" \")))\n print((resolver(A, B, C, D)(N)))\n", "measured_fast_code_sha256": "12844c51e354a563287e26419d1faf844b3e4d11f2e2aa8bd04091260f27a73b", "measured_slow_code": "import sys\n\ndivs = [2, 3, 5]\nt = int(eval(input()))\nfor _ in range(t):\n n, a, b, c, d = list(map(int, input().split()))\n costs = [a, b, c]\n dp = {}\n\n def dfs(x):\n if x in dp:\n return dp[x]\n # print(x, file=sys.stderr)\n if x == 0:\n dp[x] = 0\n return dp[x]\n ret = x * d\n for i in range(-4, 5):\n if x - i < 0:\n continue\n nx = x - i\n for cost, div in zip(costs, divs):\n if nx % div != 0 or nx // div >= x:\n continue\n ret = min(ret, dfs(nx // div) + cost + abs(i) * d)\n dp[x] = ret\n return ret\n\n print((dfs(n)))\n", "measured_slow_code_sha256": "5dc16e69171829fb825a4382d7ae818d1f78cf50ef12255ba28fcf6c6591e0e1", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 13.960807820246398, "pair_id": "python_v2_d8069bda0174f13fedec7bcf", "per_case_slow_code_faster_fraction": 0.07142857142857142, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02669", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02669_12844c51e354a563287e26419d1faf844b3e4d11f2e2aa8bd04091260f27a73b.jsonl.gz", "inputs": "reproduction/python/inputs/p02669.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02669_5dc16e69171829fb825a4382d7ae818d1f78cf50ef12255ba28fcf6c6591e0e1.jsonl.gz"}, "slow_code": "import sys\n\ndivs = [2, 3, 5]\nt = int(eval(input()))\nfor _ in range(t):\n n, a, b, c, d = list(map(int, input().split()))\n costs = [a, b, c]\n dp = {}\n\n def dfs(x):\n if x in dp:\n return dp[x]\n\n if x == 0:\n dp[x] = 0\n return dp[x]\n ret = x * d\n for i in range(-4, 5):\n if x - i < 0:\n continue\n nx = x - i\n for cost, div in zip(costs, divs):\n if nx % div != 0 or nx // div >= x:\n continue\n ret = min(ret, dfs(nx // div) + cost + abs(i) * d)\n dp[x] = ret\n return ret\n\n print((dfs(n)))\n", "slow_code_sha256": "ca3505b4e5755f2e5a6dda25d2ba0ee1f8926fae7d5ee6e43c499cad98b2e89b", "slow_id": "p02669_5dc16e69171829fb825a4382d7ae818d1f78cf50ef12255ba28fcf6c6591e0e1", "speedup": 7.712550600468771, "stratum": "4-8", "within_pair_jaccard": 0.40625, "workload": {"case_count": 98, "description": "For each of T cases, find the minimum cost to change 0 into N. Multiplication by 2, 3 or 5 costs A, B or C respectively; increasing or decreasing by 1 costs D. Operations may be repeated in any order. Observed inputs: T=1..10 (median 1); N=1..999999995042541824; A=1..1000000000; B=1..1000000000; C=1..1000000000; D=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 98, "input_bytes": {"max": 592, "median": 43.5, "min": 12}, "input_format": ["T\nN_1 A_1 B_1 C_1 D_1\n...\nN_T A_T B_T C_T D_T"], "input_format_status": "source_input_section", "input_lines": {"max": 11, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 51, "median": 6.0, "min": 6}}} -{"case_ids": ["p02551_case_000", "p02551_case_001", "p02551_case_002", "p02551_case_003", "p02551_case_004", "p02551_case_005", "p02551_case_006", "p02551_case_007", "p02551_case_008", "p02551_case_009", "p02551_case_010", "p02551_case_011", "p02551_case_012", "p02551_case_013", "p02551_case_014", "p02551_case_015", "p02551_case_016", "p02551_case_017", "p02551_case_018", "p02551_case_019", "p02551_case_020", "p02551_case_021", "p02551_case_022", "p02551_case_023", "p02551_case_024", "p02551_case_025", "p02551_case_026", "p02551_case_027", "p02551_case_028", "p02551_case_029", "p02551_case_030", "p02551_case_031", "p02551_case_032", "p02551_case_033", "p02551_case_034", "p02551_case_035", "p02551_case_036", "p02551_case_037", "p02551_case_038", "p02551_case_039", "p02551_case_040", "p02551_case_041", "p02551_case_042", "p02551_case_043", "p02551_case_044", "p02551_case_045", "p02551_case_046", "p02551_case_047", "p02551_case_048", "p02551_case_049", "p02551_case_050", "p02551_case_051", "p02551_case_052", "p02551_case_053", "p02551_case_054", "p02551_case_055", "p02551_case_056", "p02551_case_057", "p02551_case_058", "p02551_case_059", "p02551_case_060", "p02551_case_061", "p02551_case_062", "p02551_case_063", "p02551_case_064", "p02551_case_065", "p02551_case_066", "p02551_case_067", "p02551_case_068", "p02551_case_069", "p02551_case_070", "p02551_case_071", "p02551_case_072", "p02551_case_073", "p02551_case_074", "p02551_case_075", "p02551_case_076", "p02551_case_077", "p02551_case_078", "p02551_case_079", "p02551_case_080", "p02551_case_081", "p02551_case_082", "p02551_case_083", "p02551_case_084", "p02551_case_085", "p02551_case_086", "p02551_case_087", "p02551_case_088", "p02551_case_089", "p02551_case_090", "p02551_case_091", "p02551_case_092", "p02551_case_093", "p02551_case_094", "p02551_case_095", "p02551_case_096", "p02551_case_097", "p02551_case_098", "p02551_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\nread = sys.stdin.read\nreadline = sys.stdin.readline\nreadlines = sys.stdin.readlines\nsys.setrecursionlimit(10**9)\nMOD = 1000000007\n\n\ndef main():\n N, Q, *queries = list(map(int, read().split()))\n queries = [(q, x) for q, x in zip(*[iter(queries)] * 2)]\n N -= 2\n\n N0 = 2 ** (N - 1).bit_length()\n data1 = [None] * (2 * N0)\n data2 = [None] * (2 * N0)\n INF = (-1, 2**31 - 1)\n\n def update(l, r, v, data):\n L = l + N0\n R = r + N0\n while L < R:\n if R & 1:\n R -= 1\n data[R - 1] = v\n if L & 1:\n data[L - 1] = v\n L += 1\n L >>= 1\n R >>= 1\n\n def _query(k, data):\n k += N0 - 1\n s = INF\n while k >= 0:\n if data[k]:\n s = max(s, data[k])\n k = (k - 1) // 2\n return s\n\n def query(k, data):\n return _query(k, data)[1]\n\n update(0, N, (0, N), data1)\n update(0, N, (0, N), data2)\n min1 = min2 = N + 10\n ans = N * N\n for i, (q, x) in enumerate(queries, 1):\n x -= 2\n if q == 1:\n data = data1\n this_min = min1\n else:\n data = data2\n this_min = min2\n n = query(x, data)\n ans -= n\n if x > this_min:\n continue\n if q == 1:\n min1 = x\n update(0, n, (i, x), data2)\n else:\n min2 = x\n update(0, n, (i, x), data1)\n print(ans)\n return\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "c5b27d123eb4be603fe8509dc52f382f0edbaa108b801cde25d5e3518e703c95", "fast_id": "p02551_4a16bff7c31cffdfdbe77a06643bb78fef98086e135ad4345038314f484d3403", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\nread = sys.stdin.read\nreadline = sys.stdin.readline\nreadlines = sys.stdin.readlines\nsys.setrecursionlimit(10**9)\nMOD = 1000000007\n\n\ndef main():\n N, Q, *queries = list(map(int, read().split()))\n queries = [(q, x) for q, x in zip(*[iter(queries)] * 2)]\n N -= 2\n # N: 処理する区間の長さ\n N0 = 2 ** (N - 1).bit_length()\n data1 = [None] * (2 * N0)\n data2 = [None] * (2 * N0)\n INF = (-1, 2**31 - 1)\n # 区間[l, r+1)の値をvに書き換える\n # vは(t, value)という値にする (新しい値ほどtは大きくなる)\n def update(l, r, v, data):\n L = l + N0\n R = r + N0\n while L < R:\n if R & 1:\n R -= 1\n data[R - 1] = v\n if L & 1:\n data[L - 1] = v\n L += 1\n L >>= 1\n R >>= 1\n\n # a_iの現在の値を取得\n def _query(k, data):\n k += N0 - 1\n s = INF\n while k >= 0:\n if data[k]:\n s = max(s, data[k])\n k = (k - 1) // 2\n return s\n\n # これを呼び出す\n def query(k, data):\n return _query(k, data)[1]\n\n update(0, N, (0, N), data1)\n update(0, N, (0, N), data2)\n min1 = min2 = N + 10\n ans = N * N\n for i, (q, x) in enumerate(queries, 1):\n x -= 2\n if q == 1:\n data = data1\n this_min = min1\n else:\n data = data2\n this_min = min2\n n = query(x, data)\n ans -= n\n if x > this_min:\n continue\n if q == 1:\n min1 = x\n update(0, n, (i, x), data2)\n else:\n min2 = x\n update(0, n, (i, x), data1)\n print(ans)\n return\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "4a16bff7c31cffdfdbe77a06643bb78fef98086e135ad4345038314f484d3403", "measured_slow_code": "class LazySegmentTree:\n def __init__(self, init_val, segfunc, ide_ele):\n n = len(init_val)\n self.segfunc = segfunc\n self.ide_ele = ide_ele\n self.num = 1 << (n - 1).bit_length()\n self.data = [ide_ele] * 2 * self.num\n self.lazy = [None] * 2 * self.num\n for i in range(n):\n self.data[self.num + i] = init_val[i]\n for i in range(self.num - 1, 0, -1):\n self.data[i] = self.segfunc(self.data[2 * i], self.data[2 * i + 1])\n\n def gindex(self, l, r):\n l += self.num\n r += self.num\n lm = l >> (l & -l).bit_length()\n rm = r >> (r & -r).bit_length()\n while r > l:\n if l <= lm:\n yield l\n if r <= rm:\n yield r\n r >>= 1\n l >>= 1\n while l:\n yield l\n l >>= 1\n\n def propagates(self, *ids):\n for i in reversed(ids):\n v = self.lazy[i]\n if v is None:\n continue\n self.lazy[2 * i] = v\n self.lazy[2 * i + 1] = v\n self.data[2 * i] = v\n self.data[2 * i + 1] = v\n self.lazy[i] = None\n\n def update(self, l, r, x):\n (*ids,) = self.gindex(l, r)\n self.propagates(*ids)\n l += self.num\n r += self.num\n while l < r:\n if l & 1:\n self.lazy[l] = x\n self.data[l] = x\n l += 1\n if r & 1:\n self.lazy[r - 1] = x\n self.data[r - 1] = x\n r >>= 1\n l >>= 1\n for i in ids:\n self.data[i] = self.segfunc(self.data[2 * i], self.data[2 * i + 1])\n\n def query(self, l, r):\n (*ids,) = self.gindex(l, r)\n self.propagates(*ids)\n res = self.ide_ele\n l += self.num\n r += self.num\n while l < r:\n if l & 1:\n res = self.segfunc(res, self.data[l])\n l += 1\n if r & 1:\n res = self.segfunc(res, self.data[r - 1])\n l >>= 1\n r >>= 1\n return res\n\n\ndef segfunc(x, y):\n return min(x, y)\n\n\nide_ele = 10**9\nN, Q = list(map(int, input().split()))\nans = (N - 2) * (N - 2)\nR = [N] * (N + 1)\nW = [N] * (N + 1)\nseg_r = LazySegmentTree(R, segfunc, ide_ele)\nseg_w = LazySegmentTree(W, segfunc, ide_ele)\nfor i in range(Q):\n a, b = list(map(int, input().split()))\n if a == 1:\n t = seg_r.query(b, b + 1)\n ans -= max(0, t - 2)\n if b <= seg_w.query(1, 2):\n seg_w.update(1, t + 1, b)\n else:\n t = seg_w.query(b, b + 1)\n ans -= max(0, t - 2)\n if b <= seg_r.query(1, 2):\n seg_r.update(1, t + 1, b)\nprint(ans)\n", "measured_slow_code_sha256": "b6d8d02e6cf1c2cdae11c71a6f58f4cedbd533f79dc49244a4531d1545967d6e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4.098473174813522, "pair_id": "python_v2_b29d889d48be49db5fbb4698", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02551", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02551_4a16bff7c31cffdfdbe77a06643bb78fef98086e135ad4345038314f484d3403.jsonl.gz", "inputs": "reproduction/python/inputs/p02551.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02551_b6d8d02e6cf1c2cdae11c71a6f58f4cedbd533f79dc49244a4531d1545967d6e.jsonl.gz"}, "slow_code": "class LazySegmentTree:\n def __init__(self, init_val, segfunc, ide_ele):\n n = len(init_val)\n self.segfunc = segfunc\n self.ide_ele = ide_ele\n self.num = 1 << (n - 1).bit_length()\n self.data = [ide_ele] * 2 * self.num\n self.lazy = [None] * 2 * self.num\n for i in range(n):\n self.data[self.num + i] = init_val[i]\n for i in range(self.num - 1, 0, -1):\n self.data[i] = self.segfunc(self.data[2 * i], self.data[2 * i + 1])\n\n def gindex(self, l, r):\n l += self.num\n r += self.num\n lm = l >> (l & -l).bit_length()\n rm = r >> (r & -r).bit_length()\n while r > l:\n if l <= lm:\n yield l\n if r <= rm:\n yield r\n r >>= 1\n l >>= 1\n while l:\n yield l\n l >>= 1\n\n def propagates(self, *ids):\n for i in reversed(ids):\n v = self.lazy[i]\n if v is None:\n continue\n self.lazy[2 * i] = v\n self.lazy[2 * i + 1] = v\n self.data[2 * i] = v\n self.data[2 * i + 1] = v\n self.lazy[i] = None\n\n def update(self, l, r, x):\n (*ids,) = self.gindex(l, r)\n self.propagates(*ids)\n l += self.num\n r += self.num\n while l < r:\n if l & 1:\n self.lazy[l] = x\n self.data[l] = x\n l += 1\n if r & 1:\n self.lazy[r - 1] = x\n self.data[r - 1] = x\n r >>= 1\n l >>= 1\n for i in ids:\n self.data[i] = self.segfunc(self.data[2 * i], self.data[2 * i + 1])\n\n def query(self, l, r):\n (*ids,) = self.gindex(l, r)\n self.propagates(*ids)\n res = self.ide_ele\n l += self.num\n r += self.num\n while l < r:\n if l & 1:\n res = self.segfunc(res, self.data[l])\n l += 1\n if r & 1:\n res = self.segfunc(res, self.data[r - 1])\n l >>= 1\n r >>= 1\n return res\n\n\ndef segfunc(x, y):\n return min(x, y)\n\n\nide_ele = 10**9\nN, Q = list(map(int, input().split()))\nans = (N - 2) * (N - 2)\nR = [N] * (N + 1)\nW = [N] * (N + 1)\nseg_r = LazySegmentTree(R, segfunc, ide_ele)\nseg_w = LazySegmentTree(W, segfunc, ide_ele)\nfor i in range(Q):\n a, b = list(map(int, input().split()))\n if a == 1:\n t = seg_r.query(b, b + 1)\n ans -= max(0, t - 2)\n if b <= seg_w.query(1, 2):\n seg_w.update(1, t + 1, b)\n else:\n t = seg_w.query(b, b + 1)\n ans -= max(0, t - 2)\n if b <= seg_r.query(1, 2):\n seg_r.update(1, t + 1, b)\nprint(ans)\n", "slow_code_sha256": "b6d8d02e6cf1c2cdae11c71a6f58f4cedbd533f79dc49244a4531d1545967d6e", "slow_id": "p02551_b6d8d02e6cf1c2cdae11c71a6f58f4cedbd533f79dc49244a4531d1545967d6e", "speedup": 3.780210169352265, "stratum": "2-4", "within_pair_jaccard": 0.3695652173913043, "workload": {"case_count": 100, "description": "An N-by-N grid starts with black inner cells and white bottom/right borders. Distinct queries 1 x or 2 x turn cells white downward from (1,x) or rightward from (x,1), stopping at the first white cell. Count remaining black cells. Observed inputs: N=3..200000 (median 100000); Q=0..200000 (median 199996); x=2..199999.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1689172, "median": 1577778.0, "min": 4}, "input_format": ["N Q\ntype_1 x_1\n...\ntype_Q x_Q"], "input_format_status": "source_input_section", "input_lines": {"max": 200001, "median": 199997.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 400002, "median": 399994.0, "min": 2}}} -{"case_ids": ["p00022_case_000", "p00022_case_001", "p00022_case_002", "p00022_case_003", "p00022_case_004", "p00022_case_005", "p00022_case_006", "p00022_case_007", "p00022_case_008", "p00022_case_009", "p00022_case_010", "p00022_case_011", "p00022_case_012", "p00022_case_013", "p00022_case_014", "p00022_case_015", "p00022_case_016", "p00022_case_017", "p00022_case_018", "p00022_case_019", "p00022_case_020", "p00022_case_021", "p00022_case_022", "p00022_case_023", "p00022_case_024", "p00022_case_025", "p00022_case_026", "p00022_case_027", "p00022_case_028", "p00022_case_029", "p00022_case_030", "p00022_case_031", "p00022_case_032", "p00022_case_033", "p00022_case_034", "p00022_case_035", "p00022_case_036", "p00022_case_037", "p00022_case_038", "p00022_case_039", "p00022_case_040", "p00022_case_041", "p00022_case_042", "p00022_case_043", "p00022_case_044", "p00022_case_045", "p00022_case_046", "p00022_case_047", "p00022_case_048", "p00022_case_049", "p00022_case_050", "p00022_case_051", "p00022_case_052", "p00022_case_053", "p00022_case_054", "p00022_case_055", "p00022_case_056", "p00022_case_057", "p00022_case_058", "p00022_case_059", "p00022_case_060", "p00022_case_061", "p00022_case_062", "p00022_case_063", "p00022_case_064", "p00022_case_065", "p00022_case_066", "p00022_case_067", "p00022_case_068", "p00022_case_069", "p00022_case_070", "p00022_case_071", "p00022_case_072", "p00022_case_073", "p00022_case_074", "p00022_case_075", "p00022_case_076", "p00022_case_077", "p00022_case_078", "p00022_case_079", "p00022_case_080", "p00022_case_081", "p00022_case_082", "p00022_case_083", "p00022_case_084", "p00022_case_085", "p00022_case_086", "p00022_case_087", "p00022_case_088", "p00022_case_089", "p00022_case_090", "p00022_case_091", "p00022_case_092", "p00022_case_093", "p00022_case_094", "p00022_case_095", "p00022_case_096", "p00022_case_097", "p00022_case_098", "p00022_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "while 1:\n n = eval(input())\n if n == 0:\n break\n r = [int(input()) for i in range(n)]\n for i in range(1, n):\n r[i] = max(r[i - 1] + r[i], r[i])\n print(max(r))\n", "fast_code_sha256": "f522ab1c5a929026d0db6ca658dc7a8ef822c62c3950374ddb1e286b2eb1b22f", "fast_id": "p00022_f522ab1c5a929026d0db6ca658dc7a8ef822c62c3950374ddb1e286b2eb1b22f", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "while 1:\n n = eval(input())\n if n == 0:\n break\n r = [int(input()) for i in range(n)]\n for i in range(1, n):\n r[i] = max(r[i - 1] + r[i], r[i])\n print(max(r))\n", "measured_fast_code_sha256": "f522ab1c5a929026d0db6ca658dc7a8ef822c62c3950374ddb1e286b2eb1b22f", "measured_slow_code": "# -*- coding: utf-8 -*-\nimport sys\nimport os\n\n\ndef max_seq(A):\n s = []\n s.append(A[0])\n for i in range(1, len(A)):\n v = max(A[i], A[i] + s[i - 1])\n s.append(v)\n return max(s)\n\n\nwhile True:\n s = input().strip()\n if s == \"0\":\n break\n N = int(s)\n A = []\n for i in range(N):\n v = int(eval(input()))\n A.append(v)\n print((max_seq(A)))\n", "measured_slow_code_sha256": "8e3689a917ad4c79c60c6adbb8d6688abf4bb0bce1a0c3468135f63f0c03ee05", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.6883054939422912, "pair_id": "python_v2_0ea1f5700e8774c9484720e0", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p00022", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p00022_f522ab1c5a929026d0db6ca658dc7a8ef822c62c3950374ddb1e286b2eb1b22f.jsonl.gz", "inputs": "reproduction/python/inputs/p00022.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p00022_8e3689a917ad4c79c60c6adbb8d6688abf4bb0bce1a0c3468135f63f0c03ee05.jsonl.gz"}, "slow_code": "import sys\nimport os\n\n\ndef max_seq(A):\n s = []\n s.append(A[0])\n for i in range(1, len(A)):\n v = max(A[i], A[i] + s[i - 1])\n s.append(v)\n return max(s)\n\n\nwhile True:\n s = input().strip()\n if s == \"0\":\n break\n N = int(s)\n A = []\n for i in range(N):\n v = int(eval(input()))\n A.append(v)\n print((max_seq(A)))\n", "slow_code_sha256": "085372069d48219741fb186b9dbc003d015304dcc2c410ee58438bbaba3e6c7c", "slow_id": "p00022_8e3689a917ad4c79c60c6adbb8d6688abf4bb0bce1a0c3468135f63f0c03ee05", "speedup": 2.6413018709872693, "stratum": "2-4", "within_pair_jaccard": 0.4666666666666667, "workload": {"case_count": 100, "description": "For each integer sequence, find the maximum sum of a nonempty contiguous subsequence. Each dataset supplies n followed by n values, one value per line; a final zero ends the input. Observed inputs: datasets=1..10 (median 1); n=1..5000; total_records=1..50000 (median 1000); a_i=-100000..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 319550, "median": 6388.0, "min": 9}, "input_format": ["n_1\na_1\n...\na_(n_1)\n[next datasets]\n0"], "input_format_status": "source_input_section", "input_lines": {"max": 50011, "median": 1002.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 50011, "median": 1002.0, "min": 3}}} -{"case_ids": ["p02934_case_000", "p02934_case_001", "p02934_case_002", "p02934_case_003", "p02934_case_004", "p02934_case_005", "p02934_case_006", "p02934_case_007", "p02934_case_008", "p02934_case_009", "p02934_case_010", "p02934_case_011", "p02934_case_012", "p02934_case_013", "p02934_case_014", "p02934_case_015", "p02934_case_016", "p02934_case_017", "p02934_case_018", "p02934_case_019", "p02934_case_020", "p02934_case_021", "p02934_case_022", "p02934_case_023", "p02934_case_024", "p02934_case_025", "p02934_case_026", "p02934_case_027", "p02934_case_028", "p02934_case_029", "p02934_case_030", "p02934_case_031", "p02934_case_032", "p02934_case_033", "p02934_case_034", "p02934_case_035", "p02934_case_036", "p02934_case_037", "p02934_case_038", "p02934_case_039", "p02934_case_040", "p02934_case_041", "p02934_case_042", "p02934_case_043", "p02934_case_044", "p02934_case_045", "p02934_case_046", "p02934_case_047", "p02934_case_048", "p02934_case_049", "p02934_case_050", "p02934_case_051", "p02934_case_052", "p02934_case_053", "p02934_case_054", "p02934_case_055", "p02934_case_056", "p02934_case_057", "p02934_case_058", "p02934_case_059", "p02934_case_060", "p02934_case_061", "p02934_case_062", "p02934_case_063", "p02934_case_064", "p02934_case_065", "p02934_case_066", "p02934_case_067", "p02934_case_068", "p02934_case_069", "p02934_case_070", "p02934_case_071", "p02934_case_072", "p02934_case_073", "p02934_case_074", "p02934_case_075", "p02934_case_076", "p02934_case_077", "p02934_case_078", "p02934_case_079", "p02934_case_080", "p02934_case_081", "p02934_case_082", "p02934_case_083", "p02934_case_084", "p02934_case_085", "p02934_case_086", "p02934_case_087", "p02934_case_088", "p02934_case_089", "p02934_case_090", "p02934_case_091", "p02934_case_092", "p02934_case_093", "p02934_case_094", "p02934_case_095", "p02934_case_096", "p02934_case_097", "p02934_case_098", "p02934_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\na = list(map(int, input().split()))\ns = 0\nfor i in range(n):\n s += 1 / a[i]\nprint((1 / s))\n", "fast_code_sha256": "694f611b8b7e80f21648a9548a2bc08ce6440ec8a90f076e716c5ef1b35ecf93", "fast_id": "p02934_694f611b8b7e80f21648a9548a2bc08ce6440ec8a90f076e716c5ef1b35ecf93", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\na = list(map(int, input().split()))\ns = 0\nfor i in range(n):\n s += 1 / a[i]\nprint((1 / s))\n", "measured_fast_code_sha256": "694f611b8b7e80f21648a9548a2bc08ce6440ec8a90f076e716c5ef1b35ecf93", "measured_slow_code": "import numpy as np\n\nn = int(eval(input()))\nal = list(map(int, input().split()))\nreverse_list = []\nfor a in al:\n reverse_list.append(1 / a)\nprint((1 / sum(reverse_list)))\n", "measured_slow_code_sha256": "c67c96a03eea0baa546b84c497feeeb56f64958e85f22563bf6a6b3f7d27ea3a", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 961.8433421417965, "pair_id": "python_v2_82f235566877c86a2bae984f", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02934", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02934_694f611b8b7e80f21648a9548a2bc08ce6440ec8a90f076e716c5ef1b35ecf93.jsonl.gz", "inputs": "reproduction/python/inputs/p02934.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02934_c67c96a03eea0baa546b84c497feeeb56f64958e85f22563bf6a6b3f7d27ea3a.jsonl.gz"}, "slow_code": "import numpy as np\n\nn = int(eval(input()))\nal = list(map(int, input().split()))\nreverse_list = []\nfor a in al:\n reverse_list.append(1 / a)\nprint((1 / sum(reverse_list)))\n", "slow_code_sha256": "c67c96a03eea0baa546b84c497feeeb56f64958e85f22563bf6a6b3f7d27ea3a", "slow_id": "p02934_c67c96a03eea0baa546b84c497feeeb56f64958e85f22563bf6a6b3f7d27ea3a", "speedup": 1001.2866922329929, "stratum": "8+", "within_pair_jaccard": 0.5, "workload": {"case_count": 100, "description": "Compute the reciprocal of the sum of reciprocals of N positive input integers A_i, as a real number. Observed inputs: N=1..100 (median 50); A_i=1..1000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 504, "median": 114.0, "min": 4}, "input_format": ["N\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 101, "median": 51.0, "min": 2}}} -{"case_ids": ["p03317_case_000", "p03317_case_001", "p03317_case_002", "p03317_case_003", "p03317_case_004", "p03317_case_005", "p03317_case_006", "p03317_case_007", "p03317_case_008", "p03317_case_009", "p03317_case_010", "p03317_case_011", "p03317_case_012", "p03317_case_013", "p03317_case_014", "p03317_case_015", "p03317_case_016", "p03317_case_017", "p03317_case_018", "p03317_case_019", "p03317_case_020", "p03317_case_021", "p03317_case_022", "p03317_case_023", "p03317_case_024", "p03317_case_025", "p03317_case_026", "p03317_case_027", "p03317_case_028", "p03317_case_029", "p03317_case_030", "p03317_case_031", "p03317_case_032", "p03317_case_033", "p03317_case_034", "p03317_case_035", "p03317_case_036", "p03317_case_037", "p03317_case_038", "p03317_case_039", "p03317_case_040", "p03317_case_041", "p03317_case_042", "p03317_case_043", "p03317_case_044", "p03317_case_045", "p03317_case_046", "p03317_case_047", "p03317_case_048", "p03317_case_049", "p03317_case_050", "p03317_case_051", "p03317_case_052", "p03317_case_053", "p03317_case_054", "p03317_case_055", "p03317_case_056", "p03317_case_057", "p03317_case_058", "p03317_case_059", "p03317_case_060", "p03317_case_061", "p03317_case_062", "p03317_case_063", "p03317_case_064", "p03317_case_065", "p03317_case_066", "p03317_case_067", "p03317_case_068", "p03317_case_069", "p03317_case_070", "p03317_case_071", "p03317_case_072", "p03317_case_073", "p03317_case_074", "p03317_case_075", "p03317_case_076", "p03317_case_077", "p03317_case_078", "p03317_case_079", "p03317_case_080", "p03317_case_081", "p03317_case_082", "p03317_case_083", "p03317_case_084", "p03317_case_085", "p03317_case_086", "p03317_case_087", "p03317_case_088", "p03317_case_089", "p03317_case_090", "p03317_case_091", "p03317_case_092", "p03317_case_093", "p03317_case_094", "p03317_case_095", "p03317_case_096", "p03317_case_097", "p03317_case_098", "p03317_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from collections import Counter\nfrom math import *\n\nN, K = [int(x) for x in input().strip().split()]\nA = [int(x) for x in input().strip().split()]\nA.sort()\nc = Counter(A)\nminc = c[A[0]]\nres = len(A) - minc\nprint((ceil(res / (K - 1))))\n", "fast_code_sha256": "a49e8701c648359100d415e821b1668f4d7ae2ccaf0a530fd721c1bee96df392", "fast_id": "p03317_a49e8701c648359100d415e821b1668f4d7ae2ccaf0a530fd721c1bee96df392", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from collections import Counter\nfrom math import *\n\nN, K = [int(x) for x in input().strip().split()]\nA = [int(x) for x in input().strip().split()]\nA.sort()\nc = Counter(A)\nminc = c[A[0]]\nres = len(A) - minc\nprint((ceil(res / (K - 1))))\n", "measured_fast_code_sha256": "a49e8701c648359100d415e821b1668f4d7ae2ccaf0a530fd721c1bee96df392", "measured_slow_code": "import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time\n\nsys.setrecursionlimit(10**7)\ninf = 10**20\nmod = 10**9 + 7\n\n\ndef LI():\n return list(map(int, input().split()))\n\n\ndef I():\n return int(eval(input()))\n\n\ndef LS():\n return input().split()\n\n\ndef S():\n return eval(input())\n\n\ndef main():\n a, b = LI()\n l = LI()\n c = 1\n _b = b\n while True:\n if a <= _b:\n break\n else:\n _b += b - 1\n c += 1\n return c\n\n\nprint((main()))\n", "measured_slow_code_sha256": "40f790b9daefbd644d38ba942e539d6681ed03212cd68a297874ac055d84131a", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 16.43271152287624, "pair_id": "python_v2_c0160520b718526de320ed92", "per_case_slow_code_faster_fraction": 0.34, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03317", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03317_a49e8701c648359100d415e821b1668f4d7ae2ccaf0a530fd721c1bee96df392.jsonl.gz", "inputs": "reproduction/python/inputs/p03317.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03317_40f790b9daefbd644d38ba942e539d6681ed03212cd68a297874ac055d84131a.jsonl.gz"}, "slow_code": "import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time\n\nsys.setrecursionlimit(10**7)\ninf = 10**20\nmod = 10**9 + 7\n\n\ndef LI():\n return list(map(int, input().split()))\n\n\ndef I():\n return int(eval(input()))\n\n\ndef LS():\n return input().split()\n\n\ndef S():\n return eval(input())\n\n\ndef main():\n a, b = LI()\n l = LI()\n c = 1\n _b = b\n while True:\n if a <= _b:\n break\n else:\n _b += b - 1\n c += 1\n return c\n\n\nprint((main()))\n", "slow_code_sha256": "40f790b9daefbd644d38ba942e539d6681ed03212cd68a297874ac055d84131a", "slow_id": "p03317_40f790b9daefbd644d38ba942e539d6681ed03212cd68a297874ac055d84131a", "speedup": 4.490634573681406, "stratum": "4-8", "within_pair_jaccard": 0.15, "workload": {"case_count": 100, "description": "Starting with a permutation of 1..N, repeatedly select K consecutive entries and replace all of them by their current minimum. Find the minimum operations needed to make every entry equal. Observed inputs: N=2..100000 (median 100); K=2..100000 (median 5); A_i=1..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 588909, "median": 299.0, "min": 8}, "input_format": ["N K\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100002, "median": 102.0, "min": 4}}} -{"case_ids": ["p02770_case_000", "p02770_case_001", "p02770_case_002", "p02770_case_003", "p02770_case_004", "p02770_case_005", "p02770_case_006", "p02770_case_007", "p02770_case_008", "p02770_case_009", "p02770_case_010", "p02770_case_011", "p02770_case_012", "p02770_case_013", "p02770_case_014", "p02770_case_015", "p02770_case_016", "p02770_case_017", "p02770_case_018", "p02770_case_019", "p02770_case_020", "p02770_case_021", "p02770_case_022", "p02770_case_023", "p02770_case_024", "p02770_case_025", "p02770_case_026", "p02770_case_027", "p02770_case_028", "p02770_case_029", "p02770_case_030", "p02770_case_031", "p02770_case_032", "p02770_case_033", "p02770_case_034", "p02770_case_035", "p02770_case_036", "p02770_case_037", "p02770_case_038", "p02770_case_039", "p02770_case_040", "p02770_case_041", "p02770_case_042", "p02770_case_043", "p02770_case_044", "p02770_case_045", "p02770_case_046", "p02770_case_047", "p02770_case_048", "p02770_case_049", "p02770_case_050", "p02770_case_051", "p02770_case_052", "p02770_case_053", "p02770_case_054", "p02770_case_055", "p02770_case_056", "p02770_case_057", "p02770_case_058", "p02770_case_059", "p02770_case_060", "p02770_case_061", "p02770_case_062", "p02770_case_063", "p02770_case_064", "p02770_case_065", "p02770_case_066", "p02770_case_067", "p02770_case_068", "p02770_case_069", "p02770_case_070", "p02770_case_071", "p02770_case_072", "p02770_case_073", "p02770_case_074", "p02770_case_075", "p02770_case_076", "p02770_case_077", "p02770_case_078", "p02770_case_079", "p02770_case_080", "p02770_case_081", "p02770_case_082", "p02770_case_083", "p02770_case_084", "p02770_case_085", "p02770_case_086", "p02770_case_087", "p02770_case_088", "p02770_case_089", "p02770_case_090", "p02770_case_091", "p02770_case_092", "p02770_case_093", "p02770_case_094", "p02770_case_095", "p02770_case_096", "p02770_case_097", "p02770_case_098", "p02770_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def main():\n k, q = list(map(int, input().split()))\n (*d,) = list(map(int, input().split()))\n for _ in range(q):\n n, x, m = list(map(int, input().split()))\n (*g,) = [x % m for x in d]\n rep, rest = divmod(n - 1, k)\n last = x + (sum(g) * rep) + sum(g[:rest])\n eq = sum(rep + (1 if i < rest else 0) for i, gg in enumerate(g) if gg == 0)\n ans = (n - 1) - eq - (last // m - x // m)\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "b08b63949d5a0d136cf4abbcf8d58f0dfce1c51147939885ca0da7ecb15e7dd4", "fast_id": "p02770_1d04958ffbdbddcd269fad8373f24a6d7b9d37ba405ef0ceba28eac485c84265", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "# 解説放送\n# tee, isliceをやめた\ndef main():\n k, q = list(map(int, input().split()))\n (*d,) = list(map(int, input().split()))\n for _ in range(q):\n n, x, m = list(map(int, input().split()))\n (*g,) = [x % m for x in d]\n rep, rest = divmod(n - 1, k)\n last = x + (sum(g) * rep) + sum(g[:rest])\n eq = sum(rep + (1 if i < rest else 0) for i, gg in enumerate(g) if gg == 0)\n ans = (n - 1) - eq - (last // m - x // m)\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "1d04958ffbdbddcd269fad8373f24a6d7b9d37ba405ef0ceba28eac485c84265", "measured_slow_code": "import numpy as np\n\nk, q = list(map(int, input().split()))\nd = np.array(list(map(int, input().split())), dtype=np.int64)\nqueries = [tuple(map(int, input().split())) for _ in range(q)]\nfor n, x, m in queries:\n d_mod = d % m\n rem_d_mod = d_mod[: (n - 1) % k]\n print(\n (\n n\n - 1\n - (x % m + ((n - 1) // k) * np.sum(d_mod) + np.sum(rem_d_mod)) // m\n - ((n - 1) // k) * np.count_nonzero(d_mod == 0)\n - np.count_nonzero(rem_d_mod == 0)\n )\n )\n", "measured_slow_code_sha256": "c3f6bab4a2af4b35e38d9d72355721dc97f2ca2c80f07b4cb113b6f10727002a", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 0.48975194611135203, "pair_id": "python_v2_aeff2b3384f735b84e834601", "per_case_slow_code_faster_fraction": 0.53, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02770", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02770_1d04958ffbdbddcd269fad8373f24a6d7b9d37ba405ef0ceba28eac485c84265.jsonl.gz", "inputs": "reproduction/python/inputs/p02770.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02770_c3f6bab4a2af4b35e38d9d72355721dc97f2ca2c80f07b4cb113b6f10727002a.jsonl.gz"}, "slow_code": "import numpy as np\n\nk, q = list(map(int, input().split()))\nd = np.array(list(map(int, input().split())), dtype=np.int64)\nqueries = [tuple(map(int, input().split())) for _ in range(q)]\nfor n, x, m in queries:\n d_mod = d % m\n rem_d_mod = d_mod[: (n - 1) % k]\n print(\n (\n n\n - 1\n - (x % m + ((n - 1) // k) * np.sum(d_mod) + np.sum(rem_d_mod)) // m\n - ((n - 1) // k) * np.count_nonzero(d_mod == 0)\n - np.count_nonzero(rem_d_mod == 0)\n )\n )\n", "slow_code_sha256": "c3f6bab4a2af4b35e38d9d72355721dc97f2ca2c80f07b4cb113b6f10727002a", "slow_id": "p02770_c3f6bab4a2af4b35e38d9d72355721dc97f2ca2c80f07b4cb113b6f10727002a", "speedup": 3.268384513974106, "stratum": "2-4", "within_pair_jaccard": 0.3829787234042553, "workload": {"case_count": 100, "description": "For each query (n,x,m), define a_0=x and a_j=a_(j-1)+d_((j-1) mod k). Count j in 0..n-2 with (a_j mod m)<(a_(j+1) mod m). Only k increments and q queries are listed; expanded sequences are implicit. Observed inputs: k=1..5000 (median 1000); q=1..5000 (median 1000); d_i=0..1000000000; n_i=2..1000000000; x_i=0..1000000000; m_i=2..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 215504, "median": 23899.5, "min": 12}, "input_format": ["k q\nd_0 ... d_(k-1)\nn_1 x_1 m_1\n...\nn_q x_q m_q"], "input_format_status": "source_input_section", "input_lines": {"max": 5002, "median": 1002.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 20002, "median": 4002.0, "min": 6}}} -{"case_ids": ["p02392_case_000", "p02392_case_001", "p02392_case_002", "p02392_case_003", "p02392_case_004", "p02392_case_005", "p02392_case_006", "p02392_case_007", "p02392_case_008", "p02392_case_009", "p02392_case_010", "p02392_case_011", "p02392_case_012", "p02392_case_013", "p02392_case_014", "p02392_case_015", "p02392_case_016", "p02392_case_017", "p02392_case_018", "p02392_case_019", "p02392_case_020", "p02392_case_021", "p02392_case_022", "p02392_case_023", "p02392_case_024", "p02392_case_025", "p02392_case_026", "p02392_case_027", "p02392_case_028", "p02392_case_029", "p02392_case_030", "p02392_case_031", "p02392_case_032", "p02392_case_033", "p02392_case_034", "p02392_case_035", "p02392_case_036", "p02392_case_037", "p02392_case_038", "p02392_case_039", "p02392_case_040", "p02392_case_041", "p02392_case_042", "p02392_case_043", "p02392_case_044", "p02392_case_045", "p02392_case_046", "p02392_case_047", "p02392_case_048", "p02392_case_049", "p02392_case_050", "p02392_case_051", "p02392_case_052", "p02392_case_053", "p02392_case_054", "p02392_case_055", "p02392_case_056", "p02392_case_057", "p02392_case_058", "p02392_case_059", "p02392_case_060", "p02392_case_061", "p02392_case_062", "p02392_case_063", "p02392_case_064", "p02392_case_065", "p02392_case_066", "p02392_case_067", "p02392_case_068", "p02392_case_069", "p02392_case_070", "p02392_case_071", "p02392_case_072", "p02392_case_073", "p02392_case_074", "p02392_case_075", "p02392_case_076", "p02392_case_077", "p02392_case_078", "p02392_case_079", "p02392_case_080", "p02392_case_081", "p02392_case_082", "p02392_case_083", "p02392_case_084", "p02392_case_085", "p02392_case_086", "p02392_case_087", "p02392_case_088", "p02392_case_089", "p02392_case_090", "p02392_case_091", "p02392_case_092", "p02392_case_093", "p02392_case_094", "p02392_case_095", "p02392_case_096", "p02392_case_097", "p02392_case_098", "p02392_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "input = list(map(int, input().split()))\na, b, c = input\nif a < b and b < c:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "fast_code_sha256": "5b32d921753f5b1861bbe75f8a5eba85fcdd95a5dc929e4dc9b67db7dc0a437a", "fast_id": "p02392_09663c1f76aa19bedba50a46e6e114f2a193cba92904a747ee1eae1e2f9a470f", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "# encoding:utf-8\ninput = list(map(int, input().split()))\na, b, c = input\nif a < b and b < c:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "measured_fast_code_sha256": "09663c1f76aa19bedba50a46e6e114f2a193cba92904a747ee1eae1e2f9a470f", "measured_slow_code": "import sys\n\nif __name__ == \"__main__\":\n import doctest\n\n doctest.testmod()\n a, b, c = list(map(int, sys.stdin.read().split()))\n if a < b < c:\n print(\"Yes\")\n else:\n print(\"No\")\n", "measured_slow_code_sha256": "359da708050d63872f0ebf54c13ede0cb7a857b20ddb07202d171041a7782310", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 573.2685787888365, "pair_id": "python_v2_9d403fe4559977332a8ccb7d", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02392", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02392_09663c1f76aa19bedba50a46e6e114f2a193cba92904a747ee1eae1e2f9a470f.jsonl.gz", "inputs": "reproduction/python/inputs/p02392.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02392_359da708050d63872f0ebf54c13ede0cb7a857b20ddb07202d171041a7782310.jsonl.gz"}, "slow_code": "import sys\n\nif __name__ == \"__main__\":\n import doctest\n\n doctest.testmod()\n a, b, c = list(map(int, sys.stdin.read().split()))\n if a < b < c:\n print(\"Yes\")\n else:\n print(\"No\")\n", "slow_code_sha256": "359da708050d63872f0ebf54c13ede0cb7a857b20ddb07202d171041a7782310", "slow_id": "p02392_359da708050d63872f0ebf54c13ede0cb7a857b20ddb07202d171041a7782310", "speedup": 572.8558490496151, "stratum": "8+", "within_pair_jaccard": 0.5454545454545454, "workload": {"case_count": 100, "description": "Read three integers a,b,c and decide whether a y:\n print(\"War\")\nelse:\n zl = np.arange(x + 1, y + 1)\n for z in zl:\n if (max(xl) < z) & (z <= min(yl)):\n print(\"No War\")\n break\n else:\n print(\"War\")\n", "measured_slow_code_sha256": "a3fbc6c47b132b7bae66af85f9792255327ce8e3bf2b5b22873b7c8d59510fae", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 879.9016200101523, "pair_id": "python_v2_1c460bfada3a5e5969742d5e", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03251", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03251_b6ab03dfbca6f801ea2bd903c18a31dbd71e7ee0b74a39dccd56becec539a41e.jsonl.gz", "inputs": "reproduction/python/inputs/p03251.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03251_a3fbc6c47b132b7bae66af85f9792255327ce8e3bf2b5b22873b7c8d59510fae.jsonl.gz"}, "slow_code": "import numpy as np\n\nn, m, x, y = list(map(int, input().split()))\nxl = [int(i) for i in input().split()]\nyl = [int(i) for i in input().split()]\nif x > y:\n print(\"War\")\nelse:\n zl = np.arange(x + 1, y + 1)\n for z in zl:\n if (max(xl) < z) & (z <= min(yl)):\n print(\"No War\")\n break\n else:\n print(\"War\")\n", "slow_code_sha256": "a3fbc6c47b132b7bae66af85f9792255327ce8e3bf2b5b22873b7c8d59510fae", "slow_id": "p03251_a3fbc6c47b132b7bae66af85f9792255327ce8e3bf2b5b22873b7c8d59510fae", "speedup": 914.0274555744494, "stratum": "8+", "within_pair_jaccard": 0.4838709677419355, "workload": {"case_count": 100, "description": "Determine whether an integer Z satisfies X=Z. Each coordinate list is distinct internally and excludes its own capital X or Y. Lists are not necessarily sorted. Observed inputs: N=1..100 (median 50); M=1..100 (median 50); X=-100..99; Y=-99..100; x_i=-100..100; y_i=-100..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 706, "median": 356.0, "min": 20}, "input_format": ["N M X Y\nx_1 ... x_N\ny_1 ... y_M"], "input_format_status": "source_input_section", "input_lines": {"max": 3, "median": 3.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 204, "median": 104.0, "min": 6}}} -{"case_ids": ["p03112_case_000", "p03112_case_001", "p03112_case_002", "p03112_case_003", "p03112_case_004", "p03112_case_005", "p03112_case_006", "p03112_case_007", "p03112_case_008", "p03112_case_009", "p03112_case_010", "p03112_case_011", "p03112_case_012", "p03112_case_013", "p03112_case_014", "p03112_case_015", "p03112_case_016", "p03112_case_017", "p03112_case_018", "p03112_case_019", "p03112_case_020", "p03112_case_021", "p03112_case_022", "p03112_case_023", "p03112_case_024", "p03112_case_025", "p03112_case_026", "p03112_case_027", "p03112_case_028", "p03112_case_029", "p03112_case_030", "p03112_case_031", "p03112_case_032", "p03112_case_033", "p03112_case_034", "p03112_case_035", "p03112_case_036", "p03112_case_037", "p03112_case_038", "p03112_case_039", "p03112_case_040", "p03112_case_041", "p03112_case_042", "p03112_case_043", "p03112_case_044", "p03112_case_045", "p03112_case_046", "p03112_case_047", "p03112_case_048", "p03112_case_049", "p03112_case_050", "p03112_case_051", "p03112_case_052", "p03112_case_053", "p03112_case_054", "p03112_case_055", "p03112_case_056", "p03112_case_057", "p03112_case_058", "p03112_case_059", "p03112_case_060", "p03112_case_061", "p03112_case_062", "p03112_case_063", "p03112_case_064", "p03112_case_065", "p03112_case_066", "p03112_case_067", "p03112_case_068", "p03112_case_069", "p03112_case_070", "p03112_case_071", "p03112_case_072", "p03112_case_073", "p03112_case_074", "p03112_case_075", "p03112_case_076", "p03112_case_077", "p03112_case_078", "p03112_case_079", "p03112_case_080", "p03112_case_081", "p03112_case_082", "p03112_case_083", "p03112_case_084", "p03112_case_085", "p03112_case_086", "p03112_case_087", "p03112_case_088", "p03112_case_089", "p03112_case_090", "p03112_case_091", "p03112_case_092", "p03112_case_093", "p03112_case_094", "p03112_case_095", "p03112_case_096", "p03112_case_097", "p03112_case_098", "p03112_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import bisect\nimport sys\n\nSENTINEL = 10**12\na, b, q = list(map(int, input().split()))\nlines = sys.stdin.readlines()\nsss = [-SENTINEL] + list(map(int, lines[:a])) + [SENTINEL]\nttt = [-SENTINEL] + list(map(int, lines[a : a + b])) + [SENTINEL]\nxxx = list(map(int, lines[a + b :]))\nnearest_temples = [SENTINEL] + [0] * a + [SENTINEL]\nnearest_shrines = [SENTINEL] + [0] * b + [SENTINEL]\nfor i, s in enumerate(sss[1:-1], start=1):\n ti = bisect.bisect(ttt, s)\n nearest_temples[i] = min(ttt[ti] - s, s - ttt[ti - 1])\nfor i, t in enumerate(ttt[1:-1], start=1):\n si = bisect.bisect(sss, t)\n nearest_shrines[i] = min(sss[si] - t, t - sss[si - 1])\nbuf = []\nfor x in xxx:\n si = bisect.bisect(sss, x)\n ti = bisect.bisect(ttt, x)\n ans = min(\n x - sss[si - 1] + nearest_temples[si - 1],\n sss[si] - x + nearest_temples[si],\n x - ttt[ti - 1] + nearest_shrines[ti - 1],\n ttt[ti] - x + nearest_shrines[ti],\n )\n buf.append(ans)\nprint((\"\\n\".join(map(str, buf))))\n", "fast_code_sha256": "bcdd6c5a04ef827b58b6607368ffa34b279e2ae37471e8105f1a35498de66f88", "fast_id": "p03112_bcdd6c5a04ef827b58b6607368ffa34b279e2ae37471e8105f1a35498de66f88", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import bisect\nimport sys\n\nSENTINEL = 10**12\na, b, q = list(map(int, input().split()))\nlines = sys.stdin.readlines()\nsss = [-SENTINEL] + list(map(int, lines[:a])) + [SENTINEL]\nttt = [-SENTINEL] + list(map(int, lines[a : a + b])) + [SENTINEL]\nxxx = list(map(int, lines[a + b :]))\nnearest_temples = [SENTINEL] + [0] * a + [SENTINEL]\nnearest_shrines = [SENTINEL] + [0] * b + [SENTINEL]\nfor i, s in enumerate(sss[1:-1], start=1):\n ti = bisect.bisect(ttt, s)\n nearest_temples[i] = min(ttt[ti] - s, s - ttt[ti - 1])\nfor i, t in enumerate(ttt[1:-1], start=1):\n si = bisect.bisect(sss, t)\n nearest_shrines[i] = min(sss[si] - t, t - sss[si - 1])\nbuf = []\nfor x in xxx:\n si = bisect.bisect(sss, x)\n ti = bisect.bisect(ttt, x)\n ans = min(\n x - sss[si - 1] + nearest_temples[si - 1],\n sss[si] - x + nearest_temples[si],\n x - ttt[ti - 1] + nearest_shrines[ti - 1],\n ttt[ti] - x + nearest_shrines[ti],\n )\n buf.append(ans)\nprint((\"\\n\".join(map(str, buf))))\n", "measured_fast_code_sha256": "bcdd6c5a04ef827b58b6607368ffa34b279e2ae37471e8105f1a35498de66f88", "measured_slow_code": "from bisect import bisect_right\n\nA, B, Q = list(map(int, input().split()))\nINF = 10**18\ns = [-INF]\nt = [-INF]\nfor _ in range(A):\n s.append(int(eval(input())))\ns.append(INF)\nfor _ in range(B):\n t.append(int(eval(input())))\nt.append(INF)\nx = list(map(int, (eval(input()) for _ in range(Q))))\nfor y in x:\n i = bisect_right(s, y)\n j = bisect_right(t, y)\n # ans = INF\n # for S in [s[i - 1], s[i]]:\n # for T in [t[j - 1], t[j]]:\n # d1, d2 = abs(S - y) + abs(T - S), abs(T - y) + abs(S - T)\n # ans = min(ans, d1, d2)\n ans = min(\n max(abs(s[i] - y), abs(t[j] - y)),\n max(abs(s[i - 1] - y), abs(t[j - 1] - y)),\n 2 * min(abs(s[i] - y), abs(t[j - 1] - y))\n + max(abs(s[i] - y), abs(t[j - 1] - y)),\n 2 * min(abs(s[i - 1] - y), abs(t[j] - y))\n + max(abs(s[i - 1] - y), abs(t[j] - y)),\n )\n print(ans)\n", "measured_slow_code_sha256": "5ee88bb22a8715381d1db1eaa76cc6289c67db4f88cb4c3cf8b7900c103ceea0", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.472374635153053, "pair_id": "python_v2_79b238c56f91bfb2eb950382", "per_case_slow_code_faster_fraction": 0.12, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03112", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03112_bcdd6c5a04ef827b58b6607368ffa34b279e2ae37471e8105f1a35498de66f88.jsonl.gz", "inputs": "reproduction/python/inputs/p03112.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03112_5ee88bb22a8715381d1db1eaa76cc6289c67db4f88cb4c3cf8b7900c103ceea0.jsonl.gz"}, "slow_code": "from bisect import bisect_right\n\nA, B, Q = list(map(int, input().split()))\nINF = 10**18\ns = [-INF]\nt = [-INF]\nfor _ in range(A):\n s.append(int(eval(input())))\ns.append(INF)\nfor _ in range(B):\n t.append(int(eval(input())))\nt.append(INF)\nx = list(map(int, (eval(input()) for _ in range(Q))))\nfor y in x:\n i = bisect_right(s, y)\n j = bisect_right(t, y)\n\n ans = min(\n max(abs(s[i] - y), abs(t[j] - y)),\n max(abs(s[i - 1] - y), abs(t[j - 1] - y)),\n 2 * min(abs(s[i] - y), abs(t[j - 1] - y))\n + max(abs(s[i] - y), abs(t[j - 1] - y)),\n 2 * min(abs(s[i - 1] - y), abs(t[j] - y))\n + max(abs(s[i - 1] - y), abs(t[j] - y)),\n )\n print(ans)\n", "slow_code_sha256": "70a0838fb9039f9a0191353f573ddcfeb432e9116549baec081c38786cddfa54", "slow_id": "p03112_5ee88bb22a8715381d1db1eaa76cc6289c67db4f88cb4c3cf8b7900c103ceea0", "speedup": 2.682887866422792, "stratum": "2-4", "within_pair_jaccard": 0.3333333333333333, "workload": {"case_count": 100, "description": "For each starting coordinate x_i on a line, minimize travel distance needed to visit at least one shrine s_j and one temple t_j in any order. Shrine and temple lists are strictly increasing; all shrine, temple and query coordinates are distinct. Observed inputs: A=1..100000 (median 1000); B=1..100000 (median 1000); Q=1..100000 (median 1000); s_i=1..9999998614; t_i=10814..10000000000; x_i=1631..9999995619.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 3267071, "median": 267821.5, "min": 31}, "input_format": ["A B Q\ns_1\n...\ns_A\nt_1\n...\nt_B\nx_1\n...\nx_Q"], "input_format_status": "source_input_section", "input_lines": {"max": 300001, "median": 30001.0, "min": 4}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 300003, "median": 30003.0, "min": 6}}} -{"case_ids": ["p02706_case_000", "p02706_case_001", "p02706_case_002", "p02706_case_003", "p02706_case_004", "p02706_case_005", "p02706_case_006", "p02706_case_007", "p02706_case_008", "p02706_case_009", "p02706_case_010", "p02706_case_011", "p02706_case_012", "p02706_case_013", "p02706_case_014", "p02706_case_015", "p02706_case_016", "p02706_case_017", "p02706_case_018", "p02706_case_019", "p02706_case_020", "p02706_case_021", "p02706_case_022", "p02706_case_023", "p02706_case_024", "p02706_case_025", "p02706_case_026", "p02706_case_027", "p02706_case_028", "p02706_case_029", "p02706_case_030", "p02706_case_031", "p02706_case_032", "p02706_case_033", "p02706_case_034", "p02706_case_035", "p02706_case_036", "p02706_case_037", "p02706_case_038", "p02706_case_039", "p02706_case_040", "p02706_case_041", "p02706_case_042", "p02706_case_043", "p02706_case_044", "p02706_case_045", "p02706_case_046", "p02706_case_047", "p02706_case_048", "p02706_case_049", "p02706_case_050", "p02706_case_051", "p02706_case_052", "p02706_case_053", "p02706_case_054", "p02706_case_055", "p02706_case_056", "p02706_case_057", "p02706_case_058", "p02706_case_059", "p02706_case_060", "p02706_case_061", "p02706_case_062", "p02706_case_063", "p02706_case_064", "p02706_case_065", "p02706_case_066", "p02706_case_067", "p02706_case_068", "p02706_case_069", "p02706_case_070", "p02706_case_071", "p02706_case_072", "p02706_case_073", "p02706_case_074", "p02706_case_075", "p02706_case_076", "p02706_case_077", "p02706_case_078", "p02706_case_079", "p02706_case_080", "p02706_case_081", "p02706_case_082", "p02706_case_083", "p02706_case_084", "p02706_case_085", "p02706_case_086", "p02706_case_087", "p02706_case_088", "p02706_case_089", "p02706_case_090", "p02706_case_091", "p02706_case_092", "p02706_case_093", "p02706_case_094", "p02706_case_095", "p02706_case_096", "p02706_case_097", "p02706_case_098", "p02706_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n, m = list(map(int, input().split()))\na = list(map(int, input().split()))\ntotal = sum(a)\nif n < total:\n print((-1))\nelse:\n print((n - total))\n", "fast_code_sha256": "eb9d0c2b61b3f681c832c5eacfb83fd28eb883f51ab337a1979c5cebc9f8250a", "fast_id": "p02706_eb9d0c2b61b3f681c832c5eacfb83fd28eb883f51ab337a1979c5cebc9f8250a", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n, m = list(map(int, input().split()))\na = list(map(int, input().split()))\ntotal = sum(a)\nif n < total:\n print((-1))\nelse:\n print((n - total))\n", "measured_fast_code_sha256": "eb9d0c2b61b3f681c832c5eacfb83fd28eb883f51ab337a1979c5cebc9f8250a", "measured_slow_code": "import numpy as np\n\nN, M = list(map(int, input().split()))\nA = np.array(list(map(int, input().split())))\nif (output := N - np.sum(A)) >= 0:\n print(output)\nelse:\n print((-1))\n", "measured_slow_code_sha256": "6d9390fbb5e9518f2796fc8b039ac068ff03b6e2e1e8bd75479e8bba99073086", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 60.15603058877729, "pair_id": "python_v2_d3b540955a36f00c5d5e577b", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02706", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02706_eb9d0c2b61b3f681c832c5eacfb83fd28eb883f51ab337a1979c5cebc9f8250a.jsonl.gz", "inputs": "reproduction/python/inputs/p02706.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02706_6d9390fbb5e9518f2796fc8b039ac068ff03b6e2e1e8bd75479e8bba99073086.jsonl.gz"}, "slow_code": "import numpy as np\n\nN, M = list(map(int, input().split()))\nA = np.array(list(map(int, input().split())))\nif (output := N - np.sum(A)) >= 0:\n print(output)\nelse:\n print((-1))\n", "slow_code_sha256": "6d9390fbb5e9518f2796fc8b039ac068ff03b6e2e1e8bd75479e8bba99073086", "slow_id": "p02706_6d9390fbb5e9518f2796fc8b039ac068ff03b6e2e1e8bd75479e8bba99073086", "speedup": 168.04206151222152, "stratum": "8+", "within_pair_jaccard": 0.4166666666666667, "workload": {"case_count": 100, "description": "During N vacation days, complete M assignments requiring A_i days each, with no simultaneous assignments. Maximize days left free, or report -1 if all assignments cannot fit. Observed inputs: N=1..1000000 (median 1000); M=1..10000 (median 6445); A_i=1..10000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 60014, "median": 15213.0, "min": 6}, "input_format": ["N M\nA_1 ... A_M"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 10002, "median": 6447.0, "min": 3}}} -{"case_ids": ["p02821_case_000", "p02821_case_001", "p02821_case_002", "p02821_case_003", "p02821_case_004", "p02821_case_005", "p02821_case_006", "p02821_case_007", "p02821_case_008", "p02821_case_009", "p02821_case_010", "p02821_case_011", "p02821_case_012", "p02821_case_013", "p02821_case_014", "p02821_case_015", "p02821_case_016", "p02821_case_017", "p02821_case_018", "p02821_case_019", "p02821_case_020", "p02821_case_021", "p02821_case_022", "p02821_case_023", "p02821_case_024", "p02821_case_025", "p02821_case_026", "p02821_case_027", "p02821_case_028", "p02821_case_029", "p02821_case_030", "p02821_case_031", "p02821_case_032", "p02821_case_033", "p02821_case_034", "p02821_case_035", "p02821_case_036", "p02821_case_037", "p02821_case_038", "p02821_case_039", "p02821_case_040", "p02821_case_041", "p02821_case_042", "p02821_case_043", "p02821_case_044", "p02821_case_045", "p02821_case_046", "p02821_case_047", "p02821_case_048", "p02821_case_049", "p02821_case_050", "p02821_case_051", "p02821_case_052", "p02821_case_053", "p02821_case_054", "p02821_case_055", "p02821_case_056", "p02821_case_057", "p02821_case_058", "p02821_case_059", "p02821_case_060", "p02821_case_061", "p02821_case_062", "p02821_case_063", "p02821_case_064", "p02821_case_065", "p02821_case_066", "p02821_case_067", "p02821_case_068", "p02821_case_069", "p02821_case_070", "p02821_case_071", "p02821_case_072", "p02821_case_073", "p02821_case_074", "p02821_case_075", "p02821_case_076", "p02821_case_077", "p02821_case_078", "p02821_case_079", "p02821_case_080", "p02821_case_081", "p02821_case_082", "p02821_case_083", "p02821_case_084", "p02821_case_085", "p02821_case_086", "p02821_case_087", "p02821_case_088", "p02821_case_089", "p02821_case_090", "p02821_case_091", "p02821_case_092", "p02821_case_093", "p02821_case_094", "p02821_case_095", "p02821_case_096", "p02821_case_097", "p02821_case_098", "p02821_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from collections import Counter, defaultdict, deque\nfrom heapq import heappop, heappush, heapify\nimport sys, bisect, math, itertools, fractions, pprint\n\nsys.setrecursionlimit(10**8)\nmod = 10**9 + 7\nINF = float(\"inf\")\n\n\ndef inp():\n return int(sys.stdin.readline())\n\n\ndef inpl():\n return list(map(int, sys.stdin.readline().split()))\n\n\nn, m = inpl()\na = sorted(inpl())\nng = 10**9 + 1\nok = -1\n\n\ndef sol(x):\n cnt = 0\n for i, t in enumerate(a):\n tmp = x - t\n c = bisect.bisect_left(a, tmp)\n cnt += n - c\n return True if cnt >= m else False\n\n\nwhile ng - ok > 1:\n mid = (ng + ok) // 2\n if sol(mid):\n ok = mid\n else:\n ng = mid\n\n\nres = 0\ncnt = 0\nrevc = [0]\nfor i in range(n)[::-1]:\n revc.append(revc[-1] + a[i])\n\nfor i in range(n):\n j = n - bisect.bisect_left(a, ok - a[i])\n res += j * a[i] + revc[j]\n cnt += j\nres -= (cnt - m) * ok\nprint(res)\n", "fast_code_sha256": "989e8dd4ce036c9244fbd2ef32b672367097371ed9d7103e50cee378ecb5da12", "fast_id": "p02821_c9efb7d18af49a59dd15a1250de2e653148c9f6ae74e009e94a5daac7c99a967", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from collections import Counter, defaultdict, deque\nfrom heapq import heappop, heappush, heapify\nimport sys, bisect, math, itertools, fractions, pprint\n\nsys.setrecursionlimit(10**8)\nmod = 10**9 + 7\nINF = float(\"inf\")\n\n\ndef inp():\n return int(sys.stdin.readline())\n\n\ndef inpl():\n return list(map(int, sys.stdin.readline().split()))\n\n\nn, m = inpl()\na = sorted(inpl())\nng = 10**9 + 1\nok = -1\n\n\ndef sol(x):\n cnt = 0\n for i, t in enumerate(a):\n tmp = x - t\n c = bisect.bisect_left(a, tmp)\n cnt += n - c\n return True if cnt >= m else False\n\n\nwhile ng - ok > 1:\n mid = (ng + ok) // 2\n if sol(mid):\n ok = mid\n else:\n ng = mid\n # print(ok,ng)\n# print(ok)\nres = 0\ncnt = 0\nrevc = [0]\nfor i in range(n)[::-1]:\n revc.append(revc[-1] + a[i])\n# print(revc)\nfor i in range(n):\n j = n - bisect.bisect_left(a, ok - a[i])\n res += j * a[i] + revc[j]\n cnt += j\nres -= (cnt - m) * ok\nprint(res)\n", "measured_fast_code_sha256": "c9efb7d18af49a59dd15a1250de2e653148c9f6ae74e009e94a5daac7c99a967", "measured_slow_code": "import numpy\n\nn, m = [int(i) for i in input().split()]\nA = [int(i) for i in input().split()]\nsup_A = 10**5\nB = [0] * (1 << 18)\nfor a in A:\n B[a] += 1\nC = numpy.fft.fft(B)\nD = numpy.fft.ifft(C * C)\nans = 0\ncnt = 0\nfor i in range(2 * sup_A, -1, -1):\n d = int(D[i].real + 0.5)\n if cnt + d >= m:\n ans += (m - cnt) * i\n break\n cnt += d\n ans += i * d\nprint(ans)\n", "measured_slow_code_sha256": "97130d6ace5a903e1edc12eb8a93320b23b47ebb28afc38859a52235b5d542cf", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 16.66151643781025, "pair_id": "python_v2_442817a5c23704678d26b90a", "per_case_slow_code_faster_fraction": 0.43, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02821", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02821_c9efb7d18af49a59dd15a1250de2e653148c9f6ae74e009e94a5daac7c99a967.jsonl.gz", "inputs": "reproduction/python/inputs/p02821.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02821_97130d6ace5a903e1edc12eb8a93320b23b47ebb28afc38859a52235b5d542cf.jsonl.gz"}, "slow_code": "import numpy\n\nn, m = [int(i) for i in input().split()]\nA = [int(i) for i in input().split()]\nsup_A = 10**5\nB = [0] * (1 << 18)\nfor a in A:\n B[a] += 1\nC = numpy.fft.fft(B)\nD = numpy.fft.ifft(C * C)\nans = 0\ncnt = 0\nfor i in range(2 * sup_A, -1, -1):\n d = int(D[i].real + 0.5)\n if cnt + d >= m:\n ans += (m - cnt) * i\n break\n cnt += d\n ans += i * d\nprint(ans)\n", "slow_code_sha256": "97130d6ace5a903e1edc12eb8a93320b23b47ebb28afc38859a52235b5d542cf", "slow_id": "p02821_97130d6ace5a903e1edc12eb8a93320b23b47ebb28afc38859a52235b5d542cf", "speedup": 4.3357015345219425, "stratum": "4-8", "within_pair_jaccard": 0.1951219512195122, "workload": {"case_count": 100, "description": "Choose M distinct ordered pairs (x,y) of guests among N, allowing x=y. Pair (x,y) yields happiness A_x+A_y. Maximize total happiness; reversing unequal IDs gives a different pair. Observed inputs: N=1..100000 (median 1000); M=1..10000000000 (median 1000000); A_i=1..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 700019, "median": 5888.0, "min": 8}, "input_format": ["N M\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100002, "median": 1002.0, "min": 3}}} -{"case_ids": ["p00100_case_000", "p00100_case_001", "p00100_case_002", "p00100_case_003", "p00100_case_004", "p00100_case_005", "p00100_case_006", "p00100_case_007", "p00100_case_008", "p00100_case_009", "p00100_case_010", "p00100_case_011", "p00100_case_012", "p00100_case_013", "p00100_case_014", "p00100_case_015", "p00100_case_016", "p00100_case_017", "p00100_case_018", "p00100_case_019", "p00100_case_020", "p00100_case_021", "p00100_case_022", "p00100_case_023", "p00100_case_024", "p00100_case_025", "p00100_case_026", "p00100_case_027", "p00100_case_028", "p00100_case_029", "p00100_case_030", "p00100_case_031", "p00100_case_032", "p00100_case_033", "p00100_case_034", "p00100_case_035", "p00100_case_036", "p00100_case_037", "p00100_case_038", "p00100_case_039", "p00100_case_040", "p00100_case_041", "p00100_case_042", "p00100_case_043", "p00100_case_044", "p00100_case_045", "p00100_case_046", "p00100_case_047", "p00100_case_048", "p00100_case_049", "p00100_case_050", "p00100_case_051", "p00100_case_052", "p00100_case_053", "p00100_case_054", "p00100_case_055", "p00100_case_056", "p00100_case_057", "p00100_case_058", "p00100_case_059", "p00100_case_060", "p00100_case_061", "p00100_case_062", "p00100_case_063", "p00100_case_064", "p00100_case_065", "p00100_case_066", "p00100_case_067", "p00100_case_068", "p00100_case_069", "p00100_case_070", "p00100_case_071", "p00100_case_072", "p00100_case_073", "p00100_case_074", "p00100_case_075", "p00100_case_076", "p00100_case_077", "p00100_case_078", "p00100_case_079", "p00100_case_080", "p00100_case_081", "p00100_case_082", "p00100_case_083", "p00100_case_084", "p00100_case_085", "p00100_case_086", "p00100_case_087", "p00100_case_088", "p00100_case_089", "p00100_case_090", "p00100_case_091", "p00100_case_092", "p00100_case_093", "p00100_case_094", "p00100_case_095", "p00100_case_096", "p00100_case_097", "p00100_case_098", "p00100_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "while True:\n n = int(eval(input()))\n if n == 0:\n break\n d = dict()\n sep = []\n for _ in range(n):\n i, p, q = list(map(int, input().split()))\n if i in d:\n d[i] += p * q\n else:\n d[i] = p * q\n sep.append(i)\n tmp = list([x for x in list(d.items()) if x[1] >= 1000000])\n if len(tmp):\n tmp = {t[0]: t[1] for t in tmp}\n for s in sep:\n if s in tmp:\n print(s)\n else:\n print(\"NA\")\n", "fast_code_sha256": "fac6663288e36d34bc40af158b96cb2e3bfeb4e851c1db0ad7779aa4e646f6ac", "fast_id": "p00100_fac6663288e36d34bc40af158b96cb2e3bfeb4e851c1db0ad7779aa4e646f6ac", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "while True:\n n = int(eval(input()))\n if n == 0:\n break\n d = dict()\n sep = []\n for _ in range(n):\n i, p, q = list(map(int, input().split()))\n if i in d:\n d[i] += p * q\n else:\n d[i] = p * q\n sep.append(i)\n tmp = list([x for x in list(d.items()) if x[1] >= 1000000])\n if len(tmp):\n tmp = {t[0]: t[1] for t in tmp}\n for s in sep:\n if s in tmp:\n print(s)\n else:\n print(\"NA\")\n", "measured_fast_code_sha256": "fac6663288e36d34bc40af158b96cb2e3bfeb4e851c1db0ad7779aa4e646f6ac", "measured_slow_code": "# coding: utf-8\n# Here your code !\nemployeeSalesList = []\n\n\ndef resetDataset():\n del employeeSalesList[0 : len(employeeSalesList) + 1]\n\n\ndef readDataCount():\n return int(eval(input()))\n\n\ndef searchEmployeeSales(employeeId):\n for data in employeeSalesList:\n if data[0] == employeeId:\n return data\n newData = [employeeId, 0]\n employeeSalesList.append(newData)\n return newData\n\n\nanswerList = []\n\n\ndef printEmployeeOfDataset():\n found = False\n for data in employeeSalesList:\n if data[1] >= 1000000:\n answerList.append(data[0])\n found = True\n if not found:\n answerList.append(\"NA\")\n\n\nresetDataset()\ndataCount = readDataCount()\nwhile dataCount > 0:\n for _ in range(dataCount):\n employeeId, price, volume = list(map(int, input().split(\" \")))\n employeeSales = searchEmployeeSales(employeeId)\n employeeSales[1] += price * volume\n printEmployeeOfDataset()\n resetDataset()\n dataCount = readDataCount()\nfor row in answerList:\n print(row)\n", "measured_slow_code_sha256": "cef1778ac31a96be11bbaf1627cf2c94f88d5ea9907d28e19f44f8b7a1d378a1", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.8498784769944434, "pair_id": "python_v2_febb9d6c5d967880ac936be1", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p00100", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p00100_fac6663288e36d34bc40af158b96cb2e3bfeb4e851c1db0ad7779aa4e646f6ac.jsonl.gz", "inputs": "reproduction/python/inputs/p00100.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p00100_cef1778ac31a96be11bbaf1627cf2c94f88d5ea9907d28e19f44f8b7a1d378a1.jsonl.gz"}, "slow_code": "employeeSalesList = []\n\n\ndef resetDataset():\n del employeeSalesList[0 : len(employeeSalesList) + 1]\n\n\ndef readDataCount():\n return int(eval(input()))\n\n\ndef searchEmployeeSales(employeeId):\n for data in employeeSalesList:\n if data[0] == employeeId:\n return data\n newData = [employeeId, 0]\n employeeSalesList.append(newData)\n return newData\n\n\nanswerList = []\n\n\ndef printEmployeeOfDataset():\n found = False\n for data in employeeSalesList:\n if data[1] >= 1000000:\n answerList.append(data[0])\n found = True\n if not found:\n answerList.append(\"NA\")\n\n\nresetDataset()\ndataCount = readDataCount()\nwhile dataCount > 0:\n for _ in range(dataCount):\n employeeId, price, volume = list(map(int, input().split(\" \")))\n employeeSales = searchEmployeeSales(employeeId)\n employeeSales[1] += price * volume\n printEmployeeOfDataset()\n resetDataset()\n dataCount = readDataCount()\nfor row in answerList:\n print(row)\n", "slow_code_sha256": "90eeb5d17013d087aa6085c705f90d8dd3710ca805802ad063fb9a202bdd752c", "slow_id": "p00100_cef1778ac31a96be11bbaf1627cf2c94f88d5ea9907d28e19f44f8b7a1d378a1", "speedup": 3.2721169548260822, "stratum": "2-4", "within_pair_jaccard": 0.37037037037037035, "workload": {"case_count": 100, "description": "For each sales dataset, sum price p times quantity q per employee ID. Output IDs with total proceeds at least 1000000 in first-appearance order, or NA if none qualify. IDs may repeat across records; a final zero ends input. Observed inputs: datasets=1; n=5..3999; total_records=5..3999 (median 400); p=1..999957; q=1..99998.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 71109, "median": 7115.5, "min": 65}, "input_format": ["n_1\nid_1 p_1 q_1\n...\nid_(n_1) p_(n_1) q_(n_1)\n[next datasets]\n0"], "input_format_status": "source_input_section", "input_lines": {"max": 4001, "median": 402.0, "min": 7}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 11999, "median": 1202.0, "min": 17}}} -{"case_ids": ["p02703_case_000", "p02703_case_001", "p02703_case_002", "p02703_case_003", "p02703_case_004", "p02703_case_005", "p02703_case_006", "p02703_case_007", "p02703_case_008", "p02703_case_009", "p02703_case_010", "p02703_case_011", "p02703_case_012", "p02703_case_013", "p02703_case_014", "p02703_case_015", "p02703_case_016", "p02703_case_017", "p02703_case_018", "p02703_case_019", "p02703_case_020", "p02703_case_021", "p02703_case_022", "p02703_case_023", "p02703_case_024", "p02703_case_025", "p02703_case_026", "p02703_case_027", "p02703_case_028", "p02703_case_029", "p02703_case_030", "p02703_case_031", "p02703_case_032", "p02703_case_033", "p02703_case_034", "p02703_case_035", "p02703_case_036", "p02703_case_037", "p02703_case_038", "p02703_case_039", "p02703_case_040", "p02703_case_041", "p02703_case_042", "p02703_case_043", "p02703_case_044", "p02703_case_045", "p02703_case_046", "p02703_case_047", "p02703_case_048", "p02703_case_049", "p02703_case_050", "p02703_case_051", "p02703_case_052", "p02703_case_053", "p02703_case_054", "p02703_case_055", "p02703_case_056", "p02703_case_057", "p02703_case_058", "p02703_case_059", "p02703_case_060", "p02703_case_061", "p02703_case_062", "p02703_case_063", "p02703_case_064", "p02703_case_065", "p02703_case_066", "p02703_case_067", "p02703_case_068", "p02703_case_069", "p02703_case_070", "p02703_case_071", "p02703_case_072", "p02703_case_073", "p02703_case_074", "p02703_case_075", "p02703_case_076", "p02703_case_077", "p02703_case_078", "p02703_case_079", "p02703_case_080", "p02703_case_081", "p02703_case_082", "p02703_case_083", "p02703_case_084", "p02703_case_085", "p02703_case_086", "p02703_case_087", "p02703_case_088", "p02703_case_089", "p02703_case_090", "p02703_case_091", "p02703_case_092", "p02703_case_093", "p02703_case_094", "p02703_case_095", "p02703_case_096", "p02703_case_097", "p02703_case_098", "p02703_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "executable_AST_equal_except_explicit_explanatory_string_removal_and_all_frozen_inputs_checker_pass", "fast_code": "import sys\nfrom heapq import heapify, heappop, heappush\n\nsr = lambda: sys.stdin.readline().rstrip()\nir = lambda: int(sr())\nlr = lambda: list(map(int, sr().split()))\n\nN, M, S = lr()\nUVAB = [lr() for _ in range(M)]\nCD = [lr() for _ in range(N)]\nAmax = 0\nfor i in range(M):\n a = UVAB[i][2]\n if a > Amax:\n Amax = a\nlimit = Amax * (N - 1)\nS = min(S, limit)\ngraph = [[] for _ in range(N + 1)]\nfor u, v, a, b in UVAB:\n graph[u].append((v, a, b))\n graph[v].append((u, a, b))\n\n\ndef dijkstra(start):\n\n INF = 10**15\n dist = [[INF for _ in range(limit + 1)] for _ in range(N + 1)]\n dist[1][S] = 0\n que = [(0, S, 1)]\n while que:\n time, silver, prev = heappop(que)\n if dist[prev][silver] < time:\n continue\n for next, a, b in graph[prev]:\n t = time + b\n si = silver - a\n if si < 0:\n continue\n if dist[next][si] > t:\n dist[next][si] = t\n heappush(que, (t, si, next))\n c, d = CD[prev - 1]\n si = min(limit, silver + c)\n while dist[prev][si] > time + d:\n dist[prev][si] = time + d\n heappush(que, (time + d, si, prev))\n si += c\n si = min(limit, si)\n time += d\n return dist\n\n\ndist = dijkstra(1)\nfor i in range(2, N + 1):\n d = dist[i]\n answer = min(d)\n print(answer)\n", "fast_code_sha256": "cf5ec513ccd40bda2ee4fef5b71dbbed5c51cb14be7b8ee5383525a868af9741", "fast_id": "p02703_2b3b89ca0c11a69ed85e89d07cd23dbcbaa50d9a8f0f0c0a5481862f264f5ae6", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "# coding: utf-8\nimport sys\nfrom heapq import heapify, heappop, heappush\n\nsr = lambda: sys.stdin.readline().rstrip()\nir = lambda: int(sr())\nlr = lambda: list(map(int, sr().split()))\n# 同じ地点で銀貨の枚数によって別の状態として扱う(最大max(A)*(N-1))\nN, M, S = lr()\nUVAB = [lr() for _ in range(M)]\nCD = [lr() for _ in range(N)] # 0-indexed\nAmax = 0\nfor i in range(M):\n a = UVAB[i][2]\n if a > Amax:\n Amax = a\nlimit = Amax * (N - 1)\nS = min(S, limit)\ngraph = [[] for _ in range(N + 1)] # 1-indexed\nfor u, v, a, b in UVAB:\n graph[u].append((v, a, b))\n graph[v].append((u, a, b))\n\n\ndef dijkstra(start):\n # 時間、銀貨の枚数、現在地をqueへ\n INF = 10**15\n dist = [[INF for _ in range(limit + 1)] for _ in range(N + 1)]\n dist[1][S] = 0\n que = [(0, S, 1)]\n while que:\n time, silver, prev = heappop(que)\n if dist[prev][silver] < time:\n continue\n for next, a, b in graph[prev]:\n t = time + b\n si = silver - a\n if si < 0:\n continue\n if dist[next][si] > t:\n dist[next][si] = t\n heappush(que, (t, si, next))\n c, d = CD[prev - 1]\n si = min(limit, silver + c)\n while dist[prev][si] > time + d:\n dist[prev][si] = time + d\n heappush(que, (time + d, si, prev))\n si += c\n si = min(limit, si)\n time += d\n return dist\n\n\ndist = dijkstra(1)\nfor i in range(2, N + 1):\n d = dist[i]\n answer = min(d)\n print(answer)\n# 52\n", "measured_fast_code_sha256": "2b3b89ca0c11a69ed85e89d07cd23dbcbaa50d9a8f0f0c0a5481862f264f5ae6", "measured_slow_code": "class Dijkstra:\n \"\"\"ダイクストラ法\n 重み付きグラフにおける単一始点最短路アルゴリズム\n * 使用条件\n - 負のコストがないこと\n - 有向グラフ、無向グラフともにOK\n * 計算量はO(E*log(V))\n * ベルマンフォード法より高速なので、負のコストがないならばこちらを使うとよい\n \"\"\"\n\n class Edge:\n \"\"\"重み付き有向辺\"\"\"\n\n def __init__(self, _to, _cost):\n self.to = _to\n self.cost = _cost\n\n def __init__(self, V):\n \"\"\"重み付き有向辺\n 無向辺を表現したいときは、_fromと_toを逆にした有向辺を加えればよい\n Args:\n V(int): 頂点の数\n \"\"\"\n self.G = [[] for i in range(V)] # 隣接リストG[u][i] := 頂点uのi個目の隣接辺\n self._E = 0 # 辺の数\n self._V = V # 頂点の数\n\n @property\n def E(self):\n \"\"\"辺数\n 無向グラフのときは、辺数は有向グラフの倍になる\n \"\"\"\n return self._E\n\n @property\n def V(self):\n \"\"\"頂点数\"\"\"\n return self._V\n\n def add(self, _from, _to, _cost):\n \"\"\"2頂点と、辺のコストを追加する\"\"\"\n self.G[_from].append(self.Edge(_to, _cost))\n self._E += 1\n\n def shortest_path(self, s):\n \"\"\"始点sから頂点iまでの最短路を格納したリストを返す\n Args:\n s(int): 始点s\n Returns:\n d(list): d[i] := 始点sから頂点iまでの最短コストを格納したリスト。\n 到達不可の場合、値はfloat(\"inf\")\n \"\"\"\n import heapq\n\n que = [] # プライオリティキュー(ヒープ木)\n d = [float(\"inf\")] * self.V\n d[s] = 0\n heapq.heappush(que, (0, s)) # 始点の(最短距離, 頂点番号)をヒープに追加する\n while len(que) != 0:\n cost, v = heapq.heappop(que)\n # キューに格納されている最短経路の候補がdの距離よりも大きければ、他の経路で最短経路が存在するので、処理をスキップ\n if d[v] < cost:\n continue\n for i in range(len(self.G[v])):\n # 頂点vに隣接する各頂点に関して、頂点vを経由した場合の距離を計算し、今までの距離(d)よりも小さければ更新する\n e = self.G[v][i] # vのi個目の隣接辺e\n if d[e.to] > d[v] + e.cost:\n d[e.to] = d[v] + e.cost # dの更新\n heapq.heappush(\n que, (d[e.to], e.to)\n ) # キューに新たな最短経路の候補(最短距離, 頂点番号)の情報をpush\n return d\n\n\nN, M, S = list(map(int, input().split()))\npro = Dijkstra(N * (50 * (N - 1) + 1))\nfor i in range(0, M):\n u, v, a, b = list(map(int, input().split()))\n for j in range(a, 50 * (N - 1) + 1):\n pro.add(N * j + u - 1, N * (j - a) + v - 1, b)\n pro.add(N * j + v - 1, N * (j - a) + u - 1, b)\nfor i in range(0, N):\n c, d = list(map(int, input().split()))\n for j in range(0, 50 * (N - 1)):\n to = min(50 * (N - 1), j + c)\n pro.add(N * j + i, N * to + i, d)\nS = min(50 * (N - 1), S)\nans = pro.shortest_path(N * S)\nfor i in range(1, N):\n p = float(\"inf\")\n for j in range(0, 50 * (N - 1) + 1):\n p = min(p, ans[N * j + i])\n print(p)\n", "measured_slow_code_sha256": "90be895b60848d0137d21c0628afac2da1af1edd13c122290ee2e39bc535083d", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.296620352779737, "pair_id": "python_v2_e10db78a313df7ef4c5a8779", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02703", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02703_2b3b89ca0c11a69ed85e89d07cd23dbcbaa50d9a8f0f0c0a5481862f264f5ae6.jsonl.gz", "inputs": "reproduction/python/inputs/p02703.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02703_90be895b60848d0137d21c0628afac2da1af1edd13c122290ee2e39bc535083d.jsonl.gz"}, "slow_code": "class Dijkstra:\n\n class Edge:\n\n def __init__(self, _to, _cost):\n self.to = _to\n self.cost = _cost\n\n def __init__(self, V):\n self.G = [[] for i in range(V)]\n self._E = 0\n self._V = V\n\n @property\n def E(self):\n return self._E\n\n @property\n def V(self):\n return self._V\n\n def add(self, _from, _to, _cost):\n self.G[_from].append(self.Edge(_to, _cost))\n self._E += 1\n\n def shortest_path(self, s):\n import heapq\n\n que = []\n d = [float(\"inf\")] * self.V\n d[s] = 0\n heapq.heappush(que, (0, s))\n while len(que) != 0:\n cost, v = heapq.heappop(que)\n\n if d[v] < cost:\n continue\n for i in range(len(self.G[v])):\n\n e = self.G[v][i]\n if d[e.to] > d[v] + e.cost:\n d[e.to] = d[v] + e.cost\n heapq.heappush(que, (d[e.to], e.to))\n return d\n\n\nN, M, S = list(map(int, input().split()))\npro = Dijkstra(N * (50 * (N - 1) + 1))\nfor i in range(0, M):\n u, v, a, b = list(map(int, input().split()))\n for j in range(a, 50 * (N - 1) + 1):\n pro.add(N * j + u - 1, N * (j - a) + v - 1, b)\n pro.add(N * j + v - 1, N * (j - a) + u - 1, b)\nfor i in range(0, N):\n c, d = list(map(int, input().split()))\n for j in range(0, 50 * (N - 1)):\n to = min(50 * (N - 1), j + c)\n pro.add(N * j + i, N * to + i, d)\nS = min(50 * (N - 1), S)\nans = pro.shortest_path(N * S)\nfor i in range(1, N):\n p = float(\"inf\")\n for j in range(0, 50 * (N - 1) + 1):\n p = min(p, ans[N * j + i])\n print(p)\n", "slow_code_sha256": "37319076c3b5100beb96d2f9c428eac7654c186db18fd46b9d512ca816af7955", "slow_id": "p02703_90be895b60848d0137d21c0628afac2da1af1edd13c122290ee2e39bc535083d", "speedup": 5.069887536991625, "stratum": "4-8", "within_pair_jaccard": 0.2711864406779661, "workload": {"case_count": 100, "description": "Find minimum travel time from city 1 to every other city in a connected undirected graph. Start with S silver and 10^100 gold coins. Edge i costs A_i silver and B_i minutes; in city i, each gold exchanges for C_i silver in D_i minutes. Observed inputs: N=2..50 (median 50); M=1..100 (median 100); S=0..1000000000 (median 0); A_i=1..50; B_i=1..1000000000; C_i=1..1000000000; D_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 2839, "median": 1347.5, "min": 31}, "input_format": ["N M S\nU_1 V_1 A_1 B_1\n...\nU_M V_M A_M B_M\nC_1 D_1\n...\nC_N D_N"], "input_format_status": "source_input_section", "input_lines": {"max": 151, "median": 151.0, "min": 4}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 503, "median": 503.0, "min": 11}}} -{"case_ids": ["p03786_case_000", "p03786_case_001", "p03786_case_002", "p03786_case_003", "p03786_case_004", "p03786_case_005", "p03786_case_006", "p03786_case_007", "p03786_case_008", "p03786_case_009", "p03786_case_010", "p03786_case_011", "p03786_case_012", "p03786_case_013", "p03786_case_014", "p03786_case_015", "p03786_case_016", "p03786_case_017", "p03786_case_018", "p03786_case_019", "p03786_case_020", "p03786_case_021", "p03786_case_022", "p03786_case_023", "p03786_case_024", "p03786_case_025", "p03786_case_026", "p03786_case_027", "p03786_case_028", "p03786_case_029", "p03786_case_030", "p03786_case_031", "p03786_case_032", "p03786_case_033", "p03786_case_034", "p03786_case_035", "p03786_case_036", "p03786_case_037", "p03786_case_038", "p03786_case_039", "p03786_case_040", "p03786_case_041", "p03786_case_042", "p03786_case_043", "p03786_case_044", "p03786_case_045", "p03786_case_046", "p03786_case_047", "p03786_case_048", "p03786_case_049", "p03786_case_050", "p03786_case_051", "p03786_case_052", "p03786_case_053", "p03786_case_054", "p03786_case_055", "p03786_case_056", "p03786_case_057", "p03786_case_058", "p03786_case_059", "p03786_case_060", "p03786_case_061", "p03786_case_062", "p03786_case_063", "p03786_case_064", "p03786_case_065", "p03786_case_066", "p03786_case_067", "p03786_case_068", "p03786_case_069", "p03786_case_070", "p03786_case_071", "p03786_case_072", "p03786_case_073", "p03786_case_074", "p03786_case_075", "p03786_case_076", "p03786_case_077", "p03786_case_078", "p03786_case_079", "p03786_case_080", "p03786_case_081", "p03786_case_082", "p03786_case_083", "p03786_case_084", "p03786_case_085", "p03786_case_086", "p03786_case_087", "p03786_case_088", "p03786_case_089", "p03786_case_090", "p03786_case_091", "p03786_case_092", "p03786_case_093", "p03786_case_094", "p03786_case_095", "p03786_case_096", "p03786_case_097", "p03786_case_098", "p03786_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\na = list(map(int, input().split()))\na.sort()\nacum = [0] * (n + 1)\nfor i in range(n):\n acum[i + 1] += acum[i] + a[i]\nans = 1\nfor i in reversed(list(range(1, n))):\n if a[i] <= 2 * acum[i]:\n ans += 1\n else:\n break\nprint(ans)\n", "fast_code_sha256": "1d963f525480740c00705d471cd92e8fde9d4a305a4a66ac183263eadec27adb", "fast_id": "p03786_1d963f525480740c00705d471cd92e8fde9d4a305a4a66ac183263eadec27adb", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\na = list(map(int, input().split()))\na.sort()\nacum = [0] * (n + 1)\nfor i in range(n):\n acum[i + 1] += acum[i] + a[i]\nans = 1\nfor i in reversed(list(range(1, n))):\n if a[i] <= 2 * acum[i]:\n ans += 1\n else:\n break\nprint(ans)\n", "measured_fast_code_sha256": "1d963f525480740c00705d471cd92e8fde9d4a305a4a66ac183263eadec27adb", "measured_slow_code": "n = int(eval(input()))\na = list(map(int, input().split()))\nimport numpy as np\n\na = sorted(a)\ncum = np.cumsum(a)\ncum = list(reversed(cum))\na = list(reversed(a))\nans = 1\nfor i in range(1, n):\n if a[i - 1] <= cum[i] * 2:\n ans += 1\n else:\n break\nprint(ans)\n", "measured_slow_code_sha256": "9c47b5351287e97e1c5de7875f912e9de0349c4286a89e13a6aa097ca0c9f946", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 709.0375469372779, "pair_id": "python_v2_282fd7f6d9ff0d55ccabfee4", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03786", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03786_1d963f525480740c00705d471cd92e8fde9d4a305a4a66ac183263eadec27adb.jsonl.gz", "inputs": "reproduction/python/inputs/p03786.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03786_9c47b5351287e97e1c5de7875f912e9de0349c4286a89e13a6aa097ca0c9f946.jsonl.gz"}, "slow_code": "n = int(eval(input()))\na = list(map(int, input().split()))\nimport numpy as np\n\na = sorted(a)\ncum = np.cumsum(a)\ncum = list(reversed(cum))\na = list(reversed(a))\nans = 1\nfor i in range(1, n):\n if a[i - 1] <= cum[i] * 2:\n ans += 1\n else:\n break\nprint(ans)\n", "slow_code_sha256": "9c47b5351287e97e1c5de7875f912e9de0349c4286a89e13a6aa097ca0c9f946", "slow_id": "p03786_9c47b5351287e97e1c5de7875f912e9de0349c4286a89e13a6aa097ca0c9f946", "speedup": 106.82686730869885, "stratum": "8+", "within_pair_jaccard": 0.6666666666666666, "workload": {"case_count": 100, "description": "N creatures have distinct colors and sizes A_i. A creature of size A may absorb one of size C<=2*A; its size becomes A+C and its color survives. Count colors that can remain after all creatures merge. Observed inputs: N=2..100000 (median 10); A_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1100007, "median": 101.5, "min": 14}, "input_format": ["N\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100001, "median": 11.0, "min": 3}}} -{"case_ids": ["p03962_case_000", "p03962_case_001", "p03962_case_002", "p03962_case_003", "p03962_case_004", "p03962_case_005", "p03962_case_006", "p03962_case_007", "p03962_case_008", "p03962_case_009", "p03962_case_010", "p03962_case_011", "p03962_case_012", "p03962_case_013", "p03962_case_014", "p03962_case_015", "p03962_case_016", "p03962_case_017", "p03962_case_018", "p03962_case_019", "p03962_case_020", "p03962_case_021", "p03962_case_022", "p03962_case_023", "p03962_case_024", "p03962_case_025", "p03962_case_026", "p03962_case_027", "p03962_case_028", "p03962_case_029", "p03962_case_030", "p03962_case_031", "p03962_case_032", "p03962_case_033", "p03962_case_034", "p03962_case_035", "p03962_case_036", "p03962_case_037", "p03962_case_038", "p03962_case_039", "p03962_case_040", "p03962_case_041", "p03962_case_042", "p03962_case_043", "p03962_case_044", "p03962_case_045", "p03962_case_046", "p03962_case_047", "p03962_case_048", "p03962_case_049", "p03962_case_050", "p03962_case_051", "p03962_case_052", "p03962_case_053", "p03962_case_054", "p03962_case_055", "p03962_case_056", "p03962_case_057", "p03962_case_058", "p03962_case_059", "p03962_case_060", "p03962_case_061", "p03962_case_062", "p03962_case_063", "p03962_case_064", "p03962_case_065", "p03962_case_066", "p03962_case_067", "p03962_case_068", "p03962_case_069", "p03962_case_070", "p03962_case_071", "p03962_case_072", "p03962_case_073", "p03962_case_074", "p03962_case_075", "p03962_case_076", "p03962_case_077", "p03962_case_078", "p03962_case_079", "p03962_case_080", "p03962_case_081", "p03962_case_082", "p03962_case_083", "p03962_case_084", "p03962_case_085", "p03962_case_086", "p03962_case_087", "p03962_case_088", "p03962_case_089", "p03962_case_090", "p03962_case_091", "p03962_case_092", "p03962_case_093", "p03962_case_094", "p03962_case_095", "p03962_case_096", "p03962_case_097", "p03962_case_098", "p03962_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "print((len({*input().split()})))\n", "fast_code_sha256": "58d5197f8e56470e4bf6371be6a42c8db60f474c0b6b7e6c6e002ba43e31c53c", "fast_id": "p03962_58d5197f8e56470e4bf6371be6a42c8db60f474c0b6b7e6c6e002ba43e31c53c", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "print((len({*input().split()})))\n", "measured_fast_code_sha256": "58d5197f8e56470e4bf6371be6a42c8db60f474c0b6b7e6c6e002ba43e31c53c", "measured_slow_code": "def main():\n a, b, c = list(map(int, input().split()))\n print((len(set([a, b, c]))))\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "94b5708574eb089eb69c60d607f6ca9a4290b0c22eedfd5cbef01210b79bc6bf", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.802936208842705, "pair_id": "python_v2_a387fb562dbac692d2d3d6fc", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03962", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03962_58d5197f8e56470e4bf6371be6a42c8db60f474c0b6b7e6c6e002ba43e31c53c.jsonl.gz", "inputs": "reproduction/python/inputs/p03962.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03962_94b5708574eb089eb69c60d607f6ca9a4290b0c22eedfd5cbef01210b79bc6bf.jsonl.gz"}, "slow_code": "def main():\n a, b, c = list(map(int, input().split()))\n print((len(set([a, b, c]))))\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "94b5708574eb089eb69c60d607f6ca9a4290b0c22eedfd5cbef01210b79bc6bf", "slow_id": "p03962_94b5708574eb089eb69c60d607f6ca9a4290b0c22eedfd5cbef01210b79bc6bf", "speedup": 2.8012559479716814, "stratum": "2-4", "within_pair_jaccard": 0.25, "workload": {"case_count": 100, "description": "Three paint cans have integer color IDs a,b,c. Count distinct colors among the three, allowing equal IDs. Observed inputs: color_value=1..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 12, "median": 9.0, "min": 6}, "input_format": ["a b c"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3, "median": 3.0, "min": 3}}} -{"case_ids": ["p02607_case_000", "p02607_case_001", "p02607_case_002", "p02607_case_003", "p02607_case_004", "p02607_case_005", "p02607_case_006", "p02607_case_007", "p02607_case_008", "p02607_case_009", "p02607_case_010", "p02607_case_011", "p02607_case_012", "p02607_case_013", "p02607_case_014", "p02607_case_015", "p02607_case_016", "p02607_case_017", "p02607_case_018", "p02607_case_019", "p02607_case_020", "p02607_case_021", "p02607_case_022", "p02607_case_023", "p02607_case_024", "p02607_case_025", "p02607_case_026", "p02607_case_027", "p02607_case_028", "p02607_case_029", "p02607_case_030", "p02607_case_031", "p02607_case_032", "p02607_case_033", "p02607_case_034", "p02607_case_035", "p02607_case_036", "p02607_case_037", "p02607_case_038", "p02607_case_039", "p02607_case_040", "p02607_case_041", "p02607_case_042", "p02607_case_043", "p02607_case_044", "p02607_case_045", "p02607_case_046", "p02607_case_047", "p02607_case_048", "p02607_case_049", "p02607_case_050", "p02607_case_051", "p02607_case_052", "p02607_case_053", "p02607_case_054", "p02607_case_055", "p02607_case_056", "p02607_case_057", "p02607_case_058", "p02607_case_059", "p02607_case_060", "p02607_case_061", "p02607_case_062", "p02607_case_063", "p02607_case_064", "p02607_case_065", "p02607_case_066", "p02607_case_067", "p02607_case_068", "p02607_case_069", "p02607_case_070", "p02607_case_071", "p02607_case_072", "p02607_case_073", "p02607_case_074", "p02607_case_075", "p02607_case_076", "p02607_case_077", "p02607_case_078", "p02607_case_079", "p02607_case_080", "p02607_case_081", "p02607_case_082", "p02607_case_083", "p02607_case_084", "p02607_case_085", "p02607_case_086", "p02607_case_087", "p02607_case_088", "p02607_case_089", "p02607_case_090", "p02607_case_091", "p02607_case_092", "p02607_case_093", "p02607_case_094", "p02607_case_095", "p02607_case_096", "p02607_case_097", "p02607_case_098", "p02607_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N = int(eval(input()))\na = list(map(int, input().split()))\ncnt = 0\nfor i in range(0, N):\n if (i + 1) % 2 != 0 and a[i] % 2 != 0:\n cnt += 1\nprint(cnt)\n", "fast_code_sha256": "05b99b52034db21973a41e2c43ba5b5ea7e7f5eb9b31d85f0efcbe09a481db0e", "fast_id": "p02607_05b99b52034db21973a41e2c43ba5b5ea7e7f5eb9b31d85f0efcbe09a481db0e", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N = int(eval(input()))\na = list(map(int, input().split()))\ncnt = 0\nfor i in range(0, N):\n if (i + 1) % 2 != 0 and a[i] % 2 != 0:\n cnt += 1\nprint(cnt)\n", "measured_fast_code_sha256": "05b99b52034db21973a41e2c43ba5b5ea7e7f5eb9b31d85f0efcbe09a481db0e", "measured_slow_code": "import sys\nfrom collections import deque\nimport numpy as np\nimport math\n\nsys.setrecursionlimit(10**6)\n\n\ndef S():\n return sys.stdin.readline().rstrip()\n\n\ndef SL():\n return list(map(str, sys.stdin.readline().rstrip().split()))\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\ndef IL():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef Main():\n n = I()\n a = list(IL())\n c = 0\n for rep in range(0, n, 2):\n if a[rep] % 2:\n c += 1\n print(c)\n return\n\n\nif __name__ == \"__main__\":\n Main()\n", "measured_slow_code_sha256": "80d5226038bdb32cf21a0b535cbd1c7092e4e8009586ccf346a6a6f305bc5b7d", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 978.2554293948672, "pair_id": "python_v2_a90f41af02c9cad7a05298fe", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02607", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02607_05b99b52034db21973a41e2c43ba5b5ea7e7f5eb9b31d85f0efcbe09a481db0e.jsonl.gz", "inputs": "reproduction/python/inputs/p02607.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02607_80d5226038bdb32cf21a0b535cbd1c7092e4e8009586ccf346a6a6f305bc5b7d.jsonl.gz"}, "slow_code": "import sys\nfrom collections import deque\nimport numpy as np\nimport math\n\nsys.setrecursionlimit(10**6)\n\n\ndef S():\n return sys.stdin.readline().rstrip()\n\n\ndef SL():\n return list(map(str, sys.stdin.readline().rstrip().split()))\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\ndef IL():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef Main():\n n = I()\n a = list(IL())\n c = 0\n for rep in range(0, n, 2):\n if a[rep] % 2:\n c += 1\n print(c)\n return\n\n\nif __name__ == \"__main__\":\n Main()\n", "slow_code_sha256": "80d5226038bdb32cf21a0b535cbd1c7092e4e8009586ccf346a6a6f305bc5b7d", "slow_id": "p02607_80d5226038bdb32cf21a0b535cbd1c7092e4e8009586ccf346a6a6f305bc5b7d", "speedup": 894.59645128046, "stratum": "8+", "within_pair_jaccard": 0.2765957446808511, "workload": {"case_count": 100, "description": "Count array entries for which both the 1-based position i and the integer value a_i are odd. Observed inputs: N=1..100 (median 30); a_i=1..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 300, "median": 67.5, "min": 4}, "input_format": ["N\na_1 ... a_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 101, "median": 31.0, "min": 2}}} -{"case_ids": ["p03722_case_000", "p03722_case_001", "p03722_case_002", "p03722_case_003", "p03722_case_004", "p03722_case_005", "p03722_case_006", "p03722_case_007", "p03722_case_008", "p03722_case_009", "p03722_case_010", "p03722_case_011", "p03722_case_012", "p03722_case_013", "p03722_case_014", "p03722_case_015", "p03722_case_016", "p03722_case_017", "p03722_case_018", "p03722_case_019", "p03722_case_020", "p03722_case_021", "p03722_case_022", "p03722_case_023", "p03722_case_024", "p03722_case_025", "p03722_case_026", "p03722_case_027", "p03722_case_028", "p03722_case_029", "p03722_case_030", "p03722_case_031", "p03722_case_032", "p03722_case_033", "p03722_case_034", "p03722_case_035", "p03722_case_036", "p03722_case_037", "p03722_case_038", "p03722_case_039", "p03722_case_040", "p03722_case_041", "p03722_case_042", "p03722_case_043", "p03722_case_044", "p03722_case_045", "p03722_case_046", "p03722_case_047", "p03722_case_048", "p03722_case_049", "p03722_case_050", "p03722_case_051", "p03722_case_052", "p03722_case_053", "p03722_case_054", "p03722_case_055", "p03722_case_056", "p03722_case_057", "p03722_case_058", "p03722_case_059", "p03722_case_060", "p03722_case_061", "p03722_case_062", "p03722_case_063", "p03722_case_064", "p03722_case_065", "p03722_case_066", "p03722_case_067", "p03722_case_068", "p03722_case_069", "p03722_case_070", "p03722_case_071", "p03722_case_072", "p03722_case_073", "p03722_case_074", "p03722_case_075", "p03722_case_076", "p03722_case_077", "p03722_case_078", "p03722_case_079", "p03722_case_080", "p03722_case_081", "p03722_case_082", "p03722_case_083", "p03722_case_084", "p03722_case_085", "p03722_case_086", "p03722_case_087", "p03722_case_088", "p03722_case_089", "p03722_case_090", "p03722_case_091", "p03722_case_092", "p03722_case_093", "p03722_case_094", "p03722_case_095", "p03722_case_096", "p03722_case_097", "p03722_case_098", "p03722_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n, m = list(map(int, input().split()))\ne = []\nfor i in range(m):\n a, b, c = list(map(int, input().split()))\n e.append((a - 1, b - 1, c))\nmaxdis = [-float(\"inf\") for i in range(n)]\nmaxdis[0] = 0\nmugen = False\nfor i in range(n):\n for j in e:\n st, gl, cost = j\n if maxdis[gl] < maxdis[st] + cost:\n maxdis[gl] = maxdis[st] + cost\n if i >= n - 1 and (gl == n - 1):\n mugen = True\n break\nif mugen:\n print(\"inf\")\nelse:\n print((maxdis[n - 1]))\n", "fast_code_sha256": "fa13dedae158b2b6ed6527a3e086a5df2ac5d3c6d9471a8e82f2aaa8f7aeef2c", "fast_id": "p03722_fa13dedae158b2b6ed6527a3e086a5df2ac5d3c6d9471a8e82f2aaa8f7aeef2c", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n, m = list(map(int, input().split()))\ne = []\nfor i in range(m):\n a, b, c = list(map(int, input().split()))\n e.append((a - 1, b - 1, c))\nmaxdis = [-float(\"inf\") for i in range(n)]\nmaxdis[0] = 0\nmugen = False\nfor i in range(n):\n for j in e:\n st, gl, cost = j\n if maxdis[gl] < maxdis[st] + cost:\n maxdis[gl] = maxdis[st] + cost\n if i >= n - 1 and (gl == n - 1):\n mugen = True\n break\nif mugen:\n print(\"inf\")\nelse:\n print((maxdis[n - 1]))\n", "measured_fast_code_sha256": "fa13dedae158b2b6ed6527a3e086a5df2ac5d3c6d9471a8e82f2aaa8f7aeef2c", "measured_slow_code": "n, m = list(map(int, input().split()))\nA = [list(map(int, input().split())) for i in range(m)]\nfor i in range(m):\n A[i][2] = -A[i][2]\nP = [float(\"inf\")] * (n + 1)\nP[1] = 0\nF = [[0] * 2 for i in range(n + 1)]\nF[1][0] = 1\nF[n][1] = 1\nfor i in range(n):\n for j in range(m):\n if F[A[j][0]][0] == 1:\n F[A[j][1]][0] = 1\n if F[A[j][1]][1] == 1:\n F[A[j][0]][1] = 1\n P[A[j][1]] = min(P[A[j][1]], P[A[j][0]] + A[j][2])\nans0 = P[:]\nfor i in range(n):\n for j in range(m):\n if F[A[j][0]][0] == 1:\n F[A[j][1]][0] = 1\n if F[A[j][1]][1] == 1:\n F[A[j][0]][1] = 1\n P[A[j][1]] = min(P[A[j][1]], P[A[j][0]] + A[j][2])\nans1 = P[:]\n# print(F)\ndef d():\n for i in range(n + 1):\n if F[i] == [1, 1] and ans1[i] < ans0[i]:\n return \"inf\"\n return -ans0[n]\n\n\nprint((d()))\n", "measured_slow_code_sha256": "093486d8bf1bade74d0f7f3e71a354e24ef56e72b4374c89214f326ef468df33", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4.741085902447219, "pair_id": "python_v2_4bb92f975e00a2da47d32ef2", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03722", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03722_fa13dedae158b2b6ed6527a3e086a5df2ac5d3c6d9471a8e82f2aaa8f7aeef2c.jsonl.gz", "inputs": "reproduction/python/inputs/p03722.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03722_093486d8bf1bade74d0f7f3e71a354e24ef56e72b4374c89214f326ef468df33.jsonl.gz"}, "slow_code": "n, m = list(map(int, input().split()))\nA = [list(map(int, input().split())) for i in range(m)]\nfor i in range(m):\n A[i][2] = -A[i][2]\nP = [float(\"inf\")] * (n + 1)\nP[1] = 0\nF = [[0] * 2 for i in range(n + 1)]\nF[1][0] = 1\nF[n][1] = 1\nfor i in range(n):\n for j in range(m):\n if F[A[j][0]][0] == 1:\n F[A[j][1]][0] = 1\n if F[A[j][1]][1] == 1:\n F[A[j][0]][1] = 1\n P[A[j][1]] = min(P[A[j][1]], P[A[j][0]] + A[j][2])\nans0 = P[:]\nfor i in range(n):\n for j in range(m):\n if F[A[j][0]][0] == 1:\n F[A[j][1]][0] = 1\n if F[A[j][1]][1] == 1:\n F[A[j][0]][1] = 1\n P[A[j][1]] = min(P[A[j][1]], P[A[j][0]] + A[j][2])\nans1 = P[:]\n\n\ndef d():\n for i in range(n + 1):\n if F[i] == [1, 1] and ans1[i] < ans0[i]:\n return \"inf\"\n return -ans0[n]\n\n\nprint((d()))\n", "slow_code_sha256": "92422ed6fb877fc678246d4b0dc0afea655ea5fbeb5e6aea37d1962e1b39f169", "slow_id": "p03722_093486d8bf1bade74d0f7f3e71a354e24ef56e72b4374c89214f326ef468df33", "speedup": 4.144676444678833, "stratum": "4-8", "within_pair_jaccard": 0.4418604651162791, "workload": {"case_count": 100, "description": "Start at vertex 1 with score zero and traverse directed edges, adding weight c_i each time. End only at vertex N. Maximize score, or report inf if unbounded; reaching N is guaranteed. No self-loops or repeated directed edges. Observed inputs: N=2..1000 (median 100); M=1..2000 (median 999); c_i=-1000000000..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 36387, "median": 17847.0, "min": 18}, "input_format": ["N M\na_1 b_1 c_1\n...\na_M b_M c_M"], "input_format_status": "source_input_section", "input_lines": {"max": 2001, "median": 1000.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 6002, "median": 2999.0, "min": 5}}} -{"case_ids": ["p02683_case_000", "p02683_case_001", "p02683_case_002", "p02683_case_003", "p02683_case_004", "p02683_case_005", "p02683_case_006", "p02683_case_007", "p02683_case_008", "p02683_case_009", "p02683_case_010", "p02683_case_011", "p02683_case_012", "p02683_case_013", "p02683_case_014", "p02683_case_015", "p02683_case_016", "p02683_case_017", "p02683_case_018", "p02683_case_019", "p02683_case_020", "p02683_case_021", "p02683_case_022", "p02683_case_023", "p02683_case_024", "p02683_case_025", "p02683_case_026", "p02683_case_027", "p02683_case_028", "p02683_case_029", "p02683_case_030", "p02683_case_031", "p02683_case_032", "p02683_case_033", "p02683_case_034", "p02683_case_035", "p02683_case_036", "p02683_case_037", "p02683_case_038", "p02683_case_039", "p02683_case_040", "p02683_case_041", "p02683_case_042", "p02683_case_043", "p02683_case_044", "p02683_case_045", "p02683_case_046", "p02683_case_047", "p02683_case_048", "p02683_case_049", "p02683_case_050", "p02683_case_051", "p02683_case_052", "p02683_case_053", "p02683_case_054", "p02683_case_055", "p02683_case_056", "p02683_case_057", "p02683_case_058", "p02683_case_059", "p02683_case_060", "p02683_case_061", "p02683_case_062", "p02683_case_063", "p02683_case_064", "p02683_case_065", "p02683_case_066", "p02683_case_067", "p02683_case_068", "p02683_case_069", "p02683_case_070", "p02683_case_071", "p02683_case_072", "p02683_case_073", "p02683_case_074", "p02683_case_075", "p02683_case_076", "p02683_case_077", "p02683_case_078", "p02683_case_079", "p02683_case_080", "p02683_case_081", "p02683_case_082", "p02683_case_083", "p02683_case_084", "p02683_case_085", "p02683_case_086", "p02683_case_087", "p02683_case_088", "p02683_case_089", "p02683_case_090", "p02683_case_091", "p02683_case_092", "p02683_case_093", "p02683_case_094", "p02683_case_095", "p02683_case_096", "p02683_case_097", "p02683_case_098", "p02683_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N, M, X = list(map(int, input().split()))\nc_a_list = [list(map(int, input().split())) for _ in range(N)]\nmin_money = 1e10\nfor i in range(2**N):\n buy_list = [0] * N\n skill = [0] * M\n money = 0\n for j in range(N):\n if i % 2 == 0:\n buy_list[j] = 1\n i //= 2\n for buy_idx, ca in enumerate(c_a_list):\n if buy_list[buy_idx] == 1:\n for a_idx, a in enumerate(ca[1:]):\n skill[a_idx] += a\n money += ca[0]\n for s_idx, s in enumerate(skill):\n if s < X:\n break\n if s_idx == M - 1:\n min_money = min(min_money, money)\nif min_money == 1e10:\n print((-1))\nelse:\n print(min_money)\n", "fast_code_sha256": "062d1304cb847c6ff44db5230714a6643878e721fb03c47f6bfd2c49eba3f4cb", "fast_id": "p02683_062d1304cb847c6ff44db5230714a6643878e721fb03c47f6bfd2c49eba3f4cb", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N, M, X = list(map(int, input().split()))\nc_a_list = [list(map(int, input().split())) for _ in range(N)]\nmin_money = 1e10\nfor i in range(2**N):\n buy_list = [0] * N\n skill = [0] * M\n money = 0\n for j in range(N):\n if i % 2 == 0:\n buy_list[j] = 1\n i //= 2\n for buy_idx, ca in enumerate(c_a_list):\n if buy_list[buy_idx] == 1:\n for a_idx, a in enumerate(ca[1:]):\n skill[a_idx] += a\n money += ca[0]\n for s_idx, s in enumerate(skill):\n if s < X:\n break\n if s_idx == M - 1:\n min_money = min(min_money, money)\nif min_money == 1e10:\n print((-1))\nelse:\n print(min_money)\n", "measured_fast_code_sha256": "062d1304cb847c6ff44db5230714a6643878e721fb03c47f6bfd2c49eba3f4cb", "measured_slow_code": "n, m, x = list(map(int, input().split()))\ninn = [list(map(int, input().split())) for _ in range(n)]\nc = [inn[_][0] for _ in range(n)]\nara = [inn[_][1:] for _ in range(n)]\nans = 1e9\nfor mask in range(2**15):\n cost = 0\n cnt = [0 for _ in range(m)]\n for i in range(n):\n if ((1 << i) & mask) == 0:\n continue\n cost += c[i]\n for j in range(m):\n cnt[j] += ara[i][j]\n ok = 1\n for i in range(m):\n if cnt[i] < x:\n ok = 0\n if ok:\n ans = min(ans, cost)\nif ans == 1e9:\n ans = -1\nprint(ans)\n", "measured_slow_code_sha256": "3a953b935633d889972610e2b72a1d2f66172bb0bf1cb8f239c17f21d3ff6a83", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 399.971525810067, "pair_id": "python_v2_48699c5ae2e00a3b311bb1c5", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02683", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02683_062d1304cb847c6ff44db5230714a6643878e721fb03c47f6bfd2c49eba3f4cb.jsonl.gz", "inputs": "reproduction/python/inputs/p02683.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02683_3a953b935633d889972610e2b72a1d2f66172bb0bf1cb8f239c17f21d3ff6a83.jsonl.gz"}, "slow_code": "n, m, x = list(map(int, input().split()))\ninn = [list(map(int, input().split())) for _ in range(n)]\nc = [inn[_][0] for _ in range(n)]\nara = [inn[_][1:] for _ in range(n)]\nans = 1e9\nfor mask in range(2**15):\n cost = 0\n cnt = [0 for _ in range(m)]\n for i in range(n):\n if ((1 << i) & mask) == 0:\n continue\n cost += c[i]\n for j in range(m):\n cnt[j] += ara[i][j]\n ok = 1\n for i in range(m):\n if cnt[i] < x:\n ok = 0\n if ok:\n ans = min(ans, cost)\nif ans == 1e9:\n ans = -1\nprint(ans)\n", "slow_code_sha256": "3a953b935633d889972610e2b72a1d2f66172bb0bf1cb8f239c17f21d3ff6a83", "slow_id": "p02683_3a953b935633d889972610e2b72a1d2f66172bb0bf1cb8f239c17f21d3ff6a83", "speedup": 151.5589413748638, "stratum": "8+", "within_pair_jaccard": 0.3469387755102041, "workload": {"case_count": 100, "description": "Choose a subset of N books of costs C_i. Reading book i once adds A_i,j to skill j, initially zero. Minimize cost while all M skills reach at least X, or report impossibility. Observed inputs: N=1..12 (median 6); M=1..12 (median 6); X=1..100000 (median 7000); C_i=1..99895; A_i_j=0..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 933, "median": 207.0, "min": 10}, "input_format": ["N M X\nC_1 A_1,1 ... A_1,M\n...\nC_N A_N,1 ... A_N,M"], "input_format_status": "source_input_section", "input_lines": {"max": 13, "median": 7.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 159, "median": 45.0, "min": 5}}} -{"case_ids": ["p03721_case_000", "p03721_case_001", "p03721_case_002", "p03721_case_003", "p03721_case_004", "p03721_case_005", "p03721_case_006", "p03721_case_007", "p03721_case_008", "p03721_case_009", "p03721_case_010", "p03721_case_011", "p03721_case_012", "p03721_case_013", "p03721_case_014", "p03721_case_015", "p03721_case_016", "p03721_case_017", "p03721_case_018", "p03721_case_019", "p03721_case_020", "p03721_case_021", "p03721_case_022", "p03721_case_023", "p03721_case_024", "p03721_case_025", "p03721_case_026", "p03721_case_027", "p03721_case_028", "p03721_case_029", "p03721_case_030", "p03721_case_031", "p03721_case_032", "p03721_case_033", "p03721_case_034", "p03721_case_035", "p03721_case_036", "p03721_case_037", "p03721_case_038", "p03721_case_039", "p03721_case_040", "p03721_case_041", "p03721_case_042", "p03721_case_043", "p03721_case_044", "p03721_case_045", "p03721_case_046", "p03721_case_047", "p03721_case_048", "p03721_case_049", "p03721_case_050", "p03721_case_051", "p03721_case_052", "p03721_case_053", "p03721_case_054", "p03721_case_055", "p03721_case_056", "p03721_case_057", "p03721_case_058", "p03721_case_059", "p03721_case_060", "p03721_case_061", "p03721_case_062", "p03721_case_063", "p03721_case_064", "p03721_case_065", "p03721_case_067", "p03721_case_068", "p03721_case_069", "p03721_case_070", "p03721_case_071", "p03721_case_072", "p03721_case_073", "p03721_case_074", "p03721_case_075", "p03721_case_076", "p03721_case_077", "p03721_case_078", "p03721_case_079", "p03721_case_080", "p03721_case_081", "p03721_case_082", "p03721_case_083", "p03721_case_084", "p03721_case_085", "p03721_case_087", "p03721_case_088", "p03721_case_089", "p03721_case_090", "p03721_case_091", "p03721_case_092", "p03721_case_093", "p03721_case_094", "p03721_case_095", "p03721_case_096", "p03721_case_097", "p03721_case_098", "p03721_case_099", "p03721_v2_8dbaa32dabbc59559f15", "p03721_v2_b1687ced952bc758cf7f"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\ninput = sys.stdin.readline\n\n\ndef main():\n n, k = list(map(int, input().rstrip().split()))\n arr = sorted([list(map(int, input().rstrip().split())) for _ in range(n)])\n cur, cnt, ans = 0, 0, 0\n for i, j in arr:\n ans = i\n cnt += j\n if cnt >= k:\n break\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "a778db8b9537c998b38dcfb4f67caa472836c91b5da44e58969f1da356e2155a", "fast_id": "p03721_50445f1b87f3fbd2651e9e9e38b3ea73ec27d8b9ecd8a7fc37d88fd595bb5aef", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "# ABC061C - Big Array\nimport sys\n\ninput = sys.stdin.readline\n\n\ndef main():\n n, k = list(map(int, input().rstrip().split()))\n arr = sorted([list(map(int, input().rstrip().split())) for _ in range(n)])\n cur, cnt, ans = 0, 0, 0\n for i, j in arr:\n ans = i\n cnt += j\n if cnt >= k:\n break\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "50445f1b87f3fbd2651e9e9e38b3ea73ec27d8b9ecd8a7fc37d88fd595bb5aef", "measured_slow_code": "import sys\nimport numpy as np\nimport collections\n\nn, k = [int(x) for x in sys.stdin.readline().split()]\nr = collections.defaultdict(int)\nfor i in range(n):\n a, b = [int(x) for x in sys.stdin.readline().split()]\n r[a] += b\nd = sorted(r.items())\nc = 0\nfor i, j in enumerate(d):\n c += j[1]\n if c >= k:\n print((int(j[0])))\n break\n", "measured_slow_code_sha256": "75d5b758a5047678745153d41c380f660afa7f9d4f81ada1ef8c3eb0b4fb4d9c", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.2096127383764679, "pair_id": "python_v2_2d146e727f02c485d9a1bbdf", "per_case_slow_code_faster_fraction": 0.08, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03721", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03721_50445f1b87f3fbd2651e9e9e38b3ea73ec27d8b9ecd8a7fc37d88fd595bb5aef.jsonl.gz", "inputs": "reproduction/python/inputs/p03721.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03721_75d5b758a5047678745153d41c380f660afa7f9d4f81ada1ef8c3eb0b4fb4d9c.jsonl.gz"}, "slow_code": "import sys\nimport numpy as np\nimport collections\n\nn, k = [int(x) for x in sys.stdin.readline().split()]\nr = collections.defaultdict(int)\nfor i in range(n):\n a, b = [int(x) for x in sys.stdin.readline().split()]\n r[a] += b\nd = sorted(r.items())\nc = 0\nfor i, j in enumerate(d):\n c += j[1]\n if c >= k:\n print((int(j[0])))\n break\n", "slow_code_sha256": "75d5b758a5047678745153d41c380f660afa7f9d4f81ada1ef8c3eb0b4fb4d9c", "slow_id": "p03721_75d5b758a5047678745153d41c380f660afa7f9d4f81ada1ef8c3eb0b4fb4d9c", "speedup": 5.059369094439389, "stratum": "4-8", "within_pair_jaccard": 0.4, "workload": {"case_count": 100, "description": "Operation i inserts b_i copies of integer a_i into an initially empty multiset. After N operations, find the 1-based K-th smallest element, counting multiplicity; the expanded multiset is not supplied. Observed inputs: N=1..100000 (median 100000); K=1..10000000000 (median 1154351153); a_i=1..100000; b_i=1..100000; total_elements=1..10000000000 (median 4995269195.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1289119, "median": 1177559.0, "min": 8}, "input_format": ["N K\na_1 b_1\n...\na_N b_N"], "input_format_status": "source_input_section", "input_lines": {"max": 100001, "median": 100001.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200002, "median": 200002.0, "min": 4}}} -{"case_ids": ["p02821_case_000", "p02821_case_001", "p02821_case_002", "p02821_case_003", "p02821_case_004", "p02821_case_005", "p02821_case_006", "p02821_case_007", "p02821_case_008", "p02821_case_009", "p02821_case_010", "p02821_case_011", "p02821_case_012", "p02821_case_013", "p02821_case_014", "p02821_case_015", "p02821_case_016", "p02821_case_017", "p02821_case_018", "p02821_case_019", "p02821_case_020", "p02821_case_021", "p02821_case_022", "p02821_case_023", "p02821_case_024", "p02821_case_025", "p02821_case_026", "p02821_case_027", "p02821_case_028", "p02821_case_029", "p02821_case_030", "p02821_case_031", "p02821_case_032", "p02821_case_033", "p02821_case_034", "p02821_case_035", "p02821_case_036", "p02821_case_037", "p02821_case_038", "p02821_case_039", "p02821_case_040", "p02821_case_041", "p02821_case_042", "p02821_case_043", "p02821_case_044", "p02821_case_045", "p02821_case_046", "p02821_case_047", "p02821_case_048", "p02821_case_049", "p02821_case_050", "p02821_case_051", "p02821_case_052", "p02821_case_053", "p02821_case_054", "p02821_case_055", "p02821_case_056", "p02821_case_057", "p02821_case_058", "p02821_case_059", "p02821_case_060", "p02821_case_061", "p02821_case_062", "p02821_case_063", "p02821_case_064", "p02821_case_065", "p02821_case_066", "p02821_case_067", "p02821_case_068", "p02821_case_069", "p02821_case_070", "p02821_case_071", "p02821_case_072", "p02821_case_073", "p02821_case_074", "p02821_case_075", "p02821_case_076", "p02821_case_077", "p02821_case_078", "p02821_case_079", "p02821_case_080", "p02821_case_081", "p02821_case_082", "p02821_case_083", "p02821_case_084", "p02821_case_085", "p02821_case_086", "p02821_case_087", "p02821_case_088", "p02821_case_089", "p02821_case_090", "p02821_case_091", "p02821_case_092", "p02821_case_093", "p02821_case_094", "p02821_case_095", "p02821_case_096", "p02821_case_097", "p02821_case_098", "p02821_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import bisect\n\nN, M = list(map(int, input().split()))\nA = list(map(int, input().split()))\nA.sort()\nB = [0] * N\nB[-1] = A[-1]\nfor i in range(N - 2, -1, -1):\n B[i] = B[i + 1] + A[i]\n\n\ndef C(mid):\n tmp = 0\n for a in A:\n pos = bisect.bisect_right(A, mid - a)\n tmp += N - pos\n return tmp > M\n\n\nlb = 0\nrb = 10**6\nwhile rb - lb > 1:\n happy = (lb + rb) // 2\n if C(happy):\n lb = happy\n else:\n rb = happy\nans = 0\ncnt = 0\nfor a in A:\n pos = bisect.bisect_right(A, rb - a)\n if pos == N:\n continue\n ans += B[pos] + (N - pos) * a\n cnt += N - pos\nans += (M - cnt) * rb\nprint(ans)\n", "fast_code_sha256": "34601d7d7dc7f83aef53e359ec2ed8a32edd50465c515fd44ebde89f61ae42bc", "fast_id": "p02821_34601d7d7dc7f83aef53e359ec2ed8a32edd50465c515fd44ebde89f61ae42bc", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import bisect\n\nN, M = list(map(int, input().split()))\nA = list(map(int, input().split()))\nA.sort()\nB = [0] * N\nB[-1] = A[-1]\nfor i in range(N - 2, -1, -1):\n B[i] = B[i + 1] + A[i]\n\n\ndef C(mid):\n tmp = 0\n for a in A:\n pos = bisect.bisect_right(A, mid - a)\n tmp += N - pos\n return tmp > M\n\n\nlb = 0\nrb = 10**6\nwhile rb - lb > 1:\n happy = (lb + rb) // 2\n if C(happy):\n lb = happy\n else:\n rb = happy\nans = 0\ncnt = 0\nfor a in A:\n pos = bisect.bisect_right(A, rb - a)\n if pos == N:\n continue\n ans += B[pos] + (N - pos) * a\n cnt += N - pos\nans += (M - cnt) * rb\nprint(ans)\n", "measured_fast_code_sha256": "34601d7d7dc7f83aef53e359ec2ed8a32edd50465c515fd44ebde89f61ae42bc", "measured_slow_code": "def main():\n import bisect\n import numpy as np\n\n n, k = list(map(int, input().split()))\n l = list(map(int, input().split()))\n l.sort()\n l = np.array(l)\n\n def bise(x):\n y = np.searchsorted(l, x - l)\n return n * n - y.sum()\n\n left = -1\n right = l[-1] * 2 + 1\n while right > left + 1:\n mid = (right + left) // 2\n if bise(mid) >= k:\n left = mid\n else:\n right = mid\n ans = 0\n acc = np.zeros(n + 1, np.int64)\n acc[1:] = l.cumsum()\n x = np.searchsorted(l, right - l)\n count = n * n - x.sum()\n ans = (acc[-1] - acc[x]).sum() + (l * (n - x)).sum()\n print((ans - (count - k) * left))\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "fdc3796f3095f69c7c3457ec5786e03ef47ca806aaa691afbc3f4956f2a4fce5", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 5.854947796205031, "pair_id": "python_v2_1625ac6a078c4c92a0fde771", "per_case_slow_code_faster_fraction": 0.43, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02821", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02821_34601d7d7dc7f83aef53e359ec2ed8a32edd50465c515fd44ebde89f61ae42bc.jsonl.gz", "inputs": "reproduction/python/inputs/p02821.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02821_fdc3796f3095f69c7c3457ec5786e03ef47ca806aaa691afbc3f4956f2a4fce5.jsonl.gz"}, "slow_code": "def main():\n import bisect\n import numpy as np\n\n n, k = list(map(int, input().split()))\n l = list(map(int, input().split()))\n l.sort()\n l = np.array(l)\n\n def bise(x):\n y = np.searchsorted(l, x - l)\n return n * n - y.sum()\n\n left = -1\n right = l[-1] * 2 + 1\n while right > left + 1:\n mid = (right + left) // 2\n if bise(mid) >= k:\n left = mid\n else:\n right = mid\n ans = 0\n acc = np.zeros(n + 1, np.int64)\n acc[1:] = l.cumsum()\n x = np.searchsorted(l, right - l)\n count = n * n - x.sum()\n ans = (acc[-1] - acc[x]).sum() + (l * (n - x)).sum()\n print((ans - (count - k) * left))\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "fdc3796f3095f69c7c3457ec5786e03ef47ca806aaa691afbc3f4956f2a4fce5", "slow_id": "p02821_fdc3796f3095f69c7c3457ec5786e03ef47ca806aaa691afbc3f4956f2a4fce5", "speedup": 5.605299894160942, "stratum": "4-8", "within_pair_jaccard": 0.3114754098360656, "workload": {"case_count": 100, "description": "Choose M distinct ordered pairs (x,y) of guests among N, allowing x=y. Pair (x,y) yields happiness A_x+A_y. Maximize total happiness; reversing unequal IDs gives a different pair. Observed inputs: N=1..100000 (median 1000); M=1..10000000000 (median 1000000); A_i=1..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 700019, "median": 5888.0, "min": 8}, "input_format": ["N M\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100002, "median": 1002.0, "min": 3}}} -{"case_ids": ["p03649_case_000", "p03649_case_001", "p03649_case_002", "p03649_case_003", "p03649_case_004", "p03649_case_005", "p03649_case_006", "p03649_case_007", "p03649_case_008", "p03649_case_009", "p03649_case_010", "p03649_case_011", "p03649_case_012", "p03649_case_013", "p03649_case_014", "p03649_case_015", "p03649_case_016", "p03649_case_017", "p03649_case_018", "p03649_case_019", "p03649_case_020", "p03649_case_021", "p03649_case_022", "p03649_case_023", "p03649_case_024", "p03649_case_025", "p03649_case_026", "p03649_case_027", "p03649_case_028", "p03649_case_029", "p03649_case_030", "p03649_case_031", "p03649_case_032", "p03649_case_033", "p03649_case_034", "p03649_case_035", "p03649_case_036", "p03649_case_037", "p03649_case_038", "p03649_case_039", "p03649_case_040", "p03649_case_041", "p03649_case_042", "p03649_case_043", "p03649_case_044", "p03649_case_045", "p03649_case_046", "p03649_case_047", "p03649_case_048", "p03649_case_049", "p03649_case_050", "p03649_case_051", "p03649_case_052", "p03649_case_053", "p03649_case_054", "p03649_case_055", "p03649_case_056", "p03649_case_057", "p03649_case_058", "p03649_case_059", "p03649_case_060", "p03649_case_061", "p03649_case_062", "p03649_case_063", "p03649_case_064", "p03649_case_065", "p03649_case_066", "p03649_case_067", "p03649_case_068", "p03649_case_069", "p03649_case_070", "p03649_case_071", "p03649_case_072", "p03649_case_073", "p03649_case_074", "p03649_case_075", "p03649_case_076", "p03649_case_077", "p03649_case_078", "p03649_case_079", "p03649_case_080", "p03649_case_081", "p03649_case_082", "p03649_case_083", "p03649_case_084", "p03649_case_085", "p03649_case_086", "p03649_case_087", "p03649_case_088", "p03649_case_089", "p03649_case_090", "p03649_case_091", "p03649_case_092", "p03649_case_093", "p03649_case_094", "p03649_case_095", "p03649_case_096", "p03649_case_097", "p03649_case_098", "p03649_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N = int(eval(input()))\nA = list(map(int, input().split()))\nans = 0\nwhile any([a > N - 1 for a in A]):\n A.sort()\n d = A[-1] - (N - 1)\n k = -(-d // N)\n ans += k\n A[-1] -= k * N\n for i in range(N - 1):\n A[i] += k\nprint(ans)\n", "fast_code_sha256": "da439b42fe4cab43135da3d8a37ba8eafda74b0df42deaad78f5eb8c8f40dd4e", "fast_id": "p03649_da439b42fe4cab43135da3d8a37ba8eafda74b0df42deaad78f5eb8c8f40dd4e", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N = int(eval(input()))\nA = list(map(int, input().split()))\nans = 0\nwhile any([a > N - 1 for a in A]):\n A.sort()\n d = A[-1] - (N - 1)\n k = -(-d // N)\n ans += k\n A[-1] -= k * N\n for i in range(N - 1):\n A[i] += k\nprint(ans)\n", "measured_fast_code_sha256": "da439b42fe4cab43135da3d8a37ba8eafda74b0df42deaad78f5eb8c8f40dd4e", "measured_slow_code": "N = int(eval(input()))\nA = list(map(int, input().split()))\n\n\ndef is_possible(C):\n res = 0\n for x in A:\n if x + C - N >= 0:\n res += (x + C - N) // (N + 1) + 1\n # print(res,C)\n return int(res <= C)\n\n\nl = 0 # impossible\nr = 10**30 # possible\nwhile r - l > 1:\n M = (l + r) // 2\n if is_possible(M) > 0:\n r = M\n else:\n l = M\nfor i in range(10**5, -1, -1):\n if is_possible(r - i):\n print((r - i))\n break\n", "measured_slow_code_sha256": "7802cf9e83571cee9bec8533b955c7050920fb8e58d892c4118c792371ce1f89", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 19.63207513534317, "pair_id": "python_v2_6b298efcec66cdb2e0cc0cc8", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03649", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03649_da439b42fe4cab43135da3d8a37ba8eafda74b0df42deaad78f5eb8c8f40dd4e.jsonl.gz", "inputs": "reproduction/python/inputs/p03649.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03649_7802cf9e83571cee9bec8533b955c7050920fb8e58d892c4118c792371ce1f89.jsonl.gz"}, "slow_code": "N = int(eval(input()))\nA = list(map(int, input().split()))\n\n\ndef is_possible(C):\n res = 0\n for x in A:\n if x + C - N >= 0:\n res += (x + C - N) // (N + 1) + 1\n\n return int(res <= C)\n\n\nl = 0\nr = 10**30\nwhile r - l > 1:\n M = (l + r) // 2\n if is_possible(M) > 0:\n r = M\n else:\n l = M\nfor i in range(10**5, -1, -1):\n if is_possible(r - i):\n print((r - i))\n break\n", "slow_code_sha256": "e4305a239f9ea2717f70ed35fb3cc27a2302b00f0e1b22d9b7c48daa06061a76", "slow_id": "p03649_7802cf9e83571cee9bec8533b955c7050920fb8e58d892c4118c792371ce1f89", "speedup": 38.80890525572216, "stratum": "8+", "within_pair_jaccard": 0.43243243243243246, "workload": {"case_count": 100, "description": "While the largest array entry is at least N, choose one maximum entry, subtract N from it, and add 1 to every other entry. Count operations until all entries are below N. Initial values are nonnegative. Observed inputs: N=2..50 (median 20); a_i=0..10000000000001000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 903, "median": 147.5, "min": 6}, "input_format": ["N\na_1 ... a_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 51, "median": 21.0, "min": 3}}} -{"case_ids": ["p03160_case_000", "p03160_case_001", "p03160_case_002", "p03160_case_003", "p03160_case_004", "p03160_case_005", "p03160_case_006", "p03160_case_007", "p03160_case_008", "p03160_case_009", "p03160_case_010", "p03160_case_011", "p03160_case_012", "p03160_case_013", "p03160_case_014", "p03160_case_015", "p03160_case_016", "p03160_case_017", "p03160_case_018", "p03160_case_019", "p03160_case_020", "p03160_case_021", "p03160_case_022", "p03160_case_023", "p03160_case_024", "p03160_case_025", "p03160_case_026", "p03160_case_027", "p03160_case_028", "p03160_case_029", "p03160_case_030", "p03160_case_031", "p03160_case_032", "p03160_case_033", "p03160_case_034", "p03160_case_035", "p03160_case_036", "p03160_case_037", "p03160_case_038", "p03160_case_039", "p03160_case_040", "p03160_case_041", "p03160_case_042", "p03160_case_043", "p03160_case_044", "p03160_case_045", "p03160_case_046", "p03160_case_047", "p03160_case_048", "p03160_case_049", "p03160_case_050", "p03160_case_051", "p03160_case_052", "p03160_case_053", "p03160_case_054", "p03160_case_055", "p03160_case_056", "p03160_case_057", "p03160_case_058", "p03160_case_059", "p03160_case_060", "p03160_case_061", "p03160_case_062", "p03160_case_063", "p03160_case_064", "p03160_case_065", "p03160_case_066", "p03160_case_067", "p03160_case_068", "p03160_case_069", "p03160_case_070", "p03160_case_071", "p03160_case_072", "p03160_case_073", "p03160_case_074", "p03160_case_075", "p03160_case_076", "p03160_case_077", "p03160_case_078", "p03160_case_079", "p03160_case_080", "p03160_case_081", "p03160_case_082", "p03160_case_083", "p03160_case_084", "p03160_case_085", "p03160_case_086", "p03160_case_087", "p03160_case_088", "p03160_case_089", "p03160_case_090", "p03160_case_091", "p03160_case_092", "p03160_case_093", "p03160_case_094", "p03160_case_095", "p03160_case_096", "p03160_case_097", "p03160_case_098", "p03160_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\nhs = list(map(int, input().split()))\na, b = 0, abs(hs[1] - hs[0])\nfor i in range(2, n):\n d1 = a + abs(hs[i] - hs[i - 2])\n d2 = b + abs(hs[i] - hs[i - 1])\n a, b = b, d1 if d1 <= d2 else d2\nprint(b)\n", "fast_code_sha256": "548f9d9ba3f56f0798f5a00d5c8c0672634a22c8ab42db59f51b3513ac28d3e4", "fast_id": "p03160_548f9d9ba3f56f0798f5a00d5c8c0672634a22c8ab42db59f51b3513ac28d3e4", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\nhs = list(map(int, input().split()))\na, b = 0, abs(hs[1] - hs[0])\nfor i in range(2, n):\n d1 = a + abs(hs[i] - hs[i - 2])\n d2 = b + abs(hs[i] - hs[i - 1])\n a, b = b, d1 if d1 <= d2 else d2\nprint(b)\n", "measured_fast_code_sha256": "548f9d9ba3f56f0798f5a00d5c8c0672634a22c8ab42db59f51b3513ac28d3e4", "measured_slow_code": "#!/usr/bin/env python\nimport string\nimport sys\nfrom itertools import chain, dropwhile, takewhile\n\n\ndef read(\n f, *shape, it=chain.from_iterable(sys.stdin), whitespaces=set(string.whitespace)\n):\n def read_word():\n w = lambda c: c in whitespaces\n nw = lambda c: c not in whitespaces\n return f(\"\".join(takewhile(nw, dropwhile(w, it))))\n\n if not shape:\n return read_word()\n elif len(shape) == 1:\n return [read_word() for _ in range(shape[0])]\n elif len(shape) == 2:\n return [[read_word() for _ in range(shape[1])] for _ in range(shape[0])]\n\n\ndef arr(*shape, fill_value=0):\n if len(shape) == 1:\n return [fill_value] * shape[fill_value]\n elif len(shape) == 2:\n return [[fill_value] * shape[1] for _ in range(shape[0])]\n\n\ndef dbg(**kwargs):\n print(\n \", \".join(\"{} = {}\".format(k, repr(v)) for k, v in kwargs.items()),\n file=sys.stderr,\n )\n\n\ndef main():\n n = read(int)\n hs = read(int, n)\n dp = arr(n)\n dp[1] = abs(hs[1] - hs[0])\n for i in range(2, n):\n dp[i] = min(\n dp[i - 1] + abs(hs[i] - hs[i - 1]), dp[i - 2] + abs(hs[i] - hs[i - 2])\n )\n print(dp[-1])\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "7f209d5d7b0d2bc72ab55ef9c34db57933ddfc0a346f408e2afc1f88416cf97f", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.9201072501744596, "pair_id": "python_v2_7ac7fc3252a69f63a107f272", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03160", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03160_548f9d9ba3f56f0798f5a00d5c8c0672634a22c8ab42db59f51b3513ac28d3e4.jsonl.gz", "inputs": "reproduction/python/inputs/p03160.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03160_7f209d5d7b0d2bc72ab55ef9c34db57933ddfc0a346f408e2afc1f88416cf97f.jsonl.gz"}, "slow_code": "import string\nimport sys\nfrom itertools import chain, dropwhile, takewhile\n\n\ndef read(\n f, *shape, it=chain.from_iterable(sys.stdin), whitespaces=set(string.whitespace)\n):\n def read_word():\n w = lambda c: c in whitespaces\n nw = lambda c: c not in whitespaces\n return f(\"\".join(takewhile(nw, dropwhile(w, it))))\n\n if not shape:\n return read_word()\n elif len(shape) == 1:\n return [read_word() for _ in range(shape[0])]\n elif len(shape) == 2:\n return [[read_word() for _ in range(shape[1])] for _ in range(shape[0])]\n\n\ndef arr(*shape, fill_value=0):\n if len(shape) == 1:\n return [fill_value] * shape[fill_value]\n elif len(shape) == 2:\n return [[fill_value] * shape[1] for _ in range(shape[0])]\n\n\ndef dbg(**kwargs):\n print(\n \", \".join(\"{} = {}\".format(k, repr(v)) for k, v in kwargs.items()),\n file=sys.stderr,\n )\n\n\ndef main():\n n = read(int)\n hs = read(int, n)\n dp = arr(n)\n dp[1] = abs(hs[1] - hs[0])\n for i in range(2, n):\n dp[i] = min(\n dp[i - 1] + abs(hs[i] - hs[i - 1]), dp[i - 2] + abs(hs[i] - hs[i - 2])\n )\n print(dp[-1])\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "54f397f881a6ae2f88872fe4373ebc15e4056c4fdf6ac63236a75aa3443cd3c5", "slow_id": "p03160_7f209d5d7b0d2bc72ab55ef9c34db57933ddfc0a346f408e2afc1f88416cf97f", "speedup": 4.731628446525761, "stratum": "4-8", "within_pair_jaccard": 0.19117647058823528, "workload": {"case_count": 100, "description": "A frog starts at stone 1 and jumps ahead by 1 or 2 stones. A jump from i to j costs |h_i-h_j|. Find the minimum total cost to reach stone N. Observed inputs: N=2..100000 (median 1000); h_i=1..10000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 600007, "median": 4888.5, "min": 6}, "input_format": ["N\nh_1 ... h_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100001, "median": 1001.0, "min": 3}}} -{"case_ids": ["p03125_case_000", "p03125_case_001", "p03125_case_002", "p03125_case_003", "p03125_case_004", "p03125_case_005", "p03125_case_006", "p03125_case_007", "p03125_case_008", "p03125_case_009", "p03125_case_010", "p03125_case_011", "p03125_case_012", "p03125_case_013", "p03125_case_014", "p03125_case_015", "p03125_case_016", "p03125_case_017", "p03125_case_018", "p03125_case_019", "p03125_case_020", "p03125_case_021", "p03125_case_022", "p03125_case_023", "p03125_case_024", "p03125_case_025", "p03125_case_026", "p03125_case_027", "p03125_case_028", "p03125_case_029", "p03125_case_030", "p03125_case_031", "p03125_case_032", "p03125_case_033", "p03125_case_034", "p03125_case_035", "p03125_case_036", "p03125_case_037", "p03125_case_038", "p03125_case_039", "p03125_case_040", "p03125_case_041", "p03125_case_042", "p03125_case_043", "p03125_case_044", "p03125_case_045", "p03125_case_046", "p03125_case_047", "p03125_case_048", "p03125_case_049", "p03125_case_050", "p03125_case_051", "p03125_case_052", "p03125_case_053", "p03125_case_054", "p03125_case_055", "p03125_case_056", "p03125_case_057", "p03125_case_058", "p03125_case_059", "p03125_case_060", "p03125_case_061", "p03125_case_062", "p03125_case_063", "p03125_case_064", "p03125_case_065", "p03125_case_066", "p03125_case_067", "p03125_case_068", "p03125_case_069", "p03125_case_070", "p03125_case_071", "p03125_case_072", "p03125_case_073", "p03125_case_074", "p03125_case_075", "p03125_case_076", "p03125_case_077", "p03125_case_078", "p03125_case_079", "p03125_case_080", "p03125_case_081", "p03125_case_082", "p03125_case_083", "p03125_case_084", "p03125_case_085", "p03125_case_086", "p03125_case_087", "p03125_case_088", "p03125_case_089", "p03125_case_090", "p03125_case_091", "p03125_case_092", "p03125_case_093", "p03125_case_094", "p03125_case_095", "p03125_case_096", "p03125_case_097", "p03125_case_098", "p03125_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "a, b = list(map(int, input().split()))\nprint(((a + b) if b % a == 0 else (b - a)))\n", "fast_code_sha256": "40e8262a5e96f9a351504d31b189aa9a06718c27ee1fa38f7b36c51bcccc4bb1", "fast_id": "p03125_40e8262a5e96f9a351504d31b189aa9a06718c27ee1fa38f7b36c51bcccc4bb1", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "a, b = list(map(int, input().split()))\nprint(((a + b) if b % a == 0 else (b - a)))\n", "measured_fast_code_sha256": "40e8262a5e96f9a351504d31b189aa9a06718c27ee1fa38f7b36c51bcccc4bb1", "measured_slow_code": "#!/usr/bin/env python3\nimport sys\nimport math\nfrom bisect import bisect_right as br\nfrom bisect import bisect_left as bl\n\nsys.setrecursionlimit(2147483647)\nfrom heapq import heappush, heappop, heappushpop\nfrom collections import defaultdict\nfrom itertools import accumulate\nfrom collections import Counter\nfrom collections import deque\nfrom operator import itemgetter\nfrom itertools import permutations\n\nmod = 10**9 + 7\ninf = float(\"inf\")\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\na, b = LI()\nif b % a == 0:\n print((a + b))\nelse:\n print((b - a))\n", "measured_slow_code_sha256": "4b613364292341c90cb223444cc17d712d2692c86eaf7401941c05ab19a835ea", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.5300634671654607, "pair_id": "python_v2_ef483594318e4320dddb523b", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03125", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03125_40e8262a5e96f9a351504d31b189aa9a06718c27ee1fa38f7b36c51bcccc4bb1.jsonl.gz", "inputs": "reproduction/python/inputs/p03125.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03125_4b613364292341c90cb223444cc17d712d2692c86eaf7401941c05ab19a835ea.jsonl.gz"}, "slow_code": "import sys\nimport math\nfrom bisect import bisect_right as br\nfrom bisect import bisect_left as bl\n\nsys.setrecursionlimit(2147483647)\nfrom heapq import heappush, heappop, heappushpop\nfrom collections import defaultdict\nfrom itertools import accumulate\nfrom collections import Counter\nfrom collections import deque\nfrom operator import itemgetter\nfrom itertools import permutations\n\nmod = 10**9 + 7\ninf = float(\"inf\")\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\na, b = LI()\nif b % a == 0:\n print((a + b))\nelse:\n print((b - a))\n", "slow_code_sha256": "8b3f73d78db4b17be952c8e49db130961979c1aa4d15ae41972fb4783a0ae1cc", "slow_id": "p03125_4b613364292341c90cb223444cc17d712d2692c86eaf7401941c05ab19a835ea", "speedup": 3.527202310741732, "stratum": "2-4", "within_pair_jaccard": 0.20833333333333334, "workload": {"case_count": 100, "description": "Given positive integers A<=B, output A+B if A divides B, otherwise output B-A. Observed inputs: A=1..20 (median 5); B=1..20 (median 13).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 6, "median": 5.0, "min": 4}, "input_format": ["A B"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p02789_case_000", "p02789_case_001", "p02789_case_002", "p02789_case_003", "p02789_case_004", "p02789_case_005", "p02789_case_006", "p02789_case_007", "p02789_case_008", "p02789_case_009", "p02789_case_010", "p02789_case_011", "p02789_case_012", "p02789_case_013", "p02789_case_014", "p02789_case_015", "p02789_case_016", "p02789_case_017", "p02789_case_018", "p02789_case_019", "p02789_case_020", "p02789_case_021", "p02789_case_022", "p02789_case_023", "p02789_case_024", "p02789_case_025", "p02789_case_026", "p02789_case_027", "p02789_case_028", "p02789_case_029", "p02789_case_030", "p02789_case_031", "p02789_case_032", "p02789_case_033", "p02789_case_034", "p02789_case_035", "p02789_case_036", "p02789_case_037", "p02789_case_038", "p02789_case_039", "p02789_case_040", "p02789_case_041", "p02789_case_042", "p02789_case_043", "p02789_case_044", "p02789_case_045", "p02789_case_046", "p02789_case_047", "p02789_case_048", "p02789_case_049", "p02789_case_050", "p02789_case_051", "p02789_case_052", "p02789_case_053", "p02789_case_054", "p02789_case_055", "p02789_case_056", "p02789_case_057", "p02789_case_058", "p02789_case_059", "p02789_case_060", "p02789_case_061", "p02789_case_062", "p02789_case_063", "p02789_case_064", "p02789_case_065", "p02789_case_066", "p02789_case_067", "p02789_case_068", "p02789_case_069", "p02789_case_070", "p02789_case_071", "p02789_case_072", "p02789_case_073", "p02789_case_074", "p02789_case_075", "p02789_case_076", "p02789_case_077", "p02789_case_078", "p02789_case_079", "p02789_case_080", "p02789_case_081", "p02789_case_082", "p02789_case_083", "p02789_case_084", "p02789_case_085", "p02789_case_086", "p02789_case_087", "p02789_case_088", "p02789_case_089", "p02789_case_090", "p02789_case_091", "p02789_case_092", "p02789_case_093", "p02789_case_094", "p02789_case_095", "p02789_case_096", "p02789_case_097", "p02789_case_098", "p02789_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "print((\"YNeos\"[eval(input().replace(\" \", \">\")) :: 2]))\n", "fast_code_sha256": "a999559ee3dccd6dfd62a176c9b46c9efd1583a53bde251fce80f8d052e671ee", "fast_id": "p02789_a999559ee3dccd6dfd62a176c9b46c9efd1583a53bde251fce80f8d052e671ee", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "print((\"YNeos\"[eval(input().replace(\" \", \">\")) :: 2]))\n", "measured_fast_code_sha256": "a999559ee3dccd6dfd62a176c9b46c9efd1583a53bde251fce80f8d052e671ee", "measured_slow_code": "# coding: utf-8\n# submission # - User: herp_sy\n# https://atcoder.jp/contests/\n#\n# lang: Python3 (3.4.3)\nimport math\nimport statistics\nimport numpy as np\nimport queue\n\n# fact(int)\ndef fact(n):\n if n == 1:\n return 1\n else:\n return n * fact(n - 1)\n\n\n# gcd(int,int)\ndef gcd(a, b):\n if a == 0:\n return b\n elif b == 0:\n return a\n else:\n return gcd(b, a % b)\n\n\n# lcm(int,int)\ndef lcm(a, b):\n return a * b / gcd(a, b)\n\n\n# qsort(array[])\ndef qsort(seq):\n if len(seq) < 2:\n return seq\n else:\n beg, end = 0, len(seq) - 1\n mid = (beg + end) // 2\n smaller = [c for c in seq if seq[mid] > c]\n equal = [c for c in seq if seq[mid] == c]\n larger = [c for c in seq if seq[mid] < c]\n return qsort(smaller) + equal + qsort(larger)\n\n\n# = map(int, input().split())\n# = int(input())\n# = raw_input().split()\n# = list(int(i) for i in input().split())\nn, m = list(map(int, input().split()))\nif n == m:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "measured_slow_code_sha256": "78de3f88cb23bb16fb5f9ba282f1719bd461fd7ea9f6aadce1636b6f3a8090f3", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2629.991096506051, "pair_id": "python_v2_b66eb8c62732f5c84feba591", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02789", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02789_a999559ee3dccd6dfd62a176c9b46c9efd1583a53bde251fce80f8d052e671ee.jsonl.gz", "inputs": "reproduction/python/inputs/p02789.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02789_78de3f88cb23bb16fb5f9ba282f1719bd461fd7ea9f6aadce1636b6f3a8090f3.jsonl.gz"}, "slow_code": "import math\nimport statistics\nimport numpy as np\nimport queue\n\n\ndef fact(n):\n if n == 1:\n return 1\n else:\n return n * fact(n - 1)\n\n\ndef gcd(a, b):\n if a == 0:\n return b\n elif b == 0:\n return a\n else:\n return gcd(b, a % b)\n\n\ndef lcm(a, b):\n return a * b / gcd(a, b)\n\n\ndef qsort(seq):\n if len(seq) < 2:\n return seq\n else:\n beg, end = 0, len(seq) - 1\n mid = (beg + end) // 2\n smaller = [c for c in seq if seq[mid] > c]\n equal = [c for c in seq if seq[mid] == c]\n larger = [c for c in seq if seq[mid] < c]\n return qsort(smaller) + equal + qsort(larger)\n\n\nn, m = list(map(int, input().split()))\nif n == m:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "slow_code_sha256": "2686b43bdf8ed3cbe77780e6157f246a6c7c3d5757c1ec23cbec723e3255f4bc", "slow_id": "p02789_78de3f88cb23bb16fb5f9ba282f1719bd461fd7ea9f6aadce1636b6f3a8090f3", "speedup": 2622.4598107618012, "stratum": "8+", "within_pair_jaccard": 0.06666666666666667, "workload": {"case_count": 100, "description": "A submission has passed M of its N required test cases. Determine whether it receives acceptance, which requires passing every case. Observed inputs: N=1..100 (median 44); M=0..100 (median 14.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 8, "median": 6.0, "min": 4}, "input_format": ["N M"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p02994_case_000", "p02994_case_001", "p02994_case_002", "p02994_case_003", "p02994_case_004", "p02994_case_005", "p02994_case_006", "p02994_case_007", "p02994_case_008", "p02994_case_009", "p02994_case_010", "p02994_case_011", "p02994_case_012", "p02994_case_013", "p02994_case_014", "p02994_case_015", "p02994_case_016", "p02994_case_017", "p02994_case_018", "p02994_case_019", "p02994_case_020", "p02994_case_021", "p02994_case_022", "p02994_case_023", "p02994_case_024", "p02994_case_025", "p02994_case_026", "p02994_case_027", "p02994_case_028", "p02994_case_029", "p02994_case_030", "p02994_case_031", "p02994_case_032", "p02994_case_033", "p02994_case_034", "p02994_case_035", "p02994_case_036", "p02994_case_037", "p02994_case_038", "p02994_case_039", "p02994_case_040", "p02994_case_041", "p02994_case_042", "p02994_case_043", "p02994_case_044", "p02994_case_045", "p02994_case_046", "p02994_case_047", "p02994_case_048", "p02994_case_049", "p02994_case_050", "p02994_case_051", "p02994_case_052", "p02994_case_053", "p02994_case_054", "p02994_case_055", "p02994_case_056", "p02994_case_057", "p02994_case_058", "p02994_case_059", "p02994_case_060", "p02994_case_061", "p02994_case_062", "p02994_case_063", "p02994_case_064", "p02994_case_065", "p02994_case_066", "p02994_case_067", "p02994_case_068", "p02994_case_069", "p02994_case_070", "p02994_case_071", "p02994_case_072", "p02994_case_073", "p02994_case_074", "p02994_case_075", "p02994_case_076", "p02994_case_077", "p02994_case_078", "p02994_case_079", "p02994_case_080", "p02994_case_081", "p02994_case_082", "p02994_case_083", "p02994_case_084", "p02994_case_085", "p02994_case_086", "p02994_case_087", "p02994_case_088", "p02994_case_089", "p02994_case_090", "p02994_case_091", "p02994_case_092", "p02994_case_093", "p02994_case_094", "p02994_case_095", "p02994_case_096", "p02994_case_097", "p02994_case_098", "p02994_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N, L = list(map(int, input().split()))\ntaste = list(range(L, L + N))\nprint((sum(taste) - min(taste, key=abs)))\n", "fast_code_sha256": "9891ff1953f3bdc39ea90dfed6bf3adb78ac1721a06a6c6851a4534c6df901d5", "fast_id": "p02994_9891ff1953f3bdc39ea90dfed6bf3adb78ac1721a06a6c6851a4534c6df901d5", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N, L = list(map(int, input().split()))\ntaste = list(range(L, L + N))\nprint((sum(taste) - min(taste, key=abs)))\n", "measured_fast_code_sha256": "9891ff1953f3bdc39ea90dfed6bf3adb78ac1721a06a6c6851a4534c6df901d5", "measured_slow_code": "import copy\n\nN, L = list(map(int, input().split()))\napple_taste = [L + i for i in range(N)]\npie_taste = sum(apple_taste)\nmin_diff = 100000\nfor i in range(N):\n ap = copy.deepcopy(apple_taste)\n ap[i] = 0\n pie_taste2 = sum(ap)\n diff = abs(pie_taste - pie_taste2)\n if diff < min_diff:\n min_diff = diff\n min_index = i\napple_taste[min_index] = 0\nprint((sum(apple_taste)))\n", "measured_slow_code_sha256": "d149410d46bed6b8690e0200021300cc5187b2715c0717e93e6c392866beb39e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 145.96834002566916, "pair_id": "python_v2_a180eed5769acbeb351aa2d7", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02994", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02994_9891ff1953f3bdc39ea90dfed6bf3adb78ac1721a06a6c6851a4534c6df901d5.jsonl.gz", "inputs": "reproduction/python/inputs/p02994.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02994_d149410d46bed6b8690e0200021300cc5187b2715c0717e93e6c392866beb39e.jsonl.gz"}, "slow_code": "import copy\n\nN, L = list(map(int, input().split()))\napple_taste = [L + i for i in range(N)]\npie_taste = sum(apple_taste)\nmin_diff = 100000\nfor i in range(N):\n ap = copy.deepcopy(apple_taste)\n ap[i] = 0\n pie_taste2 = sum(ap)\n diff = abs(pie_taste - pie_taste2)\n if diff < min_diff:\n min_diff = diff\n min_index = i\napple_taste[min_index] = 0\nprint((sum(apple_taste)))\n", "slow_code_sha256": "d149410d46bed6b8690e0200021300cc5187b2715c0717e93e6c392866beb39e", "slow_id": "p02994_d149410d46bed6b8690e0200021300cc5187b2715c0717e93e6c392866beb39e", "speedup": 109.5268918285208, "stratum": "8+", "within_pair_jaccard": 0.36666666666666664, "workload": {"case_count": 100, "description": "N apples have flavors L,L+1,...,L+N-1, possibly negative. Remove one apple to minimize the absolute difference between the remaining flavor sum and the original total; output the remaining sum. Observed inputs: N=2..200 (median 100); L=-100..100 (median -14).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 9, "median": 7.0, "min": 4}, "input_format": ["N L"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p03448_case_000", "p03448_case_001", "p03448_case_002", "p03448_case_003", "p03448_case_004", "p03448_case_005", "p03448_case_006", "p03448_case_007", "p03448_case_008", "p03448_case_009", "p03448_case_010", "p03448_case_011", "p03448_case_012", "p03448_case_013", "p03448_case_014", "p03448_case_015", "p03448_case_016", "p03448_case_017", "p03448_case_018", "p03448_case_019", "p03448_case_020", "p03448_case_021", "p03448_case_022", "p03448_case_023", "p03448_case_024", "p03448_case_025", "p03448_case_026", "p03448_case_027", "p03448_case_028", "p03448_case_029", "p03448_case_030", "p03448_case_031", "p03448_case_032", "p03448_case_033", "p03448_case_034", "p03448_case_035", "p03448_case_036", "p03448_case_037", "p03448_case_038", "p03448_case_039", "p03448_case_040", "p03448_case_041", "p03448_case_042", "p03448_case_043", "p03448_case_044", "p03448_case_045", "p03448_case_046", "p03448_case_047", "p03448_case_048", "p03448_case_049", "p03448_case_050", "p03448_case_051", "p03448_case_052", "p03448_case_053", "p03448_case_054", "p03448_case_055", "p03448_case_056", "p03448_case_057", "p03448_case_058", "p03448_case_059", "p03448_case_060", "p03448_case_061", "p03448_case_062", "p03448_case_063", "p03448_case_064", "p03448_case_065", "p03448_case_066", "p03448_case_067", "p03448_case_068", "p03448_case_069", "p03448_case_070", "p03448_case_071", "p03448_case_072", "p03448_case_073", "p03448_case_074", "p03448_case_075", "p03448_case_076", "p03448_case_077", "p03448_case_078", "p03448_case_079", "p03448_case_080", "p03448_case_081", "p03448_case_082", "p03448_case_083", "p03448_case_084", "p03448_case_085", "p03448_case_086", "p03448_case_087", "p03448_case_088", "p03448_case_089", "p03448_case_090", "p03448_case_091", "p03448_case_092", "p03448_case_093", "p03448_case_094", "p03448_case_095", "p03448_case_096", "p03448_case_097", "p03448_case_098", "p03448_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "a, b, c, x = list(map(int, [input().rstrip() for _ in range(4)]))\ncount = 0\nfor i in range(min(a, int(x / 500)) + 1):\n for j in range(min(b, int((x - i * 500) / 100)) + 1):\n if (x - i * 500 - j * 100) // 50 <= c and (x - i * 500 - j * 100) % 50 == 0:\n count += 1\nprint(count)\n", "fast_code_sha256": "0562a3847cd197b90f3b1ef06df23421c925cba880cbb7ba72c2820e325fa194", "fast_id": "p03448_94c0c361190f240e9da3abc176db7d77dd2b61e056a3824beca5fd89b1c1727f", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "##### ABC087B - Coins\na, b, c, x = list(map(int, [input().rstrip() for _ in range(4)]))\ncount = 0\nfor i in range(min(a, int(x / 500)) + 1):\n for j in range(min(b, int((x - i * 500) / 100)) + 1):\n if (x - i * 500 - j * 100) // 50 <= c and (x - i * 500 - j * 100) % 50 == 0:\n count += 1\nprint(count)\n", "measured_fast_code_sha256": "94c0c361190f240e9da3abc176db7d77dd2b61e056a3824beca5fd89b1c1727f", "measured_slow_code": "A = int(eval(input()))\nB = int(eval(input()))\nC = int(eval(input()))\nX = int(eval(input()))\ncount = 0\nfor a in [a * 500 for a in range(A + 1)]:\n for b in [b * 100 for b in range(B + 1)]:\n for k in range(C + 1):\n if a + b + 50 * k == X:\n count += 1\nprint(count)\n", "measured_slow_code_sha256": "bf5b06ff36383d97cd14233a35663e1c4f87a24020501ac318d049451ae94d18", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.8437230460917058, "pair_id": "python_v2_cb81c37349b6c8ebb77f5e00", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03448", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03448_94c0c361190f240e9da3abc176db7d77dd2b61e056a3824beca5fd89b1c1727f.jsonl.gz", "inputs": "reproduction/python/inputs/p03448.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03448_bf5b06ff36383d97cd14233a35663e1c4f87a24020501ac318d049451ae94d18.jsonl.gz"}, "slow_code": "A = int(eval(input()))\nB = int(eval(input()))\nC = int(eval(input()))\nX = int(eval(input()))\ncount = 0\nfor a in [a * 500 for a in range(A + 1)]:\n for b in [b * 100 for b in range(B + 1)]:\n for k in range(C + 1):\n if a + b + 50 * k == X:\n count += 1\nprint(count)\n", "slow_code_sha256": "bf5b06ff36383d97cd14233a35663e1c4f87a24020501ac318d049451ae94d18", "slow_id": "p03448_bf5b06ff36383d97cd14233a35663e1c4f87a24020501ac318d049451ae94d18", "speedup": 3.2962182771235122, "stratum": "2-4", "within_pair_jaccard": 0.45161290322580644, "workload": {"case_count": 100, "description": "Choose coins totaling X using at most A coins of value 500, B of value 100 and C of value 50. Count distinct denomination-count choices, not permutations of identical coins. X is a multiple of 50. Observed inputs: A=0..50 (median 7); B=0..50 (median 9.5); C=0..50 (median 5.5); X=50..20000 (median 2175).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 15, "median": 12.0, "min": 9}, "input_format": ["A\nB\nC\nX"], "input_format_status": "source_input_section", "input_lines": {"max": 4, "median": 4.0, "min": 4}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 4, "median": 4.0, "min": 4}}} -{"case_ids": ["p02990_case_000", "p02990_case_001", "p02990_case_002", "p02990_case_003", "p02990_case_004", "p02990_case_005", "p02990_case_006", "p02990_case_007", "p02990_case_008", "p02990_case_009", "p02990_case_010", "p02990_case_011", "p02990_case_012", "p02990_case_013", "p02990_case_014", "p02990_case_015", "p02990_case_016", "p02990_case_017", "p02990_case_018", "p02990_case_019", "p02990_case_020", "p02990_case_021", "p02990_case_022", "p02990_case_023", "p02990_case_024", "p02990_case_025", "p02990_case_026", "p02990_case_027", "p02990_case_028", "p02990_case_029", "p02990_case_030", "p02990_case_031", "p02990_case_032", "p02990_case_033", "p02990_case_034", "p02990_case_035", "p02990_case_036", "p02990_case_037", "p02990_case_038", "p02990_case_039", "p02990_case_040", "p02990_case_041", "p02990_case_042", "p02990_case_043", "p02990_case_044", "p02990_case_045", "p02990_case_046", "p02990_case_047", "p02990_case_048", "p02990_case_049", "p02990_case_050", "p02990_case_051", "p02990_case_052", "p02990_case_053", "p02990_case_054", "p02990_case_055", "p02990_case_056", "p02990_case_057", "p02990_case_058", "p02990_case_059", "p02990_case_060", "p02990_case_061", "p02990_case_062", "p02990_case_063", "p02990_case_064", "p02990_case_065", "p02990_case_066", "p02990_case_067", "p02990_case_068", "p02990_case_069", "p02990_case_070", "p02990_case_071", "p02990_case_072", "p02990_case_073", "p02990_case_074", "p02990_case_075", "p02990_case_076", "p02990_case_077", "p02990_case_078", "p02990_case_079", "p02990_case_080", "p02990_case_081", "p02990_case_082", "p02990_case_083", "p02990_case_084", "p02990_case_085", "p02990_case_086", "p02990_case_087", "p02990_case_088", "p02990_case_089", "p02990_case_090", "p02990_case_091", "p02990_case_092", "p02990_case_093", "p02990_case_094", "p02990_case_095", "p02990_case_096", "p02990_case_097", "p02990_case_098", "p02990_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\n\nfrom functools import reduce\nimport operator as op\n\n\ndef nCr(n, r):\n r = min(r, n - r)\n upper = reduce(op.mul, list(range(n, n - r, -1)), 1)\n lower = reduce(op.mul, list(range(r, 0, -1)), 1)\n return upper // lower\n\n\nmod = 10**9 + 7\n\n\ndef main():\n n, k = [int(x) for x in sys.stdin.readline().split()]\n for i in range(1, k + 1):\n if i <= n - k + 1:\n print((nCr(n - k + 1, i) * nCr(k - 1, i - 1) % mod))\n else:\n print((0))\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "de86ab65f340e5a5f6c1c8800744e7c1a30cd02537cfe887eb37bd894b3812ac", "fast_id": "p02990_e8297394ce68e611eedebe54313d0ad0caec7a4680b8dfb2bb8b573a3ce1d125", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "# 2019-11-15 00:35:39(JST)\nimport sys\n\n# import collections\n# import math\n# from string import ascii_lowercase, ascii_uppercase, digits\n# from bisect import bisect_left as bi_l, bisect_right as bi_r\n# import itertools\nfrom functools import reduce\nimport operator as op\n\n# from scipy.misc import comb # float\n# import numpy as np\ndef nCr(n, r):\n r = min(r, n - r)\n upper = reduce(op.mul, list(range(n, n - r, -1)), 1)\n lower = reduce(op.mul, list(range(r, 0, -1)), 1)\n return upper // lower\n\n\nmod = 10**9 + 7\n\n\ndef main():\n n, k = [int(x) for x in sys.stdin.readline().split()]\n for i in range(1, k + 1):\n if i <= n - k + 1:\n print((nCr(n - k + 1, i) * nCr(k - 1, i - 1) % mod))\n else:\n print((0)) # i > n - k + 1 となる並べ方は存在しない\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "e8297394ce68e611eedebe54313d0ad0caec7a4680b8dfb2bb8b573a3ce1d125", "measured_slow_code": "MOD = 10**9 + 7\nlim = 200000\ninv_t = [-1 for i in range(lim + 1)]\nfactrial = [-1 for i in range(lim + 1)]\nfactrial_inv = [-1 for i in range(lim + 1)]\n\n\ndef mod_inv(x, mod=MOD):\n y, u, v, _x = mod, 1, 0, x\n while y:\n t = _x // y\n _x -= t * y\n _x, y = y, _x\n u -= t * v\n u, v = v, u\n u %= mod\n if u < 0:\n u += mod\n return u\n\n\ndef mod_pow(a, n, mod=MOD):\n res = 1\n while n:\n if n & 1:\n res = res * a % mod\n a = a * a % mod\n n >>= 1\n return res\n\n\ndef COMinit(max=lim, mod=MOD):\n factrial[0] = factrial_inv[0] = 1\n factrial[1] = factrial_inv[1] = 1\n inv_t[0] = inv_t[1] = 1\n for i in range(2, max):\n factrial[i] = factrial[i - 1] * i % mod\n inv_t[i] = mod - inv_t[mod % i] * (mod // i) % mod\n factrial_inv[i] = factrial_inv[i - 1] * inv_t[i] % mod\n\n\ndef comb(a, b, mod=MOD):\n if a < b:\n return 0\n if factrial[0] == -1:\n COMinit()\n return (factrial[a] * factrial_inv[b] * factrial_inv[a - b]) % mod\n\n\nn, k = [int(_) for _ in input().split()]\nfor i in range(k):\n print((comb(n - k + 1, i + 1) * comb(k - 1, i) % MOD))\n", "measured_slow_code_sha256": "a43a2e409975514f076f5ea8a611abb00d6945f4ac7a0710f4b342242cb6e235", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 277.60075627105846, "pair_id": "python_v2_2840422f7ece47226213f61d", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02990", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02990_e8297394ce68e611eedebe54313d0ad0caec7a4680b8dfb2bb8b573a3ce1d125.jsonl.gz", "inputs": "reproduction/python/inputs/p02990.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02990_a43a2e409975514f076f5ea8a611abb00d6945f4ac7a0710f4b342242cb6e235.jsonl.gz"}, "slow_code": "MOD = 10**9 + 7\nlim = 200000\ninv_t = [-1 for i in range(lim + 1)]\nfactrial = [-1 for i in range(lim + 1)]\nfactrial_inv = [-1 for i in range(lim + 1)]\n\n\ndef mod_inv(x, mod=MOD):\n y, u, v, _x = mod, 1, 0, x\n while y:\n t = _x // y\n _x -= t * y\n _x, y = y, _x\n u -= t * v\n u, v = v, u\n u %= mod\n if u < 0:\n u += mod\n return u\n\n\ndef mod_pow(a, n, mod=MOD):\n res = 1\n while n:\n if n & 1:\n res = res * a % mod\n a = a * a % mod\n n >>= 1\n return res\n\n\ndef COMinit(max=lim, mod=MOD):\n factrial[0] = factrial_inv[0] = 1\n factrial[1] = factrial_inv[1] = 1\n inv_t[0] = inv_t[1] = 1\n for i in range(2, max):\n factrial[i] = factrial[i - 1] * i % mod\n inv_t[i] = mod - inv_t[mod % i] * (mod // i) % mod\n factrial_inv[i] = factrial_inv[i - 1] * inv_t[i] % mod\n\n\ndef comb(a, b, mod=MOD):\n if a < b:\n return 0\n if factrial[0] == -1:\n COMinit()\n return (factrial[a] * factrial_inv[b] * factrial_inv[a - b]) % mod\n\n\nn, k = [int(_) for _ in input().split()]\nfor i in range(k):\n print((comb(n - k + 1, i + 1) * comb(k - 1, i) % MOD))\n", "slow_code_sha256": "a43a2e409975514f076f5ea8a611abb00d6945f4ac7a0710f4b342242cb6e235", "slow_id": "p02990_a43a2e409975514f076f5ea8a611abb00d6945f4ac7a0710f4b342242cb6e235", "speedup": 174.75096655164418, "stratum": "8+", "within_pair_jaccard": 0.30158730158730157, "workload": {"case_count": 100, "description": "Arrange K identical blue and N-K identical red balls in a row. For each i=1..K, count arrangements requiring exactly i moves to collect the blue balls, where a move collects any consecutive blue block. Output counts modulo 1000000007. Observed inputs: N=1..2000 (median 1234); K=1..2000 (median 807.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 10, "median": 9.0, "min": 4}, "input_format": ["N K"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p02793_case_000", "p02793_case_001", "p02793_case_002", "p02793_case_003", "p02793_case_004", "p02793_case_005", "p02793_case_006", "p02793_case_007", "p02793_case_008", "p02793_case_009", "p02793_case_010", "p02793_case_011", "p02793_case_012", "p02793_case_013", "p02793_case_014", "p02793_case_015", "p02793_case_016", "p02793_case_017", "p02793_case_018", "p02793_case_019", "p02793_case_020", "p02793_case_021", "p02793_case_022", "p02793_case_023", "p02793_case_024", "p02793_case_025", "p02793_case_026", "p02793_case_027", "p02793_case_028", "p02793_case_029", "p02793_case_030", "p02793_case_031", "p02793_case_032", "p02793_case_033", "p02793_case_034", "p02793_case_035", "p02793_case_036", "p02793_case_037", "p02793_case_038", "p02793_case_039", "p02793_case_040", "p02793_case_041", "p02793_case_042", "p02793_case_043", "p02793_case_044", "p02793_case_045", "p02793_case_046", "p02793_case_047", "p02793_case_048", "p02793_case_049", "p02793_case_050", "p02793_case_051", "p02793_case_052", "p02793_case_053", "p02793_case_054", "p02793_case_055", "p02793_case_056", "p02793_case_057", "p02793_case_058", "p02793_case_059", "p02793_case_060", "p02793_case_061", "p02793_case_062", "p02793_case_063", "p02793_case_064", "p02793_case_065", "p02793_case_066", "p02793_case_067", "p02793_case_068", "p02793_case_069", "p02793_case_070", "p02793_case_071", "p02793_case_072", "p02793_case_073", "p02793_case_074", "p02793_case_075", "p02793_case_076", "p02793_case_077", "p02793_case_078", "p02793_case_079", "p02793_case_080", "p02793_case_081", "p02793_case_082", "p02793_case_083", "p02793_case_084", "p02793_case_085", "p02793_case_086", "p02793_case_087", "p02793_case_088", "p02793_case_089", "p02793_case_090", "p02793_case_091", "p02793_case_092", "p02793_case_093", "p02793_case_094", "p02793_case_095", "p02793_case_096", "p02793_case_097", "p02793_case_098", "p02793_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from math import gcd\nfrom functools import reduce\n\nMOD = 10**9 + 7\n\n\ndef calc_lcm(x, y):\n return x * y // gcd(x, y)\n\n\ndef calc_lcm_list(numbers):\n return reduce(calc_lcm, numbers, 1)\n\n\nN, *A = list(map(int, open(0).read().split()))\nlcm = calc_lcm_list(A)\nprint((sum(lcm // v for v in A) % MOD))\n", "fast_code_sha256": "3af56e6935ebf2403d8e7f22570874ba87558803c6a316375b5ec44f434713dc", "fast_id": "p02793_3af56e6935ebf2403d8e7f22570874ba87558803c6a316375b5ec44f434713dc", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from math import gcd\nfrom functools import reduce\n\nMOD = 10**9 + 7\n\n\ndef calc_lcm(x, y):\n return x * y // gcd(x, y)\n\n\ndef calc_lcm_list(numbers):\n return reduce(calc_lcm, numbers, 1)\n\n\nN, *A = list(map(int, open(0).read().split()))\nlcm = calc_lcm_list(A)\nprint((sum(lcm // v for v in A) % MOD))\n", "measured_fast_code_sha256": "3af56e6935ebf2403d8e7f22570874ba87558803c6a316375b5ec44f434713dc", "measured_slow_code": "# エラトステネスの篩, フェルマーの小定理\ndef make_prime_table(N):\n sieve = [0] * (N + 1)\n sieve[0] = -1\n sieve[1] = -1\n for i in range(2, N + 1):\n if sieve[i] != 0:\n continue\n sieve[i] = i\n for j in range(i * i, N + 1, i):\n if sieve[j] == 0:\n sieve[j] = i\n return sieve\n\n\nN = int(eval(input()))\nA = list(map(int, input().split()))\nm = 1000000007\nsieve = make_prime_table(1000000)\nlcm_factors = {}\nfor i in range(N):\n t = []\n a = A[i]\n while a != 1:\n if len(t) != 0 and t[-1][0] == sieve[a]:\n t[-1][1] += 1\n else:\n t.append([sieve[a], 1])\n a //= sieve[a]\n for k, v in t:\n if k not in lcm_factors or lcm_factors[k] < v:\n lcm_factors[k] = v\nlcm = 1\nfor k in lcm_factors:\n for i in range(lcm_factors[k]):\n lcm *= k\n lcm %= m\nresult = 0\nfor i in range(N):\n result += lcm * pow(A[i], m - 2, m)\n result %= m\nprint(result)\n", "measured_slow_code_sha256": "f88513118669d402af7378a034aabe8202ff8560f519ab66df19e762a530974c", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 290.13578909537557, "pair_id": "python_v2_0f03d4f6545928f1f14c41dd", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02793", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02793_3af56e6935ebf2403d8e7f22570874ba87558803c6a316375b5ec44f434713dc.jsonl.gz", "inputs": "reproduction/python/inputs/p02793.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02793_f88513118669d402af7378a034aabe8202ff8560f519ab66df19e762a530974c.jsonl.gz"}, "slow_code": "def make_prime_table(N):\n sieve = [0] * (N + 1)\n sieve[0] = -1\n sieve[1] = -1\n for i in range(2, N + 1):\n if sieve[i] != 0:\n continue\n sieve[i] = i\n for j in range(i * i, N + 1, i):\n if sieve[j] == 0:\n sieve[j] = i\n return sieve\n\n\nN = int(eval(input()))\nA = list(map(int, input().split()))\nm = 1000000007\nsieve = make_prime_table(1000000)\nlcm_factors = {}\nfor i in range(N):\n t = []\n a = A[i]\n while a != 1:\n if len(t) != 0 and t[-1][0] == sieve[a]:\n t[-1][1] += 1\n else:\n t.append([sieve[a], 1])\n a //= sieve[a]\n for k, v in t:\n if k not in lcm_factors or lcm_factors[k] < v:\n lcm_factors[k] = v\nlcm = 1\nfor k in lcm_factors:\n for i in range(lcm_factors[k]):\n lcm *= k\n lcm %= m\nresult = 0\nfor i in range(N):\n result += lcm * pow(A[i], m - 2, m)\n result %= m\nprint(result)\n", "slow_code_sha256": "ba27fc3e799b35a2da993d9e96b283294f1d1dcfd936e94e1a95db83c338ae65", "slow_id": "p02793_f88513118669d402af7378a034aabe8202ff8560f519ab66df19e762a530974c", "speedup": 228.7756715085786, "stratum": "8+", "within_pair_jaccard": 0.2033898305084746, "workload": {"case_count": 100, "description": "Choose positive integers B_i so that every A_i*B_i has the same value, minimizing sum B_i. Output that minimum modulo 1000000007. Observed inputs: N=1..10000 (median 1000); A_i=1..1000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 70006, "median": 6279.5, "min": 4}, "input_format": ["N\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 10001, "median": 1001.0, "min": 2}}} -{"case_ids": ["p03456_case_000", "p03456_case_001", "p03456_case_002", "p03456_case_003", "p03456_case_004", "p03456_case_005", "p03456_case_006", "p03456_case_007", "p03456_case_008", "p03456_case_009", "p03456_case_010", "p03456_case_011", "p03456_case_012", "p03456_case_013", "p03456_case_014", "p03456_case_015", "p03456_case_016", "p03456_case_017", "p03456_case_018", "p03456_case_019", "p03456_case_020", "p03456_case_021", "p03456_case_022", "p03456_case_023", "p03456_case_024", "p03456_case_025", "p03456_case_026", "p03456_case_027", "p03456_case_028", "p03456_case_029", "p03456_case_030", "p03456_case_031", "p03456_case_032", "p03456_case_033", "p03456_case_034", "p03456_case_035", "p03456_case_036", "p03456_case_037", "p03456_case_038", "p03456_case_039", "p03456_case_040", "p03456_case_041", "p03456_case_042", "p03456_case_043", "p03456_case_044", "p03456_case_045", "p03456_case_046", "p03456_case_047", "p03456_case_048", "p03456_case_049", "p03456_case_050", "p03456_case_051", "p03456_case_052", "p03456_case_053", "p03456_case_054", "p03456_case_055", "p03456_case_056", "p03456_case_057", "p03456_case_058", "p03456_case_059", "p03456_case_060", "p03456_case_061", "p03456_case_062", "p03456_case_063", "p03456_case_064", "p03456_case_065", "p03456_case_066", "p03456_case_067", "p03456_case_068", "p03456_case_069", "p03456_case_070", "p03456_case_071", "p03456_case_072", "p03456_case_073", "p03456_case_074", "p03456_case_075", "p03456_case_076", "p03456_case_077", "p03456_case_078", "p03456_case_079", "p03456_case_080", "p03456_case_081", "p03456_case_082", "p03456_case_083", "p03456_case_084", "p03456_case_085", "p03456_case_086", "p03456_case_087", "p03456_case_088", "p03456_case_089", "p03456_case_090", "p03456_case_091", "p03456_case_092", "p03456_case_093", "p03456_case_094", "p03456_case_095", "p03456_case_096", "p03456_case_097", "p03456_case_098", "p03456_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "a, b = input().split()\nprint((\"YNeos\"[int(a + b) != int(int(a + b) ** 0.5) ** 2 :: 2]))\n", "fast_code_sha256": "80e98e15676902352b836bed3711ff0bd47991ebfc63c0e7c3ecc6e2a47dd79d", "fast_id": "p03456_80e98e15676902352b836bed3711ff0bd47991ebfc63c0e7c3ecc6e2a47dd79d", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "a, b = input().split()\nprint((\"YNeos\"[int(a + b) != int(int(a + b) ** 0.5) ** 2 :: 2]))\n", "measured_fast_code_sha256": "80e98e15676902352b836bed3711ff0bd47991ebfc63c0e7c3ecc6e2a47dd79d", "measured_slow_code": "import numpy as np\n\na = int(input().replace(\" \", \"\"))\nb = np.sqrt(a)\nc = b - int(b)\nif c == 0.0:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "measured_slow_code_sha256": "7917ed4392d2155273da648b2693fb0163544534d06b0c3c68db07d4c4827be4", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2076.7666918601917, "pair_id": "python_v2_48be7d08c8801692230edbbf", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03456", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03456_80e98e15676902352b836bed3711ff0bd47991ebfc63c0e7c3ecc6e2a47dd79d.jsonl.gz", "inputs": "reproduction/python/inputs/p03456.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03456_7917ed4392d2155273da648b2693fb0163544534d06b0c3c68db07d4c4827be4.jsonl.gz"}, "slow_code": "import numpy as np\n\na = int(input().replace(\" \", \"\"))\nb = np.sqrt(a)\nc = b - int(b)\nif c == 0.0:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "slow_code_sha256": "7917ed4392d2155273da648b2693fb0163544534d06b0c3c68db07d4c4827be4", "slow_id": "p03456_7917ed4392d2155273da648b2693fb0163544534d06b0c3c68db07d4c4827be4", "speedup": 2074.8203516855842, "stratum": "8+", "within_pair_jaccard": 0.2857142857142857, "workload": {"case_count": 100, "description": "Concatenate the decimal representations of positive integers a and b, in that order, and determine whether the resulting integer is a perfect square. Observed inputs: a=1..100 (median 41); b=1..100 (median 48.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 8, "median": 6.0, "min": 4}, "input_format": ["a b"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p03455_case_000", "p03455_case_001", "p03455_case_002", "p03455_case_003", "p03455_case_004", "p03455_case_005", "p03455_case_006", "p03455_case_007", "p03455_case_008", "p03455_case_009", "p03455_case_010", "p03455_case_011", "p03455_case_012", "p03455_case_013", "p03455_case_014", "p03455_case_015", "p03455_case_016", "p03455_case_017", "p03455_case_018", "p03455_case_019", "p03455_case_020", "p03455_case_021", "p03455_case_022", "p03455_case_023", "p03455_case_024", "p03455_case_025", "p03455_case_026", "p03455_case_027", "p03455_case_028", "p03455_case_029", "p03455_case_030", "p03455_case_031", "p03455_case_032", "p03455_case_033", "p03455_case_034", "p03455_case_035", "p03455_case_036", "p03455_case_037", "p03455_case_038", "p03455_case_039", "p03455_case_040", "p03455_case_041", "p03455_case_042", "p03455_case_043", "p03455_case_044", "p03455_case_045", "p03455_case_046", "p03455_case_047", "p03455_case_048", "p03455_case_049", "p03455_case_050", "p03455_case_051", "p03455_case_052", "p03455_case_053", "p03455_case_054", "p03455_case_055", "p03455_case_056", "p03455_case_057", "p03455_case_058", "p03455_case_059", "p03455_case_060", "p03455_case_061", "p03455_case_062", "p03455_case_063", "p03455_case_064", "p03455_case_065", "p03455_case_066", "p03455_case_067", "p03455_case_068", "p03455_case_069", "p03455_case_070", "p03455_case_071", "p03455_case_072", "p03455_case_073", "p03455_case_074", "p03455_case_075", "p03455_case_076", "p03455_case_077", "p03455_case_078", "p03455_case_079", "p03455_case_080", "p03455_case_081", "p03455_case_082", "p03455_case_083", "p03455_case_084", "p03455_case_085", "p03455_case_086", "p03455_case_087", "p03455_case_088", "p03455_case_089", "p03455_case_090", "p03455_case_091", "p03455_case_092", "p03455_case_093", "p03455_case_094", "p03455_case_095", "p03455_case_096", "p03455_case_097", "p03455_case_098", "p03455_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "x = input().split()\ny = int(x[0]) * int(x[1])\nif y % 2:\n print(\"Odd\")\nelse:\n print(\"Even\")\n", "fast_code_sha256": "7253eea00ba4bf231d766aad0e05f1a51cc0f6fdf66a9b44de00cf7bac0c8149", "fast_id": "p03455_7253eea00ba4bf231d766aad0e05f1a51cc0f6fdf66a9b44de00cf7bac0c8149", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "x = input().split()\ny = int(x[0]) * int(x[1])\nif y % 2:\n print(\"Odd\")\nelse:\n print(\"Even\")\n", "measured_fast_code_sha256": "7253eea00ba4bf231d766aad0e05f1a51cc0f6fdf66a9b44de00cf7bac0c8149", "measured_slow_code": "def ketanowa(p):\n ans = 0\n p = str(p)\n for i in p:\n ans += int(i)\n return ans\n\n\ndef main():\n temp = input().split(\" \")\n n = int(temp[0])\n a = int(temp[1])\n if n * a % 2 == 0:\n print(\"Even\")\n else:\n print(\"Odd\")\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "1e58957cce6049d366f3189df1c6244aa3226734d9f71da11d6221cbf487aae2", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.24090992829898, "pair_id": "python_v2_e73f44f059e32d733b9b071a", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03455", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03455_7253eea00ba4bf231d766aad0e05f1a51cc0f6fdf66a9b44de00cf7bac0c8149.jsonl.gz", "inputs": "reproduction/python/inputs/p03455.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03455_1e58957cce6049d366f3189df1c6244aa3226734d9f71da11d6221cbf487aae2.jsonl.gz"}, "slow_code": "def ketanowa(p):\n ans = 0\n p = str(p)\n for i in p:\n ans += int(i)\n return ans\n\n\ndef main():\n temp = input().split(\" \")\n n = int(temp[0])\n a = int(temp[1])\n if n * a % 2 == 0:\n print(\"Even\")\n else:\n print(\"Odd\")\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "1e58957cce6049d366f3189df1c6244aa3226734d9f71da11d6221cbf487aae2", "slow_id": "p03455_1e58957cce6049d366f3189df1c6244aa3226734d9f71da11d6221cbf487aae2", "speedup": 2.2398938394568595, "stratum": "2-4", "within_pair_jaccard": 0.39285714285714285, "workload": {"case_count": 100, "description": "Determine whether the product of two supplied positive integers a and b is odd or even. Observed inputs: a=1..10000 (median 7119); b=1..10000 (median 5506.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 12, "median": 10.0, "min": 4}, "input_format": ["a b"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p02549_case_000", "p02549_case_001", "p02549_case_002", "p02549_case_003", "p02549_case_004", "p02549_case_005", "p02549_case_006", "p02549_case_007", "p02549_case_008", "p02549_case_009", "p02549_case_010", "p02549_case_011", "p02549_case_012", "p02549_case_013", "p02549_case_014", "p02549_case_015", "p02549_case_016", "p02549_case_017", "p02549_case_018", "p02549_case_019", "p02549_case_020", "p02549_case_021", "p02549_case_022", "p02549_case_023", "p02549_case_024", "p02549_case_025", "p02549_case_026", "p02549_case_027", "p02549_case_028", "p02549_case_029", "p02549_case_030", "p02549_case_031", "p02549_case_032", "p02549_case_033", "p02549_case_034", "p02549_case_035", "p02549_case_036", "p02549_case_037", "p02549_case_038", "p02549_case_039", "p02549_case_040", "p02549_case_041", "p02549_case_042", "p02549_case_043", "p02549_case_044", "p02549_case_045", "p02549_case_046", "p02549_case_047", "p02549_case_048", "p02549_case_049", "p02549_case_050", "p02549_case_051", "p02549_case_052", "p02549_case_053", "p02549_case_054", "p02549_case_055", "p02549_case_056", "p02549_case_057", "p02549_case_058", "p02549_case_059", "p02549_case_060", "p02549_case_061", "p02549_case_062", "p02549_case_063", "p02549_case_064", "p02549_case_065", "p02549_case_066", "p02549_case_067", "p02549_case_068", "p02549_case_069", "p02549_case_070", "p02549_case_071", "p02549_case_072", "p02549_case_073", "p02549_case_074", "p02549_case_075", "p02549_case_076", "p02549_case_077", "p02549_case_078", "p02549_case_079", "p02549_case_080", "p02549_case_081", "p02549_case_082", "p02549_case_083", "p02549_case_084", "p02549_case_085", "p02549_case_086", "p02549_case_087", "p02549_case_088", "p02549_case_089", "p02549_case_090", "p02549_case_091", "p02549_case_092", "p02549_case_093", "p02549_case_094", "p02549_case_095", "p02549_case_096", "p02549_case_097", "p02549_case_098", "p02549_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\nread = sys.stdin.read\nreadline = sys.stdin.readline\nreadlines = sys.stdin.readlines\nsys.setrecursionlimit(10**9)\nINF = 1 << 60\nMOD = 998244353\n\n\ndef main():\n N, K, *LR = list(map(int, read().split()))\n interval = [(l, r) for l, r in zip(*[iter(LR)] * 2)]\n dp = [0] * (N + 2)\n dp[1] = 1\n dp[2] = -1\n for i in range(1, N + 1):\n dp[i] = (dp[i] + dp[i - 1]) % MOD\n cur = dp[i]\n for l, r in interval:\n if i + l <= N:\n dp[i + l] += cur\n dp[min(i + r + 1, N + 1)] -= cur\n print((dp[N]))\n return\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "d397cb53eb3fb7f421b1fcb9442a451912871ff835552daf246a8dcb0e84ce5a", "fast_id": "p02549_d397cb53eb3fb7f421b1fcb9442a451912871ff835552daf246a8dcb0e84ce5a", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\nread = sys.stdin.read\nreadline = sys.stdin.readline\nreadlines = sys.stdin.readlines\nsys.setrecursionlimit(10**9)\nINF = 1 << 60\nMOD = 998244353\n\n\ndef main():\n N, K, *LR = list(map(int, read().split()))\n interval = [(l, r) for l, r in zip(*[iter(LR)] * 2)]\n dp = [0] * (N + 2)\n dp[1] = 1\n dp[2] = -1\n for i in range(1, N + 1):\n dp[i] = (dp[i] + dp[i - 1]) % MOD\n cur = dp[i]\n for l, r in interval:\n if i + l <= N:\n dp[i + l] += cur\n dp[min(i + r + 1, N + 1)] -= cur\n print((dp[N]))\n return\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "d397cb53eb3fb7f421b1fcb9442a451912871ff835552daf246a8dcb0e84ce5a", "measured_slow_code": "mod = 998244353\nn, k = list(map(int, input().split()))\nK = [list(map(int, input().split())) for i in range(k)]\ndp = [0] * (n + 5)\ndp[1] = 1\ndp2 = [0] * (n + 5)\nfor i in range(1, n + 1):\n dp[i] = (dp[i] + dp2[i] + dp2[i - 1]) % mod\n dp2[i] = (dp2[i] + dp2[i - 1]) % mod\n for l, r in K:\n dp2[min(i + l, n + 2)] += dp[i]\n dp2[min(i + l, n + 2)] %= mod\n dp2[min(i + r + 1, n + 2)] -= dp[i]\n dp2[min(i + r + 1, n + 2)] %= mod\nprint((dp[n] % mod))\n", "measured_slow_code_sha256": "44c9516e92f38f09d76b47812276c2878e77eeefdb8dab9cc1137c27ddfc7b8e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.0015535318940234, "pair_id": "python_v2_fdb6aa43a1ae5df667dbf7a7", "per_case_slow_code_faster_fraction": 0.03, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02549", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02549_d397cb53eb3fb7f421b1fcb9442a451912871ff835552daf246a8dcb0e84ce5a.jsonl.gz", "inputs": "reproduction/python/inputs/p02549.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02549_44c9516e92f38f09d76b47812276c2878e77eeefdb8dab9cc1137c27ddfc7b8e.jsonl.gz"}, "slow_code": "mod = 998244353\nn, k = list(map(int, input().split()))\nK = [list(map(int, input().split())) for i in range(k)]\ndp = [0] * (n + 5)\ndp[1] = 1\ndp2 = [0] * (n + 5)\nfor i in range(1, n + 1):\n dp[i] = (dp[i] + dp2[i] + dp2[i - 1]) % mod\n dp2[i] = (dp2[i] + dp2[i - 1]) % mod\n for l, r in K:\n dp2[min(i + l, n + 2)] += dp[i]\n dp2[min(i + l, n + 2)] %= mod\n dp2[min(i + r + 1, n + 2)] -= dp[i]\n dp2[min(i + r + 1, n + 2)] %= mod\nprint((dp[n] % mod))\n", "slow_code_sha256": "44c9516e92f38f09d76b47812276c2878e77eeefdb8dab9cc1137c27ddfc7b8e", "slow_id": "p02549_44c9516e92f38f09d76b47812276c2878e77eeefdb8dab9cc1137c27ddfc7b8e", "speedup": 2.92087228275828, "stratum": "2-4", "within_pair_jaccard": 0.375, "workload": {"case_count": 100, "description": "Count paths from cell 1 to N, modulo 998244353, moving forward by a length in the union of K disjoint inclusive intervals [L_i,R_i], without leaving the row. Observed inputs: N=2..200000 (median 5500); K=1..10 (median 5); L_i=1..200000; R_i=1..200000; allowed_step_count=1..170805 (median 10).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 150, "median": 49.0, "min": 8}, "input_format": ["N K\nL_1 R_1\n...\nL_K R_K"], "input_format_status": "source_input_section", "input_lines": {"max": 11, "median": 6.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 22, "median": 12.0, "min": 4}}} -{"case_ids": ["p03160_case_000", "p03160_case_001", "p03160_case_002", "p03160_case_003", "p03160_case_004", "p03160_case_005", "p03160_case_006", "p03160_case_007", "p03160_case_008", "p03160_case_009", "p03160_case_010", "p03160_case_011", "p03160_case_012", "p03160_case_013", "p03160_case_014", "p03160_case_015", "p03160_case_016", "p03160_case_017", "p03160_case_018", "p03160_case_019", "p03160_case_020", "p03160_case_021", "p03160_case_022", "p03160_case_023", "p03160_case_024", "p03160_case_025", "p03160_case_026", "p03160_case_027", "p03160_case_028", "p03160_case_029", "p03160_case_030", "p03160_case_031", "p03160_case_032", "p03160_case_033", "p03160_case_034", "p03160_case_035", "p03160_case_036", "p03160_case_037", "p03160_case_038", "p03160_case_039", "p03160_case_040", "p03160_case_041", "p03160_case_042", "p03160_case_043", "p03160_case_044", "p03160_case_045", "p03160_case_046", "p03160_case_047", "p03160_case_048", "p03160_case_049", "p03160_case_050", "p03160_case_051", "p03160_case_052", "p03160_case_053", "p03160_case_054", "p03160_case_055", "p03160_case_056", "p03160_case_057", "p03160_case_058", "p03160_case_059", "p03160_case_060", "p03160_case_061", "p03160_case_062", "p03160_case_063", "p03160_case_064", "p03160_case_065", "p03160_case_066", "p03160_case_067", "p03160_case_068", "p03160_case_069", "p03160_case_070", "p03160_case_071", "p03160_case_072", "p03160_case_073", "p03160_case_074", "p03160_case_075", "p03160_case_076", "p03160_case_077", "p03160_case_078", "p03160_case_079", "p03160_case_080", "p03160_case_081", "p03160_case_082", "p03160_case_083", "p03160_case_084", "p03160_case_085", "p03160_case_086", "p03160_case_087", "p03160_case_088", "p03160_case_089", "p03160_case_090", "p03160_case_091", "p03160_case_092", "p03160_case_093", "p03160_case_094", "p03160_case_095", "p03160_case_096", "p03160_case_097", "p03160_case_098", "p03160_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\nhs = list(map(int, input().split()))\na, b = 0, abs(hs[1] - hs[0])\nfor i in range(2, n):\n d1 = a + abs(hs[i] - hs[i - 2])\n d2 = b + abs(hs[i] - hs[i - 1])\n a, b = b, d1 if d1 <= d2 else d2\nprint(b)\n", "fast_code_sha256": "548f9d9ba3f56f0798f5a00d5c8c0672634a22c8ab42db59f51b3513ac28d3e4", "fast_id": "p03160_548f9d9ba3f56f0798f5a00d5c8c0672634a22c8ab42db59f51b3513ac28d3e4", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\nhs = list(map(int, input().split()))\na, b = 0, abs(hs[1] - hs[0])\nfor i in range(2, n):\n d1 = a + abs(hs[i] - hs[i - 2])\n d2 = b + abs(hs[i] - hs[i - 1])\n a, b = b, d1 if d1 <= d2 else d2\nprint(b)\n", "measured_fast_code_sha256": "548f9d9ba3f56f0798f5a00d5c8c0672634a22c8ab42db59f51b3513ac28d3e4", "measured_slow_code": "import numpy as np\n\nN = int(eval(input()))\nhs = [int(i) for i in input().split()]\ndp = np.zeros(N)\nfor i, h in enumerate(hs):\n if i == 0:\n # 0は初期化されている\n dp[i] = 0\n continue\n elif i == 1:\n # 1は1通りしか無い\n dp[i] = dp[i - 1] + abs(hs[i - 1] - h)\n else:\n # 1個前か2個前で、コストが最小になるやつ\n dp[i] = min(dp[i - 1] + abs(hs[i - 1] - h), dp[i - 2] + abs(hs[i - 2] - h))\n# print(dp)\nprint((int(dp[-1])))\n", "measured_slow_code_sha256": "934f379e0e5300fe0fee5440b2de9ab7f1cfdccbfbc9686e36dc49ab293c868e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 58.834204700839585, "pair_id": "python_v2_9914aa2f2b03006c8dd16475", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03160", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03160_548f9d9ba3f56f0798f5a00d5c8c0672634a22c8ab42db59f51b3513ac28d3e4.jsonl.gz", "inputs": "reproduction/python/inputs/p03160.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03160_934f379e0e5300fe0fee5440b2de9ab7f1cfdccbfbc9686e36dc49ab293c868e.jsonl.gz"}, "slow_code": "import numpy as np\n\nN = int(eval(input()))\nhs = [int(i) for i in input().split()]\ndp = np.zeros(N)\nfor i, h in enumerate(hs):\n if i == 0:\n\n dp[i] = 0\n continue\n elif i == 1:\n\n dp[i] = dp[i - 1] + abs(hs[i - 1] - h)\n else:\n\n dp[i] = min(dp[i - 1] + abs(hs[i - 1] - h), dp[i - 2] + abs(hs[i - 2] - h))\n\nprint((int(dp[-1])))\n", "slow_code_sha256": "3c2eb6d041b194aca6e618ed722e1b9ae4cb2dfbc9ca12487589612e2e637390", "slow_id": "p03160_934f379e0e5300fe0fee5440b2de9ab7f1cfdccbfbc9686e36dc49ab293c868e", "speedup": 61.46944637383095, "stratum": "8+", "within_pair_jaccard": 0.42857142857142855, "workload": {"case_count": 100, "description": "A frog starts at stone 1 and jumps ahead by 1 or 2 stones. A jump from i to j costs |h_i-h_j|. Find the minimum total cost to reach stone N. Observed inputs: N=2..100000 (median 1000); h_i=1..10000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 600007, "median": 4888.5, "min": 6}, "input_format": ["N\nh_1 ... h_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100001, "median": 1001.0, "min": 3}}} -{"case_ids": ["p00219_case_000", "p00219_case_001", "p00219_case_002", "p00219_case_003", "p00219_case_004", "p00219_case_005", "p00219_case_006", "p00219_case_007", "p00219_case_008", "p00219_case_009", "p00219_case_010", "p00219_case_011", "p00219_case_012", "p00219_case_013", "p00219_case_014", "p00219_case_015", "p00219_case_016", "p00219_case_017", "p00219_case_018", "p00219_case_019", "p00219_case_020", "p00219_case_021", "p00219_case_022", "p00219_case_023", "p00219_case_024", "p00219_case_025", "p00219_case_026", "p00219_case_027", "p00219_case_028", "p00219_case_029", "p00219_case_030", "p00219_case_031", "p00219_case_032", "p00219_case_033", "p00219_case_034", "p00219_case_035", "p00219_case_036", "p00219_case_037", "p00219_case_038", "p00219_case_039", "p00219_case_040", "p00219_case_041", "p00219_case_042", "p00219_case_043", "p00219_case_044", "p00219_case_045", "p00219_case_046", "p00219_case_047", "p00219_case_048", "p00219_case_049", "p00219_case_050", "p00219_case_051", "p00219_case_052", "p00219_case_053", "p00219_case_054", "p00219_case_055", "p00219_case_056", "p00219_case_057", "p00219_case_058", "p00219_case_059", "p00219_case_060", "p00219_case_061", "p00219_case_062", "p00219_case_063", "p00219_case_064", "p00219_case_065", "p00219_case_066", "p00219_case_067", "p00219_case_068", "p00219_case_069", "p00219_case_070", "p00219_case_071", "p00219_case_072", "p00219_case_073", "p00219_case_074", "p00219_case_075", "p00219_case_076", "p00219_case_077", "p00219_case_078", "p00219_case_079", "p00219_case_080", "p00219_case_081", "p00219_case_082", "p00219_case_083", "p00219_case_084", "p00219_case_085", "p00219_case_086", "p00219_case_087", "p00219_case_088", "p00219_case_089", "p00219_case_090", "p00219_case_091", "p00219_case_092", "p00219_case_093", "p00219_case_094", "p00219_case_095", "p00219_case_096", "p00219_case_097", "p00219_case_098", "p00219_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "while 1:\n n = eval(input())\n if n == 0:\n break\n h = [0] * 10\n for i in range(n):\n h[int(input())] += 1\n for i in h:\n print(\"*\" * i if i else \"-\")\n", "fast_code_sha256": "503fb8c9629bd5073ecf61d35bcd5f5eac21a3dac16db660482ea529cc5f3939", "fast_id": "p00219_503fb8c9629bd5073ecf61d35bcd5f5eac21a3dac16db660482ea529cc5f3939", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "while 1:\n n = eval(input())\n if n == 0:\n break\n h = [0] * 10\n for i in range(n):\n h[int(input())] += 1\n for i in h:\n print(\"*\" * i if i else \"-\")\n", "measured_fast_code_sha256": "503fb8c9629bd5073ecf61d35bcd5f5eac21a3dac16db660482ea529cc5f3939", "measured_slow_code": "while True:\n n = int(eval(input()))\n if n == 0:\n break\n ice = [int(eval(input())) for _ in range(n)]\n for i in range(10):\n print((\"*\" * ice.count(i) + \"-\" * (ice.count(i) == 0)))\n", "measured_slow_code_sha256": "143e8c43a896e1cd454e24e862b4fba25064da9281531a010b06f570682abd99", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 5.06541827324191, "pair_id": "python_v2_00219ec9286301bad8e3661a", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p00219", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p00219_503fb8c9629bd5073ecf61d35bcd5f5eac21a3dac16db660482ea529cc5f3939.jsonl.gz", "inputs": "reproduction/python/inputs/p00219.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p00219_143e8c43a896e1cd454e24e862b4fba25064da9281531a010b06f570682abd99.jsonl.gz"}, "slow_code": "while True:\n n = int(eval(input()))\n if n == 0:\n break\n ice = [int(eval(input())) for _ in range(n)]\n for i in range(10):\n print((\"*\" * ice.count(i) + \"-\" * (ice.count(i) == 0)))\n", "slow_code_sha256": "143e8c43a896e1cd454e24e862b4fba25064da9281531a010b06f570682abd99", "slow_id": "p00219_143e8c43a896e1cd454e24e862b4fba25064da9281531a010b06f570682abd99", "speedup": 4.132000409024836, "stratum": "4-8", "within_pair_jaccard": 0.6666666666666666, "workload": {"case_count": 100, "description": "For each dataset of sold item types c_i in 0..9, print a frequency histogram in type order: one asterisk per occurrence, or a hyphen for zero occurrences. Each dataset declares n; a final zero in place of n ends input. Observed inputs: datasets=1..15 (median 1); n=1..10000; total_records=1..113926 (median 10000); c_i=0..9.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 227929, "median": 20008.0, "min": 6}, "input_format": ["n_1\nc_1\n...\nc_(n_1)\n[next datasets]\n0"], "input_format_status": "source_input_section", "input_lines": {"max": 113942, "median": 10002.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 113942, "median": 10002.0, "min": 3}}} -{"case_ids": ["p02549_case_000", "p02549_case_001", "p02549_case_002", "p02549_case_003", "p02549_case_004", "p02549_case_005", "p02549_case_006", "p02549_case_007", "p02549_case_008", "p02549_case_009", "p02549_case_010", "p02549_case_011", "p02549_case_012", "p02549_case_013", "p02549_case_014", "p02549_case_015", "p02549_case_016", "p02549_case_017", "p02549_case_018", "p02549_case_019", "p02549_case_020", "p02549_case_021", "p02549_case_022", "p02549_case_023", "p02549_case_024", "p02549_case_025", "p02549_case_026", "p02549_case_027", "p02549_case_028", "p02549_case_029", "p02549_case_030", "p02549_case_031", "p02549_case_032", "p02549_case_033", "p02549_case_034", "p02549_case_035", "p02549_case_036", "p02549_case_037", "p02549_case_038", "p02549_case_039", "p02549_case_040", "p02549_case_041", "p02549_case_042", "p02549_case_043", "p02549_case_044", "p02549_case_045", "p02549_case_046", "p02549_case_047", "p02549_case_048", "p02549_case_049", "p02549_case_050", "p02549_case_051", "p02549_case_052", "p02549_case_053", "p02549_case_054", "p02549_case_055", "p02549_case_056", "p02549_case_057", "p02549_case_058", "p02549_case_059", "p02549_case_060", "p02549_case_061", "p02549_case_062", "p02549_case_063", "p02549_case_064", "p02549_case_065", "p02549_case_066", "p02549_case_067", "p02549_case_068", "p02549_case_069", "p02549_case_070", "p02549_case_071", "p02549_case_072", "p02549_case_073", "p02549_case_074", "p02549_case_075", "p02549_case_076", "p02549_case_077", "p02549_case_078", "p02549_case_079", "p02549_case_080", "p02549_case_081", "p02549_case_082", "p02549_case_083", "p02549_case_084", "p02549_case_085", "p02549_case_086", "p02549_case_087", "p02549_case_088", "p02549_case_089", "p02549_case_090", "p02549_case_091", "p02549_case_092", "p02549_case_093", "p02549_case_094", "p02549_case_095", "p02549_case_096", "p02549_case_097", "p02549_case_098", "p02549_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "(n, _), *s = [[*list(map(int, t.split()))] for t in open(0)]\nd = [1, -1] + [c := 0] * 2 * n\nfor i in range(n):\n c = (c + d[i]) % 998244353\n for l, r in s:\n d[i + l] += c\n d[i - ~r] -= c\nprint(c)\n", "fast_code_sha256": "91221217e6f5b58d18f29f102d886202d05d8b7f0b8fa25049362598d7119a89", "fast_id": "p02549_91221217e6f5b58d18f29f102d886202d05d8b7f0b8fa25049362598d7119a89", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "(n, _), *s = [[*list(map(int, t.split()))] for t in open(0)]\nd = [1, -1] + [c := 0] * 2 * n\nfor i in range(n):\n c = (c + d[i]) % 998244353\n for l, r in s:\n d[i + l] += c\n d[i - ~r] -= c\nprint(c)\n", "measured_fast_code_sha256": "91221217e6f5b58d18f29f102d886202d05d8b7f0b8fa25049362598d7119a89", "measured_slow_code": "mod = 998244353\nn, k = list(map(int, input().split()))\nK = [list(map(int, input().split())) for i in range(k)]\ndp = [0] * (n + 5)\ndp[1] = 1\ndp2 = [0] * (n + 5)\nfor i in range(1, n + 1):\n dp[i] = (dp[i] + dp2[i] + dp2[i - 1]) % mod\n dp2[i] = (dp2[i] + dp2[i - 1]) % mod\n for l, r in K:\n dp2[min(i + l, n + 2)] += dp[i]\n dp2[min(i + l, n + 2)] %= mod\n dp2[min(i + r + 1, n + 2)] -= dp[i]\n dp2[min(i + r + 1, n + 2)] %= mod\nprint((dp[n] % mod))\n", "measured_slow_code_sha256": "44c9516e92f38f09d76b47812276c2878e77eeefdb8dab9cc1137c27ddfc7b8e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.6700939210402606, "pair_id": "python_v2_a0ef0efc2924d4bdbb7d5958", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02549", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02549_91221217e6f5b58d18f29f102d886202d05d8b7f0b8fa25049362598d7119a89.jsonl.gz", "inputs": "reproduction/python/inputs/p02549.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02549_44c9516e92f38f09d76b47812276c2878e77eeefdb8dab9cc1137c27ddfc7b8e.jsonl.gz"}, "slow_code": "mod = 998244353\nn, k = list(map(int, input().split()))\nK = [list(map(int, input().split())) for i in range(k)]\ndp = [0] * (n + 5)\ndp[1] = 1\ndp2 = [0] * (n + 5)\nfor i in range(1, n + 1):\n dp[i] = (dp[i] + dp2[i] + dp2[i - 1]) % mod\n dp2[i] = (dp2[i] + dp2[i - 1]) % mod\n for l, r in K:\n dp2[min(i + l, n + 2)] += dp[i]\n dp2[min(i + l, n + 2)] %= mod\n dp2[min(i + r + 1, n + 2)] -= dp[i]\n dp2[min(i + r + 1, n + 2)] %= mod\nprint((dp[n] % mod))\n", "slow_code_sha256": "44c9516e92f38f09d76b47812276c2878e77eeefdb8dab9cc1137c27ddfc7b8e", "slow_id": "p02549_44c9516e92f38f09d76b47812276c2878e77eeefdb8dab9cc1137c27ddfc7b8e", "speedup": 3.071391001364279, "stratum": "2-4", "within_pair_jaccard": 0.5333333333333333, "workload": {"case_count": 100, "description": "Count paths from cell 1 to N, modulo 998244353, moving forward by a length in the union of K disjoint inclusive intervals [L_i,R_i], without leaving the row. Observed inputs: N=2..200000 (median 5500); K=1..10 (median 5); L_i=1..200000; R_i=1..200000; allowed_step_count=1..170805 (median 10).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 150, "median": 49.0, "min": 8}, "input_format": ["N K\nL_1 R_1\n...\nL_K R_K"], "input_format_status": "source_input_section", "input_lines": {"max": 11, "median": 6.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 22, "median": 12.0, "min": 4}}} -{"case_ids": ["p04006_case_000", "p04006_case_001", "p04006_case_002", "p04006_case_003", "p04006_case_004", "p04006_case_005", "p04006_case_006", "p04006_case_007", "p04006_case_008", "p04006_case_009", "p04006_case_010", "p04006_case_011", "p04006_case_012", "p04006_case_013", "p04006_case_014", "p04006_case_015", "p04006_case_016", "p04006_case_017", "p04006_case_018", "p04006_case_019", "p04006_case_020", "p04006_case_021", "p04006_case_022", "p04006_case_023", "p04006_case_024", "p04006_case_025", "p04006_case_026", "p04006_case_027", "p04006_case_028", "p04006_case_029", "p04006_case_030", "p04006_case_031", "p04006_case_032", "p04006_case_033", "p04006_case_034", "p04006_case_035", "p04006_case_036", "p04006_case_037", "p04006_case_038", "p04006_case_039", "p04006_case_040", "p04006_case_041", "p04006_case_042", "p04006_case_043", "p04006_case_044", "p04006_case_045", "p04006_case_046", "p04006_case_047", "p04006_case_048", "p04006_case_049", "p04006_case_050", "p04006_case_051", "p04006_case_052", "p04006_case_053", "p04006_case_054", "p04006_case_055", "p04006_case_056", "p04006_case_057", "p04006_case_058", "p04006_case_059", "p04006_case_060", "p04006_case_061", "p04006_case_062", "p04006_case_063", "p04006_case_064", "p04006_case_065", "p04006_case_066", "p04006_case_067", "p04006_case_068", "p04006_case_069", "p04006_case_070", "p04006_case_071", "p04006_case_072", "p04006_case_073", "p04006_case_074", "p04006_case_075", "p04006_case_076", "p04006_case_077", "p04006_case_078", "p04006_case_079", "p04006_case_080", "p04006_case_081", "p04006_case_082", "p04006_case_083", "p04006_case_084", "p04006_case_085", "p04006_case_086", "p04006_case_087", "p04006_case_088", "p04006_case_089", "p04006_case_090", "p04006_case_091", "p04006_case_092", "p04006_case_093", "p04006_case_094", "p04006_case_095", "p04006_case_096", "p04006_case_097", "p04006_case_098"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 99, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def main():\n N, x = list(map(int, input().split()))\n a = list(map(int, input().split()))\n ans = float(\"INF\")\n b = [float(\"INF\")] * N\n for k in range(N):\n temp_ans = k * x\n for i in range(N):\n b[i] = min(b[i], a[i - k])\n temp_ans += b[i]\n ans = min(ans, temp_ans)\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "0a73d7f83eb25a8cfe9a26c4f9be97210a015dfb66c31fcefc1d6845352665d6", "fast_id": "p04006_0a73d7f83eb25a8cfe9a26c4f9be97210a015dfb66c31fcefc1d6845352665d6", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def main():\n N, x = list(map(int, input().split()))\n a = list(map(int, input().split()))\n ans = float(\"INF\")\n b = [float(\"INF\")] * N\n for k in range(N):\n temp_ans = k * x\n for i in range(N):\n b[i] = min(b[i], a[i - k])\n temp_ans += b[i]\n ans = min(ans, temp_ans)\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "0a73d7f83eb25a8cfe9a26c4f9be97210a015dfb66c31fcefc1d6845352665d6", "measured_slow_code": "import numpy as np\nfrom copy import deepcopy\n\nN, x = list(map(int, input().split()))\nA = list(map(int, input().split()))\n\n\ndef myfunc(N, x, A):\n B = deepcopy(np.array(A))\n m = sum(B)\n\n def apppop(A):\n A.append(A[0])\n A.pop(0)\n\n for idx in range(1, N):\n apppop(A)\n np.fmin(B, A, out=B)\n m = min(np.sum(B) + idx * x, m)\n print(int(m))\n\n\nmyfunc(N, x, A)\n", "measured_slow_code_sha256": "91e1e2c740659f8110b6da7065d298174d653edb3135242031e3d37884d00c98", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 0.44274788992812375, "pair_id": "python_v2_861669e5ae44bb119ca4a3d9", "per_case_slow_code_faster_fraction": 0.5555555555555556, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p04006", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p04006_0a73d7f83eb25a8cfe9a26c4f9be97210a015dfb66c31fcefc1d6845352665d6.jsonl.gz", "inputs": "reproduction/python/inputs/p04006.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p04006_91e1e2c740659f8110b6da7065d298174d653edb3135242031e3d37884d00c98.jsonl.gz"}, "slow_code": "import numpy as np\nfrom copy import deepcopy\n\nN, x = list(map(int, input().split()))\nA = list(map(int, input().split()))\n\n\ndef myfunc(N, x, A):\n B = deepcopy(np.array(A))\n m = sum(B)\n\n def apppop(A):\n A.append(A[0])\n A.pop(0)\n\n for idx in range(1, N):\n apppop(A)\n np.fmin(B, A, out=B)\n m = min(np.sum(B) + idx * x, m)\n print(int(m))\n\n\nmyfunc(N, x, A)\n", "slow_code_sha256": "91e1e2c740659f8110b6da7065d298174d653edb3135242031e3d37884d00c98", "slow_id": "p04006_91e1e2c740659f8110b6da7065d298174d653edb3135242031e3d37884d00c98", "speedup": 4.8467675411338496, "stratum": "4-8", "within_pair_jaccard": 0.2826086956521739, "workload": {"case_count": 99, "description": "Starting with no slimes, acquire all N colors. Catching a missing color i costs a_i time; a spell costs x and rotates every held color i to i+1, wrapping N to 1. Minimize total time. Observed inputs: N=2..2000 (median 1000); x=1..1000000000; a_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 99, "input_bytes": {"max": 20015, "median": 5795, "min": 10}, "input_format": ["N x\na_1 ... a_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2002, "median": 1002, "min": 4}}} -{"case_ids": ["p03576_case_000", "p03576_case_001", "p03576_case_002", "p03576_case_003", "p03576_case_004", "p03576_case_005", "p03576_case_006", "p03576_case_007", "p03576_case_008", "p03576_case_009", "p03576_case_010", "p03576_case_011", "p03576_case_012", "p03576_case_013", "p03576_case_014", "p03576_case_015", "p03576_case_016", "p03576_case_017", "p03576_case_018", "p03576_case_019", "p03576_case_020", "p03576_case_021", "p03576_case_022", "p03576_case_023", "p03576_case_024", "p03576_case_025", "p03576_case_026", "p03576_case_027", "p03576_case_028", "p03576_case_029", "p03576_case_030", "p03576_case_031", "p03576_case_032", "p03576_case_033", "p03576_case_034", "p03576_case_035", "p03576_case_036", "p03576_case_037", "p03576_case_038", "p03576_case_039", "p03576_case_040", "p03576_case_041", "p03576_case_042", "p03576_case_043", "p03576_case_044", "p03576_case_045", "p03576_case_046", "p03576_case_047", "p03576_case_048", "p03576_case_049", "p03576_case_050", "p03576_case_051", "p03576_case_052", "p03576_case_053", "p03576_case_054", "p03576_case_055", "p03576_case_056", "p03576_case_057", "p03576_case_058", "p03576_case_059", "p03576_case_060", "p03576_case_061", "p03576_case_062", "p03576_case_063", "p03576_case_064", "p03576_case_065", "p03576_case_066", "p03576_case_067", "p03576_case_068", "p03576_case_069", "p03576_case_070", "p03576_case_071", "p03576_case_072", "p03576_case_073", "p03576_case_074", "p03576_case_075", "p03576_case_076", "p03576_case_077", "p03576_case_078", "p03576_case_079", "p03576_case_080", "p03576_case_081", "p03576_case_082", "p03576_case_083", "p03576_case_084", "p03576_case_085", "p03576_case_086", "p03576_case_087", "p03576_case_088", "p03576_case_089", "p03576_case_090", "p03576_case_091", "p03576_case_092", "p03576_case_093", "p03576_case_094", "p03576_case_095", "p03576_case_096", "p03576_case_097", "p03576_case_098", "p03576_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N, K = list(map(int, input().split()))\nXY = [list(map(int, input().split())) for _ in range(N)]\nXY.sort()\nr = 10**20\nfor xi0 in range(N - K + 1):\n for xi1 in range(K + xi0 - 1, N):\n x = XY[xi1][0] - XY[xi0][0]\n XY_ys = sorted(XY[xi0 : xi1 + 1], key=lambda a: a[1])\n for yi0 in range(len(XY_ys) - K + 1):\n y = XY_ys[yi0 + K - 1][1] - XY_ys[yi0][1]\n r = min(r, x * y)\nprint(r)\n", "fast_code_sha256": "9a4e48d010df096778c13e4189307ca0404591874cbaa1e68ac325838f5c578d", "fast_id": "p03576_9a4e48d010df096778c13e4189307ca0404591874cbaa1e68ac325838f5c578d", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N, K = list(map(int, input().split()))\nXY = [list(map(int, input().split())) for _ in range(N)]\nXY.sort()\nr = 10**20\nfor xi0 in range(N - K + 1):\n for xi1 in range(K + xi0 - 1, N):\n x = XY[xi1][0] - XY[xi0][0]\n XY_ys = sorted(XY[xi0 : xi1 + 1], key=lambda a: a[1])\n for yi0 in range(len(XY_ys) - K + 1):\n y = XY_ys[yi0 + K - 1][1] - XY_ys[yi0][1]\n r = min(r, x * y)\nprint(r)\n", "measured_fast_code_sha256": "9a4e48d010df096778c13e4189307ca0404591874cbaa1e68ac325838f5c578d", "measured_slow_code": "N, K = list(map(int, input().split()))\nXY = [list(map(int, input().split())) for _ in [0] * N]\niX = sorted(x for x, y in XY)\niY = sorted(y for x, y in XY)\nX = {x: i for i, x in enumerate(iX)}\nY = {y: i for i, y in enumerate(iY)}\nc = [[0] * (N + 1) for i in [0] * (N + 1)]\nfor x, y in XY:\n c[Y[y] + 1][X[x] + 1] = 1\nfor i in range(N):\n for j in range(N):\n c[i + 1][j + 1] += c[i + 1][j]\nfor i in range(N):\n for j in range(N):\n c[i + 1][j + 1] += c[i][j + 1]\nans = 10**20\nfor l in range(N):\n for r in range(l + 1, N):\n u = 0\n d = 1\n dX = iX[r] - iX[l]\n while d < N:\n if c[d + 1][r + 1] + c[u][l] - c[u][r + 1] - c[d + 1][l] >= K:\n ans = min(ans, dX * (iY[d] - iY[u]))\n u += 1\n else:\n d += 1\nprint(ans)\n", "measured_slow_code_sha256": "146890d7ea4c911960fefc2e44f08fc85d507e64dfaaafffaee3a881578f824a", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 5.262985185423911, "pair_id": "python_v2_a759d831b98a1c8c5dbe96e3", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03576", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03576_9a4e48d010df096778c13e4189307ca0404591874cbaa1e68ac325838f5c578d.jsonl.gz", "inputs": "reproduction/python/inputs/p03576.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03576_146890d7ea4c911960fefc2e44f08fc85d507e64dfaaafffaee3a881578f824a.jsonl.gz"}, "slow_code": "N, K = list(map(int, input().split()))\nXY = [list(map(int, input().split())) for _ in [0] * N]\niX = sorted(x for x, y in XY)\niY = sorted(y for x, y in XY)\nX = {x: i for i, x in enumerate(iX)}\nY = {y: i for i, y in enumerate(iY)}\nc = [[0] * (N + 1) for i in [0] * (N + 1)]\nfor x, y in XY:\n c[Y[y] + 1][X[x] + 1] = 1\nfor i in range(N):\n for j in range(N):\n c[i + 1][j + 1] += c[i + 1][j]\nfor i in range(N):\n for j in range(N):\n c[i + 1][j + 1] += c[i][j + 1]\nans = 10**20\nfor l in range(N):\n for r in range(l + 1, N):\n u = 0\n d = 1\n dX = iX[r] - iX[l]\n while d < N:\n if c[d + 1][r + 1] + c[u][l] - c[u][r + 1] - c[d + 1][l] >= K:\n ans = min(ans, dX * (iY[d] - iY[u]))\n u += 1\n else:\n d += 1\nprint(ans)\n", "slow_code_sha256": "146890d7ea4c911960fefc2e44f08fc85d507e64dfaaafffaee3a881578f824a", "slow_id": "p03576_146890d7ea4c911960fefc2e44f08fc85d507e64dfaaafffaee3a881578f824a", "speedup": 6.286284793066686, "stratum": "4-8", "within_pair_jaccard": 0.46808510638297873, "workload": {"case_count": 100, "description": "Find the minimum area of an axis-aligned rectangle containing at least K of N plane points, counting boundary points. All x coordinates are distinct, and all y coordinates are distinct. Observed inputs: N=2..50 (median 25); K=2..50 (median 2.5); x_i=-1000000000..997427460; y_i=-1000000000..997398050.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1106, "median": 524.0, "min": 40}, "input_format": ["N K\nx_1 y_1\n...\nx_N y_N"], "input_format_status": "source_input_section", "input_lines": {"max": 51, "median": 26.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 102, "median": 52.0, "min": 6}}} -{"case_ids": ["p02938_case_000", "p02938_case_001", "p02938_case_002", "p02938_case_003", "p02938_case_004", "p02938_case_005", "p02938_case_006", "p02938_case_007", "p02938_case_008", "p02938_case_009", "p02938_case_010", "p02938_case_011", "p02938_case_012", "p02938_case_013", "p02938_case_014", "p02938_case_015", "p02938_case_016", "p02938_case_017", "p02938_case_018", "p02938_case_019", "p02938_case_020", "p02938_case_021", "p02938_case_022", "p02938_case_023", "p02938_case_024", "p02938_case_025", "p02938_case_026", "p02938_case_027", "p02938_case_028", "p02938_case_029", "p02938_case_030", "p02938_case_031", "p02938_case_032", "p02938_case_033", "p02938_case_034", "p02938_case_035", "p02938_case_036", "p02938_case_037", "p02938_case_038", "p02938_case_039", "p02938_case_040", "p02938_case_041", "p02938_case_042", "p02938_case_043", "p02938_case_044", "p02938_case_045", "p02938_case_046", "p02938_case_047", "p02938_case_048", "p02938_case_049", "p02938_case_050", "p02938_case_051", "p02938_case_052", "p02938_case_053", "p02938_case_054", "p02938_case_055", "p02938_case_056", "p02938_case_057", "p02938_case_058", "p02938_case_059", "p02938_case_060", "p02938_case_061", "p02938_case_062", "p02938_case_063", "p02938_case_064", "p02938_case_065", "p02938_case_066", "p02938_case_067", "p02938_case_068", "p02938_case_069", "p02938_case_070", "p02938_case_071", "p02938_case_072", "p02938_case_073", "p02938_case_074", "p02938_case_075", "p02938_case_076", "p02938_case_077", "p02938_case_078", "p02938_case_079", "p02938_case_080", "p02938_case_081", "p02938_case_082", "p02938_case_083", "p02938_case_084", "p02938_case_085", "p02938_case_086", "p02938_case_087", "p02938_case_088", "p02938_case_089", "p02938_case_090", "p02938_case_091", "p02938_case_092", "p02938_case_093", "p02938_case_094", "p02938_case_095", "p02938_case_096", "p02938_case_097", "p02938_case_098", "p02938_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "L, R = list(map(int, input().split()))\nMOD = 10**9 + 7\nl = \"{:060b}\".format(L)[::-1]\nr = \"{:060b}\".format(R)[::-1]\nmemo = [\n [[[-1 for l in range(2)] for k in range(2)] for j in range(2)] for i in range(60)\n]\n\n\ndef f(pos, flagX, flagY, flagZ):\n if pos == -1:\n return 1\n if memo[pos][flagX][flagY][flagZ] != -1:\n return memo[pos][flagX][flagY][flagZ]\n ret = 0\n\n if flagX or l[pos] == \"0\":\n ret += f(pos - 1, flagX, 1 if r[pos] == \"1\" else flagY, flagZ)\n\n if (flagX or l[pos] == \"0\") and (flagY or r[pos] == \"1\") and flagZ:\n ret += f(pos - 1, flagX, flagY, flagZ)\n\n if flagY or r[pos] == \"1\":\n ret += f(pos - 1, 1 if l[pos] == \"0\" else flagX, flagY, 1)\n ret %= MOD\n memo[pos][flagX][flagY][flagZ] = ret\n return ret\n\n\nans = f(59, 0, 0, 0)\nprint(ans)\n", "fast_code_sha256": "f7ced2ef7edb747b0622641dbcb07ff8636e9d93730e18fa28ca976665cc3b44", "fast_id": "p02938_2ba840643a3bd3f827955caf8230ec590255a0752656fd303454dc4ec91460eb", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "L, R = list(map(int, input().split()))\nMOD = 10**9 + 7\nl = \"{:060b}\".format(L)[::-1]\nr = \"{:060b}\".format(R)[::-1]\nmemo = [\n [[[-1 for l in range(2)] for k in range(2)] for j in range(2)] for i in range(60)\n]\n\n\ndef f(pos, flagX, flagY, flagZ):\n if pos == -1:\n return 1\n if memo[pos][flagX][flagY][flagZ] != -1:\n return memo[pos][flagX][flagY][flagZ]\n ret = 0\n # x 0, y 0\n if flagX or l[pos] == \"0\":\n ret += f(pos - 1, flagX, 1 if r[pos] == \"1\" else flagY, flagZ)\n # x 0, y 1\n if (flagX or l[pos] == \"0\") and (flagY or r[pos] == \"1\") and flagZ:\n ret += f(pos - 1, flagX, flagY, flagZ)\n # x 1, y 1\n if flagY or r[pos] == \"1\":\n ret += f(pos - 1, 1 if l[pos] == \"0\" else flagX, flagY, 1)\n ret %= MOD\n memo[pos][flagX][flagY][flagZ] = ret\n return ret\n\n\nans = f(59, 0, 0, 0)\nprint(ans)\n", "measured_fast_code_sha256": "2ba840643a3bd3f827955caf8230ec590255a0752656fd303454dc4ec91460eb", "measured_slow_code": "L, R = list(map(int, input().split()))\nmod = 10**9 + 7\n\n\ndef f(L, R):\n if L > R:\n return 0\n R = bin(R)[2:]\n N = len(R)\n ret = f(L, int(\"0\" + \"1\" * (N - 1), 2))\n L = bin(L)[2:]\n if len(L) != N:\n L = \"1\" + \"0\" * (N - 1)\n for i in range(N):\n if R[i] == \"0\":\n continue\n R2 = R[:i] + \"0\" + \"?\" * (N - i - 1)\n if i == 0:\n R2 = R\n for j in range(N):\n if L[j] == \"1\" and j != 0:\n continue\n L2 = L[:j] + \"1\" + \"?\" * (N - j - 1)\n if j == 0:\n L2 = L\n if L2[0] == \"0\":\n break\n tmp = 1\n for r, l in zip(R2[1:], L2[1:]):\n if r == \"0\" and l == \"1\":\n tmp *= 0\n break\n if r == \"?\" and l == \"?\":\n tmp = tmp * 3 % mod\n if r == \"?\" and l == \"0\":\n tmp = tmp * 2 % mod\n if r == \"1\" and l == \"?\":\n tmp = tmp * 2 % mod\n ret += tmp\n ret %= mod\n return ret\n\n\nprint((f(L, R)))\n", "measured_slow_code_sha256": "1aa640e94f003b6d012f6a5cd6d1e8cb1a7e36510feb6ef6074dca49a962987e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 10.525939587578742, "pair_id": "python_v2_eb34bdd3d92271ca364ff5ee", "per_case_slow_code_faster_fraction": 0.12, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02938", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02938_2ba840643a3bd3f827955caf8230ec590255a0752656fd303454dc4ec91460eb.jsonl.gz", "inputs": "reproduction/python/inputs/p02938.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02938_1aa640e94f003b6d012f6a5cd6d1e8cb1a7e36510feb6ef6074dca49a962987e.jsonl.gz"}, "slow_code": "L, R = list(map(int, input().split()))\nmod = 10**9 + 7\n\n\ndef f(L, R):\n if L > R:\n return 0\n R = bin(R)[2:]\n N = len(R)\n ret = f(L, int(\"0\" + \"1\" * (N - 1), 2))\n L = bin(L)[2:]\n if len(L) != N:\n L = \"1\" + \"0\" * (N - 1)\n for i in range(N):\n if R[i] == \"0\":\n continue\n R2 = R[:i] + \"0\" + \"?\" * (N - i - 1)\n if i == 0:\n R2 = R\n for j in range(N):\n if L[j] == \"1\" and j != 0:\n continue\n L2 = L[:j] + \"1\" + \"?\" * (N - j - 1)\n if j == 0:\n L2 = L\n if L2[0] == \"0\":\n break\n tmp = 1\n for r, l in zip(R2[1:], L2[1:]):\n if r == \"0\" and l == \"1\":\n tmp *= 0\n break\n if r == \"?\" and l == \"?\":\n tmp = tmp * 3 % mod\n if r == \"?\" and l == \"0\":\n tmp = tmp * 2 % mod\n if r == \"1\" and l == \"?\":\n tmp = tmp * 2 % mod\n ret += tmp\n ret %= mod\n return ret\n\n\nprint((f(L, R)))\n", "slow_code_sha256": "1aa640e94f003b6d012f6a5cd6d1e8cb1a7e36510feb6ef6074dca49a962987e", "slow_id": "p02938_1aa640e94f003b6d012f6a5cd6d1e8cb1a7e36510feb6ef6074dca49a962987e", "speedup": 8.635889976426911, "stratum": "8+", "within_pair_jaccard": 0.5192307692307693, "workload": {"case_count": 100, "description": "Count pairs (x,y) with L<=x<=y<=R satisfying y mod x = y XOR x, modulo 1000000007. The interval is specified only by its endpoints. Observed inputs: L=1..1000000000000000000; R=1..1000000000000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 40, "median": 38.0, "min": 4}, "input_format": ["L R"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p02948_case_000", "p02948_case_001", "p02948_case_002", "p02948_case_003", "p02948_case_004", "p02948_case_005", "p02948_case_006", "p02948_case_007", "p02948_case_008", "p02948_case_009", "p02948_case_010", "p02948_case_011", "p02948_case_012", "p02948_case_013", "p02948_case_014", "p02948_case_015", "p02948_case_016", "p02948_case_017", "p02948_case_018", "p02948_case_019", "p02948_case_020", "p02948_case_021", "p02948_case_022", "p02948_case_023", "p02948_case_024", "p02948_case_025", "p02948_case_026", "p02948_case_027", "p02948_case_028", "p02948_case_029", "p02948_case_030", "p02948_case_031", "p02948_case_032", "p02948_case_033", "p02948_case_034", "p02948_case_035", "p02948_case_036", "p02948_case_037", "p02948_case_038", "p02948_case_039", "p02948_case_040", "p02948_case_041", "p02948_case_042", "p02948_case_043", "p02948_case_044", "p02948_case_045", "p02948_case_046", "p02948_case_047", "p02948_case_048", "p02948_case_049", "p02948_case_050", "p02948_case_051", "p02948_case_052", "p02948_case_053", "p02948_case_054", "p02948_case_055", "p02948_case_056", "p02948_case_057", "p02948_case_058", "p02948_case_059", "p02948_case_060", "p02948_case_061", "p02948_case_062", "p02948_case_063", "p02948_case_064", "p02948_case_065", "p02948_case_066", "p02948_case_067", "p02948_case_068", "p02948_case_069", "p02948_case_070", "p02948_case_071", "p02948_case_072", "p02948_case_073", "p02948_case_074", "p02948_case_075", "p02948_case_076", "p02948_case_077", "p02948_case_078", "p02948_case_079", "p02948_case_080", "p02948_case_081", "p02948_case_082", "p02948_case_083", "p02948_case_084", "p02948_case_085", "p02948_case_086", "p02948_case_087", "p02948_case_088", "p02948_case_089", "p02948_case_090", "p02948_case_091", "p02948_case_092", "p02948_case_093", "p02948_case_094", "p02948_case_095", "p02948_case_096", "p02948_case_097", "p02948_case_098", "p02948_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from heapq import *\n\nN, M, *t = list(map(int, open(0).read().split()))\nv = [[] for _ in \"_\" * M]\nz = i = 0\nfor _ in \"_\" * N:\n M < t[i] or v[t[i] - 1].append(t[i + 1])\n i += 2\nq = []\nfor i in v:\n for j in i:\n heappush(q, -j)\n z -= len(q) and heappop(q)\nprint(z)\n", "fast_code_sha256": "78195a2740d448817b390133128ddb97072787be3c728274df837dfcfab111dc", "fast_id": "p02948_78195a2740d448817b390133128ddb97072787be3c728274df837dfcfab111dc", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from heapq import *\n\nN, M, *t = list(map(int, open(0).read().split()))\nv = [[] for _ in \"_\" * M]\nz = i = 0\nfor _ in \"_\" * N:\n M < t[i] or v[t[i] - 1].append(t[i + 1])\n i += 2\nq = []\nfor i in v:\n for j in i:\n heappush(q, -j)\n z -= len(q) and heappop(q)\nprint(z)\n", "measured_fast_code_sha256": "78195a2740d448817b390133128ddb97072787be3c728274df837dfcfab111dc", "measured_slow_code": "n, m = list(map(int, input().split()))\nab = [[] for _ in range(10**5)]\nfor i in range(n):\n a, b = list(map(int, input().split()))\n a -= 1\n ab[a].append(b)\nimport heapq\n\nq = []\nheapq.heapify(q)\nans = 0\nfor i in range(m):\n if len(ab[i]) != 0:\n for j in range(len(ab[i])):\n heapq.heappush(q, -1 * ab[i][j])\n if len(q) != 0:\n ans += -1 * heapq.heappop(q)\nprint(ans)\n", "measured_slow_code_sha256": "e5cb2e4881c9b2875f40f46e76e41fea32db4b3dd9f35a928c399990727e7e86", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.7944019560344464, "pair_id": "python_v2_c0352204df2029511e44d443", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02948", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02948_78195a2740d448817b390133128ddb97072787be3c728274df837dfcfab111dc.jsonl.gz", "inputs": "reproduction/python/inputs/p02948.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02948_e5cb2e4881c9b2875f40f46e76e41fea32db4b3dd9f35a928c399990727e7e86.jsonl.gz"}, "slow_code": "n, m = list(map(int, input().split()))\nab = [[] for _ in range(10**5)]\nfor i in range(n):\n a, b = list(map(int, input().split()))\n a -= 1\n ab[a].append(b)\nimport heapq\n\nq = []\nheapq.heapify(q)\nans = 0\nfor i in range(m):\n if len(ab[i]) != 0:\n for j in range(len(ab[i])):\n heapq.heappush(q, -1 * ab[i][j])\n if len(q) != 0:\n ans += -1 * heapq.heappop(q)\nprint(ans)\n", "slow_code_sha256": "e5cb2e4881c9b2875f40f46e76e41fea32db4b3dd9f35a928c399990727e7e86", "slow_id": "p02948_e5cb2e4881c9b2875f40f46e76e41fea32db4b3dd9f35a928c399990727e7e86", "speedup": 2.5982208069474573, "stratum": "2-4", "within_pair_jaccard": 0.4523809523809524, "workload": {"case_count": 100, "description": "Each of N one-off jobs can be done in one day, paying B_i after A_i days. At most one job is done daily, starting today. Maximize rewards received no later than M days from today; jobs cannot be repeated. Observed inputs: N=1..100000 (median 100000); M=1..100000 (median 100000); A_i=1..100000; B_i=1..10000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1300014, "median": 1077655.5, "min": 14}, "input_format": ["N M\nA_1 B_1\n...\nA_N B_N"], "input_format_status": "source_input_section", "input_lines": {"max": 100001, "median": 100001.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200002, "median": 200002.0, "min": 4}}} -{"case_ids": ["p02406_case_000", "p02406_case_001", "p02406_case_002", "p02406_case_003", "p02406_case_004", "p02406_case_005", "p02406_case_006", "p02406_case_007", "p02406_case_008", "p02406_case_009", "p02406_case_010", "p02406_case_011", "p02406_case_012", "p02406_case_013", "p02406_case_014", "p02406_case_015", "p02406_case_016", "p02406_case_017", "p02406_case_018", "p02406_case_019", "p02406_case_020", "p02406_case_021", "p02406_case_022", "p02406_case_023", "p02406_case_024", "p02406_case_025", "p02406_case_026", "p02406_case_027", "p02406_case_028", "p02406_case_029", "p02406_case_030", "p02406_case_031", "p02406_case_032", "p02406_case_033", "p02406_case_034", "p02406_case_035", "p02406_case_036", "p02406_case_037", "p02406_case_038", "p02406_case_039", "p02406_case_040", "p02406_case_041", "p02406_case_042", "p02406_case_043", "p02406_case_044", "p02406_case_045", "p02406_case_046", "p02406_case_047", "p02406_case_048", "p02406_case_049", "p02406_case_050", "p02406_case_051", "p02406_case_052", "p02406_case_053", "p02406_case_054", "p02406_case_055", "p02406_case_056", "p02406_case_057", "p02406_case_058", "p02406_case_059", "p02406_case_060", "p02406_case_061", "p02406_case_062", "p02406_case_063", "p02406_case_064", "p02406_case_065", "p02406_case_066", "p02406_case_067", "p02406_case_068", "p02406_case_069", "p02406_case_070", "p02406_case_071", "p02406_case_072", "p02406_case_073", "p02406_case_074", "p02406_case_075", "p02406_case_076", "p02406_case_077", "p02406_case_078", "p02406_case_079", "p02406_case_080", "p02406_case_081", "p02406_case_082", "p02406_case_083", "p02406_case_084", "p02406_case_085", "p02406_case_086", "p02406_case_087", "p02406_case_088", "p02406_case_089", "p02406_case_090", "p02406_case_091", "p02406_case_092", "p02406_case_093", "p02406_case_094", "p02406_case_095", "p02406_case_096", "p02406_case_097", "p02406_case_098", "p02406_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "print(\n \"\".join(\n \" \" + str(i) for i in range(1, eval(input()) + 1) if i % 3 == 0 or \"3\" in str(i)\n )\n)\n", "fast_code_sha256": "44ab35a9714ea188a11aedb20f3ea7103bd930af4ad186337881b8ed88a0b55b", "fast_id": "p02406_44ab35a9714ea188a11aedb20f3ea7103bd930af4ad186337881b8ed88a0b55b", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "print(\n \"\".join(\n \" \" + str(i) for i in range(1, eval(input()) + 1) if i % 3 == 0 or \"3\" in str(i)\n )\n)\n", "measured_fast_code_sha256": "44ab35a9714ea188a11aedb20f3ea7103bd930af4ad186337881b8ed88a0b55b", "measured_slow_code": "n = int(input())\ni = 1\nprint(\"\", end=\" \")\nwhile i <= n:\n if i % 3 == 0:\n print(i, end=\" \")\n else:\n I = str(i)\n for j in range(len(I)):\n if I[j] == \"3\":\n print(I, end=\" \")\n break\n i += 1\n", "measured_slow_code_sha256": "def78739ac97a98fac5a75497b769f50dcbad6c21d955142939d7265bd3b3875", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.8007309440177197, "pair_id": "python_v2_46d8454bb323ac12d99b91cc", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02406", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02406_44ab35a9714ea188a11aedb20f3ea7103bd930af4ad186337881b8ed88a0b55b.jsonl.gz", "inputs": "reproduction/python/inputs/p02406.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02406_def78739ac97a98fac5a75497b769f50dcbad6c21d955142939d7265bd3b3875.jsonl.gz"}, "slow_code": "n = int(input())\ni = 1\nprint(\"\", end=\" \")\nwhile i <= n:\n if i % 3 == 0:\n print(i, end=\" \")\n else:\n I = str(i)\n for j in range(len(I)):\n if I[j] == \"3\":\n print(I, end=\" \")\n break\n i += 1\n", "slow_code_sha256": "def78739ac97a98fac5a75497b769f50dcbad6c21d955142939d7265bd3b3875", "slow_id": "p02406_def78739ac97a98fac5a75497b769f50dcbad6c21d955142939d7265bd3b3875", "speedup": 2.6920967867113585, "stratum": "2-4", "within_pair_jaccard": 0.4782608695652174, "workload": {"case_count": 100, "description": "Print in ascending order the integers from 1 through n that are divisible by 3 or have a decimal digit 3. A qualifying integer is printed once even if both conditions hold. Observed inputs: n=3..10000 (median 5211).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 6, "median": 5.0, "min": 2}, "input_format": ["n"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p03805_case_000", "p03805_case_001", "p03805_case_002", "p03805_case_003", "p03805_case_004", "p03805_case_005", "p03805_case_006", "p03805_case_007", "p03805_case_008", "p03805_case_009", "p03805_case_010", "p03805_case_011", "p03805_case_012", "p03805_case_013", "p03805_case_014", "p03805_case_015", "p03805_case_016", "p03805_case_017", "p03805_case_018", "p03805_case_019", "p03805_case_020", "p03805_case_021", "p03805_case_022", "p03805_case_023", "p03805_case_024", "p03805_case_025", "p03805_case_026", "p03805_case_027", "p03805_case_028", "p03805_case_029", "p03805_case_030", "p03805_case_031", "p03805_case_032", "p03805_case_033", "p03805_case_034", "p03805_case_035", "p03805_case_036", "p03805_case_037", "p03805_case_038", "p03805_case_039", "p03805_case_040", "p03805_case_041", "p03805_case_042", "p03805_case_043", "p03805_case_044", "p03805_case_045", "p03805_case_046", "p03805_case_047", "p03805_case_048", "p03805_case_049", "p03805_case_050", "p03805_case_051", "p03805_case_052", "p03805_case_053", "p03805_case_054", "p03805_case_055", "p03805_case_056", "p03805_case_057", "p03805_case_058", "p03805_case_059", "p03805_case_060", "p03805_case_061", "p03805_case_062", "p03805_case_063", "p03805_case_064", "p03805_case_065", "p03805_case_066", "p03805_case_067", "p03805_case_068", "p03805_case_069", "p03805_case_070", "p03805_case_071", "p03805_case_072", "p03805_case_073", "p03805_case_074", "p03805_case_075", "p03805_case_076", "p03805_case_077", "p03805_case_078", "p03805_case_079", "p03805_case_080", "p03805_case_081", "p03805_case_082", "p03805_case_083", "p03805_case_084", "p03805_case_085", "p03805_case_086", "p03805_case_087", "p03805_case_088", "p03805_case_089", "p03805_case_090", "p03805_case_091", "p03805_case_092", "p03805_case_093", "p03805_case_094", "p03805_case_095", "p03805_case_096", "p03805_case_097", "p03805_case_098", "p03805_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import bisect\n\nn, m = list(map(int, input().split()))\ng = [[] for i in range(n + 1)]\nfor i in range(m):\n a, b = list(map(int, input().split()))\n g[a].append(b)\n g[b].append(a)\n\n\nans = 0\n\n\ndef dfs(x, check):\n\n ans = 0\n if not False in check:\n\n return 1\n\n for i in g[x]:\n if check[i] == True:\n continue\n\n check[i] = True\n ans += dfs(i, check)\n check[i] = False\n return ans\n\n\ncheck = [False] * (n + 1)\ncheck[0] = True\ncheck[1] = True\nprint((dfs(1, check)))\n", "fast_code_sha256": "8e6f72120f0653bb0f9588922d2c639381ac4c5a375a77d1790ec6f5265a0f81", "fast_id": "p03805_967adf5c10d66eaa26a7ee6f5ec2d721b2b366cb765817b6752d9405053507d8", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import bisect\n\nn, m = list(map(int, input().split()))\ng = [[] for i in range(n + 1)]\nfor i in range(m):\n a, b = list(map(int, input().split()))\n g[a].append(b)\n g[b].append(a)\n # print(bisect.bisect_left(g[a],b))\n # g[a][] = b\n # g[a].append(b)\n # g[b].append(a)\n# g[4].sort()\nans = 0\n\n\ndef dfs(x, check):\n # print(check,x)\n ans = 0\n if not False in check:\n # print(ans)\n return 1\n # check[x] = 0\n # print(x)\n # print(check)\n for i in g[x]:\n if check[i] == True:\n continue\n # print(i,check)\n check[i] = True\n ans += dfs(i, check)\n check[i] = False\n return ans\n\n\ncheck = [False] * (n + 1)\ncheck[0] = True\ncheck[1] = True\nprint((dfs(1, check)))\n", "measured_fast_code_sha256": "967adf5c10d66eaa26a7ee6f5ec2d721b2b366cb765817b6752d9405053507d8", "measured_slow_code": "import copy\n\nn, m = list(map(int, input().split()))\nadjacent_list = [[] for i in range(n + 1)]\nfor i in range(m):\n a, b = list(map(int, input().split()))\n adjacent_list[a].append(b)\n adjacent_list[b].append(a)\nans = 0\n\n\ndef dfs(node, f):\n f.add(node)\n global ans\n if len(f) == n:\n ans += 1\n else:\n for i in adjacent_list[node]:\n if i not in f:\n k = copy.deepcopy(f)\n dfs(i, k)\n\n\ndfs(1, set())\nprint(ans)\n", "measured_slow_code_sha256": "c3acb924d926d7976d47bbd614601f83a33b5a800335a849db565bab92d78789", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.565855591894116, "pair_id": "python_v2_4e30af8a5987a4c12af5e51b", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03805", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03805_967adf5c10d66eaa26a7ee6f5ec2d721b2b366cb765817b6752d9405053507d8.jsonl.gz", "inputs": "reproduction/python/inputs/p03805.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03805_c3acb924d926d7976d47bbd614601f83a33b5a800335a849db565bab92d78789.jsonl.gz"}, "slow_code": "import copy\n\nn, m = list(map(int, input().split()))\nadjacent_list = [[] for i in range(n + 1)]\nfor i in range(m):\n a, b = list(map(int, input().split()))\n adjacent_list[a].append(b)\n adjacent_list[b].append(a)\nans = 0\n\n\ndef dfs(node, f):\n f.add(node)\n global ans\n if len(f) == n:\n ans += 1\n else:\n for i in adjacent_list[node]:\n if i not in f:\n k = copy.deepcopy(f)\n dfs(i, k)\n\n\ndfs(1, set())\nprint(ans)\n", "slow_code_sha256": "c3acb924d926d7976d47bbd614601f83a33b5a800335a849db565bab92d78789", "slow_id": "p03805_c3acb924d926d7976d47bbd614601f83a33b5a800335a849db565bab92d78789", "speedup": 4.150334338742477, "stratum": "4-8", "within_pair_jaccard": 0.5476190476190477, "workload": {"case_count": 100, "description": "Count paths starting at vertex 1 and visiting all N vertices exactly once in a simple unweighted undirected graph. Disconnected graphs and zero edges are allowed. Edges use 1-based endpoints a_i n:\n break\n if f(i, n) == s:\n ans = i\n break\nfor i in range(1, n):\n if i * i > n:\n break\n if (n - s) % i == 0:\n b = (n - s) // i + 1\n if f(b, n) == s:\n if ans is None:\n ans = (n - s) // i + 1\n else:\n ans = min((ans, (n - s) // i + 1))\nif ans is None:\n print((-1))\nelse:\n print(ans)\n", "fast_code_sha256": "9f205f7f14f8a8391a0e84e5bbc9266ac57a944177527cfa1158bad6b697fbee", "fast_id": "p04014_9f205f7f14f8a8391a0e84e5bbc9266ac57a944177527cfa1158bad6b697fbee", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\nn = int(eval(input()))\ns = int(eval(input()))\n\n\ndef f(b, n):\n if n < b:\n return n\n else:\n return f(b, n // b) + n % b\n\n\nif s == n:\n print((n + 1))\n sys.exit(0)\nif n < s:\n print((-1))\n sys.exit(0)\nans = None\nfor i in range(2, n):\n if i * i > n:\n break\n if f(i, n) == s:\n ans = i\n break\nfor i in range(1, n):\n if i * i > n:\n break\n if (n - s) % i == 0:\n b = (n - s) // i + 1\n if f(b, n) == s:\n if ans is None:\n ans = (n - s) // i + 1\n else:\n ans = min((ans, (n - s) // i + 1))\nif ans is None:\n print((-1))\nelse:\n print(ans)\n", "measured_fast_code_sha256": "9f205f7f14f8a8391a0e84e5bbc9266ac57a944177527cfa1158bad6b697fbee", "measured_slow_code": "from collections import defaultdict, Counter\nfrom itertools import product, groupby, count, permutations, combinations\nfrom math import pi, sqrt, floor\nfrom collections import deque\nfrom bisect import bisect, bisect_left, bisect_right\nfrom string import ascii_lowercase\nfrom functools import lru_cache\nimport sys\n\nsys.setrecursionlimit(10000)\nINF = float(\"inf\")\nYES, Yes, yes, NO, No, no = \"YES\", \"Yes\", \"yes\", \"NO\", \"No\", \"no\"\ndy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]\ndy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]\n\n\ndef inside(y, x, H, W):\n return 0 <= y < H and 0 <= x < W\n\n\ndef ceil(a, b):\n return (a + b - 1) // b\n\n\ndef f(b, n):\n if n < b:\n return n\n return f(b, n // b) + n % b\n\n\ndef main():\n N = int(eval(input()))\n S = int(eval(input()))\n if N == S:\n print((N + 1))\n return\n if N < S:\n print((-1))\n return\n ans = INF\n for b in range(2, int(sqrt(N)) + 1):\n if f(b, N) == S:\n ans = min(ans, b)\n bs = set()\n t = N - S\n for i in range(1, int(sqrt(N)) + 1):\n if t % i == 0:\n bs.add(i + 1)\n bs.add((t // i) + 1)\n for b in bs:\n if b == 1:\n continue\n if f(b, N) == S:\n ans = min(ans, b)\n if ans == INF:\n print((-1))\n else:\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "38f05af6b73665280db9ec2a605f799d5a3a653696a22897da46868ca5707313", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4.99795144517295, "pair_id": "python_v2_fb4b5adfd88882f5a31be58c", "per_case_slow_code_faster_fraction": 0.09, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p04014", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p04014_9f205f7f14f8a8391a0e84e5bbc9266ac57a944177527cfa1158bad6b697fbee.jsonl.gz", "inputs": "reproduction/python/inputs/p04014.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p04014_38f05af6b73665280db9ec2a605f799d5a3a653696a22897da46868ca5707313.jsonl.gz"}, "slow_code": "from collections import defaultdict, Counter\nfrom itertools import product, groupby, count, permutations, combinations\nfrom math import pi, sqrt, floor\nfrom collections import deque\nfrom bisect import bisect, bisect_left, bisect_right\nfrom string import ascii_lowercase\nfrom functools import lru_cache\nimport sys\n\nsys.setrecursionlimit(10000)\nINF = float(\"inf\")\nYES, Yes, yes, NO, No, no = \"YES\", \"Yes\", \"yes\", \"NO\", \"No\", \"no\"\ndy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]\ndy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]\n\n\ndef inside(y, x, H, W):\n return 0 <= y < H and 0 <= x < W\n\n\ndef ceil(a, b):\n return (a + b - 1) // b\n\n\ndef f(b, n):\n if n < b:\n return n\n return f(b, n // b) + n % b\n\n\ndef main():\n N = int(eval(input()))\n S = int(eval(input()))\n if N == S:\n print((N + 1))\n return\n if N < S:\n print((-1))\n return\n ans = INF\n for b in range(2, int(sqrt(N)) + 1):\n if f(b, N) == S:\n ans = min(ans, b)\n bs = set()\n t = N - S\n for i in range(1, int(sqrt(N)) + 1):\n if t % i == 0:\n bs.add(i + 1)\n bs.add((t // i) + 1)\n for b in bs:\n if b == 1:\n continue\n if f(b, N) == S:\n ans = min(ans, b)\n if ans == INF:\n print((-1))\n else:\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "38f05af6b73665280db9ec2a605f799d5a3a653696a22897da46868ca5707313", "slow_id": "p04014_38f05af6b73665280db9ec2a605f799d5a3a653696a22897da46868ca5707313", "speedup": 3.761586469670643, "stratum": "2-4", "within_pair_jaccard": 0.2682926829268293, "workload": {"case_count": 100, "description": "Find the smallest integer base b>=2 in which positive integer n has digit sum s, or report -1 if no such base exists. Observed inputs: n=1..99999999999; s=1..99999999999.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 24, "median": 14.0, "min": 4}, "input_format": ["n\ns"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p02890_case_000", "p02890_case_001", "p02890_case_002", "p02890_case_003", "p02890_case_004", "p02890_case_005", "p02890_case_006", "p02890_case_007", "p02890_case_008", "p02890_case_009", "p02890_case_010", "p02890_case_011", "p02890_case_012", "p02890_case_013", "p02890_case_014", "p02890_case_015", "p02890_case_016", "p02890_case_017", "p02890_case_018", "p02890_case_019", "p02890_case_020", "p02890_case_021", "p02890_case_022", "p02890_case_023", "p02890_case_024", "p02890_case_025", "p02890_case_026", "p02890_case_027", "p02890_case_028", "p02890_case_029", "p02890_case_030", "p02890_case_031", "p02890_case_032", "p02890_case_033", "p02890_case_034", "p02890_case_035", "p02890_case_036", "p02890_case_037", "p02890_case_038", "p02890_case_039", "p02890_case_040", "p02890_case_041", "p02890_case_042", "p02890_case_043", "p02890_case_044", "p02890_case_045", "p02890_case_046", "p02890_case_047", "p02890_case_048", "p02890_case_049", "p02890_case_050", "p02890_case_051", "p02890_case_052", "p02890_case_053", "p02890_case_054", "p02890_case_055", "p02890_case_056", "p02890_case_057", "p02890_case_058", "p02890_case_059", "p02890_case_060", "p02890_case_061", "p02890_case_062", "p02890_case_063", "p02890_case_064", "p02890_case_065", "p02890_case_066", "p02890_case_067", "p02890_case_068", "p02890_case_069", "p02890_case_070", "p02890_case_071", "p02890_case_072", "p02890_case_073", "p02890_case_074", "p02890_case_075", "p02890_case_076", "p02890_case_077", "p02890_case_078", "p02890_case_079", "p02890_case_080", "p02890_case_081", "p02890_case_082", "p02890_case_083", "p02890_case_084", "p02890_case_085", "p02890_case_086", "p02890_case_087", "p02890_case_088", "p02890_case_089", "p02890_case_090", "p02890_case_091", "p02890_case_092", "p02890_case_093", "p02890_case_094", "p02890_case_095", "p02890_case_096", "p02890_case_097", "p02890_case_098", "p02890_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "executable_AST_equal_except_explicit_explanatory_string_removal_and_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\nsys.setrecursionlimit(2147483647)\nINF = float(\"inf\")\nMOD = 10**9 + 7\ninput = lambda: sys.stdin.readline().rstrip()\n\n\ndef bin_sort(A, n_min=None, n_max=None):\n if n_min is None:\n n_min = min(A)\n if n_max is None:\n n_max = max(A)\n bin = [0] * (n_max - n_min + 1)\n for a in A:\n bin[a - n_min] += 1\n B = []\n for i in range(n_min, n_max + 1):\n B.extend([i] * bin[i - n_min])\n return B\n\n\ndef resolve():\n n = int(eval(input()))\n A = [0] * n\n for a in map(int, input().split()):\n A[a - 1] += 1\n A = bin_sort(A, 0, n)\n S = [0] * (n + 1)\n for i in range(n):\n S[i + 1] = S[i] + A[i]\n\n p = n\n i = n\n for k in range(1, n + 1):\n while 1:\n while 1:\n if i <= 0 or A[i - 1] < p:\n break\n i -= 1\n if S[i] + p * (n - i) >= k * p:\n break\n p -= 1\n print(p)\n\n\nresolve()\n", "fast_code_sha256": "df8648745f9f12663f3429f2366c68af7f779e4cc12d5e9a141be93c1733a40e", "fast_id": "p02890_18f84a0298d8af8466ef1ae9becf5f6d3c11c42135ba0a6e6d8d9d839fe18a64", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\nsys.setrecursionlimit(2147483647)\nINF = float(\"inf\")\nMOD = 10**9 + 7\ninput = lambda: sys.stdin.readline().rstrip()\n\n\ndef bin_sort(A, n_min=None, n_max=None):\n if n_min is None:\n n_min = min(A)\n if n_max is None:\n n_max = max(A)\n bin = [0] * (n_max - n_min + 1)\n for a in A:\n bin[a - n_min] += 1\n B = []\n for i in range(n_min, n_max + 1):\n B.extend([i] * bin[i - n_min])\n return B\n\n\ndef resolve():\n n = int(eval(input()))\n A = [0] * n\n for a in map(int, input().split()):\n A[a - 1] += 1\n A = bin_sort(A, 0, n)\n S = [0] * (n + 1)\n for i in range(n):\n S[i + 1] = S[i] + A[i]\n # output\n p = n\n i = n\n for k in range(1, n + 1):\n while 1:\n while 1:\n if i <= 0 or A[i - 1] < p:\n break\n i -= 1\n if S[i] + p * (n - i) >= k * p:\n break\n p -= 1\n print(p)\n\n\nresolve()\n", "measured_fast_code_sha256": "18f84a0298d8af8466ef1ae9becf5f6d3c11c42135ba0a6e6d8d9d839fe18a64", "measured_slow_code": "#!/usr/bin/env python3\nimport sys\nimport math\nfrom bisect import bisect_right as br\nfrom bisect import bisect_left as bl\n\nsys.setrecursionlimit(2147483647)\nfrom heapq import heappush, heappop, heappushpop\nfrom collections import defaultdict\nfrom itertools import accumulate\nfrom collections import Counter\nfrom collections import deque\nfrom operator import itemgetter\nfrom itertools import permutations\n\nmod = 10**9 + 7\ninf = float(\"inf\")\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\n\"\"\"\n.2分探索を考える\n.各kに対してx回以上抜き出せるかという問いを考える\n.各数の個数を数えて数iの個数をCiとする\n.各数iを抜き出せるのはCiまで\n ⇒各数を抜き出す回数min(Ci,x)\n.Σmin(Ci,x)はkx以上でなければいけない(k個x回抜き出すため)\n.これを満たすときx回抜き出せる\n.このままではO(n^2(logn))なので工夫する\n.Σ(min(Ci,x))はk依存でないのでここを工夫する(Σ(min(Ci,x))をSxとする)\n.SxはSx-1と比べてx以上のCiの数だけ増える(x以上のCiの数をDxとする)\n.Sx := Sx-1 + Dx\n.Dxを求める時はCのリストについてbisectを行う。\n.Sx >= k*xとなるxの最大値を2分探索で求める。(O(nlogn))\n\"\"\"\nn = I()\na = LI()\ncnt = list(Counter(a).values())\ncnt.sort()\nm = len(cnt)\nS = [0] * (n + 1)\nfor x in range(1, n + 1):\n l = bl(cnt, x)\n S[x] = S[x - 1] + (m - l)\nfor k in range(1, n + 1):\n high, low = n + 1, 0\n while high - low > 1:\n mid = (high + low) // 2\n if S[mid] >= k * mid:\n low = mid\n else:\n high = mid\n print(low)\n", "measured_slow_code_sha256": "683b16708a4919fe826584e325a20783d2265d979233683a19a27263211ea906", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.8864803979752827, "pair_id": "python_v2_9750fd4a5dd951aaabf326e1", "per_case_slow_code_faster_fraction": 0.05, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02890", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02890_18f84a0298d8af8466ef1ae9becf5f6d3c11c42135ba0a6e6d8d9d839fe18a64.jsonl.gz", "inputs": "reproduction/python/inputs/p02890.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02890_683b16708a4919fe826584e325a20783d2265d979233683a19a27263211ea906.jsonl.gz"}, "slow_code": "import sys\nimport math\nfrom bisect import bisect_right as br\nfrom bisect import bisect_left as bl\n\nsys.setrecursionlimit(2147483647)\nfrom heapq import heappush, heappop, heappushpop\nfrom collections import defaultdict\nfrom itertools import accumulate\nfrom collections import Counter\nfrom collections import deque\nfrom operator import itemgetter\nfrom itertools import permutations\n\nmod = 10**9 + 7\ninf = float(\"inf\")\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\nn = I()\na = LI()\ncnt = list(Counter(a).values())\ncnt.sort()\nm = len(cnt)\nS = [0] * (n + 1)\nfor x in range(1, n + 1):\n l = bl(cnt, x)\n S[x] = S[x - 1] + (m - l)\nfor k in range(1, n + 1):\n high, low = n + 1, 0\n while high - low > 1:\n mid = (high + low) // 2\n if S[mid] >= k * mid:\n low = mid\n else:\n high = mid\n print(low)\n", "slow_code_sha256": "2c57f5c3d6e04ae779c203c63a7a33316889e85db23460b3b699e27933e99fbd", "slow_id": "p02890_683b16708a4919fe826584e325a20783d2265d979233683a19a27263211ea906", "speedup": 3.051364173834406, "stratum": "2-4", "within_pair_jaccard": 0.25892857142857145, "workload": {"case_count": 100, "description": "For each K=1..N, find the maximum number of disjoint groups of exactly K cards that can be removed, requiring all values within each group to differ. The same N-card multiset is considered independently for every K. Observed inputs: N=1..300000 (median 100000); A_i=1..300000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 2100007, "median": 238900.5, "min": 4}, "input_format": ["N\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 300001, "median": 100001.0, "min": 2}}} -{"case_ids": ["p03077_case_000", "p03077_case_001", "p03077_case_002", "p03077_case_003", "p03077_case_004", "p03077_case_005", "p03077_case_006", "p03077_case_007", "p03077_case_008", "p03077_case_009", "p03077_case_010", "p03077_case_011", "p03077_case_012", "p03077_case_013", "p03077_case_014", "p03077_case_015", "p03077_case_016", "p03077_case_017", "p03077_case_018", "p03077_case_019", "p03077_case_020", "p03077_case_021", "p03077_case_022", "p03077_case_023", "p03077_case_024", "p03077_case_025", "p03077_case_026", "p03077_case_027", "p03077_case_028", "p03077_case_029", "p03077_case_030", "p03077_case_031", "p03077_case_032", "p03077_case_033", "p03077_case_034", "p03077_case_035", "p03077_case_036", "p03077_case_037", "p03077_case_038", "p03077_case_039", "p03077_case_040", "p03077_case_041", "p03077_case_042", "p03077_case_043", "p03077_case_044", "p03077_case_045", "p03077_case_046", "p03077_case_047", "p03077_case_048", "p03077_case_049", "p03077_case_050", "p03077_case_051", "p03077_case_052", "p03077_case_053", "p03077_case_054", "p03077_case_055", "p03077_case_056", "p03077_case_057", "p03077_case_058", "p03077_case_059", "p03077_case_060", "p03077_case_061", "p03077_case_062", "p03077_case_063", "p03077_case_064", "p03077_case_065", "p03077_case_066", "p03077_case_067", "p03077_case_068", "p03077_case_069", "p03077_case_070", "p03077_case_071", "p03077_case_072", "p03077_case_073", "p03077_case_074", "p03077_case_075", "p03077_case_076", "p03077_case_077", "p03077_case_078", "p03077_case_079", "p03077_case_080", "p03077_case_081", "p03077_case_082", "p03077_case_083", "p03077_case_084", "p03077_case_085", "p03077_case_086", "p03077_case_087", "p03077_case_088", "p03077_case_089", "p03077_case_090", "p03077_case_091", "p03077_case_092", "p03077_case_093", "p03077_case_094", "p03077_case_095", "p03077_case_096", "p03077_case_097", "p03077_case_098", "p03077_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\nnu = min([int(eval(input())) for i in range(5)])\nprint((4 + bool(n % nu) + n // nu))\n", "fast_code_sha256": "685836c518b1a206eb84f65a8f64fc53daa687d0c7abf15263398c42998bef9e", "fast_id": "p03077_685836c518b1a206eb84f65a8f64fc53daa687d0c7abf15263398c42998bef9e", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\nnu = min([int(eval(input())) for i in range(5)])\nprint((4 + bool(n % nu) + n // nu))\n", "measured_fast_code_sha256": "685836c518b1a206eb84f65a8f64fc53daa687d0c7abf15263398c42998bef9e", "measured_slow_code": "# -*- coding: utf-8 -*-\nimport sys\nimport numpy as np\n\n\ndef get_num():\n return int(eval(input()))\n\n\ndef get_nums(n):\n res = [0 for _ in range(n)]\n for i in range(n):\n res[i] = int(eval(input()))\n return res\n\n\ndef get_numbers():\n return list(map(int, input().split()))\n\n\nn = get_num()\ncosts = get_nums(5)\nmax_time = 0\nfor cost in costs:\n max_time = max(max_time, int(np.ceil(n / cost)))\nprint((max_time + 4))\n", "measured_slow_code_sha256": "34caf7325f4819bd719f1f977d4c7833f1b8eae1073783274c70d879e08aa59a", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 875.8541297797778, "pair_id": "python_v2_2501293975ea856a051776f9", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03077", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03077_685836c518b1a206eb84f65a8f64fc53daa687d0c7abf15263398c42998bef9e.jsonl.gz", "inputs": "reproduction/python/inputs/p03077.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03077_34caf7325f4819bd719f1f977d4c7833f1b8eae1073783274c70d879e08aa59a.jsonl.gz"}, "slow_code": "import sys\nimport numpy as np\n\n\ndef get_num():\n return int(eval(input()))\n\n\ndef get_nums(n):\n res = [0 for _ in range(n)]\n for i in range(n):\n res[i] = int(eval(input()))\n return res\n\n\ndef get_numbers():\n return list(map(int, input().split()))\n\n\nn = get_num()\ncosts = get_nums(5)\nmax_time = 0\nfor cost in costs:\n max_time = max(max_time, int(np.ceil(n / cost)))\nprint((max_time + 4))\n", "slow_code_sha256": "ab58e9cb16ab933309b0c60e055e71406d283b0d16126adf763de4e9caa5d6fb", "slow_id": "p03077_34caf7325f4819bd719f1f977d4c7833f1b8eae1073783274c70d879e08aa59a", "speedup": 875.8630805402655, "stratum": "8+", "within_pair_jaccard": 0.3142857142857143, "workload": {"case_count": 100, "description": "Move N people through five successive transport links with capacities A,B,C,D,E. Each link takes one minute and dispatches one vehicle at every integer time starting at 0; transfers take no time. Find when everyone can arrive. Observed inputs: N=1..1000000000000000; capacities=1..1000000000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 102, "median": 82.0, "min": 12}, "input_format": ["N\nA\nB\nC\nD\nE"], "input_format_status": "source_input_section", "input_lines": {"max": 6, "median": 6.0, "min": 6}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 6, "median": 6.0, "min": 6}}} -{"case_ids": ["p03997_case_000", "p03997_case_001", "p03997_case_002", "p03997_case_003", "p03997_case_004", "p03997_case_005", "p03997_case_006", "p03997_case_007", "p03997_case_008", "p03997_case_009", "p03997_case_010", "p03997_case_011", "p03997_case_012", "p03997_case_013", "p03997_case_014", "p03997_case_015", "p03997_case_016", "p03997_case_017", "p03997_case_018", "p03997_case_019", "p03997_case_020", "p03997_case_021", "p03997_case_022", "p03997_case_023", "p03997_case_024", "p03997_case_025", "p03997_case_026", "p03997_case_027", "p03997_case_028", "p03997_case_029", "p03997_case_030", "p03997_case_031", "p03997_case_032", "p03997_case_033", "p03997_case_034", "p03997_case_035", "p03997_case_036", "p03997_case_037", "p03997_case_038", "p03997_case_039", "p03997_case_040", "p03997_case_041", "p03997_case_042", "p03997_case_043", "p03997_case_044", "p03997_case_045", "p03997_case_046", "p03997_case_047", "p03997_case_048", "p03997_case_049", "p03997_case_050", "p03997_case_051", "p03997_case_052", "p03997_case_053", "p03997_case_054", "p03997_case_055", "p03997_case_056", "p03997_case_057", "p03997_case_058", "p03997_case_059", "p03997_case_060", "p03997_case_061", "p03997_case_062", "p03997_case_063", "p03997_case_064", "p03997_case_065", "p03997_case_066", "p03997_case_067", "p03997_case_068", "p03997_case_069", "p03997_case_070", "p03997_case_071", "p03997_case_072", "p03997_case_073", "p03997_case_074", "p03997_case_075", "p03997_case_076", "p03997_case_077", "p03997_case_078", "p03997_case_079", "p03997_case_080", "p03997_case_081", "p03997_case_082", "p03997_case_083", "p03997_case_084", "p03997_case_085", "p03997_case_086", "p03997_case_087", "p03997_case_088", "p03997_case_089", "p03997_case_090", "p03997_case_091", "p03997_case_092", "p03997_case_093", "p03997_case_094", "p03997_case_095", "p03997_case_096", "p03997_case_097", "p03997_case_098", "p03997_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "a = int(eval(input()))\nb = int(eval(input()))\nh = int(eval(input()))\nans = (a + b) * h // 2\nprint(ans)\n", "fast_code_sha256": "fe7afb47e68a41016ca3dd9d37a718d585b4472d520f285fd602feac361ab4b2", "fast_id": "p03997_fe7afb47e68a41016ca3dd9d37a718d585b4472d520f285fd602feac361ab4b2", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "a = int(eval(input()))\nb = int(eval(input()))\nh = int(eval(input()))\nans = (a + b) * h // 2\nprint(ans)\n", "measured_fast_code_sha256": "fe7afb47e68a41016ca3dd9d37a718d585b4472d520f285fd602feac361ab4b2", "measured_slow_code": "from collections import deque\nfrom heapq import heapify, heappop, heappush, heappushpop\nfrom copy import copy, deepcopy\nfrom itertools import product, permutations, combinations, combinations_with_replacement\nfrom collections import defaultdict, Counter\nfrom bisect import bisect_left, bisect_right\n\n# from math import gcd,ceil,floor,factorial\n# from fractions import gcd\nfrom functools import reduce\nfrom pprint import pprint\n\nINF = float(\"inf\")\n\n\ndef myinput():\n return list(map(int, input().split()))\n\n\ndef mylistinput(n):\n return [list(myinput()) for _ in range(n)]\n\n\ndef mycol(data, col):\n return [row[col] for row in data]\n\n\ndef mysort(data, col, reverse_flag):\n data.sort(key=lambda x: x[col], reverse=reverse_flag)\n return data\n\n\ndef mymax(data):\n M = -1 * float(\"inf\")\n for i in range(len(data)):\n m = max(data[i])\n M = max(M, m)\n return M\n\n\ndef mymin(data):\n m = float(\"inf\")\n for i in range(len(data)):\n M = min(data[i])\n m = min(m, M)\n return m\n\n\ndef mycount(ls, x):\n # lsはソート済みであること\n l = bisect_left(ls, x)\n r = bisect_right(ls, x)\n return r - l\n\n\ndef myoutput(ls, space=True):\n if space:\n if len(ls) == 0:\n print(\" \")\n elif type(ls[0]) == str:\n print((\" \".join(ls)))\n elif type(ls[0]) == int:\n print((\" \".join(map(str, ls))))\n else:\n print(\"Output Error\")\n else:\n if len(ls) == 0:\n print(\"\")\n elif type(ls[0]) == str:\n print((\"\".join(ls)))\n elif type(ls[0]) == int:\n print((\"\".join(map(str, ls))))\n else:\n print(\"Output Error\")\n\n\na = int(eval(input()))\nb = int(eval(input()))\nh = int(eval(input()))\nans = (a + b) * h / 2\nprint((int(ans)))\n", "measured_slow_code_sha256": "89a2c802763da09caab2310090bce1a3bd8e29ef5b06b86a35dfdaa7e9205bfe", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 16.54608387574181, "pair_id": "python_v2_7952fe6d60ed52779d9ea837", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03997", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03997_fe7afb47e68a41016ca3dd9d37a718d585b4472d520f285fd602feac361ab4b2.jsonl.gz", "inputs": "reproduction/python/inputs/p03997.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03997_89a2c802763da09caab2310090bce1a3bd8e29ef5b06b86a35dfdaa7e9205bfe.jsonl.gz"}, "slow_code": "from collections import deque\nfrom heapq import heapify, heappop, heappush, heappushpop\nfrom copy import copy, deepcopy\nfrom itertools import product, permutations, combinations, combinations_with_replacement\nfrom collections import defaultdict, Counter\nfrom bisect import bisect_left, bisect_right\n\n\nfrom functools import reduce\nfrom pprint import pprint\n\nINF = float(\"inf\")\n\n\ndef myinput():\n return list(map(int, input().split()))\n\n\ndef mylistinput(n):\n return [list(myinput()) for _ in range(n)]\n\n\ndef mycol(data, col):\n return [row[col] for row in data]\n\n\ndef mysort(data, col, reverse_flag):\n data.sort(key=lambda x: x[col], reverse=reverse_flag)\n return data\n\n\ndef mymax(data):\n M = -1 * float(\"inf\")\n for i in range(len(data)):\n m = max(data[i])\n M = max(M, m)\n return M\n\n\ndef mymin(data):\n m = float(\"inf\")\n for i in range(len(data)):\n M = min(data[i])\n m = min(m, M)\n return m\n\n\ndef mycount(ls, x):\n\n l = bisect_left(ls, x)\n r = bisect_right(ls, x)\n return r - l\n\n\ndef myoutput(ls, space=True):\n if space:\n if len(ls) == 0:\n print(\" \")\n elif type(ls[0]) == str:\n print((\" \".join(ls)))\n elif type(ls[0]) == int:\n print((\" \".join(map(str, ls))))\n else:\n print(\"Output Error\")\n else:\n if len(ls) == 0:\n print(\"\")\n elif type(ls[0]) == str:\n print((\"\".join(ls)))\n elif type(ls[0]) == int:\n print((\"\".join(map(str, ls))))\n else:\n print(\"Output Error\")\n\n\na = int(eval(input()))\nb = int(eval(input()))\nh = int(eval(input()))\nans = (a + b) * h / 2\nprint((int(ans)))\n", "slow_code_sha256": "b35e7a11385fd8d3cfedbd5906973a53bac70684dd98a901c660194c6fcfc1db", "slow_id": "p03997_89a2c802763da09caab2310090bce1a3bd8e29ef5b06b86a35dfdaa7e9205bfe", "speedup": 16.515085624995738, "stratum": "8+", "within_pair_jaccard": 0.09523809523809523, "workload": {"case_count": 100, "description": "Compute the area of a trapezoid with integer bases a and b and even integer height h. Observed inputs: a=1..100; b=1..100; h=2..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 12, "median": 9.0, "min": 6}, "input_format": ["a\nb\nh"], "input_format_status": "source_input_section", "input_lines": {"max": 3, "median": 3.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3, "median": 3.0, "min": 3}}} -{"case_ids": ["p03558_case_000", "p03558_case_001", "p03558_case_002", "p03558_case_003", "p03558_case_004", "p03558_case_005", "p03558_case_006", "p03558_case_007", "p03558_case_008", "p03558_case_009", "p03558_case_010", "p03558_case_011", "p03558_case_012", "p03558_case_013", "p03558_case_014", "p03558_case_015", "p03558_case_016", "p03558_case_017", "p03558_case_018", "p03558_case_019", "p03558_case_020", "p03558_case_021", "p03558_case_022", "p03558_case_023", "p03558_case_024", "p03558_case_025", "p03558_case_026", "p03558_case_027", "p03558_case_028", "p03558_case_029", "p03558_case_030", "p03558_case_031", "p03558_case_032", "p03558_case_033", "p03558_case_034", "p03558_case_035", "p03558_case_036", "p03558_case_037", "p03558_case_038", "p03558_case_039", "p03558_case_040", "p03558_case_041", "p03558_case_042", "p03558_case_043", "p03558_case_044", "p03558_case_045", "p03558_case_046", "p03558_case_047", "p03558_case_048", "p03558_case_049", "p03558_case_050", "p03558_case_051", "p03558_case_052", "p03558_case_053", "p03558_case_054", "p03558_case_055", "p03558_case_056", "p03558_case_057", "p03558_case_058", "p03558_case_059", "p03558_case_060", "p03558_case_061", "p03558_case_062", "p03558_case_063", "p03558_case_064", "p03558_case_065", "p03558_case_066", "p03558_case_067", "p03558_case_068", "p03558_case_069", "p03558_case_070", "p03558_case_071", "p03558_case_072", "p03558_case_073", "p03558_case_074", "p03558_case_075", "p03558_case_076", "p03558_case_077", "p03558_case_078", "p03558_case_079", "p03558_case_080", "p03558_case_081", "p03558_case_082", "p03558_case_083", "p03558_case_084", "p03558_case_085", "p03558_case_086", "p03558_case_087", "p03558_case_088", "p03558_case_089", "p03558_case_090", "p03558_case_091", "p03558_case_092", "p03558_case_093", "p03558_case_094", "p03558_case_095", "p03558_case_096", "p03558_case_097", "p03558_case_098", "p03558_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from collections import deque\n\n\ndef solve(K):\n checked = [99999999999] * (K + 1)\n queue = deque()\n queue.append((1, 1))\n checked[1] = 1\n while queue:\n x, n = queue.popleft()\n if x == 0:\n return n\n _ = (x * 10) % K\n if n < checked[_]:\n queue.appendleft((_, n))\n checked[_] = n\n _ = (x + 1) % K\n if n + 1 < checked[_]:\n queue.append((_, n + 1))\n checked[_] = n + 1\n return None\n\n\nK = int(eval(input()))\nprint((solve(K)))\n", "fast_code_sha256": "bade334d850baa79c30c63b127211354a56f0a74387511e74bb04b26a2ac47b2", "fast_id": "p03558_bade334d850baa79c30c63b127211354a56f0a74387511e74bb04b26a2ac47b2", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from collections import deque\n\n\ndef solve(K):\n checked = [99999999999] * (K + 1)\n queue = deque()\n queue.append((1, 1))\n checked[1] = 1\n while queue:\n x, n = queue.popleft()\n if x == 0:\n return n\n _ = (x * 10) % K\n if n < checked[_]:\n queue.appendleft((_, n))\n checked[_] = n\n _ = (x + 1) % K\n if n + 1 < checked[_]:\n queue.append((_, n + 1))\n checked[_] = n + 1\n return None\n\n\nK = int(eval(input()))\nprint((solve(K)))\n", "measured_fast_code_sha256": "bade334d850baa79c30c63b127211354a56f0a74387511e74bb04b26a2ac47b2", "measured_slow_code": "#!/usr/bin/env python3\nfrom collections import deque\n\nINF = 10**9\nk = int(eval(input()))\n# (辺の伸びる先, コスト)\nG = [((10 * i % k, 0), ((i + 1) % k, 1)) for i in range(k)]\ns = 1\n# 01 - BFS\ndist = [INF] * k\nS = deque([s])\nT = deque()\ndist[s] = 0\nd = 0\nwhile S:\n while S:\n v = S.popleft()\n for w, c in G[v]:\n if d + c < dist[w]:\n dist[w] = d + c\n if c:\n T.append(w)\n else:\n S.append(w)\n S, T = T, S\n d += 1\nprint((dist[0] + 1))\n", "measured_slow_code_sha256": "a6ab1e7b677625266935289606a7abd16dc62e68b6da222665ed94a9d754971b", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.893600493083114, "pair_id": "python_v2_fe54feeeab6bd55bb9c54411", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03558", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03558_bade334d850baa79c30c63b127211354a56f0a74387511e74bb04b26a2ac47b2.jsonl.gz", "inputs": "reproduction/python/inputs/p03558.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03558_a6ab1e7b677625266935289606a7abd16dc62e68b6da222665ed94a9d754971b.jsonl.gz"}, "slow_code": "from collections import deque\n\nINF = 10**9\nk = int(eval(input()))\n\nG = [((10 * i % k, 0), ((i + 1) % k, 1)) for i in range(k)]\ns = 1\n\ndist = [INF] * k\nS = deque([s])\nT = deque()\ndist[s] = 0\nd = 0\nwhile S:\n while S:\n v = S.popleft()\n for w, c in G[v]:\n if d + c < dist[w]:\n dist[w] = d + c\n if c:\n T.append(w)\n else:\n S.append(w)\n S, T = T, S\n d += 1\nprint((dist[0] + 1))\n", "slow_code_sha256": "6f4ff4c6772818e0e2780e53df6176c3d102137c5941272af3d3b78fead790fc", "slow_id": "p03558_a6ab1e7b677625266935289606a7abd16dc62e68b6da222665ed94a9d754971b", "speedup": 3.9598596737148304, "stratum": "2-4", "within_pair_jaccard": 0.3409090909090909, "workload": {"case_count": 100, "description": "Find the smallest decimal digit sum among all positive integer multiples of K. Observed inputs: K=2..100000 (median 10205.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 7, "median": 5.5, "min": 2}, "input_format": ["K"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p02934_case_000", "p02934_case_001", "p02934_case_002", "p02934_case_003", "p02934_case_004", "p02934_case_005", "p02934_case_006", "p02934_case_007", "p02934_case_008", "p02934_case_009", "p02934_case_010", "p02934_case_011", "p02934_case_012", "p02934_case_013", "p02934_case_014", "p02934_case_015", "p02934_case_016", "p02934_case_017", "p02934_case_018", "p02934_case_019", "p02934_case_020", "p02934_case_021", "p02934_case_022", "p02934_case_023", "p02934_case_024", "p02934_case_025", "p02934_case_026", "p02934_case_027", "p02934_case_028", "p02934_case_029", "p02934_case_030", "p02934_case_031", "p02934_case_032", "p02934_case_033", "p02934_case_034", "p02934_case_035", "p02934_case_036", "p02934_case_037", "p02934_case_038", "p02934_case_039", "p02934_case_040", "p02934_case_041", "p02934_case_042", "p02934_case_043", "p02934_case_044", "p02934_case_045", "p02934_case_046", "p02934_case_047", "p02934_case_048", "p02934_case_049", "p02934_case_050", "p02934_case_051", "p02934_case_052", "p02934_case_053", "p02934_case_054", "p02934_case_055", "p02934_case_056", "p02934_case_057", "p02934_case_058", "p02934_case_059", "p02934_case_060", "p02934_case_061", "p02934_case_062", "p02934_case_063", "p02934_case_064", "p02934_case_065", "p02934_case_066", "p02934_case_067", "p02934_case_068", "p02934_case_069", "p02934_case_070", "p02934_case_071", "p02934_case_072", "p02934_case_073", "p02934_case_074", "p02934_case_075", "p02934_case_076", "p02934_case_077", "p02934_case_078", "p02934_case_079", "p02934_case_080", "p02934_case_081", "p02934_case_082", "p02934_case_083", "p02934_case_084", "p02934_case_085", "p02934_case_086", "p02934_case_087", "p02934_case_088", "p02934_case_089", "p02934_case_090", "p02934_case_091", "p02934_case_092", "p02934_case_093", "p02934_case_094", "p02934_case_095", "p02934_case_096", "p02934_case_097", "p02934_case_098", "p02934_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\na = list(map(int, input().split()))\nt = 0\nfor i in range(n):\n t = t + 1 / a[i]\nans = 1 / t\nprint(ans)\n", "fast_code_sha256": "67612659d343df45b96738503f23033fa5569ad14e1a7341ab06ca1c5e5a8d4e", "fast_id": "p02934_67612659d343df45b96738503f23033fa5569ad14e1a7341ab06ca1c5e5a8d4e", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\na = list(map(int, input().split()))\nt = 0\nfor i in range(n):\n t = t + 1 / a[i]\nans = 1 / t\nprint(ans)\n", "measured_fast_code_sha256": "67612659d343df45b96738503f23033fa5569ad14e1a7341ab06ca1c5e5a8d4e", "measured_slow_code": "import sys\n\ninput = sys.stdin.readline\nsys.setrecursionlimit(10**7)\nimport numpy as np\n\nN = int(eval(input()))\nA = np.array(input().split(), np.int32)\nanswer = 1 / (1 / A).sum()\nprint(answer)\n", "measured_slow_code_sha256": "60cac70fa0810c2893d2009a00d5b734023fa86b7674974a1bd139ed2b0fd20e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 916.2721365364025, "pair_id": "python_v2_6b0c51de16670b9f89987e5b", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02934", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02934_67612659d343df45b96738503f23033fa5569ad14e1a7341ab06ca1c5e5a8d4e.jsonl.gz", "inputs": "reproduction/python/inputs/p02934.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02934_60cac70fa0810c2893d2009a00d5b734023fa86b7674974a1bd139ed2b0fd20e.jsonl.gz"}, "slow_code": "import sys\n\ninput = sys.stdin.readline\nsys.setrecursionlimit(10**7)\nimport numpy as np\n\nN = int(eval(input()))\nA = np.array(input().split(), np.int32)\nanswer = 1 / (1 / A).sum()\nprint(answer)\n", "slow_code_sha256": "60cac70fa0810c2893d2009a00d5b734023fa86b7674974a1bd139ed2b0fd20e", "slow_id": "p02934_60cac70fa0810c2893d2009a00d5b734023fa86b7674974a1bd139ed2b0fd20e", "speedup": 951.9407097414071, "stratum": "8+", "within_pair_jaccard": 0.18181818181818182, "workload": {"case_count": 100, "description": "Compute the reciprocal of the sum of reciprocals of N positive input integers A_i, as a real number. Observed inputs: N=1..100 (median 50); A_i=1..1000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 504, "median": 114.0, "min": 4}, "input_format": ["N\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 101, "median": 51.0, "min": 2}}} -{"case_ids": ["p03598_case_000", "p03598_case_001", "p03598_case_002", "p03598_case_003", "p03598_case_004", "p03598_case_005", "p03598_case_006", "p03598_case_007", "p03598_case_008", "p03598_case_009", "p03598_case_010", "p03598_case_011", "p03598_case_012", "p03598_case_013", "p03598_case_014", "p03598_case_015", "p03598_case_016", "p03598_case_017", "p03598_case_018", "p03598_case_019", "p03598_case_020", "p03598_case_021", "p03598_case_022", "p03598_case_023", "p03598_case_024", "p03598_case_025", "p03598_case_026", "p03598_case_027", "p03598_case_028", "p03598_case_029", "p03598_case_030", "p03598_case_031", "p03598_case_032", "p03598_case_033", "p03598_case_034", "p03598_case_035", "p03598_case_036", "p03598_case_037", "p03598_case_038", "p03598_case_039", "p03598_case_040", "p03598_case_041", "p03598_case_042", "p03598_case_043", "p03598_case_044", "p03598_case_045", "p03598_case_046", "p03598_case_047", "p03598_case_048", "p03598_case_049", "p03598_case_050", "p03598_case_051", "p03598_case_052", "p03598_case_053", "p03598_case_054", "p03598_case_055", "p03598_case_056", "p03598_case_057", "p03598_case_058", "p03598_case_059", "p03598_case_060", "p03598_case_061", "p03598_case_062", "p03598_case_063", "p03598_case_064", "p03598_case_065", "p03598_case_066", "p03598_case_067", "p03598_case_068", "p03598_case_069", "p03598_case_070", "p03598_case_071", "p03598_case_072", "p03598_case_073", "p03598_case_074", "p03598_case_075", "p03598_case_076", "p03598_case_077", "p03598_case_078", "p03598_case_079", "p03598_case_080", "p03598_case_081", "p03598_case_082", "p03598_case_083", "p03598_case_084", "p03598_case_085", "p03598_case_086", "p03598_case_087", "p03598_case_088", "p03598_case_089", "p03598_case_090", "p03598_case_091", "p03598_case_092", "p03598_case_093", "p03598_case_094", "p03598_case_095", "p03598_case_096", "p03598_case_097", "p03598_case_098", "p03598_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n, k = int(eval(input())), int(eval(input()))\nprint((sum([min(i * 2, (k - i) * 2) for i in list(map(int, input().split()))])))\n", "fast_code_sha256": "f222fc533ff8c8f77d6aa872c7a6c1e0efb17146f9a7e556f0f178619b015c36", "fast_id": "p03598_f222fc533ff8c8f77d6aa872c7a6c1e0efb17146f9a7e556f0f178619b015c36", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n, k = int(eval(input())), int(eval(input()))\nprint((sum([min(i * 2, (k - i) * 2) for i in list(map(int, input().split()))])))\n", "measured_fast_code_sha256": "f222fc533ff8c8f77d6aa872c7a6c1e0efb17146f9a7e556f0f178619b015c36", "measured_slow_code": "from collections import Counter, defaultdict, deque\nfrom heapq import heappop, heappush, heapify\nimport sys, bisect, math, itertools, fractions, pprint\n\nsys.setrecursionlimit(10**8)\nmod = 10**9 + 7\nINF = float(\"inf\")\n\n\ndef inp():\n return int(sys.stdin.readline())\n\n\ndef inpl():\n return list(map(int, sys.stdin.readline().split()))\n\n\nn = inp()\nk = inp()\na = inpl()\nres = 0\nfor i, x in enumerate(a):\n res += min(abs(k - x) * 2, x * 2)\nprint(res)\n", "measured_slow_code_sha256": "1b129bb8d189a1d33979630c69207f7fede842e1eae77ef97d34db407621cf30", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 16.390274990923892, "pair_id": "python_v2_ea84a1575145869bc5f8ce15", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03598", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03598_f222fc533ff8c8f77d6aa872c7a6c1e0efb17146f9a7e556f0f178619b015c36.jsonl.gz", "inputs": "reproduction/python/inputs/p03598.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03598_1b129bb8d189a1d33979630c69207f7fede842e1eae77ef97d34db407621cf30.jsonl.gz"}, "slow_code": "from collections import Counter, defaultdict, deque\nfrom heapq import heappop, heappush, heapify\nimport sys, bisect, math, itertools, fractions, pprint\n\nsys.setrecursionlimit(10**8)\nmod = 10**9 + 7\nINF = float(\"inf\")\n\n\ndef inp():\n return int(sys.stdin.readline())\n\n\ndef inpl():\n return list(map(int, sys.stdin.readline().split()))\n\n\nn = inp()\nk = inp()\na = inpl()\nres = 0\nfor i, x in enumerate(a):\n res += min(abs(k - x) * 2, x * 2)\nprint(res)\n", "slow_code_sha256": "1b129bb8d189a1d33979630c69207f7fede842e1eae77ef97d34db407621cf30", "slow_id": "p03598_1b129bb8d189a1d33979630c69207f7fede842e1eae77ef97d34db407621cf30", "speedup": 19.554585397720988, "stratum": "8+", "within_pair_jaccard": 0.23076923076923078, "workload": {"case_count": 100, "description": "For each ball at (x_i,i), choose a robot from (0,i) or (K,i) to collect it and return to that endpoint. Minimize total travel distance over all N balls; every x_i lies strictly between 0 and K. Observed inputs: N=1..100 (median 89); K=2..100 (median 73); x_i=1..99.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 308, "median": 206.0, "min": 6}, "input_format": ["N\nK\nx_1 ... x_N"], "input_format_status": "source_input_section", "input_lines": {"max": 3, "median": 3.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 102, "median": 91.0, "min": 3}}} -{"case_ids": ["p03282_case_000", "p03282_case_001", "p03282_case_002", "p03282_case_003", "p03282_case_004", "p03282_case_005", "p03282_case_006", "p03282_case_007", "p03282_case_008", "p03282_case_009", "p03282_case_010", "p03282_case_011", "p03282_case_012", "p03282_case_013", "p03282_case_014", "p03282_case_015", "p03282_case_016", "p03282_case_017", "p03282_case_018", "p03282_case_019", "p03282_case_020", "p03282_case_021", "p03282_case_022", "p03282_case_023", "p03282_case_024", "p03282_case_025", "p03282_case_026", "p03282_case_027", "p03282_case_028", "p03282_case_029", "p03282_case_030", "p03282_case_031", "p03282_case_032", "p03282_case_033", "p03282_case_034", "p03282_case_035", "p03282_case_036", "p03282_case_037", "p03282_case_038", "p03282_case_039", "p03282_case_040", "p03282_case_041", "p03282_case_042", "p03282_case_043", "p03282_case_044", "p03282_case_045", "p03282_case_046", "p03282_case_047", "p03282_case_048", "p03282_case_049", "p03282_case_050", "p03282_case_051", "p03282_case_052", "p03282_case_053", "p03282_case_054", "p03282_case_055", "p03282_case_056", "p03282_case_057", "p03282_case_058", "p03282_case_059", "p03282_case_060", "p03282_case_061", "p03282_case_062", "p03282_case_063", "p03282_case_064", "p03282_case_065", "p03282_case_066", "p03282_case_067", "p03282_case_068", "p03282_case_069", "p03282_case_070", "p03282_case_071", "p03282_case_072", "p03282_case_073", "p03282_case_074", "p03282_case_075", "p03282_case_076", "p03282_case_077", "p03282_case_078", "p03282_case_079", "p03282_case_080", "p03282_case_081", "p03282_case_082", "p03282_case_083", "p03282_case_084", "p03282_case_085", "p03282_case_086", "p03282_case_087", "p03282_case_088", "p03282_case_089", "p03282_case_090", "p03282_case_091", "p03282_case_092", "p03282_case_093", "p03282_case_094", "p03282_case_095", "p03282_case_096", "p03282_case_097", "p03282_case_098", "p03282_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "s = list(map(str, input().rstrip()))\nk = int(eval(input()))\nans = 1\nfor x in s[:k]:\n if int(x) != 1:\n ans = int(x)\n break\nprint(ans)\n", "fast_code_sha256": "974c092f45b99a7e40bd363191669c3c95a0237f5fb8d45aaff090995d4fe6ec", "fast_id": "p03282_974c092f45b99a7e40bd363191669c3c95a0237f5fb8d45aaff090995d4fe6ec", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "s = list(map(str, input().rstrip()))\nk = int(eval(input()))\nans = 1\nfor x in s[:k]:\n if int(x) != 1:\n ans = int(x)\n break\nprint(ans)\n", "measured_fast_code_sha256": "974c092f45b99a7e40bd363191669c3c95a0237f5fb8d45aaff090995d4fe6ec", "measured_slow_code": "import numpy as np\n\nS = np.array(list(map(str, input().rstrip())))\nK = int(eval(input()))\ncnt = 0\nans = 1\nfor i, s in enumerate(S):\n if s != \"1\":\n cnt = i + 1\n ans = s\n break\nif cnt > K:\n print((1))\nelse:\n print((int(ans)))\n", "measured_slow_code_sha256": "c6afbfabb4f57c620b796822aa793c63e616de41f9eb4e63aa7e8f88e45d1110", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1006.4546837595051, "pair_id": "python_v2_27655c08040057e2e3570889", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03282", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03282_974c092f45b99a7e40bd363191669c3c95a0237f5fb8d45aaff090995d4fe6ec.jsonl.gz", "inputs": "reproduction/python/inputs/p03282.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03282_c6afbfabb4f57c620b796822aa793c63e616de41f9eb4e63aa7e8f88e45d1110.jsonl.gz"}, "slow_code": "import numpy as np\n\nS = np.array(list(map(str, input().rstrip())))\nK = int(eval(input()))\ncnt = 0\nans = 1\nfor i, s in enumerate(S):\n if s != \"1\":\n cnt = i + 1\n ans = s\n break\nif cnt > K:\n print((1))\nelse:\n print((int(ans)))\n", "slow_code_sha256": "c6afbfabb4f57c620b796822aa793c63e616de41f9eb4e63aa7e8f88e45d1110", "slow_id": "p03282_c6afbfabb4f57c620b796822aa793c63e616de41f9eb4e63aa7e8f88e45d1110", "speedup": 969.6232524728181, "stratum": "8+", "within_pair_jaccard": 0.5172413793103449, "workload": {"case_count": 100, "description": "On each day, simultaneously replace digit d by d copies of itself, for digits 1..9. Find the 1-based K-th character after 5*10^15 days starting from S; the expanded string is guaranteed long enough. Observed inputs: S_length=1..100 (median 100); K=1..1000000000000000000; digit=1..9.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 121, "median": 103.0, "min": 4}, "input_format": ["S\nK"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p02709_case_000", "p02709_case_001", "p02709_case_002", "p02709_case_003", "p02709_case_004", "p02709_case_005", "p02709_case_006", "p02709_case_007", "p02709_case_008", "p02709_case_009", "p02709_case_010", "p02709_case_011", "p02709_case_012", "p02709_case_013", "p02709_case_014", "p02709_case_015", "p02709_case_016", "p02709_case_017", "p02709_case_018", "p02709_case_019", "p02709_case_020", "p02709_case_021", "p02709_case_022", "p02709_case_023", "p02709_case_024", "p02709_case_025", "p02709_case_026", "p02709_case_027", "p02709_case_028", "p02709_case_029", "p02709_case_030", "p02709_case_031", "p02709_case_032", "p02709_case_033", "p02709_case_034", "p02709_case_035", "p02709_case_036", "p02709_case_037", "p02709_case_038", "p02709_case_039", "p02709_case_040", "p02709_case_041", "p02709_case_042", "p02709_case_043", "p02709_case_044", "p02709_case_045", "p02709_case_046", "p02709_case_047", "p02709_case_048", "p02709_case_049", "p02709_case_050", "p02709_case_051", "p02709_case_052", "p02709_case_053", "p02709_case_054", "p02709_case_055", "p02709_case_056", "p02709_case_057", "p02709_case_058", "p02709_case_059", "p02709_case_060", "p02709_case_061", "p02709_case_062", "p02709_case_063", "p02709_case_064", "p02709_case_065", "p02709_case_066", "p02709_case_067", "p02709_case_068", "p02709_case_069", "p02709_case_070", "p02709_case_071", "p02709_case_072", "p02709_case_073", "p02709_case_074", "p02709_case_075", "p02709_case_076", "p02709_case_077", "p02709_case_078", "p02709_case_079", "p02709_case_080", "p02709_case_081", "p02709_case_082", "p02709_case_083", "p02709_case_084", "p02709_case_085", "p02709_case_086", "p02709_case_087", "p02709_case_088", "p02709_case_089", "p02709_case_090", "p02709_case_091", "p02709_case_092", "p02709_case_093", "p02709_case_094", "p02709_case_095", "p02709_case_096", "p02709_case_097", "p02709_case_098", "p02709_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N = int(eval(input()))\nD = []\nfor i, a in enumerate(map(int, input().split())):\n D.append((a << 11) + i)\nD.sort(reverse=True)\ndp = [0] * (N + 1)\nfor i, d in enumerate(D, start=1):\n x, a = d % (1 << 11), d >> 11\n for j in reversed(list(range(0, i + 1))):\n dp[j] = max(\n (dp[j - 1] + a * (x - (j - 1))) * (j - 1 >= 0),\n (dp[j] + a * (N - (i - j) - x)) * (j <= i - 1),\n )\nprint((max(dp)))\n", "fast_code_sha256": "7036b1338b05c45feb569394cc5f3c4ece7b1ae9595ac7db105a43381e049624", "fast_id": "p02709_7036b1338b05c45feb569394cc5f3c4ece7b1ae9595ac7db105a43381e049624", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N = int(eval(input()))\nD = []\nfor i, a in enumerate(map(int, input().split())):\n D.append((a << 11) + i)\nD.sort(reverse=True)\ndp = [0] * (N + 1)\nfor i, d in enumerate(D, start=1):\n x, a = d % (1 << 11), d >> 11\n for j in reversed(list(range(0, i + 1))):\n dp[j] = max(\n (dp[j - 1] + a * (x - (j - 1))) * (j - 1 >= 0),\n (dp[j] + a * (N - (i - j) - x)) * (j <= i - 1),\n )\nprint((max(dp)))\n", "measured_fast_code_sha256": "7036b1338b05c45feb569394cc5f3c4ece7b1ae9595ac7db105a43381e049624", "measured_slow_code": "import sys\nimport numpy as np\n\n\ndef f(n, a_):\n a = []\n for i, ai in enumerate(a_):\n a.append([1 + i, ai])\n a.sort(key=lambda x: x[1], reverse=True)\n dp = np.zeros(\n (n + 1, n + 1), np.int64\n ) # dp[i,j]:i人目までを配置し終えていて、そのうちj人を右に置いた時の最大値。j<=i\n dp[1, 1] = a[0][1] * (n - a[0][0])\n dp[1, 0] = a[0][1] * (a[0][0] - 1)\n for i in range(2, n + 1): # i人目の幼児。a[i-1]\n dp[i, 0] = dp[i - 1, 0] + a[i - 1][1] * abs(\n (a[i - 1][0] - 1 - (i - 1))\n ) # i人目を左にする。その時左に溜まっているのはi-1人\n dp[i, i] = dp[i - 1, i - 1] + a[i - 1][1] * abs(\n (n - a[i - 1][0] - (i - 1))\n ) # i人目を右にする。その時右に溜まっているのはi-1人\n # i人目を左に\n l = dp[i - 1, 1:i] + [\n a[i - 1][1] * abs((a[i - 1][0] - 1 - j)) for j in range(i - 2, -1, -1)\n ] # j:左に溜まっている人数\n # i人目を右に\n r = dp[i - 1, : i - 1] + [\n a[i - 1][1] * abs((n - a[i - 1][0] - j)) for j in range(i - 1)\n ] # j:右に溜まっている人数\n dp[i, 1:i] = np.maximum(l, r)\n return max(dp[n])\n\n\nif __name__ == \"__main__\":\n input = sys.stdin.readline\n n = int(eval(input()))\n a_ = list(map(int, input().split()))\n print((f(n, a_)))\n", "measured_slow_code_sha256": "3d838e07742b6038959605af2d3df1f36b7399126fc563b9a2c8f3bce236aaea", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 0.955681225701275, "pair_id": "python_v2_071eb3bf37dcd3d563dde8e9", "per_case_slow_code_faster_fraction": 0.55, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02709", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02709_7036b1338b05c45feb569394cc5f3c4ece7b1ae9595ac7db105a43381e049624.jsonl.gz", "inputs": "reproduction/python/inputs/p02709.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02709_3d838e07742b6038959605af2d3df1f36b7399126fc563b9a2c8f3bce236aaea.jsonl.gz"}, "slow_code": "import sys\nimport numpy as np\n\n\ndef f(n, a_):\n a = []\n for i, ai in enumerate(a_):\n a.append([1 + i, ai])\n a.sort(key=lambda x: x[1], reverse=True)\n dp = np.zeros((n + 1, n + 1), np.int64)\n dp[1, 1] = a[0][1] * (n - a[0][0])\n dp[1, 0] = a[0][1] * (a[0][0] - 1)\n for i in range(2, n + 1):\n dp[i, 0] = dp[i - 1, 0] + a[i - 1][1] * abs((a[i - 1][0] - 1 - (i - 1)))\n dp[i, i] = dp[i - 1, i - 1] + a[i - 1][1] * abs((n - a[i - 1][0] - (i - 1)))\n\n l = dp[i - 1, 1:i] + [\n a[i - 1][1] * abs((a[i - 1][0] - 1 - j)) for j in range(i - 2, -1, -1)\n ]\n\n r = dp[i - 1, : i - 1] + [\n a[i - 1][1] * abs((n - a[i - 1][0] - j)) for j in range(i - 1)\n ]\n dp[i, 1:i] = np.maximum(l, r)\n return max(dp[n])\n\n\nif __name__ == \"__main__\":\n input = sys.stdin.readline\n n = int(eval(input()))\n a_ = list(map(int, input().split()))\n print((f(n, a_)))\n", "slow_code_sha256": "aa98af4784f39634c1b1369b22ff40f05d4ea9461af1aad5cd1db169f1d8c6f4", "slow_id": "p02709_3d838e07742b6038959605af2d3df1f36b7399126fc563b9a2c8f3bce236aaea", "speedup": 9.807294863749936, "stratum": "8+", "within_pair_jaccard": 0.42592592592592593, "workload": {"case_count": 100, "description": "Rearrange N children arbitrarily. Moving the child originally at position x to position y earns A_x*|x-y| happiness. Maximize total happiness. Observed inputs: N=2..2000 (median 1000); A_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 22005, "median": 9885.5, "min": 6}, "input_format": ["N\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2001, "median": 1001.0, "min": 3}}} -{"case_ids": ["p02959_case_000", "p02959_case_001", "p02959_case_002", "p02959_case_003", "p02959_case_004", "p02959_case_005", "p02959_case_006", "p02959_case_007", "p02959_case_008", "p02959_case_009", "p02959_case_010", "p02959_case_011", "p02959_case_012", "p02959_case_013", "p02959_case_014", "p02959_case_015", "p02959_case_016", "p02959_case_017", "p02959_case_018", "p02959_case_019", "p02959_case_020", "p02959_case_021", "p02959_case_022", "p02959_case_023", "p02959_case_024", "p02959_case_025", "p02959_case_026", "p02959_case_027", "p02959_case_028", "p02959_case_029", "p02959_case_030", "p02959_case_031", "p02959_case_032", "p02959_case_033", "p02959_case_034", "p02959_case_035", "p02959_case_036", "p02959_case_037", "p02959_case_038", "p02959_case_039", "p02959_case_040", "p02959_case_041", "p02959_case_042", "p02959_case_043", "p02959_case_044", "p02959_case_045", "p02959_case_046", "p02959_case_047", "p02959_case_048", "p02959_case_049", "p02959_case_050", "p02959_case_051", "p02959_case_052", "p02959_case_053", "p02959_case_054", "p02959_case_055", "p02959_case_056", "p02959_case_057", "p02959_case_058", "p02959_case_059", "p02959_case_060", "p02959_case_061", "p02959_case_062", "p02959_case_063", "p02959_case_064", "p02959_case_065", "p02959_case_066", "p02959_case_067", "p02959_case_068", "p02959_case_069", "p02959_case_070", "p02959_case_071", "p02959_case_072", "p02959_case_073", "p02959_case_074", "p02959_case_075", "p02959_case_076", "p02959_case_077", "p02959_case_078", "p02959_case_079", "p02959_case_080", "p02959_case_081", "p02959_case_082", "p02959_case_083", "p02959_case_084", "p02959_case_085", "p02959_case_086", "p02959_case_087", "p02959_case_088", "p02959_case_089", "p02959_case_090", "p02959_case_091", "p02959_case_092", "p02959_case_093", "p02959_case_094", "p02959_case_095", "p02959_case_096", "p02959_case_097", "p02959_case_098", "p02959_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N = int(eval(input()))\nA = [int(s) for s in input().split()]\nsum_A = sum(A)\nB = [int(s) for s in input().split()]\nfor i in range(N):\n attack1 = A[i] - B[i]\n if attack1 < 0:\n attack2 = A[i + 1] + attack1\n A[i] = 0\n A[i + 1] = attack2 if attack2 >= 0 else 0\n else:\n A[i] = attack1\nprint((sum_A - sum(A)))\n", "fast_code_sha256": "82f20614e848556fd18b708896ea299b5580cbf6fcbcbac45ebe97ffe53b8af1", "fast_id": "p02959_82f20614e848556fd18b708896ea299b5580cbf6fcbcbac45ebe97ffe53b8af1", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N = int(eval(input()))\nA = [int(s) for s in input().split()]\nsum_A = sum(A)\nB = [int(s) for s in input().split()]\nfor i in range(N):\n attack1 = A[i] - B[i]\n if attack1 < 0:\n attack2 = A[i + 1] + attack1\n A[i] = 0\n A[i + 1] = attack2 if attack2 >= 0 else 0\n else:\n A[i] = attack1\nprint((sum_A - sum(A)))\n", "measured_fast_code_sha256": "82f20614e848556fd18b708896ea299b5580cbf6fcbcbac45ebe97ffe53b8af1", "measured_slow_code": "N = int(eval(input()))\nA = list(map(int, input().split()))\nB = list(map(int, input().split()))\nans = 0\nfor i in range(N):\n if i % 2 == 0:\n if A[i // 2] >= B[i // 2]:\n A[i // 2] -= B[i // 2]\n ans += B[i // 2]\n B[i // 2] = 0\n else:\n B[i // 2] -= A[i // 2]\n ans += A[i // 2]\n A[i // 2] = 0\n if A[i // 2 + 1] >= B[i // 2]:\n A[i // 2 + 1] -= B[i // 2]\n ans += B[i // 2]\n B[i // 2] = 0\n else:\n B[i // 2] -= A[i // 2 + 1]\n ans += A[i // 2 + 1]\n A[i // 2 + 1] = 0\n else:\n if A[N - i // 2] >= B[N - i // 2 - 1]:\n A[N - i // 2] -= B[N - i // 2 - 1]\n ans += B[N - i // 2 - 1]\n B[N - i // 2 - 1] = 0\n else:\n B[N - i // 2 - 1] -= A[N - i // 2]\n ans += A[N - i // 2]\n A[N - i // 2] = 0\n if A[N - i // 2 - 1] >= B[N - i // 2 - 1]:\n A[N - i // 2 - 1] -= B[N - i // 2 - 1]\n ans += B[N - i // 2 - 1]\n B[N - i // 2 - 1] = 0\n else:\n B[N - i // 2 - 1] -= A[N - i // 2 - 1]\n ans += A[N - i // 2 - 1]\n A[N - i // 2 - 1] = 0\nprint(ans)\n", "measured_slow_code_sha256": "f0395674e51675bd438b96a7f18fa9739566f756efa1ea79ea087d0b83a10e1f", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.3102667948465982, "pair_id": "python_v2_82fbfe3e5d4f33bd3968ad9b", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02959", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02959_82f20614e848556fd18b708896ea299b5580cbf6fcbcbac45ebe97ffe53b8af1.jsonl.gz", "inputs": "reproduction/python/inputs/p02959.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02959_f0395674e51675bd438b96a7f18fa9739566f756efa1ea79ea087d0b83a10e1f.jsonl.gz"}, "slow_code": "N = int(eval(input()))\nA = list(map(int, input().split()))\nB = list(map(int, input().split()))\nans = 0\nfor i in range(N):\n if i % 2 == 0:\n if A[i // 2] >= B[i // 2]:\n A[i // 2] -= B[i // 2]\n ans += B[i // 2]\n B[i // 2] = 0\n else:\n B[i // 2] -= A[i // 2]\n ans += A[i // 2]\n A[i // 2] = 0\n if A[i // 2 + 1] >= B[i // 2]:\n A[i // 2 + 1] -= B[i // 2]\n ans += B[i // 2]\n B[i // 2] = 0\n else:\n B[i // 2] -= A[i // 2 + 1]\n ans += A[i // 2 + 1]\n A[i // 2 + 1] = 0\n else:\n if A[N - i // 2] >= B[N - i // 2 - 1]:\n A[N - i // 2] -= B[N - i // 2 - 1]\n ans += B[N - i // 2 - 1]\n B[N - i // 2 - 1] = 0\n else:\n B[N - i // 2 - 1] -= A[N - i // 2]\n ans += A[N - i // 2]\n A[N - i // 2] = 0\n if A[N - i // 2 - 1] >= B[N - i // 2 - 1]:\n A[N - i // 2 - 1] -= B[N - i // 2 - 1]\n ans += B[N - i // 2 - 1]\n B[N - i // 2 - 1] = 0\n else:\n B[N - i // 2 - 1] -= A[N - i // 2 - 1]\n ans += A[N - i // 2 - 1]\n A[N - i // 2 - 1] = 0\nprint(ans)\n", "slow_code_sha256": "f0395674e51675bd438b96a7f18fa9739566f756efa1ea79ea087d0b83a10e1f", "slow_id": "p02959_f0395674e51675bd438b96a7f18fa9739566f756efa1ea79ea087d0b83a10e1f", "speedup": 2.470542748610928, "stratum": "2-4", "within_pair_jaccard": 0.6, "workload": {"case_count": 100, "description": "N+1 towns hold A_i monsters. Hero i may defeat at most B_i monsters in total, split between towns i and i+1. Maximize the number defeated by all N cooperating heroes. Observed inputs: N=1..100000 (median 5500); A_i=1..1000000000; B_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 2200018, "median": 70232.0, "min": 8}, "input_format": ["N\nA_1 ... A_(N+1)\nB_1 ... B_N"], "input_format_status": "source_input_section", "input_lines": {"max": 3, "median": 3.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200002, "median": 11002.0, "min": 4}}} -{"case_ids": ["p03147_case_000", "p03147_case_001", "p03147_case_002", "p03147_case_003", "p03147_case_004", "p03147_case_005", "p03147_case_006", "p03147_case_007", "p03147_case_008", "p03147_case_009", "p03147_case_010", "p03147_case_011", "p03147_case_012", "p03147_case_013", "p03147_case_014", "p03147_case_015", "p03147_case_016", "p03147_case_017", "p03147_case_018", "p03147_case_019", "p03147_case_020", "p03147_case_021", "p03147_case_022", "p03147_case_023", "p03147_case_024", "p03147_case_025", "p03147_case_026", "p03147_case_027", "p03147_case_028", "p03147_case_029", "p03147_case_030", "p03147_case_031", "p03147_case_032", "p03147_case_033", "p03147_case_034", "p03147_case_035", "p03147_case_036", "p03147_case_037", "p03147_case_038", "p03147_case_039", "p03147_case_040", "p03147_case_041", "p03147_case_042", "p03147_case_043", "p03147_case_044", "p03147_case_045", "p03147_case_046", "p03147_case_047", "p03147_case_048", "p03147_case_049", "p03147_case_050", "p03147_case_051", "p03147_case_052", "p03147_case_053", "p03147_case_054", "p03147_case_055", "p03147_case_056", "p03147_case_057", "p03147_case_058", "p03147_case_059", "p03147_case_060", "p03147_case_061", "p03147_case_062", "p03147_case_063", "p03147_case_064", "p03147_case_065", "p03147_case_066", "p03147_case_067", "p03147_case_068", "p03147_case_069", "p03147_case_070", "p03147_case_071", "p03147_case_072", "p03147_case_073", "p03147_case_074", "p03147_case_075", "p03147_case_076", "p03147_case_077", "p03147_case_078", "p03147_case_079", "p03147_case_080", "p03147_case_081", "p03147_case_082", "p03147_case_083", "p03147_case_084", "p03147_case_085", "p03147_case_086", "p03147_case_087", "p03147_case_088", "p03147_case_089", "p03147_case_090", "p03147_case_091", "p03147_case_092", "p03147_case_093", "p03147_case_094", "p03147_case_095", "p03147_case_096", "p03147_case_097", "p03147_case_098", "p03147_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef resolve():\n n = int(eval(input()))\n l = list(map(int, input().split()))\n ans = l[0]\n\n for i in range(len(l) - 1):\n ans += max(l[i + 1] - l[i], 0)\n print(ans)\n\n\nresolve()\n", "fast_code_sha256": "6cf0fbae01df2d11f5ea1421c4f7d2610272c73db432d3cccb91a30ba12264af", "fast_id": "p03147_7e8bf1c73619f52a92f199219e4ce04b3d4dd877ffbb5a7d41f0473776c1a7ae", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef resolve():\n n = int(eval(input()))\n l = list(map(int, input().split()))\n ans = l[0]\n # 数列の値が増えてたらその分を追加で足す必要がある\n # 減ってたら前の花を育ててる途中で水やり完了してる\n for i in range(len(l) - 1):\n ans += max(l[i + 1] - l[i], 0)\n print(ans)\n\n\nresolve()\n", "measured_fast_code_sha256": "7e8bf1c73619f52a92f199219e4ce04b3d4dd877ffbb5a7d41f0473776c1a7ae", "measured_slow_code": "# from math import factorial,sqrt,ceil,gcd\n# from itertools import permutations as permus\n# from collections import deque,Counter\n# import re\n# from functools import lru_cache # 簡単メモ化 @lru_cache(maxsize=1000)\n# from decimal import Decimal, getcontext\n# # getcontext().prec = 1000\n# # eps = Decimal(10) ** (-100)\nimport numpy as np\n\n# import networkx as nx\n# from scipy.sparse.csgraph import shortest_path, dijkstra, floyd_warshall, bellman_ford, johnson\n# from scipy.sparse import csr_matrix\n# from scipy.special import comb\n# slist = \"abcdefghijklmnopqrstuvwxyz\"\nN = int(eval(input()))\narrA = list(map(int, input().split()))\n# ゼロでリストを分割する\n# def split_list(st):\n# lis = st.split(\"0\")\n# lis = [l for l in lis if l != \"\"]\n# return lis\ndef split_list(lis, num=0):\n res = []\n tmp = []\n for i in lis:\n if i != num:\n tmp.append(i)\n elif i == num and len(tmp) > 0:\n res.append(tmp)\n tmp = []\n else:\n continue\n else:\n res.append(tmp)\n res = [l for l in res if len(l) != 0]\n return res\n\n\nstack = split_list(arrA)\nans = 0\n# リスト毎に処理.len0は処理しない。\nwhile len(stack) > 0:\n lis1 = stack.pop()\n arr = np.array(list(map(int, list(lis1))))\n # 最小値を引いたリストにする。最小値をansに加算\n nmin = min(arr)\n ans += nmin\n arr = arr - nmin\n s = list(arr)\n lis2 = split_list(s)\n stack = stack + lis2\nprint(ans)\n# print(*ans) # unpackして出力。間にスペースが入る\n# for row in board:\n# print(*row,sep=\"\") #unpackして間にスペース入れずに出力する\n# print(\"{:.10f}\".format(ans))\n# print(\"{:0=10d}\".format(ans))\n", "measured_slow_code_sha256": "47a3646cbef4cdc6d777ff253127885ae7b10f34cd8d4fef647dd4916f5b32c1", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 626.1850102026938, "pair_id": "python_v2_a48d21bede554b11d2256dd1", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03147", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03147_7e8bf1c73619f52a92f199219e4ce04b3d4dd877ffbb5a7d41f0473776c1a7ae.jsonl.gz", "inputs": "reproduction/python/inputs/p03147.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03147_47a3646cbef4cdc6d777ff253127885ae7b10f34cd8d4fef647dd4916f5b32c1.jsonl.gz"}, "slow_code": "import numpy as np\n\n\nN = int(eval(input()))\narrA = list(map(int, input().split()))\n\n\ndef split_list(lis, num=0):\n res = []\n tmp = []\n for i in lis:\n if i != num:\n tmp.append(i)\n elif i == num and len(tmp) > 0:\n res.append(tmp)\n tmp = []\n else:\n continue\n else:\n res.append(tmp)\n res = [l for l in res if len(l) != 0]\n return res\n\n\nstack = split_list(arrA)\nans = 0\n\nwhile len(stack) > 0:\n lis1 = stack.pop()\n arr = np.array(list(map(int, list(lis1))))\n\n nmin = min(arr)\n ans += nmin\n arr = arr - nmin\n s = list(arr)\n lis2 = split_list(s)\n stack = stack + lis2\nprint(ans)\n", "slow_code_sha256": "2ca3826e95bb705eb346cc2325420f54f12d09da747118c657639adcec905d81", "slow_id": "p03147_47a3646cbef4cdc6d777ff253127885ae7b10f34cd8d4fef647dd4916f5b32c1", "speedup": 636.6535252865845, "stratum": "8+", "within_pair_jaccard": 0.3269230769230769, "workload": {"case_count": 100, "description": "N flower heights start at zero. One operation increments every height in a chosen contiguous interval by 1. Minimize operations to obtain exactly the target heights h_i. Observed inputs: N=1..100 (median 50); h_i=0..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 404, "median": 137.0, "min": 4}, "input_format": ["N\nh_1 ... h_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 101, "median": 51.0, "min": 2}}} -{"case_ids": ["p03037_case_000", "p03037_case_001", "p03037_case_002", "p03037_case_003", "p03037_case_004", "p03037_case_005", "p03037_case_006", "p03037_case_007", "p03037_case_008", "p03037_case_009", "p03037_case_010", "p03037_case_011", "p03037_case_012", "p03037_case_013", "p03037_case_014", "p03037_case_015", "p03037_case_016", "p03037_case_017", "p03037_case_018", "p03037_case_019", "p03037_case_020", "p03037_case_021", "p03037_case_022", "p03037_case_023", "p03037_case_024", "p03037_case_025", "p03037_case_026", "p03037_case_027", "p03037_case_028", "p03037_case_029", "p03037_case_030", "p03037_case_031", "p03037_case_032", "p03037_case_033", "p03037_case_034", "p03037_case_035", "p03037_case_036", "p03037_case_037", "p03037_case_038", "p03037_case_039", "p03037_case_040", "p03037_case_041", "p03037_case_042", "p03037_case_043", "p03037_case_044", "p03037_case_045", "p03037_case_046", "p03037_case_047", "p03037_case_048", "p03037_case_049", "p03037_case_050", "p03037_case_051", "p03037_case_052", "p03037_case_053", "p03037_case_054", "p03037_case_055", "p03037_case_056", "p03037_case_057", "p03037_case_058", "p03037_case_059", "p03037_case_060", "p03037_case_061", "p03037_case_062", "p03037_case_063", "p03037_case_064", "p03037_case_065", "p03037_case_066", "p03037_case_067", "p03037_case_068", "p03037_case_069", "p03037_case_070", "p03037_case_071", "p03037_case_072", "p03037_case_073", "p03037_case_074", "p03037_case_075", "p03037_case_076", "p03037_case_077", "p03037_case_078", "p03037_case_079", "p03037_case_080", "p03037_case_081", "p03037_case_082", "p03037_case_083", "p03037_case_084", "p03037_case_085", "p03037_case_086", "p03037_case_087", "p03037_case_088", "p03037_case_089", "p03037_case_090", "p03037_case_091", "p03037_case_092", "p03037_case_093", "p03037_case_094", "p03037_case_095", "p03037_case_096", "p03037_case_097", "p03037_case_098", "p03037_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N, M = list(map(int, input().split()))\nL = []\nR = []\nfor _ in range(M):\n l, r = list(map(int, input().split()))\n L.append(l)\n R.append(r)\nl = max(L)\nr = min(R)\nprint((r - l + 1 if r - l + 1 > 0 else 0))\n", "fast_code_sha256": "3bc7c1cecb87327fd4ac660aaf5663746ea0be91c65dddcf6a2f1f6099537e7a", "fast_id": "p03037_3bc7c1cecb87327fd4ac660aaf5663746ea0be91c65dddcf6a2f1f6099537e7a", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N, M = list(map(int, input().split()))\nL = []\nR = []\nfor _ in range(M):\n l, r = list(map(int, input().split()))\n L.append(l)\n R.append(r)\nl = max(L)\nr = min(R)\nprint((r - l + 1 if r - l + 1 > 0 else 0))\n", "measured_fast_code_sha256": "3bc7c1cecb87327fd4ac660aaf5663746ea0be91c65dddcf6a2f1f6099537e7a", "measured_slow_code": "import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, queue, copy\n\nsys.setrecursionlimit(10**7)\ninf = 10**20\nmod = 10**9 + 7\ndd = [(-1, 0), (0, 1), (1, 0), (0, -1)]\nddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef LI_():\n return [int(x) - 1 for x in sys.stdin.readline().split()]\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LS():\n return sys.stdin.readline().split()\n\n\ndef S():\n return eval(input())\n\n\ndef main():\n n, k = LI()\n l = [0] * (n + 1)\n for _ in range(k):\n a, b = LI()\n l[a - 1] += 1\n l[b] -= 1\n for i in range(n - 1):\n l[i + 1] += l[i]\n ans = 0\n for x in l[:-1]:\n if x == k:\n ans += 1\n return ans\n\n\nprint((main()))\n", "measured_slow_code_sha256": "603682b2a1acebd824f0081d6dbfdc82575d41c2aa8f541e6ca8387c5cde8833", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.0319514149722053, "pair_id": "python_v2_29b203792296c55e9ca04cf7", "per_case_slow_code_faster_fraction": 0.43, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03037", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03037_3bc7c1cecb87327fd4ac660aaf5663746ea0be91c65dddcf6a2f1f6099537e7a.jsonl.gz", "inputs": "reproduction/python/inputs/p03037.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03037_603682b2a1acebd824f0081d6dbfdc82575d41c2aa8f541e6ca8387c5cde8833.jsonl.gz"}, "slow_code": "import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, queue, copy\n\nsys.setrecursionlimit(10**7)\ninf = 10**20\nmod = 10**9 + 7\ndd = [(-1, 0), (0, 1), (1, 0), (0, -1)]\nddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef LI_():\n return [int(x) - 1 for x in sys.stdin.readline().split()]\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LS():\n return sys.stdin.readline().split()\n\n\ndef S():\n return eval(input())\n\n\ndef main():\n n, k = LI()\n l = [0] * (n + 1)\n for _ in range(k):\n a, b = LI()\n l[a - 1] += 1\n l[b] -= 1\n for i in range(n - 1):\n l[i + 1] += l[i]\n ans = 0\n for x in l[:-1]:\n if x == k:\n ans += 1\n return ans\n\n\nprint((main()))\n", "slow_code_sha256": "603682b2a1acebd824f0081d6dbfdc82575d41c2aa8f541e6ca8387c5cde8833", "slow_id": "p03037_603682b2a1acebd824f0081d6dbfdc82575d41c2aa8f541e6ca8387c5cde8833", "speedup": 5.0255233171969955, "stratum": "4-8", "within_pair_jaccard": 0.18461538461538463, "workload": {"case_count": 100, "description": "There are N numbered access cards and M gates. Gate i accepts card IDs in inclusive interval [L_i,R_i]. Count individual cards that each permit passage through every gate. Observed inputs: N=1..100000 (median 99999); M=1..100000 (median 1000); L_i=1..100000; R_i=1..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1200014, "median": 7912.0, "min": 8}, "input_format": ["N M\nL_1 R_1\n...\nL_M R_M"], "input_format_status": "source_input_section", "input_lines": {"max": 100001, "median": 1001.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200002, "median": 2002.0, "min": 4}}} -{"case_ids": ["p02770_case_000", "p02770_case_001", "p02770_case_002", "p02770_case_003", "p02770_case_004", "p02770_case_005", "p02770_case_006", "p02770_case_007", "p02770_case_008", "p02770_case_009", "p02770_case_010", "p02770_case_011", "p02770_case_012", "p02770_case_013", "p02770_case_014", "p02770_case_015", "p02770_case_016", "p02770_case_017", "p02770_case_018", "p02770_case_019", "p02770_case_020", "p02770_case_021", "p02770_case_022", "p02770_case_023", "p02770_case_024", "p02770_case_025", "p02770_case_026", "p02770_case_027", "p02770_case_028", "p02770_case_029", "p02770_case_030", "p02770_case_031", "p02770_case_032", "p02770_case_033", "p02770_case_034", "p02770_case_035", "p02770_case_036", "p02770_case_037", "p02770_case_038", "p02770_case_039", "p02770_case_040", "p02770_case_041", "p02770_case_042", "p02770_case_043", "p02770_case_044", "p02770_case_045", "p02770_case_046", "p02770_case_047", "p02770_case_048", "p02770_case_049", "p02770_case_050", "p02770_case_051", "p02770_case_052", "p02770_case_053", "p02770_case_054", "p02770_case_055", "p02770_case_056", "p02770_case_057", "p02770_case_058", "p02770_case_059", "p02770_case_060", "p02770_case_061", "p02770_case_062", "p02770_case_063", "p02770_case_064", "p02770_case_065", "p02770_case_066", "p02770_case_067", "p02770_case_068", "p02770_case_069", "p02770_case_070", "p02770_case_071", "p02770_case_072", "p02770_case_073", "p02770_case_074", "p02770_case_075", "p02770_case_076", "p02770_case_077", "p02770_case_078", "p02770_case_079", "p02770_case_080", "p02770_case_081", "p02770_case_082", "p02770_case_083", "p02770_case_084", "p02770_case_085", "p02770_case_086", "p02770_case_087", "p02770_case_088", "p02770_case_089", "p02770_case_090", "p02770_case_091", "p02770_case_092", "p02770_case_093", "p02770_case_094", "p02770_case_095", "p02770_case_096", "p02770_case_097", "p02770_case_098", "p02770_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\nimport math\nfrom bisect import bisect_right as br\nfrom bisect import bisect_left as bl\n\nsys.setrecursionlimit(2147483647)\nfrom heapq import heappush, heappop, heappushpop\nfrom collections import defaultdict\nfrom itertools import accumulate\nfrom collections import Counter\nfrom collections import deque\nfrom operator import itemgetter\nfrom itertools import permutations\n\nmod = 10**9 + 7\ninf = float(\"inf\")\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\nk, q = LI()\nd = LI()\nnxm = [LI() for _ in range(q)]\nfor n, x, m in nxm:\n e = list([(x - 1) % m + 1 for x in d])\n s = sum(e) * ((n - 1) // k) + sum(e[: (n - 1) % k])\n tmp = (s + x) // m - x // m\n print((n - 1 - tmp))\n", "fast_code_sha256": "3f59f403ae0b4cdcca970331b3c85584a86a57f641ec14c25a13ff864055d6a4", "fast_id": "p02770_b991ebb2290a4da6799a6daa285447de9aca5c37bf998182108cf90af4f99293", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "#!/usr/bin/env python3\nimport sys\nimport math\nfrom bisect import bisect_right as br\nfrom bisect import bisect_left as bl\n\nsys.setrecursionlimit(2147483647)\nfrom heapq import heappush, heappop, heappushpop\nfrom collections import defaultdict\nfrom itertools import accumulate\nfrom collections import Counter\nfrom collections import deque\nfrom operator import itemgetter\nfrom itertools import permutations\n\nmod = 10**9 + 7\ninf = float(\"inf\")\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\nk, q = LI()\nd = LI()\nnxm = [LI() for _ in range(q)]\nfor n, x, m in nxm:\n e = list([(x - 1) % m + 1 for x in d])\n s = sum(e) * ((n - 1) // k) + sum(e[: (n - 1) % k])\n tmp = (s + x) // m - x // m\n print((n - 1 - tmp))\n", "measured_fast_code_sha256": "b991ebb2290a4da6799a6daa285447de9aca5c37bf998182108cf90af4f99293", "measured_slow_code": "import numpy as np\n\nk, q = list(map(int, input().split()))\nd = np.array(list(map(int, input().split())), dtype=np.int64)\nqueries = [tuple(map(int, input().split())) for _ in range(q)]\nfor n, x, m in queries:\n d_mod = d % m\n rem_d_mod = d_mod[: (n - 1) % k]\n print(\n (\n n\n - 1\n - (x % m + ((n - 1) // k) * np.sum(d_mod) + np.sum(rem_d_mod)) // m\n - ((n - 1) // k) * np.count_nonzero(d_mod == 0)\n - np.count_nonzero(rem_d_mod == 0)\n )\n )\n", "measured_slow_code_sha256": "c3f6bab4a2af4b35e38d9d72355721dc97f2ca2c80f07b4cb113b6f10727002a", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 0.6153247904884234, "pair_id": "python_v2_89e61bf3f32b4a156888365b", "per_case_slow_code_faster_fraction": 0.53, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02770", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02770_b991ebb2290a4da6799a6daa285447de9aca5c37bf998182108cf90af4f99293.jsonl.gz", "inputs": "reproduction/python/inputs/p02770.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02770_c3f6bab4a2af4b35e38d9d72355721dc97f2ca2c80f07b4cb113b6f10727002a.jsonl.gz"}, "slow_code": "import numpy as np\n\nk, q = list(map(int, input().split()))\nd = np.array(list(map(int, input().split())), dtype=np.int64)\nqueries = [tuple(map(int, input().split())) for _ in range(q)]\nfor n, x, m in queries:\n d_mod = d % m\n rem_d_mod = d_mod[: (n - 1) % k]\n print(\n (\n n\n - 1\n - (x % m + ((n - 1) // k) * np.sum(d_mod) + np.sum(rem_d_mod)) // m\n - ((n - 1) // k) * np.count_nonzero(d_mod == 0)\n - np.count_nonzero(rem_d_mod == 0)\n )\n )\n", "slow_code_sha256": "c3f6bab4a2af4b35e38d9d72355721dc97f2ca2c80f07b4cb113b6f10727002a", "slow_id": "p02770_c3f6bab4a2af4b35e38d9d72355721dc97f2ca2c80f07b4cb113b6f10727002a", "speedup": 3.7687168785341814, "stratum": "2-4", "within_pair_jaccard": 0.2571428571428571, "workload": {"case_count": 100, "description": "For each query (n,x,m), define a_0=x and a_j=a_(j-1)+d_((j-1) mod k). Count j in 0..n-2 with (a_j mod m)<(a_(j+1) mod m). Only k increments and q queries are listed; expanded sequences are implicit. Observed inputs: k=1..5000 (median 1000); q=1..5000 (median 1000); d_i=0..1000000000; n_i=2..1000000000; x_i=0..1000000000; m_i=2..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 215504, "median": 23899.5, "min": 12}, "input_format": ["k q\nd_0 ... d_(k-1)\nn_1 x_1 m_1\n...\nn_q x_q m_q"], "input_format_status": "source_input_section", "input_lines": {"max": 5002, "median": 1002.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 20002, "median": 4002.0, "min": 6}}} -{"case_ids": ["p03141_case_000", "p03141_case_001", "p03141_case_002", "p03141_case_003", "p03141_case_004", "p03141_case_005", "p03141_case_006", "p03141_case_007", "p03141_case_008", "p03141_case_009", "p03141_case_010", "p03141_case_011", "p03141_case_012", "p03141_case_013", "p03141_case_014", "p03141_case_015", "p03141_case_016", "p03141_case_017", "p03141_case_018", "p03141_case_019", "p03141_case_020", "p03141_case_021", "p03141_case_022", "p03141_case_023", "p03141_case_024", "p03141_case_025", "p03141_case_026", "p03141_case_027", "p03141_case_028", "p03141_case_029", "p03141_case_030", "p03141_case_031", "p03141_case_032", "p03141_case_033", "p03141_case_034", "p03141_case_035", "p03141_case_036", "p03141_case_037", "p03141_case_038", "p03141_case_039", "p03141_case_040", "p03141_case_041", "p03141_case_042", "p03141_case_043", "p03141_case_044", "p03141_case_045", "p03141_case_046", "p03141_case_047", "p03141_case_048", "p03141_case_049", "p03141_case_050", "p03141_case_051", "p03141_case_052", "p03141_case_053", "p03141_case_054", "p03141_case_055", "p03141_case_056", "p03141_case_057", "p03141_case_058", "p03141_case_059", "p03141_case_060", "p03141_case_061", "p03141_case_062", "p03141_case_063", "p03141_case_064", "p03141_case_065", "p03141_case_066", "p03141_case_067", "p03141_case_068", "p03141_case_069", "p03141_case_070", "p03141_case_071", "p03141_case_072", "p03141_case_073", "p03141_case_074", "p03141_case_075", "p03141_case_076", "p03141_case_077", "p03141_case_078", "p03141_case_079", "p03141_case_080", "p03141_case_081", "p03141_case_082", "p03141_case_083", "p03141_case_084", "p03141_case_085", "p03141_case_086", "p03141_case_087", "p03141_case_088", "p03141_case_089", "p03141_case_090", "p03141_case_091", "p03141_case_092", "p03141_case_093", "p03141_case_094", "p03141_case_095", "p03141_case_096", "p03141_case_097", "p03141_case_098", "p03141_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\ne = []\ncurr = 0\nfor _ in range(n):\n a, b = list(map(int, input().split()))\n e.append(a + b)\n curr -= b\ne.sort(reverse=True)\nprint((curr + sum(e[::2])))\n", "fast_code_sha256": "9d2ee05141121455050ba47c5b97e0e97e30bc2b554707db60b644d17f3124cc", "fast_id": "p03141_9d2ee05141121455050ba47c5b97e0e97e30bc2b554707db60b644d17f3124cc", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\ne = []\ncurr = 0\nfor _ in range(n):\n a, b = list(map(int, input().split()))\n e.append(a + b)\n curr -= b\ne.sort(reverse=True)\nprint((curr + sum(e[::2])))\n", "measured_fast_code_sha256": "9d2ee05141121455050ba47c5b97e0e97e30bc2b554707db60b644d17f3124cc", "measured_slow_code": "N = int(eval(input()))\nTakahashi = [None] * N\nAoki = [None] * N\nUsed = [False] * N\nfor i in range(N):\n a, b = list(map(int, input().split()))\n Takahashi[i] = (-a - b, -a, i)\n Aoki[i] = (-b - a, -b, i)\nTakahashi.sort()\nAoki.sort()\nTotalPoint = 0\nusedDish = 0\ntnum, anum = 0, 0\nwhile usedDish < N:\n if usedDish % 2 == 0:\n while Used[Takahashi[tnum][2]]:\n tnum += 1\n TotalPoint -= Takahashi[tnum][1]\n Used[Takahashi[tnum][2]] = True\n usedDish += 1\n else:\n while Used[Aoki[anum][2]]:\n anum += 1\n TotalPoint += Aoki[anum][1]\n Used[Aoki[anum][2]] = True\n usedDish += 1\nprint(TotalPoint)\n", "measured_slow_code_sha256": "b85f5eb3f7e46b36e4f11c0c1981fa76a4fe4f30ce61c8db3e8371e3651bfbe4", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.007274371918193, "pair_id": "python_v2_e2cebeffa8dfff5aa45e8df9", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03141", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03141_9d2ee05141121455050ba47c5b97e0e97e30bc2b554707db60b644d17f3124cc.jsonl.gz", "inputs": "reproduction/python/inputs/p03141.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03141_b85f5eb3f7e46b36e4f11c0c1981fa76a4fe4f30ce61c8db3e8371e3651bfbe4.jsonl.gz"}, "slow_code": "N = int(eval(input()))\nTakahashi = [None] * N\nAoki = [None] * N\nUsed = [False] * N\nfor i in range(N):\n a, b = list(map(int, input().split()))\n Takahashi[i] = (-a - b, -a, i)\n Aoki[i] = (-b - a, -b, i)\nTakahashi.sort()\nAoki.sort()\nTotalPoint = 0\nusedDish = 0\ntnum, anum = 0, 0\nwhile usedDish < N:\n if usedDish % 2 == 0:\n while Used[Takahashi[tnum][2]]:\n tnum += 1\n TotalPoint -= Takahashi[tnum][1]\n Used[Takahashi[tnum][2]] = True\n usedDish += 1\n else:\n while Used[Aoki[anum][2]]:\n anum += 1\n TotalPoint += Aoki[anum][1]\n Used[Aoki[anum][2]] = True\n usedDish += 1\nprint(TotalPoint)\n", "slow_code_sha256": "b85f5eb3f7e46b36e4f11c0c1981fa76a4fe4f30ce61c8db3e8371e3651bfbe4", "slow_id": "p03141_b85f5eb3f7e46b36e4f11c0c1981fa76a4fe4f30ce61c8db3e8371e3651bfbe4", "speedup": 2.049028927267666, "stratum": "2-4", "within_pair_jaccard": 0.42105263157894735, "workload": {"case_count": 100, "description": "Two optimal players alternately choose and consume one remaining dish, starting with the first. Dish i gives the first player A_i happiness or the second B_i. Each maximizes their own final total minus the opponent total. Report first minus second. Observed inputs: N=1..100000 (median 1000); A_i=1..1000000000; B_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 2200007, "median": 19772.0, "min": 6}, "input_format": ["N\nA_1 B_1\n...\nA_N B_N"], "input_format_status": "source_input_section", "input_lines": {"max": 100001, "median": 1001.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200001, "median": 2001.0, "min": 3}}} -{"case_ids": ["p02994_case_000", "p02994_case_001", "p02994_case_002", "p02994_case_003", "p02994_case_004", "p02994_case_005", "p02994_case_006", "p02994_case_007", "p02994_case_008", "p02994_case_009", "p02994_case_010", "p02994_case_011", "p02994_case_012", "p02994_case_013", "p02994_case_014", "p02994_case_015", "p02994_case_016", "p02994_case_017", "p02994_case_018", "p02994_case_019", "p02994_case_020", "p02994_case_021", "p02994_case_022", "p02994_case_023", "p02994_case_024", "p02994_case_025", "p02994_case_026", "p02994_case_027", "p02994_case_028", "p02994_case_029", "p02994_case_030", "p02994_case_031", "p02994_case_032", "p02994_case_033", "p02994_case_034", "p02994_case_035", "p02994_case_036", "p02994_case_037", "p02994_case_038", "p02994_case_039", "p02994_case_040", "p02994_case_041", "p02994_case_042", "p02994_case_043", "p02994_case_044", "p02994_case_045", "p02994_case_046", "p02994_case_047", "p02994_case_048", "p02994_case_049", "p02994_case_050", "p02994_case_051", "p02994_case_052", "p02994_case_053", "p02994_case_054", "p02994_case_055", "p02994_case_056", "p02994_case_057", "p02994_case_058", "p02994_case_059", "p02994_case_060", "p02994_case_061", "p02994_case_062", "p02994_case_063", "p02994_case_064", "p02994_case_065", "p02994_case_066", "p02994_case_067", "p02994_case_068", "p02994_case_069", "p02994_case_070", "p02994_case_071", "p02994_case_072", "p02994_case_073", "p02994_case_074", "p02994_case_075", "p02994_case_076", "p02994_case_077", "p02994_case_078", "p02994_case_079", "p02994_case_080", "p02994_case_081", "p02994_case_082", "p02994_case_083", "p02994_case_084", "p02994_case_085", "p02994_case_086", "p02994_case_087", "p02994_case_088", "p02994_case_089", "p02994_case_090", "p02994_case_091", "p02994_case_092", "p02994_case_093", "p02994_case_094", "p02994_case_095", "p02994_case_096", "p02994_case_097", "p02994_case_098", "p02994_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n, l = list(map(int, input().split()))\npi = 0\na = []\nabs_a = []\nfor i in range(1, n + 1):\n pi += l + i - 1\nfor i in range(1, n + 1):\n a.append(l + i - 1)\nfor i in range(n):\n abs_a.append(abs(a[i]))\nif max(a) < 0:\n p = pi + min(abs_a)\nelse:\n p = pi - min(abs_a)\nprint(p)\n", "fast_code_sha256": "cec14fadeb960da889ac6d8504f301209ff7dd15e0a289e10950ca76f7801062", "fast_id": "p02994_cec14fadeb960da889ac6d8504f301209ff7dd15e0a289e10950ca76f7801062", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n, l = list(map(int, input().split()))\npi = 0\na = []\nabs_a = []\nfor i in range(1, n + 1):\n pi += l + i - 1\nfor i in range(1, n + 1):\n a.append(l + i - 1)\nfor i in range(n):\n abs_a.append(abs(a[i]))\nif max(a) < 0:\n p = pi + min(abs_a)\nelse:\n p = pi - min(abs_a)\nprint(p)\n", "measured_fast_code_sha256": "cec14fadeb960da889ac6d8504f301209ff7dd15e0a289e10950ca76f7801062", "measured_slow_code": "import copy\n\nN, L = list(map(int, input().split()))\nflaver = []\nfor i in range(1, N + 1):\n flaver.append(L + i - 1)\nflaver_sum = sum(flaver)\nfor i in range(len(flaver)):\n c_flaver = copy.deepcopy(flaver)\n del c_flaver[i]\n if i == 0:\n tmp_min = abs(flaver_sum - sum(c_flaver))\n index = i\n if abs(flaver_sum - sum(c_flaver)) < tmp_min:\n tmp_min = abs(flaver_sum - sum(c_flaver))\n index = i\ndel flaver[index]\nprint((sum(flaver)))\n", "measured_slow_code_sha256": "b033c38ec6619d100b0693f703ee7559d8c7c976d73cee1d8a552d7f88a6875e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 46.555655523845786, "pair_id": "python_v2_f3f3901f991886379f8c31e3", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02994", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02994_cec14fadeb960da889ac6d8504f301209ff7dd15e0a289e10950ca76f7801062.jsonl.gz", "inputs": "reproduction/python/inputs/p02994.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02994_b033c38ec6619d100b0693f703ee7559d8c7c976d73cee1d8a552d7f88a6875e.jsonl.gz"}, "slow_code": "import copy\n\nN, L = list(map(int, input().split()))\nflaver = []\nfor i in range(1, N + 1):\n flaver.append(L + i - 1)\nflaver_sum = sum(flaver)\nfor i in range(len(flaver)):\n c_flaver = copy.deepcopy(flaver)\n del c_flaver[i]\n if i == 0:\n tmp_min = abs(flaver_sum - sum(c_flaver))\n index = i\n if abs(flaver_sum - sum(c_flaver)) < tmp_min:\n tmp_min = abs(flaver_sum - sum(c_flaver))\n index = i\ndel flaver[index]\nprint((sum(flaver)))\n", "slow_code_sha256": "b033c38ec6619d100b0693f703ee7559d8c7c976d73cee1d8a552d7f88a6875e", "slow_id": "p02994_b033c38ec6619d100b0693f703ee7559d8c7c976d73cee1d8a552d7f88a6875e", "speedup": 36.191947680772586, "stratum": "8+", "within_pair_jaccard": 0.40540540540540543, "workload": {"case_count": 100, "description": "N apples have flavors L,L+1,...,L+N-1, possibly negative. Remove one apple to minimize the absolute difference between the remaining flavor sum and the original total; output the remaining sum. Observed inputs: N=2..200 (median 100); L=-100..100 (median -14).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 9, "median": 7.0, "min": 4}, "input_format": ["N L"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p03775_case_000", "p03775_case_001", "p03775_case_002", "p03775_case_003", "p03775_case_004", "p03775_case_005", "p03775_case_006", "p03775_case_007", "p03775_case_008", "p03775_case_009", "p03775_case_010", "p03775_case_011", "p03775_case_012", "p03775_case_013", "p03775_case_014", "p03775_case_015", "p03775_case_016", "p03775_case_017", "p03775_case_018", "p03775_case_019", "p03775_case_020", "p03775_case_021", "p03775_case_022", "p03775_case_023", "p03775_case_024", "p03775_case_025", "p03775_case_026", "p03775_case_027", "p03775_case_028", "p03775_case_029", "p03775_case_030", "p03775_case_031", "p03775_case_032", "p03775_case_033", "p03775_case_034", "p03775_case_035", "p03775_case_036", "p03775_case_037", "p03775_case_038", "p03775_case_039", "p03775_case_040", "p03775_case_041", "p03775_case_042", "p03775_case_043", "p03775_case_044", "p03775_case_045", "p03775_case_046", "p03775_case_047", "p03775_case_048", "p03775_case_049", "p03775_case_050", "p03775_case_051", "p03775_case_052", "p03775_case_053", "p03775_case_054", "p03775_case_055", "p03775_case_056", "p03775_case_057", "p03775_case_058", "p03775_case_059", "p03775_case_060", "p03775_case_061", "p03775_case_062", "p03775_case_063", "p03775_case_064", "p03775_case_065", "p03775_case_066", "p03775_case_067", "p03775_case_068", "p03775_case_069", "p03775_case_070", "p03775_case_071", "p03775_case_072", "p03775_case_073", "p03775_case_074", "p03775_case_075", "p03775_case_076", "p03775_case_077", "p03775_case_078", "p03775_case_079", "p03775_case_080", "p03775_case_081", "p03775_case_082", "p03775_case_083", "p03775_case_084", "p03775_case_085", "p03775_case_086", "p03775_case_087", "p03775_case_088", "p03775_case_089", "p03775_case_090", "p03775_case_091", "p03775_case_092", "p03775_case_093", "p03775_case_094", "p03775_case_095", "p03775_case_096", "p03775_case_097", "p03775_case_098", "p03775_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\nif n == 6983776800:\n print((5))\n exit()\n\n\ndef prime_factorize(n):\n a = []\n while n % 2 == 0:\n a.append(2)\n n //= 2\n f = 3\n while f**2 <= n:\n if n % f == 0:\n a.append(f)\n n //= f\n else:\n f += 2\n if n != 1:\n a.append(n)\n return a\n\n\nF = prime_factorize(n)\nA, B = 1, 1\nfor i in F[::-1]:\n if A <= B:\n A *= i\n else:\n B *= i\nprint((max(len(str(A)), len(str(B)))))\n", "fast_code_sha256": "16771a04e6276b491192dc984b7d0363d20dc7ef3d6fad47bf439b11ebe5f507", "fast_id": "p03775_16771a04e6276b491192dc984b7d0363d20dc7ef3d6fad47bf439b11ebe5f507", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\nif n == 6983776800:\n print((5))\n exit()\n\n\ndef prime_factorize(n):\n a = []\n while n % 2 == 0:\n a.append(2)\n n //= 2\n f = 3\n while f**2 <= n:\n if n % f == 0:\n a.append(f)\n n //= f\n else:\n f += 2\n if n != 1:\n a.append(n)\n return a\n\n\nF = prime_factorize(n)\nA, B = 1, 1\nfor i in F[::-1]:\n if A <= B:\n A *= i\n else:\n B *= i\nprint((max(len(str(A)), len(str(B)))))\n", "measured_fast_code_sha256": "16771a04e6276b491192dc984b7d0363d20dc7ef3d6fad47bf439b11ebe5f507", "measured_slow_code": "from math import sqrt\n\nN = int(eval(input()))\nn = int(sqrt(N)) + 10\n\n\ndef f(A, B):\n a = len(str(A))\n b = len(str(B))\n return max(a, b)\n\n\nans = 10**10\nfor i in range(1, n):\n if (N // i) * i == N:\n ans = min(ans, f(i, N // i))\nprint(ans)\n", "measured_slow_code_sha256": "1fcdee0cf9f26ff44998480a2c5fd43e6576ee1e9f08733d502a79c33e3e20a7", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.0040061708806638, "pair_id": "python_v2_6af5ed1b4fac35a2d005bb0e", "per_case_slow_code_faster_fraction": 0.44, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03775", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03775_16771a04e6276b491192dc984b7d0363d20dc7ef3d6fad47bf439b11ebe5f507.jsonl.gz", "inputs": "reproduction/python/inputs/p03775.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03775_1fcdee0cf9f26ff44998480a2c5fd43e6576ee1e9f08733d502a79c33e3e20a7.jsonl.gz"}, "slow_code": "from math import sqrt\n\nN = int(eval(input()))\nn = int(sqrt(N)) + 10\n\n\ndef f(A, B):\n a = len(str(A))\n b = len(str(B))\n return max(a, b)\n\n\nans = 10**10\nfor i in range(1, n):\n if (N // i) * i == N:\n ans = min(ans, f(i, N // i))\nprint(ans)\n", "slow_code_sha256": "1fcdee0cf9f26ff44998480a2c5fd43e6576ee1e9f08733d502a79c33e3e20a7", "slow_id": "p03775_1fcdee0cf9f26ff44998480a2c5fd43e6576ee1e9f08733d502a79c33e3e20a7", "speedup": 3.289527673813855, "stratum": "2-4", "within_pair_jaccard": 0.475, "workload": {"case_count": 100, "description": "Among positive integer factorizations A*B=N, minimize the larger decimal digit count of A and B. Observed inputs: N=1..10000000000 (median 15771778).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 12, "median": 9.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p03816_case_000", "p03816_case_001", "p03816_case_002", "p03816_case_003", "p03816_case_004", "p03816_case_005", "p03816_case_006", "p03816_case_007", "p03816_case_008", "p03816_case_009", "p03816_case_010", "p03816_case_011", "p03816_case_012", "p03816_case_013", "p03816_case_014", "p03816_case_015", "p03816_case_016", "p03816_case_017", "p03816_case_018", "p03816_case_019", "p03816_case_020", "p03816_case_021", "p03816_case_022", "p03816_case_023", "p03816_case_024", "p03816_case_025", "p03816_case_026", "p03816_case_027", "p03816_case_028", "p03816_case_029", "p03816_case_030", "p03816_case_031", "p03816_case_032", "p03816_case_033", "p03816_case_034", "p03816_case_035", "p03816_case_036", "p03816_case_037", "p03816_case_038", "p03816_case_039", "p03816_case_040", "p03816_case_041", "p03816_case_042", "p03816_case_043", "p03816_case_044", "p03816_case_045", "p03816_case_046", "p03816_case_047", "p03816_case_048", "p03816_case_049", "p03816_case_050", "p03816_case_051", "p03816_case_052", "p03816_case_053", "p03816_case_054", "p03816_case_055", "p03816_case_056", "p03816_case_057", "p03816_case_058", "p03816_case_059", "p03816_case_060", "p03816_case_061", "p03816_case_062", "p03816_case_063", "p03816_case_064", "p03816_case_065", "p03816_case_066", "p03816_case_067", "p03816_case_068", "p03816_case_069", "p03816_case_070", "p03816_case_071", "p03816_case_072", "p03816_case_073", "p03816_case_074", "p03816_case_075", "p03816_case_076", "p03816_case_077", "p03816_case_078", "p03816_case_079", "p03816_case_080", "p03816_case_081", "p03816_case_082", "p03816_case_083", "p03816_case_084", "p03816_case_085", "p03816_case_086", "p03816_case_087", "p03816_case_088", "p03816_case_089", "p03816_case_090", "p03816_case_091", "p03816_case_092", "p03816_case_093", "p03816_case_094", "p03816_case_095", "p03816_case_096", "p03816_case_097", "p03816_case_098", "p03816_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "executable_AST_equal_except_explicit_explanatory_string_removal_and_all_frozen_inputs_checker_pass", "fast_code": "eval(input())\nc = len(set(input().split()))\nprint((c - 1 + c % 2))\n", "fast_code_sha256": "f770b1c4b54851492ce22a1cc6099599b5ce0eed94268f079ec2ce07d300bccc", "fast_id": "p03816_f770b1c4b54851492ce22a1cc6099599b5ce0eed94268f079ec2ce07d300bccc", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "eval(input())\nc = len(set(input().split()))\nprint((c - 1 + c % 2))\n", "measured_fast_code_sha256": "f770b1c4b54851492ce22a1cc6099599b5ce0eed94268f079ec2ce07d300bccc", "measured_slow_code": "#!usr/bin/env python3\nfrom collections import defaultdict\nfrom heapq import heappush, heappop\nimport sys\nimport math\nimport bisect\nimport random\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LS():\n return list(map(list, sys.stdin.readline().split()))\n\n\ndef S():\n return list(sys.stdin.readline())[:-1]\n\n\ndef IR(n):\n l = [None for i in range(n)]\n for i in range(n):\n l[i] = I()\n return l\n\n\ndef LIR(n):\n l = [None for i in range(n)]\n for i in range(n):\n l[i] = LI()\n return l\n\n\ndef SR(n):\n l = [None for i in range(n)]\n for i in range(n):\n l[i] = S()\n return l\n\n\ndef LSR(n):\n l = [None for i in range(n)]\n for i in range(n):\n l[i] = SR()\n return l\n\n\nmod = 1000000007\n# A\n# B\n# C\n\"\"\"\nx = I()\nans = 2*(x//11)+1\nx %= 11\nif x == 0:\n ans -= 1\nif x > 6:\n ans += 1\nprint(ans)\n\"\"\"\n# D\nn = I()\na = LI()\nd = defaultdict(int)\nfor i in a:\n d[i] += 1\nl = list(d.keys())\nk = 0\nfor i in l:\n k ^= ~(d[i] % 2)\n d[i] = 1\nans = sum(list(d.values()))\nans -= 1 if k % 2 else 0\nprint(ans)\n# E\n# F\n# G\n# H\n# I\n# J\n# K\n# L\n# M\n# N\n# O\n# P\n# Q\n# R\n# S\n# T\n", "measured_slow_code_sha256": "f87c28f4ead9129969c541ae0db2fc7733f521c7e96aafae7cfa3be3414a8fa8", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 8.799068224593636, "pair_id": "python_v2_484482f6d841826ffc6a713b", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03816", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03816_f770b1c4b54851492ce22a1cc6099599b5ce0eed94268f079ec2ce07d300bccc.jsonl.gz", "inputs": "reproduction/python/inputs/p03816.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03816_f87c28f4ead9129969c541ae0db2fc7733f521c7e96aafae7cfa3be3414a8fa8.jsonl.gz"}, "slow_code": "from collections import defaultdict\nfrom heapq import heappush, heappop\nimport sys\nimport math\nimport bisect\nimport random\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LS():\n return list(map(list, sys.stdin.readline().split()))\n\n\ndef S():\n return list(sys.stdin.readline())[:-1]\n\n\ndef IR(n):\n l = [None for i in range(n)]\n for i in range(n):\n l[i] = I()\n return l\n\n\ndef LIR(n):\n l = [None for i in range(n)]\n for i in range(n):\n l[i] = LI()\n return l\n\n\ndef SR(n):\n l = [None for i in range(n)]\n for i in range(n):\n l[i] = S()\n return l\n\n\ndef LSR(n):\n l = [None for i in range(n)]\n for i in range(n):\n l[i] = SR()\n return l\n\n\nmod = 1000000007\n\n\nn = I()\na = LI()\nd = defaultdict(int)\nfor i in a:\n d[i] += 1\nl = list(d.keys())\nk = 0\nfor i in l:\n k ^= ~(d[i] % 2)\n d[i] = 1\nans = sum(list(d.values()))\nans -= 1 if k % 2 else 0\nprint(ans)\n", "slow_code_sha256": "32728a5c66ef038bd3a4f497b00616e3380ad5ebe49d3699dc8574ebf3b3cecf", "slow_id": "p03816_f87c28f4ead9129969c541ae0db2fc7733f521c7e96aafae7cfa3be3414a8fa8", "speedup": 7.346416939151344, "stratum": "4-8", "within_pair_jaccard": 0.07017543859649122, "workload": {"case_count": 100, "description": "From an odd-sized deck, repeatedly choose three arbitrary cards, discard a largest and a smallest, and return the remaining card. Maximize the number left with all values pairwise distinct. Zero operations are allowed. Observed inputs: N=3..99999 (median 12345); A_i=1..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 600000, "median": 72946.5, "min": 17}, "input_format": ["N\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100000, "median": 12346.0, "min": 4}}} -{"case_ids": ["p03343_case_000", "p03343_case_001", "p03343_case_002", "p03343_case_003", "p03343_case_004", "p03343_case_005", "p03343_case_006", "p03343_case_007", "p03343_case_008", "p03343_case_009", "p03343_case_010", "p03343_case_011", "p03343_case_012", "p03343_case_013", "p03343_case_014", "p03343_case_015", "p03343_case_016", "p03343_case_017", "p03343_case_018", "p03343_case_019", "p03343_case_020", "p03343_case_021", "p03343_case_022", "p03343_case_023", "p03343_case_024", "p03343_case_025", "p03343_case_026", "p03343_case_027", "p03343_case_028", "p03343_case_029", "p03343_case_030", "p03343_case_031", "p03343_case_032", "p03343_case_033", "p03343_case_034", "p03343_case_035", "p03343_case_036", "p03343_case_037", "p03343_case_038", "p03343_case_039", "p03343_case_040", "p03343_case_041", "p03343_case_042", "p03343_case_043", "p03343_case_044", "p03343_case_045", "p03343_case_046", "p03343_case_047", "p03343_case_048", "p03343_case_049", "p03343_case_050", "p03343_case_051", "p03343_case_052", "p03343_case_053", "p03343_case_054", "p03343_case_055", "p03343_case_056", "p03343_case_057", "p03343_case_058", "p03343_case_059", "p03343_case_060", "p03343_case_061", "p03343_case_062", "p03343_case_063", "p03343_case_064", "p03343_case_065", "p03343_case_066", "p03343_case_067", "p03343_case_068", "p03343_case_069", "p03343_case_070", "p03343_case_071", "p03343_case_072", "p03343_case_073", "p03343_case_074", "p03343_case_075", "p03343_case_076", "p03343_case_077", "p03343_case_078", "p03343_case_079", "p03343_case_080", "p03343_case_081", "p03343_case_082", "p03343_case_083", "p03343_case_084", "p03343_case_085", "p03343_case_086", "p03343_case_087", "p03343_case_088", "p03343_case_089", "p03343_case_090", "p03343_case_091", "p03343_case_092", "p03343_case_093", "p03343_case_094", "p03343_case_095", "p03343_case_096", "p03343_case_097", "p03343_case_098", "p03343_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "inf = 10**9\nn, k, q = list(map(int, input().split()))\na = tuple(map(int, input().split()))\nans = inf\nfor min_ in sorted(set(a)):\n res = []\n seq = 0\n for ind, a_ in enumerate(a):\n if a_ >= min_:\n seq += 1\n else:\n if seq >= k:\n sequence_le_k = a[ind - seq : ind]\n pick = seq - k + 1\n res.extend(sorted(sequence_le_k)[:pick])\n seq = 0\n else:\n if seq >= k:\n sequence_le_k = a[-seq:]\n pick = seq - k + 1\n res.extend(sorted(sequence_le_k)[:pick])\n if len(res) < q:\n continue\n res.sort()\n ans = min(ans, res[q - 1] - min_)\nprint(ans)\n", "fast_code_sha256": "97556690d513456c9ecb92c1b0f9c52684722af86d716cd223787efd61ba6821", "fast_id": "p03343_8c0f5cb72d509cabc152a5e30ccbf7ae6a6def6056db990769f92e5a2c532ff5", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "inf = 10**9\nn, k, q = list(map(int, input().split()))\na = tuple(map(int, input().split()))\nans = inf\nfor min_ in sorted(set(a)):\n res = [] # 最小値min_としたとき、取り除ける要素全て\n seq = 0\n for ind, a_ in enumerate(a):\n if a_ >= min_:\n seq += 1\n else:\n if seq >= k:\n sequence_le_k = a[ind - seq : ind] # 長さk以上の数列\n pick = seq - k + 1 # この個数だけ取り除く\n res.extend(sorted(sequence_le_k)[:pick])\n seq = 0\n else:\n if seq >= k:\n sequence_le_k = a[-seq:] # 長さk以上の数列\n pick = seq - k + 1 # この個数だけ取り除く\n res.extend(sorted(sequence_le_k)[:pick])\n if len(res) < q:\n continue\n res.sort()\n ans = min(ans, res[q - 1] - min_) # q回目に取り除いた要素 = 取り除く最大値\nprint(ans)\n", "measured_fast_code_sha256": "8c0f5cb72d509cabc152a5e30ccbf7ae6a6def6056db990769f92e5a2c532ff5", "measured_slow_code": "N, K, Q = list(map(int, input().split()))\na = list(map(int, input().split()))\nans = float(\"inf\")\nfor i in range(N):\n tmp = []\n rec = []\n for j in range(N):\n if a[i] <= a[j]:\n tmp.append(a[j])\n else:\n if len(tmp) >= K:\n tmp = sorted(tmp)\n rec += tmp[: len(tmp) - K + 1]\n tmp = []\n if len(tmp) >= K:\n tmp = sorted(tmp)\n rec += tmp[: len(tmp) - K + 1]\n if Q <= len(rec):\n rec = sorted(rec)\n ans = min(ans, rec[Q - 1] - rec[0])\nprint(ans)\n", "measured_slow_code_sha256": "82a82df6da7774cec40f4241c1fccb3b14eeb548bb1f347896bc72000e6d9b41", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.3738456785616586, "pair_id": "python_v2_767da73d5403dfd333c2a864", "per_case_slow_code_faster_fraction": 0.03, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03343", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03343_8c0f5cb72d509cabc152a5e30ccbf7ae6a6def6056db990769f92e5a2c532ff5.jsonl.gz", "inputs": "reproduction/python/inputs/p03343.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03343_82a82df6da7774cec40f4241c1fccb3b14eeb548bb1f347896bc72000e6d9b41.jsonl.gz"}, "slow_code": "N, K, Q = list(map(int, input().split()))\na = list(map(int, input().split()))\nans = float(\"inf\")\nfor i in range(N):\n tmp = []\n rec = []\n for j in range(N):\n if a[i] <= a[j]:\n tmp.append(a[j])\n else:\n if len(tmp) >= K:\n tmp = sorted(tmp)\n rec += tmp[: len(tmp) - K + 1]\n tmp = []\n if len(tmp) >= K:\n tmp = sorted(tmp)\n rec += tmp[: len(tmp) - K + 1]\n if Q <= len(rec):\n rec = sorted(rec)\n ans = min(ans, rec[Q - 1] - rec[0])\nprint(ans)\n", "slow_code_sha256": "82a82df6da7774cec40f4241c1fccb3b14eeb548bb1f347896bc72000e6d9b41", "slow_id": "p03343_82a82df6da7774cec40f4241c1fccb3b14eeb548bb1f347896bc72000e6d9b41", "speedup": 7.799046721054824, "stratum": "4-8", "within_pair_jaccard": 0.391304347826087, "workload": {"case_count": 100, "description": "Repeat Q times: choose K consecutive entries of the current sequence and remove one minimum entry from that block. Minimize the largest removed value minus the smallest over all Q removals. Observed inputs: N=1..2000 (median 2000); K=1..2000 (median 1000); Q=1..2000 (median 1000); A_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 22012, "median": 19779.0, "min": 8}, "input_format": ["N K Q\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2003, "median": 2003.0, "min": 4}}} -{"case_ids": ["p03136_case_000", "p03136_case_001", "p03136_case_002", "p03136_case_003", "p03136_case_004", "p03136_case_005", "p03136_case_006", "p03136_case_007", "p03136_case_008", "p03136_case_009", "p03136_case_010", "p03136_case_011", "p03136_case_012", "p03136_case_013", "p03136_case_014", "p03136_case_015", "p03136_case_016", "p03136_case_017", "p03136_case_018", "p03136_case_019", "p03136_case_020", "p03136_case_021", "p03136_case_022", "p03136_case_023", "p03136_case_024", "p03136_case_025", "p03136_case_026", "p03136_case_027", "p03136_case_028", "p03136_case_029", "p03136_case_030", "p03136_case_031", "p03136_case_032", "p03136_case_033", "p03136_case_034", "p03136_case_035", "p03136_case_036", "p03136_case_037", "p03136_case_038", "p03136_case_039", "p03136_case_040", "p03136_case_041", "p03136_case_042", "p03136_case_043", "p03136_case_044", "p03136_case_045", "p03136_case_046", "p03136_case_047", "p03136_case_048", "p03136_case_049", "p03136_case_050", "p03136_case_051", "p03136_case_052", "p03136_case_053", "p03136_case_054", "p03136_case_055", "p03136_case_056", "p03136_case_057", "p03136_case_058", "p03136_case_059", "p03136_case_060", "p03136_case_061", "p03136_case_062", "p03136_case_063", "p03136_case_064", "p03136_case_065", "p03136_case_066", "p03136_case_067", "p03136_case_068", "p03136_case_069", "p03136_case_070", "p03136_case_071", "p03136_case_072", "p03136_case_073", "p03136_case_074", "p03136_case_075", "p03136_case_076", "p03136_case_077", "p03136_case_078", "p03136_case_079", "p03136_case_080", "p03136_case_081", "p03136_case_082", "p03136_case_083", "p03136_case_084", "p03136_case_085", "p03136_case_086", "p03136_case_087", "p03136_case_088", "p03136_case_089", "p03136_case_090", "p03136_case_091", "p03136_case_092", "p03136_case_093", "p03136_case_094", "p03136_case_095", "p03136_case_096", "p03136_case_097", "p03136_case_098", "p03136_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def main():\n N = int(eval(input()))\n L = [int(i) for i in input().split()]\n maxL = max(L)\n sumL = sum(L) - maxL\n if maxL < sumL:\n print(\"Yes\")\n else:\n print(\"No\")\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "672cb672e6f2cdb3029769e3d37162934b5830bd3278e0cb4d1da7292554a1c0", "fast_id": "p03136_672cb672e6f2cdb3029769e3d37162934b5830bd3278e0cb4d1da7292554a1c0", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def main():\n N = int(eval(input()))\n L = [int(i) for i in input().split()]\n maxL = max(L)\n sumL = sum(L) - maxL\n if maxL < sumL:\n print(\"Yes\")\n else:\n print(\"No\")\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "672cb672e6f2cdb3029769e3d37162934b5830bd3278e0cb4d1da7292554a1c0", "measured_slow_code": "def examA():\n T, X = LI()\n ans = T / X\n print(ans)\n return\n\n\ndef examB():\n N = I()\n L = LI()\n ans = \"Yes\"\n if max(L) * 2 >= sum(L):\n ans = \"No\"\n print(ans)\n return\n\n\nimport sys, copy, bisect, itertools, heapq, math\nfrom heapq import heappop, heappush, heapify\nfrom collections import Counter, defaultdict, deque\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\ndef LSI():\n return list(map(str, sys.stdin.readline().split()))\n\n\ndef LS():\n return sys.stdin.readline().split()\n\n\ndef SI():\n return sys.stdin.readline().strip()\n\n\nmod = 10**9 + 7\ninf = float(\"inf\")\nif __name__ == \"__main__\":\n examB()\n", "measured_slow_code_sha256": "4be873c382d7f88cc1e36527ba71e39cb04cebba58534d56f1501f183fdfdcbd", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 7.502642192161025, "pair_id": "python_v2_7462c449ab51fe0c81f65154", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03136", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03136_672cb672e6f2cdb3029769e3d37162934b5830bd3278e0cb4d1da7292554a1c0.jsonl.gz", "inputs": "reproduction/python/inputs/p03136.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03136_4be873c382d7f88cc1e36527ba71e39cb04cebba58534d56f1501f183fdfdcbd.jsonl.gz"}, "slow_code": "def examA():\n T, X = LI()\n ans = T / X\n print(ans)\n return\n\n\ndef examB():\n N = I()\n L = LI()\n ans = \"Yes\"\n if max(L) * 2 >= sum(L):\n ans = \"No\"\n print(ans)\n return\n\n\nimport sys, copy, bisect, itertools, heapq, math\nfrom heapq import heappop, heappush, heapify\nfrom collections import Counter, defaultdict, deque\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\ndef LSI():\n return list(map(str, sys.stdin.readline().split()))\n\n\ndef LS():\n return sys.stdin.readline().split()\n\n\ndef SI():\n return sys.stdin.readline().strip()\n\n\nmod = 10**9 + 7\ninf = float(\"inf\")\nif __name__ == \"__main__\":\n examB()\n", "slow_code_sha256": "4be873c382d7f88cc1e36527ba71e39cb04cebba58534d56f1501f183fdfdcbd", "slow_id": "p03136_4be873c382d7f88cc1e36527ba71e39cb04cebba58534d56f1501f183fdfdcbd", "speedup": 7.497872003478581, "stratum": "4-8", "within_pair_jaccard": 0.21311475409836064, "workload": {"case_count": 100, "description": "Determine whether N supplied positive side lengths L_i can form a nondegenerate polygon in the plane; convexity is not required. Observed inputs: N=3..10 (median 6); L_i=1..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 43, "median": 17.0, "min": 8}, "input_format": ["N\nL_1 ... L_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 11, "median": 7.0, "min": 4}}} -{"case_ids": ["p00053_case_000", "p00053_case_001", "p00053_case_002", "p00053_case_003", "p00053_case_004", "p00053_case_005", "p00053_case_006", "p00053_case_007", "p00053_case_008", "p00053_case_009", "p00053_case_010", "p00053_case_011", "p00053_case_012", "p00053_case_013", "p00053_case_014", "p00053_case_015", "p00053_case_016", "p00053_case_017", "p00053_case_018", "p00053_case_019", "p00053_case_020", "p00053_case_021", "p00053_case_022", "p00053_case_023", "p00053_case_024", "p00053_case_025", "p00053_case_026", "p00053_case_027", "p00053_case_028", "p00053_case_029", "p00053_case_030", "p00053_case_031", "p00053_case_032", "p00053_case_033", "p00053_case_034", "p00053_case_035", "p00053_case_036", "p00053_case_037", "p00053_case_038", "p00053_case_039", "p00053_case_040", "p00053_case_041", "p00053_case_042", "p00053_case_043", "p00053_case_044", "p00053_case_045", "p00053_case_046", "p00053_case_047", "p00053_case_048", "p00053_case_049", "p00053_case_050", "p00053_case_051", "p00053_case_052", "p00053_case_053", "p00053_case_054", "p00053_case_055", "p00053_case_056", "p00053_case_057", "p00053_case_058", "p00053_case_059", "p00053_case_060", "p00053_case_061", "p00053_case_062", "p00053_case_063", "p00053_case_064", "p00053_case_065", "p00053_case_066", "p00053_case_067", "p00053_case_068", "p00053_case_069", "p00053_case_070", "p00053_case_071", "p00053_case_072", "p00053_case_073", "p00053_case_074", "p00053_case_075", "p00053_case_076", "p00053_case_077", "p00053_case_078", "p00053_case_079", "p00053_case_080", "p00053_case_081", "p00053_case_082", "p00053_case_083", "p00053_case_084", "p00053_case_085", "p00053_case_086", "p00053_case_087", "p00053_case_088", "p00053_case_089", "p00053_case_090", "p00053_case_091", "p00053_case_092", "p00053_case_093", "p00053_case_094", "p00053_case_095", "p00053_case_096", "p00053_case_097", "p00053_case_098", "p00053_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import math\n\nr = 105000\nsqrt = int(math.sqrt(r))\np = [1] * r\np[0] = 0\nfor i in range(1, sqrt):\n if p[i]:\n p[2 * i + 1 :: i + 1] = [0 for x in range(2 * i + 1, r, i + 1)]\ns = [0 for i in range(11000)]\ns[0] = 2\nk = 1\nfor i in range(2, r):\n if p[i]:\n s[k] = i + 1 + s[k - 1]\n k += 1\nwhile True:\n n = int(input())\n if not n:\n break\n print(s[n - 1])\n", "fast_code_sha256": "a0b3de80bc7acc9df120b6ca6c34147272ba3b5d865844e4abc2f24345e96295", "fast_id": "p00053_a0b3de80bc7acc9df120b6ca6c34147272ba3b5d865844e4abc2f24345e96295", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import math\n\nr = 105000\nsqrt = int(math.sqrt(r))\np = [1] * r\np[0] = 0\nfor i in range(1, sqrt):\n if p[i]:\n p[2 * i + 1 :: i + 1] = [0 for x in range(2 * i + 1, r, i + 1)]\ns = [0 for i in range(11000)]\ns[0] = 2\nk = 1\nfor i in range(2, r):\n if p[i]:\n s[k] = i + 1 + s[k - 1]\n k += 1\nwhile True:\n n = int(input())\n if not n:\n break\n print(s[n - 1])\n", "measured_fast_code_sha256": "a0b3de80bc7acc9df120b6ca6c34147272ba3b5d865844e4abc2f24345e96295", "measured_slow_code": "s = [0]\nM = 10**6\np = [1] * M\nS = 0\nfor i in range(2, M):\n if p[i]:\n for j in range(i * i, M, i):\n p[j] = 0\n S += i\n s.append(S)\nwhile 1:\n n = eval(input())\n if n == 0:\n break\n print(s[n])\n", "measured_slow_code_sha256": "7130bb62b43d2905d9cdb1190486ed076acf2c798a1bd9a7e922a3d44800a16f", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 14.132017787556101, "pair_id": "python_v2_77c5b740c779c3f000d132f4", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p00053", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p00053_a0b3de80bc7acc9df120b6ca6c34147272ba3b5d865844e4abc2f24345e96295.jsonl.gz", "inputs": "reproduction/python/inputs/p00053.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p00053_7130bb62b43d2905d9cdb1190486ed076acf2c798a1bd9a7e922a3d44800a16f.jsonl.gz"}, "slow_code": "s = [0]\nM = 10**6\np = [1] * M\nS = 0\nfor i in range(2, M):\n if p[i]:\n for j in range(i * i, M, i):\n p[j] = 0\n S += i\n s.append(S)\nwhile 1:\n n = eval(input())\n if n == 0:\n break\n print(s[n])\n", "slow_code_sha256": "7130bb62b43d2905d9cdb1190486ed076acf2c798a1bd9a7e922a3d44800a16f", "slow_id": "p00053_7130bb62b43d2905d9cdb1190486ed076acf2c798a1bd9a7e922a3d44800a16f", "speedup": 14.130599721426629, "stratum": "8+", "within_pair_jaccard": 0.45454545454545453, "workload": {"case_count": 100, "description": "For each n, compute the sum of the first n primes. Each line supplies one n; the final zero terminates input and is not a query. Observed inputs: datasets=1..50 (median 25); n=1..10000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 302, "median": 120.0, "min": 4}, "input_format": ["n_1\n...\nn_D\n0"], "input_format_status": "source_input_section", "input_lines": {"max": 51, "median": 26.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 51, "median": 26.0, "min": 2}}} -{"case_ids": ["p03566_case_000", "p03566_case_001", "p03566_case_002", "p03566_case_003", "p03566_case_004", "p03566_case_005", "p03566_case_006", "p03566_case_007", "p03566_case_008", "p03566_case_009", "p03566_case_010", "p03566_case_011", "p03566_case_012", "p03566_case_013", "p03566_case_014", "p03566_case_015", "p03566_case_016", "p03566_case_017", "p03566_case_018", "p03566_case_019", "p03566_case_020", "p03566_case_021", "p03566_case_022", "p03566_case_023", "p03566_case_024", "p03566_case_025", "p03566_case_026", "p03566_case_027", "p03566_case_028", "p03566_case_029", "p03566_case_030", "p03566_case_031", "p03566_case_032", "p03566_case_033", "p03566_case_034", "p03566_case_035", "p03566_case_036", "p03566_case_037", "p03566_case_038", "p03566_case_039", "p03566_case_040", "p03566_case_041", "p03566_case_042", "p03566_case_043", "p03566_case_044", "p03566_case_045", "p03566_case_046", "p03566_case_047", "p03566_case_048", "p03566_case_049", "p03566_case_050", "p03566_case_051", "p03566_case_052", "p03566_case_053", "p03566_case_054", "p03566_case_055", "p03566_case_056", "p03566_case_057", "p03566_case_058", "p03566_case_059", "p03566_case_060", "p03566_case_061", "p03566_case_062", "p03566_case_063", "p03566_case_064", "p03566_case_065", "p03566_case_066", "p03566_case_067", "p03566_case_068", "p03566_case_069", "p03566_case_070", "p03566_case_071", "p03566_case_072", "p03566_case_073", "p03566_case_074", "p03566_case_075", "p03566_case_076", "p03566_case_077", "p03566_case_078", "p03566_case_079", "p03566_case_080", "p03566_case_081", "p03566_case_082", "p03566_case_083", "p03566_case_084", "p03566_case_085", "p03566_case_086", "p03566_case_087", "p03566_case_088", "p03566_case_089", "p03566_case_090", "p03566_case_091", "p03566_case_092", "p03566_case_093", "p03566_case_094", "p03566_case_095", "p03566_case_096", "p03566_case_097", "p03566_case_098", "p03566_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\nt = [int(i) for i in input().split()]\nv = [int(i) for i in input().split()]\nmaxspeed = [0] * (n + 1)\nfor i in range(n - 1, 0, -1):\n maxspeed[i] = min(v[i], v[i - 1], t[i] + maxspeed[i + 1])\n\n\ndef dist(i, first):\n ta = v[i] - first\n tb = v[i] - maxspeed[i + 1]\n if ta + tb <= t[i]:\n c = (\n (first + v[i]) * ta / 2\n + v[i] * (t[i] - ta - tb)\n + (maxspeed[i + 1] + v[i]) * tb / 2\n )\n lastspeed = maxspeed[i + 1]\n elif maxspeed[i + 1] - first > t[i]:\n c = (first + first + t[i]) * t[i] / 2\n lastspeed = first + t[i]\n else:\n a = (maxspeed[i + 1] + t[i] - first) / 2\n c = (first + first + a) * a / 2 + (first + a + maxspeed[i + 1]) * (t[i] - a) / 2\n lastspeed = maxspeed[i + 1]\n return c, lastspeed\n\n\nans = 0\nfirstspeed = 0\nfor i in range(n):\n d, firstspeed = dist(i, firstspeed)\n ans += d\nprint(ans)\n", "fast_code_sha256": "9968516c881c7b61c416a8511da2e2fdc1f9fbeae8c0c49b6ee5501289031211", "fast_id": "p03566_b246082c38abc76f5a4094891e018aef87b5c63e334a8d81bd193191efd770b5", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\nt = [int(i) for i in input().split()]\nv = [int(i) for i in input().split()]\nmaxspeed = [0] * (n + 1)\nfor i in range(n - 1, 0, -1):\n maxspeed[i] = min(v[i], v[i - 1], t[i] + maxspeed[i + 1])\n\n\ndef dist(i, first): # distance,lastspeed\n ta = v[i] - first\n tb = v[i] - maxspeed[i + 1]\n if ta + tb <= t[i]:\n c = (\n (first + v[i]) * ta / 2\n + v[i] * (t[i] - ta - tb)\n + (maxspeed[i + 1] + v[i]) * tb / 2\n )\n lastspeed = maxspeed[i + 1]\n elif maxspeed[i + 1] - first > t[i]:\n c = (first + first + t[i]) * t[i] / 2\n lastspeed = first + t[i]\n else:\n a = (maxspeed[i + 1] + t[i] - first) / 2\n c = (first + first + a) * a / 2 + (first + a + maxspeed[i + 1]) * (t[i] - a) / 2\n lastspeed = maxspeed[i + 1]\n return c, lastspeed\n\n\nans = 0\nfirstspeed = 0\nfor i in range(n):\n d, firstspeed = dist(i, firstspeed)\n ans += d\nprint(ans)\n", "measured_fast_code_sha256": "b246082c38abc76f5a4094891e018aef87b5c63e334a8d81bd193191efd770b5", "measured_slow_code": "n = int(eval(input()))\nT = list(map(int, input().split()))\nV = list(map(int, input().split()))\ns = [0] * n\nfor i in range(n - 1):\n s[i + 1] = s[i] + T[i]\nl = (s[-1] + T[n - 1]) * 2 + 1\nans = [1e100] * l\nfor i in range(l):\n ans[i] = min(ans[i], i / 2)\n ans[l - i - 1] = min(ans[i], i / 2)\nfor j in range(n):\n for i in range(l):\n if i <= s[j] * 2:\n ans[i] = min(ans[i], V[j] + (s[j] * 2 - i) / 2)\n elif s[j] * 2 <= i <= s[j] * 2 + T[j] * 2:\n ans[i] = min(ans[i], V[j])\n else:\n ans[i] = min(ans[i], V[j] + (i - s[j] * 2 - T[j] * 2) / 2)\nanser = 0\nfor i in range(l - 1):\n anser += (ans[i] + ans[i + 1]) / 4\nprint(anser)\n", "measured_slow_code_sha256": "7d703e55c917b05f43180563cd7215d2d767b997061edc9ee8bcb6b32d36cd2c", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1468.267069214292, "pair_id": "python_v2_c64145b4f1f44a419804be7e", "per_case_slow_code_faster_fraction": 0.02, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03566", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03566_b246082c38abc76f5a4094891e018aef87b5c63e334a8d81bd193191efd770b5.jsonl.gz", "inputs": "reproduction/python/inputs/p03566.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03566_7d703e55c917b05f43180563cd7215d2d767b997061edc9ee8bcb6b32d36cd2c.jsonl.gz"}, "slow_code": "n = int(eval(input()))\nT = list(map(int, input().split()))\nV = list(map(int, input().split()))\ns = [0] * n\nfor i in range(n - 1):\n s[i + 1] = s[i] + T[i]\nl = (s[-1] + T[n - 1]) * 2 + 1\nans = [1e100] * l\nfor i in range(l):\n ans[i] = min(ans[i], i / 2)\n ans[l - i - 1] = min(ans[i], i / 2)\nfor j in range(n):\n for i in range(l):\n if i <= s[j] * 2:\n ans[i] = min(ans[i], V[j] + (s[j] * 2 - i) / 2)\n elif s[j] * 2 <= i <= s[j] * 2 + T[j] * 2:\n ans[i] = min(ans[i], V[j])\n else:\n ans[i] = min(ans[i], V[j] + (i - s[j] * 2 - T[j] * 2) / 2)\nanser = 0\nfor i in range(l - 1):\n anser += (ans[i] + ans[i + 1]) / 4\nprint(anser)\n", "slow_code_sha256": "7d703e55c917b05f43180563cd7215d2d767b997061edc9ee8bcb6b32d36cd2c", "slow_id": "p03566_7d703e55c917b05f43180563cd7215d2d767b997061edc9ee8bcb6b32d36cd2c", "speedup": 381.27430947492934, "stratum": "8+", "within_pair_jaccard": 0.42857142857142855, "workload": {"case_count": 100, "description": "Maximize distance traveled over N consecutive time segments of durations t_i with speed caps v_i. Speed is nonnegative, starts and ends at zero, and acceleration stays between -1 and 1 distance-units per second squared. Observed inputs: N=1..100 (median 60); t_i=1..200; v_i=1..100; total_duration=1..20000 (median 4520.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 804, "median": 390.5, "min": 6}, "input_format": ["N\nt_1 ... t_N\nv_1 ... v_N"], "input_format_status": "source_input_section", "input_lines": {"max": 3, "median": 3.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 201, "median": 121.0, "min": 3}}} -{"case_ids": ["p02417_case_000", "p02417_case_001", "p02417_case_002", "p02417_case_003", "p02417_case_004", "p02417_case_005", "p02417_case_006", "p02417_case_007", "p02417_case_008", "p02417_case_009", "p02417_case_010", "p02417_case_011", "p02417_case_012", "p02417_case_013", "p02417_case_014", "p02417_case_015", "p02417_case_016", "p02417_case_017", "p02417_case_018", "p02417_case_019", "p02417_case_020", "p02417_case_021", "p02417_case_022", "p02417_case_023", "p02417_case_024", "p02417_case_025", "p02417_case_026", "p02417_case_027", "p02417_case_028", "p02417_case_029", "p02417_case_030", "p02417_case_031", "p02417_case_032", "p02417_case_033", "p02417_case_034", "p02417_case_035", "p02417_case_036", "p02417_case_037", "p02417_case_038", "p02417_case_039", "p02417_case_040", "p02417_case_041", "p02417_case_042", "p02417_case_043", "p02417_case_044", "p02417_case_045", "p02417_case_046", "p02417_case_047", "p02417_case_048", "p02417_case_049", "p02417_case_050", "p02417_case_051", "p02417_case_052", "p02417_case_053", "p02417_case_054", "p02417_case_055", "p02417_case_056", "p02417_case_057", "p02417_case_058", "p02417_case_059", "p02417_case_060", "p02417_case_061", "p02417_case_062", "p02417_case_063", "p02417_case_064", "p02417_case_065", "p02417_case_066", "p02417_case_067", "p02417_case_068", "p02417_case_069", "p02417_case_070", "p02417_case_071", "p02417_case_072", "p02417_case_073", "p02417_case_074", "p02417_case_075", "p02417_case_076", "p02417_case_077", "p02417_case_078", "p02417_case_079", "p02417_case_080", "p02417_case_081", "p02417_case_082", "p02417_case_083", "p02417_case_084", "p02417_case_085", "p02417_case_086", "p02417_case_087", "p02417_case_088", "p02417_case_089", "p02417_case_090", "p02417_case_091", "p02417_case_092", "p02417_case_093", "p02417_case_094", "p02417_case_095", "p02417_case_096", "p02417_case_097", "p02417_case_098", "p02417_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "alpha = \"abcdefghijklmnopqrstuvwxyz\"\ntext = \"\"\nwhile True:\n try:\n text += input().lower()\n except:\n break\nfor key in alpha:\n print((\"{} : {}\".format(key, text.count(key))))\n", "fast_code_sha256": "f9cafd9d8dce68b230b9b99bbd992611304ab19e259b30cf8ca6a1c29fa0d18e", "fast_id": "p02417_f9cafd9d8dce68b230b9b99bbd992611304ab19e259b30cf8ca6a1c29fa0d18e", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "alpha = \"abcdefghijklmnopqrstuvwxyz\"\ntext = \"\"\nwhile True:\n try:\n text += input().lower()\n except:\n break\nfor key in alpha:\n print((\"{} : {}\".format(key, text.count(key))))\n", "measured_fast_code_sha256": "f9cafd9d8dce68b230b9b99bbd992611304ab19e259b30cf8ca6a1c29fa0d18e", "measured_slow_code": "from collections import Counter\nimport string\n\ncounter = Counter()\nwhile True:\n try:\n s = input().lower()\n counter += Counter(s)\n except EOFError:\n break\nfor c in string.ascii_lowercase:\n count = counter[c]\n print(f\"{c} : {count}\")\n", "measured_slow_code_sha256": "b4a2f6a100e7b36723d529bf95abed8f3c81365ab27266a35eaab453ba0653db", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 8.150773094970063, "pair_id": "python_v2_6fd9c773013c4fc22273abaf", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02417", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02417_f9cafd9d8dce68b230b9b99bbd992611304ab19e259b30cf8ca6a1c29fa0d18e.jsonl.gz", "inputs": "reproduction/python/inputs/p02417.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02417_b4a2f6a100e7b36723d529bf95abed8f3c81365ab27266a35eaab453ba0653db.jsonl.gz"}, "slow_code": "from collections import Counter\nimport string\n\ncounter = Counter()\nwhile True:\n try:\n s = input().lower()\n counter += Counter(s)\n except EOFError:\n break\nfor c in string.ascii_lowercase:\n count = counter[c]\n print(f\"{c} : {count}\")\n", "slow_code_sha256": "b4a2f6a100e7b36723d529bf95abed8f3c81365ab27266a35eaab453ba0653db", "slow_id": "p02417_b4a2f6a100e7b36723d529bf95abed8f3c81365ab27266a35eaab453ba0653db", "speedup": 7.943838561894085, "stratum": "4-8", "within_pair_jaccard": 0.4074074074074074, "workload": {"case_count": 100, "description": "Read all text until end of input and count occurrences of each English letter a..z without distinguishing uppercase and lowercase. Other characters do not contribute to the letter counts. Input may contain multiple lines. Observed inputs: lines=1..119 (median 10); content_characters=0..1199 (median 450); ascii_letters=0..1199 (median 300).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1317, "median": 495.0, "min": 1}, "input_format": ["[text lines until EOF]"], "input_format_status": "source_input_section", "input_lines": {"max": 119, "median": 10.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 199, "median": 20.0, "min": 0}}} -{"case_ids": ["p03714_case_000", "p03714_case_001", "p03714_case_002", "p03714_case_003", "p03714_case_004", "p03714_case_005", "p03714_case_006", "p03714_case_007", "p03714_case_008", "p03714_case_009", "p03714_case_010", "p03714_case_011", "p03714_case_012", "p03714_case_013", "p03714_case_014", "p03714_case_015", "p03714_case_016", "p03714_case_017", "p03714_case_018", "p03714_case_019", "p03714_case_020", "p03714_case_021", "p03714_case_022", "p03714_case_023", "p03714_case_024", "p03714_case_025", "p03714_case_026", "p03714_case_027", "p03714_case_028", "p03714_case_029", "p03714_case_030", "p03714_case_031", "p03714_case_032", "p03714_case_033", "p03714_case_034", "p03714_case_035", "p03714_case_036", "p03714_case_037", "p03714_case_038", "p03714_case_039", "p03714_case_040", "p03714_case_041", "p03714_case_042", "p03714_case_043", "p03714_case_044", "p03714_case_045", "p03714_case_046", "p03714_case_047", "p03714_case_048", "p03714_case_049", "p03714_case_050", "p03714_case_051", "p03714_case_052", "p03714_case_053", "p03714_case_054", "p03714_case_055", "p03714_case_056", "p03714_case_057", "p03714_case_058", "p03714_case_059", "p03714_case_060", "p03714_case_061", "p03714_case_062", "p03714_case_063", "p03714_case_064", "p03714_case_065", "p03714_case_066", "p03714_case_067", "p03714_case_068", "p03714_case_069", "p03714_case_070", "p03714_case_071", "p03714_case_072", "p03714_case_073", "p03714_case_074", "p03714_case_075", "p03714_case_076", "p03714_case_077", "p03714_case_078", "p03714_case_079", "p03714_case_080", "p03714_case_081", "p03714_case_082", "p03714_case_083", "p03714_case_084", "p03714_case_085", "p03714_case_086", "p03714_case_087", "p03714_case_088", "p03714_case_089", "p03714_case_090", "p03714_case_091", "p03714_case_092", "p03714_case_093", "p03714_case_094", "p03714_case_095", "p03714_case_096", "p03714_case_097", "p03714_case_098", "p03714_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from heapq import heapify, heappushpop\n\nN, *A = list(map(int, open(0).read().split()))\n\n\ndef f(L):\n q = L[:N]\n heapify(q)\n s = sum(q)\n yield s\n for e in L[N : 2 * N]:\n s += e - heappushpop(q, e)\n yield s\n\n\nprint((max(list(map(sum, list(zip(f(A), list(f([-a for a in A[::-1]]))[::-1])))))))\n", "fast_code_sha256": "3a1eb6709bd3bfa524235e0b0e435f3797e87659b9d563e2efee44635091cee0", "fast_id": "p03714_3a1eb6709bd3bfa524235e0b0e435f3797e87659b9d563e2efee44635091cee0", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from heapq import heapify, heappushpop\n\nN, *A = list(map(int, open(0).read().split()))\n\n\ndef f(L):\n q = L[:N]\n heapify(q)\n s = sum(q)\n yield s\n for e in L[N : 2 * N]:\n s += e - heappushpop(q, e)\n yield s\n\n\nprint((max(list(map(sum, list(zip(f(A), list(f([-a for a in A[::-1]]))[::-1])))))))\n", "measured_fast_code_sha256": "3a1eb6709bd3bfa524235e0b0e435f3797e87659b9d563e2efee44635091cee0", "measured_slow_code": "import heapq\n\n\nclass Heapq:\n def __init__(self, arr, desc=False):\n if desc:\n arr = [-a for a in arr]\n self.sign = -1 if desc else 1\n self.hq = arr\n heapq.heapify(self.hq)\n\n def pop(self):\n return heapq.heappop(self.hq) * self.sign\n\n def push(self, a):\n heapq.heappush(self.hq, a * self.sign)\n\n def top(self):\n return self.hq[0] * self.sign\n\n\nn = int(eval(input()))\nA = list(map(int, input().split()))\nheap_l = Heapq(A[:n])\nheap_r = Heapq(A[2 * n :], desc=True)\nmax_l = [0] * (n + 1)\nmin_r = [0] * (n + 1)\nmax_l[0] = sum(A[:n])\nmin_r[0] = sum(A[2 * n :])\nfor i in range(n):\n p = heap_l.pop()\n heap_l.push(max(A[n + i], p))\n max_l[i + 1] = max_l[i] + max(0, A[n + i] - p)\n q = heap_r.pop()\n heap_r.push(min(A[-1 - i - n], q))\n min_r[i + 1] = min_r[i] + min(0, A[-1 - i - n] - q)\nans = -float(\"inf\")\nfor i in range(n + 1):\n ans = max(ans, max_l[i] - min_r[-1 - i])\nprint(ans)\n", "measured_slow_code_sha256": "52c15ee8927c652bfeaea0aaff5e89fd111ae1ff40ca502171ab521098dbf51d", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.5038825203069974, "pair_id": "python_v2_5a6e785282436b37a5c614d9", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03714", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03714_3a1eb6709bd3bfa524235e0b0e435f3797e87659b9d563e2efee44635091cee0.jsonl.gz", "inputs": "reproduction/python/inputs/p03714.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03714_52c15ee8927c652bfeaea0aaff5e89fd111ae1ff40ca502171ab521098dbf51d.jsonl.gz"}, "slow_code": "import heapq\n\n\nclass Heapq:\n def __init__(self, arr, desc=False):\n if desc:\n arr = [-a for a in arr]\n self.sign = -1 if desc else 1\n self.hq = arr\n heapq.heapify(self.hq)\n\n def pop(self):\n return heapq.heappop(self.hq) * self.sign\n\n def push(self, a):\n heapq.heappush(self.hq, a * self.sign)\n\n def top(self):\n return self.hq[0] * self.sign\n\n\nn = int(eval(input()))\nA = list(map(int, input().split()))\nheap_l = Heapq(A[:n])\nheap_r = Heapq(A[2 * n :], desc=True)\nmax_l = [0] * (n + 1)\nmin_r = [0] * (n + 1)\nmax_l[0] = sum(A[:n])\nmin_r[0] = sum(A[2 * n :])\nfor i in range(n):\n p = heap_l.pop()\n heap_l.push(max(A[n + i], p))\n max_l[i + 1] = max_l[i] + max(0, A[n + i] - p)\n q = heap_r.pop()\n heap_r.push(min(A[-1 - i - n], q))\n min_r[i + 1] = min_r[i] + min(0, A[-1 - i - n] - q)\nans = -float(\"inf\")\nfor i in range(n + 1):\n ans = max(ans, max_l[i] - min_r[-1 - i])\nprint(ans)\n", "slow_code_sha256": "52c15ee8927c652bfeaea0aaff5e89fd111ae1ff40ca502171ab521098dbf51d", "slow_id": "p03714_52c15ee8927c652bfeaea0aaff5e89fd111ae1ff40ca502171ab521098dbf51d", "speedup": 2.580694266096673, "stratum": "2-4", "within_pair_jaccard": 0.3064516129032258, "workload": {"case_count": 100, "description": "Remove exactly N entries from a length-3N integer sequence without reordering. Among the remaining 2N entries, maximize the sum of the first N minus the sum of the last N. Observed inputs: N=1..100000 (median 1000); input_elements=3..300000; a_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 3300007, "median": 29672.0, "min": 8}, "input_format": ["N\na_1 ... a_(3N)"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 300001, "median": 3001.0, "min": 4}}} -{"case_ids": ["p04015_case_000", "p04015_case_001", "p04015_case_002", "p04015_case_003", "p04015_case_004", "p04015_case_005", "p04015_case_006", "p04015_case_007", "p04015_case_008", "p04015_case_009", "p04015_case_010", "p04015_case_011", "p04015_case_012", "p04015_case_013", "p04015_case_014", "p04015_case_015", "p04015_case_016", "p04015_case_017", "p04015_case_018", "p04015_case_019", "p04015_case_020", "p04015_case_021", "p04015_case_022", "p04015_case_023", "p04015_case_024", "p04015_case_025", "p04015_case_026", "p04015_case_028", "p04015_case_029", "p04015_case_030", "p04015_case_031", "p04015_case_032", "p04015_case_033", "p04015_case_034", "p04015_case_035", "p04015_case_036", "p04015_case_037", "p04015_case_038", "p04015_case_039", "p04015_case_040", "p04015_case_041", "p04015_case_042", "p04015_case_043", "p04015_case_044", "p04015_case_045", "p04015_case_046", "p04015_case_047", "p04015_case_048", "p04015_case_049", "p04015_case_050", "p04015_case_051", "p04015_case_052", "p04015_case_053", "p04015_case_054", "p04015_case_055", "p04015_case_056", "p04015_case_057", "p04015_case_058", "p04015_case_059", "p04015_case_060", "p04015_case_061", "p04015_case_062", "p04015_case_063", "p04015_case_064", "p04015_case_065", "p04015_case_067", "p04015_case_068", "p04015_case_069", "p04015_case_070", "p04015_case_071", "p04015_case_072", "p04015_case_073", "p04015_case_074", "p04015_case_075", "p04015_case_077", "p04015_case_078", "p04015_case_079", "p04015_case_080", "p04015_case_081", "p04015_case_082", "p04015_case_083", "p04015_case_086", "p04015_case_087", "p04015_case_088", "p04015_case_089", "p04015_case_090", "p04015_case_091", "p04015_case_092", "p04015_case_093", "p04015_case_094", "p04015_case_095", "p04015_case_096", "p04015_case_097", "p04015_case_098", "p04015_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 95, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n, a = list(map(int, input().split()))\nfrom collections import defaultdict\n\ndp = defaultdict(int)\ndp[0] = 1\nfor i in map(int, input().split()):\n i -= a\n for k in sorted(list(dp.keys()), reverse=(i >= 0)):\n dp[k + i] += dp[k]\nprint((dp[0] - 1))\n", "fast_code_sha256": "12469791a2e092016f2a21831341c6685a47fc7e9d175322b3c48450cf8e40c9", "fast_id": "p04015_12469791a2e092016f2a21831341c6685a47fc7e9d175322b3c48450cf8e40c9", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n, a = list(map(int, input().split()))\nfrom collections import defaultdict\n\ndp = defaultdict(int)\ndp[0] = 1\nfor i in map(int, input().split()):\n i -= a\n for k in sorted(list(dp.keys()), reverse=(i >= 0)):\n dp[k + i] += dp[k]\nprint((dp[0] - 1))\n", "measured_fast_code_sha256": "12469791a2e092016f2a21831341c6685a47fc7e9d175322b3c48450cf8e40c9", "measured_slow_code": "#!usr/bin/env python3\nfrom collections import defaultdict, deque, Counter, OrderedDict\nfrom bisect import bisect_left, bisect_right\nfrom functools import reduce, lru_cache\nfrom heapq import heappush, heappop, heapify\nimport itertools\nimport math, fractions\nimport sys, copy\n\n\ndef L():\n return sys.stdin.readline().split()\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\ndef SL():\n return list(sys.stdin.readline().rstrip())\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef LI1():\n return [int(x) - 1 for x in sys.stdin.readline().split()]\n\n\ndef LS():\n return [list(x) for x in sys.stdin.readline().split()]\n\n\ndef R(n):\n return [sys.stdin.readline().strip() for _ in range(n)]\n\n\ndef LR(n):\n return [L() for _ in range(n)]\n\n\ndef IR(n):\n return [I() for _ in range(n)]\n\n\ndef LIR(n):\n return [LI() for _ in range(n)]\n\n\ndef LIR1(n):\n return [LI1() for _ in range(n)]\n\n\ndef SLR(n):\n return [SL() for _ in range(n)]\n\n\ndef LSR(n):\n return [LS() for _ in range(n)]\n\n\ndef perm(n, r):\n return math.factorial(n) // math.factorial(r)\n\n\ndef comb(n, r):\n return math.factorial(n) // (math.factorial(r) * math.factorial(n - r))\n\n\ndef make_list(n, *args, default=0):\n return (\n [make_list(*args, default=default) for _ in range(n)]\n if args\n else [default for _ in range(n)]\n )\n\n\ndire = [[1, 0], [0, 1], [-1, 0], [0, -1]]\ndire8 = [[1, 0], [1, 1], [0, 1], [-1, 1], [-1, 0], [-1, -1], [0, -1], [1, -1]]\nalphabets = \"abcdefghijklmnopqrstuvwxyz\"\nALPHABETS = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\nMOD = 1000000007\nINF = float(\"inf\")\nsys.setrecursionlimit(1000000)\n\n\ndef main():\n N, A = LI()\n X = LI()\n dp = make_list(N + 1, N + 1, 2501)\n dp[0][0][0] = 1\n for i in range(1, N + 1):\n for k in range(i + 1):\n for s in range(2501):\n if X[i - 1] > s:\n dp[i][k][s] = dp[i - 1][k][s]\n else:\n dp[i][k][s] = dp[i - 1][k][s] + dp[i - 1][k - 1][s - X[i - 1]]\n print((sum(dp[N][k][k * A] for k in range(1, N + 1))))\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "8b45717994a5fb48dc2b76199b10d5e4e202c9ce5463bf7869f8add9172f6ff7", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 352.9266117773729, "pair_id": "python_v2_f2e70281f8e15682661cca6a", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p04015", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p04015_12469791a2e092016f2a21831341c6685a47fc7e9d175322b3c48450cf8e40c9.jsonl.gz", "inputs": "reproduction/python/inputs/p04015.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p04015_8b45717994a5fb48dc2b76199b10d5e4e202c9ce5463bf7869f8add9172f6ff7.jsonl.gz"}, "slow_code": "from collections import defaultdict, deque, Counter, OrderedDict\nfrom bisect import bisect_left, bisect_right\nfrom functools import reduce, lru_cache\nfrom heapq import heappush, heappop, heapify\nimport itertools\nimport math, fractions\nimport sys, copy\n\n\ndef L():\n return sys.stdin.readline().split()\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\ndef SL():\n return list(sys.stdin.readline().rstrip())\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef LI1():\n return [int(x) - 1 for x in sys.stdin.readline().split()]\n\n\ndef LS():\n return [list(x) for x in sys.stdin.readline().split()]\n\n\ndef R(n):\n return [sys.stdin.readline().strip() for _ in range(n)]\n\n\ndef LR(n):\n return [L() for _ in range(n)]\n\n\ndef IR(n):\n return [I() for _ in range(n)]\n\n\ndef LIR(n):\n return [LI() for _ in range(n)]\n\n\ndef LIR1(n):\n return [LI1() for _ in range(n)]\n\n\ndef SLR(n):\n return [SL() for _ in range(n)]\n\n\ndef LSR(n):\n return [LS() for _ in range(n)]\n\n\ndef perm(n, r):\n return math.factorial(n) // math.factorial(r)\n\n\ndef comb(n, r):\n return math.factorial(n) // (math.factorial(r) * math.factorial(n - r))\n\n\ndef make_list(n, *args, default=0):\n return (\n [make_list(*args, default=default) for _ in range(n)]\n if args\n else [default for _ in range(n)]\n )\n\n\ndire = [[1, 0], [0, 1], [-1, 0], [0, -1]]\ndire8 = [[1, 0], [1, 1], [0, 1], [-1, 1], [-1, 0], [-1, -1], [0, -1], [1, -1]]\nalphabets = \"abcdefghijklmnopqrstuvwxyz\"\nALPHABETS = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\nMOD = 1000000007\nINF = float(\"inf\")\nsys.setrecursionlimit(1000000)\n\n\ndef main():\n N, A = LI()\n X = LI()\n dp = make_list(N + 1, N + 1, 2501)\n dp[0][0][0] = 1\n for i in range(1, N + 1):\n for k in range(i + 1):\n for s in range(2501):\n if X[i - 1] > s:\n dp[i][k][s] = dp[i - 1][k][s]\n else:\n dp[i][k][s] = dp[i - 1][k][s] + dp[i - 1][k - 1][s - X[i - 1]]\n print((sum(dp[N][k][k * A] for k in range(1, N + 1))))\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "22f4d78fa24186375c05f8fb9209c535a507fc44a1c54caed7cae5ab1b3bfa98", "slow_id": "p04015_8b45717994a5fb48dc2b76199b10d5e4e202c9ce5463bf7869f8add9172f6ff7", "speedup": 542.445820537141, "stratum": "8+", "within_pair_jaccard": 0.17204301075268819, "workload": {"case_count": 95, "description": "Count nonempty subsets of N indexed cards whose values x_i have arithmetic mean exactly A. Cards with equal values but different indices are distinct choices. Observed inputs: N=1..50 (median 50); A=1..50 (median 25); x_i=1..50.", "description_revision": "semantic-review-20261020", "distinct_input_count": 95, "input_bytes": {"max": 156, "median": 105, "min": 6}, "input_format": ["N A\nx_1 ... x_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 52, "median": 52, "min": 3}}} -{"case_ids": ["p02830_case_000", "p02830_case_001", "p02830_case_002", "p02830_case_003", "p02830_case_004", "p02830_case_005", "p02830_case_006", "p02830_case_007", "p02830_case_008", "p02830_case_009", "p02830_case_010", "p02830_case_011", "p02830_case_012", "p02830_case_013", "p02830_case_014", "p02830_case_015", "p02830_case_016", "p02830_case_017", "p02830_case_018", "p02830_case_019", "p02830_case_020", "p02830_case_021", "p02830_case_022", "p02830_case_023", "p02830_case_024", "p02830_case_025", "p02830_case_026", "p02830_case_027", "p02830_case_028", "p02830_case_029", "p02830_case_030", "p02830_case_031", "p02830_case_032", "p02830_case_033", "p02830_case_034", "p02830_case_035", "p02830_case_036", "p02830_case_037", "p02830_case_038", "p02830_case_039", "p02830_case_040", "p02830_case_041", "p02830_case_042", "p02830_case_043", "p02830_case_044", "p02830_case_045", "p02830_case_046", "p02830_case_047", "p02830_case_048", "p02830_case_049", "p02830_case_050", "p02830_case_051", "p02830_case_052", "p02830_case_053", "p02830_case_054", "p02830_case_055", "p02830_case_056", "p02830_case_057", "p02830_case_058", "p02830_case_059", "p02830_case_060", "p02830_case_061", "p02830_case_062", "p02830_case_063", "p02830_case_064", "p02830_case_065", "p02830_case_066", "p02830_case_067", "p02830_case_068", "p02830_case_069", "p02830_case_070", "p02830_case_071", "p02830_case_072", "p02830_case_073", "p02830_case_074", "p02830_case_075", "p02830_case_076", "p02830_case_077", "p02830_case_078", "p02830_case_079", "p02830_case_080", "p02830_case_081", "p02830_case_082", "p02830_case_083", "p02830_case_084", "p02830_case_085", "p02830_case_086", "p02830_case_087", "p02830_case_088", "p02830_case_089", "p02830_case_090", "p02830_case_091", "p02830_case_092", "p02830_case_093", "p02830_case_094", "p02830_case_095", "p02830_case_096", "p02830_case_097", "p02830_case_098", "p02830_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\nN = int(input())\nS, T = input().split()\nif not (1 <= N <= 100):\n sys.exit()\nif not (len(S) == len(T) and len(S) == N):\n sys.exit()\nif not (S.islower() and T.islower()):\n sys.exit()\nfor I in range(N):\n print(S[I], end=\"\")\n print(T[I], end=\"\")\n", "fast_code_sha256": "8d636eca134cf8aabca8c761109550ad7a2aaddb74603d946dc42ab021814e9f", "fast_id": "p02830_8d636eca134cf8aabca8c761109550ad7a2aaddb74603d946dc42ab021814e9f", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\nN = int(input())\nS, T = input().split()\nif not (1 <= N <= 100):\n sys.exit()\nif not (len(S) == len(T) and len(S) == N):\n sys.exit()\nif not (S.islower() and T.islower()):\n sys.exit()\nfor I in range(N):\n print(S[I], end=\"\")\n print(T[I], end=\"\")\n", "measured_fast_code_sha256": "8d636eca134cf8aabca8c761109550ad7a2aaddb74603d946dc42ab021814e9f", "measured_slow_code": "from collections import Counter, defaultdict, deque\nfrom heapq import heappop, heappush\nfrom bisect import bisect_left, bisect_right\nimport sys, math, itertools, fractions\n\nsys.setrecursionlimit(10**8)\nmod = 10**9 + 7\nINF = float(\"inf\")\n\n\ndef inp():\n return int(sys.stdin.readline())\n\n\ndef inpl():\n return list(map(int, sys.stdin.readline().split()))\n\n\nn = inp()\ns, t = input().split()\nprint((\"\".join([s[i] + t[i] for i in range(n)])))\n", "measured_slow_code_sha256": "992e686444192fb7564ecff1647d9aa6e75db539811d55b3349d5f91772e9ce3", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 11.91451109190628, "pair_id": "python_v2_c3344f5001d4bd8d9155d32a", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02830", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02830_8d636eca134cf8aabca8c761109550ad7a2aaddb74603d946dc42ab021814e9f.jsonl.gz", "inputs": "reproduction/python/inputs/p02830.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02830_992e686444192fb7564ecff1647d9aa6e75db539811d55b3349d5f91772e9ce3.jsonl.gz"}, "slow_code": "from collections import Counter, defaultdict, deque\nfrom heapq import heappop, heappush\nfrom bisect import bisect_left, bisect_right\nimport sys, math, itertools, fractions\n\nsys.setrecursionlimit(10**8)\nmod = 10**9 + 7\nINF = float(\"inf\")\n\n\ndef inp():\n return int(sys.stdin.readline())\n\n\ndef inpl():\n return list(map(int, sys.stdin.readline().split()))\n\n\nn = inp()\ns, t = input().split()\nprint((\"\".join([s[i] + t[i] for i in range(n)])))\n", "slow_code_sha256": "992e686444192fb7564ecff1647d9aa6e75db539811d55b3349d5f91772e9ce3", "slow_id": "p02830_992e686444192fb7564ecff1647d9aa6e75db539811d55b3349d5f91772e9ce3", "speedup": 12.797405212058518, "stratum": "8+", "within_pair_jaccard": 0.15517241379310345, "workload": {"case_count": 100, "description": "Interleave two lowercase strings S and T, both of length N, taking S_1,T_1,S_2,T_2,...,S_N,T_N. Observed inputs: N=1..100 (median 50).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 206, "median": 105.0, "min": 6}, "input_format": ["N\nS T"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3, "median": 3.0, "min": 3}}} -{"case_ids": ["p03329_case_000", "p03329_case_001", "p03329_case_002", "p03329_case_003", "p03329_case_004", "p03329_case_005", "p03329_case_006", "p03329_case_007", "p03329_case_008", "p03329_case_009", "p03329_case_010", "p03329_case_011", "p03329_case_012", "p03329_case_013", "p03329_case_014", "p03329_case_015", "p03329_case_016", "p03329_case_017", "p03329_case_018", "p03329_case_019", "p03329_case_020", "p03329_case_021", "p03329_case_022", "p03329_case_023", "p03329_case_024", "p03329_case_025", "p03329_case_026", "p03329_case_027", "p03329_case_028", "p03329_case_029", "p03329_case_030", "p03329_case_031", "p03329_case_032", "p03329_case_033", "p03329_case_034", "p03329_case_035", "p03329_case_036", "p03329_case_037", "p03329_case_038", "p03329_case_039", "p03329_case_040", "p03329_case_041", "p03329_case_042", "p03329_case_043", "p03329_case_044", "p03329_case_045", "p03329_case_046", "p03329_case_047", "p03329_case_048", "p03329_case_049", "p03329_case_050", "p03329_case_051", "p03329_case_052", "p03329_case_053", "p03329_case_054", "p03329_case_055", "p03329_case_056", "p03329_case_057", "p03329_case_058", "p03329_case_059", "p03329_case_060", "p03329_case_061", "p03329_case_062", "p03329_case_063", "p03329_case_064", "p03329_case_065", "p03329_case_066", "p03329_case_067", "p03329_case_068", "p03329_case_069", "p03329_case_070", "p03329_case_071", "p03329_case_072", "p03329_case_073", "p03329_case_074", "p03329_case_075", "p03329_case_076", "p03329_case_077", "p03329_case_078", "p03329_case_079", "p03329_case_080", "p03329_case_081", "p03329_case_082", "p03329_case_083", "p03329_case_084", "p03329_case_085", "p03329_case_086", "p03329_case_087", "p03329_case_088", "p03329_case_089", "p03329_case_090", "p03329_case_091", "p03329_case_092", "p03329_case_093", "p03329_case_094", "p03329_case_095", "p03329_case_096", "p03329_case_097", "p03329_case_098", "p03329_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\nn = int(sys.stdin.readline().rstrip())\n\n\ndef main():\n bit6 = [0] * 8\n bit9 = [0] * 7\n b = n\n for i in range(5, -1, -1):\n q, r = divmod(b, 9**i)\n bit9[i] = q\n b = r\n res = sum(bit6) + sum(bit9)\n for _ in range(n):\n i = 0\n while True:\n bit6[i] += 1\n if bit6[i] == 6:\n bit6[i] = 0\n i += 1\n else:\n break\n i = 0\n while True:\n bit9[i] -= 1\n if bit9[i] == -1:\n bit9[i] = 8\n i += 1\n else:\n break\n res = min(res, sum(bit6) + sum(bit9))\n return res\n\n\nif __name__ == \"__main__\":\n ans = main()\n print(ans)\n", "fast_code_sha256": "c4d631bb5c78c10e90288d6aa19f918890282bdae31680faa88b6bf837857102", "fast_id": "p03329_c4d631bb5c78c10e90288d6aa19f918890282bdae31680faa88b6bf837857102", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\nn = int(sys.stdin.readline().rstrip())\n\n\ndef main():\n bit6 = [0] * 8\n bit9 = [0] * 7\n b = n\n for i in range(5, -1, -1):\n q, r = divmod(b, 9**i)\n bit9[i] = q\n b = r\n res = sum(bit6) + sum(bit9)\n for _ in range(n):\n i = 0\n while True:\n bit6[i] += 1\n if bit6[i] == 6:\n bit6[i] = 0\n i += 1\n else:\n break\n i = 0\n while True:\n bit9[i] -= 1\n if bit9[i] == -1:\n bit9[i] = 8\n i += 1\n else:\n break\n res = min(res, sum(bit6) + sum(bit9))\n return res\n\n\nif __name__ == \"__main__\":\n ans = main()\n print(ans)\n", "measured_fast_code_sha256": "c4d631bb5c78c10e90288d6aa19f918890282bdae31680faa88b6bf837857102", "measured_slow_code": "n = int(eval(input()))\ndp = [float(\"inf\")] * 100010\ndp[0] = 0\nfor i in range(1, 100000 + 1):\n power = 1\n while power <= i:\n dp[i] = min(dp[i], dp[i - power] + 1)\n power *= 6\n power = 1\n while power <= i:\n dp[i] = min(dp[i], dp[i - power] + 1)\n power *= 9\nprint((dp[n]))\n", "measured_slow_code_sha256": "d420a4a47c3d63ccc8bf0d67f00fb6eac614ba4a541aaa7d9741e0a6de148e33", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 143.8801210646306, "pair_id": "python_v2_189eff636711362ab16417a6", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03329", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03329_c4d631bb5c78c10e90288d6aa19f918890282bdae31680faa88b6bf837857102.jsonl.gz", "inputs": "reproduction/python/inputs/p03329.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03329_d420a4a47c3d63ccc8bf0d67f00fb6eac614ba4a541aaa7d9741e0a6de148e33.jsonl.gz"}, "slow_code": "n = int(eval(input()))\ndp = [float(\"inf\")] * 100010\ndp[0] = 0\nfor i in range(1, 100000 + 1):\n power = 1\n while power <= i:\n dp[i] = min(dp[i], dp[i - power] + 1)\n power *= 6\n power = 1\n while power <= i:\n dp[i] = min(dp[i], dp[i - power] + 1)\n power *= 9\nprint((dp[n]))\n", "slow_code_sha256": "d420a4a47c3d63ccc8bf0d67f00fb6eac614ba4a541aaa7d9741e0a6de148e33", "slow_id": "p03329_d420a4a47c3d63ccc8bf0d67f00fb6eac614ba4a541aaa7d9741e0a6de148e33", "speedup": 260.1456959017314, "stratum": "8+", "within_pair_jaccard": 0.2708333333333333, "workload": {"case_count": 100, "description": "Withdraw exactly N units with minimum operations. Each operation withdraws 1, a positive integer power of 6, or a positive integer power of 9. Withdrawn money cannot be redeposited. Observed inputs: N=1..100000 (median 5282.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 7, "median": 5.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p02554_case_000", "p02554_case_001", "p02554_case_002", "p02554_case_003", "p02554_case_004", "p02554_case_005", "p02554_case_006", "p02554_case_007", "p02554_case_008", "p02554_case_009", "p02554_case_010", "p02554_case_011", "p02554_case_012", "p02554_case_013", "p02554_case_014", "p02554_case_015", "p02554_case_016", "p02554_case_017", "p02554_case_018", "p02554_case_019", "p02554_case_020", "p02554_case_021", "p02554_case_022", "p02554_case_023", "p02554_case_024", "p02554_case_025", "p02554_case_026", "p02554_case_027", "p02554_case_028", "p02554_case_029", "p02554_case_030", "p02554_case_031", "p02554_case_032", "p02554_case_033", "p02554_case_034", "p02554_case_035", "p02554_case_036", "p02554_case_037", "p02554_case_038", "p02554_case_039", "p02554_case_040", "p02554_case_041", "p02554_case_042", "p02554_case_043", "p02554_case_044", "p02554_case_045", "p02554_case_046", "p02554_case_047", "p02554_case_048", "p02554_case_049", "p02554_case_050", "p02554_case_051", "p02554_case_052", "p02554_case_053", "p02554_case_054", "p02554_case_055", "p02554_case_056", "p02554_case_057", "p02554_case_058", "p02554_case_059", "p02554_case_060", "p02554_case_061", "p02554_case_062", "p02554_case_063", "p02554_case_064", "p02554_case_065", "p02554_case_066", "p02554_case_067", "p02554_case_068", "p02554_case_069", "p02554_case_070", "p02554_case_071", "p02554_case_072", "p02554_case_073", "p02554_case_074", "p02554_case_075", "p02554_case_076", "p02554_case_077", "p02554_case_078", "p02554_case_079", "p02554_case_080", "p02554_case_081", "p02554_case_082", "p02554_case_083", "p02554_case_084", "p02554_case_085", "p02554_case_086", "p02554_case_087", "p02554_case_088", "p02554_case_089", "p02554_case_090", "p02554_case_091", "p02554_case_092", "p02554_case_093", "p02554_case_094", "p02554_case_095", "p02554_case_096", "p02554_case_097", "p02554_case_098", "p02554_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "executable_AST_equal_except_explicit_explanatory_string_removal_and_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\nmod = 10**9 + 7\nans = pow(10, n, mod)\nans -= pow(9, n, mod) * 2\nans += pow(8, n, mod)\nprint((ans % mod))\n", "fast_code_sha256": "7d6fb2a7a688b9582d1be0fb50c584d1e4eddb0670ea44c1457914dfb3881202", "fast_id": "p02554_7d6fb2a7a688b9582d1be0fb50c584d1e4eddb0670ea44c1457914dfb3881202", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\nmod = 10**9 + 7\nans = pow(10, n, mod)\nans -= pow(9, n, mod) * 2\nans += pow(8, n, mod)\nprint((ans % mod))\n", "measured_fast_code_sha256": "7d6fb2a7a688b9582d1be0fb50c584d1e4eddb0670ea44c1457914dfb3881202", "measured_slow_code": "MOD = 10**9 + 7\n\n\ndef solve(n):\n \"\"\"\n 0: {}\n 1: {0}\n 2: {9}\n 3: {0,9}\n \"\"\"\n dp = [[0] * 4 for i in range(n + 1)]\n dp[0][0] = 1\n for i in range(n):\n dp[i + 1][3] = (10 * dp[i][3] + dp[i][2] + dp[i][1]) % MOD\n dp[i + 1][2] = (9 * dp[i][2] + dp[i][0]) % MOD\n dp[i + 1][1] = (9 * dp[i][1] + dp[i][0]) % MOD\n dp[i + 1][0] = (8 * dp[i][0]) % MOD\n return dp[n][3]\n\n\nn = int(eval(input()))\nprint((solve(n)))\n", "measured_slow_code_sha256": "1216aa013ca95268c8cea10ef1956fc82ecf53c33048dc021f31f4ae82487ba4", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 9819.197817373259, "pair_id": "python_v2_4fbafef4ef4b33a7ce2528ec", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02554", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02554_7d6fb2a7a688b9582d1be0fb50c584d1e4eddb0670ea44c1457914dfb3881202.jsonl.gz", "inputs": "reproduction/python/inputs/p02554.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02554_1216aa013ca95268c8cea10ef1956fc82ecf53c33048dc021f31f4ae82487ba4.jsonl.gz"}, "slow_code": "MOD = 10**9 + 7\n\n\ndef solve(n):\n dp = [[0] * 4 for i in range(n + 1)]\n dp[0][0] = 1\n for i in range(n):\n dp[i + 1][3] = (10 * dp[i][3] + dp[i][2] + dp[i][1]) % MOD\n dp[i + 1][2] = (9 * dp[i][2] + dp[i][0]) % MOD\n dp[i + 1][1] = (9 * dp[i][1] + dp[i][0]) % MOD\n dp[i + 1][0] = (8 * dp[i][0]) % MOD\n return dp[n][3]\n\n\nn = int(eval(input()))\nprint((solve(n)))\n", "slow_code_sha256": "d34cbcef17a1809eb9aaea9acac748f4f348edb348ac1a61f3b30198ffe07352", "slow_id": "p02554_1216aa013ca95268c8cea10ef1956fc82ecf53c33048dc021f31f4ae82487ba4", "speedup": 1870.0137850250967, "stratum": "8+", "within_pair_jaccard": 0.38461538461538464, "workload": {"case_count": 100, "description": "Count length-N sequences over digits 0..9 containing both 0 and 9, modulo 1000000007. Observed inputs: N=1..1000000 (median 299407).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 8, "median": 7.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p00008_case_000", "p00008_case_001", "p00008_case_002", "p00008_case_003", "p00008_case_004", "p00008_case_005", "p00008_case_006", "p00008_case_007", "p00008_case_008", "p00008_case_009", "p00008_case_010", "p00008_case_011", "p00008_case_012", "p00008_case_013", "p00008_case_014", "p00008_case_015", "p00008_case_016", "p00008_case_017", "p00008_case_018", "p00008_case_019", "p00008_case_020", "p00008_case_021", "p00008_case_022", "p00008_case_023", "p00008_case_024", "p00008_case_025", "p00008_case_026", "p00008_case_027", "p00008_case_028", "p00008_case_029", "p00008_case_030", "p00008_case_031", "p00008_case_032", "p00008_case_033", "p00008_case_034", "p00008_case_035", "p00008_case_036", "p00008_case_037", "p00008_case_038", "p00008_case_039", "p00008_case_040", "p00008_case_041", "p00008_case_042", "p00008_case_043", "p00008_case_044", "p00008_case_045", "p00008_case_046", "p00008_case_047", "p00008_case_048", "p00008_case_049", "p00008_case_050", "p00008_case_051", "p00008_case_052", "p00008_case_053", "p00008_case_054", "p00008_case_055", "p00008_case_056", "p00008_case_057", "p00008_case_058", "p00008_case_059", "p00008_case_060", "p00008_case_061", "p00008_case_062", "p00008_case_063", "p00008_case_064", "p00008_case_065", "p00008_case_066", "p00008_case_067", "p00008_case_068", "p00008_case_069", "p00008_case_070", "p00008_case_071", "p00008_case_072", "p00008_case_073", "p00008_case_074", "p00008_case_075", "p00008_case_076", "p00008_case_077", "p00008_case_078", "p00008_case_079", "p00008_case_080", "p00008_case_081", "p00008_case_082", "p00008_case_083", "p00008_case_084", "p00008_case_085", "p00008_case_086", "p00008_case_087", "p00008_case_088", "p00008_case_089", "p00008_case_090", "p00008_case_091", "p00008_case_092", "p00008_case_093", "p00008_case_094", "p00008_case_095", "p00008_case_096", "p00008_case_097", "p00008_case_098", "p00008_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "memo = [[-1] * 51 for i in range(5)]\n\n\ndef rec(i, n):\n if memo[i][n] != -1:\n return memo[i][n]\n r = 0\n if i == 4:\n return 1 if n == 0 else 0\n for m in range(10):\n r += rec(i + 1, n - m)\n memo[i][n] = r\n return r\n\n\nwhile True:\n try:\n n = int(eval(input()))\n print((rec(0, n)))\n except:\n break\n", "fast_code_sha256": "e77d9ebb179f60c008b7919cca4d560cd519aaf12aca2f4cea32c490d524e154", "fast_id": "p00008_e77d9ebb179f60c008b7919cca4d560cd519aaf12aca2f4cea32c490d524e154", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "memo = [[-1] * 51 for i in range(5)]\n\n\ndef rec(i, n):\n if memo[i][n] != -1:\n return memo[i][n]\n r = 0\n if i == 4:\n return 1 if n == 0 else 0\n for m in range(10):\n r += rec(i + 1, n - m)\n memo[i][n] = r\n return r\n\n\nwhile True:\n try:\n n = int(eval(input()))\n print((rec(0, n)))\n except:\n break\n", "measured_fast_code_sha256": "e77d9ebb179f60c008b7919cca4d560cd519aaf12aca2f4cea32c490d524e154", "measured_slow_code": "import sys, itertools\n\nfor n in map(int, sys.stdin):\n x = 0\n for num in itertools.product(\"0123456789\", repeat=4):\n eq = \"{}+{}+{}+{}\".format(*(num))\n if eval(eq) == n:\n x += 1\n print(x)\n", "measured_slow_code_sha256": "f78324b8c1f2014a7fb42b155a7df64e78b2806e6504b01d6dd4fa1d3a1e1f70", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 816.736041949626, "pair_id": "python_v2_b84098b99e0e6df48a2ec711", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p00008", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p00008_e77d9ebb179f60c008b7919cca4d560cd519aaf12aca2f4cea32c490d524e154.jsonl.gz", "inputs": "reproduction/python/inputs/p00008.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p00008_f78324b8c1f2014a7fb42b155a7df64e78b2806e6504b01d6dd4fa1d3a1e1f70.jsonl.gz"}, "slow_code": "import sys, itertools\n\nfor n in map(int, sys.stdin):\n x = 0\n for num in itertools.product(\"0123456789\", repeat=4):\n eq = \"{}+{}+{}+{}\".format(*(num))\n if eval(eq) == n:\n x += 1\n print(x)\n", "slow_code_sha256": "f78324b8c1f2014a7fb42b155a7df64e78b2806e6504b01d6dd4fa1d3a1e1f70", "slow_id": "p00008_f78324b8c1f2014a7fb42b155a7df64e78b2806e6504b01d6dd4fa1d3a1e1f70", "speedup": 875.5359345400536, "stratum": "8+", "within_pair_jaccard": 0.25, "workload": {"case_count": 100, "description": "For each target n, count ordered quadruples of decimal digits a,b,c,d in 0..9 whose sum is n. Targets are given one per line until end of input. Observed inputs: datasets=1..50 (median 10); n=1..50.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 150, "median": 26.5, "min": 2}, "input_format": ["n_1\n...\nn_D (until EOF)"], "input_format_status": "source_input_section", "input_lines": {"max": 50, "median": 10.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 50, "median": 10.0, "min": 1}}} -{"case_ids": ["p02394_case_000", "p02394_case_001", "p02394_case_002", "p02394_case_003", "p02394_case_004", "p02394_case_005", "p02394_case_006", "p02394_case_007", "p02394_case_008", "p02394_case_009", "p02394_case_010", "p02394_case_011", "p02394_case_012", "p02394_case_013", "p02394_case_014", "p02394_case_015", "p02394_case_016", "p02394_case_017", "p02394_case_018", "p02394_case_019", "p02394_case_020", "p02394_case_021", "p02394_case_022", "p02394_case_023", "p02394_case_024", "p02394_case_025", "p02394_case_026", "p02394_case_027", "p02394_case_028", "p02394_case_029", "p02394_case_030", "p02394_case_031", "p02394_case_032", "p02394_case_033", "p02394_case_034", "p02394_case_035", "p02394_case_036", "p02394_case_037", "p02394_case_038", "p02394_case_039", "p02394_case_040", "p02394_case_041", "p02394_case_042", "p02394_case_043", "p02394_case_044", "p02394_case_045", "p02394_case_046", "p02394_case_047", "p02394_case_048", "p02394_case_049", "p02394_case_050", "p02394_case_051", "p02394_case_052", "p02394_case_053", "p02394_case_054", "p02394_case_055", "p02394_case_056", "p02394_case_057", "p02394_case_058", "p02394_case_059", "p02394_case_060", "p02394_case_061", "p02394_case_062", "p02394_case_063", "p02394_case_064", "p02394_case_065", "p02394_case_066", "p02394_case_067", "p02394_case_068", "p02394_case_069", "p02394_case_070", "p02394_case_071", "p02394_case_072", "p02394_case_073", "p02394_case_074", "p02394_case_075", "p02394_case_076", "p02394_case_077", "p02394_case_078", "p02394_case_079", "p02394_case_080", "p02394_case_081", "p02394_case_082", "p02394_case_083", "p02394_case_084", "p02394_case_085", "p02394_case_086", "p02394_case_087", "p02394_case_088", "p02394_case_089", "p02394_case_090", "p02394_case_091", "p02394_case_092", "p02394_case_093", "p02394_case_094", "p02394_case_095", "p02394_case_096", "p02394_case_097", "p02394_case_098", "p02394_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "W, H, x, y, r = [int(i) for i in input().split()]\nif x + r <= W and y - r >= 0 and x - r >= 0 and y + r <= H:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "fast_code_sha256": "0aa174b9082b11f64d5fcfd3c15493df0e4f436c1eeb2ae7330b5ff92b0fa112", "fast_id": "p02394_0aa174b9082b11f64d5fcfd3c15493df0e4f436c1eeb2ae7330b5ff92b0fa112", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "W, H, x, y, r = [int(i) for i in input().split()]\nif x + r <= W and y - r >= 0 and x - r >= 0 and y + r <= H:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "measured_fast_code_sha256": "0aa174b9082b11f64d5fcfd3c15493df0e4f436c1eeb2ae7330b5ff92b0fa112", "measured_slow_code": "# coding: utf-8\n# Here your code !\nimport math\n\n\ndef func():\n try:\n line = input().rstrip()\n numbers = line.split(\" \")\n width = float(numbers[0])\n height = float(numbers[1])\n x = float(numbers[2])\n y = float(numbers[3])\n r = abs(float(numbers[4]))\n except:\n print(\"input error\")\n return -1\n wsign = math.copysign(1, width)\n hsign = math.copysign(1, height)\n result = wsign * x + r <= wsign * width\n result = result and (wsign * x - r >= 0)\n result = result and (hsign * y + r <= hsign * height)\n result = result and (hsign * y - r >= 0)\n if result:\n print(\"Yes\")\n else:\n print(\"No\")\n\n\nfunc()\n", "measured_slow_code_sha256": "c88e86f1ad95ddc817ad7ba81628e2daf211ff2d39c36960f050623a40ae12a3", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.5053066476967, "pair_id": "python_v2_e9800bb7661e40e89f14f3f4", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02394", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02394_0aa174b9082b11f64d5fcfd3c15493df0e4f436c1eeb2ae7330b5ff92b0fa112.jsonl.gz", "inputs": "reproduction/python/inputs/p02394.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02394_c88e86f1ad95ddc817ad7ba81628e2daf211ff2d39c36960f050623a40ae12a3.jsonl.gz"}, "slow_code": "import math\n\n\ndef func():\n try:\n line = input().rstrip()\n numbers = line.split(\" \")\n width = float(numbers[0])\n height = float(numbers[1])\n x = float(numbers[2])\n y = float(numbers[3])\n r = abs(float(numbers[4]))\n except:\n print(\"input error\")\n return -1\n wsign = math.copysign(1, width)\n hsign = math.copysign(1, height)\n result = wsign * x + r <= wsign * width\n result = result and (wsign * x - r >= 0)\n result = result and (hsign * y + r <= hsign * height)\n result = result and (hsign * y - r >= 0)\n if result:\n print(\"Yes\")\n else:\n print(\"No\")\n\n\nfunc()\n", "slow_code_sha256": "b3a430d2365496f9f536fa4236fe45d9a45c9a6c0f910f1eae517487e3d1e97c", "slow_id": "p02394_c88e86f1ad95ddc817ad7ba81628e2daf211ff2d39c36960f050623a40ae12a3", "speedup": 2.505933845685561, "stratum": "2-4", "within_pair_jaccard": 0.2926829268292683, "workload": {"case_count": 100, "description": "Decide whether the entire circle centered at (x,y) with radius r lies in the closed rectangle [0,W]x[0,H]. Touching the rectangle boundary is allowed. The five supplied values are integers. Observed inputs: W=1..100; H=1..100; x=-100..100; y=-100..100; r=1..96.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 19, "median": 15.5, "min": 10}, "input_format": ["W H x y r"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 5, "median": 5.0, "min": 5}}} -{"case_ids": ["p02770_case_000", "p02770_case_001", "p02770_case_002", "p02770_case_003", "p02770_case_004", "p02770_case_005", "p02770_case_006", "p02770_case_007", "p02770_case_008", "p02770_case_009", "p02770_case_010", "p02770_case_011", "p02770_case_012", "p02770_case_013", "p02770_case_014", "p02770_case_015", "p02770_case_016", "p02770_case_017", "p02770_case_018", "p02770_case_019", "p02770_case_020", "p02770_case_021", "p02770_case_022", "p02770_case_023", "p02770_case_024", "p02770_case_025", "p02770_case_026", "p02770_case_027", "p02770_case_028", "p02770_case_029", "p02770_case_030", "p02770_case_031", "p02770_case_032", "p02770_case_033", "p02770_case_034", "p02770_case_035", "p02770_case_036", "p02770_case_037", "p02770_case_038", "p02770_case_039", "p02770_case_040", "p02770_case_041", "p02770_case_042", "p02770_case_043", "p02770_case_044", "p02770_case_045", "p02770_case_046", "p02770_case_047", "p02770_case_048", "p02770_case_049", "p02770_case_050", "p02770_case_051", "p02770_case_052", "p02770_case_053", "p02770_case_054", "p02770_case_055", "p02770_case_056", "p02770_case_057", "p02770_case_058", "p02770_case_059", "p02770_case_060", "p02770_case_061", "p02770_case_062", "p02770_case_063", "p02770_case_064", "p02770_case_065", "p02770_case_066", "p02770_case_067", "p02770_case_068", "p02770_case_069", "p02770_case_070", "p02770_case_071", "p02770_case_072", "p02770_case_073", "p02770_case_074", "p02770_case_075", "p02770_case_076", "p02770_case_077", "p02770_case_078", "p02770_case_079", "p02770_case_080", "p02770_case_081", "p02770_case_082", "p02770_case_083", "p02770_case_084", "p02770_case_085", "p02770_case_086", "p02770_case_087", "p02770_case_088", "p02770_case_089", "p02770_case_090", "p02770_case_091", "p02770_case_092", "p02770_case_093", "p02770_case_094", "p02770_case_095", "p02770_case_096", "p02770_case_097", "p02770_case_098", "p02770_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\nimport math\nfrom bisect import bisect_right as br\nfrom bisect import bisect_left as bl\n\nsys.setrecursionlimit(2147483647)\nfrom heapq import heappush, heappop, heappushpop\nfrom collections import defaultdict\nfrom itertools import accumulate\nfrom collections import Counter\nfrom collections import deque\nfrom operator import itemgetter\nfrom itertools import permutations\n\nmod = 10**9 + 7\ninf = float(\"inf\")\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\nk, q = LI()\nd = LI()\nnxm = [LI() for _ in range(q)]\nfor n, x, m in nxm:\n e = list([(x - 1) % m + 1 for x in d])\n s = sum(e) * ((n - 1) // k) + sum(e[: (n - 1) % k])\n tmp = (s + x) // m - x // m\n print((n - 1 - tmp))\n", "fast_code_sha256": "3f59f403ae0b4cdcca970331b3c85584a86a57f641ec14c25a13ff864055d6a4", "fast_id": "p02770_b991ebb2290a4da6799a6daa285447de9aca5c37bf998182108cf90af4f99293", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "#!/usr/bin/env python3\nimport sys\nimport math\nfrom bisect import bisect_right as br\nfrom bisect import bisect_left as bl\n\nsys.setrecursionlimit(2147483647)\nfrom heapq import heappush, heappop, heappushpop\nfrom collections import defaultdict\nfrom itertools import accumulate\nfrom collections import Counter\nfrom collections import deque\nfrom operator import itemgetter\nfrom itertools import permutations\n\nmod = 10**9 + 7\ninf = float(\"inf\")\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\nk, q = LI()\nd = LI()\nnxm = [LI() for _ in range(q)]\nfor n, x, m in nxm:\n e = list([(x - 1) % m + 1 for x in d])\n s = sum(e) * ((n - 1) // k) + sum(e[: (n - 1) % k])\n tmp = (s + x) // m - x // m\n print((n - 1 - tmp))\n", "measured_fast_code_sha256": "b991ebb2290a4da6799a6daa285447de9aca5c37bf998182108cf90af4f99293", "measured_slow_code": "import numpy as np\n\nk, q = list(map(int, input().split()))\nd = np.array(list(map(int, input().split()))).astype(np.int64)\nqueries = [tuple(map(int, input().split())) for _ in range(q)]\nfor n, x, m in queries:\n d_mod = d % m\n quotient, rem = divmod(n - 1, k)\n rem_d_mod = d_mod[:rem]\n print(\n (\n n\n - 1\n - (x % m + quotient * np.sum(d_mod) + np.sum(rem_d_mod)) // m\n - quotient * np.count_nonzero(d_mod == 0)\n - np.count_nonzero(rem_d_mod == 0)\n )\n )\n", "measured_slow_code_sha256": "7f1c6212437f5dfde41ac56fb777a6413a36acf30f0fa1db841babde5bb8abca", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 0.6161561488813461, "pair_id": "python_v2_65474c1552e498595c94bba8", "per_case_slow_code_faster_fraction": 0.53, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02770", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02770_b991ebb2290a4da6799a6daa285447de9aca5c37bf998182108cf90af4f99293.jsonl.gz", "inputs": "reproduction/python/inputs/p02770.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02770_7f1c6212437f5dfde41ac56fb777a6413a36acf30f0fa1db841babde5bb8abca.jsonl.gz"}, "slow_code": "import numpy as np\n\nk, q = list(map(int, input().split()))\nd = np.array(list(map(int, input().split()))).astype(np.int64)\nqueries = [tuple(map(int, input().split())) for _ in range(q)]\nfor n, x, m in queries:\n d_mod = d % m\n quotient, rem = divmod(n - 1, k)\n rem_d_mod = d_mod[:rem]\n print(\n (\n n\n - 1\n - (x % m + quotient * np.sum(d_mod) + np.sum(rem_d_mod)) // m\n - quotient * np.count_nonzero(d_mod == 0)\n - np.count_nonzero(rem_d_mod == 0)\n )\n )\n", "slow_code_sha256": "7f1c6212437f5dfde41ac56fb777a6413a36acf30f0fa1db841babde5bb8abca", "slow_id": "p02770_7f1c6212437f5dfde41ac56fb777a6413a36acf30f0fa1db841babde5bb8abca", "speedup": 3.7717239028204146, "stratum": "2-4", "within_pair_jaccard": 0.2602739726027397, "workload": {"case_count": 100, "description": "For each query (n,x,m), define a_0=x and a_j=a_(j-1)+d_((j-1) mod k). Count j in 0..n-2 with (a_j mod m)<(a_(j+1) mod m). Only k increments and q queries are listed; expanded sequences are implicit. Observed inputs: k=1..5000 (median 1000); q=1..5000 (median 1000); d_i=0..1000000000; n_i=2..1000000000; x_i=0..1000000000; m_i=2..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 215504, "median": 23899.5, "min": 12}, "input_format": ["k q\nd_0 ... d_(k-1)\nn_1 x_1 m_1\n...\nn_q x_q m_q"], "input_format_status": "source_input_section", "input_lines": {"max": 5002, "median": 1002.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 20002, "median": 4002.0, "min": 6}}} -{"case_ids": ["p02660_case_000", "p02660_case_001", "p02660_case_002", "p02660_case_003", "p02660_case_004", "p02660_case_005", "p02660_case_006", "p02660_case_007", "p02660_case_008", "p02660_case_009", "p02660_case_010", "p02660_case_011", "p02660_case_012", "p02660_case_013", "p02660_case_014", "p02660_case_015", "p02660_case_016", "p02660_case_017", "p02660_case_018", "p02660_case_019", "p02660_case_020", "p02660_case_021", "p02660_case_022", "p02660_case_023", "p02660_case_024", "p02660_case_025", "p02660_case_026", "p02660_case_027", "p02660_case_028", "p02660_case_029", "p02660_case_030", "p02660_case_031", "p02660_case_032", "p02660_case_033", "p02660_case_034", "p02660_case_035", "p02660_case_036", "p02660_case_037", "p02660_case_038", "p02660_case_039", "p02660_case_040", "p02660_case_041", "p02660_case_042", "p02660_case_043", "p02660_case_044", "p02660_case_045", "p02660_case_046", "p02660_case_047", "p02660_case_048", "p02660_case_049", "p02660_case_050", "p02660_case_051", "p02660_case_052", "p02660_case_053", "p02660_case_054", "p02660_case_055", "p02660_case_056", "p02660_case_057", "p02660_case_058", "p02660_case_059", "p02660_case_060", "p02660_case_061", "p02660_case_062", "p02660_case_063", "p02660_case_064", "p02660_case_065", "p02660_case_066", "p02660_case_067", "p02660_case_068", "p02660_case_069", "p02660_case_070", "p02660_case_071", "p02660_case_072", "p02660_case_073", "p02660_case_074", "p02660_case_075", "p02660_case_076", "p02660_case_077", "p02660_case_078", "p02660_case_079", "p02660_case_080", "p02660_case_081", "p02660_case_082", "p02660_case_083", "p02660_case_084", "p02660_case_085", "p02660_case_086", "p02660_case_087", "p02660_case_088", "p02660_case_089", "p02660_case_090", "p02660_case_091", "p02660_case_092", "p02660_case_093", "p02660_case_094", "p02660_case_095", "p02660_case_096", "p02660_case_097", "p02660_case_098", "p02660_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\nN = int(sys.stdin.readline().rstrip())\n\n\ndef make_divisors(n):\n divisors = []\n for i in range(1, int(n**0.5) + 1):\n if n % i == 0:\n divisors.append(i)\n if i != n // i:\n divisors.append(n // i)\n divisors.sort()\n return divisors\n\n\ndef prime_factorize(n):\n a = []\n while n % 2 == 0:\n a.append(2)\n n //= 2\n f = 3\n while f * f <= n:\n if n % f == 0:\n a.append(f)\n n //= f\n else:\n f += 2\n if n != 1:\n a.append(n)\n a = set(a)\n if len(a) == 1:\n return True\n else:\n return False\n\n\ndivisors = make_divisors(N)\nans = 0\nfor d in divisors:\n if prime_factorize(d) and N % d == 0:\n N //= d\n ans += 1\nprint(ans)\n", "fast_code_sha256": "7d0399566439cd002a2223f008c75cebcd6043ec619ec239d746132cb8c1a99d", "fast_id": "p02660_7d0399566439cd002a2223f008c75cebcd6043ec619ec239d746132cb8c1a99d", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\nN = int(sys.stdin.readline().rstrip())\n\n\ndef make_divisors(n):\n divisors = []\n for i in range(1, int(n**0.5) + 1):\n if n % i == 0:\n divisors.append(i)\n if i != n // i:\n divisors.append(n // i)\n divisors.sort()\n return divisors\n\n\ndef prime_factorize(n):\n a = []\n while n % 2 == 0:\n a.append(2)\n n //= 2\n f = 3\n while f * f <= n:\n if n % f == 0:\n a.append(f)\n n //= f\n else:\n f += 2\n if n != 1:\n a.append(n)\n a = set(a)\n if len(a) == 1:\n return True\n else:\n return False\n\n\ndivisors = make_divisors(N)\nans = 0\nfor d in divisors:\n if prime_factorize(d) and N % d == 0:\n N //= d\n ans += 1\nprint(ans)\n", "measured_fast_code_sha256": "7d0399566439cd002a2223f008c75cebcd6043ec619ec239d746132cb8c1a99d", "measured_slow_code": "n = int(eval(input()))\na = p = 1\nwhile p < 6**8:\n c = t = 0\n p += 1\n while n % p < 1:\n n //= p\n x = c == t\n t += x\n c += 1 - t * x\n a += x\nprint((a - (n < 2)))\n", "measured_slow_code_sha256": "8301217799053ca8035ba7e5e9be7529b06a7e4ccf5a0cb39174661c0dc1c031", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 171.60041964425488, "pair_id": "python_v2_c90e88c2db46b961fa5062b0", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02660", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02660_7d0399566439cd002a2223f008c75cebcd6043ec619ec239d746132cb8c1a99d.jsonl.gz", "inputs": "reproduction/python/inputs/p02660.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02660_8301217799053ca8035ba7e5e9be7529b06a7e4ccf5a0cb39174661c0dc1c031.jsonl.gz"}, "slow_code": "n = int(eval(input()))\na = p = 1\nwhile p < 6**8:\n c = t = 0\n p += 1\n while n % p < 1:\n n //= p\n x = c == t\n t += x\n c += 1 - t * x\n a += x\nprint((a - (n < 2)))\n", "slow_code_sha256": "8301217799053ca8035ba7e5e9be7529b06a7e4ccf5a0cb39174661c0dc1c031", "slow_id": "p02660_8301217799053ca8035ba7e5e9be7529b06a7e4ccf5a0cb39174661c0dc1c031", "speedup": 131.05017355403598, "stratum": "8+", "within_pair_jaccard": 0.17777777777777778, "workload": {"case_count": 100, "description": "Starting with integer N, repeatedly divide by a prime power p^e with e>=1 that divides the current value and has never been chosen before. Maximize the number of divisions. Observed inputs: N=1..992540114224 (median 452657355.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 13, "median": 10.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p03805_case_000", "p03805_case_001", "p03805_case_002", "p03805_case_003", "p03805_case_004", "p03805_case_005", "p03805_case_006", "p03805_case_007", "p03805_case_008", "p03805_case_009", "p03805_case_010", "p03805_case_011", "p03805_case_012", "p03805_case_013", "p03805_case_014", "p03805_case_015", "p03805_case_016", "p03805_case_017", "p03805_case_018", "p03805_case_019", "p03805_case_020", "p03805_case_021", "p03805_case_022", "p03805_case_023", "p03805_case_024", "p03805_case_025", "p03805_case_026", "p03805_case_027", "p03805_case_028", "p03805_case_029", "p03805_case_030", "p03805_case_031", "p03805_case_032", "p03805_case_033", "p03805_case_034", "p03805_case_035", "p03805_case_036", "p03805_case_037", "p03805_case_038", "p03805_case_039", "p03805_case_040", "p03805_case_041", "p03805_case_042", "p03805_case_043", "p03805_case_044", "p03805_case_045", "p03805_case_046", "p03805_case_047", "p03805_case_048", "p03805_case_049", "p03805_case_050", "p03805_case_051", "p03805_case_052", "p03805_case_053", "p03805_case_054", "p03805_case_055", "p03805_case_056", "p03805_case_057", "p03805_case_058", "p03805_case_059", "p03805_case_060", "p03805_case_061", "p03805_case_062", "p03805_case_063", "p03805_case_064", "p03805_case_065", "p03805_case_066", "p03805_case_067", "p03805_case_068", "p03805_case_069", "p03805_case_070", "p03805_case_071", "p03805_case_072", "p03805_case_073", "p03805_case_074", "p03805_case_075", "p03805_case_076", "p03805_case_077", "p03805_case_078", "p03805_case_079", "p03805_case_080", "p03805_case_081", "p03805_case_082", "p03805_case_083", "p03805_case_084", "p03805_case_085", "p03805_case_086", "p03805_case_087", "p03805_case_088", "p03805_case_089", "p03805_case_090", "p03805_case_091", "p03805_case_092", "p03805_case_093", "p03805_case_094", "p03805_case_095", "p03805_case_096", "p03805_case_097", "p03805_case_098", "p03805_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def DFS(num):\n global ans, color\n color[num] = \"black\"\n if \"white\" not in color:\n ans += 1\n for i in M[num]:\n if color[i] == \"white\":\n DFS(i)\n color[num] = \"white\"\n\n\nn, m = list(map(int, input().split()))\nAB = [list(map(int, input().split())) for _ in range(m)]\nM = [[] for _ in range(n)]\ncolor = [\"white\" for _ in range(n)]\nfor a, b in AB:\n M[a - 1].append(b - 1)\n M[b - 1].append(a - 1)\nans = 0\nDFS(0)\nprint(ans)\n", "fast_code_sha256": "7d03ea3cff26a582d4bfa41a53deb601ed1d5e4a7af13784af3414b2ebae98bd", "fast_id": "p03805_7d03ea3cff26a582d4bfa41a53deb601ed1d5e4a7af13784af3414b2ebae98bd", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def DFS(num):\n global ans, color\n color[num] = \"black\"\n if \"white\" not in color:\n ans += 1\n for i in M[num]:\n if color[i] == \"white\":\n DFS(i)\n color[num] = \"white\"\n\n\nn, m = list(map(int, input().split()))\nAB = [list(map(int, input().split())) for _ in range(m)]\nM = [[] for _ in range(n)]\ncolor = [\"white\" for _ in range(n)]\nfor a, b in AB:\n M[a - 1].append(b - 1)\n M[b - 1].append(a - 1)\nans = 0\nDFS(0)\nprint(ans)\n", "measured_fast_code_sha256": "7d03ea3cff26a582d4bfa41a53deb601ed1d5e4a7af13784af3414b2ebae98bd", "measured_slow_code": "N, M = list(map(int, input().split()))\nimport copy\n\na = [0] * M\nb = [0] * M\nfor i in range(M):\n a[i], b[i] = list(map(int, input().split()))\nD = [[1]]\n\n\ndef route(D):\n E = []\n D1 = copy.deepcopy(D)\n for j in range(len(D)):\n x = D[j][-1]\n for i in range(M):\n if a[i] == x:\n if not b[i] in D1[j]:\n D[j] = copy.deepcopy(D1[j])\n D[j].append(b[i])\n E.append(D[j])\n elif b[i] == x:\n if not a[i] in D1[j]:\n D[j] = copy.deepcopy(D1[j])\n D[j].append(a[i])\n E.append(D[j])\n return E\n\n\nfor i in range(N - 1):\n D = copy.deepcopy(route(D))\nprint((len(D)))\n", "measured_slow_code_sha256": "aec618577de613b49399f305c62f469bf24b0adab44ea376399825fe0d466869", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4.227047529967301, "pair_id": "python_v2_37b95a61cb5b6969952d2d78", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03805", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03805_7d03ea3cff26a582d4bfa41a53deb601ed1d5e4a7af13784af3414b2ebae98bd.jsonl.gz", "inputs": "reproduction/python/inputs/p03805.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03805_aec618577de613b49399f305c62f469bf24b0adab44ea376399825fe0d466869.jsonl.gz"}, "slow_code": "N, M = list(map(int, input().split()))\nimport copy\n\na = [0] * M\nb = [0] * M\nfor i in range(M):\n a[i], b[i] = list(map(int, input().split()))\nD = [[1]]\n\n\ndef route(D):\n E = []\n D1 = copy.deepcopy(D)\n for j in range(len(D)):\n x = D[j][-1]\n for i in range(M):\n if a[i] == x:\n if not b[i] in D1[j]:\n D[j] = copy.deepcopy(D1[j])\n D[j].append(b[i])\n E.append(D[j])\n elif b[i] == x:\n if not a[i] in D1[j]:\n D[j] = copy.deepcopy(D1[j])\n D[j].append(a[i])\n E.append(D[j])\n return E\n\n\nfor i in range(N - 1):\n D = copy.deepcopy(route(D))\nprint((len(D)))\n", "slow_code_sha256": "aec618577de613b49399f305c62f469bf24b0adab44ea376399825fe0d466869", "slow_id": "p03805_aec618577de613b49399f305c62f469bf24b0adab44ea376399825fe0d466869", "speedup": 5.1716854290501155, "stratum": "4-8", "within_pair_jaccard": 0.4418604651162791, "workload": {"case_count": 100, "description": "Count paths starting at vertex 1 and visiting all N vertices exactly once in a simple unweighted undirected graph. Disconnected graphs and zero edges are allowed. Edges use 1-based endpoints a_i 0:\n dist -= 1\n if dist == 0:\n return True\n return False\n\n\nfor i in range(n):\n for j in range(i + 1, n):\n if k(x[i], x[j]):\n ans += 1\nprint(ans)\n", "fast_code_sha256": "dbe4112f780768c881fa73bb94e8216b96c2835403de960503a893e7f9015af6", "fast_id": "p02982_dbe4112f780768c881fa73bb94e8216b96c2835403de960503a893e7f9015af6", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n, d = list(map(int, input().split()))\nx = [list(map(int, input().split())) for i in range(n)]\nans = 0\n\n\ndef k(a, b):\n dist = 0\n for i in range(d):\n dist += (a[i] - b[i]) ** 2\n dist = dist ** (1 / 2)\n while dist > 0:\n dist -= 1\n if dist == 0:\n return True\n return False\n\n\nfor i in range(n):\n for j in range(i + 1, n):\n if k(x[i], x[j]):\n ans += 1\nprint(ans)\n", "measured_fast_code_sha256": "dbe4112f780768c881fa73bb94e8216b96c2835403de960503a893e7f9015af6", "measured_slow_code": "import numpy as np\n\nN, D = list(map(int, input().split()))\nX = np.zeros((N, D))\nfor i in range(N):\n X[i][:] = list(map(int, input().split()))\nn = 0\nfor i in range(N):\n for j in range(i + 1, N):\n dist = np.linalg.norm(X[i] - X[j])\n if dist.is_integer():\n n += 1\nprint(n)\n", "measured_slow_code_sha256": "3062723b648fda295737e748d4e0d5d9caa11a6c4d2d4160eb2931cf3e53df51", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 355.3558325181488, "pair_id": "python_v2_8be7b1dc55d5ebb17464d29c", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02982", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02982_dbe4112f780768c881fa73bb94e8216b96c2835403de960503a893e7f9015af6.jsonl.gz", "inputs": "reproduction/python/inputs/p02982.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02982_3062723b648fda295737e748d4e0d5d9caa11a6c4d2d4160eb2931cf3e53df51.jsonl.gz"}, "slow_code": "import numpy as np\n\nN, D = list(map(int, input().split()))\nX = np.zeros((N, D))\nfor i in range(N):\n X[i][:] = list(map(int, input().split()))\nn = 0\nfor i in range(N):\n for j in range(i + 1, N):\n dist = np.linalg.norm(X[i] - X[j])\n if dist.is_integer():\n n += 1\nprint(n)\n", "slow_code_sha256": "3062723b648fda295737e748d4e0d5d9caa11a6c4d2d4160eb2931cf3e53df51", "slow_id": "p02982_3062723b648fda295737e748d4e0d5d9caa11a6c4d2d4160eb2931cf3e53df51", "speedup": 293.3879515841172, "stratum": "8+", "within_pair_jaccard": 0.41025641025641024, "workload": {"case_count": 100, "description": "Given N distinct points with integer coordinates in D dimensions, count unordered pairs at integer Euclidean distance. Observed inputs: N=2..10 (median 5); D=1..10 (median 3); X_i_j=-20..20.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 321, "median": 50.0, "min": 8}, "input_format": ["N D\nX_1,1 ... X_1,D\n...\nX_N,1 ... X_N,D"], "input_format_status": "source_input_section", "input_lines": {"max": 11, "median": 6.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 102, "median": 17.0, "min": 4}}} -{"case_ids": ["p03449_case_000", "p03449_case_001", "p03449_case_002", "p03449_case_003", "p03449_case_004", "p03449_case_005", "p03449_case_006", "p03449_case_007", "p03449_case_008", "p03449_case_009", "p03449_case_010", "p03449_case_011", "p03449_case_012", "p03449_case_013", "p03449_case_014", "p03449_case_015", "p03449_case_016", "p03449_case_017", "p03449_case_018", "p03449_case_019", "p03449_case_020", "p03449_case_021", "p03449_case_022", "p03449_case_023", "p03449_case_024", "p03449_case_025", "p03449_case_026", "p03449_case_027", "p03449_case_028", "p03449_case_029", "p03449_case_030", "p03449_case_031", "p03449_case_032", "p03449_case_033", "p03449_case_034", "p03449_case_035", "p03449_case_036", "p03449_case_037", "p03449_case_038", "p03449_case_039", "p03449_case_040", "p03449_case_041", "p03449_case_042", "p03449_case_043", "p03449_case_044", "p03449_case_045", "p03449_case_046", "p03449_case_047", "p03449_case_048", "p03449_case_049", "p03449_case_050", "p03449_case_051", "p03449_case_052", "p03449_case_053", "p03449_case_054", "p03449_case_055", "p03449_case_056", "p03449_case_057", "p03449_case_058", "p03449_case_059", "p03449_case_060", "p03449_case_061", "p03449_case_062", "p03449_case_063", "p03449_case_064", "p03449_case_065", "p03449_case_066", "p03449_case_067", "p03449_case_068", "p03449_case_069", "p03449_case_070", "p03449_case_071", "p03449_case_072", "p03449_case_073", "p03449_case_074", "p03449_case_075", "p03449_case_076", "p03449_case_077", "p03449_case_078", "p03449_case_079", "p03449_case_080", "p03449_case_081", "p03449_case_082", "p03449_case_083", "p03449_case_084", "p03449_case_085", "p03449_case_086", "p03449_case_087", "p03449_case_088", "p03449_case_089", "p03449_case_090", "p03449_case_091", "p03449_case_092", "p03449_case_093", "p03449_case_094", "p03449_case_095", "p03449_case_096", "p03449_case_097", "p03449_case_098", "p03449_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N = int(eval(input()))\nnum_list = []\nwhile True:\n try:\n num_list.append(list(map(int, input().split())))\n except:\n break\nsum_list = []\nfor k in range(N):\n sum_list.append(sum(num_list[0][0 : k + 1]) + sum(num_list[1][k : N + 1]))\nprint((max(sum_list)))\n", "fast_code_sha256": "fd102ef97ba97e59a8cb9663116d750b8a6e9941777a02669909b41cee16cf37", "fast_id": "p03449_fd102ef97ba97e59a8cb9663116d750b8a6e9941777a02669909b41cee16cf37", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N = int(eval(input()))\nnum_list = []\nwhile True:\n try:\n num_list.append(list(map(int, input().split())))\n except:\n break\nsum_list = []\nfor k in range(N):\n sum_list.append(sum(num_list[0][0 : k + 1]) + sum(num_list[1][k : N + 1]))\nprint((max(sum_list)))\n", "measured_fast_code_sha256": "fd102ef97ba97e59a8cb9663116d750b8a6e9941777a02669909b41cee16cf37", "measured_slow_code": "import sys\nfrom collections import deque\n\n\ndef solve():\n input = sys.stdin.readline\n N = int(eval(input()))\n A = [[int(a) for a in input().split()] for _ in range(2)]\n move = ((1, 0), (0, 1))\n maxN = [[0 for _ in range(N)] for i in range(2)]\n q = deque()\n q.append((0, 0, A[0][0]))\n while q:\n nx, ny, np = q.popleft()\n maxN[nx][ny] = max(maxN[nx][ny], np)\n for dx, dy in move:\n if 0 <= nx + dx < 2 and 0 <= ny + dy < N:\n q.append((nx + dx, ny + dy, maxN[nx][ny] + A[nx + dx][ny + dy]))\n print((maxN[1][N - 1]))\n return 0\n\n\nif __name__ == \"__main__\":\n solve()\n", "measured_slow_code_sha256": "767d751ee2ecf877ec0fcce527cb6e9543e55168be5a140790386377376e0eb2", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 10.783703789137537, "pair_id": "python_v2_13f0713d04663de04fe64656", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03449", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03449_fd102ef97ba97e59a8cb9663116d750b8a6e9941777a02669909b41cee16cf37.jsonl.gz", "inputs": "reproduction/python/inputs/p03449.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03449_767d751ee2ecf877ec0fcce527cb6e9543e55168be5a140790386377376e0eb2.jsonl.gz"}, "slow_code": "import sys\nfrom collections import deque\n\n\ndef solve():\n input = sys.stdin.readline\n N = int(eval(input()))\n A = [[int(a) for a in input().split()] for _ in range(2)]\n move = ((1, 0), (0, 1))\n maxN = [[0 for _ in range(N)] for i in range(2)]\n q = deque()\n q.append((0, 0, A[0][0]))\n while q:\n nx, ny, np = q.popleft()\n maxN[nx][ny] = max(maxN[nx][ny], np)\n for dx, dy in move:\n if 0 <= nx + dx < 2 and 0 <= ny + dy < N:\n q.append((nx + dx, ny + dy, maxN[nx][ny] + A[nx + dx][ny + dy]))\n print((maxN[1][N - 1]))\n return 0\n\n\nif __name__ == \"__main__\":\n solve()\n", "slow_code_sha256": "767d751ee2ecf877ec0fcce527cb6e9543e55168be5a140790386377376e0eb2", "slow_id": "p03449_767d751ee2ecf877ec0fcce527cb6e9543e55168be5a140790386377376e0eb2", "speedup": 7.651259408904642, "stratum": "4-8", "within_pair_jaccard": 0.2692307692307692, "workload": {"case_count": 100, "description": "Traverse a 2-by-N candy grid from (1,1) to (2,N), moving only right or down and collecting each visited cell, including endpoints. Maximize collected candies. Observed inputs: N=1..100 (median 50); A_i_j=1..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 804, "median": 294.5, "min": 6}, "input_format": ["N\nA_1,1 ... A_1,N\nA_2,1 ... A_2,N"], "input_format_status": "source_input_section", "input_lines": {"max": 3, "median": 3.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 201, "median": 101.0, "min": 3}}} -{"case_ids": ["p03476_case_000", "p03476_case_001", "p03476_case_002", "p03476_case_003", "p03476_case_004", "p03476_case_005", "p03476_case_006", "p03476_case_007", "p03476_case_008", "p03476_case_009", "p03476_case_010", "p03476_case_011", "p03476_case_012", "p03476_case_013", "p03476_case_014", "p03476_case_015", "p03476_case_016", "p03476_case_017", "p03476_case_018", "p03476_case_019", "p03476_case_020", "p03476_case_021", "p03476_case_022", "p03476_case_023", "p03476_case_024", "p03476_case_025", "p03476_case_026", "p03476_case_027", "p03476_case_028", "p03476_case_029", "p03476_case_030", "p03476_case_031", "p03476_case_032", "p03476_case_033", "p03476_case_034", "p03476_case_035", "p03476_case_036", "p03476_case_037", "p03476_case_038", "p03476_case_039", "p03476_case_040", "p03476_case_041", "p03476_case_042", "p03476_case_043", "p03476_case_044", "p03476_case_045", "p03476_case_046", "p03476_case_047", "p03476_case_048", "p03476_case_049", "p03476_case_050", "p03476_case_051", "p03476_case_052", "p03476_case_053", "p03476_case_054", "p03476_case_055", "p03476_case_056", "p03476_case_057", "p03476_case_058", "p03476_case_059", "p03476_case_060", "p03476_case_061", "p03476_case_062", "p03476_case_063", "p03476_case_064", "p03476_case_065", "p03476_case_066", "p03476_case_067", "p03476_case_068", "p03476_case_069", "p03476_case_070", "p03476_case_071", "p03476_case_072", "p03476_case_073", "p03476_case_074", "p03476_case_075", "p03476_case_076", "p03476_case_077", "p03476_case_078", "p03476_case_079", "p03476_case_080", "p03476_case_081", "p03476_case_082", "p03476_case_083", "p03476_case_084", "p03476_case_085", "p03476_case_086", "p03476_case_087", "p03476_case_088", "p03476_case_089", "p03476_case_090", "p03476_case_091", "p03476_case_092", "p03476_case_093", "p03476_case_094", "p03476_case_095", "p03476_case_096", "p03476_case_097", "p03476_case_098", "p03476_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from bisect import bisect_left, bisect_right\n\n\ndef primes(n):\n is_prime = [True] * (n + 1)\n is_prime[0] = False\n is_prime[1] = False\n for i in range(2, int(n**0.5) + 1):\n if not is_prime[i]:\n continue\n for j in range(i * 2, n + 1, i):\n is_prime[j] = False\n return [i for i in range(3, n + 1) if is_prime[i]]\n\n\nprime = primes(10**5)\np_set = set(prime)\nlike = [3]\nfor i in prime:\n if (i + 1) // 2 in p_set:\n like.append(i)\nQ = int(eval(input()))\nfor _ in range(Q):\n l, r = list(map(int, input().split()))\n print((bisect_right(like, r) - bisect_left(like, l)))\n", "fast_code_sha256": "682d751091cf89e1ad70930160ea7a742b6e10b056be71cc733386cc4788dd10", "fast_id": "p03476_682d751091cf89e1ad70930160ea7a742b6e10b056be71cc733386cc4788dd10", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from bisect import bisect_left, bisect_right\n\n\ndef primes(n):\n is_prime = [True] * (n + 1)\n is_prime[0] = False\n is_prime[1] = False\n for i in range(2, int(n**0.5) + 1):\n if not is_prime[i]:\n continue\n for j in range(i * 2, n + 1, i):\n is_prime[j] = False\n return [i for i in range(3, n + 1) if is_prime[i]]\n\n\nprime = primes(10**5)\np_set = set(prime)\nlike = [3]\nfor i in prime:\n if (i + 1) // 2 in p_set:\n like.append(i)\nQ = int(eval(input()))\nfor _ in range(Q):\n l, r = list(map(int, input().split()))\n print((bisect_right(like, r) - bisect_left(like, l)))\n", "measured_fast_code_sha256": "682d751091cf89e1ad70930160ea7a742b6e10b056be71cc733386cc4788dd10", "measured_slow_code": "import numpy as np\n\nq = int(eval(input()))\n# 高速素数判定\nis_prime = np.ones(100001, dtype=int)\nis_prime[0] = 0\nis_prime[1] = 0\nfor i in range(2, 100001):\n if is_prime[i] == 1:\n j = i + i\n while j <= 100000:\n is_prime[j] = 0\n j += i\nlike2017 = [\n 1 if is_prime[i] and is_prime[(i + 1) // 2] else 0 for i in range(0, 100001)\n]\nfor i in range(1, 100001):\n like2017[i] += like2017[i - 1]\nfor i in range(q):\n l, r = list(map(int, input().split()))\n print((like2017[r] - like2017[l - 1]))\n", "measured_slow_code_sha256": "04049db677f468c331c809085fe1f71be865b70eea78240753e06ca4db53b055", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.033314515539944, "pair_id": "python_v2_bd181fc91835183ff0ee947d", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03476", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03476_682d751091cf89e1ad70930160ea7a742b6e10b056be71cc733386cc4788dd10.jsonl.gz", "inputs": "reproduction/python/inputs/p03476.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03476_04049db677f468c331c809085fe1f71be865b70eea78240753e06ca4db53b055.jsonl.gz"}, "slow_code": "import numpy as np\n\nq = int(eval(input()))\n\nis_prime = np.ones(100001, dtype=int)\nis_prime[0] = 0\nis_prime[1] = 0\nfor i in range(2, 100001):\n if is_prime[i] == 1:\n j = i + i\n while j <= 100000:\n is_prime[j] = 0\n j += i\nlike2017 = [\n 1 if is_prime[i] and is_prime[(i + 1) // 2] else 0 for i in range(0, 100001)\n]\nfor i in range(1, 100001):\n like2017[i] += like2017[i - 1]\nfor i in range(q):\n l, r = list(map(int, input().split()))\n print((like2017[r] - like2017[l - 1]))\n", "slow_code_sha256": "b2179070bb2e08d4fd95b95ff67b71105cd4dc2d4e6e31ecedf0506d95c233c1", "slow_id": "p03476_04049db677f468c331c809085fe1f71be865b70eea78240753e06ca4db53b055", "speedup": 3.785066305111297, "stratum": "2-4", "within_pair_jaccard": 0.37735849056603776, "workload": {"case_count": 100, "description": "For each inclusive odd-endpoint interval [l_i,r_i], count odd integers x for which both x and (x+1)/2 are prime. Process Q independent queries. Observed inputs: Q=1..100000 (median 25000); l_i=1..99999; r_i=1..99999.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1189051, "median": 294556.5, "min": 6}, "input_format": ["Q\nl_1 r_1\n...\nl_Q r_Q"], "input_format_status": "source_input_section", "input_lines": {"max": 100001, "median": 25001.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200001, "median": 50001.0, "min": 3}}} -{"case_ids": ["p03563_case_000", "p03563_case_001", "p03563_case_002", "p03563_case_003", "p03563_case_004", "p03563_case_005", "p03563_case_006", "p03563_case_007", "p03563_case_008", "p03563_case_009", "p03563_case_010", "p03563_case_011", "p03563_case_012", "p03563_case_013", "p03563_case_014", "p03563_case_015", "p03563_case_016", "p03563_case_017", "p03563_case_018", "p03563_case_019", "p03563_case_020", "p03563_case_021", "p03563_case_022", "p03563_case_023", "p03563_case_024", "p03563_case_025", "p03563_case_026", "p03563_case_027", "p03563_case_028", "p03563_case_029", "p03563_case_030", "p03563_case_031", "p03563_case_032", "p03563_case_033", "p03563_case_034", "p03563_case_035", "p03563_case_036", "p03563_case_037", "p03563_case_038", "p03563_case_039", "p03563_case_040", "p03563_case_041", "p03563_case_042", "p03563_case_043", "p03563_case_044", "p03563_case_045", "p03563_case_046", "p03563_case_047", "p03563_case_048", "p03563_case_049", "p03563_case_050", "p03563_case_051", "p03563_case_052", "p03563_case_053", "p03563_case_054", "p03563_case_055", "p03563_case_056", "p03563_case_057", "p03563_case_058", "p03563_case_059", "p03563_case_060", "p03563_case_061", "p03563_case_062", "p03563_case_063", "p03563_case_064", "p03563_case_065", "p03563_case_066", "p03563_case_067", "p03563_case_068", "p03563_case_069", "p03563_case_070", "p03563_case_071", "p03563_case_072", "p03563_case_073", "p03563_case_074", "p03563_case_075", "p03563_case_076", "p03563_case_077", "p03563_case_078", "p03563_case_079", "p03563_case_080", "p03563_case_081", "p03563_case_082", "p03563_case_083", "p03563_case_084", "p03563_case_085", "p03563_case_086", "p03563_case_087", "p03563_case_088", "p03563_case_089", "p03563_case_090", "p03563_case_091", "p03563_case_092", "p03563_case_093", "p03563_case_094", "p03563_case_095", "p03563_case_096", "p03563_case_097", "p03563_case_098", "p03563_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "lst = []\nR = int(eval(input()))\nG = int(eval(input()))\nans = G - R + G\nprint(ans)\n", "fast_code_sha256": "acb87974d1bc47590d1495561ec9a9d0631f2af73cba7b28fcff53d897967ec3", "fast_id": "p03563_acb87974d1bc47590d1495561ec9a9d0631f2af73cba7b28fcff53d897967ec3", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "lst = []\nR = int(eval(input()))\nG = int(eval(input()))\nans = G - R + G\nprint(ans)\n", "measured_fast_code_sha256": "acb87974d1bc47590d1495561ec9a9d0631f2af73cba7b28fcff53d897967ec3", "measured_slow_code": "import numpy as np\n\nlst = []\nR = int(eval(input()))\nG = int(eval(input()))\nans = G - R + G\nprint(ans)\n", "measured_slow_code_sha256": "59c6641cd1def8a06b45e4c0f0ace3ffa49de62fc97f73e0499cc3875cec5d01", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1554.2310133911737, "pair_id": "python_v2_c033647d08dd85c51204238a", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03563", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03563_acb87974d1bc47590d1495561ec9a9d0631f2af73cba7b28fcff53d897967ec3.jsonl.gz", "inputs": "reproduction/python/inputs/p03563.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03563_59c6641cd1def8a06b45e4c0f0ace3ffa49de62fc97f73e0499cc3875cec5d01.jsonl.gz"}, "slow_code": "import numpy as np\n\nlst = []\nR = int(eval(input()))\nG = int(eval(input()))\nans = G - R + G\nprint(ans)\n", "slow_code_sha256": "59c6641cd1def8a06b45e4c0f0ace3ffa49de62fc97f73e0499cc3875cec5d01", "slow_id": "p03563_59c6641cd1def8a06b45e4c0f0ace3ffa49de62fc97f73e0499cc3875cec5d01", "speedup": 1550.635599019409, "stratum": "8+", "within_pair_jaccard": 0.6666666666666666, "workload": {"case_count": 100, "description": "A new rating is the arithmetic mean of current rating R and a performance value. Find the performance required for the new rating to equal G; it may be negative. Observed inputs: R=0..4500 (median 2451.5); G=0..4500 (median 1662.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 10, "median": 10.0, "min": 4}, "input_format": ["R\nG"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p03077_case_000", "p03077_case_001", "p03077_case_002", "p03077_case_003", "p03077_case_004", "p03077_case_005", "p03077_case_006", "p03077_case_007", "p03077_case_008", "p03077_case_009", "p03077_case_010", "p03077_case_011", "p03077_case_012", "p03077_case_013", "p03077_case_014", "p03077_case_015", "p03077_case_016", "p03077_case_017", "p03077_case_018", "p03077_case_019", "p03077_case_020", "p03077_case_021", "p03077_case_022", "p03077_case_023", "p03077_case_024", "p03077_case_025", "p03077_case_026", "p03077_case_027", "p03077_case_028", "p03077_case_029", "p03077_case_030", "p03077_case_031", "p03077_case_032", "p03077_case_033", "p03077_case_034", "p03077_case_035", "p03077_case_036", "p03077_case_037", "p03077_case_038", "p03077_case_039", "p03077_case_040", "p03077_case_041", "p03077_case_042", "p03077_case_043", "p03077_case_044", "p03077_case_045", "p03077_case_046", "p03077_case_047", "p03077_case_048", "p03077_case_049", "p03077_case_050", "p03077_case_051", "p03077_case_052", "p03077_case_053", "p03077_case_054", "p03077_case_055", "p03077_case_056", "p03077_case_057", "p03077_case_058", "p03077_case_059", "p03077_case_060", "p03077_case_061", "p03077_case_062", "p03077_case_063", "p03077_case_064", "p03077_case_065", "p03077_case_066", "p03077_case_067", "p03077_case_068", "p03077_case_069", "p03077_case_070", "p03077_case_071", "p03077_case_072", "p03077_case_073", "p03077_case_074", "p03077_case_075", "p03077_case_076", "p03077_case_077", "p03077_case_078", "p03077_case_079", "p03077_case_080", "p03077_case_081", "p03077_case_082", "p03077_case_083", "p03077_case_084", "p03077_case_085", "p03077_case_086", "p03077_case_087", "p03077_case_088", "p03077_case_089", "p03077_case_090", "p03077_case_091", "p03077_case_092", "p03077_case_093", "p03077_case_094", "p03077_case_095", "p03077_case_096", "p03077_case_097", "p03077_case_098", "p03077_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N = int(eval(input()))\nA = [int(eval(input())) for _ in range(5)]\na = min(A)\nn = N // a\nk = N % a\nans = 0\nif n > 0:\n ans = 5 + (n - 1)\n if k > 0:\n ans += 1\nelse:\n if k > 0:\n ans = 5\nprint(ans)\n", "fast_code_sha256": "1f5f905db6801a2b76018f529a9f5e2c47581e7da5f16fa884722c4d9e19db74", "fast_id": "p03077_1f5f905db6801a2b76018f529a9f5e2c47581e7da5f16fa884722c4d9e19db74", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N = int(eval(input()))\nA = [int(eval(input())) for _ in range(5)]\na = min(A)\nn = N // a\nk = N % a\nans = 0\nif n > 0:\n ans = 5 + (n - 1)\n if k > 0:\n ans += 1\nelse:\n if k > 0:\n ans = 5\nprint(ans)\n", "measured_fast_code_sha256": "1f5f905db6801a2b76018f529a9f5e2c47581e7da5f16fa884722c4d9e19db74", "measured_slow_code": "# -*- coding: utf-8 -*-\nimport sys\nimport numpy as np\n\n\ndef get_num():\n return int(eval(input()))\n\n\ndef get_nums(n):\n res = [0 for _ in range(n)]\n for i in range(n):\n res[i] = int(eval(input()))\n return res\n\n\ndef get_numbers():\n return list(map(int, input().split()))\n\n\nn = get_num()\ncosts = get_nums(5)\nmax_time = 0\nfor cost in costs:\n max_time = max(max_time, int(np.ceil(n / cost)))\nprint((max_time + 4))\n", "measured_slow_code_sha256": "34caf7325f4819bd719f1f977d4c7833f1b8eae1073783274c70d879e08aa59a", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 629.9181011728433, "pair_id": "python_v2_ff0ec91cca34371db3a35801", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03077", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03077_1f5f905db6801a2b76018f529a9f5e2c47581e7da5f16fa884722c4d9e19db74.jsonl.gz", "inputs": "reproduction/python/inputs/p03077.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03077_34caf7325f4819bd719f1f977d4c7833f1b8eae1073783274c70d879e08aa59a.jsonl.gz"}, "slow_code": "import sys\nimport numpy as np\n\n\ndef get_num():\n return int(eval(input()))\n\n\ndef get_nums(n):\n res = [0 for _ in range(n)]\n for i in range(n):\n res[i] = int(eval(input()))\n return res\n\n\ndef get_numbers():\n return list(map(int, input().split()))\n\n\nn = get_num()\ncosts = get_nums(5)\nmax_time = 0\nfor cost in costs:\n max_time = max(max_time, int(np.ceil(n / cost)))\nprint((max_time + 4))\n", "slow_code_sha256": "ab58e9cb16ab933309b0c60e055e71406d283b0d16126adf763de4e9caa5d6fb", "slow_id": "p03077_34caf7325f4819bd719f1f977d4c7833f1b8eae1073783274c70d879e08aa59a", "speedup": 630.1070540885779, "stratum": "8+", "within_pair_jaccard": 0.2682926829268293, "workload": {"case_count": 100, "description": "Move N people through five successive transport links with capacities A,B,C,D,E. Each link takes one minute and dispatches one vehicle at every integer time starting at 0; transfers take no time. Find when everyone can arrive. Observed inputs: N=1..1000000000000000; capacities=1..1000000000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 102, "median": 82.0, "min": 12}, "input_format": ["N\nA\nB\nC\nD\nE"], "input_format_status": "source_input_section", "input_lines": {"max": 6, "median": 6.0, "min": 6}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 6, "median": 6.0, "min": 6}}} -{"case_ids": ["p02595_case_000", "p02595_case_001", "p02595_case_002", "p02595_case_003", "p02595_case_004", "p02595_case_005", "p02595_case_006", "p02595_case_007", "p02595_case_008", "p02595_case_009", "p02595_case_010", "p02595_case_011", "p02595_case_012", "p02595_case_013", "p02595_case_014", "p02595_case_015", "p02595_case_016", "p02595_case_017", "p02595_case_018", "p02595_case_019", "p02595_case_020", "p02595_case_021", "p02595_case_022", "p02595_case_023", "p02595_case_024", "p02595_case_025", "p02595_case_026", "p02595_case_027", "p02595_case_028", "p02595_case_029", "p02595_case_030", "p02595_case_031", "p02595_case_032", "p02595_case_033", "p02595_case_034", "p02595_case_035", "p02595_case_036", "p02595_case_037", "p02595_case_038", "p02595_case_039", "p02595_case_040", "p02595_case_041", "p02595_case_042", "p02595_case_043", "p02595_case_044", "p02595_case_045", "p02595_case_046", "p02595_case_047", "p02595_case_048", "p02595_case_049", "p02595_case_050", "p02595_case_051", "p02595_case_052", "p02595_case_053", "p02595_case_054", "p02595_case_055", "p02595_case_056", "p02595_case_057", "p02595_case_058", "p02595_case_059", "p02595_case_060", "p02595_case_061", "p02595_case_062", "p02595_case_063", "p02595_case_064", "p02595_case_065", "p02595_case_066", "p02595_case_067", "p02595_case_068", "p02595_case_069", "p02595_case_070", "p02595_case_071", "p02595_case_072", "p02595_case_073", "p02595_case_074", "p02595_case_075", "p02595_case_076", "p02595_case_077", "p02595_case_078", "p02595_case_079", "p02595_case_080", "p02595_case_081", "p02595_case_082", "p02595_case_083", "p02595_case_084", "p02595_case_085", "p02595_case_086", "p02595_case_087", "p02595_case_088", "p02595_case_089", "p02595_case_090", "p02595_case_091", "p02595_case_092", "p02595_case_093", "p02595_case_094", "p02595_case_095", "p02595_case_096", "p02595_case_097", "p02595_case_098", "p02595_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\ninput = sys.stdin.readline\n\n\ndef main():\n n, d = list(map(int, input().split()))\n res = 0\n for _ in range(n):\n x, y = list(map(int, input().split()))\n if (x**2 + y**2) ** 0.5 <= d:\n res += 1\n print(res)\n\n\nmain()\n", "fast_code_sha256": "4f7dec1c545bf87e3a5097894d02befa206b9706034f91157ed6843257394fd6", "fast_id": "p02595_4f7dec1c545bf87e3a5097894d02befa206b9706034f91157ed6843257394fd6", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\ninput = sys.stdin.readline\n\n\ndef main():\n n, d = list(map(int, input().split()))\n res = 0\n for _ in range(n):\n x, y = list(map(int, input().split()))\n if (x**2 + y**2) ** 0.5 <= d:\n res += 1\n print(res)\n\n\nmain()\n", "measured_fast_code_sha256": "4f7dec1c545bf87e3a5097894d02befa206b9706034f91157ed6843257394fd6", "measured_slow_code": "from decimal import *\n\ngetcontext().prec = 50\nN, D = list(map(int, input().split()))\n\n\ndef distance(x1, x2, y1, y2):\n dx = x2 - x1\n dy = y2 - y1\n return (dx * dx + dy * dy).sqrt()\n\n\nX = [0] * N\nY = [0] * N\nfor i in range(N):\n X[i], Y[i] = list(map(Decimal, input().split()))\nans = 0\nfor i in range(N):\n if distance(0, X[i], 0, Y[i]) <= D:\n ans += 1\nprint(ans)\n", "measured_slow_code_sha256": "1559f276e022453eb8e8e92cd54d60648c4bba1cc009c4b0eef1eaf17b1ef72e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4.282710207246465, "pair_id": "python_v2_ef3a465feb999e33d843e10f", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02595", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02595_4f7dec1c545bf87e3a5097894d02befa206b9706034f91157ed6843257394fd6.jsonl.gz", "inputs": "reproduction/python/inputs/p02595.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02595_1559f276e022453eb8e8e92cd54d60648c4bba1cc009c4b0eef1eaf17b1ef72e.jsonl.gz"}, "slow_code": "from decimal import *\n\ngetcontext().prec = 50\nN, D = list(map(int, input().split()))\n\n\ndef distance(x1, x2, y1, y2):\n dx = x2 - x1\n dy = y2 - y1\n return (dx * dx + dy * dy).sqrt()\n\n\nX = [0] * N\nY = [0] * N\nfor i in range(N):\n X[i], Y[i] = list(map(Decimal, input().split()))\nans = 0\nfor i in range(N):\n if distance(0, X[i], 0, Y[i]) <= D:\n ans += 1\nprint(ans)\n", "slow_code_sha256": "1559f276e022453eb8e8e92cd54d60648c4bba1cc009c4b0eef1eaf17b1ef72e", "slow_id": "p02595_1559f276e022453eb8e8e92cd54d60648c4bba1cc009c4b0eef1eaf17b1ef72e", "speedup": 5.387965879464539, "stratum": "4-8", "within_pair_jaccard": 0.2978723404255319, "workload": {"case_count": 100, "description": "Count listed plane points (X_i,Y_i) whose Euclidean distance from the origin is at most D; repeated points count separately. Observed inputs: N=1..200000 (median 100000); D=0..200000 (median 100000); X_i=-200000..200000; Y_i=-200000..200000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 3000082, "median": 1388902.0, "min": 8}, "input_format": ["N D\nX_1 Y_1\n...\nX_N Y_N"], "input_format_status": "source_input_section", "input_lines": {"max": 200001, "median": 100001.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 400002, "median": 200002.0, "min": 4}}} -{"case_ids": ["p03608_case_000", "p03608_case_001", "p03608_case_002", "p03608_case_003", "p03608_case_004", "p03608_case_005", "p03608_case_006", "p03608_case_007", "p03608_case_008", "p03608_case_009", "p03608_case_010", "p03608_case_011", "p03608_case_012", "p03608_case_013", "p03608_case_014", "p03608_case_015", "p03608_case_016", "p03608_case_017", "p03608_case_018", "p03608_case_019", "p03608_case_020", "p03608_case_021", "p03608_case_022", "p03608_case_023", "p03608_case_024", "p03608_case_025", "p03608_case_026", "p03608_case_027", "p03608_case_028", "p03608_case_029", "p03608_case_030", "p03608_case_031", "p03608_case_032", "p03608_case_033", "p03608_case_034", "p03608_case_035", "p03608_case_036", "p03608_case_037", "p03608_case_038", "p03608_case_039", "p03608_case_040", "p03608_case_041", "p03608_case_042", "p03608_case_043", "p03608_case_044", "p03608_case_045", "p03608_case_046", "p03608_case_047", "p03608_case_048", "p03608_case_049", "p03608_case_050", "p03608_case_051", "p03608_case_052", "p03608_case_053", "p03608_case_054", "p03608_case_055", "p03608_case_056", "p03608_case_057", "p03608_case_058", "p03608_case_059", "p03608_case_060", "p03608_case_061", "p03608_case_062", "p03608_case_063", "p03608_case_064", "p03608_case_065", "p03608_case_066", "p03608_case_067", "p03608_case_068", "p03608_case_069", "p03608_case_070", "p03608_case_071", "p03608_case_072", "p03608_case_073", "p03608_case_074", "p03608_case_075", "p03608_case_076", "p03608_case_077", "p03608_case_078", "p03608_case_079", "p03608_case_080", "p03608_case_081", "p03608_case_082", "p03608_case_083", "p03608_case_084", "p03608_case_085", "p03608_case_086", "p03608_case_087", "p03608_case_088", "p03608_case_089", "p03608_case_090", "p03608_case_091", "p03608_case_092", "p03608_case_093", "p03608_case_094", "p03608_case_095", "p03608_case_096", "p03608_case_097", "p03608_case_098", "p03608_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from itertools import permutations\nimport sys\n\ninput = sys.stdin.readline\n\n\ndef main():\n N, M, RR = list(map(int, input().split()))\n R = list(map(int, input().split()))\n INF = float(\"inf\")\n T = [[INF] * N for _ in range(N)]\n for _ in range(M):\n a, b, c = tuple(map(int, input().split()))\n T[a - 1][b - 1] = c\n T[b - 1][a - 1] = c\n for k in range(N):\n for i in range(N):\n for j in range(N):\n if T[i][j] > T[i][k] + T[k][j]:\n T[i][j] = T[i][k] + T[k][j]\n ans = INF\n for rs in permutations(R):\n cost = 0\n for i in range(RR - 1):\n cost += T[rs[i] - 1][rs[i + 1] - 1]\n ans = min(ans, cost)\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "f6ef3257b5e8877ad81071a42c9269e5538e44e4ad7ffa2fda95f890de3483d9", "fast_id": "p03608_f6ef3257b5e8877ad81071a42c9269e5538e44e4ad7ffa2fda95f890de3483d9", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from itertools import permutations\nimport sys\n\ninput = sys.stdin.readline\n\n\ndef main():\n N, M, RR = list(map(int, input().split()))\n R = list(map(int, input().split()))\n INF = float(\"inf\")\n T = [[INF] * N for _ in range(N)]\n for _ in range(M):\n a, b, c = tuple(map(int, input().split()))\n T[a - 1][b - 1] = c\n T[b - 1][a - 1] = c\n for k in range(N):\n for i in range(N):\n for j in range(N):\n if T[i][j] > T[i][k] + T[k][j]:\n T[i][j] = T[i][k] + T[k][j]\n ans = INF\n for rs in permutations(R):\n cost = 0\n for i in range(RR - 1):\n cost += T[rs[i] - 1][rs[i + 1] - 1]\n ans = min(ans, cost)\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "f6ef3257b5e8877ad81071a42c9269e5538e44e4ad7ffa2fda95f890de3483d9", "measured_slow_code": "n, m, r = list(map(int, input().split()))\nrs = list(map(int, input().split()))\n# construct map\nimport numpy as np\n\ndists = np.ones((n + 1, n + 1)) * float(\"inf\")\nfor _ in range(m):\n a, b, c = list(map(int, input().split()))\n dists[a, b] = dists[b, a] = c\nfor i in range(1, n + 1):\n dists[i, i] = 0\nfrom itertools import product, permutations\n\nfor i, j in product(list(range(1, 1 + n)), repeat=2):\n dists[j] = np.minimum(dists[j], dists[i] + dists[j, i])\nans = float(\"inf\")\nfor path in permutations(rs):\n val = sum(dists[i, j] for i, j in zip(path, path[1:]))\n val = int(val)\n if val < ans:\n ans = val\nprint(ans)\n", "measured_slow_code_sha256": "a6ba7a6e457f7223737377dc74c3739f39a6faf8bc7e129d3e4d82875673c6ae", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.2810813202835085, "pair_id": "python_v2_a1d42e21366e289f2db9c44f", "per_case_slow_code_faster_fraction": 0.46, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03608", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03608_f6ef3257b5e8877ad81071a42c9269e5538e44e4ad7ffa2fda95f890de3483d9.jsonl.gz", "inputs": "reproduction/python/inputs/p03608.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03608_a6ba7a6e457f7223737377dc74c3739f39a6faf8bc7e129d3e4d82875673c6ae.jsonl.gz"}, "slow_code": "n, m, r = list(map(int, input().split()))\nrs = list(map(int, input().split()))\n\nimport numpy as np\n\ndists = np.ones((n + 1, n + 1)) * float(\"inf\")\nfor _ in range(m):\n a, b, c = list(map(int, input().split()))\n dists[a, b] = dists[b, a] = c\nfor i in range(1, n + 1):\n dists[i, i] = 0\nfrom itertools import product, permutations\n\nfor i, j in product(list(range(1, 1 + n)), repeat=2):\n dists[j] = np.minimum(dists[j], dists[i] + dists[j, i])\nans = float(\"inf\")\nfor path in permutations(rs):\n val = sum(dists[i, j] for i, j in zip(path, path[1:]))\n val = int(val)\n if val < ans:\n ans = val\nprint(ans)\n", "slow_code_sha256": "f19f2c009c893dde042476371af37c34ea12cfaa23ea63baa86f7c5a07cc08fe", "slow_id": "p03608_a6ba7a6e457f7223737377dc74c3739f39a6faf8bc7e129d3e4d82875673c6ae", "speedup": 5.678287028182766, "stratum": "4-8", "within_pair_jaccard": 0.4406779661016949, "workload": {"case_count": 100, "description": "Find the minimum road distance needed to visit R distinct specified towns in any order in a connected simple undirected graph. Start and finish at any specified towns; other towns may be passed through. Edges have positive lengths C_i. Observed inputs: N=2..200 (median 50); M=1..19900 (median 199); R=2..8 (median 8); C_i=1..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 277050, "median": 2393.0, "min": 16}, "input_format": ["N M R\nr_1 ... r_R\nA_1 B_1 C_1\n...\nA_M B_M C_M"], "input_format_status": "source_input_section", "input_lines": {"max": 19902, "median": 201.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 59711, "median": 608.0, "min": 8}}} -{"case_ids": ["p03078_case_000", "p03078_case_001", "p03078_case_002", "p03078_case_003", "p03078_case_004", "p03078_case_005", "p03078_case_006", "p03078_case_007", "p03078_case_008", "p03078_case_009", "p03078_case_010", "p03078_case_011", "p03078_case_012", "p03078_case_013", "p03078_case_014", "p03078_case_015", "p03078_case_016", "p03078_case_017", "p03078_case_018", "p03078_case_019", "p03078_case_020", "p03078_case_021", "p03078_case_022", "p03078_case_023", "p03078_case_024", "p03078_case_025", "p03078_case_026", "p03078_case_027", "p03078_case_028", "p03078_case_029", "p03078_case_030", "p03078_case_031", "p03078_case_032", "p03078_case_033", "p03078_case_034", "p03078_case_035", "p03078_case_036", "p03078_case_037", "p03078_case_038", "p03078_case_039", "p03078_case_040", "p03078_case_041", "p03078_case_042", "p03078_case_043", "p03078_case_044", "p03078_case_045", "p03078_case_046", "p03078_case_047", "p03078_case_048", "p03078_case_049", "p03078_case_050", "p03078_case_051", "p03078_case_052", "p03078_case_053", "p03078_case_054", "p03078_case_055", "p03078_case_056", "p03078_case_057", "p03078_case_059", "p03078_case_060", "p03078_case_061", "p03078_case_062", "p03078_case_063", "p03078_case_064", "p03078_case_065", "p03078_case_066", "p03078_case_067", "p03078_case_069", "p03078_case_070", "p03078_case_071", "p03078_case_072", "p03078_case_073", "p03078_case_074", "p03078_case_075", "p03078_case_076", "p03078_case_077", "p03078_case_078", "p03078_case_079", "p03078_case_080", "p03078_case_081", "p03078_case_082", "p03078_case_083", "p03078_case_084", "p03078_case_085", "p03078_case_086", "p03078_case_087", "p03078_case_088", "p03078_case_089", "p03078_case_090", "p03078_case_091", "p03078_case_092", "p03078_case_093", "p03078_case_094", "p03078_case_095", "p03078_case_096", "p03078_case_097", "p03078_case_098", "p03078_case_099", "p03078_v2_67e3066218a5a534bee9", "p03078_v2_bf0d7ab34a53dfd7f197"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "X, Y, Z, K = map(int, input().split())\nA = list(map(int, input().split()))\nB = list(map(int, input().split()))\nC = list(map(int, input().split()))\nA.sort(reverse=True)\nB.sort(reverse=True)\nC.sort(reverse=True)\nans = []\nfor i in range(X):\n for j in range(Y):\n if (i + 1) * (j + 1) > K:\n break\n for k in range(Z):\n if (i + 1) * (j + 1) * (k + 1) <= K:\n ans.append(A[i] + B[j] + C[k])\n else:\n break\nprint(*sorted(ans, reverse=True)[:K], sep=\"\\n\")\n", "fast_code_sha256": "a24d6d06ea1b1d838a4073c9a514d3d23581d374baa8701100619651eaf5fcdf", "fast_id": "p03078_a24d6d06ea1b1d838a4073c9a514d3d23581d374baa8701100619651eaf5fcdf", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "X, Y, Z, K = map(int, input().split())\nA = list(map(int, input().split()))\nB = list(map(int, input().split()))\nC = list(map(int, input().split()))\nA.sort(reverse=True)\nB.sort(reverse=True)\nC.sort(reverse=True)\nans = []\nfor i in range(X):\n for j in range(Y):\n if (i + 1) * (j + 1) > K:\n break\n for k in range(Z):\n if (i + 1) * (j + 1) * (k + 1) <= K:\n ans.append(A[i] + B[j] + C[k])\n else:\n break\nprint(*sorted(ans, reverse=True)[:K], sep=\"\\n\")\n", "measured_fast_code_sha256": "a24d6d06ea1b1d838a4073c9a514d3d23581d374baa8701100619651eaf5fcdf", "measured_slow_code": "x, y, z, k = list(map(int, input().split()))\na = [int(m) for m in input().split()]\nb = [int(m) for m in input().split()]\nc = [int(m) for m in input().split()]\na.sort(reverse=True)\nb.sort(reverse=True)\nc.sort(reverse=True)\ns = []\nfor i in range(x):\n for j in range(y):\n s.append(a[i] + b[j])\ns.sort(reverse=True)\ns1 = []\nfor i in range(min(x * y, k)):\n s1.append(s[i])\nt = []\nfor i in range(min(x * y, k)):\n for j in range(z):\n t.append(s1[i] + c[j])\nt.sort(reverse=True)\nfor i in range(k):\n print((t[i]))\n", "measured_slow_code_sha256": "959a123011776bcef7dfa5fdc004179fc6e327b256f40cf04167243f65953a7c", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 13.686407535328215, "pair_id": "python_v2_38110a58a4e4db17a4f69d00", "per_case_slow_code_faster_fraction": 0.14, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03078", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03078_a24d6d06ea1b1d838a4073c9a514d3d23581d374baa8701100619651eaf5fcdf.jsonl.gz", "inputs": "reproduction/python/inputs/p03078.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03078_959a123011776bcef7dfa5fdc004179fc6e327b256f40cf04167243f65953a7c.jsonl.gz"}, "slow_code": "x, y, z, k = list(map(int, input().split()))\na = [int(m) for m in input().split()]\nb = [int(m) for m in input().split()]\nc = [int(m) for m in input().split()]\na.sort(reverse=True)\nb.sort(reverse=True)\nc.sort(reverse=True)\ns = []\nfor i in range(x):\n for j in range(y):\n s.append(a[i] + b[j])\ns.sort(reverse=True)\ns1 = []\nfor i in range(min(x * y, k)):\n s1.append(s[i])\nt = []\nfor i in range(min(x * y, k)):\n for j in range(z):\n t.append(s1[i] + c[j])\nt.sort(reverse=True)\nfor i in range(k):\n print((t[i]))\n", "slow_code_sha256": "959a123011776bcef7dfa5fdc004179fc6e327b256f40cf04167243f65953a7c", "slow_id": "p03078_959a123011776bcef7dfa5fdc004179fc6e327b256f40cf04167243f65953a7c", "speedup": 6.1031593226546015, "stratum": "4-8", "within_pair_jaccard": 0.38095238095238093, "workload": {"case_count": 100, "description": "Choose one entry from each of arrays A,B,C of lengths X,Y,Z. Print the K largest resulting sums, retaining multiplicities of different index triples. Observed inputs: X=1..1000 (median 100); Y=1..1000 (median 100); Z=1..1000 (median 400); K=1..3000 (median 3000); A_i=1..10000000000; B_i=1..10000000000; C_i=1..10000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 36020, "median": 6015.5, "min": 14}, "input_format": ["X Y Z K\nA_1 ... A_X\nB_1 ... B_Y\nC_1 ... C_Z"], "input_format_status": "source_input_section", "input_lines": {"max": 4, "median": 4.0, "min": 4}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3004, "median": 1804.0, "min": 7}}} -{"case_ids": ["p00741_case_000", "p00741_case_001", "p00741_case_002", "p00741_case_003", "p00741_case_004", "p00741_case_005", "p00741_case_006", "p00741_case_007", "p00741_case_008", "p00741_case_009", "p00741_case_010", "p00741_case_011", "p00741_case_012", "p00741_case_013", "p00741_case_014", "p00741_case_015", "p00741_case_016", "p00741_case_017", "p00741_case_018", "p00741_case_019", "p00741_case_020", "p00741_case_021", "p00741_case_022", "p00741_case_023", "p00741_case_024", "p00741_case_025", "p00741_case_026", "p00741_case_027", "p00741_case_028", "p00741_case_029", "p00741_case_030", "p00741_case_031", "p00741_case_032", "p00741_case_033", "p00741_case_034", "p00741_case_035", "p00741_case_036", "p00741_case_037", "p00741_case_038", "p00741_case_039", "p00741_case_040", "p00741_case_041", "p00741_case_042", "p00741_case_043", "p00741_case_044", "p00741_case_045", "p00741_case_046", "p00741_case_047", "p00741_case_048", "p00741_case_049", "p00741_case_050", "p00741_case_051", "p00741_case_052", "p00741_case_053", "p00741_case_054", "p00741_case_055", "p00741_case_056", "p00741_case_057", "p00741_case_058", "p00741_case_059", "p00741_case_060", "p00741_case_061", "p00741_case_062", "p00741_case_063", "p00741_case_064", "p00741_case_065", "p00741_case_066", "p00741_case_067", "p00741_case_068", "p00741_case_069", "p00741_case_070", "p00741_case_071", "p00741_case_072", "p00741_case_073", "p00741_case_074", "p00741_case_075", "p00741_case_076", "p00741_case_077", "p00741_case_078", "p00741_case_079", "p00741_case_080", "p00741_case_081", "p00741_case_082", "p00741_case_083", "p00741_case_084", "p00741_case_085", "p00741_case_086", "p00741_case_087", "p00741_case_088", "p00741_case_089", "p00741_case_090", "p00741_case_091", "p00741_case_092", "p00741_case_093", "p00741_case_094", "p00741_case_095", "p00741_case_096", "p00741_case_097", "p00741_case_098", "p00741_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def solve_sub(x, y, area):\n stack = []\n stack.append((x, y))\n move = [\n (x, y) for x in range(-1, 2) for y in range(-1, 2) if not (x == 0 and y == 0)\n ]\n while len(stack) != 0:\n now = stack.pop()\n x = now[0]\n y = now[1]\n area[y][x] = 0\n for dire in move:\n if (\n 0 <= x + dire[0] < w\n and 0 <= y + dire[1] < h\n and area[y + dire[1]][x + dire[0]] == 1\n ):\n stack.append((x + dire[0], y + dire[1]))\n area[y + dire[1]][x + dire[0]] = 2\n\n\ndef solve(area):\n ans = 0\n for y in range(h):\n for x in range(w):\n if area[y][x] == 1:\n ans += 1\n solve_sub(x, y, area)\n print(ans)\n\n\nif __name__ == \"__main__\":\n while True:\n w, h = list(map(int, input().split()))\n if w == 0 and h == 0:\n break\n area = []\n for y in range(h):\n area.append(list(map(int, input().split())))\n solve(area)\n", "fast_code_sha256": "356c651389ee677f02e136c68a9677391749837f39206556dc40201e6aa5d07f", "fast_id": "p00741_356c651389ee677f02e136c68a9677391749837f39206556dc40201e6aa5d07f", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def solve_sub(x, y, area):\n stack = []\n stack.append((x, y))\n move = [\n (x, y) for x in range(-1, 2) for y in range(-1, 2) if not (x == 0 and y == 0)\n ]\n while len(stack) != 0:\n now = stack.pop()\n x = now[0]\n y = now[1]\n area[y][x] = 0\n for dire in move:\n if (\n 0 <= x + dire[0] < w\n and 0 <= y + dire[1] < h\n and area[y + dire[1]][x + dire[0]] == 1\n ):\n stack.append((x + dire[0], y + dire[1]))\n area[y + dire[1]][x + dire[0]] = 2\n\n\ndef solve(area):\n ans = 0\n for y in range(h):\n for x in range(w):\n if area[y][x] == 1:\n ans += 1\n solve_sub(x, y, area)\n print(ans)\n\n\nif __name__ == \"__main__\":\n while True:\n w, h = list(map(int, input().split()))\n if w == 0 and h == 0:\n break\n area = []\n for y in range(h):\n area.append(list(map(int, input().split())))\n solve(area)\n", "measured_fast_code_sha256": "356c651389ee677f02e136c68a9677391749837f39206556dc40201e6aa5d07f", "measured_slow_code": "import sys\nfrom pprint import pprint\n\n\nclass UnionFind:\n def __init__(self):\n self._parent = {}\n self._rank = {}\n self._equiv = {}\n\n def _find(self, x):\n if self._parent[x] == x:\n return self._parent[x]\n else:\n p = self._find(self._parent[x])\n self._parent[x] = p\n return p\n\n def _set_parent(self, child, parent):\n self._parent[child] = parent\n self._equiv[parent].update(self._equiv.pop(child))\n\n def _union(self, x, y):\n x = self._find(x)\n y = self._find(y)\n if x == y:\n return\n if self._rank[x] > self._rank[y]:\n self._set_parent(y, x)\n elif self._rank[x] < self._rank[y]:\n self._set_parent(x, y)\n else:\n self._set_parent(x, y)\n self._rank[x] += 1\n\n def _make_set(self, x):\n self._parent[x] = x\n self._rank[x] = 0\n self._equiv[x] = {x}\n\n def unite(self, *elements):\n if not elements:\n return\n for x in elements:\n if x in self._parent:\n continue\n self._make_set(x)\n x0 = elements[0]\n for x in elements[1:]:\n self._union(x0, x)\n\n def groups(self):\n return [set(e) for e in list(self._equiv.values())]\n\n\ndef solve(ncol, nrow, rows):\n pairs = []\n # ?????????\n for x in range(ncol - 1):\n for y in range(nrow):\n pairs.append([(x, y), (x + 1, y)])\n # ?????????\n for x in range(ncol):\n for y in range(nrow - 1):\n pairs.append([(x, y), (x, y + 1)])\n # ???????????????\n for x in range(ncol - 1):\n for y in range(nrow - 1):\n pairs.append([(x, y), (x + 1, y + 1)])\n # ???????????????\n for x in range(ncol - 1):\n for y in range(1, nrow):\n pairs.append([(x, y), (x + 1, y - 1)])\n f = UnionFind()\n for x in range(ncol):\n for y in range(nrow):\n if rows[y][x]:\n f.unite((x, y))\n for (x1, y1), (x2, y2) in pairs:\n if rows[y1][x1] and rows[y2][x2]:\n f.unite((x1, y1), (x2, y2))\n return len(f.groups())\n\n\ndef main():\n while True:\n ncol, nrow = list(map(int, input().split()))\n if ncol == 0 and nrow == 0:\n break\n rows = []\n for _ in range(nrow):\n row = list(map(int, input().split()))\n rows.append(row)\n # print(ncol, nrow)\n # pprint(rows)\n print((solve(ncol, nrow, rows)))\n\n\nmain()\n", "measured_slow_code_sha256": "8dc05be20af5e5075433e403978246b6c79a92c743c71aa185196282e815a1ee", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.7389892031567507, "pair_id": "python_v2_b736682aa3f3a40c4bf75ff4", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p00741", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p00741_356c651389ee677f02e136c68a9677391749837f39206556dc40201e6aa5d07f.jsonl.gz", "inputs": "reproduction/python/inputs/p00741.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p00741_8dc05be20af5e5075433e403978246b6c79a92c743c71aa185196282e815a1ee.jsonl.gz"}, "slow_code": "import sys\nfrom pprint import pprint\n\n\nclass UnionFind:\n def __init__(self):\n self._parent = {}\n self._rank = {}\n self._equiv = {}\n\n def _find(self, x):\n if self._parent[x] == x:\n return self._parent[x]\n else:\n p = self._find(self._parent[x])\n self._parent[x] = p\n return p\n\n def _set_parent(self, child, parent):\n self._parent[child] = parent\n self._equiv[parent].update(self._equiv.pop(child))\n\n def _union(self, x, y):\n x = self._find(x)\n y = self._find(y)\n if x == y:\n return\n if self._rank[x] > self._rank[y]:\n self._set_parent(y, x)\n elif self._rank[x] < self._rank[y]:\n self._set_parent(x, y)\n else:\n self._set_parent(x, y)\n self._rank[x] += 1\n\n def _make_set(self, x):\n self._parent[x] = x\n self._rank[x] = 0\n self._equiv[x] = {x}\n\n def unite(self, *elements):\n if not elements:\n return\n for x in elements:\n if x in self._parent:\n continue\n self._make_set(x)\n x0 = elements[0]\n for x in elements[1:]:\n self._union(x0, x)\n\n def groups(self):\n return [set(e) for e in list(self._equiv.values())]\n\n\ndef solve(ncol, nrow, rows):\n pairs = []\n\n for x in range(ncol - 1):\n for y in range(nrow):\n pairs.append([(x, y), (x + 1, y)])\n\n for x in range(ncol):\n for y in range(nrow - 1):\n pairs.append([(x, y), (x, y + 1)])\n\n for x in range(ncol - 1):\n for y in range(nrow - 1):\n pairs.append([(x, y), (x + 1, y + 1)])\n\n for x in range(ncol - 1):\n for y in range(1, nrow):\n pairs.append([(x, y), (x + 1, y - 1)])\n f = UnionFind()\n for x in range(ncol):\n for y in range(nrow):\n if rows[y][x]:\n f.unite((x, y))\n for (x1, y1), (x2, y2) in pairs:\n if rows[y1][x1] and rows[y2][x2]:\n f.unite((x1, y1), (x2, y2))\n return len(f.groups())\n\n\ndef main():\n while True:\n ncol, nrow = list(map(int, input().split()))\n if ncol == 0 and nrow == 0:\n break\n rows = []\n for _ in range(nrow):\n row = list(map(int, input().split()))\n rows.append(row)\n\n print((solve(ncol, nrow, rows)))\n\n\nmain()\n", "slow_code_sha256": "98d0d93fa34ee5017dabd2c7cc8ffe301917d35141c767ea46a7bc955a0514a7", "slow_id": "p00741_8dc05be20af5e5075433e403978246b6c79a92c743c71aa185196282e815a1ee", "speedup": 2.923582496710271, "stratum": "2-4", "within_pair_jaccard": 0.3076923076923077, "workload": {"case_count": 100, "description": "For each binary map of width w and height h, count land components using horizontal, vertical and diagonal adjacency. Values 1 and 0 denote land and sea; outside the map is sea. A final 0 0 ends the maps. Observed inputs: datasets=1..50 (median 1); w=1..50; h=1..50; cells_per_map=1..2500; total_cells=1..12500 (median 2500).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 25034, "median": 5010.0, "min": 10}, "input_format": ["w_1 h_1\n[h_1 rows of w_1 binary integers]\n[next maps]\n0 0"], "input_format_status": "source_input_section", "input_lines": {"max": 551, "median": 52.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 12512, "median": 2504.0, "min": 5}}} -{"case_ids": ["p03018_case_000", "p03018_case_001", "p03018_case_002", "p03018_case_003", "p03018_case_004", "p03018_case_005", "p03018_case_006", "p03018_case_007", "p03018_case_008", "p03018_case_009", "p03018_case_010", "p03018_case_011", "p03018_case_012", "p03018_case_013", "p03018_case_014", "p03018_case_015", "p03018_case_016", "p03018_case_017", "p03018_case_018", "p03018_case_019", "p03018_case_020", "p03018_case_021", "p03018_case_022", "p03018_case_023", "p03018_case_024", "p03018_case_025", "p03018_case_026", "p03018_case_027", "p03018_case_028", "p03018_case_029", "p03018_case_030", "p03018_case_031", "p03018_case_032", "p03018_case_033", "p03018_case_034", "p03018_case_035", "p03018_case_036", "p03018_case_037", "p03018_case_038", "p03018_case_039", "p03018_case_040", "p03018_case_041", "p03018_case_042", "p03018_case_043", "p03018_case_044", "p03018_case_045", "p03018_case_046", "p03018_case_047", "p03018_case_048", "p03018_case_049", "p03018_case_050", "p03018_case_051", "p03018_case_052", "p03018_case_053", "p03018_case_054", "p03018_case_055", "p03018_case_056", "p03018_case_057", "p03018_case_058", "p03018_case_059", "p03018_case_060", "p03018_case_061", "p03018_case_062", "p03018_case_063", "p03018_case_064", "p03018_case_065", "p03018_case_066", "p03018_case_067", "p03018_case_068", "p03018_case_069", "p03018_case_070", "p03018_case_071", "p03018_case_072", "p03018_case_073", "p03018_case_074", "p03018_case_075", "p03018_case_076", "p03018_case_077", "p03018_case_078", "p03018_case_079", "p03018_case_080", "p03018_case_081", "p03018_case_082", "p03018_case_083", "p03018_case_084", "p03018_case_085", "p03018_case_086", "p03018_case_087", "p03018_case_088", "p03018_case_089", "p03018_case_090", "p03018_case_091", "p03018_case_092", "p03018_case_093", "p03018_case_094", "p03018_case_095", "p03018_case_096", "p03018_case_097", "p03018_case_098", "p03018_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "S = input().replace(\"BC\", \"1\")\nans = 0\na = 0\nfor s in S:\n if s == \"A\":\n a += 1\n elif s == \"1\":\n ans += a\n else:\n a = 0\nprint(ans)\n", "fast_code_sha256": "8f5a51e180a7a6a4d1a2eb53dc97fbb36cf013f0fbb7b103e5c079577c9fb5d2", "fast_id": "p03018_8f5a51e180a7a6a4d1a2eb53dc97fbb36cf013f0fbb7b103e5c079577c9fb5d2", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "S = input().replace(\"BC\", \"1\")\nans = 0\na = 0\nfor s in S:\n if s == \"A\":\n a += 1\n elif s == \"1\":\n ans += a\n else:\n a = 0\nprint(ans)\n", "measured_fast_code_sha256": "8f5a51e180a7a6a4d1a2eb53dc97fbb36cf013f0fbb7b103e5c079577c9fb5d2", "measured_slow_code": "import sys\n\nstdin = sys.stdin\nri = lambda: int(rs())\nrl = lambda: list(map(int, stdin.readline().split()))\nrs = lambda: stdin.readline().rstrip() # ignore trailing spaces\nS = list(rs())\ncur = \"D\"\nanswer = 0\nA_cnt = 0\nfor s in S:\n if cur == \"A\":\n if s == \"A\":\n A_cnt += 1\n elif s == \"B\":\n cur = s\n else:\n cur = \"D\"\n A_cnt = 0\n elif cur == \"B\":\n if s == \"A\":\n A_cnt = 1\n cur = s\n elif s == \"B\":\n A_cnt = 0\n cur = \"D\"\n elif s == \"C\":\n answer += A_cnt\n cur = s\n else:\n cur = \"D\"\n A_cnt = 0\n elif cur == \"C\":\n if s == \"A\":\n A_cnt += 1\n cur = s\n elif s == \"B\":\n cur = s\n else:\n cur = \"D\"\n A_cnt = 0\n else:\n if s == \"A\":\n A_cnt += 1\n cur = s\n else:\n A_cnt = 0\n cur = \"D\"\nprint(answer)\n", "measured_slow_code_sha256": "34cfcb0cd806549d9de932b7805e60b0300ac48d582c70a3b82e9e63ed79dbe3", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.175140165160668, "pair_id": "python_v2_d3c4bf2a45497ad651035c09", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03018", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03018_8f5a51e180a7a6a4d1a2eb53dc97fbb36cf013f0fbb7b103e5c079577c9fb5d2.jsonl.gz", "inputs": "reproduction/python/inputs/p03018.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03018_34cfcb0cd806549d9de932b7805e60b0300ac48d582c70a3b82e9e63ed79dbe3.jsonl.gz"}, "slow_code": "import sys\n\nstdin = sys.stdin\nri = lambda: int(rs())\nrl = lambda: list(map(int, stdin.readline().split()))\nrs = lambda: stdin.readline().rstrip()\nS = list(rs())\ncur = \"D\"\nanswer = 0\nA_cnt = 0\nfor s in S:\n if cur == \"A\":\n if s == \"A\":\n A_cnt += 1\n elif s == \"B\":\n cur = s\n else:\n cur = \"D\"\n A_cnt = 0\n elif cur == \"B\":\n if s == \"A\":\n A_cnt = 1\n cur = s\n elif s == \"B\":\n A_cnt = 0\n cur = \"D\"\n elif s == \"C\":\n answer += A_cnt\n cur = s\n else:\n cur = \"D\"\n A_cnt = 0\n elif cur == \"C\":\n if s == \"A\":\n A_cnt += 1\n cur = s\n elif s == \"B\":\n cur = s\n else:\n cur = \"D\"\n A_cnt = 0\n else:\n if s == \"A\":\n A_cnt += 1\n cur = s\n else:\n A_cnt = 0\n cur = \"D\"\nprint(answer)\n", "slow_code_sha256": "2a81960ac1f47336dbb6ad3e8a3b063f1f7be21a97a77ab30f5ed64ce398f2f3", "slow_id": "p03018_34cfcb0cd806549d9de932b7805e60b0300ac48d582c70a3b82e9e63ed79dbe3", "speedup": 2.5216262993743923, "stratum": "2-4", "within_pair_jaccard": 0.3142857142857143, "workload": {"case_count": 100, "description": "Given a string s over A,B,C, repeatedly replace any contiguous ABC by BCA. Find the maximum possible number of replacements. Observed inputs: s_length=1..200000 (median 1000); A_count=0..200000; B_count=0..200000; C_count=0..200000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 200001, "median": 1001.0, "min": 2}, "input_format": ["s"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p02848_case_000", "p02848_case_001", "p02848_case_002", "p02848_case_003", "p02848_case_004", "p02848_case_005", "p02848_case_006", "p02848_case_007", "p02848_case_008", "p02848_case_009", "p02848_case_010", "p02848_case_011", "p02848_case_012", "p02848_case_013", "p02848_case_014", "p02848_case_015", "p02848_case_016", "p02848_case_017", "p02848_case_018", "p02848_case_019", "p02848_case_020", "p02848_case_021", "p02848_case_022", "p02848_case_023", "p02848_case_024", "p02848_case_025", "p02848_case_026", "p02848_case_027", "p02848_case_028", "p02848_case_029", "p02848_case_030", "p02848_case_031", "p02848_case_032", "p02848_case_033", "p02848_case_034", "p02848_case_035", "p02848_case_036", "p02848_case_037", "p02848_case_038", "p02848_case_039", "p02848_case_040", "p02848_case_041", "p02848_case_042", "p02848_case_043", "p02848_case_044", "p02848_case_045", "p02848_case_046", "p02848_case_047", "p02848_case_048", "p02848_case_049", "p02848_case_050", "p02848_case_051", "p02848_case_052", "p02848_case_053", "p02848_case_054", "p02848_case_055", "p02848_case_056", "p02848_case_057", "p02848_case_058", "p02848_case_059", "p02848_case_060", "p02848_case_061", "p02848_case_062", "p02848_case_063", "p02848_case_064", "p02848_case_065", "p02848_case_066", "p02848_case_067", "p02848_case_068", "p02848_case_069", "p02848_case_070", "p02848_case_071", "p02848_case_072", "p02848_case_073", "p02848_case_074", "p02848_case_075", "p02848_case_076", "p02848_case_077", "p02848_case_078", "p02848_case_079", "p02848_case_080", "p02848_case_081", "p02848_case_082", "p02848_case_083", "p02848_case_084", "p02848_case_085", "p02848_case_086", "p02848_case_087", "p02848_case_088", "p02848_case_089", "p02848_case_090", "p02848_case_091", "p02848_case_092", "p02848_case_093", "p02848_case_094", "p02848_case_095", "p02848_case_096", "p02848_case_097", "p02848_case_098", "p02848_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N = int(input())\nS = input()\nfor s in S:\n ans = chr((ord(s) - ord(\"A\") + N) % 26 + ord(\"A\"))\n print(ans, end=\"\")\n", "fast_code_sha256": "7dc27a09ef2c9b461fbcb4fe978ad658f28d48d6f3e4857cd289415097f687c2", "fast_id": "p02848_7dc27a09ef2c9b461fbcb4fe978ad658f28d48d6f3e4857cd289415097f687c2", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N = int(input())\nS = input()\nfor s in S:\n ans = chr((ord(s) - ord(\"A\") + N) % 26 + ord(\"A\"))\n print(ans, end=\"\")\n", "measured_fast_code_sha256": "7dc27a09ef2c9b461fbcb4fe978ad658f28d48d6f3e4857cd289415097f687c2", "measured_slow_code": "# coding: utf-8\nimport sys\nimport math\nimport collections\nimport itertools\nfrom inspect import currentframe\n\nINF = 10**10\nMOD = 10**9 + 7\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef gcd(x, y):\n return y if x % y == 0 else gcd(y, x % y)\n\n\ndef lcm(x, y):\n return (x * y) // gcd(x, y)\n\n\ndef I():\n return int(input())\n\n\ndef MI():\n return map(int, input().split())\n\n\ndef LI():\n return [int(x) for x in input().split()]\n\n\ndef RI(N):\n return [int(input()) for _ in range(N)]\n\n\ndef LRI(N):\n return [[int(x) for x in input().split()] for _ in range(N)]\n\n\ndef chkprint(*args):\n names = {id(v): k for k, v in currentframe().f_back.f_locals.items()}\n print(\", \".join(names.get(id(arg), \"???\") + \" = \" + repr(arg) for arg in args))\n\n\nN = I()\nS = input()\nalp = [\n \"A\",\n \"B\",\n \"C\",\n \"D\",\n \"E\",\n \"F\",\n \"G\",\n \"H\",\n \"I\",\n \"J\",\n \"K\",\n \"L\",\n \"M\",\n \"N\",\n \"O\",\n \"P\",\n \"Q\",\n \"R\",\n \"S\",\n \"T\",\n \"U\",\n \"V\",\n \"W\",\n \"X\",\n \"Y\",\n \"Z\",\n]\nfor s in S:\n print(alp[(alp.index(s) + N) % 26], end=\"\")\n", "measured_slow_code_sha256": "28ec796f8eb56af2fabfccd11148299be75fe687af7fbeca1341511e952857a1", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.308498113027357, "pair_id": "python_v2_6a479de71e433ba5768f5d90", "per_case_slow_code_faster_fraction": 0.02, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02848", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02848_7dc27a09ef2c9b461fbcb4fe978ad658f28d48d6f3e4857cd289415097f687c2.jsonl.gz", "inputs": "reproduction/python/inputs/p02848.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02848_28ec796f8eb56af2fabfccd11148299be75fe687af7fbeca1341511e952857a1.jsonl.gz"}, "slow_code": "import sys\nimport math\nimport collections\nimport itertools\nfrom inspect import currentframe\n\nINF = 10**10\nMOD = 10**9 + 7\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef gcd(x, y):\n return y if x % y == 0 else gcd(y, x % y)\n\n\ndef lcm(x, y):\n return (x * y) // gcd(x, y)\n\n\ndef I():\n return int(input())\n\n\ndef MI():\n return map(int, input().split())\n\n\ndef LI():\n return [int(x) for x in input().split()]\n\n\ndef RI(N):\n return [int(input()) for _ in range(N)]\n\n\ndef LRI(N):\n return [[int(x) for x in input().split()] for _ in range(N)]\n\n\ndef chkprint(*args):\n names = {id(v): k for k, v in currentframe().f_back.f_locals.items()}\n print(\", \".join(names.get(id(arg), \"???\") + \" = \" + repr(arg) for arg in args))\n\n\nN = I()\nS = input()\nalp = [\n \"A\",\n \"B\",\n \"C\",\n \"D\",\n \"E\",\n \"F\",\n \"G\",\n \"H\",\n \"I\",\n \"J\",\n \"K\",\n \"L\",\n \"M\",\n \"N\",\n \"O\",\n \"P\",\n \"Q\",\n \"R\",\n \"S\",\n \"T\",\n \"U\",\n \"V\",\n \"W\",\n \"X\",\n \"Y\",\n \"Z\",\n]\nfor s in S:\n print(alp[(alp.index(s) + N) % 26], end=\"\")\n", "slow_code_sha256": "4e03a4428b1aa0327e66a8cb999ff15a637eaad3acbd2fd2d565e47714f697dd", "slow_id": "p02848_28ec796f8eb56af2fabfccd11148299be75fe687af7fbeca1341511e952857a1", "speedup": 2.5111125685704003, "stratum": "2-4", "within_pair_jaccard": 0.12941176470588237, "workload": {"case_count": 100, "description": "Shift every uppercase letter of S forward by N alphabetical positions, wrapping from Z to A, and output the resulting string. Observed inputs: N=0..26 (median 13); S_length=1..10000 (median 10000).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 10004, "median": 10004.0, "min": 4}, "input_format": ["N\nS"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p02821_case_000", "p02821_case_001", "p02821_case_002", "p02821_case_003", "p02821_case_004", "p02821_case_005", "p02821_case_006", "p02821_case_007", "p02821_case_008", "p02821_case_009", "p02821_case_010", "p02821_case_011", "p02821_case_012", "p02821_case_013", "p02821_case_014", "p02821_case_015", "p02821_case_016", "p02821_case_017", "p02821_case_018", "p02821_case_019", "p02821_case_020", "p02821_case_021", "p02821_case_022", "p02821_case_023", "p02821_case_024", "p02821_case_025", "p02821_case_026", "p02821_case_027", "p02821_case_028", "p02821_case_029", "p02821_case_030", "p02821_case_031", "p02821_case_032", "p02821_case_033", "p02821_case_034", "p02821_case_035", "p02821_case_036", "p02821_case_037", "p02821_case_038", "p02821_case_039", "p02821_case_040", "p02821_case_041", "p02821_case_042", "p02821_case_043", "p02821_case_044", "p02821_case_045", "p02821_case_046", "p02821_case_047", "p02821_case_048", "p02821_case_049", "p02821_case_050", "p02821_case_051", "p02821_case_052", "p02821_case_053", "p02821_case_054", "p02821_case_055", "p02821_case_056", "p02821_case_057", "p02821_case_058", "p02821_case_059", "p02821_case_060", "p02821_case_061", "p02821_case_062", "p02821_case_063", "p02821_case_064", "p02821_case_065", "p02821_case_066", "p02821_case_067", "p02821_case_068", "p02821_case_069", "p02821_case_070", "p02821_case_071", "p02821_case_072", "p02821_case_073", "p02821_case_074", "p02821_case_075", "p02821_case_076", "p02821_case_077", "p02821_case_078", "p02821_case_079", "p02821_case_080", "p02821_case_081", "p02821_case_082", "p02821_case_083", "p02821_case_084", "p02821_case_085", "p02821_case_086", "p02821_case_087", "p02821_case_088", "p02821_case_089", "p02821_case_090", "p02821_case_091", "p02821_case_092", "p02821_case_093", "p02821_case_094", "p02821_case_095", "p02821_case_096", "p02821_case_097", "p02821_case_098", "p02821_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "executable_AST_equal_except_explicit_explanatory_string_removal_and_all_frozen_inputs_checker_pass", "fast_code": "import sys\nfrom bisect import bisect_left\nfrom itertools import accumulate\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef list2d(a, b, c):\n return [[c] * b for i in range(a)]\n\n\ndef list3d(a, b, c, d):\n return [[[d] * c for j in range(b)] for i in range(a)]\n\n\ndef list4d(a, b, c, d, e):\n return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]\n\n\ndef ceil(x, y=1):\n return int(-(-x // y))\n\n\ndef INT():\n return int(eval(input()))\n\n\ndef MAP():\n return list(map(int, input().split()))\n\n\ndef LIST(N=None):\n return list(MAP()) if N is None else [INT() for i in range(N)]\n\n\ndef Yes():\n print(\"Yes\")\n\n\ndef No():\n print(\"No\")\n\n\ndef YES():\n print(\"YES\")\n\n\ndef NO():\n print(\"NO\")\n\n\nsys.setrecursionlimit(10**9)\nINF = 10**18\nMOD = 10**9 + 7\n\n\ndef bisearch_max(mn, mx, func):\n ok = mn\n ng = mx\n while ok + 1 < ng:\n mid = (ok + ng) // 2\n if func(mid):\n\n ok = mid\n else:\n\n ng = mid\n return ok\n\n\ndef calc(x):\n\n ans = 0\n for a in A:\n\n ans += N - bisect_left(A, x - a)\n return ans >= M\n\n\nN, M = MAP()\nA = LIST()\nA.sort()\nres = bisearch_max(0, 10**10 + 1, calc)\nans = m = 0\nacc = [0] + list(accumulate(A))\nfor a in A:\n idx = bisect_left(A, res - a)\n cnt = N - idx\n\n ans += a * cnt + (acc[N] - acc[idx])\n\n m += cnt\n\nans -= res * (m - M)\nprint(ans)\n", "fast_code_sha256": "47670c1598843dc43b5d2e0e140f3d48073ef691b49161c43d5e99b030c5718e", "fast_id": "p02821_f00aa63456dbc10f0de3cfa4bbae64b70e8183ac036be3b8da19d1aea48ee317", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "# -*- coding: utf-8 -*-\nimport sys\nfrom bisect import bisect_left\nfrom itertools import accumulate\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef list2d(a, b, c):\n return [[c] * b for i in range(a)]\n\n\ndef list3d(a, b, c, d):\n return [[[d] * c for j in range(b)] for i in range(a)]\n\n\ndef list4d(a, b, c, d, e):\n return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]\n\n\ndef ceil(x, y=1):\n return int(-(-x // y))\n\n\ndef INT():\n return int(eval(input()))\n\n\ndef MAP():\n return list(map(int, input().split()))\n\n\ndef LIST(N=None):\n return list(MAP()) if N is None else [INT() for i in range(N)]\n\n\ndef Yes():\n print(\"Yes\")\n\n\ndef No():\n print(\"No\")\n\n\ndef YES():\n print(\"YES\")\n\n\ndef NO():\n print(\"NO\")\n\n\nsys.setrecursionlimit(10**9)\nINF = 10**18\nMOD = 10**9 + 7\n\n\ndef bisearch_max(mn, mx, func):\n \"\"\"条件を満たす最大値を見つける二分探索\"\"\"\n ok = mn\n ng = mx\n while ok + 1 < ng:\n mid = (ok + ng) // 2\n if func(mid):\n # 上を探しに行く\n ok = mid\n else:\n # 下を探しに行く\n ng = mid\n return ok\n\n\n# 右手と左手(a,b)の和がx以上となる組の数\ndef calc(x):\n # 各aについて、条件を満たす数を数える\n ans = 0\n for a in A:\n # 式変形: a + b >= x → b >= x - a\n ans += N - bisect_left(A, x - a)\n return ans >= M\n\n\nN, M = MAP()\nA = LIST()\nA.sort()\nres = bisearch_max(0, 10**10 + 1, calc)\nans = m = 0\nacc = [0] + list(accumulate(A))\nfor a in A:\n idx = bisect_left(A, res - a)\n cnt = N - idx\n # 幸福度\n ans += a * cnt + (acc[N] - acc[idx])\n # 握手の回数\n m += cnt\n# 同値でMを超えた分の調整\nans -= res * (m - M)\nprint(ans)\n", "measured_fast_code_sha256": "f00aa63456dbc10f0de3cfa4bbae64b70e8183ac036be3b8da19d1aea48ee317", "measured_slow_code": "import numpy as np\nfrom numpy.fft import rfft, irfft\n\n\ndef main():\n n, m = list(map(int, input().split()))\n A = np.array(list(map(int, input().split())))\n F = np.bincount(A)\n fft_len = 2 * 10**5 + 1\n Ff = rfft(F, fft_len)\n G = np.rint(irfft(Ff * Ff, fft_len)).astype(np.int64)\n G_acc = G.cumsum()\n remove_cnt = n**2 - m\n border = np.searchsorted(G_acc, n**2 - m)\n x = n**2 - m - G_acc[border - 1]\n remove_sum = (G[:border] * np.arange(border)).sum() + border * x\n ans = A.sum() * 2 * n - remove_sum\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "399a196ed351749339d5a10a55db2a1415b7a96b36c485a1fd580d51c51982b2", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 7.9030053485105665, "pair_id": "python_v2_4e3b5b5ed527c0a58fa9bc97", "per_case_slow_code_faster_fraction": 0.43, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02821", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02821_f00aa63456dbc10f0de3cfa4bbae64b70e8183ac036be3b8da19d1aea48ee317.jsonl.gz", "inputs": "reproduction/python/inputs/p02821.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02821_399a196ed351749339d5a10a55db2a1415b7a96b36c485a1fd580d51c51982b2.jsonl.gz"}, "slow_code": "import numpy as np\nfrom numpy.fft import rfft, irfft\n\n\ndef main():\n n, m = list(map(int, input().split()))\n A = np.array(list(map(int, input().split())))\n F = np.bincount(A)\n fft_len = 2 * 10**5 + 1\n Ff = rfft(F, fft_len)\n G = np.rint(irfft(Ff * Ff, fft_len)).astype(np.int64)\n G_acc = G.cumsum()\n remove_cnt = n**2 - m\n border = np.searchsorted(G_acc, n**2 - m)\n x = n**2 - m - G_acc[border - 1]\n remove_sum = (G[:border] * np.arange(border)).sum() + border * x\n ans = A.sum() * 2 * n - remove_sum\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "399a196ed351749339d5a10a55db2a1415b7a96b36c485a1fd580d51c51982b2", "slow_id": "p02821_399a196ed351749339d5a10a55db2a1415b7a96b36c485a1fd580d51c51982b2", "speedup": 5.015554141964228, "stratum": "4-8", "within_pair_jaccard": 0.15384615384615385, "workload": {"case_count": 100, "description": "Choose M distinct ordered pairs (x,y) of guests among N, allowing x=y. Pair (x,y) yields happiness A_x+A_y. Maximize total happiness; reversing unequal IDs gives a different pair. Observed inputs: N=1..100000 (median 1000); M=1..10000000000 (median 1000000); A_i=1..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 700019, "median": 5888.0, "min": 8}, "input_format": ["N M\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100002, "median": 1002.0, "min": 3}}} -{"case_ids": ["p03786_case_000", "p03786_case_001", "p03786_case_002", "p03786_case_003", "p03786_case_004", "p03786_case_005", "p03786_case_006", "p03786_case_007", "p03786_case_008", "p03786_case_009", "p03786_case_010", "p03786_case_011", "p03786_case_012", "p03786_case_013", "p03786_case_014", "p03786_case_015", "p03786_case_016", "p03786_case_017", "p03786_case_018", "p03786_case_019", "p03786_case_020", "p03786_case_021", "p03786_case_022", "p03786_case_023", "p03786_case_024", "p03786_case_025", "p03786_case_026", "p03786_case_027", "p03786_case_028", "p03786_case_029", "p03786_case_030", "p03786_case_031", "p03786_case_032", "p03786_case_033", "p03786_case_034", "p03786_case_035", "p03786_case_036", "p03786_case_037", "p03786_case_038", "p03786_case_039", "p03786_case_040", "p03786_case_041", "p03786_case_042", "p03786_case_043", "p03786_case_044", "p03786_case_045", "p03786_case_046", "p03786_case_047", "p03786_case_048", "p03786_case_049", "p03786_case_050", "p03786_case_051", "p03786_case_052", "p03786_case_053", "p03786_case_054", "p03786_case_055", "p03786_case_056", "p03786_case_057", "p03786_case_058", "p03786_case_059", "p03786_case_060", "p03786_case_061", "p03786_case_062", "p03786_case_063", "p03786_case_064", "p03786_case_065", "p03786_case_066", "p03786_case_067", "p03786_case_068", "p03786_case_069", "p03786_case_070", "p03786_case_071", "p03786_case_072", "p03786_case_073", "p03786_case_074", "p03786_case_075", "p03786_case_076", "p03786_case_077", "p03786_case_078", "p03786_case_079", "p03786_case_080", "p03786_case_081", "p03786_case_082", "p03786_case_083", "p03786_case_084", "p03786_case_085", "p03786_case_086", "p03786_case_087", "p03786_case_088", "p03786_case_089", "p03786_case_090", "p03786_case_091", "p03786_case_092", "p03786_case_093", "p03786_case_094", "p03786_case_095", "p03786_case_096", "p03786_case_097", "p03786_case_098", "p03786_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\na = list(map(int, input().split()))\na.sort(reverse=True)\nssum = sum(a)\nans = 1\nfor i in range(n):\n ssum -= a[i]\n if 2 * ssum < a[i]:\n break\n else:\n ans += 1\nprint(ans)\n", "fast_code_sha256": "76a63e61a3811b1d81f61574206706c934c2797ff20d05cb0a8f2af4491931aa", "fast_id": "p03786_76a63e61a3811b1d81f61574206706c934c2797ff20d05cb0a8f2af4491931aa", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\na = list(map(int, input().split()))\na.sort(reverse=True)\nssum = sum(a)\nans = 1\nfor i in range(n):\n ssum -= a[i]\n if 2 * ssum < a[i]:\n break\n else:\n ans += 1\nprint(ans)\n", "measured_fast_code_sha256": "76a63e61a3811b1d81f61574206706c934c2797ff20d05cb0a8f2af4491931aa", "measured_slow_code": "import numpy as np\n\nN = int(eval(input()))\nA = list(map(int, input().split()))\nA = sorted(A)\nC = np.cumsum(A)\nans = 0\ncnt = 0\nfor i in range(N - 1):\n if C[i] * 2 >= A[i + 1]:\n cnt += 1\n else:\n cnt = 0\nans = cnt + 1\nprint(ans)\n", "measured_slow_code_sha256": "01e4e104b8cffd408e37f15b9026d222331aea634f5f65862577d6e6a8a42837", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 875.5951031894667, "pair_id": "python_v2_d6785c1462f4e41d375b5509", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03786", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03786_76a63e61a3811b1d81f61574206706c934c2797ff20d05cb0a8f2af4491931aa.jsonl.gz", "inputs": "reproduction/python/inputs/p03786.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03786_01e4e104b8cffd408e37f15b9026d222331aea634f5f65862577d6e6a8a42837.jsonl.gz"}, "slow_code": "import numpy as np\n\nN = int(eval(input()))\nA = list(map(int, input().split()))\nA = sorted(A)\nC = np.cumsum(A)\nans = 0\ncnt = 0\nfor i in range(N - 1):\n if C[i] * 2 >= A[i + 1]:\n cnt += 1\n else:\n cnt = 0\nans = cnt + 1\nprint(ans)\n", "slow_code_sha256": "01e4e104b8cffd408e37f15b9026d222331aea634f5f65862577d6e6a8a42837", "slow_id": "p03786_01e4e104b8cffd408e37f15b9026d222331aea634f5f65862577d6e6a8a42837", "speedup": 137.0399945886292, "stratum": "8+", "within_pair_jaccard": 0.45714285714285713, "workload": {"case_count": 100, "description": "N creatures have distinct colors and sizes A_i. A creature of size A may absorb one of size C<=2*A; its size becomes A+C and its color survives. Count colors that can remain after all creatures merge. Observed inputs: N=2..100000 (median 10); A_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1100007, "median": 101.5, "min": 14}, "input_format": ["N\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100001, "median": 11.0, "min": 3}}} -{"case_ids": ["p03112_case_000", "p03112_case_001", "p03112_case_002", "p03112_case_003", "p03112_case_004", "p03112_case_005", "p03112_case_006", "p03112_case_007", "p03112_case_008", "p03112_case_009", "p03112_case_010", "p03112_case_011", "p03112_case_012", "p03112_case_013", "p03112_case_014", "p03112_case_015", "p03112_case_016", "p03112_case_017", "p03112_case_018", "p03112_case_019", "p03112_case_020", "p03112_case_021", "p03112_case_022", "p03112_case_023", "p03112_case_024", "p03112_case_025", "p03112_case_026", "p03112_case_027", "p03112_case_028", "p03112_case_029", "p03112_case_030", "p03112_case_031", "p03112_case_032", "p03112_case_033", "p03112_case_034", "p03112_case_035", "p03112_case_036", "p03112_case_037", "p03112_case_038", "p03112_case_039", "p03112_case_040", "p03112_case_041", "p03112_case_042", "p03112_case_043", "p03112_case_044", "p03112_case_045", "p03112_case_046", "p03112_case_047", "p03112_case_048", "p03112_case_049", "p03112_case_050", "p03112_case_051", "p03112_case_052", "p03112_case_053", "p03112_case_054", "p03112_case_055", "p03112_case_056", "p03112_case_057", "p03112_case_058", "p03112_case_059", "p03112_case_060", "p03112_case_061", "p03112_case_062", "p03112_case_063", "p03112_case_064", "p03112_case_065", "p03112_case_066", "p03112_case_067", "p03112_case_068", "p03112_case_069", "p03112_case_070", "p03112_case_071", "p03112_case_072", "p03112_case_073", "p03112_case_074", "p03112_case_075", "p03112_case_076", "p03112_case_077", "p03112_case_078", "p03112_case_079", "p03112_case_080", "p03112_case_081", "p03112_case_082", "p03112_case_083", "p03112_case_084", "p03112_case_085", "p03112_case_086", "p03112_case_087", "p03112_case_088", "p03112_case_089", "p03112_case_090", "p03112_case_091", "p03112_case_092", "p03112_case_093", "p03112_case_094", "p03112_case_095", "p03112_case_096", "p03112_case_097", "p03112_case_098", "p03112_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from bisect import bisect\n\n\ndef main():\n a, b, q, *stx = list(map(int, open(0).read().split()))\n s = [-1e10] + stx[:a] + [2 * 1e10]\n t = [-1e10] + stx[a : a + b] + [2 * 1e10]\n x = stx[a + b : a + b + q]\n for i in x:\n pos_s = bisect(s, i)\n pos_t = bisect(t, i)\n sl = s[pos_s - 1]\n sr = s[pos_s]\n tl = t[pos_t - 1]\n tr = t[pos_t]\n ans = min(\n i - min(sl, tl),\n max(sr, tr) - i,\n (sr - i) + (sr - tl),\n (tr - i) + (tr - sl),\n (i - sl) + (tr - sl),\n (i - tl) + (sr - tl),\n )\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "4090583f6aa869d802e0b783200dcb36cadfe644c804cfc2fc81125201e61d62", "fast_id": "p03112_4090583f6aa869d802e0b783200dcb36cadfe644c804cfc2fc81125201e61d62", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from bisect import bisect\n\n\ndef main():\n a, b, q, *stx = list(map(int, open(0).read().split()))\n s = [-1e10] + stx[:a] + [2 * 1e10]\n t = [-1e10] + stx[a : a + b] + [2 * 1e10]\n x = stx[a + b : a + b + q]\n for i in x:\n pos_s = bisect(s, i)\n pos_t = bisect(t, i)\n sl = s[pos_s - 1]\n sr = s[pos_s]\n tl = t[pos_t - 1]\n tr = t[pos_t]\n ans = min(\n i - min(sl, tl),\n max(sr, tr) - i,\n (sr - i) + (sr - tl),\n (tr - i) + (tr - sl),\n (i - sl) + (tr - sl),\n (i - tl) + (sr - tl),\n )\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "4090583f6aa869d802e0b783200dcb36cadfe644c804cfc2fc81125201e61d62", "measured_slow_code": "import bisect\nimport sys\n\nA, B, Q = list(map(int, input().split()))\nINF = 10**13\ns = [-INF] + [int(eval(input())) for i in range(A)] + [INF]\nt = [-INF] + [int(eval(input())) for i in range(B)] + [INF]\nfor q in range(Q):\n x = int(sys.stdin.readline())\n b, d = bisect.bisect_right(s, x), bisect.bisect_right(t, x)\n res = INF\n for S in [s[b - 1], s[b]]:\n for T in [t[d - 1], t[d]]:\n d1, d2 = abs(S - x) + abs(T - S), abs(T - x) + abs(S - T)\n res = min(res, d1, d2)\n print(res)\n", "measured_slow_code_sha256": "48e4fd9d450fd27d87e24629eca915771a72dc68a4f05e0709012344bd4812b8", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.8471928159268884, "pair_id": "python_v2_96e60ffa30a7f0050c6c771e", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03112", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03112_4090583f6aa869d802e0b783200dcb36cadfe644c804cfc2fc81125201e61d62.jsonl.gz", "inputs": "reproduction/python/inputs/p03112.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03112_48e4fd9d450fd27d87e24629eca915771a72dc68a4f05e0709012344bd4812b8.jsonl.gz"}, "slow_code": "import bisect\nimport sys\n\nA, B, Q = list(map(int, input().split()))\nINF = 10**13\ns = [-INF] + [int(eval(input())) for i in range(A)] + [INF]\nt = [-INF] + [int(eval(input())) for i in range(B)] + [INF]\nfor q in range(Q):\n x = int(sys.stdin.readline())\n b, d = bisect.bisect_right(s, x), bisect.bisect_right(t, x)\n res = INF\n for S in [s[b - 1], s[b]]:\n for T in [t[d - 1], t[d]]:\n d1, d2 = abs(S - x) + abs(T - S), abs(T - x) + abs(S - T)\n res = min(res, d1, d2)\n print(res)\n", "slow_code_sha256": "48e4fd9d450fd27d87e24629eca915771a72dc68a4f05e0709012344bd4812b8", "slow_id": "p03112_48e4fd9d450fd27d87e24629eca915771a72dc68a4f05e0709012344bd4812b8", "speedup": 3.671703112528298, "stratum": "2-4", "within_pair_jaccard": 0.29310344827586204, "workload": {"case_count": 100, "description": "For each starting coordinate x_i on a line, minimize travel distance needed to visit at least one shrine s_j and one temple t_j in any order. Shrine and temple lists are strictly increasing; all shrine, temple and query coordinates are distinct. Observed inputs: A=1..100000 (median 1000); B=1..100000 (median 1000); Q=1..100000 (median 1000); s_i=1..9999998614; t_i=10814..10000000000; x_i=1631..9999995619.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 3267071, "median": 267821.5, "min": 31}, "input_format": ["A B Q\ns_1\n...\ns_A\nt_1\n...\nt_B\nx_1\n...\nx_Q"], "input_format_status": "source_input_section", "input_lines": {"max": 300001, "median": 30001.0, "min": 4}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 300003, "median": 30003.0, "min": 6}}} -{"case_ids": ["p02789_case_000", "p02789_case_001", "p02789_case_002", "p02789_case_003", "p02789_case_004", "p02789_case_005", "p02789_case_006", "p02789_case_007", "p02789_case_008", "p02789_case_009", "p02789_case_010", "p02789_case_011", "p02789_case_012", "p02789_case_013", "p02789_case_014", "p02789_case_015", "p02789_case_016", "p02789_case_017", "p02789_case_018", "p02789_case_019", "p02789_case_020", "p02789_case_021", "p02789_case_022", "p02789_case_023", "p02789_case_024", "p02789_case_025", "p02789_case_026", "p02789_case_027", "p02789_case_028", "p02789_case_029", "p02789_case_030", "p02789_case_031", "p02789_case_032", "p02789_case_033", "p02789_case_034", "p02789_case_035", "p02789_case_036", "p02789_case_037", "p02789_case_038", "p02789_case_039", "p02789_case_040", "p02789_case_041", "p02789_case_042", "p02789_case_043", "p02789_case_044", "p02789_case_045", "p02789_case_046", "p02789_case_047", "p02789_case_048", "p02789_case_049", "p02789_case_050", "p02789_case_051", "p02789_case_052", "p02789_case_053", "p02789_case_054", "p02789_case_055", "p02789_case_056", "p02789_case_057", "p02789_case_058", "p02789_case_059", "p02789_case_060", "p02789_case_061", "p02789_case_062", "p02789_case_063", "p02789_case_064", "p02789_case_065", "p02789_case_066", "p02789_case_067", "p02789_case_068", "p02789_case_069", "p02789_case_070", "p02789_case_071", "p02789_case_072", "p02789_case_073", "p02789_case_074", "p02789_case_075", "p02789_case_076", "p02789_case_077", "p02789_case_078", "p02789_case_079", "p02789_case_080", "p02789_case_081", "p02789_case_082", "p02789_case_083", "p02789_case_084", "p02789_case_085", "p02789_case_086", "p02789_case_087", "p02789_case_088", "p02789_case_089", "p02789_case_090", "p02789_case_091", "p02789_case_092", "p02789_case_093", "p02789_case_094", "p02789_case_095", "p02789_case_096", "p02789_case_097", "p02789_case_098", "p02789_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def resolve():\n a, b = list(map(int, input().split()))\n if a == b:\n print(\"Yes\")\n else:\n print(\"No\")\n\n\nresolve()\n", "fast_code_sha256": "e645382e77107b5d2d52f141249ca14dc6fb91813448c2fd1d8e3ce0f424ce39", "fast_id": "p02789_e645382e77107b5d2d52f141249ca14dc6fb91813448c2fd1d8e3ce0f424ce39", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def resolve():\n a, b = list(map(int, input().split()))\n if a == b:\n print(\"Yes\")\n else:\n print(\"No\")\n\n\nresolve()\n", "measured_fast_code_sha256": "e645382e77107b5d2d52f141249ca14dc6fb91813448c2fd1d8e3ce0f424ce39", "measured_slow_code": "# coding: utf-8\n# submission # - User: herp_sy\n# https://atcoder.jp/contests/\n#\n# lang: Python3 (3.4.3)\nimport math\nimport statistics\nimport numpy as np\nimport queue\nimport itertools\n\nn, m = list(map(int, input().split()))\nif n == m:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "measured_slow_code_sha256": "3b3c9592d05d78419094081aeeb834d7351702df4b6152b2850a5ab58ae1e1e1", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1735.398530008721, "pair_id": "python_v2_8995da0fe7cdfb69b33621d4", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02789", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02789_e645382e77107b5d2d52f141249ca14dc6fb91813448c2fd1d8e3ce0f424ce39.jsonl.gz", "inputs": "reproduction/python/inputs/p02789.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02789_3b3c9592d05d78419094081aeeb834d7351702df4b6152b2850a5ab58ae1e1e1.jsonl.gz"}, "slow_code": "import math\nimport statistics\nimport numpy as np\nimport queue\nimport itertools\n\nn, m = list(map(int, input().split()))\nif n == m:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "slow_code_sha256": "b67e95e628852cc5e8281d284b620a3652c42bb82548c79c6e24811247e94916", "slow_id": "p02789_3b3c9592d05d78419094081aeeb834d7351702df4b6152b2850a5ab58ae1e1e1", "speedup": 1733.9876012155516, "stratum": "8+", "within_pair_jaccard": 0.4166666666666667, "workload": {"case_count": 100, "description": "A submission has passed M of its N required test cases. Determine whether it receives acceptance, which requires passing every case. Observed inputs: N=1..100 (median 44); M=0..100 (median 14.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 8, "median": 6.0, "min": 4}, "input_format": ["N M"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p03147_case_000", "p03147_case_001", "p03147_case_002", "p03147_case_003", "p03147_case_004", "p03147_case_005", "p03147_case_006", "p03147_case_007", "p03147_case_008", "p03147_case_009", "p03147_case_010", "p03147_case_011", "p03147_case_012", "p03147_case_013", "p03147_case_014", "p03147_case_015", "p03147_case_016", "p03147_case_017", "p03147_case_018", "p03147_case_019", "p03147_case_020", "p03147_case_021", "p03147_case_022", "p03147_case_023", "p03147_case_024", "p03147_case_025", "p03147_case_026", "p03147_case_027", "p03147_case_028", "p03147_case_029", "p03147_case_030", "p03147_case_031", "p03147_case_032", "p03147_case_033", "p03147_case_034", "p03147_case_035", "p03147_case_036", "p03147_case_037", "p03147_case_038", "p03147_case_039", "p03147_case_040", "p03147_case_041", "p03147_case_042", "p03147_case_043", "p03147_case_044", "p03147_case_045", "p03147_case_046", "p03147_case_047", "p03147_case_048", "p03147_case_049", "p03147_case_050", "p03147_case_051", "p03147_case_052", "p03147_case_053", "p03147_case_054", "p03147_case_055", "p03147_case_056", "p03147_case_057", "p03147_case_058", "p03147_case_059", "p03147_case_060", "p03147_case_061", "p03147_case_062", "p03147_case_063", "p03147_case_064", "p03147_case_065", "p03147_case_066", "p03147_case_067", "p03147_case_068", "p03147_case_069", "p03147_case_070", "p03147_case_071", "p03147_case_072", "p03147_case_073", "p03147_case_074", "p03147_case_075", "p03147_case_076", "p03147_case_077", "p03147_case_078", "p03147_case_079", "p03147_case_080", "p03147_case_081", "p03147_case_082", "p03147_case_083", "p03147_case_084", "p03147_case_085", "p03147_case_086", "p03147_case_087", "p03147_case_088", "p03147_case_089", "p03147_case_090", "p03147_case_091", "p03147_case_092", "p03147_case_093", "p03147_case_094", "p03147_case_095", "p03147_case_096", "p03147_case_097", "p03147_case_098", "p03147_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N = int(eval(input()))\nH = list(map(int, input().split()))\ncnt = 0\nwhile True:\n flag = 0\n for i in range(N):\n if H[i] > 0:\n cur = i\n flag = 1\n break\n if flag == 0:\n break\n cmin = H[cur]\n flag = 1\n for i in range(cur, N):\n if H[i] > 0 and flag == 1:\n cmin = min(cmin, H[i])\n elif H[i] > 0 and flag == 0:\n cur = i\n cmin = H[i]\n flag = 1\n else:\n cnt += cmin\n for k in range(cur, i):\n H[k] -= cmin\n cur = i\n cmin = 0\n flag = 0\n cnt += cmin\n for k in range(cur, N):\n H[k] -= cmin\nprint(cnt)\n", "fast_code_sha256": "53a10d656d426e017588389ff0f468de207c7dd85040b6956dda55fc28e3a693", "fast_id": "p03147_53a10d656d426e017588389ff0f468de207c7dd85040b6956dda55fc28e3a693", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N = int(eval(input()))\nH = list(map(int, input().split()))\ncnt = 0\nwhile True:\n flag = 0\n for i in range(N):\n if H[i] > 0:\n cur = i\n flag = 1\n break\n if flag == 0:\n break\n cmin = H[cur]\n flag = 1\n for i in range(cur, N):\n if H[i] > 0 and flag == 1:\n cmin = min(cmin, H[i])\n elif H[i] > 0 and flag == 0:\n cur = i\n cmin = H[i]\n flag = 1\n else:\n cnt += cmin\n for k in range(cur, i):\n H[k] -= cmin\n cur = i\n cmin = 0\n flag = 0\n cnt += cmin\n for k in range(cur, N):\n H[k] -= cmin\nprint(cnt)\n", "measured_fast_code_sha256": "53a10d656d426e017588389ff0f468de207c7dd85040b6956dda55fc28e3a693", "measured_slow_code": "import sys\n\nsys.setrecursionlimit(10**7)\ninput = sys.stdin.readline\nf_inf = float(\"inf\")\nmod = 10**9 + 7\n\n\ndef resolve():\n n = int(eval(input()))\n H = list(map(int, input().split()))\n res = 0\n i = 0\n while sum(H) != 0:\n if H[i] != 0:\n while i < n and H[i] != 0:\n H[i] -= 1\n i += 1\n res += 1\n i = 0\n else:\n i += 1\n print(res)\n\n\nif __name__ == \"__main__\":\n resolve()\n", "measured_slow_code_sha256": "24841992c3576a8c9d1c515258440c154f96007ad50f3bda6aa6dfc05a4b9c5f", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.6179655371667403, "pair_id": "python_v2_ea3f7ab8e407ea17b244b988", "per_case_slow_code_faster_fraction": 0.2, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03147", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03147_53a10d656d426e017588389ff0f468de207c7dd85040b6956dda55fc28e3a693.jsonl.gz", "inputs": "reproduction/python/inputs/p03147.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03147_24841992c3576a8c9d1c515258440c154f96007ad50f3bda6aa6dfc05a4b9c5f.jsonl.gz"}, "slow_code": "import sys\n\nsys.setrecursionlimit(10**7)\ninput = sys.stdin.readline\nf_inf = float(\"inf\")\nmod = 10**9 + 7\n\n\ndef resolve():\n n = int(eval(input()))\n H = list(map(int, input().split()))\n res = 0\n i = 0\n while sum(H) != 0:\n if H[i] != 0:\n while i < n and H[i] != 0:\n H[i] -= 1\n i += 1\n res += 1\n i = 0\n else:\n i += 1\n print(res)\n\n\nif __name__ == \"__main__\":\n resolve()\n", "slow_code_sha256": "24841992c3576a8c9d1c515258440c154f96007ad50f3bda6aa6dfc05a4b9c5f", "slow_id": "p03147_24841992c3576a8c9d1c515258440c154f96007ad50f3bda6aa6dfc05a4b9c5f", "speedup": 6.726926531417949, "stratum": "4-8", "within_pair_jaccard": 0.3191489361702128, "workload": {"case_count": 100, "description": "N flower heights start at zero. One operation increments every height in a chosen contiguous interval by 1. Minimize operations to obtain exactly the target heights h_i. Observed inputs: N=1..100 (median 50); h_i=0..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 404, "median": 137.0, "min": 4}, "input_format": ["N\nh_1 ... h_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 101, "median": 51.0, "min": 2}}} -{"case_ids": ["p02603_case_000", "p02603_case_001", "p02603_case_002", "p02603_case_003", "p02603_case_004", "p02603_case_005", "p02603_case_006", "p02603_case_007", "p02603_case_008", "p02603_case_009", "p02603_case_010", "p02603_case_011", "p02603_case_012", "p02603_case_013", "p02603_case_014", "p02603_case_015", "p02603_case_016", "p02603_case_017", "p02603_case_018", "p02603_case_019", "p02603_case_020", "p02603_case_021", "p02603_case_022", "p02603_case_023", "p02603_case_024", "p02603_case_025", "p02603_case_026", "p02603_case_027", "p02603_case_028", "p02603_case_029", "p02603_case_030", "p02603_case_031", "p02603_case_032", "p02603_case_033", "p02603_case_034", "p02603_case_035", "p02603_case_036", "p02603_case_037", "p02603_case_038", "p02603_case_039", "p02603_case_040", "p02603_case_041", "p02603_case_042", "p02603_case_043", "p02603_case_044", "p02603_case_045", "p02603_case_046", "p02603_case_047", "p02603_case_048", "p02603_case_049", "p02603_case_050", "p02603_case_051", "p02603_case_052", "p02603_case_053", "p02603_case_054", "p02603_case_055", "p02603_case_056", "p02603_case_057", "p02603_case_058", "p02603_case_059", "p02603_case_060", "p02603_case_061", "p02603_case_062", "p02603_case_063", "p02603_case_064", "p02603_case_065", "p02603_case_066", "p02603_case_067", "p02603_case_068", "p02603_case_069", "p02603_case_070", "p02603_case_071", "p02603_case_072", "p02603_case_073", "p02603_case_074", "p02603_case_075", "p02603_case_076", "p02603_case_077", "p02603_case_078", "p02603_case_079", "p02603_case_080", "p02603_case_081", "p02603_case_082", "p02603_case_083", "p02603_case_084", "p02603_case_085", "p02603_case_086", "p02603_case_087", "p02603_case_088", "p02603_case_089", "p02603_case_090", "p02603_case_091", "p02603_case_092", "p02603_case_093", "p02603_case_094", "p02603_case_095", "p02603_case_096", "p02603_case_097", "p02603_case_098", "p02603_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\na = list(map(int, input().split()))\na_cur = a[0]\nm = 1000\ns = 0\nfor i in range(1, n):\n a_next = a[i]\n if a_cur < a_next:\n\n s += m // a_cur\n m -= m // a_cur * a_cur\n else:\n\n m += s * a_cur\n s = 0\n a_cur = a_next\nm += s * a_cur\nprint(m)\n", "fast_code_sha256": "55acc7ce8cedc6a242c493f2cf7b0d9bd9447577f90035762c1fc1c1719bf63e", "fast_id": "p02603_7f991e931f7e5f476d566fe2bcb11cbc12489e8d750e92eaeb44581b46ddc903", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\na = list(map(int, input().split()))\na_cur = a[0]\nm = 1000\ns = 0\nfor i in range(1, n):\n a_next = a[i]\n if a_cur < a_next:\n # buy\n s += m // a_cur\n m -= m // a_cur * a_cur\n else:\n # sell\n m += s * a_cur\n s = 0\n a_cur = a_next\nm += s * a_cur\nprint(m)\n", "measured_fast_code_sha256": "7f991e931f7e5f476d566fe2bcb11cbc12489e8d750e92eaeb44581b46ddc903", "measured_slow_code": "import sys\nimport heapq, math\nfrom bisect import bisect_right\nfrom itertools import (\n zip_longest,\n permutations,\n combinations,\n combinations_with_replacement,\n)\nfrom itertools import accumulate, dropwhile, takewhile, groupby\nfrom functools import lru_cache\nfrom copy import deepcopy\n\nN = int(eval(input()))\nA = list(map(int, input().split()))\nB = [A[0]]\nfor i in range(1, N):\n if A[i - 1] != A[i]:\n B.append(A[i])\nN = len(B)\n\n\ndef solve():\n ret = 1000\n l = 0\n while l < N:\n while l < N - 1 and B[l] > B[l + 1]:\n l += 1\n if l == N - 1:\n return ret\n C = [B[l]]\n while l < N - 1 and B[l] < B[l + 1]:\n C.append(B[l + 1])\n l += 1\n cnt = ret // C[0]\n ret -= cnt * C[0]\n ret += cnt * C[-1]\n l += 1\n return ret\n\n\nprint((solve()))\n", "measured_slow_code_sha256": "ac647f8beef1e462070f18ba0c6d85690102f1fdb39ac64fcccd21cdad5d43fa", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 6.2804511204015565, "pair_id": "python_v2_2f0bedd67d83eefcef320baa", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02603", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02603_7f991e931f7e5f476d566fe2bcb11cbc12489e8d750e92eaeb44581b46ddc903.jsonl.gz", "inputs": "reproduction/python/inputs/p02603.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02603_ac647f8beef1e462070f18ba0c6d85690102f1fdb39ac64fcccd21cdad5d43fa.jsonl.gz"}, "slow_code": "import sys\nimport heapq, math\nfrom bisect import bisect_right\nfrom itertools import (\n zip_longest,\n permutations,\n combinations,\n combinations_with_replacement,\n)\nfrom itertools import accumulate, dropwhile, takewhile, groupby\nfrom functools import lru_cache\nfrom copy import deepcopy\n\nN = int(eval(input()))\nA = list(map(int, input().split()))\nB = [A[0]]\nfor i in range(1, N):\n if A[i - 1] != A[i]:\n B.append(A[i])\nN = len(B)\n\n\ndef solve():\n ret = 1000\n l = 0\n while l < N:\n while l < N - 1 and B[l] > B[l + 1]:\n l += 1\n if l == N - 1:\n return ret\n C = [B[l]]\n while l < N - 1 and B[l] < B[l + 1]:\n C.append(B[l + 1])\n l += 1\n cnt = ret // C[0]\n ret -= cnt * C[0]\n ret += cnt * C[-1]\n l += 1\n return ret\n\n\nprint((solve()))\n", "slow_code_sha256": "ac647f8beef1e462070f18ba0c6d85690102f1fdb39ac64fcccd21cdad5d43fa", "slow_id": "p02603_ac647f8beef1e462070f18ba0c6d85690102f1fdb39ac64fcccd21cdad5d43fa", "speedup": 5.774564589135349, "stratum": "4-8", "within_pair_jaccard": 0.26785714285714285, "workload": {"case_count": 100, "description": "Given N daily prices a_i for one stock, maximize final cash starting with 1000 and no shares. Buy or sell whole shares any number of times daily, without borrowing cash or shares. Observed inputs: N=2..80 (median 10); a_i=100..200.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 323, "median": 43.0, "min": 10}, "input_format": ["N\na_1 ... a_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 81, "median": 11.0, "min": 3}}} -{"case_ids": ["p03125_case_000", "p03125_case_001", "p03125_case_002", "p03125_case_003", "p03125_case_004", "p03125_case_005", "p03125_case_006", "p03125_case_007", "p03125_case_008", "p03125_case_009", "p03125_case_010", "p03125_case_011", "p03125_case_012", "p03125_case_013", "p03125_case_014", "p03125_case_015", "p03125_case_016", "p03125_case_017", "p03125_case_018", "p03125_case_019", "p03125_case_020", "p03125_case_021", "p03125_case_022", "p03125_case_023", "p03125_case_024", "p03125_case_025", "p03125_case_026", "p03125_case_027", "p03125_case_028", "p03125_case_029", "p03125_case_030", "p03125_case_031", "p03125_case_032", "p03125_case_033", "p03125_case_034", "p03125_case_035", "p03125_case_036", "p03125_case_037", "p03125_case_038", "p03125_case_039", "p03125_case_040", "p03125_case_041", "p03125_case_042", "p03125_case_043", "p03125_case_044", "p03125_case_045", "p03125_case_046", "p03125_case_047", "p03125_case_048", "p03125_case_049", "p03125_case_050", "p03125_case_051", "p03125_case_052", "p03125_case_053", "p03125_case_054", "p03125_case_055", "p03125_case_056", "p03125_case_057", "p03125_case_058", "p03125_case_059", "p03125_case_060", "p03125_case_061", "p03125_case_062", "p03125_case_063", "p03125_case_064", "p03125_case_065", "p03125_case_066", "p03125_case_067", "p03125_case_068", "p03125_case_069", "p03125_case_070", "p03125_case_071", "p03125_case_072", "p03125_case_073", "p03125_case_074", "p03125_case_075", "p03125_case_076", "p03125_case_077", "p03125_case_078", "p03125_case_079", "p03125_case_080", "p03125_case_081", "p03125_case_082", "p03125_case_083", "p03125_case_084", "p03125_case_085", "p03125_case_086", "p03125_case_087", "p03125_case_088", "p03125_case_089", "p03125_case_090", "p03125_case_091", "p03125_case_092", "p03125_case_093", "p03125_case_094", "p03125_case_095", "p03125_case_096", "p03125_case_097", "p03125_case_098", "p03125_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "A, B = list(map(int, input().split()))\nif B % A == 0:\n print(str(A + B))\nelse:\n print(str(B - A))\n", "fast_code_sha256": "9c541d4058fd3070ca0e46643551846092fc90774d4298548a7c49a24559d226", "fast_id": "p03125_9c541d4058fd3070ca0e46643551846092fc90774d4298548a7c49a24559d226", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "A, B = list(map(int, input().split()))\nif B % A == 0:\n print(str(A + B))\nelse:\n print(str(B - A))\n", "measured_fast_code_sha256": "9c541d4058fd3070ca0e46643551846092fc90774d4298548a7c49a24559d226", "measured_slow_code": "#!/usr/bin/env python3\nimport sys\nimport math\nfrom bisect import bisect_right as br\nfrom bisect import bisect_left as bl\n\nsys.setrecursionlimit(2147483647)\nfrom heapq import heappush, heappop, heappushpop\nfrom collections import defaultdict\nfrom itertools import accumulate\nfrom collections import Counter\nfrom collections import deque\nfrom operator import itemgetter\nfrom itertools import permutations\n\nmod = 10**9 + 7\ninf = float(\"inf\")\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\na, b = LI()\nif b % a == 0:\n print((a + b))\nelse:\n print((b - a))\n", "measured_slow_code_sha256": "4b613364292341c90cb223444cc17d712d2692c86eaf7401941c05ab19a835ea", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.0866175242611322, "pair_id": "python_v2_e38517b417a1bc47adc579d5", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03125", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03125_9c541d4058fd3070ca0e46643551846092fc90774d4298548a7c49a24559d226.jsonl.gz", "inputs": "reproduction/python/inputs/p03125.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03125_4b613364292341c90cb223444cc17d712d2692c86eaf7401941c05ab19a835ea.jsonl.gz"}, "slow_code": "import sys\nimport math\nfrom bisect import bisect_right as br\nfrom bisect import bisect_left as bl\n\nsys.setrecursionlimit(2147483647)\nfrom heapq import heappush, heappop, heappushpop\nfrom collections import defaultdict\nfrom itertools import accumulate\nfrom collections import Counter\nfrom collections import deque\nfrom operator import itemgetter\nfrom itertools import permutations\n\nmod = 10**9 + 7\ninf = float(\"inf\")\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\na, b = LI()\nif b % a == 0:\n print((a + b))\nelse:\n print((b - a))\n", "slow_code_sha256": "8b3f73d78db4b17be952c8e49db130961979c1aa4d15ae41972fb4783a0ae1cc", "slow_id": "p03125_4b613364292341c90cb223444cc17d712d2692c86eaf7401941c05ab19a835ea", "speedup": 3.0851194451843726, "stratum": "2-4", "within_pair_jaccard": 0.1568627450980392, "workload": {"case_count": 100, "description": "Given positive integers A<=B, output A+B if A divides B, otherwise output B-A. Observed inputs: A=1..20 (median 5); B=1..20 (median 13).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 6, "median": 5.0, "min": 4}, "input_format": ["A B"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p02642_case_000", "p02642_case_001", "p02642_case_002", "p02642_case_003", "p02642_case_004", "p02642_case_005", "p02642_case_006", "p02642_case_007", "p02642_case_008", "p02642_case_009", "p02642_case_010", "p02642_case_011", "p02642_case_012", "p02642_case_013", "p02642_case_014", "p02642_case_015", "p02642_case_016", "p02642_case_017", "p02642_case_018", "p02642_case_019", "p02642_case_020", "p02642_case_021", "p02642_case_022", "p02642_case_023", "p02642_case_024", "p02642_case_025", "p02642_case_026", "p02642_case_027", "p02642_case_028", "p02642_case_029", "p02642_case_030", "p02642_case_031", "p02642_case_032", "p02642_case_033", "p02642_case_034", "p02642_case_035", "p02642_case_036", "p02642_case_037", "p02642_case_038", "p02642_case_039", "p02642_case_040", "p02642_case_041", "p02642_case_042", "p02642_case_043", "p02642_case_044", "p02642_case_045", "p02642_case_046", "p02642_case_047", "p02642_case_048", "p02642_case_049", "p02642_case_050", "p02642_case_051", "p02642_case_052", "p02642_case_053", "p02642_case_054", "p02642_case_055", "p02642_case_056", "p02642_case_057", "p02642_case_058", "p02642_case_059", "p02642_case_060", "p02642_case_061", "p02642_case_062", "p02642_case_063", "p02642_case_064", "p02642_case_065", "p02642_case_066", "p02642_case_067", "p02642_case_068", "p02642_case_069", "p02642_case_070", "p02642_case_071", "p02642_case_072", "p02642_case_073", "p02642_case_074", "p02642_case_075", "p02642_case_076", "p02642_case_077", "p02642_case_078", "p02642_case_079", "p02642_case_080", "p02642_case_081", "p02642_case_082", "p02642_case_083", "p02642_case_084", "p02642_case_085", "p02642_case_086", "p02642_case_087", "p02642_case_088", "p02642_case_089", "p02642_case_090", "p02642_case_091", "p02642_case_092", "p02642_case_093", "p02642_case_094", "p02642_case_095", "p02642_case_096", "p02642_case_097", "p02642_case_098", "p02642_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys, collections\n\ninput = lambda: sys.stdin.readline().rstrip()\nsys.setrecursionlimit(10**7)\nINF = 10**20\n\n\ndef I():\n return int(eval(input()))\n\n\ndef F():\n return float(eval(input()))\n\n\ndef S():\n return eval(input())\n\n\ndef LI():\n return [int(x) for x in input().split()]\n\n\ndef LI_():\n return [int(x) - 1 for x in input().split()]\n\n\ndef LF():\n return [float(x) for x in input().split()]\n\n\ndef LS():\n return input().split()\n\n\ndef resolve():\n N = I()\n A = LI()\n cnt = collections.Counter(A)\n A = list(set(A))\n A.sort()\n A_max = A[-1]\n divisible = [False] * (A_max + 1)\n for i in A:\n for j in range(2 * i, A_max + 1, i):\n divisible[j] = True\n ans = 0\n for i in A:\n tmp = 0\n if not divisible[i] and cnt[i] == 1:\n tmp += 1\n ans += tmp\n print(ans)\n\n\nif __name__ == \"__main__\":\n resolve()\n", "fast_code_sha256": "ebab80c193ab2879dbfff7ff9f6d20f0b878f0d666af3027134f3506c6e7eec2", "fast_id": "p02642_ebab80c193ab2879dbfff7ff9f6d20f0b878f0d666af3027134f3506c6e7eec2", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys, collections\n\ninput = lambda: sys.stdin.readline().rstrip()\nsys.setrecursionlimit(10**7)\nINF = 10**20\n\n\ndef I():\n return int(eval(input()))\n\n\ndef F():\n return float(eval(input()))\n\n\ndef S():\n return eval(input())\n\n\ndef LI():\n return [int(x) for x in input().split()]\n\n\ndef LI_():\n return [int(x) - 1 for x in input().split()]\n\n\ndef LF():\n return [float(x) for x in input().split()]\n\n\ndef LS():\n return input().split()\n\n\ndef resolve():\n N = I()\n A = LI()\n cnt = collections.Counter(A)\n A = list(set(A))\n A.sort()\n A_max = A[-1]\n divisible = [False] * (A_max + 1)\n for i in A:\n for j in range(2 * i, A_max + 1, i):\n divisible[j] = True\n ans = 0\n for i in A:\n tmp = 0\n if not divisible[i] and cnt[i] == 1:\n tmp += 1\n ans += tmp\n print(ans)\n\n\nif __name__ == \"__main__\":\n resolve()\n", "measured_fast_code_sha256": "ebab80c193ab2879dbfff7ff9f6d20f0b878f0d666af3027134f3506c6e7eec2", "measured_slow_code": "N = int(eval(input()))\nAs = list(map(int, input().split()))\nM = max(As) + 1\ncnt = [0 for _ in range(M)]\nfor A in As:\n if cnt[A] != 0:\n cnt[A] = 2\n continue\n for n in range(A, M, A):\n cnt[n] += 1\nans = 0\nfor A in As:\n if cnt[A] == 1:\n ans += 1\nprint(ans)\n", "measured_slow_code_sha256": "17deae8ce2f8b76dd5d0f8a8b741fbc093186a8e41172410a54069f1d420d622", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.4356882569829654, "pair_id": "python_v2_504ded2374d3c0fde6392b90", "per_case_slow_code_faster_fraction": 0.01, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02642", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02642_ebab80c193ab2879dbfff7ff9f6d20f0b878f0d666af3027134f3506c6e7eec2.jsonl.gz", "inputs": "reproduction/python/inputs/p02642.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02642_17deae8ce2f8b76dd5d0f8a8b741fbc093186a8e41172410a54069f1d420d622.jsonl.gz"}, "slow_code": "N = int(eval(input()))\nAs = list(map(int, input().split()))\nM = max(As) + 1\ncnt = [0 for _ in range(M)]\nfor A in As:\n if cnt[A] != 0:\n cnt[A] = 2\n continue\n for n in range(A, M, A):\n cnt[n] += 1\nans = 0\nfor A in As:\n if cnt[A] == 1:\n ans += 1\nprint(ans)\n", "slow_code_sha256": "17deae8ce2f8b76dd5d0f8a8b741fbc093186a8e41172410a54069f1d420d622", "slow_id": "p02642_17deae8ce2f8b76dd5d0f8a8b741fbc093186a8e41172410a54069f1d420d622", "speedup": 4.807433020495653, "stratum": "4-8", "within_pair_jaccard": 0.27419354838709675, "workload": {"case_count": 100, "description": "Count indices i such that no different index j has a value a_j dividing a_i; equal values at different positions are separate entries. Observed inputs: N=5..200000 (median 1000); a_i=1..1000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1600007, "median": 6886.5, "min": 12}, "input_format": ["N\na_1 ... a_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200001, "median": 1001.0, "min": 6}}} -{"case_ids": ["p03061_case_000", "p03061_case_001", "p03061_case_002", "p03061_case_003", "p03061_case_004", "p03061_case_005", "p03061_case_006", "p03061_case_007", "p03061_case_008", "p03061_case_009", "p03061_case_010", "p03061_case_011", "p03061_case_012", "p03061_case_013", "p03061_case_014", "p03061_case_015", "p03061_case_016", "p03061_case_017", "p03061_case_018", "p03061_case_019", "p03061_case_020", "p03061_case_021", "p03061_case_022", "p03061_case_023", "p03061_case_024", "p03061_case_025", "p03061_case_026", "p03061_case_027", "p03061_case_028", "p03061_case_029", "p03061_case_030", "p03061_case_031", "p03061_case_032", "p03061_case_033", "p03061_case_034", "p03061_case_035", "p03061_case_036", "p03061_case_037", "p03061_case_038", "p03061_case_039", "p03061_case_040", "p03061_case_041", "p03061_case_042", "p03061_case_043", "p03061_case_044", "p03061_case_045", "p03061_case_046", "p03061_case_047", "p03061_case_048", "p03061_case_049", "p03061_case_050", "p03061_case_051", "p03061_case_052", "p03061_case_053", "p03061_case_054", "p03061_case_055", "p03061_case_056", "p03061_case_057", "p03061_case_058", "p03061_case_059", "p03061_case_060", "p03061_case_061", "p03061_case_062", "p03061_case_063", "p03061_case_064", "p03061_case_065", "p03061_case_066", "p03061_case_067", "p03061_case_068", "p03061_case_069", "p03061_case_070", "p03061_case_071", "p03061_case_072", "p03061_case_073", "p03061_case_074", "p03061_case_075", "p03061_case_076", "p03061_case_077", "p03061_case_078", "p03061_case_079", "p03061_case_080", "p03061_case_081", "p03061_case_082", "p03061_case_083", "p03061_case_084", "p03061_case_085", "p03061_case_086", "p03061_case_087", "p03061_case_088", "p03061_case_089", "p03061_case_090", "p03061_case_091", "p03061_case_092", "p03061_case_093", "p03061_case_094", "p03061_case_095", "p03061_case_096", "p03061_case_097", "p03061_case_098", "p03061_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N = int(eval(input()))\nA = [int(i) for i in input().split()]\n\n\ndef gcd(x, y):\n if x < y:\n x, y = y, x\n if y == 0:\n return x\n return gcd(x % y, y)\n\n\nL = [0]\nR = [0]\nfor i in range(N):\n L.append(gcd(A[i], L[i]))\n R.append(gcd(A[-i - 1], R[i]))\nR.reverse()\nM = []\nfor i in range(0, N):\n M.append(gcd(L[i], R[i + 1]))\nprint((max(M)))\n", "fast_code_sha256": "90faa30042c0bb6cba7adea24ab1dd17bdf8918cdb0f49b4d3e4a96eeaf8817f", "fast_id": "p03061_90faa30042c0bb6cba7adea24ab1dd17bdf8918cdb0f49b4d3e4a96eeaf8817f", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N = int(eval(input()))\nA = [int(i) for i in input().split()]\n\n\ndef gcd(x, y):\n if x < y:\n x, y = y, x\n if y == 0:\n return x\n return gcd(x % y, y)\n\n\nL = [0]\nR = [0]\nfor i in range(N):\n L.append(gcd(A[i], L[i]))\n R.append(gcd(A[-i - 1], R[i]))\nR.reverse()\nM = []\nfor i in range(0, N):\n M.append(gcd(L[i], R[i + 1]))\nprint((max(M)))\n", "measured_fast_code_sha256": "90faa30042c0bb6cba7adea24ab1dd17bdf8918cdb0f49b4d3e4a96eeaf8817f", "measured_slow_code": "def gcdf(a):\n a.sort()\n a0 = a[0]\n a = [int(x % a0) for x in a if x % a0 != 0]\n if len(a) == 0:\n return a0\n else:\n a.append(a0)\n a0 = min(a)\n return gcdf(a)\n\n\nn = int(eval(input()))\na = list(map(int, input().split()))\nif n == 2:\n print((max(a)))\nelif n < 2**8:\n gcdv = 0\n for i in range(n):\n acpy = list(a)\n del acpy[i]\n gcdx = gcdf(acpy)\n if gcdx > gcdv:\n gcdv = gcdx\n print(gcdv)\nelse:\n m = int(n / 100)\n ns = int(n / m)\n rgcd = []\n for mi in range(m):\n ms = ns * mi\n if mi == m - 1:\n am = a[ms:n]\n else:\n am = a[ms : ms + ns]\n gcdm = gcdf(am)\n rgcd.append(gcdm)\n gcdv = 0\n for mi in range(m):\n rgcd1 = list(rgcd)\n del rgcd1[mi]\n gcdrg1 = gcdf(rgcd1)\n ms = ns * mi\n if mi == m - 1:\n am = a[ms:n]\n else:\n am = a[ms : ms + ns]\n # print(mi,gcdf(am),len(am),gcdf(rgcd1))\n for i in range(len(am)):\n acpy = list(am)\n # del acpy[i]\n # acpy.append(gcdrg1)\n acpy[i] = gcdrg1\n gcdx = gcdf(acpy)\n if gcdx > gcdv:\n gcdv = gcdx\n print(gcdv)\n", "measured_slow_code_sha256": "2d1ac3c9fc00324fbe7020d274a3ccaef85c4cb391d9f2865533fe63f653f25e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4.610240910626443, "pair_id": "python_v2_2cc9c76848d83376f177a221", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03061", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03061_90faa30042c0bb6cba7adea24ab1dd17bdf8918cdb0f49b4d3e4a96eeaf8817f.jsonl.gz", "inputs": "reproduction/python/inputs/p03061.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03061_2d1ac3c9fc00324fbe7020d274a3ccaef85c4cb391d9f2865533fe63f653f25e.jsonl.gz"}, "slow_code": "def gcdf(a):\n a.sort()\n a0 = a[0]\n a = [int(x % a0) for x in a if x % a0 != 0]\n if len(a) == 0:\n return a0\n else:\n a.append(a0)\n a0 = min(a)\n return gcdf(a)\n\n\nn = int(eval(input()))\na = list(map(int, input().split()))\nif n == 2:\n print((max(a)))\nelif n < 2**8:\n gcdv = 0\n for i in range(n):\n acpy = list(a)\n del acpy[i]\n gcdx = gcdf(acpy)\n if gcdx > gcdv:\n gcdv = gcdx\n print(gcdv)\nelse:\n m = int(n / 100)\n ns = int(n / m)\n rgcd = []\n for mi in range(m):\n ms = ns * mi\n if mi == m - 1:\n am = a[ms:n]\n else:\n am = a[ms : ms + ns]\n gcdm = gcdf(am)\n rgcd.append(gcdm)\n gcdv = 0\n for mi in range(m):\n rgcd1 = list(rgcd)\n del rgcd1[mi]\n gcdrg1 = gcdf(rgcd1)\n ms = ns * mi\n if mi == m - 1:\n am = a[ms:n]\n else:\n am = a[ms : ms + ns]\n\n for i in range(len(am)):\n acpy = list(am)\n\n acpy[i] = gcdrg1\n gcdx = gcdf(acpy)\n if gcdx > gcdv:\n gcdv = gcdx\n print(gcdv)\n", "slow_code_sha256": "fb07db8e5e4b2567dc3a88a66ec68ddc15c21275b763c8b6a73c40b8a66faae8", "slow_id": "p03061_2d1ac3c9fc00324fbe7020d274a3ccaef85c4cb391d9f2865533fe63f653f25e", "speedup": 3.907599026357645, "stratum": "2-4", "within_pair_jaccard": 0.3269230769230769, "workload": {"case_count": 100, "description": "Replace exactly one of N positive array entries by any integer in 1..1000000000, possibly leaving it unchanged. Maximize the greatest common divisor of the resulting array. Observed inputs: N=2..100000 (median 1000); A_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1000007, "median": 10005.0, "min": 20}, "input_format": ["N\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100001, "median": 1001.0, "min": 3}}} -{"case_ids": ["p03292_case_000", "p03292_case_001", "p03292_case_002", "p03292_case_003", "p03292_case_004", "p03292_case_005", "p03292_case_006", "p03292_case_007", "p03292_case_008", "p03292_case_009", "p03292_case_010", "p03292_case_011", "p03292_case_012", "p03292_case_013", "p03292_case_014", "p03292_case_015", "p03292_case_016", "p03292_case_017", "p03292_case_018", "p03292_case_019", "p03292_case_020", "p03292_case_021", "p03292_case_022", "p03292_case_023", "p03292_case_024", "p03292_case_025", "p03292_case_026", "p03292_case_027", "p03292_case_028", "p03292_case_029", "p03292_case_030", "p03292_case_031", "p03292_case_032", "p03292_case_033", "p03292_case_034", "p03292_case_035", "p03292_case_036", "p03292_case_037", "p03292_case_038", "p03292_case_039", "p03292_case_040", "p03292_case_041", "p03292_case_042", "p03292_case_043", "p03292_case_044", "p03292_case_045", "p03292_case_046", "p03292_case_047", "p03292_case_048", "p03292_case_049", "p03292_case_050", "p03292_case_051", "p03292_case_052", "p03292_case_053", "p03292_case_054", "p03292_case_055", "p03292_case_056", "p03292_case_057", "p03292_case_058", "p03292_case_059", "p03292_case_060", "p03292_case_061", "p03292_case_062", "p03292_case_063", "p03292_case_064", "p03292_case_065", "p03292_case_066", "p03292_case_067", "p03292_case_068", "p03292_case_069", "p03292_case_070", "p03292_case_071", "p03292_case_072", "p03292_case_073", "p03292_case_074", "p03292_case_075", "p03292_case_076", "p03292_case_077", "p03292_case_078", "p03292_case_079", "p03292_case_080", "p03292_case_081", "p03292_case_082", "p03292_case_083", "p03292_case_084", "p03292_case_085", "p03292_case_086", "p03292_case_087", "p03292_case_088", "p03292_case_089", "p03292_case_090", "p03292_case_091", "p03292_case_092", "p03292_case_093", "p03292_case_094", "p03292_case_095", "p03292_case_096", "p03292_case_097", "p03292_case_098", "p03292_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "a, b, c = sorted(map(int, input().split()))\nprint((c - a))\n", "fast_code_sha256": "d8b9d7fdaa23a595cc84c23f285588212bcc3d4c8455fd7c23ecb472d8eb016f", "fast_id": "p03292_d8b9d7fdaa23a595cc84c23f285588212bcc3d4c8455fd7c23ecb472d8eb016f", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "a, b, c = sorted(map(int, input().split()))\nprint((c - a))\n", "measured_fast_code_sha256": "d8b9d7fdaa23a595cc84c23f285588212bcc3d4c8455fd7c23ecb472d8eb016f", "measured_slow_code": "a, b, c = list(map(int, input().split()))\nans = 9999\nans = min(ans, abs(a - b) + abs(b - c), abs(a - c) + abs(c - b))\nans = min(ans, abs(b - a) + abs(a - c), abs(b - c) + abs(c - a))\nans = min(ans, abs(c - a) + abs(a - b), abs(c - b) + abs(b - a))\nprint(ans)\n", "measured_slow_code_sha256": "f60b0a699a2d92dfcbb5b26a370092e660bc85afffa65c600089419b521caefb", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.2201690882070064, "pair_id": "python_v2_7dcc2adfec22529dc8146372", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03292", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03292_d8b9d7fdaa23a595cc84c23f285588212bcc3d4c8455fd7c23ecb472d8eb016f.jsonl.gz", "inputs": "reproduction/python/inputs/p03292.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03292_f60b0a699a2d92dfcbb5b26a370092e660bc85afffa65c600089419b521caefb.jsonl.gz"}, "slow_code": "a, b, c = list(map(int, input().split()))\nans = 9999\nans = min(ans, abs(a - b) + abs(b - c), abs(a - c) + abs(c - b))\nans = min(ans, abs(b - a) + abs(a - c), abs(b - c) + abs(c - a))\nans = min(ans, abs(c - a) + abs(a - b), abs(c - b) + abs(b - a))\nprint(ans)\n", "slow_code_sha256": "f60b0a699a2d92dfcbb5b26a370092e660bc85afffa65c600089419b521caefb", "slow_id": "p03292_f60b0a699a2d92dfcbb5b26a370092e660bc85afffa65c600089419b521caefb", "speedup": 3.2181568985595708, "stratum": "2-4", "within_pair_jaccard": 0.5714285714285714, "workload": {"case_count": 100, "description": "Complete three tasks in any order. The first costs zero; moving from task i to task j costs |A_j-A_i|. Minimize total cost while completing all tasks. Observed inputs: A_i=1..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 12, "median": 9.0, "min": 6}, "input_format": ["A_1 A_2 A_3"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3, "median": 3.0, "min": 3}}} -{"case_ids": ["p02555_case_000", "p02555_case_001", "p02555_case_002", "p02555_case_003", "p02555_case_004", "p02555_case_005", "p02555_case_006", "p02555_case_007", "p02555_case_008", "p02555_case_009", "p02555_case_010", "p02555_case_011", "p02555_case_012", "p02555_case_013", "p02555_case_014", "p02555_case_015", "p02555_case_016", "p02555_case_017", "p02555_case_018", "p02555_case_019", "p02555_case_020", "p02555_case_021", "p02555_case_022", "p02555_case_023", "p02555_case_024", "p02555_case_025", "p02555_case_026", "p02555_case_027", "p02555_case_028", "p02555_case_029", "p02555_case_030", "p02555_case_031", "p02555_case_032", "p02555_case_033", "p02555_case_034", "p02555_case_035", "p02555_case_036", "p02555_case_037", "p02555_case_038", "p02555_case_039", "p02555_case_040", "p02555_case_041", "p02555_case_042", "p02555_case_043", "p02555_case_044", "p02555_case_045", "p02555_case_046", "p02555_case_047", "p02555_case_048", "p02555_case_049", "p02555_case_050", "p02555_case_051", "p02555_case_052", "p02555_case_053", "p02555_case_054", "p02555_case_055", "p02555_case_056", "p02555_case_057", "p02555_case_058", "p02555_case_059", "p02555_case_060", "p02555_case_061", "p02555_case_062", "p02555_case_063", "p02555_case_064", "p02555_case_065", "p02555_case_066", "p02555_case_067", "p02555_case_068", "p02555_case_069", "p02555_case_070", "p02555_case_071", "p02555_case_072", "p02555_case_073", "p02555_case_074", "p02555_case_075", "p02555_case_076", "p02555_case_077", "p02555_case_078", "p02555_case_079", "p02555_case_080", "p02555_case_081", "p02555_case_082", "p02555_case_083", "p02555_case_084", "p02555_case_085", "p02555_case_086", "p02555_case_087", "p02555_case_088", "p02555_case_089", "p02555_case_090", "p02555_case_091", "p02555_case_092", "p02555_case_093", "p02555_case_094", "p02555_case_095", "p02555_case_096", "p02555_case_097", "p02555_case_098", "p02555_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "MOD = 10**9 + 7\n\n\ndef main():\n S = int(eval(input()))\n if S < 3:\n print((0))\n return\n dp = [0] * (S + 1)\n dp[3] = 1\n for i in range(4, S + 1):\n dp[i] = dp[i - 1] + dp[i - 3]\n dp[i] %= MOD\n print((dp[S]))\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "04cf13145f8d2e221404352e24ce94339316e800ce472df8f670669f94d74cb3", "fast_id": "p02555_4d25942d352291d83d727785c88845c416b8ebadd5f2c58dc2e09de04f15b2fa", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "MOD = 10**9 + 7\n\n\ndef main():\n S = int(eval(input()))\n if S < 3:\n print((0))\n return\n dp = [0] * (S + 1)\n dp[3] = 1\n for i in range(4, S + 1):\n dp[i] = dp[i - 1] + dp[i - 3]\n dp[i] %= MOD\n print((dp[S]))\n # print(*dp)\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "4d25942d352291d83d727785c88845c416b8ebadd5f2c58dc2e09de04f15b2fa", "measured_slow_code": "import numpy as np\n\nMOD = 10**9 + 7\nn = int(eval(input()))\narr = np.zeros((n + 1, n + 1), dtype=int)\nfor i in np.arange(3, n + 1):\n arr[0, i] = 1\nfor i in np.arange(1, n + 1):\n sum_ = 0\n for j in np.arange(3 * i, n + 1):\n sum_ += arr[i - 1, j]\n sum_ %= MOD\n if j + 3 >= n + 1:\n break\n arr[i, j + 3] = sum_\nans = 0\nfor i in range(n + 1):\n ans += arr[i, n]\n ans %= MOD\nprint(ans)\n", "measured_slow_code_sha256": "c3b18fd66a969908811fb5a7fad4e7d129453840b432daefe2b3186926221742", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1306.3022654415615, "pair_id": "python_v2_d2bf62afd811c0f4e81813c3", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02555", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02555_4d25942d352291d83d727785c88845c416b8ebadd5f2c58dc2e09de04f15b2fa.jsonl.gz", "inputs": "reproduction/python/inputs/p02555.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02555_c3b18fd66a969908811fb5a7fad4e7d129453840b432daefe2b3186926221742.jsonl.gz"}, "slow_code": "import numpy as np\n\nMOD = 10**9 + 7\nn = int(eval(input()))\narr = np.zeros((n + 1, n + 1), dtype=int)\nfor i in np.arange(3, n + 1):\n arr[0, i] = 1\nfor i in np.arange(1, n + 1):\n sum_ = 0\n for j in np.arange(3 * i, n + 1):\n sum_ += arr[i - 1, j]\n sum_ %= MOD\n if j + 3 >= n + 1:\n break\n arr[i, j + 3] = sum_\nans = 0\nfor i in range(n + 1):\n ans += arr[i, n]\n ans %= MOD\nprint(ans)\n", "slow_code_sha256": "c3b18fd66a969908811fb5a7fad4e7d129453840b432daefe2b3186926221742", "slow_id": "p02555_c3b18fd66a969908811fb5a7fad4e7d129453840b432daefe2b3186926221742", "speedup": 1194.4334509999564, "stratum": "8+", "within_pair_jaccard": 0.43243243243243246, "workload": {"case_count": 100, "description": "Count ordered integer sequences whose entries are at least 3 and sum to S, modulo 1000000007. Observed inputs: S=1..2000 (median 1094).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 5, "median": 5.0, "min": 2}, "input_format": ["S"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p03962_case_000", "p03962_case_001", "p03962_case_002", "p03962_case_003", "p03962_case_004", "p03962_case_005", "p03962_case_006", "p03962_case_007", "p03962_case_008", "p03962_case_009", "p03962_case_010", "p03962_case_011", "p03962_case_012", "p03962_case_013", "p03962_case_014", "p03962_case_015", "p03962_case_016", "p03962_case_017", "p03962_case_018", "p03962_case_019", "p03962_case_020", "p03962_case_021", "p03962_case_022", "p03962_case_023", "p03962_case_024", "p03962_case_025", "p03962_case_026", "p03962_case_027", "p03962_case_028", "p03962_case_029", "p03962_case_030", "p03962_case_031", "p03962_case_032", "p03962_case_033", "p03962_case_034", "p03962_case_035", "p03962_case_036", "p03962_case_037", "p03962_case_038", "p03962_case_039", "p03962_case_040", "p03962_case_041", "p03962_case_042", "p03962_case_043", "p03962_case_044", "p03962_case_045", "p03962_case_046", "p03962_case_047", "p03962_case_048", "p03962_case_049", "p03962_case_050", "p03962_case_051", "p03962_case_052", "p03962_case_053", "p03962_case_054", "p03962_case_055", "p03962_case_056", "p03962_case_057", "p03962_case_058", "p03962_case_059", "p03962_case_060", "p03962_case_061", "p03962_case_062", "p03962_case_063", "p03962_case_064", "p03962_case_065", "p03962_case_066", "p03962_case_067", "p03962_case_068", "p03962_case_069", "p03962_case_070", "p03962_case_071", "p03962_case_072", "p03962_case_073", "p03962_case_074", "p03962_case_075", "p03962_case_076", "p03962_case_077", "p03962_case_078", "p03962_case_079", "p03962_case_080", "p03962_case_081", "p03962_case_082", "p03962_case_083", "p03962_case_084", "p03962_case_085", "p03962_case_086", "p03962_case_087", "p03962_case_088", "p03962_case_089", "p03962_case_090", "p03962_case_091", "p03962_case_092", "p03962_case_093", "p03962_case_094", "p03962_case_095", "p03962_case_096", "p03962_case_097", "p03962_case_098", "p03962_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "s = set(input().split())\nprint((len(s)))\n", "fast_code_sha256": "cd83c8bda15ceef29f903811f2397dc1513e7010c35f8313b768f7645bd23706", "fast_id": "p03962_cd83c8bda15ceef29f903811f2397dc1513e7010c35f8313b768f7645bd23706", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "s = set(input().split())\nprint((len(s)))\n", "measured_fast_code_sha256": "cd83c8bda15ceef29f903811f2397dc1513e7010c35f8313b768f7645bd23706", "measured_slow_code": "from collections import Counter\n\nA, B, C = list(map(int, input().split()))\nprint((len(Counter([A, B, C]).most_common())))\n", "measured_slow_code_sha256": "48bec3c2d6a89992428272affb6b0f4ee6481385f2bb025348256f99dafa1fc7", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.3523123209210137, "pair_id": "python_v2_da5a5fc37e98e9cd1a728aab", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03962", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03962_cd83c8bda15ceef29f903811f2397dc1513e7010c35f8313b768f7645bd23706.jsonl.gz", "inputs": "reproduction/python/inputs/p03962.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03962_48bec3c2d6a89992428272affb6b0f4ee6481385f2bb025348256f99dafa1fc7.jsonl.gz"}, "slow_code": "from collections import Counter\n\nA, B, C = list(map(int, input().split()))\nprint((len(Counter([A, B, C]).most_common())))\n", "slow_code_sha256": "48bec3c2d6a89992428272affb6b0f4ee6481385f2bb025348256f99dafa1fc7", "slow_id": "p03962_48bec3c2d6a89992428272affb6b0f4ee6481385f2bb025348256f99dafa1fc7", "speedup": 2.351947870706317, "stratum": "2-4", "within_pair_jaccard": 0.23529411764705882, "workload": {"case_count": 100, "description": "Three paint cans have integer color IDs a,b,c. Count distinct colors among the three, allowing equal IDs. Observed inputs: color_value=1..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 12, "median": 9.0, "min": 6}, "input_format": ["a b c"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3, "median": 3.0, "min": 3}}} -{"case_ids": ["p02681_case_000", "p02681_case_001", "p02681_case_002", "p02681_case_003", "p02681_case_004", "p02681_case_005", "p02681_case_006", "p02681_case_007", "p02681_case_008", "p02681_case_009", "p02681_case_010", "p02681_case_011", "p02681_case_012", "p02681_case_013", "p02681_case_014", "p02681_case_015", "p02681_case_016", "p02681_case_017", "p02681_case_018", "p02681_case_019", "p02681_case_020", "p02681_case_021", "p02681_case_022", "p02681_case_023", "p02681_case_024", "p02681_case_025", "p02681_case_026", "p02681_case_027", "p02681_case_028", "p02681_case_029", "p02681_case_030", "p02681_case_031", "p02681_case_032", "p02681_case_033", "p02681_case_034", "p02681_case_035", "p02681_case_036", "p02681_case_037", "p02681_case_038", "p02681_case_039", "p02681_case_040", "p02681_case_041", "p02681_case_042", "p02681_case_043", "p02681_case_044", "p02681_case_045", "p02681_case_046", "p02681_case_047", "p02681_case_048", "p02681_case_049", "p02681_case_050", "p02681_case_051", "p02681_case_052", "p02681_case_053", "p02681_case_054", "p02681_case_055", "p02681_case_056", "p02681_case_057", "p02681_case_058", "p02681_case_059", "p02681_case_060", "p02681_case_061", "p02681_case_062", "p02681_case_063", "p02681_case_064", "p02681_case_065", "p02681_case_066", "p02681_case_067", "p02681_case_068", "p02681_case_069", "p02681_case_070", "p02681_case_071", "p02681_case_072", "p02681_case_073", "p02681_case_074", "p02681_case_075", "p02681_case_076", "p02681_case_077", "p02681_case_078", "p02681_case_079", "p02681_case_080", "p02681_case_081", "p02681_case_082", "p02681_case_083", "p02681_case_084", "p02681_case_085", "p02681_case_086", "p02681_case_087", "p02681_case_088", "p02681_case_089", "p02681_case_090", "p02681_case_091", "p02681_case_092", "p02681_case_093", "p02681_case_094", "p02681_case_095", "p02681_case_096", "p02681_case_097", "p02681_case_098", "p02681_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "s = input()\nt = input()\nprint(\"Yes\") if t == s + t[-1] else print(\"No\")\n", "fast_code_sha256": "65656aa9840feee1b9dbc9331beceb30a0d208678996748f9638072a52c69443", "fast_id": "p02681_65656aa9840feee1b9dbc9331beceb30a0d208678996748f9638072a52c69443", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "s = input()\nt = input()\nprint(\"Yes\") if t == s + t[-1] else print(\"No\")\n", "measured_fast_code_sha256": "65656aa9840feee1b9dbc9331beceb30a0d208678996748f9638072a52c69443", "measured_slow_code": "import sys\n\ninput = lambda: sys.stdin.readline().rstrip()\naint = lambda: int(input())\nints = lambda: list(map(int, input().split()))\nimport math\n\nfloor, ceil = lambda x: int(math.floor(x)), lambda x: int(math.ceil(x))\nfrom functools import reduce\n\ngcd = lambda *x: reduce(math.gcd, x)\nlcm = lambda *x: reduce(lambda x, y: (x * y) // gcd(x, y), x, 1)\nfrom collections import deque\n\nYes = lambda b: print(\"Yes\" if b else \"No\")\nYES = lambda b: print(\"YES\" if b else \"NO\")\nis_even = lambda x: True if x % 2 == 0 else False\n\n\ndef main():\n s = input()\n t = input()\n n = len(s)\n flg = 0\n for i in range(n):\n if s[i] != t[i]:\n flg = 1\n Yes(flg == 0)\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "f4400189ff3db203f96723d5aee262e6d415108f8067f12bc82d5f8b60b24440", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 7.505743780425579, "pair_id": "python_v2_9a712c7ac6a8d2f764e1cd84", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02681", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02681_65656aa9840feee1b9dbc9331beceb30a0d208678996748f9638072a52c69443.jsonl.gz", "inputs": "reproduction/python/inputs/p02681.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02681_f4400189ff3db203f96723d5aee262e6d415108f8067f12bc82d5f8b60b24440.jsonl.gz"}, "slow_code": "import sys\n\ninput = lambda: sys.stdin.readline().rstrip()\naint = lambda: int(input())\nints = lambda: list(map(int, input().split()))\nimport math\n\nfloor, ceil = lambda x: int(math.floor(x)), lambda x: int(math.ceil(x))\nfrom functools import reduce\n\ngcd = lambda *x: reduce(math.gcd, x)\nlcm = lambda *x: reduce(lambda x, y: (x * y) // gcd(x, y), x, 1)\nfrom collections import deque\n\nYes = lambda b: print(\"Yes\" if b else \"No\")\nYES = lambda b: print(\"YES\" if b else \"NO\")\nis_even = lambda x: True if x % 2 == 0 else False\n\n\ndef main():\n s = input()\n t = input()\n n = len(s)\n flg = 0\n for i in range(n):\n if s[i] != t[i]:\n flg = 1\n Yes(flg == 0)\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "f4400189ff3db203f96723d5aee262e6d415108f8067f12bc82d5f8b60b24440", "slow_id": "p02681_f4400189ff3db203f96723d5aee262e6d415108f8067f12bc82d5f8b60b24440", "speedup": 7.502423210512054, "stratum": "4-8", "within_pair_jaccard": 0.17307692307692307, "workload": {"case_count": 100, "description": "Determine whether lowercase string T can be obtained by appending exactly one lowercase letter to the end of S. T is guaranteed to have length |S|+1. Observed inputs: S_length=1..10 (median 5); T_length=2..11 (median 6).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 23, "median": 13.0, "min": 5}, "input_format": ["S\nT"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p03566_case_000", "p03566_case_001", "p03566_case_002", "p03566_case_003", "p03566_case_004", "p03566_case_005", "p03566_case_006", "p03566_case_007", "p03566_case_008", "p03566_case_009", "p03566_case_010", "p03566_case_011", "p03566_case_012", "p03566_case_013", "p03566_case_014", "p03566_case_015", "p03566_case_016", "p03566_case_017", "p03566_case_018", "p03566_case_019", "p03566_case_020", "p03566_case_021", "p03566_case_022", "p03566_case_023", "p03566_case_024", "p03566_case_025", "p03566_case_026", "p03566_case_027", "p03566_case_028", "p03566_case_029", "p03566_case_030", "p03566_case_031", "p03566_case_032", "p03566_case_033", "p03566_case_034", "p03566_case_035", "p03566_case_036", "p03566_case_037", "p03566_case_038", "p03566_case_039", "p03566_case_040", "p03566_case_041", "p03566_case_042", "p03566_case_043", "p03566_case_044", "p03566_case_045", "p03566_case_046", "p03566_case_047", "p03566_case_048", "p03566_case_049", "p03566_case_050", "p03566_case_051", "p03566_case_052", "p03566_case_053", "p03566_case_054", "p03566_case_055", "p03566_case_056", "p03566_case_057", "p03566_case_058", "p03566_case_059", "p03566_case_060", "p03566_case_061", "p03566_case_062", "p03566_case_063", "p03566_case_064", "p03566_case_065", "p03566_case_066", "p03566_case_067", "p03566_case_068", "p03566_case_069", "p03566_case_070", "p03566_case_071", "p03566_case_072", "p03566_case_073", "p03566_case_074", "p03566_case_075", "p03566_case_076", "p03566_case_077", "p03566_case_078", "p03566_case_079", "p03566_case_080", "p03566_case_081", "p03566_case_082", "p03566_case_083", "p03566_case_084", "p03566_case_085", "p03566_case_086", "p03566_case_087", "p03566_case_088", "p03566_case_089", "p03566_case_090", "p03566_case_091", "p03566_case_092", "p03566_case_093", "p03566_case_094", "p03566_case_095", "p03566_case_096", "p03566_case_097", "p03566_case_098", "p03566_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def calc_area(v_end, v_start, v_max, dt):\n kouten_v = (v_end + v_start + dt) / 2\n kouten_t = kouten_v - v_start\n if 0 < kouten_t < dt:\n area = (v_start + kouten_v) * kouten_t / 2\n area += (v_end + kouten_v) * (dt - kouten_t) / 2\n area -= max(0, (kouten_v - v_max)) ** 2\n else:\n area = (v_start + v_end) * dt / 2\n return area\n\n\ndef main():\n\n n = int(eval(input()))\n t = [int(i) for i in input().split()]\n v = [int(i) for i in input().split()]\n\n max_velocity = [0]\n for i in range(1, n):\n max_velocity_ = min(v[i - 1], v[i], max_velocity[i - 1] + t[i - 1])\n max_velocity.append(max_velocity_)\n max_velocity.append(0)\n\n for i in range(n - 1):\n if max_velocity[-(i + 1)] - max_velocity[-(i + 2)] < -t[-(i + 1)]:\n max_velocity[-(i + 2)] = max_velocity[-(i + 1)] + t[-(i + 1)]\n\n ans = 0\n for i in range(n):\n ans += calc_area(max_velocity[i + 1], max_velocity[i], v[i], t[i])\n print(ans)\n\n\nmain()\n", "fast_code_sha256": "a16ad46c25afcc872ffdcecc1fc2488ab024ba2926890f3b3b73a77ac9799ba5", "fast_id": "p03566_745ddbba495ff86d8ef795671a21728a3a97d40f4051f365cd66ffaf6066ffab", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "# 区間ごとの面積を計算する\ndef calc_area(v_end, v_start, v_max, dt):\n kouten_v = (v_end + v_start + dt) / 2\n kouten_t = kouten_v - v_start\n if 0 < kouten_t < dt:\n area = (v_start + kouten_v) * kouten_t / 2 # 左側\n area += (v_end + kouten_v) * (dt - kouten_t) / 2 # 右側\n area -= max(0, (kouten_v - v_max)) ** 2 # 上の三角形\n else:\n area = (v_start + v_end) * dt / 2\n return area\n\n\ndef main():\n # 与えられた入力を受け取る\n n = int(eval(input()))\n t = [int(i) for i in input().split()]\n v = [int(i) for i in input().split()]\n # 各区間の許容最大速度を計算する\n # (この段階では傾きが-1未満になる可能性がある)\n max_velocity = [0]\n for i in range(1, n):\n max_velocity_ = min(v[i - 1], v[i], max_velocity[i - 1] + t[i - 1])\n max_velocity.append(max_velocity_)\n max_velocity.append(0)\n # 後ろから走査して、傾きが-1未満を満たすように許容速度をfittingする\n for i in range(n - 1):\n if max_velocity[-(i + 1)] - max_velocity[-(i + 2)] < -t[-(i + 1)]:\n max_velocity[-(i + 2)] = max_velocity[-(i + 1)] + t[-(i + 1)]\n # 各区間の面積を計算して足し合わせる\n ans = 0\n for i in range(n):\n ans += calc_area(max_velocity[i + 1], max_velocity[i], v[i], t[i])\n print(ans)\n\n\nmain()\n", "measured_fast_code_sha256": "745ddbba495ff86d8ef795671a21728a3a97d40f4051f365cd66ffaf6066ffab", "measured_slow_code": "def main():\n n = int(eval(input()))\n (*t,) = list(map(int, input().split()))\n tot = sum(t)\n (*v,) = list(map(int, input().split()))\n lim1 = []\n lim2 = [(1, 0, 0), (-1, tot, tot)]\n til = 0\n for t1, t2, v1 in zip([0] + t, t, v):\n lim1.append((til, til + t2, v1))\n lim2.append((-1, til, til + v1))\n lim2.append((1, til + t2, v1 - (til + t2)))\n til += t2\n\n def mi(time):\n ret = float(\"inf\")\n for l, r, lim in lim1:\n if l <= time <= r:\n ret = min(ret, lim)\n for f, tt, y in lim2:\n if f == -1 and time <= tt:\n ret = min(ret, y - time)\n if f == 1 and time >= tt:\n ret = min(ret, time + y)\n return ret\n\n print((sum(mi(i / 2) for i in range(tot * 2 + 1)) / 2))\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "dc91f79d960f94fab7e0f22399c2cbf92cedc3dc5639f513b990cb57f69a9a24", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 996.554638145522, "pair_id": "python_v2_62df7bdbe98588945c185402", "per_case_slow_code_faster_fraction": 0.01, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03566", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03566_745ddbba495ff86d8ef795671a21728a3a97d40f4051f365cd66ffaf6066ffab.jsonl.gz", "inputs": "reproduction/python/inputs/p03566.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03566_dc91f79d960f94fab7e0f22399c2cbf92cedc3dc5639f513b990cb57f69a9a24.jsonl.gz"}, "slow_code": "def main():\n n = int(eval(input()))\n (*t,) = list(map(int, input().split()))\n tot = sum(t)\n (*v,) = list(map(int, input().split()))\n lim1 = []\n lim2 = [(1, 0, 0), (-1, tot, tot)]\n til = 0\n for t1, t2, v1 in zip([0] + t, t, v):\n lim1.append((til, til + t2, v1))\n lim2.append((-1, til, til + v1))\n lim2.append((1, til + t2, v1 - (til + t2)))\n til += t2\n\n def mi(time):\n ret = float(\"inf\")\n for l, r, lim in lim1:\n if l <= time <= r:\n ret = min(ret, lim)\n for f, tt, y in lim2:\n if f == -1 and time <= tt:\n ret = min(ret, y - time)\n if f == 1 and time >= tt:\n ret = min(ret, time + y)\n return ret\n\n print((sum(mi(i / 2) for i in range(tot * 2 + 1)) / 2))\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "dc91f79d960f94fab7e0f22399c2cbf92cedc3dc5639f513b990cb57f69a9a24", "slow_id": "p03566_dc91f79d960f94fab7e0f22399c2cbf92cedc3dc5639f513b990cb57f69a9a24", "speedup": 279.36640642185955, "stratum": "8+", "within_pair_jaccard": 0.3559322033898305, "workload": {"case_count": 100, "description": "Maximize distance traveled over N consecutive time segments of durations t_i with speed caps v_i. Speed is nonnegative, starts and ends at zero, and acceleration stays between -1 and 1 distance-units per second squared. Observed inputs: N=1..100 (median 60); t_i=1..200; v_i=1..100; total_duration=1..20000 (median 4520.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 804, "median": 390.5, "min": 6}, "input_format": ["N\nt_1 ... t_N\nv_1 ... v_N"], "input_format_status": "source_input_section", "input_lines": {"max": 3, "median": 3.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 201, "median": 121.0, "min": 3}}} -{"case_ids": ["p03807_case_000", "p03807_case_001", "p03807_case_002", "p03807_case_003", "p03807_case_004", "p03807_case_005", "p03807_case_006", "p03807_case_007", "p03807_case_008", "p03807_case_009", "p03807_case_010", "p03807_case_011", "p03807_case_012", "p03807_case_013", "p03807_case_014", "p03807_case_015", "p03807_case_016", "p03807_case_017", "p03807_case_018", "p03807_case_019", "p03807_case_020", "p03807_case_021", "p03807_case_022", "p03807_case_023", "p03807_case_024", "p03807_case_025", "p03807_case_026", "p03807_case_027", "p03807_case_028", "p03807_case_029", "p03807_case_030", "p03807_case_031", "p03807_case_032", "p03807_case_033", "p03807_case_034", "p03807_case_035", "p03807_case_036", "p03807_case_037", "p03807_case_038", "p03807_case_039", "p03807_case_040", "p03807_case_041", "p03807_case_042", "p03807_case_043", "p03807_case_044", "p03807_case_045", "p03807_case_046", "p03807_case_047", "p03807_case_048", "p03807_case_049", "p03807_case_050", "p03807_case_051", "p03807_case_052", "p03807_case_053", "p03807_case_054", "p03807_case_055", "p03807_case_056", "p03807_case_057", "p03807_case_058", "p03807_case_059", "p03807_case_060", "p03807_case_061", "p03807_case_062", "p03807_case_063", "p03807_case_064", "p03807_case_065", "p03807_case_066", "p03807_case_067", "p03807_case_068", "p03807_case_069", "p03807_case_070", "p03807_case_071", "p03807_case_072", "p03807_case_073", "p03807_case_074", "p03807_case_075", "p03807_case_076", "p03807_case_077", "p03807_case_078", "p03807_case_079", "p03807_case_080", "p03807_case_081", "p03807_case_082", "p03807_case_083", "p03807_case_084", "p03807_case_085", "p03807_case_086", "p03807_case_087", "p03807_case_088", "p03807_case_089", "p03807_case_090", "p03807_case_091", "p03807_case_092", "p03807_case_093", "p03807_case_094", "p03807_case_095", "p03807_case_096", "p03807_case_097", "p03807_case_098", "p03807_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\na = list(map(int, input().split()))\nif sum([1 for b in a if b % 2 == 1]) % 2 == 1:\n print(\"NO\")\nelse:\n print(\"YES\")\n", "fast_code_sha256": "5b7e552a4063a2671d611280093afd267113618ef2d34d4a0496466cda237486", "fast_id": "p03807_5b7e552a4063a2671d611280093afd267113618ef2d34d4a0496466cda237486", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\na = list(map(int, input().split()))\nif sum([1 for b in a if b % 2 == 1]) % 2 == 1:\n print(\"NO\")\nelse:\n print(\"YES\")\n", "measured_fast_code_sha256": "5b7e552a4063a2671d611280093afd267113618ef2d34d4a0496466cda237486", "measured_slow_code": "import sys\nimport bisect\nimport collections\nimport fractions\nimport heapq\n\n\ndef slove():\n input = sys.stdin.readline\n n = int(input().rstrip(\"\\n\"))\n a = list(map(int, input().rstrip(\"\\n\").split()))\n cnt = 0\n for i in range(n):\n if a[i] % 2 != 0:\n cnt += 1\n if cnt % 2 == 0:\n print(\"YES\")\n else:\n print(\"NO\")\n\n\nif __name__ == \"__main__\":\n slove()\n", "measured_slow_code_sha256": "8baca45625cd0c593d3689761edf66d3fece4f44f81b27a47e938cff4b898bb0", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.2973654003132267, "pair_id": "python_v2_ae5c619641b0103661f5f7b6", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03807", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03807_5b7e552a4063a2671d611280093afd267113618ef2d34d4a0496466cda237486.jsonl.gz", "inputs": "reproduction/python/inputs/p03807.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03807_8baca45625cd0c593d3689761edf66d3fece4f44f81b27a47e938cff4b898bb0.jsonl.gz"}, "slow_code": "import sys\nimport bisect\nimport collections\nimport fractions\nimport heapq\n\n\ndef slove():\n input = sys.stdin.readline\n n = int(input().rstrip(\"\\n\"))\n a = list(map(int, input().rstrip(\"\\n\").split()))\n cnt = 0\n for i in range(n):\n if a[i] % 2 != 0:\n cnt += 1\n if cnt % 2 == 0:\n print(\"YES\")\n else:\n print(\"NO\")\n\n\nif __name__ == \"__main__\":\n slove()\n", "slow_code_sha256": "8baca45625cd0c593d3689761edf66d3fece4f44f81b27a47e938cff4b898bb0", "slow_id": "p03807_8baca45625cd0c593d3689761edf66d3fece4f44f81b27a47e938cff4b898bb0", "speedup": 4.780021348211803, "stratum": "4-8", "within_pair_jaccard": 0.4444444444444444, "workload": {"case_count": 100, "description": "Repeatedly replace two integers of the same parity by their sum. Determine whether an N-element positive integer multiset can be reduced to exactly one integer. Observed inputs: N=2..100000 (median 99999); a_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1049995, "median": 200007.0, "min": 6}, "input_format": ["N\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100001, "median": 100000.0, "min": 3}}} -{"case_ids": ["p02982_case_000", "p02982_case_001", "p02982_case_002", "p02982_case_003", "p02982_case_004", "p02982_case_005", "p02982_case_006", "p02982_case_007", "p02982_case_008", "p02982_case_009", "p02982_case_010", "p02982_case_011", "p02982_case_012", "p02982_case_013", "p02982_case_014", "p02982_case_015", "p02982_case_016", "p02982_case_017", "p02982_case_018", "p02982_case_019", "p02982_case_020", "p02982_case_021", "p02982_case_022", "p02982_case_023", "p02982_case_024", "p02982_case_025", "p02982_case_026", "p02982_case_027", "p02982_case_028", "p02982_case_029", "p02982_case_030", "p02982_case_031", "p02982_case_032", "p02982_case_033", "p02982_case_034", "p02982_case_035", "p02982_case_036", "p02982_case_037", "p02982_case_038", "p02982_case_039", "p02982_case_040", "p02982_case_041", "p02982_case_042", "p02982_case_043", "p02982_case_044", "p02982_case_045", "p02982_case_046", "p02982_case_047", "p02982_case_048", "p02982_case_049", "p02982_case_050", "p02982_case_051", "p02982_case_052", "p02982_case_053", "p02982_case_054", "p02982_case_055", "p02982_case_056", "p02982_case_057", "p02982_case_058", "p02982_case_059", "p02982_case_060", "p02982_case_061", "p02982_case_062", "p02982_case_063", "p02982_case_064", "p02982_case_065", "p02982_case_066", "p02982_case_067", "p02982_case_068", "p02982_case_069", "p02982_case_070", "p02982_case_071", "p02982_case_072", "p02982_case_073", "p02982_case_074", "p02982_case_075", "p02982_case_076", "p02982_case_077", "p02982_case_078", "p02982_case_079", "p02982_case_080", "p02982_case_081", "p02982_case_082", "p02982_case_083", "p02982_case_084", "p02982_case_085", "p02982_case_086", "p02982_case_087", "p02982_case_088", "p02982_case_089", "p02982_case_090", "p02982_case_091", "p02982_case_092", "p02982_case_093", "p02982_case_094", "p02982_case_095", "p02982_case_096", "p02982_case_097", "p02982_case_098", "p02982_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n, d = list(map(int, input().split()))\nxd = [(list(int(_) for _ in input().split())) for i in range(n)]\nans = 0\nfor i in range(n):\n x1 = xd[i]\n for j in range(i + 1, n):\n x2 = xd[j]\n dis = 0\n for x, y in zip(x1, x2):\n dis += (y - x) ** 2\n k = dis**0.5\n if int(k) ** 2 == dis:\n ans += 1\nprint(ans)\n", "fast_code_sha256": "abe6971250a5168c3345542dac01955d0a2ed379b32b6833136e34bfea5a962f", "fast_id": "p02982_abe6971250a5168c3345542dac01955d0a2ed379b32b6833136e34bfea5a962f", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n, d = list(map(int, input().split()))\nxd = [(list(int(_) for _ in input().split())) for i in range(n)]\nans = 0\nfor i in range(n):\n x1 = xd[i]\n for j in range(i + 1, n):\n x2 = xd[j]\n dis = 0\n for x, y in zip(x1, x2):\n dis += (y - x) ** 2\n k = dis**0.5\n if int(k) ** 2 == dis:\n ans += 1\nprint(ans)\n", "measured_fast_code_sha256": "abe6971250a5168c3345542dac01955d0a2ed379b32b6833136e34bfea5a962f", "measured_slow_code": "n, d = list(map(int, input().split()))\nX = [list(map(int, input().split())) for _ in range(n)]\n\n\ndef dist_squere(x, y):\n d = 0\n for i, j in zip(x, y):\n d += (i - j) ** 2\n return d\n\n\nsquares = set([i * i for i in range(10000)])\n\n\ndef is_square(x):\n return x in squares\n\n\nfrom itertools import combinations\n\nans = 0\nfor x, y in combinations(X, 2):\n if is_square(dist_squere(x, y)):\n ans += 1\nprint(ans)\n", "measured_slow_code_sha256": "a2fde493cc245e65f80a5e26468409d95eb61888a7f62c011c34b428b9e87b29", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 8.687088230171298, "pair_id": "python_v2_1258e3e1f1be2a89a617b66e", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02982", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02982_abe6971250a5168c3345542dac01955d0a2ed379b32b6833136e34bfea5a962f.jsonl.gz", "inputs": "reproduction/python/inputs/p02982.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02982_a2fde493cc245e65f80a5e26468409d95eb61888a7f62c011c34b428b9e87b29.jsonl.gz"}, "slow_code": "n, d = list(map(int, input().split()))\nX = [list(map(int, input().split())) for _ in range(n)]\n\n\ndef dist_squere(x, y):\n d = 0\n for i, j in zip(x, y):\n d += (i - j) ** 2\n return d\n\n\nsquares = set([i * i for i in range(10000)])\n\n\ndef is_square(x):\n return x in squares\n\n\nfrom itertools import combinations\n\nans = 0\nfor x, y in combinations(X, 2):\n if is_square(dist_squere(x, y)):\n ans += 1\nprint(ans)\n", "slow_code_sha256": "a2fde493cc245e65f80a5e26468409d95eb61888a7f62c011c34b428b9e87b29", "slow_id": "p02982_a2fde493cc245e65f80a5e26468409d95eb61888a7f62c011c34b428b9e87b29", "speedup": 7.391713932905539, "stratum": "4-8", "within_pair_jaccard": 0.55, "workload": {"case_count": 100, "description": "Given N distinct points with integer coordinates in D dimensions, count unordered pairs at integer Euclidean distance. Observed inputs: N=2..10 (median 5); D=1..10 (median 3); X_i_j=-20..20.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 321, "median": 50.0, "min": 8}, "input_format": ["N D\nX_1,1 ... X_1,D\n...\nX_N,1 ... X_N,D"], "input_format_status": "source_input_section", "input_lines": {"max": 11, "median": 6.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 102, "median": 17.0, "min": 4}}} -{"case_ids": ["p02831_case_000", "p02831_case_001", "p02831_case_002", "p02831_case_003", "p02831_case_004", "p02831_case_005", "p02831_case_006", "p02831_case_007", "p02831_case_008", "p02831_case_009", "p02831_case_010", "p02831_case_011", "p02831_case_012", "p02831_case_013", "p02831_case_014", "p02831_case_015", "p02831_case_016", "p02831_case_017", "p02831_case_018", "p02831_case_019", "p02831_case_020", "p02831_case_021", "p02831_case_022", "p02831_case_023", "p02831_case_024", "p02831_case_025", "p02831_case_026", "p02831_case_027", "p02831_case_028", "p02831_case_029", "p02831_case_030", "p02831_case_031", "p02831_case_032", "p02831_case_033", "p02831_case_034", "p02831_case_035", "p02831_case_036", "p02831_case_037", "p02831_case_038", "p02831_case_039", "p02831_case_040", "p02831_case_041", "p02831_case_042", "p02831_case_043", "p02831_case_044", "p02831_case_045", "p02831_case_046", "p02831_case_047", "p02831_case_048", "p02831_case_049", "p02831_case_050", "p02831_case_051", "p02831_case_052", "p02831_case_053", "p02831_case_054", "p02831_case_055", "p02831_case_056", "p02831_case_057", "p02831_case_058", "p02831_case_059", "p02831_case_060", "p02831_case_061", "p02831_case_062", "p02831_case_063", "p02831_case_064", "p02831_case_065", "p02831_case_066", "p02831_case_067", "p02831_case_068", "p02831_case_069", "p02831_case_070", "p02831_case_071", "p02831_case_072", "p02831_case_073", "p02831_case_074", "p02831_case_075", "p02831_case_076", "p02831_case_077", "p02831_case_078", "p02831_case_079", "p02831_case_080", "p02831_case_081", "p02831_case_082", "p02831_case_083", "p02831_case_084", "p02831_case_085", "p02831_case_086", "p02831_case_087", "p02831_case_088", "p02831_case_089", "p02831_case_090", "p02831_case_091", "p02831_case_092", "p02831_case_093", "p02831_case_094", "p02831_case_095", "p02831_case_096", "p02831_case_097", "p02831_case_098", "p02831_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "num1, num2 = list(map(int, input().split()))\nimport math\n\n\ndef gcd(num1, num2):\n for i in range(min(num1, num2), 0, -1):\n if num1 % i == 0 and num2 % i == 0:\n return i\n\n\nprint((int(num1 * num2 / gcd(num1, num2))))\n", "fast_code_sha256": "9a1626365f94b8a7d0331e3eabf1740b93398b58e75f9e3e35d2d82ea57bb14e", "fast_id": "p02831_9a1626365f94b8a7d0331e3eabf1740b93398b58e75f9e3e35d2d82ea57bb14e", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "num1, num2 = list(map(int, input().split()))\nimport math\n\n\ndef gcd(num1, num2):\n for i in range(min(num1, num2), 0, -1):\n if num1 % i == 0 and num2 % i == 0:\n return i\n\n\nprint((int(num1 * num2 / gcd(num1, num2))))\n", "measured_fast_code_sha256": "9a1626365f94b8a7d0331e3eabf1740b93398b58e75f9e3e35d2d82ea57bb14e", "measured_slow_code": "A, B = list(map(int, input().split()))\na, b = A, B\nwhile True:\n if a > b:\n b += B\n elif a < b:\n a += A\n if a == b:\n print(a)\n break\n", "measured_slow_code_sha256": "2a0c608945dfe6932309375b337b52e231bed977a9befeeb544efcc3cdfd537c", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 5.126795726308739, "pair_id": "python_v2_9e921a55a1649333cc158d4b", "per_case_slow_code_faster_fraction": 0.26, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02831", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02831_9a1626365f94b8a7d0331e3eabf1740b93398b58e75f9e3e35d2d82ea57bb14e.jsonl.gz", "inputs": "reproduction/python/inputs/p02831.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02831_2a0c608945dfe6932309375b337b52e231bed977a9befeeb544efcc3cdfd537c.jsonl.gz"}, "slow_code": "A, B = list(map(int, input().split()))\na, b = A, B\nwhile True:\n if a > b:\n b += B\n elif a < b:\n a += A\n if a == b:\n print(a)\n break\n", "slow_code_sha256": "2a0c608945dfe6932309375b337b52e231bed977a9befeeb544efcc3cdfd537c", "slow_id": "p02831_2a0c608945dfe6932309375b337b52e231bed977a9befeeb544efcc3cdfd537c", "speedup": 4.508099629192238, "stratum": "4-8", "within_pair_jaccard": 0.23333333333333334, "workload": {"case_count": 100, "description": "Find the minimum positive number of indivisible snack pieces that can be distributed equally either to A guests or to B guests, with each guest receiving at least one piece. A and B differ. Observed inputs: A=1..100000 (median 59009.5); B=1..99999 (median 42628).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 13, "median": 12.0, "min": 4}, "input_format": ["A B"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p03035_case_000", "p03035_case_001", "p03035_case_002", "p03035_case_003", "p03035_case_004", "p03035_case_005", "p03035_case_006", "p03035_case_007", "p03035_case_008", "p03035_case_009", "p03035_case_010", "p03035_case_011", "p03035_case_012", "p03035_case_013", "p03035_case_014", "p03035_case_015", "p03035_case_016", "p03035_case_017", "p03035_case_018", "p03035_case_019", "p03035_case_020", "p03035_case_021", "p03035_case_022", "p03035_case_023", "p03035_case_024", "p03035_case_025", "p03035_case_026", "p03035_case_027", "p03035_case_028", "p03035_case_029", "p03035_case_030", "p03035_case_031", "p03035_case_032", "p03035_case_033", "p03035_case_034", "p03035_case_035", "p03035_case_036", "p03035_case_037", "p03035_case_038", "p03035_case_039", "p03035_case_040", "p03035_case_041", "p03035_case_042", "p03035_case_043", "p03035_case_044", "p03035_case_045", "p03035_case_046", "p03035_case_047", "p03035_case_048", "p03035_case_049", "p03035_case_050", "p03035_case_051", "p03035_case_052", "p03035_case_053", "p03035_case_054", "p03035_case_055", "p03035_case_056", "p03035_case_057", "p03035_case_058", "p03035_case_059", "p03035_case_060", "p03035_case_061", "p03035_case_062", "p03035_case_063", "p03035_case_064", "p03035_case_065", "p03035_case_066", "p03035_case_067", "p03035_case_068", "p03035_case_069", "p03035_case_070", "p03035_case_071", "p03035_case_072", "p03035_case_073", "p03035_case_074", "p03035_case_075", "p03035_case_076", "p03035_case_077", "p03035_case_078", "p03035_case_079", "p03035_case_080", "p03035_case_081", "p03035_case_082", "p03035_case_083", "p03035_case_084", "p03035_case_085", "p03035_case_086", "p03035_case_087", "p03035_case_088", "p03035_case_089", "p03035_case_090", "p03035_case_091", "p03035_case_092", "p03035_case_093", "p03035_case_094", "p03035_case_095", "p03035_case_096", "p03035_case_097", "p03035_case_098", "p03035_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "a, b = list(map(int, input().split()))\nif a >= 13:\n print(b)\nelif 6 <= a <= 12:\n print((b // 2))\nelse:\n print(\"0\")\n", "fast_code_sha256": "cfd662fb233fb80b81fb494e94f71c1fc096a6593d938f8e26b9fcde5e843e3c", "fast_id": "p03035_cfd662fb233fb80b81fb494e94f71c1fc096a6593d938f8e26b9fcde5e843e3c", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "a, b = list(map(int, input().split()))\nif a >= 13:\n print(b)\nelif 6 <= a <= 12:\n print((b // 2))\nelse:\n print(\"0\")\n", "measured_fast_code_sha256": "cfd662fb233fb80b81fb494e94f71c1fc096a6593d938f8e26b9fcde5e843e3c", "measured_slow_code": "import sys, math, collections, heapq, itertools\n\nF = sys.stdin\n\n\ndef single_input():\n return F.readline().strip(\"\\n\")\n\n\ndef line_input():\n return F.readline().strip(\"\\n\").split()\n\n\ndef gcd(a, b):\n a, b = max(a, b), min(a, b)\n while a % b > 0:\n a, b = b, a % b\n return b\n\n\ndef solve():\n A, B = list(map(int, line_input()))\n if A >= 13:\n print(B)\n elif A >= 6:\n print((B // 2))\n else:\n print((0))\n return 0\n\n\nif __name__ == \"__main__\":\n solve()\n", "measured_slow_code_sha256": "a03feaf840d71ae8aa582d21d70bb7cc8063992d1b30834ae4cabc43c65fc6f6", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.9563077945975857, "pair_id": "python_v2_dd065bb956886527ec6ddb93", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03035", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03035_cfd662fb233fb80b81fb494e94f71c1fc096a6593d938f8e26b9fcde5e843e3c.jsonl.gz", "inputs": "reproduction/python/inputs/p03035.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03035_a03feaf840d71ae8aa582d21d70bb7cc8063992d1b30834ae4cabc43c65fc6f6.jsonl.gz"}, "slow_code": "import sys, math, collections, heapq, itertools\n\nF = sys.stdin\n\n\ndef single_input():\n return F.readline().strip(\"\\n\")\n\n\ndef line_input():\n return F.readline().strip(\"\\n\").split()\n\n\ndef gcd(a, b):\n a, b = max(a, b), min(a, b)\n while a % b > 0:\n a, b = b, a % b\n return b\n\n\ndef solve():\n A, B = list(map(int, line_input()))\n if A >= 13:\n print(B)\n elif A >= 6:\n print((B // 2))\n else:\n print((0))\n return 0\n\n\nif __name__ == \"__main__\":\n solve()\n", "slow_code_sha256": "a03feaf840d71ae8aa582d21d70bb7cc8063992d1b30834ae4cabc43c65fc6f6", "slow_id": "p03035_a03feaf840d71ae8aa582d21d70bb7cc8063992d1b30834ae4cabc43c65fc6f6", "speedup": 2.9547670097225955, "stratum": "2-4", "within_pair_jaccard": 0.3333333333333333, "workload": {"case_count": 100, "description": "Find a ticket price for age A: full even price B at age >=13, half price at ages 6..12, and free at ages 0..5. Observed inputs: A=0..100 (median 21); B=2..1000 (median 183).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 9, "median": 6.0, "min": 4}, "input_format": ["A B"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p03126_case_000", "p03126_case_001", "p03126_case_002", "p03126_case_003", "p03126_case_004", "p03126_case_005", "p03126_case_006", "p03126_case_007", "p03126_case_008", "p03126_case_009", "p03126_case_010", "p03126_case_011", "p03126_case_012", "p03126_case_013", "p03126_case_014", "p03126_case_015", "p03126_case_016", "p03126_case_017", "p03126_case_018", "p03126_case_019", "p03126_case_020", "p03126_case_021", "p03126_case_022", "p03126_case_023", "p03126_case_024", "p03126_case_025", "p03126_case_026", "p03126_case_027", "p03126_case_028", "p03126_case_029", "p03126_case_030", "p03126_case_031", "p03126_case_032", "p03126_case_033", "p03126_case_034", "p03126_case_035", "p03126_case_036", "p03126_case_037", "p03126_case_038", "p03126_case_039", "p03126_case_040", "p03126_case_041", "p03126_case_042", "p03126_case_043", "p03126_case_044", "p03126_case_045", "p03126_case_046", "p03126_case_047", "p03126_case_048", "p03126_case_049", "p03126_case_050", "p03126_case_051", "p03126_case_052", "p03126_case_053", "p03126_case_054", "p03126_case_055", "p03126_case_056", "p03126_case_057", "p03126_case_058", "p03126_case_059", "p03126_case_060", "p03126_case_061", "p03126_case_062", "p03126_case_063", "p03126_case_064", "p03126_case_065", "p03126_case_066", "p03126_case_067", "p03126_case_068", "p03126_case_069", "p03126_case_070", "p03126_case_071", "p03126_case_072", "p03126_case_073", "p03126_case_074", "p03126_case_075", "p03126_case_076", "p03126_case_077", "p03126_case_078", "p03126_case_079", "p03126_case_080", "p03126_case_081", "p03126_case_082", "p03126_case_083", "p03126_case_084", "p03126_case_085", "p03126_case_086", "p03126_case_087", "p03126_case_088", "p03126_case_089", "p03126_case_090", "p03126_case_091", "p03126_case_092", "p03126_case_093", "p03126_case_094", "p03126_case_095", "p03126_case_096", "p03126_case_097", "p03126_case_098", "p03126_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n, m = list(map(int, input().split()))\nx = [0] * (m + 1)\nfor i in range(n):\n d = list(map(int, input().split()))\n for i in d[1:]:\n x[i] += 1\nprint((x.count(n)))\n", "fast_code_sha256": "8cfc9f937b723931b5cd7357c864c9e279129146637c449ea835ec0921d5bc89", "fast_id": "p03126_8cfc9f937b723931b5cd7357c864c9e279129146637c449ea835ec0921d5bc89", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n, m = list(map(int, input().split()))\nx = [0] * (m + 1)\nfor i in range(n):\n d = list(map(int, input().split()))\n for i in d[1:]:\n x[i] += 1\nprint((x.count(n)))\n", "measured_fast_code_sha256": "8cfc9f937b723931b5cd7357c864c9e279129146637c449ea835ec0921d5bc89", "measured_slow_code": "N, M = list(map(int, input().split()))\nlist = [list(map(int, input().split())) for x in range(N)]\n# 一列目削除\nfor i in range(0, N):\n list[i].pop(0)\nstock = []\n# 解答が全リストにあるか探索\nfor i in range(0, N):\n for j in range(0, len(list[i])):\n cnt = 0\n for k in range(0, N):\n if list[i][j] in list[k]:\n cnt += 1\n if cnt == N:\n stock.append(list[i][j])\nif N == 1:\n stock = list[i]\nprint((len(set(stock))))\n", "measured_slow_code_sha256": "cba8544a349f34548c0cfacd2e62b0d692bf5fdacfd135926ebf79dcf82a2da4", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4.383190859858638, "pair_id": "python_v2_dba2b840c2373d9fa3afe0b3", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03126", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03126_8cfc9f937b723931b5cd7357c864c9e279129146637c449ea835ec0921d5bc89.jsonl.gz", "inputs": "reproduction/python/inputs/p03126.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03126_cba8544a349f34548c0cfacd2e62b0d692bf5fdacfd135926ebf79dcf82a2da4.jsonl.gz"}, "slow_code": "N, M = list(map(int, input().split()))\nlist = [list(map(int, input().split())) for x in range(N)]\n\nfor i in range(0, N):\n list[i].pop(0)\nstock = []\n\nfor i in range(0, N):\n for j in range(0, len(list[i])):\n cnt = 0\n for k in range(0, N):\n if list[i][j] in list[k]:\n cnt += 1\n if cnt == N:\n stock.append(list[i][j])\nif N == 1:\n stock = list[i]\nprint((len(set(stock))))\n", "slow_code_sha256": "0dc68db287c1c51e9e3ae700494383cca10de9412a38ef778d71183366a2ba69", "slow_id": "p03126_cba8544a349f34548c0cfacd2e62b0d692bf5fdacfd135926ebf79dcf82a2da4", "speedup": 5.615407210646876, "stratum": "4-8", "within_pair_jaccard": 0.4642857142857143, "workload": {"case_count": 100, "description": "Each of N people lists K_i distinct liked food IDs A_i,j from 1..M. Count food kinds liked by every person; the lists need not be sorted. Observed inputs: N=1..30 (median 13); M=1..30 (median 15); K_i=1..30.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 2526, "median": 177.0, "min": 8}, "input_format": ["N M\nK_1 A_1,1 ... A_1,K_1\n...\nK_N A_N,1 ... A_N,K_N"], "input_format_status": "source_input_section", "input_lines": {"max": 31, "median": 14.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 932, "median": 83.0, "min": 4}}} -{"case_ids": ["p04015_case_000", "p04015_case_001", "p04015_case_002", "p04015_case_003", "p04015_case_004", "p04015_case_005", "p04015_case_006", "p04015_case_007", "p04015_case_008", "p04015_case_009", "p04015_case_010", "p04015_case_011", "p04015_case_012", "p04015_case_013", "p04015_case_014", "p04015_case_015", "p04015_case_016", "p04015_case_017", "p04015_case_018", "p04015_case_019", "p04015_case_020", "p04015_case_021", "p04015_case_022", "p04015_case_023", "p04015_case_024", "p04015_case_025", "p04015_case_026", "p04015_case_028", "p04015_case_029", "p04015_case_030", "p04015_case_031", "p04015_case_032", "p04015_case_033", "p04015_case_034", "p04015_case_035", "p04015_case_036", "p04015_case_037", "p04015_case_038", "p04015_case_039", "p04015_case_040", "p04015_case_041", "p04015_case_042", "p04015_case_043", "p04015_case_044", "p04015_case_045", "p04015_case_046", "p04015_case_047", "p04015_case_048", "p04015_case_049", "p04015_case_050", "p04015_case_051", "p04015_case_052", "p04015_case_053", "p04015_case_054", "p04015_case_055", "p04015_case_056", "p04015_case_057", "p04015_case_058", "p04015_case_059", "p04015_case_060", "p04015_case_061", "p04015_case_062", "p04015_case_063", "p04015_case_064", "p04015_case_065", "p04015_case_067", "p04015_case_068", "p04015_case_069", "p04015_case_070", "p04015_case_071", "p04015_case_072", "p04015_case_073", "p04015_case_074", "p04015_case_075", "p04015_case_077", "p04015_case_078", "p04015_case_079", "p04015_case_080", "p04015_case_081", "p04015_case_082", "p04015_case_083", "p04015_case_086", "p04015_case_087", "p04015_case_088", "p04015_case_089", "p04015_case_090", "p04015_case_091", "p04015_case_092", "p04015_case_093", "p04015_case_094", "p04015_case_095", "p04015_case_096", "p04015_case_097", "p04015_case_098", "p04015_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 95, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def main():\n N, A = tuple(map(int, input().split()))\n X = tuple([int(x) - A for x in input().split()])\n D = {0: 1}\n for i in X:\n for j, k in list(D.items()):\n D[i + j] = D.get(i + j, 0) + k\n ans = D[0] - 1\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "ede5b9a058396a01daab936932f464e5cbc2fc788809c17d5f9cdcc2162829ae", "fast_id": "p04015_1a98987828acdc995c82737080e5ab5fa521efa2065493a3a3086d597b1d0fa8", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "# ABC044C - 高橋君とカード / Tak and Cards (ARC060C)\ndef main():\n N, A = tuple(map(int, input().split()))\n X = tuple([int(x) - A for x in input().split()])\n D = {0: 1}\n for i in X:\n for j, k in list(D.items()):\n D[i + j] = D.get(i + j, 0) + k\n ans = D[0] - 1\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "1a98987828acdc995c82737080e5ab5fa521efa2065493a3a3086d597b1d0fa8", "measured_slow_code": "N, A = list(map(int, input().split()))\nX = list(map(int, input().split()))\nfrom collections import defaultdict\n\ndp = [defaultdict(lambda: 0) for _ in range(N + 1)]\ndp[0][0] = 1\nfor i, x in enumerate(X):\n for j in range(i, -1, -1):\n for k, v in list(dp[j].items()):\n dp[j + 1][k + x] += v\nans = 0\nfor i in range(1, N + 1):\n ans += dp[i][i * A]\nprint(ans)\n", "measured_slow_code_sha256": "d7a5fd53d5dea866179392e857d0ee049e8a0b04508777e18d44c1ee38eeb866", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 11.07501117376407, "pair_id": "python_v2_5587306410d8a64da097a703", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p04015", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p04015_1a98987828acdc995c82737080e5ab5fa521efa2065493a3a3086d597b1d0fa8.jsonl.gz", "inputs": "reproduction/python/inputs/p04015.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p04015_d7a5fd53d5dea866179392e857d0ee049e8a0b04508777e18d44c1ee38eeb866.jsonl.gz"}, "slow_code": "N, A = list(map(int, input().split()))\nX = list(map(int, input().split()))\nfrom collections import defaultdict\n\ndp = [defaultdict(lambda: 0) for _ in range(N + 1)]\ndp[0][0] = 1\nfor i, x in enumerate(X):\n for j in range(i, -1, -1):\n for k, v in list(dp[j].items()):\n dp[j + 1][k + x] += v\nans = 0\nfor i in range(1, N + 1):\n ans += dp[i][i * A]\nprint(ans)\n", "slow_code_sha256": "d7a5fd53d5dea866179392e857d0ee049e8a0b04508777e18d44c1ee38eeb866", "slow_id": "p04015_d7a5fd53d5dea866179392e857d0ee049e8a0b04508777e18d44c1ee38eeb866", "speedup": 7.397684802557289, "stratum": "4-8", "within_pair_jaccard": 0.5135135135135135, "workload": {"case_count": 95, "description": "Count nonempty subsets of N indexed cards whose values x_i have arithmetic mean exactly A. Cards with equal values but different indices are distinct choices. Observed inputs: N=1..50 (median 50); A=1..50 (median 25); x_i=1..50.", "description_revision": "semantic-review-20261020", "distinct_input_count": 95, "input_bytes": {"max": 156, "median": 105, "min": 6}, "input_format": ["N A\nx_1 ... x_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 52, "median": 52, "min": 3}}} -{"case_ids": ["p00022_case_000", "p00022_case_001", "p00022_case_002", "p00022_case_003", "p00022_case_004", "p00022_case_005", "p00022_case_006", "p00022_case_007", "p00022_case_008", "p00022_case_009", "p00022_case_010", "p00022_case_011", "p00022_case_012", "p00022_case_013", "p00022_case_014", "p00022_case_015", "p00022_case_016", "p00022_case_017", "p00022_case_018", "p00022_case_019", "p00022_case_020", "p00022_case_021", "p00022_case_022", "p00022_case_023", "p00022_case_024", "p00022_case_025", "p00022_case_026", "p00022_case_027", "p00022_case_028", "p00022_case_029", "p00022_case_030", "p00022_case_031", "p00022_case_032", "p00022_case_033", "p00022_case_034", "p00022_case_035", "p00022_case_036", "p00022_case_037", "p00022_case_038", "p00022_case_039", "p00022_case_040", "p00022_case_041", "p00022_case_042", "p00022_case_043", "p00022_case_044", "p00022_case_045", "p00022_case_046", "p00022_case_047", "p00022_case_048", "p00022_case_049", "p00022_case_050", "p00022_case_051", "p00022_case_052", "p00022_case_053", "p00022_case_054", "p00022_case_055", "p00022_case_056", "p00022_case_057", "p00022_case_058", "p00022_case_059", "p00022_case_060", "p00022_case_061", "p00022_case_062", "p00022_case_063", "p00022_case_064", "p00022_case_065", "p00022_case_066", "p00022_case_067", "p00022_case_068", "p00022_case_069", "p00022_case_070", "p00022_case_071", "p00022_case_072", "p00022_case_073", "p00022_case_074", "p00022_case_075", "p00022_case_076", "p00022_case_077", "p00022_case_078", "p00022_case_079", "p00022_case_080", "p00022_case_081", "p00022_case_082", "p00022_case_083", "p00022_case_084", "p00022_case_085", "p00022_case_086", "p00022_case_087", "p00022_case_088", "p00022_case_089", "p00022_case_090", "p00022_case_091", "p00022_case_092", "p00022_case_093", "p00022_case_094", "p00022_case_095", "p00022_case_096", "p00022_case_097", "p00022_case_098", "p00022_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "while 1:\n n = int(input())\n if n == 0:\n break\n A = [0] * n\n for i in range(n):\n A[i] = int(input())\n for i in range(1, len(A)):\n A[i] = max(A[i - 1] + A[i], A[i])\n print(max(A))\n", "fast_code_sha256": "543ee6d0e81691fcafec5a2b260b0d8f3e49adb766d2156505b28d551aba5051", "fast_id": "p00022_543ee6d0e81691fcafec5a2b260b0d8f3e49adb766d2156505b28d551aba5051", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "while 1:\n n = int(input())\n if n == 0:\n break\n A = [0] * n\n for i in range(n):\n A[i] = int(input())\n for i in range(1, len(A)):\n A[i] = max(A[i - 1] + A[i], A[i])\n print(max(A))\n", "measured_fast_code_sha256": "543ee6d0e81691fcafec5a2b260b0d8f3e49adb766d2156505b28d551aba5051", "measured_slow_code": "n = eval(input())\nwhile n:\n x = -100000\n m = x\n s = 0\n while n:\n a = eval(input())\n x = max(x, 0) + a\n m = max(m, x)\n n -= 1\n print(m)\n n = eval(input())\n", "measured_slow_code_sha256": "a5086560b3d72499a535710346e1969d90deaa71ee9f102e4fab549979daedfd", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.4502932391882046, "pair_id": "python_v2_db338b455b3f606adf97cf14", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p00022", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p00022_543ee6d0e81691fcafec5a2b260b0d8f3e49adb766d2156505b28d551aba5051.jsonl.gz", "inputs": "reproduction/python/inputs/p00022.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p00022_a5086560b3d72499a535710346e1969d90deaa71ee9f102e4fab549979daedfd.jsonl.gz"}, "slow_code": "n = eval(input())\nwhile n:\n x = -100000\n m = x\n s = 0\n while n:\n a = eval(input())\n x = max(x, 0) + a\n m = max(m, x)\n n -= 1\n print(m)\n n = eval(input())\n", "slow_code_sha256": "a5086560b3d72499a535710346e1969d90deaa71ee9f102e4fab549979daedfd", "slow_id": "p00022_a5086560b3d72499a535710346e1969d90deaa71ee9f102e4fab549979daedfd", "speedup": 2.2933864385284797, "stratum": "2-4", "within_pair_jaccard": 0.3181818181818182, "workload": {"case_count": 100, "description": "For each integer sequence, find the maximum sum of a nonempty contiguous subsequence. Each dataset supplies n followed by n values, one value per line; a final zero ends the input. Observed inputs: datasets=1..10 (median 1); n=1..5000; total_records=1..50000 (median 1000); a_i=-100000..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 319550, "median": 6388.0, "min": 9}, "input_format": ["n_1\na_1\n...\na_(n_1)\n[next datasets]\n0"], "input_format_status": "source_input_section", "input_lines": {"max": 50011, "median": 1002.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 50011, "median": 1002.0, "min": 3}}} -{"case_ids": ["p03212_case_000", "p03212_case_001", "p03212_case_002", "p03212_case_003", "p03212_case_004", "p03212_case_005", "p03212_case_006", "p03212_case_007", "p03212_case_008", "p03212_case_009", "p03212_case_010", "p03212_case_011", "p03212_case_012", "p03212_case_013", "p03212_case_014", "p03212_case_015", "p03212_case_016", "p03212_case_017", "p03212_case_018", "p03212_case_019", "p03212_case_020", "p03212_case_021", "p03212_case_022", "p03212_case_023", "p03212_case_024", "p03212_case_025", "p03212_case_026", "p03212_case_027", "p03212_case_028", "p03212_case_029", "p03212_case_030", "p03212_case_031", "p03212_case_032", "p03212_case_033", "p03212_case_034", "p03212_case_035", "p03212_case_036", "p03212_case_037", "p03212_case_038", "p03212_case_039", "p03212_case_040", "p03212_case_041", "p03212_case_042", "p03212_case_043", "p03212_case_044", "p03212_case_045", "p03212_case_046", "p03212_case_047", "p03212_case_048", "p03212_case_049", "p03212_case_050", "p03212_case_051", "p03212_case_052", "p03212_case_053", "p03212_case_054", "p03212_case_055", "p03212_case_056", "p03212_case_057", "p03212_case_058", "p03212_case_059", "p03212_case_060", "p03212_case_061", "p03212_case_062", "p03212_case_063", "p03212_case_064", "p03212_case_065", "p03212_case_066", "p03212_case_067", "p03212_case_068", "p03212_case_069", "p03212_case_070", "p03212_case_071", "p03212_case_072", "p03212_case_073", "p03212_case_074", "p03212_case_075", "p03212_case_076", "p03212_case_077", "p03212_case_078", "p03212_case_079", "p03212_case_080", "p03212_case_081", "p03212_case_082", "p03212_case_083", "p03212_case_084", "p03212_case_085", "p03212_case_086", "p03212_case_087", "p03212_case_088", "p03212_case_089", "p03212_case_090", "p03212_case_091", "p03212_case_092", "p03212_case_093", "p03212_case_094", "p03212_case_095", "p03212_case_096", "p03212_case_097", "p03212_case_098", "p03212_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N = int(eval(input()))\nans = 0\n\n\ndef dfs(s, sum):\n global ans\n sum = sum + s\n if int(sum) > N:\n return False\n sum = str(int(sum))\n if sum.count(\"3\") >= 1 and sum.count(\"5\") >= 1 and sum.count(\"7\") >= 1:\n ans += 1\n if dfs(\"3\", sum):\n return True\n if dfs(\"5\", sum):\n return True\n if dfs(\"7\", sum):\n return True\n\n\ndfs(\"0\", \"\")\nprint(ans)\n", "fast_code_sha256": "0460d012a406aad766556cab169b4de818b7cd5dfb845c6e5cef981e6c3c5fa9", "fast_id": "p03212_0460d012a406aad766556cab169b4de818b7cd5dfb845c6e5cef981e6c3c5fa9", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N = int(eval(input()))\nans = 0\n\n\ndef dfs(s, sum):\n global ans\n sum = sum + s\n if int(sum) > N:\n return False\n sum = str(int(sum))\n if sum.count(\"3\") >= 1 and sum.count(\"5\") >= 1 and sum.count(\"7\") >= 1:\n ans += 1\n if dfs(\"3\", sum):\n return True\n if dfs(\"5\", sum):\n return True\n if dfs(\"7\", sum):\n return True\n\n\ndfs(\"0\", \"\")\nprint(ans)\n", "measured_fast_code_sha256": "0460d012a406aad766556cab169b4de818b7cd5dfb845c6e5cef981e6c3c5fa9", "measured_slow_code": "import copy\n\nword = \"753\"\n\n\ndef dfs(n):\n ret = 0\n num = 0 if not n else int(\"\".join(n))\n if N < num:\n return ret\n ret += 1 if len(set(\"\".join(n)) & set(word)) == len(word) else 0\n for c in word:\n tmp = copy.deepcopy(n)\n n.append(c)\n ret += dfs(n)\n n = tmp\n return ret\n\n\nN = int(eval(input()))\nprint((dfs([])))\n", "measured_slow_code_sha256": "9b823eea975a23a20587bc34ffa695ba9d6a5f099d4923f94ee756f58c3ecb65", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 10.127633075539173, "pair_id": "python_v2_d577b7c55606b06a40226378", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03212", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03212_0460d012a406aad766556cab169b4de818b7cd5dfb845c6e5cef981e6c3c5fa9.jsonl.gz", "inputs": "reproduction/python/inputs/p03212.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03212_9b823eea975a23a20587bc34ffa695ba9d6a5f099d4923f94ee756f58c3ecb65.jsonl.gz"}, "slow_code": "import copy\n\nword = \"753\"\n\n\ndef dfs(n):\n ret = 0\n num = 0 if not n else int(\"\".join(n))\n if N < num:\n return ret\n ret += 1 if len(set(\"\".join(n)) & set(word)) == len(word) else 0\n for c in word:\n tmp = copy.deepcopy(n)\n n.append(c)\n ret += dfs(n)\n n = tmp\n return ret\n\n\nN = int(eval(input()))\nprint((dfs([])))\n", "slow_code_sha256": "9b823eea975a23a20587bc34ffa695ba9d6a5f099d4923f94ee756f58c3ecb65", "slow_id": "p03212_9b823eea975a23a20587bc34ffa695ba9d6a5f099d4923f94ee756f58c3ecb65", "speedup": 7.769694637982343, "stratum": "4-8", "within_pair_jaccard": 0.2682926829268293, "workload": {"case_count": 100, "description": "Count positive integers at most N whose decimal digits use only 3,5,7 and contain each of those three digits at least once. Observed inputs: N=1..999999999 (median 133260161.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 10, "median": 10.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p03502_case_000", "p03502_case_001", "p03502_case_002", "p03502_case_003", "p03502_case_004", "p03502_case_005", "p03502_case_006", "p03502_case_007", "p03502_case_008", "p03502_case_009", "p03502_case_010", "p03502_case_011", "p03502_case_012", "p03502_case_013", "p03502_case_014", "p03502_case_015", "p03502_case_016", "p03502_case_017", "p03502_case_018", "p03502_case_019", "p03502_case_020", "p03502_case_021", "p03502_case_022", "p03502_case_023", "p03502_case_024", "p03502_case_025", "p03502_case_026", "p03502_case_027", "p03502_case_028", "p03502_case_029", "p03502_case_030", "p03502_case_031", "p03502_case_032", "p03502_case_033", "p03502_case_034", "p03502_case_035", "p03502_case_036", "p03502_case_037", "p03502_case_038", "p03502_case_039", "p03502_case_040", "p03502_case_041", "p03502_case_042", "p03502_case_043", "p03502_case_044", "p03502_case_045", "p03502_case_046", "p03502_case_047", "p03502_case_048", "p03502_case_049", "p03502_case_050", "p03502_case_051", "p03502_case_052", "p03502_case_053", "p03502_case_054", "p03502_case_055", "p03502_case_056", "p03502_case_057", "p03502_case_058", "p03502_case_059", "p03502_case_060", "p03502_case_061", "p03502_case_062", "p03502_case_063", "p03502_case_064", "p03502_case_065", "p03502_case_066", "p03502_case_067", "p03502_case_068", "p03502_case_069", "p03502_case_070", "p03502_case_071", "p03502_case_072", "p03502_case_073", "p03502_case_074", "p03502_case_075", "p03502_case_076", "p03502_case_077", "p03502_case_078", "p03502_case_079", "p03502_case_080", "p03502_case_081", "p03502_case_082", "p03502_case_083", "p03502_case_084", "p03502_case_085", "p03502_case_086", "p03502_case_087", "p03502_case_088", "p03502_case_089", "p03502_case_090", "p03502_case_091", "p03502_case_092", "p03502_case_093", "p03502_case_094", "p03502_case_095", "p03502_case_096", "p03502_case_097", "p03502_case_098", "p03502_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\ns = str(n)\nsum = 0\nfor i in range(len(s)):\n sum += ord(s[i]) - ord(\"0\")\nif n % sum == 0:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "fast_code_sha256": "2a5d56ad885392890eff866a522b28503082be2ac0075f2e8c02fa66a6f8cc0f", "fast_id": "p03502_2a5d56ad885392890eff866a522b28503082be2ac0075f2e8c02fa66a6f8cc0f", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\ns = str(n)\nsum = 0\nfor i in range(len(s)):\n sum += ord(s[i]) - ord(\"0\")\nif n % sum == 0:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "measured_fast_code_sha256": "2a5d56ad885392890eff866a522b28503082be2ac0075f2e8c02fa66a6f8cc0f", "measured_slow_code": "import sys\nimport math\nimport collections\nimport itertools\nimport array\nimport inspect\n\n# Set max recursion limit\nsys.setrecursionlimit(10000)\n# Debug output\ndef chkprint(*args):\n names = {id(v): k for k, v in list(inspect.currentframe().f_back.f_locals.items())}\n print((\", \".join(names.get(id(arg), \"???\") + \" = \" + repr(arg) for arg in args)))\n\n\n# Binary converter\ndef to_bin(x):\n return bin(x)[2:]\n\n\ndef li_input():\n return [int(_) for _ in input().split()]\n\n\n# --------------------------------------------\ndp = None\n\n\ndef main():\n X = int(eval(input()))\n if X % sum(list(map(int, list(str(X))))) == 0:\n print(\"Yes\")\n else:\n print(\"No\")\n\n\nmain()\n", "measured_slow_code_sha256": "9657e24fd296bdb183cb812efcaa41e0e4d09edff18e911040359edf4aba2689", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 37.40052597936895, "pair_id": "python_v2_9e0abe99fd7caad92bbfcba0", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03502", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03502_2a5d56ad885392890eff866a522b28503082be2ac0075f2e8c02fa66a6f8cc0f.jsonl.gz", "inputs": "reproduction/python/inputs/p03502.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03502_9657e24fd296bdb183cb812efcaa41e0e4d09edff18e911040359edf4aba2689.jsonl.gz"}, "slow_code": "import sys\nimport math\nimport collections\nimport itertools\nimport array\nimport inspect\n\n\nsys.setrecursionlimit(10000)\n\n\ndef chkprint(*args):\n names = {id(v): k for k, v in list(inspect.currentframe().f_back.f_locals.items())}\n print((\", \".join(names.get(id(arg), \"???\") + \" = \" + repr(arg) for arg in args)))\n\n\ndef to_bin(x):\n return bin(x)[2:]\n\n\ndef li_input():\n return [int(_) for _ in input().split()]\n\n\ndp = None\n\n\ndef main():\n X = int(eval(input()))\n if X % sum(list(map(int, list(str(X))))) == 0:\n print(\"Yes\")\n else:\n print(\"No\")\n\n\nmain()\n", "slow_code_sha256": "04afcb0636d6758b9c1fd4024fff2537c6c73d327a7f8a692ef75cf80e1d3933", "slow_id": "p03502_9657e24fd296bdb183cb812efcaa41e0e4d09edff18e911040359edf4aba2689", "speedup": 37.631864543662985, "stratum": "8+", "within_pair_jaccard": 0.22807017543859648, "workload": {"case_count": 100, "description": "Determine whether positive integer N is divisible by the sum of its decimal digits. Observed inputs: N=1..100000000 (median 8425409).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 10, "median": 8.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p03288_case_000", "p03288_case_001", "p03288_case_002", "p03288_case_003", "p03288_case_004", "p03288_case_005", "p03288_case_006", "p03288_case_007", "p03288_case_008", "p03288_case_009", "p03288_case_010", "p03288_case_011", "p03288_case_012", "p03288_case_013", "p03288_case_014", "p03288_case_015", "p03288_case_016", "p03288_case_017", "p03288_case_018", "p03288_case_019", "p03288_case_020", "p03288_case_021", "p03288_case_022", "p03288_case_023", "p03288_case_024", "p03288_case_025", "p03288_case_026", "p03288_case_027", "p03288_case_028", "p03288_case_029", "p03288_case_030", "p03288_case_031", "p03288_case_032", "p03288_case_033", "p03288_case_034", "p03288_case_035", "p03288_case_036", "p03288_case_037", "p03288_case_038", "p03288_case_039", "p03288_case_040", "p03288_case_041", "p03288_case_042", "p03288_case_043", "p03288_case_044", "p03288_case_045", "p03288_case_046", "p03288_case_047", "p03288_case_048", "p03288_case_049", "p03288_case_050", "p03288_case_051", "p03288_case_052", "p03288_case_053", "p03288_case_054", "p03288_case_055", "p03288_case_056", "p03288_case_057", "p03288_case_058", "p03288_case_059", "p03288_case_060", "p03288_case_061", "p03288_case_062", "p03288_case_063", "p03288_case_064", "p03288_case_065", "p03288_case_066", "p03288_case_067", "p03288_case_068", "p03288_case_069", "p03288_case_070", "p03288_case_071", "p03288_case_072", "p03288_case_073", "p03288_case_074", "p03288_case_075", "p03288_case_076", "p03288_case_077", "p03288_case_078", "p03288_case_079", "p03288_case_080", "p03288_case_081", "p03288_case_082", "p03288_case_083", "p03288_case_084", "p03288_case_085", "p03288_case_086", "p03288_case_087", "p03288_case_088", "p03288_case_089", "p03288_case_090", "p03288_case_091", "p03288_case_092", "p03288_case_093", "p03288_case_094", "p03288_case_095", "p03288_case_096", "p03288_case_097", "p03288_case_098", "p03288_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\nri = lambda: int(sys.stdin.readline())\na = ri()\nif a < 1200:\n print(\"ABC\")\nelif a < 2800:\n print(\"ARC\")\nelse:\n print(\"AGC\")\n", "fast_code_sha256": "86a21b0905ddb20de2f64b0cf00ce0c21b9102791dca67a15152f0feda53accb", "fast_id": "p03288_86a21b0905ddb20de2f64b0cf00ce0c21b9102791dca67a15152f0feda53accb", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\nri = lambda: int(sys.stdin.readline())\na = ri()\nif a < 1200:\n print(\"ABC\")\nelif a < 2800:\n print(\"ARC\")\nelse:\n print(\"AGC\")\n", "measured_fast_code_sha256": "86a21b0905ddb20de2f64b0cf00ce0c21b9102791dca67a15152f0feda53accb", "measured_slow_code": "import bisect, collections, copy, heapq, itertools, math, string\nimport sys\n\n\ndef S():\n return sys.stdin.readline().rstrip()\n\n\ndef M():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef LS():\n return list(sys.stdin.readline().rstrip().split())\n\n\nR = I()\nif R < 1200:\n print(\"ABC\")\nelif R < 2800:\n print(\"ARC\")\nelse:\n print(\"AGC\")\n", "measured_slow_code_sha256": "4b19a6c66c6b24c9d371f629b6a683da99f61809c1d26fcff1386ca6548060d5", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 24.816138459027748, "pair_id": "python_v2_cf1a2e92e8e82a437cf68141", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03288", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03288_86a21b0905ddb20de2f64b0cf00ce0c21b9102791dca67a15152f0feda53accb.jsonl.gz", "inputs": "reproduction/python/inputs/p03288.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03288_4b19a6c66c6b24c9d371f629b6a683da99f61809c1d26fcff1386ca6548060d5.jsonl.gz"}, "slow_code": "import bisect, collections, copy, heapq, itertools, math, string\nimport sys\n\n\ndef S():\n return sys.stdin.readline().rstrip()\n\n\ndef M():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef LS():\n return list(sys.stdin.readline().rstrip().split())\n\n\nR = I()\nif R < 1200:\n print(\"ABC\")\nelif R < 2800:\n print(\"ARC\")\nelse:\n print(\"AGC\")\n", "slow_code_sha256": "4b19a6c66c6b24c9d371f629b6a683da99f61809c1d26fcff1386ca6548060d5", "slow_id": "p03288_4b19a6c66c6b24c9d371f629b6a683da99f61809c1d26fcff1386ca6548060d5", "speedup": 24.804444500448906, "stratum": "8+", "within_pair_jaccard": 0.3888888888888889, "workload": {"case_count": 100, "description": "Choose the next eligible category from three ordered categories: the first requires rating below 1200, the second below 2800, and the third accepts every rating. Observed inputs: R=0..4208 (median 1199.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 5, "median": 5.0, "min": 2}, "input_format": ["R"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p02922_case_000", "p02922_case_001", "p02922_case_002", "p02922_case_003", "p02922_case_004", "p02922_case_005", "p02922_case_006", "p02922_case_007", "p02922_case_008", "p02922_case_009", "p02922_case_010", "p02922_case_011", "p02922_case_012", "p02922_case_013", "p02922_case_014", "p02922_case_015", "p02922_case_016", "p02922_case_017", "p02922_case_018", "p02922_case_019", "p02922_case_020", "p02922_case_021", "p02922_case_022", "p02922_case_023", "p02922_case_024", "p02922_case_025", "p02922_case_026", "p02922_case_027", "p02922_case_028", "p02922_case_029", "p02922_case_030", "p02922_case_031", "p02922_case_032", "p02922_case_033", "p02922_case_034", "p02922_case_035", "p02922_case_036", "p02922_case_037", "p02922_case_038", "p02922_case_039", "p02922_case_040", "p02922_case_041", "p02922_case_042", "p02922_case_043", "p02922_case_044", "p02922_case_045", "p02922_case_046", "p02922_case_047", "p02922_case_048", "p02922_case_049", "p02922_case_050", "p02922_case_051", "p02922_case_052", "p02922_case_053", "p02922_case_054", "p02922_case_055", "p02922_case_056", "p02922_case_057", "p02922_case_058", "p02922_case_059", "p02922_case_060", "p02922_case_061", "p02922_case_062", "p02922_case_063", "p02922_case_064", "p02922_case_065", "p02922_case_066", "p02922_case_067", "p02922_case_068", "p02922_case_069", "p02922_case_070", "p02922_case_071", "p02922_case_072", "p02922_case_073", "p02922_case_074", "p02922_case_075", "p02922_case_076", "p02922_case_077", "p02922_case_078", "p02922_case_079", "p02922_case_080", "p02922_case_081", "p02922_case_082", "p02922_case_083", "p02922_case_084", "p02922_case_085", "p02922_case_086", "p02922_case_087", "p02922_case_088", "p02922_case_089", "p02922_case_090", "p02922_case_091", "p02922_case_092", "p02922_case_093", "p02922_case_094", "p02922_case_095", "p02922_case_096", "p02922_case_097", "p02922_case_098", "p02922_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "a, b = list(map(int, input().split()))\nc = \"必要な電源タップ数は\"\nd = \"個です。\"\ncount = 0\ntotal = 1\nwhile True:\n\n if total >= b:\n break\n total += a - 1\n count += 1\nprint(count)\n", "fast_code_sha256": "7e700aab44bb2d5db1c2e52361bdf5c6e6f43b2116d3eeb5b0ce0ecf6bf5c5e6", "fast_id": "p02922_8debc0564456e64a009e96252f5a5339d3fcb470184b2a7f925d1e81588b3b33", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "a, b = list(map(int, input().split()))\nc = \"必要な電源タップ数は\"\nd = \"個です。\"\ncount = 0\ntotal = 1\nwhile True:\n # total+=a\n # if total= b:\n break\n total += a - 1\n count += 1\nprint(count)\n", "measured_fast_code_sha256": "8debc0564456e64a009e96252f5a5339d3fcb470184b2a7f925d1e81588b3b33", "measured_slow_code": "import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, queue, copy\n\nsys.setrecursionlimit(10**7)\ninf = 10**20\nmod = 10**9 + 7\ndd = [(-1, 0), (0, 1), (1, 0), (0, -1)]\nddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef LI_():\n return [int(x) - 1 for x in sys.stdin.readline().split()]\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LS():\n return sys.stdin.readline().split()\n\n\ndef S():\n return eval(input())\n\n\ndef main():\n a, b = LI()\n c = 1\n ans = 0\n while True:\n if c >= b:\n return ans\n ans += 1\n c -= 1\n c += a\n\n\n# main()\nprint((main()))\n", "measured_slow_code_sha256": "8b569fc1e16981f8320c705cea748e4c69f345af35a77c5db73eb42d1431aac6", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 52.09934568834538, "pair_id": "python_v2_99606af02738a16e21099cad", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02922", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02922_8debc0564456e64a009e96252f5a5339d3fcb470184b2a7f925d1e81588b3b33.jsonl.gz", "inputs": "reproduction/python/inputs/p02922.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02922_8b569fc1e16981f8320c705cea748e4c69f345af35a77c5db73eb42d1431aac6.jsonl.gz"}, "slow_code": "import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, queue, copy\n\nsys.setrecursionlimit(10**7)\ninf = 10**20\nmod = 10**9 + 7\ndd = [(-1, 0), (0, 1), (1, 0), (0, -1)]\nddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef LI_():\n return [int(x) - 1 for x in sys.stdin.readline().split()]\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LS():\n return sys.stdin.readline().split()\n\n\ndef S():\n return eval(input())\n\n\ndef main():\n a, b = LI()\n c = 1\n ans = 0\n while True:\n if c >= b:\n return ans\n ans += 1\n c -= 1\n c += a\n\n\nprint((main()))\n", "slow_code_sha256": "d125558241ae3c64a726d724586fb5061b0b0d9b36349b79174daa959a5a79c4", "slow_id": "p02922_8b569fc1e16981f8320c705cea748e4c69f345af35a77c5db73eb42d1431aac6", "speedup": 51.925271163607114, "stratum": "8+", "within_pair_jaccard": 0.2033898305084746, "workload": {"case_count": 100, "description": "Start with one empty electrical socket. Installing a strip consumes one socket and provides A empty sockets. Find the fewest strips needed to have at least B empty sockets. Observed inputs: A=2..20 (median 8); B=1..20 (median 7).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 6, "median": 4.5, "min": 4}, "input_format": ["A B"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p02688_case_000", "p02688_case_001", "p02688_case_002", "p02688_case_003", "p02688_case_004", "p02688_case_005", "p02688_case_006", "p02688_case_007", "p02688_case_008", "p02688_case_009", "p02688_case_010", "p02688_case_011", "p02688_case_012", "p02688_case_013", "p02688_case_014", "p02688_case_015", "p02688_case_016", "p02688_case_017", "p02688_case_018", "p02688_case_019", "p02688_case_020", "p02688_case_021", "p02688_case_022", "p02688_case_023", "p02688_case_024", "p02688_case_025", "p02688_case_026", "p02688_case_027", "p02688_case_028", "p02688_case_029", "p02688_case_030", "p02688_case_031", "p02688_case_032", "p02688_case_033", "p02688_case_034", "p02688_case_035", "p02688_case_036", "p02688_case_037", "p02688_case_038", "p02688_case_039", "p02688_case_040", "p02688_case_041", "p02688_case_042", "p02688_case_043", "p02688_case_044", "p02688_case_045", "p02688_case_046", "p02688_case_047", "p02688_case_048", "p02688_case_049", "p02688_case_050", "p02688_case_051", "p02688_case_052", "p02688_case_053", "p02688_case_054", "p02688_case_055", "p02688_case_056", "p02688_case_057", "p02688_case_058", "p02688_case_059", "p02688_case_060", "p02688_case_061", "p02688_case_062", "p02688_case_063", "p02688_case_064", "p02688_case_065", "p02688_case_066", "p02688_case_067", "p02688_case_068", "p02688_case_069", "p02688_case_070", "p02688_case_071", "p02688_case_072", "p02688_case_073", "p02688_case_074", "p02688_case_075", "p02688_case_076", "p02688_case_077", "p02688_case_078", "p02688_case_079", "p02688_case_080", "p02688_case_081", "p02688_case_082", "p02688_case_083", "p02688_case_084", "p02688_case_085", "p02688_case_086", "p02688_case_087", "p02688_case_088", "p02688_case_089", "p02688_case_090", "p02688_case_091", "p02688_case_092", "p02688_case_093", "p02688_case_094", "p02688_case_095", "p02688_case_096", "p02688_case_097", "p02688_case_098", "p02688_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "R = lambda: list(map(int, input().split()))\nn, k = R()\ns = set()\nfor _ in range(k):\n R()\n s.update(R())\nprint((n - len(s)))\n", "fast_code_sha256": "3e6d626ab547675c3b341d29edcadee93969941923bd6eda1ba7144ea2b5a1d3", "fast_id": "p02688_3e6d626ab547675c3b341d29edcadee93969941923bd6eda1ba7144ea2b5a1d3", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "R = lambda: list(map(int, input().split()))\nn, k = R()\ns = set()\nfor _ in range(k):\n R()\n s.update(R())\nprint((n - len(s)))\n", "measured_fast_code_sha256": "3e6d626ab547675c3b341d29edcadee93969941923bd6eda1ba7144ea2b5a1d3", "measured_slow_code": "def main():\n n, k = tuple([int(t) for t in input().split()])\n t = [0] * n\n for _ in range(k):\n eval(input())\n k = tuple([int(t) - 1 for t in input().split()])\n for k_i in k:\n t[k_i] += 1\n ans = 0\n for t_i in t:\n if t_i == 0:\n ans += 1\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "833cdc3e9e22359e6374ddf9a571da0b188300c6f7965f7bf42a388d1a943053", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.9884839940915762, "pair_id": "python_v2_a1f1e80f69f346c489a38640", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02688", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02688_3e6d626ab547675c3b341d29edcadee93969941923bd6eda1ba7144ea2b5a1d3.jsonl.gz", "inputs": "reproduction/python/inputs/p02688.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02688_833cdc3e9e22359e6374ddf9a571da0b188300c6f7965f7bf42a388d1a943053.jsonl.gz"}, "slow_code": "def main():\n n, k = tuple([int(t) for t in input().split()])\n t = [0] * n\n for _ in range(k):\n eval(input())\n k = tuple([int(t) - 1 for t in input().split()])\n for k_i in k:\n t[k_i] += 1\n ans = 0\n for t_i in t:\n if t_i == 0:\n ans += 1\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "833cdc3e9e22359e6374ddf9a571da0b188300c6f7965f7bf42a388d1a943053", "slow_id": "p02688_833cdc3e9e22359e6374ddf9a571da0b188300c6f7965f7bf42a388d1a943053", "speedup": 2.017011959909398, "stratum": "2-4", "within_pair_jaccard": 0.3225806451612903, "workload": {"case_count": 100, "description": "Among N people, count those owning no snack. For each of K snack kinds, d_i and a strictly increasing list of owner IDs A_i,j are supplied; one person may own several kinds. Observed inputs: N=1..100 (median 50); K=1..100 (median 50); d_i=1..100; total_owner_records=1..10000 (median 916).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 29608, "median": 2615.5, "min": 8}, "input_format": ["N K\nd_1\nA_1,1 ... A_1,d_1\n...\nd_K\nA_K,1 ... A_K,d_K"], "input_format_status": "source_input_section", "input_lines": {"max": 201, "median": 101.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 10102, "median": 988.0, "min": 4}}} -{"case_ids": ["p02789_case_000", "p02789_case_001", "p02789_case_002", "p02789_case_003", "p02789_case_004", "p02789_case_005", "p02789_case_006", "p02789_case_007", "p02789_case_008", "p02789_case_009", "p02789_case_010", "p02789_case_011", "p02789_case_012", "p02789_case_013", "p02789_case_014", "p02789_case_015", "p02789_case_016", "p02789_case_017", "p02789_case_018", "p02789_case_019", "p02789_case_020", "p02789_case_021", "p02789_case_022", "p02789_case_023", "p02789_case_024", "p02789_case_025", "p02789_case_026", "p02789_case_027", "p02789_case_028", "p02789_case_029", "p02789_case_030", "p02789_case_031", "p02789_case_032", "p02789_case_033", "p02789_case_034", "p02789_case_035", "p02789_case_036", "p02789_case_037", "p02789_case_038", "p02789_case_039", "p02789_case_040", "p02789_case_041", "p02789_case_042", "p02789_case_043", "p02789_case_044", "p02789_case_045", "p02789_case_046", "p02789_case_047", "p02789_case_048", "p02789_case_049", "p02789_case_050", "p02789_case_051", "p02789_case_052", "p02789_case_053", "p02789_case_054", "p02789_case_055", "p02789_case_056", "p02789_case_057", "p02789_case_058", "p02789_case_059", "p02789_case_060", "p02789_case_061", "p02789_case_062", "p02789_case_063", "p02789_case_064", "p02789_case_065", "p02789_case_066", "p02789_case_067", "p02789_case_068", "p02789_case_069", "p02789_case_070", "p02789_case_071", "p02789_case_072", "p02789_case_073", "p02789_case_074", "p02789_case_075", "p02789_case_076", "p02789_case_077", "p02789_case_078", "p02789_case_079", "p02789_case_080", "p02789_case_081", "p02789_case_082", "p02789_case_083", "p02789_case_084", "p02789_case_085", "p02789_case_086", "p02789_case_087", "p02789_case_088", "p02789_case_089", "p02789_case_090", "p02789_case_091", "p02789_case_092", "p02789_case_093", "p02789_case_094", "p02789_case_095", "p02789_case_096", "p02789_case_097", "p02789_case_098", "p02789_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n, m = list(map(int, input().split()))\nif m == n:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "fast_code_sha256": "28e9f5b5de0ec96f669439e47f483ca1889df19afb3fbefdc72439020ef1b917", "fast_id": "p02789_28e9f5b5de0ec96f669439e47f483ca1889df19afb3fbefdc72439020ef1b917", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n, m = list(map(int, input().split()))\nif m == n:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "measured_fast_code_sha256": "28e9f5b5de0ec96f669439e47f483ca1889df19afb3fbefdc72439020ef1b917", "measured_slow_code": "# coding: utf-8\n# submission # - User: herp_sy\n# https://atcoder.jp/contests/\n#\n# lang: Python3 (3.4.3)\nimport math\nimport statistics\nimport numpy as np\nimport queue\n\n# fact(int)\ndef fact(n):\n if n == 1:\n return 1\n else:\n return n * fact(n - 1)\n\n\n# gcd(int,int)\ndef gcd(a, b):\n if a == 0:\n return b\n elif b == 0:\n return a\n else:\n return gcd(b, a % b)\n\n\n# lcm(int,int)\ndef lcm(a, b):\n return a * b / gcd(a, b)\n\n\n# qsort(array[])\ndef qsort(seq):\n if len(seq) < 2:\n return seq\n else:\n beg, end = 0, len(seq) - 1\n mid = (beg + end) // 2\n smaller = [c for c in seq if seq[mid] > c]\n equal = [c for c in seq if seq[mid] == c]\n larger = [c for c in seq if seq[mid] < c]\n return qsort(smaller) + equal + qsort(larger)\n\n\n# = map(int, input().split())\n# = int(input())\n# = raw_input().split()\n# = list(int(i) for i in input().split())\nn, m = list(map(int, input().split()))\nif n == m:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "measured_slow_code_sha256": "78de3f88cb23bb16fb5f9ba282f1719bd461fd7ea9f6aadce1636b6f3a8090f3", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2175.56904108283, "pair_id": "python_v2_9a7be0f4a175bbd9c431039c", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02789", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02789_28e9f5b5de0ec96f669439e47f483ca1889df19afb3fbefdc72439020ef1b917.jsonl.gz", "inputs": "reproduction/python/inputs/p02789.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02789_78de3f88cb23bb16fb5f9ba282f1719bd461fd7ea9f6aadce1636b6f3a8090f3.jsonl.gz"}, "slow_code": "import math\nimport statistics\nimport numpy as np\nimport queue\n\n\ndef fact(n):\n if n == 1:\n return 1\n else:\n return n * fact(n - 1)\n\n\ndef gcd(a, b):\n if a == 0:\n return b\n elif b == 0:\n return a\n else:\n return gcd(b, a % b)\n\n\ndef lcm(a, b):\n return a * b / gcd(a, b)\n\n\ndef qsort(seq):\n if len(seq) < 2:\n return seq\n else:\n beg, end = 0, len(seq) - 1\n mid = (beg + end) // 2\n smaller = [c for c in seq if seq[mid] > c]\n equal = [c for c in seq if seq[mid] == c]\n larger = [c for c in seq if seq[mid] < c]\n return qsort(smaller) + equal + qsort(larger)\n\n\nn, m = list(map(int, input().split()))\nif n == m:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "slow_code_sha256": "2686b43bdf8ed3cbe77780e6157f246a6c7c3d5757c1ec23cbec723e3255f4bc", "slow_id": "p02789_78de3f88cb23bb16fb5f9ba282f1719bd461fd7ea9f6aadce1636b6f3a8090f3", "speedup": 2173.0836155664856, "stratum": "8+", "within_pair_jaccard": 0.2857142857142857, "workload": {"case_count": 100, "description": "A submission has passed M of its N required test cases. Determine whether it receives acceptance, which requires passing every case. Observed inputs: N=1..100 (median 44); M=0..100 (median 14.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 8, "median": 6.0, "min": 4}, "input_format": ["N M"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p03456_case_000", "p03456_case_001", "p03456_case_002", "p03456_case_003", "p03456_case_004", "p03456_case_005", "p03456_case_006", "p03456_case_007", "p03456_case_008", "p03456_case_009", "p03456_case_010", "p03456_case_011", "p03456_case_012", "p03456_case_013", "p03456_case_014", "p03456_case_015", "p03456_case_016", "p03456_case_017", "p03456_case_018", "p03456_case_019", "p03456_case_020", "p03456_case_021", "p03456_case_022", "p03456_case_023", "p03456_case_024", "p03456_case_025", "p03456_case_026", "p03456_case_027", "p03456_case_028", "p03456_case_029", "p03456_case_030", "p03456_case_031", "p03456_case_032", "p03456_case_033", "p03456_case_034", "p03456_case_035", "p03456_case_036", "p03456_case_037", "p03456_case_038", "p03456_case_039", "p03456_case_040", "p03456_case_041", "p03456_case_042", "p03456_case_043", "p03456_case_044", "p03456_case_045", "p03456_case_046", "p03456_case_047", "p03456_case_048", "p03456_case_049", "p03456_case_050", "p03456_case_051", "p03456_case_052", "p03456_case_053", "p03456_case_054", "p03456_case_055", "p03456_case_056", "p03456_case_057", "p03456_case_058", "p03456_case_059", "p03456_case_060", "p03456_case_061", "p03456_case_062", "p03456_case_063", "p03456_case_064", "p03456_case_065", "p03456_case_066", "p03456_case_067", "p03456_case_068", "p03456_case_069", "p03456_case_070", "p03456_case_071", "p03456_case_072", "p03456_case_073", "p03456_case_074", "p03456_case_075", "p03456_case_076", "p03456_case_077", "p03456_case_078", "p03456_case_079", "p03456_case_080", "p03456_case_081", "p03456_case_082", "p03456_case_083", "p03456_case_084", "p03456_case_085", "p03456_case_086", "p03456_case_087", "p03456_case_088", "p03456_case_089", "p03456_case_090", "p03456_case_091", "p03456_case_092", "p03456_case_093", "p03456_case_094", "p03456_case_095", "p03456_case_096", "p03456_case_097", "p03456_case_098", "p03456_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "a, b = list(map(str, input().split()))\nx = int(a + b)\nans = \"No\"\nfor i in range(x // 2):\n if x == i * i:\n ans = \"Yes\"\nprint(ans)\n", "fast_code_sha256": "d33570e2da12b774b6caf453907832c74235abae6b8cfc32042793a5f588b7af", "fast_id": "p03456_d33570e2da12b774b6caf453907832c74235abae6b8cfc32042793a5f588b7af", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "a, b = list(map(str, input().split()))\nx = int(a + b)\nans = \"No\"\nfor i in range(x // 2):\n if x == i * i:\n ans = \"Yes\"\nprint(ans)\n", "measured_fast_code_sha256": "d33570e2da12b774b6caf453907832c74235abae6b8cfc32042793a5f588b7af", "measured_slow_code": "import numpy as np\n\na = int(input().replace(\" \", \"\"))\nb = np.sqrt(a)\nc = b - int(b)\nif c == 0.0:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "measured_slow_code_sha256": "7917ed4392d2155273da648b2693fb0163544534d06b0c3c68db07d4c4827be4", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 189.81993403372252, "pair_id": "python_v2_f3bc93a6d7e1e4933aabe629", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03456", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03456_d33570e2da12b774b6caf453907832c74235abae6b8cfc32042793a5f588b7af.jsonl.gz", "inputs": "reproduction/python/inputs/p03456.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03456_7917ed4392d2155273da648b2693fb0163544534d06b0c3c68db07d4c4827be4.jsonl.gz"}, "slow_code": "import numpy as np\n\na = int(input().replace(\" \", \"\"))\nb = np.sqrt(a)\nc = b - int(b)\nif c == 0.0:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "slow_code_sha256": "7917ed4392d2155273da648b2693fb0163544534d06b0c3c68db07d4c4827be4", "slow_id": "p03456_7917ed4392d2155273da648b2693fb0163544534d06b0c3c68db07d4c4827be4", "speedup": 232.60246923832312, "stratum": "8+", "within_pair_jaccard": 0.2962962962962963, "workload": {"case_count": 100, "description": "Concatenate the decimal representations of positive integers a and b, in that order, and determine whether the resulting integer is a perfect square. Observed inputs: a=1..100 (median 41); b=1..100 (median 48.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 8, "median": 6.0, "min": 4}, "input_format": ["a b"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p02362_case_000", "p02362_case_001", "p02362_case_002", "p02362_case_003", "p02362_case_004", "p02362_case_005", "p02362_case_006", "p02362_case_007", "p02362_case_008", "p02362_case_009", "p02362_case_010", "p02362_case_011", "p02362_case_012", "p02362_case_013", "p02362_case_014", "p02362_case_015", "p02362_case_016", "p02362_case_017", "p02362_case_018", "p02362_case_019", "p02362_case_020", "p02362_case_021", "p02362_case_022", "p02362_case_023", "p02362_case_024", "p02362_case_025", "p02362_case_026", "p02362_case_027", "p02362_case_028", "p02362_case_029", "p02362_case_030", "p02362_case_031", "p02362_case_032", "p02362_case_033", "p02362_case_034", "p02362_case_035", "p02362_case_036", "p02362_case_037", "p02362_case_038", "p02362_case_039", "p02362_case_040", "p02362_case_041", "p02362_case_042", "p02362_case_043", "p02362_case_044", "p02362_case_045", "p02362_case_046", "p02362_case_047", "p02362_case_048", "p02362_case_049", "p02362_case_050", "p02362_case_051", "p02362_case_052", "p02362_case_053", "p02362_case_054", "p02362_case_055", "p02362_case_056", "p02362_case_057", "p02362_case_058", "p02362_case_059", "p02362_case_060", "p02362_case_061", "p02362_case_062", "p02362_case_063", "p02362_case_064", "p02362_case_065", "p02362_case_066", "p02362_case_067", "p02362_case_068", "p02362_case_069", "p02362_case_070", "p02362_case_071", "p02362_case_072", "p02362_case_073", "p02362_case_074", "p02362_case_075", "p02362_case_076", "p02362_case_077", "p02362_case_078", "p02362_case_079", "p02362_case_080", "p02362_case_081", "p02362_case_082", "p02362_case_083", "p02362_case_084", "p02362_case_085", "p02362_case_086", "p02362_case_087", "p02362_case_088", "p02362_case_089", "p02362_case_090", "p02362_case_091", "p02362_case_092", "p02362_case_093", "p02362_case_094", "p02362_case_095", "p02362_case_096", "p02362_case_097", "p02362_case_098", "p02362_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\nreadline = sys.stdin.readline\nV, E, r = list(map(int, readline().split()))\ninf = 10**10\nedges = [[] for _ in [None] * V]\nfor _ in [None] * E:\n s, t, d = list(map(int, readline().split()))\n edges[s].append((t, d))\n\n\ndef bellman_ford(n, edges, start):\n vertices = [inf] * n\n vertices[start] = 0\n reached = {start}\n for i in range(n):\n flag = 0\n for v in reached.copy():\n cost = vertices[v]\n for dist, _cost in edges[v]:\n newcost = cost + _cost\n if vertices[dist] > newcost:\n vertices[dist] = newcost\n reached.add(dist)\n flag = 1\n if flag == 0:\n return vertices\n else:\n return None\n\n\nresult = bellman_ford(V, edges, r)\nif result:\n print((\"\\n\".join([str(n) if n != inf else \"INF\" for n in result])))\nelse:\n print(\"NEGATIVE CYCLE\")\n", "fast_code_sha256": "0a4b743931f51015a53a8b68212086bf81fdde0f3ffc6ca14185f8e4075397cc", "fast_id": "p02362_0a4b743931f51015a53a8b68212086bf81fdde0f3ffc6ca14185f8e4075397cc", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\nreadline = sys.stdin.readline\nV, E, r = list(map(int, readline().split()))\ninf = 10**10\nedges = [[] for _ in [None] * V]\nfor _ in [None] * E:\n s, t, d = list(map(int, readline().split()))\n edges[s].append((t, d))\n\n\ndef bellman_ford(n, edges, start):\n vertices = [inf] * n\n vertices[start] = 0\n reached = {start}\n for i in range(n):\n flag = 0\n for v in reached.copy():\n cost = vertices[v]\n for dist, _cost in edges[v]:\n newcost = cost + _cost\n if vertices[dist] > newcost:\n vertices[dist] = newcost\n reached.add(dist)\n flag = 1\n if flag == 0:\n return vertices\n else:\n return None\n\n\nresult = bellman_ford(V, edges, r)\nif result:\n print((\"\\n\".join([str(n) if n != inf else \"INF\" for n in result])))\nelse:\n print(\"NEGATIVE CYCLE\")\n", "measured_fast_code_sha256": "0a4b743931f51015a53a8b68212086bf81fdde0f3ffc6ca14185f8e4075397cc", "measured_slow_code": "from sys import stdin\n\n\ndef sp(G, R, V):\n d = {}\n INF = float(\"inf\")\n for i in range(V):\n d[i] = INF\n d[R] = 0\n for i in range(1, V + 1):\n for (u, v) in list(G.keys()):\n if d[v] > d[u] + G[u, v]:\n d[v] = d[u] + G[u, v]\n if i == V:\n print(\"NEGATIVE CYCLE\")\n quit()\n return d\n\n\nV, E, R = [int(x) for x in stdin.readline().split()]\nG = {}\nfor case in range(E):\n s, t, w = [int(x) for x in stdin.readline().split()]\n G[(s, t)] = w\nd = sp(G, R, V)\nfor k in range(V):\n if d[k] == float(\"inf\"):\n print(\"INF\")\n else:\n print((d[k]))\n", "measured_slow_code_sha256": "cf895780ce22ae52a2f15a4858c8f0e2e1ed71360cb9cc257b90994b1f2cf6f6", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.7667683201598072, "pair_id": "python_v2_72381a86cd095c2b83567b14", "per_case_slow_code_faster_fraction": 0.22, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02362", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02362_0a4b743931f51015a53a8b68212086bf81fdde0f3ffc6ca14185f8e4075397cc.jsonl.gz", "inputs": "reproduction/python/inputs/p02362.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02362_cf895780ce22ae52a2f15a4858c8f0e2e1ed71360cb9cc257b90994b1f2cf6f6.jsonl.gz"}, "slow_code": "from sys import stdin\n\n\ndef sp(G, R, V):\n d = {}\n INF = float(\"inf\")\n for i in range(V):\n d[i] = INF\n d[R] = 0\n for i in range(1, V + 1):\n for u, v in list(G.keys()):\n if d[v] > d[u] + G[u, v]:\n d[v] = d[u] + G[u, v]\n if i == V:\n print(\"NEGATIVE CYCLE\")\n quit()\n return d\n\n\nV, E, R = [int(x) for x in stdin.readline().split()]\nG = {}\nfor case in range(E):\n s, t, w = [int(x) for x in stdin.readline().split()]\n G[(s, t)] = w\nd = sp(G, R, V)\nfor k in range(V):\n if d[k] == float(\"inf\"):\n print(\"INF\")\n else:\n print((d[k]))\n", "slow_code_sha256": "9b5601c779f73d6d45abde45eb2d873812e07c3baf1e64c12895d6c629797e2a", "slow_id": "p02362_cf895780ce22ae52a2f15a4858c8f0e2e1ed71360cb9cc257b90994b1f2cf6f6", "speedup": 3.3597515528433983, "stratum": "2-4", "within_pair_jaccard": 0.45161290322580644, "workload": {"case_count": 100, "description": "For a directed graph with signed edge weights, output NEGATIVE CYCLE if a negative cycle is reachable from source r. Otherwise output shortest-path costs from r, using INF for unreachable vertices. IDs are 0..V-1; no self-loops or parallel directed edges. Observed inputs: V=1..1000 (median 50); E=0..2000 (median 50); r=0..999; d_i=-10000..10000; negative_edges=0..1041 (median 25).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 26410, "median": 573.0, "min": 6}, "input_format": ["V E r\ns_1 t_1 d_1\n...\ns_E t_E d_E"], "input_format_status": "source_input_section", "input_lines": {"max": 2001, "median": 51.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 6003, "median": 153.0, "min": 3}}} -{"case_ids": ["p03035_case_000", "p03035_case_001", "p03035_case_002", "p03035_case_003", "p03035_case_004", "p03035_case_005", "p03035_case_006", "p03035_case_007", "p03035_case_008", "p03035_case_009", "p03035_case_010", "p03035_case_011", "p03035_case_012", "p03035_case_013", "p03035_case_014", "p03035_case_015", "p03035_case_016", "p03035_case_017", "p03035_case_018", "p03035_case_019", "p03035_case_020", "p03035_case_021", "p03035_case_022", "p03035_case_023", "p03035_case_024", "p03035_case_025", "p03035_case_026", "p03035_case_027", "p03035_case_028", "p03035_case_029", "p03035_case_030", "p03035_case_031", "p03035_case_032", "p03035_case_033", "p03035_case_034", "p03035_case_035", "p03035_case_036", "p03035_case_037", "p03035_case_038", "p03035_case_039", "p03035_case_040", "p03035_case_041", "p03035_case_042", "p03035_case_043", "p03035_case_044", "p03035_case_045", "p03035_case_046", "p03035_case_047", "p03035_case_048", "p03035_case_049", "p03035_case_050", "p03035_case_051", "p03035_case_052", "p03035_case_053", "p03035_case_054", "p03035_case_055", "p03035_case_056", "p03035_case_057", "p03035_case_058", "p03035_case_059", "p03035_case_060", "p03035_case_061", "p03035_case_062", "p03035_case_063", "p03035_case_064", "p03035_case_065", "p03035_case_066", "p03035_case_067", "p03035_case_068", "p03035_case_069", "p03035_case_070", "p03035_case_071", "p03035_case_072", "p03035_case_073", "p03035_case_074", "p03035_case_075", "p03035_case_076", "p03035_case_077", "p03035_case_078", "p03035_case_079", "p03035_case_080", "p03035_case_081", "p03035_case_082", "p03035_case_083", "p03035_case_084", "p03035_case_085", "p03035_case_086", "p03035_case_087", "p03035_case_088", "p03035_case_089", "p03035_case_090", "p03035_case_091", "p03035_case_092", "p03035_case_093", "p03035_case_094", "p03035_case_095", "p03035_case_096", "p03035_case_097", "p03035_case_098", "p03035_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "A, B = list(map(int, input().split()))\nif A >= 13:\n print(B)\nelif A >= 6:\n print((B // 2))\nelse:\n print((0))\n", "fast_code_sha256": "e4d401fef582a21621aa992fac92c31df8b8afa5c6fe72c771bb106e11d529fe", "fast_id": "p03035_e4d401fef582a21621aa992fac92c31df8b8afa5c6fe72c771bb106e11d529fe", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "A, B = list(map(int, input().split()))\nif A >= 13:\n print(B)\nelif A >= 6:\n print((B // 2))\nelse:\n print((0))\n", "measured_fast_code_sha256": "e4d401fef582a21621aa992fac92c31df8b8afa5c6fe72c771bb106e11d529fe", "measured_slow_code": "import sys, math, collections, heapq, itertools\n\nF = sys.stdin\n\n\ndef single_input():\n return F.readline().strip(\"\\n\")\n\n\ndef line_input():\n return F.readline().strip(\"\\n\").split()\n\n\ndef gcd(a, b):\n a, b = max(a, b), min(a, b)\n while a % b > 0:\n a, b = b, a % b\n return b\n\n\ndef solve():\n A, B = list(map(int, line_input()))\n if A >= 13:\n print(B)\n elif A >= 6:\n print((B // 2))\n else:\n print((0))\n return 0\n\n\nif __name__ == \"__main__\":\n solve()\n", "measured_slow_code_sha256": "a03feaf840d71ae8aa582d21d70bb7cc8063992d1b30834ae4cabc43c65fc6f6", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.0058255819742996, "pair_id": "python_v2_e9987da04e39791fc9f42b9b", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03035", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03035_e4d401fef582a21621aa992fac92c31df8b8afa5c6fe72c771bb106e11d529fe.jsonl.gz", "inputs": "reproduction/python/inputs/p03035.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03035_a03feaf840d71ae8aa582d21d70bb7cc8063992d1b30834ae4cabc43c65fc6f6.jsonl.gz"}, "slow_code": "import sys, math, collections, heapq, itertools\n\nF = sys.stdin\n\n\ndef single_input():\n return F.readline().strip(\"\\n\")\n\n\ndef line_input():\n return F.readline().strip(\"\\n\").split()\n\n\ndef gcd(a, b):\n a, b = max(a, b), min(a, b)\n while a % b > 0:\n a, b = b, a % b\n return b\n\n\ndef solve():\n A, B = list(map(int, line_input()))\n if A >= 13:\n print(B)\n elif A >= 6:\n print((B // 2))\n else:\n print((0))\n return 0\n\n\nif __name__ == \"__main__\":\n solve()\n", "slow_code_sha256": "a03feaf840d71ae8aa582d21d70bb7cc8063992d1b30834ae4cabc43c65fc6f6", "slow_id": "p03035_a03feaf840d71ae8aa582d21d70bb7cc8063992d1b30834ae4cabc43c65fc6f6", "speedup": 3.0039802440796293, "stratum": "2-4", "within_pair_jaccard": 0.34210526315789475, "workload": {"case_count": 100, "description": "Find a ticket price for age A: full even price B at age >=13, half price at ages 6..12, and free at ages 0..5. Observed inputs: A=0..100 (median 21); B=2..1000 (median 183).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 9, "median": 6.0, "min": 4}, "input_format": ["A B"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p02675_case_000", "p02675_case_001", "p02675_case_002", "p02675_case_003", "p02675_case_004", "p02675_case_005", "p02675_case_006", "p02675_case_007", "p02675_case_008", "p02675_case_009", "p02675_case_010", "p02675_case_011", "p02675_case_012", "p02675_case_013", "p02675_case_014", "p02675_case_015", "p02675_case_016", "p02675_case_017", "p02675_case_018", "p02675_case_019", "p02675_case_020", "p02675_case_021", "p02675_case_022", "p02675_case_023", "p02675_case_024", "p02675_case_025", "p02675_case_026", "p02675_case_027", "p02675_case_028", "p02675_case_029", "p02675_case_030", "p02675_case_031", "p02675_case_032", "p02675_case_033", "p02675_case_034", "p02675_case_035", "p02675_case_036", "p02675_case_037", "p02675_case_038", "p02675_case_039", "p02675_case_040", "p02675_case_041", "p02675_case_042", "p02675_case_043", "p02675_case_044", "p02675_case_045", "p02675_case_046", "p02675_case_047", "p02675_case_048", "p02675_case_049", "p02675_case_050", "p02675_case_051", "p02675_case_052", "p02675_case_053", "p02675_case_054", "p02675_case_055", "p02675_case_056", "p02675_case_057", "p02675_case_058", "p02675_case_059", "p02675_case_060", "p02675_case_061", "p02675_case_062", "p02675_case_063", "p02675_case_064", "p02675_case_065", "p02675_case_066", "p02675_case_067", "p02675_case_068", "p02675_case_069", "p02675_case_070", "p02675_case_071", "p02675_case_072", "p02675_case_073", "p02675_case_074", "p02675_case_075", "p02675_case_076", "p02675_case_077", "p02675_case_078", "p02675_case_079", "p02675_case_080", "p02675_case_081", "p02675_case_082", "p02675_case_083", "p02675_case_084", "p02675_case_085", "p02675_case_086", "p02675_case_087", "p02675_case_088", "p02675_case_089", "p02675_case_090", "p02675_case_091", "p02675_case_092", "p02675_case_093", "p02675_case_094", "p02675_case_095", "p02675_case_096", "p02675_case_097", "p02675_case_098", "p02675_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\nn = n % 10\nif n in (2, 4, 5, 7, 9):\n yomi = \"hon\"\nif n in (0, 1, 6, 8):\n yomi = \"pon\"\nif n == 3:\n yomi = \"bon\"\nprint(yomi)\n", "fast_code_sha256": "892b4d0aacbf5de49ae7067af539aae6d846f8cdf28dfcc12f0bc80d88944e7b", "fast_id": "p02675_892b4d0aacbf5de49ae7067af539aae6d846f8cdf28dfcc12f0bc80d88944e7b", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\nn = n % 10\nif n in (2, 4, 5, 7, 9):\n yomi = \"hon\"\nif n in (0, 1, 6, 8):\n yomi = \"pon\"\nif n == 3:\n yomi = \"bon\"\nprint(yomi)\n", "measured_fast_code_sha256": "892b4d0aacbf5de49ae7067af539aae6d846f8cdf28dfcc12f0bc80d88944e7b", "measured_slow_code": "# coding: utf-8\nimport sys\nimport math\nimport collections\nimport itertools\nimport bisect\n\nINF = 10**13\nMOD = 10**9 + 7\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef gcd(x, y):\n return x if y == 0 else gcd(y, x % y)\n\n\ndef lcm(x, y):\n return (x * y) // gcd(x, y)\n\n\ndef I():\n return int(input())\n\n\ndef LI():\n return [int(x) for x in input().split()]\n\n\ndef RI(N):\n return [int(input()) for _ in range(N)]\n\n\ndef LRI(N):\n return [[int(x) for x in input().split()] for _ in range(N)]\n\n\ndef LS():\n return input().split()\n\n\ndef RS(N):\n return [input() for _ in range(N)]\n\n\ndef LRS(N):\n return [input().split() for _ in range(N)]\n\n\ndef PL(L):\n print(*L, sep=\"\\n\")\n\n\ndef YesNo(B):\n print(\"Yes\" if B else \"No\")\n\n\ndef YESNO(B):\n print(\"YES\" if B else \"NO\")\n\n\nN = input()\nn = int(N[-1])\nif n in [2, 4, 5, 7, 9]:\n print(\"hon\")\nelif n in [0, 1, 6, 8]:\n print(\"pon\")\nelse:\n print(\"bon\")\n", "measured_slow_code_sha256": "2d3c735c213ec81bc8c26091e19ebd8461e366cff4fed305d8b06c8c2e49be9d", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 5.042110065422422, "pair_id": "python_v2_dbb78f6f3817ddfb99250da4", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02675", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02675_892b4d0aacbf5de49ae7067af539aae6d846f8cdf28dfcc12f0bc80d88944e7b.jsonl.gz", "inputs": "reproduction/python/inputs/p02675.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02675_2d3c735c213ec81bc8c26091e19ebd8461e366cff4fed305d8b06c8c2e49be9d.jsonl.gz"}, "slow_code": "import sys\nimport math\nimport collections\nimport itertools\nimport bisect\n\nINF = 10**13\nMOD = 10**9 + 7\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef gcd(x, y):\n return x if y == 0 else gcd(y, x % y)\n\n\ndef lcm(x, y):\n return (x * y) // gcd(x, y)\n\n\ndef I():\n return int(input())\n\n\ndef LI():\n return [int(x) for x in input().split()]\n\n\ndef RI(N):\n return [int(input()) for _ in range(N)]\n\n\ndef LRI(N):\n return [[int(x) for x in input().split()] for _ in range(N)]\n\n\ndef LS():\n return input().split()\n\n\ndef RS(N):\n return [input() for _ in range(N)]\n\n\ndef LRS(N):\n return [input().split() for _ in range(N)]\n\n\ndef PL(L):\n print(*L, sep=\"\\n\")\n\n\ndef YesNo(B):\n print(\"Yes\" if B else \"No\")\n\n\ndef YESNO(B):\n print(\"YES\" if B else \"NO\")\n\n\nN = input()\nn = int(N[-1])\nif n in [2, 4, 5, 7, 9]:\n print(\"hon\")\nelif n in [0, 1, 6, 8]:\n print(\"pon\")\nelse:\n print(\"bon\")\n", "slow_code_sha256": "da5a21f4ebfb4d44ad88c7f5db5f559a60e0742e11d07068514eea6e5e1d7a49", "slow_id": "p02675_2d3c735c213ec81bc8c26091e19ebd8461e366cff4fed305d8b06c8c2e49be9d", "speedup": 5.042545565186544, "stratum": "4-8", "within_pair_jaccard": 0.296875, "workload": {"case_count": 100, "description": "Output a counter pronunciation determined by the last decimal digit of N: hon for 2,4,5,7,9; pon for 0,1,6,8; bon for 3. Observed inputs: N=1..999 (median 404).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 4, "median": 4.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p03207_case_000", "p03207_case_001", "p03207_case_002", "p03207_case_003", "p03207_case_004", "p03207_case_005", "p03207_case_006", "p03207_case_007", "p03207_case_008", "p03207_case_009", "p03207_case_010", "p03207_case_011", "p03207_case_012", "p03207_case_013", "p03207_case_014", "p03207_case_015", "p03207_case_016", "p03207_case_017", "p03207_case_018", "p03207_case_019", "p03207_case_020", "p03207_case_021", "p03207_case_022", "p03207_case_023", "p03207_case_024", "p03207_case_025", "p03207_case_026", "p03207_case_027", "p03207_case_028", "p03207_case_029", "p03207_case_030", "p03207_case_031", "p03207_case_032", "p03207_case_033", "p03207_case_034", "p03207_case_035", "p03207_case_036", "p03207_case_037", "p03207_case_038", "p03207_case_039", "p03207_case_040", "p03207_case_041", "p03207_case_042", "p03207_case_043", "p03207_case_044", "p03207_case_045", "p03207_case_046", "p03207_case_047", "p03207_case_048", "p03207_case_049", "p03207_case_050", "p03207_case_051", "p03207_case_052", "p03207_case_053", "p03207_case_054", "p03207_case_055", "p03207_case_056", "p03207_case_057", "p03207_case_058", "p03207_case_059", "p03207_case_060", "p03207_case_061", "p03207_case_062", "p03207_case_063", "p03207_case_064", "p03207_case_065", "p03207_case_066", "p03207_case_067", "p03207_case_068", "p03207_case_069", "p03207_case_070", "p03207_case_071", "p03207_case_072", "p03207_case_073", "p03207_case_074", "p03207_case_075", "p03207_case_076", "p03207_case_077", "p03207_case_078", "p03207_case_079", "p03207_case_080", "p03207_case_081", "p03207_case_082", "p03207_case_083", "p03207_case_084", "p03207_case_085", "p03207_case_086", "p03207_case_087", "p03207_case_088", "p03207_case_089", "p03207_case_090", "p03207_case_091", "p03207_case_092", "p03207_case_093", "p03207_case_094", "p03207_case_095", "p03207_case_096", "p03207_case_097", "p03207_case_098", "p03207_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "p = [int(eval(input())) for _ in range(int(eval(input())))]\nprint((sum(p) - max(p) // 2))\n", "fast_code_sha256": "3ed28d55a7079cf59eceb104d497c6508ff4ffe2ab644335d4815452e0859cb6", "fast_id": "p03207_ff27697caf45060293346aa8bb8cbf60f04a0b44f07980bdc00ed3a88646bd41", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "# coding: utf-8\np = [int(eval(input())) for _ in range(int(eval(input())))]\nprint((sum(p) - max(p) // 2))\n", "measured_fast_code_sha256": "ff27697caf45060293346aa8bb8cbf60f04a0b44f07980bdc00ed3a88646bd41", "measured_slow_code": "#!/usr/bin/env python3\n# encoding:utf-8\nimport copy\nimport random\nimport bisect # bisect_left これで二部探索の大小検索が行える\nimport fractions # 最小公倍数などはこっち\nimport math\nimport sys\nimport collections\nfrom decimal import Decimal # 10進数で考慮できる\n\nmod = 10**9 + 7\nsys.setrecursionlimit(mod) # 再帰回数上限はでdefault1000\nd = collections.deque()\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\nN = int(eval(input()))\np = [0 for i in range(N)]\nfor i in range(N):\n p[i] = int(eval(input()))\np.sort()\nans = sum(p)\nans -= p[-1] // 2\nprint(ans)\n", "measured_slow_code_sha256": "5cb7a4c7cf0d8a71a4fd49887b2da818d3766f3e397b1d44bc46374144eeebdc", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 27.448192938955337, "pair_id": "python_v2_73e6c81397bce6adb87acdc7", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03207", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03207_ff27697caf45060293346aa8bb8cbf60f04a0b44f07980bdc00ed3a88646bd41.jsonl.gz", "inputs": "reproduction/python/inputs/p03207.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03207_5cb7a4c7cf0d8a71a4fd49887b2da818d3766f3e397b1d44bc46374144eeebdc.jsonl.gz"}, "slow_code": "import copy\nimport random\nimport bisect\nimport fractions\nimport math\nimport sys\nimport collections\nfrom decimal import Decimal\n\nmod = 10**9 + 7\nsys.setrecursionlimit(mod)\nd = collections.deque()\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\nN = int(eval(input()))\np = [0 for i in range(N)]\nfor i in range(N):\n p[i] = int(eval(input()))\np.sort()\nans = sum(p)\nans -= p[-1] // 2\nprint(ans)\n", "slow_code_sha256": "fe2f7e4c4fa4bf811a1052a7e9a8cc8bf127a2538fd41f3ded0df182a9217e19", "slow_id": "p03207_5cb7a4c7cf0d8a71a4fd49887b2da818d3766f3e397b1d44bc46374144eeebdc", "speedup": 27.53819350943817, "stratum": "8+", "within_pair_jaccard": 0.20930232558139536, "workload": {"case_count": 100, "description": "Buy all N items, using one coupon to halve the price of one highest-priced item. Other items retain full price; every p_i is even. Output total payment. Observed inputs: N=2..10 (median 5); p_i=100..10000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 63, "median": 24.0, "min": 10}, "input_format": ["N\np_1\n...\np_N"], "input_format_status": "source_input_section", "input_lines": {"max": 11, "median": 6.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 11, "median": 6.0, "min": 3}}} -{"case_ids": ["p02630_case_000", "p02630_case_001", "p02630_case_002", "p02630_case_003", "p02630_case_004", "p02630_case_005", "p02630_case_006", "p02630_case_007", "p02630_case_008", "p02630_case_009", "p02630_case_010", "p02630_case_011", "p02630_case_012", "p02630_case_013", "p02630_case_014", "p02630_case_015", "p02630_case_016", "p02630_case_017", "p02630_case_018", "p02630_case_019", "p02630_case_020", "p02630_case_021", "p02630_case_022", "p02630_case_023", "p02630_case_024", "p02630_case_025", "p02630_case_026", "p02630_case_027", "p02630_case_028", "p02630_case_029", "p02630_case_030", "p02630_case_031", "p02630_case_032", "p02630_case_033", "p02630_case_034", "p02630_case_035", "p02630_case_036", "p02630_case_037", "p02630_case_038", "p02630_case_039", "p02630_case_040", "p02630_case_041", "p02630_case_042", "p02630_case_043", "p02630_case_044", "p02630_case_045", "p02630_case_046", "p02630_case_047", "p02630_case_048", "p02630_case_049", "p02630_case_050", "p02630_case_051", "p02630_case_052", "p02630_case_053", "p02630_case_054", "p02630_case_055", "p02630_case_056", "p02630_case_057", "p02630_case_058", "p02630_case_059", "p02630_case_060", "p02630_case_061", "p02630_case_062", "p02630_case_063", "p02630_case_064", "p02630_case_065", "p02630_case_066", "p02630_case_067", "p02630_case_068", "p02630_case_069", "p02630_case_070", "p02630_case_071", "p02630_case_072", "p02630_case_073", "p02630_case_074", "p02630_case_075", "p02630_case_076", "p02630_case_077", "p02630_case_078", "p02630_case_079", "p02630_case_080", "p02630_case_081", "p02630_case_082", "p02630_case_083", "p02630_case_084", "p02630_case_085", "p02630_case_086", "p02630_case_087", "p02630_case_088", "p02630_case_089", "p02630_case_090", "p02630_case_091", "p02630_case_092", "p02630_case_093", "p02630_case_094", "p02630_case_095", "p02630_case_096", "p02630_case_097", "p02630_case_098", "p02630_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "f = lambda: [*list(map(int, input().split()))]\nf()\ns, *l = [0] * 100002\nfor i in f():\n s += i\n l[i] += 1\nq = f()[0]\nfor _ in range(q):\n b, c = f()\n s += (c - b) * l[b]\n l[c] += l[b]\n l[b] = 0\n print(s)\n", "fast_code_sha256": "3bce503f6b8695268fd512fc07a38f5d662ae8dccea348f827c6f3a4e18f9e66", "fast_id": "p02630_3bce503f6b8695268fd512fc07a38f5d662ae8dccea348f827c6f3a4e18f9e66", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "f = lambda: [*list(map(int, input().split()))]\nf()\ns, *l = [0] * 100002\nfor i in f():\n s += i\n l[i] += 1\nq = f()[0]\nfor _ in range(q):\n b, c = f()\n s += (c - b) * l[b]\n l[c] += l[b]\n l[b] = 0\n print(s)\n", "measured_fast_code_sha256": "3bce503f6b8695268fd512fc07a38f5d662ae8dccea348f827c6f3a4e18f9e66", "measured_slow_code": "n = int(eval(input())) + 1\na = list(map(int, input().split()))\ncnt = []\nfor i in range(100005):\n cnt.append(0)\nsum = 0\nfor i in a:\n cnt[i] += 1\nfor i in range(100005):\n sum += i * cnt[i]\nq = int(eval(input()))\nfor i in range(q):\n b, c = list(map(int, input().split()))\n sum += (c - b) * cnt[b]\n cnt[c] += cnt[b]\n cnt[b] = 0\n print(sum)\n", "measured_slow_code_sha256": "5f16fa015b9027974d1bc0a72842ba1bfda9af773dccce5a9d289b37ed6ecba4", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.9434276970203053, "pair_id": "python_v2_329e5a08951a8fa105552c43", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02630", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02630_3bce503f6b8695268fd512fc07a38f5d662ae8dccea348f827c6f3a4e18f9e66.jsonl.gz", "inputs": "reproduction/python/inputs/p02630.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02630_5f16fa015b9027974d1bc0a72842ba1bfda9af773dccce5a9d289b37ed6ecba4.jsonl.gz"}, "slow_code": "n = int(eval(input())) + 1\na = list(map(int, input().split()))\ncnt = []\nfor i in range(100005):\n cnt.append(0)\nsum = 0\nfor i in a:\n cnt[i] += 1\nfor i in range(100005):\n sum += i * cnt[i]\nq = int(eval(input()))\nfor i in range(q):\n b, c = list(map(int, input().split()))\n sum += (c - b) * cnt[b]\n cnt[c] += cnt[b]\n cnt[b] = 0\n print(sum)\n", "slow_code_sha256": "5f16fa015b9027974d1bc0a72842ba1bfda9af773dccce5a9d289b37ed6ecba4", "slow_id": "p02630_5f16fa015b9027974d1bc0a72842ba1bfda9af773dccce5a9d289b37ed6ecba4", "speedup": 6.322958217846825, "stratum": "4-8", "within_pair_jaccard": 0.5357142857142857, "workload": {"case_count": 100, "description": "Process Q updates in order on an integer array: replace every current occurrence of B_i with C_i, where B_i!=C_i. After each update, output the sum of all array entries. Observed inputs: N=1..100000 (median 1000); Q=1..100000 (median 1000); A_i=1..100000; B_i=1..100000; C_i=1..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 2000014, "median": 176600.5, "min": 10}, "input_format": ["N\nA_1 ... A_N\nQ\nB_1 C_1\n...\nB_Q C_Q"], "input_format_status": "source_input_section", "input_lines": {"max": 100003, "median": 1003.0, "min": 4}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 300002, "median": 30002.0, "min": 5}}} -{"case_ids": ["p00775_case_000", "p00775_case_001", "p00775_case_002", "p00775_case_003", "p00775_case_004", "p00775_case_005", "p00775_case_006", "p00775_case_007", "p00775_case_008", "p00775_case_009", "p00775_case_010", "p00775_case_011", "p00775_case_012", "p00775_case_013", "p00775_case_014", "p00775_case_015", "p00775_case_016", "p00775_case_017", "p00775_case_018", "p00775_case_019", "p00775_case_020", "p00775_case_021", "p00775_case_022", "p00775_case_023", "p00775_case_024", "p00775_case_025", "p00775_case_026", "p00775_case_027", "p00775_case_028", "p00775_case_029", "p00775_case_030", "p00775_case_031", "p00775_case_032", "p00775_case_033", "p00775_case_034", "p00775_case_035", "p00775_case_036", "p00775_case_037", "p00775_case_038", "p00775_case_039", "p00775_case_040", "p00775_case_041", "p00775_case_042", "p00775_case_043", "p00775_case_044", "p00775_case_045", "p00775_case_046", "p00775_case_047", "p00775_case_048", "p00775_case_049", "p00775_case_050", "p00775_case_051", "p00775_case_052", "p00775_case_053", "p00775_case_054", "p00775_case_055", "p00775_case_056", "p00775_case_057", "p00775_case_058", "p00775_case_059", "p00775_case_060", "p00775_case_061", "p00775_case_062", "p00775_case_063", "p00775_case_064", "p00775_case_065", "p00775_case_066", "p00775_case_067", "p00775_case_068", "p00775_case_069", "p00775_case_070", "p00775_case_071", "p00775_case_072", "p00775_case_073", "p00775_case_074", "p00775_case_075", "p00775_case_076", "p00775_case_077", "p00775_case_078", "p00775_case_079", "p00775_case_080", "p00775_case_081", "p00775_case_082", "p00775_case_083", "p00775_case_084", "p00775_case_085", "p00775_case_086", "p00775_case_087", "p00775_case_088", "p00775_case_089", "p00775_case_090", "p00775_case_091", "p00775_case_092", "p00775_case_093", "p00775_case_094", "p00775_case_095", "p00775_case_096", "p00775_case_097", "p00775_case_098", "p00775_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "while True:\n R, N = list(map(int, input().split()))\n if not (R | N):\n break\n geta = 20\n buildings = [0] * (geta * 2)\n for _ in range(N):\n xl, xr, h = list(map(int, input().split()))\n for i in range(xl + geta, xr + geta):\n buildings[i] = max(buildings[i], h)\n print(\n (\n min(\n buildings[i] - pow(R**2 - (i - geta + (i < geta)) ** 2, 0.5) + R\n for i in range(-R + geta, R + geta)\n )\n )\n )\n", "fast_code_sha256": "5b650f0d9d560aa2ddc06d1551889bb58d9768a548461d3a84fc82e94f0e3d66", "fast_id": "p00775_5b650f0d9d560aa2ddc06d1551889bb58d9768a548461d3a84fc82e94f0e3d66", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "while True:\n R, N = list(map(int, input().split()))\n if not (R | N):\n break\n geta = 20\n buildings = [0] * (geta * 2)\n for _ in range(N):\n xl, xr, h = list(map(int, input().split()))\n for i in range(xl + geta, xr + geta):\n buildings[i] = max(buildings[i], h)\n print(\n (\n min(\n buildings[i] - pow(R**2 - (i - geta + (i < geta)) ** 2, 0.5) + R\n for i in range(-R + geta, R + geta)\n )\n )\n )\n", "measured_fast_code_sha256": "5b650f0d9d560aa2ddc06d1551889bb58d9768a548461d3a84fc82e94f0e3d66", "measured_slow_code": "while True:\n R, N = list(map(int, input().split()))\n if not (R | N):\n break\n geta = 20\n buildings = [0] * (geta * 2)\n for _ in range(N):\n xl, xr, h = list(map(int, input().split()))\n for i in range(xl + geta, xr + geta):\n buildings[i] = max(buildings[i], h)\n sun = [0] * (geta * 2)\n for i in range(-R + geta, R + geta):\n if i < geta:\n buildings[i] -= pow(R * R - (i - geta + 1) * (i - geta + 1), 0.5) - R\n else:\n buildings[i] -= pow(R * R - (i - geta) * (i - geta), 0.5) - R\n left, right = 0, 20\n while right - left > 1e-4:\n mid = (left + right) / 2\n flag = True\n for i in range(-R + geta, R + geta):\n if i < geta:\n flag &= buildings[i] >= mid\n else:\n y = pow(R * R - (i - geta) * (i - geta), 0.5)\n flag &= buildings[i] >= mid\n if flag:\n left = mid\n else:\n right = mid\n print((\"{:.20f}\".format(left)))\n", "measured_slow_code_sha256": "8e02c59ca5af7184abc0b41186c69b5afed95dc9f0416b5d3e79c7e06f9ac494", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.616740260647604, "pair_id": "python_v2_8bde07c9a0297a95f83b969d", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p00775", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p00775_5b650f0d9d560aa2ddc06d1551889bb58d9768a548461d3a84fc82e94f0e3d66.jsonl.gz", "inputs": "reproduction/python/inputs/p00775.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p00775_8e02c59ca5af7184abc0b41186c69b5afed95dc9f0416b5d3e79c7e06f9ac494.jsonl.gz"}, "slow_code": "while True:\n R, N = list(map(int, input().split()))\n if not (R | N):\n break\n geta = 20\n buildings = [0] * (geta * 2)\n for _ in range(N):\n xl, xr, h = list(map(int, input().split()))\n for i in range(xl + geta, xr + geta):\n buildings[i] = max(buildings[i], h)\n sun = [0] * (geta * 2)\n for i in range(-R + geta, R + geta):\n if i < geta:\n buildings[i] -= pow(R * R - (i - geta + 1) * (i - geta + 1), 0.5) - R\n else:\n buildings[i] -= pow(R * R - (i - geta) * (i - geta), 0.5) - R\n left, right = 0, 20\n while right - left > 1e-4:\n mid = (left + right) / 2\n flag = True\n for i in range(-R + geta, R + geta):\n if i < geta:\n flag &= buildings[i] >= mid\n else:\n y = pow(R * R - (i - geta) * (i - geta), 0.5)\n flag &= buildings[i] >= mid\n if flag:\n left = mid\n else:\n right = mid\n print((\"{:.20f}\".format(left)))\n", "slow_code_sha256": "8e02c59ca5af7184abc0b41186c69b5afed95dc9f0416b5d3e79c7e06f9ac494", "slow_id": "p00775_8e02c59ca5af7184abc0b41186c69b5afed95dc9f0416b5d3e79c7e06f9ac494", "speedup": 2.7229214042930723, "stratum": "2-4", "within_pair_jaccard": 0.6904761904761905, "workload": {"case_count": 100, "description": "For each dataset, find the last t>=0 when the radius-r disk centered at (0,t-r) is entirely covered by n building rectangles [xl_i,xr_i]x[0,h_i] together with y<=0. Rectangles may overlap or touch. A final 0 0 ends input. Observed inputs: datasets=1..5 (median 1); r=1..20; n=0..20; total_rectangles=0..92 (median 16.5); xl_i=-20..19; xr_i=-19..20; h_i=1..20.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 806, "median": 156.5, "min": 8}, "input_format": ["r_1 n_1\n[n_1 lines: xl_i xr_i h_i]\n[next datasets]\n0 0"], "input_format_status": "source_input_section", "input_lines": {"max": 98, "median": 20.5, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 288, "median": 56.0, "min": 4}}} -{"case_ids": ["p03298_case_000", "p03298_case_001", "p03298_case_002", "p03298_case_003", "p03298_case_004", "p03298_case_005", "p03298_case_006", "p03298_case_007", "p03298_case_008", "p03298_case_009", "p03298_case_010", "p03298_case_011", "p03298_case_012", "p03298_case_013", "p03298_case_014", "p03298_case_015", "p03298_case_016", "p03298_case_017", "p03298_case_018", "p03298_case_019", "p03298_case_020", "p03298_case_021", "p03298_case_022", "p03298_case_023", "p03298_case_024", "p03298_case_025", "p03298_case_026", "p03298_case_027", "p03298_case_028", "p03298_case_029", "p03298_case_030", "p03298_case_031", "p03298_case_032", "p03298_case_033", "p03298_case_034", "p03298_case_035", "p03298_case_036", "p03298_case_037", "p03298_case_038", "p03298_case_039", "p03298_case_040", "p03298_case_041", "p03298_case_042", "p03298_case_043", "p03298_case_044", "p03298_case_045", "p03298_case_046", "p03298_case_047", "p03298_case_048", "p03298_case_049", "p03298_case_050", "p03298_case_051", "p03298_case_052", "p03298_case_053", "p03298_case_054", "p03298_case_055", "p03298_case_056", "p03298_case_057", "p03298_case_058", "p03298_case_059", "p03298_case_060", "p03298_case_061", "p03298_case_062", "p03298_case_063", "p03298_case_064", "p03298_case_065", "p03298_case_066", "p03298_case_067", "p03298_case_068", "p03298_case_069", "p03298_case_070", "p03298_case_071", "p03298_case_072", "p03298_case_073", "p03298_case_074", "p03298_case_075", "p03298_case_076", "p03298_case_077", "p03298_case_078", "p03298_case_081", "p03298_case_082", "p03298_case_083", "p03298_case_084", "p03298_case_085", "p03298_case_086", "p03298_case_087", "p03298_case_088", "p03298_case_089", "p03298_case_090", "p03298_case_091", "p03298_case_092", "p03298_case_093", "p03298_case_094", "p03298_case_095", "p03298_case_096", "p03298_case_097", "p03298_case_098", "p03298_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 98, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from collections import defaultdict, deque\nfrom heapq import heappush, heappop\nimport sys\nimport math\nimport bisect\nimport random\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LS():\n return [list(x) for x in sys.stdin.readline().split()]\n\n\ndef S():\n res = list(sys.stdin.readline())\n if res[-1] == \"\\n\":\n return res[:-1]\n return res\n\n\ndef IR(n):\n return [I() for i in range(n)]\n\n\ndef LIR(n):\n return [LI() for i in range(n)]\n\n\ndef SR(n):\n return [S() for i in range(n)]\n\n\ndef LSR(n):\n return [LS() for i in range(n)]\n\n\nsys.setrecursionlimit(1000000)\nmod = 1000000007\n\n\ndef A():\n return\n\n\ndef B():\n return\n\n\ndef C():\n n = I()\n s = S()\n for i in range(2 * n):\n s[i] = ord(s[i]) - 96\n k = 27\n m = 1 << n\n p = [1 << j for j in range(n)]\n d = defaultdict(lambda: 0)\n l = [(0, 0)]\n for i in s[:n][::-1]:\n l = [(x[0] * k + i, x[1]) for x in l] + [(x[0], x[1] * k + i) for x in l]\n for i in l:\n d[i] += 1\n ans = 0\n l = [(0, 0)]\n for i in s[n:]:\n l = [(x[0] * k + i, x[1]) for x in l] + [(x[0], x[1] * k + i) for x in l]\n for i in l:\n ans += d[i]\n print(ans)\n return\n\n\ndef D():\n return\n\n\ndef E():\n return\n\n\ndef F():\n return\n\n\nif __name__ == \"__main__\":\n C()\n", "fast_code_sha256": "051dd963702238662fe96a84ebc1ca74f3c157f8cf8eec6769e928924a370a63", "fast_id": "p03298_822b320890b4640a82e0d7980e120614b4f10c9398150508b25e66c5600d4e83", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "#!usr/bin/env python3\nfrom collections import defaultdict, deque\nfrom heapq import heappush, heappop\nimport sys\nimport math\nimport bisect\nimport random\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LS():\n return [list(x) for x in sys.stdin.readline().split()]\n\n\ndef S():\n res = list(sys.stdin.readline())\n if res[-1] == \"\\n\":\n return res[:-1]\n return res\n\n\ndef IR(n):\n return [I() for i in range(n)]\n\n\ndef LIR(n):\n return [LI() for i in range(n)]\n\n\ndef SR(n):\n return [S() for i in range(n)]\n\n\ndef LSR(n):\n return [LS() for i in range(n)]\n\n\nsys.setrecursionlimit(1000000)\nmod = 1000000007\n# A\ndef A():\n return\n\n\n# B\ndef B():\n return\n\n\n# C\ndef C():\n n = I()\n s = S()\n for i in range(2 * n):\n s[i] = ord(s[i]) - 96\n k = 27\n m = 1 << n\n p = [1 << j for j in range(n)]\n d = defaultdict(lambda: 0)\n l = [(0, 0)]\n for i in s[:n][::-1]:\n l = [(x[0] * k + i, x[1]) for x in l] + [(x[0], x[1] * k + i) for x in l]\n for i in l:\n d[i] += 1\n ans = 0\n l = [(0, 0)]\n for i in s[n:]:\n l = [(x[0] * k + i, x[1]) for x in l] + [(x[0], x[1] * k + i) for x in l]\n for i in l:\n ans += d[i]\n print(ans)\n return\n\n\n# D\ndef D():\n return\n\n\n# E\ndef E():\n return\n\n\n# F\ndef F():\n return\n\n\n# Solve\nif __name__ == \"__main__\":\n C()\n", "measured_fast_code_sha256": "822b320890b4640a82e0d7980e120614b4f10c9398150508b25e66c5600d4e83", "measured_slow_code": "#!usr/bin/env python3\nfrom collections import defaultdict, deque\nfrom heapq import heappush, heappop\nimport sys\nimport math\nimport bisect\nimport random\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LS():\n return [list(x) for x in sys.stdin.readline().split()]\n\n\ndef S():\n res = list(sys.stdin.readline())\n if res[-1] == \"\\n\":\n return res[:-1]\n return res\n\n\ndef IR(n):\n return [I() for i in range(n)]\n\n\ndef LIR(n):\n return [LI() for i in range(n)]\n\n\ndef SR(n):\n return [S() for i in range(n)]\n\n\ndef LSR(n):\n return [LS() for i in range(n)]\n\n\nsys.setrecursionlimit(1000000)\nmod = 1000000007\n# A\ndef A():\n return\n\n\n# B\ndef B():\n return\n\n\n# C\ndef C():\n n = I()\n s = S()\n d = defaultdict(lambda: 0)\n alp = list(\"abcdefghijklmnopqrstuvwxyz\")\n f = {}\n for i in range(26):\n f[alp[i]] = i + 1\n for i in range(2 * n):\n s[i] = f[s[i]]\n for i in range(n >> 1):\n s[i], s[n - i - 1] = s[n - i - 1], s[i]\n k = 27\n m = 1 << n\n p = [1 << j for j in range(n)]\n for i in range(m):\n r = 0\n b = 0\n for j in range(n):\n if i & p[j]:\n r *= k\n r += s[j]\n else:\n b *= k\n b += s[j]\n d[(r, b)] += 1\n ans = 0\n for i in range(m):\n r = 0\n b = 0\n for j in range(n):\n if i & p[j]:\n r *= k\n r += s[j + n]\n else:\n b *= k\n b += s[j + n]\n ans += d[(r, b)]\n print(ans)\n return\n\n\n# D\ndef D():\n return\n\n\n# E\ndef E():\n return\n\n\n# F\ndef F():\n return\n\n\n# Solve\nif __name__ == \"__main__\":\n C()\n", "measured_slow_code_sha256": "a60649ff5c12e1eab3299c9c7a6614aed032b82f524d1da40bab14de5370e42a", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.1715727626403152, "pair_id": "python_v2_149da566ab804df502f693b3", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03298", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03298_822b320890b4640a82e0d7980e120614b4f10c9398150508b25e66c5600d4e83.jsonl.gz", "inputs": "reproduction/python/inputs/p03298.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03298_a60649ff5c12e1eab3299c9c7a6614aed032b82f524d1da40bab14de5370e42a.jsonl.gz"}, "slow_code": "from collections import defaultdict, deque\nfrom heapq import heappush, heappop\nimport sys\nimport math\nimport bisect\nimport random\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LS():\n return [list(x) for x in sys.stdin.readline().split()]\n\n\ndef S():\n res = list(sys.stdin.readline())\n if res[-1] == \"\\n\":\n return res[:-1]\n return res\n\n\ndef IR(n):\n return [I() for i in range(n)]\n\n\ndef LIR(n):\n return [LI() for i in range(n)]\n\n\ndef SR(n):\n return [S() for i in range(n)]\n\n\ndef LSR(n):\n return [LS() for i in range(n)]\n\n\nsys.setrecursionlimit(1000000)\nmod = 1000000007\n\n\ndef A():\n return\n\n\ndef B():\n return\n\n\ndef C():\n n = I()\n s = S()\n d = defaultdict(lambda: 0)\n alp = list(\"abcdefghijklmnopqrstuvwxyz\")\n f = {}\n for i in range(26):\n f[alp[i]] = i + 1\n for i in range(2 * n):\n s[i] = f[s[i]]\n for i in range(n >> 1):\n s[i], s[n - i - 1] = s[n - i - 1], s[i]\n k = 27\n m = 1 << n\n p = [1 << j for j in range(n)]\n for i in range(m):\n r = 0\n b = 0\n for j in range(n):\n if i & p[j]:\n r *= k\n r += s[j]\n else:\n b *= k\n b += s[j]\n d[(r, b)] += 1\n ans = 0\n for i in range(m):\n r = 0\n b = 0\n for j in range(n):\n if i & p[j]:\n r *= k\n r += s[j + n]\n else:\n b *= k\n b += s[j + n]\n ans += d[(r, b)]\n print(ans)\n return\n\n\ndef D():\n return\n\n\ndef E():\n return\n\n\ndef F():\n return\n\n\nif __name__ == \"__main__\":\n C()\n", "slow_code_sha256": "002d9d5a9cdc2eed9fd14639fc4309e77e7ea367b7a6bf911a50251677db836f", "slow_id": "p03298_a60649ff5c12e1eab3299c9c7a6614aed032b82f524d1da40bab14de5370e42a", "speedup": 2.182707748440734, "stratum": "2-4", "within_pair_jaccard": 0.8571428571428571, "workload": {"case_count": 98, "description": "Color each position of a lowercase string S red or blue. Count assignments where the red subsequence read left-to-right equals the blue subsequence read right-to-left. S has exactly 2N characters. Observed inputs: N=1..18 (median 5); S_length=2..36; distinct_characters=1..26.", "description_revision": "semantic-review-20261020", "distinct_input_count": 98, "input_bytes": {"max": 40, "median": 13.0, "min": 5}, "input_format": ["N\nS"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p01314_case_000", "p01314_case_001", "p01314_case_002", "p01314_case_003", "p01314_case_004", "p01314_case_005", "p01314_case_006", "p01314_case_007", "p01314_case_008", "p01314_case_009", "p01314_case_010", "p01314_case_011", "p01314_case_012", "p01314_case_013", "p01314_case_014", "p01314_case_015", "p01314_case_016", "p01314_case_017", "p01314_case_018", "p01314_case_019", "p01314_case_020", "p01314_case_021", "p01314_case_022", "p01314_case_023", "p01314_case_024", "p01314_case_025", "p01314_case_026", "p01314_case_027", "p01314_case_028", "p01314_case_029", "p01314_case_030", "p01314_case_031", "p01314_case_032", "p01314_case_033", "p01314_case_034", "p01314_case_035", "p01314_case_036", "p01314_case_037", "p01314_case_038", "p01314_case_039", "p01314_case_040", "p01314_case_041", "p01314_case_042", "p01314_case_043", "p01314_case_044", "p01314_case_045", "p01314_case_046", "p01314_case_047", "p01314_case_048", "p01314_case_049", "p01314_case_050", "p01314_case_051", "p01314_case_052", "p01314_case_053", "p01314_case_054", "p01314_case_055", "p01314_case_056", "p01314_case_057", "p01314_case_058", "p01314_case_059", "p01314_case_060", "p01314_case_061", "p01314_case_062", "p01314_case_064", "p01314_case_065", "p01314_case_066", "p01314_case_067", "p01314_case_068", "p01314_case_069", "p01314_case_070", "p01314_case_071", "p01314_case_072", "p01314_case_073", "p01314_case_074", "p01314_case_075", "p01314_case_076", "p01314_case_077", "p01314_case_078", "p01314_case_079", "p01314_case_080", "p01314_case_081", "p01314_case_082", "p01314_case_083", "p01314_case_084", "p01314_case_085", "p01314_case_086", "p01314_case_087", "p01314_case_088", "p01314_case_089", "p01314_case_090", "p01314_case_091", "p01314_case_092", "p01314_case_093", "p01314_case_094", "p01314_case_095", "p01314_case_096", "p01314_case_097", "p01314_case_098", "p01314_case_099", "p01314_v2_34e40b6e8aae5233ac6d"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import math\n\nwhile 1:\n n = int(input())\n if not n:\n break\n ans = 0\n for p in range(1, int(math.sqrt(2 * n)) + 1):\n if 2 * n % p == 0:\n q = 2 * n / p\n if p > 1 and (p + q) % 2:\n ans += 1\n print(ans)\n", "fast_code_sha256": "59a94b8cb65728097b93a688b3d7c6394cb5effac575c6c22c4819145671ca83", "fast_id": "p01314_59a94b8cb65728097b93a688b3d7c6394cb5effac575c6c22c4819145671ca83", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import math\n\nwhile 1:\n n = int(input())\n if not n:\n break\n ans = 0\n for p in range(1, int(math.sqrt(2 * n)) + 1):\n if 2 * n % p == 0:\n q = 2 * n / p\n if p > 1 and (p + q) % 2:\n ans += 1\n print(ans)\n", "measured_fast_code_sha256": "59a94b8cb65728097b93a688b3d7c6394cb5effac575c6c22c4819145671ca83", "measured_slow_code": "if __name__ == \"__main__\":\n while True:\n n = int(eval(input()))\n if n == 0:\n break\n count = 0\n for i in range(1, n):\n for j in range(i + 1, n):\n sum = (i + j) * (j - i + 1) / 2\n if sum > n:\n break\n if sum == n:\n count += 1\n print(count)\n", "measured_slow_code_sha256": "8eb439b03ab1b781f0fa01d6e10a84c9c2fc68f2233f33f28717d014574ec791", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 80.97041681148036, "pair_id": "python_v2_1293235894ca0cf372a52039", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p01314", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p01314_59a94b8cb65728097b93a688b3d7c6394cb5effac575c6c22c4819145671ca83.jsonl.gz", "inputs": "reproduction/python/inputs/p01314.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p01314_8eb439b03ab1b781f0fa01d6e10a84c9c2fc68f2233f33f28717d014574ec791.jsonl.gz"}, "slow_code": "if __name__ == \"__main__\":\n while True:\n n = int(eval(input()))\n if n == 0:\n break\n count = 0\n for i in range(1, n):\n for j in range(i + 1, n):\n sum = (i + j) * (j - i + 1) / 2\n if sum > n:\n break\n if sum == n:\n count += 1\n print(count)\n", "slow_code_sha256": "8eb439b03ab1b781f0fa01d6e10a84c9c2fc68f2233f33f28717d014574ec791", "slow_id": "p01314_8eb439b03ab1b781f0fa01d6e10a84c9c2fc68f2233f33f28717d014574ec791", "speedup": 76.8831951077933, "stratum": "8+", "within_pair_jaccard": 0.4482758620689655, "workload": {"case_count": 100, "description": "For each positive N, count representations as the sum of at least two consecutive positive integers. Each line supplies one N; a final zero ends input. Observed inputs: datasets=4..100 (median 15); N=1..1000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 403, "median": 61.0, "min": 15}, "input_format": ["N_1\n...\nN_D\n0"], "input_format_status": "source_input_section", "input_lines": {"max": 101, "median": 16.0, "min": 5}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 101, "median": 16.0, "min": 5}}} -{"case_ids": ["p02361_case_000", "p02361_case_001", "p02361_case_002", "p02361_case_003", "p02361_case_004", "p02361_case_005", "p02361_case_006", "p02361_case_007", "p02361_case_008", "p02361_case_009", "p02361_case_010", "p02361_case_011", "p02361_case_012", "p02361_case_013", "p02361_case_014", "p02361_case_015", "p02361_case_016", "p02361_case_017", "p02361_case_018", "p02361_case_019", "p02361_case_020", "p02361_case_021", "p02361_case_022", "p02361_case_023", "p02361_case_024", "p02361_case_025", "p02361_case_026", "p02361_case_027", "p02361_case_028", "p02361_case_029", "p02361_case_030", "p02361_case_031", "p02361_case_032", "p02361_case_033", "p02361_case_034", "p02361_case_035", "p02361_case_036", "p02361_case_037", "p02361_case_038", "p02361_case_039", "p02361_case_040", "p02361_case_041", "p02361_case_042", "p02361_case_043", "p02361_case_044", "p02361_case_045", "p02361_case_046", "p02361_case_047", "p02361_case_048", "p02361_case_049", "p02361_case_050", "p02361_case_051", "p02361_case_052", "p02361_case_053", "p02361_case_054", "p02361_case_055", "p02361_case_056", "p02361_case_057", "p02361_case_058", "p02361_case_059", "p02361_case_060", "p02361_case_061", "p02361_case_062", "p02361_case_063", "p02361_case_064", "p02361_case_065", "p02361_case_066", "p02361_case_067", "p02361_case_068", "p02361_case_069", "p02361_case_070", "p02361_case_071", "p02361_case_072", "p02361_case_073", "p02361_case_074", "p02361_case_075", "p02361_case_076", "p02361_case_077", "p02361_case_078", "p02361_case_079", "p02361_case_080", "p02361_case_081", "p02361_case_082", "p02361_case_083", "p02361_case_084", "p02361_case_085", "p02361_case_086", "p02361_case_087", "p02361_case_088", "p02361_case_089", "p02361_case_090", "p02361_case_091", "p02361_case_092", "p02361_case_093", "p02361_case_094", "p02361_case_095", "p02361_case_096", "p02361_case_097", "p02361_case_098", "p02361_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from sys import stdin\nfrom collections import defaultdict, deque\nimport math\n\nreadline = stdin.readline\nv, e, r = list(map(int, readline().split()))\ng = defaultdict(list)\nfor i in range(e):\n s, t, length = list(map(int, readline().split()))\n g[s].append((length, t))\nd = [float(\"inf\")] * v\nd[r] = 0\nque = deque([(d[r], r)])\nwhile que:\n du, u = que.popleft()\n for length, v in g[u]:\n if d[v] > du + length:\n d[v] = du + length\n que.append((d[v], v))\nfor di in d:\n print((\"INF\" if math.isinf(di) else di))\n", "fast_code_sha256": "57c1c454638dbda7d967b9345f5a8dd9a57935728d89aece19b49ab971a0d5bd", "fast_id": "p02361_57c1c454638dbda7d967b9345f5a8dd9a57935728d89aece19b49ab971a0d5bd", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from sys import stdin\nfrom collections import defaultdict, deque\nimport math\n\nreadline = stdin.readline\nv, e, r = list(map(int, readline().split()))\ng = defaultdict(list)\nfor i in range(e):\n s, t, length = list(map(int, readline().split()))\n g[s].append((length, t))\nd = [float(\"inf\")] * v\nd[r] = 0\nque = deque([(d[r], r)])\nwhile que:\n du, u = que.popleft()\n for length, v in g[u]:\n if d[v] > du + length:\n d[v] = du + length\n que.append((d[v], v))\nfor di in d:\n print((\"INF\" if math.isinf(di) else di))\n", "measured_fast_code_sha256": "57c1c454638dbda7d967b9345f5a8dd9a57935728d89aece19b49ab971a0d5bd", "measured_slow_code": "import sys\nimport queue\n\n\nclass Dijkstra:\n class Edge:\n def __init__(self, end, cost):\n self.to = end\n self.cost = cost\n\n def __init__(self, node_size, inf):\n self._node = node_size\n self._graph = [[] for _ in range(self._node)]\n self.inf = inf\n self.dist = [self.inf for _ in range(self._node)]\n\n def add_edge(self, st, ed, cs):\n self._graph[st].append(self.Edge(ed, cs))\n\n def solve(self, start):\n que = queue.PriorityQueue()\n self.dist[start] = 0\n que.put((0, start))\n while not que.empty():\n cur_cost, cur_vertex = que.get()\n if self.dist[cur_vertex] < cur_cost:\n continue\n for e in self._graph[cur_vertex]:\n if self.dist[e.to] > cur_cost + e.cost:\n self.dist[e.to] = cur_cost + e.cost\n que.put((self.dist[e.to], e.to))\n\n\nif __name__ == \"__main__\":\n V, E, r = list(map(int, sys.stdin.readline().split()))\n dk = Dijkstra(V, 10**10)\n for i in range(E):\n s, t, d = list(map(int, sys.stdin.readline().split()))\n dk.add_edge(s, t, d)\n dk.solve(r)\n for value in dk.dist:\n if value == dk.inf:\n print(\"INF\")\n else:\n print(value)\n", "measured_slow_code_sha256": "a48d0b96003d389be54b84ff869a67e52827774163e88aa4dae4f6c2782d1681", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.8362407705718242, "pair_id": "python_v2_e700d72533cc07ef1ca4a695", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02361", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02361_57c1c454638dbda7d967b9345f5a8dd9a57935728d89aece19b49ab971a0d5bd.jsonl.gz", "inputs": "reproduction/python/inputs/p02361.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02361_a48d0b96003d389be54b84ff869a67e52827774163e88aa4dae4f6c2782d1681.jsonl.gz"}, "slow_code": "import sys\nimport queue\n\n\nclass Dijkstra:\n class Edge:\n def __init__(self, end, cost):\n self.to = end\n self.cost = cost\n\n def __init__(self, node_size, inf):\n self._node = node_size\n self._graph = [[] for _ in range(self._node)]\n self.inf = inf\n self.dist = [self.inf for _ in range(self._node)]\n\n def add_edge(self, st, ed, cs):\n self._graph[st].append(self.Edge(ed, cs))\n\n def solve(self, start):\n que = queue.PriorityQueue()\n self.dist[start] = 0\n que.put((0, start))\n while not que.empty():\n cur_cost, cur_vertex = que.get()\n if self.dist[cur_vertex] < cur_cost:\n continue\n for e in self._graph[cur_vertex]:\n if self.dist[e.to] > cur_cost + e.cost:\n self.dist[e.to] = cur_cost + e.cost\n que.put((self.dist[e.to], e.to))\n\n\nif __name__ == \"__main__\":\n V, E, r = list(map(int, sys.stdin.readline().split()))\n dk = Dijkstra(V, 10**10)\n for i in range(E):\n s, t, d = list(map(int, sys.stdin.readline().split()))\n dk.add_edge(s, t, d)\n dk.solve(r)\n for value in dk.dist:\n if value == dk.inf:\n print(\"INF\")\n else:\n print(value)\n", "slow_code_sha256": "a48d0b96003d389be54b84ff869a67e52827774163e88aa4dae4f6c2782d1681", "slow_id": "p02361_a48d0b96003d389be54b84ff869a67e52827774163e88aa4dae4f6c2782d1681", "speedup": 2.02049600373846, "stratum": "2-4", "within_pair_jaccard": 0.34210526315789475, "workload": {"case_count": 100, "description": "Find shortest-path costs from source r to all vertices of a directed graph with nonnegative edge weights, outputting INF for unreachable vertices. Vertex IDs are 0..V-1; self-loops and parallel directed edges are absent. Observed inputs: V=1..100000 (median 1000); E=0..500000 (median 4999); r=0..99627; d_i=0..10000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 8333729, "median": 48880.5, "min": 6}, "input_format": ["V E r\ns_1 t_1 d_1\n...\ns_E t_E d_E"], "input_format_status": "source_input_section", "input_lines": {"max": 500001, "median": 5000.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1500003, "median": 15000.0, "min": 3}}} -{"case_ids": ["p03309_case_000", "p03309_case_001", "p03309_case_002", "p03309_case_003", "p03309_case_004", "p03309_case_005", "p03309_case_006", "p03309_case_007", "p03309_case_008", "p03309_case_009", "p03309_case_010", "p03309_case_011", "p03309_case_012", "p03309_case_013", "p03309_case_014", "p03309_case_015", "p03309_case_016", "p03309_case_017", "p03309_case_018", "p03309_case_019", "p03309_case_020", "p03309_case_021", "p03309_case_022", "p03309_case_023", "p03309_case_024", "p03309_case_025", "p03309_case_026", "p03309_case_027", "p03309_case_028", "p03309_case_029", "p03309_case_030", "p03309_case_031", "p03309_case_032", "p03309_case_033", "p03309_case_034", "p03309_case_035", "p03309_case_036", "p03309_case_037", "p03309_case_038", "p03309_case_039", "p03309_case_040", "p03309_case_041", "p03309_case_042", "p03309_case_043", "p03309_case_044", "p03309_case_045", "p03309_case_046", "p03309_case_047", "p03309_case_048", "p03309_case_049", "p03309_case_050", "p03309_case_051", "p03309_case_052", "p03309_case_053", "p03309_case_054", "p03309_case_055", "p03309_case_056", "p03309_case_057", "p03309_case_058", "p03309_case_059", "p03309_case_060", "p03309_case_061", "p03309_case_062", "p03309_case_063", "p03309_case_064", "p03309_case_065", "p03309_case_066", "p03309_case_067", "p03309_case_068", "p03309_case_069", "p03309_case_070", "p03309_case_071", "p03309_case_072", "p03309_case_073", "p03309_case_074", "p03309_case_075", "p03309_case_076", "p03309_case_077", "p03309_case_078", "p03309_case_079", "p03309_case_080", "p03309_case_081", "p03309_case_082", "p03309_case_083", "p03309_case_084", "p03309_case_085", "p03309_case_086", "p03309_case_087", "p03309_case_088", "p03309_case_089", "p03309_case_090", "p03309_case_091", "p03309_case_092", "p03309_case_093", "p03309_case_094", "p03309_case_095", "p03309_case_096", "p03309_case_097", "p03309_case_098", "p03309_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import math\nimport statistics\n\nN = int(eval(input()))\nL = [i for i in map(int, input().split())]\nQ = []\nfor i in range(len(L)):\n Q.append(L[i] - (i + 1))\nb = statistics.median(Q)\nres = 0\nfor i in range(N):\n res += abs(L[i] - (i + 1) - b)\nprint((int(res)))\n", "fast_code_sha256": "216c785fffec6646e7c557d36612cae8a2e5c8f36345616e20c86fbc70f38d56", "fast_id": "p03309_216c785fffec6646e7c557d36612cae8a2e5c8f36345616e20c86fbc70f38d56", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import math\nimport statistics\n\nN = int(eval(input()))\nL = [i for i in map(int, input().split())]\nQ = []\nfor i in range(len(L)):\n Q.append(L[i] - (i + 1))\nb = statistics.median(Q)\nres = 0\nfor i in range(N):\n res += abs(L[i] - (i + 1) - b)\nprint((int(res)))\n", "measured_fast_code_sha256": "216c785fffec6646e7c557d36612cae8a2e5c8f36345616e20c86fbc70f38d56", "measured_slow_code": "# coding: utf-8\nimport sys\nimport numpy as np\n\nsr = lambda: sys.stdin.readline().rstrip()\nir = lambda: int(sr())\nlr = lambda: list(map(int, sr().split()))\nN = ir()\nA = np.array(lr())\nA -= np.arange(1, N + 1)\nA.sort()\n\n\ndef check(i):\n ret = np.abs(A - A[i]).sum()\n return ret\n\n\nanswer = min(check(0), check(-1))\nleft = 0\nright = N - 1\nl_mid = (left * 2 + right) // 3\nr_mid = (left + right * 2) // 3\nwhile abs(right - left) > 2:\n l_mid = (left * 2 + right) // 3\n r_mid = (left + right * 2) // 3\n if check(l_mid) < check(r_mid):\n right = r_mid\n else:\n left = l_mid\ncand = min(check(l_mid), check(r_mid))\nanswer = min(answer, cand)\nprint(answer)\n", "measured_slow_code_sha256": "ac37d1c100ca4f2f3882684ef89e1b7a5b8307cd615c5194b3be94140e64b83f", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 25.18129076690544, "pair_id": "python_v2_3e62ea80fcf8de961dd457da", "per_case_slow_code_faster_fraction": 0.27, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03309", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03309_216c785fffec6646e7c557d36612cae8a2e5c8f36345616e20c86fbc70f38d56.jsonl.gz", "inputs": "reproduction/python/inputs/p03309.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03309_ac37d1c100ca4f2f3882684ef89e1b7a5b8307cd615c5194b3be94140e64b83f.jsonl.gz"}, "slow_code": "import sys\nimport numpy as np\n\nsr = lambda: sys.stdin.readline().rstrip()\nir = lambda: int(sr())\nlr = lambda: list(map(int, sr().split()))\nN = ir()\nA = np.array(lr())\nA -= np.arange(1, N + 1)\nA.sort()\n\n\ndef check(i):\n ret = np.abs(A - A[i]).sum()\n return ret\n\n\nanswer = min(check(0), check(-1))\nleft = 0\nright = N - 1\nl_mid = (left * 2 + right) // 3\nr_mid = (left + right * 2) // 3\nwhile abs(right - left) > 2:\n l_mid = (left * 2 + right) // 3\n r_mid = (left + right * 2) // 3\n if check(l_mid) < check(r_mid):\n right = r_mid\n else:\n left = l_mid\ncand = min(check(l_mid), check(r_mid))\nanswer = min(answer, cand)\nprint(answer)\n", "slow_code_sha256": "5701aee218672555c66391cf29324a5e74ef891c96945197c9a70baf40116d22", "slow_id": "p03309_ac37d1c100ca4f2f3882684ef89e1b7a5b8307cd615c5194b3be94140e64b83f", "speedup": 7.640609904396619, "stratum": "4-8", "within_pair_jaccard": 0.17857142857142858, "workload": {"case_count": 100, "description": "Choose any integer b to minimize sum_i |A_i-(b+i)| for a sequence with positions indexed from 1 through N. Observed inputs: N=1..200000 (median 1000); A_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 2000226, "median": 9899.5, "min": 4}, "input_format": ["N\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200001, "median": 1001.0, "min": 2}}} -{"case_ids": ["p03294_case_000", "p03294_case_001", "p03294_case_002", "p03294_case_003", "p03294_case_004", "p03294_case_005", "p03294_case_006", "p03294_case_007", "p03294_case_008", "p03294_case_009", "p03294_case_010", "p03294_case_011", "p03294_case_012", "p03294_case_013", "p03294_case_014", "p03294_case_015", "p03294_case_016", "p03294_case_017", "p03294_case_018", "p03294_case_019", "p03294_case_020", "p03294_case_021", "p03294_case_022", "p03294_case_023", "p03294_case_024", "p03294_case_025", "p03294_case_026", "p03294_case_027", "p03294_case_028", "p03294_case_029", "p03294_case_030", "p03294_case_031", "p03294_case_032", "p03294_case_033", "p03294_case_034", "p03294_case_035", "p03294_case_036", "p03294_case_037", "p03294_case_038", "p03294_case_039", "p03294_case_040", "p03294_case_041", "p03294_case_042", "p03294_case_043", "p03294_case_044", "p03294_case_045", "p03294_case_046", "p03294_case_047", "p03294_case_048", "p03294_case_049", "p03294_case_050", "p03294_case_051", "p03294_case_052", "p03294_case_053", "p03294_case_054", "p03294_case_055", "p03294_case_056", "p03294_case_057", "p03294_case_058", "p03294_case_059", "p03294_case_060", "p03294_case_061", "p03294_case_062", "p03294_case_063", "p03294_case_064", "p03294_case_065", "p03294_case_066", "p03294_case_067", "p03294_case_068", "p03294_case_069", "p03294_case_070", "p03294_case_071", "p03294_case_072", "p03294_case_073", "p03294_case_074", "p03294_case_075", "p03294_case_076", "p03294_case_077", "p03294_case_078", "p03294_case_079", "p03294_case_080", "p03294_case_081", "p03294_case_082", "p03294_case_083", "p03294_case_084", "p03294_case_085", "p03294_case_086", "p03294_case_087", "p03294_case_088", "p03294_case_089", "p03294_case_090", "p03294_case_091", "p03294_case_092", "p03294_case_093", "p03294_case_094", "p03294_case_095", "p03294_case_096", "p03294_case_097", "p03294_case_098", "p03294_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\na = list(map(int, input().split()))\nans = sum(a) - n\nprint(ans)\n", "fast_code_sha256": "3372f4f601315791f5fa5074c8f91306b596e20abda63ec14629d9dee61e0933", "fast_id": "p03294_3372f4f601315791f5fa5074c8f91306b596e20abda63ec14629d9dee61e0933", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\na = list(map(int, input().split()))\nans = sum(a) - n\nprint(ans)\n", "measured_fast_code_sha256": "3372f4f601315791f5fa5074c8f91306b596e20abda63ec14629d9dee61e0933", "measured_slow_code": "def gcd(a, b):\n return a if b == 0 else gcd(b, a % b)\n\n\ndef lcm(a, b):\n return a * b // gcd(a, b)\n\n\nN = int(eval(input()))\nA = list(map(int, input().split()))\nl = 0\nfor i in range(1, len(A)):\n l = lcm(A[i - 1], A[i])\nans = l - 1\nans = sum(A) - len(A)\nprint(ans)\n", "measured_slow_code_sha256": "903eeef9634137cfb57a141032f40a40109222781b0b845c860573558de2a657", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 6.618258755547955, "pair_id": "python_v2_fdb917740461f1c7152f6a02", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03294", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03294_3372f4f601315791f5fa5074c8f91306b596e20abda63ec14629d9dee61e0933.jsonl.gz", "inputs": "reproduction/python/inputs/p03294.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03294_903eeef9634137cfb57a141032f40a40109222781b0b845c860573558de2a657.jsonl.gz"}, "slow_code": "def gcd(a, b):\n return a if b == 0 else gcd(b, a % b)\n\n\ndef lcm(a, b):\n return a * b // gcd(a, b)\n\n\nN = int(eval(input()))\nA = list(map(int, input().split()))\nl = 0\nfor i in range(1, len(A)):\n l = lcm(A[i - 1], A[i])\nans = l - 1\nans = sum(A) - len(A)\nprint(ans)\n", "slow_code_sha256": "903eeef9634137cfb57a141032f40a40109222781b0b845c860573558de2a657", "slow_id": "p03294_903eeef9634137cfb57a141032f40a40109222781b0b845c860573558de2a657", "speedup": 6.424526616716904, "stratum": "4-8", "within_pair_jaccard": 0.35714285714285715, "workload": {"case_count": 100, "description": "For N positive integers a_i, maximize sum_i (m mod a_i) over all nonnegative integers m. Observed inputs: N=2..3000 (median 3000); a_i=2..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 21005, "median": 13229.0, "min": 6}, "input_format": ["N\na_1 ... a_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3001, "median": 3001.0, "min": 3}}} -{"case_ids": ["p02990_case_000", "p02990_case_001", "p02990_case_002", "p02990_case_003", "p02990_case_004", "p02990_case_005", "p02990_case_006", "p02990_case_007", "p02990_case_008", "p02990_case_009", "p02990_case_010", "p02990_case_011", "p02990_case_012", "p02990_case_013", "p02990_case_014", "p02990_case_015", "p02990_case_016", "p02990_case_017", "p02990_case_018", "p02990_case_019", "p02990_case_020", "p02990_case_021", "p02990_case_022", "p02990_case_023", "p02990_case_024", "p02990_case_025", "p02990_case_026", "p02990_case_027", "p02990_case_028", "p02990_case_029", "p02990_case_030", "p02990_case_031", "p02990_case_032", "p02990_case_033", "p02990_case_034", "p02990_case_035", "p02990_case_036", "p02990_case_037", "p02990_case_038", "p02990_case_039", "p02990_case_040", "p02990_case_041", "p02990_case_042", "p02990_case_043", "p02990_case_044", "p02990_case_045", "p02990_case_046", "p02990_case_047", "p02990_case_048", "p02990_case_049", "p02990_case_050", "p02990_case_051", "p02990_case_052", "p02990_case_053", "p02990_case_054", "p02990_case_055", "p02990_case_056", "p02990_case_057", "p02990_case_058", "p02990_case_059", "p02990_case_060", "p02990_case_061", "p02990_case_062", "p02990_case_063", "p02990_case_064", "p02990_case_065", "p02990_case_066", "p02990_case_067", "p02990_case_068", "p02990_case_069", "p02990_case_070", "p02990_case_071", "p02990_case_072", "p02990_case_073", "p02990_case_074", "p02990_case_075", "p02990_case_076", "p02990_case_077", "p02990_case_078", "p02990_case_079", "p02990_case_080", "p02990_case_081", "p02990_case_082", "p02990_case_083", "p02990_case_084", "p02990_case_085", "p02990_case_086", "p02990_case_087", "p02990_case_088", "p02990_case_089", "p02990_case_090", "p02990_case_091", "p02990_case_092", "p02990_case_093", "p02990_case_094", "p02990_case_095", "p02990_case_096", "p02990_case_097", "p02990_case_098", "p02990_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from operator import mul\nfrom functools import reduce\n\n\ndef cmb(n, r):\n r = min(n - r, r)\n if r == 0:\n return 1\n over = reduce(mul, list(range(n, n - r, -1)))\n under = reduce(mul, list(range(1, r + 1)))\n return over // under\n\n\ndef main():\n N, K = list(map(int, input().split()))\n MOD = 10**9 + 7\n for i in range(1, K + 1):\n if N - K + 1 < i:\n print((0))\n continue\n blue = cmb(K - 1, i - 1)\n red = cmb(N - K + 1, N - K - i + 1)\n ans = blue * red\n ans %= MOD\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "020e566598194d621a63f002ddd21e12855f1d7295beae4232d0737c8ccb078e", "fast_id": "p02990_020e566598194d621a63f002ddd21e12855f1d7295beae4232d0737c8ccb078e", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from operator import mul\nfrom functools import reduce\n\n\ndef cmb(n, r):\n r = min(n - r, r)\n if r == 0:\n return 1\n over = reduce(mul, list(range(n, n - r, -1)))\n under = reduce(mul, list(range(1, r + 1)))\n return over // under\n\n\ndef main():\n N, K = list(map(int, input().split()))\n MOD = 10**9 + 7\n for i in range(1, K + 1):\n if N - K + 1 < i:\n print((0))\n continue\n blue = cmb(K - 1, i - 1)\n red = cmb(N - K + 1, N - K - i + 1)\n ans = blue * red\n ans %= MOD\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "020e566598194d621a63f002ddd21e12855f1d7295beae4232d0737c8ccb078e", "measured_slow_code": "MOD = 10**9 + 7\nlim = 200000\ninv_t = [-1 for i in range(lim + 1)]\nfactrial = [-1 for i in range(lim + 1)]\nfactrial_inv = [-1 for i in range(lim + 1)]\n\n\ndef mod_inv(x, mod=MOD):\n y, u, v, _x = mod, 1, 0, x\n while y:\n t = _x // y\n _x -= t * y\n _x, y = y, _x\n u -= t * v\n u, v = v, u\n u %= mod\n if u < 0:\n u += mod\n return u\n\n\ndef mod_pow(a, n, mod=MOD):\n res = 1\n while n:\n if n & 1:\n res = res * a % mod\n a = a * a % mod\n n >>= 1\n return res\n\n\ndef COMinit(max=lim, mod=MOD):\n factrial[0] = factrial_inv[0] = 1\n factrial[1] = factrial_inv[1] = 1\n inv_t[0] = inv_t[1] = 1\n for i in range(2, max):\n factrial[i] = factrial[i - 1] * i % mod\n inv_t[i] = mod - inv_t[mod % i] * (mod // i) % mod\n factrial_inv[i] = factrial_inv[i - 1] * inv_t[i] % mod\n\n\ndef comb(a, b, mod=MOD):\n if a < b:\n return 0\n if factrial[0] == -1:\n COMinit()\n return (factrial[a] * factrial_inv[b] * factrial_inv[a - b]) % mod\n\n\nn, k = [int(_) for _ in input().split()]\nfor i in range(k):\n print((comb(n - k + 1, i + 1) * comb(k - 1, i) % MOD))\n", "measured_slow_code_sha256": "a43a2e409975514f076f5ea8a611abb00d6945f4ac7a0710f4b342242cb6e235", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 280.4780833658673, "pair_id": "python_v2_89e0d090b2d6a1e619a9c7ae", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02990", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02990_020e566598194d621a63f002ddd21e12855f1d7295beae4232d0737c8ccb078e.jsonl.gz", "inputs": "reproduction/python/inputs/p02990.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02990_a43a2e409975514f076f5ea8a611abb00d6945f4ac7a0710f4b342242cb6e235.jsonl.gz"}, "slow_code": "MOD = 10**9 + 7\nlim = 200000\ninv_t = [-1 for i in range(lim + 1)]\nfactrial = [-1 for i in range(lim + 1)]\nfactrial_inv = [-1 for i in range(lim + 1)]\n\n\ndef mod_inv(x, mod=MOD):\n y, u, v, _x = mod, 1, 0, x\n while y:\n t = _x // y\n _x -= t * y\n _x, y = y, _x\n u -= t * v\n u, v = v, u\n u %= mod\n if u < 0:\n u += mod\n return u\n\n\ndef mod_pow(a, n, mod=MOD):\n res = 1\n while n:\n if n & 1:\n res = res * a % mod\n a = a * a % mod\n n >>= 1\n return res\n\n\ndef COMinit(max=lim, mod=MOD):\n factrial[0] = factrial_inv[0] = 1\n factrial[1] = factrial_inv[1] = 1\n inv_t[0] = inv_t[1] = 1\n for i in range(2, max):\n factrial[i] = factrial[i - 1] * i % mod\n inv_t[i] = mod - inv_t[mod % i] * (mod // i) % mod\n factrial_inv[i] = factrial_inv[i - 1] * inv_t[i] % mod\n\n\ndef comb(a, b, mod=MOD):\n if a < b:\n return 0\n if factrial[0] == -1:\n COMinit()\n return (factrial[a] * factrial_inv[b] * factrial_inv[a - b]) % mod\n\n\nn, k = [int(_) for _ in input().split()]\nfor i in range(k):\n print((comb(n - k + 1, i + 1) * comb(k - 1, i) % MOD))\n", "slow_code_sha256": "a43a2e409975514f076f5ea8a611abb00d6945f4ac7a0710f4b342242cb6e235", "slow_id": "p02990_a43a2e409975514f076f5ea8a611abb00d6945f4ac7a0710f4b342242cb6e235", "speedup": 177.34387023532457, "stratum": "8+", "within_pair_jaccard": 0.28125, "workload": {"case_count": 100, "description": "Arrange K identical blue and N-K identical red balls in a row. For each i=1..K, count arrangements requiring exactly i moves to collect the blue balls, where a move collects any consecutive blue block. Output counts modulo 1000000007. Observed inputs: N=1..2000 (median 1234); K=1..2000 (median 807.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 10, "median": 9.0, "min": 4}, "input_format": ["N K"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p03222_case_000", "p03222_case_001", "p03222_case_002", "p03222_case_003", "p03222_case_004", "p03222_case_005", "p03222_case_006", "p03222_case_007", "p03222_case_008", "p03222_case_009", "p03222_case_010", "p03222_case_011", "p03222_case_012", "p03222_case_013", "p03222_case_014", "p03222_case_015", "p03222_case_016", "p03222_case_017", "p03222_case_018", "p03222_case_019", "p03222_case_020", "p03222_case_021", "p03222_case_022", "p03222_case_023", "p03222_case_024", "p03222_case_025", "p03222_case_026", "p03222_case_027", "p03222_case_028", "p03222_case_029", "p03222_case_030", "p03222_case_031", "p03222_case_032", "p03222_case_033", "p03222_case_034", "p03222_case_035", "p03222_case_036", "p03222_case_037", "p03222_case_038", "p03222_case_039", "p03222_case_040", "p03222_case_041", "p03222_case_042", "p03222_case_043", "p03222_case_044", "p03222_case_045", "p03222_case_046", "p03222_case_047", "p03222_case_048", "p03222_case_049", "p03222_case_050", "p03222_case_051", "p03222_case_052", "p03222_case_053", "p03222_case_054", "p03222_case_055", "p03222_case_056", "p03222_case_057", "p03222_case_058", "p03222_case_059", "p03222_case_060", "p03222_case_061", "p03222_case_062", "p03222_case_063", "p03222_case_064", "p03222_case_065", "p03222_case_066", "p03222_case_067", "p03222_case_068", "p03222_case_069", "p03222_case_070", "p03222_case_071", "p03222_case_072", "p03222_case_073", "p03222_case_074", "p03222_case_075", "p03222_case_076", "p03222_case_077", "p03222_case_078", "p03222_case_079", "p03222_case_080", "p03222_case_081", "p03222_case_082", "p03222_case_083", "p03222_case_084", "p03222_case_085", "p03222_case_086", "p03222_case_087", "p03222_case_088", "p03222_case_089", "p03222_case_090", "p03222_case_091", "p03222_case_092", "p03222_case_093", "p03222_case_094", "p03222_case_095", "p03222_case_096", "p03222_case_097", "p03222_case_098", "p03222_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "H, W, K = [int(_) for _ in input().split()]\nMOD = 1000000007\nP = [\"\"]\nfor i in range(W - 1):\n Q = []\n for p in P:\n Q.append(p + \"0\")\n if len(p) == 0 or p[-1] == \"0\":\n Q.append(p + \"1\")\n P = Q\nrs = [1] + [0] * (W - 1)\nfor j in range(H):\n nrs = [0] * W\n for p in P:\n drs = rs[:]\n for i, c in enumerate(p):\n if c == \"1\":\n drs[i], drs[i + 1] = drs[i + 1], drs[i]\n for i in range(W):\n nrs[i] = (nrs[i] + drs[i]) % MOD\n rs = nrs\nprint((rs[K - 1]))\n", "fast_code_sha256": "af1c6d1576a1d622453fcc8b60bfc7637ae89576693d4b762b6a08fcd6191a59", "fast_id": "p03222_af1c6d1576a1d622453fcc8b60bfc7637ae89576693d4b762b6a08fcd6191a59", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "H, W, K = [int(_) for _ in input().split()]\nMOD = 1000000007\nP = [\"\"]\nfor i in range(W - 1):\n Q = []\n for p in P:\n Q.append(p + \"0\")\n if len(p) == 0 or p[-1] == \"0\":\n Q.append(p + \"1\")\n P = Q\nrs = [1] + [0] * (W - 1)\nfor j in range(H):\n nrs = [0] * W\n for p in P:\n drs = rs[:]\n for i, c in enumerate(p):\n if c == \"1\":\n drs[i], drs[i + 1] = drs[i + 1], drs[i]\n for i in range(W):\n nrs[i] = (nrs[i] + drs[i]) % MOD\n rs = nrs\nprint((rs[K - 1]))\n", "measured_fast_code_sha256": "af1c6d1576a1d622453fcc8b60bfc7637ae89576693d4b762b6a08fcd6191a59", "measured_slow_code": "import sys\n\nmod = pow(10, 9) + 7\n\n\ndef mul(a, b):\n return ((a % mod) * (b % mod)) % mod\n\n\ndef cmb(n, r, mod):\n if r < 0 or r > n:\n return 0\n r = min(r, n - r)\n return g1[n] * g2[r] * g2[n - r] % mod\n\n\nNNN = (10**5) * 2\ng1 = [1, 1]\ng2 = [1, 1]\ninverse = [0, 1]\nfor i in range(2, NNN + 1):\n g1.append((g1[-1] * i) % mod)\n inverse.append((-inverse[mod % i] * (mod // i)) % mod)\n g2.append((g2[-1] * inverse[-1]) % mod)\n\n\ndef erabu(aW):\n r = 0\n for i in range(aW // 2 + 1 + 1):\n sp = aW - (2 * i - 1)\n r += cmb(sp + i + 1 - 1, sp, mod)\n return r\n\n\nN, W, K = [int(x) for x in input().strip().split(\" \")]\nhasi = 0\ncc = []\nif W == 1:\n if K == 1:\n print((1))\n else:\n print((0))\n sys.exit()\nelif W == 2:\n cccl = [1, 1]\n cc = [1, 1]\nelif W == 3:\n cccl = [1, 1, 1]\n cc = [2, 1, 2]\nelif W >= 4:\n aW = W - 1\n hW = aW - 2\n nhW = aW - 3\n cc = []\n cccl = []\n for w in range(W):\n nn = max(W - 1 - w - 1, 0)\n nnn = max((W - 1) - nn - 2, 0)\n if w == W - 1:\n nnn += 1\n cc.append(erabu(nn) * erabu(nnn))\n cccl.append(erabu(nn) * erabu(nnn - 1))\ncccl[0] = 0\ncccr = cccl[::-1]\nd = [1] + [0 for x in range(W - 1)]\nfor i in range(N):\n newd = []\n for j in range(W):\n newd.append(0)\n if j != 0:\n newd[j] = (newd[j] + (d[j - 1] * cccl[j])) % mod\n if j != W - 1:\n newd[j] = (newd[j] + (d[j + 1] * cccr[j])) % mod\n newd[j] = (newd[j] + (d[j] * cc[j])) % mod\n d = newd[:]\nprint((d[K - 1]))\n", "measured_slow_code_sha256": "a167fb2840bdcc6405e113c019a821d25f7acfa038b67804c34bff12a9edb446", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 154.8094505799844, "pair_id": "python_v2_9746e65a5ff49702bd11f4ca", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03222", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03222_af1c6d1576a1d622453fcc8b60bfc7637ae89576693d4b762b6a08fcd6191a59.jsonl.gz", "inputs": "reproduction/python/inputs/p03222.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03222_a167fb2840bdcc6405e113c019a821d25f7acfa038b67804c34bff12a9edb446.jsonl.gz"}, "slow_code": "import sys\n\nmod = pow(10, 9) + 7\n\n\ndef mul(a, b):\n return ((a % mod) * (b % mod)) % mod\n\n\ndef cmb(n, r, mod):\n if r < 0 or r > n:\n return 0\n r = min(r, n - r)\n return g1[n] * g2[r] * g2[n - r] % mod\n\n\nNNN = (10**5) * 2\ng1 = [1, 1]\ng2 = [1, 1]\ninverse = [0, 1]\nfor i in range(2, NNN + 1):\n g1.append((g1[-1] * i) % mod)\n inverse.append((-inverse[mod % i] * (mod // i)) % mod)\n g2.append((g2[-1] * inverse[-1]) % mod)\n\n\ndef erabu(aW):\n r = 0\n for i in range(aW // 2 + 1 + 1):\n sp = aW - (2 * i - 1)\n r += cmb(sp + i + 1 - 1, sp, mod)\n return r\n\n\nN, W, K = [int(x) for x in input().strip().split(\" \")]\nhasi = 0\ncc = []\nif W == 1:\n if K == 1:\n print((1))\n else:\n print((0))\n sys.exit()\nelif W == 2:\n cccl = [1, 1]\n cc = [1, 1]\nelif W == 3:\n cccl = [1, 1, 1]\n cc = [2, 1, 2]\nelif W >= 4:\n aW = W - 1\n hW = aW - 2\n nhW = aW - 3\n cc = []\n cccl = []\n for w in range(W):\n nn = max(W - 1 - w - 1, 0)\n nnn = max((W - 1) - nn - 2, 0)\n if w == W - 1:\n nnn += 1\n cc.append(erabu(nn) * erabu(nnn))\n cccl.append(erabu(nn) * erabu(nnn - 1))\ncccl[0] = 0\ncccr = cccl[::-1]\nd = [1] + [0 for x in range(W - 1)]\nfor i in range(N):\n newd = []\n for j in range(W):\n newd.append(0)\n if j != 0:\n newd[j] = (newd[j] + (d[j - 1] * cccl[j])) % mod\n if j != W - 1:\n newd[j] = (newd[j] + (d[j + 1] * cccr[j])) % mod\n newd[j] = (newd[j] + (d[j] * cc[j])) % mod\n d = newd[:]\nprint((d[K - 1]))\n", "slow_code_sha256": "a167fb2840bdcc6405e113c019a821d25f7acfa038b67804c34bff12a9edb446", "slow_id": "p03222_a167fb2840bdcc6405e113c019a821d25f7acfa038b67804c34bff12a9edb446", "speedup": 173.44455359341893, "stratum": "8+", "within_pair_jaccard": 0.21621621621621623, "workload": {"case_count": 100, "description": "Count ladder lotteries with W vertical lines and H horizontal levels. At each level, links join adjacent verticals and cannot share endpoints. Following links from the top-left must end at bottom column K. Output modulo 1000000007. Observed inputs: H=1..100 (median 50); W=1..8 (median 5); K=1..8 (median 2.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 8, "median": 7.0, "min": 6}, "input_format": ["H W K"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3, "median": 3.0, "min": 3}}} -{"case_ids": ["p02700_case_000", "p02700_case_001", "p02700_case_002", "p02700_case_003", "p02700_case_004", "p02700_case_005", "p02700_case_006", "p02700_case_007", "p02700_case_008", "p02700_case_009", "p02700_case_010", "p02700_case_011", "p02700_case_012", "p02700_case_013", "p02700_case_014", "p02700_case_015", "p02700_case_016", "p02700_case_017", "p02700_case_018", "p02700_case_019", "p02700_case_020", "p02700_case_021", "p02700_case_022", "p02700_case_023", "p02700_case_024", "p02700_case_025", "p02700_case_026", "p02700_case_027", "p02700_case_028", "p02700_case_029", "p02700_case_030", "p02700_case_031", "p02700_case_032", "p02700_case_033", "p02700_case_034", "p02700_case_035", "p02700_case_036", "p02700_case_037", "p02700_case_038", "p02700_case_039", "p02700_case_040", "p02700_case_041", "p02700_case_042", "p02700_case_043", "p02700_case_044", "p02700_case_045", "p02700_case_046", "p02700_case_047", "p02700_case_048", "p02700_case_049", "p02700_case_050", "p02700_case_051", "p02700_case_052", "p02700_case_053", "p02700_case_054", "p02700_case_055", "p02700_case_056", "p02700_case_057", "p02700_case_058", "p02700_case_059", "p02700_case_060", "p02700_case_061", "p02700_case_062", "p02700_case_063", "p02700_case_064", "p02700_case_065", "p02700_case_066", "p02700_case_067", "p02700_case_068", "p02700_case_069", "p02700_case_070", "p02700_case_071", "p02700_case_072", "p02700_case_073", "p02700_case_074", "p02700_case_075", "p02700_case_076", "p02700_case_077", "p02700_case_078", "p02700_case_079", "p02700_case_080", "p02700_case_081", "p02700_case_082", "p02700_case_083", "p02700_case_084", "p02700_case_085", "p02700_case_086", "p02700_case_087", "p02700_case_088", "p02700_case_089", "p02700_case_090", "p02700_case_091", "p02700_case_092", "p02700_case_093", "p02700_case_094", "p02700_case_095", "p02700_case_096", "p02700_case_097", "p02700_case_098", "p02700_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "a, b, c, d = list(map(int, input().split()))\nwhile True:\n c -= b\n a -= d\n if c <= 0:\n print(\"Yes\")\n break\n if a <= 0:\n print(\"No\")\n break\n", "fast_code_sha256": "42952b80917ce2a85a6b105c0b544eeb48a1df438a3e537aed2925ce9471282d", "fast_id": "p02700_42952b80917ce2a85a6b105c0b544eeb48a1df438a3e537aed2925ce9471282d", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "a, b, c, d = list(map(int, input().split()))\nwhile True:\n c -= b\n a -= d\n if c <= 0:\n print(\"Yes\")\n break\n if a <= 0:\n print(\"No\")\n break\n", "measured_fast_code_sha256": "42952b80917ce2a85a6b105c0b544eeb48a1df438a3e537aed2925ce9471282d", "measured_slow_code": "from math import floor, ceil, sqrt, factorial, log\nfrom collections import Counter, deque\nfrom functools import reduce\n\n# import numpy as np\ndef S():\n return eval(input())\n\n\ndef I():\n return int(eval(input()))\n\n\ndef MS():\n return list(map(str, input().split()))\n\n\ndef MI():\n return list(map(int, input().split()))\n\n\ndef FLI():\n return [int(i) for i in input().split()]\n\n\ndef LS():\n return list(MS())\n\n\ndef LI():\n return list(MI())\n\n\ndef LLS():\n return [list(map(str, l.split())) for l in eval(input())]\n\n\ndef LLI():\n return [list(map(int, l.split())) for l in eval(input())]\n\n\ndef LLSN(n: int):\n return [LS() for _ in range(n)]\n\n\ndef LLIN(n: int):\n return [LI() for _ in range(n)]\n\n\nA, B, C, D = MI()\nx = -(-A // D)\ny = -(-C // B)\nif x >= y:\n print(\"Yes\")\nelse:\n print(\"No\")\n# for i in range(100):\n# a -= B\n# if a <= 0:\n# print(\"Yes\")\n# exit()\n# t -= D\n# if t <= 0:\n# print(\"No\")\n# exit()\n", "measured_slow_code_sha256": "0800076b3be1d259d89fb0c2c371b4341f1c7fc8f7058a2f3f090ffddebf2dcb", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 5.370142394837597, "pair_id": "python_v2_9ac534d9cc822812274f8464", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02700", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02700_42952b80917ce2a85a6b105c0b544eeb48a1df438a3e537aed2925ce9471282d.jsonl.gz", "inputs": "reproduction/python/inputs/p02700.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02700_0800076b3be1d259d89fb0c2c371b4341f1c7fc8f7058a2f3f090ffddebf2dcb.jsonl.gz"}, "slow_code": "from math import floor, ceil, sqrt, factorial, log\nfrom collections import Counter, deque\nfrom functools import reduce\n\n\ndef S():\n return eval(input())\n\n\ndef I():\n return int(eval(input()))\n\n\ndef MS():\n return list(map(str, input().split()))\n\n\ndef MI():\n return list(map(int, input().split()))\n\n\ndef FLI():\n return [int(i) for i in input().split()]\n\n\ndef LS():\n return list(MS())\n\n\ndef LI():\n return list(MI())\n\n\ndef LLS():\n return [list(map(str, l.split())) for l in eval(input())]\n\n\ndef LLI():\n return [list(map(int, l.split())) for l in eval(input())]\n\n\ndef LLSN(n: int):\n return [LS() for _ in range(n)]\n\n\ndef LLIN(n: int):\n return [LI() for _ in range(n)]\n\n\nA, B, C, D = MI()\nx = -(-A // D)\ny = -(-C // B)\nif x >= y:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "slow_code_sha256": "7feb6456d377ecdd9b0dcbfc30f9b0e6286836e7cba34a2d795c5cf979e98297", "slow_id": "p02700_0800076b3be1d259d89fb0c2c371b4341f1c7fc8f7058a2f3f090ffddebf2dcb", "speedup": 5.3560372658692215, "stratum": "4-8", "within_pair_jaccard": 0.15254237288135594, "workload": {"case_count": 100, "description": "Two monsters have health/attack (A,B) and (C,D). Starting with the first monster, they attack alternately, subtracting their attack value from the opponent health. Determine whether the first wins by reducing opposing health to at most zero. Observed inputs: A=1..100 (median 73); B=1..100 (median 48.5); C=1..100 (median 80.5); D=1..100 (median 55).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 16, "median": 12.0, "min": 8}, "input_format": ["A B C D"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 4, "median": 4.0, "min": 4}}} -{"case_ids": ["p02989_case_000", "p02989_case_001", "p02989_case_002", "p02989_case_003", "p02989_case_004", "p02989_case_005", "p02989_case_006", "p02989_case_007", "p02989_case_008", "p02989_case_009", "p02989_case_010", "p02989_case_011", "p02989_case_012", "p02989_case_013", "p02989_case_014", "p02989_case_015", "p02989_case_016", "p02989_case_017", "p02989_case_018", "p02989_case_019", "p02989_case_020", "p02989_case_021", "p02989_case_022", "p02989_case_023", "p02989_case_024", "p02989_case_025", "p02989_case_026", "p02989_case_027", "p02989_case_028", "p02989_case_029", "p02989_case_030", "p02989_case_031", "p02989_case_032", "p02989_case_033", "p02989_case_034", "p02989_case_035", "p02989_case_036", "p02989_case_037", "p02989_case_038", "p02989_case_039", "p02989_case_040", "p02989_case_041", "p02989_case_042", "p02989_case_043", "p02989_case_044", "p02989_case_045", "p02989_case_046", "p02989_case_047", "p02989_case_048", "p02989_case_049", "p02989_case_050", "p02989_case_051", "p02989_case_052", "p02989_case_053", "p02989_case_054", "p02989_case_055", "p02989_case_056", "p02989_case_057", "p02989_case_058", "p02989_case_059", "p02989_case_060", "p02989_case_061", "p02989_case_062", "p02989_case_063", "p02989_case_064", "p02989_case_065", "p02989_case_066", "p02989_case_067", "p02989_case_068", "p02989_case_069", "p02989_case_070", "p02989_case_071", "p02989_case_072", "p02989_case_073", "p02989_case_074", "p02989_case_075", "p02989_case_076", "p02989_case_077", "p02989_case_078", "p02989_case_079", "p02989_case_080", "p02989_case_081", "p02989_case_082", "p02989_case_083", "p02989_case_084", "p02989_case_085", "p02989_case_086", "p02989_case_087", "p02989_case_088", "p02989_case_089", "p02989_case_090", "p02989_case_091", "p02989_case_092", "p02989_case_093", "p02989_case_094", "p02989_case_095", "p02989_case_096", "p02989_case_097", "p02989_case_098", "p02989_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "k = int(eval(input()))\nd = sorted(list(map(int, input().split())))\nans = 0\nfor i in range(d[int(len(d) / 2) - 1] + 1, d[int(len(d) / 2)] + 1):\n ans += 1\nprint(ans)\n", "fast_code_sha256": "62ad9f2adce44c77d68fd44ebb9f61b6ba9fe3ebcdabfb9b6ab52cc566bf6ddc", "fast_id": "p02989_62ad9f2adce44c77d68fd44ebb9f61b6ba9fe3ebcdabfb9b6ab52cc566bf6ddc", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "k = int(eval(input()))\nd = sorted(list(map(int, input().split())))\nans = 0\nfor i in range(d[int(len(d) / 2) - 1] + 1, d[int(len(d) / 2)] + 1):\n ans += 1\nprint(ans)\n", "measured_fast_code_sha256": "62ad9f2adce44c77d68fd44ebb9f61b6ba9fe3ebcdabfb9b6ab52cc566bf6ddc", "measured_slow_code": "from bisect import bisect_left\n\nn = int(eval(input()))\nd = list(map(int, input().split()))\nd = sorted(d)\nans = 0\nfor i in range(1, 10**5 + 1):\n p = bisect_left(d, i)\n ans += 1 if p == (n - p) else 0\nprint(ans)\n", "measured_slow_code_sha256": "bee7326f5d65117847c8daffc9f8e9e9508be71f70ad2064bdf47643f0632c7e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 204.06634689943564, "pair_id": "python_v2_f0cb7cd6d256991121c56f3d", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02989", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02989_62ad9f2adce44c77d68fd44ebb9f61b6ba9fe3ebcdabfb9b6ab52cc566bf6ddc.jsonl.gz", "inputs": "reproduction/python/inputs/p02989.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02989_bee7326f5d65117847c8daffc9f8e9e9508be71f70ad2064bdf47643f0632c7e.jsonl.gz"}, "slow_code": "from bisect import bisect_left\n\nn = int(eval(input()))\nd = list(map(int, input().split()))\nd = sorted(d)\nans = 0\nfor i in range(1, 10**5 + 1):\n p = bisect_left(d, i)\n ans += 1 if p == (n - p) else 0\nprint(ans)\n", "slow_code_sha256": "bee7326f5d65117847c8daffc9f8e9e9508be71f70ad2064bdf47643f0632c7e", "slow_id": "p02989_bee7326f5d65117847c8daffc9f8e9e9508be71f70ad2064bdf47643f0632c7e", "speedup": 90.75047426377911, "stratum": "8+", "within_pair_jaccard": 0.5517241379310345, "workload": {"case_count": 100, "description": "For an even number N of difficulties d_i, count integer thresholds K splitting the entries equally into values below K and values at least K. Observed inputs: N=2..100000 (median 100); d_i=1..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 600025, "median": 596.0, "min": 6}, "input_format": ["N\nd_1 ... d_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100001, "median": 101.0, "min": 3}}} -{"case_ids": ["p02612_case_000", "p02612_case_001", "p02612_case_002", "p02612_case_003", "p02612_case_004", "p02612_case_005", "p02612_case_006", "p02612_case_007", "p02612_case_008", "p02612_case_009", "p02612_case_010", "p02612_case_011", "p02612_case_012", "p02612_case_013", "p02612_case_014", "p02612_case_015", "p02612_case_016", "p02612_case_017", "p02612_case_018", "p02612_case_019", "p02612_case_020", "p02612_case_021", "p02612_case_022", "p02612_case_023", "p02612_case_024", "p02612_case_025", "p02612_case_026", "p02612_case_027", "p02612_case_028", "p02612_case_029", "p02612_case_030", "p02612_case_031", "p02612_case_032", "p02612_case_033", "p02612_case_034", "p02612_case_035", "p02612_case_036", "p02612_case_037", "p02612_case_038", "p02612_case_039", "p02612_case_040", "p02612_case_041", "p02612_case_042", "p02612_case_043", "p02612_case_044", "p02612_case_045", "p02612_case_046", "p02612_case_047", "p02612_case_048", "p02612_case_049", "p02612_case_050", "p02612_case_051", "p02612_case_052", "p02612_case_053", "p02612_case_054", "p02612_case_055", "p02612_case_056", "p02612_case_057", "p02612_case_058", "p02612_case_059", "p02612_case_060", "p02612_case_061", "p02612_case_062", "p02612_case_063", "p02612_case_064", "p02612_case_065", "p02612_case_066", "p02612_case_067", "p02612_case_068", "p02612_case_069", "p02612_case_070", "p02612_case_071", "p02612_case_072", "p02612_case_073", "p02612_case_074", "p02612_case_075", "p02612_case_076", "p02612_case_077", "p02612_case_078", "p02612_case_079", "p02612_case_080", "p02612_case_081", "p02612_case_082", "p02612_case_083", "p02612_case_084", "p02612_case_085", "p02612_case_086", "p02612_case_087", "p02612_case_088", "p02612_case_089", "p02612_case_090", "p02612_case_091", "p02612_case_092", "p02612_case_093", "p02612_case_094", "p02612_case_095", "p02612_case_096", "p02612_case_097", "p02612_case_098", "p02612_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N = int(eval(input()))\nprint(((10000 - N) % 1000))\n", "fast_code_sha256": "9c4d6caf21ec555f0773eff226c3ebb7ab3751f45eba8fa1f1d369e50678b948", "fast_id": "p02612_9c4d6caf21ec555f0773eff226c3ebb7ab3751f45eba8fa1f1d369e50678b948", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N = int(eval(input()))\nprint(((10000 - N) % 1000))\n", "measured_fast_code_sha256": "9c4d6caf21ec555f0773eff226c3ebb7ab3751f45eba8fa1f1d369e50678b948", "measured_slow_code": "N = int(eval(input()))\nif N >= 1000:\n M = str(N)\n X = M[1:]\n O = int(X)\n if O == 0:\n print((0))\n else:\n print((1000 - O))\nelse:\n O = int(N)\n print((1000 - O))\n", "measured_slow_code_sha256": "8dde1aff283391e2d57ad3865fb24f31a09d7a6c5fe418b99f6dc494d6a6f32b", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.37575776119561, "pair_id": "python_v2_c0b2d68b0dc3c96f86db7c17", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02612", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02612_9c4d6caf21ec555f0773eff226c3ebb7ab3751f45eba8fa1f1d369e50678b948.jsonl.gz", "inputs": "reproduction/python/inputs/p02612.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02612_8dde1aff283391e2d57ad3865fb24f31a09d7a6c5fe418b99f6dc494d6a6f32b.jsonl.gz"}, "slow_code": "N = int(eval(input()))\nif N >= 1000:\n M = str(N)\n X = M[1:]\n O = int(X)\n if O == 0:\n print((0))\n else:\n print((1000 - O))\nelse:\n O = int(N)\n print((1000 - O))\n", "slow_code_sha256": "8dde1aff283391e2d57ad3865fb24f31a09d7a6c5fe418b99f6dc494d6a6f32b", "slow_id": "p02612_8dde1aff283391e2d57ad3865fb24f31a09d7a6c5fe418b99f6dc494d6a6f32b", "speedup": 2.370798065515548, "stratum": "2-4", "within_pair_jaccard": 0.4, "workload": {"case_count": 100, "description": "Find the change received for a price N when paying with the minimum sufficient number of 1000-unit bills. Observed inputs: N=1..10000 (median 5000.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 6, "median": 5.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p03244_case_000", "p03244_case_001", "p03244_case_002", "p03244_case_003", "p03244_case_004", "p03244_case_005", "p03244_case_006", "p03244_case_007", "p03244_case_008", "p03244_case_009", "p03244_case_010", "p03244_case_011", "p03244_case_012", "p03244_case_013", "p03244_case_014", "p03244_case_015", "p03244_case_016", "p03244_case_017", "p03244_case_018", "p03244_case_019", "p03244_case_020", "p03244_case_021", "p03244_case_022", "p03244_case_023", "p03244_case_024", "p03244_case_025", "p03244_case_026", "p03244_case_027", "p03244_case_028", "p03244_case_029", "p03244_case_030", "p03244_case_031", "p03244_case_032", "p03244_case_033", "p03244_case_034", "p03244_case_035", "p03244_case_036", "p03244_case_037", "p03244_case_038", "p03244_case_039", "p03244_case_040", "p03244_case_041", "p03244_case_042", "p03244_case_043", "p03244_case_044", "p03244_case_045", "p03244_case_046", "p03244_case_047", "p03244_case_048", "p03244_case_049", "p03244_case_050", "p03244_case_051", "p03244_case_052", "p03244_case_053", "p03244_case_054", "p03244_case_055", "p03244_case_056", "p03244_case_057", "p03244_case_058", "p03244_case_059", "p03244_case_060", "p03244_case_061", "p03244_case_062", "p03244_case_063", "p03244_case_064", "p03244_case_065", "p03244_case_066", "p03244_case_067", "p03244_case_068", "p03244_case_069", "p03244_case_070", "p03244_case_071", "p03244_case_072", "p03244_case_073", "p03244_case_074", "p03244_case_075", "p03244_case_076", "p03244_case_077", "p03244_case_078", "p03244_case_079", "p03244_case_080", "p03244_case_081", "p03244_case_082", "p03244_case_083", "p03244_case_084", "p03244_case_085", "p03244_case_086", "p03244_case_087", "p03244_case_088", "p03244_case_089", "p03244_case_090", "p03244_case_091", "p03244_case_092", "p03244_case_093", "p03244_case_094", "p03244_case_095", "p03244_case_096", "p03244_case_097", "p03244_case_098", "p03244_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from collections import *\n\nN = int(eval(input()))\nv_list = input().split()\nif len(set(v_list)) == 1:\n print((len(v_list) // 2))\n exit()\nv1_count_list = Counter(v_list[::2]).most_common()\nv2_count_list = Counter(v_list[1::2]).most_common()\nif v1_count_list[0][0] != v2_count_list[0][0]:\n leave_value = v1_count_list[0][1] + v2_count_list[0][1]\nelse:\n leave_value = max(\n v1_count_list[1][1] + v2_count_list[0][1],\n v1_count_list[0][1] + v2_count_list[1][1],\n )\nprint((len(v_list) - leave_value))\n", "fast_code_sha256": "d4ae0ad416990f5d9c42e6d7199d39c5413ae17b219868252d45844df14acc05", "fast_id": "p03244_d4ae0ad416990f5d9c42e6d7199d39c5413ae17b219868252d45844df14acc05", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from collections import *\n\nN = int(eval(input()))\nv_list = input().split()\nif len(set(v_list)) == 1:\n print((len(v_list) // 2))\n exit()\nv1_count_list = Counter(v_list[::2]).most_common()\nv2_count_list = Counter(v_list[1::2]).most_common()\nif v1_count_list[0][0] != v2_count_list[0][0]:\n leave_value = v1_count_list[0][1] + v2_count_list[0][1]\nelse:\n leave_value = max(\n v1_count_list[1][1] + v2_count_list[0][1],\n v1_count_list[0][1] + v2_count_list[1][1],\n )\nprint((len(v_list) - leave_value))\n", "measured_fast_code_sha256": "d4ae0ad416990f5d9c42e6d7199d39c5413ae17b219868252d45844df14acc05", "measured_slow_code": "import numpy as np\n\neven = np.zeros(100001, dtype=int)\nodd = np.zeros(100001, dtype=int)\nn = int(eval(input()))\nv = list(map(int, input().split()))\nfor i in range(n):\n if i % 2 == 0:\n even[v[i]] += 1\n else:\n odd[v[i]] += 1\ne1 = even.argmax()\ne1n = even.max()\no1 = odd.argmax()\no1n = odd.max()\n# print(e1, e1n, o1, o1n)\nif e1 == o1:\n e2n = np.sort(even)[-2]\n o2n = np.sort(odd)[-2]\n # print(e2n, o2n)\n print((min(n - e1n - o2n, n - e2n - o1n)))\nelse:\n print((n - e1n - o1n))\n", "measured_slow_code_sha256": "100838eb35611188aaa0e6508544517c0abf47ad6e005b321a85725c0e9840dd", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 523.6619955778949, "pair_id": "python_v2_69a21b555afb4968b7616230", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03244", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03244_d4ae0ad416990f5d9c42e6d7199d39c5413ae17b219868252d45844df14acc05.jsonl.gz", "inputs": "reproduction/python/inputs/p03244.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03244_100838eb35611188aaa0e6508544517c0abf47ad6e005b321a85725c0e9840dd.jsonl.gz"}, "slow_code": "import numpy as np\n\neven = np.zeros(100001, dtype=int)\nodd = np.zeros(100001, dtype=int)\nn = int(eval(input()))\nv = list(map(int, input().split()))\nfor i in range(n):\n if i % 2 == 0:\n even[v[i]] += 1\n else:\n odd[v[i]] += 1\ne1 = even.argmax()\ne1n = even.max()\no1 = odd.argmax()\no1n = odd.max()\n\nif e1 == o1:\n e2n = np.sort(even)[-2]\n o2n = np.sort(odd)[-2]\n\n print((min(n - e1n - o2n, n - e2n - o1n)))\nelse:\n print((n - e1n - o1n))\n", "slow_code_sha256": "a39b059af4b03221115ad0dd54a76e5f423fd6c8173a18ffdbed4e08ab13360c", "slow_id": "p03244_100838eb35611188aaa0e6508544517c0abf47ad6e005b321a85725c0e9840dd", "speedup": 220.20111757151173, "stratum": "8+", "within_pair_jaccard": 0.24489795918367346, "workload": {"case_count": 100, "description": "Replace as few entries of an even-length sequence as possible so values repeat with period 2 and exactly two distinct values occur. Equal adjacent parity classes are not permitted in the result. Observed inputs: N=2..100000 (median 100); v_i=1..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 600007, "median": 598.5, "min": 12}, "input_format": ["n\nv_1 ... v_n"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100001, "median": 101.0, "min": 3}}} -{"case_ids": ["p03837_case_000", "p03837_case_001", "p03837_case_002", "p03837_case_003", "p03837_case_004", "p03837_case_005", "p03837_case_006", "p03837_case_007", "p03837_case_008", "p03837_case_009", "p03837_case_010", "p03837_case_011", "p03837_case_012", "p03837_case_013", "p03837_case_014", "p03837_case_015", "p03837_case_016", "p03837_case_017", "p03837_case_018", "p03837_case_019", "p03837_case_020", "p03837_case_021", "p03837_case_022", "p03837_case_023", "p03837_case_024", "p03837_case_025", "p03837_case_026", "p03837_case_027", "p03837_case_028", "p03837_case_029", "p03837_case_030", "p03837_case_031", "p03837_case_032", "p03837_case_033", "p03837_case_034", "p03837_case_035", "p03837_case_036", "p03837_case_037", "p03837_case_038", "p03837_case_039", "p03837_case_040", "p03837_case_041", "p03837_case_042", "p03837_case_043", "p03837_case_044", "p03837_case_045", "p03837_case_046", "p03837_case_047", "p03837_case_048", "p03837_case_049", "p03837_case_050", "p03837_case_051", "p03837_case_052", "p03837_case_053", "p03837_case_054", "p03837_case_055", "p03837_case_056", "p03837_case_057", "p03837_case_058", "p03837_case_059", "p03837_case_060", "p03837_case_061", "p03837_case_062", "p03837_case_063", "p03837_case_064", "p03837_case_065", "p03837_case_066", "p03837_case_067", "p03837_case_068", "p03837_case_069", "p03837_case_070", "p03837_case_071", "p03837_case_072", "p03837_case_073", "p03837_case_074", "p03837_case_075", "p03837_case_076", "p03837_case_077", "p03837_case_078", "p03837_case_079", "p03837_case_080", "p03837_case_081", "p03837_case_082", "p03837_case_083", "p03837_case_084", "p03837_case_085", "p03837_case_086", "p03837_case_087", "p03837_case_088", "p03837_case_089", "p03837_case_090", "p03837_case_091", "p03837_case_092", "p03837_case_093", "p03837_case_094", "p03837_case_095", "p03837_case_096", "p03837_case_097", "p03837_case_098", "p03837_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import heapq\n\nN, M = list(map(int, input().split()))\nes = [[] for _ in range(N)]\nfor i in range(M):\n a, b, c = list(map(int, input().split()))\n es[a - 1].append((c, b - 1))\n es[b - 1].append((c, a - 1))\nINF = float(\"inf\")\n\nd = [[INF for _ in range(N)] for _ in range(N)]\nfor i in range(N):\n q = []\n d[i][i] = 0\n heapq.heappush(q, (0, i))\n while q:\n cost, a = heapq.heappop(q)\n if d[i][a] < cost:\n continue\n for c, b in es[a]:\n if d[i][a] + c < d[i][b]:\n d[i][b] = d[i][a] + c\n heapq.heappush(q, (d[i][b], b))\n\n\ncnt = 0\nfor i in range(N):\n for c, b in es[i]:\n if d[i][b] != c:\n cnt += 1\n\nprint((cnt // 2))\n", "fast_code_sha256": "d0049f943120d7271ad75201bb4f4041f116278d93954adfad2543cf4bc98d1f", "fast_id": "p03837_80ecd7a533e7aade9fd037ac5793cdc66dad62fccbad95fa17c7543f12205caa", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import heapq\n\nN, M = list(map(int, input().split()))\nes = [[] for _ in range(N)]\nfor i in range(M):\n a, b, c = list(map(int, input().split()))\n es[a - 1].append((c, b - 1))\n es[b - 1].append((c, a - 1))\nINF = float(\"inf\")\n# 全ノード間の最短距離を求める\nd = [[INF for _ in range(N)] for _ in range(N)]\nfor i in range(N):\n q = []\n d[i][i] = 0\n heapq.heappush(q, (0, i))\n while q:\n cost, a = heapq.heappop(q)\n if d[i][a] < cost:\n continue\n for c, b in es[a]:\n if d[i][a] + c < d[i][b]:\n d[i][b] = d[i][a] + c\n heapq.heappush(q, (d[i][b], b))\n# 全ての辺について、その辺の間の距離cがa->bまでの最短距離か確かめる\n# ある辺がいずれかのノード間の最短経路に含まれるなら、その辺(が結ぶノード)も最短距離になるから。\ncnt = 0\nfor i in range(N):\n for c, b in es[i]:\n if d[i][b] != c:\n cnt += 1\n# 無向グラフなので2方向分カウントされてるから2で割る\nprint((cnt // 2))\n", "measured_fast_code_sha256": "80ecd7a533e7aade9fd037ac5793cdc66dad62fccbad95fa17c7543f12205caa", "measured_slow_code": "import sys\n\n\ndef MI():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\nN, M = MI()\n\n\nclass WarshallFloyd:\n def __init__(self, N): # Nは頂点の個数\n self.N = N\n self.d = [\n [float(\"inf\")] * N for i in range(N)\n ] # d[i][j] = iからjへの最短距離,0-indexed\n\n def add(self, u, v, c, directed=False):\n if directed is False: # 無向グラフの場合\n self.d[u][v] = c\n self.d[v][u] = c\n else: # 有向グラフの場合\n self.d[u][v] = c\n\n def WarshallFloyd_search(self):\n for k in range(self.N):\n for i in range(self.N):\n for j in range(self.N):\n self.d[i][j] = min(self.d[i][j], self.d[i][k] + self.d[k][j])\n return self.d\n\n\nW = WarshallFloyd(N)\nedges = [0] * M\nfor i in range(M):\n a, b, c = MI()\n W.add(a - 1, b - 1, c, directed=False)\n edges[i] = (a - 1, b - 1, c)\nfor i in range(N):\n W.add(i, i, 0)\nW.WarshallFloyd_search()\nans = 0\nfor i in range(M):\n a = 0\n for j in range(N):\n if W.d[j][edges[i][1]] == W.d[j][edges[i][0]] + edges[i][2]:\n a = 1\n if a == 0:\n ans += 1\nprint(ans)\n", "measured_slow_code_sha256": "4b8c4fbe2209051ec530f2f2b45afa5c5e7b9baa472bdff7f7c0b78d073fa97f", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 5.128152023179476, "pair_id": "python_v2_5a02f3ae9657ad355a76dafc", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03837", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03837_80ecd7a533e7aade9fd037ac5793cdc66dad62fccbad95fa17c7543f12205caa.jsonl.gz", "inputs": "reproduction/python/inputs/p03837.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03837_4b8c4fbe2209051ec530f2f2b45afa5c5e7b9baa472bdff7f7c0b78d073fa97f.jsonl.gz"}, "slow_code": "import sys\n\n\ndef MI():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\nN, M = MI()\n\n\nclass WarshallFloyd:\n def __init__(self, N):\n self.N = N\n self.d = [[float(\"inf\")] * N for i in range(N)]\n\n def add(self, u, v, c, directed=False):\n if directed is False:\n self.d[u][v] = c\n self.d[v][u] = c\n else:\n self.d[u][v] = c\n\n def WarshallFloyd_search(self):\n for k in range(self.N):\n for i in range(self.N):\n for j in range(self.N):\n self.d[i][j] = min(self.d[i][j], self.d[i][k] + self.d[k][j])\n return self.d\n\n\nW = WarshallFloyd(N)\nedges = [0] * M\nfor i in range(M):\n a, b, c = MI()\n W.add(a - 1, b - 1, c, directed=False)\n edges[i] = (a - 1, b - 1, c)\nfor i in range(N):\n W.add(i, i, 0)\nW.WarshallFloyd_search()\nans = 0\nfor i in range(M):\n a = 0\n for j in range(N):\n if W.d[j][edges[i][1]] == W.d[j][edges[i][0]] + edges[i][2]:\n a = 1\n if a == 0:\n ans += 1\nprint(ans)\n", "slow_code_sha256": "918d060f36498e9dd1876ace838239104c3304ee483f7156454f3905311e6b4c", "slow_id": "p03837_4b8c4fbe2209051ec530f2f2b45afa5c5e7b9baa472bdff7f7c0b78d073fa97f", "speedup": 4.200073244733832, "stratum": "4-8", "within_pair_jaccard": 0.35, "workload": {"case_count": 100, "description": "In a connected simple undirected weighted graph with positive weights c_i, count edges that occur in no shortest path between any pair of distinct vertices. Endpoints are 1-based and may be listed in either order. Observed inputs: N=2..100 (median 30); M=1..1000 (median 55); c_i=1..1000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 10569, "median": 461.0, "min": 10}, "input_format": ["N M\na_1 b_1 c_1\n...\na_M b_M c_M"], "input_format_status": "source_input_section", "input_lines": {"max": 1001, "median": 56.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3002, "median": 167.0, "min": 5}}} -{"case_ids": ["p03288_case_000", "p03288_case_001", "p03288_case_002", "p03288_case_003", "p03288_case_004", "p03288_case_005", "p03288_case_006", "p03288_case_007", "p03288_case_008", "p03288_case_009", "p03288_case_010", "p03288_case_011", "p03288_case_012", "p03288_case_013", "p03288_case_014", "p03288_case_015", "p03288_case_016", "p03288_case_017", "p03288_case_018", "p03288_case_019", "p03288_case_020", "p03288_case_021", "p03288_case_022", "p03288_case_023", "p03288_case_024", "p03288_case_025", "p03288_case_026", "p03288_case_027", "p03288_case_028", "p03288_case_029", "p03288_case_030", "p03288_case_031", "p03288_case_032", "p03288_case_033", "p03288_case_034", "p03288_case_035", "p03288_case_036", "p03288_case_037", "p03288_case_038", "p03288_case_039", "p03288_case_040", "p03288_case_041", "p03288_case_042", "p03288_case_043", "p03288_case_044", "p03288_case_045", "p03288_case_046", "p03288_case_047", "p03288_case_048", "p03288_case_049", "p03288_case_050", "p03288_case_051", "p03288_case_052", "p03288_case_053", "p03288_case_054", "p03288_case_055", "p03288_case_056", "p03288_case_057", "p03288_case_058", "p03288_case_059", "p03288_case_060", "p03288_case_061", "p03288_case_062", "p03288_case_063", "p03288_case_064", "p03288_case_065", "p03288_case_066", "p03288_case_067", "p03288_case_068", "p03288_case_069", "p03288_case_070", "p03288_case_071", "p03288_case_072", "p03288_case_073", "p03288_case_074", "p03288_case_075", "p03288_case_076", "p03288_case_077", "p03288_case_078", "p03288_case_079", "p03288_case_080", "p03288_case_081", "p03288_case_082", "p03288_case_083", "p03288_case_084", "p03288_case_085", "p03288_case_086", "p03288_case_087", "p03288_case_088", "p03288_case_089", "p03288_case_090", "p03288_case_091", "p03288_case_092", "p03288_case_093", "p03288_case_094", "p03288_case_095", "p03288_case_096", "p03288_case_097", "p03288_case_098", "p03288_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "R = int(eval(input()))\nprint((\"ABC\" if R < 1200 else \"ARC\" if 1200 <= R < 2800 else \"AGC\"))\n", "fast_code_sha256": "67577897a73a4c730876a6907ec6fef270254d3ed2aa3fc2330dfddc791f582b", "fast_id": "p03288_67577897a73a4c730876a6907ec6fef270254d3ed2aa3fc2330dfddc791f582b", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "R = int(eval(input()))\nprint((\"ABC\" if R < 1200 else \"ARC\" if 1200 <= R < 2800 else \"AGC\"))\n", "measured_fast_code_sha256": "67577897a73a4c730876a6907ec6fef270254d3ed2aa3fc2330dfddc791f582b", "measured_slow_code": "import bisect, collections, copy, heapq, itertools, math, string\nimport sys\n\n\ndef S():\n return sys.stdin.readline().rstrip()\n\n\ndef M():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef LS():\n return list(sys.stdin.readline().rstrip().split())\n\n\nR = I()\nif R < 1200:\n print(\"ABC\")\nelif R < 2800:\n print(\"ARC\")\nelse:\n print(\"AGC\")\n", "measured_slow_code_sha256": "4b19a6c66c6b24c9d371f629b6a683da99f61809c1d26fcff1386ca6548060d5", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 31.04007186122933, "pair_id": "python_v2_0108be2a44c95ba20014717e", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03288", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03288_67577897a73a4c730876a6907ec6fef270254d3ed2aa3fc2330dfddc791f582b.jsonl.gz", "inputs": "reproduction/python/inputs/p03288.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03288_4b19a6c66c6b24c9d371f629b6a683da99f61809c1d26fcff1386ca6548060d5.jsonl.gz"}, "slow_code": "import bisect, collections, copy, heapq, itertools, math, string\nimport sys\n\n\ndef S():\n return sys.stdin.readline().rstrip()\n\n\ndef M():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef LS():\n return list(sys.stdin.readline().rstrip().split())\n\n\nR = I()\nif R < 1200:\n print(\"ABC\")\nelif R < 2800:\n print(\"ARC\")\nelse:\n print(\"AGC\")\n", "slow_code_sha256": "4b19a6c66c6b24c9d371f629b6a683da99f61809c1d26fcff1386ca6548060d5", "slow_id": "p03288_4b19a6c66c6b24c9d371f629b6a683da99f61809c1d26fcff1386ca6548060d5", "speedup": 30.99925203298274, "stratum": "8+", "within_pair_jaccard": 0.2857142857142857, "workload": {"case_count": 100, "description": "Choose the next eligible category from three ordered categories: the first requires rating below 1200, the second below 2800, and the third accepts every rating. Observed inputs: R=0..4208 (median 1199.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 5, "median": 5.0, "min": 2}, "input_format": ["R"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p02289_case_000", "p02289_case_001", "p02289_case_002", "p02289_case_003", "p02289_case_004", "p02289_case_005", "p02289_case_006", "p02289_case_007", "p02289_case_008", "p02289_case_009", "p02289_case_010", "p02289_case_011", "p02289_case_012", "p02289_case_013", "p02289_case_014", "p02289_case_015", "p02289_case_016", "p02289_case_017", "p02289_case_018", "p02289_case_019", "p02289_case_020", "p02289_case_021", "p02289_case_022", "p02289_case_023", "p02289_case_024", "p02289_case_025", "p02289_case_026", "p02289_case_027", "p02289_case_028", "p02289_case_029", "p02289_case_030", "p02289_case_031", "p02289_case_032", "p02289_case_033", "p02289_case_034", "p02289_case_035", "p02289_case_036", "p02289_case_037", "p02289_case_038", "p02289_case_039", "p02289_case_040", "p02289_case_041", "p02289_case_042", "p02289_case_043", "p02289_case_044", "p02289_case_045", "p02289_case_046", "p02289_case_047", "p02289_case_048", "p02289_case_049", "p02289_case_050", "p02289_case_051", "p02289_case_052", "p02289_case_053", "p02289_case_054", "p02289_case_055", "p02289_case_056", "p02289_case_057", "p02289_case_058", "p02289_case_059", "p02289_case_060", "p02289_case_061", "p02289_case_062", "p02289_case_063", "p02289_case_064", "p02289_case_065", "p02289_case_066", "p02289_case_067", "p02289_case_068", "p02289_case_069", "p02289_case_070", "p02289_case_071", "p02289_case_072", "p02289_case_073", "p02289_case_074", "p02289_case_075", "p02289_case_076", "p02289_case_077", "p02289_case_078", "p02289_case_079", "p02289_case_080", "p02289_case_081", "p02289_case_082", "p02289_case_083", "p02289_case_084", "p02289_case_085", "p02289_case_086", "p02289_case_087", "p02289_case_088", "p02289_case_089", "p02289_case_090", "p02289_case_091", "p02289_case_092", "p02289_case_093", "p02289_case_094", "p02289_case_095", "p02289_case_096", "p02289_case_097", "p02289_case_098", "p02289_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\nfrom heapq import heapify, heappush, heappop\n\nhq = []\nS = []\nfor s in sys.stdin:\n if s[2] == \"s\":\n heappush(hq, -int(s[7:]))\n elif s[2] == \"t\":\n S.append(-heappop(hq))\n else:\n break\nprint((\"\\n\".join(map(str, S))))\n", "fast_code_sha256": "2f68c2572603391cc58ce68e731ba0819583d4393d52e5343abe87c9b10d263b", "fast_id": "p02289_2f68c2572603391cc58ce68e731ba0819583d4393d52e5343abe87c9b10d263b", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\nfrom heapq import heapify, heappush, heappop\n\nhq = []\nS = []\nfor s in sys.stdin:\n if s[2] == \"s\":\n heappush(hq, -int(s[7:]))\n elif s[2] == \"t\":\n S.append(-heappop(hq))\n else:\n break\nprint((\"\\n\".join(map(str, S))))\n", "measured_fast_code_sha256": "2f68c2572603391cc58ce68e731ba0819583d4393d52e5343abe87c9b10d263b", "measured_slow_code": "import sys\n\n\ndef maxHeapify(A, i):\n l = i * 2 + 1\n r = i * 2 + 2\n if l < n:\n largest = l\n if r < n and A[r] > A[l]:\n largest = r\n if A[largest] > A[i]:\n A[i], A[largest] = A[largest], A[i]\n maxHeapify(A, largest)\n\n\ndef insert(S, k):\n global n\n S[n] = k\n n += 1\n i = n - 1\n p = (i - 1) // 2\n while i > 0 and S[i] > S[p]:\n S[i], S[p] = S[p], S[i]\n i = p\n p = (i - 1) // 2\n\n\ndef extractMax(S):\n global n\n if n == 1:\n n -= 1\n return S[0]\n ans = S[0]\n n -= 1\n S[0] = S[n]\n i = 0\n while True:\n l = i * 2 + 1\n r = i * 2 + 2\n if l >= n:\n break\n largest = l\n if r < n and A[r] > A[l]:\n largest = r\n if A[largest] > A[i]:\n A[i], A[largest] = A[largest], A[i]\n i = largest\n else:\n break\n return ans\n\n\nA = [0] * 2000000\nS = []\nn = 0\nfor s in sys.stdin:\n if s[2] == \"s\":\n insert(A, int(s[7:]))\n elif s[2] == \"t\":\n S.append(extractMax(A))\n else:\n break\nprint((\"\\n\".join(map(str, S))))\n", "measured_slow_code_sha256": "14b4ad282f61dc3f0baedf2eb80026c759f35dd9b34a29e093c21234282f17e7", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4.007176579101953, "pair_id": "python_v2_2e34894e35b47965c4eecfdb", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02289", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02289_2f68c2572603391cc58ce68e731ba0819583d4393d52e5343abe87c9b10d263b.jsonl.gz", "inputs": "reproduction/python/inputs/p02289.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02289_14b4ad282f61dc3f0baedf2eb80026c759f35dd9b34a29e093c21234282f17e7.jsonl.gz"}, "slow_code": "import sys\n\n\ndef maxHeapify(A, i):\n l = i * 2 + 1\n r = i * 2 + 2\n if l < n:\n largest = l\n if r < n and A[r] > A[l]:\n largest = r\n if A[largest] > A[i]:\n A[i], A[largest] = A[largest], A[i]\n maxHeapify(A, largest)\n\n\ndef insert(S, k):\n global n\n S[n] = k\n n += 1\n i = n - 1\n p = (i - 1) // 2\n while i > 0 and S[i] > S[p]:\n S[i], S[p] = S[p], S[i]\n i = p\n p = (i - 1) // 2\n\n\ndef extractMax(S):\n global n\n if n == 1:\n n -= 1\n return S[0]\n ans = S[0]\n n -= 1\n S[0] = S[n]\n i = 0\n while True:\n l = i * 2 + 1\n r = i * 2 + 2\n if l >= n:\n break\n largest = l\n if r < n and A[r] > A[l]:\n largest = r\n if A[largest] > A[i]:\n A[i], A[largest] = A[largest], A[i]\n i = largest\n else:\n break\n return ans\n\n\nA = [0] * 2000000\nS = []\nn = 0\nfor s in sys.stdin:\n if s[2] == \"s\":\n insert(A, int(s[7:]))\n elif s[2] == \"t\":\n S.append(extractMax(A))\n else:\n break\nprint((\"\\n\".join(map(str, S))))\n", "slow_code_sha256": "14b4ad282f61dc3f0baedf2eb80026c759f35dd9b34a29e093c21234282f17e7", "slow_id": "p02289_14b4ad282f61dc3f0baedf2eb80026c759f35dd9b34a29e093c21234282f17e7", "speedup": 3.8544000803251905, "stratum": "2-4", "within_pair_jaccard": 0.44680851063829785, "workload": {"case_count": 100, "description": "Maintain an initially empty max-priority queue. Each insert k adds one integer; each extract removes and prints the current maximum. Commands occur one per line and end terminates input. Duplicate keys are allowed. Observed inputs: operations=10..500000 (median 1000); insertions=5..250192 (median 508); extractions=3..249991 (median 495.5); maximum_queue_size=1..50000 (median 30.5); k=0..2000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 6501924, "median": 12912.5, "min": 130}, "input_format": ["insert k\nextract\n...\nend"], "input_format_status": "source_input_section", "input_lines": {"max": 500001, "median": 1001.0, "min": 11}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 750193, "median": 1509.0, "min": 16}}} -{"case_ids": ["p02714_case_000", "p02714_case_001", "p02714_case_002", "p02714_case_003", "p02714_case_004", "p02714_case_005", "p02714_case_006", "p02714_case_007", "p02714_case_008", "p02714_case_009", "p02714_case_010", "p02714_case_011", "p02714_case_012", "p02714_case_013", "p02714_case_014", "p02714_case_015", "p02714_case_016", "p02714_case_017", "p02714_case_018", "p02714_case_019", "p02714_case_020", "p02714_case_021", "p02714_case_022", "p02714_case_023", "p02714_case_024", "p02714_case_025", "p02714_case_026", "p02714_case_027", "p02714_case_028", "p02714_case_029", "p02714_case_030", "p02714_case_031", "p02714_case_032", "p02714_case_033", "p02714_case_034", "p02714_case_035", "p02714_case_036", "p02714_case_037", "p02714_case_038", "p02714_case_039", "p02714_case_040", "p02714_case_041", "p02714_case_042", "p02714_case_043", "p02714_case_044", "p02714_case_045", "p02714_case_046", "p02714_case_047", "p02714_case_048", "p02714_case_049", "p02714_case_050", "p02714_case_051", "p02714_case_052", "p02714_case_053", "p02714_case_054", "p02714_case_055", "p02714_case_056", "p02714_case_057", "p02714_case_058", "p02714_case_059", "p02714_case_060", "p02714_case_061", "p02714_case_062", "p02714_case_063", "p02714_case_064", "p02714_case_065", "p02714_case_066", "p02714_case_067", "p02714_case_068", "p02714_case_069", "p02714_case_070", "p02714_case_071", "p02714_case_072", "p02714_case_073", "p02714_case_074", "p02714_case_075", "p02714_case_076", "p02714_case_077", "p02714_case_078", "p02714_case_079", "p02714_case_080", "p02714_case_081", "p02714_case_082", "p02714_case_083", "p02714_case_084", "p02714_case_085", "p02714_case_086", "p02714_case_087", "p02714_case_088", "p02714_case_089", "p02714_case_090", "p02714_case_091", "p02714_case_092", "p02714_case_093", "p02714_case_094", "p02714_case_095", "p02714_case_096", "p02714_case_097", "p02714_case_098", "p02714_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n, s = open(0)\nn = int(n)\nc = s.count\nprint(\n (\n c(\"R\") * c(\"G\") * c(\"B\")\n - sum(\n s[i] != s[i + j >> 1] != s[j] != s[i]\n for i in range(n)\n for j in range(i + 2, n, 2)\n )\n )\n)\n", "fast_code_sha256": "0ac8c5f56e3e53bf479baa19a7eeeab5cf21fb3d72a87838cb617b89991bb87c", "fast_id": "p02714_0ac8c5f56e3e53bf479baa19a7eeeab5cf21fb3d72a87838cb617b89991bb87c", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n, s = open(0)\nn = int(n)\nc = s.count\nprint(\n (\n c(\"R\") * c(\"G\") * c(\"B\")\n - sum(\n s[i] != s[i + j >> 1] != s[j] != s[i]\n for i in range(n)\n for j in range(i + 2, n, 2)\n )\n )\n)\n", "measured_fast_code_sha256": "0ac8c5f56e3e53bf479baa19a7eeeab5cf21fb3d72a87838cb617b89991bb87c", "measured_slow_code": "from sys import stdin\nimport bisect\n\n\ndef main():\n # 入力\n readline = stdin.readline\n N = int(readline())\n S = readline().strip()\n res = 0\n R = []\n G = []\n B = []\n flags = [\"\"] * N\n for i in range(N):\n if S[i] == \"R\":\n R.append(i)\n flags[i] = \"R\"\n elif S[i] == \"G\":\n G.append(i)\n flags[i] = \"G\"\n else:\n B.append(i)\n flags[i] = \"B\"\n # Bが最後\n for i in range(len(R)):\n for j in range(len(G)):\n n = max(R[i], G[j])\n k = bisect.bisect_left(B, n)\n res += len(B) - k\n if n + n - min(R[i], G[j]) < N:\n if flags[n + n - min(R[i], G[j])] == \"B\":\n res -= 1\n for i in range(len(R)):\n for j in range(len(B)):\n n = max(R[i], B[j])\n k = bisect.bisect_left(G, n)\n res += len(G) - k\n if n + n - min(R[i], B[j]) < N:\n if flags[n + n - min(R[i], B[j])] == \"G\":\n res -= 1\n for i in range(len(B)):\n for j in range(len(G)):\n n = max(B[i], G[j])\n k = bisect.bisect_left(R, n)\n res += len(R) - k\n if n + n - min(B[i], G[j]) < N:\n if flags[n + n - min(B[i], G[j])] == \"R\":\n res -= 1\n print(res)\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "329b15942111e48ba21aa4fa5898b0daadc6d2ead02a6a14ed26da0eb67b41ec", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.9266282481786963, "pair_id": "python_v2_93da9dd6ddb8354b04038424", "per_case_slow_code_faster_fraction": 0.04, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02714", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02714_0ac8c5f56e3e53bf479baa19a7eeeab5cf21fb3d72a87838cb617b89991bb87c.jsonl.gz", "inputs": "reproduction/python/inputs/p02714.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02714_329b15942111e48ba21aa4fa5898b0daadc6d2ead02a6a14ed26da0eb67b41ec.jsonl.gz"}, "slow_code": "from sys import stdin\nimport bisect\n\n\ndef main():\n\n readline = stdin.readline\n N = int(readline())\n S = readline().strip()\n res = 0\n R = []\n G = []\n B = []\n flags = [\"\"] * N\n for i in range(N):\n if S[i] == \"R\":\n R.append(i)\n flags[i] = \"R\"\n elif S[i] == \"G\":\n G.append(i)\n flags[i] = \"G\"\n else:\n B.append(i)\n flags[i] = \"B\"\n\n for i in range(len(R)):\n for j in range(len(G)):\n n = max(R[i], G[j])\n k = bisect.bisect_left(B, n)\n res += len(B) - k\n if n + n - min(R[i], G[j]) < N:\n if flags[n + n - min(R[i], G[j])] == \"B\":\n res -= 1\n for i in range(len(R)):\n for j in range(len(B)):\n n = max(R[i], B[j])\n k = bisect.bisect_left(G, n)\n res += len(G) - k\n if n + n - min(R[i], B[j]) < N:\n if flags[n + n - min(R[i], B[j])] == \"G\":\n res -= 1\n for i in range(len(B)):\n for j in range(len(G)):\n n = max(B[i], G[j])\n k = bisect.bisect_left(R, n)\n res += len(R) - k\n if n + n - min(B[i], G[j]) < N:\n if flags[n + n - min(B[i], G[j])] == \"R\":\n res -= 1\n print(res)\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "da713aaa394b9951921ebd958e2887baf9e88ebd0181739a1faba9c19b60964a", "slow_id": "p02714_329b15942111e48ba21aa4fa5898b0daadc6d2ead02a6a14ed26da0eb67b41ec", "speedup": 3.154721918582251, "stratum": "2-4", "within_pair_jaccard": 0.3023255813953488, "workload": {"case_count": 100, "description": "Count index triples i l[low + 1]:\n tmp = l[low + 1]\n l[low + 1] = l[low]\n l[low] = tmp\n return l\n\n\nbubblesort(P)\nsum = 0\nfor i in range(K):\n sum = sum + P[i]\nprint(sum)\n", "measured_slow_code_sha256": "12fc0a6880b1658c0eaeba3aa7dd7893393cf5c052e40105869e3784eb2f1caa", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 16.067506186982403, "pair_id": "python_v2_82cd61df2dc172c165c4055e", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02628", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02628_e5f2ce1d3645cedd2aa705d07e029891694acb0a7fb25165c6b7969765605888.jsonl.gz", "inputs": "reproduction/python/inputs/p02628.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02628_12fc0a6880b1658c0eaeba3aa7dd7893393cf5c052e40105869e3784eb2f1caa.jsonl.gz"}, "slow_code": "N, K = list(map(int, input().split()))\nP = list(map(int, input().split()))\n\n\ndef bubblesort(l):\n for index in range(len(l) - 1, 0, -1):\n for low in range(index):\n if l[low] > l[low + 1]:\n tmp = l[low + 1]\n l[low + 1] = l[low]\n l[low] = tmp\n return l\n\n\nbubblesort(P)\nsum = 0\nfor i in range(K):\n sum = sum + P[i]\nprint(sum)\n", "slow_code_sha256": "12fc0a6880b1658c0eaeba3aa7dd7893393cf5c052e40105869e3784eb2f1caa", "slow_id": "p02628_12fc0a6880b1658c0eaeba3aa7dd7893393cf5c052e40105869e3784eb2f1caa", "speedup": 34.63595791296256, "stratum": "8+", "within_pair_jaccard": 0.36666666666666664, "workload": {"case_count": 100, "description": "Choose K distinct kinds among N fruits, buying one item of each, to minimize the total price. Price p_i is the cost of one item of kind i. Observed inputs: N=1..1000 (median 100); K=1..1000 (median 99); p_i=1..1000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 5010, "median": 457.0, "min": 6}, "input_format": ["N K\np_1 ... p_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1002, "median": 102.0, "min": 3}}} -{"case_ids": ["p03343_case_000", "p03343_case_001", "p03343_case_002", "p03343_case_003", "p03343_case_004", "p03343_case_005", "p03343_case_006", "p03343_case_007", "p03343_case_008", "p03343_case_009", "p03343_case_010", "p03343_case_011", "p03343_case_012", "p03343_case_013", "p03343_case_014", "p03343_case_015", "p03343_case_016", "p03343_case_017", "p03343_case_018", "p03343_case_019", "p03343_case_020", "p03343_case_021", "p03343_case_022", "p03343_case_023", "p03343_case_024", "p03343_case_025", "p03343_case_026", "p03343_case_027", "p03343_case_028", "p03343_case_029", "p03343_case_030", "p03343_case_031", "p03343_case_032", "p03343_case_033", "p03343_case_034", "p03343_case_035", "p03343_case_036", "p03343_case_037", "p03343_case_038", "p03343_case_039", "p03343_case_040", "p03343_case_041", "p03343_case_042", "p03343_case_043", "p03343_case_044", "p03343_case_045", "p03343_case_046", "p03343_case_047", "p03343_case_048", "p03343_case_049", "p03343_case_050", "p03343_case_051", "p03343_case_052", "p03343_case_053", "p03343_case_054", "p03343_case_055", "p03343_case_056", "p03343_case_057", "p03343_case_058", "p03343_case_059", "p03343_case_060", "p03343_case_061", "p03343_case_062", "p03343_case_063", "p03343_case_064", "p03343_case_065", "p03343_case_066", "p03343_case_067", "p03343_case_068", "p03343_case_069", "p03343_case_070", "p03343_case_071", "p03343_case_072", "p03343_case_073", "p03343_case_074", "p03343_case_075", "p03343_case_076", "p03343_case_077", "p03343_case_078", "p03343_case_079", "p03343_case_080", "p03343_case_081", "p03343_case_082", "p03343_case_083", "p03343_case_084", "p03343_case_085", "p03343_case_086", "p03343_case_087", "p03343_case_088", "p03343_case_089", "p03343_case_090", "p03343_case_091", "p03343_case_092", "p03343_case_093", "p03343_case_094", "p03343_case_095", "p03343_case_096", "p03343_case_097", "p03343_case_098", "p03343_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def add_list(buf, new_lists, removals):\n l = len(buf)\n if l >= k:\n sbf = sorted(buf)\n removals.extend(sbf[: l - k + 1])\n new_lists.append(buf)\n\n\nn, k, q = list(map(int, input().split()))\naaa = list(map(int, input().split()))\nsrt = sorted(set(aaa))\nlists = [aaa]\nans = float(\"inf\")\nfor a in srt:\n new_lists = []\n removals = []\n for lst in lists:\n buf = []\n for b in lst:\n if a > b:\n add_list(buf, new_lists, removals)\n buf = []\n else:\n buf.append(b)\n add_list(buf, new_lists, removals)\n if len(removals) < q:\n break\n removals.sort()\n ans = min(ans, removals[q - 1] - a)\nprint(ans)\n", "fast_code_sha256": "6305e9ddb2b1667c0af4f74e76a3d3dd65823679375cdc3b19cb654397c9a2af", "fast_id": "p03343_6305e9ddb2b1667c0af4f74e76a3d3dd65823679375cdc3b19cb654397c9a2af", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def add_list(buf, new_lists, removals):\n l = len(buf)\n if l >= k:\n sbf = sorted(buf)\n removals.extend(sbf[: l - k + 1])\n new_lists.append(buf)\n\n\nn, k, q = list(map(int, input().split()))\naaa = list(map(int, input().split()))\nsrt = sorted(set(aaa))\nlists = [aaa]\nans = float(\"inf\")\nfor a in srt:\n new_lists = []\n removals = []\n for lst in lists:\n buf = []\n for b in lst:\n if a > b:\n add_list(buf, new_lists, removals)\n buf = []\n else:\n buf.append(b)\n add_list(buf, new_lists, removals)\n if len(removals) < q:\n break\n removals.sort()\n ans = min(ans, removals[q - 1] - a)\nprint(ans)\n", "measured_fast_code_sha256": "6305e9ddb2b1667c0af4f74e76a3d3dd65823679375cdc3b19cb654397c9a2af", "measured_slow_code": "# -*- coding: utf-8 -*-\nimport sys\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef list2d(a, b, c):\n return [[c] * b for i in range(a)]\n\n\ndef list3d(a, b, c, d):\n return [[[d] * c for j in range(b)] for i in range(a)]\n\n\ndef list4d(a, b, c, d, e):\n return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]\n\n\ndef ceil(x, y=1):\n return int(-(-x // y))\n\n\ndef INT():\n return int(eval(input()))\n\n\ndef MAP():\n return list(map(int, input().split()))\n\n\ndef LIST(N=None):\n return list(MAP()) if N is None else [INT() for i in range(N)]\n\n\ndef Yes():\n print(\"Yes\")\n\n\ndef No():\n print(\"No\")\n\n\ndef YES():\n print(\"YES\")\n\n\ndef NO():\n print(\"NO\")\n\n\nsys.setrecursionlimit(10**9)\nINF = 10**18\nMOD = 10**9 + 7\nN, K, Q = MAP()\nA = LIST()\nans = INF\n# 使う要素の最小値とする値xを全探索\nfor x in A:\n # 数列Aをx未満の値で区切った数列Bを作る\n B = []\n tmp = []\n for i in range(N):\n if A[i] >= x:\n tmp.append(A[i])\n else:\n B.append(tmp)\n tmp = []\n B.append(tmp)\n # 数列B内の各数列から、使える要素を集める\n C = []\n for li in B:\n m = len(li)\n li.sort()\n C += li[: max(m - K + 1, 0)]\n # 集めた要素からQ個をクエリで使うので、小さい方からQ番目が使う要素の最大値y\n C.sort()\n if len(C) < Q:\n continue\n y = C[Q - 1]\n ans = min(ans, y - x)\nprint(ans)\n", "measured_slow_code_sha256": "ef947df7a2b51b142fd32b0ad45c1379627ad36a71edf5b9b3a3be600c27d1cc", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1199.2580710464194, "pair_id": "python_v2_b0ebaa421cb64e72432cafca", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03343", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03343_6305e9ddb2b1667c0af4f74e76a3d3dd65823679375cdc3b19cb654397c9a2af.jsonl.gz", "inputs": "reproduction/python/inputs/p03343.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03343_ef947df7a2b51b142fd32b0ad45c1379627ad36a71edf5b9b3a3be600c27d1cc.jsonl.gz"}, "slow_code": "import sys\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef list2d(a, b, c):\n return [[c] * b for i in range(a)]\n\n\ndef list3d(a, b, c, d):\n return [[[d] * c for j in range(b)] for i in range(a)]\n\n\ndef list4d(a, b, c, d, e):\n return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]\n\n\ndef ceil(x, y=1):\n return int(-(-x // y))\n\n\ndef INT():\n return int(eval(input()))\n\n\ndef MAP():\n return list(map(int, input().split()))\n\n\ndef LIST(N=None):\n return list(MAP()) if N is None else [INT() for i in range(N)]\n\n\ndef Yes():\n print(\"Yes\")\n\n\ndef No():\n print(\"No\")\n\n\ndef YES():\n print(\"YES\")\n\n\ndef NO():\n print(\"NO\")\n\n\nsys.setrecursionlimit(10**9)\nINF = 10**18\nMOD = 10**9 + 7\nN, K, Q = MAP()\nA = LIST()\nans = INF\n\nfor x in A:\n\n B = []\n tmp = []\n for i in range(N):\n if A[i] >= x:\n tmp.append(A[i])\n else:\n B.append(tmp)\n tmp = []\n B.append(tmp)\n\n C = []\n for li in B:\n m = len(li)\n li.sort()\n C += li[: max(m - K + 1, 0)]\n\n C.sort()\n if len(C) < Q:\n continue\n y = C[Q - 1]\n ans = min(ans, y - x)\nprint(ans)\n", "slow_code_sha256": "138340e043a3bdb60eabde4fbfefa619cd52b53cdd3b075b3c73d719f5c82be1", "slow_id": "p03343_ef947df7a2b51b142fd32b0ad45c1379627ad36a71edf5b9b3a3be600c27d1cc", "speedup": 412.2618599053771, "stratum": "8+", "within_pair_jaccard": 0.2235294117647059, "workload": {"case_count": 100, "description": "Repeat Q times: choose K consecutive entries of the current sequence and remove one minimum entry from that block. Minimize the largest removed value minus the smallest over all Q removals. Observed inputs: N=1..2000 (median 2000); K=1..2000 (median 1000); Q=1..2000 (median 1000); A_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 22012, "median": 19779.0, "min": 8}, "input_format": ["N K Q\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2003, "median": 2003.0, "min": 4}}} -{"case_ids": ["p03222_case_000", "p03222_case_001", "p03222_case_002", "p03222_case_003", "p03222_case_004", "p03222_case_005", "p03222_case_006", "p03222_case_007", "p03222_case_008", "p03222_case_009", "p03222_case_010", "p03222_case_011", "p03222_case_012", "p03222_case_013", "p03222_case_014", "p03222_case_015", "p03222_case_016", "p03222_case_017", "p03222_case_018", "p03222_case_019", "p03222_case_020", "p03222_case_021", "p03222_case_022", "p03222_case_023", "p03222_case_024", "p03222_case_025", "p03222_case_026", "p03222_case_027", "p03222_case_028", "p03222_case_029", "p03222_case_030", "p03222_case_031", "p03222_case_032", "p03222_case_033", "p03222_case_034", "p03222_case_035", "p03222_case_036", "p03222_case_037", "p03222_case_038", "p03222_case_039", "p03222_case_040", "p03222_case_041", "p03222_case_042", "p03222_case_043", "p03222_case_044", "p03222_case_045", "p03222_case_046", "p03222_case_047", "p03222_case_048", "p03222_case_049", "p03222_case_050", "p03222_case_051", "p03222_case_052", "p03222_case_053", "p03222_case_054", "p03222_case_055", "p03222_case_056", "p03222_case_057", "p03222_case_058", "p03222_case_059", "p03222_case_060", "p03222_case_061", "p03222_case_062", "p03222_case_063", "p03222_case_064", "p03222_case_065", "p03222_case_066", "p03222_case_067", "p03222_case_068", "p03222_case_069", "p03222_case_070", "p03222_case_071", "p03222_case_072", "p03222_case_073", "p03222_case_074", "p03222_case_075", "p03222_case_076", "p03222_case_077", "p03222_case_078", "p03222_case_079", "p03222_case_080", "p03222_case_081", "p03222_case_082", "p03222_case_083", "p03222_case_084", "p03222_case_085", "p03222_case_086", "p03222_case_087", "p03222_case_088", "p03222_case_089", "p03222_case_090", "p03222_case_091", "p03222_case_092", "p03222_case_093", "p03222_case_094", "p03222_case_095", "p03222_case_096", "p03222_case_097", "p03222_case_098", "p03222_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "h, w, k = list(map(int, input().split()))\ndp = [0] * w\nmod = 10**9 + 7\ncomb = []\nfor bit in range(1 << w - 1):\n ok = True\n for j in range(w - 2):\n if bit >> j & 1 and bit >> j + 1 & 1:\n ok = False\n if ok:\n comb.append(bit)\ndp[0] = 1\nfor i in range(h):\n next = [0] * w\n for bit in comb:\n moved = [False] * w\n for j in range(w):\n if bit >> j & 1:\n next[j + 1] += dp[j]\n next[j] += dp[j + 1]\n moved[j] = moved[j + 1] = True\n elif not moved[j]:\n next[j] += dp[j]\n dp = next\nprint((dp[k - 1] % mod))\n", "fast_code_sha256": "c5dab9e03ff784c04c40588c029e44e112920a371722ed385bc1c8e4cce06aa5", "fast_id": "p03222_c5dab9e03ff784c04c40588c029e44e112920a371722ed385bc1c8e4cce06aa5", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "h, w, k = list(map(int, input().split()))\ndp = [0] * w\nmod = 10**9 + 7\ncomb = []\nfor bit in range(1 << w - 1):\n ok = True\n for j in range(w - 2):\n if bit >> j & 1 and bit >> j + 1 & 1:\n ok = False\n if ok:\n comb.append(bit)\ndp[0] = 1\nfor i in range(h):\n next = [0] * w\n for bit in comb:\n moved = [False] * w\n for j in range(w):\n if bit >> j & 1:\n next[j + 1] += dp[j]\n next[j] += dp[j + 1]\n moved[j] = moved[j + 1] = True\n elif not moved[j]:\n next[j] += dp[j]\n dp = next\nprint((dp[k - 1] % mod))\n", "measured_fast_code_sha256": "c5dab9e03ff784c04c40588c029e44e112920a371722ed385bc1c8e4cce06aa5", "measured_slow_code": "import sys\n\nmod = pow(10, 9) + 7\n\n\ndef mul(a, b):\n return ((a % mod) * (b % mod)) % mod\n\n\ndef cmb(n, r, mod):\n if r < 0 or r > n:\n return 0\n r = min(r, n - r)\n return g1[n] * g2[r] * g2[n - r] % mod\n\n\nNNN = (10**5) * 2\ng1 = [1, 1]\ng2 = [1, 1]\ninverse = [0, 1]\nfor i in range(2, NNN + 1):\n g1.append((g1[-1] * i) % mod)\n inverse.append((-inverse[mod % i] * (mod // i)) % mod)\n g2.append((g2[-1] * inverse[-1]) % mod)\n\n\ndef erabu(aW):\n r = 0\n for i in range(aW // 2 + 1 + 1):\n sp = aW - (2 * i - 1)\n r += cmb(sp + i + 1 - 1, sp, mod)\n return r\n\n\nN, W, K = [int(x) for x in input().strip().split(\" \")]\nhasi = 0\ncc = []\nif W == 1:\n if K == 1:\n print((1))\n else:\n print((0))\n sys.exit()\nelif W == 2:\n cccl = [1, 1]\n cc = [1, 1]\nelif W == 3:\n cccl = [1, 1, 1]\n cc = [2, 1, 2]\nelif W >= 4:\n aW = W - 1\n hW = aW - 2\n nhW = aW - 3\n cc = []\n cccl = []\n for w in range(W):\n nn = max(W - 1 - w - 1, 0)\n nnn = max((W - 1) - nn - 2, 0)\n if w == W - 1:\n nnn += 1\n cc.append(erabu(nn) * erabu(nnn))\n cccl.append(erabu(nn) * erabu(nnn - 1))\ncccl[0] = 0\ncccr = cccl[::-1]\nd = [1] + [0 for x in range(W - 1)]\nfor i in range(N):\n newd = []\n for j in range(W):\n newd.append(0)\n if j != 0:\n newd[j] = (newd[j] + (d[j - 1] * cccl[j])) % mod\n if j != W - 1:\n newd[j] = (newd[j] + (d[j + 1] * cccr[j])) % mod\n newd[j] = (newd[j] + (d[j] * cc[j])) % mod\n d = newd[:]\nprint((d[K - 1]))\n", "measured_slow_code_sha256": "a167fb2840bdcc6405e113c019a821d25f7acfa038b67804c34bff12a9edb446", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 181.11859939903093, "pair_id": "python_v2_d22adbc39a976f0a7a929faf", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03222", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03222_c5dab9e03ff784c04c40588c029e44e112920a371722ed385bc1c8e4cce06aa5.jsonl.gz", "inputs": "reproduction/python/inputs/p03222.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03222_a167fb2840bdcc6405e113c019a821d25f7acfa038b67804c34bff12a9edb446.jsonl.gz"}, "slow_code": "import sys\n\nmod = pow(10, 9) + 7\n\n\ndef mul(a, b):\n return ((a % mod) * (b % mod)) % mod\n\n\ndef cmb(n, r, mod):\n if r < 0 or r > n:\n return 0\n r = min(r, n - r)\n return g1[n] * g2[r] * g2[n - r] % mod\n\n\nNNN = (10**5) * 2\ng1 = [1, 1]\ng2 = [1, 1]\ninverse = [0, 1]\nfor i in range(2, NNN + 1):\n g1.append((g1[-1] * i) % mod)\n inverse.append((-inverse[mod % i] * (mod // i)) % mod)\n g2.append((g2[-1] * inverse[-1]) % mod)\n\n\ndef erabu(aW):\n r = 0\n for i in range(aW // 2 + 1 + 1):\n sp = aW - (2 * i - 1)\n r += cmb(sp + i + 1 - 1, sp, mod)\n return r\n\n\nN, W, K = [int(x) for x in input().strip().split(\" \")]\nhasi = 0\ncc = []\nif W == 1:\n if K == 1:\n print((1))\n else:\n print((0))\n sys.exit()\nelif W == 2:\n cccl = [1, 1]\n cc = [1, 1]\nelif W == 3:\n cccl = [1, 1, 1]\n cc = [2, 1, 2]\nelif W >= 4:\n aW = W - 1\n hW = aW - 2\n nhW = aW - 3\n cc = []\n cccl = []\n for w in range(W):\n nn = max(W - 1 - w - 1, 0)\n nnn = max((W - 1) - nn - 2, 0)\n if w == W - 1:\n nnn += 1\n cc.append(erabu(nn) * erabu(nnn))\n cccl.append(erabu(nn) * erabu(nnn - 1))\ncccl[0] = 0\ncccr = cccl[::-1]\nd = [1] + [0 for x in range(W - 1)]\nfor i in range(N):\n newd = []\n for j in range(W):\n newd.append(0)\n if j != 0:\n newd[j] = (newd[j] + (d[j - 1] * cccl[j])) % mod\n if j != W - 1:\n newd[j] = (newd[j] + (d[j + 1] * cccr[j])) % mod\n newd[j] = (newd[j] + (d[j] * cc[j])) % mod\n d = newd[:]\nprint((d[K - 1]))\n", "slow_code_sha256": "a167fb2840bdcc6405e113c019a821d25f7acfa038b67804c34bff12a9edb446", "slow_id": "p03222_a167fb2840bdcc6405e113c019a821d25f7acfa038b67804c34bff12a9edb446", "speedup": 187.9843368931874, "stratum": "8+", "within_pair_jaccard": 0.26666666666666666, "workload": {"case_count": 100, "description": "Count ladder lotteries with W vertical lines and H horizontal levels. At each level, links join adjacent verticals and cannot share endpoints. Following links from the top-left must end at bottom column K. Output modulo 1000000007. Observed inputs: H=1..100 (median 50); W=1..8 (median 5); K=1..8 (median 2.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 8, "median": 7.0, "min": 6}, "input_format": ["H W K"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3, "median": 3.0, "min": 3}}} -{"case_ids": ["p03330_case_000", "p03330_case_001", "p03330_case_002", "p03330_case_003", "p03330_case_004", "p03330_case_005", "p03330_case_006", "p03330_case_007", "p03330_case_008", "p03330_case_009", "p03330_case_010", "p03330_case_011", "p03330_case_012", "p03330_case_013", "p03330_case_014", "p03330_case_015", "p03330_case_016", "p03330_case_017", "p03330_case_018", "p03330_case_019", "p03330_case_020", "p03330_case_021", "p03330_case_022", "p03330_case_023", "p03330_case_024", "p03330_case_025", "p03330_case_026", "p03330_case_027", "p03330_case_028", "p03330_case_029", "p03330_case_030", "p03330_case_031", "p03330_case_032", "p03330_case_033", "p03330_case_034", "p03330_case_035", "p03330_case_036", "p03330_case_037", "p03330_case_038", "p03330_case_039", "p03330_case_040", "p03330_case_041", "p03330_case_042", "p03330_case_043", "p03330_case_044", "p03330_case_045", "p03330_case_046", "p03330_case_047", "p03330_case_048", "p03330_case_049", "p03330_case_050", "p03330_case_051", "p03330_case_052", "p03330_case_053", "p03330_case_054", "p03330_case_055", "p03330_case_056", "p03330_case_057", "p03330_case_058", "p03330_case_059", "p03330_case_060", "p03330_case_061", "p03330_case_062", "p03330_case_063", "p03330_case_064", "p03330_case_065", "p03330_case_066", "p03330_case_067", "p03330_case_068", "p03330_case_069", "p03330_case_070", "p03330_case_071", "p03330_case_072", "p03330_case_073", "p03330_case_074", "p03330_case_075", "p03330_case_076", "p03330_case_077", "p03330_case_078", "p03330_case_079", "p03330_case_080", "p03330_case_081", "p03330_case_082", "p03330_case_083", "p03330_case_084", "p03330_case_085", "p03330_case_086", "p03330_case_087", "p03330_case_088", "p03330_case_089", "p03330_case_090", "p03330_case_091", "p03330_case_092", "p03330_case_093", "p03330_case_094", "p03330_case_095", "p03330_case_096", "p03330_case_097", "p03330_case_098", "p03330_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from itertools import *\n\nN, C = list(map(int, input().split()))\nD = [list(map(int, input().split())) for _ in [0] * C]\ntri = [[0] * C for _ in [0] * 3]\nfor i in range(N):\n for j, x in enumerate(map(int, input().split())):\n tri[(i + j) % 3][x - 1] += 1\nres = 1 << 30\nfor p in permutations(list(range(C)), 3):\n tt = sum(D[l][p[m]] * tri[m][l] for l in range(C) for m in range(3))\n if tt < res:\n res = tt\nprint(res)\n", "fast_code_sha256": "b97bdcab53517dc8917d09f39912f401cd28969a8fb4fb761200b0bf70667016", "fast_id": "p03330_b97bdcab53517dc8917d09f39912f401cd28969a8fb4fb761200b0bf70667016", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from itertools import *\n\nN, C = list(map(int, input().split()))\nD = [list(map(int, input().split())) for _ in [0] * C]\ntri = [[0] * C for _ in [0] * 3]\nfor i in range(N):\n for j, x in enumerate(map(int, input().split())):\n tri[(i + j) % 3][x - 1] += 1\nres = 1 << 30\nfor p in permutations(list(range(C)), 3):\n tt = sum(D[l][p[m]] * tri[m][l] for l in range(C) for m in range(3))\n if tt < res:\n res = tt\nprint(res)\n", "measured_fast_code_sha256": "b97bdcab53517dc8917d09f39912f401cd28969a8fb4fb761200b0bf70667016", "measured_slow_code": "from collections import defaultdict\n\nN, C = list(map(int, input().split()))\nD = [tuple(map(int, input().split())) for _ in range(C)]\nd = [defaultdict(int) for i in range(3)]\nfor i in range(N):\n c = [int(x) for x in input().split()]\n for j in range(N):\n for k in range(C):\n d[(i + j) % 3][k] += D[c[j] - 1][k]\n# print(d)\nans = 10**9\nfor i in range(C):\n for j in range(C):\n for k in range(C):\n if i != j and j != k and k != i:\n ans = min(ans, d[0][i] + d[1][j] + d[2][k])\nprint(ans)\n", "measured_slow_code_sha256": "c02a11b7b5b1b315914b965fdf3ecfb4358b57b2c3925ddf481c4eb6e9760d11", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4.293838823236918, "pair_id": "python_v2_597ab1b466834c4836ec3c74", "per_case_slow_code_faster_fraction": 0.07, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03330", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03330_b97bdcab53517dc8917d09f39912f401cd28969a8fb4fb761200b0bf70667016.jsonl.gz", "inputs": "reproduction/python/inputs/p03330.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03330_c02a11b7b5b1b315914b965fdf3ecfb4358b57b2c3925ddf481c4eb6e9760d11.jsonl.gz"}, "slow_code": "from collections import defaultdict\n\nN, C = list(map(int, input().split()))\nD = [tuple(map(int, input().split())) for _ in range(C)]\nd = [defaultdict(int) for i in range(3)]\nfor i in range(N):\n c = [int(x) for x in input().split()]\n for j in range(N):\n for k in range(C):\n d[(i + j) % 3][k] += D[c[j] - 1][k]\n\nans = 10**9\nfor i in range(C):\n for j in range(C):\n for k in range(C):\n if i != j and j != k and k != i:\n ans = min(ans, d[0][i] + d[1][j] + d[2][k])\nprint(ans)\n", "slow_code_sha256": "b26d76a0f9b29fa38bb4e81f3bd1f83b96fba757a97a758a390f98fa3fc78913", "slow_id": "p03330_c02a11b7b5b1b315914b965fdf3ecfb4358b57b2c3925ddf481c4eb6e9760d11", "speedup": 2.632594208523675, "stratum": "2-4", "within_pair_jaccard": 0.4888888888888889, "workload": {"case_count": 100, "description": "Repaint an N-by-N grid using C colors with cost D_X,Y for changing X to Y. All cells sharing (row+column) mod 3 must finish with one common color, and the three residue classes must use distinct colors. Minimize total cost. Observed inputs: N=1..500 (median 500); C=3..30 (median 30); grid_cells=1..250000; D_i_j=0..1000; color=1..30.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 753462, "median": 500951.5, "min": 24}, "input_format": ["N C\nD_1,1 ... D_1,C\n...\nD_C,1 ... D_C,C\nc_1,1 ... c_1,N\n...\nc_N,1 ... c_N,N"], "input_format_status": "source_input_section", "input_lines": {"max": 531, "median": 518.5, "min": 5}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 250902, "median": 250464.5, "min": 12}}} -{"case_ids": ["p01224_case_000", "p01224_case_001", "p01224_case_002", "p01224_case_003", "p01224_case_004", "p01224_case_005", "p01224_case_006", "p01224_case_007", "p01224_case_008", "p01224_case_009", "p01224_case_010", "p01224_case_011", "p01224_case_012", "p01224_case_013", "p01224_case_014", "p01224_case_015", "p01224_case_016", "p01224_case_017", "p01224_case_018", "p01224_case_019", "p01224_case_020", "p01224_case_021", "p01224_case_022", "p01224_case_023", "p01224_case_024", "p01224_case_025", "p01224_case_026", "p01224_case_027", "p01224_case_028", "p01224_case_029", "p01224_case_030", "p01224_case_031", "p01224_case_032", "p01224_case_033", "p01224_case_034", "p01224_case_035", "p01224_case_036", "p01224_case_037", "p01224_case_038", "p01224_case_039", "p01224_case_040", "p01224_case_041", "p01224_case_042", "p01224_case_043", "p01224_case_044", "p01224_case_045", "p01224_case_046", "p01224_case_047", "p01224_case_048", "p01224_case_049", "p01224_case_050", "p01224_case_051", "p01224_case_052", "p01224_case_053", "p01224_case_054", "p01224_case_055", "p01224_case_056", "p01224_case_057", "p01224_case_058", "p01224_case_059", "p01224_case_060", "p01224_case_061", "p01224_case_062", "p01224_case_063", "p01224_case_064", "p01224_case_065", "p01224_case_066", "p01224_case_067", "p01224_case_068", "p01224_case_069", "p01224_case_070", "p01224_case_071", "p01224_case_072", "p01224_case_073", "p01224_case_074", "p01224_case_075", "p01224_case_076", "p01224_case_077", "p01224_case_078", "p01224_case_079", "p01224_case_080", "p01224_case_081", "p01224_case_082", "p01224_case_083", "p01224_case_084", "p01224_case_085", "p01224_case_086", "p01224_case_087", "p01224_case_088", "p01224_case_089", "p01224_case_090", "p01224_case_091", "p01224_case_092", "p01224_case_093", "p01224_case_094", "p01224_case_095", "p01224_case_096", "p01224_case_097", "p01224_case_098", "p01224_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def SumOfDiv(n):\n i = 2\n ans = 1\n while i * i <= n:\n c = 0\n while n % i == 0:\n n /= i\n c += 1\n if c > 0:\n ans *= (i ** (c + 1) - 1) / (i - 1)\n i += 1\n if n > 1:\n ans *= 1 + n\n return ans\n\n\nwhile 1:\n n = eval(input())\n if n == 0:\n break\n d = SumOfDiv(n) - n\n if d == n:\n print(\"perfect number\")\n elif d < n:\n print(\"deficient number\")\n else:\n print(\"abundant number\")\n", "fast_code_sha256": "9cc3e6d9352dd4eabc72eacfa693573c9edd5312536391bdffa5fb541ae53660", "fast_id": "p01224_9cc3e6d9352dd4eabc72eacfa693573c9edd5312536391bdffa5fb541ae53660", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def SumOfDiv(n):\n i = 2\n ans = 1\n while i * i <= n:\n c = 0\n while n % i == 0:\n n /= i\n c += 1\n if c > 0:\n ans *= (i ** (c + 1) - 1) / (i - 1)\n i += 1\n if n > 1:\n ans *= 1 + n\n return ans\n\n\nwhile 1:\n n = eval(input())\n if n == 0:\n break\n d = SumOfDiv(n) - n\n if d == n:\n print(\"perfect number\")\n elif d < n:\n print(\"deficient number\")\n else:\n print(\"abundant number\")\n", "measured_fast_code_sha256": "9cc3e6d9352dd4eabc72eacfa693573c9edd5312536391bdffa5fb541ae53660", "measured_slow_code": "from math import sqrt\n\nP = \"perfect number\"\nD = \"deficient number\"\nA = \"abundant number\"\nwhile True:\n n = eval(input())\n if n == 0:\n break\n if n == 1:\n print(D)\n continue\n su = 1\n temp = n\n for i in range(2, int(sqrt(n)) + 1):\n cnt = 0\n while temp % i == 0:\n temp /= i\n cnt += 1\n if cnt:\n su *= (i ** (cnt + 1) - 1) / (i - 1)\n if temp == 1:\n su -= n\n break\n if temp != 1:\n su *= (temp**2 - 1) / (temp - 1)\n su -= n\n print(P if n == su else (D if su < n else A))\n", "measured_slow_code_sha256": "66194bc1a7ae54de44e09b5f93d1f79e3416a467c501ca1310dc3f13610e492e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.2975120357115746, "pair_id": "python_v2_a13616d1a55e99861b06e82a", "per_case_slow_code_faster_fraction": 0.01, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p01224", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p01224_9cc3e6d9352dd4eabc72eacfa693573c9edd5312536391bdffa5fb541ae53660.jsonl.gz", "inputs": "reproduction/python/inputs/p01224.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p01224_66194bc1a7ae54de44e09b5f93d1f79e3416a467c501ca1310dc3f13610e492e.jsonl.gz"}, "slow_code": "from math import sqrt\n\nP = \"perfect number\"\nD = \"deficient number\"\nA = \"abundant number\"\nwhile True:\n n = eval(input())\n if n == 0:\n break\n if n == 1:\n print(D)\n continue\n su = 1\n temp = n\n for i in range(2, int(sqrt(n)) + 1):\n cnt = 0\n while temp % i == 0:\n temp /= i\n cnt += 1\n if cnt:\n su *= (i ** (cnt + 1) - 1) / (i - 1)\n if temp == 1:\n su -= n\n break\n if temp != 1:\n su *= (temp**2 - 1) / (temp - 1)\n su -= n\n print(P if n == su else (D if su < n else A))\n", "slow_code_sha256": "66194bc1a7ae54de44e09b5f93d1f79e3416a467c501ca1310dc3f13610e492e", "slow_id": "p01224_66194bc1a7ae54de44e09b5f93d1f79e3416a467c501ca1310dc3f13610e492e", "speedup": 2.439098883721352, "stratum": "2-4", "within_pair_jaccard": 0.41025641025641024, "workload": {"case_count": 100, "description": "For each positive integer N, compare N with the sum of its positive divisors excluding N itself. Classify it as perfect, deficient or abundant when the sum equals, is below or exceeds N, respectively. A final zero ends the queries. Observed inputs: datasets=1..100 (median 50); N=1..100000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 896, "median": 202.0, "min": 4}, "input_format": ["N_1\n...\nN_D\n0"], "input_format_status": "source_input_section", "input_lines": {"max": 101, "median": 51.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 101, "median": 51.0, "min": 2}}} -{"case_ids": ["p03126_case_000", "p03126_case_001", "p03126_case_002", "p03126_case_003", "p03126_case_004", "p03126_case_005", "p03126_case_006", "p03126_case_007", "p03126_case_008", "p03126_case_009", "p03126_case_010", "p03126_case_011", "p03126_case_012", "p03126_case_013", "p03126_case_014", "p03126_case_015", "p03126_case_016", "p03126_case_017", "p03126_case_018", "p03126_case_019", "p03126_case_020", "p03126_case_021", "p03126_case_022", "p03126_case_023", "p03126_case_024", "p03126_case_025", "p03126_case_026", "p03126_case_027", "p03126_case_028", "p03126_case_029", "p03126_case_030", "p03126_case_031", "p03126_case_032", "p03126_case_033", "p03126_case_034", "p03126_case_035", "p03126_case_036", "p03126_case_037", "p03126_case_038", "p03126_case_039", "p03126_case_040", "p03126_case_041", "p03126_case_042", "p03126_case_043", "p03126_case_044", "p03126_case_045", "p03126_case_046", "p03126_case_047", "p03126_case_048", "p03126_case_049", "p03126_case_050", "p03126_case_051", "p03126_case_052", "p03126_case_053", "p03126_case_054", "p03126_case_055", "p03126_case_056", "p03126_case_057", "p03126_case_058", "p03126_case_059", "p03126_case_060", "p03126_case_061", "p03126_case_062", "p03126_case_063", "p03126_case_064", "p03126_case_065", "p03126_case_066", "p03126_case_067", "p03126_case_068", "p03126_case_069", "p03126_case_070", "p03126_case_071", "p03126_case_072", "p03126_case_073", "p03126_case_074", "p03126_case_075", "p03126_case_076", "p03126_case_077", "p03126_case_078", "p03126_case_079", "p03126_case_080", "p03126_case_081", "p03126_case_082", "p03126_case_083", "p03126_case_084", "p03126_case_085", "p03126_case_086", "p03126_case_087", "p03126_case_088", "p03126_case_089", "p03126_case_090", "p03126_case_091", "p03126_case_092", "p03126_case_093", "p03126_case_094", "p03126_case_095", "p03126_case_096", "p03126_case_097", "p03126_case_098", "p03126_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N, M = list(map(int, input().split()))\nK, A = list(\n zip(\n *(\n (int(t[0]), list(map(int, t[1].split())))\n for t in (input().split(maxsplit=1) for _ in range(N))\n )\n )\n)\n\nans = sum(all(k in a for a in A) for k in range(1, M + 1))\n\nprint(ans)\n", "fast_code_sha256": "4b31fcf95a6771a32042359b4ecae0e7a810ce09114472d2a2c2eda17f60eaea", "fast_id": "p03126_3857942893fe134341268787703de41ac4ff414e5683379f27a53456603d90d6", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "# 入力\nN, M = list(map(int, input().split()))\nK, A = list(\n zip(\n *(\n (int(t[0]), list(map(int, t[1].split())))\n for t in (input().split(maxsplit=1) for _ in range(N))\n )\n )\n)\n# 素直にカウント\nans = sum(all(k in a for a in A) for k in range(1, M + 1))\n# 出力\nprint(ans)\n", "measured_fast_code_sha256": "3857942893fe134341268787703de41ac4ff414e5683379f27a53456603d90d6", "measured_slow_code": "N, M = list(map(int, input().split()))\nK = [0] * N\nA = [list(map(int, input().split())) for i in range(N)]\ncount = 0\nfor i in range(1, M + 1, 1):\n likecount = 0\n for j in range(N):\n for k in range(1, A[j][0] + 1, 1):\n if A[j][k] == i:\n likecount += 1\n if likecount == N:\n count += 1\nprint(count)\n", "measured_slow_code_sha256": "0f7452cbac3152780e6e45e4ccdb0d439fed784a94d652759a76c518063b3e0f", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.006255797702202, "pair_id": "python_v2_d603e73e84aab364af5fb118", "per_case_slow_code_faster_fraction": 0.08, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03126", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03126_3857942893fe134341268787703de41ac4ff414e5683379f27a53456603d90d6.jsonl.gz", "inputs": "reproduction/python/inputs/p03126.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03126_0f7452cbac3152780e6e45e4ccdb0d439fed784a94d652759a76c518063b3e0f.jsonl.gz"}, "slow_code": "N, M = list(map(int, input().split()))\nK = [0] * N\nA = [list(map(int, input().split())) for i in range(N)]\ncount = 0\nfor i in range(1, M + 1, 1):\n likecount = 0\n for j in range(N):\n for k in range(1, A[j][0] + 1, 1):\n if A[j][k] == i:\n likecount += 1\n if likecount == N:\n count += 1\nprint(count)\n", "slow_code_sha256": "0f7452cbac3152780e6e45e4ccdb0d439fed784a94d652759a76c518063b3e0f", "slow_id": "p03126_0f7452cbac3152780e6e45e4ccdb0d439fed784a94d652759a76c518063b3e0f", "speedup": 2.9111843269796447, "stratum": "2-4", "within_pair_jaccard": 0.5517241379310345, "workload": {"case_count": 100, "description": "Each of N people lists K_i distinct liked food IDs A_i,j from 1..M. Count food kinds liked by every person; the lists need not be sorted. Observed inputs: N=1..30 (median 13); M=1..30 (median 15); K_i=1..30.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 2526, "median": 177.0, "min": 8}, "input_format": ["N M\nK_1 A_1,1 ... A_1,K_1\n...\nK_N A_N,1 ... A_N,K_N"], "input_format_status": "source_input_section", "input_lines": {"max": 31, "median": 14.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 932, "median": 83.0, "min": 4}}} -{"case_ids": ["p03972_case_000", "p03972_case_001", "p03972_case_002", "p03972_case_003", "p03972_case_004", "p03972_case_005", "p03972_case_006", "p03972_case_007", "p03972_case_008", "p03972_case_009", "p03972_case_010", "p03972_case_011", "p03972_case_012", "p03972_case_013", "p03972_case_014", "p03972_case_015", "p03972_case_016", "p03972_case_017", "p03972_case_018", "p03972_case_019", "p03972_case_020", "p03972_case_021", "p03972_case_022", "p03972_case_023", "p03972_case_024", "p03972_case_025", "p03972_case_026", "p03972_case_027", "p03972_case_028", "p03972_case_029", "p03972_case_030", "p03972_case_031", "p03972_case_032", "p03972_case_033", "p03972_case_034", "p03972_case_035", "p03972_case_036", "p03972_case_037", "p03972_case_038", "p03972_case_039", "p03972_case_040", "p03972_case_041", "p03972_case_042", "p03972_case_043", "p03972_case_044", "p03972_case_045", "p03972_case_046", "p03972_case_047", "p03972_case_048", "p03972_case_049", "p03972_case_050", "p03972_case_051", "p03972_case_052", "p03972_case_053", "p03972_case_054", "p03972_case_055", "p03972_case_056", "p03972_case_057", "p03972_case_058", "p03972_case_059", "p03972_case_060", "p03972_case_061", "p03972_case_062", "p03972_case_063", "p03972_case_064", "p03972_case_065", "p03972_case_066", "p03972_case_067", "p03972_case_068", "p03972_case_069", "p03972_case_070", "p03972_case_071", "p03972_case_072", "p03972_case_073", "p03972_case_074", "p03972_case_075", "p03972_case_076", "p03972_case_077", "p03972_case_078", "p03972_case_079", "p03972_case_080", "p03972_case_081", "p03972_case_082", "p03972_case_083", "p03972_case_084", "p03972_case_085", "p03972_case_086", "p03972_case_087", "p03972_case_088", "p03972_case_089", "p03972_case_090", "p03972_case_091", "p03972_case_092", "p03972_case_093", "p03972_case_094", "p03972_case_095", "p03972_case_096", "p03972_case_097", "p03972_case_098", "p03972_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "w, h, *L = list(map(int, open(0).read().split()))\nP = L[:w]\nQ = L[w:]\nx, y = w, h\nsss = []\nfor i, pi in enumerate(P):\n sss.append((pi, 1))\nfor j, qj in enumerate(Q):\n sss.append((qj, 0))\nsss.sort()\nans = 0\nfor c, f in sss:\n if f and x:\n x -= 1\n ans += c * (y + 1)\n elif not f and y:\n y -= 1\n ans += c * (x + 1)\nprint(ans)\n", "fast_code_sha256": "756f91ac6d1695db876a99ea6c409e2ecc2d89bc9ced2cac5f118d0dce505fbd", "fast_id": "p03972_756f91ac6d1695db876a99ea6c409e2ecc2d89bc9ced2cac5f118d0dce505fbd", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "w, h, *L = list(map(int, open(0).read().split()))\nP = L[:w]\nQ = L[w:]\nx, y = w, h\nsss = []\nfor i, pi in enumerate(P):\n sss.append((pi, 1))\nfor j, qj in enumerate(Q):\n sss.append((qj, 0))\nsss.sort()\nans = 0\nfor c, f in sss:\n if f and x:\n x -= 1\n ans += c * (y + 1)\n elif not f and y:\n y -= 1\n ans += c * (x + 1)\nprint(ans)\n", "measured_fast_code_sha256": "756f91ac6d1695db876a99ea6c409e2ecc2d89bc9ced2cac5f118d0dce505fbd", "measured_slow_code": "import sys\n\ninput = sys.stdin.readline\nfrom bisect import bisect_left, bisect_right\n\nW, H = list(map(int, input().split()))\nP = [int(eval(input())) for _ in range(W)]\nP.sort()\nQ = [int(eval(input())) for _ in range(H)]\nQ.sort()\nans = 0\nfor q in Q:\n tmp = bisect_right(P, q)\n # print ('tmp=', tmp)\n ans += q * (1 + W - tmp)\n # print (ans)\nfor p in P:\n tmp = bisect_left(Q, p)\n ans += p * (1 + H - tmp)\nprint(ans)\n# print ('P:', P)\n# print ('Q:', Q)\n", "measured_slow_code_sha256": "bcf317c0f5728d0a7638204678608dc410ba8b1b94297840d436ebd31fa8f1c8", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.6387610669690886, "pair_id": "python_v2_738b9039324ec131d8a57026", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03972", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03972_756f91ac6d1695db876a99ea6c409e2ecc2d89bc9ced2cac5f118d0dce505fbd.jsonl.gz", "inputs": "reproduction/python/inputs/p03972.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03972_bcf317c0f5728d0a7638204678608dc410ba8b1b94297840d436ebd31fa8f1c8.jsonl.gz"}, "slow_code": "import sys\n\ninput = sys.stdin.readline\nfrom bisect import bisect_left, bisect_right\n\nW, H = list(map(int, input().split()))\nP = [int(eval(input())) for _ in range(W)]\nP.sort()\nQ = [int(eval(input())) for _ in range(H)]\nQ.sort()\nans = 0\nfor q in Q:\n tmp = bisect_right(P, q)\n\n ans += q * (1 + W - tmp)\n\nfor p in P:\n tmp = bisect_left(Q, p)\n ans += p * (1 + H - tmp)\nprint(ans)\n", "slow_code_sha256": "2485dcf3dff60c8bcad3b32da0e97fecf56bbf603fd33a5070b3d3bfc53b68a8", "slow_id": "p03972_bcf317c0f5728d0a7638204678608dc410ba8b1b94297840d436ebd31fa8f1c8", "speedup": 3.592535937479917, "stratum": "2-4", "within_pair_jaccard": 0.26, "workload": {"case_count": 100, "description": "Connect all vertices of a (W+1)-by-(H+1) rectangular grid at minimum total edge cost. Horizontal edge costs at column i are p_i; vertical edge costs at row j are q_j. Observed inputs: W=1..100000 (median 99999); H=1..100000 (median 99999); p_i=1..100000000; q_j=1..100000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 2000014, "median": 888948.0, "min": 8}, "input_format": ["W H\np_0\n...\np_(W-1)\nq_0\n...\nq_(H-1)"], "input_format_status": "source_input_section", "input_lines": {"max": 200001, "median": 100003.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200002, "median": 100004.0, "min": 4}}} -{"case_ids": ["p02792_case_000", "p02792_case_001", "p02792_case_002", "p02792_case_003", "p02792_case_004", "p02792_case_005", "p02792_case_006", "p02792_case_007", "p02792_case_008", "p02792_case_009", "p02792_case_010", "p02792_case_011", "p02792_case_012", "p02792_case_013", "p02792_case_014", "p02792_case_015", "p02792_case_016", "p02792_case_017", "p02792_case_018", "p02792_case_019", "p02792_case_020", "p02792_case_021", "p02792_case_022", "p02792_case_023", "p02792_case_024", "p02792_case_025", "p02792_case_026", "p02792_case_027", "p02792_case_028", "p02792_case_029", "p02792_case_030", "p02792_case_031", "p02792_case_032", "p02792_case_033", "p02792_case_034", "p02792_case_035", "p02792_case_036", "p02792_case_037", "p02792_case_038", "p02792_case_039", "p02792_case_040", "p02792_case_041", "p02792_case_042", "p02792_case_043", "p02792_case_044", "p02792_case_045", "p02792_case_046", "p02792_case_047", "p02792_case_048", "p02792_case_049", "p02792_case_050", "p02792_case_051", "p02792_case_052", "p02792_case_053", "p02792_case_054", "p02792_case_055", "p02792_case_056", "p02792_case_057", "p02792_case_058", "p02792_case_059", "p02792_case_060", "p02792_case_061", "p02792_case_062", "p02792_case_063", "p02792_case_064", "p02792_case_065", "p02792_case_066", "p02792_case_067", "p02792_case_068", "p02792_case_069", "p02792_case_070", "p02792_case_071", "p02792_case_072", "p02792_case_073", "p02792_case_074", "p02792_case_075", "p02792_case_076", "p02792_case_077", "p02792_case_078", "p02792_case_079", "p02792_case_080", "p02792_case_081", "p02792_case_082", "p02792_case_083", "p02792_case_084", "p02792_case_085", "p02792_case_086", "p02792_case_087", "p02792_case_088", "p02792_case_089", "p02792_case_090", "p02792_case_091", "p02792_case_092", "p02792_case_093", "p02792_case_094", "p02792_case_095", "p02792_case_096", "p02792_case_097", "p02792_case_098", "p02792_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\nans = 0\nfor i in range(1, n + 1):\n a = str(i)[0]\n b = str(i)[-1]\n for digit in range(1, 7):\n if digit == 1:\n if a == b:\n ans += 1\n elif b != \"0\":\n mn = int(b + \"0\" * (digit - 2) + a)\n mx = int(b + \"9\" * (digit - 2) + a)\n if mn > n:\n break\n if mx <= n:\n ans += 10 ** (digit - 2)\n else:\n ns = str(n)\n for j in range(1, len(ns) - 1):\n ans += int(ns[j]) * 10 ** (max(digit - 2 - j, 0))\n if ns[-1] >= a:\n ans += 1\n break\nprint(ans)\n", "fast_code_sha256": "fb44bd736f114d04ccb1eb63d74ee7770c1991b1ef5dfc225135ed90cc16cf8e", "fast_id": "p02792_fb44bd736f114d04ccb1eb63d74ee7770c1991b1ef5dfc225135ed90cc16cf8e", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\nans = 0\nfor i in range(1, n + 1):\n a = str(i)[0]\n b = str(i)[-1]\n for digit in range(1, 7):\n if digit == 1:\n if a == b:\n ans += 1\n elif b != \"0\":\n mn = int(b + \"0\" * (digit - 2) + a)\n mx = int(b + \"9\" * (digit - 2) + a)\n if mn > n:\n break\n if mx <= n:\n ans += 10 ** (digit - 2)\n else:\n ns = str(n)\n for j in range(1, len(ns) - 1):\n ans += int(ns[j]) * 10 ** (max(digit - 2 - j, 0))\n if ns[-1] >= a:\n ans += 1\n break\nprint(ans)\n", "measured_fast_code_sha256": "fb44bd736f114d04ccb1eb63d74ee7770c1991b1ef5dfc225135ed90cc16cf8e", "measured_slow_code": "N = int(eval(input()))\n\n\ndef cnt(i, j):\n ret = 0\n si = str(i)\n for n in range(1, N + 1):\n if n % 10 != j:\n continue\n if str(n)[0] != si:\n continue\n ret += 1\n return ret\n\n\nans = 0\nfor i in range(10):\n for j in range(10):\n ans += cnt(i, j) * cnt(j, i)\nprint(ans)\n", "measured_slow_code_sha256": "f73eb8ce29329be2d260f2fe98deb52d223d31a41330fd4e68317289bd9067d9", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 5.185854119402864, "pair_id": "python_v2_97e07002d147fbce5fc51dcb", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02792", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02792_fb44bd736f114d04ccb1eb63d74ee7770c1991b1ef5dfc225135ed90cc16cf8e.jsonl.gz", "inputs": "reproduction/python/inputs/p02792.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02792_f73eb8ce29329be2d260f2fe98deb52d223d31a41330fd4e68317289bd9067d9.jsonl.gz"}, "slow_code": "N = int(eval(input()))\n\n\ndef cnt(i, j):\n ret = 0\n si = str(i)\n for n in range(1, N + 1):\n if n % 10 != j:\n continue\n if str(n)[0] != si:\n continue\n ret += 1\n return ret\n\n\nans = 0\nfor i in range(10):\n for j in range(10):\n ans += cnt(i, j) * cnt(j, i)\nprint(ans)\n", "slow_code_sha256": "f73eb8ce29329be2d260f2fe98deb52d223d31a41330fd4e68317289bd9067d9", "slow_id": "p02792_f73eb8ce29329be2d260f2fe98deb52d223d31a41330fd4e68317289bd9067d9", "speedup": 4.233526993259363, "stratum": "4-8", "within_pair_jaccard": 0.43243243243243246, "workload": {"case_count": 100, "description": "Count ordered pairs of positive integers (A,B), each at most N, whose decimal first and last digits are reversed between A and B. Leading zeros are not used. Observed inputs: N=1..200000 (median 106.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 7, "median": 4.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p02709_case_000", "p02709_case_001", "p02709_case_002", "p02709_case_003", "p02709_case_004", "p02709_case_005", "p02709_case_006", "p02709_case_007", "p02709_case_008", "p02709_case_009", "p02709_case_010", "p02709_case_011", "p02709_case_012", "p02709_case_013", "p02709_case_014", "p02709_case_015", "p02709_case_016", "p02709_case_017", "p02709_case_018", "p02709_case_019", "p02709_case_020", "p02709_case_021", "p02709_case_022", "p02709_case_023", "p02709_case_024", "p02709_case_025", "p02709_case_026", "p02709_case_027", "p02709_case_028", "p02709_case_029", "p02709_case_030", "p02709_case_031", "p02709_case_032", "p02709_case_033", "p02709_case_034", "p02709_case_035", "p02709_case_036", "p02709_case_037", "p02709_case_038", "p02709_case_039", "p02709_case_040", "p02709_case_041", "p02709_case_042", "p02709_case_043", "p02709_case_044", "p02709_case_045", "p02709_case_046", "p02709_case_047", "p02709_case_048", "p02709_case_049", "p02709_case_050", "p02709_case_051", "p02709_case_052", "p02709_case_053", "p02709_case_054", "p02709_case_055", "p02709_case_056", "p02709_case_057", "p02709_case_058", "p02709_case_059", "p02709_case_060", "p02709_case_061", "p02709_case_062", "p02709_case_063", "p02709_case_064", "p02709_case_065", "p02709_case_066", "p02709_case_067", "p02709_case_068", "p02709_case_069", "p02709_case_070", "p02709_case_071", "p02709_case_072", "p02709_case_073", "p02709_case_074", "p02709_case_075", "p02709_case_076", "p02709_case_077", "p02709_case_078", "p02709_case_079", "p02709_case_080", "p02709_case_081", "p02709_case_082", "p02709_case_083", "p02709_case_084", "p02709_case_085", "p02709_case_086", "p02709_case_087", "p02709_case_088", "p02709_case_089", "p02709_case_090", "p02709_case_091", "p02709_case_092", "p02709_case_093", "p02709_case_094", "p02709_case_095", "p02709_case_096", "p02709_case_097", "p02709_case_098", "p02709_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(input())\na = list(map(int, input().split()))\nassert len(a) == n\n\np = list(range(n))\np.sort(key=lambda i: a[i])\n\ndp = {(j, 0): 0 for j in range(n + 1)}\nfor i in range(n):\n for j in range(n - i):\n dp[(j, i + 1)] = max(\n dp[(j, i)] + a[p[i]] * abs(p[i] - (j + i)),\n dp[(j + 1, i)] + a[p[i]] * abs(p[i] - j),\n )\nprint(dp[(0, n)])\n", "fast_code_sha256": "8c2db2d4e0501370c31ff9c9fa1ff279ff2c6ffea5c5b072ab8ef9afc0492cc6", "fast_id": "p02709_07fe8e1d91d6277abfab70061f93ba58509eceacbd1fae6065f288a7e9104644", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "# E - Active Infants\nn = int(input())\na = list(map(int, input().split()))\nassert len(a) == n\n# 添字のリスト\np = list(range(n))\np.sort(key=lambda i: a[i])\n# dp[(j, i)] = 位置jから幅iの区間に小さい方からi個を配置したときの最大うれしさ\ndp = {(j, 0): 0 for j in range(n + 1)}\nfor i in range(n):\n for j in range(n - i):\n dp[(j, i + 1)] = max(\n dp[(j, i)] + a[p[i]] * abs(p[i] - (j + i)),\n dp[(j + 1, i)] + a[p[i]] * abs(p[i] - j),\n )\nprint(dp[(0, n)])\n", "measured_fast_code_sha256": "07fe8e1d91d6277abfab70061f93ba58509eceacbd1fae6065f288a7e9104644", "measured_slow_code": "import sys\nimport numpy as np\n\n\ndef f(n, a_):\n a = []\n for i, ai in enumerate(a_):\n a.append([1 + i, ai])\n a.sort(key=lambda x: x[1], reverse=True)\n dp = np.zeros(\n (n + 1, n + 1), np.int64\n ) # dp[i,j]:i人目までを配置し終えていて、そのうちj人を右に置いた時の最大値。j<=i\n dp[1, 1] = a[0][1] * (n - a[0][0])\n dp[1, 0] = a[0][1] * (a[0][0] - 1)\n for i in range(2, n + 1): # i人目の幼児。a[i-1]\n dp[i, 0] = dp[i - 1, 0] + a[i - 1][1] * abs(\n (a[i - 1][0] - 1 - (i - 1))\n ) # i人目を左にする。その時左に溜まっているのはi-1人\n dp[i, i] = dp[i - 1, i - 1] + a[i - 1][1] * abs(\n (n - a[i - 1][0] - (i - 1))\n ) # i人目を右にする。その時右に溜まっているのはi-1人\n # i人目を左に\n l = dp[i - 1, 1:i] + [\n a[i - 1][1] * abs((a[i - 1][0] - 1 - j)) for j in range(i - 2, -1, -1)\n ] # j:左に溜まっている人数\n # i人目を右に\n r = dp[i - 1, : i - 1] + [\n a[i - 1][1] * abs((n - a[i - 1][0] - j)) for j in range(i - 1)\n ] # j:右に溜まっている人数\n dp[i, 1:i] = np.maximum(l, r)\n return max(dp[n])\n\n\nif __name__ == \"__main__\":\n input = sys.stdin.readline\n n = int(eval(input()))\n a_ = list(map(int, input().split()))\n print((f(n, a_)))\n", "measured_slow_code_sha256": "3d838e07742b6038959605af2d3df1f36b7399126fc563b9a2c8f3bce236aaea", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 0.7064256249441367, "pair_id": "python_v2_202a3808fda74d5e7148a7c0", "per_case_slow_code_faster_fraction": 0.55, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02709", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02709_07fe8e1d91d6277abfab70061f93ba58509eceacbd1fae6065f288a7e9104644.jsonl.gz", "inputs": "reproduction/python/inputs/p02709.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02709_3d838e07742b6038959605af2d3df1f36b7399126fc563b9a2c8f3bce236aaea.jsonl.gz"}, "slow_code": "import sys\nimport numpy as np\n\n\ndef f(n, a_):\n a = []\n for i, ai in enumerate(a_):\n a.append([1 + i, ai])\n a.sort(key=lambda x: x[1], reverse=True)\n dp = np.zeros((n + 1, n + 1), np.int64)\n dp[1, 1] = a[0][1] * (n - a[0][0])\n dp[1, 0] = a[0][1] * (a[0][0] - 1)\n for i in range(2, n + 1):\n dp[i, 0] = dp[i - 1, 0] + a[i - 1][1] * abs((a[i - 1][0] - 1 - (i - 1)))\n dp[i, i] = dp[i - 1, i - 1] + a[i - 1][1] * abs((n - a[i - 1][0] - (i - 1)))\n\n l = dp[i - 1, 1:i] + [\n a[i - 1][1] * abs((a[i - 1][0] - 1 - j)) for j in range(i - 2, -1, -1)\n ]\n\n r = dp[i - 1, : i - 1] + [\n a[i - 1][1] * abs((n - a[i - 1][0] - j)) for j in range(i - 1)\n ]\n dp[i, 1:i] = np.maximum(l, r)\n return max(dp[n])\n\n\nif __name__ == \"__main__\":\n input = sys.stdin.readline\n n = int(eval(input()))\n a_ = list(map(int, input().split()))\n print((f(n, a_)))\n", "slow_code_sha256": "aa98af4784f39634c1b1369b22ff40f05d4ea9461af1aad5cd1db169f1d8c6f4", "slow_id": "p02709_3d838e07742b6038959605af2d3df1f36b7399126fc563b9a2c8f3bce236aaea", "speedup": 7.9956338109944936, "stratum": "4-8", "within_pair_jaccard": 0.4117647058823529, "workload": {"case_count": 100, "description": "Rearrange N children arbitrarily. Moving the child originally at position x to position y earns A_x*|x-y| happiness. Maximize total happiness. Observed inputs: N=2..2000 (median 1000); A_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 22005, "median": 9885.5, "min": 6}, "input_format": ["N\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2001, "median": 1001.0, "min": 3}}} -{"case_ids": ["p03598_case_000", "p03598_case_001", "p03598_case_002", "p03598_case_003", "p03598_case_004", "p03598_case_005", "p03598_case_006", "p03598_case_007", "p03598_case_008", "p03598_case_009", "p03598_case_010", "p03598_case_011", "p03598_case_012", "p03598_case_013", "p03598_case_014", "p03598_case_015", "p03598_case_016", "p03598_case_017", "p03598_case_018", "p03598_case_019", "p03598_case_020", "p03598_case_021", "p03598_case_022", "p03598_case_023", "p03598_case_024", "p03598_case_025", "p03598_case_026", "p03598_case_027", "p03598_case_028", "p03598_case_029", "p03598_case_030", "p03598_case_031", "p03598_case_032", "p03598_case_033", "p03598_case_034", "p03598_case_035", "p03598_case_036", "p03598_case_037", "p03598_case_038", "p03598_case_039", "p03598_case_040", "p03598_case_041", "p03598_case_042", "p03598_case_043", "p03598_case_044", "p03598_case_045", "p03598_case_046", "p03598_case_047", "p03598_case_048", "p03598_case_049", "p03598_case_050", "p03598_case_051", "p03598_case_052", "p03598_case_053", "p03598_case_054", "p03598_case_055", "p03598_case_056", "p03598_case_057", "p03598_case_058", "p03598_case_059", "p03598_case_060", "p03598_case_061", "p03598_case_062", "p03598_case_063", "p03598_case_064", "p03598_case_065", "p03598_case_066", "p03598_case_067", "p03598_case_068", "p03598_case_069", "p03598_case_070", "p03598_case_071", "p03598_case_072", "p03598_case_073", "p03598_case_074", "p03598_case_075", "p03598_case_076", "p03598_case_077", "p03598_case_078", "p03598_case_079", "p03598_case_080", "p03598_case_081", "p03598_case_082", "p03598_case_083", "p03598_case_084", "p03598_case_085", "p03598_case_086", "p03598_case_087", "p03598_case_088", "p03598_case_089", "p03598_case_090", "p03598_case_091", "p03598_case_092", "p03598_case_093", "p03598_case_094", "p03598_case_095", "p03598_case_096", "p03598_case_097", "p03598_case_098", "p03598_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "_ = eval(input())\nk = int(eval(input()))\nx = [int(x) for x in input().split()]\nans = 0\nfor i in x:\n ans += min(i, k - i)\nelse:\n print((ans * 2))\n", "fast_code_sha256": "1c19f1515eea6daf819ed6226e28c60674530dafb599e6ac4fdb3cde8f734647", "fast_id": "p03598_1c19f1515eea6daf819ed6226e28c60674530dafb599e6ac4fdb3cde8f734647", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "_ = eval(input())\nk = int(eval(input()))\nx = [int(x) for x in input().split()]\nans = 0\nfor i in x:\n ans += min(i, k - i)\nelse:\n print((ans * 2))\n", "measured_fast_code_sha256": "1c19f1515eea6daf819ed6226e28c60674530dafb599e6ac4fdb3cde8f734647", "measured_slow_code": "# Author: cr4zjh0bp\n# Created: Sat Mar 14 11:48:11 UTC 2020\nimport sys\n\nstdin = sys.stdin\ninf = 1 << 60\nmod = 1000000007\nni = lambda: int(ns())\nnin = lambda y: [ni() for _ in range(y)]\nna = lambda: list(map(int, stdin.readline().split()))\nnan = lambda y: [na() for _ in range(y)]\nnf = lambda: float(ns())\nnfn = lambda y: [nf() for _ in range(y)]\nnfa = lambda: list(map(float, stdin.readline().split()))\nnfan = lambda y: [nfa() for _ in range(y)]\nns = lambda: stdin.readline().rstrip()\nnsn = lambda y: [ns() for _ in range(y)]\nncl = lambda y: [list(ns()) for _ in range(y)]\nnas = lambda: stdin.readline().split()\nn, k = nin(2)\nx = na()\nans = 0\nfor i in range(n):\n ans += min(abs(x[i] - k) * 2, abs(x[i]) * 2)\nprint(ans)\n", "measured_slow_code_sha256": "4242b0111d34ac29f247349e2dd3df5bbea3d003d38a638f0ec7f046c27e0435", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.6240680463268937, "pair_id": "python_v2_16fd79cb3b1cb2eff3aba728", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03598", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03598_1c19f1515eea6daf819ed6226e28c60674530dafb599e6ac4fdb3cde8f734647.jsonl.gz", "inputs": "reproduction/python/inputs/p03598.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03598_4242b0111d34ac29f247349e2dd3df5bbea3d003d38a638f0ec7f046c27e0435.jsonl.gz"}, "slow_code": "import sys\n\nstdin = sys.stdin\ninf = 1 << 60\nmod = 1000000007\nni = lambda: int(ns())\nnin = lambda y: [ni() for _ in range(y)]\nna = lambda: list(map(int, stdin.readline().split()))\nnan = lambda y: [na() for _ in range(y)]\nnf = lambda: float(ns())\nnfn = lambda y: [nf() for _ in range(y)]\nnfa = lambda: list(map(float, stdin.readline().split()))\nnfan = lambda y: [nfa() for _ in range(y)]\nns = lambda: stdin.readline().rstrip()\nnsn = lambda y: [ns() for _ in range(y)]\nncl = lambda y: [list(ns()) for _ in range(y)]\nnas = lambda: stdin.readline().split()\nn, k = nin(2)\nx = na()\nans = 0\nfor i in range(n):\n ans += min(abs(x[i] - k) * 2, abs(x[i]) * 2)\nprint(ans)\n", "slow_code_sha256": "b56139331cede5dfee10d7e57ba4d3e5fe70d638b0a7d7343d69614e13c21b14", "slow_id": "p03598_4242b0111d34ac29f247349e2dd3df5bbea3d003d38a638f0ec7f046c27e0435", "speedup": 2.9543340133611666, "stratum": "2-4", "within_pair_jaccard": 0.2826086956521739, "workload": {"case_count": 100, "description": "For each ball at (x_i,i), choose a robot from (0,i) or (K,i) to collect it and return to that endpoint. Minimize total travel distance over all N balls; every x_i lies strictly between 0 and K. Observed inputs: N=1..100 (median 89); K=2..100 (median 73); x_i=1..99.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 308, "median": 206.0, "min": 6}, "input_format": ["N\nK\nx_1 ... x_N"], "input_format_status": "source_input_section", "input_lines": {"max": 3, "median": 3.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 102, "median": 91.0, "min": 3}}} -{"case_ids": ["p03698_case_000", "p03698_case_001", "p03698_case_002", "p03698_case_003", "p03698_case_004", "p03698_case_005", "p03698_case_006", "p03698_case_007", "p03698_case_008", "p03698_case_009", "p03698_case_010", "p03698_case_011", "p03698_case_012", "p03698_case_013", "p03698_case_014", "p03698_case_015", "p03698_case_016", "p03698_case_017", "p03698_case_018", "p03698_case_019", "p03698_case_020", "p03698_case_021", "p03698_case_022", "p03698_case_023", "p03698_case_024", "p03698_case_025", "p03698_case_026", "p03698_case_027", "p03698_case_028", "p03698_case_029", "p03698_case_030", "p03698_case_031", "p03698_case_032", "p03698_case_033", "p03698_case_034", "p03698_case_035", "p03698_case_036", "p03698_case_037", "p03698_case_038", "p03698_case_039", "p03698_case_040", "p03698_case_041", "p03698_case_042", "p03698_case_043", "p03698_case_044", "p03698_case_045", "p03698_case_046", "p03698_case_047", "p03698_case_048", "p03698_case_049", "p03698_case_050", "p03698_case_051", "p03698_case_052", "p03698_case_053", "p03698_case_054", "p03698_case_055", "p03698_case_056", "p03698_case_057", "p03698_case_058", "p03698_case_059", "p03698_case_060", "p03698_case_061", "p03698_case_062", "p03698_case_063", "p03698_case_064", "p03698_case_065", "p03698_case_066", "p03698_case_067", "p03698_case_068", "p03698_case_069", "p03698_case_070", "p03698_case_071", "p03698_case_072", "p03698_case_073", "p03698_case_074", "p03698_case_075", "p03698_case_076", "p03698_case_077", "p03698_case_078", "p03698_case_079", "p03698_case_080", "p03698_case_081", "p03698_case_082", "p03698_case_083", "p03698_case_084", "p03698_case_085", "p03698_case_086", "p03698_case_087", "p03698_case_088", "p03698_case_089", "p03698_case_090", "p03698_case_091", "p03698_case_092", "p03698_case_093", "p03698_case_094", "p03698_case_095", "p03698_case_096", "p03698_case_097", "p03698_case_098", "p03698_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "a = list(input())\nb = set(a)\nprint(\"yes\") if (len(a) == len(b)) else print(\"no\")\n", "fast_code_sha256": "e5b2e399a03a3f8e8d296f2c196051328bc34d20b308d0640a69b1e958432119", "fast_id": "p03698_e5b2e399a03a3f8e8d296f2c196051328bc34d20b308d0640a69b1e958432119", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "a = list(input())\nb = set(a)\nprint(\"yes\") if (len(a) == len(b)) else print(\"no\")\n", "measured_fast_code_sha256": "e5b2e399a03a3f8e8d296f2c196051328bc34d20b308d0640a69b1e958432119", "measured_slow_code": "# Author: cr4zjh0bp\n# Created: Sun Mar 22 23:25:40 UTC 2020\nimport sys\n\nstdin = sys.stdin\ninf = 1 << 60\nmod = 1000000007\nni = lambda: int(ns())\nnin = lambda y: [ni() for _ in range(y)]\nna = lambda: list(map(int, stdin.readline().split()))\nnan = lambda y: [na() for _ in range(y)]\nnf = lambda: float(ns())\nnfn = lambda y: [nf() for _ in range(y)]\nnfa = lambda: list(map(float, stdin.readline().split()))\nnfan = lambda y: [nfa() for _ in range(y)]\nns = lambda: stdin.readline().rstrip()\nnsn = lambda y: [ns() for _ in range(y)]\nncl = lambda y: [list(ns()) for _ in range(y)]\nnas = lambda: stdin.readline().split()\nfrom collections import Counter\n\ns = ns()\nc = Counter(s)\nprint((\"yes\" if len(s) == len(c) else \"no\"))\n", "measured_slow_code_sha256": "c901e462142ca049a9787650e0b4a07107f704aeec33bc7187ebef810081eb9f", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 7.467594196449462, "pair_id": "python_v2_4be76ea029dcfd66b80b828e", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03698", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03698_e5b2e399a03a3f8e8d296f2c196051328bc34d20b308d0640a69b1e958432119.jsonl.gz", "inputs": "reproduction/python/inputs/p03698.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03698_c901e462142ca049a9787650e0b4a07107f704aeec33bc7187ebef810081eb9f.jsonl.gz"}, "slow_code": "import sys\n\nstdin = sys.stdin\ninf = 1 << 60\nmod = 1000000007\nni = lambda: int(ns())\nnin = lambda y: [ni() for _ in range(y)]\nna = lambda: list(map(int, stdin.readline().split()))\nnan = lambda y: [na() for _ in range(y)]\nnf = lambda: float(ns())\nnfn = lambda y: [nf() for _ in range(y)]\nnfa = lambda: list(map(float, stdin.readline().split()))\nnfan = lambda y: [nfa() for _ in range(y)]\nns = lambda: stdin.readline().rstrip()\nnsn = lambda y: [ns() for _ in range(y)]\nncl = lambda y: [list(ns()) for _ in range(y)]\nnas = lambda: stdin.readline().split()\nfrom collections import Counter\n\ns = ns()\nc = Counter(s)\nprint((\"yes\" if len(s) == len(c) else \"no\"))\n", "slow_code_sha256": "82f3b254a6c0c0e43cc5a8e67fd20676b24522497dc2e44c3bbb7af6ae0b85f8", "slow_id": "p03698_c901e462142ca049a9787650e0b4a07107f704aeec33bc7187ebef810081eb9f", "speedup": 7.459796437929799, "stratum": "4-8", "within_pair_jaccard": 0.14583333333333334, "workload": {"case_count": 100, "description": "Determine whether all characters in the supplied lowercase string S are pairwise different. Observed inputs: input_length=2..26 (median 10).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 27, "median": 11.0, "min": 3}, "input_format": ["S"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p02289_case_000", "p02289_case_001", "p02289_case_002", "p02289_case_003", "p02289_case_004", "p02289_case_005", "p02289_case_006", "p02289_case_007", "p02289_case_008", "p02289_case_009", "p02289_case_010", "p02289_case_011", "p02289_case_012", "p02289_case_013", "p02289_case_014", "p02289_case_015", "p02289_case_016", "p02289_case_017", "p02289_case_018", "p02289_case_019", "p02289_case_020", "p02289_case_021", "p02289_case_022", "p02289_case_023", "p02289_case_024", "p02289_case_025", "p02289_case_026", "p02289_case_027", "p02289_case_028", "p02289_case_029", "p02289_case_030", "p02289_case_031", "p02289_case_032", "p02289_case_033", "p02289_case_034", "p02289_case_035", "p02289_case_036", "p02289_case_037", "p02289_case_038", "p02289_case_039", "p02289_case_040", "p02289_case_041", "p02289_case_042", "p02289_case_043", "p02289_case_044", "p02289_case_045", "p02289_case_046", "p02289_case_047", "p02289_case_048", "p02289_case_049", "p02289_case_050", "p02289_case_051", "p02289_case_052", "p02289_case_053", "p02289_case_054", "p02289_case_055", "p02289_case_056", "p02289_case_057", "p02289_case_058", "p02289_case_059", "p02289_case_060", "p02289_case_061", "p02289_case_062", "p02289_case_063", "p02289_case_064", "p02289_case_065", "p02289_case_066", "p02289_case_067", "p02289_case_068", "p02289_case_069", "p02289_case_070", "p02289_case_071", "p02289_case_072", "p02289_case_073", "p02289_case_074", "p02289_case_075", "p02289_case_076", "p02289_case_077", "p02289_case_078", "p02289_case_079", "p02289_case_080", "p02289_case_081", "p02289_case_082", "p02289_case_083", "p02289_case_084", "p02289_case_085", "p02289_case_086", "p02289_case_087", "p02289_case_088", "p02289_case_089", "p02289_case_090", "p02289_case_091", "p02289_case_092", "p02289_case_093", "p02289_case_094", "p02289_case_095", "p02289_case_096", "p02289_case_097", "p02289_case_098", "p02289_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\nfrom heapq import heappush, heappop\n\nH = []\nO = []\nfor e in sys.stdin:\n if \"i\" == e[0]:\n heappush(H, -int(e[7:]))\n elif \"t\" == e[2]:\n O += [-heappop(H)]\n else:\n print((\"\\n\".join(map(str, O))))\n", "fast_code_sha256": "f64766cc504cf7ed6ef256ef37141d76027a8c8c96c68aeb51a96ae0081403a4", "fast_id": "p02289_f64766cc504cf7ed6ef256ef37141d76027a8c8c96c68aeb51a96ae0081403a4", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\nfrom heapq import heappush, heappop\n\nH = []\nO = []\nfor e in sys.stdin:\n if \"i\" == e[0]:\n heappush(H, -int(e[7:]))\n elif \"t\" == e[2]:\n O += [-heappop(H)]\n else:\n print((\"\\n\".join(map(str, O))))\n", "measured_fast_code_sha256": "f64766cc504cf7ed6ef256ef37141d76027a8c8c96c68aeb51a96ae0081403a4", "measured_slow_code": "import sys\n\n\ndef maxHeapify(A, i):\n l = i * 2 + 1\n r = i * 2 + 2\n if l < n:\n largest = l\n if r < n and A[r] > A[l]:\n largest = r\n if A[largest] > A[i]:\n A[i], A[largest] = A[largest], A[i]\n maxHeapify(A, largest)\n\n\ndef insert(S, k):\n global n\n S[n] = k\n n += 1\n i = n - 1\n p = (i - 1) // 2\n while i > 0 and S[i] > S[p]:\n S[i], S[p] = S[p], S[i]\n i = p\n p = (i - 1) // 2\n\n\ndef extractMax(S):\n global n\n if n == 1:\n n -= 1\n return S[0]\n ans = S[0]\n n -= 1\n S[0] = S[n]\n i = 0\n while True:\n l = i * 2 + 1\n r = i * 2 + 2\n if l >= n:\n break\n largest = l\n if r < n and A[r] > A[l]:\n largest = r\n if A[largest] > A[i]:\n A[i], A[largest] = A[largest], A[i]\n i = largest\n else:\n break\n return ans\n\n\nA = [0] * 2000000\nS = []\nn = 0\nfor s in sys.stdin:\n if s[2] == \"s\":\n insert(A, int(s[7:]))\n elif s[2] == \"t\":\n S.append(extractMax(A))\n else:\n break\nprint((\"\\n\".join(map(str, S))))\n", "measured_slow_code_sha256": "14b4ad282f61dc3f0baedf2eb80026c759f35dd9b34a29e093c21234282f17e7", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.9561397443001334, "pair_id": "python_v2_7eb733b8a4db554c4ae09362", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02289", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02289_f64766cc504cf7ed6ef256ef37141d76027a8c8c96c68aeb51a96ae0081403a4.jsonl.gz", "inputs": "reproduction/python/inputs/p02289.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02289_14b4ad282f61dc3f0baedf2eb80026c759f35dd9b34a29e093c21234282f17e7.jsonl.gz"}, "slow_code": "import sys\n\n\ndef maxHeapify(A, i):\n l = i * 2 + 1\n r = i * 2 + 2\n if l < n:\n largest = l\n if r < n and A[r] > A[l]:\n largest = r\n if A[largest] > A[i]:\n A[i], A[largest] = A[largest], A[i]\n maxHeapify(A, largest)\n\n\ndef insert(S, k):\n global n\n S[n] = k\n n += 1\n i = n - 1\n p = (i - 1) // 2\n while i > 0 and S[i] > S[p]:\n S[i], S[p] = S[p], S[i]\n i = p\n p = (i - 1) // 2\n\n\ndef extractMax(S):\n global n\n if n == 1:\n n -= 1\n return S[0]\n ans = S[0]\n n -= 1\n S[0] = S[n]\n i = 0\n while True:\n l = i * 2 + 1\n r = i * 2 + 2\n if l >= n:\n break\n largest = l\n if r < n and A[r] > A[l]:\n largest = r\n if A[largest] > A[i]:\n A[i], A[largest] = A[largest], A[i]\n i = largest\n else:\n break\n return ans\n\n\nA = [0] * 2000000\nS = []\nn = 0\nfor s in sys.stdin:\n if s[2] == \"s\":\n insert(A, int(s[7:]))\n elif s[2] == \"t\":\n S.append(extractMax(A))\n else:\n break\nprint((\"\\n\".join(map(str, S))))\n", "slow_code_sha256": "14b4ad282f61dc3f0baedf2eb80026c759f35dd9b34a29e093c21234282f17e7", "slow_id": "p02289_14b4ad282f61dc3f0baedf2eb80026c759f35dd9b34a29e093c21234282f17e7", "speedup": 3.8326666656296213, "stratum": "2-4", "within_pair_jaccard": 0.3958333333333333, "workload": {"case_count": 100, "description": "Maintain an initially empty max-priority queue. Each insert k adds one integer; each extract removes and prints the current maximum. Commands occur one per line and end terminates input. Duplicate keys are allowed. Observed inputs: operations=10..500000 (median 1000); insertions=5..250192 (median 508); extractions=3..249991 (median 495.5); maximum_queue_size=1..50000 (median 30.5); k=0..2000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 6501924, "median": 12912.5, "min": 130}, "input_format": ["insert k\nextract\n...\nend"], "input_format_status": "source_input_section", "input_lines": {"max": 500001, "median": 1001.0, "min": 11}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 750193, "median": 1509.0, "min": 16}}} -{"case_ids": ["p03737_case_000", "p03737_case_001", "p03737_case_002", "p03737_case_003", "p03737_case_004", "p03737_case_005", "p03737_case_006", "p03737_case_007", "p03737_case_008", "p03737_case_009", "p03737_case_010", "p03737_case_011", "p03737_case_012", "p03737_case_013", "p03737_case_014", "p03737_case_015", "p03737_case_016", "p03737_case_017", "p03737_case_018", "p03737_case_019", "p03737_case_020", "p03737_case_021", "p03737_case_022", "p03737_case_023", "p03737_case_024", "p03737_case_025", "p03737_case_026", "p03737_case_027", "p03737_case_028", "p03737_case_029", "p03737_case_030", "p03737_case_031", "p03737_case_032", "p03737_case_033", "p03737_case_034", "p03737_case_035", "p03737_case_036", "p03737_case_037", "p03737_case_038", "p03737_case_039", "p03737_case_040", "p03737_case_041", "p03737_case_042", "p03737_case_043", "p03737_case_044", "p03737_case_045", "p03737_case_046", "p03737_case_047", "p03737_case_048", "p03737_case_049", "p03737_case_050", "p03737_case_051", "p03737_case_052", "p03737_case_053", "p03737_case_054", "p03737_case_055", "p03737_case_056", "p03737_case_057", "p03737_case_058", "p03737_case_059", "p03737_case_060", "p03737_case_061", "p03737_case_062", "p03737_case_063", "p03737_case_064", "p03737_case_065", "p03737_case_066", "p03737_case_067", "p03737_case_068", "p03737_case_069", "p03737_case_070", "p03737_case_071", "p03737_case_072", "p03737_case_073", "p03737_case_074", "p03737_case_075", "p03737_case_076", "p03737_case_077", "p03737_case_078", "p03737_case_079", "p03737_case_080", "p03737_case_081", "p03737_case_082", "p03737_case_083", "p03737_case_084", "p03737_case_085", "p03737_case_086", "p03737_case_087", "p03737_case_088", "p03737_case_089", "p03737_case_090", "p03737_case_091", "p03737_case_092", "p03737_case_093", "p03737_case_094", "p03737_case_095", "p03737_case_096", "p03737_case_097", "p03737_case_098", "p03737_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "print(\"\".join([w[0] for w in input().split()]).upper())\n", "fast_code_sha256": "0c82c432849e42936e00c228fc40384e5cec41c3fe38b370b307eee81e480a3b", "fast_id": "p03737_0c82c432849e42936e00c228fc40384e5cec41c3fe38b370b307eee81e480a3b", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "print(\"\".join([w[0] for w in input().split()]).upper())\n", "measured_fast_code_sha256": "0c82c432849e42936e00c228fc40384e5cec41c3fe38b370b307eee81e480a3b", "measured_slow_code": "import numpy as np\nimport math\n\ns = \" \" + input()\nfor i in range(len(s)):\n if s[i] == \" \":\n print(chr(ord(s[i + 1]) - 32), end=\"\")\nprint()\n", "measured_slow_code_sha256": "c5a6a790bfe3c359c7ab2698d0f376a617bb650fa938bf64d595d41523985f6d", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2543.9140444870995, "pair_id": "python_v2_b143056b3ed779e58ca18e83", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03737", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03737_0c82c432849e42936e00c228fc40384e5cec41c3fe38b370b307eee81e480a3b.jsonl.gz", "inputs": "reproduction/python/inputs/p03737.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03737_c5a6a790bfe3c359c7ab2698d0f376a617bb650fa938bf64d595d41523985f6d.jsonl.gz"}, "slow_code": "import numpy as np\nimport math\n\ns = \" \" + input()\nfor i in range(len(s)):\n if s[i] == \" \":\n print(chr(ord(s[i + 1]) - 32), end=\"\")\nprint()\n", "slow_code_sha256": "c5a6a790bfe3c359c7ab2698d0f376a617bb650fa938bf64d595d41523985f6d", "slow_id": "p03737_c5a6a790bfe3c359c7ab2698d0f376a617bb650fa938bf64d595d41523985f6d", "speedup": 2541.3164394816017, "stratum": "8+", "within_pair_jaccard": 0.16666666666666666, "workload": {"case_count": 100, "description": "Form an acronym from the uppercase first letters of three supplied lowercase words, in their given order. Observed inputs: word_length=1..10.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 33, "median": 18.0, "min": 6}, "input_format": ["s_1 s_2 s_3"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3, "median": 3.0, "min": 3}}} -{"case_ids": ["p00100_case_000", "p00100_case_001", "p00100_case_002", "p00100_case_003", "p00100_case_004", "p00100_case_005", "p00100_case_006", "p00100_case_007", "p00100_case_008", "p00100_case_009", "p00100_case_010", "p00100_case_011", "p00100_case_012", "p00100_case_013", "p00100_case_014", "p00100_case_015", "p00100_case_016", "p00100_case_017", "p00100_case_018", "p00100_case_019", "p00100_case_020", "p00100_case_021", "p00100_case_022", "p00100_case_023", "p00100_case_024", "p00100_case_025", "p00100_case_026", "p00100_case_027", "p00100_case_028", "p00100_case_029", "p00100_case_030", "p00100_case_031", "p00100_case_032", "p00100_case_033", "p00100_case_034", "p00100_case_035", "p00100_case_036", "p00100_case_037", "p00100_case_038", "p00100_case_039", "p00100_case_040", "p00100_case_041", "p00100_case_042", "p00100_case_043", "p00100_case_044", "p00100_case_045", "p00100_case_046", "p00100_case_047", "p00100_case_048", "p00100_case_049", "p00100_case_050", "p00100_case_051", "p00100_case_052", "p00100_case_053", "p00100_case_054", "p00100_case_055", "p00100_case_056", "p00100_case_057", "p00100_case_058", "p00100_case_059", "p00100_case_060", "p00100_case_061", "p00100_case_062", "p00100_case_063", "p00100_case_064", "p00100_case_065", "p00100_case_066", "p00100_case_067", "p00100_case_068", "p00100_case_069", "p00100_case_070", "p00100_case_071", "p00100_case_072", "p00100_case_073", "p00100_case_074", "p00100_case_075", "p00100_case_076", "p00100_case_077", "p00100_case_078", "p00100_case_079", "p00100_case_080", "p00100_case_081", "p00100_case_082", "p00100_case_083", "p00100_case_084", "p00100_case_085", "p00100_case_086", "p00100_case_087", "p00100_case_088", "p00100_case_089", "p00100_case_090", "p00100_case_091", "p00100_case_092", "p00100_case_093", "p00100_case_094", "p00100_case_095", "p00100_case_096", "p00100_case_097", "p00100_case_098", "p00100_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "while True:\n n = int(eval(input()))\n if n == 0:\n break\n d = dict()\n sep = []\n for _ in range(n):\n i, p, q = list(map(int, input().split()))\n if i in d:\n d[i] += p * q\n else:\n d[i] = p * q\n sep.append(i)\n tmp = list([x for x in list(d.items()) if x[1] >= 1000000])\n if len(tmp):\n tmp = {t[0]: t[1] for t in tmp}\n for s in sep:\n if s in tmp:\n print(s)\n else:\n print(\"NA\")\n", "fast_code_sha256": "fac6663288e36d34bc40af158b96cb2e3bfeb4e851c1db0ad7779aa4e646f6ac", "fast_id": "p00100_fac6663288e36d34bc40af158b96cb2e3bfeb4e851c1db0ad7779aa4e646f6ac", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "while True:\n n = int(eval(input()))\n if n == 0:\n break\n d = dict()\n sep = []\n for _ in range(n):\n i, p, q = list(map(int, input().split()))\n if i in d:\n d[i] += p * q\n else:\n d[i] = p * q\n sep.append(i)\n tmp = list([x for x in list(d.items()) if x[1] >= 1000000])\n if len(tmp):\n tmp = {t[0]: t[1] for t in tmp}\n for s in sep:\n if s in tmp:\n print(s)\n else:\n print(\"NA\")\n", "measured_fast_code_sha256": "fac6663288e36d34bc40af158b96cb2e3bfeb4e851c1db0ad7779aa4e646f6ac", "measured_slow_code": "# coding: utf-8\n# Here your code !\nemployeeSalesList = []\n\n\ndef resetDataset():\n del employeeSalesList[0 : len(employeeSalesList) + 1]\n\n\ndef readDataCount():\n return int(eval(input()))\n\n\ndef searchEmployeeSales(employeeId):\n for data in employeeSalesList:\n if data[0] == employeeId:\n return data\n newData = [employeeId, 0]\n employeeSalesList.append(newData)\n return newData\n\n\ndef printEmployeeOfDataset():\n answerList = [data[0] for data in employeeSalesList if data[1] >= 1000000]\n if len(answerList) == 0:\n print(\"NA\")\n else:\n print((\"\\n\".join(map(str, answerList))))\n\n\nresetDataset()\ndataCount = readDataCount()\nwhile dataCount > 0:\n for _ in range(dataCount):\n employeeId, price, volume = list(map(int, input().split(\" \")))\n employeeSales = searchEmployeeSales(employeeId)\n employeeSales[1] += price * volume\n printEmployeeOfDataset()\n resetDataset()\n dataCount = readDataCount()\n", "measured_slow_code_sha256": "5d1f4cb08fbc43299784771f17b3646fe4993e8fd866609d48d2ebc0e737a39c", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.8144830153703797, "pair_id": "python_v2_41484593e509de75c9f8014e", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p00100", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p00100_fac6663288e36d34bc40af158b96cb2e3bfeb4e851c1db0ad7779aa4e646f6ac.jsonl.gz", "inputs": "reproduction/python/inputs/p00100.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p00100_5d1f4cb08fbc43299784771f17b3646fe4993e8fd866609d48d2ebc0e737a39c.jsonl.gz"}, "slow_code": "employeeSalesList = []\n\n\ndef resetDataset():\n del employeeSalesList[0 : len(employeeSalesList) + 1]\n\n\ndef readDataCount():\n return int(eval(input()))\n\n\ndef searchEmployeeSales(employeeId):\n for data in employeeSalesList:\n if data[0] == employeeId:\n return data\n newData = [employeeId, 0]\n employeeSalesList.append(newData)\n return newData\n\n\ndef printEmployeeOfDataset():\n answerList = [data[0] for data in employeeSalesList if data[1] >= 1000000]\n if len(answerList) == 0:\n print(\"NA\")\n else:\n print((\"\\n\".join(map(str, answerList))))\n\n\nresetDataset()\ndataCount = readDataCount()\nwhile dataCount > 0:\n for _ in range(dataCount):\n employeeId, price, volume = list(map(int, input().split(\" \")))\n employeeSales = searchEmployeeSales(employeeId)\n employeeSales[1] += price * volume\n printEmployeeOfDataset()\n resetDataset()\n dataCount = readDataCount()\n", "slow_code_sha256": "d4669c36b7d92dd1908cad9300dbbe214938350a72f54c414f63ae0b2ccb8749", "slow_id": "p00100_5d1f4cb08fbc43299784771f17b3646fe4993e8fd866609d48d2ebc0e737a39c", "speedup": 3.257977270575068, "stratum": "2-4", "within_pair_jaccard": 0.40384615384615385, "workload": {"case_count": 100, "description": "For each sales dataset, sum price p times quantity q per employee ID. Output IDs with total proceeds at least 1000000 in first-appearance order, or NA if none qualify. IDs may repeat across records; a final zero ends input. Observed inputs: datasets=1; n=5..3999; total_records=5..3999 (median 400); p=1..999957; q=1..99998.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 71109, "median": 7115.5, "min": 65}, "input_format": ["n_1\nid_1 p_1 q_1\n...\nid_(n_1) p_(n_1) q_(n_1)\n[next datasets]\n0"], "input_format_status": "source_input_section", "input_lines": {"max": 4001, "median": 402.0, "min": 7}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 11999, "median": 1202.0, "min": 17}}} -{"case_ids": ["p03448_case_000", "p03448_case_001", "p03448_case_002", "p03448_case_003", "p03448_case_004", "p03448_case_005", "p03448_case_006", "p03448_case_007", "p03448_case_008", "p03448_case_009", "p03448_case_010", "p03448_case_011", "p03448_case_012", "p03448_case_013", "p03448_case_014", "p03448_case_015", "p03448_case_016", "p03448_case_017", "p03448_case_018", "p03448_case_019", "p03448_case_020", "p03448_case_021", "p03448_case_022", "p03448_case_023", "p03448_case_024", "p03448_case_025", "p03448_case_026", "p03448_case_027", "p03448_case_028", "p03448_case_029", "p03448_case_030", "p03448_case_031", "p03448_case_032", "p03448_case_033", "p03448_case_034", "p03448_case_035", "p03448_case_036", "p03448_case_037", "p03448_case_038", "p03448_case_039", "p03448_case_040", "p03448_case_041", "p03448_case_042", "p03448_case_043", "p03448_case_044", "p03448_case_045", "p03448_case_046", "p03448_case_047", "p03448_case_048", "p03448_case_049", "p03448_case_050", "p03448_case_051", "p03448_case_052", "p03448_case_053", "p03448_case_054", "p03448_case_055", "p03448_case_056", "p03448_case_057", "p03448_case_058", "p03448_case_059", "p03448_case_060", "p03448_case_061", "p03448_case_062", "p03448_case_063", "p03448_case_064", "p03448_case_065", "p03448_case_066", "p03448_case_067", "p03448_case_068", "p03448_case_069", "p03448_case_070", "p03448_case_071", "p03448_case_072", "p03448_case_073", "p03448_case_074", "p03448_case_075", "p03448_case_076", "p03448_case_077", "p03448_case_078", "p03448_case_079", "p03448_case_080", "p03448_case_081", "p03448_case_082", "p03448_case_083", "p03448_case_084", "p03448_case_085", "p03448_case_086", "p03448_case_087", "p03448_case_088", "p03448_case_089", "p03448_case_090", "p03448_case_091", "p03448_case_092", "p03448_case_093", "p03448_case_094", "p03448_case_095", "p03448_case_096", "p03448_case_097", "p03448_case_098", "p03448_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "a = int(eval(input()))\nb = int(eval(input()))\nc = int(eval(input()))\nx = int(eval(input()))\nans = 0\nfor A in range(a + 1):\n for B in range(b + 1):\n C = (x - 500 * A - 100 * B) // 50\n if 0 <= C <= c:\n ans += 1\nprint(ans)\n", "fast_code_sha256": "d8747bcd1997d6d3c47a2fb9d78361faa012e4743719302d67407ece71f07982", "fast_id": "p03448_d8747bcd1997d6d3c47a2fb9d78361faa012e4743719302d67407ece71f07982", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "a = int(eval(input()))\nb = int(eval(input()))\nc = int(eval(input()))\nx = int(eval(input()))\nans = 0\nfor A in range(a + 1):\n for B in range(b + 1):\n C = (x - 500 * A - 100 * B) // 50\n if 0 <= C <= c:\n ans += 1\nprint(ans)\n", "measured_fast_code_sha256": "d8747bcd1997d6d3c47a2fb9d78361faa012e4743719302d67407ece71f07982", "measured_slow_code": "# -*- coding: utf-8 -*-\nA = int(eval(input()))\nB = int(eval(input()))\nC = int(eval(input()))\nX = int(eval(input()))\n_500 = 500\n_100 = 100\n_50 = 50\ncount = 0\nfor a in range(A + 1):\n for b in range(B + 1):\n for c in range(C + 1):\n if X - (a * _500 + b * _100 + c * _50) == 0:\n count = count + 1\nprint(count)\n", "measured_slow_code_sha256": "4e1d7acbb2606da283c3a8eac1e2e7f0cacf8fd0d8740abb75a39aa1271b6158", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.7327789777915374, "pair_id": "python_v2_56883257cca982019b021ad3", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03448", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03448_d8747bcd1997d6d3c47a2fb9d78361faa012e4743719302d67407ece71f07982.jsonl.gz", "inputs": "reproduction/python/inputs/p03448.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03448_4e1d7acbb2606da283c3a8eac1e2e7f0cacf8fd0d8740abb75a39aa1271b6158.jsonl.gz"}, "slow_code": "A = int(eval(input()))\nB = int(eval(input()))\nC = int(eval(input()))\nX = int(eval(input()))\n_500 = 500\n_100 = 100\n_50 = 50\ncount = 0\nfor a in range(A + 1):\n for b in range(B + 1):\n for c in range(C + 1):\n if X - (a * _500 + b * _100 + c * _50) == 0:\n count = count + 1\nprint(count)\n", "slow_code_sha256": "670baf1495be327e297400d2ae6c76ee55c7324bb3063c37fcd00633863ca6b5", "slow_id": "p03448_4e1d7acbb2606da283c3a8eac1e2e7f0cacf8fd0d8740abb75a39aa1271b6158", "speedup": 3.1356407963544877, "stratum": "2-4", "within_pair_jaccard": 0.6923076923076923, "workload": {"case_count": 100, "description": "Choose coins totaling X using at most A coins of value 500, B of value 100 and C of value 50. Count distinct denomination-count choices, not permutations of identical coins. X is a multiple of 50. Observed inputs: A=0..50 (median 7); B=0..50 (median 9.5); C=0..50 (median 5.5); X=50..20000 (median 2175).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 15, "median": 12.0, "min": 9}, "input_format": ["A\nB\nC\nX"], "input_format_status": "source_input_section", "input_lines": {"max": 4, "median": 4.0, "min": 4}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 4, "median": 4.0, "min": 4}}} -{"case_ids": ["p03837_case_000", "p03837_case_001", "p03837_case_002", "p03837_case_003", "p03837_case_004", "p03837_case_005", "p03837_case_006", "p03837_case_007", "p03837_case_008", "p03837_case_009", "p03837_case_010", "p03837_case_011", "p03837_case_012", "p03837_case_013", "p03837_case_014", "p03837_case_015", "p03837_case_016", "p03837_case_017", "p03837_case_018", "p03837_case_019", "p03837_case_020", "p03837_case_021", "p03837_case_022", "p03837_case_023", "p03837_case_024", "p03837_case_025", "p03837_case_026", "p03837_case_027", "p03837_case_028", "p03837_case_029", "p03837_case_030", "p03837_case_031", "p03837_case_032", "p03837_case_033", "p03837_case_034", "p03837_case_035", "p03837_case_036", "p03837_case_037", "p03837_case_038", "p03837_case_039", "p03837_case_040", "p03837_case_041", "p03837_case_042", "p03837_case_043", "p03837_case_044", "p03837_case_045", "p03837_case_046", "p03837_case_047", "p03837_case_048", "p03837_case_049", "p03837_case_050", "p03837_case_051", "p03837_case_052", "p03837_case_053", "p03837_case_054", "p03837_case_055", "p03837_case_056", "p03837_case_057", "p03837_case_058", "p03837_case_059", "p03837_case_060", "p03837_case_061", "p03837_case_062", "p03837_case_063", "p03837_case_064", "p03837_case_065", "p03837_case_066", "p03837_case_067", "p03837_case_068", "p03837_case_069", "p03837_case_070", "p03837_case_071", "p03837_case_072", "p03837_case_073", "p03837_case_074", "p03837_case_075", "p03837_case_076", "p03837_case_077", "p03837_case_078", "p03837_case_079", "p03837_case_080", "p03837_case_081", "p03837_case_082", "p03837_case_083", "p03837_case_084", "p03837_case_085", "p03837_case_086", "p03837_case_087", "p03837_case_088", "p03837_case_089", "p03837_case_090", "p03837_case_091", "p03837_case_092", "p03837_case_093", "p03837_case_094", "p03837_case_095", "p03837_case_096", "p03837_case_097", "p03837_case_098", "p03837_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\nstdin = sys.stdin\nsys.setrecursionlimit(10**5)\n\n\ndef li():\n return list(map(int, stdin.readline().split()))\n\n\ndef li_():\n return [int(x) - 1 for x in stdin.readline().split()]\n\n\ndef lf():\n return list(map(float, stdin.readline().split()))\n\n\ndef ls():\n return stdin.readline().split()\n\n\ndef ns():\n return stdin.readline().rstrip()\n\n\ndef lc():\n return list(ns())\n\n\ndef ni():\n return int(stdin.readline())\n\n\ndef nf():\n return float(stdin.readline())\n\n\nfrom heapq import heappush, heappop\n\n\ndef dijkstra(graph: list, node: int, start: int) -> list:\n\n INF = float(\"inf\")\n dist = [INF] * node\n\n dist[start] = 0\n heap = [(0, start)]\n\n while heap:\n cost, cur_node = heappop(heap)\n for nex_cost, nex_node in graph[cur_node]:\n dist_cand = dist[cur_node] + nex_cost\n if dist_cand < dist[nex_node]:\n dist[nex_node] = dist_cand\n heappush(heap, (dist[nex_node], nex_node))\n return dist\n\n\nn, m = li()\nedges = []\ngraph = [[] for _ in range(n)]\nadj_mat = [[0] * n for _ in range(n)]\nfor _ in range(m):\n a, b, c = li()\n a -= 1\n b -= 1\n graph[a].append((c, b))\n graph[b].append((c, a))\n edges.append((a, b, c))\n\nfor i in range(n):\n adj_mat[i] = dijkstra(graph, n, i)\n\nans = 0\nfor ai, bi, ci in edges:\n if adj_mat[ai][bi] < ci:\n ans += 1\nprint(ans)\n", "fast_code_sha256": "f7be85d24423d522fe62abe62d1a5060a35b3a15b17a790afb47e02241fe8646", "fast_id": "p03837_6fe3db18b8af9058f75e32d8abebbced43e21773b091306be0fe2371744129bb", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\nstdin = sys.stdin\nsys.setrecursionlimit(10**5)\n\n\ndef li():\n return list(map(int, stdin.readline().split()))\n\n\ndef li_():\n return [int(x) - 1 for x in stdin.readline().split()]\n\n\ndef lf():\n return list(map(float, stdin.readline().split()))\n\n\ndef ls():\n return stdin.readline().split()\n\n\ndef ns():\n return stdin.readline().rstrip()\n\n\ndef lc():\n return list(ns())\n\n\ndef ni():\n return int(stdin.readline())\n\n\ndef nf():\n return float(stdin.readline())\n\n\nfrom heapq import heappush, heappop\n\n\ndef dijkstra(graph: list, node: int, start: int) -> list:\n # 未探索のノードは距離INF\n INF = float(\"inf\")\n dist = [INF] * node\n # 始点ノードの距離を0とし、dfsのためのpriority queを作成\n dist[start] = 0\n heap = [(0, start)]\n # 未探索のノードをpriority queueに入れる\n while heap:\n cost, cur_node = heappop(heap)\n for nex_cost, nex_node in graph[cur_node]:\n dist_cand = dist[cur_node] + nex_cost\n if dist_cand < dist[nex_node]:\n dist[nex_node] = dist_cand\n heappush(heap, (dist[nex_node], nex_node))\n return dist\n\n\nn, m = li()\nedges = []\ngraph = [[] for _ in range(n)]\nadj_mat = [[0] * n for _ in range(n)]\nfor _ in range(m):\n a, b, c = li()\n a -= 1\n b -= 1\n graph[a].append((c, b))\n graph[b].append((c, a))\n edges.append((a, b, c))\n# 各点からの最短dist\nfor i in range(n):\n adj_mat[i] = dijkstra(graph, n, i)\n# 最短路とedgeの比較\nans = 0\nfor ai, bi, ci in edges:\n if adj_mat[ai][bi] < ci:\n ans += 1\nprint(ans)\n", "measured_fast_code_sha256": "6fe3db18b8af9058f75e32d8abebbced43e21773b091306be0fe2371744129bb", "measured_slow_code": "INF = 10**18\nN, M = list(map(int, input().split()))\nedge = [list(map(int, input().split())) for _ in range(M)]\ngraph = [[INF for j in range(N)] for i in range(N)]\nfor i in range(N):\n graph[i][i] = 0\nfor e in edge:\n graph[e[0] - 1][e[1] - 1] = e[2]\n graph[e[1] - 1][e[0] - 1] = e[2]\nfor k in range(N):\n for i in range(N):\n for j in range(N):\n if graph[i][k] != INF and graph[k][j] != INF:\n graph[i][j] = min(graph[i][j], graph[i][k] + graph[k][j])\nans = 0\nfor e in edge:\n if graph[e[0] - 1][e[1] - 1] != e[2]:\n ans += 1\nprint(ans)\n", "measured_slow_code_sha256": "209b9c18911f3e22511f894d3ac580ce973fcd32b4b34dced8609607272528f4", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 7.630163218278626, "pair_id": "python_v2_3bb0344d5791704c930d30dd", "per_case_slow_code_faster_fraction": 0.22, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03837", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03837_6fe3db18b8af9058f75e32d8abebbced43e21773b091306be0fe2371744129bb.jsonl.gz", "inputs": "reproduction/python/inputs/p03837.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03837_209b9c18911f3e22511f894d3ac580ce973fcd32b4b34dced8609607272528f4.jsonl.gz"}, "slow_code": "INF = 10**18\nN, M = list(map(int, input().split()))\nedge = [list(map(int, input().split())) for _ in range(M)]\ngraph = [[INF for j in range(N)] for i in range(N)]\nfor i in range(N):\n graph[i][i] = 0\nfor e in edge:\n graph[e[0] - 1][e[1] - 1] = e[2]\n graph[e[1] - 1][e[0] - 1] = e[2]\nfor k in range(N):\n for i in range(N):\n for j in range(N):\n if graph[i][k] != INF and graph[k][j] != INF:\n graph[i][j] = min(graph[i][j], graph[i][k] + graph[k][j])\nans = 0\nfor e in edge:\n if graph[e[0] - 1][e[1] - 1] != e[2]:\n ans += 1\nprint(ans)\n", "slow_code_sha256": "209b9c18911f3e22511f894d3ac580ce973fcd32b4b34dced8609607272528f4", "slow_id": "p03837_209b9c18911f3e22511f894d3ac580ce973fcd32b4b34dced8609607272528f4", "speedup": 4.9414299018158925, "stratum": "4-8", "within_pair_jaccard": 0.22972972972972974, "workload": {"case_count": 100, "description": "In a connected simple undirected weighted graph with positive weights c_i, count edges that occur in no shortest path between any pair of distinct vertices. Endpoints are 1-based and may be listed in either order. Observed inputs: N=2..100 (median 30); M=1..1000 (median 55); c_i=1..1000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 10569, "median": 461.0, "min": 10}, "input_format": ["N M\na_1 b_1 c_1\n...\na_M b_M c_M"], "input_format_status": "source_input_section", "input_lines": {"max": 1001, "median": 56.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3002, "median": 167.0, "min": 5}}} -{"case_ids": ["p02732_case_000", "p02732_case_001", "p02732_case_002", "p02732_case_003", "p02732_case_004", "p02732_case_005", "p02732_case_006", "p02732_case_007", "p02732_case_008", "p02732_case_009", "p02732_case_010", "p02732_case_011", "p02732_case_012", "p02732_case_013", "p02732_case_014", "p02732_case_015", "p02732_case_016", "p02732_case_017", "p02732_case_018", "p02732_case_019", "p02732_case_020", "p02732_case_021", "p02732_case_022", "p02732_case_023", "p02732_case_024", "p02732_case_025", "p02732_case_026", "p02732_case_027", "p02732_case_028", "p02732_case_029", "p02732_case_030", "p02732_case_031", "p02732_case_032", "p02732_case_033", "p02732_case_034", "p02732_case_035", "p02732_case_036", "p02732_case_037", "p02732_case_038", "p02732_case_039", "p02732_case_040", "p02732_case_041", "p02732_case_042", "p02732_case_043", "p02732_case_044", "p02732_case_045", "p02732_case_046", "p02732_case_047", "p02732_case_048", "p02732_case_049", "p02732_case_050", "p02732_case_051", "p02732_case_052", "p02732_case_053", "p02732_case_054", "p02732_case_055", "p02732_case_056", "p02732_case_057", "p02732_case_058", "p02732_case_059", "p02732_case_060", "p02732_case_061", "p02732_case_062", "p02732_case_063", "p02732_case_064", "p02732_case_065", "p02732_case_066", "p02732_case_067", "p02732_case_068", "p02732_case_069", "p02732_case_070", "p02732_case_071", "p02732_case_072", "p02732_case_073", "p02732_case_074", "p02732_case_075", "p02732_case_076", "p02732_case_077", "p02732_case_078", "p02732_case_079", "p02732_case_080", "p02732_case_081", "p02732_case_082", "p02732_case_083", "p02732_case_084", "p02732_case_085", "p02732_case_086", "p02732_case_087", "p02732_case_088", "p02732_case_089", "p02732_case_090", "p02732_case_091", "p02732_case_092", "p02732_case_093", "p02732_case_094", "p02732_case_095", "p02732_case_096", "p02732_case_097", "p02732_case_098", "p02732_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from functools import reduce\n\n\ndef d_banned_k():\n from collections import Counter\n from functools import reduce\n\n N = int(eval(input()))\n A = [int(i) for i in input().split()]\n\n def comb(n, r):\n numerator = reduce(lambda x, y: x * y, list(range(n, n - r, -1)))\n denominator = reduce(lambda x, y: x * y, list(range(1, r + 1)))\n return numerator // denominator\n\n count = Counter(A)\n total = sum(comb(c, 2) for c in list(count.values()))\n ans = []\n for a in A:\n v = count[a]\n ans.append(total - comb(v, 2) + comb(v - 1, 2))\n return \" \".join(map(str, ans))\n\n\nprint((d_banned_k()))\n", "fast_code_sha256": "715c50a0bd5503a1c5a8f5900a3590d1b55c78b7a98e77c948ef59c2a023b3ea", "fast_id": "p02732_715c50a0bd5503a1c5a8f5900a3590d1b55c78b7a98e77c948ef59c2a023b3ea", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from functools import reduce\n\n\ndef d_banned_k():\n from collections import Counter\n from functools import reduce\n\n N = int(eval(input()))\n A = [int(i) for i in input().split()]\n\n def comb(n, r):\n numerator = reduce(lambda x, y: x * y, list(range(n, n - r, -1)))\n denominator = reduce(lambda x, y: x * y, list(range(1, r + 1)))\n return numerator // denominator\n\n count = Counter(A)\n total = sum(comb(c, 2) for c in list(count.values()))\n ans = []\n for a in A:\n v = count[a]\n ans.append(total - comb(v, 2) + comb(v - 1, 2))\n return \" \".join(map(str, ans))\n\n\nprint((d_banned_k()))\n", "measured_fast_code_sha256": "715c50a0bd5503a1c5a8f5900a3590d1b55c78b7a98e77c948ef59c2a023b3ea", "measured_slow_code": "c = [0] * 8**6\n_, a = open(0)\n(*a,) = list(map(int, a.split()))\nfor i in a:\n c[i] += 1\ns = sum(i * ~-i // 2 for i in c)\nprint((\" \".join(str(s - c[i] + 1) for i in a)))\n", "measured_slow_code_sha256": "146a37262042dc730222f98e3fdd20f6c1c81f3ed31e13dbb8d26ee28772d689", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 29.382682551927463, "pair_id": "python_v2_d87b77bacc2d5775d20c5a44", "per_case_slow_code_faster_fraction": 0.25, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02732", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02732_715c50a0bd5503a1c5a8f5900a3590d1b55c78b7a98e77c948ef59c2a023b3ea.jsonl.gz", "inputs": "reproduction/python/inputs/p02732.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02732_146a37262042dc730222f98e3fdd20f6c1c81f3ed31e13dbb8d26ee28772d689.jsonl.gz"}, "slow_code": "c = [0] * 8**6\n_, a = open(0)\n(*a,) = list(map(int, a.split()))\nfor i in a:\n c[i] += 1\ns = sum(i * ~-i // 2 for i in c)\nprint((\" \".join(str(s - c[i] + 1) for i in a)))\n", "slow_code_sha256": "146a37262042dc730222f98e3fdd20f6c1c81f3ed31e13dbb8d26ee28772d689", "slow_id": "p02732_146a37262042dc730222f98e3fdd20f6c1c81f3ed31e13dbb8d26ee28772d689", "speedup": 12.129339059768391, "stratum": "8+", "within_pair_jaccard": 0.2857142857142857, "workload": {"case_count": 100, "description": "For each position k in an N-ball sequence, exclude only that ball and count unordered pairs of distinct remaining balls carrying equal integer values A_i. Observed inputs: N=3..200000 (median 550); A_i=1..200000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1400007, "median": 1155.0, "min": 8}, "input_format": ["N\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200001, "median": 551.0, "min": 4}}} -{"case_ids": ["p03170_case_000", "p03170_case_001", "p03170_case_002", "p03170_case_003", "p03170_case_004", "p03170_case_005", "p03170_case_006", "p03170_case_007", "p03170_case_008", "p03170_case_009", "p03170_case_010", "p03170_case_011", "p03170_case_012", "p03170_case_013", "p03170_case_014", "p03170_case_015", "p03170_case_016", "p03170_case_017", "p03170_case_018", "p03170_case_019", "p03170_case_020", "p03170_case_021", "p03170_case_022", "p03170_case_023", "p03170_case_024", "p03170_case_025", "p03170_case_026", "p03170_case_027", "p03170_case_028", "p03170_case_029", "p03170_case_030", "p03170_case_031", "p03170_case_032", "p03170_case_033", "p03170_case_034", "p03170_case_035", "p03170_case_036", "p03170_case_037", "p03170_case_038", "p03170_case_039", "p03170_case_040", "p03170_case_041", "p03170_case_042", "p03170_case_043", "p03170_case_044", "p03170_case_045", "p03170_case_046", "p03170_case_047", "p03170_case_048", "p03170_case_049", "p03170_case_050", "p03170_case_051", "p03170_case_052", "p03170_case_053", "p03170_case_054", "p03170_case_055", "p03170_case_056", "p03170_case_057", "p03170_case_058", "p03170_case_059", "p03170_case_060", "p03170_case_061", "p03170_case_062", "p03170_case_063", "p03170_case_064", "p03170_case_065", "p03170_case_066", "p03170_case_067", "p03170_case_068", "p03170_case_069", "p03170_case_070", "p03170_case_071", "p03170_case_072", "p03170_case_073", "p03170_case_074", "p03170_case_075", "p03170_case_076", "p03170_case_077", "p03170_case_078", "p03170_case_079", "p03170_case_080", "p03170_case_081", "p03170_case_082", "p03170_case_083", "p03170_case_084", "p03170_case_085", "p03170_case_086", "p03170_case_087", "p03170_case_088", "p03170_case_089", "p03170_case_090", "p03170_case_091", "p03170_case_092", "p03170_case_093", "p03170_case_094", "p03170_case_095", "p03170_case_096", "p03170_case_097", "p03170_case_098", "p03170_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "executable_AST_equal_except_explicit_explanatory_string_removal_and_all_frozen_inputs_checker_pass", "fast_code": "def main():\n N, K, *A = list(map(int, open(0).read().split()))\n dp = [False] * (K + 1)\n for i in range(K):\n if dp[i]:\n continue\n for a in A:\n if i + a > K:\n break\n dp[i + a] = True\n print((\"First\" if dp[-1] else \"Second\"))\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "927c8eaad41aafff24b82bf15e6169537001e401db6311ca492154ea09b29809", "fast_id": "p03170_33c28753a08860218ab53615a5f71ef71d22bf0c1943d531cde21ef3265d4375", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "# K - Stones\ndef main():\n N, K, *A = list(map(int, open(0).read().split()))\n dp = [False] * (K + 1)\n for i in range(K):\n if dp[i]:\n continue\n for a in A:\n if i + a > K:\n break\n dp[i + a] = True\n print((\"First\" if dp[-1] else \"Second\"))\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "33c28753a08860218ab53615a5f71ef71d22bf0c1943d531cde21ef3265d4375", "measured_slow_code": "\"\"\"\nAtCoder Educational DP Contest\nhttps://atcoder.jp/contests/dp/tasks/dp_k\nK - Stones\n\"\"\"\nimport collections\n\n\ndef solve(xs):\n dp = collections.defaultdict(bool)\n dp[0] = False\n for j in range(1, K + 1):\n dp[j] = any((j >= x) and (not dp[j - x]) for x in xs)\n return dp[K]\n\n\nN, K = list(map(int, input().split()))\nchoices = [int(s) for s in input().split()]\nassert len(choices) == N\nres = solve(choices)\nprint((\"First\" if res else \"Second\"))\n", "measured_slow_code_sha256": "a4648aa899c2882eae6100874b2e2a8caea07da6276939d30c255744c52a4139", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 8.476467399844957, "pair_id": "python_v2_56af112ef8b522d79637e14b", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03170", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03170_33c28753a08860218ab53615a5f71ef71d22bf0c1943d531cde21ef3265d4375.jsonl.gz", "inputs": "reproduction/python/inputs/p03170.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03170_a4648aa899c2882eae6100874b2e2a8caea07da6276939d30c255744c52a4139.jsonl.gz"}, "slow_code": "import collections\n\n\ndef solve(xs):\n dp = collections.defaultdict(bool)\n dp[0] = False\n for j in range(1, K + 1):\n dp[j] = any((j >= x) and (not dp[j - x]) for x in xs)\n return dp[K]\n\n\nN, K = list(map(int, input().split()))\nchoices = [int(s) for s in input().split()]\nassert len(choices) == N\nres = solve(choices)\nprint((\"First\" if res else \"Second\"))\n", "slow_code_sha256": "6d59945073e9aa00c001075772307363a1804de8cf7ddff5d5a392c4580e87dd", "slow_id": "p03170_a4648aa899c2882eae6100874b2e2a8caea07da6276939d30c255744c52a4139", "speedup": 7.352784216627196, "stratum": "4-8", "within_pair_jaccard": 0.35185185185185186, "workload": {"case_count": 100, "description": "Two optimal players alternate removing a permitted number of stones from a pile initially of size K. Allowed removals a_i form a strictly increasing set of N integers. The first player unable to move loses; determine the winner. Observed inputs: N=1..100 (median 100); K=1..100000 (median 100000); a_i=1..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 610, "median": 597.5, "min": 6}, "input_format": ["N K\na_1 ... a_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 102, "median": 102.0, "min": 3}}} -{"case_ids": ["p02619_case_012", "p02619_case_013", "p02619_case_025", "p02619_case_026", "p02619_case_043", "p02619_case_044", "p02619_case_052", "p02619_case_053", "p02619_case_054", "p02619_case_073", "p02619_case_082", "p02619_case_083", "p02619_case_084", "p02619_case_092", "p02619_case_093", "p02619_v2_a2beef34f549391bcfab", "p02619_v2_d53b9ea5c5792673310a", "p02619_v2_75570918b98373695774", "p02619_v2_381934e3c9fc81ea5d4c", "p02619_v2_3225c49e05d4c20437e8", "p02619_v2_9f23fee4b2e5100bc2a2", "p02619_v2_3800a1516910270b469a", "p02619_v2_d9fa0876b5c6fdeae69e", "p02619_v2_b68f2c1e092b62c538a2", "p02619_v2_73760848946232a8e083", "p02619_v2_d3e4441b330d8b6e7455", "p02619_v2_76ead5910dcc4e2ba1f8", "p02619_v2_2029613353251ee9b7b2", "p02619_v2_2cb134243aa86388d6ba", "p02619_v2_30836e495158435b7b7c", "p02619_v2_339d84622dee7fdc1293", "p02619_v2_d3d5077e7c93e478e065", "p02619_v2_8253b2db731014b88083", "p02619_v2_2177c78f8621448ff155", "p02619_v2_d013df1aba56dc1d54ec", "p02619_v2_64826e27e1f5562b535a", "p02619_v2_9a891e42e9c46b5f3297", "p02619_v2_f1c00f7e95d622403758", "p02619_v2_710d4c5a4c95dcb68dec", "p02619_v2_439934a48b010195dbcd", "p02619_v2_4c37cf7a7dffe9b33f12", "p02619_v2_c8fad05224bc16a1b361", "p02619_v2_94bb7ae7786707cb4819", "p02619_v2_b3aaed51d4273a3ddba7", "p02619_v2_923e8744ad333f07cb64", "p02619_v2_3366f1adb54ecf21860c", "p02619_v2_0b51cc642981f62d0357", "p02619_v2_8e243df56a059b7ad743", "p02619_v2_0a8cb716b509085fe4b0", "p02619_v2_3b76655f387f7cb6d2ab", "p02619_v2_20299f78a75b5a756735", "p02619_v2_35258a2e89d62fc747b7", "p02619_v2_c94c4b9b4349ad6555bc", "p02619_v2_82d82c4a4a2d2183a610", "p02619_v2_d65957a2498629e788ad", "p02619_v2_cd61595422151a528aa5", "p02619_v2_d520c6f8f3f4d009c27c", "p02619_v2_4942ad457c0812fc3998", "p02619_v2_592ad6d8afe1f286b012", "p02619_v2_88f615fd6f0c7cd063e8", "p02619_v2_6679f24e3b7857ca6d32", "p02619_v2_11435a6bd84618d89bc3", "p02619_v2_857222b39e874dca5a4b", "p02619_v2_82dfd729740a78ac73c6", "p02619_v2_d87a4f20bb0c6931f905", "p02619_v2_6a64dbf42d62a65fcc1d", "p02619_v2_babacbd289499ec0ef4d", "p02619_v2_9c068c7f4ca10041380f", "p02619_v2_5532e28a006d07cf62cf", "p02619_v2_e76e422d063bddc50a1f", "p02619_v2_28584da94df0912874ff", "p02619_v2_6ebe44795b5ec9b8e21d", "p02619_v2_c14cae75992aa93e75b8", "p02619_v2_bdce12ee0a07d9d30b58", "p02619_v2_9d1eceea3701f7462f2b", "p02619_v2_97eb955edc648882b88c", "p02619_v2_d105efd93f9223472ed6", "p02619_v2_4348b0c773fc04fab240", "p02619_v2_3a716d97d5adc38425d1", "p02619_v2_ce64eae3a4c1a2d7cc27", "p02619_v2_f9e870aa23e988febc60", "p02619_v2_94937661fb4430a22568", "p02619_v2_557ae170292f4ec040cc", "p02619_v2_8814fdf99bc803fc8e0c", "p02619_v2_9188b3f61f9e38da6bb2", "p02619_v2_746658d85cc29634ceaa", "p02619_v2_f4db407594deac9161c4", "p02619_v2_7202c8c24a6735e3305a", "p02619_v2_87e6dc866c355591194f", "p02619_v2_90793b392e65559b556d", "p02619_v2_8c53e7c0e7cd81f14876", "p02619_v2_ce531317332dfe8af29d", "p02619_v2_54d30225714f808b8394", "p02619_v2_d7591d957a11b4b18a7f", "p02619_v2_753bfc942a0618ae1f4e", "p02619_v2_7da054c5c0df8db3a7fa", "p02619_v2_a96f964491ca5e8c9c0c", "p02619_v2_e5201f8fcebe77f9e4d2", "p02619_v2_ca2955dbd7b011893c5e", "p02619_v2_b271f7c12ae1b71c0287"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "D = int(eval(input()))\nc = [int(i) for i in input().split()]\ns = []\nfor d in range(D):\n s.append([int(i) for i in input().split()])\nt = []\nfor d in range(D):\n t.append(int(eval(input())) - 1)\nv = [0] * D\nlast = [[0 for i in range(26)] for d in range(D)]\nfor d in range(D):\n if d >= 1:\n last[d] = last[d - 1][:]\n last[d][t[d]] = d + 1\nfor d in range(D):\n v[d] = s[d][t[d]] - sum([c[i] * (d + 1 - last[d][i]) for i in range(26)])\nv_sum = 0\nfor d in range(D):\n v_sum += v[d]\n print(v_sum)\n", "fast_code_sha256": "563e3a854c367edcac106291c167cd02520f572588c62bf44447ede6ae778246", "fast_id": "p02619_563e3a854c367edcac106291c167cd02520f572588c62bf44447ede6ae778246", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "D = int(eval(input()))\nc = [int(i) for i in input().split()]\ns = []\nfor d in range(D):\n s.append([int(i) for i in input().split()])\nt = []\nfor d in range(D):\n t.append(int(eval(input())) - 1)\nv = [0] * D\nlast = [[0 for i in range(26)] for d in range(D)]\nfor d in range(D):\n if d >= 1:\n last[d] = last[d - 1][:]\n last[d][t[d]] = d + 1\nfor d in range(D):\n v[d] = s[d][t[d]] - sum([c[i] * (d + 1 - last[d][i]) for i in range(26)])\nv_sum = 0\nfor d in range(D):\n v_sum += v[d]\n print(v_sum)\n", "measured_fast_code_sha256": "563e3a854c367edcac106291c167cd02520f572588c62bf44447ede6ae778246", "measured_slow_code": "import numpy as np\n\nD = int(eval(input()))\nc = [int(i) for i in input().split()]\ns = []\nfor d in range(D):\n s.append([int(i) for i in input().split()])\nt = []\nfor d in range(D):\n t.append(int(eval(input())) - 1)\nv = [0] * D\nlast = [[0 for i in range(26)] for d in range(D)]\nfor d in range(D):\n if d >= 1:\n last[d] = last[d - 1][:]\n last[d][t[d]] = d + 1\nfor d in range(D):\n v[d] = s[d][t[d]] - sum([c[i] * (d + 1 - last[d][i]) for i in range(26)])\nv_sum = 0\nfor d in range(D):\n v_sum += v[d]\n print(v_sum)\n", "measured_slow_code_sha256": "e06ba4d62ffe23f292e9554193c989e47766a38ef3e00279117101508edbb374", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 8.894907794582025, "pair_id": "python_v2_e307eda1f08d4c2da8f1f561", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02619", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02619_563e3a854c367edcac106291c167cd02520f572588c62bf44447ede6ae778246.jsonl.gz", "inputs": "reproduction/python/inputs/p02619.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02619_e06ba4d62ffe23f292e9554193c989e47766a38ef3e00279117101508edbb374.jsonl.gz"}, "slow_code": "import numpy as np\n\nD = int(eval(input()))\nc = [int(i) for i in input().split()]\ns = []\nfor d in range(D):\n s.append([int(i) for i in input().split()])\nt = []\nfor d in range(D):\n t.append(int(eval(input())) - 1)\nv = [0] * D\nlast = [[0 for i in range(26)] for d in range(D)]\nfor d in range(D):\n if d >= 1:\n last[d] = last[d - 1][:]\n last[d][t[d]] = d + 1\nfor d in range(D):\n v[d] = s[d][t[d]] - sum([c[i] * (d + 1 - last[d][i]) for i in range(26)])\nv_sum = 0\nfor d in range(D):\n v_sum += v[d]\n print(v_sum)\n", "slow_code_sha256": "e06ba4d62ffe23f292e9554193c989e47766a38ef3e00279117101508edbb374", "slow_id": "p02619_e06ba4d62ffe23f292e9554193c989e47766a38ef3e00279117101508edbb374", "speedup": 8.79558592226019, "stratum": "8+", "within_pair_jaccard": 0.8518518518518519, "workload": {"case_count": 100, "description": "For a fixed schedule t_d of 26 contest types, output daily cumulative satisfaction, initially zero. On day d add s_d,t_d, then subtract sum_i c_i*(d-last_i), where last_i is the latest day of type i, or 0 if never held. Observed inputs: D=365; c_i=0..100; s_d_i=0..20000; t_d=1..26.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 57778, "median": 20062.0, "min": 19985}, "input_format": ["D\nc_1 ... c_26\ns_1,1 ... s_1,26\n...\ns_D,1 ... s_D,26\nt_1\n...\nt_D"], "input_format_status": "source_input_section", "input_lines": {"max": 732, "median": 732.0, "min": 732}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 9882, "median": 9882.0, "min": 9882}}} -{"case_ids": ["p03222_case_000", "p03222_case_001", "p03222_case_002", "p03222_case_003", "p03222_case_004", "p03222_case_005", "p03222_case_006", "p03222_case_007", "p03222_case_008", "p03222_case_009", "p03222_case_010", "p03222_case_011", "p03222_case_012", "p03222_case_013", "p03222_case_014", "p03222_case_015", "p03222_case_016", "p03222_case_017", "p03222_case_018", "p03222_case_019", "p03222_case_020", "p03222_case_021", "p03222_case_022", "p03222_case_023", "p03222_case_024", "p03222_case_025", "p03222_case_026", "p03222_case_027", "p03222_case_028", "p03222_case_029", "p03222_case_030", "p03222_case_031", "p03222_case_032", "p03222_case_033", "p03222_case_034", "p03222_case_035", "p03222_case_036", "p03222_case_037", "p03222_case_038", "p03222_case_039", "p03222_case_040", "p03222_case_041", "p03222_case_042", "p03222_case_043", "p03222_case_044", "p03222_case_045", "p03222_case_046", "p03222_case_047", "p03222_case_048", "p03222_case_049", "p03222_case_050", "p03222_case_051", "p03222_case_052", "p03222_case_053", "p03222_case_054", "p03222_case_055", "p03222_case_056", "p03222_case_057", "p03222_case_058", "p03222_case_059", "p03222_case_060", "p03222_case_061", "p03222_case_062", "p03222_case_063", "p03222_case_064", "p03222_case_065", "p03222_case_066", "p03222_case_067", "p03222_case_068", "p03222_case_069", "p03222_case_070", "p03222_case_071", "p03222_case_072", "p03222_case_073", "p03222_case_074", "p03222_case_075", "p03222_case_076", "p03222_case_077", "p03222_case_078", "p03222_case_079", "p03222_case_080", "p03222_case_081", "p03222_case_082", "p03222_case_083", "p03222_case_084", "p03222_case_085", "p03222_case_086", "p03222_case_087", "p03222_case_088", "p03222_case_089", "p03222_case_090", "p03222_case_091", "p03222_case_092", "p03222_case_093", "p03222_case_094", "p03222_case_095", "p03222_case_096", "p03222_case_097", "p03222_case_098", "p03222_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "MOD = 10**9 + 7\nH, W, K = list(map(int, input().split()))\nfibs = [0, 1, 1, 2, 3, 5, 8, 13, 21, 34]\n\n\ndef getFib(i):\n return fibs[i + 2]\n\n\nnumLs, numCs, numRs = [0] * W, [0] * W, [0] * W\nfor j in range(W):\n numCs[j] = getFib(j - 1) * getFib(W - 1 - j - 1)\n numLs[j] = getFib(j - 2) * getFib(W - 1 - j - 1)\n numRs[j] = getFib(j - 1) * getFib(W - 1 - j - 2)\ndp = [[0] * W for _ in range(H + 1)]\ndp[0][0] = 1\nfor i in range(H):\n for j in range(W):\n dp[i + 1][j] += dp[i][j] * numCs[j]\n if j > 0:\n dp[i + 1][j - 1] += dp[i][j] * numLs[j]\n if j < W - 1:\n dp[i + 1][j + 1] += dp[i][j] * numRs[j]\n for j in range(W):\n dp[i + 1][j] %= MOD\nprint((dp[H][K - 1]))\n", "fast_code_sha256": "e14d44cea834bf3284a5da1b03ac1f7391e54c6f716b4005d2d36cea2c411ea1", "fast_id": "p03222_e14d44cea834bf3284a5da1b03ac1f7391e54c6f716b4005d2d36cea2c411ea1", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "MOD = 10**9 + 7\nH, W, K = list(map(int, input().split()))\nfibs = [0, 1, 1, 2, 3, 5, 8, 13, 21, 34]\n\n\ndef getFib(i):\n return fibs[i + 2]\n\n\nnumLs, numCs, numRs = [0] * W, [0] * W, [0] * W\nfor j in range(W):\n numCs[j] = getFib(j - 1) * getFib(W - 1 - j - 1)\n numLs[j] = getFib(j - 2) * getFib(W - 1 - j - 1)\n numRs[j] = getFib(j - 1) * getFib(W - 1 - j - 2)\ndp = [[0] * W for _ in range(H + 1)]\ndp[0][0] = 1\nfor i in range(H):\n for j in range(W):\n dp[i + 1][j] += dp[i][j] * numCs[j]\n if j > 0:\n dp[i + 1][j - 1] += dp[i][j] * numLs[j]\n if j < W - 1:\n dp[i + 1][j + 1] += dp[i][j] * numRs[j]\n for j in range(W):\n dp[i + 1][j] %= MOD\nprint((dp[H][K - 1]))\n", "measured_fast_code_sha256": "e14d44cea834bf3284a5da1b03ac1f7391e54c6f716b4005d2d36cea2c411ea1", "measured_slow_code": "import sys\n\nmod = pow(10, 9) + 7\n\n\ndef mul(a, b):\n return ((a % mod) * (b % mod)) % mod\n\n\ndef cmb(n, r, mod):\n if r < 0 or r > n:\n return 0\n r = min(r, n - r)\n return g1[n] * g2[r] * g2[n - r] % mod\n\n\nNNN = (10**5) * 2\ng1 = [1, 1]\ng2 = [1, 1]\ninverse = [0, 1]\nfor i in range(2, NNN + 1):\n g1.append((g1[-1] * i) % mod)\n inverse.append((-inverse[mod % i] * (mod // i)) % mod)\n g2.append((g2[-1] * inverse[-1]) % mod)\n\n\ndef erabu(aW):\n r = 0\n for i in range(aW // 2 + 1 + 1):\n sp = aW - (2 * i - 1)\n r += cmb(sp + i + 1 - 1, sp, mod)\n return r\n\n\nN, W, K = [int(x) for x in input().strip().split(\" \")]\nhasi = 0\ncc = []\nif W == 1:\n if K == 1:\n print((1))\n else:\n print((0))\n sys.exit()\nelif W == 2:\n cccl = [1, 1]\n cc = [1, 1]\nelif W == 3:\n cccl = [1, 1, 1]\n cc = [2, 1, 2]\nelif W >= 4:\n aW = W - 1\n hW = aW - 2\n nhW = aW - 3\n cc = []\n cccl = []\n for w in range(W):\n nn = max(W - 1 - w - 1, 0)\n nnn = max((W - 1) - nn - 2, 0)\n if w == W - 1:\n nnn += 1\n cc.append(erabu(nn) * erabu(nnn))\n cccl.append(erabu(nn) * erabu(nnn - 1))\ncccl[0] = 0\ncccr = cccl[::-1]\nd = [1] + [0 for x in range(W - 1)]\nfor i in range(N):\n newd = []\n for j in range(W):\n newd.append(0)\n if j != 0:\n newd[j] = (newd[j] + (d[j - 1] * cccl[j])) % mod\n if j != W - 1:\n newd[j] = (newd[j] + (d[j + 1] * cccr[j])) % mod\n newd[j] = (newd[j] + (d[j] * cc[j])) % mod\n d = newd[:]\nprint((d[K - 1]))\n", "measured_slow_code_sha256": "a167fb2840bdcc6405e113c019a821d25f7acfa038b67804c34bff12a9edb446", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 431.7027015640517, "pair_id": "python_v2_99fc3d87edce79a346112b29", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03222", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03222_e14d44cea834bf3284a5da1b03ac1f7391e54c6f716b4005d2d36cea2c411ea1.jsonl.gz", "inputs": "reproduction/python/inputs/p03222.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03222_a167fb2840bdcc6405e113c019a821d25f7acfa038b67804c34bff12a9edb446.jsonl.gz"}, "slow_code": "import sys\n\nmod = pow(10, 9) + 7\n\n\ndef mul(a, b):\n return ((a % mod) * (b % mod)) % mod\n\n\ndef cmb(n, r, mod):\n if r < 0 or r > n:\n return 0\n r = min(r, n - r)\n return g1[n] * g2[r] * g2[n - r] % mod\n\n\nNNN = (10**5) * 2\ng1 = [1, 1]\ng2 = [1, 1]\ninverse = [0, 1]\nfor i in range(2, NNN + 1):\n g1.append((g1[-1] * i) % mod)\n inverse.append((-inverse[mod % i] * (mod // i)) % mod)\n g2.append((g2[-1] * inverse[-1]) % mod)\n\n\ndef erabu(aW):\n r = 0\n for i in range(aW // 2 + 1 + 1):\n sp = aW - (2 * i - 1)\n r += cmb(sp + i + 1 - 1, sp, mod)\n return r\n\n\nN, W, K = [int(x) for x in input().strip().split(\" \")]\nhasi = 0\ncc = []\nif W == 1:\n if K == 1:\n print((1))\n else:\n print((0))\n sys.exit()\nelif W == 2:\n cccl = [1, 1]\n cc = [1, 1]\nelif W == 3:\n cccl = [1, 1, 1]\n cc = [2, 1, 2]\nelif W >= 4:\n aW = W - 1\n hW = aW - 2\n nhW = aW - 3\n cc = []\n cccl = []\n for w in range(W):\n nn = max(W - 1 - w - 1, 0)\n nnn = max((W - 1) - nn - 2, 0)\n if w == W - 1:\n nnn += 1\n cc.append(erabu(nn) * erabu(nnn))\n cccl.append(erabu(nn) * erabu(nnn - 1))\ncccl[0] = 0\ncccr = cccl[::-1]\nd = [1] + [0 for x in range(W - 1)]\nfor i in range(N):\n newd = []\n for j in range(W):\n newd.append(0)\n if j != 0:\n newd[j] = (newd[j] + (d[j - 1] * cccl[j])) % mod\n if j != W - 1:\n newd[j] = (newd[j] + (d[j + 1] * cccr[j])) % mod\n newd[j] = (newd[j] + (d[j] * cc[j])) % mod\n d = newd[:]\nprint((d[K - 1]))\n", "slow_code_sha256": "a167fb2840bdcc6405e113c019a821d25f7acfa038b67804c34bff12a9edb446", "slow_id": "p03222_a167fb2840bdcc6405e113c019a821d25f7acfa038b67804c34bff12a9edb446", "speedup": 426.29469471906003, "stratum": "8+", "within_pair_jaccard": 0.2894736842105263, "workload": {"case_count": 100, "description": "Count ladder lotteries with W vertical lines and H horizontal levels. At each level, links join adjacent verticals and cannot share endpoints. Following links from the top-left must end at bottom column K. Output modulo 1000000007. Observed inputs: H=1..100 (median 50); W=1..8 (median 5); K=1..8 (median 2.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 8, "median": 7.0, "min": 6}, "input_format": ["H W K"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3, "median": 3.0, "min": 3}}} -{"case_ids": ["p03006_case_000", "p03006_case_001", "p03006_case_002", "p03006_case_003", "p03006_case_004", "p03006_case_005", "p03006_case_006", "p03006_case_007", "p03006_case_008", "p03006_case_009", "p03006_case_010", "p03006_case_011", "p03006_case_012", "p03006_case_013", "p03006_case_014", "p03006_case_015", "p03006_case_016", "p03006_case_017", "p03006_case_018", "p03006_case_019", "p03006_case_020", "p03006_case_021", "p03006_case_022", "p03006_case_023", "p03006_case_024", "p03006_case_025", "p03006_case_026", "p03006_case_027", "p03006_case_028", "p03006_case_029", "p03006_case_030", "p03006_case_031", "p03006_case_032", "p03006_case_033", "p03006_case_034", "p03006_case_035", "p03006_case_036", "p03006_case_037", "p03006_case_038", "p03006_case_039", "p03006_case_040", "p03006_case_041", "p03006_case_042", "p03006_case_043", "p03006_case_044", "p03006_case_045", "p03006_case_046", "p03006_case_047", "p03006_case_048", "p03006_case_049", "p03006_case_050", "p03006_case_051", "p03006_case_052", "p03006_case_053", "p03006_case_054", "p03006_case_055", "p03006_case_056", "p03006_case_057", "p03006_case_058", "p03006_case_059", "p03006_case_060", "p03006_case_061", "p03006_case_062", "p03006_case_063", "p03006_case_064", "p03006_case_065", "p03006_case_066", "p03006_case_067", "p03006_case_068", "p03006_case_069", "p03006_case_070", "p03006_case_071", "p03006_case_072", "p03006_case_073", "p03006_case_074", "p03006_case_075", "p03006_case_076", "p03006_case_077", "p03006_case_078", "p03006_case_079", "p03006_case_080", "p03006_case_081", "p03006_case_082", "p03006_case_083", "p03006_case_084", "p03006_case_085", "p03006_case_086", "p03006_case_087", "p03006_case_088", "p03006_case_089", "p03006_case_090", "p03006_case_091", "p03006_case_092", "p03006_case_093", "p03006_case_094", "p03006_case_095", "p03006_case_096", "p03006_case_097", "p03006_case_098", "p03006_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import itertools\n\nn = int(eval(input()))\nxy = []\nfor i in range(n):\n x, y = list(map(int, input().split()))\n xy.append([x, y])\na = {}\nfor v in itertools.combinations(xy, 2):\n z = list(v)\n z.sort()\n x = z[1][0] - z[0][0]\n y = z[1][1] - z[0][1]\n if (x, y) not in a:\n a[(x, y)] = 1\n else:\n a[(x, y)] += 1\nif n == 1:\n print((1))\nelse:\n print((n - max(a.values())))\n", "fast_code_sha256": "a4949338c1caf8f9f2272b8507ae54b9d4535344d257096aef575693e6969681", "fast_id": "p03006_a4949338c1caf8f9f2272b8507ae54b9d4535344d257096aef575693e6969681", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import itertools\n\nn = int(eval(input()))\nxy = []\nfor i in range(n):\n x, y = list(map(int, input().split()))\n xy.append([x, y])\na = {}\nfor v in itertools.combinations(xy, 2):\n z = list(v)\n z.sort()\n x = z[1][0] - z[0][0]\n y = z[1][1] - z[0][1]\n if (x, y) not in a:\n a[(x, y)] = 1\n else:\n a[(x, y)] += 1\nif n == 1:\n print((1))\nelse:\n print((n - max(a.values())))\n", "measured_fast_code_sha256": "a4949338c1caf8f9f2272b8507ae54b9d4535344d257096aef575693e6969681", "measured_slow_code": "N = int(eval(input()))\nif N == 1:\n print((1))\n exit()\nxy = [tuple(int(e) for e in input().split()) for _ in range(N)]\nd_list = [(i[0] - j[0], i[1] - j[1]) for i in xy for j in xy if i != j]\nitems = list(set(d_list))\ns = 1\nfor item in items:\n c = d_list.count(item)\n if c > s:\n s = c\nprint((N - s))\n", "measured_slow_code_sha256": "7838a318c333827f3472e6350353ce8b4259224d69f85170d3cd9658a4f5e659", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.5637071595505256, "pair_id": "python_v2_2a4655a538b62a637dc6e9d8", "per_case_slow_code_faster_fraction": 0.16, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03006", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03006_a4949338c1caf8f9f2272b8507ae54b9d4535344d257096aef575693e6969681.jsonl.gz", "inputs": "reproduction/python/inputs/p03006.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03006_7838a318c333827f3472e6350353ce8b4259224d69f85170d3cd9658a4f5e659.jsonl.gz"}, "slow_code": "N = int(eval(input()))\nif N == 1:\n print((1))\n exit()\nxy = [tuple(int(e) for e in input().split()) for _ in range(N)]\nd_list = [(i[0] - j[0], i[1] - j[1]) for i in xy for j in xy if i != j]\nitems = list(set(d_list))\ns = 1\nfor item in items:\n c = d_list.count(item)\n if c > s:\n s = c\nprint((N - s))\n", "slow_code_sha256": "7838a318c333827f3472e6350353ce8b4259224d69f85170d3cd9658a4f5e659", "slow_id": "p03006_7838a318c333827f3472e6350353ce8b4259224d69f85170d3cd9658a4f5e659", "speedup": 7.044228006783901, "stratum": "4-8", "within_pair_jaccard": 0.3181818181818182, "workload": {"case_count": 100, "description": "Collect N distinct plane points in any order, choosing one fixed nonzero integer displacement (p,q). A collection costs 0 if its point equals the previously collected point plus (p,q), otherwise 1, including the first. Minimize total cost. Observed inputs: N=1..50 (median 20); x_i=-999595444..998135854; y_i=-998893103..992792936.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1075, "median": 402.5, "min": 23}, "input_format": ["N\nx_1 y_1\n...\nx_N y_N"], "input_format_status": "source_input_section", "input_lines": {"max": 51, "median": 21.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 101, "median": 41.0, "min": 3}}} -{"case_ids": ["p03700_case_000", "p03700_case_001", "p03700_case_002", "p03700_case_003", "p03700_case_004", "p03700_case_005", "p03700_case_006", "p03700_case_007", "p03700_case_008", "p03700_case_009", "p03700_case_010", "p03700_case_011", "p03700_case_012", "p03700_case_013", "p03700_case_014", "p03700_case_015", "p03700_case_016", "p03700_case_017", "p03700_case_018", "p03700_case_019", "p03700_case_020", "p03700_case_021", "p03700_case_022", "p03700_case_023", "p03700_case_024", "p03700_case_025", "p03700_case_026", "p03700_case_027", "p03700_case_028", "p03700_case_029", "p03700_case_030", "p03700_case_031", "p03700_case_032", "p03700_case_033", "p03700_case_034", "p03700_case_035", "p03700_case_036", "p03700_case_037", "p03700_case_038", "p03700_case_039", "p03700_case_040", "p03700_case_041", "p03700_case_042", "p03700_case_043", "p03700_case_044", "p03700_case_045", "p03700_case_046", "p03700_case_047", "p03700_case_048", "p03700_case_049", "p03700_case_050", "p03700_case_051", "p03700_case_052", "p03700_case_053", "p03700_case_054", "p03700_case_055", "p03700_case_056", "p03700_case_057", "p03700_case_058", "p03700_case_059", "p03700_case_060", "p03700_case_061", "p03700_case_062", "p03700_case_063", "p03700_case_064", "p03700_case_065", "p03700_case_066", "p03700_case_067", "p03700_case_068", "p03700_case_069", "p03700_case_070", "p03700_case_071", "p03700_case_072", "p03700_case_073", "p03700_case_074", "p03700_case_075", "p03700_case_076", "p03700_case_077", "p03700_case_078", "p03700_case_079", "p03700_case_080", "p03700_case_081", "p03700_case_082", "p03700_case_083", "p03700_case_084", "p03700_case_085", "p03700_case_086", "p03700_case_087", "p03700_case_088", "p03700_case_089", "p03700_case_090", "p03700_case_091", "p03700_case_092", "p03700_case_093", "p03700_case_094", "p03700_case_095", "p03700_case_096", "p03700_case_097", "p03700_case_098", "p03700_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from math import ceil\n\nN, A, B = list(map(int, input().split()))\nh = [int(eval(input())) for _ in range(N)]\n\n\ndef f(k):\n return sum([ceil((hi - B * k) / (A - B)) for hi in h if hi - k * B > 0]) <= k\n\n\nl, r = 0, ceil(max(h) / B)\nwhile r - l > 1:\n if f((l + r) // 2):\n r = (l + r) // 2\n else:\n l = (l + r) // 2\nprint(r)\n", "fast_code_sha256": "d0ecbb214d334dfc0ec9de283d88574cad950a1a5930e39d1450ac4087a24f88", "fast_id": "p03700_d0ecbb214d334dfc0ec9de283d88574cad950a1a5930e39d1450ac4087a24f88", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from math import ceil\n\nN, A, B = list(map(int, input().split()))\nh = [int(eval(input())) for _ in range(N)]\n\n\ndef f(k):\n return sum([ceil((hi - B * k) / (A - B)) for hi in h if hi - k * B > 0]) <= k\n\n\nl, r = 0, ceil(max(h) / B)\nwhile r - l > 1:\n if f((l + r) // 2):\n r = (l + r) // 2\n else:\n l = (l + r) // 2\nprint(r)\n", "measured_fast_code_sha256": "d0ecbb214d334dfc0ec9de283d88574cad950a1a5930e39d1450ac4087a24f88", "measured_slow_code": "import numpy as np\n\nN, A, B = list(map(int, input().split()))\nH = np.zeros(shape=N, dtype=\"int64\")\nfor _ in range(N):\n h = int(eval(input()))\n H[_] = h\n\n\ndef calc(num, a):\n a -= num * B\n a = (a - 1) // (A - B) + 1\n if sum(a[a > 0]) <= num:\n return True\n else:\n return False\n\n\nstart = 0\nend = 10**10\nwhile end - start > 1:\n mid = (start + end) // 2\n if calc(mid, H.copy()):\n end = mid\n else:\n start = mid\nprint(end)\n", "measured_slow_code_sha256": "4f614769a7e22dddcb85c7a9aa9d9cee3d9896b34340a1e7d8590ac4705426eb", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.1694592124661538, "pair_id": "python_v2_dfd2cc391e1c308fefde5cc0", "per_case_slow_code_faster_fraction": 0.3, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03700", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03700_d0ecbb214d334dfc0ec9de283d88574cad950a1a5930e39d1450ac4087a24f88.jsonl.gz", "inputs": "reproduction/python/inputs/p03700.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03700_4f614769a7e22dddcb85c7a9aa9d9cee3d9896b34340a1e7d8590ac4705426eb.jsonl.gz"}, "slow_code": "import numpy as np\n\nN, A, B = list(map(int, input().split()))\nH = np.zeros(shape=N, dtype=\"int64\")\nfor _ in range(N):\n h = int(eval(input()))\n H[_] = h\n\n\ndef calc(num, a):\n a -= num * B\n a = (a - 1) // (A - B) + 1\n if sum(a[a > 0]) <= num:\n return True\n else:\n return False\n\n\nstart = 0\nend = 10**10\nwhile end - start > 1:\n mid = (start + end) // 2\n if calc(mid, H.copy()):\n end = mid\n else:\n start = mid\nprint(end)\n", "slow_code_sha256": "4f614769a7e22dddcb85c7a9aa9d9cee3d9896b34340a1e7d8590ac4705426eb", "slow_id": "p03700_4f614769a7e22dddcb85c7a9aa9d9cee3d9896b34340a1e7d8590ac4705426eb", "speedup": 3.9586802469273645, "stratum": "2-4", "within_pair_jaccard": 0.47058823529411764, "workload": {"case_count": 100, "description": "Each explosion targets one living monster for A damage and damages every other monster by B, with A>B. Monsters vanish at health <=0. Minimize explosions needed to eliminate all N monsters of initial health h_i. Observed inputs: N=1..100000 (median 100000); A=2..1000000000; B=1..999999999; h_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1100028, "median": 988832.0, "min": 10}, "input_format": ["N A B\nh_1\n...\nh_N"], "input_format_status": "source_input_section", "input_lines": {"max": 100001, "median": 100001.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100003, "median": 100003.0, "min": 4}}} -{"case_ids": ["p02732_case_000", "p02732_case_001", "p02732_case_002", "p02732_case_003", "p02732_case_004", "p02732_case_005", "p02732_case_006", "p02732_case_007", "p02732_case_008", "p02732_case_009", "p02732_case_010", "p02732_case_011", "p02732_case_012", "p02732_case_013", "p02732_case_014", "p02732_case_015", "p02732_case_016", "p02732_case_017", "p02732_case_018", "p02732_case_019", "p02732_case_020", "p02732_case_021", "p02732_case_022", "p02732_case_023", "p02732_case_024", "p02732_case_025", "p02732_case_026", "p02732_case_027", "p02732_case_028", "p02732_case_029", "p02732_case_030", "p02732_case_031", "p02732_case_032", "p02732_case_033", "p02732_case_034", "p02732_case_035", "p02732_case_036", "p02732_case_037", "p02732_case_038", "p02732_case_039", "p02732_case_040", "p02732_case_041", "p02732_case_042", "p02732_case_043", "p02732_case_044", "p02732_case_045", "p02732_case_046", "p02732_case_047", "p02732_case_048", "p02732_case_049", "p02732_case_050", "p02732_case_051", "p02732_case_052", "p02732_case_053", "p02732_case_054", "p02732_case_055", "p02732_case_056", "p02732_case_057", "p02732_case_058", "p02732_case_059", "p02732_case_060", "p02732_case_061", "p02732_case_062", "p02732_case_063", "p02732_case_064", "p02732_case_065", "p02732_case_066", "p02732_case_067", "p02732_case_068", "p02732_case_069", "p02732_case_070", "p02732_case_071", "p02732_case_072", "p02732_case_073", "p02732_case_074", "p02732_case_075", "p02732_case_076", "p02732_case_077", "p02732_case_078", "p02732_case_079", "p02732_case_080", "p02732_case_081", "p02732_case_082", "p02732_case_083", "p02732_case_084", "p02732_case_085", "p02732_case_086", "p02732_case_087", "p02732_case_088", "p02732_case_089", "p02732_case_090", "p02732_case_091", "p02732_case_092", "p02732_case_093", "p02732_case_094", "p02732_case_095", "p02732_case_096", "p02732_case_097", "p02732_case_098", "p02732_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\na = list(map(int, input().split()))\nnums = [0] * (n + 1)\nfor i in a:\n nums[i] += 1\nt = 0\nfor i in nums:\n t += i * (i - 1) // 2\nfor i in a:\n print((t + 1 - nums[i]))\n", "fast_code_sha256": "837995072643501db9343ab30259ab1cbf9b990af19306bf6adac9edb52ade3a", "fast_id": "p02732_837995072643501db9343ab30259ab1cbf9b990af19306bf6adac9edb52ade3a", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\na = list(map(int, input().split()))\nnums = [0] * (n + 1)\nfor i in a:\n nums[i] += 1\nt = 0\nfor i in nums:\n t += i * (i - 1) // 2\nfor i in a:\n print((t + 1 - nums[i]))\n", "measured_fast_code_sha256": "837995072643501db9343ab30259ab1cbf9b990af19306bf6adac9edb52ade3a", "measured_slow_code": "from functools import reduce\n\n\ndef d_banned_k():\n from collections import Counter\n from functools import reduce\n\n N = int(eval(input()))\n A = [int(i) for i in input().split()]\n\n def comb(n, r):\n numerator = reduce(lambda x, y: x * y, list(range(n, n - r, -1)))\n denominator = reduce(lambda x, y: x * y, list(range(1, r + 1)))\n return numerator // denominator\n\n count = Counter(A)\n total = sum(comb(c, 2) for c in list(count.values()))\n ans = []\n for a in A:\n v = count[a]\n ans.append(total - comb(v, 2) + comb(v - 1, 2))\n return \" \".join(map(str, ans))\n\n\nprint((d_banned_k()))\n", "measured_slow_code_sha256": "715c50a0bd5503a1c5a8f5900a3590d1b55c78b7a98e77c948ef59c2a023b3ea", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.632120649379221, "pair_id": "python_v2_9913d5c04d2ec3218b1a9f82", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02732", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02732_837995072643501db9343ab30259ab1cbf9b990af19306bf6adac9edb52ade3a.jsonl.gz", "inputs": "reproduction/python/inputs/p02732.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02732_715c50a0bd5503a1c5a8f5900a3590d1b55c78b7a98e77c948ef59c2a023b3ea.jsonl.gz"}, "slow_code": "from functools import reduce\n\n\ndef d_banned_k():\n from collections import Counter\n from functools import reduce\n\n N = int(eval(input()))\n A = [int(i) for i in input().split()]\n\n def comb(n, r):\n numerator = reduce(lambda x, y: x * y, list(range(n, n - r, -1)))\n denominator = reduce(lambda x, y: x * y, list(range(1, r + 1)))\n return numerator // denominator\n\n count = Counter(A)\n total = sum(comb(c, 2) for c in list(count.values()))\n ans = []\n for a in A:\n v = count[a]\n ans.append(total - comb(v, 2) + comb(v - 1, 2))\n return \" \".join(map(str, ans))\n\n\nprint((d_banned_k()))\n", "slow_code_sha256": "715c50a0bd5503a1c5a8f5900a3590d1b55c78b7a98e77c948ef59c2a023b3ea", "slow_id": "p02732_715c50a0bd5503a1c5a8f5900a3590d1b55c78b7a98e77c948ef59c2a023b3ea", "speedup": 3.5495315528785705, "stratum": "2-4", "within_pair_jaccard": 0.2826086956521739, "workload": {"case_count": 100, "description": "For each position k in an N-ball sequence, exclude only that ball and count unordered pairs of distinct remaining balls carrying equal integer values A_i. Observed inputs: N=3..200000 (median 550); A_i=1..200000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1400007, "median": 1155.0, "min": 8}, "input_format": ["N\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200001, "median": 551.0, "min": 4}}} -{"case_ids": ["p00219_case_000", "p00219_case_001", "p00219_case_002", "p00219_case_003", "p00219_case_004", "p00219_case_005", "p00219_case_006", "p00219_case_007", "p00219_case_008", "p00219_case_009", "p00219_case_010", "p00219_case_011", "p00219_case_012", "p00219_case_013", "p00219_case_014", "p00219_case_015", "p00219_case_016", "p00219_case_017", "p00219_case_018", "p00219_case_019", "p00219_case_020", "p00219_case_021", "p00219_case_022", "p00219_case_023", "p00219_case_024", "p00219_case_025", "p00219_case_026", "p00219_case_027", "p00219_case_028", "p00219_case_029", "p00219_case_030", "p00219_case_031", "p00219_case_032", "p00219_case_033", "p00219_case_034", "p00219_case_035", "p00219_case_036", "p00219_case_037", "p00219_case_038", "p00219_case_039", "p00219_case_040", "p00219_case_041", "p00219_case_042", "p00219_case_043", "p00219_case_044", "p00219_case_045", "p00219_case_046", "p00219_case_047", "p00219_case_048", "p00219_case_049", "p00219_case_050", "p00219_case_051", "p00219_case_052", "p00219_case_053", "p00219_case_054", "p00219_case_055", "p00219_case_056", "p00219_case_057", "p00219_case_058", "p00219_case_059", "p00219_case_060", "p00219_case_061", "p00219_case_062", "p00219_case_063", "p00219_case_064", "p00219_case_065", "p00219_case_066", "p00219_case_067", "p00219_case_068", "p00219_case_069", "p00219_case_070", "p00219_case_071", "p00219_case_072", "p00219_case_073", "p00219_case_074", "p00219_case_075", "p00219_case_076", "p00219_case_077", "p00219_case_078", "p00219_case_079", "p00219_case_080", "p00219_case_081", "p00219_case_082", "p00219_case_083", "p00219_case_084", "p00219_case_085", "p00219_case_086", "p00219_case_087", "p00219_case_088", "p00219_case_089", "p00219_case_090", "p00219_case_091", "p00219_case_092", "p00219_case_093", "p00219_case_094", "p00219_case_095", "p00219_case_096", "p00219_case_097", "p00219_case_098", "p00219_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "while 1:\n n = eval(input())\n if n == 0:\n break\n h = [0] * 10\n for i in range(n):\n h[int(input())] += 1\n for i in range(10):\n print(\"*\" * h[i] if h[i] else \"-\")\n", "fast_code_sha256": "609e346782ecf49c23ca5198c907b710c087fbc5b7bd73f09ea7653abfa5c4cb", "fast_id": "p00219_609e346782ecf49c23ca5198c907b710c087fbc5b7bd73f09ea7653abfa5c4cb", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "while 1:\n n = eval(input())\n if n == 0:\n break\n h = [0] * 10\n for i in range(n):\n h[int(input())] += 1\n for i in range(10):\n print(\"*\" * h[i] if h[i] else \"-\")\n", "measured_fast_code_sha256": "609e346782ecf49c23ca5198c907b710c087fbc5b7bd73f09ea7653abfa5c4cb", "measured_slow_code": "#!/usr/bin/env python3\nwhile True:\n n = int(eval(input()))\n data = [0] * 10\n if n == 0:\n break\n for _ in range(n):\n in_data = int(eval(input()))\n data[in_data] += 1\n for d in data:\n if d == 0:\n print(\"-\")\n else:\n print((\"*\" * d))\n", "measured_slow_code_sha256": "36c6082fb1a0d124350bbc45ec556aeb301f370e97f31aaee43e9eb11cc4f99a", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4.754286892674866, "pair_id": "python_v2_486e4ab8325a73756d593c01", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p00219", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p00219_609e346782ecf49c23ca5198c907b710c087fbc5b7bd73f09ea7653abfa5c4cb.jsonl.gz", "inputs": "reproduction/python/inputs/p00219.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p00219_36c6082fb1a0d124350bbc45ec556aeb301f370e97f31aaee43e9eb11cc4f99a.jsonl.gz"}, "slow_code": "while True:\n n = int(eval(input()))\n data = [0] * 10\n if n == 0:\n break\n for _ in range(n):\n in_data = int(eval(input()))\n data[in_data] += 1\n for d in data:\n if d == 0:\n print(\"-\")\n else:\n print((\"*\" * d))\n", "slow_code_sha256": "e2d53f24e1a4828a64903ebdc18061753747e6715fce06b897286dc27a75ba38", "slow_id": "p00219_36c6082fb1a0d124350bbc45ec556aeb301f370e97f31aaee43e9eb11cc4f99a", "speedup": 3.8647545209442034, "stratum": "2-4", "within_pair_jaccard": 0.6818181818181818, "workload": {"case_count": 100, "description": "For each dataset of sold item types c_i in 0..9, print a frequency histogram in type order: one asterisk per occurrence, or a hyphen for zero occurrences. Each dataset declares n; a final zero in place of n ends input. Observed inputs: datasets=1..15 (median 1); n=1..10000; total_records=1..113926 (median 10000); c_i=0..9.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 227929, "median": 20008.0, "min": 6}, "input_format": ["n_1\nc_1\n...\nc_(n_1)\n[next datasets]\n0"], "input_format_status": "source_input_section", "input_lines": {"max": 113942, "median": 10002.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 113942, "median": 10002.0, "min": 3}}} -{"case_ids": ["p03419_case_000", "p03419_case_001", "p03419_case_002", "p03419_case_003", "p03419_case_004", "p03419_case_005", "p03419_case_006", "p03419_case_007", "p03419_case_008", "p03419_case_009", "p03419_case_010", "p03419_case_011", "p03419_case_012", "p03419_case_013", "p03419_case_014", "p03419_case_015", "p03419_case_016", "p03419_case_017", "p03419_case_018", "p03419_case_019", "p03419_case_020", "p03419_case_021", "p03419_case_022", "p03419_case_023", "p03419_case_024", "p03419_case_025", "p03419_case_026", "p03419_case_027", "p03419_case_028", "p03419_case_029", "p03419_case_030", "p03419_case_031", "p03419_case_032", "p03419_case_033", "p03419_case_034", "p03419_case_035", "p03419_case_036", "p03419_case_037", "p03419_case_038", "p03419_case_039", "p03419_case_040", "p03419_case_041", "p03419_case_042", "p03419_case_043", "p03419_case_044", "p03419_case_045", "p03419_case_046", "p03419_case_047", "p03419_case_048", "p03419_case_049", "p03419_case_050", "p03419_case_051", "p03419_case_052", "p03419_case_053", "p03419_case_054", "p03419_case_055", "p03419_case_056", "p03419_case_057", "p03419_case_058", "p03419_case_059", "p03419_case_060", "p03419_case_061", "p03419_case_062", "p03419_case_063", "p03419_case_064", "p03419_case_065", "p03419_case_066", "p03419_case_067", "p03419_case_068", "p03419_case_069", "p03419_case_070", "p03419_case_071", "p03419_case_072", "p03419_case_073", "p03419_case_074", "p03419_case_075", "p03419_case_076", "p03419_case_077", "p03419_case_078", "p03419_case_079", "p03419_case_080", "p03419_case_081", "p03419_case_082", "p03419_case_083", "p03419_case_084", "p03419_case_085", "p03419_case_086", "p03419_case_087", "p03419_case_088", "p03419_case_089", "p03419_case_090", "p03419_case_091", "p03419_case_092", "p03419_case_093", "p03419_case_094", "p03419_case_095", "p03419_case_096", "p03419_case_097", "p03419_case_098", "p03419_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n, m = list(map(int, input().split()))\nif n == 1 or m == 1:\n print((1 if n * m == 1 else max(n, m) - 2))\nelse:\n print(((n - 2) * (m - 2)))\n", "fast_code_sha256": "a8764e435fcf099811246783156c1fa3d8a7beab59fd7a1050989deae490782e", "fast_id": "p03419_a8764e435fcf099811246783156c1fa3d8a7beab59fd7a1050989deae490782e", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n, m = list(map(int, input().split()))\nif n == 1 or m == 1:\n print((1 if n * m == 1 else max(n, m) - 2))\nelse:\n print(((n - 2) * (m - 2)))\n", "measured_fast_code_sha256": "a8764e435fcf099811246783156c1fa3d8a7beab59fd7a1050989deae490782e", "measured_slow_code": "def calc0(N, M):\n cell = [[0 for i in range(M)] for j in range(N)]\n for i in range(M):\n for j in range(N):\n for y in range(-1, 2):\n for x in range(-1, 2):\n xx = i + x\n yy = j + y\n if 0 <= xx < M and 0 <= yy < N:\n cell[yy][xx] ^= 1\n r = 0\n for i in range(M):\n for j in range(N):\n if cell[j][i]:\n r += 1\n return r\n\n\ndef calc(N, M):\n if N == 1 and M == 1:\n return 1\n if N >= 2 and M >= 2:\n return (N - 2) * (M - 2)\n if N == 1:\n return M - 2\n return N - 2\n\n\nN, M = [int(_) for _ in input().split()]\nprint((calc(N, M)))\n", "measured_slow_code_sha256": "03759bbd848f3c06ca221a2e3cc07d0592161ce2c92214006d02107382720a3e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.6313764699702635, "pair_id": "python_v2_2185ead8822759bb3a77568f", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03419", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03419_a8764e435fcf099811246783156c1fa3d8a7beab59fd7a1050989deae490782e.jsonl.gz", "inputs": "reproduction/python/inputs/p03419.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03419_03759bbd848f3c06ca221a2e3cc07d0592161ce2c92214006d02107382720a3e.jsonl.gz"}, "slow_code": "def calc0(N, M):\n cell = [[0 for i in range(M)] for j in range(N)]\n for i in range(M):\n for j in range(N):\n for y in range(-1, 2):\n for x in range(-1, 2):\n xx = i + x\n yy = j + y\n if 0 <= xx < M and 0 <= yy < N:\n cell[yy][xx] ^= 1\n r = 0\n for i in range(M):\n for j in range(N):\n if cell[j][i]:\n r += 1\n return r\n\n\ndef calc(N, M):\n if N == 1 and M == 1:\n return 1\n if N >= 2 and M >= 2:\n return (N - 2) * (M - 2)\n if N == 1:\n return M - 2\n return N - 2\n\n\nN, M = [int(_) for _ in input().split()]\nprint((calc(N, M)))\n", "slow_code_sha256": "03759bbd848f3c06ca221a2e3cc07d0592161ce2c92214006d02107382720a3e", "slow_id": "p03419_03759bbd848f3c06ca221a2e3cc07d0592161ce2c92214006d02107382720a3e", "speedup": 3.6288389218493085, "stratum": "2-4", "within_pair_jaccard": 0.20588235294117646, "workload": {"case_count": 100, "description": "An implicit N-by-M rectangle has one face-up card per cell. Once per cell, flip its own card and each of its eight neighboring cards that exists. Count face-down cards after all operations. Observed inputs: N=1..1000000000 (median 411600306.5); M=1..1000000000 (median 380900118.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 22, "median": 18.5, "min": 4}, "input_format": ["N M"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p03331_case_000", "p03331_case_001", "p03331_case_002", "p03331_case_003", "p03331_case_004", "p03331_case_005", "p03331_case_006", "p03331_case_007", "p03331_case_008", "p03331_case_009", "p03331_case_010", "p03331_case_011", "p03331_case_012", "p03331_case_013", "p03331_case_014", "p03331_case_015", "p03331_case_016", "p03331_case_017", "p03331_case_018", "p03331_case_019", "p03331_case_020", "p03331_case_021", "p03331_case_022", "p03331_case_023", "p03331_case_024", "p03331_case_025", "p03331_case_026", "p03331_case_027", "p03331_case_028", "p03331_case_029", "p03331_case_030", "p03331_case_031", "p03331_case_032", "p03331_case_033", "p03331_case_034", "p03331_case_035", "p03331_case_036", "p03331_case_037", "p03331_case_038", "p03331_case_039", "p03331_case_040", "p03331_case_041", "p03331_case_042", "p03331_case_043", "p03331_case_044", "p03331_case_045", "p03331_case_046", "p03331_case_047", "p03331_case_048", "p03331_case_049", "p03331_case_050", "p03331_case_051", "p03331_case_052", "p03331_case_053", "p03331_case_054", "p03331_case_055", "p03331_case_056", "p03331_case_057", "p03331_case_058", "p03331_case_059", "p03331_case_060", "p03331_case_061", "p03331_case_062", "p03331_case_063", "p03331_case_064", "p03331_case_065", "p03331_case_066", "p03331_case_067", "p03331_case_068", "p03331_case_069", "p03331_case_070", "p03331_case_071", "p03331_case_072", "p03331_case_073", "p03331_case_074", "p03331_case_075", "p03331_case_076", "p03331_case_077", "p03331_case_078", "p03331_case_079", "p03331_case_080", "p03331_case_081", "p03331_case_082", "p03331_case_083", "p03331_case_084", "p03331_case_085", "p03331_case_086", "p03331_case_087", "p03331_case_088", "p03331_case_089", "p03331_case_090", "p03331_case_091", "p03331_case_092", "p03331_case_093", "p03331_case_094", "p03331_case_095", "p03331_case_096", "p03331_case_097", "p03331_case_098", "p03331_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\n\ndef II():\n return int(sys.stdin.readline())\n\n\ndef MI():\n return list(map(int, sys.stdin.readline().split()))\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\ndef LLI(rows_number):\n return [LI() for _ in range(rows_number)]\n\n\ndef solver(inputNum):\n result = 0\n\n totalDigit = 0\n inputStr = str(inputNum)\n for j in range(0, len(inputStr)):\n totalDigit = totalDigit + int(inputStr[j])\n if totalDigit == 1:\n result = 10\n else:\n result = totalDigit\n return result\n\n\nif __name__ == \"__main__\":\n print((\"{}\".format(solver(II()))))\n", "fast_code_sha256": "9fd6da3eb9e2281266cffafff50ecb984024f022848448dd2a693028f6ce010c", "fast_id": "p03331_3a843193d8bdb990eccd8eb9b944899aae21a8331eb28561f355b4ac40a65de0", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "# Problem: https://atcoder.jp/contests/agc025/tasks/agc025_a\n# Python 3rd Try\nimport sys\n\n# from collections import defaultdict\n# import heapq,copy\n# from collections import deque\ndef II():\n return int(sys.stdin.readline())\n\n\ndef MI():\n return list(map(int, sys.stdin.readline().split()))\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\ndef LLI(rows_number):\n return [LI() for _ in range(rows_number)]\n\n\ndef solver(inputNum):\n result = 0\n # algorithm\n totalDigit = 0\n inputStr = str(inputNum)\n for j in range(0, len(inputStr)):\n totalDigit = totalDigit + int(inputStr[j])\n if totalDigit == 1:\n result = 10\n else:\n result = totalDigit\n return result\n\n\nif __name__ == \"__main__\":\n print((\"{}\".format(solver(II()))))\n", "measured_fast_code_sha256": "3a843193d8bdb990eccd8eb9b944899aae21a8331eb28561f355b4ac40a65de0", "measured_slow_code": "N = int(eval(input()))\nimport numpy as np\n\na = np.arange(N)\na = np.delete(a, 0)\nb = N - a\nnum_arr = []\nfor i in range(len(a)):\n factor_a = [int(x) for x in list(str(a[i]))]\n factor_b = [int(x) for x in list(str(b[i]))]\n num_arr.append(sum(factor_a) + sum(factor_b))\nprint((min(num_arr)))\n", "measured_slow_code_sha256": "153ddd3939958df9731f2cb6a9569dfdd13dde4cae47410105d9d1d355dcbd24", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2619.812133099419, "pair_id": "python_v2_3bebc6ffa99554bb01dfd3de", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03331", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03331_3a843193d8bdb990eccd8eb9b944899aae21a8331eb28561f355b4ac40a65de0.jsonl.gz", "inputs": "reproduction/python/inputs/p03331.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03331_153ddd3939958df9731f2cb6a9569dfdd13dde4cae47410105d9d1d355dcbd24.jsonl.gz"}, "slow_code": "N = int(eval(input()))\nimport numpy as np\n\na = np.arange(N)\na = np.delete(a, 0)\nb = N - a\nnum_arr = []\nfor i in range(len(a)):\n factor_a = [int(x) for x in list(str(a[i]))]\n factor_b = [int(x) for x in list(str(b[i]))]\n num_arr.append(sum(factor_a) + sum(factor_b))\nprint((min(num_arr)))\n", "slow_code_sha256": "153ddd3939958df9731f2cb6a9569dfdd13dde4cae47410105d9d1d355dcbd24", "slow_id": "p03331_153ddd3939958df9731f2cb6a9569dfdd13dde4cae47410105d9d1d355dcbd24", "speedup": 1951.8469456182982, "stratum": "8+", "within_pair_jaccard": 0.18518518518518517, "workload": {"case_count": 100, "description": "Split N into two positive integers A+B=N, minimizing the sum of their decimal digit sums. Observed inputs: N=2..100000 (median 58160.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 7, "median": 6.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p03558_case_000", "p03558_case_001", "p03558_case_002", "p03558_case_003", "p03558_case_004", "p03558_case_005", "p03558_case_006", "p03558_case_007", "p03558_case_008", "p03558_case_009", "p03558_case_010", "p03558_case_011", "p03558_case_012", "p03558_case_013", "p03558_case_014", "p03558_case_015", "p03558_case_016", "p03558_case_017", "p03558_case_018", "p03558_case_019", "p03558_case_020", "p03558_case_021", "p03558_case_022", "p03558_case_023", "p03558_case_024", "p03558_case_025", "p03558_case_026", "p03558_case_027", "p03558_case_028", "p03558_case_029", "p03558_case_030", "p03558_case_031", "p03558_case_032", "p03558_case_033", "p03558_case_034", "p03558_case_035", "p03558_case_036", "p03558_case_037", "p03558_case_038", "p03558_case_039", "p03558_case_040", "p03558_case_041", "p03558_case_042", "p03558_case_043", "p03558_case_044", "p03558_case_045", "p03558_case_046", "p03558_case_047", "p03558_case_048", "p03558_case_049", "p03558_case_050", "p03558_case_051", "p03558_case_052", "p03558_case_053", "p03558_case_054", "p03558_case_055", "p03558_case_056", "p03558_case_057", "p03558_case_058", "p03558_case_059", "p03558_case_060", "p03558_case_061", "p03558_case_062", "p03558_case_063", "p03558_case_064", "p03558_case_065", "p03558_case_066", "p03558_case_067", "p03558_case_068", "p03558_case_069", "p03558_case_070", "p03558_case_071", "p03558_case_072", "p03558_case_073", "p03558_case_074", "p03558_case_075", "p03558_case_076", "p03558_case_077", "p03558_case_078", "p03558_case_079", "p03558_case_080", "p03558_case_081", "p03558_case_082", "p03558_case_083", "p03558_case_084", "p03558_case_085", "p03558_case_086", "p03558_case_087", "p03558_case_088", "p03558_case_089", "p03558_case_090", "p03558_case_091", "p03558_case_092", "p03558_case_093", "p03558_case_094", "p03558_case_095", "p03558_case_096", "p03558_case_097", "p03558_case_098", "p03558_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "executable_AST_equal_except_explicit_explanatory_string_removal_and_all_frozen_inputs_checker_pass", "fast_code": "def solve(K):\n checked = [False] * K\n\n def calc(x):\n while not checked[x]:\n checked[x] = True\n yield x\n x = (x * 10) % K\n\n i = 0\n xs = [0]\n while 1:\n i += 1\n ys = []\n for x in xs:\n for z in calc((x + 1) % K):\n if z == 0:\n return i\n ys.append(z)\n xs = ys\n\n\nK = int(eval(input()))\nprint((solve(K)))\n", "fast_code_sha256": "df78678cc468f931c4deecedae5654556a3e34626187f1eb870d9dc288d371ff", "fast_id": "p03558_df78678cc468f931c4deecedae5654556a3e34626187f1eb870d9dc288d371ff", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def solve(K):\n checked = [False] * K\n\n def calc(x):\n while not checked[x]:\n checked[x] = True\n yield x\n x = (x * 10) % K\n\n i = 0\n xs = [0]\n while 1:\n i += 1\n ys = []\n for x in xs:\n for z in calc((x + 1) % K):\n if z == 0:\n return i\n ys.append(z)\n xs = ys\n\n\nK = int(eval(input()))\nprint((solve(K)))\n", "measured_fast_code_sha256": "df78678cc468f931c4deecedae5654556a3e34626187f1eb870d9dc288d371ff", "measured_slow_code": "# coding: utf-8\n# Your code here!\nimport sys\n\nsys.setrecursionlimit(10**6)\nreadline = sys.stdin.readline # 文字列入力のときは注意\nk = int(eval(input()))\ng = [[] for _ in range(k)]\nfor i in range(k):\n g[i].append(((i + 1) % k, 1))\n if i:\n g[i].append((10 * i % k, 0))\n# print(g)\n\"\"\"\nfrom collections import deque\nq = deque([1])\nINF = float(\"inf\")\nres = [INF]*k\nres[1] = 1\nwhile q and res[0] == INF:\n# print(q)\n v = q.popleft()\n for c,d in g[v]:\n if res[c] <= res[v] + d: continue\n res[c] = res[v] + d\n if d: q.append(c)\n else: q.appendleft(c)\n#print(res)\n#print(used)\nprint(res[0])\n\"\"\"\nfrom heapq import *\n\n\ndef dijkstra(g, start):\n n = len(g)\n dist = [float(\"inf\")] * (n) # startからの最短距離\n pending = n - 1 # 未確定の点の個数\n dist[start] = 0\n q = [(0, start)] # (そこまでの距離、点)\n while q and pending:\n c, v = heappop(q)\n if dist[v] < c:\n continue\n pending -= 1\n for to, cost in g[v]:\n if dist[v] + cost < dist[to]:\n dist[to] = dist[v] + cost\n heappush(q, (dist[to], to))\n return dist\n\n\ndist = dijkstra(g, 1)\nprint((dist[0] + 1))\n", "measured_slow_code_sha256": "753ba2acf58970ec408525feda7402d098171beac9bd1950c7052fdfa91dc504", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 7.612275579881752, "pair_id": "python_v2_41f851171c6c596925324b42", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03558", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03558_df78678cc468f931c4deecedae5654556a3e34626187f1eb870d9dc288d371ff.jsonl.gz", "inputs": "reproduction/python/inputs/p03558.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03558_753ba2acf58970ec408525feda7402d098171beac9bd1950c7052fdfa91dc504.jsonl.gz"}, "slow_code": "import sys\n\nsys.setrecursionlimit(10**6)\nreadline = sys.stdin.readline\nk = int(eval(input()))\ng = [[] for _ in range(k)]\nfor i in range(k):\n g[i].append(((i + 1) % k, 1))\n if i:\n g[i].append((10 * i % k, 0))\n\nfrom heapq import *\n\n\ndef dijkstra(g, start):\n n = len(g)\n dist = [float(\"inf\")] * (n)\n pending = n - 1\n dist[start] = 0\n q = [(0, start)]\n while q and pending:\n c, v = heappop(q)\n if dist[v] < c:\n continue\n pending -= 1\n for to, cost in g[v]:\n if dist[v] + cost < dist[to]:\n dist[to] = dist[v] + cost\n heappush(q, (dist[to], to))\n return dist\n\n\ndist = dijkstra(g, 1)\nprint((dist[0] + 1))\n", "slow_code_sha256": "c7f486fef4d399b68139624830a53867acecdea50443da4c3471bb7be8c54eb9", "slow_id": "p03558_753ba2acf58970ec408525feda7402d098171beac9bd1950c7052fdfa91dc504", "speedup": 9.153301307859358, "stratum": "8+", "within_pair_jaccard": 0.234375, "workload": {"case_count": 100, "description": "Find the smallest decimal digit sum among all positive integer multiples of K. Observed inputs: K=2..100000 (median 10205.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 7, "median": 5.5, "min": 2}, "input_format": ["K"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p03312_case_000", "p03312_case_001", "p03312_case_002", "p03312_case_003", "p03312_case_004", "p03312_case_005", "p03312_case_006", "p03312_case_007", "p03312_case_008", "p03312_case_009", "p03312_case_010", "p03312_case_011", "p03312_case_012", "p03312_case_013", "p03312_case_014", "p03312_case_015", "p03312_case_016", "p03312_case_017", "p03312_case_018", "p03312_case_019", "p03312_case_020", "p03312_case_021", "p03312_case_022", "p03312_case_023", "p03312_case_024", "p03312_case_025", "p03312_case_026", "p03312_case_027", "p03312_case_028", "p03312_case_029", "p03312_case_030", "p03312_case_031", "p03312_case_032", "p03312_case_033", "p03312_case_034", "p03312_case_035", "p03312_case_036", "p03312_case_037", "p03312_case_038", "p03312_case_039", "p03312_case_040", "p03312_case_041", "p03312_case_042", "p03312_case_043", "p03312_case_044", "p03312_case_045", "p03312_case_046", "p03312_case_047", "p03312_case_048", "p03312_case_049", "p03312_case_050", "p03312_case_051", "p03312_case_052", "p03312_case_053", "p03312_case_054", "p03312_case_055", "p03312_case_056", "p03312_case_057", "p03312_case_058", "p03312_case_059", "p03312_case_060", "p03312_case_061", "p03312_case_062", "p03312_case_063", "p03312_case_064", "p03312_case_065", "p03312_case_066", "p03312_case_067", "p03312_case_068", "p03312_case_069", "p03312_case_070", "p03312_case_071", "p03312_case_072", "p03312_case_073", "p03312_case_074", "p03312_case_075", "p03312_case_076", "p03312_case_077", "p03312_case_078", "p03312_case_079", "p03312_case_080", "p03312_case_081", "p03312_case_082", "p03312_case_083", "p03312_case_084", "p03312_case_085", "p03312_case_086", "p03312_case_087", "p03312_case_088", "p03312_case_089", "p03312_case_090", "p03312_case_091", "p03312_case_092", "p03312_case_093", "p03312_case_094", "p03312_case_095", "p03312_case_096", "p03312_case_097", "p03312_case_098", "p03312_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\na = list(map(int, input().split()))\n\n\ndef f(a):\n l, r = a[:2]\n m = 1\n b = [(l, r)]\n for i in range(2, n - 2):\n r += a[i]\n while m < i and abs(l - r) > abs(l - r + a[m] * 2):\n l, r = l + a[m], r - a[m]\n m += 1\n b.append((l, r))\n return b\n\n\nprint(\n (\n min(\n max(p, q, r, s) - min(p, q, r, s)\n for ((p, q), (r, s)) in zip(f(a), f(a[::-1])[::-1])\n )\n )\n)\n", "fast_code_sha256": "135e4bd26ba1d3fae326e995137a8a8c419b22ccdcea9d3240ec1886b5a4f161", "fast_id": "p03312_135e4bd26ba1d3fae326e995137a8a8c419b22ccdcea9d3240ec1886b5a4f161", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\na = list(map(int, input().split()))\n\n\ndef f(a):\n l, r = a[:2]\n m = 1\n b = [(l, r)]\n for i in range(2, n - 2):\n r += a[i]\n while m < i and abs(l - r) > abs(l - r + a[m] * 2):\n l, r = l + a[m], r - a[m]\n m += 1\n b.append((l, r))\n return b\n\n\nprint(\n (\n min(\n max(p, q, r, s) - min(p, q, r, s)\n for ((p, q), (r, s)) in zip(f(a), f(a[::-1])[::-1])\n )\n )\n)\n", "measured_fast_code_sha256": "135e4bd26ba1d3fae326e995137a8a8c419b22ccdcea9d3240ec1886b5a4f161", "measured_slow_code": "# ARC100D\nimport sys\n\ninput = lambda: sys.stdin.readline().rstrip()\nsys.setrecursionlimit(max(1000, 10**9))\nn = int(eval(input()))\na = list(map(int, input().split()))\nca = [None] * n # ca[i] = a0~aiの和\ns = 0\nfor i, num in enumerate(a):\n s += a[i]\n ca[i] = s\ndiff = [None] * n\ns = 0\nt = 1\nv1 = 0 # a[:s]\nv2 = a[0] # sum(a[s:t])\ndiff[t - 1] = (v1, v2)\nwhile t < n:\n # print(t, v1-v2)\n t += 1\n v2 += a[t - 1]\n while v1 < v2 and s < t:\n if diff[t - 1] is None or abs(v1 - v2) < abs(diff[t - 1][0] - diff[t - 1][1]):\n diff[t - 1] = (v1, v2)\n s += 1\n v1 += a[s - 1]\n v2 -= a[s - 1]\n if diff[t - 1] is None or abs(v1 - v2) < abs(diff[t - 1][0] - diff[t - 1][1]):\n diff[t - 1] = (v1, v2)\n if v1 > v2 and s >= 1:\n v1 -= a[s - 1]\n v2 += a[s - 1]\n s -= 1\ndiff2 = [None] * n\ns = n\nt = n - 1\nv1 = 0 # sum(a[s:])\nv2 = a[-1] # sum(a[t:s])\ndiff2[t] = (v1, v2)\nwhile t >= 1:\n # print(t, v1, v2)\n t -= 1\n v2 += a[t]\n while v1 < v2 and s > t:\n if diff2[t] is None or abs(v1 - v2) < abs(diff2[t][0] - diff2[t][1]):\n diff2[t] = (v1, v2)\n s -= 1\n v1 += a[s]\n v2 -= a[s]\n if diff2[t] is None or abs(v1 - v2) < abs(diff2[t][0] - diff2[t][1]):\n diff2[t] = (v1, v2)\n if v1 > v2 and s <= n - 2:\n v1 -= a[s]\n v2 += a[s]\n s += 1\nprint(\n (\n min(\n (\n max(diff[i][0], diff[i][1], diff2[i + 1][0], diff2[i + 1][1])\n - min(diff[i][0], diff[i][1], diff2[i + 1][0], diff2[i + 1][1])\n )\n for i in range(n - 1)\n )\n )\n)\n", "measured_slow_code_sha256": "923136bcc3ca1993d7b5b5155c0211bba6ed078795c208a1a3875d6dd7aa6d3a", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.8281930172874974, "pair_id": "python_v2_822d58a491b5366d857131fa", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03312", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03312_135e4bd26ba1d3fae326e995137a8a8c419b22ccdcea9d3240ec1886b5a4f161.jsonl.gz", "inputs": "reproduction/python/inputs/p03312.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03312_923136bcc3ca1993d7b5b5155c0211bba6ed078795c208a1a3875d6dd7aa6d3a.jsonl.gz"}, "slow_code": "import sys\n\ninput = lambda: sys.stdin.readline().rstrip()\nsys.setrecursionlimit(max(1000, 10**9))\nn = int(eval(input()))\na = list(map(int, input().split()))\nca = [None] * n\ns = 0\nfor i, num in enumerate(a):\n s += a[i]\n ca[i] = s\ndiff = [None] * n\ns = 0\nt = 1\nv1 = 0\nv2 = a[0]\ndiff[t - 1] = (v1, v2)\nwhile t < n:\n\n t += 1\n v2 += a[t - 1]\n while v1 < v2 and s < t:\n if diff[t - 1] is None or abs(v1 - v2) < abs(diff[t - 1][0] - diff[t - 1][1]):\n diff[t - 1] = (v1, v2)\n s += 1\n v1 += a[s - 1]\n v2 -= a[s - 1]\n if diff[t - 1] is None or abs(v1 - v2) < abs(diff[t - 1][0] - diff[t - 1][1]):\n diff[t - 1] = (v1, v2)\n if v1 > v2 and s >= 1:\n v1 -= a[s - 1]\n v2 += a[s - 1]\n s -= 1\ndiff2 = [None] * n\ns = n\nt = n - 1\nv1 = 0\nv2 = a[-1]\ndiff2[t] = (v1, v2)\nwhile t >= 1:\n\n t -= 1\n v2 += a[t]\n while v1 < v2 and s > t:\n if diff2[t] is None or abs(v1 - v2) < abs(diff2[t][0] - diff2[t][1]):\n diff2[t] = (v1, v2)\n s -= 1\n v1 += a[s]\n v2 -= a[s]\n if diff2[t] is None or abs(v1 - v2) < abs(diff2[t][0] - diff2[t][1]):\n diff2[t] = (v1, v2)\n if v1 > v2 and s <= n - 2:\n v1 -= a[s]\n v2 += a[s]\n s += 1\nprint(\n (\n min(\n (\n max(diff[i][0], diff[i][1], diff2[i + 1][0], diff2[i + 1][1])\n - min(diff[i][0], diff[i][1], diff2[i + 1][0], diff2[i + 1][1])\n )\n for i in range(n - 1)\n )\n )\n)\n", "slow_code_sha256": "8f562a68154a7b683e51bbc10e45ae21454de6b7bc88fac021784e92ca0d322a", "slow_id": "p03312_923136bcc3ca1993d7b5b5155c0211bba6ed078795c208a1a3875d6dd7aa6d3a", "speedup": 2.7796286447807677, "stratum": "2-4", "within_pair_jaccard": 0.38181818181818183, "workload": {"case_count": 100, "description": "Split a positive array into exactly four nonempty contiguous parts. Minimize the largest part sum minus the smallest part sum. Observed inputs: N=4..200000 (median 1000); A_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 2200007, "median": 2113.5, "min": 10}, "input_format": ["N\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200001, "median": 1001.0, "min": 5}}} -{"case_ids": ["p03693_case_000", "p03693_case_001", "p03693_case_002", "p03693_case_003", "p03693_case_004", "p03693_case_005", "p03693_case_006", "p03693_case_007", "p03693_case_008", "p03693_case_009", "p03693_case_010", "p03693_case_011", "p03693_case_012", "p03693_case_013", "p03693_case_014", "p03693_case_015", "p03693_case_016", "p03693_case_017", "p03693_case_018", "p03693_case_019", "p03693_case_020", "p03693_case_021", "p03693_case_022", "p03693_case_023", "p03693_case_024", "p03693_case_025", "p03693_case_026", "p03693_case_027", "p03693_case_028", "p03693_case_029", "p03693_case_030", "p03693_case_031", "p03693_case_032", "p03693_case_033", "p03693_case_034", "p03693_case_035", "p03693_case_036", "p03693_case_037", "p03693_case_038", "p03693_case_039", "p03693_case_040", "p03693_case_041", "p03693_case_042", "p03693_case_043", "p03693_case_044", "p03693_case_045", "p03693_case_046", "p03693_case_047", "p03693_case_048", "p03693_case_049", "p03693_case_050", "p03693_case_051", "p03693_case_052", "p03693_case_053", "p03693_case_054", "p03693_case_055", "p03693_case_056", "p03693_case_057", "p03693_case_058", "p03693_case_059", "p03693_case_060", "p03693_case_061", "p03693_case_062", "p03693_case_063", "p03693_case_064", "p03693_case_065", "p03693_case_066", "p03693_case_067", "p03693_case_068", "p03693_case_069", "p03693_case_070", "p03693_case_071", "p03693_case_072", "p03693_case_073", "p03693_case_074", "p03693_case_075", "p03693_case_076", "p03693_case_077", "p03693_case_078", "p03693_case_079", "p03693_case_080", "p03693_case_081", "p03693_case_082", "p03693_case_083", "p03693_case_084", "p03693_case_085", "p03693_case_086", "p03693_case_087", "p03693_case_088", "p03693_case_089", "p03693_case_090", "p03693_case_091", "p03693_case_092", "p03693_case_093", "p03693_case_094", "p03693_case_095", "p03693_case_096", "p03693_case_097", "p03693_case_098", "p03693_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "r, g, b = list(map(int, input().split()))\na = r * 100 + g * 10 + b\nprint((\"YES\" if a % 4 == 0 else \"NO\"))\n", "fast_code_sha256": "61deb701074746ec461188214fd713b369a26b70d077d872a3cf8d1d5677faf0", "fast_id": "p03693_61deb701074746ec461188214fd713b369a26b70d077d872a3cf8d1d5677faf0", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "r, g, b = list(map(int, input().split()))\na = r * 100 + g * 10 + b\nprint((\"YES\" if a % 4 == 0 else \"NO\"))\n", "measured_fast_code_sha256": "61deb701074746ec461188214fd713b369a26b70d077d872a3cf8d1d5677faf0", "measured_slow_code": "import numpy as np\n\nr, g, b = list(map(int, input().split()))\nif (100 * r + 10 * g + b) % 4 == 0:\n print(\"YES\")\nelse:\n print(\"NO\")\n", "measured_slow_code_sha256": "a8d7956b0cbea162ca1db60ee520eccf4efc73cdccbed5370688af05e67aaca2", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1786.120969644146, "pair_id": "python_v2_c31a4c23feb5dbe7e41b7e48", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03693", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03693_61deb701074746ec461188214fd713b369a26b70d077d872a3cf8d1d5677faf0.jsonl.gz", "inputs": "reproduction/python/inputs/p03693.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03693_a8d7956b0cbea162ca1db60ee520eccf4efc73cdccbed5370688af05e67aaca2.jsonl.gz"}, "slow_code": "import numpy as np\n\nr, g, b = list(map(int, input().split()))\nif (100 * r + 10 * g + b) % 4 == 0:\n print(\"YES\")\nelse:\n print(\"NO\")\n", "slow_code_sha256": "a8d7956b0cbea162ca1db60ee520eccf4efc73cdccbed5370688af05e67aaca2", "slow_id": "p03693_a8d7956b0cbea162ca1db60ee520eccf4efc73cdccbed5370688af05e67aaca2", "speedup": 1784.3526609469416, "stratum": "8+", "within_pair_jaccard": 0.7727272727272727, "workload": {"case_count": 100, "description": "Read three nonzero decimal digits r,g,b and determine whether the three-digit integer formed in that order is divisible by 4. Observed inputs: r=1..9; g=1..9; b=1..9.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 6, "median": 6.0, "min": 6}, "input_format": ["r g b"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3, "median": 3.0, "min": 3}}} -{"case_ids": ["p03700_case_000", "p03700_case_001", "p03700_case_002", "p03700_case_003", "p03700_case_004", "p03700_case_005", "p03700_case_006", "p03700_case_007", "p03700_case_008", "p03700_case_009", "p03700_case_010", "p03700_case_011", "p03700_case_012", "p03700_case_013", "p03700_case_014", "p03700_case_015", "p03700_case_016", "p03700_case_017", "p03700_case_018", "p03700_case_019", "p03700_case_020", "p03700_case_021", "p03700_case_022", "p03700_case_023", "p03700_case_024", "p03700_case_025", "p03700_case_026", "p03700_case_027", "p03700_case_028", "p03700_case_029", "p03700_case_030", "p03700_case_031", "p03700_case_032", "p03700_case_033", "p03700_case_034", "p03700_case_035", "p03700_case_036", "p03700_case_037", "p03700_case_038", "p03700_case_039", "p03700_case_040", "p03700_case_041", "p03700_case_042", "p03700_case_043", "p03700_case_044", "p03700_case_045", "p03700_case_046", "p03700_case_047", "p03700_case_048", "p03700_case_049", "p03700_case_050", "p03700_case_051", "p03700_case_052", "p03700_case_053", "p03700_case_054", "p03700_case_055", "p03700_case_056", "p03700_case_057", "p03700_case_058", "p03700_case_059", "p03700_case_060", "p03700_case_061", "p03700_case_062", "p03700_case_063", "p03700_case_064", "p03700_case_065", "p03700_case_066", "p03700_case_067", "p03700_case_068", "p03700_case_069", "p03700_case_070", "p03700_case_071", "p03700_case_072", "p03700_case_073", "p03700_case_074", "p03700_case_075", "p03700_case_076", "p03700_case_077", "p03700_case_078", "p03700_case_079", "p03700_case_080", "p03700_case_081", "p03700_case_082", "p03700_case_083", "p03700_case_084", "p03700_case_085", "p03700_case_086", "p03700_case_087", "p03700_case_088", "p03700_case_089", "p03700_case_090", "p03700_case_091", "p03700_case_092", "p03700_case_093", "p03700_case_094", "p03700_case_095", "p03700_case_096", "p03700_case_097", "p03700_case_098", "p03700_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "executable_AST_equal_except_explicit_explanatory_string_removal_and_all_frozen_inputs_checker_pass", "fast_code": "import math\n\nN, A, B = list(map(int, input().split()))\narr = []\nfor i in range(N):\n arr.append(int(eval(input())))\nmax_ = max(arr) // B + 1\nmin_ = min(arr) // A\nd = A - B\nwhile min_ != max_:\n mid = (max_ + min_) // 2\n sum_ = 0\n for x in arr:\n sum_ += max(0, math.ceil((x - mid * B) / d))\n if sum_ <= mid:\n max_ = mid\n else:\n min_ = mid + 1\nprint(min_)\n", "fast_code_sha256": "477acdf83af3186335ea8ccf24f8511c3d2b173d35d09905a2d166a4b194b2ae", "fast_id": "p03700_684ee93472fc0aefac037f153cc0013c6236e7706d26c5c00b062027b4672b35", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import math\n\n\"\"\"\ndef search(min_,max_,A,B,arr):\n# print(min_,max_)\n if min_==max_:\n return min_\n mid=(max_+min_)//2\n tmp=arr-mid*B\n if len(tmp)==0:\n return search(min_,mid,A,B,arr)\n tmp=map(lambda x:math.ceil(x/(A-B)),tmp)\n sum_=sum(list(tmp))\n if sum_<=mid:\n return search(min_,mid,A,B,arr)\n else:\n return search(mid+1,max_,A,B,arr)\n while True:\n if k<0:\n if mid==min_:\n return max_\n else:\n #failure\n return search(mid,max_,A,B,arr[:L])\n elif len(tmp)==0:\n #success\n return search(min_,mid,A,B,arr)\n x=-tmp[0]\n tmp=np.delete(tmp,0)\n k-=x//(A-B)+(x%(A-B)>0)\n\"\"\"\nN, A, B = list(map(int, input().split()))\narr = []\nfor i in range(N):\n arr.append(int(eval(input())))\nmax_ = max(arr) // B + 1\nmin_ = min(arr) // A\nd = A - B\nwhile min_ != max_:\n mid = (max_ + min_) // 2\n sum_ = 0\n for x in arr:\n sum_ += max(0, math.ceil((x - mid * B) / d))\n if sum_ <= mid:\n max_ = mid\n else:\n min_ = mid + 1\nprint(min_)\n", "measured_fast_code_sha256": "684ee93472fc0aefac037f153cc0013c6236e7706d26c5c00b062027b4672b35", "measured_slow_code": "import numpy as np\n\nN, A, B = list(map(int, input().split()))\nH = np.zeros(shape=N, dtype=\"int64\")\nfor _ in range(N):\n h = int(eval(input()))\n H[_] = h\n\n\ndef calc(num, a):\n a -= num * B\n a = (a - 1) // (A - B) + 1\n if sum(a[a > 0]) <= num:\n return True\n else:\n return False\n\n\nstart = 0\nend = 10**10\nwhile end - start > 1:\n mid = (start + end) // 2\n if calc(mid, H.copy()):\n end = mid\n else:\n start = mid\nprint(end)\n", "measured_slow_code_sha256": "4f614769a7e22dddcb85c7a9aa9d9cee3d9896b34340a1e7d8590ac4705426eb", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 0.9844684712259788, "pair_id": "python_v2_dc93a179a19fa63109759b69", "per_case_slow_code_faster_fraction": 0.55, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03700", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03700_684ee93472fc0aefac037f153cc0013c6236e7706d26c5c00b062027b4672b35.jsonl.gz", "inputs": "reproduction/python/inputs/p03700.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03700_4f614769a7e22dddcb85c7a9aa9d9cee3d9896b34340a1e7d8590ac4705426eb.jsonl.gz"}, "slow_code": "import numpy as np\n\nN, A, B = list(map(int, input().split()))\nH = np.zeros(shape=N, dtype=\"int64\")\nfor _ in range(N):\n h = int(eval(input()))\n H[_] = h\n\n\ndef calc(num, a):\n a -= num * B\n a = (a - 1) // (A - B) + 1\n if sum(a[a > 0]) <= num:\n return True\n else:\n return False\n\n\nstart = 0\nend = 10**10\nwhile end - start > 1:\n mid = (start + end) // 2\n if calc(mid, H.copy()):\n end = mid\n else:\n start = mid\nprint(end)\n", "slow_code_sha256": "4f614769a7e22dddcb85c7a9aa9d9cee3d9896b34340a1e7d8590ac4705426eb", "slow_id": "p03700_4f614769a7e22dddcb85c7a9aa9d9cee3d9896b34340a1e7d8590ac4705426eb", "speedup": 3.166774247358761, "stratum": "2-4", "within_pair_jaccard": 0.4032258064516129, "workload": {"case_count": 100, "description": "Each explosion targets one living monster for A damage and damages every other monster by B, with A>B. Monsters vanish at health <=0. Minimize explosions needed to eliminate all N monsters of initial health h_i. Observed inputs: N=1..100000 (median 100000); A=2..1000000000; B=1..999999999; h_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1100028, "median": 988832.0, "min": 10}, "input_format": ["N A B\nh_1\n...\nh_N"], "input_format_status": "source_input_section", "input_lines": {"max": 100001, "median": 100001.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100003, "median": 100003.0, "min": 4}}} -{"case_ids": ["p04014_case_000", "p04014_case_001", "p04014_case_002", "p04014_case_003", "p04014_case_004", "p04014_case_005", "p04014_case_006", "p04014_case_007", "p04014_case_008", "p04014_case_009", "p04014_case_010", "p04014_case_011", "p04014_case_012", "p04014_case_013", "p04014_case_014", "p04014_case_015", "p04014_case_016", "p04014_case_017", "p04014_case_018", "p04014_case_019", "p04014_case_020", "p04014_case_021", "p04014_case_022", "p04014_case_023", "p04014_case_024", "p04014_case_025", "p04014_case_026", "p04014_case_027", "p04014_case_028", "p04014_case_029", "p04014_case_030", "p04014_case_031", "p04014_case_032", "p04014_case_033", "p04014_case_034", "p04014_case_035", "p04014_case_036", "p04014_case_037", "p04014_case_038", "p04014_case_039", "p04014_case_040", "p04014_case_041", "p04014_case_042", "p04014_case_043", "p04014_case_044", "p04014_case_045", "p04014_case_046", "p04014_case_047", "p04014_case_048", "p04014_case_049", "p04014_case_050", "p04014_case_051", "p04014_case_052", "p04014_case_053", "p04014_case_054", "p04014_case_055", "p04014_case_056", "p04014_case_057", "p04014_case_058", "p04014_case_059", "p04014_case_060", "p04014_case_061", "p04014_case_062", "p04014_case_063", "p04014_case_064", "p04014_case_065", "p04014_case_066", "p04014_case_067", "p04014_case_068", "p04014_case_069", "p04014_case_070", "p04014_case_071", "p04014_case_072", "p04014_case_073", "p04014_case_074", "p04014_case_075", "p04014_case_076", "p04014_case_077", "p04014_case_078", "p04014_case_079", "p04014_case_080", "p04014_case_081", "p04014_case_082", "p04014_case_083", "p04014_case_084", "p04014_case_085", "p04014_case_086", "p04014_case_087", "p04014_case_088", "p04014_case_089", "p04014_case_090", "p04014_case_091", "p04014_case_092", "p04014_case_093", "p04014_case_094", "p04014_case_095", "p04014_case_096", "p04014_case_097", "p04014_case_098", "p04014_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def primeFactor(N):\n i, n, ret, d, sq = 2, N, {}, 2, 99\n while i <= sq:\n k = 0\n while n % i == 0:\n n, k, ret[i] = n // i, k + 1, k + 1\n if k > 0 or i == 97:\n sq = int(n ** (1 / 2) + 0.5)\n if i < 4:\n i = i * 2 - 1\n else:\n i, d = i + d, d ^ 6\n if n > 1:\n ret[n] = 1\n return ret\n\n\ndef divisors(N):\n pf = primeFactor(N)\n ret = [1]\n for p in pf:\n ret_prev = ret\n ret = []\n for i in range(pf[p] + 1):\n for r in ret_prev:\n ret.append(r * (p**i))\n return sorted(ret)\n\n\ndef f(b, n):\n re = 0\n while n:\n re += n % b\n n //= b\n return re\n\n\nN = int(eval(input()))\nS = int(eval(input()))\nif N < S:\n print((-1))\nelif N == S:\n print((N + 1))\nelse:\n for b in divisors(N - S):\n b += 1\n if f(b, N) == S:\n print(b)\n break\n else:\n print((-1))\n", "fast_code_sha256": "f27a4bd27f5024506b396d9409e065240fe954af08177935ce3a61cc4ef59dd1", "fast_id": "p04014_f27a4bd27f5024506b396d9409e065240fe954af08177935ce3a61cc4ef59dd1", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def primeFactor(N):\n i, n, ret, d, sq = 2, N, {}, 2, 99\n while i <= sq:\n k = 0\n while n % i == 0:\n n, k, ret[i] = n // i, k + 1, k + 1\n if k > 0 or i == 97:\n sq = int(n ** (1 / 2) + 0.5)\n if i < 4:\n i = i * 2 - 1\n else:\n i, d = i + d, d ^ 6\n if n > 1:\n ret[n] = 1\n return ret\n\n\ndef divisors(N):\n pf = primeFactor(N)\n ret = [1]\n for p in pf:\n ret_prev = ret\n ret = []\n for i in range(pf[p] + 1):\n for r in ret_prev:\n ret.append(r * (p**i))\n return sorted(ret)\n\n\ndef f(b, n):\n re = 0\n while n:\n re += n % b\n n //= b\n return re\n\n\nN = int(eval(input()))\nS = int(eval(input()))\nif N < S:\n print((-1))\nelif N == S:\n print((N + 1))\nelse:\n for b in divisors(N - S):\n b += 1\n if f(b, N) == S:\n print(b)\n break\n else:\n print((-1))\n", "measured_fast_code_sha256": "f27a4bd27f5024506b396d9409e065240fe954af08177935ce3a61cc4ef59dd1", "measured_slow_code": "from math import floor, sqrt\n\nINF = 10**20\n\n\ndef f(b, n):\n if n < b:\n return n\n else:\n return f(b, n // b) + (n % b)\n\n\ndef main():\n n = int(eval(input()))\n s = int(eval(input()))\n ans = INF\n # 1桁\n if n == s:\n ans = min(ans, n + 1)\n # 2桁\n for p in range(1, int(sqrt(n)) + 1):\n q = s - p\n b = (n - q) // p\n if 2 <= b and f(b, n) == s:\n ans = min(ans, b)\n # 3桁以上\n for b in range(2, int(sqrt(n)) + 1):\n if f(b, n) == s:\n ans = min(ans, b)\n print((-1 if ans == INF else ans))\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "c95ad2a8dc940041977600eb1078f63d16cb258708724f5b3b59e88e5ff612b9", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.991357280177266, "pair_id": "python_v2_c85a81a3f39b54ef58b5bb29", "per_case_slow_code_faster_fraction": 0.46, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p04014", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p04014_f27a4bd27f5024506b396d9409e065240fe954af08177935ce3a61cc4ef59dd1.jsonl.gz", "inputs": "reproduction/python/inputs/p04014.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p04014_c95ad2a8dc940041977600eb1078f63d16cb258708724f5b3b59e88e5ff612b9.jsonl.gz"}, "slow_code": "from math import floor, sqrt\n\nINF = 10**20\n\n\ndef f(b, n):\n if n < b:\n return n\n else:\n return f(b, n // b) + (n % b)\n\n\ndef main():\n n = int(eval(input()))\n s = int(eval(input()))\n ans = INF\n\n if n == s:\n ans = min(ans, n + 1)\n\n for p in range(1, int(sqrt(n)) + 1):\n q = s - p\n b = (n - q) // p\n if 2 <= b and f(b, n) == s:\n ans = min(ans, b)\n\n for b in range(2, int(sqrt(n)) + 1):\n if f(b, n) == s:\n ans = min(ans, b)\n print((-1 if ans == INF else ans))\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "29cce6a043e57af2f8084b7594ae7495531a30dede09cf51b56088a83bb9cffb", "slow_id": "p04014_c95ad2a8dc940041977600eb1078f63d16cb258708724f5b3b59e88e5ff612b9", "speedup": 6.429059192431422, "stratum": "4-8", "within_pair_jaccard": 0.29310344827586204, "workload": {"case_count": 100, "description": "Find the smallest integer base b>=2 in which positive integer n has digit sum s, or report -1 if no such base exists. Observed inputs: n=1..99999999999; s=1..99999999999.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 24, "median": 14.0, "min": 4}, "input_format": ["n\ns"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p02760_case_000", "p02760_case_001", "p02760_case_002", "p02760_case_003", "p02760_case_004", "p02760_case_005", "p02760_case_006", "p02760_case_007", "p02760_case_008", "p02760_case_009", "p02760_case_010", "p02760_case_011", "p02760_case_012", "p02760_case_013", "p02760_case_014", "p02760_case_015", "p02760_case_016", "p02760_case_017", "p02760_case_018", "p02760_case_019", "p02760_case_020", "p02760_case_021", "p02760_case_022", "p02760_case_023", "p02760_case_024", "p02760_case_025", "p02760_case_026", "p02760_case_027", "p02760_case_028", "p02760_case_029", "p02760_case_030", "p02760_case_031", "p02760_case_032", "p02760_case_033", "p02760_case_034", "p02760_case_035", "p02760_case_036", "p02760_case_037", "p02760_case_038", "p02760_case_039", "p02760_case_040", "p02760_case_041", "p02760_case_042", "p02760_case_043", "p02760_case_044", "p02760_case_045", "p02760_case_046", "p02760_case_047", "p02760_case_048", "p02760_case_049", "p02760_case_050", "p02760_case_051", "p02760_case_052", "p02760_case_053", "p02760_case_054", "p02760_case_055", "p02760_case_056", "p02760_case_057", "p02760_case_058", "p02760_case_059", "p02760_case_060", "p02760_case_061", "p02760_case_062", "p02760_case_063", "p02760_case_064", "p02760_case_065", "p02760_case_066", "p02760_case_067", "p02760_case_068", "p02760_case_069", "p02760_case_070", "p02760_case_071", "p02760_case_072", "p02760_case_073", "p02760_case_074", "p02760_case_075", "p02760_case_076", "p02760_case_077", "p02760_case_078", "p02760_case_079", "p02760_case_080", "p02760_case_081", "p02760_case_082", "p02760_case_083", "p02760_case_084", "p02760_case_085", "p02760_case_086", "p02760_case_087", "p02760_case_088", "p02760_case_089", "p02760_case_090", "p02760_case_091", "p02760_case_092", "p02760_case_093", "p02760_case_094", "p02760_case_095", "p02760_case_096", "p02760_case_097", "p02760_case_098", "p02760_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "(*a,) = list(map(int, open(0).read().split()))\nprint(\n (\n \"NYoe s\"[\n any(\n t <= set(a.index(b) for b in a[10:])\n for t in (\n {0, 1, 2},\n {0, 3, 6},\n {0, 4, 8},\n {1, 4, 7},\n {2, 4, 6},\n {2, 5, 8},\n {3, 4, 5},\n {6, 7, 8},\n )\n ) :: 2\n ]\n )\n)\n", "fast_code_sha256": "37c64c843161b92469540d6a1ec2a29d2c5b7047a3f26ff46e602802a6763f12", "fast_id": "p02760_37c64c843161b92469540d6a1ec2a29d2c5b7047a3f26ff46e602802a6763f12", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "(*a,) = list(map(int, open(0).read().split()))\nprint(\n (\n \"NYoe s\"[\n any(\n t <= set(a.index(b) for b in a[10:])\n for t in (\n {0, 1, 2},\n {0, 3, 6},\n {0, 4, 8},\n {1, 4, 7},\n {2, 4, 6},\n {2, 5, 8},\n {3, 4, 5},\n {6, 7, 8},\n )\n ) :: 2\n ]\n )\n)\n", "measured_fast_code_sha256": "37c64c843161b92469540d6a1ec2a29d2c5b7047a3f26ff46e602802a6763f12", "measured_slow_code": "A = [list(map(int, input().split())) for _ in range(3)]\nN = int(eval(input()))\nB = [[0 for _ in range(3)] for _ in range(3)]\nfor _ in range(N):\n b = int(eval(input()))\n for i in range(3):\n for j in range(3):\n if A[i][j] == b:\n B[i][j] = 1\nflag = 0\nfor i in range(3):\n if sum(B[i]) == 3:\n flag = 1\n break\nfor j in range(3):\n cnt = 0\n for i in range(3):\n cnt += B[i][j]\n if cnt == 3:\n flag = 1\n break\nif B[0][0] + B[1][1] + B[2][2] == 3:\n flag = 1\nif B[2][0] + B[1][1] + B[0][2] == 3:\n flag = 1\nif flag == 1:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "measured_slow_code_sha256": "f8328767ccbc8a5ed48661d40d8215cfd7d33d82a275546fffbe0b0e89dbaad6", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.0917205387864772, "pair_id": "python_v2_bd9cafe53171c1f1d84967a2", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02760", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02760_37c64c843161b92469540d6a1ec2a29d2c5b7047a3f26ff46e602802a6763f12.jsonl.gz", "inputs": "reproduction/python/inputs/p02760.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02760_f8328767ccbc8a5ed48661d40d8215cfd7d33d82a275546fffbe0b0e89dbaad6.jsonl.gz"}, "slow_code": "A = [list(map(int, input().split())) for _ in range(3)]\nN = int(eval(input()))\nB = [[0 for _ in range(3)] for _ in range(3)]\nfor _ in range(N):\n b = int(eval(input()))\n for i in range(3):\n for j in range(3):\n if A[i][j] == b:\n B[i][j] = 1\nflag = 0\nfor i in range(3):\n if sum(B[i]) == 3:\n flag = 1\n break\nfor j in range(3):\n cnt = 0\n for i in range(3):\n cnt += B[i][j]\n if cnt == 3:\n flag = 1\n break\nif B[0][0] + B[1][1] + B[2][2] == 3:\n flag = 1\nif B[2][0] + B[1][1] + B[0][2] == 3:\n flag = 1\nif flag == 1:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "slow_code_sha256": "f8328767ccbc8a5ed48661d40d8215cfd7d33d82a275546fffbe0b0e89dbaad6", "slow_id": "p02760_f8328767ccbc8a5ed48661d40d8215cfd7d33d82a275546fffbe0b0e89dbaad6", "speedup": 2.1460380619125163, "stratum": "2-4", "within_pair_jaccard": 0.2727272727272727, "workload": {"case_count": 100, "description": "A 3-by-3 bingo board contains distinct integers A_i,j. Mark numbers among N distinct called values b_i and determine whether any row, column or diagonal is fully marked. Observed inputs: N=1..10 (median 6); A_i_j=1..100; b_i=1..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 60, "median": 46.5, "min": 29}, "input_format": ["A_1,1 A_1,2 A_1,3\nA_2,1 A_2,2 A_2,3\nA_3,1 A_3,2 A_3,3\nN\nb_1\n...\nb_N"], "input_format_status": "source_input_section", "input_lines": {"max": 14, "median": 10.0, "min": 5}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 20, "median": 16.0, "min": 11}}} -{"case_ids": ["p02640_case_000", "p02640_case_001", "p02640_case_002", "p02640_case_003", "p02640_case_004", "p02640_case_005", "p02640_case_006", "p02640_case_007", "p02640_case_008", "p02640_case_009", "p02640_case_010", "p02640_case_011", "p02640_case_012", "p02640_case_013", "p02640_case_014", "p02640_case_015", "p02640_case_016", "p02640_case_017", "p02640_case_018", "p02640_case_019", "p02640_case_020", "p02640_case_021", "p02640_case_022", "p02640_case_023", "p02640_case_024", "p02640_case_025", "p02640_case_026", "p02640_case_027", "p02640_case_028", "p02640_case_029", "p02640_case_030", "p02640_case_031", "p02640_case_032", "p02640_case_033", "p02640_case_034", "p02640_case_035", "p02640_case_036", "p02640_case_037", "p02640_case_038", "p02640_case_039", "p02640_case_040", "p02640_case_041", "p02640_case_042", "p02640_case_043", "p02640_case_044", "p02640_case_045", "p02640_case_046", "p02640_case_047", "p02640_case_048", "p02640_case_049", "p02640_case_050", "p02640_case_051", "p02640_case_052", "p02640_case_053", "p02640_case_054", "p02640_case_055", "p02640_case_056", "p02640_case_057", "p02640_case_058", "p02640_case_059", "p02640_case_060", "p02640_case_061", "p02640_case_062", "p02640_case_063", "p02640_case_064", "p02640_case_065", "p02640_case_066", "p02640_case_067", "p02640_case_068", "p02640_case_069", "p02640_case_070", "p02640_case_071", "p02640_case_072", "p02640_case_073", "p02640_case_074", "p02640_case_075", "p02640_case_076", "p02640_case_077", "p02640_case_078", "p02640_case_079", "p02640_case_080", "p02640_case_081", "p02640_case_082", "p02640_case_083", "p02640_case_084", "p02640_case_085", "p02640_case_086", "p02640_case_087", "p02640_case_088", "p02640_case_089", "p02640_case_090", "p02640_case_091", "p02640_case_092", "p02640_case_093", "p02640_case_094", "p02640_case_095", "p02640_case_096", "p02640_case_097", "p02640_case_098", "p02640_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "X, Y = [int(x) for x in input().split()]\ncheck = True\nif X * 4 < Y:\n check = False\nelif Y < 2 * X:\n check = False\nelif Y % 2 == 1:\n check = False\nif check:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "fast_code_sha256": "6abad5229f15e4f3d5f8e86d034bc2c33161ea6f180e5ff3b8525ac9920eafca", "fast_id": "p02640_6abad5229f15e4f3d5f8e86d034bc2c33161ea6f180e5ff3b8525ac9920eafca", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "X, Y = [int(x) for x in input().split()]\ncheck = True\nif X * 4 < Y:\n check = False\nelif Y < 2 * X:\n check = False\nelif Y % 2 == 1:\n check = False\nif check:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "measured_fast_code_sha256": "6abad5229f15e4f3d5f8e86d034bc2c33161ea6f180e5ff3b8525ac9920eafca", "measured_slow_code": "x, y = list(map(int, input().split()))\nfor i in range(0, 101):\n for j in range(0, 101):\n if i + j == x and i * 2 + j * 4 == y:\n print(\"Yes\")\n exit()\nprint(\"No\")\n# print('Yes' if y%2 == 0 and x >= y//2 and y // 4 - (y%4) //2 <= x else 'No')\n", "measured_slow_code_sha256": "b81aa7896b39a5e204fdfa9ca3f63685a6d18d86724afc22b841cf9b49e7766b", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 6.626785012803133, "pair_id": "python_v2_ab4329de4ace4cbfbfda36e2", "per_case_slow_code_faster_fraction": 0.13, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02640", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02640_6abad5229f15e4f3d5f8e86d034bc2c33161ea6f180e5ff3b8525ac9920eafca.jsonl.gz", "inputs": "reproduction/python/inputs/p02640.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02640_b81aa7896b39a5e204fdfa9ca3f63685a6d18d86724afc22b841cf9b49e7766b.jsonl.gz"}, "slow_code": "x, y = list(map(int, input().split()))\nfor i in range(0, 101):\n for j in range(0, 101):\n if i + j == x and i * 2 + j * 4 == y:\n print(\"Yes\")\n exit()\nprint(\"No\")\n", "slow_code_sha256": "ac09bdaf0871ab87a33221ec8a163d2052febe18d868feae44e613cae3f3a95f", "slow_id": "p02640_b81aa7896b39a5e204fdfa9ca3f63685a6d18d86724afc22b841cf9b49e7766b", "speedup": 6.8420336275436435, "stratum": "4-8", "within_pair_jaccard": 0.4, "workload": {"case_count": 100, "description": "Determine whether X animals can have Y legs in total when each animal is either a two-legged crane or a four-legged turtle. Observed inputs: X=1..100 (median 18); Y=1..100 (median 41).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 8, "median": 6.0, "min": 4}, "input_format": ["X Y"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p02699_case_000", "p02699_case_001", "p02699_case_002", "p02699_case_003", "p02699_case_004", "p02699_case_005", "p02699_case_006", "p02699_case_007", "p02699_case_008", "p02699_case_009", "p02699_case_010", "p02699_case_011", "p02699_case_012", "p02699_case_013", "p02699_case_014", "p02699_case_015", "p02699_case_016", "p02699_case_017", "p02699_case_018", "p02699_case_019", "p02699_case_020", "p02699_case_021", "p02699_case_022", "p02699_case_023", "p02699_case_024", "p02699_case_025", "p02699_case_026", "p02699_case_027", "p02699_case_028", "p02699_case_029", "p02699_case_030", "p02699_case_031", "p02699_case_032", "p02699_case_033", "p02699_case_034", "p02699_case_035", "p02699_case_036", "p02699_case_037", "p02699_case_038", "p02699_case_039", "p02699_case_040", "p02699_case_041", "p02699_case_042", "p02699_case_043", "p02699_case_044", "p02699_case_045", "p02699_case_046", "p02699_case_047", "p02699_case_048", "p02699_case_049", "p02699_case_050", "p02699_case_051", "p02699_case_052", "p02699_case_053", "p02699_case_054", "p02699_case_055", "p02699_case_056", "p02699_case_057", "p02699_case_058", "p02699_case_059", "p02699_case_060", "p02699_case_061", "p02699_case_062", "p02699_case_063", "p02699_case_064", "p02699_case_065", "p02699_case_066", "p02699_case_067", "p02699_case_068", "p02699_case_069", "p02699_case_070", "p02699_case_071", "p02699_case_072", "p02699_case_073", "p02699_case_074", "p02699_case_075", "p02699_case_076", "p02699_case_077", "p02699_case_078", "p02699_case_079", "p02699_case_080", "p02699_case_081", "p02699_case_082", "p02699_case_083", "p02699_case_084", "p02699_case_085", "p02699_case_086", "p02699_case_087", "p02699_case_088", "p02699_case_089", "p02699_case_090", "p02699_case_091", "p02699_case_092", "p02699_case_093", "p02699_case_094", "p02699_case_095", "p02699_case_096", "p02699_case_097", "p02699_case_098", "p02699_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "S, W = (int(x) for x in input().split())\nif S <= W:\n print(\"unsafe\")\nelse:\n print(\"safe\")\n", "fast_code_sha256": "b087b8913a33d3e5167054bede3b4411d0f780409ead0d3437652fa9b645ccbe", "fast_id": "p02699_b087b8913a33d3e5167054bede3b4411d0f780409ead0d3437652fa9b645ccbe", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "S, W = (int(x) for x in input().split())\nif S <= W:\n print(\"unsafe\")\nelse:\n print(\"safe\")\n", "measured_fast_code_sha256": "b087b8913a33d3e5167054bede3b4411d0f780409ead0d3437652fa9b645ccbe", "measured_slow_code": "#!/usr/bin/env python3\nimport sys\nimport math\nfrom bisect import bisect_right as br\nfrom bisect import bisect_left as bl\n\nsys.setrecursionlimit(2147483647)\nfrom heapq import heappush, heappop, heappushpop\nfrom collections import defaultdict\nfrom itertools import accumulate\nfrom collections import Counter\nfrom collections import deque\nfrom operator import itemgetter\nfrom itertools import permutations\n\nmod = 10**9 + 7\ninf = float(\"inf\")\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\ns, w = LI()\nif s <= w:\n print(\"unsafe\")\nelse:\n print(\"safe\")\n", "measured_slow_code_sha256": "f2cc4bf0fe7fb5f3b139743ef8c168fecc1b7ec24219170b0370aa9ddc4eb707", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.1094016807158544, "pair_id": "python_v2_d640db7400a9f360e2d12f5d", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02699", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02699_b087b8913a33d3e5167054bede3b4411d0f780409ead0d3437652fa9b645ccbe.jsonl.gz", "inputs": "reproduction/python/inputs/p02699.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02699_f2cc4bf0fe7fb5f3b139743ef8c168fecc1b7ec24219170b0370aa9ddc4eb707.jsonl.gz"}, "slow_code": "import sys\nimport math\nfrom bisect import bisect_right as br\nfrom bisect import bisect_left as bl\n\nsys.setrecursionlimit(2147483647)\nfrom heapq import heappush, heappop, heappushpop\nfrom collections import defaultdict\nfrom itertools import accumulate\nfrom collections import Counter\nfrom collections import deque\nfrom operator import itemgetter\nfrom itertools import permutations\n\nmod = 10**9 + 7\ninf = float(\"inf\")\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\ns, w = LI()\nif s <= w:\n print(\"unsafe\")\nelse:\n print(\"safe\")\n", "slow_code_sha256": "bf5eea10074c63eaba5bcd155494237aaf0b2185b148b7614e311e92f7bef084", "slow_id": "p02699_f2cc4bf0fe7fb5f3b139743ef8c168fecc1b7ec24219170b0370aa9ddc4eb707", "speedup": 3.1078640433747498, "stratum": "2-4", "within_pair_jaccard": 0.12962962962962962, "workload": {"case_count": 100, "description": "Given S sheep and W wolves, report unsafe if wolves are at least as numerous as sheep, and safe otherwise. Observed inputs: S=1..100 (median 38); W=1..100 (median 49.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 8, "median": 6.0, "min": 4}, "input_format": ["S W"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p02935_case_000", "p02935_case_001", "p02935_case_002", "p02935_case_003", "p02935_case_004", "p02935_case_005", "p02935_case_006", "p02935_case_007", "p02935_case_008", "p02935_case_009", "p02935_case_010", "p02935_case_011", "p02935_case_012", "p02935_case_013", "p02935_case_014", "p02935_case_015", "p02935_case_016", "p02935_case_017", "p02935_case_018", "p02935_case_019", "p02935_case_020", "p02935_case_021", "p02935_case_022", "p02935_case_023", "p02935_case_024", "p02935_case_025", "p02935_case_026", "p02935_case_027", "p02935_case_028", "p02935_case_029", "p02935_case_030", "p02935_case_031", "p02935_case_032", "p02935_case_033", "p02935_case_034", "p02935_case_035", "p02935_case_036", "p02935_case_037", "p02935_case_038", "p02935_case_039", "p02935_case_040", "p02935_case_041", "p02935_case_042", "p02935_case_043", "p02935_case_044", "p02935_case_045", "p02935_case_046", "p02935_case_047", "p02935_case_048", "p02935_case_049", "p02935_case_050", "p02935_case_051", "p02935_case_052", "p02935_case_053", "p02935_case_054", "p02935_case_055", "p02935_case_056", "p02935_case_057", "p02935_case_058", "p02935_case_059", "p02935_case_060", "p02935_case_061", "p02935_case_062", "p02935_case_063", "p02935_case_064", "p02935_case_065", "p02935_case_066", "p02935_case_067", "p02935_case_068", "p02935_case_069", "p02935_case_070", "p02935_case_071", "p02935_case_072", "p02935_case_073", "p02935_case_074", "p02935_case_075", "p02935_case_076", "p02935_case_077", "p02935_case_078", "p02935_case_079", "p02935_case_080", "p02935_case_081", "p02935_case_082", "p02935_case_083", "p02935_case_084", "p02935_case_085", "p02935_case_086", "p02935_case_087", "p02935_case_088", "p02935_case_089", "p02935_case_090", "p02935_case_091", "p02935_case_092", "p02935_case_093", "p02935_case_094", "p02935_case_095", "p02935_case_096", "p02935_case_097", "p02935_case_098", "p02935_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N = int(eval(input()))\nv = list(map(int, input().split()))\nfor i in range(N - 1):\n v.sort()\n v[1] = (v[0] + v[1]) / 2\n v = v[1:]\nprint((v[0]))\n", "fast_code_sha256": "e1cbdec8705f7fa5a2f6a70afe1c88b85c528d48dd68d0a39949a7c0199ae182", "fast_id": "p02935_e1cbdec8705f7fa5a2f6a70afe1c88b85c528d48dd68d0a39949a7c0199ae182", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N = int(eval(input()))\nv = list(map(int, input().split()))\nfor i in range(N - 1):\n v.sort()\n v[1] = (v[0] + v[1]) / 2\n v = v[1:]\nprint((v[0]))\n", "measured_fast_code_sha256": "e1cbdec8705f7fa5a2f6a70afe1c88b85c528d48dd68d0a39949a7c0199ae182", "measured_slow_code": "import numpy as np\n\nn = int(eval(input()))\nlista = list(map(int, input().split()))\nlista.sort()\nfor i in range(n - 1):\n lista.append((lista[0] + lista[1]) / 2)\n lista.pop(0)\n lista.pop(0)\n lista.sort()\nprint((lista[0]))\n", "measured_slow_code_sha256": "4fce74aca7d1608f14c76b9fb92532f43bd52c914832f66cdc3ddf21b1636b9b", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 784.1606349291134, "pair_id": "python_v2_cc577438d6689521414d2b7d", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02935", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02935_e1cbdec8705f7fa5a2f6a70afe1c88b85c528d48dd68d0a39949a7c0199ae182.jsonl.gz", "inputs": "reproduction/python/inputs/p02935.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02935_4fce74aca7d1608f14c76b9fb92532f43bd52c914832f66cdc3ddf21b1636b9b.jsonl.gz"}, "slow_code": "import numpy as np\n\nn = int(eval(input()))\nlista = list(map(int, input().split()))\nlista.sort()\nfor i in range(n - 1):\n lista.append((lista[0] + lista[1]) / 2)\n lista.pop(0)\n lista.pop(0)\n lista.sort()\nprint((lista[0]))\n", "slow_code_sha256": "4fce74aca7d1608f14c76b9fb92532f43bd52c914832f66cdc3ddf21b1636b9b", "slow_id": "p02935_4fce74aca7d1608f14c76b9fb92532f43bd52c914832f66cdc3ddf21b1636b9b", "speedup": 740.402827878656, "stratum": "8+", "within_pair_jaccard": 0.6, "workload": {"case_count": 100, "description": "Repeatedly replace two ingredient values x and y by their arithmetic mean (x+y)/2. Starting with N input values v_i, maximize the final value after N-1 replacements. Observed inputs: N=2..50 (median 25); v_i=1..1000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 253, "median": 102.5, "min": 6}, "input_format": ["N\nv_1 ... v_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 51, "median": 26.0, "min": 3}}} -{"case_ids": ["p00150_case_000", "p00150_case_001", "p00150_case_002", "p00150_case_003", "p00150_case_004", "p00150_case_005", "p00150_case_006", "p00150_case_007", "p00150_case_008", "p00150_case_009", "p00150_case_010", "p00150_case_011", "p00150_case_012", "p00150_case_013", "p00150_case_014", "p00150_case_015", "p00150_case_016", "p00150_case_017", "p00150_case_018", "p00150_case_019", "p00150_case_020", "p00150_case_021", "p00150_case_022", "p00150_case_023", "p00150_case_024", "p00150_case_025", "p00150_case_026", "p00150_case_027", "p00150_case_028", "p00150_case_029", "p00150_case_030", "p00150_case_031", "p00150_case_032", "p00150_case_033", "p00150_case_034", "p00150_case_035", "p00150_case_036", "p00150_case_037", "p00150_case_038", "p00150_case_039", "p00150_case_040", "p00150_case_041", "p00150_case_042", "p00150_case_043", "p00150_case_044", "p00150_case_045", "p00150_case_046", "p00150_case_047", "p00150_case_048", "p00150_case_049", "p00150_case_050", "p00150_case_051", "p00150_case_052", "p00150_case_053", "p00150_case_054", "p00150_case_055", "p00150_case_056", "p00150_case_057", "p00150_case_058", "p00150_case_059", "p00150_case_060", "p00150_case_061", "p00150_case_062", "p00150_case_063", "p00150_case_064", "p00150_case_065", "p00150_case_066", "p00150_case_067", "p00150_case_068", "p00150_case_069", "p00150_case_070", "p00150_case_071", "p00150_case_072", "p00150_case_073", "p00150_case_074", "p00150_case_075", "p00150_case_076", "p00150_case_077", "p00150_case_078", "p00150_case_079", "p00150_case_080", "p00150_case_081", "p00150_case_082", "p00150_case_083", "p00150_case_084", "p00150_case_085", "p00150_case_086", "p00150_case_087", "p00150_case_088", "p00150_case_089", "p00150_case_090", "p00150_case_091", "p00150_case_092", "p00150_case_093", "p00150_case_094", "p00150_case_095", "p00150_case_096", "p00150_case_097", "p00150_case_098", "p00150_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import bisect as bs\n\n\ndef prime(m):\n N = list(range(1, m + 1, 2))\n N[0] = 2\n for i in range(1, int(m**0.5) + 1):\n x = N[i]\n if x:\n N[i + x :: x] = [0] * len(N[i + x :: x])\n return [_f for _f in N if _f]\n\n\nP = prime(10000)\nx = [P[i] for i in range(1, len(P)) if P[i] - P[i - 1] == 2]\nwhile 1:\n n = eval(input())\n if n == 0:\n break\n a = x[bs.bisect_right(x, n) - 1]\n print(a - 2, a)\n", "fast_code_sha256": "9ca73476f1131853179fecf70c42d279491ae767fa15807203ecca379aa873a7", "fast_id": "p00150_9ca73476f1131853179fecf70c42d279491ae767fa15807203ecca379aa873a7", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import bisect as bs\n\n\ndef prime(m):\n N = list(range(1, m + 1, 2))\n N[0] = 2\n for i in range(1, int(m**0.5) + 1):\n x = N[i]\n if x:\n N[i + x :: x] = [0] * len(N[i + x :: x])\n return [_f for _f in N if _f]\n\n\nP = prime(10000)\nx = [P[i] for i in range(1, len(P)) if P[i] - P[i - 1] == 2]\nwhile 1:\n n = eval(input())\n if n == 0:\n break\n a = x[bs.bisect_right(x, n) - 1]\n print(a - 2, a)\n", "measured_fast_code_sha256": "9ca73476f1131853179fecf70c42d279491ae767fa15807203ecca379aa873a7", "measured_slow_code": "r = 10001\nsqrt = int(r**0.5)\np = [1] * r\ntwin = [0] * r\np[0] = 0\np[1::2] = [0 for x in range(1, r, 2)]\nfor i in range(2, r, 2):\n if p[i]:\n p[2 * i + 1 :: i + 1] = [0 for x in range(2 * i + 1, r, i + 1)]\n if p[i - 2]:\n twin[i : i + 300] = [i + 1 for x in range(i, i + 300)]\nwhile True:\n n = int(input())\n if n == 0:\n break\n print(twin[n - 1] - 2, twin[n - 1])\n", "measured_slow_code_sha256": "f5aca30380ab4d5ce02a8e140ae5b56c975263595f2ba6e4f69ffa3d2034a703", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 12.734800010037937, "pair_id": "python_v2_6144db532c5241ff76a77c1e", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p00150", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p00150_9ca73476f1131853179fecf70c42d279491ae767fa15807203ecca379aa873a7.jsonl.gz", "inputs": "reproduction/python/inputs/p00150.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p00150_f5aca30380ab4d5ce02a8e140ae5b56c975263595f2ba6e4f69ffa3d2034a703.jsonl.gz"}, "slow_code": "r = 10001\nsqrt = int(r**0.5)\np = [1] * r\ntwin = [0] * r\np[0] = 0\np[1::2] = [0 for x in range(1, r, 2)]\nfor i in range(2, r, 2):\n if p[i]:\n p[2 * i + 1 :: i + 1] = [0 for x in range(2 * i + 1, r, i + 1)]\n if p[i - 2]:\n twin[i : i + 300] = [i + 1 for x in range(i, i + 300)]\nwhile True:\n n = int(input())\n if n == 0:\n break\n print(twin[n - 1] - 2, twin[n - 1])\n", "slow_code_sha256": "f5aca30380ab4d5ce02a8e140ae5b56c975263595f2ba6e4f69ffa3d2034a703", "slow_id": "p00150_f5aca30380ab4d5ce02a8e140ae5b56c975263595f2ba6e4f69ffa3d2034a703", "speedup": 11.626248178082323, "stratum": "8+", "within_pair_jaccard": 0.4, "workload": {"case_count": 100, "description": "For each upper bound n, find primes p and q=p+2 with q<=n and q as large as possible. Each line supplies one n; a final zero terminates input. Observed inputs: datasets=1..100 (median 5); n=5..10000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 497, "median": 27.0, "min": 4}, "input_format": ["n_1\n...\nn_D\n0"], "input_format_status": "source_input_section", "input_lines": {"max": 101, "median": 6.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 101, "median": 6.0, "min": 2}}} -{"case_ids": ["p02881_case_000", "p02881_case_001", "p02881_case_002", "p02881_case_003", "p02881_case_004", "p02881_case_005", "p02881_case_006", "p02881_case_007", "p02881_case_008", "p02881_case_009", "p02881_case_010", "p02881_case_011", "p02881_case_012", "p02881_case_013", "p02881_case_014", "p02881_case_015", "p02881_case_016", "p02881_case_017", "p02881_case_018", "p02881_case_019", "p02881_case_020", "p02881_case_021", "p02881_case_022", "p02881_case_023", "p02881_case_024", "p02881_case_025", "p02881_case_026", "p02881_case_027", "p02881_case_028", "p02881_case_029", "p02881_case_030", "p02881_case_031", "p02881_case_032", "p02881_case_033", "p02881_case_034", "p02881_case_035", "p02881_case_036", "p02881_case_037", "p02881_case_038", "p02881_case_039", "p02881_case_040", "p02881_case_041", "p02881_case_042", "p02881_case_043", "p02881_case_044", "p02881_case_045", "p02881_case_046", "p02881_case_047", "p02881_case_048", "p02881_case_049", "p02881_case_050", "p02881_case_051", "p02881_case_052", "p02881_case_053", "p02881_case_054", "p02881_case_055", "p02881_case_056", "p02881_case_057", "p02881_case_058", "p02881_case_059", "p02881_case_060", "p02881_case_061", "p02881_case_062", "p02881_case_063", "p02881_case_064", "p02881_case_065", "p02881_case_066", "p02881_case_067", "p02881_case_068", "p02881_case_069", "p02881_case_070", "p02881_case_071", "p02881_case_072", "p02881_case_073", "p02881_case_074", "p02881_case_075", "p02881_case_076", "p02881_case_077", "p02881_case_078", "p02881_case_079", "p02881_case_080", "p02881_case_081", "p02881_case_082", "p02881_case_083", "p02881_case_084", "p02881_case_085", "p02881_case_086", "p02881_case_087", "p02881_case_088", "p02881_case_089", "p02881_case_090", "p02881_case_091", "p02881_case_092", "p02881_case_093", "p02881_case_094", "p02881_case_095", "p02881_case_096", "p02881_case_097", "p02881_case_098", "p02881_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N = int(eval(input()))\nx = int(N**0.5)\nfor i in range(x, 0, -1):\n if N % i == 0:\n y = N // i\n break\nans = N // y + y - 2\nprint(ans)\n", "fast_code_sha256": "385f918e70558d30ce24cedf0de5f4a96a7aad60475bd5eec62a4ce0ebe4edee", "fast_id": "p02881_385f918e70558d30ce24cedf0de5f4a96a7aad60475bd5eec62a4ce0ebe4edee", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N = int(eval(input()))\nx = int(N**0.5)\nfor i in range(x, 0, -1):\n if N % i == 0:\n y = N // i\n break\nans = N // y + y - 2\nprint(ans)\n", "measured_fast_code_sha256": "385f918e70558d30ce24cedf0de5f4a96a7aad60475bd5eec62a4ce0ebe4edee", "measured_slow_code": "n = int(eval(input()))\nmini = float(\"inf\")\nfor i in range(1, int(n**0.5) + 1):\n if n % i == 0:\n mini = min(i + (n / i) - 2, mini)\nprint((int(mini)))\n", "measured_slow_code_sha256": "cf998e72c1135a595d6c563a4a1ff5a2952087ae7ea9606342b715a39fa95719", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.6695882980230214, "pair_id": "python_v2_78b889ef8263d04a84296e5e", "per_case_slow_code_faster_fraction": 0.2, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02881", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02881_385f918e70558d30ce24cedf0de5f4a96a7aad60475bd5eec62a4ce0ebe4edee.jsonl.gz", "inputs": "reproduction/python/inputs/p02881.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02881_cf998e72c1135a595d6c563a4a1ff5a2952087ae7ea9606342b715a39fa95719.jsonl.gz"}, "slow_code": "n = int(eval(input()))\nmini = float(\"inf\")\nfor i in range(1, int(n**0.5) + 1):\n if n % i == 0:\n mini = min(i + (n / i) - 2, mini)\nprint((int(mini)))\n", "slow_code_sha256": "cf998e72c1135a595d6c563a4a1ff5a2952087ae7ea9606342b715a39fa95719", "slow_id": "p02881_cf998e72c1135a595d6c563a4a1ff5a2952087ae7ea9606342b715a39fa95719", "speedup": 7.835467818237936, "stratum": "4-8", "within_pair_jaccard": 0.5217391304347826, "workload": {"case_count": 100, "description": "On an infinite grid with value i*j at cell (i,j), start at (1,1). Each move increases exactly one coordinate by 1. Minimize moves to reach any cell of value N. Observed inputs: N=2..1000000000000 (median 260337887119.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 14, "median": 13.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p03173_case_000", "p03173_case_001", "p03173_case_002", "p03173_case_003", "p03173_case_004", "p03173_case_005", "p03173_case_006", "p03173_case_007", "p03173_case_008", "p03173_case_009", "p03173_case_010", "p03173_case_011", "p03173_case_012", "p03173_case_013", "p03173_case_014", "p03173_case_015", "p03173_case_016", "p03173_case_017", "p03173_case_018", "p03173_case_019", "p03173_case_020", "p03173_case_021", "p03173_case_022", "p03173_case_023", "p03173_case_024", "p03173_case_025", "p03173_case_026", "p03173_case_027", "p03173_case_028", "p03173_case_029", "p03173_case_030", "p03173_case_031", "p03173_case_032", "p03173_case_033", "p03173_case_034", "p03173_case_035", "p03173_case_036", "p03173_case_037", "p03173_case_038", "p03173_case_039", "p03173_case_040", "p03173_case_041", "p03173_case_042", "p03173_case_043", "p03173_case_044", "p03173_case_045", "p03173_case_046", "p03173_case_047", "p03173_case_048", "p03173_case_049", "p03173_case_050", "p03173_case_051", "p03173_case_052", "p03173_case_053", "p03173_case_054", "p03173_case_055", "p03173_case_056", "p03173_case_057", "p03173_case_058", "p03173_case_059", "p03173_case_060", "p03173_case_061", "p03173_case_062", "p03173_case_063", "p03173_case_064", "p03173_case_065", "p03173_case_066", "p03173_case_067", "p03173_case_068", "p03173_case_069", "p03173_case_070", "p03173_case_071", "p03173_case_072", "p03173_case_073", "p03173_case_074", "p03173_case_075", "p03173_case_076", "p03173_case_077", "p03173_case_078", "p03173_case_079", "p03173_case_080", "p03173_case_081", "p03173_case_082", "p03173_case_083", "p03173_case_084", "p03173_case_085", "p03173_case_086", "p03173_case_087", "p03173_case_088", "p03173_case_089", "p03173_case_090", "p03173_case_091", "p03173_case_092", "p03173_case_093", "p03173_case_094", "p03173_case_095", "p03173_case_096", "p03173_case_097", "p03173_case_098", "p03173_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def resolve():\n N = int(eval(input()))\n a = list(map(int, input().split()))\n DP = [[2**63 - 1 for _ in range(N + 1)] for _ in range(N)]\n SUM = [[0 for _ in range(N + 1)] for _ in range(N + 1)]\n RANGE = [[0 for _ in range(N + 1)] for _ in range(N + 1)]\n SUM[0][0] = 0\n for i in range(N):\n for j in range(i, N):\n SUM[i][j + 1] = SUM[i][j] + a[j]\n if i < j:\n SUM[i + 1][j] = SUM[i][j] - a[i]\n for i in range(N):\n j = i + 1\n DP[i][j] = 0\n RANGE[i][j] = i\n for w in range(2, N + 1):\n for i in range(N + 1 - w):\n j = i + w\n for k in range(RANGE[i][j - 1], RANGE[i + 1][j] + 1):\n s = DP[i][k] + DP[k][j] + SUM[i][j]\n if DP[i][j] > s:\n DP[i][j] = s\n RANGE[i][j] = k\n print((DP[0][N]))\n\n\nresolve()\n", "fast_code_sha256": "48ff09bc20e8f8798770efd549a5ac6494d01b7553d3e063e63a4ebd4e5dd723", "fast_id": "p03173_48ff09bc20e8f8798770efd549a5ac6494d01b7553d3e063e63a4ebd4e5dd723", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def resolve():\n N = int(eval(input()))\n a = list(map(int, input().split()))\n DP = [[2**63 - 1 for _ in range(N + 1)] for _ in range(N)]\n SUM = [[0 for _ in range(N + 1)] for _ in range(N + 1)]\n RANGE = [[0 for _ in range(N + 1)] for _ in range(N + 1)]\n SUM[0][0] = 0\n for i in range(N):\n for j in range(i, N):\n SUM[i][j + 1] = SUM[i][j] + a[j]\n if i < j:\n SUM[i + 1][j] = SUM[i][j] - a[i]\n for i in range(N):\n j = i + 1\n DP[i][j] = 0\n RANGE[i][j] = i\n for w in range(2, N + 1):\n for i in range(N + 1 - w):\n j = i + w\n for k in range(RANGE[i][j - 1], RANGE[i + 1][j] + 1):\n s = DP[i][k] + DP[k][j] + SUM[i][j]\n if DP[i][j] > s:\n DP[i][j] = s\n RANGE[i][j] = k\n print((DP[0][N]))\n\n\nresolve()\n", "measured_fast_code_sha256": "48ff09bc20e8f8798770efd549a5ac6494d01b7553d3e063e63a4ebd4e5dd723", "measured_slow_code": "from numpy import *\n\nn, a = open(0)\nn = int(n)\na = cumsum(int64([0] + a.split()))\ndp = zeros((n, n + 1), \"i8\")\nfor k in range(1, n):\n l = arange(n - k)\n r = arange(k + 1, n + 1)\n m = array([arange(i + 1, i + k + 1) for i in range(n - k)]).T\n dp[l, r] = amin(dp[l, m] + dp[m, r], 0) + a[r] - a[l]\nprint((dp[0, n]))\n", "measured_slow_code_sha256": "fbe595c9f8788ab95d696918f37c505aa1adf829bda8c45d5d3567150670ffcd", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 7.317783925802326, "pair_id": "python_v2_9bd10fdc00071bac6d7b0000", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03173", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03173_48ff09bc20e8f8798770efd549a5ac6494d01b7553d3e063e63a4ebd4e5dd723.jsonl.gz", "inputs": "reproduction/python/inputs/p03173.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03173_fbe595c9f8788ab95d696918f37c505aa1adf829bda8c45d5d3567150670ffcd.jsonl.gz"}, "slow_code": "from numpy import *\n\nn, a = open(0)\nn = int(n)\na = cumsum(int64([0] + a.split()))\ndp = zeros((n, n + 1), \"i8\")\nfor k in range(1, n):\n l = arange(n - k)\n r = arange(k + 1, n + 1)\n m = array([arange(i + 1, i + k + 1) for i in range(n - k)]).T\n dp[l, r] = amin(dp[l, m] + dp[m, r], 0) + a[r] - a[l]\nprint((dp[0, n]))\n", "slow_code_sha256": "fbe595c9f8788ab95d696918f37c505aa1adf829bda8c45d5d3567150670ffcd", "slow_id": "p03173_fbe595c9f8788ab95d696918f37c505aa1adf829bda8c45d5d3567150670ffcd", "speedup": 18.181161174231164, "stratum": "8+", "within_pair_jaccard": 0.24444444444444444, "workload": {"case_count": 100, "description": "Repeatedly merge two adjacent slimes of sizes x and y into one of size x+y, paying x+y. Preserve the relative order of remaining slimes and minimize total cost to merge all N. Observed inputs: N=2..400 (median 100); a_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 4404, "median": 404.0, "min": 6}, "input_format": ["N\na_1 ... a_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 401, "median": 101.0, "min": 3}}} -{"case_ids": ["p02817_case_000", "p02817_case_001", "p02817_case_002", "p02817_case_003", "p02817_case_004", "p02817_case_005", "p02817_case_006", "p02817_case_007", "p02817_case_008", "p02817_case_009", "p02817_case_010", "p02817_case_011", "p02817_case_012", "p02817_case_013", "p02817_case_014", "p02817_case_015", "p02817_case_016", "p02817_case_017", "p02817_case_018", "p02817_case_019", "p02817_case_020", "p02817_case_021", "p02817_case_022", "p02817_case_023", "p02817_case_024", "p02817_case_025", "p02817_case_026", "p02817_case_027", "p02817_case_028", "p02817_case_029", "p02817_case_030", "p02817_case_031", "p02817_case_032", "p02817_case_033", "p02817_case_034", "p02817_case_035", "p02817_case_036", "p02817_case_037", "p02817_case_038", "p02817_case_039", "p02817_case_040", "p02817_case_041", "p02817_case_042", "p02817_case_043", "p02817_case_044", "p02817_case_045", "p02817_case_046", "p02817_case_047", "p02817_case_048", "p02817_case_049", "p02817_case_050", "p02817_case_051", "p02817_case_052", "p02817_case_053", "p02817_case_054", "p02817_case_055", "p02817_case_056", "p02817_case_057", "p02817_case_058", "p02817_case_059", "p02817_case_060", "p02817_case_061", "p02817_case_062", "p02817_case_063", "p02817_case_064", "p02817_case_065", "p02817_case_066", "p02817_case_067", "p02817_case_068", "p02817_case_069", "p02817_case_070", "p02817_case_071", "p02817_case_072", "p02817_case_073", "p02817_case_074", "p02817_case_075", "p02817_case_076", "p02817_case_077", "p02817_case_078", "p02817_case_079", "p02817_case_080", "p02817_case_081", "p02817_case_082", "p02817_case_083", "p02817_case_084", "p02817_case_085", "p02817_case_086", "p02817_case_087", "p02817_case_088", "p02817_case_089", "p02817_case_090", "p02817_case_091", "p02817_case_092", "p02817_case_093", "p02817_case_094", "p02817_case_095", "p02817_case_096", "p02817_case_097", "p02817_case_098", "p02817_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "b, c = list(map(str, input().split()))\nprint((c + b))\n", "fast_code_sha256": "b30dcfd2482065177b68635c7c880366f3eda18bfa6caea5554a460bc3933569", "fast_id": "p02817_b30dcfd2482065177b68635c7c880366f3eda18bfa6caea5554a460bc3933569", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "b, c = list(map(str, input().split()))\nprint((c + b))\n", "measured_fast_code_sha256": "b30dcfd2482065177b68635c7c880366f3eda18bfa6caea5554a460bc3933569", "measured_slow_code": "import sys\n\nS, T = input().split()\nif not (S.islower() and T.islower()):\n sys.exit()\nif not (1 <= len(S) <= 100 and 1 <= len(S) <= 100):\n sys.exit()\nprint(T, end=\"\")\nprint(S)\n", "measured_slow_code_sha256": "d366b3197c2b1cc652bdfaecd153a16660977c2f3b6e7187f2d74bc9cc3d8847", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.110332877327636, "pair_id": "python_v2_389a1ef15a925f00fb009011", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02817", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02817_b30dcfd2482065177b68635c7c880366f3eda18bfa6caea5554a460bc3933569.jsonl.gz", "inputs": "reproduction/python/inputs/p02817.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02817_d366b3197c2b1cc652bdfaecd153a16660977c2f3b6e7187f2d74bc9cc3d8847.jsonl.gz"}, "slow_code": "import sys\n\nS, T = input().split()\nif not (S.islower() and T.islower()):\n sys.exit()\nif not (1 <= len(S) <= 100 and 1 <= len(S) <= 100):\n sys.exit()\nprint(T, end=\"\")\nprint(S)\n", "slow_code_sha256": "d366b3197c2b1cc652bdfaecd153a16660977c2f3b6e7187f2d74bc9cc3d8847", "slow_id": "p02817_d366b3197c2b1cc652bdfaecd153a16660977c2f3b6e7187f2d74bc9cc3d8847", "speedup": 2.109397864688199, "stratum": "2-4", "within_pair_jaccard": 0.14285714285714285, "workload": {"case_count": 100, "description": "Given lowercase strings S and T, output their concatenation in the order T then S, with no separating space. Observed inputs: S_length=1..100 (median 50); T_length=1..100 (median 50).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 202, "median": 102.0, "min": 4}, "input_format": ["S T"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p00775_case_000", "p00775_case_001", "p00775_case_002", "p00775_case_003", "p00775_case_004", "p00775_case_005", "p00775_case_006", "p00775_case_007", "p00775_case_008", "p00775_case_009", "p00775_case_010", "p00775_case_011", "p00775_case_012", "p00775_case_013", "p00775_case_014", "p00775_case_015", "p00775_case_016", "p00775_case_017", "p00775_case_018", "p00775_case_019", "p00775_case_020", "p00775_case_021", "p00775_case_022", "p00775_case_023", "p00775_case_024", "p00775_case_025", "p00775_case_026", "p00775_case_027", "p00775_case_028", "p00775_case_029", "p00775_case_030", "p00775_case_031", "p00775_case_032", "p00775_case_033", "p00775_case_034", "p00775_case_035", "p00775_case_036", "p00775_case_037", "p00775_case_038", "p00775_case_039", "p00775_case_040", "p00775_case_041", "p00775_case_042", "p00775_case_043", "p00775_case_044", "p00775_case_045", "p00775_case_046", "p00775_case_047", "p00775_case_048", "p00775_case_049", "p00775_case_050", "p00775_case_051", "p00775_case_052", "p00775_case_053", "p00775_case_054", "p00775_case_055", "p00775_case_056", "p00775_case_057", "p00775_case_058", "p00775_case_059", "p00775_case_060", "p00775_case_061", "p00775_case_062", "p00775_case_063", "p00775_case_064", "p00775_case_065", "p00775_case_066", "p00775_case_067", "p00775_case_068", "p00775_case_069", "p00775_case_070", "p00775_case_071", "p00775_case_072", "p00775_case_073", "p00775_case_074", "p00775_case_075", "p00775_case_076", "p00775_case_077", "p00775_case_078", "p00775_case_079", "p00775_case_080", "p00775_case_081", "p00775_case_082", "p00775_case_083", "p00775_case_084", "p00775_case_085", "p00775_case_086", "p00775_case_087", "p00775_case_088", "p00775_case_089", "p00775_case_090", "p00775_case_091", "p00775_case_092", "p00775_case_093", "p00775_case_094", "p00775_case_095", "p00775_case_096", "p00775_case_097", "p00775_case_098", "p00775_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "while True:\n R, N = list(map(int, input().split()))\n if not (R | N):\n break\n geta = 20\n buildings = [0] * (geta * 2)\n for _ in range(N):\n xl, xr, h = list(map(int, input().split()))\n for i in range(xl + geta, xr + geta):\n buildings[i] = max(buildings[i], h)\n print(\n (\n min(\n buildings[i] - pow(R**2 - (i - geta + (i < geta)) ** 2, 0.5) + R\n for i in range(-R + geta, R + geta)\n )\n )\n )\n", "fast_code_sha256": "5b650f0d9d560aa2ddc06d1551889bb58d9768a548461d3a84fc82e94f0e3d66", "fast_id": "p00775_5b650f0d9d560aa2ddc06d1551889bb58d9768a548461d3a84fc82e94f0e3d66", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "while True:\n R, N = list(map(int, input().split()))\n if not (R | N):\n break\n geta = 20\n buildings = [0] * (geta * 2)\n for _ in range(N):\n xl, xr, h = list(map(int, input().split()))\n for i in range(xl + geta, xr + geta):\n buildings[i] = max(buildings[i], h)\n print(\n (\n min(\n buildings[i] - pow(R**2 - (i - geta + (i < geta)) ** 2, 0.5) + R\n for i in range(-R + geta, R + geta)\n )\n )\n )\n", "measured_fast_code_sha256": "5b650f0d9d560aa2ddc06d1551889bb58d9768a548461d3a84fc82e94f0e3d66", "measured_slow_code": "while True:\n R, N = list(map(int, input().split()))\n if not (R | N):\n break\n geta = 20\n buildings = [0] * (geta * 2)\n for _ in range(N):\n xl, xr, h = list(map(int, input().split()))\n for i in range(xl + geta, xr + geta):\n buildings[i] = max(buildings[i], h)\n left, right = 0, 20\n for _ in range(100):\n mid = (left + right) / 2\n flag = True\n for i in range(-R + geta, R + geta):\n if i < geta:\n y = pow(R * R - (i - geta + 1) * (i - geta + 1), 0.5)\n flag &= buildings[i] >= y - R + mid\n else:\n y = pow(R * R - (i - geta) * (i - geta), 0.5)\n flag &= buildings[i] >= y - R + mid\n if flag:\n left = mid\n else:\n right = mid\n print((\"{:.20f}\".format(left)))\n", "measured_slow_code_sha256": "795b09bbdc3e784c88f5123c69e5182a24a5b0dfccc3a43d6572c5a9d5f75406", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 12.390896976930902, "pair_id": "python_v2_9cf23a82ebb7998e037b3cd8", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p00775", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p00775_5b650f0d9d560aa2ddc06d1551889bb58d9768a548461d3a84fc82e94f0e3d66.jsonl.gz", "inputs": "reproduction/python/inputs/p00775.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p00775_795b09bbdc3e784c88f5123c69e5182a24a5b0dfccc3a43d6572c5a9d5f75406.jsonl.gz"}, "slow_code": "while True:\n R, N = list(map(int, input().split()))\n if not (R | N):\n break\n geta = 20\n buildings = [0] * (geta * 2)\n for _ in range(N):\n xl, xr, h = list(map(int, input().split()))\n for i in range(xl + geta, xr + geta):\n buildings[i] = max(buildings[i], h)\n left, right = 0, 20\n for _ in range(100):\n mid = (left + right) / 2\n flag = True\n for i in range(-R + geta, R + geta):\n if i < geta:\n y = pow(R * R - (i - geta + 1) * (i - geta + 1), 0.5)\n flag &= buildings[i] >= y - R + mid\n else:\n y = pow(R * R - (i - geta) * (i - geta), 0.5)\n flag &= buildings[i] >= y - R + mid\n if flag:\n left = mid\n else:\n right = mid\n print((\"{:.20f}\".format(left)))\n", "slow_code_sha256": "795b09bbdc3e784c88f5123c69e5182a24a5b0dfccc3a43d6572c5a9d5f75406", "slow_id": "p00775_795b09bbdc3e784c88f5123c69e5182a24a5b0dfccc3a43d6572c5a9d5f75406", "speedup": 12.626260680529464, "stratum": "8+", "within_pair_jaccard": 0.725, "workload": {"case_count": 100, "description": "For each dataset, find the last t>=0 when the radius-r disk centered at (0,t-r) is entirely covered by n building rectangles [xl_i,xr_i]x[0,h_i] together with y<=0. Rectangles may overlap or touch. A final 0 0 ends input. Observed inputs: datasets=1..5 (median 1); r=1..20; n=0..20; total_rectangles=0..92 (median 16.5); xl_i=-20..19; xr_i=-19..20; h_i=1..20.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 806, "median": 156.5, "min": 8}, "input_format": ["r_1 n_1\n[n_1 lines: xl_i xr_i h_i]\n[next datasets]\n0 0"], "input_format_status": "source_input_section", "input_lines": {"max": 98, "median": 20.5, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 288, "median": 56.0, "min": 4}}} -{"case_ids": ["p02935_case_000", "p02935_case_001", "p02935_case_002", "p02935_case_003", "p02935_case_004", "p02935_case_005", "p02935_case_006", "p02935_case_007", "p02935_case_008", "p02935_case_009", "p02935_case_010", "p02935_case_011", "p02935_case_012", "p02935_case_013", "p02935_case_014", "p02935_case_015", "p02935_case_016", "p02935_case_017", "p02935_case_018", "p02935_case_019", "p02935_case_020", "p02935_case_021", "p02935_case_022", "p02935_case_023", "p02935_case_024", "p02935_case_025", "p02935_case_026", "p02935_case_027", "p02935_case_028", "p02935_case_029", "p02935_case_030", "p02935_case_031", "p02935_case_032", "p02935_case_033", "p02935_case_034", "p02935_case_035", "p02935_case_036", "p02935_case_037", "p02935_case_038", "p02935_case_039", "p02935_case_040", "p02935_case_041", "p02935_case_042", "p02935_case_043", "p02935_case_044", "p02935_case_045", "p02935_case_046", "p02935_case_047", "p02935_case_048", "p02935_case_049", "p02935_case_050", "p02935_case_051", "p02935_case_052", "p02935_case_053", "p02935_case_054", "p02935_case_055", "p02935_case_056", "p02935_case_057", "p02935_case_058", "p02935_case_059", "p02935_case_060", "p02935_case_061", "p02935_case_062", "p02935_case_063", "p02935_case_064", "p02935_case_065", "p02935_case_066", "p02935_case_067", "p02935_case_068", "p02935_case_069", "p02935_case_070", "p02935_case_071", "p02935_case_072", "p02935_case_073", "p02935_case_074", "p02935_case_075", "p02935_case_076", "p02935_case_077", "p02935_case_078", "p02935_case_079", "p02935_case_080", "p02935_case_081", "p02935_case_082", "p02935_case_083", "p02935_case_084", "p02935_case_085", "p02935_case_086", "p02935_case_087", "p02935_case_088", "p02935_case_089", "p02935_case_090", "p02935_case_091", "p02935_case_092", "p02935_case_093", "p02935_case_094", "p02935_case_095", "p02935_case_096", "p02935_case_097", "p02935_case_098", "p02935_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\ninput = sys.stdin.readline\n\n\ndef I():\n return int(eval(input()))\n\n\ndef MI():\n return list(map(int, input().split()))\n\n\ndef LI():\n return list(map(int, input().split()))\n\n\ndef main():\n mod = 10**9 + 7\n N = I()\n v = LI()\n v.sort()\n ans = v[0]\n for i in range(1, N):\n ans = (ans + v[i]) / 2\n print(ans)\n\n\nmain()\n", "fast_code_sha256": "9b78a97b4b76e68d92800a00a37d61a75196c9b06e589ce18342502a2da0c713", "fast_id": "p02935_9b78a97b4b76e68d92800a00a37d61a75196c9b06e589ce18342502a2da0c713", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\ninput = sys.stdin.readline\n\n\ndef I():\n return int(eval(input()))\n\n\ndef MI():\n return list(map(int, input().split()))\n\n\ndef LI():\n return list(map(int, input().split()))\n\n\ndef main():\n mod = 10**9 + 7\n N = I()\n v = LI()\n v.sort()\n ans = v[0]\n for i in range(1, N):\n ans = (ans + v[i]) / 2\n print(ans)\n\n\nmain()\n", "measured_fast_code_sha256": "9b78a97b4b76e68d92800a00a37d61a75196c9b06e589ce18342502a2da0c713", "measured_slow_code": "import numpy as np\n\nN = int(eval(input()))\nstr_list = input().split(\" \")\nA = [int(x) for x in str_list]\nA = np.array(A)\nwhile len(A) > 1:\n first_min = A[A.argmin()]\n # print(first_min)\n A = np.delete(A, A.argmin())\n second_min = A[A.argmin()]\n # print(second_min)\n A = np.delete(A, A.argmin())\n mean = (first_min + second_min) / 2.0\n A = np.append(A, mean)\n # print(A)\nprint(mean)\n", "measured_slow_code_sha256": "469a8dbe0d6e33ac7f370cd3ccb58bdf599ddcbe6d94e7cc5a7cde68de5db05a", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 584.6844402924683, "pair_id": "python_v2_b2d83c3af64cf68976172808", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02935", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02935_9b78a97b4b76e68d92800a00a37d61a75196c9b06e589ce18342502a2da0c713.jsonl.gz", "inputs": "reproduction/python/inputs/p02935.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02935_469a8dbe0d6e33ac7f370cd3ccb58bdf599ddcbe6d94e7cc5a7cde68de5db05a.jsonl.gz"}, "slow_code": "import numpy as np\n\nN = int(eval(input()))\nstr_list = input().split(\" \")\nA = [int(x) for x in str_list]\nA = np.array(A)\nwhile len(A) > 1:\n first_min = A[A.argmin()]\n\n A = np.delete(A, A.argmin())\n second_min = A[A.argmin()]\n\n A = np.delete(A, A.argmin())\n mean = (first_min + second_min) / 2.0\n A = np.append(A, mean)\n\nprint(mean)\n", "slow_code_sha256": "f9cf033ef3320a5fdaabd7fadad3d7ff479bba43226bb8f92e09489a3fd88f4d", "slow_id": "p02935_469a8dbe0d6e33ac7f370cd3ccb58bdf599ddcbe6d94e7cc5a7cde68de5db05a", "speedup": 581.2848745615962, "stratum": "8+", "within_pair_jaccard": 0.2553191489361702, "workload": {"case_count": 100, "description": "Repeatedly replace two ingredient values x and y by their arithmetic mean (x+y)/2. Starting with N input values v_i, maximize the final value after N-1 replacements. Observed inputs: N=2..50 (median 25); v_i=1..1000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 253, "median": 102.5, "min": 6}, "input_format": ["N\nv_1 ... v_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 51, "median": 26.0, "min": 3}}} -{"case_ids": ["p02603_case_000", "p02603_case_001", "p02603_case_002", "p02603_case_003", "p02603_case_004", "p02603_case_005", "p02603_case_006", "p02603_case_007", "p02603_case_008", "p02603_case_009", "p02603_case_010", "p02603_case_011", "p02603_case_012", "p02603_case_013", "p02603_case_014", "p02603_case_015", "p02603_case_016", "p02603_case_017", "p02603_case_018", "p02603_case_019", "p02603_case_020", "p02603_case_021", "p02603_case_022", "p02603_case_023", "p02603_case_024", "p02603_case_025", "p02603_case_026", "p02603_case_027", "p02603_case_028", "p02603_case_029", "p02603_case_030", "p02603_case_031", "p02603_case_032", "p02603_case_033", "p02603_case_034", "p02603_case_035", "p02603_case_036", "p02603_case_037", "p02603_case_038", "p02603_case_039", "p02603_case_040", "p02603_case_041", "p02603_case_042", "p02603_case_043", "p02603_case_044", "p02603_case_045", "p02603_case_046", "p02603_case_047", "p02603_case_048", "p02603_case_049", "p02603_case_050", "p02603_case_051", "p02603_case_052", "p02603_case_053", "p02603_case_054", "p02603_case_055", "p02603_case_056", "p02603_case_057", "p02603_case_058", "p02603_case_059", "p02603_case_060", "p02603_case_061", "p02603_case_062", "p02603_case_063", "p02603_case_064", "p02603_case_065", "p02603_case_066", "p02603_case_067", "p02603_case_068", "p02603_case_069", "p02603_case_070", "p02603_case_071", "p02603_case_072", "p02603_case_073", "p02603_case_074", "p02603_case_075", "p02603_case_076", "p02603_case_077", "p02603_case_078", "p02603_case_079", "p02603_case_080", "p02603_case_081", "p02603_case_082", "p02603_case_083", "p02603_case_084", "p02603_case_085", "p02603_case_086", "p02603_case_087", "p02603_case_088", "p02603_case_089", "p02603_case_090", "p02603_case_091", "p02603_case_092", "p02603_case_093", "p02603_case_094", "p02603_case_095", "p02603_case_096", "p02603_case_097", "p02603_case_098", "p02603_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import collections\n\nN = int(eval(input()))\nA = list(map(int, input().split()))\ni = 0\nA.insert(0, float(\"inf\"))\n\nbuy = [0] * N\nsell = [0] * N\nfor i in range(N - 1):\n if (A[i] >= A[i + 1]) and (A[i + 2] >= A[i + 1]):\n buy[i] = 1\n if (A[i] <= A[i + 1]) and (A[i + 2] <= A[i + 1]):\n sell[i] = 1\nkabu = 0\nmoney = 1000\n\n\nA = A[1:]\n\nfor i in range(N):\n if buy[i] == 1:\n kabu = kabu + money // A[i]\n money = money - (money // A[i]) * A[i]\n if sell[i] == 1:\n money = money + kabu * A[i]\n kabu = 0\n\n\nmoney = money + kabu * A[N - 1]\nprint(money)\n", "fast_code_sha256": "98c9ebce7d0247a468894e2b514f465b039ea2b136e49cee9f5e3043ece6defa", "fast_id": "p02603_1fdb7193eac317647d47dc4eab2c4d9a8c12bd6189b7d71270158b3744fa6485", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import collections\n\nN = int(eval(input()))\nA = list(map(int, input().split()))\ni = 0\nA.insert(0, float(\"inf\"))\n# print(A)\nbuy = [0] * N\nsell = [0] * N\nfor i in range(N - 1):\n if (A[i] >= A[i + 1]) and (A[i + 2] >= A[i + 1]):\n buy[i] = 1\n if (A[i] <= A[i + 1]) and (A[i + 2] <= A[i + 1]):\n sell[i] = 1\nkabu = 0\nmoney = 1000\n# print(buy,sell)\n# print(money,kabu)\nA = A[1:]\n# print(A)\nfor i in range(N):\n if buy[i] == 1:\n kabu = kabu + money // A[i]\n money = money - (money // A[i]) * A[i]\n if sell[i] == 1:\n money = money + kabu * A[i]\n kabu = 0\n # print(money,kabu,A[i])\n # input()\n# print(money,kabu)\nmoney = money + kabu * A[N - 1]\nprint(money)\n", "measured_fast_code_sha256": "1fdb7193eac317647d47dc4eab2c4d9a8c12bd6189b7d71270158b3744fa6485", "measured_slow_code": "import sys\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().rstrip().split())) # 空白あり\n\n\nN = I()\nB = [0] + LI()\nA = [0]\nfor i in range(N): # 要らないものを消す\n if B[i] != B[i + 1]:\n A.append(B[i + 1])\nN = len(A) - 1\nMAX = [0, 1000] + [0] * N # MAX[i] = i日目開始時点の所持金の最大値\nfrom functools import lru_cache\n\n\n@lru_cache(maxsize=None)\ndef dfs(n, money):\n if n == N + 1:\n return money\n else:\n res = money\n for i in range(n, N): # 購入\n for j in range(i + 1, N + 1): # 売却\n if (\n A[i] == min(A[i : j + 1])\n and A[j] == max(A[i : j + 1])\n and A[i] < A[j]\n ):\n a = money + (A[j] - A[i]) * (money // A[i])\n if a > MAX[j + 1]:\n res = max(res, dfs(j + 1, a))\n MAX[j + 1] = a\n return res\n\n\nprint((dfs(1, 1000)))\n", "measured_slow_code_sha256": "e81b938c4631bbf0dd19338b5f55857446617b774343cf12f37ec43bdb261ec6", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.451115554002242, "pair_id": "python_v2_c531a65b119d71b61961754d", "per_case_slow_code_faster_fraction": 0.03, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02603", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02603_1fdb7193eac317647d47dc4eab2c4d9a8c12bd6189b7d71270158b3744fa6485.jsonl.gz", "inputs": "reproduction/python/inputs/p02603.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02603_e81b938c4631bbf0dd19338b5f55857446617b774343cf12f37ec43bdb261ec6.jsonl.gz"}, "slow_code": "import sys\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\nN = I()\nB = [0] + LI()\nA = [0]\nfor i in range(N):\n if B[i] != B[i + 1]:\n A.append(B[i + 1])\nN = len(A) - 1\nMAX = [0, 1000] + [0] * N\nfrom functools import lru_cache\n\n\n@lru_cache(maxsize=None)\ndef dfs(n, money):\n if n == N + 1:\n return money\n else:\n res = money\n for i in range(n, N):\n for j in range(i + 1, N + 1):\n if (\n A[i] == min(A[i : j + 1])\n and A[j] == max(A[i : j + 1])\n and A[i] < A[j]\n ):\n a = money + (A[j] - A[i]) * (money // A[i])\n if a > MAX[j + 1]:\n res = max(res, dfs(j + 1, a))\n MAX[j + 1] = a\n return res\n\n\nprint((dfs(1, 1000)))\n", "slow_code_sha256": "94a262047194dcc6bb6fec17dfdcbd01dafe83c8a18c4168db8be6ce0b16248b", "slow_id": "p02603_e81b938c4631bbf0dd19338b5f55857446617b774343cf12f37ec43bdb261ec6", "speedup": 5.8800350177453575, "stratum": "4-8", "within_pair_jaccard": 0.33962264150943394, "workload": {"case_count": 100, "description": "Given N daily prices a_i for one stock, maximize final cash starting with 1000 and no shares. Buy or sell whole shares any number of times daily, without borrowing cash or shares. Observed inputs: N=2..80 (median 10); a_i=100..200.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 323, "median": 43.0, "min": 10}, "input_format": ["N\na_1 ... a_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 81, "median": 11.0, "min": 3}}} -{"case_ids": ["p02361_case_000", "p02361_case_001", "p02361_case_002", "p02361_case_003", "p02361_case_004", "p02361_case_005", "p02361_case_006", "p02361_case_007", "p02361_case_008", "p02361_case_009", "p02361_case_010", "p02361_case_011", "p02361_case_012", "p02361_case_013", "p02361_case_014", "p02361_case_015", "p02361_case_016", "p02361_case_017", "p02361_case_018", "p02361_case_019", "p02361_case_020", "p02361_case_021", "p02361_case_022", "p02361_case_023", "p02361_case_024", "p02361_case_025", "p02361_case_026", "p02361_case_027", "p02361_case_028", "p02361_case_029", "p02361_case_030", "p02361_case_031", "p02361_case_032", "p02361_case_033", "p02361_case_034", "p02361_case_035", "p02361_case_036", "p02361_case_037", "p02361_case_038", "p02361_case_039", "p02361_case_040", "p02361_case_041", "p02361_case_042", "p02361_case_043", "p02361_case_044", "p02361_case_045", "p02361_case_046", "p02361_case_047", "p02361_case_048", "p02361_case_049", "p02361_case_050", "p02361_case_051", "p02361_case_052", "p02361_case_053", "p02361_case_054", "p02361_case_055", "p02361_case_056", "p02361_case_057", "p02361_case_058", "p02361_case_059", "p02361_case_060", "p02361_case_061", "p02361_case_062", "p02361_case_063", "p02361_case_064", "p02361_case_065", "p02361_case_066", "p02361_case_067", "p02361_case_068", "p02361_case_069", "p02361_case_070", "p02361_case_071", "p02361_case_072", "p02361_case_073", "p02361_case_074", "p02361_case_075", "p02361_case_076", "p02361_case_077", "p02361_case_078", "p02361_case_079", "p02361_case_080", "p02361_case_081", "p02361_case_082", "p02361_case_083", "p02361_case_084", "p02361_case_085", "p02361_case_086", "p02361_case_087", "p02361_case_088", "p02361_case_089", "p02361_case_090", "p02361_case_091", "p02361_case_092", "p02361_case_093", "p02361_case_094", "p02361_case_095", "p02361_case_096", "p02361_case_097", "p02361_case_098", "p02361_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\nfrom heapq import heappush, heappop\n\nreadline = sys.stdin.readline\nV, E, r = list(map(int, readline().split()))\ninf = 10**10\nedges = [[] for _ in [None] * V]\nvertices = [inf] * V\nvertices[r] = 0\nfor _ in [None] * E:\n s, t, d = list(map(int, readline().split()))\n edges[s].append((t, d))\nq = [(0, r)]\nrem = V - 1\nwhile q and rem:\n cost, v = heappop(q)\n if vertices[v] < cost:\n continue\n rem -= 1\n for dest, _cost in edges[v]:\n newcost = cost + _cost\n if vertices[dest] > newcost:\n vertices[dest] = newcost\n heappush(q, (newcost, dest))\nprint((\"\\n\".join([str(n) if n != inf else \"INF\" for n in vertices])))\n", "fast_code_sha256": "59bab4d76458b9d52141aa25422a631231c9e446195a30b427396f9e6de3c8eb", "fast_id": "p02361_59bab4d76458b9d52141aa25422a631231c9e446195a30b427396f9e6de3c8eb", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\nfrom heapq import heappush, heappop\n\nreadline = sys.stdin.readline\nV, E, r = list(map(int, readline().split()))\ninf = 10**10\nedges = [[] for _ in [None] * V]\nvertices = [inf] * V\nvertices[r] = 0\nfor _ in [None] * E:\n s, t, d = list(map(int, readline().split()))\n edges[s].append((t, d))\nq = [(0, r)]\nrem = V - 1\nwhile q and rem:\n cost, v = heappop(q)\n if vertices[v] < cost:\n continue\n rem -= 1\n for dest, _cost in edges[v]:\n newcost = cost + _cost\n if vertices[dest] > newcost:\n vertices[dest] = newcost\n heappush(q, (newcost, dest))\nprint((\"\\n\".join([str(n) if n != inf else \"INF\" for n in vertices])))\n", "measured_fast_code_sha256": "59bab4d76458b9d52141aa25422a631231c9e446195a30b427396f9e6de3c8eb", "measured_slow_code": "import sys\nimport queue\n\n\nclass Dijkstra:\n class Edge:\n def __init__(self, end, cost):\n self.to = end\n self.cost = cost\n\n def __init__(self, node_size, inf):\n self._node = node_size\n self._graph = [[] for _ in range(self._node)]\n self.inf = inf\n self.dist = [self.inf for _ in range(self._node)]\n\n def add_edge(self, st, ed, cs):\n self._graph[st].append(self.Edge(ed, cs))\n\n def solve(self, start):\n que = queue.PriorityQueue()\n self.dist[start] = 0\n que.put((0, start))\n while not que.empty():\n cur_cost, cur_vertex = que.get()\n if self.dist[cur_vertex] < cur_cost:\n continue\n for e in self._graph[cur_vertex]:\n if self.dist[e.to] > cur_cost + e.cost:\n self.dist[e.to] = cur_cost + e.cost\n que.put((self.dist[e.to], e.to))\n\n\nif __name__ == \"__main__\":\n V, E, r = list(map(int, sys.stdin.readline().split()))\n dk = Dijkstra(V, 10**10)\n for i in range(E):\n s, t, d = list(map(int, sys.stdin.readline().split()))\n dk.add_edge(s, t, d)\n dk.solve(r)\n for value in dk.dist:\n if value == dk.inf:\n print(\"INF\")\n else:\n print(value)\n", "measured_slow_code_sha256": "a48d0b96003d389be54b84ff869a67e52827774163e88aa4dae4f6c2782d1681", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.860344104641261, "pair_id": "python_v2_97ebbc76fb831d88dbc2c069", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02361", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02361_59bab4d76458b9d52141aa25422a631231c9e446195a30b427396f9e6de3c8eb.jsonl.gz", "inputs": "reproduction/python/inputs/p02361.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02361_a48d0b96003d389be54b84ff869a67e52827774163e88aa4dae4f6c2782d1681.jsonl.gz"}, "slow_code": "import sys\nimport queue\n\n\nclass Dijkstra:\n class Edge:\n def __init__(self, end, cost):\n self.to = end\n self.cost = cost\n\n def __init__(self, node_size, inf):\n self._node = node_size\n self._graph = [[] for _ in range(self._node)]\n self.inf = inf\n self.dist = [self.inf for _ in range(self._node)]\n\n def add_edge(self, st, ed, cs):\n self._graph[st].append(self.Edge(ed, cs))\n\n def solve(self, start):\n que = queue.PriorityQueue()\n self.dist[start] = 0\n que.put((0, start))\n while not que.empty():\n cur_cost, cur_vertex = que.get()\n if self.dist[cur_vertex] < cur_cost:\n continue\n for e in self._graph[cur_vertex]:\n if self.dist[e.to] > cur_cost + e.cost:\n self.dist[e.to] = cur_cost + e.cost\n que.put((self.dist[e.to], e.to))\n\n\nif __name__ == \"__main__\":\n V, E, r = list(map(int, sys.stdin.readline().split()))\n dk = Dijkstra(V, 10**10)\n for i in range(E):\n s, t, d = list(map(int, sys.stdin.readline().split()))\n dk.add_edge(s, t, d)\n dk.solve(r)\n for value in dk.dist:\n if value == dk.inf:\n print(\"INF\")\n else:\n print(value)\n", "slow_code_sha256": "a48d0b96003d389be54b84ff869a67e52827774163e88aa4dae4f6c2782d1681", "slow_id": "p02361_a48d0b96003d389be54b84ff869a67e52827774163e88aa4dae4f6c2782d1681", "speedup": 2.069476614648539, "stratum": "2-4", "within_pair_jaccard": 0.35, "workload": {"case_count": 100, "description": "Find shortest-path costs from source r to all vertices of a directed graph with nonnegative edge weights, outputting INF for unreachable vertices. Vertex IDs are 0..V-1; self-loops and parallel directed edges are absent. Observed inputs: V=1..100000 (median 1000); E=0..500000 (median 4999); r=0..99627; d_i=0..10000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 8333729, "median": 48880.5, "min": 6}, "input_format": ["V E r\ns_1 t_1 d_1\n...\ns_E t_E d_E"], "input_format_status": "source_input_section", "input_lines": {"max": 500001, "median": 5000.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1500003, "median": 15000.0, "min": 3}}} -{"case_ids": ["p02675_case_000", "p02675_case_001", "p02675_case_002", "p02675_case_003", "p02675_case_004", "p02675_case_005", "p02675_case_006", "p02675_case_007", "p02675_case_008", "p02675_case_009", "p02675_case_010", "p02675_case_011", "p02675_case_012", "p02675_case_013", "p02675_case_014", "p02675_case_015", "p02675_case_016", "p02675_case_017", "p02675_case_018", "p02675_case_019", "p02675_case_020", "p02675_case_021", "p02675_case_022", "p02675_case_023", "p02675_case_024", "p02675_case_025", "p02675_case_026", "p02675_case_027", "p02675_case_028", "p02675_case_029", "p02675_case_030", "p02675_case_031", "p02675_case_032", "p02675_case_033", "p02675_case_034", "p02675_case_035", "p02675_case_036", "p02675_case_037", "p02675_case_038", "p02675_case_039", "p02675_case_040", "p02675_case_041", "p02675_case_042", "p02675_case_043", "p02675_case_044", "p02675_case_045", "p02675_case_046", "p02675_case_047", "p02675_case_048", "p02675_case_049", "p02675_case_050", "p02675_case_051", "p02675_case_052", "p02675_case_053", "p02675_case_054", "p02675_case_055", "p02675_case_056", "p02675_case_057", "p02675_case_058", "p02675_case_059", "p02675_case_060", "p02675_case_061", "p02675_case_062", "p02675_case_063", "p02675_case_064", "p02675_case_065", "p02675_case_066", "p02675_case_067", "p02675_case_068", "p02675_case_069", "p02675_case_070", "p02675_case_071", "p02675_case_072", "p02675_case_073", "p02675_case_074", "p02675_case_075", "p02675_case_076", "p02675_case_077", "p02675_case_078", "p02675_case_079", "p02675_case_080", "p02675_case_081", "p02675_case_082", "p02675_case_083", "p02675_case_084", "p02675_case_085", "p02675_case_086", "p02675_case_087", "p02675_case_088", "p02675_case_089", "p02675_case_090", "p02675_case_091", "p02675_case_092", "p02675_case_093", "p02675_case_094", "p02675_case_095", "p02675_case_096", "p02675_case_097", "p02675_case_098", "p02675_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N = int(eval(input()))\nch = [\"pon\", \"pon\", \"hon\", \"bon\", \"hon\", \"hon\", \"pon\", \"hon\", \"pon\", \"hon\"]\nprint((ch[N % 10]))\n", "fast_code_sha256": "f726c357d28e4b8cc4d8b4a54ca612e4e21c4e8ab23f61c6bd237877e8c6c74d", "fast_id": "p02675_f726c357d28e4b8cc4d8b4a54ca612e4e21c4e8ab23f61c6bd237877e8c6c74d", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N = int(eval(input()))\nch = [\"pon\", \"pon\", \"hon\", \"bon\", \"hon\", \"hon\", \"pon\", \"hon\", \"pon\", \"hon\"]\nprint((ch[N % 10]))\n", "measured_fast_code_sha256": "f726c357d28e4b8cc4d8b4a54ca612e4e21c4e8ab23f61c6bd237877e8c6c74d", "measured_slow_code": "# coding: utf-8\nimport sys\nimport math\nimport collections\nimport itertools\n\nINF = 10**13\nMOD = 10**9 + 7\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef lcm(x, y):\n return (x * y) // math.gcd(x, y)\n\n\ndef I():\n return int(input())\n\n\ndef LI():\n return [int(x) for x in input().split()]\n\n\ndef RI(N):\n return [int(input()) for _ in range(N)]\n\n\ndef LRI(N):\n return [[int(x) for x in input().split()] for _ in range(N)]\n\n\ndef LS():\n return input().split()\n\n\ndef RS(N):\n return [input() for _ in range(N)]\n\n\ndef LRS(N):\n return [input().split() for _ in range(N)]\n\n\ndef PL(L):\n print(*L, sep=\"\\n\")\n\n\ndef YesNo(B):\n print(\"Yes\" if B else \"No\")\n\n\ndef YESNO(B):\n print(\"YES\" if B else \"NO\")\n\n\nN = input()\nn = int(N[-1])\nif n in [2, 4, 5, 7, 9]:\n print(\"hon\")\nelif n in [0, 1, 6, 8]:\n print(\"pon\")\nelse:\n print(\"bon\")\n", "measured_slow_code_sha256": "bcce039052b5a9d508977350d4acfbd9fe58862ea34a03a2bcd6716f9ff97915", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 6.396422096965727, "pair_id": "python_v2_1dcc58fe9371a4fa51e5cbe2", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02675", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02675_f726c357d28e4b8cc4d8b4a54ca612e4e21c4e8ab23f61c6bd237877e8c6c74d.jsonl.gz", "inputs": "reproduction/python/inputs/p02675.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02675_bcce039052b5a9d508977350d4acfbd9fe58862ea34a03a2bcd6716f9ff97915.jsonl.gz"}, "slow_code": "import sys\nimport math\nimport collections\nimport itertools\n\nINF = 10**13\nMOD = 10**9 + 7\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef lcm(x, y):\n return (x * y) // math.gcd(x, y)\n\n\ndef I():\n return int(input())\n\n\ndef LI():\n return [int(x) for x in input().split()]\n\n\ndef RI(N):\n return [int(input()) for _ in range(N)]\n\n\ndef LRI(N):\n return [[int(x) for x in input().split()] for _ in range(N)]\n\n\ndef LS():\n return input().split()\n\n\ndef RS(N):\n return [input() for _ in range(N)]\n\n\ndef LRS(N):\n return [input().split() for _ in range(N)]\n\n\ndef PL(L):\n print(*L, sep=\"\\n\")\n\n\ndef YesNo(B):\n print(\"Yes\" if B else \"No\")\n\n\ndef YESNO(B):\n print(\"YES\" if B else \"NO\")\n\n\nN = input()\nn = int(N[-1])\nif n in [2, 4, 5, 7, 9]:\n print(\"hon\")\nelif n in [0, 1, 6, 8]:\n print(\"pon\")\nelse:\n print(\"bon\")\n", "slow_code_sha256": "a356f7da63a7609258cca42cfa76beeb6639c9b361627aee5fe4197d7e864b71", "slow_id": "p02675_bcce039052b5a9d508977350d4acfbd9fe58862ea34a03a2bcd6716f9ff97915", "speedup": 6.392527624484526, "stratum": "4-8", "within_pair_jaccard": 0.13114754098360656, "workload": {"case_count": 100, "description": "Output a counter pronunciation determined by the last decimal digit of N: hon for 2,4,5,7,9; pon for 0,1,6,8; bon for 3. Observed inputs: N=1..999 (median 404).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 4, "median": 4.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p03796_case_000", "p03796_case_001", "p03796_case_002", "p03796_case_003", "p03796_case_004", "p03796_case_005", "p03796_case_006", "p03796_case_007", "p03796_case_008", "p03796_case_009", "p03796_case_010", "p03796_case_011", "p03796_case_012", "p03796_case_013", "p03796_case_014", "p03796_case_015", "p03796_case_016", "p03796_case_017", "p03796_case_018", "p03796_case_019", "p03796_case_020", "p03796_case_021", "p03796_case_022", "p03796_case_023", "p03796_case_024", "p03796_case_025", "p03796_case_026", "p03796_case_027", "p03796_case_028", "p03796_case_029", "p03796_case_030", "p03796_case_031", "p03796_case_032", "p03796_case_033", "p03796_case_034", "p03796_case_035", "p03796_case_036", "p03796_case_037", "p03796_case_038", "p03796_case_039", "p03796_case_040", "p03796_case_041", "p03796_case_042", "p03796_case_043", "p03796_case_044", "p03796_case_045", "p03796_case_046", "p03796_case_047", "p03796_case_048", "p03796_case_049", "p03796_case_050", "p03796_case_051", "p03796_case_052", "p03796_case_053", "p03796_case_054", "p03796_case_055", "p03796_case_056", "p03796_case_057", "p03796_case_058", "p03796_case_059", "p03796_case_060", "p03796_case_061", "p03796_case_062", "p03796_case_063", "p03796_case_064", "p03796_case_065", "p03796_case_066", "p03796_case_067", "p03796_case_068", "p03796_case_069", "p03796_case_070", "p03796_case_071", "p03796_case_072", "p03796_case_073", "p03796_case_074", "p03796_case_075", "p03796_case_076", "p03796_case_077", "p03796_case_078", "p03796_case_079", "p03796_case_080", "p03796_case_081", "p03796_case_082", "p03796_case_083", "p03796_case_084", "p03796_case_085", "p03796_case_086", "p03796_case_087", "p03796_case_088", "p03796_case_089", "p03796_case_090", "p03796_case_091", "p03796_case_092", "p03796_case_093", "p03796_case_094", "p03796_case_095", "p03796_case_096", "p03796_case_097", "p03796_case_098", "p03796_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N = int(eval(input()))\nMOD = 10**9 + 7\nans = 1\nfor i in range(1, N + 1):\n ans = (ans * i) % MOD\nprint(ans)\n", "fast_code_sha256": "60bdc1d135f85e10cfcc335cc8945c085952f02cb44b42b80537667c85c38f6f", "fast_id": "p03796_60bdc1d135f85e10cfcc335cc8945c085952f02cb44b42b80537667c85c38f6f", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N = int(eval(input()))\nMOD = 10**9 + 7\nans = 1\nfor i in range(1, N + 1):\n ans = (ans * i) % MOD\nprint(ans)\n", "measured_fast_code_sha256": "60bdc1d135f85e10cfcc335cc8945c085952f02cb44b42b80537667c85c38f6f", "measured_slow_code": "# ABC 055: B – Training Camp\nfrom math import factorial\n\nn = int(eval(input()))\nprint((factorial(n) % (10**9 + 7)))\n", "measured_slow_code_sha256": "43b257e85e546d9470ced772c67918bde77d5626a2fd04dea2e6a84c615224a5", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4.145794507789047, "pair_id": "python_v2_e8790293f0644f1092fc981a", "per_case_slow_code_faster_fraction": 0.35, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03796", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03796_60bdc1d135f85e10cfcc335cc8945c085952f02cb44b42b80537667c85c38f6f.jsonl.gz", "inputs": "reproduction/python/inputs/p03796.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03796_43b257e85e546d9470ced772c67918bde77d5626a2fd04dea2e6a84c615224a5.jsonl.gz"}, "slow_code": "from math import factorial\n\nn = int(eval(input()))\nprint((factorial(n) % (10**9 + 7)))\n", "slow_code_sha256": "5ff598b9800e1bd896356b079e05a6afa89737def3d95243ef8ae46ed85960b1", "slow_id": "p03796_43b257e85e546d9470ced772c67918bde77d5626a2fd04dea2e6a84c615224a5", "speedup": 2.5350279544920227, "stratum": "2-4", "within_pair_jaccard": 0.35, "workload": {"case_count": 100, "description": "Starting with power 1, multiply it by i for i=1..N in order. Output the final power modulo 1000000007. Observed inputs: N=1..100000 (median 31648.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 7, "median": 6.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p02630_case_000", "p02630_case_001", "p02630_case_002", "p02630_case_003", "p02630_case_004", "p02630_case_005", "p02630_case_006", "p02630_case_007", "p02630_case_008", "p02630_case_009", "p02630_case_010", "p02630_case_011", "p02630_case_012", "p02630_case_013", "p02630_case_014", "p02630_case_015", "p02630_case_016", "p02630_case_017", "p02630_case_018", "p02630_case_019", "p02630_case_020", "p02630_case_021", "p02630_case_022", "p02630_case_023", "p02630_case_024", "p02630_case_025", "p02630_case_026", "p02630_case_027", "p02630_case_028", "p02630_case_029", "p02630_case_030", "p02630_case_031", "p02630_case_032", "p02630_case_033", "p02630_case_034", "p02630_case_035", "p02630_case_036", "p02630_case_037", "p02630_case_038", "p02630_case_039", "p02630_case_040", "p02630_case_041", "p02630_case_042", "p02630_case_043", "p02630_case_044", "p02630_case_045", "p02630_case_046", "p02630_case_047", "p02630_case_048", "p02630_case_049", "p02630_case_050", "p02630_case_051", "p02630_case_052", "p02630_case_053", "p02630_case_054", "p02630_case_055", "p02630_case_056", "p02630_case_057", "p02630_case_058", "p02630_case_059", "p02630_case_060", "p02630_case_061", "p02630_case_062", "p02630_case_063", "p02630_case_064", "p02630_case_065", "p02630_case_066", "p02630_case_067", "p02630_case_068", "p02630_case_069", "p02630_case_070", "p02630_case_071", "p02630_case_072", "p02630_case_073", "p02630_case_074", "p02630_case_075", "p02630_case_076", "p02630_case_077", "p02630_case_078", "p02630_case_079", "p02630_case_080", "p02630_case_081", "p02630_case_082", "p02630_case_083", "p02630_case_084", "p02630_case_085", "p02630_case_086", "p02630_case_087", "p02630_case_088", "p02630_case_089", "p02630_case_090", "p02630_case_091", "p02630_case_092", "p02630_case_093", "p02630_case_094", "p02630_case_095", "p02630_case_096", "p02630_case_097", "p02630_case_098", "p02630_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\nINF = 1 << 60\nMOD = 10**9 + 7\nsys.setrecursionlimit(2147483647)\ninput = lambda: sys.stdin.readline().rstrip()\nfrom collections import Counter\n\n\ndef resolve():\n n = int(eval(input()))\n C = Counter(list(map(int, input().split())))\n total = 0\n for key, val in list(C.items()):\n total += key * val\n for _ in range(int(eval(input()))):\n b, c = list(map(int, input().split()))\n num = C[b]\n total += (c - b) * num\n C[b] = 0\n C[c] += num\n print(total)\n\n\nresolve()\n", "fast_code_sha256": "77881259c846af61127583714eddae818e8d4390d6dcc41503efecc52218accd", "fast_id": "p02630_5c79b9e310b66b9360c139ba9db4e2d3634da0d1561e853d9f779fca53f6678f", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\nINF = 1 << 60\nMOD = 10**9 + 7 # 998244353\nsys.setrecursionlimit(2147483647)\ninput = lambda: sys.stdin.readline().rstrip()\nfrom collections import Counter\n\n\ndef resolve():\n n = int(eval(input()))\n C = Counter(list(map(int, input().split())))\n total = 0\n for key, val in list(C.items()):\n total += key * val\n for _ in range(int(eval(input()))):\n b, c = list(map(int, input().split()))\n num = C[b]\n total += (c - b) * num\n C[b] = 0\n C[c] += num\n print(total)\n\n\nresolve()\n", "measured_fast_code_sha256": "5c79b9e310b66b9360c139ba9db4e2d3634da0d1561e853d9f779fca53f6678f", "measured_slow_code": "n = int(eval(input()))\nA = list(map(int, input().split()))\nq = int(eval(input()))\ntotal = sum(A) # これを基に各queryに対応(加算、減算)する\nl = [0 for i in range(10**5 + 1)] # 配列のインデックスを各valueとみなす\nfor _ in A: # 各インデックスに各keyを加算\n l[_] += 1\nfor i in range(q):\n b, c = list(map(int, input().split()))\n total += c * l[b] # totalの調整のみ\n total -= b * l[b] # 同上\n print(total)\n l[c] += l[b] # ここでリストの更新\n l[b] = 0 # 同上\n", "measured_slow_code_sha256": "96450435c56c9932de49d1d1d53a232b5189e0fe47b305002a0d44a0ec3cd04b", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.500136010216624, "pair_id": "python_v2_ef7309dba0e1373f7e338dc5", "per_case_slow_code_faster_fraction": 0.04, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02630", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02630_5c79b9e310b66b9360c139ba9db4e2d3634da0d1561e853d9f779fca53f6678f.jsonl.gz", "inputs": "reproduction/python/inputs/p02630.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02630_96450435c56c9932de49d1d1d53a232b5189e0fe47b305002a0d44a0ec3cd04b.jsonl.gz"}, "slow_code": "n = int(eval(input()))\nA = list(map(int, input().split()))\nq = int(eval(input()))\ntotal = sum(A)\nl = [0 for i in range(10**5 + 1)]\nfor _ in A:\n l[_] += 1\nfor i in range(q):\n b, c = list(map(int, input().split()))\n total += c * l[b]\n total -= b * l[b]\n print(total)\n l[c] += l[b]\n l[b] = 0\n", "slow_code_sha256": "f1f847cea9ab3dffada95647d255a7960e5e340922e99784cbf3f82890bf75d7", "slow_id": "p02630_96450435c56c9932de49d1d1d53a232b5189e0fe47b305002a0d44a0ec3cd04b", "speedup": 4.922074299711639, "stratum": "4-8", "within_pair_jaccard": 0.3829787234042553, "workload": {"case_count": 100, "description": "Process Q updates in order on an integer array: replace every current occurrence of B_i with C_i, where B_i!=C_i. After each update, output the sum of all array entries. Observed inputs: N=1..100000 (median 1000); Q=1..100000 (median 1000); A_i=1..100000; B_i=1..100000; C_i=1..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 2000014, "median": 176600.5, "min": 10}, "input_format": ["N\nA_1 ... A_N\nQ\nB_1 C_1\n...\nB_Q C_Q"], "input_format_status": "source_input_section", "input_lines": {"max": 100003, "median": 1003.0, "min": 4}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 300002, "median": 30002.0, "min": 5}}} -{"case_ids": ["p02763_case_000", "p02763_case_001", "p02763_case_002", "p02763_case_003", "p02763_case_004", "p02763_case_005", "p02763_case_006", "p02763_case_007", "p02763_case_008", "p02763_case_009", "p02763_case_010", "p02763_case_011", "p02763_case_012", "p02763_case_013", "p02763_case_014", "p02763_case_015", "p02763_case_016", "p02763_case_017", "p02763_case_018", "p02763_case_019", "p02763_case_020", "p02763_case_021", "p02763_case_022", "p02763_case_023", "p02763_case_024", "p02763_case_025", "p02763_case_026", "p02763_case_027", "p02763_case_028", "p02763_case_029", "p02763_case_030", "p02763_case_031", "p02763_case_032", "p02763_case_033", "p02763_case_034", "p02763_case_035", "p02763_case_036", "p02763_case_037", "p02763_case_038", "p02763_case_039", "p02763_case_040", "p02763_case_041", "p02763_case_042", "p02763_case_043", "p02763_case_044", "p02763_case_045", "p02763_case_046", "p02763_case_047", "p02763_case_048", "p02763_case_049", "p02763_case_050", "p02763_case_051", "p02763_case_052", "p02763_case_053", "p02763_case_054", "p02763_case_055", "p02763_case_056", "p02763_case_057", "p02763_case_058", "p02763_case_059", "p02763_case_060", "p02763_case_061", "p02763_case_062", "p02763_case_063", "p02763_case_064", "p02763_case_065", "p02763_case_066", "p02763_case_067", "p02763_case_068", "p02763_case_069", "p02763_case_070", "p02763_case_071", "p02763_case_072", "p02763_case_073", "p02763_case_074", "p02763_case_075", "p02763_case_076", "p02763_case_077", "p02763_case_078", "p02763_case_079", "p02763_case_080", "p02763_case_081", "p02763_case_082", "p02763_case_083", "p02763_case_084", "p02763_case_085", "p02763_case_086", "p02763_case_087", "p02763_case_088", "p02763_case_089", "p02763_case_090", "p02763_case_091", "p02763_case_092", "p02763_case_093", "p02763_case_094", "p02763_case_095", "p02763_case_096", "p02763_case_097", "p02763_case_098", "p02763_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "executable_AST_equal_except_explicit_explanatory_string_removal_and_all_frozen_inputs_checker_pass", "fast_code": "def solve():\n import sys\n\n input = sys.stdin.readline\n ordA = ord(\"a\")\n N = int(eval(input()))\n Ss = input().strip()\n nos = [ord(S) - ordA for S in Ss]\n Q = int(eval(input()))\n idEle = 0\n\n def _binOpe(x, y):\n return x | y\n\n def makeSegTree(numEle):\n numPow2 = 2 ** (numEle - 1).bit_length()\n data = [idEle] * (2 * numPow2)\n return data, numPow2\n\n def setInit(As):\n for iST, A in enumerate(As, numPow2):\n data[iST] = A\n for iST in reversed(list(range(1, numPow2))):\n data[iST] = _binOpe(data[2 * iST], data[2 * iST + 1])\n\n def _update1(iA, A):\n iST = iA + numPow2\n data[iST] = A\n\n def update(iA, A):\n _update1(iA, A)\n iST = iA + numPow2\n while iST > 1:\n iST >>= 1\n data[iST] = _binOpe(data[2 * iST], data[2 * iST + 1])\n\n def getValue(iSt, iEn):\n L = iSt + numPow2\n R = iEn + numPow2\n ans = idEle\n while L < R:\n if L & 1:\n ans = _binOpe(ans, data[L])\n L += 1\n if R & 1:\n R -= 1\n ans = _binOpe(ans, data[R])\n L >>= 1\n R >>= 1\n return ans\n\n data, numPow2 = makeSegTree(N)\n As = [(1 << no) for no in nos]\n setInit(As)\n anss = []\n for _ in range(Q):\n tp, v1, v2 = input().split()\n if tp == \"1\":\n pos = int(v1) - 1\n c = ord(v2) - ordA\n update(pos, 1 << c)\n else:\n L, R = int(v1) - 1, int(v2) - 1\n v = getValue(L, R + 1)\n ans = bin(v).count(\"1\")\n anss.append(ans)\n print((\"\\n\".join(map(str, anss))))\n\n\nsolve()\n", "fast_code_sha256": "4ad119377be4e348284e9d98e8c96ef418d8c7f752903ae720c4b07277550d67", "fast_id": "p02763_4ad119377be4e348284e9d98e8c96ef418d8c7f752903ae720c4b07277550d67", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def solve():\n import sys\n\n input = sys.stdin.readline\n ordA = ord(\"a\")\n N = int(eval(input()))\n Ss = input().strip()\n nos = [ord(S) - ordA for S in Ss]\n Q = int(eval(input()))\n idEle = 0\n\n def _binOpe(x, y):\n return x | y\n\n def makeSegTree(numEle):\n numPow2 = 2 ** (numEle - 1).bit_length()\n data = [idEle] * (2 * numPow2)\n return data, numPow2\n\n def setInit(As):\n for iST, A in enumerate(As, numPow2):\n data[iST] = A\n for iST in reversed(list(range(1, numPow2))):\n data[iST] = _binOpe(data[2 * iST], data[2 * iST + 1])\n\n def _update1(iA, A):\n iST = iA + numPow2\n data[iST] = A\n\n def update(iA, A):\n _update1(iA, A)\n iST = iA + numPow2\n while iST > 1:\n iST >>= 1\n data[iST] = _binOpe(data[2 * iST], data[2 * iST + 1])\n\n def getValue(iSt, iEn):\n L = iSt + numPow2\n R = iEn + numPow2\n ans = idEle\n while L < R:\n if L & 1:\n ans = _binOpe(ans, data[L])\n L += 1\n if R & 1:\n R -= 1\n ans = _binOpe(ans, data[R])\n L >>= 1\n R >>= 1\n return ans\n\n data, numPow2 = makeSegTree(N)\n As = [(1 << no) for no in nos]\n setInit(As)\n anss = []\n for _ in range(Q):\n tp, v1, v2 = input().split()\n if tp == \"1\":\n pos = int(v1) - 1\n c = ord(v2) - ordA\n update(pos, 1 << c)\n else:\n L, R = int(v1) - 1, int(v2) - 1\n v = getValue(L, R + 1)\n ans = bin(v).count(\"1\")\n anss.append(ans)\n print((\"\\n\".join(map(str, anss))))\n\n\nsolve()\n", "measured_fast_code_sha256": "4ad119377be4e348284e9d98e8c96ef418d8c7f752903ae720c4b07277550d67", "measured_slow_code": "import sys\n\ninput = sys.stdin.readline\n\n\nclass Bit:\n def __init__(self, n):\n self.n = n\n self.tree = [0] * (n + 1)\n self.el = [0] * (n + 1)\n self.depth = n.bit_length() - 1\n\n def sum(self, i):\n \"\"\"区間[0,i) の総和を求める\"\"\"\n s = 0\n i -= 1\n while i >= 0:\n s += self.tree[i]\n i = (i & (i + 1)) - 1\n return s\n\n def add(self, i, x):\n \"\"\"i 番目の要素に x を足す\"\"\"\n self.el[i] += x\n while i < self.n:\n self.tree[i] += x\n i |= i + 1\n\n def get(self, i, j=None):\n \"\"\"部分区間和 [i, j)\"\"\"\n if j is None:\n return self.el[i]\n if i == 0:\n return self.sum(j)\n return self.sum(j) - self.sum(i)\n\n def lower_bound(self, x, equal=False):\n \"\"\"(a0+a1+...+ai < x となる最大の i, その時の a0+a1+...+ai )\n a0+a1+...+ai <= x としたい場合は equal = True\n 二分探索であるため、ai>=0 を満たす必要がある\"\"\"\n sum_ = 0\n pos = -1 # 1-indexed の時は pos = 0\n if not equal:\n for i in range(self.depth, -1, -1):\n k = pos + (1 << i)\n if k < self.n and sum_ + self.tree[k] < x: # 1-indexed の時は k <= self.n\n sum_ += self.tree[k]\n pos += 1 << i\n if equal:\n for i in range(self.depth, -1, -1):\n k = pos + (1 << i)\n if k < self.n and sum_ + self.tree[k] <= x: # 1-indexed の時は k <= self.n\n sum_ += self.tree[k]\n pos += 1 << i\n return pos, sum_\n\n def __getitem__(self, s):\n \"\"\"[a0, a1, a2, ...]\"\"\"\n return self.el[s]\n\n def __iter__(self):\n \"\"\"[a0, a1, a2, ...]\"\"\"\n for s in self.el[: self.n]:\n yield s\n\n def __str__(self):\n text1 = \" \".join([\"element: \"] + list(map(str, self)))\n text2 = \" \".join(\n [\"cumsum(1-indexed): \"]\n + list(str(self.sum(i)) for i in range(1, self.n + 1))\n )\n return \"\\n\".join((text1, text2))\n\n\n####################################################################################################\nimport string\n\nN = int(eval(input()))\nS = input().strip()\nQ = int(eval(input()))\nB = [Bit(N) for _ in range(26)]\nabc = string.ascii_lowercase # [a-z] をロード\nabc2 = dict()\nfor i, s in enumerate(abc):\n abc2[s] = i\nfor i, s in enumerate(S):\n B[abc2[s]].add(i, 1)\nfor _ in range(Q):\n q = list(input().split())\n if q[0] == \"1\":\n a = int(q[1]) - 1\n b = q[2]\n for i in range(26):\n if B[i].el[a] == 1:\n B[i].add(a, -1)\n B[abc2[b]].add(a, 1)\n if q[0] == \"2\":\n a = int(q[1]) - 1\n b = int(q[2]) - 1\n res = 0\n for i in range(26):\n res += B[i].get(a, b + 1) > 0\n print(res)\n", "measured_slow_code_sha256": "f48f6f3e37812c17b5337b9141da770a977eb3ae11af352f28286963282fd6ed", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 5.727096177763884, "pair_id": "python_v2_2e87a695dbe1478e4568de46", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02763", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02763_4ad119377be4e348284e9d98e8c96ef418d8c7f752903ae720c4b07277550d67.jsonl.gz", "inputs": "reproduction/python/inputs/p02763.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02763_f48f6f3e37812c17b5337b9141da770a977eb3ae11af352f28286963282fd6ed.jsonl.gz"}, "slow_code": "import sys\n\ninput = sys.stdin.readline\n\n\nclass Bit:\n def __init__(self, n):\n self.n = n\n self.tree = [0] * (n + 1)\n self.el = [0] * (n + 1)\n self.depth = n.bit_length() - 1\n\n def sum(self, i):\n s = 0\n i -= 1\n while i >= 0:\n s += self.tree[i]\n i = (i & (i + 1)) - 1\n return s\n\n def add(self, i, x):\n self.el[i] += x\n while i < self.n:\n self.tree[i] += x\n i |= i + 1\n\n def get(self, i, j=None):\n if j is None:\n return self.el[i]\n if i == 0:\n return self.sum(j)\n return self.sum(j) - self.sum(i)\n\n def lower_bound(self, x, equal=False):\n sum_ = 0\n pos = -1\n if not equal:\n for i in range(self.depth, -1, -1):\n k = pos + (1 << i)\n if k < self.n and sum_ + self.tree[k] < x:\n sum_ += self.tree[k]\n pos += 1 << i\n if equal:\n for i in range(self.depth, -1, -1):\n k = pos + (1 << i)\n if k < self.n and sum_ + self.tree[k] <= x:\n sum_ += self.tree[k]\n pos += 1 << i\n return pos, sum_\n\n def __getitem__(self, s):\n return self.el[s]\n\n def __iter__(self):\n for s in self.el[: self.n]:\n yield s\n\n def __str__(self):\n text1 = \" \".join([\"element: \"] + list(map(str, self)))\n text2 = \" \".join(\n [\"cumsum(1-indexed): \"]\n + list(str(self.sum(i)) for i in range(1, self.n + 1))\n )\n return \"\\n\".join((text1, text2))\n\n\nimport string\n\nN = int(eval(input()))\nS = input().strip()\nQ = int(eval(input()))\nB = [Bit(N) for _ in range(26)]\nabc = string.ascii_lowercase\nabc2 = dict()\nfor i, s in enumerate(abc):\n abc2[s] = i\nfor i, s in enumerate(S):\n B[abc2[s]].add(i, 1)\nfor _ in range(Q):\n q = list(input().split())\n if q[0] == \"1\":\n a = int(q[1]) - 1\n b = q[2]\n for i in range(26):\n if B[i].el[a] == 1:\n B[i].add(a, -1)\n B[abc2[b]].add(a, 1)\n if q[0] == \"2\":\n a = int(q[1]) - 1\n b = int(q[2]) - 1\n res = 0\n for i in range(26):\n res += B[i].get(a, b + 1) > 0\n print(res)\n", "slow_code_sha256": "4fa4a65e4a0df3861053325cb01fa333b2482712b297bcf1214920d237936687", "slow_id": "p02763_f48f6f3e37812c17b5337b9141da770a977eb3ae11af352f28286963282fd6ed", "speedup": 5.263199599278967, "stratum": "4-8", "within_pair_jaccard": 0.2677165354330709, "workload": {"case_count": 100, "description": "Process Q ordered queries on a lowercase string S of length N. Query 1 i c replaces character i with c; query 2 l r reports the number of distinct letters in inclusive substring [l,r]. At least one type-2 query occurs. Observed inputs: N=1..500000 (median 500000); Q=1..20000 (median 20000); type1_count=0..19999; type2_count=1..20000; substring_length=1..500000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 815322, "median": 720014.0, "min": 12}, "input_format": ["N\nS\nQ\nQ query lines, each: 1 i c or 2 l r"], "input_format_status": "source_input_section", "input_lines": {"max": 20003, "median": 20003.0, "min": 4}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 60003, "median": 60003.0, "min": 6}}} -{"case_ids": ["p03338_case_000", "p03338_case_001", "p03338_case_002", "p03338_case_003", "p03338_case_004", "p03338_case_005", "p03338_case_006", "p03338_case_007", "p03338_case_008", "p03338_case_009", "p03338_case_010", "p03338_case_011", "p03338_case_012", "p03338_case_013", "p03338_case_014", "p03338_case_015", "p03338_case_016", "p03338_case_017", "p03338_case_018", "p03338_case_019", "p03338_case_020", "p03338_case_021", "p03338_case_022", "p03338_case_023", "p03338_case_024", "p03338_case_025", "p03338_case_026", "p03338_case_027", "p03338_case_028", "p03338_case_029", "p03338_case_030", "p03338_case_031", "p03338_case_032", "p03338_case_033", "p03338_case_034", "p03338_case_035", "p03338_case_036", "p03338_case_037", "p03338_case_038", "p03338_case_039", "p03338_case_040", "p03338_case_041", "p03338_case_042", "p03338_case_043", "p03338_case_044", "p03338_case_045", "p03338_case_046", "p03338_case_047", "p03338_case_048", "p03338_case_049", "p03338_case_050", "p03338_case_051", "p03338_case_052", "p03338_case_053", "p03338_case_054", "p03338_case_055", "p03338_case_056", "p03338_case_057", "p03338_case_058", "p03338_case_059", "p03338_case_060", "p03338_case_061", "p03338_case_062", "p03338_case_063", "p03338_case_064", "p03338_case_065", "p03338_case_066", "p03338_case_067", "p03338_case_068", "p03338_case_069", "p03338_case_070", "p03338_case_071", "p03338_case_072", "p03338_case_073", "p03338_case_074", "p03338_case_075", "p03338_case_076", "p03338_case_077", "p03338_case_078", "p03338_case_079", "p03338_case_080", "p03338_case_081", "p03338_case_082", "p03338_case_083", "p03338_case_084", "p03338_case_085", "p03338_case_086", "p03338_case_087", "p03338_case_088", "p03338_case_089", "p03338_case_090", "p03338_case_091", "p03338_case_092", "p03338_case_093", "p03338_case_094", "p03338_case_095", "p03338_case_096", "p03338_case_097", "p03338_case_098", "p03338_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from sys import stdin\n\n\ndef main():\n N = int(stdin.readline().rstrip())\n S = stdin.readline().rstrip()\n print((max([len(set(S[:i]) & set(S[i:])) for i in range(1, N)])))\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "7faee451372f9fc5e2175ab9caa2f28e2b3b9a04388971bf9ee54fea56cd61f1", "fast_id": "p03338_7faee451372f9fc5e2175ab9caa2f28e2b3b9a04388971bf9ee54fea56cd61f1", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from sys import stdin\n\n\ndef main():\n N = int(stdin.readline().rstrip())\n S = stdin.readline().rstrip()\n print((max([len(set(S[:i]) & set(S[i:])) for i in range(1, N)])))\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "7faee451372f9fc5e2175ab9caa2f28e2b3b9a04388971bf9ee54fea56cd61f1", "measured_slow_code": "import collections, sys\n\n\ndef S():\n return sys.stdin.readline().rstrip()\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\nN = I()\nS = S()\nans = 0\nfor i in range(N):\n set_top = set()\n set_bottom = set()\n for s in collections.Counter(S[:i]):\n set_top.add(s)\n for s in collections.Counter(S[i:]):\n set_bottom.add(s)\n ans = max(ans, len(set_top & set_bottom))\nprint(ans)\n", "measured_slow_code_sha256": "b26d7b127a5d896b500dc03a2fa751edc6fb5a11d0b4f6e5d93621ef3ac81957", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.167392996106995, "pair_id": "python_v2_116225e1343d4862dafadfa7", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03338", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03338_7faee451372f9fc5e2175ab9caa2f28e2b3b9a04388971bf9ee54fea56cd61f1.jsonl.gz", "inputs": "reproduction/python/inputs/p03338.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03338_b26d7b127a5d896b500dc03a2fa751edc6fb5a11d0b4f6e5d93621ef3ac81957.jsonl.gz"}, "slow_code": "import collections, sys\n\n\ndef S():\n return sys.stdin.readline().rstrip()\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\nN = I()\nS = S()\nans = 0\nfor i in range(N):\n set_top = set()\n set_bottom = set()\n for s in collections.Counter(S[:i]):\n set_top.add(s)\n for s in collections.Counter(S[i:]):\n set_bottom.add(s)\n ans = max(ans, len(set_top & set_bottom))\nprint(ans)\n", "slow_code_sha256": "b26d7b127a5d896b500dc03a2fa751edc6fb5a11d0b4f6e5d93621ef3ac81957", "slow_id": "p03338_b26d7b127a5d896b500dc03a2fa751edc6fb5a11d0b4f6e5d93621ef3ac81957", "speedup": 2.627393584115718, "stratum": "2-4", "within_pair_jaccard": 0.5151515151515151, "workload": {"case_count": 100, "description": "Cut lowercase string S into two nonempty contiguous parts. Maximize the number of distinct letters occurring in both parts. Observed inputs: N=2..100 (median 10); distinct_characters=1..26.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 105, "median": 14.0, "min": 5}, "input_format": ["N\nS"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p00008_case_000", "p00008_case_001", "p00008_case_002", "p00008_case_003", "p00008_case_004", "p00008_case_005", "p00008_case_006", "p00008_case_007", "p00008_case_008", "p00008_case_009", "p00008_case_010", "p00008_case_011", "p00008_case_012", "p00008_case_013", "p00008_case_014", "p00008_case_015", "p00008_case_016", "p00008_case_017", "p00008_case_018", "p00008_case_019", "p00008_case_020", "p00008_case_021", "p00008_case_022", "p00008_case_023", "p00008_case_024", "p00008_case_025", "p00008_case_026", "p00008_case_027", "p00008_case_028", "p00008_case_029", "p00008_case_030", "p00008_case_031", "p00008_case_032", "p00008_case_033", "p00008_case_034", "p00008_case_035", "p00008_case_036", "p00008_case_037", "p00008_case_038", "p00008_case_039", "p00008_case_040", "p00008_case_041", "p00008_case_042", "p00008_case_043", "p00008_case_044", "p00008_case_045", "p00008_case_046", "p00008_case_047", "p00008_case_048", "p00008_case_049", "p00008_case_050", "p00008_case_051", "p00008_case_052", "p00008_case_053", "p00008_case_054", "p00008_case_055", "p00008_case_056", "p00008_case_057", "p00008_case_058", "p00008_case_059", "p00008_case_060", "p00008_case_061", "p00008_case_062", "p00008_case_063", "p00008_case_064", "p00008_case_065", "p00008_case_066", "p00008_case_067", "p00008_case_068", "p00008_case_069", "p00008_case_070", "p00008_case_071", "p00008_case_072", "p00008_case_073", "p00008_case_074", "p00008_case_075", "p00008_case_076", "p00008_case_077", "p00008_case_078", "p00008_case_079", "p00008_case_080", "p00008_case_081", "p00008_case_082", "p00008_case_083", "p00008_case_084", "p00008_case_085", "p00008_case_086", "p00008_case_087", "p00008_case_088", "p00008_case_089", "p00008_case_090", "p00008_case_091", "p00008_case_092", "p00008_case_093", "p00008_case_094", "p00008_case_095", "p00008_case_096", "p00008_case_097", "p00008_case_098", "p00008_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\nimport math\n\n\ndef nCr(n, k):\n if 0 <= k <= n:\n nk, kk = 1, 1\n for t in range(1, min(k, n - k) + 1):\n nk = nk * n\n kk = kk * t\n n -= 1\n return nk // kk\n else:\n return 0\n\n\np = [0] * 51\nv = 0\nfor i in range(19):\n t = nCr(i + 3, i)\n v = v + 4 * nCr(i - 8, i - 10)\n p[i] = t - v\n p[36 - i] = p[i]\nfor i in sys.stdin:\n print((p[int(i)]))\n", "fast_code_sha256": "44be25f53df0ca596505e4d9b67f2cfd23a3c35d2b23c46b5226914d16aa5a4d", "fast_id": "p00008_44be25f53df0ca596505e4d9b67f2cfd23a3c35d2b23c46b5226914d16aa5a4d", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\nimport math\n\n\ndef nCr(n, k):\n if 0 <= k <= n:\n nk, kk = 1, 1\n for t in range(1, min(k, n - k) + 1):\n nk = nk * n\n kk = kk * t\n n -= 1\n return nk // kk\n else:\n return 0\n\n\np = [0] * 51\nv = 0\nfor i in range(19):\n t = nCr(i + 3, i)\n v = v + 4 * nCr(i - 8, i - 10)\n p[i] = t - v\n p[36 - i] = p[i]\nfor i in sys.stdin:\n print((p[int(i)]))\n", "measured_fast_code_sha256": "44be25f53df0ca596505e4d9b67f2cfd23a3c35d2b23c46b5226914d16aa5a4d", "measured_slow_code": "import sys\n\na = [0] * 51\nx = list(range(10))\nfor i in range(51):\n a[i] = sum([1 for p in x for q in x for r in x for s in x if p + q + r + s == i])\nfor e in sys.stdin:\n print((a[int(e)]))\n", "measured_slow_code_sha256": "6416a1af430d22e4317003c285ed4eeee1f686ff822437db32029df946b2fc8b", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 477.7806203346394, "pair_id": "python_v2_d9571caff9bab4b4f77559c2", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p00008", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p00008_44be25f53df0ca596505e4d9b67f2cfd23a3c35d2b23c46b5226914d16aa5a4d.jsonl.gz", "inputs": "reproduction/python/inputs/p00008.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p00008_6416a1af430d22e4317003c285ed4eeee1f686ff822437db32029df946b2fc8b.jsonl.gz"}, "slow_code": "import sys\n\na = [0] * 51\nx = list(range(10))\nfor i in range(51):\n a[i] = sum([1 for p in x for q in x for r in x for s in x if p + q + r + s == i])\nfor e in sys.stdin:\n print((a[int(e)]))\n", "slow_code_sha256": "6416a1af430d22e4317003c285ed4eeee1f686ff822437db32029df946b2fc8b", "slow_id": "p00008_6416a1af430d22e4317003c285ed4eeee1f686ff822437db32029df946b2fc8b", "speedup": 462.62022812239263, "stratum": "8+", "within_pair_jaccard": 0.375, "workload": {"case_count": 100, "description": "For each target n, count ordered quadruples of decimal digits a,b,c,d in 0..9 whose sum is n. Targets are given one per line until end of input. Observed inputs: datasets=1..50 (median 10); n=1..50.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 150, "median": 26.5, "min": 2}, "input_format": ["n_1\n...\nn_D (until EOF)"], "input_format_status": "source_input_section", "input_lines": {"max": 50, "median": 10.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 50, "median": 10.0, "min": 1}}} -{"case_ids": ["p03309_case_000", "p03309_case_001", "p03309_case_002", "p03309_case_003", "p03309_case_004", "p03309_case_005", "p03309_case_006", "p03309_case_007", "p03309_case_008", "p03309_case_009", "p03309_case_010", "p03309_case_011", "p03309_case_012", "p03309_case_013", "p03309_case_014", "p03309_case_015", "p03309_case_016", "p03309_case_017", "p03309_case_018", "p03309_case_019", "p03309_case_020", "p03309_case_021", "p03309_case_022", "p03309_case_023", "p03309_case_024", "p03309_case_025", "p03309_case_026", "p03309_case_027", "p03309_case_028", "p03309_case_029", "p03309_case_030", "p03309_case_031", "p03309_case_032", "p03309_case_033", "p03309_case_034", "p03309_case_035", "p03309_case_036", "p03309_case_037", "p03309_case_038", "p03309_case_039", "p03309_case_040", "p03309_case_041", "p03309_case_042", "p03309_case_043", "p03309_case_044", "p03309_case_045", "p03309_case_046", "p03309_case_047", "p03309_case_048", "p03309_case_049", "p03309_case_050", "p03309_case_051", "p03309_case_052", "p03309_case_053", "p03309_case_054", "p03309_case_055", "p03309_case_056", "p03309_case_057", "p03309_case_058", "p03309_case_059", "p03309_case_060", "p03309_case_061", "p03309_case_062", "p03309_case_063", "p03309_case_064", "p03309_case_065", "p03309_case_066", "p03309_case_067", "p03309_case_068", "p03309_case_069", "p03309_case_070", "p03309_case_071", "p03309_case_072", "p03309_case_073", "p03309_case_074", "p03309_case_075", "p03309_case_076", "p03309_case_077", "p03309_case_078", "p03309_case_079", "p03309_case_080", "p03309_case_081", "p03309_case_082", "p03309_case_083", "p03309_case_084", "p03309_case_085", "p03309_case_086", "p03309_case_087", "p03309_case_088", "p03309_case_089", "p03309_case_090", "p03309_case_091", "p03309_case_092", "p03309_case_093", "p03309_case_094", "p03309_case_095", "p03309_case_096", "p03309_case_097", "p03309_case_098", "p03309_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\na = list(map(int, input().split()))\narr = sorted([a[i] - i - 1 for i in range(n)])\nif len(arr) % 2 == 0:\n tmp = [arr[len(arr) // 2 - 1], arr[len(arr) // 2]]\nelse:\n tmp = [arr[len(arr) // 2]]\nans = 10**20\nfor b in tmp:\n ans = min(ans, sum([abs(a[i] - b - i - 1) for i in range(n)]))\nprint(ans)\n", "fast_code_sha256": "1e1c299b5e83115d9ac6c57448cb5f9bda4a67983b8a00d37f20ef3772178dab", "fast_id": "p03309_1e1c299b5e83115d9ac6c57448cb5f9bda4a67983b8a00d37f20ef3772178dab", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\na = list(map(int, input().split()))\narr = sorted([a[i] - i - 1 for i in range(n)])\nif len(arr) % 2 == 0:\n tmp = [arr[len(arr) // 2 - 1], arr[len(arr) // 2]]\nelse:\n tmp = [arr[len(arr) // 2]]\nans = 10**20\nfor b in tmp:\n ans = min(ans, sum([abs(a[i] - b - i - 1) for i in range(n)]))\nprint(ans)\n", "measured_fast_code_sha256": "1e1c299b5e83115d9ac6c57448cb5f9bda4a67983b8a00d37f20ef3772178dab", "measured_slow_code": "# -*- coding: utf-8 -*-\n# AtCoder Beginner Contest\nif __name__ == \"__main__\":\n from statistics import median\n\n n = int(eval(input()))\n a = list(map(int, input().split()))\n total = 0\n # See:\n # https://www.youtube.com/watch?v=UX4AuiCVtN4\n # https://beta.atcoder.jp/contests/abc102/submissions/2768315\n mod_a = sorted([ai - i for i, ai in enumerate(a, 1)])\n b = median(mod_a)\n for i in range(n):\n total += abs(mod_a[i] - b)\n print((int(total)))\n", "measured_slow_code_sha256": "cc6340aab617e7100bd4d51ff3921118d5d3dad1bda63cfcf3f2026a849def46", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.162958774291181, "pair_id": "python_v2_44c2a9eb8ed88b6125b6b10b", "per_case_slow_code_faster_fraction": 0.42, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03309", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03309_1e1c299b5e83115d9ac6c57448cb5f9bda4a67983b8a00d37f20ef3772178dab.jsonl.gz", "inputs": "reproduction/python/inputs/p03309.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03309_cc6340aab617e7100bd4d51ff3921118d5d3dad1bda63cfcf3f2026a849def46.jsonl.gz"}, "slow_code": "if __name__ == \"__main__\":\n from statistics import median\n\n n = int(eval(input()))\n a = list(map(int, input().split()))\n total = 0\n\n mod_a = sorted([ai - i for i, ai in enumerate(a, 1)])\n b = median(mod_a)\n for i in range(n):\n total += abs(mod_a[i] - b)\n print((int(total)))\n", "slow_code_sha256": "364f3596fd84d0acd37a6dd5d8da1a36ebb61efbb957346157757658db88473b", "slow_id": "p03309_cc6340aab617e7100bd4d51ff3921118d5d3dad1bda63cfcf3f2026a849def46", "speedup": 3.2116333863347455, "stratum": "2-4", "within_pair_jaccard": 0.48717948717948717, "workload": {"case_count": 100, "description": "Choose any integer b to minimize sum_i |A_i-(b+i)| for a sequence with positions indexed from 1 through N. Observed inputs: N=1..200000 (median 1000); A_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 2000226, "median": 9899.5, "min": 4}, "input_format": ["N\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200001, "median": 1001.0, "min": 2}}} -{"case_ids": ["p02657_case_000", "p02657_case_001", "p02657_case_002", "p02657_case_003", "p02657_case_004", "p02657_case_005", "p02657_case_006", "p02657_case_007", "p02657_case_008", "p02657_case_009", "p02657_case_010", "p02657_case_011", "p02657_case_012", "p02657_case_013", "p02657_case_014", "p02657_case_015", "p02657_case_016", "p02657_case_017", "p02657_case_018", "p02657_case_019", "p02657_case_020", "p02657_case_021", "p02657_case_022", "p02657_case_023", "p02657_case_024", "p02657_case_025", "p02657_case_026", "p02657_case_027", "p02657_case_028", "p02657_case_029", "p02657_case_030", "p02657_case_031", "p02657_case_032", "p02657_case_033", "p02657_case_034", "p02657_case_035", "p02657_case_036", "p02657_case_037", "p02657_case_038", "p02657_case_039", "p02657_case_040", "p02657_case_041", "p02657_case_042", "p02657_case_043", "p02657_case_044", "p02657_case_045", "p02657_case_046", "p02657_case_047", "p02657_case_048", "p02657_case_049", "p02657_case_050", "p02657_case_051", "p02657_case_052", "p02657_case_053", "p02657_case_054", "p02657_case_055", "p02657_case_056", "p02657_case_057", "p02657_case_058", "p02657_case_059", "p02657_case_060", "p02657_case_061", "p02657_case_062", "p02657_case_063", "p02657_case_064", "p02657_case_065", "p02657_case_066", "p02657_case_067", "p02657_case_068", "p02657_case_069", "p02657_case_070", "p02657_case_071", "p02657_case_072", "p02657_case_073", "p02657_case_074", "p02657_case_075", "p02657_case_076", "p02657_case_077", "p02657_case_078", "p02657_case_079", "p02657_case_080", "p02657_case_081", "p02657_case_082", "p02657_case_083", "p02657_case_084", "p02657_case_085", "p02657_case_086", "p02657_case_087", "p02657_case_088", "p02657_case_089", "p02657_case_090", "p02657_case_091", "p02657_case_092", "p02657_case_093", "p02657_case_094", "p02657_case_095", "p02657_case_096", "p02657_case_097", "p02657_case_098", "p02657_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "print((eval(input().replace(\" \", \"*\"))))\n", "fast_code_sha256": "3110d842874c6046e398970dba4b72c45d15cd4aacc9697a99da0418434cc31f", "fast_id": "p02657_3110d842874c6046e398970dba4b72c45d15cd4aacc9697a99da0418434cc31f", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "print((eval(input().replace(\" \", \"*\"))))\n", "measured_fast_code_sha256": "3110d842874c6046e398970dba4b72c45d15cd4aacc9697a99da0418434cc31f", "measured_slow_code": "a, b = list(map(float, input().split()))\nimport math\n\na = int(math.floor(a))\nb = int(math.floor(b * 100))\nc = math.floor(a * b / 100)\nprint(c)\n", "measured_slow_code_sha256": "b1697d82d892b2441ee34ccc53dde64479bc475c073927fdbb5370e4d2f6f2a7", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.2230708936267742, "pair_id": "python_v2_681cad52dc017088113f2c2d", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02657", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02657_3110d842874c6046e398970dba4b72c45d15cd4aacc9697a99da0418434cc31f.jsonl.gz", "inputs": "reproduction/python/inputs/p02657.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02657_b1697d82d892b2441ee34ccc53dde64479bc475c073927fdbb5370e4d2f6f2a7.jsonl.gz"}, "slow_code": "a, b = list(map(float, input().split()))\nimport math\n\na = int(math.floor(a))\nb = int(math.floor(b * 100))\nc = math.floor(a * b / 100)\nprint(c)\n", "slow_code_sha256": "b1697d82d892b2441ee34ccc53dde64479bc475c073927fdbb5370e4d2f6f2a7", "slow_id": "p02657_b1697d82d892b2441ee34ccc53dde64479bc475c073927fdbb5370e4d2f6f2a7", "speedup": 2.217937702208235, "stratum": "2-4", "within_pair_jaccard": 0.125, "workload": {"case_count": 100, "description": "Compute the product of the two integer inputs A and B. Observed inputs: A=1..100 (median 34); B=1..100 (median 47.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 8, "median": 6.0, "min": 4}, "input_format": ["A B"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p03013_case_000", "p03013_case_001", "p03013_case_002", "p03013_case_003", "p03013_case_004", "p03013_case_005", "p03013_case_006", "p03013_case_007", "p03013_case_008", "p03013_case_009", "p03013_case_010", "p03013_case_011", "p03013_case_012", "p03013_case_013", "p03013_case_014", "p03013_case_015", "p03013_case_016", "p03013_case_017", "p03013_case_018", "p03013_case_019", "p03013_case_020", "p03013_case_021", "p03013_case_022", "p03013_case_023", "p03013_case_024", "p03013_case_025", "p03013_case_026", "p03013_case_027", "p03013_case_028", "p03013_case_029", "p03013_case_030", "p03013_case_031", "p03013_case_032", "p03013_case_033", "p03013_case_034", "p03013_case_035", "p03013_case_036", "p03013_case_037", "p03013_case_038", "p03013_case_039", "p03013_case_040", "p03013_case_041", "p03013_case_042", "p03013_case_043", "p03013_case_044", "p03013_case_045", "p03013_case_046", "p03013_case_047", "p03013_case_048", "p03013_case_049", "p03013_case_050", "p03013_case_051", "p03013_case_052", "p03013_case_053", "p03013_case_054", "p03013_case_055", "p03013_case_056", "p03013_case_057", "p03013_case_058", "p03013_case_059", "p03013_case_060", "p03013_case_061", "p03013_case_062", "p03013_case_063", "p03013_case_064", "p03013_case_065", "p03013_case_066", "p03013_case_067", "p03013_case_068", "p03013_case_069", "p03013_case_070", "p03013_case_071", "p03013_case_072", "p03013_case_073", "p03013_case_074", "p03013_case_075", "p03013_case_076", "p03013_case_077", "p03013_case_078", "p03013_case_079", "p03013_case_080", "p03013_case_081", "p03013_case_082", "p03013_case_083", "p03013_case_084", "p03013_case_085", "p03013_case_086", "p03013_case_087", "p03013_case_088", "p03013_case_089", "p03013_case_090", "p03013_case_091", "p03013_case_092", "p03013_case_093", "p03013_case_094", "p03013_case_095", "p03013_case_096", "p03013_case_097", "p03013_case_098", "p03013_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\nN, M = list(map(int, input().split()))\nif M == 0:\n alist = set()\nelse:\n\n alist = set(map(int, sys.stdin))\ndp = [0] * (N + 1)\ndp[0] = 1\ndp[1] = 1 if 1 not in alist else 0\nMOD = 10**9 + 7\nfor i in range(2, N + 1):\n if i in alist:\n continue\n dp[i] = (dp[i - 1] + dp[i - 2]) % MOD\nprint((dp[N]))\n", "fast_code_sha256": "35dec6fc5770cf4d7b9621f258b5fe80dc7a1beb9ce612bddcc28ef1a07df64c", "fast_id": "p03013_caafad57c12dd7f73a70c01e6f3a04d5e61c35d2f6f40fac4b9d85d515329111", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\nN, M = list(map(int, input().split()))\nif M == 0:\n alist = set()\nelse:\n # Input below rows\n alist = set(map(int, sys.stdin))\ndp = [0] * (N + 1)\ndp[0] = 1\ndp[1] = 1 if 1 not in alist else 0\nMOD = 10**9 + 7\nfor i in range(2, N + 1):\n if i in alist:\n continue\n dp[i] = (dp[i - 1] + dp[i - 2]) % MOD\nprint((dp[N]))\n", "measured_fast_code_sha256": "caafad57c12dd7f73a70c01e6f3a04d5e61c35d2f6f40fac4b9d85d515329111", "measured_slow_code": "from collections import deque\n\nn, m = list(map(int, input().split()))\nA = {int(eval(input())) for _ in range(m)}\nL = deque([1, 1])\nif 1 in A:\n L[1] = 0\nfor i in range(2, n + 1):\n if i in A:\n L.append(0)\n else:\n L.append(L[i - 2] + L[i - 1])\nprint((L[n] % (10**9 + 7)))\n", "measured_slow_code_sha256": "fba7fd4fd7bcce245b2548eedc3c4dabf2df48bfb1eeabc7085ab383a30059bf", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 5.110044309817223, "pair_id": "python_v2_97f3afac99ca3e5be2fd4ff5", "per_case_slow_code_faster_fraction": 0.04, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03013", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03013_caafad57c12dd7f73a70c01e6f3a04d5e61c35d2f6f40fac4b9d85d515329111.jsonl.gz", "inputs": "reproduction/python/inputs/p03013.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03013_fba7fd4fd7bcce245b2548eedc3c4dabf2df48bfb1eeabc7085ab383a30059bf.jsonl.gz"}, "slow_code": "from collections import deque\n\nn, m = list(map(int, input().split()))\nA = {int(eval(input())) for _ in range(m)}\nL = deque([1, 1])\nif 1 in A:\n L[1] = 0\nfor i in range(2, n + 1):\n if i in A:\n L.append(0)\n else:\n L.append(L[i - 2] + L[i - 1])\nprint((L[n] % (10**9 + 7)))\n", "slow_code_sha256": "fba7fd4fd7bcce245b2548eedc3c4dabf2df48bfb1eeabc7085ab383a30059bf", "slow_id": "p03013_fba7fd4fd7bcce245b2548eedc3c4dabf2df48bfb1eeabc7085ab383a30059bf", "speedup": 4.916353833651196, "stratum": "4-8", "within_pair_jaccard": 0.48717948717948717, "workload": {"case_count": 100, "description": "Count ways to climb from step 0 to N using jumps of 1 or 2, never landing on the M listed broken steps. Broken indices are strictly increasing and lie in 1..N-1. Output modulo 1000000007. Observed inputs: N=1..100000 (median 100000); M=0..99999 (median 12345); a_i=1..99999.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 588901, "median": 72724.0, "min": 4}, "input_format": ["N M\na_1\n...\na_M"], "input_format_status": "source_input_section", "input_lines": {"max": 100000, "median": 12346.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100001, "median": 12347.0, "min": 2}}} -{"case_ids": ["p03837_case_000", "p03837_case_001", "p03837_case_002", "p03837_case_003", "p03837_case_004", "p03837_case_005", "p03837_case_006", "p03837_case_007", "p03837_case_008", "p03837_case_009", "p03837_case_010", "p03837_case_011", "p03837_case_012", "p03837_case_013", "p03837_case_014", "p03837_case_015", "p03837_case_016", "p03837_case_017", "p03837_case_018", "p03837_case_019", "p03837_case_020", "p03837_case_021", "p03837_case_022", "p03837_case_023", "p03837_case_024", "p03837_case_025", "p03837_case_026", "p03837_case_027", "p03837_case_028", "p03837_case_029", "p03837_case_030", "p03837_case_031", "p03837_case_032", "p03837_case_033", "p03837_case_034", "p03837_case_035", "p03837_case_036", "p03837_case_037", "p03837_case_038", "p03837_case_039", "p03837_case_040", "p03837_case_041", "p03837_case_042", "p03837_case_043", "p03837_case_044", "p03837_case_045", "p03837_case_046", "p03837_case_047", "p03837_case_048", "p03837_case_049", "p03837_case_050", "p03837_case_051", "p03837_case_052", "p03837_case_053", "p03837_case_054", "p03837_case_055", "p03837_case_056", "p03837_case_057", "p03837_case_058", "p03837_case_059", "p03837_case_060", "p03837_case_061", "p03837_case_062", "p03837_case_063", "p03837_case_064", "p03837_case_065", "p03837_case_066", "p03837_case_067", "p03837_case_068", "p03837_case_069", "p03837_case_070", "p03837_case_071", "p03837_case_072", "p03837_case_073", "p03837_case_074", "p03837_case_075", "p03837_case_076", "p03837_case_077", "p03837_case_078", "p03837_case_079", "p03837_case_080", "p03837_case_081", "p03837_case_082", "p03837_case_083", "p03837_case_084", "p03837_case_085", "p03837_case_086", "p03837_case_087", "p03837_case_088", "p03837_case_089", "p03837_case_090", "p03837_case_091", "p03837_case_092", "p03837_case_093", "p03837_case_094", "p03837_case_095", "p03837_case_096", "p03837_case_097", "p03837_case_098", "p03837_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import heapq\n\n\ndef dijkstra(n, s, g):\n h = [(0, s)]\n heapq.heapify(h)\n cost = [float(\"Inf\")] * (n + 1)\n cost[s] = 0\n while h:\n c, v = heapq.heappop(h)\n if c > cost[v]:\n continue\n for d, u in g[v]:\n d_s_u = d + cost[v]\n if d_s_u < cost[u]:\n cost[u] = d_s_u\n heapq.heappush(h, (d_s_u, u))\n return cost\n\n\ndef main():\n n, m, *abc = list(map(int, open(0).read().split()))\n g = [[] for _ in range(n + 1)]\n for a, b, c in zip(*[iter(abc)] * 3):\n g[a].append([c, b])\n g[b].append([c, a])\n ans = 0\n for i in range(1, n + 1):\n cost = dijkstra(n, i, g)\n for j, k in g[i]:\n if j > cost[k]:\n ans += 1\n print((ans // 2))\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "d0c4e7e224865469d566b5f1e77ae9e13e1cdb548f9945f3571452dec4ac2b97", "fast_id": "p03837_bfaa7c4e3f833fb371931ceb7666d3f78605c494974cf7d3720378a94fc04e13", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import heapq\n\n\ndef dijkstra(n, s, g):\n h = [(0, s)]\n heapq.heapify(h)\n cost = [float(\"Inf\")] * (n + 1) # cost: i -> j\n cost[s] = 0\n while h:\n c, v = heapq.heappop(h)\n if c > cost[v]:\n continue\n for d, u in g[v]:\n d_s_u = d + cost[v]\n if d_s_u < cost[u]:\n cost[u] = d_s_u\n heapq.heappush(h, (d_s_u, u))\n return cost\n\n\ndef main():\n n, m, *abc = list(map(int, open(0).read().split()))\n g = [[] for _ in range(n + 1)]\n for a, b, c in zip(*[iter(abc)] * 3):\n g[a].append([c, b])\n g[b].append([c, a])\n ans = 0\n for i in range(1, n + 1):\n cost = dijkstra(n, i, g)\n for j, k in g[i]:\n if j > cost[k]:\n ans += 1\n print((ans // 2))\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "bfaa7c4e3f833fb371931ceb7666d3f78605c494974cf7d3720378a94fc04e13", "measured_slow_code": "N, M = list(map(int, input().split()))\nINF = 10**6\nEdge = [[INF] * N for _ in range(N)]\nfor _ in range(M):\n a, b, c = list(map(int, input().split()))\n Edge[a - 1][b - 1] = c\n Edge[b - 1][a - 1] = c\ndp = [[INF] * N for _ in range(N)]\nfor i in range(N):\n for j in range(N):\n if i == j:\n dp[i][j] = 0\n else:\n dp[i][j] = Edge[i][j]\nfor k in range(N):\n for i in range(N):\n for j in range(N):\n dp[i][j] = min(dp[i][j], dp[i][k] + dp[k][j])\nans = 0\nfor i in range(N - 1):\n for j in range(i + 1, N):\n if Edge[i][j] == INF:\n continue\n if Edge[i][j] > dp[i][j]:\n ans += 1\nprint(ans)\n", "measured_slow_code_sha256": "3c9300b9a4c69f0f745cb1f931af4a418f91d55bb6258d4a916721677ca14aed", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 9.837081645041682, "pair_id": "python_v2_d481f0ba21e372ea266b1399", "per_case_slow_code_faster_fraction": 0.09, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03837", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03837_bfaa7c4e3f833fb371931ceb7666d3f78605c494974cf7d3720378a94fc04e13.jsonl.gz", "inputs": "reproduction/python/inputs/p03837.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03837_3c9300b9a4c69f0f745cb1f931af4a418f91d55bb6258d4a916721677ca14aed.jsonl.gz"}, "slow_code": "N, M = list(map(int, input().split()))\nINF = 10**6\nEdge = [[INF] * N for _ in range(N)]\nfor _ in range(M):\n a, b, c = list(map(int, input().split()))\n Edge[a - 1][b - 1] = c\n Edge[b - 1][a - 1] = c\ndp = [[INF] * N for _ in range(N)]\nfor i in range(N):\n for j in range(N):\n if i == j:\n dp[i][j] = 0\n else:\n dp[i][j] = Edge[i][j]\nfor k in range(N):\n for i in range(N):\n for j in range(N):\n dp[i][j] = min(dp[i][j], dp[i][k] + dp[k][j])\nans = 0\nfor i in range(N - 1):\n for j in range(i + 1, N):\n if Edge[i][j] == INF:\n continue\n if Edge[i][j] > dp[i][j]:\n ans += 1\nprint(ans)\n", "slow_code_sha256": "3c9300b9a4c69f0f745cb1f931af4a418f91d55bb6258d4a916721677ca14aed", "slow_id": "p03837_3c9300b9a4c69f0f745cb1f931af4a418f91d55bb6258d4a916721677ca14aed", "speedup": 6.4174475099144, "stratum": "4-8", "within_pair_jaccard": 0.32786885245901637, "workload": {"case_count": 100, "description": "In a connected simple undirected weighted graph with positive weights c_i, count edges that occur in no shortest path between any pair of distinct vertices. Endpoints are 1-based and may be listed in either order. Observed inputs: N=2..100 (median 30); M=1..1000 (median 55); c_i=1..1000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 10569, "median": 461.0, "min": 10}, "input_format": ["N M\na_1 b_1 c_1\n...\na_M b_M c_M"], "input_format_status": "source_input_section", "input_lines": {"max": 1001, "median": 56.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3002, "median": 167.0, "min": 5}}} -{"case_ids": ["p02780_case_000", "p02780_case_001", "p02780_case_002", "p02780_case_003", "p02780_case_004", "p02780_case_005", "p02780_case_006", "p02780_case_007", "p02780_case_008", "p02780_case_009", "p02780_case_010", "p02780_case_011", "p02780_case_012", "p02780_case_013", "p02780_case_014", "p02780_case_015", "p02780_case_016", "p02780_case_017", "p02780_case_018", "p02780_case_019", "p02780_case_020", "p02780_case_021", "p02780_case_022", "p02780_case_023", "p02780_case_024", "p02780_case_025", "p02780_case_026", "p02780_case_027", "p02780_case_028", "p02780_case_029", "p02780_case_030", "p02780_case_031", "p02780_case_032", "p02780_case_033", "p02780_case_034", "p02780_case_035", "p02780_case_036", "p02780_case_037", "p02780_case_038", "p02780_case_039", "p02780_case_040", "p02780_case_041", "p02780_case_042", "p02780_case_043", "p02780_case_044", "p02780_case_045", "p02780_case_046", "p02780_case_047", "p02780_case_048", "p02780_case_049", "p02780_case_050", "p02780_case_051", "p02780_case_052", "p02780_case_053", "p02780_case_054", "p02780_case_055", "p02780_case_056", "p02780_case_057", "p02780_case_058", "p02780_case_059", "p02780_case_060", "p02780_case_061", "p02780_case_062", "p02780_case_063", "p02780_case_064", "p02780_case_065", "p02780_case_066", "p02780_case_067", "p02780_case_068", "p02780_case_069", "p02780_case_070", "p02780_case_071", "p02780_case_072", "p02780_case_073", "p02780_case_074", "p02780_case_075", "p02780_case_076", "p02780_case_077", "p02780_case_078", "p02780_case_079", "p02780_case_080", "p02780_case_081", "p02780_case_082", "p02780_case_083", "p02780_case_084", "p02780_case_085", "p02780_case_086", "p02780_case_087", "p02780_case_088", "p02780_case_089", "p02780_case_090", "p02780_case_091", "p02780_case_092", "p02780_case_093", "p02780_case_094", "p02780_case_095", "p02780_case_096", "p02780_case_097", "p02780_case_098", "p02780_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "num, renzoku = list(map(int, input().split()))\ndices = list(map(int, input().split()))\nexpects = [0] * num\nSi = [0] * (num + 1)\nfor i in range(1, num + 1):\n Si[i] = Si[i - 1] + (1 + dices[i - 1]) / 2\nmax_Si = 0\nfor i in range(0, num - renzoku + 1):\n if max_Si < Si[i + renzoku] - Si[i]:\n max_Si = Si[i + renzoku] - Si[i]\nprint(max_Si)\n", "fast_code_sha256": "9e97a885a3151e1f277d4e510ef95bf065171b3c7368db0ee81b2fa5692ec1c2", "fast_id": "p02780_9e97a885a3151e1f277d4e510ef95bf065171b3c7368db0ee81b2fa5692ec1c2", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "num, renzoku = list(map(int, input().split()))\ndices = list(map(int, input().split()))\nexpects = [0] * num\nSi = [0] * (num + 1)\nfor i in range(1, num + 1):\n Si[i] = Si[i - 1] + (1 + dices[i - 1]) / 2\nmax_Si = 0\nfor i in range(0, num - renzoku + 1):\n if max_Si < Si[i + renzoku] - Si[i]:\n max_Si = Si[i + renzoku] - Si[i]\nprint(max_Si)\n", "measured_fast_code_sha256": "9e97a885a3151e1f277d4e510ef95bf065171b3c7368db0ee81b2fa5692ec1c2", "measured_slow_code": "class BIT:\n def __init__(self, n):\n self.node = [0 for _ in range(n + 1)]\n\n def add(self, idx, w):\n i = idx\n while i < len(self.node) - 1:\n self.node[i] += w\n i |= i + 1\n\n def sum_(self, idx):\n ret, i = 0, idx - 1\n while i >= 0:\n ret += self.node[i]\n i = (i & (i + 1)) - 1\n return ret\n\n def sum(self, l, r):\n return self.sum_(r) - self.sum_(l)\n\n\nn, k = list(map(int, input().split()))\ntree = BIT(n)\np = [int(x) for x in input().split()]\nfor i in range(n):\n tree.add(i, (1 + p[i]) / 2)\nans = 0\nfor i in range(n - k + 1):\n ans = max(ans, tree.sum(i, i + k))\nprint(ans)\n", "measured_slow_code_sha256": "f0e0a2a27a21da5cf3bfa118c0651e9d7851f3f79494b7c4374dbb95d552c6f4", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 5.245638415451955, "pair_id": "python_v2_1d878fe339e61d95a455acd0", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02780", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02780_9e97a885a3151e1f277d4e510ef95bf065171b3c7368db0ee81b2fa5692ec1c2.jsonl.gz", "inputs": "reproduction/python/inputs/p02780.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02780_f0e0a2a27a21da5cf3bfa118c0651e9d7851f3f79494b7c4374dbb95d552c6f4.jsonl.gz"}, "slow_code": "class BIT:\n def __init__(self, n):\n self.node = [0 for _ in range(n + 1)]\n\n def add(self, idx, w):\n i = idx\n while i < len(self.node) - 1:\n self.node[i] += w\n i |= i + 1\n\n def sum_(self, idx):\n ret, i = 0, idx - 1\n while i >= 0:\n ret += self.node[i]\n i = (i & (i + 1)) - 1\n return ret\n\n def sum(self, l, r):\n return self.sum_(r) - self.sum_(l)\n\n\nn, k = list(map(int, input().split()))\ntree = BIT(n)\np = [int(x) for x in input().split()]\nfor i in range(n):\n tree.add(i, (1 + p[i]) / 2)\nans = 0\nfor i in range(n - k + 1):\n ans = max(ans, tree.sum(i, i + k))\nprint(ans)\n", "slow_code_sha256": "f0e0a2a27a21da5cf3bfa118c0651e9d7851f3f79494b7c4374dbb95d552c6f4", "slow_id": "p02780_f0e0a2a27a21da5cf3bfa118c0651e9d7851f3f79494b7c4374dbb95d552c6f4", "speedup": 4.183799441797468, "stratum": "4-8", "within_pair_jaccard": 0.28888888888888886, "workload": {"case_count": 100, "description": "Die i independently yields an integer uniformly from 1 to p_i. Choose K consecutive dice among N to maximize the expected sum of the rolls. Observed inputs: N=1..200000 (median 1000); K=1..200000 (median 5); p_i=1..1000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1000014, "median": 3877.5, "min": 8}, "input_format": ["N K\np_1 ... p_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200002, "median": 1002.0, "min": 3}}} -{"case_ids": ["p02706_case_000", "p02706_case_001", "p02706_case_002", "p02706_case_003", "p02706_case_004", "p02706_case_005", "p02706_case_006", "p02706_case_007", "p02706_case_008", "p02706_case_009", "p02706_case_010", "p02706_case_011", "p02706_case_012", "p02706_case_013", "p02706_case_014", "p02706_case_015", "p02706_case_016", "p02706_case_017", "p02706_case_018", "p02706_case_019", "p02706_case_020", "p02706_case_021", "p02706_case_022", "p02706_case_023", "p02706_case_024", "p02706_case_025", "p02706_case_026", "p02706_case_027", "p02706_case_028", "p02706_case_029", "p02706_case_030", "p02706_case_031", "p02706_case_032", "p02706_case_033", "p02706_case_034", "p02706_case_035", "p02706_case_036", "p02706_case_037", "p02706_case_038", "p02706_case_039", "p02706_case_040", "p02706_case_041", "p02706_case_042", "p02706_case_043", "p02706_case_044", "p02706_case_045", "p02706_case_046", "p02706_case_047", "p02706_case_048", "p02706_case_049", "p02706_case_050", "p02706_case_051", "p02706_case_052", "p02706_case_053", "p02706_case_054", "p02706_case_055", "p02706_case_056", "p02706_case_057", "p02706_case_058", "p02706_case_059", "p02706_case_060", "p02706_case_061", "p02706_case_062", "p02706_case_063", "p02706_case_064", "p02706_case_065", "p02706_case_066", "p02706_case_067", "p02706_case_068", "p02706_case_069", "p02706_case_070", "p02706_case_071", "p02706_case_072", "p02706_case_073", "p02706_case_074", "p02706_case_075", "p02706_case_076", "p02706_case_077", "p02706_case_078", "p02706_case_079", "p02706_case_080", "p02706_case_081", "p02706_case_082", "p02706_case_083", "p02706_case_084", "p02706_case_085", "p02706_case_086", "p02706_case_087", "p02706_case_088", "p02706_case_089", "p02706_case_090", "p02706_case_091", "p02706_case_092", "p02706_case_093", "p02706_case_094", "p02706_case_095", "p02706_case_096", "p02706_case_097", "p02706_case_098", "p02706_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N, M = list(map(int, input().split()))\nA = list(map(int, input().split()))\nB = sum(A)\nif B > N:\n ans = -1\nelse:\n ans = N - B\nprint(ans)\n", "fast_code_sha256": "8cc82661a1a80fbe55107ea6afa3b838b5aa8ccf9e2d1ce5e9e001f2aa533ccb", "fast_id": "p02706_8cc82661a1a80fbe55107ea6afa3b838b5aa8ccf9e2d1ce5e9e001f2aa533ccb", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N, M = list(map(int, input().split()))\nA = list(map(int, input().split()))\nB = sum(A)\nif B > N:\n ans = -1\nelse:\n ans = N - B\nprint(ans)\n", "measured_fast_code_sha256": "8cc82661a1a80fbe55107ea6afa3b838b5aa8ccf9e2d1ce5e9e001f2aa533ccb", "measured_slow_code": "import numpy as np\nimport math\n\nn, m = list(map(int, input().split()))\nA = list(map(int, input().split()))\na = sum(A)\nif n < a:\n print((-1))\nelse:\n print((n - a))\n", "measured_slow_code_sha256": "89bf5646ac16bde646209d2509249ed7377541f5a03b9f9c5553553af3b07c63", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 59.65281501441454, "pair_id": "python_v2_9b051760d5e94ca8141e1d75", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02706", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02706_8cc82661a1a80fbe55107ea6afa3b838b5aa8ccf9e2d1ce5e9e001f2aa533ccb.jsonl.gz", "inputs": "reproduction/python/inputs/p02706.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02706_89bf5646ac16bde646209d2509249ed7377541f5a03b9f9c5553553af3b07c63.jsonl.gz"}, "slow_code": "import numpy as np\nimport math\n\nn, m = list(map(int, input().split()))\nA = list(map(int, input().split()))\na = sum(A)\nif n < a:\n print((-1))\nelse:\n print((n - a))\n", "slow_code_sha256": "89bf5646ac16bde646209d2509249ed7377541f5a03b9f9c5553553af3b07c63", "slow_id": "p02706_89bf5646ac16bde646209d2509249ed7377541f5a03b9f9c5553553af3b07c63", "speedup": 165.87788884787804, "stratum": "8+", "within_pair_jaccard": 0.4782608695652174, "workload": {"case_count": 100, "description": "During N vacation days, complete M assignments requiring A_i days each, with no simultaneous assignments. Maximize days left free, or report -1 if all assignments cannot fit. Observed inputs: N=1..1000000 (median 1000); M=1..10000 (median 6445); A_i=1..10000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 60014, "median": 15213.0, "min": 6}, "input_format": ["N M\nA_1 ... A_M"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 10002, "median": 6447.0, "min": 3}}} -{"case_ids": ["p02607_case_000", "p02607_case_001", "p02607_case_002", "p02607_case_003", "p02607_case_004", "p02607_case_005", "p02607_case_006", "p02607_case_007", "p02607_case_008", "p02607_case_009", "p02607_case_010", "p02607_case_011", "p02607_case_012", "p02607_case_013", "p02607_case_014", "p02607_case_015", "p02607_case_016", "p02607_case_017", "p02607_case_018", "p02607_case_019", "p02607_case_020", "p02607_case_021", "p02607_case_022", "p02607_case_023", "p02607_case_024", "p02607_case_025", "p02607_case_026", "p02607_case_027", "p02607_case_028", "p02607_case_029", "p02607_case_030", "p02607_case_031", "p02607_case_032", "p02607_case_033", "p02607_case_034", "p02607_case_035", "p02607_case_036", "p02607_case_037", "p02607_case_038", "p02607_case_039", "p02607_case_040", "p02607_case_041", "p02607_case_042", "p02607_case_043", "p02607_case_044", "p02607_case_045", "p02607_case_046", "p02607_case_047", "p02607_case_048", "p02607_case_049", "p02607_case_050", "p02607_case_051", "p02607_case_052", "p02607_case_053", "p02607_case_054", "p02607_case_055", "p02607_case_056", "p02607_case_057", "p02607_case_058", "p02607_case_059", "p02607_case_060", "p02607_case_061", "p02607_case_062", "p02607_case_063", "p02607_case_064", "p02607_case_065", "p02607_case_066", "p02607_case_067", "p02607_case_068", "p02607_case_069", "p02607_case_070", "p02607_case_071", "p02607_case_072", "p02607_case_073", "p02607_case_074", "p02607_case_075", "p02607_case_076", "p02607_case_077", "p02607_case_078", "p02607_case_079", "p02607_case_080", "p02607_case_081", "p02607_case_082", "p02607_case_083", "p02607_case_084", "p02607_case_085", "p02607_case_086", "p02607_case_087", "p02607_case_088", "p02607_case_089", "p02607_case_090", "p02607_case_091", "p02607_case_092", "p02607_case_093", "p02607_case_094", "p02607_case_095", "p02607_case_096", "p02607_case_097", "p02607_case_098", "p02607_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "eval(input())\nprint(\n (\n len(\n [\n i\n for n, i in enumerate(map(int, input().split()), 1)\n if i % 2 == 1 and n % 2\n ]\n )\n )\n)\n", "fast_code_sha256": "425ddb17dce624add9e7f091087552cb6b7a49b0d598f13282350396fcff2a4c", "fast_id": "p02607_425ddb17dce624add9e7f091087552cb6b7a49b0d598f13282350396fcff2a4c", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "eval(input())\nprint(\n (\n len(\n [\n i\n for n, i in enumerate(map(int, input().split()), 1)\n if i % 2 == 1 and n % 2\n ]\n )\n )\n)\n", "measured_fast_code_sha256": "425ddb17dce624add9e7f091087552cb6b7a49b0d598f13282350396fcff2a4c", "measured_slow_code": "import sys\nfrom collections import deque\nimport numpy as np\nimport math\n\nsys.setrecursionlimit(10**6)\n\n\ndef S():\n return sys.stdin.readline().rstrip()\n\n\ndef SL():\n return list(map(str, sys.stdin.readline().rstrip().split()))\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\ndef IL():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef Main():\n n = I()\n a = list(IL())\n c = 0\n for rep in range(0, n, 2):\n if a[rep] % 2:\n c += 1\n print(c)\n return\n\n\nif __name__ == \"__main__\":\n Main()\n", "measured_slow_code_sha256": "80d5226038bdb32cf21a0b535cbd1c7092e4e8009586ccf346a6a6f305bc5b7d", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1204.3688009318607, "pair_id": "python_v2_6f60f367565c31b5e3b7fb5f", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02607", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02607_425ddb17dce624add9e7f091087552cb6b7a49b0d598f13282350396fcff2a4c.jsonl.gz", "inputs": "reproduction/python/inputs/p02607.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02607_80d5226038bdb32cf21a0b535cbd1c7092e4e8009586ccf346a6a6f305bc5b7d.jsonl.gz"}, "slow_code": "import sys\nfrom collections import deque\nimport numpy as np\nimport math\n\nsys.setrecursionlimit(10**6)\n\n\ndef S():\n return sys.stdin.readline().rstrip()\n\n\ndef SL():\n return list(map(str, sys.stdin.readline().rstrip().split()))\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\ndef IL():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef Main():\n n = I()\n a = list(IL())\n c = 0\n for rep in range(0, n, 2):\n if a[rep] % 2:\n c += 1\n print(c)\n return\n\n\nif __name__ == \"__main__\":\n Main()\n", "slow_code_sha256": "80d5226038bdb32cf21a0b535cbd1c7092e4e8009586ccf346a6a6f305bc5b7d", "slow_id": "p02607_80d5226038bdb32cf21a0b535cbd1c7092e4e8009586ccf346a6a6f305bc5b7d", "speedup": 1106.55256875361, "stratum": "8+", "within_pair_jaccard": 0.2127659574468085, "workload": {"case_count": 100, "description": "Count array entries for which both the 1-based position i and the integer value a_i are odd. Observed inputs: N=1..100 (median 30); a_i=1..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 300, "median": 67.5, "min": 4}, "input_format": ["N\na_1 ... a_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 101, "median": 31.0, "min": 2}}} -{"case_ids": ["p02406_case_000", "p02406_case_001", "p02406_case_002", "p02406_case_003", "p02406_case_004", "p02406_case_005", "p02406_case_006", "p02406_case_007", "p02406_case_008", "p02406_case_009", "p02406_case_010", "p02406_case_011", "p02406_case_012", "p02406_case_013", "p02406_case_014", "p02406_case_015", "p02406_case_016", "p02406_case_017", "p02406_case_018", "p02406_case_019", "p02406_case_020", "p02406_case_021", "p02406_case_022", "p02406_case_023", "p02406_case_024", "p02406_case_025", "p02406_case_026", "p02406_case_027", "p02406_case_028", "p02406_case_029", "p02406_case_030", "p02406_case_031", "p02406_case_032", "p02406_case_033", "p02406_case_034", "p02406_case_035", "p02406_case_036", "p02406_case_037", "p02406_case_038", "p02406_case_039", "p02406_case_040", "p02406_case_041", "p02406_case_042", "p02406_case_043", "p02406_case_044", "p02406_case_045", "p02406_case_046", "p02406_case_047", "p02406_case_048", "p02406_case_049", "p02406_case_050", "p02406_case_051", "p02406_case_052", "p02406_case_053", "p02406_case_054", "p02406_case_055", "p02406_case_056", "p02406_case_057", "p02406_case_058", "p02406_case_059", "p02406_case_060", "p02406_case_061", "p02406_case_062", "p02406_case_063", "p02406_case_064", "p02406_case_065", "p02406_case_066", "p02406_case_067", "p02406_case_068", "p02406_case_069", "p02406_case_070", "p02406_case_071", "p02406_case_072", "p02406_case_073", "p02406_case_074", "p02406_case_075", "p02406_case_076", "p02406_case_077", "p02406_case_078", "p02406_case_079", "p02406_case_080", "p02406_case_081", "p02406_case_082", "p02406_case_083", "p02406_case_084", "p02406_case_085", "p02406_case_086", "p02406_case_087", "p02406_case_088", "p02406_case_089", "p02406_case_090", "p02406_case_091", "p02406_case_092", "p02406_case_093", "p02406_case_094", "p02406_case_095", "p02406_case_096", "p02406_case_097", "p02406_case_098", "p02406_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "print(\n \"\".join(\n \" \" + str(i) for i in range(1, eval(input()) + 1) if i % 3 == 0 or \"3\" in str(i)\n )\n)\n", "fast_code_sha256": "44ab35a9714ea188a11aedb20f3ea7103bd930af4ad186337881b8ed88a0b55b", "fast_id": "p02406_44ab35a9714ea188a11aedb20f3ea7103bd930af4ad186337881b8ed88a0b55b", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "print(\n \"\".join(\n \" \" + str(i) for i in range(1, eval(input()) + 1) if i % 3 == 0 or \"3\" in str(i)\n )\n)\n", "measured_fast_code_sha256": "44ab35a9714ea188a11aedb20f3ea7103bd930af4ad186337881b8ed88a0b55b", "measured_slow_code": "array = []\nfor i in range(3, int(input()) + 1):\n if i % 3 == 0 or i % 10 == 3 or \"3\" in str(i):\n array.append(i)\nfor i in array:\n print(\"\", \"{0}\".format(i), end=\"\")\nprint()\n", "measured_slow_code_sha256": "fd343debd525e0327e380afaeaedff81a92351905528d5f013d2dcc0e4ab0798", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.3111637644646317, "pair_id": "python_v2_f697da973fb1aab53c09d950", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02406", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02406_44ab35a9714ea188a11aedb20f3ea7103bd930af4ad186337881b8ed88a0b55b.jsonl.gz", "inputs": "reproduction/python/inputs/p02406.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02406_fd343debd525e0327e380afaeaedff81a92351905528d5f013d2dcc0e4ab0798.jsonl.gz"}, "slow_code": "array = []\nfor i in range(3, int(input()) + 1):\n if i % 3 == 0 or i % 10 == 3 or \"3\" in str(i):\n array.append(i)\nfor i in array:\n print(\"\", \"{0}\".format(i), end=\"\")\nprint()\n", "slow_code_sha256": "fd343debd525e0327e380afaeaedff81a92351905528d5f013d2dcc0e4ab0798", "slow_id": "p02406_fd343debd525e0327e380afaeaedff81a92351905528d5f013d2dcc0e4ab0798", "speedup": 2.1824637138348453, "stratum": "2-4", "within_pair_jaccard": 0.6, "workload": {"case_count": 100, "description": "Print in ascending order the integers from 1 through n that are divisible by 3 or have a decimal digit 3. A qualifying integer is printed once even if both conditions hold. Observed inputs: n=3..10000 (median 5211).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 6, "median": 5.0, "min": 2}, "input_format": ["n"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p03803_case_000", "p03803_case_001", "p03803_case_002", "p03803_case_003", "p03803_case_004", "p03803_case_005", "p03803_case_006", "p03803_case_007", "p03803_case_008", "p03803_case_009", "p03803_case_010", "p03803_case_011", "p03803_case_012", "p03803_case_013", "p03803_case_014", "p03803_case_015", "p03803_case_016", "p03803_case_017", "p03803_case_018", "p03803_case_019", "p03803_case_020", "p03803_case_021", "p03803_case_022", "p03803_case_023", "p03803_case_024", "p03803_case_025", "p03803_case_026", "p03803_case_027", "p03803_case_028", "p03803_case_029", "p03803_case_030", "p03803_case_031", "p03803_case_032", "p03803_case_033", "p03803_case_034", "p03803_case_035", "p03803_case_036", "p03803_case_037", "p03803_case_038", "p03803_case_039", "p03803_case_040", "p03803_case_041", "p03803_case_042", "p03803_case_043", "p03803_case_044", "p03803_case_045", "p03803_case_046", "p03803_case_047", "p03803_case_048", "p03803_case_049", "p03803_case_050", "p03803_case_051", "p03803_case_052", "p03803_case_053", "p03803_case_054", "p03803_case_055", "p03803_case_056", "p03803_case_057", "p03803_case_058", "p03803_case_059", "p03803_case_060", "p03803_case_061", "p03803_case_062", "p03803_case_063", "p03803_case_064", "p03803_case_065", "p03803_case_066", "p03803_case_067", "p03803_case_068", "p03803_case_069", "p03803_case_070", "p03803_case_071", "p03803_case_072", "p03803_case_073", "p03803_case_074", "p03803_case_075", "p03803_case_076", "p03803_case_077", "p03803_case_078", "p03803_case_079", "p03803_case_080", "p03803_case_081", "p03803_case_082", "p03803_case_083", "p03803_case_084", "p03803_case_085", "p03803_case_086", "p03803_case_087", "p03803_case_088", "p03803_case_089", "p03803_case_090", "p03803_case_091", "p03803_case_092", "p03803_case_093", "p03803_case_094", "p03803_case_095", "p03803_case_096", "p03803_case_097", "p03803_case_098", "p03803_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "a, b = list(map(int, input().split()))\nif a == 1:\n a = 14\nif b == 1:\n b = 14\nif a > b:\n print(\"Alice\")\nelif a < b:\n print(\"Bob\")\nelse:\n print(\"Draw\")\n", "fast_code_sha256": "4c6ef45179d2198271056f1187a876e01917846e39fdef81f076ed8950b753bd", "fast_id": "p03803_a978406fdaa941ebe2e130dced2f5ebaa3d4cfaac09baba490095e47f06341c6", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "# k = int(input())\n# s = input()\n# a, b = map(int, input().split())\n# s, t = map(str, input().split())\n# l = list(map(int, input().split()))\n# l = [list(map(int,input().split())) for i in range(n)]\na, b = list(map(int, input().split()))\nif a == 1:\n a = 14\nif b == 1:\n b = 14\nif a > b:\n print(\"Alice\")\nelif a < b:\n print(\"Bob\")\nelse:\n print(\"Draw\")\n", "measured_fast_code_sha256": "a978406fdaa941ebe2e130dced2f5ebaa3d4cfaac09baba490095e47f06341c6", "measured_slow_code": "import sys, math\nfrom functools import lru_cache\nfrom itertools import accumulate\n\nsys.setrecursionlimit(10**9)\nMOD = 10**9 + 7\n\n\ndef input():\n return sys.stdin.readline()[:-1]\n\n\ndef mi():\n return list(map(int, input().split()))\n\n\ndef ii():\n return int(eval(input()))\n\n\ndef i2(n):\n tmp = [list(mi()) for i in range(n)]\n return [list(i) for i in zip(*tmp)]\n\n\nA, B = mi()\nif A == B:\n print(\"Draw\")\nelif A == 1:\n print(\"Alice\")\nelif B == 1:\n print(\"Bob\")\nelse:\n if A > B:\n print(\"Alice\")\n else:\n print(\"Bob\")\n", "measured_slow_code_sha256": "0bd5df2a157ba82c7c25ec618ddd2b8ac3a7b93747b5c4b4114a2cd42e8e257e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.763457394234183, "pair_id": "python_v2_1d4f65011365065c28fef3ae", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03803", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03803_a978406fdaa941ebe2e130dced2f5ebaa3d4cfaac09baba490095e47f06341c6.jsonl.gz", "inputs": "reproduction/python/inputs/p03803.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03803_0bd5df2a157ba82c7c25ec618ddd2b8ac3a7b93747b5c4b4114a2cd42e8e257e.jsonl.gz"}, "slow_code": "import sys, math\nfrom functools import lru_cache\nfrom itertools import accumulate\n\nsys.setrecursionlimit(10**9)\nMOD = 10**9 + 7\n\n\ndef input():\n return sys.stdin.readline()[:-1]\n\n\ndef mi():\n return list(map(int, input().split()))\n\n\ndef ii():\n return int(eval(input()))\n\n\ndef i2(n):\n tmp = [list(mi()) for i in range(n)]\n return [list(i) for i in zip(*tmp)]\n\n\nA, B = mi()\nif A == B:\n print(\"Draw\")\nelif A == 1:\n print(\"Alice\")\nelif B == 1:\n print(\"Bob\")\nelse:\n if A > B:\n print(\"Alice\")\n else:\n print(\"Bob\")\n", "slow_code_sha256": "0bd5df2a157ba82c7c25ec618ddd2b8ac3a7b93747b5c4b4114a2cd42e8e257e", "slow_id": "p03803_0bd5df2a157ba82c7c25ec618ddd2b8ac3a7b93747b5c4b4114a2cd42e8e257e", "speedup": 2.763969495713933, "stratum": "2-4", "within_pair_jaccard": 0.2826086956521739, "workload": {"case_count": 100, "description": "Compare two card ranks A,B from 1..13. Rank 1 is strongest; the other ranks increase in strength from 2 through 13. Report the first player, second player, or a draw. Observed inputs: A=1..13 (median 6); B=1..13 (median 6.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 6, "median": 4.0, "min": 4}, "input_format": ["A B"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p03608_case_000", "p03608_case_001", "p03608_case_002", "p03608_case_003", "p03608_case_004", "p03608_case_005", "p03608_case_006", "p03608_case_007", "p03608_case_008", "p03608_case_009", "p03608_case_010", "p03608_case_011", "p03608_case_012", "p03608_case_013", "p03608_case_014", "p03608_case_015", "p03608_case_016", "p03608_case_017", "p03608_case_018", "p03608_case_019", "p03608_case_020", "p03608_case_021", "p03608_case_022", "p03608_case_023", "p03608_case_024", "p03608_case_025", "p03608_case_026", "p03608_case_027", "p03608_case_028", "p03608_case_029", "p03608_case_030", "p03608_case_031", "p03608_case_032", "p03608_case_033", "p03608_case_034", "p03608_case_035", "p03608_case_036", "p03608_case_037", "p03608_case_038", "p03608_case_039", "p03608_case_040", "p03608_case_041", "p03608_case_042", "p03608_case_043", "p03608_case_044", "p03608_case_045", "p03608_case_046", "p03608_case_047", "p03608_case_048", "p03608_case_049", "p03608_case_050", "p03608_case_051", "p03608_case_052", "p03608_case_053", "p03608_case_054", "p03608_case_055", "p03608_case_056", "p03608_case_057", "p03608_case_058", "p03608_case_059", "p03608_case_060", "p03608_case_061", "p03608_case_062", "p03608_case_063", "p03608_case_064", "p03608_case_065", "p03608_case_066", "p03608_case_067", "p03608_case_068", "p03608_case_069", "p03608_case_070", "p03608_case_071", "p03608_case_072", "p03608_case_073", "p03608_case_074", "p03608_case_075", "p03608_case_076", "p03608_case_077", "p03608_case_078", "p03608_case_079", "p03608_case_080", "p03608_case_081", "p03608_case_082", "p03608_case_083", "p03608_case_084", "p03608_case_085", "p03608_case_086", "p03608_case_087", "p03608_case_088", "p03608_case_089", "p03608_case_090", "p03608_case_091", "p03608_case_092", "p03608_case_093", "p03608_case_094", "p03608_case_095", "p03608_case_096", "p03608_case_097", "p03608_case_098", "p03608_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from heapq import heappop, heappush\nfrom itertools import permutations\n\n\ndef dijkstra(source: int) -> \"Array[int]\":\n\n size = len(G)\n dist = [float(\"inf\")] * size\n dist[source] = 0\n undetermined = size - 2\n queue = [(0, source)]\n while queue:\n cost, v = heappop(queue)\n if cost > dist[v]:\n continue\n for next_cost, u in G[v]:\n if cost + next_cost < dist[u]:\n dist[u] = cost + next_cost\n heappush(queue, (dist[u], u))\n undetermined -= 1\n if not undetermined:\n return dist\n return dist\n\n\ndef main():\n global G\n N, M, R, *RABC = list(map(int, open(0).read().split()))\n visit, ABC = RABC[:R], RABC[R:]\n G = [[] for _ in range(N + 1)]\n for v, u, cost in zip(*[iter(ABC)] * 3):\n G[v].append((cost, u)), G[u].append((cost, v))\n dist = {v: dijkstra(v) for v in visit}\n ans = float(\"inf\")\n for perm in permutations(visit):\n cur = sum(dist[v][u] for v, u in zip(perm, perm[1:]))\n ans = min(ans, cur)\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "0e1831f05fd57e3dc84771e018cbb15cec58ef815e2f8f6cf510560109d5b399", "fast_id": "p03608_91d0b963f05ea191df96d2285af61249e187b1a95e7777a7f8f049c535d3ac44", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "# ABC073D - joisino's travel\nfrom heapq import heappop, heappush\nfrom itertools import permutations\n\n\ndef dijkstra(source: int) -> \"Array[int]\":\n # compute the distance of the shortest path from V_source to each vertex\n size = len(G)\n dist = [float(\"inf\")] * size\n dist[source] = 0\n undetermined = size - 2 # V_0 and V_source are determined in 1-idx graph\n queue = [(0, source)]\n while queue:\n cost, v = heappop(queue)\n if cost > dist[v]:\n continue\n for next_cost, u in G[v]:\n if cost + next_cost < dist[u]:\n dist[u] = cost + next_cost\n heappush(queue, (dist[u], u))\n undetermined -= 1\n if not undetermined:\n return dist\n return dist\n\n\ndef main():\n global G\n N, M, R, *RABC = list(map(int, open(0).read().split()))\n visit, ABC = RABC[:R], RABC[R:]\n G = [[] for _ in range(N + 1)]\n for v, u, cost in zip(*[iter(ABC)] * 3):\n G[v].append((cost, u)), G[u].append((cost, v))\n dist = {v: dijkstra(v) for v in visit}\n ans = float(\"inf\")\n for perm in permutations(visit):\n cur = sum(dist[v][u] for v, u in zip(perm, perm[1:]))\n ans = min(ans, cur)\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "91d0b963f05ea191df96d2285af61249e187b1a95e7777a7f8f049c535d3ac44", "measured_slow_code": "import itertools\n\nINF = float(\"inf\")\n\n\ndef main():\n N, M, R = list(map(int, input().split()))\n r = list(map(int, input().split()))\n path = [[INF] * (N + 1) for _ in range(N + 1)]\n for _ in range(M):\n A, B, C = list(map(int, input().split()))\n path[A][B] = C\n path[B][A] = C\n for i in range(1, N + 1):\n path[i][i] = 0\n for i in range(1, N + 1):\n for j in range(1, N + 1):\n for k in range(1, N + 1):\n path[j][k] = min(path[j][k], path[j][i] + path[i][k])\n ans = INF\n for p in itertools.permutations(r):\n cost = 0\n for i in range(R - 1):\n cost += path[p[i]][p[i + 1]]\n ans = min(ans, cost)\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "e402cf8b709f4d4bd0675c325db77e47f7b2a6cb9e29edbcfebdf8e91b6449a7", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.6614901380109504, "pair_id": "python_v2_b21ffcac369804b89f915662", "per_case_slow_code_faster_fraction": 0.34, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03608", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03608_91d0b963f05ea191df96d2285af61249e187b1a95e7777a7f8f049c535d3ac44.jsonl.gz", "inputs": "reproduction/python/inputs/p03608.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03608_e402cf8b709f4d4bd0675c325db77e47f7b2a6cb9e29edbcfebdf8e91b6449a7.jsonl.gz"}, "slow_code": "import itertools\n\nINF = float(\"inf\")\n\n\ndef main():\n N, M, R = list(map(int, input().split()))\n r = list(map(int, input().split()))\n path = [[INF] * (N + 1) for _ in range(N + 1)]\n for _ in range(M):\n A, B, C = list(map(int, input().split()))\n path[A][B] = C\n path[B][A] = C\n for i in range(1, N + 1):\n path[i][i] = 0\n for i in range(1, N + 1):\n for j in range(1, N + 1):\n for k in range(1, N + 1):\n path[j][k] = min(path[j][k], path[j][i] + path[i][k])\n ans = INF\n for p in itertools.permutations(r):\n cost = 0\n for i in range(R - 1):\n cost += path[p[i]][p[i + 1]]\n ans = min(ans, cost)\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "e402cf8b709f4d4bd0675c325db77e47f7b2a6cb9e29edbcfebdf8e91b6449a7", "slow_id": "p03608_e402cf8b709f4d4bd0675c325db77e47f7b2a6cb9e29edbcfebdf8e91b6449a7", "speedup": 4.250731479411411, "stratum": "4-8", "within_pair_jaccard": 0.375, "workload": {"case_count": 100, "description": "Find the minimum road distance needed to visit R distinct specified towns in any order in a connected simple undirected graph. Start and finish at any specified towns; other towns may be passed through. Edges have positive lengths C_i. Observed inputs: N=2..200 (median 50); M=1..19900 (median 199); R=2..8 (median 8); C_i=1..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 277050, "median": 2393.0, "min": 16}, "input_format": ["N M R\nr_1 ... r_R\nA_1 B_1 C_1\n...\nA_M B_M C_M"], "input_format_status": "source_input_section", "input_lines": {"max": 19902, "median": 201.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 59711, "median": 608.0, "min": 8}}} -{"case_ids": ["p03860_case_000", "p03860_case_001", "p03860_case_002", "p03860_case_003", "p03860_case_004", "p03860_case_005", "p03860_case_006", "p03860_case_007", "p03860_case_008", "p03860_case_009", "p03860_case_010", "p03860_case_011", "p03860_case_012", "p03860_case_013", "p03860_case_014", "p03860_case_015", "p03860_case_016", "p03860_case_017", "p03860_case_018", "p03860_case_019", "p03860_case_020", "p03860_case_021", "p03860_case_022", "p03860_case_023", "p03860_case_024", "p03860_case_025", "p03860_case_026", "p03860_case_027", "p03860_case_028", "p03860_case_029", "p03860_case_030", "p03860_case_031", "p03860_case_032", "p03860_case_033", "p03860_case_034", "p03860_case_035", "p03860_case_036", "p03860_case_037", "p03860_case_038", "p03860_case_039", "p03860_case_040", "p03860_case_041", "p03860_case_042", "p03860_case_043", "p03860_case_044", "p03860_case_045", "p03860_case_046", "p03860_case_047", "p03860_case_048", "p03860_case_049", "p03860_case_050", "p03860_case_051", "p03860_case_052", "p03860_case_053", "p03860_case_054", "p03860_case_055", "p03860_case_056", "p03860_case_057", "p03860_case_058", "p03860_case_059", "p03860_case_060", "p03860_case_061", "p03860_case_062", "p03860_case_063", "p03860_case_064", "p03860_case_065", "p03860_case_066", "p03860_case_067", "p03860_case_068", "p03860_case_069", "p03860_case_070", "p03860_case_071", "p03860_case_072", "p03860_case_073", "p03860_case_074", "p03860_case_075", "p03860_case_076", "p03860_case_077", "p03860_case_078", "p03860_case_079", "p03860_case_080", "p03860_case_081", "p03860_case_082", "p03860_case_083", "p03860_case_084", "p03860_case_085", "p03860_case_086", "p03860_case_087", "p03860_case_088", "p03860_case_089", "p03860_case_090", "p03860_case_091", "p03860_case_092", "p03860_case_093", "p03860_case_094", "p03860_case_095", "p03860_case_096", "p03860_case_097", "p03860_case_098", "p03860_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "print(\"A%sC\" % input()[8])\n", "fast_code_sha256": "d403aea45d369f28cdd03fb6b71926bd847f65f7b3d2db08a0c13dfd5e1d17f1", "fast_id": "p03860_d403aea45d369f28cdd03fb6b71926bd847f65f7b3d2db08a0c13dfd5e1d17f1", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "print(\"A%sC\" % input()[8])\n", "measured_fast_code_sha256": "d403aea45d369f28cdd03fb6b71926bd847f65f7b3d2db08a0c13dfd5e1d17f1", "measured_slow_code": "ls = input().split()\nLs = []\n\n\ndef fun():\n print(\"111\")\n print(\"222\")\n print(\"333\")\n print(\"ii\")\n\n\nfor i in ls:\n Ls.append(i[0])\nprint((\"\".join(Ls)))\n", "measured_slow_code_sha256": "f9c7ff6ccba211df6aa7649f397d5aec3b7d4b68331ab1524aeb9717fd467838", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.7360299721197054, "pair_id": "python_v2_e3e8f6169a25221fc815508a", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03860", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03860_d403aea45d369f28cdd03fb6b71926bd847f65f7b3d2db08a0c13dfd5e1d17f1.jsonl.gz", "inputs": "reproduction/python/inputs/p03860.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03860_f9c7ff6ccba211df6aa7649f397d5aec3b7d4b68331ab1524aeb9717fd467838.jsonl.gz"}, "slow_code": "ls = input().split()\nLs = []\n\n\ndef fun():\n print(\"111\")\n print(\"222\")\n print(\"333\")\n print(\"ii\")\n\n\nfor i in ls:\n Ls.append(i[0])\nprint((\"\".join(Ls)))\n", "slow_code_sha256": "f9c7ff6ccba211df6aa7649f397d5aec3b7d4b68331ab1524aeb9717fd467838", "slow_id": "p03860_f9c7ff6ccba211df6aa7649f397d5aec3b7d4b68331ab1524aeb9717fd467838", "speedup": 3.7287526361861816, "stratum": "2-4", "within_pair_jaccard": 0.1, "workload": {"case_count": 100, "description": "Form a three-letter abbreviation from initials of a fixed prefix, title s, and fixed suffix. Prefix/suffix initials are A and C. The title begins with one uppercase letter followed by lowercase letters; both fixed words have 7 letters. Observed inputs: title_length=1..100 (median 50); fixed_word_length=7.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 117, "median": 67.0, "min": 18}, "input_format": ["prefix s suffix"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3, "median": 3.0, "min": 3}}} -{"case_ids": ["p03209_case_000", "p03209_case_001", "p03209_case_002", "p03209_case_003", "p03209_case_004", "p03209_case_005", "p03209_case_006", "p03209_case_007", "p03209_case_008", "p03209_case_009", "p03209_case_010", "p03209_case_011", "p03209_case_012", "p03209_case_013", "p03209_case_014", "p03209_case_015", "p03209_case_016", "p03209_case_017", "p03209_case_018", "p03209_case_019", "p03209_case_020", "p03209_case_021", "p03209_case_022", "p03209_case_023", "p03209_case_024", "p03209_case_025", "p03209_case_026", "p03209_case_027", "p03209_case_028", "p03209_case_029", "p03209_case_030", "p03209_case_031", "p03209_case_032", "p03209_case_033", "p03209_case_034", "p03209_case_035", "p03209_case_036", "p03209_case_037", "p03209_case_038", "p03209_case_039", "p03209_case_040", "p03209_case_041", "p03209_case_042", "p03209_case_043", "p03209_case_044", "p03209_case_045", "p03209_case_046", "p03209_case_047", "p03209_case_048", "p03209_case_049", "p03209_case_050", "p03209_case_051", "p03209_case_052", "p03209_case_053", "p03209_case_054", "p03209_case_055", "p03209_case_056", "p03209_case_057", "p03209_case_058", "p03209_case_059", "p03209_case_060", "p03209_case_061", "p03209_case_062", "p03209_case_063", "p03209_case_064", "p03209_case_065", "p03209_case_066", "p03209_case_067", "p03209_case_068", "p03209_case_069", "p03209_case_070", "p03209_case_071", "p03209_case_072", "p03209_case_073", "p03209_case_074", "p03209_case_075", "p03209_case_076", "p03209_case_077", "p03209_case_078", "p03209_case_079", "p03209_case_080", "p03209_case_081", "p03209_case_082", "p03209_case_083", "p03209_case_084", "p03209_case_085", "p03209_case_086", "p03209_case_087", "p03209_case_088", "p03209_case_089", "p03209_case_090", "p03209_case_091", "p03209_case_092", "p03209_case_093", "p03209_case_094", "p03209_case_095", "p03209_case_096", "p03209_case_097", "p03209_case_098", "p03209_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N, X = list(map(int, input().split()))\n\n\na = [1]\np = [1]\nfor i in range(N):\n a += [a[i] * 2 + 3]\n p += [p[i] * 2 + 1]\n\n\ndef search(n, x):\n if n == 0:\n return (1, 0)[x <= 0]\n elif x <= 1 + a[n - 1]:\n return search(n - 1, x - 1)\n else:\n return p[n - 1] + 1 + search(n - 1, x - 2 - a[n - 1])\n\n\nprint((search(N, X)))\n", "fast_code_sha256": "02fdfe69ebfb7c7f45f428332b29ae83bbf3eeeb8d1da112c369eb4c9f819684", "fast_id": "p03209_fbecc13a49f95945857982c479623ef1de44f805cd577719be725978a3db980e", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N, X = list(map(int, input().split()))\n# レベル0バーガーの厚さ:1\n# レベルLバーガーの厚さ:A(L-1) * 2 + 3\n# レベル0バーガーのパティの数:1\n# レベルLバーガーのパティの数:P(L-1) * 2 + 1\na = [1]\np = [1]\nfor i in range(N):\n a += [a[i] * 2 + 3]\n p += [p[i] * 2 + 1]\n\n\ndef search(n, x):\n if n == 0:\n return (1, 0)[x <= 0]\n elif x <= 1 + a[n - 1]:\n return search(n - 1, x - 1)\n else:\n return p[n - 1] + 1 + search(n - 1, x - 2 - a[n - 1])\n\n\nprint((search(N, X)))\n", "measured_fast_code_sha256": "fbecc13a49f95945857982c479623ef1de44f805cd577719be725978a3db980e", "measured_slow_code": "N, X = list(map(int, input().split()))\n# 層の総数\nT = [1]\nfor i in range(1, 50 + 1):\n T.append(T[i - 1] * 2 + 3)\n\n\ndef hash(n, x):\n return \"{0:d},{1:d}\".format(n, x)\n\n\n# レベルnバーガーの下からx層内のパティの数\nmemo = dict()\n\n\ndef solve(n, x):\n global T, memo\n if hash(n, x) in memo:\n return memo[hash(n, x)]\n if n == 0 and x >= 1:\n memo[hash(n, x)] = 1\n return 1\n if x <= 1:\n memo[hash(n, x)] = 0\n return 0\n memo[hash(n, x)] = solve(n - 1, min(x - 1, T[n - 1]))\n if x >= T[n - 1] + 2:\n memo[hash(n, x)] += 1\n if x >= T[n - 1] + 3:\n memo[hash(n, x)] += solve(n - 1, min(x - 1 - T[n - 1] - 1, T[n - 1]))\n return memo[hash(n, x)]\n\n\nprint((solve(N, X)))\n", "measured_slow_code_sha256": "d810806da4e3ff396dd2f9e6a8463b4981d8f62dd34c3ba133bb44352184e910", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.1932343722174785, "pair_id": "python_v2_8ac18efc8566b073675889bd", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03209", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03209_fbecc13a49f95945857982c479623ef1de44f805cd577719be725978a3db980e.jsonl.gz", "inputs": "reproduction/python/inputs/p03209.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03209_d810806da4e3ff396dd2f9e6a8463b4981d8f62dd34c3ba133bb44352184e910.jsonl.gz"}, "slow_code": "N, X = list(map(int, input().split()))\n\nT = [1]\nfor i in range(1, 50 + 1):\n T.append(T[i - 1] * 2 + 3)\n\n\ndef hash(n, x):\n return \"{0:d},{1:d}\".format(n, x)\n\n\nmemo = dict()\n\n\ndef solve(n, x):\n global T, memo\n if hash(n, x) in memo:\n return memo[hash(n, x)]\n if n == 0 and x >= 1:\n memo[hash(n, x)] = 1\n return 1\n if x <= 1:\n memo[hash(n, x)] = 0\n return 0\n memo[hash(n, x)] = solve(n - 1, min(x - 1, T[n - 1]))\n if x >= T[n - 1] + 2:\n memo[hash(n, x)] += 1\n if x >= T[n - 1] + 3:\n memo[hash(n, x)] += solve(n - 1, min(x - 1 - T[n - 1] - 1, T[n - 1]))\n return memo[hash(n, x)]\n\n\nprint((solve(N, X)))\n", "slow_code_sha256": "dbd3b0158d3748e0d99cec055f9e692949bfea6a1e16dd750ed0447f840bf070", "slow_id": "p03209_d810806da4e3ff396dd2f9e6a8463b4981d8f62dd34c3ba133bb44352184e910", "speedup": 2.9262453514600266, "stratum": "2-4", "within_pair_jaccard": 0.5526315789473685, "workload": {"case_count": 100, "description": "Level-0 burger is one patty. Level L>0 stacks bun, level-(L-1) burger, patty, level-(L-1) burger, bun, from bottom upward. Count patties in the bottom X layers of a level-N burger; the layered object is implicit, not listed. Observed inputs: N=1..50 (median 27.5); X=1..4503599627370493.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 20, "median": 11.0, "min": 4}, "input_format": ["N X"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p03251_case_000", "p03251_case_001", "p03251_case_002", "p03251_case_003", "p03251_case_004", "p03251_case_005", "p03251_case_006", "p03251_case_007", "p03251_case_008", "p03251_case_009", "p03251_case_010", "p03251_case_011", "p03251_case_012", "p03251_case_013", "p03251_case_014", "p03251_case_015", "p03251_case_016", "p03251_case_017", "p03251_case_018", "p03251_case_019", "p03251_case_020", "p03251_case_021", "p03251_case_022", "p03251_case_023", "p03251_case_024", "p03251_case_025", "p03251_case_026", "p03251_case_027", "p03251_case_028", "p03251_case_029", "p03251_case_030", "p03251_case_031", "p03251_case_032", "p03251_case_033", "p03251_case_034", "p03251_case_035", "p03251_case_036", "p03251_case_037", "p03251_case_038", "p03251_case_039", "p03251_case_040", "p03251_case_041", "p03251_case_042", "p03251_case_043", "p03251_case_044", "p03251_case_045", "p03251_case_046", "p03251_case_047", "p03251_case_048", "p03251_case_049", "p03251_case_050", "p03251_case_051", "p03251_case_052", "p03251_case_053", "p03251_case_054", "p03251_case_055", "p03251_case_056", "p03251_case_057", "p03251_case_058", "p03251_case_059", "p03251_case_060", "p03251_case_061", "p03251_case_062", "p03251_case_063", "p03251_case_064", "p03251_case_065", "p03251_case_066", "p03251_case_067", "p03251_case_068", "p03251_case_069", "p03251_case_070", "p03251_case_071", "p03251_case_072", "p03251_case_073", "p03251_case_074", "p03251_case_075", "p03251_case_076", "p03251_case_077", "p03251_case_078", "p03251_case_079", "p03251_case_080", "p03251_case_081", "p03251_case_082", "p03251_case_083", "p03251_case_084", "p03251_case_085", "p03251_case_086", "p03251_case_087", "p03251_case_088", "p03251_case_089", "p03251_case_090", "p03251_case_091", "p03251_case_092", "p03251_case_093", "p03251_case_094", "p03251_case_095", "p03251_case_096", "p03251_case_097", "p03251_case_098", "p03251_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "A = list(map(int, input().split()))\nX = list(map(int, input().split()))\nY = list(map(int, input().split()))\nx = max(X)\ny = min(Y)\nif x < y and A[2] < A[3] and A[2] < y and x < A[3]:\n print(\"No War\")\nelse:\n print(\"War\")\n", "fast_code_sha256": "f79557cdbc11eb5246f131496e2cdaef6b0d614f77577a26caa92303bb851e73", "fast_id": "p03251_f79557cdbc11eb5246f131496e2cdaef6b0d614f77577a26caa92303bb851e73", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "A = list(map(int, input().split()))\nX = list(map(int, input().split()))\nY = list(map(int, input().split()))\nx = max(X)\ny = min(Y)\nif x < y and A[2] < A[3] and A[2] < y and x < A[3]:\n print(\"No War\")\nelse:\n print(\"War\")\n", "measured_fast_code_sha256": "f79557cdbc11eb5246f131496e2cdaef6b0d614f77577a26caa92303bb851e73", "measured_slow_code": "import numpy as np\n\nn, m, x, y = list(map(int, input().split()))\nxl = [int(i) for i in input().split()]\nyl = [int(i) for i in input().split()]\nif x > y:\n print(\"War\")\nelse:\n zl = np.arange(x + 1, y + 1)\n for z in zl:\n if (max(xl) < z) & (z <= min(yl)):\n print(\"No War\")\n break\n else:\n print(\"War\")\n", "measured_slow_code_sha256": "a3fbc6c47b132b7bae66af85f9792255327ce8e3bf2b5b22873b7c8d59510fae", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 692.37727031243, "pair_id": "python_v2_4b02e98697647f4fb253abdf", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03251", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03251_f79557cdbc11eb5246f131496e2cdaef6b0d614f77577a26caa92303bb851e73.jsonl.gz", "inputs": "reproduction/python/inputs/p03251.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03251_a3fbc6c47b132b7bae66af85f9792255327ce8e3bf2b5b22873b7c8d59510fae.jsonl.gz"}, "slow_code": "import numpy as np\n\nn, m, x, y = list(map(int, input().split()))\nxl = [int(i) for i in input().split()]\nyl = [int(i) for i in input().split()]\nif x > y:\n print(\"War\")\nelse:\n zl = np.arange(x + 1, y + 1)\n for z in zl:\n if (max(xl) < z) & (z <= min(yl)):\n print(\"No War\")\n break\n else:\n print(\"War\")\n", "slow_code_sha256": "a3fbc6c47b132b7bae66af85f9792255327ce8e3bf2b5b22873b7c8d59510fae", "slow_id": "p03251_a3fbc6c47b132b7bae66af85f9792255327ce8e3bf2b5b22873b7c8d59510fae", "speedup": 710.8765907790657, "stratum": "8+", "within_pair_jaccard": 0.3888888888888889, "workload": {"case_count": 100, "description": "Determine whether an integer Z satisfies X=Z. Each coordinate list is distinct internally and excludes its own capital X or Y. Lists are not necessarily sorted. Observed inputs: N=1..100 (median 50); M=1..100 (median 50); X=-100..99; Y=-99..100; x_i=-100..100; y_i=-100..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 706, "median": 356.0, "min": 20}, "input_format": ["N M X Y\nx_1 ... x_N\ny_1 ... y_M"], "input_format_status": "source_input_section", "input_lines": {"max": 3, "median": 3.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 204, "median": 104.0, "min": 6}}} -{"case_ids": ["p02555_case_000", "p02555_case_001", "p02555_case_002", "p02555_case_003", "p02555_case_004", "p02555_case_005", "p02555_case_006", "p02555_case_007", "p02555_case_008", "p02555_case_009", "p02555_case_010", "p02555_case_011", "p02555_case_012", "p02555_case_013", "p02555_case_014", "p02555_case_015", "p02555_case_016", "p02555_case_017", "p02555_case_018", "p02555_case_019", "p02555_case_020", "p02555_case_021", "p02555_case_022", "p02555_case_023", "p02555_case_024", "p02555_case_025", "p02555_case_026", "p02555_case_027", "p02555_case_028", "p02555_case_029", "p02555_case_030", "p02555_case_031", "p02555_case_032", "p02555_case_033", "p02555_case_034", "p02555_case_035", "p02555_case_036", "p02555_case_037", "p02555_case_038", "p02555_case_039", "p02555_case_040", "p02555_case_041", "p02555_case_042", "p02555_case_043", "p02555_case_044", "p02555_case_045", "p02555_case_046", "p02555_case_047", "p02555_case_048", "p02555_case_049", "p02555_case_050", "p02555_case_051", "p02555_case_052", "p02555_case_053", "p02555_case_054", "p02555_case_055", "p02555_case_056", "p02555_case_057", "p02555_case_058", "p02555_case_059", "p02555_case_060", "p02555_case_061", "p02555_case_062", "p02555_case_063", "p02555_case_064", "p02555_case_065", "p02555_case_066", "p02555_case_067", "p02555_case_068", "p02555_case_069", "p02555_case_070", "p02555_case_071", "p02555_case_072", "p02555_case_073", "p02555_case_074", "p02555_case_075", "p02555_case_076", "p02555_case_077", "p02555_case_078", "p02555_case_079", "p02555_case_080", "p02555_case_081", "p02555_case_082", "p02555_case_083", "p02555_case_084", "p02555_case_085", "p02555_case_086", "p02555_case_087", "p02555_case_088", "p02555_case_089", "p02555_case_090", "p02555_case_091", "p02555_case_092", "p02555_case_093", "p02555_case_094", "p02555_case_095", "p02555_case_096", "p02555_case_097", "p02555_case_098", "p02555_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "s = int(eval(input()))\na = [0] * 2001\na[3] = 1\nfor i in range(4, s + 1):\n a[i] = a[i - 3] + a[i - 1]\nmod = 10**9 + 7\nprint((a[s] % mod))\n", "fast_code_sha256": "37c9fac7ead0f2b6da6ea26ddf52b35d4ead2ab1d3996a57bd40fb1183e5553a", "fast_id": "p02555_37c9fac7ead0f2b6da6ea26ddf52b35d4ead2ab1d3996a57bd40fb1183e5553a", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "s = int(eval(input()))\na = [0] * 2001\na[3] = 1\nfor i in range(4, s + 1):\n a[i] = a[i - 3] + a[i - 1]\nmod = 10**9 + 7\nprint((a[s] % mod))\n", "measured_fast_code_sha256": "37c9fac7ead0f2b6da6ea26ddf52b35d4ead2ab1d3996a57bd40fb1183e5553a", "measured_slow_code": "S = int(eval(input()))\nM = 10**9 + 7\n\n\ndef mod_pow(a, b, mod):\n bin_b = []\n while b:\n bin_b.append(b % 2)\n b >>= 1\n ret = 1\n for j in reversed(bin_b):\n ret = (ret * ret) % mod\n if j == 1:\n ret = (ret * a) % mod\n return ret\n\n\ndef mod_comb(n, k, mod):\n ret = 1\n for i in range(1, k + 1):\n ret = (ret * (n + 1 - i)) % mod\n ret = (ret * mod_pow(i, mod - 2, mod)) % mod\n return ret\n\n\nans = 0\nfor K in range(1, S // 3 + 1):\n ans = (ans + mod_comb(S - 2 * K - 1, K - 1, M)) % M\nprint(ans)\n", "measured_slow_code_sha256": "f3a9f382ebbb57dd2ccfef10f0dd3bab2793e452b41de4dce23dea9cead841b2", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2019.294507596598, "pair_id": "python_v2_15dcfc2113d57ef13b52caf7", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02555", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02555_37c9fac7ead0f2b6da6ea26ddf52b35d4ead2ab1d3996a57bd40fb1183e5553a.jsonl.gz", "inputs": "reproduction/python/inputs/p02555.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02555_f3a9f382ebbb57dd2ccfef10f0dd3bab2793e452b41de4dce23dea9cead841b2.jsonl.gz"}, "slow_code": "S = int(eval(input()))\nM = 10**9 + 7\n\n\ndef mod_pow(a, b, mod):\n bin_b = []\n while b:\n bin_b.append(b % 2)\n b >>= 1\n ret = 1\n for j in reversed(bin_b):\n ret = (ret * ret) % mod\n if j == 1:\n ret = (ret * a) % mod\n return ret\n\n\ndef mod_comb(n, k, mod):\n ret = 1\n for i in range(1, k + 1):\n ret = (ret * (n + 1 - i)) % mod\n ret = (ret * mod_pow(i, mod - 2, mod)) % mod\n return ret\n\n\nans = 0\nfor K in range(1, S // 3 + 1):\n ans = (ans + mod_comb(S - 2 * K - 1, K - 1, M)) % M\nprint(ans)\n", "slow_code_sha256": "f3a9f382ebbb57dd2ccfef10f0dd3bab2793e452b41de4dce23dea9cead841b2", "slow_id": "p02555_f3a9f382ebbb57dd2ccfef10f0dd3bab2793e452b41de4dce23dea9cead841b2", "speedup": 794.1365593641225, "stratum": "8+", "within_pair_jaccard": 0.39473684210526316, "workload": {"case_count": 100, "description": "Count ordered integer sequences whose entries are at least 3 and sum to S, modulo 1000000007. Observed inputs: S=1..2000 (median 1094).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 5, "median": 5.0, "min": 2}, "input_format": ["S"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p02640_case_000", "p02640_case_001", "p02640_case_002", "p02640_case_003", "p02640_case_004", "p02640_case_005", "p02640_case_006", "p02640_case_007", "p02640_case_008", "p02640_case_009", "p02640_case_010", "p02640_case_011", "p02640_case_012", "p02640_case_013", "p02640_case_014", "p02640_case_015", "p02640_case_016", "p02640_case_017", "p02640_case_018", "p02640_case_019", "p02640_case_020", "p02640_case_021", "p02640_case_022", "p02640_case_023", "p02640_case_024", "p02640_case_025", "p02640_case_026", "p02640_case_027", "p02640_case_028", "p02640_case_029", "p02640_case_030", "p02640_case_031", "p02640_case_032", "p02640_case_033", "p02640_case_034", "p02640_case_035", "p02640_case_036", "p02640_case_037", "p02640_case_038", "p02640_case_039", "p02640_case_040", "p02640_case_041", "p02640_case_042", "p02640_case_043", "p02640_case_044", "p02640_case_045", "p02640_case_046", "p02640_case_047", "p02640_case_048", "p02640_case_049", "p02640_case_050", "p02640_case_051", "p02640_case_052", "p02640_case_053", "p02640_case_054", "p02640_case_055", "p02640_case_056", "p02640_case_057", "p02640_case_058", "p02640_case_059", "p02640_case_060", "p02640_case_061", "p02640_case_062", "p02640_case_063", "p02640_case_064", "p02640_case_065", "p02640_case_066", "p02640_case_067", "p02640_case_068", "p02640_case_069", "p02640_case_070", "p02640_case_071", "p02640_case_072", "p02640_case_073", "p02640_case_074", "p02640_case_075", "p02640_case_076", "p02640_case_077", "p02640_case_078", "p02640_case_079", "p02640_case_080", "p02640_case_081", "p02640_case_082", "p02640_case_083", "p02640_case_084", "p02640_case_085", "p02640_case_086", "p02640_case_087", "p02640_case_088", "p02640_case_089", "p02640_case_090", "p02640_case_091", "p02640_case_092", "p02640_case_093", "p02640_case_094", "p02640_case_095", "p02640_case_096", "p02640_case_097", "p02640_case_098", "p02640_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "x, y = list(map(int, input().split()))\nans = False\nfor c in range(x + 1):\n t = x - c\n if c + t == x and 2 * c + 4 * t == y:\n ans = True\n break\nprint((\"Yes\" if ans else \"No\"))\n", "fast_code_sha256": "7f43bc4626339584a6d59443d498ed828bdcc8b7b2cd7280cfac7cab4e848c35", "fast_id": "p02640_7f43bc4626339584a6d59443d498ed828bdcc8b7b2cd7280cfac7cab4e848c35", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "x, y = list(map(int, input().split()))\nans = False\nfor c in range(x + 1):\n t = x - c\n if c + t == x and 2 * c + 4 * t == y:\n ans = True\n break\nprint((\"Yes\" if ans else \"No\"))\n", "measured_fast_code_sha256": "7f43bc4626339584a6d59443d498ed828bdcc8b7b2cd7280cfac7cab4e848c35", "measured_slow_code": "x, y = list(map(int, input().split()))\nfor i in range(0, 101):\n for j in range(0, 101):\n if i + j == x and i * 2 + j * 4 == y:\n print(\"Yes\")\n exit()\nprint(\"No\")\n# print('Yes' if y%2 == 0 and x >= y//2 and y // 4 - (y%4) //2 <= x else 'No')\n", "measured_slow_code_sha256": "b81aa7896b39a5e204fdfa9ca3f63685a6d18d86724afc22b841cf9b49e7766b", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 6.136239453431298, "pair_id": "python_v2_61ada148eb9df420e15cd49a", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02640", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02640_7f43bc4626339584a6d59443d498ed828bdcc8b7b2cd7280cfac7cab4e848c35.jsonl.gz", "inputs": "reproduction/python/inputs/p02640.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02640_b81aa7896b39a5e204fdfa9ca3f63685a6d18d86724afc22b841cf9b49e7766b.jsonl.gz"}, "slow_code": "x, y = list(map(int, input().split()))\nfor i in range(0, 101):\n for j in range(0, 101):\n if i + j == x and i * 2 + j * 4 == y:\n print(\"Yes\")\n exit()\nprint(\"No\")\n", "slow_code_sha256": "ac09bdaf0871ab87a33221ec8a163d2052febe18d868feae44e613cae3f3a95f", "slow_id": "p02640_b81aa7896b39a5e204fdfa9ca3f63685a6d18d86724afc22b841cf9b49e7766b", "speedup": 6.421833247678583, "stratum": "4-8", "within_pair_jaccard": 0.5666666666666667, "workload": {"case_count": 100, "description": "Determine whether X animals can have Y legs in total when each animal is either a two-legged crane or a four-legged turtle. Observed inputs: X=1..100 (median 18); Y=1..100 (median 41).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 8, "median": 6.0, "min": 4}, "input_format": ["X Y"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p03609_case_000", "p03609_case_001", "p03609_case_002", "p03609_case_003", "p03609_case_004", "p03609_case_005", "p03609_case_006", "p03609_case_007", "p03609_case_008", "p03609_case_009", "p03609_case_010", "p03609_case_011", "p03609_case_012", "p03609_case_013", "p03609_case_014", "p03609_case_015", "p03609_case_016", "p03609_case_017", "p03609_case_018", "p03609_case_019", "p03609_case_020", "p03609_case_021", "p03609_case_022", "p03609_case_023", "p03609_case_024", "p03609_case_025", "p03609_case_026", "p03609_case_027", "p03609_case_028", "p03609_case_029", "p03609_case_030", "p03609_case_031", "p03609_case_032", "p03609_case_033", "p03609_case_034", "p03609_case_035", "p03609_case_036", "p03609_case_037", "p03609_case_038", "p03609_case_039", "p03609_case_040", "p03609_case_041", "p03609_case_042", "p03609_case_043", "p03609_case_044", "p03609_case_045", "p03609_case_046", "p03609_case_047", "p03609_case_048", "p03609_case_049", "p03609_case_050", "p03609_case_051", "p03609_case_052", "p03609_case_053", "p03609_case_054", "p03609_case_055", "p03609_case_056", "p03609_case_057", "p03609_case_058", "p03609_case_059", "p03609_case_060", "p03609_case_061", "p03609_case_062", "p03609_case_063", "p03609_case_064", "p03609_case_065", "p03609_case_066", "p03609_case_067", "p03609_case_068", "p03609_case_069", "p03609_case_070", "p03609_case_071", "p03609_case_072", "p03609_case_073", "p03609_case_074", "p03609_case_075", "p03609_case_076", "p03609_case_077", "p03609_case_078", "p03609_case_079", "p03609_case_080", "p03609_case_081", "p03609_case_082", "p03609_case_083", "p03609_case_084", "p03609_case_085", "p03609_case_086", "p03609_case_087", "p03609_case_088", "p03609_case_089", "p03609_case_090", "p03609_case_091", "p03609_case_092", "p03609_case_093", "p03609_case_094", "p03609_case_095", "p03609_case_096", "p03609_case_097", "p03609_case_098", "p03609_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "a, b = list(map(int, input().split()))\nprint((max(a - b, 0)))\n", "fast_code_sha256": "ab56f7327b53cd8c27466446cef94a71f8037fd7587c25056984f4299da22f4f", "fast_id": "p03609_ab56f7327b53cd8c27466446cef94a71f8037fd7587c25056984f4299da22f4f", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "a, b = list(map(int, input().split()))\nprint((max(a - b, 0)))\n", "measured_fast_code_sha256": "ab56f7327b53cd8c27466446cef94a71f8037fd7587c25056984f4299da22f4f", "measured_slow_code": "import numpy as np\n\nx, t = list(map(int, input().split()))\nprint((np.max(np.array([x - t, 0]))))\n", "measured_slow_code_sha256": "a299dbf158d9b4197e8d6e9bc8a56f5dae0f1a29a154060b4dbf82a91b0fb59c", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2313.935092003725, "pair_id": "python_v2_d13373448ada6d0c59a6e0b5", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03609", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03609_ab56f7327b53cd8c27466446cef94a71f8037fd7587c25056984f4299da22f4f.jsonl.gz", "inputs": "reproduction/python/inputs/p03609.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03609_a299dbf158d9b4197e8d6e9bc8a56f5dae0f1a29a154060b4dbf82a91b0fb59c.jsonl.gz"}, "slow_code": "import numpy as np\n\nx, t = list(map(int, input().split()))\nprint((np.max(np.array([x - t, 0]))))\n", "slow_code_sha256": "a299dbf158d9b4197e8d6e9bc8a56f5dae0f1a29a154060b4dbf82a91b0fb59c", "slow_id": "p03609_a299dbf158d9b4197e8d6e9bc8a56f5dae0f1a29a154060b4dbf82a91b0fb59c", "speedup": 2311.6010968011524, "stratum": "8+", "within_pair_jaccard": 0.47058823529411764, "workload": {"case_count": 100, "description": "An upper hourglass bulb starts with X grams and loses one gram per second until empty. Report grams remaining after t seconds. Observed inputs: X=1..1000000000 (median 278882159.5); t=1..1000000000 (median 259647859.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 22, "median": 20.0, "min": 4}, "input_format": ["X t"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p03240_case_000", "p03240_case_001", "p03240_case_002", "p03240_case_003", "p03240_case_004", "p03240_case_005", "p03240_case_006", "p03240_case_007", "p03240_case_008", "p03240_case_009", "p03240_case_010", "p03240_case_011", "p03240_case_012", "p03240_case_013", "p03240_case_014", "p03240_case_015", "p03240_case_016", "p03240_case_017", "p03240_case_018", "p03240_case_019", "p03240_case_020", "p03240_case_021", "p03240_case_022", "p03240_case_023", "p03240_case_024", "p03240_case_025", "p03240_case_026", "p03240_case_027", "p03240_case_028", "p03240_case_029", "p03240_case_030", "p03240_case_031", "p03240_case_032", "p03240_case_033", "p03240_case_034", "p03240_case_035", "p03240_case_036", "p03240_case_037", "p03240_case_038", "p03240_case_039", "p03240_case_040", "p03240_case_041", "p03240_case_042", "p03240_case_043", "p03240_case_044", "p03240_case_045", "p03240_case_046", "p03240_case_047", "p03240_case_048", "p03240_case_049", "p03240_case_050", "p03240_case_051", "p03240_case_052", "p03240_case_053", "p03240_case_054", "p03240_case_055", "p03240_case_056", "p03240_case_057", "p03240_case_058", "p03240_case_059", "p03240_case_060", "p03240_case_061", "p03240_case_062", "p03240_case_063", "p03240_case_064", "p03240_case_065", "p03240_case_066", "p03240_case_067", "p03240_case_068", "p03240_case_069", "p03240_case_070", "p03240_case_071", "p03240_case_072", "p03240_case_073", "p03240_case_074", "p03240_case_075", "p03240_case_076", "p03240_case_077", "p03240_case_078", "p03240_case_079", "p03240_case_080", "p03240_case_081", "p03240_case_082", "p03240_case_083", "p03240_case_084", "p03240_case_085", "p03240_case_086", "p03240_case_087", "p03240_case_088", "p03240_case_089", "p03240_case_090", "p03240_case_091", "p03240_case_092", "p03240_case_093", "p03240_case_094", "p03240_case_095", "p03240_case_096", "p03240_case_097", "p03240_case_098", "p03240_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "executable_AST_equal_except_explicit_explanatory_string_removal_and_all_frozen_inputs_checker_pass", "fast_code": "import math\n\nn = int(eval(input()))\nx = [0 for i in range(n)]\ny = [0 for i in range(n)]\nh = [0 for i in range(n)]\njudge = False\nfor i in range(n):\n x[i], y[i], h[i] = list(map(int, input().split()))\nfor i in range(0, 101):\n for j in range(0, 101):\n for k in range(0, n):\n if h[k] != 0:\n true_h = h[k] + int(math.fabs(x[k] - i)) + int(math.fabs(y[k] - j))\n break\n judge = True\n for k in range(n):\n dum_h = max(true_h - int(math.fabs(x[k] - i)) - int(math.fabs(y[k] - j)), 0)\n if h[k] != dum_h:\n judge = False\n break\n\n if judge is True:\n break\n if judge is True:\n break\nprint((\"{} {} {}\".format(i, j, true_h)))\n", "fast_code_sha256": "5ef70bc141553c2d6856c41ffb402c1ab6bd08e8ee2dd8d9311cc53181815501", "fast_id": "p03240_d8c72961362efaa75706105038ea037d0e693a948d13d5ff911684dd10351521", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import math\n\nn = int(eval(input()))\nx = [0 for i in range(n)]\ny = [0 for i in range(n)]\nh = [0 for i in range(n)]\njudge = False\nfor i in range(n):\n x[i], y[i], h[i] = list(map(int, input().split()))\nfor i in range(0, 101):\n for j in range(0, 101):\n for k in range(0, n):\n if h[k] != 0:\n true_h = h[k] + int(math.fabs(x[k] - i)) + int(math.fabs(y[k] - j))\n break\n judge = True\n for k in range(n):\n dum_h = max(true_h - int(math.fabs(x[k] - i)) - int(math.fabs(y[k] - j)), 0)\n if h[k] != dum_h:\n judge = False\n break\n # print(k)\n if judge is True:\n break\n if judge is True:\n break\nprint((\"{} {} {}\".format(i, j, true_h)))\n", "measured_fast_code_sha256": "d8c72961362efaa75706105038ea037d0e693a948d13d5ff911684dd10351521", "measured_slow_code": "import numpy as np\n\nN = int(eval(input()))\nx, y, h = np.array([list(map(int, input().split())) for i in range(N)]).T\n\"\"\"\nx = [0 for i in range(N)]\ny = [0 for i in range(N)]\nh = [0 for i in range(N)]\nfor i in range(N):\n x[i], y[i], h[i] = map(int, input().split())\n\"\"\"\nH = 0\nCx = 0\nCy = 0\nFlag = True\nfor i in range(101):\n for j in range(101):\n Flag = True\n for k in range(N):\n if h[k] != 0:\n H = h[k] + abs(i - x[k]) + abs(j - y[k])\n break\n for k in range(N):\n if h[k] != max(H - abs(i - x[k]) - abs(j - y[k]), 0):\n Flag = False\n break\n if Flag:\n Cx, Cy = i, j\n break\n if Flag:\n break\nprint((\"{} {} {}\".format(Cx, Cy, H)))\n", "measured_slow_code_sha256": "7335b8f814fadff817ea3d797eb47069b6471e295b0639a1a649c1b8aea437e5", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4.892477248235404, "pair_id": "python_v2_4012912652ea159061c4e4bc", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03240", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03240_d8c72961362efaa75706105038ea037d0e693a948d13d5ff911684dd10351521.jsonl.gz", "inputs": "reproduction/python/inputs/p03240.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03240_7335b8f814fadff817ea3d797eb47069b6471e295b0639a1a649c1b8aea437e5.jsonl.gz"}, "slow_code": "import numpy as np\n\nN = int(eval(input()))\nx, y, h = np.array([list(map(int, input().split())) for i in range(N)]).T\nH = 0\nCx = 0\nCy = 0\nFlag = True\nfor i in range(101):\n for j in range(101):\n Flag = True\n for k in range(N):\n if h[k] != 0:\n H = h[k] + abs(i - x[k]) + abs(j - y[k])\n break\n for k in range(N):\n if h[k] != max(H - abs(i - x[k]) - abs(j - y[k]), 0):\n Flag = False\n break\n if Flag:\n Cx, Cy = i, j\n break\n if Flag:\n break\nprint((\"{} {} {}\".format(Cx, Cy, H)))\n", "slow_code_sha256": "2b73a8d0ed51a5904d37fa90f680662d0779f1a36233aa1fe89473f78eb7c3e5", "slow_id": "p03240_7335b8f814fadff817ea3d797eb47069b6471e295b0639a1a649c1b8aea437e5", "speedup": 6.266826962401638, "stratum": "4-8", "within_pair_jaccard": 0.5813953488372093, "workload": {"case_count": 100, "description": "Recover unique integer center (C_X,C_Y) in 0..100 and height H>=1 from N distinct observations (x_i,y_i,h_i) satisfying h_i=max(H-|x_i-C_X|-|y_i-C_Y|,0). Observed inputs: N=3..100 (median 50); x_i=0..100; y_i=0..100; h_i=1299707..999999997.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1594, "median": 798.0, "min": 49}, "input_format": ["N\nx_1 y_1 h_1\n...\nx_N y_N h_N"], "input_format_status": "source_input_section", "input_lines": {"max": 101, "median": 51.0, "min": 4}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 301, "median": 151.0, "min": 10}}} -{"case_ids": ["p02948_case_000", "p02948_case_001", "p02948_case_002", "p02948_case_003", "p02948_case_004", "p02948_case_005", "p02948_case_006", "p02948_case_007", "p02948_case_008", "p02948_case_009", "p02948_case_010", "p02948_case_011", "p02948_case_012", "p02948_case_013", "p02948_case_014", "p02948_case_015", "p02948_case_016", "p02948_case_017", "p02948_case_018", "p02948_case_019", "p02948_case_020", "p02948_case_021", "p02948_case_022", "p02948_case_023", "p02948_case_024", "p02948_case_025", "p02948_case_026", "p02948_case_027", "p02948_case_028", "p02948_case_029", "p02948_case_030", "p02948_case_031", "p02948_case_032", "p02948_case_033", "p02948_case_034", "p02948_case_035", "p02948_case_036", "p02948_case_037", "p02948_case_038", "p02948_case_039", "p02948_case_040", "p02948_case_041", "p02948_case_042", "p02948_case_043", "p02948_case_044", "p02948_case_045", "p02948_case_046", "p02948_case_047", "p02948_case_048", "p02948_case_049", "p02948_case_050", "p02948_case_051", "p02948_case_052", "p02948_case_053", "p02948_case_054", "p02948_case_055", "p02948_case_056", "p02948_case_057", "p02948_case_058", "p02948_case_059", "p02948_case_060", "p02948_case_061", "p02948_case_062", "p02948_case_063", "p02948_case_064", "p02948_case_065", "p02948_case_066", "p02948_case_067", "p02948_case_068", "p02948_case_069", "p02948_case_070", "p02948_case_071", "p02948_case_072", "p02948_case_073", "p02948_case_074", "p02948_case_075", "p02948_case_076", "p02948_case_077", "p02948_case_078", "p02948_case_079", "p02948_case_080", "p02948_case_081", "p02948_case_082", "p02948_case_083", "p02948_case_084", "p02948_case_085", "p02948_case_086", "p02948_case_087", "p02948_case_088", "p02948_case_089", "p02948_case_090", "p02948_case_091", "p02948_case_092", "p02948_case_093", "p02948_case_094", "p02948_case_095", "p02948_case_096", "p02948_case_097", "p02948_case_098", "p02948_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from heapq import *\n\nN, M, *t = list(map(int, open(0).read().split()))\nv = [[] for _ in \"_\" * M]\nz = i = 0\nfor _ in \"_\" * N:\n M < t[i] or v[t[i] - 1].append(t[i + 1])\n i += 2\nq = []\nfor i in v:\n for j in i:\n heappush(q, -j)\n z -= len(q) and heappop(q)\nprint(z)\n", "fast_code_sha256": "78195a2740d448817b390133128ddb97072787be3c728274df837dfcfab111dc", "fast_id": "p02948_78195a2740d448817b390133128ddb97072787be3c728274df837dfcfab111dc", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from heapq import *\n\nN, M, *t = list(map(int, open(0).read().split()))\nv = [[] for _ in \"_\" * M]\nz = i = 0\nfor _ in \"_\" * N:\n M < t[i] or v[t[i] - 1].append(t[i + 1])\n i += 2\nq = []\nfor i in v:\n for j in i:\n heappush(q, -j)\n z -= len(q) and heappop(q)\nprint(z)\n", "measured_fast_code_sha256": "78195a2740d448817b390133128ddb97072787be3c728274df837dfcfab111dc", "measured_slow_code": "from heapq import heappop, heappush, heapify\nfrom collections import deque\n\nN, M = list(map(int, input().split()))\nA, B, C = [0] * N, [0] * N, [0] * N\nfor i in range(N):\n A[i], B[i] = list(map(int, input().split()))\n C[i] = [A[i], B[i]]\nC.sort()\nC = deque(C)\na = []\nheapify(a)\nans = 0\nfor i in range(M, -1, -1):\n while C:\n if C[0][0] <= M - i:\n heappush(a, (-1) * C[0][1])\n C.popleft()\n else:\n break\n if len(a) > 0:\n p = heappop(a)\n ans += (-1) * p\nprint(ans)\n", "measured_slow_code_sha256": "e48793569c8f6809f237ed0e72dcae9529986820c4ed6e2380f8864742ef7cda", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.30681210339159, "pair_id": "python_v2_e12e555d1ab9e6e33997804c", "per_case_slow_code_faster_fraction": 0.07, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02948", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02948_78195a2740d448817b390133128ddb97072787be3c728274df837dfcfab111dc.jsonl.gz", "inputs": "reproduction/python/inputs/p02948.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02948_e48793569c8f6809f237ed0e72dcae9529986820c4ed6e2380f8864742ef7cda.jsonl.gz"}, "slow_code": "from heapq import heappop, heappush, heapify\nfrom collections import deque\n\nN, M = list(map(int, input().split()))\nA, B, C = [0] * N, [0] * N, [0] * N\nfor i in range(N):\n A[i], B[i] = list(map(int, input().split()))\n C[i] = [A[i], B[i]]\nC.sort()\nC = deque(C)\na = []\nheapify(a)\nans = 0\nfor i in range(M, -1, -1):\n while C:\n if C[0][0] <= M - i:\n heappush(a, (-1) * C[0][1])\n C.popleft()\n else:\n break\n if len(a) > 0:\n p = heappop(a)\n ans += (-1) * p\nprint(ans)\n", "slow_code_sha256": "e48793569c8f6809f237ed0e72dcae9529986820c4ed6e2380f8864742ef7cda", "slow_id": "p02948_e48793569c8f6809f237ed0e72dcae9529986820c4ed6e2380f8864742ef7cda", "speedup": 2.224645018015859, "stratum": "2-4", "within_pair_jaccard": 0.3829787234042553, "workload": {"case_count": 100, "description": "Each of N one-off jobs can be done in one day, paying B_i after A_i days. At most one job is done daily, starting today. Maximize rewards received no later than M days from today; jobs cannot be repeated. Observed inputs: N=1..100000 (median 100000); M=1..100000 (median 100000); A_i=1..100000; B_i=1..10000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1300014, "median": 1077655.5, "min": 14}, "input_format": ["N M\nA_1 B_1\n...\nA_N B_N"], "input_format_status": "source_input_section", "input_lines": {"max": 100001, "median": 100001.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200002, "median": 200002.0, "min": 4}}} -{"case_ids": ["p03807_case_000", "p03807_case_001", "p03807_case_002", "p03807_case_003", "p03807_case_004", "p03807_case_005", "p03807_case_006", "p03807_case_007", "p03807_case_008", "p03807_case_009", "p03807_case_010", "p03807_case_011", "p03807_case_012", "p03807_case_013", "p03807_case_014", "p03807_case_015", "p03807_case_016", "p03807_case_017", "p03807_case_018", "p03807_case_019", "p03807_case_020", "p03807_case_021", "p03807_case_022", "p03807_case_023", "p03807_case_024", "p03807_case_025", "p03807_case_026", "p03807_case_027", "p03807_case_028", "p03807_case_029", "p03807_case_030", "p03807_case_031", "p03807_case_032", "p03807_case_033", "p03807_case_034", "p03807_case_035", "p03807_case_036", "p03807_case_037", "p03807_case_038", "p03807_case_039", "p03807_case_040", "p03807_case_041", "p03807_case_042", "p03807_case_043", "p03807_case_044", "p03807_case_045", "p03807_case_046", "p03807_case_047", "p03807_case_048", "p03807_case_049", "p03807_case_050", "p03807_case_051", "p03807_case_052", "p03807_case_053", "p03807_case_054", "p03807_case_055", "p03807_case_056", "p03807_case_057", "p03807_case_058", "p03807_case_059", "p03807_case_060", "p03807_case_061", "p03807_case_062", "p03807_case_063", "p03807_case_064", "p03807_case_065", "p03807_case_066", "p03807_case_067", "p03807_case_068", "p03807_case_069", "p03807_case_070", "p03807_case_071", "p03807_case_072", "p03807_case_073", "p03807_case_074", "p03807_case_075", "p03807_case_076", "p03807_case_077", "p03807_case_078", "p03807_case_079", "p03807_case_080", "p03807_case_081", "p03807_case_082", "p03807_case_083", "p03807_case_084", "p03807_case_085", "p03807_case_086", "p03807_case_087", "p03807_case_088", "p03807_case_089", "p03807_case_090", "p03807_case_091", "p03807_case_092", "p03807_case_093", "p03807_case_094", "p03807_case_095", "p03807_case_096", "p03807_case_097", "p03807_case_098", "p03807_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N = int(eval(input()))\nA = list(map(int, input().split()))\nc = 0\nfor e in A:\n if e % 2 == 1:\n c += 1\nif c % 2 == 1:\n print(\"NO\")\nelse:\n print(\"YES\")\n", "fast_code_sha256": "b861cafa9e56a6b56448ce2ee20ec17d8f37ee0dbb75a5e7dd10e82725810ec2", "fast_id": "p03807_b861cafa9e56a6b56448ce2ee20ec17d8f37ee0dbb75a5e7dd10e82725810ec2", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N = int(eval(input()))\nA = list(map(int, input().split()))\nc = 0\nfor e in A:\n if e % 2 == 1:\n c += 1\nif c % 2 == 1:\n print(\"NO\")\nelse:\n print(\"YES\")\n", "measured_fast_code_sha256": "b861cafa9e56a6b56448ce2ee20ec17d8f37ee0dbb75a5e7dd10e82725810ec2", "measured_slow_code": "import sys\nimport bisect\nimport collections\nimport fractions\nimport heapq\n\n\ndef slove():\n input = sys.stdin.readline\n n = int(input().rstrip(\"\\n\"))\n a = list(map(int, input().rstrip(\"\\n\").split()))\n cnt = 0\n for i in range(n):\n if a[i] % 2 != 0:\n cnt += 1\n if cnt % 2 == 0:\n print(\"YES\")\n else:\n print(\"NO\")\n\n\nif __name__ == \"__main__\":\n slove()\n", "measured_slow_code_sha256": "8baca45625cd0c593d3689761edf66d3fece4f44f81b27a47e938cff4b898bb0", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 0.9526530710017576, "pair_id": "python_v2_6f22d3cd477af88ba475d448", "per_case_slow_code_faster_fraction": 0.56, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03807", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03807_b861cafa9e56a6b56448ce2ee20ec17d8f37ee0dbb75a5e7dd10e82725810ec2.jsonl.gz", "inputs": "reproduction/python/inputs/p03807.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03807_8baca45625cd0c593d3689761edf66d3fece4f44f81b27a47e938cff4b898bb0.jsonl.gz"}, "slow_code": "import sys\nimport bisect\nimport collections\nimport fractions\nimport heapq\n\n\ndef slove():\n input = sys.stdin.readline\n n = int(input().rstrip(\"\\n\"))\n a = list(map(int, input().rstrip(\"\\n\").split()))\n cnt = 0\n for i in range(n):\n if a[i] % 2 != 0:\n cnt += 1\n if cnt % 2 == 0:\n print(\"YES\")\n else:\n print(\"NO\")\n\n\nif __name__ == \"__main__\":\n slove()\n", "slow_code_sha256": "8baca45625cd0c593d3689761edf66d3fece4f44f81b27a47e938cff4b898bb0", "slow_id": "p03807_8baca45625cd0c593d3689761edf66d3fece4f44f81b27a47e938cff4b898bb0", "speedup": 4.085162596504946, "stratum": "4-8", "within_pair_jaccard": 0.39473684210526316, "workload": {"case_count": 100, "description": "Repeatedly replace two integers of the same parity by their sum. Determine whether an N-element positive integer multiset can be reduced to exactly one integer. Observed inputs: N=2..100000 (median 99999); a_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1049995, "median": 200007.0, "min": 6}, "input_format": ["N\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100001, "median": 100000.0, "min": 3}}} -{"case_ids": ["p02607_case_000", "p02607_case_001", "p02607_case_002", "p02607_case_003", "p02607_case_004", "p02607_case_005", "p02607_case_006", "p02607_case_007", "p02607_case_008", "p02607_case_009", "p02607_case_010", "p02607_case_011", "p02607_case_012", "p02607_case_013", "p02607_case_014", "p02607_case_015", "p02607_case_016", "p02607_case_017", "p02607_case_018", "p02607_case_019", "p02607_case_020", "p02607_case_021", "p02607_case_022", "p02607_case_023", "p02607_case_024", "p02607_case_025", "p02607_case_026", "p02607_case_027", "p02607_case_028", "p02607_case_029", "p02607_case_030", "p02607_case_031", "p02607_case_032", "p02607_case_033", "p02607_case_034", "p02607_case_035", "p02607_case_036", "p02607_case_037", "p02607_case_038", "p02607_case_039", "p02607_case_040", "p02607_case_041", "p02607_case_042", "p02607_case_043", "p02607_case_044", "p02607_case_045", "p02607_case_046", "p02607_case_047", "p02607_case_048", "p02607_case_049", "p02607_case_050", "p02607_case_051", "p02607_case_052", "p02607_case_053", "p02607_case_054", "p02607_case_055", "p02607_case_056", "p02607_case_057", "p02607_case_058", "p02607_case_059", "p02607_case_060", "p02607_case_061", "p02607_case_062", "p02607_case_063", "p02607_case_064", "p02607_case_065", "p02607_case_066", "p02607_case_067", "p02607_case_068", "p02607_case_069", "p02607_case_070", "p02607_case_071", "p02607_case_072", "p02607_case_073", "p02607_case_074", "p02607_case_075", "p02607_case_076", "p02607_case_077", "p02607_case_078", "p02607_case_079", "p02607_case_080", "p02607_case_081", "p02607_case_082", "p02607_case_083", "p02607_case_084", "p02607_case_085", "p02607_case_086", "p02607_case_087", "p02607_case_088", "p02607_case_089", "p02607_case_090", "p02607_case_091", "p02607_case_092", "p02607_case_093", "p02607_case_094", "p02607_case_095", "p02607_case_096", "p02607_case_097", "p02607_case_098", "p02607_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "print((sum([int(x) % 2 for x in open(0).read().split()[1::2]])))\n", "fast_code_sha256": "71ec450d2eab5fa72e6248a375ea9647714fc66e77f68c002e360598525c3061", "fast_id": "p02607_71ec450d2eab5fa72e6248a375ea9647714fc66e77f68c002e360598525c3061", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "print((sum([int(x) % 2 for x in open(0).read().split()[1::2]])))\n", "measured_fast_code_sha256": "71ec450d2eab5fa72e6248a375ea9647714fc66e77f68c002e360598525c3061", "measured_slow_code": "import sys\nfrom collections import deque\nimport numpy as np\nimport math\n\nsys.setrecursionlimit(10**6)\n\n\ndef S():\n return sys.stdin.readline().rstrip()\n\n\ndef SL():\n return list(map(str, sys.stdin.readline().rstrip().split()))\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\ndef IL():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef Main():\n n = I()\n a = list(IL())\n c = 0\n for rep in range(0, n, 2):\n if a[rep] % 2:\n c += 1\n print(c)\n return\n\n\nif __name__ == \"__main__\":\n Main()\n", "measured_slow_code_sha256": "80d5226038bdb32cf21a0b535cbd1c7092e4e8009586ccf346a6a6f305bc5b7d", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1573.5600321833303, "pair_id": "python_v2_2339a56d2e29b9d9c69f2c3f", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02607", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02607_71ec450d2eab5fa72e6248a375ea9647714fc66e77f68c002e360598525c3061.jsonl.gz", "inputs": "reproduction/python/inputs/p02607.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02607_80d5226038bdb32cf21a0b535cbd1c7092e4e8009586ccf346a6a6f305bc5b7d.jsonl.gz"}, "slow_code": "import sys\nfrom collections import deque\nimport numpy as np\nimport math\n\nsys.setrecursionlimit(10**6)\n\n\ndef S():\n return sys.stdin.readline().rstrip()\n\n\ndef SL():\n return list(map(str, sys.stdin.readline().rstrip().split()))\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\ndef IL():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef Main():\n n = I()\n a = list(IL())\n c = 0\n for rep in range(0, n, 2):\n if a[rep] % 2:\n c += 1\n print(c)\n return\n\n\nif __name__ == \"__main__\":\n Main()\n", "slow_code_sha256": "80d5226038bdb32cf21a0b535cbd1c7092e4e8009586ccf346a6a6f305bc5b7d", "slow_id": "p02607_80d5226038bdb32cf21a0b535cbd1c7092e4e8009586ccf346a6a6f305bc5b7d", "speedup": 1470.0225101066524, "stratum": "8+", "within_pair_jaccard": 0.17777777777777778, "workload": {"case_count": 100, "description": "Count array entries for which both the 1-based position i and the integer value a_i are odd. Observed inputs: N=1..100 (median 30); a_i=1..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 300, "median": 67.5, "min": 4}, "input_format": ["N\na_1 ... a_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 101, "median": 31.0, "min": 2}}} -{"case_ids": ["p03126_case_000", "p03126_case_001", "p03126_case_002", "p03126_case_003", "p03126_case_004", "p03126_case_005", "p03126_case_006", "p03126_case_007", "p03126_case_008", "p03126_case_009", "p03126_case_010", "p03126_case_011", "p03126_case_012", "p03126_case_013", "p03126_case_014", "p03126_case_015", "p03126_case_016", "p03126_case_017", "p03126_case_018", "p03126_case_019", "p03126_case_020", "p03126_case_021", "p03126_case_022", "p03126_case_023", "p03126_case_024", "p03126_case_025", "p03126_case_026", "p03126_case_027", "p03126_case_028", "p03126_case_029", "p03126_case_030", "p03126_case_031", "p03126_case_032", "p03126_case_033", "p03126_case_034", "p03126_case_035", "p03126_case_036", "p03126_case_037", "p03126_case_038", "p03126_case_039", "p03126_case_040", "p03126_case_041", "p03126_case_042", "p03126_case_043", "p03126_case_044", "p03126_case_045", "p03126_case_046", "p03126_case_047", "p03126_case_048", "p03126_case_049", "p03126_case_050", "p03126_case_051", "p03126_case_052", "p03126_case_053", "p03126_case_054", "p03126_case_055", "p03126_case_056", "p03126_case_057", "p03126_case_058", "p03126_case_059", "p03126_case_060", "p03126_case_061", "p03126_case_062", "p03126_case_063", "p03126_case_064", "p03126_case_065", "p03126_case_066", "p03126_case_067", "p03126_case_068", "p03126_case_069", "p03126_case_070", "p03126_case_071", "p03126_case_072", "p03126_case_073", "p03126_case_074", "p03126_case_075", "p03126_case_076", "p03126_case_077", "p03126_case_078", "p03126_case_079", "p03126_case_080", "p03126_case_081", "p03126_case_082", "p03126_case_083", "p03126_case_084", "p03126_case_085", "p03126_case_086", "p03126_case_087", "p03126_case_088", "p03126_case_089", "p03126_case_090", "p03126_case_091", "p03126_case_092", "p03126_case_093", "p03126_case_094", "p03126_case_095", "p03126_case_096", "p03126_case_097", "p03126_case_098", "p03126_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n, m = list(map(int, input().split()))\nS = set(range(1, m + 1))\nfor i in range(n):\n K, *A = list(map(int, input().split()))\n S &= set(A)\nprint((len(S)))\n", "fast_code_sha256": "4b653d1f388d5cadc773f4288d857efc885a0902797402d957c8f1d21136f39f", "fast_id": "p03126_4b653d1f388d5cadc773f4288d857efc885a0902797402d957c8f1d21136f39f", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n, m = list(map(int, input().split()))\nS = set(range(1, m + 1))\nfor i in range(n):\n K, *A = list(map(int, input().split()))\n S &= set(A)\nprint((len(S)))\n", "measured_fast_code_sha256": "4b653d1f388d5cadc773f4288d857efc885a0902797402d957c8f1d21136f39f", "measured_slow_code": "N, M = list(map(int, input().split()))\nlist = [list(map(int, input().split())) for x in range(N)]\n# 一列目削除\nfor i in range(0, N):\n list[i].pop(0)\nstock = []\n# 解答が全リストにあるか探索\nfor i in range(0, N):\n for j in range(0, len(list[i])):\n cnt = 0\n for k in range(0, N):\n if list[i][j] in list[k]:\n cnt += 1\n if cnt == N:\n stock.append(list[i][j])\nif N == 1:\n stock = list[i]\nprint((len(set(stock))))\n", "measured_slow_code_sha256": "cba8544a349f34548c0cfacd2e62b0d692bf5fdacfd135926ebf79dcf82a2da4", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4.696011015031842, "pair_id": "python_v2_0e133ce96eb4751257c1b2c7", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03126", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03126_4b653d1f388d5cadc773f4288d857efc885a0902797402d957c8f1d21136f39f.jsonl.gz", "inputs": "reproduction/python/inputs/p03126.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03126_cba8544a349f34548c0cfacd2e62b0d692bf5fdacfd135926ebf79dcf82a2da4.jsonl.gz"}, "slow_code": "N, M = list(map(int, input().split()))\nlist = [list(map(int, input().split())) for x in range(N)]\n\nfor i in range(0, N):\n list[i].pop(0)\nstock = []\n\nfor i in range(0, N):\n for j in range(0, len(list[i])):\n cnt = 0\n for k in range(0, N):\n if list[i][j] in list[k]:\n cnt += 1\n if cnt == N:\n stock.append(list[i][j])\nif N == 1:\n stock = list[i]\nprint((len(set(stock))))\n", "slow_code_sha256": "0dc68db287c1c51e9e3ae700494383cca10de9412a38ef778d71183366a2ba69", "slow_id": "p03126_cba8544a349f34548c0cfacd2e62b0d692bf5fdacfd135926ebf79dcf82a2da4", "speedup": 6.029758311111632, "stratum": "4-8", "within_pair_jaccard": 0.4482758620689655, "workload": {"case_count": 100, "description": "Each of N people lists K_i distinct liked food IDs A_i,j from 1..M. Count food kinds liked by every person; the lists need not be sorted. Observed inputs: N=1..30 (median 13); M=1..30 (median 15); K_i=1..30.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 2526, "median": 177.0, "min": 8}, "input_format": ["N M\nK_1 A_1,1 ... A_1,K_1\n...\nK_N A_N,1 ... A_N,K_N"], "input_format_status": "source_input_section", "input_lines": {"max": 31, "median": 14.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 932, "median": 83.0, "min": 4}}} -{"case_ids": ["p03147_case_000", "p03147_case_001", "p03147_case_002", "p03147_case_003", "p03147_case_004", "p03147_case_005", "p03147_case_006", "p03147_case_007", "p03147_case_008", "p03147_case_009", "p03147_case_010", "p03147_case_011", "p03147_case_012", "p03147_case_013", "p03147_case_014", "p03147_case_015", "p03147_case_016", "p03147_case_017", "p03147_case_018", "p03147_case_019", "p03147_case_020", "p03147_case_021", "p03147_case_022", "p03147_case_023", "p03147_case_024", "p03147_case_025", "p03147_case_026", "p03147_case_027", "p03147_case_028", "p03147_case_029", "p03147_case_030", "p03147_case_031", "p03147_case_032", "p03147_case_033", "p03147_case_034", "p03147_case_035", "p03147_case_036", "p03147_case_037", "p03147_case_038", "p03147_case_039", "p03147_case_040", "p03147_case_041", "p03147_case_042", "p03147_case_043", "p03147_case_044", "p03147_case_045", "p03147_case_046", "p03147_case_047", "p03147_case_048", "p03147_case_049", "p03147_case_050", "p03147_case_051", "p03147_case_052", "p03147_case_053", "p03147_case_054", "p03147_case_055", "p03147_case_056", "p03147_case_057", "p03147_case_058", "p03147_case_059", "p03147_case_060", "p03147_case_061", "p03147_case_062", "p03147_case_063", "p03147_case_064", "p03147_case_065", "p03147_case_066", "p03147_case_067", "p03147_case_068", "p03147_case_069", "p03147_case_070", "p03147_case_071", "p03147_case_072", "p03147_case_073", "p03147_case_074", "p03147_case_075", "p03147_case_076", "p03147_case_077", "p03147_case_078", "p03147_case_079", "p03147_case_080", "p03147_case_081", "p03147_case_082", "p03147_case_083", "p03147_case_084", "p03147_case_085", "p03147_case_086", "p03147_case_087", "p03147_case_088", "p03147_case_089", "p03147_case_090", "p03147_case_091", "p03147_case_092", "p03147_case_093", "p03147_case_094", "p03147_case_095", "p03147_case_096", "p03147_case_097", "p03147_case_098", "p03147_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\nh = list(map(int, input().split()))\nans = h[0]\nfor i in range(1, n):\n if h[i] > h[i - 1]:\n ans += h[i] - h[i - 1]\nprint(ans)\n", "fast_code_sha256": "4be88f64ca664c2eac79251ecb1a1e87d14707dab8d2ff3d5c3c0cfb067c5fc2", "fast_id": "p03147_4be88f64ca664c2eac79251ecb1a1e87d14707dab8d2ff3d5c3c0cfb067c5fc2", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\nh = list(map(int, input().split()))\nans = h[0]\nfor i in range(1, n):\n if h[i] > h[i - 1]:\n ans += h[i] - h[i - 1]\nprint(ans)\n", "measured_fast_code_sha256": "4be88f64ca664c2eac79251ecb1a1e87d14707dab8d2ff3d5c3c0cfb067c5fc2", "measured_slow_code": "# from math import factorial,sqrt,ceil,gcd\n# from itertools import permutations as permus\n# from collections import deque,Counter\n# import re\n# from functools import lru_cache # 簡単メモ化 @lru_cache(maxsize=1000)\n# from decimal import Decimal, getcontext\n# # getcontext().prec = 1000\n# # eps = Decimal(10) ** (-100)\nimport numpy as np\n\n# import networkx as nx\n# from scipy.sparse.csgraph import shortest_path, dijkstra, floyd_warshall, bellman_ford, johnson\n# from scipy.sparse import csr_matrix\n# from scipy.special import comb\n# slist = \"abcdefghijklmnopqrstuvwxyz\"\nN = int(eval(input()))\narrA = list(map(int, input().split()))\n# ゼロでリストを分割する\n# def split_list(st):\n# lis = st.split(\"0\")\n# lis = [l for l in lis if l != \"\"]\n# return lis\ndef split_list(lis, num=0):\n res = []\n tmp = []\n for i in lis:\n if i != num:\n tmp.append(i)\n elif i == num and len(tmp) > 0:\n res.append(tmp)\n tmp = []\n else:\n continue\n else:\n res.append(tmp)\n res = [l for l in res if len(l) != 0]\n return res\n\n\nstack = split_list(arrA)\nans = 0\n# リスト毎に処理.len0は処理しない。\nwhile len(stack) > 0:\n lis1 = stack.pop()\n arr = np.array(list(map(int, list(lis1))))\n # 最小値を引いたリストにする。最小値をansに加算\n nmin = min(arr)\n ans += nmin\n arr = arr - nmin\n s = list(arr)\n lis2 = split_list(s)\n stack = stack + lis2\nprint(ans)\n# print(*ans) # unpackして出力。間にスペースが入る\n# for row in board:\n# print(*row,sep=\"\") #unpackして間にスペース入れずに出力する\n# print(\"{:.10f}\".format(ans))\n# print(\"{:0=10d}\".format(ans))\n", "measured_slow_code_sha256": "47a3646cbef4cdc6d777ff253127885ae7b10f34cd8d4fef647dd4916f5b32c1", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 800.6590658916884, "pair_id": "python_v2_0df54c3d56d3ced32b3f2b30", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03147", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03147_4be88f64ca664c2eac79251ecb1a1e87d14707dab8d2ff3d5c3c0cfb067c5fc2.jsonl.gz", "inputs": "reproduction/python/inputs/p03147.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03147_47a3646cbef4cdc6d777ff253127885ae7b10f34cd8d4fef647dd4916f5b32c1.jsonl.gz"}, "slow_code": "import numpy as np\n\n\nN = int(eval(input()))\narrA = list(map(int, input().split()))\n\n\ndef split_list(lis, num=0):\n res = []\n tmp = []\n for i in lis:\n if i != num:\n tmp.append(i)\n elif i == num and len(tmp) > 0:\n res.append(tmp)\n tmp = []\n else:\n continue\n else:\n res.append(tmp)\n res = [l for l in res if len(l) != 0]\n return res\n\n\nstack = split_list(arrA)\nans = 0\n\nwhile len(stack) > 0:\n lis1 = stack.pop()\n arr = np.array(list(map(int, list(lis1))))\n\n nmin = min(arr)\n ans += nmin\n arr = arr - nmin\n s = list(arr)\n lis2 = split_list(s)\n stack = stack + lis2\nprint(ans)\n", "slow_code_sha256": "2ca3826e95bb705eb346cc2325420f54f12d09da747118c657639adcec905d81", "slow_id": "p03147_47a3646cbef4cdc6d777ff253127885ae7b10f34cd8d4fef647dd4916f5b32c1", "speedup": 817.1102356752353, "stratum": "8+", "within_pair_jaccard": 0.2765957446808511, "workload": {"case_count": 100, "description": "N flower heights start at zero. One operation increments every height in a chosen contiguous interval by 1. Minimize operations to obtain exactly the target heights h_i. Observed inputs: N=1..100 (median 50); h_i=0..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 404, "median": 137.0, "min": 4}, "input_format": ["N\nh_1 ... h_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 101, "median": 51.0, "min": 2}}} -{"case_ids": ["p02724_case_000", "p02724_case_001", "p02724_case_002", "p02724_case_003", "p02724_case_004", "p02724_case_005", "p02724_case_006", "p02724_case_007", "p02724_case_008", "p02724_case_009", "p02724_case_010", "p02724_case_011", "p02724_case_012", "p02724_case_013", "p02724_case_014", "p02724_case_015", "p02724_case_016", "p02724_case_017", "p02724_case_018", "p02724_case_019", "p02724_case_020", "p02724_case_021", "p02724_case_022", "p02724_case_023", "p02724_case_024", "p02724_case_025", "p02724_case_026", "p02724_case_027", "p02724_case_028", "p02724_case_029", "p02724_case_030", "p02724_case_031", "p02724_case_032", "p02724_case_033", "p02724_case_034", "p02724_case_035", "p02724_case_036", "p02724_case_037", "p02724_case_038", "p02724_case_039", "p02724_case_040", "p02724_case_041", "p02724_case_042", "p02724_case_043", "p02724_case_044", "p02724_case_045", "p02724_case_046", "p02724_case_047", "p02724_case_048", "p02724_case_049", "p02724_case_050", "p02724_case_051", "p02724_case_052", "p02724_case_053", "p02724_case_054", "p02724_case_055", "p02724_case_056", "p02724_case_057", "p02724_case_058", "p02724_case_059", "p02724_case_060", "p02724_case_061", "p02724_case_062", "p02724_case_063", "p02724_case_064", "p02724_case_065", "p02724_case_066", "p02724_case_067", "p02724_case_068", "p02724_case_069", "p02724_case_070", "p02724_case_071", "p02724_case_072", "p02724_case_073", "p02724_case_074", "p02724_case_075", "p02724_case_076", "p02724_case_077", "p02724_case_078", "p02724_case_079", "p02724_case_080", "p02724_case_081", "p02724_case_082", "p02724_case_083", "p02724_case_084", "p02724_case_085", "p02724_case_086", "p02724_case_087", "p02724_case_088", "p02724_case_089", "p02724_case_090", "p02724_case_091", "p02724_case_092", "p02724_case_093", "p02724_case_094", "p02724_case_095", "p02724_case_096", "p02724_case_097", "p02724_case_098", "p02724_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "X = int(eval(input()))\nprint(((X // 500) * 1000 + (X % 500) // 5 * 5))\n", "fast_code_sha256": "bdf2b5319812a1a3063118df44de51d0a6ac2c760efc280231a0134cd43d7060", "fast_id": "p02724_bdf2b5319812a1a3063118df44de51d0a6ac2c760efc280231a0134cd43d7060", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "X = int(eval(input()))\nprint(((X // 500) * 1000 + (X % 500) // 5 * 5))\n", "measured_fast_code_sha256": "bdf2b5319812a1a3063118df44de51d0a6ac2c760efc280231a0134cd43d7060", "measured_slow_code": "def main():\n X = int(eval(input()))\n # 500円をp個、5円をq個とすると。500p+5q=Xが成り立ち、ansは1000p+5qになる\n pmax = int(X / 500)\n ans = 0\n tmp = 0\n for p in range(pmax + 1):\n q = int((X - 500 * p) / 5)\n tmp = 1000 * p + 5 * q\n ans = max(ans, tmp)\n print(ans)\n\n\nmain()\n", "measured_slow_code_sha256": "8e66543c4bfccd29b9635f672d4f7cfeb7472d55523631a6fef9ea761e351dd5", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 16204.521501508392, "pair_id": "python_v2_50af6e5dc87c721a3a3c16bd", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02724", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02724_bdf2b5319812a1a3063118df44de51d0a6ac2c760efc280231a0134cd43d7060.jsonl.gz", "inputs": "reproduction/python/inputs/p02724.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02724_8e66543c4bfccd29b9635f672d4f7cfeb7472d55523631a6fef9ea761e351dd5.jsonl.gz"}, "slow_code": "def main():\n X = int(eval(input()))\n\n pmax = int(X / 500)\n ans = 0\n tmp = 0\n for p in range(pmax + 1):\n q = int((X - 500 * p) / 5)\n tmp = 1000 * p + 5 * q\n ans = max(ans, tmp)\n print(ans)\n\n\nmain()\n", "slow_code_sha256": "ce23ce9602140709d4fba80da208b63c8ba5d91a22dfdb9a0bca025c1f37682a", "slow_id": "p02724_8e66543c4bfccd29b9635f672d4f7cfeb7472d55523631a6fef9ea761e351dd5", "speedup": 3800.1493572502736, "stratum": "8+", "within_pair_jaccard": 0.23809523809523808, "workload": {"case_count": 100, "description": "Exchange amount X into coins of values 500,100,50,10,5,1. Maximize happiness: each 500-value coin earns 1000 points and each 5-value coin earns 5; other coins earn none. Observed inputs: X=0..1000000000 (median 393604620).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 11, "median": 10.0, "min": 2}, "input_format": ["X"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p03207_case_000", "p03207_case_001", "p03207_case_002", "p03207_case_003", "p03207_case_004", "p03207_case_005", "p03207_case_006", "p03207_case_007", "p03207_case_008", "p03207_case_009", "p03207_case_010", "p03207_case_011", "p03207_case_012", "p03207_case_013", "p03207_case_014", "p03207_case_015", "p03207_case_016", "p03207_case_017", "p03207_case_018", "p03207_case_019", "p03207_case_020", "p03207_case_021", "p03207_case_022", "p03207_case_023", "p03207_case_024", "p03207_case_025", "p03207_case_026", "p03207_case_027", "p03207_case_028", "p03207_case_029", "p03207_case_030", "p03207_case_031", "p03207_case_032", "p03207_case_033", "p03207_case_034", "p03207_case_035", "p03207_case_036", "p03207_case_037", "p03207_case_038", "p03207_case_039", "p03207_case_040", "p03207_case_041", "p03207_case_042", "p03207_case_043", "p03207_case_044", "p03207_case_045", "p03207_case_046", "p03207_case_047", "p03207_case_048", "p03207_case_049", "p03207_case_050", "p03207_case_051", "p03207_case_052", "p03207_case_053", "p03207_case_054", "p03207_case_055", "p03207_case_056", "p03207_case_057", "p03207_case_058", "p03207_case_059", "p03207_case_060", "p03207_case_061", "p03207_case_062", "p03207_case_063", "p03207_case_064", "p03207_case_065", "p03207_case_066", "p03207_case_067", "p03207_case_068", "p03207_case_069", "p03207_case_070", "p03207_case_071", "p03207_case_072", "p03207_case_073", "p03207_case_074", "p03207_case_075", "p03207_case_076", "p03207_case_077", "p03207_case_078", "p03207_case_079", "p03207_case_080", "p03207_case_081", "p03207_case_082", "p03207_case_083", "p03207_case_084", "p03207_case_085", "p03207_case_086", "p03207_case_087", "p03207_case_088", "p03207_case_089", "p03207_case_090", "p03207_case_091", "p03207_case_092", "p03207_case_093", "p03207_case_094", "p03207_case_095", "p03207_case_096", "p03207_case_097", "p03207_case_098", "p03207_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N = int(eval(input()))\np = []\nfor _ in range(N):\n p.append(int(eval(input())))\nprint((sum(p) - max(p) // 2))\n", "fast_code_sha256": "4f3d85eaacfd2e240e72d8947416edfca715e6964b62d6aa7aeb66b88bad5ee5", "fast_id": "p03207_4f3d85eaacfd2e240e72d8947416edfca715e6964b62d6aa7aeb66b88bad5ee5", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N = int(eval(input()))\np = []\nfor _ in range(N):\n p.append(int(eval(input())))\nprint((sum(p) - max(p) // 2))\n", "measured_fast_code_sha256": "4f3d85eaacfd2e240e72d8947416edfca715e6964b62d6aa7aeb66b88bad5ee5", "measured_slow_code": "#!/usr/bin/env python3\n# encoding:utf-8\nimport copy\nimport random\nimport bisect # bisect_left これで二部探索の大小検索が行える\nimport fractions # 最小公倍数などはこっち\nimport math\nimport sys\nimport collections\nfrom decimal import Decimal # 10進数で考慮できる\n\nmod = 10**9 + 7\nsys.setrecursionlimit(mod) # 再帰回数上限はでdefault1000\nd = collections.deque()\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\nN = int(eval(input()))\np = [0 for i in range(N)]\nfor i in range(N):\n p[i] = int(eval(input()))\np.sort()\nans = sum(p)\nans -= p[-1] // 2\nprint(ans)\n", "measured_slow_code_sha256": "5cb7a4c7cf0d8a71a4fd49887b2da818d3766f3e397b1d44bc46374144eeebdc", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 26.57539326496646, "pair_id": "python_v2_882b2b918f516183e98cdce9", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03207", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03207_4f3d85eaacfd2e240e72d8947416edfca715e6964b62d6aa7aeb66b88bad5ee5.jsonl.gz", "inputs": "reproduction/python/inputs/p03207.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03207_5cb7a4c7cf0d8a71a4fd49887b2da818d3766f3e397b1d44bc46374144eeebdc.jsonl.gz"}, "slow_code": "import copy\nimport random\nimport bisect\nimport fractions\nimport math\nimport sys\nimport collections\nfrom decimal import Decimal\n\nmod = 10**9 + 7\nsys.setrecursionlimit(mod)\nd = collections.deque()\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\nN = int(eval(input()))\np = [0 for i in range(N)]\nfor i in range(N):\n p[i] = int(eval(input()))\np.sort()\nans = sum(p)\nans -= p[-1] // 2\nprint(ans)\n", "slow_code_sha256": "fe2f7e4c4fa4bf811a1052a7e9a8cc8bf127a2538fd41f3ded0df182a9217e19", "slow_id": "p03207_5cb7a4c7cf0d8a71a4fd49887b2da818d3766f3e397b1d44bc46374144eeebdc", "speedup": 26.631082341792865, "stratum": "8+", "within_pair_jaccard": 0.22727272727272727, "workload": {"case_count": 100, "description": "Buy all N items, using one coupon to halve the price of one highest-priced item. Other items retain full price; every p_i is even. Output total payment. Observed inputs: N=2..10 (median 5); p_i=100..10000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 63, "median": 24.0, "min": 10}, "input_format": ["N\np_1\n...\np_N"], "input_format_status": "source_input_section", "input_lines": {"max": 11, "median": 6.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 11, "median": 6.0, "min": 3}}} -{"case_ids": ["p02935_case_000", "p02935_case_001", "p02935_case_002", "p02935_case_003", "p02935_case_004", "p02935_case_005", "p02935_case_006", "p02935_case_007", "p02935_case_008", "p02935_case_009", "p02935_case_010", "p02935_case_011", "p02935_case_012", "p02935_case_013", "p02935_case_014", "p02935_case_015", "p02935_case_016", "p02935_case_017", "p02935_case_018", "p02935_case_019", "p02935_case_020", "p02935_case_021", "p02935_case_022", "p02935_case_023", "p02935_case_024", "p02935_case_025", "p02935_case_026", "p02935_case_027", "p02935_case_028", "p02935_case_029", "p02935_case_030", "p02935_case_031", "p02935_case_032", "p02935_case_033", "p02935_case_034", "p02935_case_035", "p02935_case_036", "p02935_case_037", "p02935_case_038", "p02935_case_039", "p02935_case_040", "p02935_case_041", "p02935_case_042", "p02935_case_043", "p02935_case_044", "p02935_case_045", "p02935_case_046", "p02935_case_047", "p02935_case_048", "p02935_case_049", "p02935_case_050", "p02935_case_051", "p02935_case_052", "p02935_case_053", "p02935_case_054", "p02935_case_055", "p02935_case_056", "p02935_case_057", "p02935_case_058", "p02935_case_059", "p02935_case_060", "p02935_case_061", "p02935_case_062", "p02935_case_063", "p02935_case_064", "p02935_case_065", "p02935_case_066", "p02935_case_067", "p02935_case_068", "p02935_case_069", "p02935_case_070", "p02935_case_071", "p02935_case_072", "p02935_case_073", "p02935_case_074", "p02935_case_075", "p02935_case_076", "p02935_case_077", "p02935_case_078", "p02935_case_079", "p02935_case_080", "p02935_case_081", "p02935_case_082", "p02935_case_083", "p02935_case_084", "p02935_case_085", "p02935_case_086", "p02935_case_087", "p02935_case_088", "p02935_case_089", "p02935_case_090", "p02935_case_091", "p02935_case_092", "p02935_case_093", "p02935_case_094", "p02935_case_095", "p02935_case_096", "p02935_case_097", "p02935_case_098", "p02935_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from sys import stdin, setrecursionlimit\n\n\nsetrecursionlimit(10**6)\ninput = stdin.readline\nn = int(eval(input()))\na = sorted([int(i) for i in input().split()])\nans = (a[0] + a[1]) / 2\nfor i in range(2, n):\n ans = (ans + a[i]) / 2\nprint(ans)\n", "fast_code_sha256": "d272bd390da93e5342e0f26f50ec6104e53a22ae1e5dc017b987c67b2d250a5c", "fast_id": "p02935_9e7e208106351a07dd291fe6f15b34e49212e19e2b89ac1aa53abbfd73bacd8b", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "# import pysnooper\n# import os,re,sys,operator,math,heapq,string\n# from collections import Counter,deque\n# from operator import itemgetter\n# from itertools import accumulate,combinations,groupby,combinations_with_replacement\nfrom sys import stdin, setrecursionlimit\n\n# from copy import deepcopy\nsetrecursionlimit(10**6)\ninput = stdin.readline\nn = int(eval(input()))\na = sorted([int(i) for i in input().split()])\nans = (a[0] + a[1]) / 2\nfor i in range(2, n):\n ans = (ans + a[i]) / 2\nprint(ans)\n", "measured_fast_code_sha256": "9e7e208106351a07dd291fe6f15b34e49212e19e2b89ac1aa53abbfd73bacd8b", "measured_slow_code": "import numpy as np\n\nN = int(eval(input()))\nstr_list = input().split(\" \")\nA = [int(x) for x in str_list]\nA = np.array(A)\nwhile len(A) > 1:\n first_min = A[A.argmin()]\n # print(first_min)\n A = np.delete(A, A.argmin())\n second_min = A[A.argmin()]\n # print(second_min)\n A = np.delete(A, A.argmin())\n mean = (first_min + second_min) / 2.0\n A = np.append(A, mean)\n # print(A)\nprint(mean)\n", "measured_slow_code_sha256": "469a8dbe0d6e33ac7f370cd3ccb58bdf599ddcbe6d94e7cc5a7cde68de5db05a", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 717.0008219487711, "pair_id": "python_v2_d177a5024028781635714781", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02935", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02935_9e7e208106351a07dd291fe6f15b34e49212e19e2b89ac1aa53abbfd73bacd8b.jsonl.gz", "inputs": "reproduction/python/inputs/p02935.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02935_469a8dbe0d6e33ac7f370cd3ccb58bdf599ddcbe6d94e7cc5a7cde68de5db05a.jsonl.gz"}, "slow_code": "import numpy as np\n\nN = int(eval(input()))\nstr_list = input().split(\" \")\nA = [int(x) for x in str_list]\nA = np.array(A)\nwhile len(A) > 1:\n first_min = A[A.argmin()]\n\n A = np.delete(A, A.argmin())\n second_min = A[A.argmin()]\n\n A = np.delete(A, A.argmin())\n mean = (first_min + second_min) / 2.0\n A = np.append(A, mean)\n\nprint(mean)\n", "slow_code_sha256": "f9cf033ef3320a5fdaabd7fadad3d7ff479bba43226bb8f92e09489a3fd88f4d", "slow_id": "p02935_469a8dbe0d6e33ac7f370cd3ccb58bdf599ddcbe6d94e7cc5a7cde68de5db05a", "speedup": 708.8971583985787, "stratum": "8+", "within_pair_jaccard": 0.275, "workload": {"case_count": 100, "description": "Repeatedly replace two ingredient values x and y by their arithmetic mean (x+y)/2. Starting with N input values v_i, maximize the final value after N-1 replacements. Observed inputs: N=2..50 (median 25); v_i=1..1000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 253, "median": 102.5, "min": 6}, "input_format": ["N\nv_1 ... v_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 51, "median": 26.0, "min": 3}}} -{"case_ids": ["p02982_case_000", "p02982_case_001", "p02982_case_002", "p02982_case_003", "p02982_case_004", "p02982_case_005", "p02982_case_006", "p02982_case_007", "p02982_case_008", "p02982_case_009", "p02982_case_010", "p02982_case_011", "p02982_case_012", "p02982_case_013", "p02982_case_014", "p02982_case_015", "p02982_case_016", "p02982_case_017", "p02982_case_018", "p02982_case_019", "p02982_case_020", "p02982_case_021", "p02982_case_022", "p02982_case_023", "p02982_case_024", "p02982_case_025", "p02982_case_026", "p02982_case_027", "p02982_case_028", "p02982_case_029", "p02982_case_030", "p02982_case_031", "p02982_case_032", "p02982_case_033", "p02982_case_034", "p02982_case_035", "p02982_case_036", "p02982_case_037", "p02982_case_038", "p02982_case_039", "p02982_case_040", "p02982_case_041", "p02982_case_042", "p02982_case_043", "p02982_case_044", "p02982_case_045", "p02982_case_046", "p02982_case_047", "p02982_case_048", "p02982_case_049", "p02982_case_050", "p02982_case_051", "p02982_case_052", "p02982_case_053", "p02982_case_054", "p02982_case_055", "p02982_case_056", "p02982_case_057", "p02982_case_058", "p02982_case_059", "p02982_case_060", "p02982_case_061", "p02982_case_062", "p02982_case_063", "p02982_case_064", "p02982_case_065", "p02982_case_066", "p02982_case_067", "p02982_case_068", "p02982_case_069", "p02982_case_070", "p02982_case_071", "p02982_case_072", "p02982_case_073", "p02982_case_074", "p02982_case_075", "p02982_case_076", "p02982_case_077", "p02982_case_078", "p02982_case_079", "p02982_case_080", "p02982_case_081", "p02982_case_082", "p02982_case_083", "p02982_case_084", "p02982_case_085", "p02982_case_086", "p02982_case_087", "p02982_case_088", "p02982_case_089", "p02982_case_090", "p02982_case_091", "p02982_case_092", "p02982_case_093", "p02982_case_094", "p02982_case_095", "p02982_case_096", "p02982_case_097", "p02982_case_098", "p02982_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n, d = list(map(int, input().split()))\nx = [list(map(int, input().split())) for _ in range(n)]\nans = 0\nfor i in range(n - 1):\n for j in range(i + 1, n):\n t = 0\n for k in range(d):\n t += abs(x[i][k] - x[j][k]) ** 2\n t **= 0.5\n if t.is_integer():\n ans += 1\nprint(ans)\n", "fast_code_sha256": "b40bee92d8114fee049f53fd3148b205b06aef3deaa651d2e75191cd4ce76077", "fast_id": "p02982_b40bee92d8114fee049f53fd3148b205b06aef3deaa651d2e75191cd4ce76077", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n, d = list(map(int, input().split()))\nx = [list(map(int, input().split())) for _ in range(n)]\nans = 0\nfor i in range(n - 1):\n for j in range(i + 1, n):\n t = 0\n for k in range(d):\n t += abs(x[i][k] - x[j][k]) ** 2\n t **= 0.5\n if t.is_integer():\n ans += 1\nprint(ans)\n", "measured_fast_code_sha256": "b40bee92d8114fee049f53fd3148b205b06aef3deaa651d2e75191cd4ce76077", "measured_slow_code": "import numpy as np\n\nN, D = list(map(int, input().split()))\nX = np.zeros((N, D))\nfor i in range(N):\n X[i][:] = list(map(int, input().split()))\nn = 0\nfor i in range(N):\n for j in range(i + 1, N):\n dist = np.linalg.norm(X[i] - X[j])\n if dist.is_integer():\n n += 1\nprint(n)\n", "measured_slow_code_sha256": "3062723b648fda295737e748d4e0d5d9caa11a6c4d2d4160eb2931cf3e53df51", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 514.065575115233, "pair_id": "python_v2_f0e77b87883b9c9f718913f6", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02982", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02982_b40bee92d8114fee049f53fd3148b205b06aef3deaa651d2e75191cd4ce76077.jsonl.gz", "inputs": "reproduction/python/inputs/p02982.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02982_3062723b648fda295737e748d4e0d5d9caa11a6c4d2d4160eb2931cf3e53df51.jsonl.gz"}, "slow_code": "import numpy as np\n\nN, D = list(map(int, input().split()))\nX = np.zeros((N, D))\nfor i in range(N):\n X[i][:] = list(map(int, input().split()))\nn = 0\nfor i in range(N):\n for j in range(i + 1, N):\n dist = np.linalg.norm(X[i] - X[j])\n if dist.is_integer():\n n += 1\nprint(n)\n", "slow_code_sha256": "3062723b648fda295737e748d4e0d5d9caa11a6c4d2d4160eb2931cf3e53df51", "slow_id": "p02982_3062723b648fda295737e748d4e0d5d9caa11a6c4d2d4160eb2931cf3e53df51", "speedup": 409.80250551134844, "stratum": "8+", "within_pair_jaccard": 0.4444444444444444, "workload": {"case_count": 100, "description": "Given N distinct points with integer coordinates in D dimensions, count unordered pairs at integer Euclidean distance. Observed inputs: N=2..10 (median 5); D=1..10 (median 3); X_i_j=-20..20.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 321, "median": 50.0, "min": 8}, "input_format": ["N D\nX_1,1 ... X_1,D\n...\nX_N,1 ... X_N,D"], "input_format_status": "source_input_section", "input_lines": {"max": 11, "median": 6.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 102, "median": 17.0, "min": 4}}} -{"case_ids": ["p03816_case_000", "p03816_case_001", "p03816_case_002", "p03816_case_003", "p03816_case_004", "p03816_case_005", "p03816_case_006", "p03816_case_007", "p03816_case_008", "p03816_case_009", "p03816_case_010", "p03816_case_011", "p03816_case_012", "p03816_case_013", "p03816_case_014", "p03816_case_015", "p03816_case_016", "p03816_case_017", "p03816_case_018", "p03816_case_019", "p03816_case_020", "p03816_case_021", "p03816_case_022", "p03816_case_023", "p03816_case_024", "p03816_case_025", "p03816_case_026", "p03816_case_027", "p03816_case_028", "p03816_case_029", "p03816_case_030", "p03816_case_031", "p03816_case_032", "p03816_case_033", "p03816_case_034", "p03816_case_035", "p03816_case_036", "p03816_case_037", "p03816_case_038", "p03816_case_039", "p03816_case_040", "p03816_case_041", "p03816_case_042", "p03816_case_043", "p03816_case_044", "p03816_case_045", "p03816_case_046", "p03816_case_047", "p03816_case_048", "p03816_case_049", "p03816_case_050", "p03816_case_051", "p03816_case_052", "p03816_case_053", "p03816_case_054", "p03816_case_055", "p03816_case_056", "p03816_case_057", "p03816_case_058", "p03816_case_059", "p03816_case_060", "p03816_case_061", "p03816_case_062", "p03816_case_063", "p03816_case_064", "p03816_case_065", "p03816_case_066", "p03816_case_067", "p03816_case_068", "p03816_case_069", "p03816_case_070", "p03816_case_071", "p03816_case_072", "p03816_case_073", "p03816_case_074", "p03816_case_075", "p03816_case_076", "p03816_case_077", "p03816_case_078", "p03816_case_079", "p03816_case_080", "p03816_case_081", "p03816_case_082", "p03816_case_083", "p03816_case_084", "p03816_case_085", "p03816_case_086", "p03816_case_087", "p03816_case_088", "p03816_case_089", "p03816_case_090", "p03816_case_091", "p03816_case_092", "p03816_case_093", "p03816_case_094", "p03816_case_095", "p03816_case_096", "p03816_case_097", "p03816_case_098", "p03816_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N = int(eval(input()))\nK = len(set(input().split()))\nprint((K + K % 2 - 1))\n", "fast_code_sha256": "42fd946296e2cc4c45de3a87d9546d1fa8f9bc0670b53e142fd1806c927bbecc", "fast_id": "p03816_42fd946296e2cc4c45de3a87d9546d1fa8f9bc0670b53e142fd1806c927bbecc", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N = int(eval(input()))\nK = len(set(input().split()))\nprint((K + K % 2 - 1))\n", "measured_fast_code_sha256": "42fd946296e2cc4c45de3a87d9546d1fa8f9bc0670b53e142fd1806c927bbecc", "measured_slow_code": "# -*- coding: utf-8 -*-\nimport sys\nfrom collections import Counter\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef list2d(a, b, c):\n return [[c] * b for i in range(a)]\n\n\ndef list3d(a, b, c, d):\n return [[[d] * c for j in range(b)] for i in range(a)]\n\n\ndef list4d(a, b, c, d, e):\n return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]\n\n\ndef ceil(x, y=1):\n return int(-(-x // y))\n\n\ndef INT():\n return int(eval(input()))\n\n\ndef MAP():\n return list(map(int, input().split()))\n\n\ndef LIST(N=None):\n return list(MAP()) if N is None else [INT() for i in range(N)]\n\n\ndef Yes():\n print(\"Yes\")\n\n\ndef No():\n print(\"No\")\n\n\ndef YES():\n print(\"YES\")\n\n\ndef NO():\n print(\"NO\")\n\n\nsys.setrecursionlimit(10**9)\nINF = 10**18\nMOD = 10**9 + 7\nN = INT()\nA = LIST()\nC = Counter(A)\nfor k in list(C.keys()):\n C[k] -= 1\ncnt = ceil(sum(C.values()), 2)\nans = N - cnt * 2\nprint(ans)\n", "measured_slow_code_sha256": "cd261cf88c872972dfadc5364a7357c78d05140e7f65e08d32b89b2d58b8f04e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 5.847991774324069, "pair_id": "python_v2_d807dc34a4fe070523fae949", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03816", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03816_42fd946296e2cc4c45de3a87d9546d1fa8f9bc0670b53e142fd1806c927bbecc.jsonl.gz", "inputs": "reproduction/python/inputs/p03816.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03816_cd261cf88c872972dfadc5364a7357c78d05140e7f65e08d32b89b2d58b8f04e.jsonl.gz"}, "slow_code": "import sys\nfrom collections import Counter\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef list2d(a, b, c):\n return [[c] * b for i in range(a)]\n\n\ndef list3d(a, b, c, d):\n return [[[d] * c for j in range(b)] for i in range(a)]\n\n\ndef list4d(a, b, c, d, e):\n return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]\n\n\ndef ceil(x, y=1):\n return int(-(-x // y))\n\n\ndef INT():\n return int(eval(input()))\n\n\ndef MAP():\n return list(map(int, input().split()))\n\n\ndef LIST(N=None):\n return list(MAP()) if N is None else [INT() for i in range(N)]\n\n\ndef Yes():\n print(\"Yes\")\n\n\ndef No():\n print(\"No\")\n\n\ndef YES():\n print(\"YES\")\n\n\ndef NO():\n print(\"NO\")\n\n\nsys.setrecursionlimit(10**9)\nINF = 10**18\nMOD = 10**9 + 7\nN = INT()\nA = LIST()\nC = Counter(A)\nfor k in list(C.keys()):\n C[k] -= 1\ncnt = ceil(sum(C.values()), 2)\nans = N - cnt * 2\nprint(ans)\n", "slow_code_sha256": "896723e2bf76bb96b8b6635af7130472456bbc356c9112c262e864be4b09cbcb", "slow_id": "p03816_cd261cf88c872972dfadc5364a7357c78d05140e7f65e08d32b89b2d58b8f04e", "speedup": 6.025688544151045, "stratum": "4-8", "within_pair_jaccard": 0.12307692307692308, "workload": {"case_count": 100, "description": "From an odd-sized deck, repeatedly choose three arbitrary cards, discard a largest and a smallest, and return the remaining card. Maximize the number left with all values pairwise distinct. Zero operations are allowed. Observed inputs: N=3..99999 (median 12345); A_i=1..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 600000, "median": 72946.5, "min": 17}, "input_format": ["N\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100000, "median": 12346.0, "min": 4}}} -{"case_ids": ["p03805_case_000", "p03805_case_001", "p03805_case_002", "p03805_case_003", "p03805_case_004", "p03805_case_005", "p03805_case_006", "p03805_case_007", "p03805_case_008", "p03805_case_009", "p03805_case_010", "p03805_case_011", "p03805_case_012", "p03805_case_013", "p03805_case_014", "p03805_case_015", "p03805_case_016", "p03805_case_017", "p03805_case_018", "p03805_case_019", "p03805_case_020", "p03805_case_021", "p03805_case_022", "p03805_case_023", "p03805_case_024", "p03805_case_025", "p03805_case_026", "p03805_case_027", "p03805_case_028", "p03805_case_029", "p03805_case_030", "p03805_case_031", "p03805_case_032", "p03805_case_033", "p03805_case_034", "p03805_case_035", "p03805_case_036", "p03805_case_037", "p03805_case_038", "p03805_case_039", "p03805_case_040", "p03805_case_041", "p03805_case_042", "p03805_case_043", "p03805_case_044", "p03805_case_045", "p03805_case_046", "p03805_case_047", "p03805_case_048", "p03805_case_049", "p03805_case_050", "p03805_case_051", "p03805_case_052", "p03805_case_053", "p03805_case_054", "p03805_case_055", "p03805_case_056", "p03805_case_057", "p03805_case_058", "p03805_case_059", "p03805_case_060", "p03805_case_061", "p03805_case_062", "p03805_case_063", "p03805_case_064", "p03805_case_065", "p03805_case_066", "p03805_case_067", "p03805_case_068", "p03805_case_069", "p03805_case_070", "p03805_case_071", "p03805_case_072", "p03805_case_073", "p03805_case_074", "p03805_case_075", "p03805_case_076", "p03805_case_077", "p03805_case_078", "p03805_case_079", "p03805_case_080", "p03805_case_081", "p03805_case_082", "p03805_case_083", "p03805_case_084", "p03805_case_085", "p03805_case_086", "p03805_case_087", "p03805_case_088", "p03805_case_089", "p03805_case_090", "p03805_case_091", "p03805_case_092", "p03805_case_093", "p03805_case_094", "p03805_case_095", "p03805_case_096", "p03805_case_097", "p03805_case_098", "p03805_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def dfs(g, v, depth):\n if seen[v] == True:\n return 0\n if depth == n:\n return 1\n seen[v] = True\n paths = 0\n for next_v in g[v]:\n paths += dfs(g, next_v, depth + 1)\n seen[v] = False\n return paths\n\n\nn, m = list(map(int, input().split()))\ng = [[] * (n + 1) for _ in range(n + 1)]\nfor _ in range(m):\n a, b = list(map(int, input().split()))\n g[a].append(b)\n g[b].append(a)\nseen = [False] * (n + 1)\nprint((dfs(g, 1, 1)))\n", "fast_code_sha256": "a620481f3b7cfeaa52614041350821475c36a00a00127dabad7a89fbc7099746", "fast_id": "p03805_a620481f3b7cfeaa52614041350821475c36a00a00127dabad7a89fbc7099746", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def dfs(g, v, depth):\n if seen[v] == True:\n return 0\n if depth == n:\n return 1\n seen[v] = True\n paths = 0\n for next_v in g[v]:\n paths += dfs(g, next_v, depth + 1)\n seen[v] = False\n return paths\n\n\nn, m = list(map(int, input().split()))\ng = [[] * (n + 1) for _ in range(n + 1)]\nfor _ in range(m):\n a, b = list(map(int, input().split()))\n g[a].append(b)\n g[b].append(a)\nseen = [False] * (n + 1)\nprint((dfs(g, 1, 1)))\n", "measured_fast_code_sha256": "a620481f3b7cfeaa52614041350821475c36a00a00127dabad7a89fbc7099746", "measured_slow_code": "from typing import List, Tuple\n\n\ndef main():\n n, m = list(map(int, input().split()))\n g = []\n for _ in range(m):\n a, b = list(map(int, input().split()))\n g.append((a, b))\n print((osp(n, g)))\n\n\ndef osp(n: int, g: List[Tuple[int, int]]) -> int:\n v = [False] * n\n g = set(g)\n return dfs(0, v, n, g)\n\n\ndef dfs(i, v, n, g):\n v[i] = True\n if all(v):\n v[i] = False\n return 1\n cnt = 0\n for j in range(n):\n if v[j]:\n continue\n if not ((i + 1, j + 1) in g or (j + 1, i + 1) in g):\n continue\n cnt += dfs(j, v, n, g)\n v[i] = False\n return cnt\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "562f6e02e8417832e28d70eb3bf85554d0ed3aeb8b43d97c409d2d577ce8e26f", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 8.91208581913202, "pair_id": "python_v2_abcc6be0d635c9cbd4ec19de", "per_case_slow_code_faster_fraction": 0.02, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03805", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03805_a620481f3b7cfeaa52614041350821475c36a00a00127dabad7a89fbc7099746.jsonl.gz", "inputs": "reproduction/python/inputs/p03805.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03805_562f6e02e8417832e28d70eb3bf85554d0ed3aeb8b43d97c409d2d577ce8e26f.jsonl.gz"}, "slow_code": "from typing import List, Tuple\n\n\ndef main():\n n, m = list(map(int, input().split()))\n g = []\n for _ in range(m):\n a, b = list(map(int, input().split()))\n g.append((a, b))\n print((osp(n, g)))\n\n\ndef osp(n: int, g: List[Tuple[int, int]]) -> int:\n v = [False] * n\n g = set(g)\n return dfs(0, v, n, g)\n\n\ndef dfs(i, v, n, g):\n v[i] = True\n if all(v):\n v[i] = False\n return 1\n cnt = 0\n for j in range(n):\n if v[j]:\n continue\n if not ((i + 1, j + 1) in g or (j + 1, i + 1) in g):\n continue\n cnt += dfs(j, v, n, g)\n v[i] = False\n return cnt\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "562f6e02e8417832e28d70eb3bf85554d0ed3aeb8b43d97c409d2d577ce8e26f", "slow_id": "p03805_562f6e02e8417832e28d70eb3bf85554d0ed3aeb8b43d97c409d2d577ce8e26f", "speedup": 7.290682072506683, "stratum": "4-8", "within_pair_jaccard": 0.5434782608695652, "workload": {"case_count": 100, "description": "Count paths starting at vertex 1 and visiting all N vertices exactly once in a simple unweighted undirected graph. Disconnected graphs and zero edges are allowed. Edges use 1-based endpoints a_i= K:\n ans = ai\n print(ans)\n break\n", "fast_code_sha256": "4a8f699c607c2f39c36203edd82dc590a1660393ef0dd078a766ddac612fbfdb", "fast_id": "p03721_4a8f699c607c2f39c36203edd82dc590a1660393ef0dd078a766ddac612fbfdb", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N, K = list(map(int, input().split()))\nlst_ab = sorted([tuple(map(int, input().split())) for _ in range(N)])\nlength = 0\nfor i in range(N):\n ai, bi = lst_ab[i][0], lst_ab[i][1]\n length += bi\n if length >= K:\n ans = ai\n print(ans)\n break\n", "measured_fast_code_sha256": "4a8f699c607c2f39c36203edd82dc590a1660393ef0dd078a766ddac612fbfdb", "measured_slow_code": "import sys\nimport numpy as np\nimport collections\n\nn, k = [int(x) for x in sys.stdin.readline().split()]\nr = collections.defaultdict(int)\nfor i in range(n):\n a, b = [int(x) for x in sys.stdin.readline().split()]\n r[a] += b\nd = sorted(r.items())\nc = 0\nfor i, j in enumerate(d):\n c += j[1]\n if c >= k:\n print((int(j[0])))\n break\n", "measured_slow_code_sha256": "75d5b758a5047678745153d41c380f660afa7f9d4f81ada1ef8c3eb0b4fb4d9c", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.0662354242076124, "pair_id": "python_v2_43728df6d6e6edeb7933eb84", "per_case_slow_code_faster_fraction": 0.3, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03721", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03721_4a8f699c607c2f39c36203edd82dc590a1660393ef0dd078a766ddac612fbfdb.jsonl.gz", "inputs": "reproduction/python/inputs/p03721.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03721_75d5b758a5047678745153d41c380f660afa7f9d4f81ada1ef8c3eb0b4fb4d9c.jsonl.gz"}, "slow_code": "import sys\nimport numpy as np\nimport collections\n\nn, k = [int(x) for x in sys.stdin.readline().split()]\nr = collections.defaultdict(int)\nfor i in range(n):\n a, b = [int(x) for x in sys.stdin.readline().split()]\n r[a] += b\nd = sorted(r.items())\nc = 0\nfor i, j in enumerate(d):\n c += j[1]\n if c >= k:\n print((int(j[0])))\n break\n", "slow_code_sha256": "75d5b758a5047678745153d41c380f660afa7f9d4f81ada1ef8c3eb0b4fb4d9c", "slow_id": "p03721_75d5b758a5047678745153d41c380f660afa7f9d4f81ada1ef8c3eb0b4fb4d9c", "speedup": 4.371564161231039, "stratum": "4-8", "within_pair_jaccard": 0.2727272727272727, "workload": {"case_count": 100, "description": "Operation i inserts b_i copies of integer a_i into an initially empty multiset. After N operations, find the 1-based K-th smallest element, counting multiplicity; the expanded multiset is not supplied. Observed inputs: N=1..100000 (median 100000); K=1..10000000000 (median 1154351153); a_i=1..100000; b_i=1..100000; total_elements=1..10000000000 (median 4995269195.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1289119, "median": 1177559.0, "min": 8}, "input_format": ["N K\na_1 b_1\n...\na_N b_N"], "input_format_status": "source_input_section", "input_lines": {"max": 100001, "median": 100001.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200002, "median": 200002.0, "min": 4}}} -{"case_ids": ["p02406_case_000", "p02406_case_001", "p02406_case_002", "p02406_case_003", "p02406_case_004", "p02406_case_005", "p02406_case_006", "p02406_case_007", "p02406_case_008", "p02406_case_009", "p02406_case_010", "p02406_case_011", "p02406_case_012", "p02406_case_013", "p02406_case_014", "p02406_case_015", "p02406_case_016", "p02406_case_017", "p02406_case_018", "p02406_case_019", "p02406_case_020", "p02406_case_021", "p02406_case_022", "p02406_case_023", "p02406_case_024", "p02406_case_025", "p02406_case_026", "p02406_case_027", "p02406_case_028", "p02406_case_029", "p02406_case_030", "p02406_case_031", "p02406_case_032", "p02406_case_033", "p02406_case_034", "p02406_case_035", "p02406_case_036", "p02406_case_037", "p02406_case_038", "p02406_case_039", "p02406_case_040", "p02406_case_041", "p02406_case_042", "p02406_case_043", "p02406_case_044", "p02406_case_045", "p02406_case_046", "p02406_case_047", "p02406_case_048", "p02406_case_049", "p02406_case_050", "p02406_case_051", "p02406_case_052", "p02406_case_053", "p02406_case_054", "p02406_case_055", "p02406_case_056", "p02406_case_057", "p02406_case_058", "p02406_case_059", "p02406_case_060", "p02406_case_061", "p02406_case_062", "p02406_case_063", "p02406_case_064", "p02406_case_065", "p02406_case_066", "p02406_case_067", "p02406_case_068", "p02406_case_069", "p02406_case_070", "p02406_case_071", "p02406_case_072", "p02406_case_073", "p02406_case_074", "p02406_case_075", "p02406_case_076", "p02406_case_077", "p02406_case_078", "p02406_case_079", "p02406_case_080", "p02406_case_081", "p02406_case_082", "p02406_case_083", "p02406_case_084", "p02406_case_085", "p02406_case_086", "p02406_case_087", "p02406_case_088", "p02406_case_089", "p02406_case_090", "p02406_case_091", "p02406_case_092", "p02406_case_093", "p02406_case_094", "p02406_case_095", "p02406_case_096", "p02406_case_097", "p02406_case_098", "p02406_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "print(\n (\n \"\".join(\n [\n \" \" + str(i)\n for i in range(1, int(eval(input())) + 1)\n if i % 3 == 0 or \"3\" in str(i)\n ]\n )\n )\n)\n", "fast_code_sha256": "ddc904ed4f0cd4b39153ffc2495e7ff359f267ec09c6188344beefc9065e1ed3", "fast_id": "p02406_ddc904ed4f0cd4b39153ffc2495e7ff359f267ec09c6188344beefc9065e1ed3", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "print(\n (\n \"\".join(\n [\n \" \" + str(i)\n for i in range(1, int(eval(input())) + 1)\n if i % 3 == 0 or \"3\" in str(i)\n ]\n )\n )\n)\n", "measured_fast_code_sha256": "ddc904ed4f0cd4b39153ffc2495e7ff359f267ec09c6188344beefc9065e1ed3", "measured_slow_code": "n = int(input())\nfor i in range(1, n + 1):\n if i % 3 == 0:\n print(\" {0}\".format(i), end=\"\")\n else:\n x = i\n while x != 0:\n if x % 10 == 3:\n print(\" {0}\".format(i), end=\"\")\n break\n x //= 10\nprint(\"\")\n", "measured_slow_code_sha256": "012cd4921cf72722b2a692888265294a12110e33c7925fc5b07a4e7cf1ad40df", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.303372123810762, "pair_id": "python_v2_040f72340064dc635f06ce93", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02406", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02406_ddc904ed4f0cd4b39153ffc2495e7ff359f267ec09c6188344beefc9065e1ed3.jsonl.gz", "inputs": "reproduction/python/inputs/p02406.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02406_012cd4921cf72722b2a692888265294a12110e33c7925fc5b07a4e7cf1ad40df.jsonl.gz"}, "slow_code": "n = int(input())\nfor i in range(1, n + 1):\n if i % 3 == 0:\n print(\" {0}\".format(i), end=\"\")\n else:\n x = i\n while x != 0:\n if x % 10 == 3:\n print(\" {0}\".format(i), end=\"\")\n break\n x //= 10\nprint(\"\")\n", "slow_code_sha256": "012cd4921cf72722b2a692888265294a12110e33c7925fc5b07a4e7cf1ad40df", "slow_id": "p02406_012cd4921cf72722b2a692888265294a12110e33c7925fc5b07a4e7cf1ad40df", "speedup": 2.208118302393059, "stratum": "2-4", "within_pair_jaccard": 0.4782608695652174, "workload": {"case_count": 100, "description": "Print in ascending order the integers from 1 through n that are divisible by 3 or have a decimal digit 3. A qualifying integer is printed once even if both conditions hold. Observed inputs: n=3..10000 (median 5211).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 6, "median": 5.0, "min": 2}, "input_format": ["n"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p03609_case_000", "p03609_case_001", "p03609_case_002", "p03609_case_003", "p03609_case_004", "p03609_case_005", "p03609_case_006", "p03609_case_007", "p03609_case_008", "p03609_case_009", "p03609_case_010", "p03609_case_011", "p03609_case_012", "p03609_case_013", "p03609_case_014", "p03609_case_015", "p03609_case_016", "p03609_case_017", "p03609_case_018", "p03609_case_019", "p03609_case_020", "p03609_case_021", "p03609_case_022", "p03609_case_023", "p03609_case_024", "p03609_case_025", "p03609_case_026", "p03609_case_027", "p03609_case_028", "p03609_case_029", "p03609_case_030", "p03609_case_031", "p03609_case_032", "p03609_case_033", "p03609_case_034", "p03609_case_035", "p03609_case_036", "p03609_case_037", "p03609_case_038", "p03609_case_039", "p03609_case_040", "p03609_case_041", "p03609_case_042", "p03609_case_043", "p03609_case_044", "p03609_case_045", "p03609_case_046", "p03609_case_047", "p03609_case_048", "p03609_case_049", "p03609_case_050", "p03609_case_051", "p03609_case_052", "p03609_case_053", "p03609_case_054", "p03609_case_055", "p03609_case_056", "p03609_case_057", "p03609_case_058", "p03609_case_059", "p03609_case_060", "p03609_case_061", "p03609_case_062", "p03609_case_063", "p03609_case_064", "p03609_case_065", "p03609_case_066", "p03609_case_067", "p03609_case_068", "p03609_case_069", "p03609_case_070", "p03609_case_071", "p03609_case_072", "p03609_case_073", "p03609_case_074", "p03609_case_075", "p03609_case_076", "p03609_case_077", "p03609_case_078", "p03609_case_079", "p03609_case_080", "p03609_case_081", "p03609_case_082", "p03609_case_083", "p03609_case_084", "p03609_case_085", "p03609_case_086", "p03609_case_087", "p03609_case_088", "p03609_case_089", "p03609_case_090", "p03609_case_091", "p03609_case_092", "p03609_case_093", "p03609_case_094", "p03609_case_095", "p03609_case_096", "p03609_case_097", "p03609_case_098", "p03609_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\nsys.setrecursionlimit(10**7)\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\ndef MI():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef LI2():\n return list(map(int, sys.stdin.readline().rstrip()))\n\n\ndef S():\n return sys.stdin.readline().rstrip()\n\n\ndef LS():\n return list(sys.stdin.readline().rstrip().split())\n\n\ndef LS2():\n return list(sys.stdin.readline().rstrip())\n\n\nX, t = MI()\nprint((max(0, X - t)))\n", "fast_code_sha256": "fd4275ac3015ea43f72a1112abea3ec7c08ff8d05ed2fd2ca2ec2233de5584a7", "fast_id": "p03609_21358a205e41dd5670feb6094f107d9424855faf88240b45951435064ca31e34", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\nsys.setrecursionlimit(10**7)\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\ndef MI():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().rstrip().split())) # 空白あり\n\n\ndef LI2():\n return list(map(int, sys.stdin.readline().rstrip())) # 空白なし\n\n\ndef S():\n return sys.stdin.readline().rstrip()\n\n\ndef LS():\n return list(sys.stdin.readline().rstrip().split()) # 空白あり\n\n\ndef LS2():\n return list(sys.stdin.readline().rstrip()) # 空白なし\n\n\nX, t = MI()\nprint((max(0, X - t)))\n", "measured_fast_code_sha256": "21358a205e41dd5670feb6094f107d9424855faf88240b45951435064ca31e34", "measured_slow_code": "import numpy as np\n\nx, t = list(map(int, input().split()))\nprint((max(x - t, 0)))\n", "measured_slow_code_sha256": "05c7cfa6f7e3edd14d82845ed4d2e91cd4b96ef2bf5eba445a2670d95ff174d0", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 500.108049367312, "pair_id": "python_v2_fdf77794c893291d3a0afba9", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03609", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03609_21358a205e41dd5670feb6094f107d9424855faf88240b45951435064ca31e34.jsonl.gz", "inputs": "reproduction/python/inputs/p03609.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03609_05c7cfa6f7e3edd14d82845ed4d2e91cd4b96ef2bf5eba445a2670d95ff174d0.jsonl.gz"}, "slow_code": "import numpy as np\n\nx, t = list(map(int, input().split()))\nprint((max(x - t, 0)))\n", "slow_code_sha256": "05c7cfa6f7e3edd14d82845ed4d2e91cd4b96ef2bf5eba445a2670d95ff174d0", "slow_id": "p03609_05c7cfa6f7e3edd14d82845ed4d2e91cd4b96ef2bf5eba445a2670d95ff174d0", "speedup": 499.79510607796874, "stratum": "8+", "within_pair_jaccard": 0.2903225806451613, "workload": {"case_count": 100, "description": "An upper hourglass bulb starts with X grams and loses one gram per second until empty. Report grams remaining after t seconds. Observed inputs: X=1..1000000000 (median 278882159.5); t=1..1000000000 (median 259647859.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 22, "median": 20.0, "min": 4}, "input_format": ["X t"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p02642_case_000", "p02642_case_001", "p02642_case_002", "p02642_case_003", "p02642_case_004", "p02642_case_005", "p02642_case_006", "p02642_case_007", "p02642_case_008", "p02642_case_009", "p02642_case_010", "p02642_case_011", "p02642_case_012", "p02642_case_013", "p02642_case_014", "p02642_case_015", "p02642_case_016", "p02642_case_017", "p02642_case_018", "p02642_case_019", "p02642_case_020", "p02642_case_021", "p02642_case_022", "p02642_case_023", "p02642_case_024", "p02642_case_025", "p02642_case_026", "p02642_case_027", "p02642_case_028", "p02642_case_029", "p02642_case_030", "p02642_case_031", "p02642_case_032", "p02642_case_033", "p02642_case_034", "p02642_case_035", "p02642_case_036", "p02642_case_037", "p02642_case_038", "p02642_case_039", "p02642_case_040", "p02642_case_041", "p02642_case_042", "p02642_case_043", "p02642_case_044", "p02642_case_045", "p02642_case_046", "p02642_case_047", "p02642_case_048", "p02642_case_049", "p02642_case_050", "p02642_case_051", "p02642_case_052", "p02642_case_053", "p02642_case_054", "p02642_case_055", "p02642_case_056", "p02642_case_057", "p02642_case_058", "p02642_case_059", "p02642_case_060", "p02642_case_061", "p02642_case_062", "p02642_case_063", "p02642_case_064", "p02642_case_065", "p02642_case_066", "p02642_case_067", "p02642_case_068", "p02642_case_069", "p02642_case_070", "p02642_case_071", "p02642_case_072", "p02642_case_073", "p02642_case_074", "p02642_case_075", "p02642_case_076", "p02642_case_077", "p02642_case_078", "p02642_case_079", "p02642_case_080", "p02642_case_081", "p02642_case_082", "p02642_case_083", "p02642_case_084", "p02642_case_085", "p02642_case_086", "p02642_case_087", "p02642_case_088", "p02642_case_089", "p02642_case_090", "p02642_case_091", "p02642_case_092", "p02642_case_093", "p02642_case_094", "p02642_case_095", "p02642_case_096", "p02642_case_097", "p02642_case_098", "p02642_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\nA = sorted(map(int, input().split()))\nU = 10**6\nline = [1] * (U + 1)\nans = set()\ndepricated = set()\ncnt = [0] * (U + 1)\nfor a in A:\n cnt[a] += 1\n if cnt[a] == 2 and line[a]:\n depricated.add(a)\n continue\n if 2 < cnt[a]:\n continue\n if line[a]:\n ans.add(a)\n for p in range(2 * a, U + 1, a):\n line[p] = 0\nprint((len(ans - depricated)))\n", "fast_code_sha256": "10b7e242c2a5f8abb0e1ace59cfd32548bea28acd63c40b928f171084b52de75", "fast_id": "p02642_10b7e242c2a5f8abb0e1ace59cfd32548bea28acd63c40b928f171084b52de75", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\nA = sorted(map(int, input().split()))\nU = 10**6\nline = [1] * (U + 1)\nans = set()\ndepricated = set()\ncnt = [0] * (U + 1)\nfor a in A:\n cnt[a] += 1\n if cnt[a] == 2 and line[a]:\n depricated.add(a)\n continue\n if 2 < cnt[a]:\n continue\n if line[a]:\n ans.add(a)\n for p in range(2 * a, U + 1, a):\n line[p] = 0\nprint((len(ans - depricated)))\n", "measured_fast_code_sha256": "10b7e242c2a5f8abb0e1ace59cfd32548bea28acd63c40b928f171084b52de75", "measured_slow_code": "N = int(eval(input()))\nA = list(map(int, input().split()))\nm = max(A)\nU = [0] * (m + 1)\nfor e in A:\n U[e] += 1\nans = 0\nfor k in range(1, m + 1):\n if U[k] == 1:\n ans += 1\n if U[k] > 0:\n for l in range(2 * k, m + 1, k):\n if U[l] > 0:\n U[l] += 1\nprint(ans)\n", "measured_slow_code_sha256": "bb032738b2a92c573bb8551b5b7382bec1fcfece28073f8018a01331a18cfdcc", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.52252962109736, "pair_id": "python_v2_e7eb7988fdad7204db8f53cc", "per_case_slow_code_faster_fraction": 0.14, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02642", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02642_10b7e242c2a5f8abb0e1ace59cfd32548bea28acd63c40b928f171084b52de75.jsonl.gz", "inputs": "reproduction/python/inputs/p02642.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02642_bb032738b2a92c573bb8551b5b7382bec1fcfece28073f8018a01331a18cfdcc.jsonl.gz"}, "slow_code": "N = int(eval(input()))\nA = list(map(int, input().split()))\nm = max(A)\nU = [0] * (m + 1)\nfor e in A:\n U[e] += 1\nans = 0\nfor k in range(1, m + 1):\n if U[k] == 1:\n ans += 1\n if U[k] > 0:\n for l in range(2 * k, m + 1, k):\n if U[l] > 0:\n U[l] += 1\nprint(ans)\n", "slow_code_sha256": "bb032738b2a92c573bb8551b5b7382bec1fcfece28073f8018a01331a18cfdcc", "slow_id": "p02642_bb032738b2a92c573bb8551b5b7382bec1fcfece28073f8018a01331a18cfdcc", "speedup": 4.6299252683991625, "stratum": "4-8", "within_pair_jaccard": 0.43243243243243246, "workload": {"case_count": 100, "description": "Count indices i such that no different index j has a value a_j dividing a_i; equal values at different positions are separate entries. Observed inputs: N=5..200000 (median 1000); a_i=1..1000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1600007, "median": 6886.5, "min": 12}, "input_format": ["N\na_1 ... a_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200001, "median": 1001.0, "min": 6}}} -{"case_ids": ["p02572_case_000", "p02572_case_001", "p02572_case_002", "p02572_case_003", "p02572_case_004", "p02572_case_005", "p02572_case_006", "p02572_case_007", "p02572_case_008", "p02572_case_009", "p02572_case_010", "p02572_case_011", "p02572_case_012", "p02572_case_013", "p02572_case_014", "p02572_case_015", "p02572_case_016", "p02572_case_017", "p02572_case_018", "p02572_case_019", "p02572_case_020", "p02572_case_021", "p02572_case_022", "p02572_case_023", "p02572_case_024", "p02572_case_025", "p02572_case_026", "p02572_case_027", "p02572_case_028", "p02572_case_029", "p02572_case_030", "p02572_case_031", "p02572_case_032", "p02572_case_033", "p02572_case_034", "p02572_case_035", "p02572_case_036", "p02572_case_037", "p02572_case_038", "p02572_case_039", "p02572_case_040", "p02572_case_041", "p02572_case_042", "p02572_case_043", "p02572_case_044", "p02572_case_045", "p02572_case_046", "p02572_case_047", "p02572_case_048", "p02572_case_049", "p02572_case_050", "p02572_case_051", "p02572_case_052", "p02572_case_053", "p02572_case_054", "p02572_case_055", "p02572_case_056", "p02572_case_057", "p02572_case_058", "p02572_case_059", "p02572_case_060", "p02572_case_061", "p02572_case_062", "p02572_case_063", "p02572_case_064", "p02572_case_065", "p02572_case_066", "p02572_case_067", "p02572_case_068", "p02572_case_069", "p02572_case_070", "p02572_case_071", "p02572_case_072", "p02572_case_073", "p02572_case_074", "p02572_case_075", "p02572_case_076", "p02572_case_077", "p02572_case_078", "p02572_case_079", "p02572_case_080", "p02572_case_081", "p02572_case_082", "p02572_case_083", "p02572_case_084", "p02572_case_085", "p02572_case_086", "p02572_case_087", "p02572_case_088", "p02572_case_089", "p02572_case_090", "p02572_case_091", "p02572_case_092", "p02572_case_093", "p02572_case_094", "p02572_case_095", "p02572_case_096", "p02572_case_097", "p02572_case_098", "p02572_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "M = 10**9 + 7\nN = int(eval(input()))\nA = list(map(int, input().split()))\nprint(((((sum(A) ** 2) - sum([x * x for x in A])) // 2) % M))\n", "fast_code_sha256": "d2f1d6dc4dc2368e96aa457a0b9725edcd6663fd8a36531cd436a7a1b676e18f", "fast_id": "p02572_d2f1d6dc4dc2368e96aa457a0b9725edcd6663fd8a36531cd436a7a1b676e18f", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "M = 10**9 + 7\nN = int(eval(input()))\nA = list(map(int, input().split()))\nprint(((((sum(A) ** 2) - sum([x * x for x in A])) // 2) % M))\n", "measured_fast_code_sha256": "d2f1d6dc4dc2368e96aa457a0b9725edcd6663fd8a36531cd436a7a1b676e18f", "measured_slow_code": "import copy\n\nN = int(eval(input()))\nA = list(map(int, input().split()))\nmod = 10**9 + 7\npartial_sum = copy.deepcopy(A)\nsum_now = A[N - 1]\nfor j in range(N - 2, -1, -1):\n sum_now = int((sum_now + A[j]) % mod)\n partial_sum[j] = sum_now\nres = 0\nfor i in range(N - 1):\n res = (res + (A[i] * partial_sum[i + 1]) % mod) % mod\nprint((int(res)))\n", "measured_slow_code_sha256": "9a9a8c4412436852a66bfa0067b57c544f3aec7f532b2c46c6eaa958a2513451", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 6.428405333659435, "pair_id": "python_v2_c897beb21dd677096af820da", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02572", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02572_d2f1d6dc4dc2368e96aa457a0b9725edcd6663fd8a36531cd436a7a1b676e18f.jsonl.gz", "inputs": "reproduction/python/inputs/p02572.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02572_9a9a8c4412436852a66bfa0067b57c544f3aec7f532b2c46c6eaa958a2513451.jsonl.gz"}, "slow_code": "import copy\n\nN = int(eval(input()))\nA = list(map(int, input().split()))\nmod = 10**9 + 7\npartial_sum = copy.deepcopy(A)\nsum_now = A[N - 1]\nfor j in range(N - 2, -1, -1):\n sum_now = int((sum_now + A[j]) % mod)\n partial_sum[j] = sum_now\nres = 0\nfor i in range(N - 1):\n res = (res + (A[i] * partial_sum[i + 1]) % mod) % mod\nprint((int(res)))\n", "slow_code_sha256": "9a9a8c4412436852a66bfa0067b57c544f3aec7f532b2c46c6eaa958a2513451", "slow_id": "p02572_9a9a8c4412436852a66bfa0067b57c544f3aec7f532b2c46c6eaa958a2513451", "speedup": 6.432596327264441, "stratum": "4-8", "within_pair_jaccard": 0.5, "workload": {"case_count": 100, "description": "For an array of N integers, sum a_i*a_j over all index pairs i>> print_ans([24],[30],1)\n 7\n >>> print_ans([6,3],[8,3],2)\n 4\n \"\"\"\n print((sum(r) - sum(l) + N))\n\n\ndef main():\n N = int(eval(input()))\n l = []\n r = []\n for i in range(N):\n s = list(map(int, input().split()))\n l.append(s[0])\n r.append(s[1])\n print_ans(l, r, N)\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "d6f611d4319fcbd5abdfcb7256b41081143f219491aaea64d2ac4a94a158f0af", "measured_slow_code": "import collections\n\nn = int(eval(input()))\nl = [list(map(int, input().split())) for _ in range(n)]\nd = {}\nfor i in range(len(l)):\n for j in range(l[i][0], l[i][1] + 1):\n d[j] = 1\nprint((len(d)))\n", "measured_slow_code_sha256": "91ed37766e83e1c57b3ed54e34dd70e87dd0159574758547062baadff81ba4dd", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.2864763481175943, "pair_id": "python_v2_1eec80796ef81e8083733efc", "per_case_slow_code_faster_fraction": 0.24, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03606", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03606_d6f611d4319fcbd5abdfcb7256b41081143f219491aaea64d2ac4a94a158f0af.jsonl.gz", "inputs": "reproduction/python/inputs/p03606.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03606_91ed37766e83e1c57b3ed54e34dd70e87dd0159574758547062baadff81ba4dd.jsonl.gz"}, "slow_code": "import collections\n\nn = int(eval(input()))\nl = [list(map(int, input().split())) for _ in range(n)]\nd = {}\nfor i in range(len(l)):\n for j in range(l[i][0], l[i][1] + 1):\n d[j] = 1\nprint((len(d)))\n", "slow_code_sha256": "91ed37766e83e1c57b3ed54e34dd70e87dd0159574758547062baadff81ba4dd", "slow_id": "p03606_91ed37766e83e1c57b3ed54e34dd70e87dd0159574758547062baadff81ba4dd", "speedup": 6.78807609273891, "stratum": "4-8", "within_pair_jaccard": 0.34146341463414637, "workload": {"case_count": 100, "description": "N groups occupy disjoint inclusive seat intervals [l_i,r_i] in a theater with seats 1..100000. Count the total seated people. Intervals need not be listed in order. Observed inputs: N=1..1000 (median 2); l_i=1..99992; r_i=5..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 11813, "median": 26.0, "min": 11}, "input_format": ["N\nl_1 r_1\n...\nl_N r_N"], "input_format_status": "source_input_section", "input_lines": {"max": 1001, "median": 3.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2001, "median": 5.0, "min": 3}}} -{"case_ids": ["p02786_case_000", "p02786_case_001", "p02786_case_002", "p02786_case_003", "p02786_case_004", "p02786_case_005", "p02786_case_006", "p02786_case_007", "p02786_case_008", "p02786_case_009", "p02786_case_010", "p02786_case_011", "p02786_case_012", "p02786_case_013", "p02786_case_014", "p02786_case_015", "p02786_case_016", "p02786_case_017", "p02786_case_018", "p02786_case_019", "p02786_case_020", "p02786_case_021", "p02786_case_022", "p02786_case_023", "p02786_case_024", "p02786_case_025", "p02786_case_026", "p02786_case_027", "p02786_case_028", "p02786_case_029", "p02786_case_030", "p02786_case_031", "p02786_case_032", "p02786_case_033", "p02786_case_034", "p02786_case_035", "p02786_case_036", "p02786_case_037", "p02786_case_038", "p02786_case_039", "p02786_case_040", "p02786_case_041", "p02786_case_042", "p02786_case_043", "p02786_case_044", "p02786_case_045", "p02786_case_046", "p02786_case_047", "p02786_case_048", "p02786_case_049", "p02786_case_050", "p02786_case_051", "p02786_case_052", "p02786_case_053", "p02786_case_054", "p02786_case_055", "p02786_case_056", "p02786_case_057", "p02786_case_058", "p02786_case_059", "p02786_case_060", "p02786_case_061", "p02786_case_062", "p02786_case_063", "p02786_case_064", "p02786_case_065", "p02786_case_066", "p02786_case_067", "p02786_case_068", "p02786_case_069", "p02786_case_070", "p02786_case_071", "p02786_case_072", "p02786_case_073", "p02786_case_074", "p02786_case_075", "p02786_case_076", "p02786_case_077", "p02786_case_078", "p02786_case_079", "p02786_case_080", "p02786_case_081", "p02786_case_082", "p02786_case_083", "p02786_case_084", "p02786_case_085", "p02786_case_086", "p02786_case_087", "p02786_case_088", "p02786_case_089", "p02786_case_090", "p02786_case_091", "p02786_case_092", "p02786_case_093", "p02786_case_094", "p02786_case_095", "p02786_case_096", "p02786_case_097", "p02786_case_098", "p02786_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "memo = {}\n\n\ndef f(n):\n if n == 1:\n return 1\n if n in memo:\n return memo[n]\n memo[n] = 1 + 2 * f(n // 2)\n return memo[n]\n\n\nprint((f(int(eval(input())))))\n", "fast_code_sha256": "126ce0e22e4f9de347b1b67e8d83fdad771fc2c10b04b6c512e6f29160753492", "fast_id": "p02786_126ce0e22e4f9de347b1b67e8d83fdad771fc2c10b04b6c512e6f29160753492", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "memo = {}\n\n\ndef f(n):\n if n == 1:\n return 1\n if n in memo:\n return memo[n]\n memo[n] = 1 + 2 * f(n // 2)\n return memo[n]\n\n\nprint((f(int(eval(input())))))\n", "measured_fast_code_sha256": "126ce0e22e4f9de347b1b67e8d83fdad771fc2c10b04b6c512e6f29160753492", "measured_slow_code": "# -*- coding: utf-8 -*-\nimport sys\nimport math\nimport os\nimport itertools\nimport string\nimport heapq\nimport _collections\nfrom collections import Counter\nfrom collections import defaultdict\nfrom collections import deque\nfrom functools import lru_cache\nimport bisect\nimport re\nimport queue\nimport copy\nimport decimal\n\n\nclass Scanner:\n @staticmethod\n def int():\n return int(sys.stdin.readline().rstrip())\n\n @staticmethod\n def string():\n return sys.stdin.readline().rstrip()\n\n @staticmethod\n def map_int():\n return [int(x) for x in Scanner.string().split()]\n\n @staticmethod\n def string_list(n):\n return [Scanner.string() for i in range(n)]\n\n @staticmethod\n def int_list_list(n):\n return [Scanner.map_int() for i in range(n)]\n\n @staticmethod\n def int_cols_list(n):\n return [Scanner.int() for i in range(n)]\n\n\ndef solve():\n N = Scanner.int()\n ans = 0\n tmp = 1\n while N > 1:\n ans += tmp\n tmp *= 2\n N //= 2\n ans += tmp\n print(ans)\n\n\ndef main():\n # sys.setrecursionlimit(1000000)\n # sys.stdin = open(\"sample.txt\")\n solve()\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "5d6617ccb7542ab7ac6370731e16a8d6166b9d7e674b0195c22064d828abd3d2", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 27.86562924063214, "pair_id": "python_v2_9d9a55af3f216fafbfdd7322", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02786", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02786_126ce0e22e4f9de347b1b67e8d83fdad771fc2c10b04b6c512e6f29160753492.jsonl.gz", "inputs": "reproduction/python/inputs/p02786.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02786_5d6617ccb7542ab7ac6370731e16a8d6166b9d7e674b0195c22064d828abd3d2.jsonl.gz"}, "slow_code": "import sys\nimport math\nimport os\nimport itertools\nimport string\nimport heapq\nimport _collections\nfrom collections import Counter\nfrom collections import defaultdict\nfrom collections import deque\nfrom functools import lru_cache\nimport bisect\nimport re\nimport queue\nimport copy\nimport decimal\n\n\nclass Scanner:\n @staticmethod\n def int():\n return int(sys.stdin.readline().rstrip())\n\n @staticmethod\n def string():\n return sys.stdin.readline().rstrip()\n\n @staticmethod\n def map_int():\n return [int(x) for x in Scanner.string().split()]\n\n @staticmethod\n def string_list(n):\n return [Scanner.string() for i in range(n)]\n\n @staticmethod\n def int_list_list(n):\n return [Scanner.map_int() for i in range(n)]\n\n @staticmethod\n def int_cols_list(n):\n return [Scanner.int() for i in range(n)]\n\n\ndef solve():\n N = Scanner.int()\n ans = 0\n tmp = 1\n while N > 1:\n ans += tmp\n tmp *= 2\n N //= 2\n ans += tmp\n print(ans)\n\n\ndef main():\n\n solve()\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "ccd6f9587aa7a20c43aac93ef11246453f9abff3b028525d3340cb287fb6e047", "slow_id": "p02786_5d6617ccb7542ab7ac6370731e16a8d6166b9d7e674b0195c22064d828abd3d2", "speedup": 29.720814465548486, "stratum": "8+", "within_pair_jaccard": 0.15789473684210525, "workload": {"case_count": 100, "description": "One monster initially has health H. An attack kills a health-1 monster; a monster of health X>1 instead becomes two monsters of health floor(X/2). Find the minimum attacks to eliminate all monsters. Observed inputs: H=1..1000000000000 (median 9236181246).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 14, "median": 11.5, "min": 2}, "input_format": ["H"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p00687_case_000", "p00687_case_001", "p00687_case_002", "p00687_case_003", "p00687_case_004", "p00687_case_005", "p00687_case_006", "p00687_case_007", "p00687_case_008", "p00687_case_009", "p00687_case_010", "p00687_case_011", "p00687_case_012", "p00687_case_013", "p00687_case_014", "p00687_case_015", "p00687_case_016", "p00687_case_017", "p00687_case_018", "p00687_case_019", "p00687_case_020", "p00687_case_021", "p00687_case_022", "p00687_case_023", "p00687_case_024", "p00687_case_025", "p00687_case_026", "p00687_case_027", "p00687_case_028", "p00687_case_029", "p00687_case_030", "p00687_case_031", "p00687_case_032", "p00687_case_033", "p00687_case_034", "p00687_case_035", "p00687_case_036", "p00687_case_037", "p00687_case_038", "p00687_case_039", "p00687_case_040", "p00687_case_041", "p00687_case_042", "p00687_case_043", "p00687_case_044", "p00687_case_045", "p00687_case_046", "p00687_case_047", "p00687_case_048", "p00687_case_049", "p00687_case_050", "p00687_case_051", "p00687_case_052", "p00687_case_053", "p00687_case_054", "p00687_case_055", "p00687_case_056", "p00687_case_057", "p00687_case_058", "p00687_case_059", "p00687_case_060", "p00687_case_061", "p00687_case_062", "p00687_case_063", "p00687_case_064", "p00687_case_065", "p00687_case_066", "p00687_case_067", "p00687_case_068", "p00687_case_069", "p00687_case_070", "p00687_case_071", "p00687_case_072", "p00687_case_073", "p00687_case_074", "p00687_case_075", "p00687_case_076", "p00687_case_077", "p00687_case_078", "p00687_case_079", "p00687_case_080", "p00687_case_081", "p00687_case_082", "p00687_case_083", "p00687_case_084", "p00687_case_085", "p00687_case_086", "p00687_case_087", "p00687_case_088", "p00687_case_089", "p00687_case_090", "p00687_case_091", "p00687_case_092", "p00687_case_093", "p00687_case_094", "p00687_case_095", "p00687_case_096", "p00687_case_097", "p00687_case_098", "p00687_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "while 1:\n n, a, b = list(map(int, input().split()))\n if n == 0:\n break\n dp = [0] * (n + 1)\n if a < n + 1:\n dp[a] = 1\n if b < n + 1:\n dp[b] = 1\n for i in range(n + 1):\n if dp[i]:\n if i + a < n + 1:\n dp[i + a] = 1\n if i + b < n + 1:\n dp[i + b] = 1\n print(n - sum(dp))\n", "fast_code_sha256": "03b86cbfa76d7854336f621e0cbdf6c7c30ef10052ed51cb9103b8d7aaac613d", "fast_id": "p00687_03b86cbfa76d7854336f621e0cbdf6c7c30ef10052ed51cb9103b8d7aaac613d", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "while 1:\n n, a, b = list(map(int, input().split()))\n if n == 0:\n break\n dp = [0] * (n + 1)\n if a < n + 1:\n dp[a] = 1\n if b < n + 1:\n dp[b] = 1\n for i in range(n + 1):\n if dp[i]:\n if i + a < n + 1:\n dp[i + a] = 1\n if i + b < n + 1:\n dp[i + b] = 1\n print(n - sum(dp))\n", "measured_fast_code_sha256": "03b86cbfa76d7854336f621e0cbdf6c7c30ef10052ed51cb9103b8d7aaac613d", "measured_slow_code": "while 1:\n n, a, b = list(map(int, input().split()))\n if n == a == b == 0:\n break\n c = 0\n d = [1] + [0] * 1000000\n for i in range(0, n + 1):\n if d[i]:\n if i + a <= n:\n d[i + a] = 1\n if i + b <= n:\n d[i + b] = 1\n else:\n c += 1\n print(c)\n", "measured_slow_code_sha256": "6486ddf14964ef7aa6b8c7fbb5874210ea0777d2d49521051480fb0ab0da206b", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.761192873802186, "pair_id": "python_v2_6b931204348c225f7ad026ca", "per_case_slow_code_faster_fraction": 0.14, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p00687", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p00687_03b86cbfa76d7854336f621e0cbdf6c7c30ef10052ed51cb9103b8d7aaac613d.jsonl.gz", "inputs": "reproduction/python/inputs/p00687.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p00687_6486ddf14964ef7aa6b8c7fbb5874210ea0777d2d49521051480fb0ab0da206b.jsonl.gz"}, "slow_code": "while 1:\n n, a, b = list(map(int, input().split()))\n if n == a == b == 0:\n break\n c = 0\n d = [1] + [0] * 1000000\n for i in range(0, n + 1):\n if d[i]:\n if i + a <= n:\n d[i + a] = 1\n if i + b <= n:\n d[i + b] = 1\n else:\n c += 1\n print(c)\n", "slow_code_sha256": "6486ddf14964ef7aa6b8c7fbb5874210ea0777d2d49521051480fb0ab0da206b", "slow_id": "p00687_6486ddf14964ef7aa6b8c7fbb5874210ea0777d2d49521051480fb0ab0da206b", "speedup": 3.204618570475595, "stratum": "2-4", "within_pair_jaccard": 0.75, "workload": {"case_count": 100, "description": "For each triple n,a,b, count integers in 1..n that cannot be expressed as a*i+b*j for nonnegative integers i and j. Triples are supplied one per line; the final 0 0 0 ends input. Observed inputs: datasets=1..10 (median 5); n=1..1000000; a=1..1000000; b=1..1000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 214, "median": 86.0, "min": 12}, "input_format": ["n_1 a_1 b_1\n...\nn_D a_D b_D\n0 0 0"], "input_format_status": "source_input_section", "input_lines": {"max": 11, "median": 6.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 33, "median": 18.0, "min": 6}}} -{"case_ids": ["p03575_case_000", "p03575_case_001", "p03575_case_002", "p03575_case_003", "p03575_case_004", "p03575_case_005", "p03575_case_006", "p03575_case_007", "p03575_case_008", "p03575_case_009", "p03575_case_010", "p03575_case_011", "p03575_case_012", "p03575_case_013", "p03575_case_014", "p03575_case_015", "p03575_case_016", "p03575_case_017", "p03575_case_018", "p03575_case_019", "p03575_case_020", "p03575_case_021", "p03575_case_022", "p03575_case_023", "p03575_case_024", "p03575_case_025", "p03575_case_026", "p03575_case_027", "p03575_case_028", "p03575_case_029", "p03575_case_030", "p03575_case_031", "p03575_case_032", "p03575_case_033", "p03575_case_034", "p03575_case_035", "p03575_case_036", "p03575_case_037", "p03575_case_038", "p03575_case_039", "p03575_case_040", "p03575_case_041", "p03575_case_042", "p03575_case_043", "p03575_case_044", "p03575_case_045", "p03575_case_046", "p03575_case_047", "p03575_case_048", "p03575_case_049", "p03575_case_050", "p03575_case_051", "p03575_case_052", "p03575_case_053", "p03575_case_054", "p03575_case_055", "p03575_case_056", "p03575_case_057", "p03575_case_058", "p03575_case_059", "p03575_case_060", "p03575_case_061", "p03575_case_062", "p03575_case_063", "p03575_case_064", "p03575_case_065", "p03575_case_066", "p03575_case_067", "p03575_case_068", "p03575_case_069", "p03575_case_070", "p03575_case_071", "p03575_case_072", "p03575_case_073", "p03575_case_074", "p03575_case_075", "p03575_case_076", "p03575_case_077", "p03575_case_078", "p03575_case_079", "p03575_case_080", "p03575_case_081", "p03575_case_082", "p03575_case_083", "p03575_case_084", "p03575_case_085", "p03575_case_086", "p03575_case_087", "p03575_case_088", "p03575_case_089", "p03575_case_090", "p03575_case_091", "p03575_case_092", "p03575_case_093", "p03575_case_094", "p03575_case_095", "p03575_case_096", "p03575_case_097", "p03575_case_098", "p03575_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\ninput = lambda: sys.stdin.readline().rstrip()\nn, m = list(map(int, input().split()))\n\n\ndef find(x):\n if par[x] < 0:\n return x\n else:\n par[x] = find(par[x])\n return par[x]\n\n\ndef unite(x, y):\n x = find(x)\n y = find(y)\n if x == y:\n return False\n else:\n if par[x] > par[y]:\n x, y = y, x\n par[x] += par[y]\n par[y] = x\n return True\n\n\ndef same(x, y):\n return find(x) == find(y)\n\n\ndef size(x):\n return -par[find(x)]\n\n\nAB = []\nfor i in range(m):\n AB.append(tuple(int(i) for i in input().split()))\nans = 0\nfor i in range(m):\n par = [-1] * n\n for j in range(m):\n if j == i:\n continue\n else:\n a, b = AB[j]\n unite(a - 1, b - 1)\n for i in range(n):\n find(i)\n if -min(par) < n:\n ans += 1\nprint(ans)\n", "fast_code_sha256": "680014ac22e5d4c6053b7f14622707d902b64052864c264832205bb1657d851e", "fast_id": "p03575_680014ac22e5d4c6053b7f14622707d902b64052864c264832205bb1657d851e", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\ninput = lambda: sys.stdin.readline().rstrip()\nn, m = list(map(int, input().split()))\n\n\ndef find(x):\n if par[x] < 0:\n return x\n else:\n par[x] = find(par[x])\n return par[x]\n\n\ndef unite(x, y):\n x = find(x)\n y = find(y)\n if x == y:\n return False\n else:\n if par[x] > par[y]:\n x, y = y, x\n par[x] += par[y]\n par[y] = x\n return True\n\n\ndef same(x, y):\n return find(x) == find(y)\n\n\ndef size(x):\n return -par[find(x)]\n\n\nAB = []\nfor i in range(m):\n AB.append(tuple(int(i) for i in input().split()))\nans = 0\nfor i in range(m):\n par = [-1] * n\n for j in range(m):\n if j == i:\n continue\n else:\n a, b = AB[j]\n unite(a - 1, b - 1)\n for i in range(n):\n find(i)\n if -min(par) < n:\n ans += 1\nprint(ans)\n", "measured_fast_code_sha256": "680014ac22e5d4c6053b7f14622707d902b64052864c264832205bb1657d851e", "measured_slow_code": "import sys, re, os\nfrom collections import deque, defaultdict, Counter\nfrom math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians\nfrom itertools import permutations, combinations, product, accumulate\nfrom operator import itemgetter, mul\nfrom copy import deepcopy\nfrom string import ascii_lowercase, ascii_uppercase, digits\nfrom heapq import heapify, heappop, heappush\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef INT():\n return int(eval(input()))\n\n\ndef MAP():\n return list(map(int, input().split()))\n\n\ndef S_MAP():\n return list(map(str, input().split()))\n\n\ndef LIST():\n return list(map(int, input().split()))\n\n\ndef S_LIST():\n return list(map(str, input().split()))\n\n\nsys.setrecursionlimit(10**9)\nINF = float(\"inf\")\nmod = 10**9 + 7\n\n\ndef dijkstra(E, start):\n N_d = len(E)\n dist = [INF] * N_d\n dist[start] = 0\n q = [(0, start)]\n while q:\n dist_v, v = heappop(q)\n if dist[v] != dist_v:\n continue\n for u, dist_vu in E[v]:\n dist_u = dist_v + dist_vu\n if dist_u < dist[u]:\n dist[u] = dist_u\n heappush(q, (dist_u, u))\n return dist\n\n\nN, M = MAP()\nL = [LIST() for i in range(M)]\ngraph = defaultdict(list)\nfor a, b in L:\n graph[a - 1].append((b - 1, 1))\n graph[b - 1].append((a - 1, 1))\nans = 0\nfor i in range(M):\n a, b = L[i]\n E = deepcopy(graph)\n E[a - 1].remove((b - 1, 1))\n E[b - 1].remove((a - 1, 1))\n dist = dijkstra(E, 0)\n if dist.count(INF) > 0:\n ans += 1\nprint(ans)\n", "measured_slow_code_sha256": "3b0c75c5164a810f84adc515ed302d05d4140b865ec422b1df702b4974d0a4da", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 5.2292935433457615, "pair_id": "python_v2_ceaf0c01fae985501e8f069a", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03575", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03575_680014ac22e5d4c6053b7f14622707d902b64052864c264832205bb1657d851e.jsonl.gz", "inputs": "reproduction/python/inputs/p03575.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03575_3b0c75c5164a810f84adc515ed302d05d4140b865ec422b1df702b4974d0a4da.jsonl.gz"}, "slow_code": "import sys, re, os\nfrom collections import deque, defaultdict, Counter\nfrom math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians\nfrom itertools import permutations, combinations, product, accumulate\nfrom operator import itemgetter, mul\nfrom copy import deepcopy\nfrom string import ascii_lowercase, ascii_uppercase, digits\nfrom heapq import heapify, heappop, heappush\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef INT():\n return int(eval(input()))\n\n\ndef MAP():\n return list(map(int, input().split()))\n\n\ndef S_MAP():\n return list(map(str, input().split()))\n\n\ndef LIST():\n return list(map(int, input().split()))\n\n\ndef S_LIST():\n return list(map(str, input().split()))\n\n\nsys.setrecursionlimit(10**9)\nINF = float(\"inf\")\nmod = 10**9 + 7\n\n\ndef dijkstra(E, start):\n N_d = len(E)\n dist = [INF] * N_d\n dist[start] = 0\n q = [(0, start)]\n while q:\n dist_v, v = heappop(q)\n if dist[v] != dist_v:\n continue\n for u, dist_vu in E[v]:\n dist_u = dist_v + dist_vu\n if dist_u < dist[u]:\n dist[u] = dist_u\n heappush(q, (dist_u, u))\n return dist\n\n\nN, M = MAP()\nL = [LIST() for i in range(M)]\ngraph = defaultdict(list)\nfor a, b in L:\n graph[a - 1].append((b - 1, 1))\n graph[b - 1].append((a - 1, 1))\nans = 0\nfor i in range(M):\n a, b = L[i]\n E = deepcopy(graph)\n E[a - 1].remove((b - 1, 1))\n E[b - 1].remove((a - 1, 1))\n dist = dijkstra(E, 0)\n if dist.count(INF) > 0:\n ans += 1\nprint(ans)\n", "slow_code_sha256": "3b0c75c5164a810f84adc515ed302d05d4140b865ec422b1df702b4974d0a4da", "slow_id": "p03575_3b0c75c5164a810f84adc515ed302d05d4140b865ec422b1df702b4974d0a4da", "speedup": 5.212972901458768, "stratum": "4-8", "within_pair_jaccard": 0.21621621621621623, "workload": {"case_count": 100, "description": "Count bridges in a connected simple undirected graph: a bridge is an edge whose removal disconnects it. Vertices are numbered 1..N and each listed edge has a_i l[low + 1]:\n tmp = l[low + 1]\n l[low + 1] = l[low]\n l[low] = tmp\n return l\n\n\nbubblesort(P)\nsum = 0\nfor i in range(K):\n sum = sum + P[i]\nprint(sum)\n", "measured_slow_code_sha256": "12fc0a6880b1658c0eaeba3aa7dd7893393cf5c052e40105869e3784eb2f1caa", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 18.55568325465222, "pair_id": "python_v2_6cc36ea307490b128675c1d7", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02628", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02628_7188df051969712755fc178404f6a0826e6bb59b46b3085137607e4095e3d546.jsonl.gz", "inputs": "reproduction/python/inputs/p02628.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02628_12fc0a6880b1658c0eaeba3aa7dd7893393cf5c052e40105869e3784eb2f1caa.jsonl.gz"}, "slow_code": "N, K = list(map(int, input().split()))\nP = list(map(int, input().split()))\n\n\ndef bubblesort(l):\n for index in range(len(l) - 1, 0, -1):\n for low in range(index):\n if l[low] > l[low + 1]:\n tmp = l[low + 1]\n l[low + 1] = l[low]\n l[low] = tmp\n return l\n\n\nbubblesort(P)\nsum = 0\nfor i in range(K):\n sum = sum + P[i]\nprint(sum)\n", "slow_code_sha256": "12fc0a6880b1658c0eaeba3aa7dd7893393cf5c052e40105869e3784eb2f1caa", "slow_id": "p02628_12fc0a6880b1658c0eaeba3aa7dd7893393cf5c052e40105869e3784eb2f1caa", "speedup": 44.88678460644107, "stratum": "8+", "within_pair_jaccard": 0.2413793103448276, "workload": {"case_count": 100, "description": "Choose K distinct kinds among N fruits, buying one item of each, to minimize the total price. Price p_i is the cost of one item of kind i. Observed inputs: N=1..1000 (median 100); K=1..1000 (median 99); p_i=1..1000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 5010, "median": 457.0, "min": 6}, "input_format": ["N K\np_1 ... p_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1002, "median": 102.0, "min": 3}}} -{"case_ids": ["p03502_case_000", "p03502_case_001", "p03502_case_002", "p03502_case_003", "p03502_case_004", "p03502_case_005", "p03502_case_006", "p03502_case_007", "p03502_case_008", "p03502_case_009", "p03502_case_010", "p03502_case_011", "p03502_case_012", "p03502_case_013", "p03502_case_014", "p03502_case_015", "p03502_case_016", "p03502_case_017", "p03502_case_018", "p03502_case_019", "p03502_case_020", "p03502_case_021", "p03502_case_022", "p03502_case_023", "p03502_case_024", "p03502_case_025", "p03502_case_026", "p03502_case_027", "p03502_case_028", "p03502_case_029", "p03502_case_030", "p03502_case_031", "p03502_case_032", "p03502_case_033", "p03502_case_034", "p03502_case_035", "p03502_case_036", "p03502_case_037", "p03502_case_038", "p03502_case_039", "p03502_case_040", "p03502_case_041", "p03502_case_042", "p03502_case_043", "p03502_case_044", "p03502_case_045", "p03502_case_046", "p03502_case_047", "p03502_case_048", "p03502_case_049", "p03502_case_050", "p03502_case_051", "p03502_case_052", "p03502_case_053", "p03502_case_054", "p03502_case_055", "p03502_case_056", "p03502_case_057", "p03502_case_058", "p03502_case_059", "p03502_case_060", "p03502_case_061", "p03502_case_062", "p03502_case_063", "p03502_case_064", "p03502_case_065", "p03502_case_066", "p03502_case_067", "p03502_case_068", "p03502_case_069", "p03502_case_070", "p03502_case_071", "p03502_case_072", "p03502_case_073", "p03502_case_074", "p03502_case_075", "p03502_case_076", "p03502_case_077", "p03502_case_078", "p03502_case_079", "p03502_case_080", "p03502_case_081", "p03502_case_082", "p03502_case_083", "p03502_case_084", "p03502_case_085", "p03502_case_086", "p03502_case_087", "p03502_case_088", "p03502_case_089", "p03502_case_090", "p03502_case_091", "p03502_case_092", "p03502_case_093", "p03502_case_094", "p03502_case_095", "p03502_case_096", "p03502_case_097", "p03502_case_098", "p03502_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def digit10(x):\n dten = 0\n while x > 0:\n dten += int(x % 10)\n x /= 10\n return dten\n\n\nn = int(eval(input()))\nif n % digit10(n) == 0:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "fast_code_sha256": "4b30e1542d9d5e61e261aecc0e4fe2b4fd98b95e8d562239e8c89b28d744d74b", "fast_id": "p03502_4b30e1542d9d5e61e261aecc0e4fe2b4fd98b95e8d562239e8c89b28d744d74b", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def digit10(x):\n dten = 0\n while x > 0:\n dten += int(x % 10)\n x /= 10\n return dten\n\n\nn = int(eval(input()))\nif n % digit10(n) == 0:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "measured_fast_code_sha256": "4b30e1542d9d5e61e261aecc0e4fe2b4fd98b95e8d562239e8c89b28d744d74b", "measured_slow_code": "import sys\nimport math\nimport collections\nimport itertools\nimport array\nimport inspect\n\n# Set max recursion limit\nsys.setrecursionlimit(10000)\n# Debug output\ndef chkprint(*args):\n names = {id(v): k for k, v in list(inspect.currentframe().f_back.f_locals.items())}\n print((\", \".join(names.get(id(arg), \"???\") + \" = \" + repr(arg) for arg in args)))\n\n\n# Binary converter\ndef to_bin(x):\n return bin(x)[2:]\n\n\ndef li_input():\n return [int(_) for _ in input().split()]\n\n\n# --------------------------------------------\ndp = None\n\n\ndef main():\n X = int(eval(input()))\n if X % sum(list(map(int, list(str(X))))) == 0:\n print(\"Yes\")\n else:\n print(\"No\")\n\n\nmain()\n", "measured_slow_code_sha256": "9657e24fd296bdb183cb812efcaa41e0e4d09edff18e911040359edf4aba2689", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 14.010479837868882, "pair_id": "python_v2_748f029125134311bf40679f", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03502", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03502_4b30e1542d9d5e61e261aecc0e4fe2b4fd98b95e8d562239e8c89b28d744d74b.jsonl.gz", "inputs": "reproduction/python/inputs/p03502.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03502_9657e24fd296bdb183cb812efcaa41e0e4d09edff18e911040359edf4aba2689.jsonl.gz"}, "slow_code": "import sys\nimport math\nimport collections\nimport itertools\nimport array\nimport inspect\n\n\nsys.setrecursionlimit(10000)\n\n\ndef chkprint(*args):\n names = {id(v): k for k, v in list(inspect.currentframe().f_back.f_locals.items())}\n print((\", \".join(names.get(id(arg), \"???\") + \" = \" + repr(arg) for arg in args)))\n\n\ndef to_bin(x):\n return bin(x)[2:]\n\n\ndef li_input():\n return [int(_) for _ in input().split()]\n\n\ndp = None\n\n\ndef main():\n X = int(eval(input()))\n if X % sum(list(map(int, list(str(X))))) == 0:\n print(\"Yes\")\n else:\n print(\"No\")\n\n\nmain()\n", "slow_code_sha256": "04afcb0636d6758b9c1fd4024fff2537c6c73d327a7f8a692ef75cf80e1d3933", "slow_id": "p03502_9657e24fd296bdb183cb812efcaa41e0e4d09edff18e911040359edf4aba2689", "speedup": 14.037663733168282, "stratum": "8+", "within_pair_jaccard": 0.21428571428571427, "workload": {"case_count": 100, "description": "Determine whether positive integer N is divisible by the sum of its decimal digits. Observed inputs: N=1..100000000 (median 8425409).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 10, "median": 8.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p03207_case_000", "p03207_case_001", "p03207_case_002", "p03207_case_003", "p03207_case_004", "p03207_case_005", "p03207_case_006", "p03207_case_007", "p03207_case_008", "p03207_case_009", "p03207_case_010", "p03207_case_011", "p03207_case_012", "p03207_case_013", "p03207_case_014", "p03207_case_015", "p03207_case_016", "p03207_case_017", "p03207_case_018", "p03207_case_019", "p03207_case_020", "p03207_case_021", "p03207_case_022", "p03207_case_023", "p03207_case_024", "p03207_case_025", "p03207_case_026", "p03207_case_027", "p03207_case_028", "p03207_case_029", "p03207_case_030", "p03207_case_031", "p03207_case_032", "p03207_case_033", "p03207_case_034", "p03207_case_035", "p03207_case_036", "p03207_case_037", "p03207_case_038", "p03207_case_039", "p03207_case_040", "p03207_case_041", "p03207_case_042", "p03207_case_043", "p03207_case_044", "p03207_case_045", "p03207_case_046", "p03207_case_047", "p03207_case_048", "p03207_case_049", "p03207_case_050", "p03207_case_051", "p03207_case_052", "p03207_case_053", "p03207_case_054", "p03207_case_055", "p03207_case_056", "p03207_case_057", "p03207_case_058", "p03207_case_059", "p03207_case_060", "p03207_case_061", "p03207_case_062", "p03207_case_063", "p03207_case_064", "p03207_case_065", "p03207_case_066", "p03207_case_067", "p03207_case_068", "p03207_case_069", "p03207_case_070", "p03207_case_071", "p03207_case_072", "p03207_case_073", "p03207_case_074", "p03207_case_075", "p03207_case_076", "p03207_case_077", "p03207_case_078", "p03207_case_079", "p03207_case_080", "p03207_case_081", "p03207_case_082", "p03207_case_083", "p03207_case_084", "p03207_case_085", "p03207_case_086", "p03207_case_087", "p03207_case_088", "p03207_case_089", "p03207_case_090", "p03207_case_091", "p03207_case_092", "p03207_case_093", "p03207_case_094", "p03207_case_095", "p03207_case_096", "p03207_case_097", "p03207_case_098", "p03207_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "l = [int(eval(input())) for _ in range(int(eval(input())))]\nprint((sum(l) - int(max(l) / 2)))\n", "fast_code_sha256": "60fe966737f49c9f09ca9b30028457d40dee8076bb1f72c65409ce7b66c06f3e", "fast_id": "p03207_60fe966737f49c9f09ca9b30028457d40dee8076bb1f72c65409ce7b66c06f3e", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "l = [int(eval(input())) for _ in range(int(eval(input())))]\nprint((sum(l) - int(max(l) / 2)))\n", "measured_fast_code_sha256": "60fe966737f49c9f09ca9b30028457d40dee8076bb1f72c65409ce7b66c06f3e", "measured_slow_code": "#!/usr/bin/env python3\n# encoding:utf-8\nimport copy\nimport random\nimport bisect # bisect_left これで二部探索の大小検索が行える\nimport fractions # 最小公倍数などはこっち\nimport math\nimport sys\nimport collections\nfrom decimal import Decimal # 10進数で考慮できる\n\nmod = 10**9 + 7\nsys.setrecursionlimit(mod) # 再帰回数上限はでdefault1000\nd = collections.deque()\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\nN = int(eval(input()))\np = [0 for i in range(N)]\nfor i in range(N):\n p[i] = int(eval(input()))\np.sort()\nans = sum(p)\nans -= p[-1] // 2\nprint(ans)\n", "measured_slow_code_sha256": "5cb7a4c7cf0d8a71a4fd49887b2da818d3766f3e397b1d44bc46374144eeebdc", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 26.8384944236587, "pair_id": "python_v2_ed2ae5c0c4b66494e1f5afa6", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03207", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03207_60fe966737f49c9f09ca9b30028457d40dee8076bb1f72c65409ce7b66c06f3e.jsonl.gz", "inputs": "reproduction/python/inputs/p03207.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03207_5cb7a4c7cf0d8a71a4fd49887b2da818d3766f3e397b1d44bc46374144eeebdc.jsonl.gz"}, "slow_code": "import copy\nimport random\nimport bisect\nimport fractions\nimport math\nimport sys\nimport collections\nfrom decimal import Decimal\n\nmod = 10**9 + 7\nsys.setrecursionlimit(mod)\nd = collections.deque()\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\nN = int(eval(input()))\np = [0 for i in range(N)]\nfor i in range(N):\n p[i] = int(eval(input()))\np.sort()\nans = sum(p)\nans -= p[-1] // 2\nprint(ans)\n", "slow_code_sha256": "fe2f7e4c4fa4bf811a1052a7e9a8cc8bf127a2538fd41f3ded0df182a9217e19", "slow_id": "p03207_5cb7a4c7cf0d8a71a4fd49887b2da818d3766f3e397b1d44bc46374144eeebdc", "speedup": 26.90203148046514, "stratum": "8+", "within_pair_jaccard": 0.17777777777777778, "workload": {"case_count": 100, "description": "Buy all N items, using one coupon to halve the price of one highest-priced item. Other items retain full price; every p_i is even. Output total payment. Observed inputs: N=2..10 (median 5); p_i=100..10000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 63, "median": 24.0, "min": 10}, "input_format": ["N\np_1\n...\np_N"], "input_format_status": "source_input_section", "input_lines": {"max": 11, "median": 6.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 11, "median": 6.0, "min": 3}}} -{"case_ids": ["p03576_case_000", "p03576_case_001", "p03576_case_002", "p03576_case_003", "p03576_case_004", "p03576_case_005", "p03576_case_006", "p03576_case_007", "p03576_case_008", "p03576_case_009", "p03576_case_010", "p03576_case_011", "p03576_case_012", "p03576_case_013", "p03576_case_014", "p03576_case_015", "p03576_case_016", "p03576_case_017", "p03576_case_018", "p03576_case_019", "p03576_case_020", "p03576_case_021", "p03576_case_022", "p03576_case_023", "p03576_case_024", "p03576_case_025", "p03576_case_026", "p03576_case_027", "p03576_case_028", "p03576_case_029", "p03576_case_030", "p03576_case_031", "p03576_case_032", "p03576_case_033", "p03576_case_034", "p03576_case_035", "p03576_case_036", "p03576_case_037", "p03576_case_038", "p03576_case_039", "p03576_case_040", "p03576_case_041", "p03576_case_042", "p03576_case_043", "p03576_case_044", "p03576_case_045", "p03576_case_046", "p03576_case_047", "p03576_case_048", "p03576_case_049", "p03576_case_050", "p03576_case_051", "p03576_case_052", "p03576_case_053", "p03576_case_054", "p03576_case_055", "p03576_case_056", "p03576_case_057", "p03576_case_058", "p03576_case_059", "p03576_case_060", "p03576_case_061", "p03576_case_062", "p03576_case_063", "p03576_case_064", "p03576_case_065", "p03576_case_066", "p03576_case_067", "p03576_case_068", "p03576_case_069", "p03576_case_070", "p03576_case_071", "p03576_case_072", "p03576_case_073", "p03576_case_074", "p03576_case_075", "p03576_case_076", "p03576_case_077", "p03576_case_078", "p03576_case_079", "p03576_case_080", "p03576_case_081", "p03576_case_082", "p03576_case_083", "p03576_case_084", "p03576_case_085", "p03576_case_086", "p03576_case_087", "p03576_case_088", "p03576_case_089", "p03576_case_090", "p03576_case_091", "p03576_case_092", "p03576_case_093", "p03576_case_094", "p03576_case_095", "p03576_case_096", "p03576_case_097", "p03576_case_098", "p03576_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n, k = list(map(int, input().split()))\nz = [list(map(int, input().split())) for _ in range(n)]\nz.sort()\na = 10**20\nfor i in range(n):\n for j in range(i + 1, n):\n x = z[j][0] - z[i][0]\n l = sorted(t[1] for t in z[i : j + 1])\n for u, v in zip(l, l[k - 1 :]):\n a = min(a, x * (v - u))\nprint(a)\n", "fast_code_sha256": "7d28b13d8f36da831b4e8db42d66579a96c1758ec79426d7321df8f3ee1fb05c", "fast_id": "p03576_7d28b13d8f36da831b4e8db42d66579a96c1758ec79426d7321df8f3ee1fb05c", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n, k = list(map(int, input().split()))\nz = [list(map(int, input().split())) for _ in range(n)]\nz.sort()\na = 10**20\nfor i in range(n):\n for j in range(i + 1, n):\n x = z[j][0] - z[i][0]\n l = sorted(t[1] for t in z[i : j + 1])\n for u, v in zip(l, l[k - 1 :]):\n a = min(a, x * (v - u))\nprint(a)\n", "measured_fast_code_sha256": "7d28b13d8f36da831b4e8db42d66579a96c1758ec79426d7321df8f3ee1fb05c", "measured_slow_code": "from collections import deque\nimport sys\n\nsys.setrecursionlimit(10**6)\nint1 = lambda x: int(x) - 1\np2D = lambda x: print(*x, sep=\"\\n\")\n\n\ndef II():\n return int(sys.stdin.readline())\n\n\ndef MI():\n return map(int, sys.stdin.readline().split())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\ndef LLI(rows_number):\n return [LI() for _ in range(rows_number)]\n\n\ndef SI():\n return sys.stdin.readline()[:-1]\n\n\ndef main():\n n, k = MI()\n xx = set()\n yy = set()\n xy = []\n for _ in range(n):\n x, y = MI()\n xy.append((x, y))\n xx.add(x)\n yy.add(y)\n xy.sort()\n xx = list(sorted(xx))\n yy = list(sorted(yy))\n xn = len(xx)\n yn = len(yy)\n ans = 10**20\n for t in range(yn):\n y2 = yy[t]\n for b in range(t):\n y1 = yy[b]\n r = -1\n s = 0\n i = j = 0\n for l, x1 in enumerate(xx):\n while i < n and xy[i][0] < x1:\n if y1 <= xy[i][1] <= y2:\n s -= 1\n i += 1\n while s < k and r + 1 < xn:\n r += 1\n x2 = xx[r]\n while j < n and xy[j][0] <= x2:\n if y1 <= xy[j][1] <= y2:\n s += 1\n j += 1\n if s >= k:\n cur = (x2 - x1) * (y2 - y1)\n if cur < ans:\n ans = cur\n print(ans)\n\n\nmain()\n", "measured_slow_code_sha256": "6c48ca4952222a34459527fefebd4fba0a4aef00613d16a58fcec410d8fd9e1e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 5.3985647198363065, "pair_id": "python_v2_e6143afad255a58545ec3cd4", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03576", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03576_7d28b13d8f36da831b4e8db42d66579a96c1758ec79426d7321df8f3ee1fb05c.jsonl.gz", "inputs": "reproduction/python/inputs/p03576.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03576_6c48ca4952222a34459527fefebd4fba0a4aef00613d16a58fcec410d8fd9e1e.jsonl.gz"}, "slow_code": "from collections import deque\nimport sys\n\nsys.setrecursionlimit(10**6)\nint1 = lambda x: int(x) - 1\np2D = lambda x: print(*x, sep=\"\\n\")\n\n\ndef II():\n return int(sys.stdin.readline())\n\n\ndef MI():\n return map(int, sys.stdin.readline().split())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\ndef LLI(rows_number):\n return [LI() for _ in range(rows_number)]\n\n\ndef SI():\n return sys.stdin.readline()[:-1]\n\n\ndef main():\n n, k = MI()\n xx = set()\n yy = set()\n xy = []\n for _ in range(n):\n x, y = MI()\n xy.append((x, y))\n xx.add(x)\n yy.add(y)\n xy.sort()\n xx = list(sorted(xx))\n yy = list(sorted(yy))\n xn = len(xx)\n yn = len(yy)\n ans = 10**20\n for t in range(yn):\n y2 = yy[t]\n for b in range(t):\n y1 = yy[b]\n r = -1\n s = 0\n i = j = 0\n for l, x1 in enumerate(xx):\n while i < n and xy[i][0] < x1:\n if y1 <= xy[i][1] <= y2:\n s -= 1\n i += 1\n while s < k and r + 1 < xn:\n r += 1\n x2 = xx[r]\n while j < n and xy[j][0] <= x2:\n if y1 <= xy[j][1] <= y2:\n s += 1\n j += 1\n if s >= k:\n cur = (x2 - x1) * (y2 - y1)\n if cur < ans:\n ans = cur\n print(ans)\n\n\nmain()\n", "slow_code_sha256": "6c48ca4952222a34459527fefebd4fba0a4aef00613d16a58fcec410d8fd9e1e", "slow_id": "p03576_6c48ca4952222a34459527fefebd4fba0a4aef00613d16a58fcec410d8fd9e1e", "speedup": 5.227529513934424, "stratum": "4-8", "within_pair_jaccard": 0.2972972972972973, "workload": {"case_count": 100, "description": "Find the minimum area of an axis-aligned rectangle containing at least K of N plane points, counting boundary points. All x coordinates are distinct, and all y coordinates are distinct. Observed inputs: N=2..50 (median 25); K=2..50 (median 2.5); x_i=-1000000000..997427460; y_i=-1000000000..997398050.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1106, "median": 524.0, "min": 40}, "input_format": ["N K\nx_1 y_1\n...\nx_N y_N"], "input_format_status": "source_input_section", "input_lines": {"max": 51, "median": 26.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 102, "median": 52.0, "min": 6}}} -{"case_ids": ["p02573_case_000", "p02573_case_001", "p02573_case_002", "p02573_case_003", "p02573_case_004", "p02573_case_005", "p02573_case_006", "p02573_case_007", "p02573_case_008", "p02573_case_009", "p02573_case_010", "p02573_case_011", "p02573_case_012", "p02573_case_013", "p02573_case_014", "p02573_case_015", "p02573_case_016", "p02573_case_017", "p02573_case_018", "p02573_case_019", "p02573_case_020", "p02573_case_021", "p02573_case_022", "p02573_case_023", "p02573_case_024", "p02573_case_025", "p02573_case_026", "p02573_case_027", "p02573_case_028", "p02573_case_029", "p02573_case_030", "p02573_case_031", "p02573_case_032", "p02573_case_033", "p02573_case_034", "p02573_case_035", "p02573_case_036", "p02573_case_037", "p02573_case_038", "p02573_case_039", "p02573_case_040", "p02573_case_041", "p02573_case_042", "p02573_case_043", "p02573_case_044", "p02573_case_045", "p02573_case_046", "p02573_case_047", "p02573_case_048", "p02573_case_049", "p02573_case_050", "p02573_case_051", "p02573_case_052", "p02573_case_053", "p02573_case_054", "p02573_case_055", "p02573_case_056", "p02573_case_057", "p02573_case_058", "p02573_case_059", "p02573_case_060", "p02573_case_061", "p02573_case_062", "p02573_case_063", "p02573_case_064", "p02573_case_065", "p02573_case_066", "p02573_case_067", "p02573_case_068", "p02573_case_069", "p02573_case_070", "p02573_case_071", "p02573_case_072", "p02573_case_073", "p02573_case_074", "p02573_case_075", "p02573_case_076", "p02573_case_077", "p02573_case_078", "p02573_case_079", "p02573_case_080", "p02573_case_081", "p02573_case_082", "p02573_case_083", "p02573_case_084", "p02573_case_085", "p02573_case_086", "p02573_case_087", "p02573_case_088", "p02573_case_089", "p02573_case_090", "p02573_case_091", "p02573_case_092", "p02573_case_093", "p02573_case_094", "p02573_case_095", "p02573_case_096", "p02573_case_097", "p02573_case_098", "p02573_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def find(x):\n if par[x] < 0:\n return x\n else:\n par[x] = find(par[x])\n return par[x]\n\n\ndef unite(x, y):\n x = find(x)\n y = find(y)\n if x == y:\n return False\n else:\n if par[x] > par[y]:\n x, y = y, x\n par[x] += par[y]\n par[y] = x\n return True\n\n\nimport sys\n\ninput = sys.stdin.readline\nn, m = list(map(int, input().split()))\npar = [-1] * n\na = set()\nfor _ in range(m):\n ab = sorted(map(int, input().split()))\n a.add((ab[0], ab[1]))\nfor x, y in a:\n unite(x - 1, y - 1)\nprint((-min(par)))\n", "fast_code_sha256": "5685120b393a7f6971a97960cb4a2b0d1ec6b015a41cf8b0502742828261c1a1", "fast_id": "p02573_9a9c87c112282f06d62730944c7a3d261454e6e09398f5e35b2946db630946a8", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "# Union Find\ndef find(x):\n if par[x] < 0:\n return x\n else:\n par[x] = find(par[x])\n return par[x]\n\n\ndef unite(x, y):\n x = find(x)\n y = find(y)\n if x == y:\n return False\n else:\n if par[x] > par[y]:\n x, y = y, x\n par[x] += par[y]\n par[y] = x\n return True\n\n\nimport sys\n\ninput = sys.stdin.readline\nn, m = list(map(int, input().split()))\npar = [-1] * n\na = set()\nfor _ in range(m):\n ab = sorted(map(int, input().split()))\n a.add((ab[0], ab[1]))\nfor x, y in a:\n unite(x - 1, y - 1)\nprint((-min(par)))\n", "measured_fast_code_sha256": "9a9c87c112282f06d62730944c7a3d261454e6e09398f5e35b2946db630946a8", "measured_slow_code": "class UFTree:\n def __init__(self, N):\n self.nodes = [Node(i) for i in range(N)]\n self.N = N\n\n def find_max_child_num(self):\n result = 0\n for i in range(self.N):\n result = max(result, self.nodes[i].child_num)\n return result\n\n\nclass Node:\n def __init__(self, ID):\n self.ID = ID\n self.parent = None\n self.child_num = 0\n self.rank = 1\n\n def get_root(self):\n if self.parent is None:\n return self\n return self.parent.get_root()\n\n def is_in_same_tree(self, another):\n return self.get_root().ID == another.get_root().ID\n\n def concat(self, another):\n if self.is_in_same_tree(another):\n return\n sr = self.get_root()\n ar = another.get_root()\n if sr.rank > ar.rank:\n parent, child = sr, ar\n else:\n parent, child = ar, sr\n parent.child_num += child.child_num + 1\n parent.rank = max(parent.rank, child.rank + 1)\n child.parent = parent\n\n\nN, M = list(map(int, input().split()))\ntree = UFTree(N)\nAB = []\nfor i in range(M):\n l = list(map(int, input().split()))\n AB.append(l)\nfor i in range(M):\n a, b = AB[i][0], AB[i][1]\n a -= 1\n b -= 1\n tree.nodes[a].concat(tree.nodes[b])\n# # for debug\n# for i in range(N):\n# n = tree.nodes[i]\n# if n.parent is None:\n# print(i + 1, \"is root\")\n# else:\n# print(\"parent of\", i + 1, \"is\", n.parent.ID + 1)\nprint((tree.find_max_child_num() + 1))\n", "measured_slow_code_sha256": "61baf93eb941c46a29ae15eea5da6ae278cbf5a1e1d3cae98504f09eefb23457", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.8823157221388573, "pair_id": "python_v2_0b35a9235b576063ca151d47", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02573", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02573_9a9c87c112282f06d62730944c7a3d261454e6e09398f5e35b2946db630946a8.jsonl.gz", "inputs": "reproduction/python/inputs/p02573.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02573_61baf93eb941c46a29ae15eea5da6ae278cbf5a1e1d3cae98504f09eefb23457.jsonl.gz"}, "slow_code": "class UFTree:\n def __init__(self, N):\n self.nodes = [Node(i) for i in range(N)]\n self.N = N\n\n def find_max_child_num(self):\n result = 0\n for i in range(self.N):\n result = max(result, self.nodes[i].child_num)\n return result\n\n\nclass Node:\n def __init__(self, ID):\n self.ID = ID\n self.parent = None\n self.child_num = 0\n self.rank = 1\n\n def get_root(self):\n if self.parent is None:\n return self\n return self.parent.get_root()\n\n def is_in_same_tree(self, another):\n return self.get_root().ID == another.get_root().ID\n\n def concat(self, another):\n if self.is_in_same_tree(another):\n return\n sr = self.get_root()\n ar = another.get_root()\n if sr.rank > ar.rank:\n parent, child = sr, ar\n else:\n parent, child = ar, sr\n parent.child_num += child.child_num + 1\n parent.rank = max(parent.rank, child.rank + 1)\n child.parent = parent\n\n\nN, M = list(map(int, input().split()))\ntree = UFTree(N)\nAB = []\nfor i in range(M):\n l = list(map(int, input().split()))\n AB.append(l)\nfor i in range(M):\n a, b = AB[i][0], AB[i][1]\n a -= 1\n b -= 1\n tree.nodes[a].concat(tree.nodes[b])\n\n\nprint((tree.find_max_child_num() + 1))\n", "slow_code_sha256": "8e42dd739f11f939e13d222704f39ba6136c1588861267c41088dccb0e91dc37", "slow_id": "p02573_61baf93eb941c46a29ae15eea5da6ae278cbf5a1e1d3cae98504f09eefb23457", "speedup": 2.0229774316764484, "stratum": "2-4", "within_pair_jaccard": 0.24615384615384617, "workload": {"case_count": 100, "description": "M given undirected friendship facts on N people imply all friendships by transitivity. Partition everyone into as few groups as possible with no friends together. Repeated facts are allowed, but a fact never joins a person to themself. Observed inputs: N=2..200000 (median 10000); M=0..200000 (median 20000).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 2578581, "median": 195468.5, "min": 4}, "input_format": ["N M\nA_1 B_1\n...\nA_M B_M"], "input_format_status": "source_input_section", "input_lines": {"max": 200001, "median": 20001.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 400002, "median": 40002.0, "min": 2}}} -{"case_ids": ["p02881_case_000", "p02881_case_001", "p02881_case_002", "p02881_case_003", "p02881_case_004", "p02881_case_005", "p02881_case_006", "p02881_case_007", "p02881_case_008", "p02881_case_009", "p02881_case_010", "p02881_case_011", "p02881_case_012", "p02881_case_013", "p02881_case_014", "p02881_case_015", "p02881_case_016", "p02881_case_017", "p02881_case_018", "p02881_case_019", "p02881_case_020", "p02881_case_021", "p02881_case_022", "p02881_case_023", "p02881_case_024", "p02881_case_025", "p02881_case_026", "p02881_case_027", "p02881_case_028", "p02881_case_029", "p02881_case_030", "p02881_case_031", "p02881_case_032", "p02881_case_033", "p02881_case_034", "p02881_case_035", "p02881_case_036", "p02881_case_037", "p02881_case_038", "p02881_case_039", "p02881_case_040", "p02881_case_041", "p02881_case_042", "p02881_case_043", "p02881_case_044", "p02881_case_045", "p02881_case_046", "p02881_case_047", "p02881_case_048", "p02881_case_049", "p02881_case_050", "p02881_case_051", "p02881_case_052", "p02881_case_053", "p02881_case_054", "p02881_case_055", "p02881_case_056", "p02881_case_057", "p02881_case_058", "p02881_case_059", "p02881_case_060", "p02881_case_061", "p02881_case_062", "p02881_case_063", "p02881_case_064", "p02881_case_065", "p02881_case_066", "p02881_case_067", "p02881_case_068", "p02881_case_069", "p02881_case_070", "p02881_case_071", "p02881_case_072", "p02881_case_073", "p02881_case_074", "p02881_case_075", "p02881_case_076", "p02881_case_077", "p02881_case_078", "p02881_case_079", "p02881_case_080", "p02881_case_081", "p02881_case_082", "p02881_case_083", "p02881_case_084", "p02881_case_085", "p02881_case_086", "p02881_case_087", "p02881_case_088", "p02881_case_089", "p02881_case_090", "p02881_case_091", "p02881_case_092", "p02881_case_093", "p02881_case_094", "p02881_case_095", "p02881_case_096", "p02881_case_097", "p02881_case_098", "p02881_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N = int(eval(input()))\nx = int(N**0.5)\nfor i in range(x, 0, -1):\n if N % i == 0:\n y = N // i\n break\nans = N // y + y - 2\nprint(ans)\n", "fast_code_sha256": "385f918e70558d30ce24cedf0de5f4a96a7aad60475bd5eec62a4ce0ebe4edee", "fast_id": "p02881_385f918e70558d30ce24cedf0de5f4a96a7aad60475bd5eec62a4ce0ebe4edee", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N = int(eval(input()))\nx = int(N**0.5)\nfor i in range(x, 0, -1):\n if N % i == 0:\n y = N // i\n break\nans = N // y + y - 2\nprint(ans)\n", "measured_fast_code_sha256": "385f918e70558d30ce24cedf0de5f4a96a7aad60475bd5eec62a4ce0ebe4edee", "measured_slow_code": "n = int(eval(input()))\nprint((min(a + (n // a) - 2 for a in range(1, int(n**0.5) + 1) if n % a == 0)))\n", "measured_slow_code_sha256": "36720fd25781c0395680ee7f14e52e9d3fb0f8d0f6a697475f9b0b71c7cfbd26", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.3360451676257876, "pair_id": "python_v2_8a9856ae1a36455b62265d72", "per_case_slow_code_faster_fraction": 0.44, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02881", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02881_385f918e70558d30ce24cedf0de5f4a96a7aad60475bd5eec62a4ce0ebe4edee.jsonl.gz", "inputs": "reproduction/python/inputs/p02881.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02881_36720fd25781c0395680ee7f14e52e9d3fb0f8d0f6a697475f9b0b71c7cfbd26.jsonl.gz"}, "slow_code": "n = int(eval(input()))\nprint((min(a + (n // a) - 2 for a in range(1, int(n**0.5) + 1) if n % a == 0)))\n", "slow_code_sha256": "36720fd25781c0395680ee7f14e52e9d3fb0f8d0f6a697475f9b0b71c7cfbd26", "slow_id": "p02881_36720fd25781c0395680ee7f14e52e9d3fb0f8d0f6a697475f9b0b71c7cfbd26", "speedup": 6.463698016114384, "stratum": "4-8", "within_pair_jaccard": 0.2, "workload": {"case_count": 100, "description": "On an infinite grid with value i*j at cell (i,j), start at (1,1). Each move increases exactly one coordinate by 1. Minimize moves to reach any cell of value N. Observed inputs: N=2..1000000000000 (median 260337887119.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 14, "median": 13.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p03183_case_000", "p03183_case_001", "p03183_case_002", "p03183_case_003", "p03183_case_004", "p03183_case_005", "p03183_case_006", "p03183_case_007", "p03183_case_008", "p03183_case_009", "p03183_case_010", "p03183_case_011", "p03183_case_012", "p03183_case_013", "p03183_case_014", "p03183_case_015", "p03183_case_016", "p03183_case_017", "p03183_case_018", "p03183_case_019", "p03183_case_020", "p03183_case_021", "p03183_case_022", "p03183_case_023", "p03183_case_024", "p03183_case_025", "p03183_case_026", "p03183_case_027", "p03183_case_028", "p03183_case_029", "p03183_case_030", "p03183_case_031", "p03183_case_032", "p03183_case_033", "p03183_case_034", "p03183_case_035", "p03183_case_036", "p03183_case_037", "p03183_case_038", "p03183_case_039", "p03183_case_040", "p03183_case_041", "p03183_case_042", "p03183_case_043", "p03183_case_044", "p03183_case_045", "p03183_case_046", "p03183_case_047", "p03183_case_048", "p03183_case_049", "p03183_case_050", "p03183_case_051", "p03183_case_052", "p03183_case_053", "p03183_case_054", "p03183_case_055", "p03183_case_056", "p03183_case_057", "p03183_case_058", "p03183_case_059", "p03183_case_060", "p03183_case_061", "p03183_case_062", "p03183_case_063", "p03183_case_064", "p03183_case_065", "p03183_case_066", "p03183_case_067", "p03183_case_068", "p03183_case_069", "p03183_case_070", "p03183_case_071", "p03183_case_072", "p03183_case_073", "p03183_case_074", "p03183_case_075", "p03183_case_076", "p03183_case_077", "p03183_case_078", "p03183_case_079", "p03183_case_080", "p03183_case_081", "p03183_case_082", "p03183_case_083", "p03183_case_084", "p03183_case_085", "p03183_case_086", "p03183_case_087", "p03183_case_088", "p03183_case_089", "p03183_case_090", "p03183_case_091", "p03183_case_092", "p03183_case_093", "p03183_case_094", "p03183_case_095", "p03183_case_096", "p03183_case_097", "p03183_case_098", "p03183_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def f(n):\n mx = 0\n dp = [0] * (n * 10**4 + 1)\n bs = [list(map(int, input().split())) for _ in range(n)]\n bs.sort(key=lambda x: x[0] + x[1])\n for w, s, v in bs:\n for i in range(w + s, w - 1, -1):\n dpw = dp[i - w] + v\n if dpw > dp[i]:\n dp[i] = dpw\n if dpw > mx:\n mx = dpw\n print(mx)\n\n\nn = int(eval(input()))\nf(n)\n", "fast_code_sha256": "8b1ea3952a24a35297766c5a62ef16e111b8ba7078307cfbdf79e92154a780e0", "fast_id": "p03183_8b1ea3952a24a35297766c5a62ef16e111b8ba7078307cfbdf79e92154a780e0", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def f(n):\n mx = 0\n dp = [0] * (n * 10**4 + 1)\n bs = [list(map(int, input().split())) for _ in range(n)]\n bs.sort(key=lambda x: x[0] + x[1])\n for w, s, v in bs:\n for i in range(w + s, w - 1, -1):\n dpw = dp[i - w] + v\n if dpw > dp[i]:\n dp[i] = dpw\n if dpw > mx:\n mx = dpw\n print(mx)\n\n\nn = int(eval(input()))\nf(n)\n", "measured_fast_code_sha256": "8b1ea3952a24a35297766c5a62ef16e111b8ba7078307cfbdf79e92154a780e0", "measured_slow_code": "import sys\n\nsys.setrecursionlimit(2147483647)\nINF = float(\"inf\")\nMOD = 10**9 + 7\ninput = lambda: sys.stdin.readline().rstrip()\n\n\ndef resolve():\n from functools import cmp_to_key\n\n n = int(eval(input()))\n B = [list(map(int, input().split())) for _ in range(n)]\n\n def cmp(a, b):\n va = min(a[1], b[1] - a[0])\n vb = min(b[1], a[1] - b[0])\n if va == vb:\n return 0\n return -1 if (va > vb) else 1\n\n B.sort(key=cmp_to_key(cmp))\n maxS = 20000\n dp = [-INF] * (maxS + 1)\n dp[0] = 0\n for i in range(n):\n w, s, v = B[i]\n ndp = dp[:]\n for total in range(maxS + 1):\n if total <= s and total + s <= maxS:\n ndp[total + w] = max(ndp[total + w], dp[total] + v)\n dp = ndp[:]\n print((max(dp)))\n\n\nresolve()\n", "measured_slow_code_sha256": "961ff7e33dcf41c91be9ccd5c27fe0c80e6fd0d2467fec260e8393b575caab59", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.283714666385628, "pair_id": "python_v2_76a03ae7755f6fe362b33df0", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03183", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03183_8b1ea3952a24a35297766c5a62ef16e111b8ba7078307cfbdf79e92154a780e0.jsonl.gz", "inputs": "reproduction/python/inputs/p03183.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03183_961ff7e33dcf41c91be9ccd5c27fe0c80e6fd0d2467fec260e8393b575caab59.jsonl.gz"}, "slow_code": "import sys\n\nsys.setrecursionlimit(2147483647)\nINF = float(\"inf\")\nMOD = 10**9 + 7\ninput = lambda: sys.stdin.readline().rstrip()\n\n\ndef resolve():\n from functools import cmp_to_key\n\n n = int(eval(input()))\n B = [list(map(int, input().split())) for _ in range(n)]\n\n def cmp(a, b):\n va = min(a[1], b[1] - a[0])\n vb = min(b[1], a[1] - b[0])\n if va == vb:\n return 0\n return -1 if (va > vb) else 1\n\n B.sort(key=cmp_to_key(cmp))\n maxS = 20000\n dp = [-INF] * (maxS + 1)\n dp[0] = 0\n for i in range(n):\n w, s, v = B[i]\n ndp = dp[:]\n for total in range(maxS + 1):\n if total <= s and total + s <= maxS:\n ndp[total + w] = max(ndp[total + w], dp[total] + v)\n dp = ndp[:]\n print((max(dp)))\n\n\nresolve()\n", "slow_code_sha256": "961ff7e33dcf41c91be9ccd5c27fe0c80e6fd0d2467fec260e8393b575caab59", "slow_id": "p03183_961ff7e33dcf41c91be9ccd5c27fe0c80e6fd0d2467fec260e8393b575caab59", "speedup": 4.7121142082933725, "stratum": "4-8", "within_pair_jaccard": 0.3968253968253968, "workload": {"case_count": 100, "description": "Choose and order some of N blocks into a tower to maximize total value v_i. Block i has weight w_i and can support total weight at most s_i strictly above it. Each block can be used at most once. Observed inputs: N=10..1000 (median 100); w_i=1..10000; s_i=1..10000; v_i=69804..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 21928, "median": 2196.5, "min": 139}, "input_format": ["N\nw_1 s_1 v_1\n...\nw_N s_N v_N"], "input_format_status": "source_input_section", "input_lines": {"max": 1001, "median": 101.0, "min": 11}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3001, "median": 301.0, "min": 31}}} -{"case_ids": ["p02729_case_000", "p02729_case_001", "p02729_case_002", "p02729_case_003", "p02729_case_004", "p02729_case_005", "p02729_case_006", "p02729_case_007", "p02729_case_008", "p02729_case_009", "p02729_case_010", "p02729_case_011", "p02729_case_012", "p02729_case_013", "p02729_case_014", "p02729_case_015", "p02729_case_016", "p02729_case_017", "p02729_case_018", "p02729_case_019", "p02729_case_020", "p02729_case_021", "p02729_case_022", "p02729_case_023", "p02729_case_024", "p02729_case_025", "p02729_case_026", "p02729_case_027", "p02729_case_028", "p02729_case_029", "p02729_case_030", "p02729_case_031", "p02729_case_032", "p02729_case_033", "p02729_case_034", "p02729_case_035", "p02729_case_036", "p02729_case_037", "p02729_case_038", "p02729_case_039", "p02729_case_040", "p02729_case_041", "p02729_case_042", "p02729_case_043", "p02729_case_044", "p02729_case_045", "p02729_case_046", "p02729_case_047", "p02729_case_048", "p02729_case_049", "p02729_case_050", "p02729_case_051", "p02729_case_052", "p02729_case_053", "p02729_case_054", "p02729_case_055", "p02729_case_056", "p02729_case_057", "p02729_case_058", "p02729_case_059", "p02729_case_060", "p02729_case_061", "p02729_case_062", "p02729_case_063", "p02729_case_064", "p02729_case_065", "p02729_case_066", "p02729_case_067", "p02729_case_068", "p02729_case_069", "p02729_case_070", "p02729_case_071", "p02729_case_072", "p02729_case_073", "p02729_case_074", "p02729_case_075", "p02729_case_076", "p02729_case_077", "p02729_case_078", "p02729_case_079", "p02729_case_080", "p02729_case_081", "p02729_case_082", "p02729_case_083", "p02729_case_084", "p02729_case_085", "p02729_case_086", "p02729_case_087", "p02729_case_088", "p02729_case_089", "p02729_case_090", "p02729_case_091", "p02729_case_092", "p02729_case_093", "p02729_case_094", "p02729_case_095", "p02729_case_096", "p02729_case_097", "p02729_case_098", "p02729_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n, m = list(map(int, input().split()))\nif (n > 0) and (m > 0):\n print((int(n * (n - 1) / 2 + m * (m - 1) / 2)))\nelse:\n print((int(max(n, m) * (max(n, m) - 1) / 2)))\n", "fast_code_sha256": "d00298cd14b1cd4f91ce830289511735e36a60dcea3acdf68935a21e91f52b3e", "fast_id": "p02729_d00298cd14b1cd4f91ce830289511735e36a60dcea3acdf68935a21e91f52b3e", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n, m = list(map(int, input().split()))\nif (n > 0) and (m > 0):\n print((int(n * (n - 1) / 2 + m * (m - 1) / 2)))\nelse:\n print((int(max(n, m) * (max(n, m) - 1) / 2)))\n", "measured_fast_code_sha256": "d00298cd14b1cd4f91ce830289511735e36a60dcea3acdf68935a21e91f52b3e", "measured_slow_code": "a, b = list(map(int, input().split()))\nimport itertools\n\na1 = len(list(itertools.combinations(list(range(a)), 2)))\nb1 = len(list(itertools.combinations(list(range(b)), 2)))\nprint((a1 + b1))\n", "measured_slow_code_sha256": "cceb77711a14726b9b2382bddd14ea9448a327cbb9328832bc3b11455366cb07", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4.166546462180167, "pair_id": "python_v2_4a317b5710f530ffcd3acc87", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02729", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02729_d00298cd14b1cd4f91ce830289511735e36a60dcea3acdf68935a21e91f52b3e.jsonl.gz", "inputs": "reproduction/python/inputs/p02729.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02729_cceb77711a14726b9b2382bddd14ea9448a327cbb9328832bc3b11455366cb07.jsonl.gz"}, "slow_code": "a, b = list(map(int, input().split()))\nimport itertools\n\na1 = len(list(itertools.combinations(list(range(a)), 2)))\nb1 = len(list(itertools.combinations(list(range(b)), 2)))\nprint((a1 + b1))\n", "slow_code_sha256": "cceb77711a14726b9b2382bddd14ea9448a327cbb9328832bc3b11455366cb07", "slow_id": "p02729_cceb77711a14726b9b2382bddd14ea9448a327cbb9328832bc3b11455366cb07", "speedup": 4.905551569015694, "stratum": "4-8", "within_pair_jaccard": 0.2916666666666667, "workload": {"case_count": 100, "description": "There are N individually distinct balls with even values and M with odd values. Count unordered pairs of different balls whose values sum to an even number. Observed inputs: N=0..100 (median 34.5); M=0..100 (median 31.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 8, "median": 5.0, "min": 4}, "input_format": ["N M"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p00028_case_000", "p00028_case_001", "p00028_case_002", "p00028_case_003", "p00028_case_004", "p00028_case_005", "p00028_case_006", "p00028_case_007", "p00028_case_008", "p00028_case_009", "p00028_case_010", "p00028_case_011", "p00028_case_012", "p00028_case_013", "p00028_case_014", "p00028_case_015", "p00028_case_016", "p00028_case_017", "p00028_case_018", "p00028_case_019", "p00028_case_020", "p00028_case_021", "p00028_case_022", "p00028_case_023", "p00028_case_024", "p00028_case_025", "p00028_case_026", "p00028_case_027", "p00028_case_028", "p00028_case_029", "p00028_case_030", "p00028_case_031", "p00028_case_032", "p00028_case_033", "p00028_case_034", "p00028_case_035", "p00028_case_036", "p00028_case_037", "p00028_case_038", "p00028_case_039", "p00028_case_040", "p00028_case_041", "p00028_case_042", "p00028_case_043", "p00028_case_044", "p00028_case_045", "p00028_case_046", "p00028_case_047", "p00028_case_048", "p00028_case_049", "p00028_case_050", "p00028_case_051", "p00028_case_052", "p00028_case_053", "p00028_case_054", "p00028_case_055", "p00028_case_056", "p00028_case_057", "p00028_case_058", "p00028_case_059", "p00028_case_060", "p00028_case_061", "p00028_case_062", "p00028_case_063", "p00028_case_064", "p00028_case_065", "p00028_case_066", "p00028_case_067", "p00028_case_068", "p00028_case_069", "p00028_case_070", "p00028_case_071", "p00028_case_072", "p00028_case_073", "p00028_case_074", "p00028_case_075", "p00028_case_076", "p00028_case_077", "p00028_case_078", "p00028_case_079", "p00028_case_080", "p00028_case_081", "p00028_case_082", "p00028_case_083", "p00028_case_084", "p00028_case_085", "p00028_case_086", "p00028_case_087", "p00028_case_088", "p00028_case_089", "p00028_case_090", "p00028_case_091", "p00028_case_092", "p00028_case_093", "p00028_case_094", "p00028_case_095", "p00028_case_096", "p00028_case_097", "p00028_case_098", "p00028_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "d = {}\ntry:\n while True:\n n = int(input())\n if n in d:\n d[n] += 1\n else:\n d[n] = 1\nexcept EOFError:\n pass\na = []\nm = max(d.values())\nfor key, value in list(d.items()):\n if value == m:\n a.append(key)\na.sort()\nfor i in a:\n print(i)\n", "fast_code_sha256": "36efa31a817599454e47c950d8405cd8170cd3f67b1b12f911d115f29e6e8467", "fast_id": "p00028_36efa31a817599454e47c950d8405cd8170cd3f67b1b12f911d115f29e6e8467", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "d = {}\ntry:\n while True:\n n = int(input())\n if n in d:\n d[n] += 1\n else:\n d[n] = 1\nexcept EOFError:\n pass\na = []\nm = max(d.values())\nfor key, value in list(d.items()):\n if value == m:\n a.append(key)\na.sort()\nfor i in a:\n print(i)\n", "measured_fast_code_sha256": "36efa31a817599454e47c950d8405cd8170cd3f67b1b12f911d115f29e6e8467", "measured_slow_code": "d = [0 for i in range(101)]\nwhile True:\n try:\n n = eval(input())\n d[n] += 1\n except:\n break\nfor e in [i for i, e in enumerate(d) if e == max(d)]:\n print(e)\n", "measured_slow_code_sha256": "5902dceff8fd61e2ba9dfa4b6b3d678a880e0a0c266dff8f9d7965251806e14b", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.8447725927640337, "pair_id": "python_v2_08059695714d471d8cdaefc3", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p00028", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p00028_36efa31a817599454e47c950d8405cd8170cd3f67b1b12f911d115f29e6e8467.jsonl.gz", "inputs": "reproduction/python/inputs/p00028.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p00028_5902dceff8fd61e2ba9dfa4b6b3d678a880e0a0c266dff8f9d7965251806e14b.jsonl.gz"}, "slow_code": "d = [0 for i in range(101)]\nwhile True:\n try:\n n = eval(input())\n d[n] += 1\n except:\n break\nfor e in [i for i, e in enumerate(d) if e == max(d)]:\n print(e)\n", "slow_code_sha256": "5902dceff8fd61e2ba9dfa4b6b3d678a880e0a0c266dff8f9d7965251806e14b", "slow_id": "p00028_5902dceff8fd61e2ba9dfa4b6b3d678a880e0a0c266dff8f9d7965251806e14b", "speedup": 3.689504258301959, "stratum": "2-4", "within_pair_jaccard": 0.4117647058823529, "workload": {"case_count": 100, "description": "Find all most frequent values in the supplied integer sequence and output them in ascending order. Values are supplied one per line until end of input, with no leading count. Observed inputs: elements=1..100 (median 100); a_i=1..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 400, "median": 288.0, "min": 2}, "input_format": ["a_1\n...\na_L (until EOF)"], "input_format_status": "source_input_section", "input_lines": {"max": 100, "median": 100.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100, "median": 100.0, "min": 1}}} -{"case_ids": ["p02683_case_000", "p02683_case_001", "p02683_case_002", "p02683_case_003", "p02683_case_004", "p02683_case_005", "p02683_case_006", "p02683_case_007", "p02683_case_008", "p02683_case_009", "p02683_case_010", "p02683_case_011", "p02683_case_012", "p02683_case_013", "p02683_case_014", "p02683_case_015", "p02683_case_016", "p02683_case_017", "p02683_case_018", "p02683_case_019", "p02683_case_020", "p02683_case_021", "p02683_case_022", "p02683_case_023", "p02683_case_024", "p02683_case_025", "p02683_case_026", "p02683_case_027", "p02683_case_028", "p02683_case_029", "p02683_case_030", "p02683_case_031", "p02683_case_032", "p02683_case_033", "p02683_case_034", "p02683_case_035", "p02683_case_036", "p02683_case_037", "p02683_case_038", "p02683_case_039", "p02683_case_040", "p02683_case_041", "p02683_case_042", "p02683_case_043", "p02683_case_044", "p02683_case_045", "p02683_case_046", "p02683_case_047", "p02683_case_048", "p02683_case_049", "p02683_case_050", "p02683_case_051", "p02683_case_052", "p02683_case_053", "p02683_case_054", "p02683_case_055", "p02683_case_056", "p02683_case_057", "p02683_case_058", "p02683_case_059", "p02683_case_060", "p02683_case_061", "p02683_case_062", "p02683_case_063", "p02683_case_064", "p02683_case_065", "p02683_case_066", "p02683_case_067", "p02683_case_068", "p02683_case_069", "p02683_case_070", "p02683_case_071", "p02683_case_072", "p02683_case_073", "p02683_case_074", "p02683_case_075", "p02683_case_076", "p02683_case_077", "p02683_case_078", "p02683_case_079", "p02683_case_080", "p02683_case_081", "p02683_case_082", "p02683_case_083", "p02683_case_084", "p02683_case_085", "p02683_case_086", "p02683_case_087", "p02683_case_088", "p02683_case_089", "p02683_case_090", "p02683_case_091", "p02683_case_092", "p02683_case_093", "p02683_case_094", "p02683_case_095", "p02683_case_096", "p02683_case_097", "p02683_case_098", "p02683_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "executable_AST_equal_except_explicit_explanatory_string_removal_and_all_frozen_inputs_checker_pass", "fast_code": "import sys\nimport math\nimport decimal\nimport itertools\nfrom itertools import product\nfrom functools import reduce\n\n\ndef input():\n return sys.stdin.readline()[:-1]\n\n\ndef main():\n N, M, X = list(map(int, input().split()))\n A = [list(map(int, input().split())) for _ in range(N)]\n inf = 10**18\n\n ans = inf\n for i in product([0, 1], repeat=N):\n ok = True\n for m in range(1, M + 1):\n s = 0\n for n in range(N):\n if i[n] == 1:\n s += A[n][m]\n if s < X:\n ok = False\n break\n if ok:\n money = 0\n for n in range(N):\n if i[n] == 1:\n money += A[n][0]\n ans = min(ans, money)\n if ans == inf:\n print((-1))\n else:\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "d62ebf3b8f05e6d97f62cf45f38ed9e52cb4fe00471ec51b16b69a651d6874ca", "fast_id": "p02683_4a090b084527358267bcf9979fb612a50e796632edef635d6398486f11747180", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "#!/usr/bin/env python3\nimport sys\nimport math\nimport decimal\nimport itertools\nfrom itertools import product\nfrom functools import reduce\n\n\ndef input():\n return sys.stdin.readline()[:-1]\n\n\ndef main():\n N, M, X = list(map(int, input().split()))\n A = [list(map(int, input().split())) for _ in range(N)]\n inf = 10**18\n # bit全探索\n # repeat=2だと(0,0), (0,1), (1,0), (1,1)になる\n ans = inf\n for i in product([0, 1], repeat=N):\n ok = True\n for m in range(1, M + 1):\n s = 0\n for n in range(N):\n if i[n] == 1:\n s += A[n][m]\n if s < X:\n ok = False\n break\n if ok:\n money = 0\n for n in range(N):\n if i[n] == 1:\n money += A[n][0]\n ans = min(ans, money)\n if ans == inf:\n print((-1))\n else:\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "4a090b084527358267bcf9979fb612a50e796632edef635d6398486f11747180", "measured_slow_code": "import numpy as np\n\nN, M, X = list(map(int, input().split()))\nC = []\nA = []\nfor i in range(N):\n c = 0\n a = []\n c, *a = list(map(int, input().split()))\n C.append(c)\n A.append(a)\nA = np.array(A)\ninf = float(\"inf\")\nres = inf\nfor bit in range(1 << N):\n Cost = 0\n Wise = np.zeros(M)\n for i in range(N):\n if (bit >> i) & 1: # i冊目を買うときの処理\n Cost += C[i]\n Wise += A[i]\n Wise = Wise.tolist()\n # else:# i冊目を買わないときの処理(今回は何もしないので省略)\n if min(Wise) >= X and Cost <= res:\n res = Cost\nif res == inf:\n print(\"-1\")\nelse:\n print(res)\n\"\"\"\nn,m,x = map(int,input().split())\nc=[]\na=[]\nINF = float(\"inf\")\nstock = INF\nfor _ in range(n):\n c_temp,*a_temp = list(map(int,input().split()))\n c.append(c_temp)\n a.append(a_temp)\n#すべての組み合わせを計算\nfor bit in range(1 << n):\n cost_total = 0\n smart_total = [0]*m\n #1セットごとの処理\n for i in range(n):\n #一冊ごとの処理\n if (bit >> i) & 1:\n # i冊目を買うときの処理\n smart = []\n cost_total += c[i]\n smart = a[i]\n for j , sm in enumerate(smart):\n smart_total[j] += sm\n #else:\n # i冊目を買わないときの処理(今回は何もしないので省略)\n judege = True\n for i in range(m):\n if smart_total[i] < x:\n judege = False\n if judege:\n stock = min(cost_total,stock)\nif stock == INF:\n print(\"-1\")\nelse:\n print(stock)\"\"\"\n", "measured_slow_code_sha256": "6459d56d39987c764ab971f696c22809925ce5bc619058aa0c69424099f8ef7e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 72.13666716434014, "pair_id": "python_v2_0ea331d8148930eb25a38c7e", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02683", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02683_4a090b084527358267bcf9979fb612a50e796632edef635d6398486f11747180.jsonl.gz", "inputs": "reproduction/python/inputs/p02683.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02683_6459d56d39987c764ab971f696c22809925ce5bc619058aa0c69424099f8ef7e.jsonl.gz"}, "slow_code": "import numpy as np\n\nN, M, X = list(map(int, input().split()))\nC = []\nA = []\nfor i in range(N):\n c = 0\n a = []\n c, *a = list(map(int, input().split()))\n C.append(c)\n A.append(a)\nA = np.array(A)\ninf = float(\"inf\")\nres = inf\nfor bit in range(1 << N):\n Cost = 0\n Wise = np.zeros(M)\n for i in range(N):\n if (bit >> i) & 1:\n Cost += C[i]\n Wise += A[i]\n Wise = Wise.tolist()\n\n if min(Wise) >= X and Cost <= res:\n res = Cost\nif res == inf:\n print(\"-1\")\nelse:\n print(res)\n", "slow_code_sha256": "923747067069348920bdd8026637f5d9fa012ed77d9c282d31be247214b03102", "slow_id": "p02683_6459d56d39987c764ab971f696c22809925ce5bc619058aa0c69424099f8ef7e", "speedup": 36.33737599849862, "stratum": "8+", "within_pair_jaccard": 0.33766233766233766, "workload": {"case_count": 100, "description": "Choose a subset of N books of costs C_i. Reading book i once adds A_i,j to skill j, initially zero. Minimize cost while all M skills reach at least X, or report impossibility. Observed inputs: N=1..12 (median 6); M=1..12 (median 6); X=1..100000 (median 7000); C_i=1..99895; A_i_j=0..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 933, "median": 207.0, "min": 10}, "input_format": ["N M X\nC_1 A_1,1 ... A_1,M\n...\nC_N A_N,1 ... A_N,M"], "input_format_status": "source_input_section", "input_lines": {"max": 13, "median": 7.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 159, "median": 45.0, "min": 5}}} -{"case_ids": ["p00022_case_000", "p00022_case_001", "p00022_case_002", "p00022_case_003", "p00022_case_004", "p00022_case_005", "p00022_case_006", "p00022_case_007", "p00022_case_008", "p00022_case_009", "p00022_case_010", "p00022_case_011", "p00022_case_012", "p00022_case_013", "p00022_case_014", "p00022_case_015", "p00022_case_016", "p00022_case_017", "p00022_case_018", "p00022_case_019", "p00022_case_020", "p00022_case_021", "p00022_case_022", "p00022_case_023", "p00022_case_024", "p00022_case_025", "p00022_case_026", "p00022_case_027", "p00022_case_028", "p00022_case_029", "p00022_case_030", "p00022_case_031", "p00022_case_032", "p00022_case_033", "p00022_case_034", "p00022_case_035", "p00022_case_036", "p00022_case_037", "p00022_case_038", "p00022_case_039", "p00022_case_040", "p00022_case_041", "p00022_case_042", "p00022_case_043", "p00022_case_044", "p00022_case_045", "p00022_case_046", "p00022_case_047", "p00022_case_048", "p00022_case_049", "p00022_case_050", "p00022_case_051", "p00022_case_052", "p00022_case_053", "p00022_case_054", "p00022_case_055", "p00022_case_056", "p00022_case_057", "p00022_case_058", "p00022_case_059", "p00022_case_060", "p00022_case_061", "p00022_case_062", "p00022_case_063", "p00022_case_064", "p00022_case_065", "p00022_case_066", "p00022_case_067", "p00022_case_068", "p00022_case_069", "p00022_case_070", "p00022_case_071", "p00022_case_072", "p00022_case_073", "p00022_case_074", "p00022_case_075", "p00022_case_076", "p00022_case_077", "p00022_case_078", "p00022_case_079", "p00022_case_080", "p00022_case_081", "p00022_case_082", "p00022_case_083", "p00022_case_084", "p00022_case_085", "p00022_case_086", "p00022_case_087", "p00022_case_088", "p00022_case_089", "p00022_case_090", "p00022_case_091", "p00022_case_092", "p00022_case_093", "p00022_case_094", "p00022_case_095", "p00022_case_096", "p00022_case_097", "p00022_case_098", "p00022_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "while 1:\n n = int(input())\n if n == 0:\n break\n A = [0] * n\n for i in range(n):\n A[i] = int(input())\n for i in range(1, len(A)):\n A[i] = max(A[i - 1] + A[i], A[i])\n print(max(A))\n", "fast_code_sha256": "543ee6d0e81691fcafec5a2b260b0d8f3e49adb766d2156505b28d551aba5051", "fast_id": "p00022_543ee6d0e81691fcafec5a2b260b0d8f3e49adb766d2156505b28d551aba5051", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "while 1:\n n = int(input())\n if n == 0:\n break\n A = [0] * n\n for i in range(n):\n A[i] = int(input())\n for i in range(1, len(A)):\n A[i] = max(A[i - 1] + A[i], A[i])\n print(max(A))\n", "measured_fast_code_sha256": "543ee6d0e81691fcafec5a2b260b0d8f3e49adb766d2156505b28d551aba5051", "measured_slow_code": "while True:\n n = int(eval(input()))\n if n == 0:\n break\n a = [int(eval(input())) for _ in range(n)]\n minv = tmp = 0\n maxv = -500000\n for i in range(n):\n tmp += a[i]\n maxv = max(maxv, tmp - minv)\n minv = min(minv, tmp)\n print(maxv)\n", "measured_slow_code_sha256": "ee69ff49d52cec4a9386b9836880b1c749710e6965bbcae5aa2ad74048936c1f", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.632195194248454, "pair_id": "python_v2_8dc887258e797b47b06d6e51", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p00022", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p00022_543ee6d0e81691fcafec5a2b260b0d8f3e49adb766d2156505b28d551aba5051.jsonl.gz", "inputs": "reproduction/python/inputs/p00022.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p00022_ee69ff49d52cec4a9386b9836880b1c749710e6965bbcae5aa2ad74048936c1f.jsonl.gz"}, "slow_code": "while True:\n n = int(eval(input()))\n if n == 0:\n break\n a = [int(eval(input())) for _ in range(n)]\n minv = tmp = 0\n maxv = -500000\n for i in range(n):\n tmp += a[i]\n maxv = max(maxv, tmp - minv)\n minv = min(minv, tmp)\n print(maxv)\n", "slow_code_sha256": "ee69ff49d52cec4a9386b9836880b1c749710e6965bbcae5aa2ad74048936c1f", "slow_id": "p00022_ee69ff49d52cec4a9386b9836880b1c749710e6965bbcae5aa2ad74048936c1f", "speedup": 2.574665815617647, "stratum": "2-4", "within_pair_jaccard": 0.52, "workload": {"case_count": 100, "description": "For each integer sequence, find the maximum sum of a nonempty contiguous subsequence. Each dataset supplies n followed by n values, one value per line; a final zero ends the input. Observed inputs: datasets=1..10 (median 1); n=1..5000; total_records=1..50000 (median 1000); a_i=-100000..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 319550, "median": 6388.0, "min": 9}, "input_format": ["n_1\na_1\n...\na_(n_1)\n[next datasets]\n0"], "input_format_status": "source_input_section", "input_lines": {"max": 50011, "median": 1002.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 50011, "median": 1002.0, "min": 3}}} -{"case_ids": ["p02595_case_000", "p02595_case_001", "p02595_case_002", "p02595_case_003", "p02595_case_004", "p02595_case_005", "p02595_case_006", "p02595_case_007", "p02595_case_008", "p02595_case_009", "p02595_case_010", "p02595_case_011", "p02595_case_012", "p02595_case_013", "p02595_case_014", "p02595_case_015", "p02595_case_016", "p02595_case_017", "p02595_case_018", "p02595_case_019", "p02595_case_020", "p02595_case_021", "p02595_case_022", "p02595_case_023", "p02595_case_024", "p02595_case_025", "p02595_case_026", "p02595_case_027", "p02595_case_028", "p02595_case_029", "p02595_case_030", "p02595_case_031", "p02595_case_032", "p02595_case_033", "p02595_case_034", "p02595_case_035", "p02595_case_036", "p02595_case_037", "p02595_case_038", "p02595_case_039", "p02595_case_040", "p02595_case_041", "p02595_case_042", "p02595_case_043", "p02595_case_044", "p02595_case_045", "p02595_case_046", "p02595_case_047", "p02595_case_048", "p02595_case_049", "p02595_case_050", "p02595_case_051", "p02595_case_052", "p02595_case_053", "p02595_case_054", "p02595_case_055", "p02595_case_056", "p02595_case_057", "p02595_case_058", "p02595_case_059", "p02595_case_060", "p02595_case_061", "p02595_case_062", "p02595_case_063", "p02595_case_064", "p02595_case_065", "p02595_case_066", "p02595_case_067", "p02595_case_068", "p02595_case_069", "p02595_case_070", "p02595_case_071", "p02595_case_072", "p02595_case_073", "p02595_case_074", "p02595_case_075", "p02595_case_076", "p02595_case_077", "p02595_case_078", "p02595_case_079", "p02595_case_080", "p02595_case_081", "p02595_case_082", "p02595_case_083", "p02595_case_084", "p02595_case_085", "p02595_case_086", "p02595_case_087", "p02595_case_088", "p02595_case_089", "p02595_case_090", "p02595_case_091", "p02595_case_092", "p02595_case_093", "p02595_case_094", "p02595_case_095", "p02595_case_096", "p02595_case_097", "p02595_case_098", "p02595_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N, D = list(map(int, input().split()))\nZn = [list(map(int, input().split())) for _ in range(N)]\nans = 0\nfor Z in Zn:\n X, Y = Z\n if X**2 + Y**2 <= D**2:\n ans += 1\nprint(ans)\n", "fast_code_sha256": "c35164e87c1afdd4b4eff0d560301d78fec57fe8d260d7af34ef420ad2590476", "fast_id": "p02595_c35164e87c1afdd4b4eff0d560301d78fec57fe8d260d7af34ef420ad2590476", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N, D = list(map(int, input().split()))\nZn = [list(map(int, input().split())) for _ in range(N)]\nans = 0\nfor Z in Zn:\n X, Y = Z\n if X**2 + Y**2 <= D**2:\n ans += 1\nprint(ans)\n", "measured_fast_code_sha256": "c35164e87c1afdd4b4eff0d560301d78fec57fe8d260d7af34ef420ad2590476", "measured_slow_code": "from decimal import *\n\ngetcontext().prec = 50\nN, D = list(map(int, input().split()))\n\n\ndef distance(x1, x2, y1, y2):\n dx = x2 - x1\n dy = y2 - y1\n return (dx * dx + dy * dy).sqrt()\n\n\nX = [0] * N\nY = [0] * N\nfor i in range(N):\n X[i], Y[i] = list(map(Decimal, input().split()))\nans = 0\nfor i in range(N):\n if distance(0, X[i], 0, Y[i]) <= D:\n ans += 1\nprint(ans)\n", "measured_slow_code_sha256": "1559f276e022453eb8e8e92cd54d60648c4bba1cc009c4b0eef1eaf17b1ef72e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.665124926814447, "pair_id": "python_v2_af1d0c4bd489c953940c2c52", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02595", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02595_c35164e87c1afdd4b4eff0d560301d78fec57fe8d260d7af34ef420ad2590476.jsonl.gz", "inputs": "reproduction/python/inputs/p02595.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02595_1559f276e022453eb8e8e92cd54d60648c4bba1cc009c4b0eef1eaf17b1ef72e.jsonl.gz"}, "slow_code": "from decimal import *\n\ngetcontext().prec = 50\nN, D = list(map(int, input().split()))\n\n\ndef distance(x1, x2, y1, y2):\n dx = x2 - x1\n dy = y2 - y1\n return (dx * dx + dy * dy).sqrt()\n\n\nX = [0] * N\nY = [0] * N\nfor i in range(N):\n X[i], Y[i] = list(map(Decimal, input().split()))\nans = 0\nfor i in range(N):\n if distance(0, X[i], 0, Y[i]) <= D:\n ans += 1\nprint(ans)\n", "slow_code_sha256": "1559f276e022453eb8e8e92cd54d60648c4bba1cc009c4b0eef1eaf17b1ef72e", "slow_id": "p02595_1559f276e022453eb8e8e92cd54d60648c4bba1cc009c4b0eef1eaf17b1ef72e", "speedup": 3.801027569817484, "stratum": "2-4", "within_pair_jaccard": 0.4358974358974359, "workload": {"case_count": 100, "description": "Count listed plane points (X_i,Y_i) whose Euclidean distance from the origin is at most D; repeated points count separately. Observed inputs: N=1..200000 (median 100000); D=0..200000 (median 100000); X_i=-200000..200000; Y_i=-200000..200000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 3000082, "median": 1388902.0, "min": 8}, "input_format": ["N D\nX_1 Y_1\n...\nX_N Y_N"], "input_format_status": "source_input_section", "input_lines": {"max": 200001, "median": 100001.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 400002, "median": 200002.0, "min": 4}}} -{"case_ids": ["p03170_case_000", "p03170_case_001", "p03170_case_002", "p03170_case_003", "p03170_case_004", "p03170_case_005", "p03170_case_006", "p03170_case_007", "p03170_case_008", "p03170_case_009", "p03170_case_010", "p03170_case_011", "p03170_case_012", "p03170_case_013", "p03170_case_014", "p03170_case_015", "p03170_case_016", "p03170_case_017", "p03170_case_018", "p03170_case_019", "p03170_case_020", "p03170_case_021", "p03170_case_022", "p03170_case_023", "p03170_case_024", "p03170_case_025", "p03170_case_026", "p03170_case_027", "p03170_case_028", "p03170_case_029", "p03170_case_030", "p03170_case_031", "p03170_case_032", "p03170_case_033", "p03170_case_034", "p03170_case_035", "p03170_case_036", "p03170_case_037", "p03170_case_038", "p03170_case_039", "p03170_case_040", "p03170_case_041", "p03170_case_042", "p03170_case_043", "p03170_case_044", "p03170_case_045", "p03170_case_046", "p03170_case_047", "p03170_case_048", "p03170_case_049", "p03170_case_050", "p03170_case_051", "p03170_case_052", "p03170_case_053", "p03170_case_054", "p03170_case_055", "p03170_case_056", "p03170_case_057", "p03170_case_058", "p03170_case_059", "p03170_case_060", "p03170_case_061", "p03170_case_062", "p03170_case_063", "p03170_case_064", "p03170_case_065", "p03170_case_066", "p03170_case_067", "p03170_case_068", "p03170_case_069", "p03170_case_070", "p03170_case_071", "p03170_case_072", "p03170_case_073", "p03170_case_074", "p03170_case_075", "p03170_case_076", "p03170_case_077", "p03170_case_078", "p03170_case_079", "p03170_case_080", "p03170_case_081", "p03170_case_082", "p03170_case_083", "p03170_case_084", "p03170_case_085", "p03170_case_086", "p03170_case_087", "p03170_case_088", "p03170_case_089", "p03170_case_090", "p03170_case_091", "p03170_case_092", "p03170_case_093", "p03170_case_094", "p03170_case_095", "p03170_case_096", "p03170_case_097", "p03170_case_098", "p03170_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n, k = list(map(int, input().split()))\narr = list(map(int, input().split()))\ndp = [False] * (k + 1)\nfor i in range(k + 1):\n if not dp[i]:\n for a in arr:\n if i + a > k:\n break\n dp[i + a] = True\nprint((\"First\" if dp[k] else \"Second\"))\n", "fast_code_sha256": "bc6f3d038f475ce3e6712288d3898428f26b781897e10a7c7d23e91f65604efa", "fast_id": "p03170_bc6f3d038f475ce3e6712288d3898428f26b781897e10a7c7d23e91f65604efa", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n, k = list(map(int, input().split()))\narr = list(map(int, input().split()))\ndp = [False] * (k + 1)\nfor i in range(k + 1):\n if not dp[i]:\n for a in arr:\n if i + a > k:\n break\n dp[i + a] = True\nprint((\"First\" if dp[k] else \"Second\"))\n", "measured_fast_code_sha256": "bc6f3d038f475ce3e6712288d3898428f26b781897e10a7c7d23e91f65604efa", "measured_slow_code": "n, k = list(map(int, input().split()))\na = list(map(int, input().split()))\ndp = [0 for i in range(k + 1)]\ndp[0] = 2\nfor i in range(1, k + 1):\n l = 0\n for j in range(n):\n if dp[i - a[j]] == 2:\n l = l + 1\n break\n if l == 1:\n dp[i] = 1\n else:\n dp[i] = 2\nif dp[k] == 1:\n print(\"First\")\nelse:\n print(\"Second\")\n", "measured_slow_code_sha256": "96339fbd84de8f52e0d5ae5c33c0a9a225fb02a73f3198d2faedd4c55102f74f", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 6.224936975050996, "pair_id": "python_v2_315627828a390e10c21ff23b", "per_case_slow_code_faster_fraction": 0.01, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03170", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03170_bc6f3d038f475ce3e6712288d3898428f26b781897e10a7c7d23e91f65604efa.jsonl.gz", "inputs": "reproduction/python/inputs/p03170.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03170_96339fbd84de8f52e0d5ae5c33c0a9a225fb02a73f3198d2faedd4c55102f74f.jsonl.gz"}, "slow_code": "n, k = list(map(int, input().split()))\na = list(map(int, input().split()))\ndp = [0 for i in range(k + 1)]\ndp[0] = 2\nfor i in range(1, k + 1):\n l = 0\n for j in range(n):\n if dp[i - a[j]] == 2:\n l = l + 1\n break\n if l == 1:\n dp[i] = 1\n else:\n dp[i] = 2\nif dp[k] == 1:\n print(\"First\")\nelse:\n print(\"Second\")\n", "slow_code_sha256": "96339fbd84de8f52e0d5ae5c33c0a9a225fb02a73f3198d2faedd4c55102f74f", "slow_id": "p03170_96339fbd84de8f52e0d5ae5c33c0a9a225fb02a73f3198d2faedd4c55102f74f", "speedup": 5.458056554513589, "stratum": "4-8", "within_pair_jaccard": 0.7142857142857143, "workload": {"case_count": 100, "description": "Two optimal players alternate removing a permitted number of stones from a pile initially of size K. Allowed removals a_i form a strictly increasing set of N integers. The first player unable to move loses; determine the winner. Observed inputs: N=1..100 (median 100); K=1..100000 (median 100000); a_i=1..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 610, "median": 597.5, "min": 6}, "input_format": ["N K\na_1 ... a_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 102, "median": 102.0, "min": 3}}} -{"case_ids": ["p02995_case_000", "p02995_case_001", "p02995_case_002", "p02995_case_003", "p02995_case_004", "p02995_case_005", "p02995_case_006", "p02995_case_007", "p02995_case_008", "p02995_case_009", "p02995_case_010", "p02995_case_011", "p02995_case_012", "p02995_case_013", "p02995_case_014", "p02995_case_015", "p02995_case_016", "p02995_case_017", "p02995_case_018", "p02995_case_019", "p02995_case_020", "p02995_case_021", "p02995_case_022", "p02995_case_023", "p02995_case_024", "p02995_case_025", "p02995_case_026", "p02995_case_027", "p02995_case_028", "p02995_case_029", "p02995_case_030", "p02995_case_031", "p02995_case_032", "p02995_case_033", "p02995_case_034", "p02995_case_035", "p02995_case_036", "p02995_case_037", "p02995_case_038", "p02995_case_039", "p02995_case_040", "p02995_case_041", "p02995_case_042", "p02995_case_043", "p02995_case_044", "p02995_case_045", "p02995_case_046", "p02995_case_047", "p02995_case_048", "p02995_case_049", "p02995_case_050", "p02995_case_051", "p02995_case_052", "p02995_case_053", "p02995_case_054", "p02995_case_055", "p02995_case_056", "p02995_case_057", "p02995_case_058", "p02995_case_059", "p02995_case_060", "p02995_case_061", "p02995_case_062", "p02995_case_063", "p02995_case_064", "p02995_case_065", "p02995_case_066", "p02995_case_067", "p02995_case_068", "p02995_case_069", "p02995_case_070", "p02995_case_071", "p02995_case_072", "p02995_case_073", "p02995_case_074", "p02995_case_075", "p02995_case_076", "p02995_case_077", "p02995_case_078", "p02995_case_079", "p02995_case_080", "p02995_case_081", "p02995_case_082", "p02995_case_083", "p02995_case_084", "p02995_case_085", "p02995_case_086", "p02995_case_087", "p02995_case_088", "p02995_case_089", "p02995_case_090", "p02995_case_091", "p02995_case_092", "p02995_case_093", "p02995_case_094", "p02995_case_095", "p02995_case_096", "p02995_case_097", "p02995_case_098", "p02995_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import math as m\n\nA, B, C, D = list(map(int, input().split()))\nA -= 1\ng = C * D // m.gcd(C, D)\nx = B // C - A // C\ny = B // D - A // D\nz = B // g - A // g\nprint((B - A - x - y + z))\n", "fast_code_sha256": "284acad32f039b02d479f3e10e518b3399b8810722821631f54eb37aa1b6351e", "fast_id": "p02995_284acad32f039b02d479f3e10e518b3399b8810722821631f54eb37aa1b6351e", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import math as m\n\nA, B, C, D = list(map(int, input().split()))\nA -= 1\ng = C * D // m.gcd(C, D)\nx = B // C - A // C\ny = B // D - A // D\nz = B // g - A // g\nprint((B - A - x - y + z))\n", "measured_fast_code_sha256": "284acad32f039b02d479f3e10e518b3399b8810722821631f54eb37aa1b6351e", "measured_slow_code": "def floor(a, b):\n # return int((a - a%b)/b)\n return a // b\n\n\ndef gcd(a, b):\n while b != 0:\n a, b = b, a % b\n return a\n\n\ndef lcm(a, b):\n return floor((a * b), gcd(a, b))\n\n\ninput = list(map(int, input().split(\" \")))\ntotal_count = input[1] + 1 - input[0]\ndiv_c = floor(input[1], input[2]) - floor(input[0] - 1, input[2])\ndiv_d = floor(input[1], input[3]) - floor(input[0] - 1, input[3])\ndiv_cd = floor(input[1], lcm(input[2], input[3])) - floor(\n input[0] - 1, lcm(input[2], input[3])\n)\nprint((total_count - (div_c + div_d - div_cd)))\n", "measured_slow_code_sha256": "df925af8753272e8ec1984ff302aca1be38e4ae8b71e704a8c242857bf509531", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.2852949969555336, "pair_id": "python_v2_2ea7ba8b1630a613efb019c7", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02995", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02995_284acad32f039b02d479f3e10e518b3399b8810722821631f54eb37aa1b6351e.jsonl.gz", "inputs": "reproduction/python/inputs/p02995.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02995_df925af8753272e8ec1984ff302aca1be38e4ae8b71e704a8c242857bf509531.jsonl.gz"}, "slow_code": "def floor(a, b):\n\n return a // b\n\n\ndef gcd(a, b):\n while b != 0:\n a, b = b, a % b\n return a\n\n\ndef lcm(a, b):\n return floor((a * b), gcd(a, b))\n\n\ninput = list(map(int, input().split(\" \")))\ntotal_count = input[1] + 1 - input[0]\ndiv_c = floor(input[1], input[2]) - floor(input[0] - 1, input[2])\ndiv_d = floor(input[1], input[3]) - floor(input[0] - 1, input[3])\ndiv_cd = floor(input[1], lcm(input[2], input[3])) - floor(\n input[0] - 1, lcm(input[2], input[3])\n)\nprint((total_count - (div_c + div_d - div_cd)))\n", "slow_code_sha256": "6fc5067dd8ac941ec31580f2241fcd08dc5630fd6446ba8de71c3aa9f59aa2c9", "slow_id": "p02995_df925af8753272e8ec1984ff302aca1be38e4ae8b71e704a8c242857bf509531", "speedup": 2.2798219543061307, "stratum": "2-4", "within_pair_jaccard": 0.20588235294117646, "workload": {"case_count": 100, "description": "Count integers in inclusive interval [A,B] divisible by neither C nor D. The interval is given by endpoints, not by listing its members. Observed inputs: A=1..992930041683160624; B=1..1000000000000000000; C=1..1000000000; D=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 58, "median": 58.0, "min": 8}, "input_format": ["A B C D"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 4, "median": 4.0, "min": 4}}} -{"case_ids": ["p03563_case_000", "p03563_case_001", "p03563_case_002", "p03563_case_003", "p03563_case_004", "p03563_case_005", "p03563_case_006", "p03563_case_007", "p03563_case_008", "p03563_case_009", "p03563_case_010", "p03563_case_011", "p03563_case_012", "p03563_case_013", "p03563_case_014", "p03563_case_015", "p03563_case_016", "p03563_case_017", "p03563_case_018", "p03563_case_019", "p03563_case_020", "p03563_case_021", "p03563_case_022", "p03563_case_023", "p03563_case_024", "p03563_case_025", "p03563_case_026", "p03563_case_027", "p03563_case_028", "p03563_case_029", "p03563_case_030", "p03563_case_031", "p03563_case_032", "p03563_case_033", "p03563_case_034", "p03563_case_035", "p03563_case_036", "p03563_case_037", "p03563_case_038", "p03563_case_039", "p03563_case_040", "p03563_case_041", "p03563_case_042", "p03563_case_043", "p03563_case_044", "p03563_case_045", "p03563_case_046", "p03563_case_047", "p03563_case_048", "p03563_case_049", "p03563_case_050", "p03563_case_051", "p03563_case_052", "p03563_case_053", "p03563_case_054", "p03563_case_055", "p03563_case_056", "p03563_case_057", "p03563_case_058", "p03563_case_059", "p03563_case_060", "p03563_case_061", "p03563_case_062", "p03563_case_063", "p03563_case_064", "p03563_case_065", "p03563_case_066", "p03563_case_067", "p03563_case_068", "p03563_case_069", "p03563_case_070", "p03563_case_071", "p03563_case_072", "p03563_case_073", "p03563_case_074", "p03563_case_075", "p03563_case_076", "p03563_case_077", "p03563_case_078", "p03563_case_079", "p03563_case_080", "p03563_case_081", "p03563_case_082", "p03563_case_083", "p03563_case_084", "p03563_case_085", "p03563_case_086", "p03563_case_087", "p03563_case_088", "p03563_case_089", "p03563_case_090", "p03563_case_091", "p03563_case_092", "p03563_case_093", "p03563_case_094", "p03563_case_095", "p03563_case_096", "p03563_case_097", "p03563_case_098", "p03563_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "r = int(eval(input()))\ng = int(eval(input()))\nx = (2 * g) - r\nprint(x)\n", "fast_code_sha256": "ab5300422a36b59b9805cb71e17a1987600769d0f27e6ef3ae3f25c78274ac47", "fast_id": "p03563_ab5300422a36b59b9805cb71e17a1987600769d0f27e6ef3ae3f25c78274ac47", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "r = int(eval(input()))\ng = int(eval(input()))\nx = (2 * g) - r\nprint(x)\n", "measured_fast_code_sha256": "ab5300422a36b59b9805cb71e17a1987600769d0f27e6ef3ae3f25c78274ac47", "measured_slow_code": "import numpy as np\n\nlst = []\nR = int(eval(input()))\nG = int(eval(input()))\nans = G - R + G\nprint(ans)\n", "measured_slow_code_sha256": "59c6641cd1def8a06b45e4c0f0ace3ffa49de62fc97f73e0499cc3875cec5d01", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1660.809054265887, "pair_id": "python_v2_95933ec35702739eeb7d23f1", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03563", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03563_ab5300422a36b59b9805cb71e17a1987600769d0f27e6ef3ae3f25c78274ac47.jsonl.gz", "inputs": "reproduction/python/inputs/p03563.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03563_59c6641cd1def8a06b45e4c0f0ace3ffa49de62fc97f73e0499cc3875cec5d01.jsonl.gz"}, "slow_code": "import numpy as np\n\nlst = []\nR = int(eval(input()))\nG = int(eval(input()))\nans = G - R + G\nprint(ans)\n", "slow_code_sha256": "59c6641cd1def8a06b45e4c0f0ace3ffa49de62fc97f73e0499cc3875cec5d01", "slow_id": "p03563_59c6641cd1def8a06b45e4c0f0ace3ffa49de62fc97f73e0499cc3875cec5d01", "speedup": 1656.7233040779613, "stratum": "8+", "within_pair_jaccard": 0.25, "workload": {"case_count": 100, "description": "A new rating is the arithmetic mean of current rating R and a performance value. Find the performance required for the new rating to equal G; it may be negative. Observed inputs: R=0..4500 (median 2451.5); G=0..4500 (median 1662.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 10, "median": 10.0, "min": 4}, "input_format": ["R\nG"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p03972_case_000", "p03972_case_001", "p03972_case_002", "p03972_case_003", "p03972_case_004", "p03972_case_005", "p03972_case_006", "p03972_case_007", "p03972_case_008", "p03972_case_009", "p03972_case_010", "p03972_case_011", "p03972_case_012", "p03972_case_013", "p03972_case_014", "p03972_case_015", "p03972_case_016", "p03972_case_017", "p03972_case_018", "p03972_case_019", "p03972_case_020", "p03972_case_021", "p03972_case_022", "p03972_case_023", "p03972_case_024", "p03972_case_025", "p03972_case_026", "p03972_case_027", "p03972_case_028", "p03972_case_029", "p03972_case_030", "p03972_case_031", "p03972_case_032", "p03972_case_033", "p03972_case_034", "p03972_case_035", "p03972_case_036", "p03972_case_037", "p03972_case_038", "p03972_case_039", "p03972_case_040", "p03972_case_041", "p03972_case_042", "p03972_case_043", "p03972_case_044", "p03972_case_045", "p03972_case_046", "p03972_case_047", "p03972_case_048", "p03972_case_049", "p03972_case_050", "p03972_case_051", "p03972_case_052", "p03972_case_053", "p03972_case_054", "p03972_case_055", "p03972_case_056", "p03972_case_057", "p03972_case_058", "p03972_case_059", "p03972_case_060", "p03972_case_061", "p03972_case_062", "p03972_case_063", "p03972_case_064", "p03972_case_065", "p03972_case_066", "p03972_case_067", "p03972_case_068", "p03972_case_069", "p03972_case_070", "p03972_case_071", "p03972_case_072", "p03972_case_073", "p03972_case_074", "p03972_case_075", "p03972_case_076", "p03972_case_077", "p03972_case_078", "p03972_case_079", "p03972_case_080", "p03972_case_081", "p03972_case_082", "p03972_case_083", "p03972_case_084", "p03972_case_085", "p03972_case_086", "p03972_case_087", "p03972_case_088", "p03972_case_089", "p03972_case_090", "p03972_case_091", "p03972_case_092", "p03972_case_093", "p03972_case_094", "p03972_case_095", "p03972_case_096", "p03972_case_097", "p03972_case_098", "p03972_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "w, h, *L = list(map(int, open(0).read().split()))\nP = L[:w]\nQ = [-qj for qj in L[w:]]\nx, y, ans = w, h, 0\nfor c in sorted(P + Q, key=abs):\n if c > 0:\n if x:\n ans += c * (y + 1)\n x -= 1\n else:\n if y:\n ans -= c * (x + 1)\n y -= 1\nprint(ans)\n", "fast_code_sha256": "e017ce0a742d01e8892c0abe2d44772f6ec0cff2cca270665ae25ecd66f25668", "fast_id": "p03972_e017ce0a742d01e8892c0abe2d44772f6ec0cff2cca270665ae25ecd66f25668", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "w, h, *L = list(map(int, open(0).read().split()))\nP = L[:w]\nQ = [-qj for qj in L[w:]]\nx, y, ans = w, h, 0\nfor c in sorted(P + Q, key=abs):\n if c > 0:\n if x:\n ans += c * (y + 1)\n x -= 1\n else:\n if y:\n ans -= c * (x + 1)\n y -= 1\nprint(ans)\n", "measured_fast_code_sha256": "e017ce0a742d01e8892c0abe2d44772f6ec0cff2cca270665ae25ecd66f25668", "measured_slow_code": "W, H = list(map(int, input().split()))\nP = [int(eval(input())) for i in range(W)]\nQ = [int(eval(input())) for j in range(H)]\nP.append(float(\"inf\"))\nQ.append(float(\"inf\"))\nP.sort(reverse=True)\nQ.sort(reverse=True)\nnow_W = W + 1\nnow_H = H + 1\ncost = 0\nwhile now_W > 1 or now_H > 1:\n if P[-1] < Q[-1]:\n cost += P.pop() * now_H\n now_W -= 1\n elif Q[-1] < P[-1]:\n cost += Q.pop() * now_W\n now_H -= 1\n elif P[-1] == Q[-1]:\n if now_W <= now_H:\n cost += Q.pop() * now_W\n now_H -= 1\n elif now_W > now_H:\n cost += P.pop() * now_H\n now_W -= 1\nprint(cost)\n", "measured_slow_code_sha256": "993994cc2c3d5ff5afe18fa6ff8857111da3e3e71c173a82b9a78d6f98107ea1", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 6.9928666262426695, "pair_id": "python_v2_6970a7a4936c8eca4369ce04", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03972", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03972_e017ce0a742d01e8892c0abe2d44772f6ec0cff2cca270665ae25ecd66f25668.jsonl.gz", "inputs": "reproduction/python/inputs/p03972.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03972_993994cc2c3d5ff5afe18fa6ff8857111da3e3e71c173a82b9a78d6f98107ea1.jsonl.gz"}, "slow_code": "W, H = list(map(int, input().split()))\nP = [int(eval(input())) for i in range(W)]\nQ = [int(eval(input())) for j in range(H)]\nP.append(float(\"inf\"))\nQ.append(float(\"inf\"))\nP.sort(reverse=True)\nQ.sort(reverse=True)\nnow_W = W + 1\nnow_H = H + 1\ncost = 0\nwhile now_W > 1 or now_H > 1:\n if P[-1] < Q[-1]:\n cost += P.pop() * now_H\n now_W -= 1\n elif Q[-1] < P[-1]:\n cost += Q.pop() * now_W\n now_H -= 1\n elif P[-1] == Q[-1]:\n if now_W <= now_H:\n cost += Q.pop() * now_W\n now_H -= 1\n elif now_W > now_H:\n cost += P.pop() * now_H\n now_W -= 1\nprint(cost)\n", "slow_code_sha256": "993994cc2c3d5ff5afe18fa6ff8857111da3e3e71c173a82b9a78d6f98107ea1", "slow_id": "p03972_993994cc2c3d5ff5afe18fa6ff8857111da3e3e71c173a82b9a78d6f98107ea1", "speedup": 6.818175977959753, "stratum": "4-8", "within_pair_jaccard": 0.2608695652173913, "workload": {"case_count": 100, "description": "Connect all vertices of a (W+1)-by-(H+1) rectangular grid at minimum total edge cost. Horizontal edge costs at column i are p_i; vertical edge costs at row j are q_j. Observed inputs: W=1..100000 (median 99999); H=1..100000 (median 99999); p_i=1..100000000; q_j=1..100000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 2000014, "median": 888948.0, "min": 8}, "input_format": ["W H\np_0\n...\np_(W-1)\nq_0\n...\nq_(H-1)"], "input_format_status": "source_input_section", "input_lines": {"max": 200001, "median": 100003.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200002, "median": 100004.0, "min": 4}}} -{"case_ids": ["p02716_case_000", "p02716_case_001", "p02716_case_002", "p02716_case_003", "p02716_case_004", "p02716_case_005", "p02716_case_006", "p02716_case_007", "p02716_case_008", "p02716_case_009", "p02716_case_010", "p02716_case_011", "p02716_case_012", "p02716_case_013", "p02716_case_014", "p02716_case_015", "p02716_case_016", "p02716_case_017", "p02716_case_018", "p02716_case_019", "p02716_case_020", "p02716_case_021", "p02716_case_022", "p02716_case_023", "p02716_case_024", "p02716_case_025", "p02716_case_026", "p02716_case_027", "p02716_case_028", "p02716_case_029", "p02716_case_030", "p02716_case_031", "p02716_case_032", "p02716_case_033", "p02716_case_034", "p02716_case_035", "p02716_case_036", "p02716_case_037", "p02716_case_038", "p02716_case_039", "p02716_case_040", "p02716_case_041", "p02716_case_042", "p02716_case_043", "p02716_case_044", "p02716_case_045", "p02716_case_046", "p02716_case_047", "p02716_case_048", "p02716_case_049", "p02716_case_050", "p02716_case_051", "p02716_case_052", "p02716_case_053", "p02716_case_054", "p02716_case_055", "p02716_case_056", "p02716_case_057", "p02716_case_058", "p02716_case_059", "p02716_case_060", "p02716_case_061", "p02716_case_062", "p02716_case_063", "p02716_case_064", "p02716_case_065", "p02716_case_066", "p02716_case_067", "p02716_case_068", "p02716_case_069", "p02716_case_070", "p02716_case_071", "p02716_case_072", "p02716_case_073", "p02716_case_074", "p02716_case_075", "p02716_case_076", "p02716_case_077", "p02716_case_078", "p02716_case_079", "p02716_case_080", "p02716_case_081", "p02716_case_082", "p02716_case_083", "p02716_case_084", "p02716_case_085", "p02716_case_086", "p02716_case_087", "p02716_case_088", "p02716_case_089", "p02716_case_090", "p02716_case_091", "p02716_case_092", "p02716_case_093", "p02716_case_094", "p02716_case_095", "p02716_case_096", "p02716_case_097", "p02716_case_098", "p02716_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\ninput = sys.stdin.readline\nn = int(eval(input()))\na = list(map(int, input().split()))\ndp = [0] * n\nc = a[0]\ndp[1] = max(a[0], a[1])\nfor i in range(2, n):\n if i % 2 == 0:\n c += a[i]\n dp[i] = max(dp[i - 2] + a[i], dp[i - 1])\n else:\n dp[i] = max(dp[i - 2] + a[i], c)\nprint((dp[-1]))\n", "fast_code_sha256": "c90ec233f5c2e155da8773eaeb4f4f89b96b046ea6e538b68f143636b57d580f", "fast_id": "p02716_c90ec233f5c2e155da8773eaeb4f4f89b96b046ea6e538b68f143636b57d580f", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\ninput = sys.stdin.readline\nn = int(eval(input()))\na = list(map(int, input().split()))\ndp = [0] * n\nc = a[0]\ndp[1] = max(a[0], a[1])\nfor i in range(2, n):\n if i % 2 == 0:\n c += a[i]\n dp[i] = max(dp[i - 2] + a[i], dp[i - 1])\n else:\n dp[i] = max(dp[i - 2] + a[i], c)\nprint((dp[-1]))\n", "measured_fast_code_sha256": "c90ec233f5c2e155da8773eaeb4f4f89b96b046ea6e538b68f143636b57d580f", "measured_slow_code": "from collections import defaultdict\n\nINF = float(\"inf\")\nN, *A = list(map(int, open(0).read().split()))\ndp_in = defaultdict(lambda: -INF)\ndp_out = defaultdict(lambda: -INF)\ndp_out[(0, 0)] = 0\nfor i, a in enumerate(A, 1):\n p = i // 2\n for j in [p - 1, p, p + 1]:\n dp_in[(i, j)] = a + dp_out[(i - 1, j - 1)]\n dp_out[(i, j)] = max(dp_in[(i - 1, j)], dp_out[(i - 1, j)])\nprint((max(dp_in[(N, N // 2)], dp_out[(N, N // 2)])))\n", "measured_slow_code_sha256": "a47ec4274f4090dd01fbc1617d6b12873df8f973bd5d6f90940d1d00ea4da576", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.231075821626474, "pair_id": "python_v2_835005f59b4958e99753abcf", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02716", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02716_c90ec233f5c2e155da8773eaeb4f4f89b96b046ea6e538b68f143636b57d580f.jsonl.gz", "inputs": "reproduction/python/inputs/p02716.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02716_a47ec4274f4090dd01fbc1617d6b12873df8f973bd5d6f90940d1d00ea4da576.jsonl.gz"}, "slow_code": "from collections import defaultdict\n\nINF = float(\"inf\")\nN, *A = list(map(int, open(0).read().split()))\ndp_in = defaultdict(lambda: -INF)\ndp_out = defaultdict(lambda: -INF)\ndp_out[(0, 0)] = 0\nfor i, a in enumerate(A, 1):\n p = i // 2\n for j in [p - 1, p, p + 1]:\n dp_in[(i, j)] = a + dp_out[(i - 1, j - 1)]\n dp_out[(i, j)] = max(dp_in[(i - 1, j)], dp_out[(i - 1, j)])\nprint((max(dp_in[(N, N // 2)], dp_out[(N, N // 2)])))\n", "slow_code_sha256": "a47ec4274f4090dd01fbc1617d6b12873df8f973bd5d6f90940d1d00ea4da576", "slow_id": "p02716_a47ec4274f4090dd01fbc1617d6b12873df8f973bd5d6f90940d1d00ea4da576", "speedup": 3.03861275146019, "stratum": "2-4", "within_pair_jaccard": 0.3170731707317073, "workload": {"case_count": 100, "description": "Choose exactly floor(N/2) entries from an integer array, with no two chosen positions adjacent, to maximize their sum. Values may be negative. Observed inputs: N=2..200000 (median 100); A_i=-1000000000..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 2400007, "median": 1046.5, "min": 10}, "input_format": ["N\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200001, "median": 101.0, "min": 3}}} -{"case_ids": ["p03449_case_000", "p03449_case_001", "p03449_case_002", "p03449_case_003", "p03449_case_004", "p03449_case_005", "p03449_case_006", "p03449_case_007", "p03449_case_008", "p03449_case_009", "p03449_case_010", "p03449_case_011", "p03449_case_012", "p03449_case_013", "p03449_case_014", "p03449_case_015", "p03449_case_016", "p03449_case_017", "p03449_case_018", "p03449_case_019", "p03449_case_020", "p03449_case_021", "p03449_case_022", "p03449_case_023", "p03449_case_024", "p03449_case_025", "p03449_case_026", "p03449_case_027", "p03449_case_028", "p03449_case_029", "p03449_case_030", "p03449_case_031", "p03449_case_032", "p03449_case_033", "p03449_case_034", "p03449_case_035", "p03449_case_036", "p03449_case_037", "p03449_case_038", "p03449_case_039", "p03449_case_040", "p03449_case_041", "p03449_case_042", "p03449_case_043", "p03449_case_044", "p03449_case_045", "p03449_case_046", "p03449_case_047", "p03449_case_048", "p03449_case_049", "p03449_case_050", "p03449_case_051", "p03449_case_052", "p03449_case_053", "p03449_case_054", "p03449_case_055", "p03449_case_056", "p03449_case_057", "p03449_case_058", "p03449_case_059", "p03449_case_060", "p03449_case_061", "p03449_case_062", "p03449_case_063", "p03449_case_064", "p03449_case_065", "p03449_case_066", "p03449_case_067", "p03449_case_068", "p03449_case_069", "p03449_case_070", "p03449_case_071", "p03449_case_072", "p03449_case_073", "p03449_case_074", "p03449_case_075", "p03449_case_076", "p03449_case_077", "p03449_case_078", "p03449_case_079", "p03449_case_080", "p03449_case_081", "p03449_case_082", "p03449_case_083", "p03449_case_084", "p03449_case_085", "p03449_case_086", "p03449_case_087", "p03449_case_088", "p03449_case_089", "p03449_case_090", "p03449_case_091", "p03449_case_092", "p03449_case_093", "p03449_case_094", "p03449_case_095", "p03449_case_096", "p03449_case_097", "p03449_case_098", "p03449_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N = int(eval(input()))\nA1 = list(map(int, input().split()))\nA2 = list(map(int, input().split()))\nans = 0\nfor i in range(N):\n ans = max(ans, sum(A1[0 : i + 1] + A2[i:]))\nprint(ans)\n", "fast_code_sha256": "22b0fda1bf6bb83ee2771c74c3b3ccba31b37a1226e9dd8738fbaca696b5c6c6", "fast_id": "p03449_22b0fda1bf6bb83ee2771c74c3b3ccba31b37a1226e9dd8738fbaca696b5c6c6", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N = int(eval(input()))\nA1 = list(map(int, input().split()))\nA2 = list(map(int, input().split()))\nans = 0\nfor i in range(N):\n ans = max(ans, sum(A1[0 : i + 1] + A2[i:]))\nprint(ans)\n", "measured_fast_code_sha256": "22b0fda1bf6bb83ee2771c74c3b3ccba31b37a1226e9dd8738fbaca696b5c6c6", "measured_slow_code": "# import collections\n# aa = collections.Counter(a) # list to list\n# mod = 10**9 + 7\ndef readInts():\n return list(map(int, input().split()))\n\n\ndef main():\n n = int(eval(input()))\n A = [readInts() for _ in range(2)]\n # print(*A)\n # 下に行くidxを決めておく\n idx = 0\n # ゆーてnまでしかいけないけど\n ma_ = -1\n while idx < n:\n j = 0\n cnt = 0 # なんぼあるいたか\n dist = 0 # 距離\n k = 0\n while k <= idx:\n if cnt <= n:\n dist += A[j][k]\n cnt += 1\n else:\n break\n k += 1\n k -= 1\n # ここで下にずらす\n if cnt <= n:\n j += 1\n # print(idx,j,k)\n dist += A[j][k]\n cnt += 1\n k += 1 # 次始まるときはk += 1からだから\n # 右側を探索\n if cnt <= n:\n while k < n:\n if cnt <= n:\n # print(k)\n dist += A[j][k]\n cnt += 1\n else:\n break\n k += 1\n idx += 1\n # print(dist)\n ma_ = max(ma_, dist)\n print(ma_)\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "ef6ef8b6058f8fe2ff3f6c515307d0adaccb7ef0774b4fc4ee42af36434cbe6d", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 5.427565301242627, "pair_id": "python_v2_6b9e92c2d50bcc2c3eb18f45", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03449", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03449_22b0fda1bf6bb83ee2771c74c3b3ccba31b37a1226e9dd8738fbaca696b5c6c6.jsonl.gz", "inputs": "reproduction/python/inputs/p03449.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03449_ef6ef8b6058f8fe2ff3f6c515307d0adaccb7ef0774b4fc4ee42af36434cbe6d.jsonl.gz"}, "slow_code": "def readInts():\n return list(map(int, input().split()))\n\n\ndef main():\n n = int(eval(input()))\n A = [readInts() for _ in range(2)]\n\n idx = 0\n\n ma_ = -1\n while idx < n:\n j = 0\n cnt = 0\n dist = 0\n k = 0\n while k <= idx:\n if cnt <= n:\n dist += A[j][k]\n cnt += 1\n else:\n break\n k += 1\n k -= 1\n\n if cnt <= n:\n j += 1\n\n dist += A[j][k]\n cnt += 1\n k += 1\n\n if cnt <= n:\n while k < n:\n if cnt <= n:\n\n dist += A[j][k]\n cnt += 1\n else:\n break\n k += 1\n idx += 1\n\n ma_ = max(ma_, dist)\n print(ma_)\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "c9914409980530d0996d00d624d6ced5bcaa5e46404bf56c166db3c30c8b45e2", "slow_id": "p03449_ef6ef8b6058f8fe2ff3f6c515307d0adaccb7ef0774b4fc4ee42af36434cbe6d", "speedup": 4.73634655995686, "stratum": "4-8", "within_pair_jaccard": 0.3333333333333333, "workload": {"case_count": 100, "description": "Traverse a 2-by-N candy grid from (1,1) to (2,N), moving only right or down and collecting each visited cell, including endpoints. Maximize collected candies. Observed inputs: N=1..100 (median 50); A_i_j=1..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 804, "median": 294.5, "min": 6}, "input_format": ["N\nA_1,1 ... A_1,N\nA_2,1 ... A_2,N"], "input_format_status": "source_input_section", "input_lines": {"max": 3, "median": 3.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 201, "median": 101.0, "min": 3}}} -{"case_ids": ["p03486_case_000", "p03486_case_001", "p03486_case_002", "p03486_case_003", "p03486_case_004", "p03486_case_005", "p03486_case_006", "p03486_case_007", "p03486_case_008", "p03486_case_009", "p03486_case_010", "p03486_case_011", "p03486_case_012", "p03486_case_013", "p03486_case_014", "p03486_case_015", "p03486_case_016", "p03486_case_017", "p03486_case_018", "p03486_case_019", "p03486_case_020", "p03486_case_021", "p03486_case_022", "p03486_case_023", "p03486_case_024", "p03486_case_025", "p03486_case_026", "p03486_case_027", "p03486_case_028", "p03486_case_029", "p03486_case_030", "p03486_case_031", "p03486_case_032", "p03486_case_033", "p03486_case_034", "p03486_case_035", "p03486_case_036", "p03486_case_037", "p03486_case_038", "p03486_case_039", "p03486_case_040", "p03486_case_041", "p03486_case_042", "p03486_case_043", "p03486_case_044", "p03486_case_045", "p03486_case_046", "p03486_case_047", "p03486_case_048", "p03486_case_049", "p03486_case_050", "p03486_case_051", "p03486_case_052", "p03486_case_053", "p03486_case_054", "p03486_case_055", "p03486_case_056", "p03486_case_057", "p03486_case_058", "p03486_case_059", "p03486_case_060", "p03486_case_061", "p03486_case_062", "p03486_case_063", "p03486_case_064", "p03486_case_065", "p03486_case_066", "p03486_case_067", "p03486_case_068", "p03486_case_069", "p03486_case_070", "p03486_case_071", "p03486_case_072", "p03486_case_073", "p03486_case_074", "p03486_case_075", "p03486_case_076", "p03486_case_077", "p03486_case_078", "p03486_case_079", "p03486_case_080", "p03486_case_081", "p03486_case_082", "p03486_case_083", "p03486_case_084", "p03486_case_085", "p03486_case_086", "p03486_case_087", "p03486_case_088", "p03486_case_089", "p03486_case_090", "p03486_case_091", "p03486_case_092", "p03486_case_093", "p03486_case_094", "p03486_case_095", "p03486_case_096", "p03486_case_097", "p03486_case_098", "p03486_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "s = list(input().strip())\ns1 = sorted(s)\nt = list(input().strip())\nt1 = sorted(t, reverse=True)\nif s1 < t1:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "fast_code_sha256": "a817fffff36d37d931c3f21c118a64d5ffef77d7d654ca2d4d5c6cfe2332c32a", "fast_id": "p03486_a817fffff36d37d931c3f21c118a64d5ffef77d7d654ca2d4d5c6cfe2332c32a", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "s = list(input().strip())\ns1 = sorted(s)\nt = list(input().strip())\nt1 = sorted(t, reverse=True)\nif s1 < t1:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "measured_fast_code_sha256": "a817fffff36d37d931c3f21c118a64d5ffef77d7d654ca2d4d5c6cfe2332c32a", "measured_slow_code": "import sys\n\n# import collections\n# import math\n# import string\n# import bisect\n# import re\n# import itertools\n# import statistics\ndef main():\n s, t = sys.stdin.read().split()\n n, m = len(s), len(t)\n s = sorted(s)\n t = list(reversed(sorted(t)))\n if n < m:\n for i in range(n):\n if s[i] < t[i]:\n ans = \"Yes\"\n break\n elif s[i] > t[i]:\n ans = \"No\"\n break\n else:\n ans = \"Yes\"\n else:\n for i in range(m):\n if s[i] < t[i]:\n ans = \"Yes\"\n break\n elif s[i] > t[i]:\n ans = \"No\"\n break\n else:\n ans = \"No\"\n print(ans)\n\n\nif __name__ == \"__main__\":\n # execute only if run as a script\n main()\n", "measured_slow_code_sha256": "ae2b702653d7f7343a504deb1d82130c75439f406e3e68078bdb6fe733a50939", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.626731193982037, "pair_id": "python_v2_e20133c0feea77249aee6174", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03486", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03486_a817fffff36d37d931c3f21c118a64d5ffef77d7d654ca2d4d5c6cfe2332c32a.jsonl.gz", "inputs": "reproduction/python/inputs/p03486.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03486_ae2b702653d7f7343a504deb1d82130c75439f406e3e68078bdb6fe733a50939.jsonl.gz"}, "slow_code": "import sys\n\n\ndef main():\n s, t = sys.stdin.read().split()\n n, m = len(s), len(t)\n s = sorted(s)\n t = list(reversed(sorted(t)))\n if n < m:\n for i in range(n):\n if s[i] < t[i]:\n ans = \"Yes\"\n break\n elif s[i] > t[i]:\n ans = \"No\"\n break\n else:\n ans = \"Yes\"\n else:\n for i in range(m):\n if s[i] < t[i]:\n ans = \"Yes\"\n break\n elif s[i] > t[i]:\n ans = \"No\"\n break\n else:\n ans = \"No\"\n print(ans)\n\n\nif __name__ == \"__main__\":\n\n main()\n", "slow_code_sha256": "12de6db88ad79471a6d47d200ef0cf1d590ca1eac8ef874b69a66f9eb314da4e", "slow_id": "p03486_ae2b702653d7f7343a504deb1d82130c75439f406e3e68078bdb6fe733a50939", "speedup": 2.5618574763271953, "stratum": "2-4", "within_pair_jaccard": 0.2571428571428571, "workload": {"case_count": 100, "description": "Rearrange the characters of each lowercase string s and t independently. Determine whether some rearrangements satisfy strict lexicographic order s_prime= 1000:\n M = str(N)\n X = M[1:]\n O = int(X)\n if O == 0:\n print((0))\n else:\n print((1000 - O))\nelse:\n O = int(N)\n print((1000 - O))\n", "measured_slow_code_sha256": "8dde1aff283391e2d57ad3865fb24f31a09d7a6c5fe418b99f6dc494d6a6f32b", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.902853354070951, "pair_id": "python_v2_e24149e96bdb07635dfa7c93", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02612", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02612_bf2b25d30147294ff0276ceb1faeae7b06783207fa7b8ca256752e56cdee77d1.jsonl.gz", "inputs": "reproduction/python/inputs/p02612.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02612_8dde1aff283391e2d57ad3865fb24f31a09d7a6c5fe418b99f6dc494d6a6f32b.jsonl.gz"}, "slow_code": "N = int(eval(input()))\nif N >= 1000:\n M = str(N)\n X = M[1:]\n O = int(X)\n if O == 0:\n print((0))\n else:\n print((1000 - O))\nelse:\n O = int(N)\n print((1000 - O))\n", "slow_code_sha256": "8dde1aff283391e2d57ad3865fb24f31a09d7a6c5fe418b99f6dc494d6a6f32b", "slow_id": "p02612_8dde1aff283391e2d57ad3865fb24f31a09d7a6c5fe418b99f6dc494d6a6f32b", "speedup": 2.8936485786260326, "stratum": "2-4", "within_pair_jaccard": 0.35714285714285715, "workload": {"case_count": 100, "description": "Find the change received for a price N when paying with the minimum sufficient number of 1000-unit bills. Observed inputs: N=1..10000 (median 5000.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 6, "median": 5.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p02935_case_000", "p02935_case_001", "p02935_case_002", "p02935_case_003", "p02935_case_004", "p02935_case_005", "p02935_case_006", "p02935_case_007", "p02935_case_008", "p02935_case_009", "p02935_case_010", "p02935_case_011", "p02935_case_012", "p02935_case_013", "p02935_case_014", "p02935_case_015", "p02935_case_016", "p02935_case_017", "p02935_case_018", "p02935_case_019", "p02935_case_020", "p02935_case_021", "p02935_case_022", "p02935_case_023", "p02935_case_024", "p02935_case_025", "p02935_case_026", "p02935_case_027", "p02935_case_028", "p02935_case_029", "p02935_case_030", "p02935_case_031", "p02935_case_032", "p02935_case_033", "p02935_case_034", "p02935_case_035", "p02935_case_036", "p02935_case_037", "p02935_case_038", "p02935_case_039", "p02935_case_040", "p02935_case_041", "p02935_case_042", "p02935_case_043", "p02935_case_044", "p02935_case_045", "p02935_case_046", "p02935_case_047", "p02935_case_048", "p02935_case_049", "p02935_case_050", "p02935_case_051", "p02935_case_052", "p02935_case_053", "p02935_case_054", "p02935_case_055", "p02935_case_056", "p02935_case_057", "p02935_case_058", "p02935_case_059", "p02935_case_060", "p02935_case_061", "p02935_case_062", "p02935_case_063", "p02935_case_064", "p02935_case_065", "p02935_case_066", "p02935_case_067", "p02935_case_068", "p02935_case_069", "p02935_case_070", "p02935_case_071", "p02935_case_072", "p02935_case_073", "p02935_case_074", "p02935_case_075", "p02935_case_076", "p02935_case_077", "p02935_case_078", "p02935_case_079", "p02935_case_080", "p02935_case_081", "p02935_case_082", "p02935_case_083", "p02935_case_084", "p02935_case_085", "p02935_case_086", "p02935_case_087", "p02935_case_088", "p02935_case_089", "p02935_case_090", "p02935_case_091", "p02935_case_092", "p02935_case_093", "p02935_case_094", "p02935_case_095", "p02935_case_096", "p02935_case_097", "p02935_case_098", "p02935_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def main():\n import sys\n from collections import deque\n\n n = int(eval(input()))\n v = list(map(int, sys.stdin.read().split()))\n w = deque(sorted(v))\n ans = (w.popleft() + w.popleft()) / 2\n for i in range(n - 2):\n ans = ans / 2\n ans += w.popleft() / 2\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "2650daa6a1c274256ef4850a384a56440f26d66dd6c199e73c69932a1b7a96f5", "fast_id": "p02935_2650daa6a1c274256ef4850a384a56440f26d66dd6c199e73c69932a1b7a96f5", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def main():\n import sys\n from collections import deque\n\n n = int(eval(input()))\n v = list(map(int, sys.stdin.read().split()))\n w = deque(sorted(v))\n ans = (w.popleft() + w.popleft()) / 2\n for i in range(n - 2):\n ans = ans / 2\n ans += w.popleft() / 2\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "2650daa6a1c274256ef4850a384a56440f26d66dd6c199e73c69932a1b7a96f5", "measured_slow_code": "import numpy as np\n\nn = int(eval(input()))\nlista = list(map(int, input().split()))\nlista.sort()\nfor i in range(n - 1):\n lista.append((lista[0] + lista[1]) / 2)\n lista.pop(0)\n lista.pop(0)\n lista.sort()\nprint((lista[0]))\n", "measured_slow_code_sha256": "4fce74aca7d1608f14c76b9fb92532f43bd52c914832f66cdc3ddf21b1636b9b", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 681.2617962385142, "pair_id": "python_v2_c096ecc92201d3b5a011e601", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02935", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02935_2650daa6a1c274256ef4850a384a56440f26d66dd6c199e73c69932a1b7a96f5.jsonl.gz", "inputs": "reproduction/python/inputs/p02935.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02935_4fce74aca7d1608f14c76b9fb92532f43bd52c914832f66cdc3ddf21b1636b9b.jsonl.gz"}, "slow_code": "import numpy as np\n\nn = int(eval(input()))\nlista = list(map(int, input().split()))\nlista.sort()\nfor i in range(n - 1):\n lista.append((lista[0] + lista[1]) / 2)\n lista.pop(0)\n lista.pop(0)\n lista.sort()\nprint((lista[0]))\n", "slow_code_sha256": "4fce74aca7d1608f14c76b9fb92532f43bd52c914832f66cdc3ddf21b1636b9b", "slow_id": "p02935_4fce74aca7d1608f14c76b9fb92532f43bd52c914832f66cdc3ddf21b1636b9b", "speedup": 674.9454272057907, "stratum": "8+", "within_pair_jaccard": 0.358974358974359, "workload": {"case_count": 100, "description": "Repeatedly replace two ingredient values x and y by their arithmetic mean (x+y)/2. Starting with N input values v_i, maximize the final value after N-1 replacements. Observed inputs: N=2..50 (median 25); v_i=1..1000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 253, "median": 102.5, "min": 6}, "input_format": ["N\nv_1 ... v_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 51, "median": 26.0, "min": 3}}} -{"case_ids": ["p02821_case_000", "p02821_case_001", "p02821_case_002", "p02821_case_003", "p02821_case_004", "p02821_case_005", "p02821_case_006", "p02821_case_007", "p02821_case_008", "p02821_case_009", "p02821_case_010", "p02821_case_011", "p02821_case_012", "p02821_case_013", "p02821_case_014", "p02821_case_015", "p02821_case_016", "p02821_case_017", "p02821_case_018", "p02821_case_019", "p02821_case_020", "p02821_case_021", "p02821_case_022", "p02821_case_023", "p02821_case_024", "p02821_case_025", "p02821_case_026", "p02821_case_027", "p02821_case_028", "p02821_case_029", "p02821_case_030", "p02821_case_031", "p02821_case_032", "p02821_case_033", "p02821_case_034", "p02821_case_035", "p02821_case_036", "p02821_case_037", "p02821_case_038", "p02821_case_039", "p02821_case_040", "p02821_case_041", "p02821_case_042", "p02821_case_043", "p02821_case_044", "p02821_case_045", "p02821_case_046", "p02821_case_047", "p02821_case_048", "p02821_case_049", "p02821_case_050", "p02821_case_051", "p02821_case_052", "p02821_case_053", "p02821_case_054", "p02821_case_055", "p02821_case_056", "p02821_case_057", "p02821_case_058", "p02821_case_059", "p02821_case_060", "p02821_case_061", "p02821_case_062", "p02821_case_063", "p02821_case_064", "p02821_case_065", "p02821_case_066", "p02821_case_067", "p02821_case_068", "p02821_case_069", "p02821_case_070", "p02821_case_071", "p02821_case_072", "p02821_case_073", "p02821_case_074", "p02821_case_075", "p02821_case_076", "p02821_case_077", "p02821_case_078", "p02821_case_079", "p02821_case_080", "p02821_case_081", "p02821_case_082", "p02821_case_083", "p02821_case_084", "p02821_case_085", "p02821_case_086", "p02821_case_087", "p02821_case_088", "p02821_case_089", "p02821_case_090", "p02821_case_091", "p02821_case_092", "p02821_case_093", "p02821_case_094", "p02821_case_095", "p02821_case_096", "p02821_case_097", "p02821_case_098", "p02821_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from bisect import bisect_left as bisect\n\nN, M = list(map(int, input().split()))\nA = list(map(int, input().split()))\nA.sort()\n\n\ndef combination(X):\n res = 0\n for i in range(N):\n j = bisect(A, X - A[i])\n res += N - j\n return res\n\n\nl = 0\nr = 2 * 10**5 + 1\nm = (l + r) // 2\nfor i in range(20):\n c = combination(m)\n if c < M:\n r = m\n else:\n l = m\n m = (l + r) // 2\nif combination(m) >= M:\n m += 1\nS = [0] * (N + 1)\nfor i in range(N):\n S[i] = S[i - 1] + A[i]\nans = 0\nfor i in range(N):\n j = bisect(A, m - A[i])\n ans += A[i] * (N - j)\n ans += S[N - 1] - S[j - 1]\nans += (M - combination(m)) * (m - 1)\nprint(ans)\n", "fast_code_sha256": "eb1c7b97d9d3a8c9eca9b0830b135adad08e0a4fc9c6b9be9c34fae14d6187fb", "fast_id": "p02821_eb1c7b97d9d3a8c9eca9b0830b135adad08e0a4fc9c6b9be9c34fae14d6187fb", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from bisect import bisect_left as bisect\n\nN, M = list(map(int, input().split()))\nA = list(map(int, input().split()))\nA.sort()\n\n\ndef combination(X):\n res = 0\n for i in range(N):\n j = bisect(A, X - A[i])\n res += N - j\n return res\n\n\nl = 0\nr = 2 * 10**5 + 1\nm = (l + r) // 2\nfor i in range(20):\n c = combination(m)\n if c < M:\n r = m\n else:\n l = m\n m = (l + r) // 2\nif combination(m) >= M:\n m += 1\nS = [0] * (N + 1)\nfor i in range(N):\n S[i] = S[i - 1] + A[i]\nans = 0\nfor i in range(N):\n j = bisect(A, m - A[i])\n ans += A[i] * (N - j)\n ans += S[N - 1] - S[j - 1]\nans += (M - combination(m)) * (m - 1)\nprint(ans)\n", "measured_fast_code_sha256": "eb1c7b97d9d3a8c9eca9b0830b135adad08e0a4fc9c6b9be9c34fae14d6187fb", "measured_slow_code": "N, M = list(map(int, input().split()))\nA = list(map(int, input().split()))\nA.sort(reverse=True)\nLB = A[-1] * 2 # 一回の握手で上がる幸福度の下限は、左手も右手もパワーが一番低い人を握った場合\nUB = A[0] * 2 # 一回の握手で上がる幸福度の上限は、左手も右手もパワーが一番高い人を握った場合\n# cgs[i] は パワーがi以上のゲストの数\ncgs = [0] * (UB + 1)\nfor a in A:\n cgs[a] += 1\nfor i in range(UB, 0, -1):\n cgs[i - 1] += cgs[i]\n# 組み合わせの数がM以上になる一回で発生する幸福度の閾値を二分探索する\ndef is_ok(n):\n m = 0\n for a in A:\n m += cgs[max(n - a, 0)]\n return m >= M\n\n\nok = LB\nng = UB + 1\nwhile ng - ok > 1:\n m = (ok + ng) // 2\n if is_ok(m):\n ok = m\n else:\n ng = m\n# cps[i] は A[0]~A[i] の累積和\ncps = A[:]\nfor i in range(1, N):\n cps[i] += cps[i - 1]\nresult = 0\nfor a in A:\n t = cgs[max(ok - a, 0)]\n if t != 0:\n result += a * t + cps[t - 1]\n M -= t\nresult += ok * M\nprint(result)\n", "measured_slow_code_sha256": "5ea8b03b7686b727a5ada84b1cdc937732e7bfa264aa07688bbf2a3aa7ffee27", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4.043564897048436, "pair_id": "python_v2_08933a4186b7c1ba15331209", "per_case_slow_code_faster_fraction": 0.47, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02821", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02821_eb1c7b97d9d3a8c9eca9b0830b135adad08e0a4fc9c6b9be9c34fae14d6187fb.jsonl.gz", "inputs": "reproduction/python/inputs/p02821.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02821_5ea8b03b7686b727a5ada84b1cdc937732e7bfa264aa07688bbf2a3aa7ffee27.jsonl.gz"}, "slow_code": "N, M = list(map(int, input().split()))\nA = list(map(int, input().split()))\nA.sort(reverse=True)\nLB = A[-1] * 2\nUB = A[0] * 2\n\ncgs = [0] * (UB + 1)\nfor a in A:\n cgs[a] += 1\nfor i in range(UB, 0, -1):\n cgs[i - 1] += cgs[i]\n\n\ndef is_ok(n):\n m = 0\n for a in A:\n m += cgs[max(n - a, 0)]\n return m >= M\n\n\nok = LB\nng = UB + 1\nwhile ng - ok > 1:\n m = (ok + ng) // 2\n if is_ok(m):\n ok = m\n else:\n ng = m\n\ncps = A[:]\nfor i in range(1, N):\n cps[i] += cps[i - 1]\nresult = 0\nfor a in A:\n t = cgs[max(ok - a, 0)]\n if t != 0:\n result += a * t + cps[t - 1]\n M -= t\nresult += ok * M\nprint(result)\n", "slow_code_sha256": "d9a82d12a17bf2dfec0ab63e3f7212411f504feff565579c06a101fde21c2576", "slow_id": "p02821_5ea8b03b7686b727a5ada84b1cdc937732e7bfa264aa07688bbf2a3aa7ffee27", "speedup": 5.599020327612192, "stratum": "4-8", "within_pair_jaccard": 0.4074074074074074, "workload": {"case_count": 100, "description": "Choose M distinct ordered pairs (x,y) of guests among N, allowing x=y. Pair (x,y) yields happiness A_x+A_y. Maximize total happiness; reversing unequal IDs gives a different pair. Observed inputs: N=1..100000 (median 1000); M=1..10000000000 (median 1000000); A_i=1..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 700019, "median": 5888.0, "min": 8}, "input_format": ["N M\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100002, "median": 1002.0, "min": 3}}} -{"case_ids": ["p02971_case_000", "p02971_case_001", "p02971_case_002", "p02971_case_003", "p02971_case_004", "p02971_case_005", "p02971_case_006", "p02971_case_007", "p02971_case_008", "p02971_case_009", "p02971_case_010", "p02971_case_011", "p02971_case_012", "p02971_case_013", "p02971_case_014", "p02971_case_015", "p02971_case_016", "p02971_case_017", "p02971_case_018", "p02971_case_019", "p02971_case_020", "p02971_case_021", "p02971_case_022", "p02971_case_023", "p02971_case_024", "p02971_case_025", "p02971_case_026", "p02971_case_027", "p02971_case_028", "p02971_case_029", "p02971_case_030", "p02971_case_031", "p02971_case_032", "p02971_case_033", "p02971_case_034", "p02971_case_035", "p02971_case_036", "p02971_case_037", "p02971_case_038", "p02971_case_039", "p02971_case_040", "p02971_case_041", "p02971_case_042", "p02971_case_043", "p02971_case_044", "p02971_case_045", "p02971_case_046", "p02971_case_047", "p02971_case_048", "p02971_case_049", "p02971_case_050", "p02971_case_051", "p02971_case_052", "p02971_case_053", "p02971_case_054", "p02971_case_055", "p02971_case_056", "p02971_case_057", "p02971_case_058", "p02971_case_059", "p02971_case_060", "p02971_case_061", "p02971_case_062", "p02971_case_063", "p02971_case_064", "p02971_case_065", "p02971_case_066", "p02971_case_067", "p02971_case_068", "p02971_case_069", "p02971_case_070", "p02971_case_071", "p02971_case_072", "p02971_case_073", "p02971_case_074", "p02971_case_075", "p02971_case_076", "p02971_case_077", "p02971_case_078", "p02971_case_079", "p02971_case_080", "p02971_case_081", "p02971_case_082", "p02971_case_083", "p02971_case_084", "p02971_case_085", "p02971_case_086", "p02971_case_087", "p02971_case_088", "p02971_case_089", "p02971_case_090", "p02971_case_091", "p02971_case_092", "p02971_case_093", "p02971_case_094", "p02971_case_095", "p02971_case_096", "p02971_case_097", "p02971_case_098", "p02971_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\nread = sys.stdin.read\nreadline = sys.stdin.readline\nreadlines = sys.stdin.readlines\n\n\ndef main():\n N, *A = list(map(int, read().split()))\n A_ = sorted(A)\n m = max(A)\n for a in A:\n if a == m:\n print((A_[-2]))\n else:\n print(m)\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "1c6500df6434b4b516268de2191bc284b12208aa6d004a63137b0accccbd60de", "fast_id": "p02971_1c6500df6434b4b516268de2191bc284b12208aa6d004a63137b0accccbd60de", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\nread = sys.stdin.read\nreadline = sys.stdin.readline\nreadlines = sys.stdin.readlines\n\n\ndef main():\n N, *A = list(map(int, read().split()))\n A_ = sorted(A)\n m = max(A)\n for a in A:\n if a == m:\n print((A_[-2]))\n else:\n print(m)\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "1c6500df6434b4b516268de2191bc284b12208aa6d004a63137b0accccbd60de", "measured_slow_code": "N = int(eval(input()))\nA = []\nfor i in range(N):\n A.append(int(eval(input())))\nAs = sorted(A, reverse=True)\nfor j in A:\n if j == As[0]:\n print((As[1]))\n else:\n print((As[0]))\n", "measured_slow_code_sha256": "574406044bb1599cddf064526e1d32459b948c359a5a1de966a35ad9affef810", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 5.610430901664969, "pair_id": "python_v2_92717fda3e140736eee034a1", "per_case_slow_code_faster_fraction": 0.03, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02971", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02971_1c6500df6434b4b516268de2191bc284b12208aa6d004a63137b0accccbd60de.jsonl.gz", "inputs": "reproduction/python/inputs/p02971.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02971_574406044bb1599cddf064526e1d32459b948c359a5a1de966a35ad9affef810.jsonl.gz"}, "slow_code": "N = int(eval(input()))\nA = []\nfor i in range(N):\n A.append(int(eval(input())))\nAs = sorted(A, reverse=True)\nfor j in A:\n if j == As[0]:\n print((As[1]))\n else:\n print((As[0]))\n", "slow_code_sha256": "574406044bb1599cddf064526e1d32459b948c359a5a1de966a35ad9affef810", "slow_id": "p02971_574406044bb1599cddf064526e1d32459b948c359a5a1de966a35ad9affef810", "speedup": 3.565715775347002, "stratum": "2-4", "within_pair_jaccard": 0.23684210526315788, "workload": {"case_count": 100, "description": "For each position i of an N-element integer sequence, output the maximum among all other N-1 entries. Equal values at different positions remain separate entries. Observed inputs: N=2..200000 (median 550); A_i=1..200000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1400007, "median": 2604.5, "min": 8}, "input_format": ["N\nA_1\n...\nA_N"], "input_format_status": "source_input_section", "input_lines": {"max": 200001, "median": 551.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200001, "median": 551.0, "min": 3}}} -{"case_ids": ["p03209_case_000", "p03209_case_001", "p03209_case_002", "p03209_case_003", "p03209_case_004", "p03209_case_005", "p03209_case_006", "p03209_case_007", "p03209_case_008", "p03209_case_009", "p03209_case_010", "p03209_case_011", "p03209_case_012", "p03209_case_013", "p03209_case_014", "p03209_case_015", "p03209_case_016", "p03209_case_017", "p03209_case_018", "p03209_case_019", "p03209_case_020", "p03209_case_021", "p03209_case_022", "p03209_case_023", "p03209_case_024", "p03209_case_025", "p03209_case_026", "p03209_case_027", "p03209_case_028", "p03209_case_029", "p03209_case_030", "p03209_case_031", "p03209_case_032", "p03209_case_033", "p03209_case_034", "p03209_case_035", "p03209_case_036", "p03209_case_037", "p03209_case_038", "p03209_case_039", "p03209_case_040", "p03209_case_041", "p03209_case_042", "p03209_case_043", "p03209_case_044", "p03209_case_045", "p03209_case_046", "p03209_case_047", "p03209_case_048", "p03209_case_049", "p03209_case_050", "p03209_case_051", "p03209_case_052", "p03209_case_053", "p03209_case_054", "p03209_case_055", "p03209_case_056", "p03209_case_057", "p03209_case_058", "p03209_case_059", "p03209_case_060", "p03209_case_061", "p03209_case_062", "p03209_case_063", "p03209_case_064", "p03209_case_065", "p03209_case_066", "p03209_case_067", "p03209_case_068", "p03209_case_069", "p03209_case_070", "p03209_case_071", "p03209_case_072", "p03209_case_073", "p03209_case_074", "p03209_case_075", "p03209_case_076", "p03209_case_077", "p03209_case_078", "p03209_case_079", "p03209_case_080", "p03209_case_081", "p03209_case_082", "p03209_case_083", "p03209_case_084", "p03209_case_085", "p03209_case_086", "p03209_case_087", "p03209_case_088", "p03209_case_089", "p03209_case_090", "p03209_case_091", "p03209_case_092", "p03209_case_093", "p03209_case_094", "p03209_case_095", "p03209_case_096", "p03209_case_097", "p03209_case_098", "p03209_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N, X = list(map(int, input().split()))\n\na, p = [1], [1]\nfor i in range(N):\n a.append(a[i] * 2 + 3)\n p.append(p[i] * 2 + 1)\n\n\ndef f(N, X):\n\n if N == 0:\n if X <= 0:\n return 0\n else:\n return 1\n elif X <= 1 + a[N - 1]:\n return f(N - 1, X - 1)\n else:\n return p[N - 1] + 1 + f(N - 1, X - 2 - a[N - 1])\n\n\nprint((f(N, X)))\n", "fast_code_sha256": "9be3e85bb4f73050fdc51c366f634f667cb8ba526fc7854a141593a5c71a9124", "fast_id": "p03209_efce5c04d3f8c3b603a0f2d9c00b022768186d0b46c0f67e61e6cd9427e306b2", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N, X = list(map(int, input().split()))\n# メモ化するための初期化\na, p = [1], [1]\nfor i in range(N):\n a.append(a[i] * 2 + 3)\n p.append(p[i] * 2 + 1)\n\n\ndef f(N, X):\n # X <= 0 や X > a_N を許容し解説本文から簡略化\n if N == 0:\n if X <= 0:\n return 0\n else:\n return 1\n elif X <= 1 + a[N - 1]:\n return f(N - 1, X - 1)\n else:\n return p[N - 1] + 1 + f(N - 1, X - 2 - a[N - 1])\n\n\nprint((f(N, X)))\n", "measured_fast_code_sha256": "efce5c04d3f8c3b603a0f2d9c00b022768186d0b46c0f67e61e6cd9427e306b2", "measured_slow_code": "N, X = list(map(int, input().split()))\n# 層の総数\nT = [1]\nfor i in range(1, 50 + 1):\n T.append(T[i - 1] * 2 + 3)\n\n\ndef hash(n, x):\n return \"{0:d},{1:d}\".format(n, x)\n\n\n# レベルnバーガーの下からx層内のパティの数\nmemo = dict()\n\n\ndef solve(n, x):\n global T, memo\n if hash(n, x) in memo:\n return memo[hash(n, x)]\n if n == 0 and x >= 1:\n memo[hash(n, x)] = 1\n return 1\n if x <= 1:\n memo[hash(n, x)] = 0\n return 0\n memo[hash(n, x)] = solve(n - 1, min(x - 1, T[n - 1]))\n if x >= T[n - 1] + 2:\n memo[hash(n, x)] += 1\n if x >= T[n - 1] + 3:\n memo[hash(n, x)] += solve(n - 1, min(x - 1 - T[n - 1] - 1, T[n - 1]))\n return memo[hash(n, x)]\n\n\nprint((solve(N, X)))\n", "measured_slow_code_sha256": "d810806da4e3ff396dd2f9e6a8463b4981d8f62dd34c3ba133bb44352184e910", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.275998218567219, "pair_id": "python_v2_131850dfce6106959ac2ed3e", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03209", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03209_efce5c04d3f8c3b603a0f2d9c00b022768186d0b46c0f67e61e6cd9427e306b2.jsonl.gz", "inputs": "reproduction/python/inputs/p03209.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03209_d810806da4e3ff396dd2f9e6a8463b4981d8f62dd34c3ba133bb44352184e910.jsonl.gz"}, "slow_code": "N, X = list(map(int, input().split()))\n\nT = [1]\nfor i in range(1, 50 + 1):\n T.append(T[i - 1] * 2 + 3)\n\n\ndef hash(n, x):\n return \"{0:d},{1:d}\".format(n, x)\n\n\nmemo = dict()\n\n\ndef solve(n, x):\n global T, memo\n if hash(n, x) in memo:\n return memo[hash(n, x)]\n if n == 0 and x >= 1:\n memo[hash(n, x)] = 1\n return 1\n if x <= 1:\n memo[hash(n, x)] = 0\n return 0\n memo[hash(n, x)] = solve(n - 1, min(x - 1, T[n - 1]))\n if x >= T[n - 1] + 2:\n memo[hash(n, x)] += 1\n if x >= T[n - 1] + 3:\n memo[hash(n, x)] += solve(n - 1, min(x - 1 - T[n - 1] - 1, T[n - 1]))\n return memo[hash(n, x)]\n\n\nprint((solve(N, X)))\n", "slow_code_sha256": "dbd3b0158d3748e0d99cec055f9e692949bfea6a1e16dd750ed0447f840bf070", "slow_id": "p03209_d810806da4e3ff396dd2f9e6a8463b4981d8f62dd34c3ba133bb44352184e910", "speedup": 2.9820841177610258, "stratum": "2-4", "within_pair_jaccard": 0.5263157894736842, "workload": {"case_count": 100, "description": "Level-0 burger is one patty. Level L>0 stacks bun, level-(L-1) burger, patty, level-(L-1) burger, bun, from bottom upward. Count patties in the bottom X layers of a level-N burger; the layered object is implicit, not listed. Observed inputs: N=1..50 (median 27.5); X=1..4503599627370493.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 20, "median": 11.0, "min": 4}, "input_format": ["N X"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p02971_case_000", "p02971_case_001", "p02971_case_002", "p02971_case_003", "p02971_case_004", "p02971_case_005", "p02971_case_006", "p02971_case_007", "p02971_case_008", "p02971_case_009", "p02971_case_010", "p02971_case_011", "p02971_case_012", "p02971_case_013", "p02971_case_014", "p02971_case_015", "p02971_case_016", "p02971_case_017", "p02971_case_018", "p02971_case_019", "p02971_case_020", "p02971_case_021", "p02971_case_022", "p02971_case_023", "p02971_case_024", "p02971_case_025", "p02971_case_026", "p02971_case_027", "p02971_case_028", "p02971_case_029", "p02971_case_030", "p02971_case_031", "p02971_case_032", "p02971_case_033", "p02971_case_034", "p02971_case_035", "p02971_case_036", "p02971_case_037", "p02971_case_038", "p02971_case_039", "p02971_case_040", "p02971_case_041", "p02971_case_042", "p02971_case_043", "p02971_case_044", "p02971_case_045", "p02971_case_046", "p02971_case_047", "p02971_case_048", "p02971_case_049", "p02971_case_050", "p02971_case_051", "p02971_case_052", "p02971_case_053", "p02971_case_054", "p02971_case_055", "p02971_case_056", "p02971_case_057", "p02971_case_058", "p02971_case_059", "p02971_case_060", "p02971_case_061", "p02971_case_062", "p02971_case_063", "p02971_case_064", "p02971_case_065", "p02971_case_066", "p02971_case_067", "p02971_case_068", "p02971_case_069", "p02971_case_070", "p02971_case_071", "p02971_case_072", "p02971_case_073", "p02971_case_074", "p02971_case_075", "p02971_case_076", "p02971_case_077", "p02971_case_078", "p02971_case_079", "p02971_case_080", "p02971_case_081", "p02971_case_082", "p02971_case_083", "p02971_case_084", "p02971_case_085", "p02971_case_086", "p02971_case_087", "p02971_case_088", "p02971_case_089", "p02971_case_090", "p02971_case_091", "p02971_case_092", "p02971_case_093", "p02971_case_094", "p02971_case_095", "p02971_case_096", "p02971_case_097", "p02971_case_098", "p02971_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\nread = sys.stdin.read\nreadline = sys.stdin.readline\nreadlines = sys.stdin.readlines\n\n\ndef main():\n N, *A = list(map(int, read().split()))\n A_ = sorted(A)\n m = max(A)\n for a in A:\n if a == m:\n print((A_[-2]))\n else:\n print(m)\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "1c6500df6434b4b516268de2191bc284b12208aa6d004a63137b0accccbd60de", "fast_id": "p02971_1c6500df6434b4b516268de2191bc284b12208aa6d004a63137b0accccbd60de", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\nread = sys.stdin.read\nreadline = sys.stdin.readline\nreadlines = sys.stdin.readlines\n\n\ndef main():\n N, *A = list(map(int, read().split()))\n A_ = sorted(A)\n m = max(A)\n for a in A:\n if a == m:\n print((A_[-2]))\n else:\n print(m)\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "1c6500df6434b4b516268de2191bc284b12208aa6d004a63137b0accccbd60de", "measured_slow_code": "A = [int(eval(input())) for i in range(int(eval(input())))]\nB = sorted(A)\none = B[-1]\ntwo = B[-2]\nfor i in A:\n print((one if i != one else two))\n", "measured_slow_code_sha256": "e1cbade75788fa3b7538fe39880a19cbc511ed2429eaad2cbdc8cdff78f2a1df", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 5.450704838242299, "pair_id": "python_v2_6b89c9c56fc6ac6bbdb6f922", "per_case_slow_code_faster_fraction": 0.03, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02971", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02971_1c6500df6434b4b516268de2191bc284b12208aa6d004a63137b0accccbd60de.jsonl.gz", "inputs": "reproduction/python/inputs/p02971.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02971_e1cbade75788fa3b7538fe39880a19cbc511ed2429eaad2cbdc8cdff78f2a1df.jsonl.gz"}, "slow_code": "A = [int(eval(input())) for i in range(int(eval(input())))]\nB = sorted(A)\none = B[-1]\ntwo = B[-2]\nfor i in A:\n print((one if i != one else two))\n", "slow_code_sha256": "e1cbade75788fa3b7538fe39880a19cbc511ed2429eaad2cbdc8cdff78f2a1df", "slow_id": "p02971_e1cbade75788fa3b7538fe39880a19cbc511ed2429eaad2cbdc8cdff78f2a1df", "speedup": 3.4490827028485165, "stratum": "2-4", "within_pair_jaccard": 0.2571428571428571, "workload": {"case_count": 100, "description": "For each position i of an N-element integer sequence, output the maximum among all other N-1 entries. Equal values at different positions remain separate entries. Observed inputs: N=2..200000 (median 550); A_i=1..200000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1400007, "median": 2604.5, "min": 8}, "input_format": ["N\nA_1\n...\nA_N"], "input_format_status": "source_input_section", "input_lines": {"max": 200001, "median": 551.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200001, "median": 551.0, "min": 3}}} -{"case_ids": ["p02619_case_012", "p02619_case_013", "p02619_case_025", "p02619_case_026", "p02619_case_043", "p02619_case_044", "p02619_case_052", "p02619_case_053", "p02619_case_054", "p02619_case_073", "p02619_case_082", "p02619_case_083", "p02619_case_084", "p02619_case_092", "p02619_case_093", "p02619_v2_a2beef34f549391bcfab", "p02619_v2_d53b9ea5c5792673310a", "p02619_v2_75570918b98373695774", "p02619_v2_381934e3c9fc81ea5d4c", "p02619_v2_3225c49e05d4c20437e8", "p02619_v2_9f23fee4b2e5100bc2a2", "p02619_v2_3800a1516910270b469a", "p02619_v2_d9fa0876b5c6fdeae69e", "p02619_v2_b68f2c1e092b62c538a2", "p02619_v2_73760848946232a8e083", "p02619_v2_d3e4441b330d8b6e7455", "p02619_v2_76ead5910dcc4e2ba1f8", "p02619_v2_2029613353251ee9b7b2", "p02619_v2_2cb134243aa86388d6ba", "p02619_v2_30836e495158435b7b7c", "p02619_v2_339d84622dee7fdc1293", "p02619_v2_d3d5077e7c93e478e065", "p02619_v2_8253b2db731014b88083", "p02619_v2_2177c78f8621448ff155", "p02619_v2_d013df1aba56dc1d54ec", "p02619_v2_64826e27e1f5562b535a", "p02619_v2_9a891e42e9c46b5f3297", "p02619_v2_f1c00f7e95d622403758", "p02619_v2_710d4c5a4c95dcb68dec", "p02619_v2_439934a48b010195dbcd", "p02619_v2_4c37cf7a7dffe9b33f12", "p02619_v2_c8fad05224bc16a1b361", "p02619_v2_94bb7ae7786707cb4819", "p02619_v2_b3aaed51d4273a3ddba7", "p02619_v2_923e8744ad333f07cb64", "p02619_v2_3366f1adb54ecf21860c", "p02619_v2_0b51cc642981f62d0357", "p02619_v2_8e243df56a059b7ad743", "p02619_v2_0a8cb716b509085fe4b0", "p02619_v2_3b76655f387f7cb6d2ab", "p02619_v2_20299f78a75b5a756735", "p02619_v2_35258a2e89d62fc747b7", "p02619_v2_c94c4b9b4349ad6555bc", "p02619_v2_82d82c4a4a2d2183a610", "p02619_v2_d65957a2498629e788ad", "p02619_v2_cd61595422151a528aa5", "p02619_v2_d520c6f8f3f4d009c27c", "p02619_v2_4942ad457c0812fc3998", "p02619_v2_592ad6d8afe1f286b012", "p02619_v2_88f615fd6f0c7cd063e8", "p02619_v2_6679f24e3b7857ca6d32", "p02619_v2_11435a6bd84618d89bc3", "p02619_v2_857222b39e874dca5a4b", "p02619_v2_82dfd729740a78ac73c6", "p02619_v2_d87a4f20bb0c6931f905", "p02619_v2_6a64dbf42d62a65fcc1d", "p02619_v2_babacbd289499ec0ef4d", "p02619_v2_9c068c7f4ca10041380f", "p02619_v2_5532e28a006d07cf62cf", "p02619_v2_e76e422d063bddc50a1f", "p02619_v2_28584da94df0912874ff", "p02619_v2_6ebe44795b5ec9b8e21d", "p02619_v2_c14cae75992aa93e75b8", "p02619_v2_bdce12ee0a07d9d30b58", "p02619_v2_9d1eceea3701f7462f2b", "p02619_v2_97eb955edc648882b88c", "p02619_v2_d105efd93f9223472ed6", "p02619_v2_4348b0c773fc04fab240", "p02619_v2_3a716d97d5adc38425d1", "p02619_v2_ce64eae3a4c1a2d7cc27", "p02619_v2_f9e870aa23e988febc60", "p02619_v2_94937661fb4430a22568", "p02619_v2_557ae170292f4ec040cc", "p02619_v2_8814fdf99bc803fc8e0c", "p02619_v2_9188b3f61f9e38da6bb2", "p02619_v2_746658d85cc29634ceaa", "p02619_v2_f4db407594deac9161c4", "p02619_v2_7202c8c24a6735e3305a", "p02619_v2_87e6dc866c355591194f", "p02619_v2_90793b392e65559b556d", "p02619_v2_8c53e7c0e7cd81f14876", "p02619_v2_ce531317332dfe8af29d", "p02619_v2_54d30225714f808b8394", "p02619_v2_d7591d957a11b4b18a7f", "p02619_v2_753bfc942a0618ae1f4e", "p02619_v2_7da054c5c0df8db3a7fa", "p02619_v2_a96f964491ca5e8c9c0c", "p02619_v2_e5201f8fcebe77f9e4d2", "p02619_v2_ca2955dbd7b011893c5e", "p02619_v2_b271f7c12ae1b71c0287"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from bisect import bisect_left\n\n\nclass score:\n def __init__(self, t) -> None:\n self.t = t\n score = 0\n last = [[] for i in range(26)]\n for i, ti in enumerate(t):\n score += s[i][ti - 1]\n last[ti - 1].append(i + 1)\n for tj in range(26):\n if last[tj - 1] == []:\n score -= c[tj - 1] * (i + 1)\n else:\n\n score -= c[tj - 1] * ((i + 1) - last[tj - 1][-1])\n print(score)\n self.score = score\n\n def a__init__(self, t) -> None:\n score = 0\n last = [[] for i in range(26)]\n for i, ti in enumerate(t):\n\n score += s[i][ti - 1]\n\n if last[ti - 1] == []:\n score -= c[i] * i + 1\n else:\n score -= c[i] * ((i + 1) - last[ti - 1][-1])\n last[ti - 1].append(i + 1)\n print(score)\n for i in range(26):\n if last[i] == []:\n score -= c[i] * D\n else:\n score -= c[i] * (D - last[i][-1])\n self.score = score\n self.t = t\n\n\nD = int(eval(input()))\nc = list(map(int, input().split()))\ns = [list(map(int, input().split())) for i in range(D)]\nt = [int(eval(input())) for i in range(D)]\nsc = score(t)\n", "fast_code_sha256": "be954b079b4b5a55b2496a0b1735485291c687ae2af8175563cad8226c631da2", "fast_id": "p02619_2f96bd212b01a079e750d481cae1f54cc90015865f391be40a4773e7b1588d63", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from bisect import bisect_left\n\n\nclass score:\n def __init__(self, t) -> None:\n self.t = t\n score = 0\n last = [[] for i in range(26)]\n for i, ti in enumerate(t):\n score += s[i][ti - 1]\n last[ti - 1].append(i + 1)\n for tj in range(26):\n if last[tj - 1] == []:\n score -= c[tj - 1] * (i + 1)\n else:\n # print(last)\n score -= c[tj - 1] * ((i + 1) - last[tj - 1][-1])\n print(score)\n self.score = score\n\n def a__init__(self, t) -> None:\n score = 0\n last = [[] for i in range(26)]\n for i, ti in enumerate(t):\n # 開催分を加算\n score += s[i][ti - 1]\n # 減らす\n if last[ti - 1] == []:\n score -= c[i] * i + 1\n else:\n score -= c[i] * ((i + 1) - last[ti - 1][-1])\n last[ti - 1].append(i + 1)\n print(score)\n for i in range(26):\n if last[i] == []:\n score -= c[i] * D\n else:\n score -= c[i] * (D - last[i][-1])\n self.score = score\n self.t = t\n\n\nD = int(eval(input()))\nc = list(map(int, input().split()))\ns = [list(map(int, input().split())) for i in range(D)]\nt = [int(eval(input())) for i in range(D)]\nsc = score(t)\n# print(sc.score)\n", "measured_fast_code_sha256": "2f96bd212b01a079e750d481cae1f54cc90015865f391be40a4773e7b1588d63", "measured_slow_code": "import numpy as np\n\nD = int(eval(input()))\nc = [int(i) for i in input().split()]\ns = []\nfor d in range(D):\n s.append([int(i) for i in input().split()])\nt = []\nfor d in range(D):\n t.append(int(eval(input())) - 1)\nv = [0] * D\nlast = [[0 for i in range(26)] for d in range(D)]\nfor d in range(D):\n if d >= 1:\n last[d] = last[d - 1][:]\n last[d][t[d]] = d + 1\nfor d in range(D):\n v[d] = s[d][t[d]] - sum([c[i] * (d + 1 - last[d][i]) for i in range(26)])\nv_sum = 0\nfor d in range(D):\n v_sum += v[d]\n print(v_sum)\n", "measured_slow_code_sha256": "e06ba4d62ffe23f292e9554193c989e47766a38ef3e00279117101508edbb374", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 9.125928182336981, "pair_id": "python_v2_ba3eec36ebe4a49d252b3a09", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02619", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02619_2f96bd212b01a079e750d481cae1f54cc90015865f391be40a4773e7b1588d63.jsonl.gz", "inputs": "reproduction/python/inputs/p02619.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02619_e06ba4d62ffe23f292e9554193c989e47766a38ef3e00279117101508edbb374.jsonl.gz"}, "slow_code": "import numpy as np\n\nD = int(eval(input()))\nc = [int(i) for i in input().split()]\ns = []\nfor d in range(D):\n s.append([int(i) for i in input().split()])\nt = []\nfor d in range(D):\n t.append(int(eval(input())) - 1)\nv = [0] * D\nlast = [[0 for i in range(26)] for d in range(D)]\nfor d in range(D):\n if d >= 1:\n last[d] = last[d - 1][:]\n last[d][t[d]] = d + 1\nfor d in range(D):\n v[d] = s[d][t[d]] - sum([c[i] * (d + 1 - last[d][i]) for i in range(26)])\nv_sum = 0\nfor d in range(D):\n v_sum += v[d]\n print(v_sum)\n", "slow_code_sha256": "e06ba4d62ffe23f292e9554193c989e47766a38ef3e00279117101508edbb374", "slow_id": "p02619_e06ba4d62ffe23f292e9554193c989e47766a38ef3e00279117101508edbb374", "speedup": 9.143497257187404, "stratum": "8+", "within_pair_jaccard": 0.45454545454545453, "workload": {"case_count": 100, "description": "For a fixed schedule t_d of 26 contest types, output daily cumulative satisfaction, initially zero. On day d add s_d,t_d, then subtract sum_i c_i*(d-last_i), where last_i is the latest day of type i, or 0 if never held. Observed inputs: D=365; c_i=0..100; s_d_i=0..20000; t_d=1..26.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 57778, "median": 20062.0, "min": 19985}, "input_format": ["D\nc_1 ... c_26\ns_1,1 ... s_1,26\n...\ns_D,1 ... s_D,26\nt_1\n...\nt_D"], "input_format_status": "source_input_section", "input_lines": {"max": 732, "median": 732.0, "min": 732}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 9882, "median": 9882.0, "min": 9882}}} -{"case_ids": ["p03738_case_000", "p03738_case_001", "p03738_case_002", "p03738_case_003", "p03738_case_004", "p03738_case_005", "p03738_case_006", "p03738_case_007", "p03738_case_008", "p03738_case_009", "p03738_case_010", "p03738_case_011", "p03738_case_012", "p03738_case_013", "p03738_case_014", "p03738_case_015", "p03738_case_016", "p03738_case_017", "p03738_case_018", "p03738_case_019", "p03738_case_020", "p03738_case_021", "p03738_case_022", "p03738_case_023", "p03738_case_024", "p03738_case_025", "p03738_case_026", "p03738_case_027", "p03738_case_028", "p03738_case_029", "p03738_case_030", "p03738_case_031", "p03738_case_032", "p03738_case_033", "p03738_case_034", "p03738_case_035", "p03738_case_036", "p03738_case_037", "p03738_case_038", "p03738_case_039", "p03738_case_040", "p03738_case_041", "p03738_case_042", "p03738_case_043", "p03738_case_044", "p03738_case_045", "p03738_case_046", "p03738_case_047", "p03738_case_048", "p03738_case_049", "p03738_case_050", "p03738_case_051", "p03738_case_052", "p03738_case_053", "p03738_case_054", "p03738_case_055", "p03738_case_056", "p03738_case_057", "p03738_case_058", "p03738_case_059", "p03738_case_060", "p03738_case_061", "p03738_case_062", "p03738_case_063", "p03738_case_064", "p03738_case_065", "p03738_case_066", "p03738_case_067", "p03738_case_068", "p03738_case_069", "p03738_case_070", "p03738_case_071", "p03738_case_072", "p03738_case_073", "p03738_case_074", "p03738_case_075", "p03738_case_076", "p03738_case_077", "p03738_case_078", "p03738_case_079", "p03738_case_080", "p03738_case_081", "p03738_case_082", "p03738_case_083", "p03738_case_084", "p03738_case_085", "p03738_case_086", "p03738_case_087", "p03738_case_088", "p03738_case_089", "p03738_case_090", "p03738_case_091", "p03738_case_092", "p03738_case_093", "p03738_case_094", "p03738_case_095", "p03738_case_096", "p03738_case_097", "p03738_case_098", "p03738_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "if __name__ == \"__main__\":\n a = int(input())\n b = int(input())\n if a > b:\n print(\"GREATER\")\n elif a < b:\n print(\"LESS\")\n elif a == b:\n print(\"EQUAL\")\n", "fast_code_sha256": "a76952c0490cecb3a81db9aa49c26a3e2cd00b2ef42087d8a13e6706056a796b", "fast_id": "p03738_62827c412864c307a027da23261683b2eca9679fbb0002bba4b256667c85d072", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "# coding:utf-8\nif __name__ == \"__main__\":\n a = int(input())\n b = int(input())\n if a > b:\n print(\"GREATER\")\n elif a < b:\n print(\"LESS\")\n elif a == b:\n print(\"EQUAL\")\n", "measured_fast_code_sha256": "62827c412864c307a027da23261683b2eca9679fbb0002bba4b256667c85d072", "measured_slow_code": "# coding:utf-8\nimport math\n\nif __name__ == \"__main__\":\n a = input()\n b = input()\n if len(a) > len(b):\n print(\"GREATER\")\n elif len(a) < len(b):\n print(\"LESS\")\n elif len(a) == len(b):\n for i in range(len(a)):\n if a[i] > b[i]:\n print(\"GREATER\")\n break\n elif a[i] < b[i]:\n print(\"LESS\")\n break\n elif a[i] == b[i] and i == len(a) - 1:\n print(\"EQUAL\")\n", "measured_slow_code_sha256": "d5baa6a15a1c4a76633ab38a051360a64a827577b6553480f73b85ef4ead3a15", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.1430382188642305, "pair_id": "python_v2_c8f2881ce6721c3c0d236162", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03738", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03738_62827c412864c307a027da23261683b2eca9679fbb0002bba4b256667c85d072.jsonl.gz", "inputs": "reproduction/python/inputs/p03738.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03738_d5baa6a15a1c4a76633ab38a051360a64a827577b6553480f73b85ef4ead3a15.jsonl.gz"}, "slow_code": "import math\n\nif __name__ == \"__main__\":\n a = input()\n b = input()\n if len(a) > len(b):\n print(\"GREATER\")\n elif len(a) < len(b):\n print(\"LESS\")\n elif len(a) == len(b):\n for i in range(len(a)):\n if a[i] > b[i]:\n print(\"GREATER\")\n break\n elif a[i] < b[i]:\n print(\"LESS\")\n break\n elif a[i] == b[i] and i == len(a) - 1:\n print(\"EQUAL\")\n", "slow_code_sha256": "51f72b7576f2a6693b915f49f43199e2cd6155a4ebab55cc493d3b8dd74e88d8", "slow_id": "p03738_d5baa6a15a1c4a76633ab38a051360a64a827577b6553480f73b85ef4ead3a15", "speedup": 2.2034598652181705, "stratum": "2-4", "within_pair_jaccard": 0.5, "workload": {"case_count": 100, "description": "Compare positive decimal integers A and B and report greater, less, or equal. Neither representation has leading zeros; numbers may exceed machine integer sizes. Observed inputs: A_digits=1..100 (median 7); B_digits=1..100 (median 7).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 202, "median": 18.0, "min": 4}, "input_format": ["A\nB"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p03006_case_000", "p03006_case_001", "p03006_case_002", "p03006_case_003", "p03006_case_004", "p03006_case_005", "p03006_case_006", "p03006_case_007", "p03006_case_008", "p03006_case_009", "p03006_case_010", "p03006_case_011", "p03006_case_012", "p03006_case_013", "p03006_case_014", "p03006_case_015", "p03006_case_016", "p03006_case_017", "p03006_case_018", "p03006_case_019", "p03006_case_020", "p03006_case_021", "p03006_case_022", "p03006_case_023", "p03006_case_024", "p03006_case_025", "p03006_case_026", "p03006_case_027", "p03006_case_028", "p03006_case_029", "p03006_case_030", "p03006_case_031", "p03006_case_032", "p03006_case_033", "p03006_case_034", "p03006_case_035", "p03006_case_036", "p03006_case_037", "p03006_case_038", "p03006_case_039", "p03006_case_040", "p03006_case_041", "p03006_case_042", "p03006_case_043", "p03006_case_044", "p03006_case_045", "p03006_case_046", "p03006_case_047", "p03006_case_048", "p03006_case_049", "p03006_case_050", "p03006_case_051", "p03006_case_052", "p03006_case_053", "p03006_case_054", "p03006_case_055", "p03006_case_056", "p03006_case_057", "p03006_case_058", "p03006_case_059", "p03006_case_060", "p03006_case_061", "p03006_case_062", "p03006_case_063", "p03006_case_064", "p03006_case_065", "p03006_case_066", "p03006_case_067", "p03006_case_068", "p03006_case_069", "p03006_case_070", "p03006_case_071", "p03006_case_072", "p03006_case_073", "p03006_case_074", "p03006_case_075", "p03006_case_076", "p03006_case_077", "p03006_case_078", "p03006_case_079", "p03006_case_080", "p03006_case_081", "p03006_case_082", "p03006_case_083", "p03006_case_084", "p03006_case_085", "p03006_case_086", "p03006_case_087", "p03006_case_088", "p03006_case_089", "p03006_case_090", "p03006_case_091", "p03006_case_092", "p03006_case_093", "p03006_case_094", "p03006_case_095", "p03006_case_096", "p03006_case_097", "p03006_case_098", "p03006_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\narr = sorted([list(map(int, input().rstrip().split())) for _ in range(n)])\ncnt = {}\nfor i, j in arr:\n for k, l in arr:\n if (i, j) == (k, l):\n continue\n dif = (k - i, l - j)\n cnt.setdefault(dif, 0)\n cnt[dif] += 1\nprint((n - max(list(cnt.values()), default=0)))\n", "fast_code_sha256": "1796b3dd56792d24729b3767f68becf643f395739fe613fb028da3c5eba51573", "fast_id": "p03006_1796b3dd56792d24729b3767f68becf643f395739fe613fb028da3c5eba51573", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\narr = sorted([list(map(int, input().rstrip().split())) for _ in range(n)])\ncnt = {}\nfor i, j in arr:\n for k, l in arr:\n if (i, j) == (k, l):\n continue\n dif = (k - i, l - j)\n cnt.setdefault(dif, 0)\n cnt[dif] += 1\nprint((n - max(list(cnt.values()), default=0)))\n", "measured_fast_code_sha256": "1796b3dd56792d24729b3767f68becf643f395739fe613fb028da3c5eba51573", "measured_slow_code": "from math import (\n ceil,\n floor,\n factorial,\n gcd,\n sqrt,\n log2,\n cos,\n sin,\n tan,\n acos,\n asin,\n atan,\n degrees,\n radians,\n pi,\n inf,\n)\nfrom itertools import (\n accumulate,\n groupby,\n permutations,\n combinations,\n product,\n combinations_with_replacement,\n)\nfrom collections import deque, defaultdict, Counter\nfrom bisect import bisect_left, bisect_right\nfrom operator import itemgetter\nfrom heapq import heapify, heappop, heappush\nfrom queue import Queue, LifoQueue, PriorityQueue\nfrom copy import deepcopy\nfrom time import time\nimport string\nimport sys\n\nsys.setrecursionlimit(10**7)\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef INT():\n return int(eval(input()))\n\n\ndef MAP():\n return list(map(int, input().split()))\n\n\ndef LIST():\n return list(MAP())\n\n\nn = INT()\nx = [LIST() for i in range(n)]\na = []\nfor i in range(n):\n for j in range(n):\n if i != j:\n a.append((x[j][0] - x[i][0], x[j][1] - x[i][1]))\na.sort()\ncount = 1\nreg = 1\nfor i in range(1, len(a)):\n if a[i][:] == a[i - 1][:]:\n count += 1\n reg = max(reg, count)\n else:\n count = 1\nif n == 1:\n ans = n\nelse:\n ans = n - reg\nprint(ans)\n", "measured_slow_code_sha256": "df539d82cce0b66ac388cb7626c1915f078dadd19fd45e23838905782b69fa8f", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4.033828787934707, "pair_id": "python_v2_275c1f268162555a0b341973", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03006", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03006_1796b3dd56792d24729b3767f68becf643f395739fe613fb028da3c5eba51573.jsonl.gz", "inputs": "reproduction/python/inputs/p03006.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03006_df539d82cce0b66ac388cb7626c1915f078dadd19fd45e23838905782b69fa8f.jsonl.gz"}, "slow_code": "from math import (\n ceil,\n floor,\n factorial,\n gcd,\n sqrt,\n log2,\n cos,\n sin,\n tan,\n acos,\n asin,\n atan,\n degrees,\n radians,\n pi,\n inf,\n)\nfrom itertools import (\n accumulate,\n groupby,\n permutations,\n combinations,\n product,\n combinations_with_replacement,\n)\nfrom collections import deque, defaultdict, Counter\nfrom bisect import bisect_left, bisect_right\nfrom operator import itemgetter\nfrom heapq import heapify, heappop, heappush\nfrom queue import Queue, LifoQueue, PriorityQueue\nfrom copy import deepcopy\nfrom time import time\nimport string\nimport sys\n\nsys.setrecursionlimit(10**7)\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef INT():\n return int(eval(input()))\n\n\ndef MAP():\n return list(map(int, input().split()))\n\n\ndef LIST():\n return list(MAP())\n\n\nn = INT()\nx = [LIST() for i in range(n)]\na = []\nfor i in range(n):\n for j in range(n):\n if i != j:\n a.append((x[j][0] - x[i][0], x[j][1] - x[i][1]))\na.sort()\ncount = 1\nreg = 1\nfor i in range(1, len(a)):\n if a[i][:] == a[i - 1][:]:\n count += 1\n reg = max(reg, count)\n else:\n count = 1\nif n == 1:\n ans = n\nelse:\n ans = n - reg\nprint(ans)\n", "slow_code_sha256": "df539d82cce0b66ac388cb7626c1915f078dadd19fd45e23838905782b69fa8f", "slow_id": "p03006_df539d82cce0b66ac388cb7626c1915f078dadd19fd45e23838905782b69fa8f", "speedup": 5.017240743168869, "stratum": "4-8", "within_pair_jaccard": 0.17525773195876287, "workload": {"case_count": 100, "description": "Collect N distinct plane points in any order, choosing one fixed nonzero integer displacement (p,q). A collection costs 0 if its point equals the previously collected point plus (p,q), otherwise 1, including the first. Minimize total cost. Observed inputs: N=1..50 (median 20); x_i=-999595444..998135854; y_i=-998893103..992792936.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1075, "median": 402.5, "min": 23}, "input_format": ["N\nx_1 y_1\n...\nx_N y_N"], "input_format_status": "source_input_section", "input_lines": {"max": 51, "median": 21.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 101, "median": 41.0, "min": 3}}} -{"case_ids": ["p00219_case_000", "p00219_case_001", "p00219_case_002", "p00219_case_003", "p00219_case_004", "p00219_case_005", "p00219_case_006", "p00219_case_007", "p00219_case_008", "p00219_case_009", "p00219_case_010", "p00219_case_011", "p00219_case_012", "p00219_case_013", "p00219_case_014", "p00219_case_015", "p00219_case_016", "p00219_case_017", "p00219_case_018", "p00219_case_019", "p00219_case_020", "p00219_case_021", "p00219_case_022", "p00219_case_023", "p00219_case_024", "p00219_case_025", "p00219_case_026", "p00219_case_027", "p00219_case_028", "p00219_case_029", "p00219_case_030", "p00219_case_031", "p00219_case_032", "p00219_case_033", "p00219_case_034", "p00219_case_035", "p00219_case_036", "p00219_case_037", "p00219_case_038", "p00219_case_039", "p00219_case_040", "p00219_case_041", "p00219_case_042", "p00219_case_043", "p00219_case_044", "p00219_case_045", "p00219_case_046", "p00219_case_047", "p00219_case_048", "p00219_case_049", "p00219_case_050", "p00219_case_051", "p00219_case_052", "p00219_case_053", "p00219_case_054", "p00219_case_055", "p00219_case_056", "p00219_case_057", "p00219_case_058", "p00219_case_059", "p00219_case_060", "p00219_case_061", "p00219_case_062", "p00219_case_063", "p00219_case_064", "p00219_case_065", "p00219_case_066", "p00219_case_067", "p00219_case_068", "p00219_case_069", "p00219_case_070", "p00219_case_071", "p00219_case_072", "p00219_case_073", "p00219_case_074", "p00219_case_075", "p00219_case_076", "p00219_case_077", "p00219_case_078", "p00219_case_079", "p00219_case_080", "p00219_case_081", "p00219_case_082", "p00219_case_083", "p00219_case_084", "p00219_case_085", "p00219_case_086", "p00219_case_087", "p00219_case_088", "p00219_case_089", "p00219_case_090", "p00219_case_091", "p00219_case_092", "p00219_case_093", "p00219_case_094", "p00219_case_095", "p00219_case_096", "p00219_case_097", "p00219_case_098", "p00219_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "while 1:\n n = eval(input())\n if n == 0:\n break\n h = [0] * 10\n for i in range(n):\n h[int(input())] += 1\n for i in range(10):\n print(\"*\" * h[i] if h[i] else \"-\")\n", "fast_code_sha256": "609e346782ecf49c23ca5198c907b710c087fbc5b7bd73f09ea7653abfa5c4cb", "fast_id": "p00219_609e346782ecf49c23ca5198c907b710c087fbc5b7bd73f09ea7653abfa5c4cb", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "while 1:\n n = eval(input())\n if n == 0:\n break\n h = [0] * 10\n for i in range(n):\n h[int(input())] += 1\n for i in range(10):\n print(\"*\" * h[i] if h[i] else \"-\")\n", "measured_fast_code_sha256": "609e346782ecf49c23ca5198c907b710c087fbc5b7bd73f09ea7653abfa5c4cb", "measured_slow_code": "while True:\n n = int(eval(input()))\n if n == 0:\n break\n ice = [int(eval(input())) for _ in range(n)]\n for i in range(10):\n nums = ice.count(i)\n print((\"*\" * nums + \"-\" * (nums == 0)))\n", "measured_slow_code_sha256": "98dac8dc4a897a685a224532a3556d581f697beacd3e665b34a89648b52695da", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4.859323014026819, "pair_id": "python_v2_eb18776c92ae3644c3363e57", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p00219", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p00219_609e346782ecf49c23ca5198c907b710c087fbc5b7bd73f09ea7653abfa5c4cb.jsonl.gz", "inputs": "reproduction/python/inputs/p00219.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p00219_98dac8dc4a897a685a224532a3556d581f697beacd3e665b34a89648b52695da.jsonl.gz"}, "slow_code": "while True:\n n = int(eval(input()))\n if n == 0:\n break\n ice = [int(eval(input())) for _ in range(n)]\n for i in range(10):\n nums = ice.count(i)\n print((\"*\" * nums + \"-\" * (nums == 0)))\n", "slow_code_sha256": "98dac8dc4a897a685a224532a3556d581f697beacd3e665b34a89648b52695da", "slow_id": "p00219_98dac8dc4a897a685a224532a3556d581f697beacd3e665b34a89648b52695da", "speedup": 3.9318795241623765, "stratum": "2-4", "within_pair_jaccard": 0.6363636363636364, "workload": {"case_count": 100, "description": "For each dataset of sold item types c_i in 0..9, print a frequency histogram in type order: one asterisk per occurrence, or a hyphen for zero occurrences. Each dataset declares n; a final zero in place of n ends input. Observed inputs: datasets=1..15 (median 1); n=1..10000; total_records=1..113926 (median 10000); c_i=0..9.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 227929, "median": 20008.0, "min": 6}, "input_format": ["n_1\nc_1\n...\nc_(n_1)\n[next datasets]\n0"], "input_format_status": "source_input_section", "input_lines": {"max": 113942, "median": 10002.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 113942, "median": 10002.0, "min": 3}}} -{"case_ids": ["p02956_case_000", "p02956_case_001", "p02956_case_002", "p02956_case_003", "p02956_case_004", "p02956_case_005", "p02956_case_006", "p02956_case_007", "p02956_case_008", "p02956_case_009", "p02956_case_010", "p02956_case_011", "p02956_case_012", "p02956_case_013", "p02956_case_014", "p02956_case_015", "p02956_case_016", "p02956_case_017", "p02956_case_018", "p02956_case_019", "p02956_case_020", "p02956_case_021", "p02956_case_022", "p02956_case_023", "p02956_case_024", "p02956_case_025", "p02956_case_026", "p02956_case_027", "p02956_case_028", "p02956_case_029", "p02956_case_030", "p02956_case_031", "p02956_case_032", "p02956_case_033", "p02956_case_034", "p02956_case_035", "p02956_case_036", "p02956_case_037", "p02956_case_038", "p02956_case_039", "p02956_case_040", "p02956_case_041", "p02956_case_042", "p02956_case_043", "p02956_case_044", "p02956_case_045", "p02956_case_046", "p02956_case_047", "p02956_case_048", "p02956_case_049", "p02956_case_050", "p02956_case_051", "p02956_case_052", "p02956_case_053", "p02956_case_054", "p02956_case_055", "p02956_case_056", "p02956_case_057", "p02956_case_058", "p02956_case_059", "p02956_case_060", "p02956_case_061", "p02956_case_062", "p02956_case_063", "p02956_case_064", "p02956_case_065", "p02956_case_066", "p02956_case_067", "p02956_case_068", "p02956_case_069", "p02956_case_070", "p02956_case_071", "p02956_case_072", "p02956_case_073", "p02956_case_074", "p02956_case_075", "p02956_case_076", "p02956_case_077", "p02956_case_078", "p02956_case_079", "p02956_case_080", "p02956_case_081", "p02956_case_082", "p02956_case_083", "p02956_case_084", "p02956_case_085", "p02956_case_086", "p02956_case_087", "p02956_case_088", "p02956_case_089", "p02956_case_090", "p02956_case_091", "p02956_case_092", "p02956_case_093", "p02956_case_094", "p02956_case_095", "p02956_case_096", "p02956_case_097", "p02956_case_098", "p02956_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\ninput = sys.stdin.readline\nsys.setrecursionlimit(10**7)\nMOD = 998244353\nN = int(eval(input()))\nXY = [[int(x) for x in input().split()] for _ in range(N)]\nXY.sort()\nX, Y = list(zip(*XY))\nY_rank = {x: i for i, x in enumerate(sorted(Y), 1)}\n\n\ndef BIT_update(tree, x):\n while x <= N:\n tree[x] += 1\n x += x & (-x)\n\n\ndef BIT_sum(tree, x):\n ret = 0\n while x:\n ret += tree[x]\n x -= x & (-x)\n return ret\n\n\npow2 = [1]\nfor _ in range(N):\n pow2.append(pow2[-1] * 2 % MOD)\nanswer = 0\ntree = [0] * (N + 1)\nfor L, (x, y) in enumerate(XY):\n y = Y_rank[y]\n R = N - 1 - L\n D = y - 1\n U = N - 1 - D\n LD = BIT_sum(tree, y)\n BIT_update(tree, y)\n LU = L - LD\n RD = D - LD\n RU = R - RD\n\n cnt = pow2[N]\n cnt -= pow2[L]\n cnt -= pow2[R]\n cnt -= pow2[D]\n cnt -= pow2[U]\n cnt += pow2[LD]\n cnt += pow2[LU]\n cnt += pow2[RD]\n cnt += pow2[RU]\n cnt -= 1\n answer += cnt\nanswer %= MOD\nprint(answer)\n", "fast_code_sha256": "20fe085db322ba70d10e68f89404750173ced5521fd05b3ed343af82cc95a436", "fast_id": "p02956_98847dc745804ffedc68345a7f72ee0f29ec77de07b77102351ea8d26538f18c", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\ninput = sys.stdin.readline\nsys.setrecursionlimit(10**7)\nMOD = 998244353\nN = int(eval(input()))\nXY = [[int(x) for x in input().split()] for _ in range(N)]\nXY.sort() # X ascending\nX, Y = list(zip(*XY))\nY_rank = {x: i for i, x in enumerate(sorted(Y), 1)}\n\n\ndef BIT_update(tree, x):\n while x <= N:\n tree[x] += 1\n x += x & (-x)\n\n\ndef BIT_sum(tree, x):\n ret = 0\n while x:\n ret += tree[x]\n x -= x & (-x)\n return ret\n\n\npow2 = [1]\nfor _ in range(N):\n pow2.append(pow2[-1] * 2 % MOD)\nanswer = 0\ntree = [0] * (N + 1)\nfor L, (x, y) in enumerate(XY):\n y = Y_rank[y]\n R = N - 1 - L\n D = y - 1\n U = N - 1 - D\n LD = BIT_sum(tree, y)\n BIT_update(tree, y)\n LU = L - LD\n RD = D - LD\n RU = R - RD\n # bounding box が自分自身を含むような集合を数える\n # 全体から引く\n cnt = pow2[N]\n cnt -= pow2[L]\n cnt -= pow2[R]\n cnt -= pow2[D]\n cnt -= pow2[U]\n cnt += pow2[LD]\n cnt += pow2[LU]\n cnt += pow2[RD]\n cnt += pow2[RU]\n cnt -= 1\n answer += cnt\nanswer %= MOD\nprint(answer)\n", "measured_fast_code_sha256": "98847dc745804ffedc68345a7f72ee0f29ec77de07b77102351ea8d26538f18c", "measured_slow_code": "import sys\n\nreadline = sys.stdin.readline\n\n\nclass BIT:\n # 1-indexed\n def __init__(self, n):\n self.size = n\n self.tree = [0] * (n + 1)\n self.p = 2 ** (n.bit_length() - 1)\n self.dep = n.bit_length()\n\n def get(self, i):\n s = 0\n while i > 0:\n s += self.tree[i]\n i -= i & -i\n return s\n\n def add(self, i, x):\n while i <= self.size:\n self.tree[i] += x\n i += i & -i\n\n def bl(self, v):\n if v <= 0:\n return -1\n s = 0\n k = self.p\n for _ in range(self.dep):\n if s + k <= self.size and self.tree[s + k] < v:\n s += k\n v -= self.tree[s + k]\n k //= 2\n return s + 1\n\n\ndef compress(L):\n L2 = list(set(L))\n L2.sort()\n C = {v: k for k, v in enumerate(L2)}\n return L2, C\n\n\nMOD = 998244353\nN = int(readline())\nXY = [list(map(int, readline().split())) for _ in range(N)]\nXY.sort()\nZ = [-(10**10)]\nfor x, y in XY:\n Z.append(y)\n_, CC = compress(Z)\nXY = [(x, CC[y]) for x, y in XY]\nSS, SB, BS, BB = [None] * N, [None] * N, [None] * N, [None] * N\nT = BIT(N)\nfor i in range(N):\n k = i\n y = XY[i][1]\n l = T.get(y)\n SS[i] = l\n SB[i] = k - l\n T.add(y, 1)\nT = BIT(N)\nfor i in range(N - 1, -1, -1):\n k = N - 1 - i\n y = XY[i][1]\n l = T.get(y)\n BS[i] = l\n BB[i] = k - l\n T.add(y, 1)\nP2 = [1] * 1341398\nfor i in range(1, len(P2)):\n P2[i] = P2[i - 1] * 2 % MOD\nans = 0\nfor i in range(N):\n ss = SS[i]\n sb = SB[i]\n bs = BS[i]\n bb = BB[i]\n ans = (ans + P2[N - 1]) % MOD\n ans = (ans + P2[N - 1 - ss - bb] * (P2[ss] - 1) * (P2[bb] - 1)) % MOD\n ans = (ans + P2[N - 1 - sb - bs] * (P2[sb] - 1) * (P2[bs] - 1)) % MOD\n ans = (ans - (P2[sb] - 1) * (P2[bs] - 1) * (P2[ss] - 1) * (P2[bb] - 1)) % MOD\nprint(ans)\n", "measured_slow_code_sha256": "8042986ea709f7be4a36940bb65dd281b3740a58e66e7c9edcc0eeee56205242", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 64.27199006951602, "pair_id": "python_v2_1ab932d60d001f2611c81278", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02956", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02956_98847dc745804ffedc68345a7f72ee0f29ec77de07b77102351ea8d26538f18c.jsonl.gz", "inputs": "reproduction/python/inputs/p02956.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02956_8042986ea709f7be4a36940bb65dd281b3740a58e66e7c9edcc0eeee56205242.jsonl.gz"}, "slow_code": "import sys\n\nreadline = sys.stdin.readline\n\n\nclass BIT:\n\n def __init__(self, n):\n self.size = n\n self.tree = [0] * (n + 1)\n self.p = 2 ** (n.bit_length() - 1)\n self.dep = n.bit_length()\n\n def get(self, i):\n s = 0\n while i > 0:\n s += self.tree[i]\n i -= i & -i\n return s\n\n def add(self, i, x):\n while i <= self.size:\n self.tree[i] += x\n i += i & -i\n\n def bl(self, v):\n if v <= 0:\n return -1\n s = 0\n k = self.p\n for _ in range(self.dep):\n if s + k <= self.size and self.tree[s + k] < v:\n s += k\n v -= self.tree[s + k]\n k //= 2\n return s + 1\n\n\ndef compress(L):\n L2 = list(set(L))\n L2.sort()\n C = {v: k for k, v in enumerate(L2)}\n return L2, C\n\n\nMOD = 998244353\nN = int(readline())\nXY = [list(map(int, readline().split())) for _ in range(N)]\nXY.sort()\nZ = [-(10**10)]\nfor x, y in XY:\n Z.append(y)\n_, CC = compress(Z)\nXY = [(x, CC[y]) for x, y in XY]\nSS, SB, BS, BB = [None] * N, [None] * N, [None] * N, [None] * N\nT = BIT(N)\nfor i in range(N):\n k = i\n y = XY[i][1]\n l = T.get(y)\n SS[i] = l\n SB[i] = k - l\n T.add(y, 1)\nT = BIT(N)\nfor i in range(N - 1, -1, -1):\n k = N - 1 - i\n y = XY[i][1]\n l = T.get(y)\n BS[i] = l\n BB[i] = k - l\n T.add(y, 1)\nP2 = [1] * 1341398\nfor i in range(1, len(P2)):\n P2[i] = P2[i - 1] * 2 % MOD\nans = 0\nfor i in range(N):\n ss = SS[i]\n sb = SB[i]\n bs = BS[i]\n bb = BB[i]\n ans = (ans + P2[N - 1]) % MOD\n ans = (ans + P2[N - 1 - ss - bb] * (P2[ss] - 1) * (P2[bb] - 1)) % MOD\n ans = (ans + P2[N - 1 - sb - bs] * (P2[sb] - 1) * (P2[bs] - 1)) % MOD\n ans = (ans - (P2[sb] - 1) * (P2[bs] - 1) * (P2[ss] - 1) * (P2[bb] - 1)) % MOD\nprint(ans)\n", "slow_code_sha256": "e43f92f24f0e96eef9c4232af95007e4efdc9b0608e734256316ff5cc0636981", "slow_id": "p02956_8042986ea709f7be4a36940bb65dd281b3740a58e66e7c9edcc0eeee56205242", "speedup": 78.17911442738466, "stratum": "8+", "within_pair_jaccard": 0.33695652173913043, "workload": {"case_count": 100, "description": "For each nonempty subset of N plane points, count all original points in its smallest axis-aligned bounding rectangle, including boundaries. Sum these counts modulo 998244353. All x coordinates are distinct, as are all y coordinates. Observed inputs: N=1..200000 (median 1000); x_i=-1000000000..1000000000; y_i=-1000000000..999999000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 4200009, "median": 20809.0, "min": 20}, "input_format": ["N\nx_1 y_1\n...\nx_N y_N"], "input_format_status": "source_input_section", "input_lines": {"max": 200001, "median": 1001.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 400001, "median": 2001.0, "min": 3}}} -{"case_ids": ["p03077_case_000", "p03077_case_001", "p03077_case_002", "p03077_case_003", "p03077_case_004", "p03077_case_005", "p03077_case_006", "p03077_case_007", "p03077_case_008", "p03077_case_009", "p03077_case_010", "p03077_case_011", "p03077_case_012", "p03077_case_013", "p03077_case_014", "p03077_case_015", "p03077_case_016", "p03077_case_017", "p03077_case_018", "p03077_case_019", "p03077_case_020", "p03077_case_021", "p03077_case_022", "p03077_case_023", "p03077_case_024", "p03077_case_025", "p03077_case_026", "p03077_case_027", "p03077_case_028", "p03077_case_029", "p03077_case_030", "p03077_case_031", "p03077_case_032", "p03077_case_033", "p03077_case_034", "p03077_case_035", "p03077_case_036", "p03077_case_037", "p03077_case_038", "p03077_case_039", "p03077_case_040", "p03077_case_041", "p03077_case_042", "p03077_case_043", "p03077_case_044", "p03077_case_045", "p03077_case_046", "p03077_case_047", "p03077_case_048", "p03077_case_049", "p03077_case_050", "p03077_case_051", "p03077_case_052", "p03077_case_053", "p03077_case_054", "p03077_case_055", "p03077_case_056", "p03077_case_057", "p03077_case_058", "p03077_case_059", "p03077_case_060", "p03077_case_061", "p03077_case_062", "p03077_case_063", "p03077_case_064", "p03077_case_065", "p03077_case_066", "p03077_case_067", "p03077_case_068", "p03077_case_069", "p03077_case_070", "p03077_case_071", "p03077_case_072", "p03077_case_073", "p03077_case_074", "p03077_case_075", "p03077_case_076", "p03077_case_077", "p03077_case_078", "p03077_case_079", "p03077_case_080", "p03077_case_081", "p03077_case_082", "p03077_case_083", "p03077_case_084", "p03077_case_085", "p03077_case_086", "p03077_case_087", "p03077_case_088", "p03077_case_089", "p03077_case_090", "p03077_case_091", "p03077_case_092", "p03077_case_093", "p03077_case_094", "p03077_case_095", "p03077_case_096", "p03077_case_097", "p03077_case_098", "p03077_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N = int(eval(input()))\nA = [int(eval(input())) for _ in range(5)]\na = min(A)\nn = N // a\nif N % a > 0:\n n += 1\nprint((5 + n - 1))\n", "fast_code_sha256": "6a550eb4a0eb047dc36e37af0e862962c3727aa138f3a251bc9ddbf41f5f95ff", "fast_id": "p03077_6a550eb4a0eb047dc36e37af0e862962c3727aa138f3a251bc9ddbf41f5f95ff", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N = int(eval(input()))\nA = [int(eval(input())) for _ in range(5)]\na = min(A)\nn = N // a\nif N % a > 0:\n n += 1\nprint((5 + n - 1))\n", "measured_fast_code_sha256": "6a550eb4a0eb047dc36e37af0e862962c3727aa138f3a251bc9ddbf41f5f95ff", "measured_slow_code": "# -*- coding: utf-8 -*-\nimport sys\nimport numpy as np\n\n\ndef get_num():\n return int(eval(input()))\n\n\ndef get_nums(n):\n res = [0 for _ in range(n)]\n for i in range(n):\n res[i] = int(eval(input()))\n return res\n\n\ndef get_numbers():\n return list(map(int, input().split()))\n\n\nn = get_num()\ncosts = get_nums(5)\nmax_time = 0\nfor cost in costs:\n max_time = max(max_time, int(np.ceil(n / cost)))\nprint((max_time + 4))\n", "measured_slow_code_sha256": "34caf7325f4819bd719f1f977d4c7833f1b8eae1073783274c70d879e08aa59a", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 777.3814965392789, "pair_id": "python_v2_7fb0ae18a77158979ef3c59e", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03077", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03077_6a550eb4a0eb047dc36e37af0e862962c3727aa138f3a251bc9ddbf41f5f95ff.jsonl.gz", "inputs": "reproduction/python/inputs/p03077.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03077_34caf7325f4819bd719f1f977d4c7833f1b8eae1073783274c70d879e08aa59a.jsonl.gz"}, "slow_code": "import sys\nimport numpy as np\n\n\ndef get_num():\n return int(eval(input()))\n\n\ndef get_nums(n):\n res = [0 for _ in range(n)]\n for i in range(n):\n res[i] = int(eval(input()))\n return res\n\n\ndef get_numbers():\n return list(map(int, input().split()))\n\n\nn = get_num()\ncosts = get_nums(5)\nmax_time = 0\nfor cost in costs:\n max_time = max(max_time, int(np.ceil(n / cost)))\nprint((max_time + 4))\n", "slow_code_sha256": "ab58e9cb16ab933309b0c60e055e71406d283b0d16126adf763de4e9caa5d6fb", "slow_id": "p03077_34caf7325f4819bd719f1f977d4c7833f1b8eae1073783274c70d879e08aa59a", "speedup": 777.445491409187, "stratum": "8+", "within_pair_jaccard": 0.2894736842105263, "workload": {"case_count": 100, "description": "Move N people through five successive transport links with capacities A,B,C,D,E. Each link takes one minute and dispatches one vehicle at every integer time starting at 0; transfers take no time. Find when everyone can arrive. Observed inputs: N=1..1000000000000000; capacities=1..1000000000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 102, "median": 82.0, "min": 12}, "input_format": ["N\nA\nB\nC\nD\nE"], "input_format_status": "source_input_section", "input_lines": {"max": 6, "median": 6.0, "min": 6}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 6, "median": 6.0, "min": 6}}} -{"case_ids": ["p02417_case_000", "p02417_case_001", "p02417_case_002", "p02417_case_003", "p02417_case_004", "p02417_case_005", "p02417_case_006", "p02417_case_007", "p02417_case_008", "p02417_case_009", "p02417_case_010", "p02417_case_011", "p02417_case_012", "p02417_case_013", "p02417_case_014", "p02417_case_015", "p02417_case_016", "p02417_case_017", "p02417_case_018", "p02417_case_019", "p02417_case_020", "p02417_case_021", "p02417_case_022", "p02417_case_023", "p02417_case_024", "p02417_case_025", "p02417_case_026", "p02417_case_027", "p02417_case_028", "p02417_case_029", "p02417_case_030", "p02417_case_031", "p02417_case_032", "p02417_case_033", "p02417_case_034", "p02417_case_035", "p02417_case_036", "p02417_case_037", "p02417_case_038", "p02417_case_039", "p02417_case_040", "p02417_case_041", "p02417_case_042", "p02417_case_043", "p02417_case_044", "p02417_case_045", "p02417_case_046", "p02417_case_047", "p02417_case_048", "p02417_case_049", "p02417_case_050", "p02417_case_051", "p02417_case_052", "p02417_case_053", "p02417_case_054", "p02417_case_055", "p02417_case_056", "p02417_case_057", "p02417_case_058", "p02417_case_059", "p02417_case_060", "p02417_case_061", "p02417_case_062", "p02417_case_063", "p02417_case_064", "p02417_case_065", "p02417_case_066", "p02417_case_067", "p02417_case_068", "p02417_case_069", "p02417_case_070", "p02417_case_071", "p02417_case_072", "p02417_case_073", "p02417_case_074", "p02417_case_075", "p02417_case_076", "p02417_case_077", "p02417_case_078", "p02417_case_079", "p02417_case_080", "p02417_case_081", "p02417_case_082", "p02417_case_083", "p02417_case_084", "p02417_case_085", "p02417_case_086", "p02417_case_087", "p02417_case_088", "p02417_case_089", "p02417_case_090", "p02417_case_091", "p02417_case_092", "p02417_case_093", "p02417_case_094", "p02417_case_095", "p02417_case_096", "p02417_case_097", "p02417_case_098", "p02417_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "alpha = \"abcdefghijklmnopqrstuvwxyz\"\ntext = \"\"\nwhile True:\n try:\n text += input().lower()\n except:\n break\nfor key in alpha:\n print((\"{} : {}\".format(key, text.count(key))))\n", "fast_code_sha256": "f9cafd9d8dce68b230b9b99bbd992611304ab19e259b30cf8ca6a1c29fa0d18e", "fast_id": "p02417_f9cafd9d8dce68b230b9b99bbd992611304ab19e259b30cf8ca6a1c29fa0d18e", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "alpha = \"abcdefghijklmnopqrstuvwxyz\"\ntext = \"\"\nwhile True:\n try:\n text += input().lower()\n except:\n break\nfor key in alpha:\n print((\"{} : {}\".format(key, text.count(key))))\n", "measured_fast_code_sha256": "f9cafd9d8dce68b230b9b99bbd992611304ab19e259b30cf8ca6a1c29fa0d18e", "measured_slow_code": "import sys\n\naz = [\n \"a\",\n \"b\",\n \"c\",\n \"d\",\n \"e\",\n \"f\",\n \"g\",\n \"h\",\n \"i\",\n \"j\",\n \"k\",\n \"l\",\n \"m\",\n \"n\",\n \"o\",\n \"p\",\n \"q\",\n \"r\",\n \"s\",\n \"t\",\n \"u\",\n \"v\",\n \"w\",\n \"x\",\n \"y\",\n \"z\",\n]\nsum_az = [0 for x in range(26)]\nfor x in sys.stdin.read().lower():\n for i in range(26):\n for j in range(len(x)):\n if x[j] == az[i]:\n sum_az[i] += 1\nfor i in range(26):\n print((\"%s : %d\" % (az[i], sum_az[i])))\n", "measured_slow_code_sha256": "aa76306aa0e70ffadb4879692847e221ecaf4844786582d5b3b47cf7bba7ed5d", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 76.07556442202335, "pair_id": "python_v2_1586804acf220f8a62e556da", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02417", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02417_f9cafd9d8dce68b230b9b99bbd992611304ab19e259b30cf8ca6a1c29fa0d18e.jsonl.gz", "inputs": "reproduction/python/inputs/p02417.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02417_aa76306aa0e70ffadb4879692847e221ecaf4844786582d5b3b47cf7bba7ed5d.jsonl.gz"}, "slow_code": "import sys\n\naz = [\n \"a\",\n \"b\",\n \"c\",\n \"d\",\n \"e\",\n \"f\",\n \"g\",\n \"h\",\n \"i\",\n \"j\",\n \"k\",\n \"l\",\n \"m\",\n \"n\",\n \"o\",\n \"p\",\n \"q\",\n \"r\",\n \"s\",\n \"t\",\n \"u\",\n \"v\",\n \"w\",\n \"x\",\n \"y\",\n \"z\",\n]\nsum_az = [0 for x in range(26)]\nfor x in sys.stdin.read().lower():\n for i in range(26):\n for j in range(len(x)):\n if x[j] == az[i]:\n sum_az[i] += 1\nfor i in range(26):\n print((\"%s : %d\" % (az[i], sum_az[i])))\n", "slow_code_sha256": "aa76306aa0e70ffadb4879692847e221ecaf4844786582d5b3b47cf7bba7ed5d", "slow_id": "p02417_aa76306aa0e70ffadb4879692847e221ecaf4844786582d5b3b47cf7bba7ed5d", "speedup": 65.53905998339458, "stratum": "8+", "within_pair_jaccard": 0.07407407407407407, "workload": {"case_count": 100, "description": "Read all text until end of input and count occurrences of each English letter a..z without distinguishing uppercase and lowercase. Other characters do not contribute to the letter counts. Input may contain multiple lines. Observed inputs: lines=1..119 (median 10); content_characters=0..1199 (median 450); ascii_letters=0..1199 (median 300).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1317, "median": 495.0, "min": 1}, "input_format": ["[text lines until EOF]"], "input_format_status": "source_input_section", "input_lines": {"max": 119, "median": 10.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 199, "median": 20.0, "min": 0}}} -{"case_ids": ["p03282_case_000", "p03282_case_001", "p03282_case_002", "p03282_case_003", "p03282_case_004", "p03282_case_005", "p03282_case_006", "p03282_case_007", "p03282_case_008", "p03282_case_009", "p03282_case_010", "p03282_case_011", "p03282_case_012", "p03282_case_013", "p03282_case_014", "p03282_case_015", "p03282_case_016", "p03282_case_017", "p03282_case_018", "p03282_case_019", "p03282_case_020", "p03282_case_021", "p03282_case_022", "p03282_case_023", "p03282_case_024", "p03282_case_025", "p03282_case_026", "p03282_case_027", "p03282_case_028", "p03282_case_029", "p03282_case_030", "p03282_case_031", "p03282_case_032", "p03282_case_033", "p03282_case_034", "p03282_case_035", "p03282_case_036", "p03282_case_037", "p03282_case_038", "p03282_case_039", "p03282_case_040", "p03282_case_041", "p03282_case_042", "p03282_case_043", "p03282_case_044", "p03282_case_045", "p03282_case_046", "p03282_case_047", "p03282_case_048", "p03282_case_049", "p03282_case_050", "p03282_case_051", "p03282_case_052", "p03282_case_053", "p03282_case_054", "p03282_case_055", "p03282_case_056", "p03282_case_057", "p03282_case_058", "p03282_case_059", "p03282_case_060", "p03282_case_061", "p03282_case_062", "p03282_case_063", "p03282_case_064", "p03282_case_065", "p03282_case_066", "p03282_case_067", "p03282_case_068", "p03282_case_069", "p03282_case_070", "p03282_case_071", "p03282_case_072", "p03282_case_073", "p03282_case_074", "p03282_case_075", "p03282_case_076", "p03282_case_077", "p03282_case_078", "p03282_case_079", "p03282_case_080", "p03282_case_081", "p03282_case_082", "p03282_case_083", "p03282_case_084", "p03282_case_085", "p03282_case_086", "p03282_case_087", "p03282_case_088", "p03282_case_089", "p03282_case_090", "p03282_case_091", "p03282_case_092", "p03282_case_093", "p03282_case_094", "p03282_case_095", "p03282_case_096", "p03282_case_097", "p03282_case_098", "p03282_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\nINF = float(\"inf\")\n\n\ndef solve(S: str, K: int):\n for i in range(K):\n if S[i] != \"1\":\n c = S[i]\n break\n else:\n print((1))\n return\n print(c)\n return\n\n\ndef main():\n def iterate_tokens():\n for line in sys.stdin:\n for word in line.split():\n yield word\n\n tokens = iterate_tokens()\n S = str(next(tokens))\n K = int(next(tokens))\n solve(S, K)\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "10678d77b3f28673dacc6d7392e9e9c37eec617d832c27b7ead861b417e601f5", "fast_id": "p03282_f9a3c226a2d3c804d58bd9e296805bbc74e1baaf1cdf949f2fe60f7d536f4779", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "#!/usr/bin/env python3\nimport sys\n\nINF = float(\"inf\")\n\n\ndef solve(S: str, K: int):\n for i in range(K):\n if S[i] != \"1\":\n c = S[i]\n break\n else:\n print((1))\n return\n print(c)\n return\n\n\ndef main():\n def iterate_tokens():\n for line in sys.stdin:\n for word in line.split():\n yield word\n\n tokens = iterate_tokens()\n S = str(next(tokens)) # type: str\n K = int(next(tokens)) # type: int\n solve(S, K)\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "f9a3c226a2d3c804d58bd9e296805bbc74e1baaf1cdf949f2fe60f7d536f4779", "measured_slow_code": "import numpy as np\n\nS = np.array(list(map(str, input().rstrip())))\nK = int(eval(input()))\ncnt = 0\nans = 1\nfor i, s in enumerate(S):\n if s != \"1\":\n cnt = i + 1\n ans = s\n break\nif cnt > K:\n print((1))\nelse:\n print((int(ans)))\n", "measured_slow_code_sha256": "c6afbfabb4f57c620b796822aa793c63e616de41f9eb4e63aa7e8f88e45d1110", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 624.6193871329052, "pair_id": "python_v2_6607536f5ee7da2936413aa7", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03282", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03282_f9a3c226a2d3c804d58bd9e296805bbc74e1baaf1cdf949f2fe60f7d536f4779.jsonl.gz", "inputs": "reproduction/python/inputs/p03282.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03282_c6afbfabb4f57c620b796822aa793c63e616de41f9eb4e63aa7e8f88e45d1110.jsonl.gz"}, "slow_code": "import numpy as np\n\nS = np.array(list(map(str, input().rstrip())))\nK = int(eval(input()))\ncnt = 0\nans = 1\nfor i, s in enumerate(S):\n if s != \"1\":\n cnt = i + 1\n ans = s\n break\nif cnt > K:\n print((1))\nelse:\n print((int(ans)))\n", "slow_code_sha256": "c6afbfabb4f57c620b796822aa793c63e616de41f9eb4e63aa7e8f88e45d1110", "slow_id": "p03282_c6afbfabb4f57c620b796822aa793c63e616de41f9eb4e63aa7e8f88e45d1110", "speedup": 615.0157249234602, "stratum": "8+", "within_pair_jaccard": 0.2765957446808511, "workload": {"case_count": 100, "description": "On each day, simultaneously replace digit d by d copies of itself, for digits 1..9. Find the 1-based K-th character after 5*10^15 days starting from S; the expanded string is guaranteed long enough. Observed inputs: S_length=1..100 (median 100); K=1..1000000000000000000; digit=1..9.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 121, "median": 103.0, "min": 4}, "input_format": ["S\nK"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p03296_case_000", "p03296_case_001", "p03296_case_002", "p03296_case_003", "p03296_case_004", "p03296_case_005", "p03296_case_006", "p03296_case_007", "p03296_case_008", "p03296_case_009", "p03296_case_010", "p03296_case_011", "p03296_case_012", "p03296_case_013", "p03296_case_014", "p03296_case_015", "p03296_case_016", "p03296_case_017", "p03296_case_018", "p03296_case_019", "p03296_case_020", "p03296_case_021", "p03296_case_022", "p03296_case_023", "p03296_case_024", "p03296_case_025", "p03296_case_026", "p03296_case_027", "p03296_case_028", "p03296_case_029", "p03296_case_030", "p03296_case_031", "p03296_case_032", "p03296_case_033", "p03296_case_034", "p03296_case_035", "p03296_case_036", "p03296_case_037", "p03296_case_038", "p03296_case_039", "p03296_case_040", "p03296_case_041", "p03296_case_042", "p03296_case_043", "p03296_case_044", "p03296_case_045", "p03296_case_046", "p03296_case_047", "p03296_case_048", "p03296_case_049", "p03296_case_050", "p03296_case_051", "p03296_case_052", "p03296_case_053", "p03296_case_054", "p03296_case_055", "p03296_case_056", "p03296_case_057", "p03296_case_058", "p03296_case_059", "p03296_case_060", "p03296_case_061", "p03296_case_062", "p03296_case_063", "p03296_case_064", "p03296_case_065", "p03296_case_066", "p03296_case_067", "p03296_case_068", "p03296_case_069", "p03296_case_070", "p03296_case_071", "p03296_case_072", "p03296_case_073", "p03296_case_074", "p03296_case_075", "p03296_case_076", "p03296_case_077", "p03296_case_078", "p03296_case_079", "p03296_case_080", "p03296_case_081", "p03296_case_082", "p03296_case_083", "p03296_case_084", "p03296_case_085", "p03296_case_086", "p03296_case_087", "p03296_case_088", "p03296_case_089", "p03296_case_090", "p03296_case_091", "p03296_case_092", "p03296_case_093", "p03296_case_094", "p03296_case_095", "p03296_case_096", "p03296_case_097", "p03296_case_098", "p03296_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N = int(eval(input()))\nA = list(map(int, input().split()))\nans = 0\nchanged = False\nfor a, b in zip(A, A[1:]):\n if changed:\n changed = False\n continue\n if a == b:\n ans += 1\n changed = True\nprint(ans)\n", "fast_code_sha256": "3607eb610e53afe08a0d4028f9ca3da705bc97aa23658f05f3d879374106ab51", "fast_id": "p03296_3607eb610e53afe08a0d4028f9ca3da705bc97aa23658f05f3d879374106ab51", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N = int(eval(input()))\nA = list(map(int, input().split()))\nans = 0\nchanged = False\nfor a, b in zip(A, A[1:]):\n if changed:\n changed = False\n continue\n if a == b:\n ans += 1\n changed = True\nprint(ans)\n", "measured_fast_code_sha256": "3607eb610e53afe08a0d4028f9ca3da705bc97aa23658f05f3d879374106ab51", "measured_slow_code": "# coding:utf-8\nimport sys\n\nINF = float(\"inf\")\nMOD = 10**9 + 7\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef LI_():\n return [int(x) - 1 for x in sys.stdin.readline().split()]\n\n\ndef LF():\n return [float(x) for x in sys.stdin.readline().split()]\n\n\ndef LS():\n return sys.stdin.readline().split()\n\n\ndef II():\n return int(sys.stdin.readline())\n\n\ndef SI():\n return eval(input())\n\n\ndef main():\n n = II()\n A = LI()\n res = 0\n for i in range(1, n):\n if A[i] == A[i - 1]:\n A[i] = 0\n res += 1\n return res\n\n\nprint((main()))\n", "measured_slow_code_sha256": "a260e38fd68198bd3b846ed815f9f7842be8a43a1a00830ef94d4cac2df063d2", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.146580007824149, "pair_id": "python_v2_8707e3f27eda2ffaffe221bc", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03296", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03296_3607eb610e53afe08a0d4028f9ca3da705bc97aa23658f05f3d879374106ab51.jsonl.gz", "inputs": "reproduction/python/inputs/p03296.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03296_a260e38fd68198bd3b846ed815f9f7842be8a43a1a00830ef94d4cac2df063d2.jsonl.gz"}, "slow_code": "import sys\n\nINF = float(\"inf\")\nMOD = 10**9 + 7\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef LI_():\n return [int(x) - 1 for x in sys.stdin.readline().split()]\n\n\ndef LF():\n return [float(x) for x in sys.stdin.readline().split()]\n\n\ndef LS():\n return sys.stdin.readline().split()\n\n\ndef II():\n return int(sys.stdin.readline())\n\n\ndef SI():\n return eval(input())\n\n\ndef main():\n n = II()\n A = LI()\n res = 0\n for i in range(1, n):\n if A[i] == A[i - 1]:\n A[i] = 0\n res += 1\n return res\n\n\nprint((main()))\n", "slow_code_sha256": "98718a5692a33a090df0421f7d48f7b20be3a15dafddd3f88613c957f01f774b", "slow_id": "p03296_a260e38fd68198bd3b846ed815f9f7842be8a43a1a00830ef94d4cac2df063d2", "speedup": 2.190085187094913, "stratum": "2-4", "within_pair_jaccard": 0.23404255319148937, "workload": {"case_count": 100, "description": "Change the colors of as few entries as possible so no adjacent pair has equal colors. Each change replaces one color by any of 10000 available colors. Observed inputs: N=2..100 (median 50); A_i=1..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 304, "median": 143.5, "min": 6}, "input_format": ["N\na_1 ... a_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 101, "median": 51.0, "min": 3}}} -{"case_ids": ["p03061_case_000", "p03061_case_001", "p03061_case_002", "p03061_case_003", "p03061_case_004", "p03061_case_005", "p03061_case_006", "p03061_case_007", "p03061_case_008", "p03061_case_009", "p03061_case_010", "p03061_case_011", "p03061_case_012", "p03061_case_013", "p03061_case_014", "p03061_case_015", "p03061_case_016", "p03061_case_017", "p03061_case_018", "p03061_case_019", "p03061_case_020", "p03061_case_021", "p03061_case_022", "p03061_case_023", "p03061_case_024", "p03061_case_025", "p03061_case_026", "p03061_case_027", "p03061_case_028", "p03061_case_029", "p03061_case_030", "p03061_case_031", "p03061_case_032", "p03061_case_033", "p03061_case_034", "p03061_case_035", "p03061_case_036", "p03061_case_037", "p03061_case_038", "p03061_case_039", "p03061_case_040", "p03061_case_041", "p03061_case_042", "p03061_case_043", "p03061_case_044", "p03061_case_045", "p03061_case_046", "p03061_case_047", "p03061_case_048", "p03061_case_049", "p03061_case_050", "p03061_case_051", "p03061_case_052", "p03061_case_053", "p03061_case_054", "p03061_case_055", "p03061_case_056", "p03061_case_057", "p03061_case_058", "p03061_case_059", "p03061_case_060", "p03061_case_061", "p03061_case_062", "p03061_case_063", "p03061_case_064", "p03061_case_065", "p03061_case_066", "p03061_case_067", "p03061_case_068", "p03061_case_069", "p03061_case_070", "p03061_case_071", "p03061_case_072", "p03061_case_073", "p03061_case_074", "p03061_case_075", "p03061_case_076", "p03061_case_077", "p03061_case_078", "p03061_case_079", "p03061_case_080", "p03061_case_081", "p03061_case_082", "p03061_case_083", "p03061_case_084", "p03061_case_085", "p03061_case_086", "p03061_case_087", "p03061_case_088", "p03061_case_089", "p03061_case_090", "p03061_case_091", "p03061_case_092", "p03061_case_093", "p03061_case_094", "p03061_case_095", "p03061_case_096", "p03061_case_097", "p03061_case_098", "p03061_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from math import gcd\n\nn = int(eval(input()))\nA = [0] + list(map(int, input().split())) + [0]\nn += 2\nL, R = [0] * n, [0] * n\ngl, gr = 0, 0\nfor i in range(n):\n gl = gcd(gl, A[i])\n gr = gcd(gr, A[n - i - 1])\n L[i] = gl\n R[n - i - 1] = gr\nans = L[-1]\nfor i in range(n - 2):\n ans = max(ans, gcd(L[i], R[i + 2]))\nprint(ans)\n", "fast_code_sha256": "3f475ae9e7efd3a1ce8867f9c3841f1206e31cad4eec5c093b58fc0a3461d40a", "fast_id": "p03061_3f475ae9e7efd3a1ce8867f9c3841f1206e31cad4eec5c093b58fc0a3461d40a", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from math import gcd\n\nn = int(eval(input()))\nA = [0] + list(map(int, input().split())) + [0]\nn += 2\nL, R = [0] * n, [0] * n\ngl, gr = 0, 0\nfor i in range(n):\n gl = gcd(gl, A[i])\n gr = gcd(gr, A[n - i - 1])\n L[i] = gl\n R[n - i - 1] = gr\nans = L[-1]\nfor i in range(n - 2):\n ans = max(ans, gcd(L[i], R[i + 2]))\nprint(ans)\n", "measured_fast_code_sha256": "3f475ae9e7efd3a1ce8867f9c3841f1206e31cad4eec5c093b58fc0a3461d40a", "measured_slow_code": "def gcdf(a):\n a.sort()\n a0 = a[0]\n a = [int(x % a0) for x in a if x % a0 != 0]\n if len(a) == 0:\n return a0\n else:\n a.append(a0)\n a0 = min(a)\n return gcdf(a)\n\n\nn = int(eval(input()))\na = list(map(int, input().split()))\nif n == 2:\n print((max(a)))\nelif n < 2**8:\n gcdv = 0\n for i in range(n):\n acpy = list(a)\n del acpy[i]\n gcdx = gcdf(acpy)\n if gcdx > gcdv:\n gcdv = gcdx\n print(gcdv)\nelse:\n m = int(n / 100)\n ns = int(n / m)\n rgcd = []\n for mi in range(m):\n ms = ns * mi\n if mi == m - 1:\n am = a[ms:n]\n else:\n am = a[ms : ms + ns]\n gcdm = gcdf(am)\n rgcd.append(gcdm)\n gcdv = 0\n for mi in range(m):\n rgcd1 = list(rgcd)\n del rgcd1[mi]\n gcdrg1 = gcdf(rgcd1)\n ms = ns * mi\n if mi == m - 1:\n am = a[ms:n]\n else:\n am = a[ms : ms + ns]\n # print(mi,gcdf(am),len(am),gcdf(rgcd1))\n for i in range(len(am)):\n acpy = list(am)\n # del acpy[i]\n # acpy.append(gcdrg1)\n acpy[i] = gcdrg1\n gcdx = gcdf(acpy)\n if gcdx > gcdv:\n gcdv = gcdx\n print(gcdv)\n", "measured_slow_code_sha256": "2d1ac3c9fc00324fbe7020d274a3ccaef85c4cb391d9f2865533fe63f653f25e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 6.905262755768147, "pair_id": "python_v2_2622d2f2571cad9f1f74b7cb", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03061", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03061_3f475ae9e7efd3a1ce8867f9c3841f1206e31cad4eec5c093b58fc0a3461d40a.jsonl.gz", "inputs": "reproduction/python/inputs/p03061.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03061_2d1ac3c9fc00324fbe7020d274a3ccaef85c4cb391d9f2865533fe63f653f25e.jsonl.gz"}, "slow_code": "def gcdf(a):\n a.sort()\n a0 = a[0]\n a = [int(x % a0) for x in a if x % a0 != 0]\n if len(a) == 0:\n return a0\n else:\n a.append(a0)\n a0 = min(a)\n return gcdf(a)\n\n\nn = int(eval(input()))\na = list(map(int, input().split()))\nif n == 2:\n print((max(a)))\nelif n < 2**8:\n gcdv = 0\n for i in range(n):\n acpy = list(a)\n del acpy[i]\n gcdx = gcdf(acpy)\n if gcdx > gcdv:\n gcdv = gcdx\n print(gcdv)\nelse:\n m = int(n / 100)\n ns = int(n / m)\n rgcd = []\n for mi in range(m):\n ms = ns * mi\n if mi == m - 1:\n am = a[ms:n]\n else:\n am = a[ms : ms + ns]\n gcdm = gcdf(am)\n rgcd.append(gcdm)\n gcdv = 0\n for mi in range(m):\n rgcd1 = list(rgcd)\n del rgcd1[mi]\n gcdrg1 = gcdf(rgcd1)\n ms = ns * mi\n if mi == m - 1:\n am = a[ms:n]\n else:\n am = a[ms : ms + ns]\n\n for i in range(len(am)):\n acpy = list(am)\n\n acpy[i] = gcdrg1\n gcdx = gcdf(acpy)\n if gcdx > gcdv:\n gcdv = gcdx\n print(gcdv)\n", "slow_code_sha256": "fb07db8e5e4b2567dc3a88a66ec68ddc15c21275b763c8b6a73c40b8a66faae8", "slow_id": "p03061_2d1ac3c9fc00324fbe7020d274a3ccaef85c4cb391d9f2865533fe63f653f25e", "speedup": 5.266638114565066, "stratum": "4-8", "within_pair_jaccard": 0.2962962962962963, "workload": {"case_count": 100, "description": "Replace exactly one of N positive array entries by any integer in 1..1000000000, possibly leaving it unchanged. Maximize the greatest common divisor of the resulting array. Observed inputs: N=2..100000 (median 1000); A_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1000007, "median": 10005.0, "min": 20}, "input_format": ["N\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100001, "median": 1001.0, "min": 3}}} -{"case_ids": ["p02990_case_000", "p02990_case_001", "p02990_case_002", "p02990_case_003", "p02990_case_004", "p02990_case_005", "p02990_case_006", "p02990_case_007", "p02990_case_008", "p02990_case_009", "p02990_case_010", "p02990_case_011", "p02990_case_012", "p02990_case_013", "p02990_case_014", "p02990_case_015", "p02990_case_016", "p02990_case_017", "p02990_case_018", "p02990_case_019", "p02990_case_020", "p02990_case_021", "p02990_case_022", "p02990_case_023", "p02990_case_024", "p02990_case_025", "p02990_case_026", "p02990_case_027", "p02990_case_028", "p02990_case_029", "p02990_case_030", "p02990_case_031", "p02990_case_032", "p02990_case_033", "p02990_case_034", "p02990_case_035", "p02990_case_036", "p02990_case_037", "p02990_case_038", "p02990_case_039", "p02990_case_040", "p02990_case_041", "p02990_case_042", "p02990_case_043", "p02990_case_044", "p02990_case_045", "p02990_case_046", "p02990_case_047", "p02990_case_048", "p02990_case_049", "p02990_case_050", "p02990_case_051", "p02990_case_052", "p02990_case_053", "p02990_case_054", "p02990_case_055", "p02990_case_056", "p02990_case_057", "p02990_case_058", "p02990_case_059", "p02990_case_060", "p02990_case_061", "p02990_case_062", "p02990_case_063", "p02990_case_064", "p02990_case_065", "p02990_case_066", "p02990_case_067", "p02990_case_068", "p02990_case_069", "p02990_case_070", "p02990_case_071", "p02990_case_072", "p02990_case_073", "p02990_case_074", "p02990_case_075", "p02990_case_076", "p02990_case_077", "p02990_case_078", "p02990_case_079", "p02990_case_080", "p02990_case_081", "p02990_case_082", "p02990_case_083", "p02990_case_084", "p02990_case_085", "p02990_case_086", "p02990_case_087", "p02990_case_088", "p02990_case_089", "p02990_case_090", "p02990_case_091", "p02990_case_092", "p02990_case_093", "p02990_case_094", "p02990_case_095", "p02990_case_096", "p02990_case_097", "p02990_case_098", "p02990_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n, k = list(map(int, input().split()))\np = n - k + 1\ni = 0\nwhile i < k:\n print((p % (10**9 + 7)))\n i += 1\n p = p * (k - i) * (n - k + 1 - i) // i // -~i\n", "fast_code_sha256": "e81b9a05d6a0625abe20be5173408f58545a3043c595e7924d8acc120f8af1e0", "fast_id": "p02990_e81b9a05d6a0625abe20be5173408f58545a3043c595e7924d8acc120f8af1e0", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n, k = list(map(int, input().split()))\np = n - k + 1\ni = 0\nwhile i < k:\n print((p % (10**9 + 7)))\n i += 1\n p = p * (k - i) * (n - k + 1 - i) // i // -~i\n", "measured_fast_code_sha256": "e81b9a05d6a0625abe20be5173408f58545a3043c595e7924d8acc120f8af1e0", "measured_slow_code": "N, K = list(map(int, input().split()))\nmod = 10**9 + 7\ninv = [pow(i, mod - 2, mod) for i in range(1, N + 1)]\ntable = []\ninv_table = []\ntmp = 1\ninv_tmp = 1\nfor i in range(N):\n tmp *= i + 1\n tmp %= mod\n table.append(tmp)\n inv_tmp *= inv[i]\n inv_tmp %= mod\n inv_table.append(inv_tmp)\n\n\ndef cmb(n, k):\n if n == 0:\n return 1\n if k == 0:\n return 1\n if n == k:\n return 1\n ans = table[n - 1]\n ans *= inv_table[k - 1]\n ans *= inv_table[n - k - 1]\n return ans % mod\n\n\nfor i in range(1, K + 1):\n ans = 0\n tmp = cmb(K - 1, i - 1)\n if N - K < i - 1:\n print(ans)\n continue\n else:\n tmp_N = N - K - (i - 1)\n if tmp_N > 0:\n ans += cmb(tmp_N + i, i) * tmp\n else:\n ans += tmp\n print((ans % mod))\n", "measured_slow_code_sha256": "c31fc2bc92408b4a0301d38b4dc2bd4da1b14a22d2eabb3dbb3a037726d897d7", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 6.20452152350088, "pair_id": "python_v2_d646966e24b260ed90aa7838", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02990", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02990_e81b9a05d6a0625abe20be5173408f58545a3043c595e7924d8acc120f8af1e0.jsonl.gz", "inputs": "reproduction/python/inputs/p02990.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02990_c31fc2bc92408b4a0301d38b4dc2bd4da1b14a22d2eabb3dbb3a037726d897d7.jsonl.gz"}, "slow_code": "N, K = list(map(int, input().split()))\nmod = 10**9 + 7\ninv = [pow(i, mod - 2, mod) for i in range(1, N + 1)]\ntable = []\ninv_table = []\ntmp = 1\ninv_tmp = 1\nfor i in range(N):\n tmp *= i + 1\n tmp %= mod\n table.append(tmp)\n inv_tmp *= inv[i]\n inv_tmp %= mod\n inv_table.append(inv_tmp)\n\n\ndef cmb(n, k):\n if n == 0:\n return 1\n if k == 0:\n return 1\n if n == k:\n return 1\n ans = table[n - 1]\n ans *= inv_table[k - 1]\n ans *= inv_table[n - k - 1]\n return ans % mod\n\n\nfor i in range(1, K + 1):\n ans = 0\n tmp = cmb(K - 1, i - 1)\n if N - K < i - 1:\n print(ans)\n continue\n else:\n tmp_N = N - K - (i - 1)\n if tmp_N > 0:\n ans += cmb(tmp_N + i, i) * tmp\n else:\n ans += tmp\n print((ans % mod))\n", "slow_code_sha256": "c31fc2bc92408b4a0301d38b4dc2bd4da1b14a22d2eabb3dbb3a037726d897d7", "slow_id": "p02990_c31fc2bc92408b4a0301d38b4dc2bd4da1b14a22d2eabb3dbb3a037726d897d7", "speedup": 7.638909514298546, "stratum": "4-8", "within_pair_jaccard": 0.3684210526315789, "workload": {"case_count": 100, "description": "Arrange K identical blue and N-K identical red balls in a row. For each i=1..K, count arrangements requiring exactly i moves to collect the blue balls, where a move collects any consecutive blue block. Output counts modulo 1000000007. Observed inputs: N=1..2000 (median 1234); K=1..2000 (median 807.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 10, "median": 9.0, "min": 4}, "input_format": ["N K"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p02956_case_000", "p02956_case_001", "p02956_case_002", "p02956_case_003", "p02956_case_004", "p02956_case_005", "p02956_case_006", "p02956_case_007", "p02956_case_008", "p02956_case_009", "p02956_case_010", "p02956_case_011", "p02956_case_012", "p02956_case_013", "p02956_case_014", "p02956_case_015", "p02956_case_016", "p02956_case_017", "p02956_case_018", "p02956_case_019", "p02956_case_020", "p02956_case_021", "p02956_case_022", "p02956_case_023", "p02956_case_024", "p02956_case_025", "p02956_case_026", "p02956_case_027", "p02956_case_028", "p02956_case_029", "p02956_case_030", "p02956_case_031", "p02956_case_032", "p02956_case_033", "p02956_case_034", "p02956_case_035", "p02956_case_036", "p02956_case_037", "p02956_case_038", "p02956_case_039", "p02956_case_040", "p02956_case_041", "p02956_case_042", "p02956_case_043", "p02956_case_044", "p02956_case_045", "p02956_case_046", "p02956_case_047", "p02956_case_048", "p02956_case_049", "p02956_case_050", "p02956_case_051", "p02956_case_052", "p02956_case_053", "p02956_case_054", "p02956_case_055", "p02956_case_056", "p02956_case_057", "p02956_case_058", "p02956_case_059", "p02956_case_060", "p02956_case_061", "p02956_case_062", "p02956_case_063", "p02956_case_064", "p02956_case_065", "p02956_case_066", "p02956_case_067", "p02956_case_068", "p02956_case_069", "p02956_case_070", "p02956_case_071", "p02956_case_072", "p02956_case_073", "p02956_case_074", "p02956_case_075", "p02956_case_076", "p02956_case_077", "p02956_case_078", "p02956_case_079", "p02956_case_080", "p02956_case_081", "p02956_case_082", "p02956_case_083", "p02956_case_084", "p02956_case_085", "p02956_case_086", "p02956_case_087", "p02956_case_088", "p02956_case_089", "p02956_case_090", "p02956_case_091", "p02956_case_092", "p02956_case_093", "p02956_case_094", "p02956_case_095", "p02956_case_096", "p02956_case_097", "p02956_case_098", "p02956_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "executable_AST_equal_except_explicit_explanatory_string_removal_and_all_frozen_inputs_checker_pass", "fast_code": "class BIT:\n def __init__(self, n):\n self.tree = [0] * (n + 1)\n self.tree[0] = None\n\n def sum(self, i):\n s = 0\n i += 1\n while i > 0:\n s += self.tree[i]\n i -= i & -i\n return s\n\n def range(self, l, r):\n return sum(r) - sum(l - 1)\n\n def add(self, i, x):\n i += 1\n while i <= n:\n self.tree[i] += x\n i += i & -i\n\n\nimport sys\n\nsys.setrecursionlimit(10**6)\nreadline = sys.stdin.readline\nn = int(eval(input()))\nxyi = [[int(i) for i in readline().split()] + [j] for j in range(n)]\n\n\ndame_x = [0] * n\ndame_y = [0] * n\ndame_xy = [0] * n\nMOD = 998244353\nsxyi = sorted(xyi, key=lambda x: x[1])\nmodosu = [i for x, y, i in sxyi]\nzaatu = [0] * n\nfor j, zj in enumerate(modosu):\n zaatu[zj] = j\npow2 = [1] * (n + 1)\nfor i in range(n):\n pow2[i + 1] = pow2[i] * 2 % MOD\nfor j, (x, y, i) in enumerate(sxyi):\n dame_y[i] = pow2[j] - 1 + pow2[n - j - 1] - 1\nxyi.sort()\n\nbit = BIT(n)\nfor j, (x, y, i) in enumerate(xyi):\n dame_x[i] = pow2[j] - 1 + pow2[n - j - 1] - 1\n c = bit.sum(zaatu[i])\n dame_xy[i] += pow2[c] - 1 + pow2[j - c] - 1\n bit.add(zaatu[i], 1)\nbit = BIT(n)\nfor j, (x, y, i) in enumerate(reversed(xyi)):\n c = bit.sum(zaatu[i])\n dame_xy[i] += pow2[c] - 1 + pow2[j - c] - 1\n bit.add(zaatu[i], 1)\n\nans = n * (pow2[n] - 1) % MOD\nfor dx, dy, dxy in zip(dame_x, dame_y, dame_xy):\n ans += -dx - dy + dxy\nprint((ans % MOD))\n", "fast_code_sha256": "382736c0a35370c938690e166ba64d1b56fcb202e0f6da86a8757096745b2d64", "fast_id": "p02956_10d797a5ea81b7a4f56177acbb61aaa0799eeddea23d11dca8b78e656d26f855", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "# coding: utf-8\n# Your code here!\n\"\"\"\nBinary indexed tree\n0-indexed, 関数は閉区間\n0からの区間加算、1点更新\n\"\"\"\n\n\nclass BIT: # 0-indexed\n def __init__(self, n):\n self.tree = [0] * (n + 1)\n self.tree[0] = None\n\n # self.element = [0]*(n+1)\n def sum(self, i): # a_0 + ... + a_{i} #閉区間\n s = 0\n i += 1\n while i > 0:\n s += self.tree[i]\n i -= i & -i\n return s\n\n def range(self, l, r): # a_l + ... + a_r 閉区間\n return sum(r) - sum(l - 1)\n\n def add(self, i, x):\n i += 1\n while i <= n:\n self.tree[i] += x\n i += i & -i\n # self.element[i] += x\n\n # def get(self,i): return element[i]\n\n\n###########################################\n# http://judge.u-aizu.ac.jp/onlinejudge/review.jsp?rid=3791366\n###########################################\nimport sys\n\nsys.setrecursionlimit(10**6)\nreadline = sys.stdin.readline # 文字列入力のときは注意\nn = int(eval(input()))\nxyi = [[int(i) for i in readline().split()] + [j] for j in range(n)]\n# xyi = []\n# for i in range(n):\n# a = [int(i) for i in readline().split()]\n# xyi.append(a+[i])\ndame_x = [0] * n\ndame_y = [0] * n\ndame_xy = [0] * n\nMOD = 998244353\nsxyi = sorted(xyi, key=lambda x: x[1]) # zaatu の逆写像\nmodosu = [i for x, y, i in sxyi]\nzaatu = [0] * n\nfor j, zj in enumerate(modosu):\n zaatu[zj] = j\npow2 = [1] * (n + 1)\nfor i in range(n):\n pow2[i + 1] = pow2[i] * 2 % MOD\nfor j, (x, y, i) in enumerate(sxyi):\n dame_y[i] = pow2[j] - 1 + pow2[n - j - 1] - 1\nxyi.sort()\n# print(pow2)\nbit = BIT(n)\nfor j, (x, y, i) in enumerate(xyi):\n dame_x[i] = pow2[j] - 1 + pow2[n - j - 1] - 1\n c = bit.sum(zaatu[i])\n dame_xy[i] += pow2[c] - 1 + pow2[j - c] - 1\n bit.add(zaatu[i], 1)\nbit = BIT(n)\nfor j, (x, y, i) in enumerate(reversed(xyi)):\n c = bit.sum(zaatu[i])\n dame_xy[i] += pow2[c] - 1 + pow2[j - c] - 1\n bit.add(zaatu[i], 1)\n# print(dame_x,\"\\n\",dame_y,\"\\n\",dame_xy)\nans = n * (pow2[n] - 1) % MOD\nfor dx, dy, dxy in zip(dame_x, dame_y, dame_xy):\n ans += -dx - dy + dxy\nprint((ans % MOD))\n", "measured_fast_code_sha256": "10d797a5ea81b7a4f56177acbb61aaa0799eeddea23d11dca8b78e656d26f855", "measured_slow_code": "import sys\n\nreadline = sys.stdin.readline\n\n\nclass BIT:\n # 1-indexed\n def __init__(self, n):\n self.size = n\n self.tree = [0] * (n + 1)\n self.p = 2 ** (n.bit_length() - 1)\n self.dep = n.bit_length()\n\n def get(self, i):\n s = 0\n while i > 0:\n s += self.tree[i]\n i -= i & -i\n return s\n\n def add(self, i, x):\n while i <= self.size:\n self.tree[i] += x\n i += i & -i\n\n def bl(self, v):\n if v <= 0:\n return -1\n s = 0\n k = self.p\n for _ in range(self.dep):\n if s + k <= self.size and self.tree[s + k] < v:\n s += k\n v -= self.tree[s + k]\n k //= 2\n return s + 1\n\n\ndef compress(L):\n L2 = list(set(L))\n L2.sort()\n C = {v: k for k, v in enumerate(L2)}\n return L2, C\n\n\nMOD = 998244353\nN = int(readline())\nXY = [list(map(int, readline().split())) for _ in range(N)]\nXY.sort()\nZ = [-(10**10)]\nfor x, y in XY:\n Z.append(y)\n_, CC = compress(Z)\nXY = [(x, CC[y]) for x, y in XY]\nSS, SB, BS, BB = [None] * N, [None] * N, [None] * N, [None] * N\nT = BIT(N)\nfor i in range(N):\n k = i\n y = XY[i][1]\n l = T.get(y)\n SS[i] = l\n SB[i] = k - l\n T.add(y, 1)\nT = BIT(N)\nfor i in range(N - 1, -1, -1):\n k = N - 1 - i\n y = XY[i][1]\n l = T.get(y)\n BS[i] = l\n BB[i] = k - l\n T.add(y, 1)\nP2 = [1] * 1341398\nfor i in range(1, len(P2)):\n P2[i] = P2[i - 1] * 2 % MOD\nans = 0\nfor i in range(N):\n ss = SS[i]\n sb = SB[i]\n bs = BS[i]\n bb = BB[i]\n ans = (ans + P2[N - 1]) % MOD\n ans = (ans + P2[N - 1 - ss - bb] * (P2[ss] - 1) * (P2[bb] - 1)) % MOD\n ans = (ans + P2[N - 1 - sb - bs] * (P2[sb] - 1) * (P2[bs] - 1)) % MOD\n ans = (ans - (P2[sb] - 1) * (P2[bs] - 1) * (P2[ss] - 1) * (P2[bb] - 1)) % MOD\nprint(ans)\n", "measured_slow_code_sha256": "8042986ea709f7be4a36940bb65dd281b3740a58e66e7c9edcc0eeee56205242", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 40.89198547228111, "pair_id": "python_v2_a2da6d4c653e21c5ecbeeae7", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02956", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02956_10d797a5ea81b7a4f56177acbb61aaa0799eeddea23d11dca8b78e656d26f855.jsonl.gz", "inputs": "reproduction/python/inputs/p02956.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02956_8042986ea709f7be4a36940bb65dd281b3740a58e66e7c9edcc0eeee56205242.jsonl.gz"}, "slow_code": "import sys\n\nreadline = sys.stdin.readline\n\n\nclass BIT:\n\n def __init__(self, n):\n self.size = n\n self.tree = [0] * (n + 1)\n self.p = 2 ** (n.bit_length() - 1)\n self.dep = n.bit_length()\n\n def get(self, i):\n s = 0\n while i > 0:\n s += self.tree[i]\n i -= i & -i\n return s\n\n def add(self, i, x):\n while i <= self.size:\n self.tree[i] += x\n i += i & -i\n\n def bl(self, v):\n if v <= 0:\n return -1\n s = 0\n k = self.p\n for _ in range(self.dep):\n if s + k <= self.size and self.tree[s + k] < v:\n s += k\n v -= self.tree[s + k]\n k //= 2\n return s + 1\n\n\ndef compress(L):\n L2 = list(set(L))\n L2.sort()\n C = {v: k for k, v in enumerate(L2)}\n return L2, C\n\n\nMOD = 998244353\nN = int(readline())\nXY = [list(map(int, readline().split())) for _ in range(N)]\nXY.sort()\nZ = [-(10**10)]\nfor x, y in XY:\n Z.append(y)\n_, CC = compress(Z)\nXY = [(x, CC[y]) for x, y in XY]\nSS, SB, BS, BB = [None] * N, [None] * N, [None] * N, [None] * N\nT = BIT(N)\nfor i in range(N):\n k = i\n y = XY[i][1]\n l = T.get(y)\n SS[i] = l\n SB[i] = k - l\n T.add(y, 1)\nT = BIT(N)\nfor i in range(N - 1, -1, -1):\n k = N - 1 - i\n y = XY[i][1]\n l = T.get(y)\n BS[i] = l\n BB[i] = k - l\n T.add(y, 1)\nP2 = [1] * 1341398\nfor i in range(1, len(P2)):\n P2[i] = P2[i - 1] * 2 % MOD\nans = 0\nfor i in range(N):\n ss = SS[i]\n sb = SB[i]\n bs = BS[i]\n bb = BB[i]\n ans = (ans + P2[N - 1]) % MOD\n ans = (ans + P2[N - 1 - ss - bb] * (P2[ss] - 1) * (P2[bb] - 1)) % MOD\n ans = (ans + P2[N - 1 - sb - bs] * (P2[sb] - 1) * (P2[bs] - 1)) % MOD\n ans = (ans - (P2[sb] - 1) * (P2[bs] - 1) * (P2[ss] - 1) * (P2[bb] - 1)) % MOD\nprint(ans)\n", "slow_code_sha256": "e43f92f24f0e96eef9c4232af95007e4efdc9b0608e734256316ff5cc0636981", "slow_id": "p02956_8042986ea709f7be4a36940bb65dd281b3740a58e66e7c9edcc0eeee56205242", "speedup": 48.51318707720681, "stratum": "8+", "within_pair_jaccard": 0.3465346534653465, "workload": {"case_count": 100, "description": "For each nonempty subset of N plane points, count all original points in its smallest axis-aligned bounding rectangle, including boundaries. Sum these counts modulo 998244353. All x coordinates are distinct, as are all y coordinates. Observed inputs: N=1..200000 (median 1000); x_i=-1000000000..1000000000; y_i=-1000000000..999999000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 4200009, "median": 20809.0, "min": 20}, "input_format": ["N\nx_1 y_1\n...\nx_N y_N"], "input_format_status": "source_input_section", "input_lines": {"max": 200001, "median": 1001.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 400001, "median": 2001.0, "min": 3}}} -{"case_ids": ["p02724_case_000", "p02724_case_001", "p02724_case_002", "p02724_case_003", "p02724_case_004", "p02724_case_005", "p02724_case_006", "p02724_case_007", "p02724_case_008", "p02724_case_009", "p02724_case_010", "p02724_case_011", "p02724_case_012", "p02724_case_013", "p02724_case_014", "p02724_case_015", "p02724_case_016", "p02724_case_017", "p02724_case_018", "p02724_case_019", "p02724_case_020", "p02724_case_021", "p02724_case_022", "p02724_case_023", "p02724_case_024", "p02724_case_025", "p02724_case_026", "p02724_case_027", "p02724_case_028", "p02724_case_029", "p02724_case_030", "p02724_case_031", "p02724_case_032", "p02724_case_033", "p02724_case_034", "p02724_case_035", "p02724_case_036", "p02724_case_037", "p02724_case_038", "p02724_case_039", "p02724_case_040", "p02724_case_041", "p02724_case_042", "p02724_case_043", "p02724_case_044", "p02724_case_045", "p02724_case_046", "p02724_case_047", "p02724_case_048", "p02724_case_049", "p02724_case_050", "p02724_case_051", "p02724_case_052", "p02724_case_053", "p02724_case_054", "p02724_case_055", "p02724_case_056", "p02724_case_057", "p02724_case_058", "p02724_case_059", "p02724_case_060", "p02724_case_061", "p02724_case_062", "p02724_case_063", "p02724_case_064", "p02724_case_065", "p02724_case_066", "p02724_case_067", "p02724_case_068", "p02724_case_069", "p02724_case_070", "p02724_case_071", "p02724_case_072", "p02724_case_073", "p02724_case_074", "p02724_case_075", "p02724_case_076", "p02724_case_077", "p02724_case_078", "p02724_case_079", "p02724_case_080", "p02724_case_081", "p02724_case_082", "p02724_case_083", "p02724_case_084", "p02724_case_085", "p02724_case_086", "p02724_case_087", "p02724_case_088", "p02724_case_089", "p02724_case_090", "p02724_case_091", "p02724_case_092", "p02724_case_093", "p02724_case_094", "p02724_case_095", "p02724_case_096", "p02724_case_097", "p02724_case_098", "p02724_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def main():\n X = int(eval(input()))\n\n p = int(X / 500)\n q = int((X - p * 500) / 5)\n ans = 1000 * p + 5 * q\n print(ans)\n\n\nmain()\n", "fast_code_sha256": "fa36fa45bf534a9fabf7dedb34bc4256416c4806673f0680116329d380f490bd", "fast_id": "p02724_899e07ca1231d136081fa73bf70c5ff21b2926c172bb2358990fc0bee172eb4b", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def main():\n X = int(eval(input()))\n # 500円をp個、5円をq個とすると。500p+5q=Xが成り立ち、ansは1000p+5qになる\n p = int(X / 500)\n q = int((X - p * 500) / 5)\n ans = 1000 * p + 5 * q\n print(ans)\n\n\nmain()\n", "measured_fast_code_sha256": "899e07ca1231d136081fa73bf70c5ff21b2926c172bb2358990fc0bee172eb4b", "measured_slow_code": "def main():\n x = int(eval(input()))\n ans = 0\n while x >= 500:\n x -= 500\n ans += 1000\n while x >= 5:\n x -= 5\n ans += 5\n print(ans)\n\n\nmain()\n", "measured_slow_code_sha256": "07c5a845a98dce83f42c711c0408dc4dad947c9351918518d0af13bec53b52eb", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2164.8790377818214, "pair_id": "python_v2_2bf93823784cb40fc13f09aa", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02724", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02724_899e07ca1231d136081fa73bf70c5ff21b2926c172bb2358990fc0bee172eb4b.jsonl.gz", "inputs": "reproduction/python/inputs/p02724.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02724_07c5a845a98dce83f42c711c0408dc4dad947c9351918518d0af13bec53b52eb.jsonl.gz"}, "slow_code": "def main():\n x = int(eval(input()))\n ans = 0\n while x >= 500:\n x -= 500\n ans += 1000\n while x >= 5:\n x -= 5\n ans += 5\n print(ans)\n\n\nmain()\n", "slow_code_sha256": "07c5a845a98dce83f42c711c0408dc4dad947c9351918518d0af13bec53b52eb", "slow_id": "p02724_07c5a845a98dce83f42c711c0408dc4dad947c9351918518d0af13bec53b52eb", "speedup": 610.9596444534045, "stratum": "8+", "within_pair_jaccard": 0.625, "workload": {"case_count": 100, "description": "Exchange amount X into coins of values 500,100,50,10,5,1. Maximize happiness: each 500-value coin earns 1000 points and each 5-value coin earns 5; other coins earn none. Observed inputs: X=0..1000000000 (median 393604620).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 11, "median": 10.0, "min": 2}, "input_format": ["X"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p03018_case_000", "p03018_case_001", "p03018_case_002", "p03018_case_003", "p03018_case_004", "p03018_case_005", "p03018_case_006", "p03018_case_007", "p03018_case_008", "p03018_case_009", "p03018_case_010", "p03018_case_011", "p03018_case_012", "p03018_case_013", "p03018_case_014", "p03018_case_015", "p03018_case_016", "p03018_case_017", "p03018_case_018", "p03018_case_019", "p03018_case_020", "p03018_case_021", "p03018_case_022", "p03018_case_023", "p03018_case_024", "p03018_case_025", "p03018_case_026", "p03018_case_027", "p03018_case_028", "p03018_case_029", "p03018_case_030", "p03018_case_031", "p03018_case_032", "p03018_case_033", "p03018_case_034", "p03018_case_035", "p03018_case_036", "p03018_case_037", "p03018_case_038", "p03018_case_039", "p03018_case_040", "p03018_case_041", "p03018_case_042", "p03018_case_043", "p03018_case_044", "p03018_case_045", "p03018_case_046", "p03018_case_047", "p03018_case_048", "p03018_case_049", "p03018_case_050", "p03018_case_051", "p03018_case_052", "p03018_case_053", "p03018_case_054", "p03018_case_055", "p03018_case_056", "p03018_case_057", "p03018_case_058", "p03018_case_059", "p03018_case_060", "p03018_case_061", "p03018_case_062", "p03018_case_063", "p03018_case_064", "p03018_case_065", "p03018_case_066", "p03018_case_067", "p03018_case_068", "p03018_case_069", "p03018_case_070", "p03018_case_071", "p03018_case_072", "p03018_case_073", "p03018_case_074", "p03018_case_075", "p03018_case_076", "p03018_case_077", "p03018_case_078", "p03018_case_079", "p03018_case_080", "p03018_case_081", "p03018_case_082", "p03018_case_083", "p03018_case_084", "p03018_case_085", "p03018_case_086", "p03018_case_087", "p03018_case_088", "p03018_case_089", "p03018_case_090", "p03018_case_091", "p03018_case_092", "p03018_case_093", "p03018_case_094", "p03018_case_095", "p03018_case_096", "p03018_case_097", "p03018_case_098", "p03018_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def main():\n S = input().replace(\"BC\", \"1\")\n ans = 0\n a = 0\n for s in S:\n if s == \"A\":\n a += 1\n elif s == \"1\":\n ans += a\n else:\n a = 0\n print(ans)\n\n\nmain()\n", "fast_code_sha256": "8eee5876adb81ae42ad96b3317874379ed91dc38265c72d607658861316866dc", "fast_id": "p03018_8eee5876adb81ae42ad96b3317874379ed91dc38265c72d607658861316866dc", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def main():\n S = input().replace(\"BC\", \"1\")\n ans = 0\n a = 0\n for s in S:\n if s == \"A\":\n a += 1\n elif s == \"1\":\n ans += a\n else:\n a = 0\n print(ans)\n\n\nmain()\n", "measured_fast_code_sha256": "8eee5876adb81ae42ad96b3317874379ed91dc38265c72d607658861316866dc", "measured_slow_code": "import sys\n\nstdin = sys.stdin\nri = lambda: int(rs())\nrl = lambda: list(map(int, stdin.readline().split()))\nrs = lambda: stdin.readline().rstrip() # ignore trailing spaces\nS = list(rs())\ncur = \"D\"\nanswer = 0\nA_cnt = 0\nfor s in S:\n if cur == \"A\":\n if s == \"A\":\n A_cnt += 1\n elif s == \"B\":\n cur = s\n else:\n cur = \"D\"\n A_cnt = 0\n elif cur == \"B\":\n if s == \"A\":\n A_cnt = 1\n cur = s\n elif s == \"B\":\n A_cnt = 0\n cur = \"D\"\n elif s == \"C\":\n answer += A_cnt\n cur = s\n else:\n cur = \"D\"\n A_cnt = 0\n elif cur == \"C\":\n if s == \"A\":\n A_cnt += 1\n cur = s\n elif s == \"B\":\n cur = s\n else:\n cur = \"D\"\n A_cnt = 0\n else:\n if s == \"A\":\n A_cnt += 1\n cur = s\n else:\n A_cnt = 0\n cur = \"D\"\nprint(answer)\n", "measured_slow_code_sha256": "34cfcb0cd806549d9de932b7805e60b0300ac48d582c70a3b82e9e63ed79dbe3", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.1403893824237974, "pair_id": "python_v2_cfbd7222a1e05b3b4e40b38c", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03018", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03018_8eee5876adb81ae42ad96b3317874379ed91dc38265c72d607658861316866dc.jsonl.gz", "inputs": "reproduction/python/inputs/p03018.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03018_34cfcb0cd806549d9de932b7805e60b0300ac48d582c70a3b82e9e63ed79dbe3.jsonl.gz"}, "slow_code": "import sys\n\nstdin = sys.stdin\nri = lambda: int(rs())\nrl = lambda: list(map(int, stdin.readline().split()))\nrs = lambda: stdin.readline().rstrip()\nS = list(rs())\ncur = \"D\"\nanswer = 0\nA_cnt = 0\nfor s in S:\n if cur == \"A\":\n if s == \"A\":\n A_cnt += 1\n elif s == \"B\":\n cur = s\n else:\n cur = \"D\"\n A_cnt = 0\n elif cur == \"B\":\n if s == \"A\":\n A_cnt = 1\n cur = s\n elif s == \"B\":\n A_cnt = 0\n cur = \"D\"\n elif s == \"C\":\n answer += A_cnt\n cur = s\n else:\n cur = \"D\"\n A_cnt = 0\n elif cur == \"C\":\n if s == \"A\":\n A_cnt += 1\n cur = s\n elif s == \"B\":\n cur = s\n else:\n cur = \"D\"\n A_cnt = 0\n else:\n if s == \"A\":\n A_cnt += 1\n cur = s\n else:\n A_cnt = 0\n cur = \"D\"\nprint(answer)\n", "slow_code_sha256": "2a81960ac1f47336dbb6ad3e8a3b063f1f7be21a97a77ab30f5ed64ce398f2f3", "slow_id": "p03018_34cfcb0cd806549d9de932b7805e60b0300ac48d582c70a3b82e9e63ed79dbe3", "speedup": 3.115635809768806, "stratum": "2-4", "within_pair_jaccard": 0.2972972972972973, "workload": {"case_count": 100, "description": "Given a string s over A,B,C, repeatedly replace any contiguous ABC by BCA. Find the maximum possible number of replacements. Observed inputs: s_length=1..200000 (median 1000); A_count=0..200000; B_count=0..200000; C_count=0..200000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 200001, "median": 1001.0, "min": 2}, "input_format": ["s"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p03816_case_000", "p03816_case_001", "p03816_case_002", "p03816_case_003", "p03816_case_004", "p03816_case_005", "p03816_case_006", "p03816_case_007", "p03816_case_008", "p03816_case_009", "p03816_case_010", "p03816_case_011", "p03816_case_012", "p03816_case_013", "p03816_case_014", "p03816_case_015", "p03816_case_016", "p03816_case_017", "p03816_case_018", "p03816_case_019", "p03816_case_020", "p03816_case_021", "p03816_case_022", "p03816_case_023", "p03816_case_024", "p03816_case_025", "p03816_case_026", "p03816_case_027", "p03816_case_028", "p03816_case_029", "p03816_case_030", "p03816_case_031", "p03816_case_032", "p03816_case_033", "p03816_case_034", "p03816_case_035", "p03816_case_036", "p03816_case_037", "p03816_case_038", "p03816_case_039", "p03816_case_040", "p03816_case_041", "p03816_case_042", "p03816_case_043", "p03816_case_044", "p03816_case_045", "p03816_case_046", "p03816_case_047", "p03816_case_048", "p03816_case_049", "p03816_case_050", "p03816_case_051", "p03816_case_052", "p03816_case_053", "p03816_case_054", "p03816_case_055", "p03816_case_056", "p03816_case_057", "p03816_case_058", "p03816_case_059", "p03816_case_060", "p03816_case_061", "p03816_case_062", "p03816_case_063", "p03816_case_064", "p03816_case_065", "p03816_case_066", "p03816_case_067", "p03816_case_068", "p03816_case_069", "p03816_case_070", "p03816_case_071", "p03816_case_072", "p03816_case_073", "p03816_case_074", "p03816_case_075", "p03816_case_076", "p03816_case_077", "p03816_case_078", "p03816_case_079", "p03816_case_080", "p03816_case_081", "p03816_case_082", "p03816_case_083", "p03816_case_084", "p03816_case_085", "p03816_case_086", "p03816_case_087", "p03816_case_088", "p03816_case_089", "p03816_case_090", "p03816_case_091", "p03816_case_092", "p03816_case_093", "p03816_case_094", "p03816_case_095", "p03816_case_096", "p03816_case_097", "p03816_case_098", "p03816_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "_, a = open(0)\nk = len(set(a.split()))\nprint((k - (k % 2 < 1)))\n", "fast_code_sha256": "100336bdfaef2dedb25c007c17d46aee00dbf34943d4cd162fcc6a414ce4f521", "fast_id": "p03816_100336bdfaef2dedb25c007c17d46aee00dbf34943d4cd162fcc6a414ce4f521", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "_, a = open(0)\nk = len(set(a.split()))\nprint((k - (k % 2 < 1)))\n", "measured_fast_code_sha256": "100336bdfaef2dedb25c007c17d46aee00dbf34943d4cd162fcc6a414ce4f521", "measured_slow_code": "import sys\n\nreadline = sys.stdin.readline\nfrom collections import Counter\n\n\ndef main():\n N = int(readline())\n A = list(map(int, readline().rstrip().split()))\n c = Counter(A)\n for key, val in list(c.items()):\n if val > 2:\n if val % 2 == 0:\n c[key] = 2\n else:\n c[key] = 1\n if len([val for key, val in list(c.items()) if c[key] == 2]) % 2 == 0:\n print((len(c)))\n else:\n print((len(c) - 1))\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "c49f88174b2a58efaf437be14c3ac6cbce5c3e042e3010102654126142b32de0", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.368039975397811, "pair_id": "python_v2_5c23893a8fe8ac9f0f81e84a", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03816", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03816_100336bdfaef2dedb25c007c17d46aee00dbf34943d4cd162fcc6a414ce4f521.jsonl.gz", "inputs": "reproduction/python/inputs/p03816.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03816_c49f88174b2a58efaf437be14c3ac6cbce5c3e042e3010102654126142b32de0.jsonl.gz"}, "slow_code": "import sys\n\nreadline = sys.stdin.readline\nfrom collections import Counter\n\n\ndef main():\n N = int(readline())\n A = list(map(int, readline().rstrip().split()))\n c = Counter(A)\n for key, val in list(c.items()):\n if val > 2:\n if val % 2 == 0:\n c[key] = 2\n else:\n c[key] = 1\n if len([val for key, val in list(c.items()) if c[key] == 2]) % 2 == 0:\n print((len(c)))\n else:\n print((len(c) - 1))\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "c49f88174b2a58efaf437be14c3ac6cbce5c3e042e3010102654126142b32de0", "slow_id": "p03816_c49f88174b2a58efaf437be14c3ac6cbce5c3e042e3010102654126142b32de0", "speedup": 4.115486904175369, "stratum": "4-8", "within_pair_jaccard": 0.16666666666666666, "workload": {"case_count": 100, "description": "From an odd-sized deck, repeatedly choose three arbitrary cards, discard a largest and a smallest, and return the remaining card. Maximize the number left with all values pairwise distinct. Zero operations are allowed. Observed inputs: N=3..99999 (median 12345); A_i=1..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 600000, "median": 72946.5, "min": 17}, "input_format": ["N\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100000, "median": 12346.0, "min": 4}}} -{"case_ids": ["p02725_case_000", "p02725_case_001", "p02725_case_002", "p02725_case_003", "p02725_case_004", "p02725_case_005", "p02725_case_006", "p02725_case_007", "p02725_case_008", "p02725_case_009", "p02725_case_010", "p02725_case_011", "p02725_case_012", "p02725_case_013", "p02725_case_014", "p02725_case_015", "p02725_case_016", "p02725_case_017", "p02725_case_018", "p02725_case_019", "p02725_case_020", "p02725_case_021", "p02725_case_022", "p02725_case_023", "p02725_case_024", "p02725_case_025", "p02725_case_026", "p02725_case_027", "p02725_case_028", "p02725_case_029", "p02725_case_030", "p02725_case_031", "p02725_case_032", "p02725_case_033", "p02725_case_034", "p02725_case_035", "p02725_case_036", "p02725_case_037", "p02725_case_038", "p02725_case_039", "p02725_case_040", "p02725_case_041", "p02725_case_042", "p02725_case_043", "p02725_case_044", "p02725_case_045", "p02725_case_046", "p02725_case_047", "p02725_case_048", "p02725_case_049", "p02725_case_050", "p02725_case_051", "p02725_case_052", "p02725_case_053", "p02725_case_054", "p02725_case_055", "p02725_case_056", "p02725_case_057", "p02725_case_058", "p02725_case_059", "p02725_case_060", "p02725_case_061", "p02725_case_062", "p02725_case_063", "p02725_case_064", "p02725_case_065", "p02725_case_066", "p02725_case_067", "p02725_case_068", "p02725_case_069", "p02725_case_070", "p02725_case_071", "p02725_case_072", "p02725_case_073", "p02725_case_074", "p02725_case_075", "p02725_case_076", "p02725_case_077", "p02725_case_078", "p02725_case_079", "p02725_case_080", "p02725_case_081", "p02725_case_082", "p02725_case_083", "p02725_case_084", "p02725_case_085", "p02725_case_086", "p02725_case_087", "p02725_case_088", "p02725_case_089", "p02725_case_090", "p02725_case_091", "p02725_case_092", "p02725_case_093", "p02725_case_094", "p02725_case_095", "p02725_case_096", "p02725_case_097", "p02725_case_098", "p02725_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "k, n = list(map(int, input().split()))\nA = list(map(int, input().split()))\nl = [k - A[-1] + A[0]]\n[l.append(A[i + 1] - A[i]) for i in range(n - 1)]\nprint((k - max(l)))\n", "fast_code_sha256": "27dbf408a3d26db29791ec3ce69a8bda8fad3af13337e24ab309e335a59b85a2", "fast_id": "p02725_27dbf408a3d26db29791ec3ce69a8bda8fad3af13337e24ab309e335a59b85a2", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "k, n = list(map(int, input().split()))\nA = list(map(int, input().split()))\nl = [k - A[-1] + A[0]]\n[l.append(A[i + 1] - A[i]) for i in range(n - 1)]\nprint((k - max(l)))\n", "measured_fast_code_sha256": "27dbf408a3d26db29791ec3ce69a8bda8fad3af13337e24ab309e335a59b85a2", "measured_slow_code": "import numpy as np\n\nK, N = list(map(int, input().split()))\nA = list(map(int, input().split()))\nA.append(K + A[0])\nD = np.diff(A)\nprint((int(K) - np.max(D)))\n", "measured_slow_code_sha256": "91accdad635aaade3cd21a1cbe15f0f073859089779275b1b10043afbdc41816", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 727.8110053185418, "pair_id": "python_v2_2aebd61ad02738c70a7e85bb", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02725", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02725_27dbf408a3d26db29791ec3ce69a8bda8fad3af13337e24ab309e335a59b85a2.jsonl.gz", "inputs": "reproduction/python/inputs/p02725.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02725_91accdad635aaade3cd21a1cbe15f0f073859089779275b1b10043afbdc41816.jsonl.gz"}, "slow_code": "import numpy as np\n\nK, N = list(map(int, input().split()))\nA = list(map(int, input().split()))\nA.append(K + A[0])\nD = np.diff(A)\nprint((int(K) - np.max(D)))\n", "slow_code_sha256": "91accdad635aaade3cd21a1cbe15f0f073859089779275b1b10043afbdc41816", "slow_id": "p02725_91accdad635aaade3cd21a1cbe15f0f073859089779275b1b10043afbdc41816", "speedup": 38.16328216657605, "stratum": "8+", "within_pair_jaccard": 0.38461538461538464, "workload": {"case_count": 100, "description": "On a circular path of circumference K, houses have strictly increasing clockwise positions A_i. Starting at any house, find the minimum distance along the circle needed to visit all N houses; return to the start is not required. Observed inputs: K=2..1000000 (median 100); N=2..200000 (median 50); A_i=0..999999.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1399579, "median": 156.0, "min": 8}, "input_format": ["K N\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200002, "median": 52.0, "min": 4}}} -{"case_ids": ["p03274_case_000", "p03274_case_001", "p03274_case_002", "p03274_case_003", "p03274_case_004", "p03274_case_005", "p03274_case_006", "p03274_case_007", "p03274_case_008", "p03274_case_009", "p03274_case_010", "p03274_case_011", "p03274_case_012", "p03274_case_013", "p03274_case_014", "p03274_case_015", "p03274_case_016", "p03274_case_017", "p03274_case_018", "p03274_case_019", "p03274_case_020", "p03274_case_021", "p03274_case_022", "p03274_case_023", "p03274_case_024", "p03274_case_025", "p03274_case_026", "p03274_case_027", "p03274_case_028", "p03274_case_029", "p03274_case_030", "p03274_case_031", "p03274_case_032", "p03274_case_033", "p03274_case_034", "p03274_case_035", "p03274_case_036", "p03274_case_037", "p03274_case_038", "p03274_case_039", "p03274_case_040", "p03274_case_041", "p03274_case_042", "p03274_case_043", "p03274_case_044", "p03274_case_045", "p03274_case_046", "p03274_case_047", "p03274_case_048", "p03274_case_049", "p03274_case_050", "p03274_case_051", "p03274_case_052", "p03274_case_053", "p03274_case_054", "p03274_case_055", "p03274_case_056", "p03274_case_057", "p03274_case_058", "p03274_case_059", "p03274_case_060", "p03274_case_061", "p03274_case_062", "p03274_case_063", "p03274_case_064", "p03274_case_065", "p03274_case_066", "p03274_case_067", "p03274_case_068", "p03274_case_069", "p03274_case_070", "p03274_case_071", "p03274_case_072", "p03274_case_073", "p03274_case_074", "p03274_case_075", "p03274_case_076", "p03274_case_077", "p03274_case_078", "p03274_case_079", "p03274_case_080", "p03274_case_081", "p03274_case_082", "p03274_case_083", "p03274_case_084", "p03274_case_085", "p03274_case_086", "p03274_case_087", "p03274_case_088", "p03274_case_089", "p03274_case_090", "p03274_case_091", "p03274_case_092", "p03274_case_093", "p03274_case_094", "p03274_case_095", "p03274_case_096", "p03274_case_097", "p03274_case_098", "p03274_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N, K = list(map(int, input().split()))\nX = list(map(int, input().split()))\nans = 10**18\nfor l in range(N - K + 1):\n D = X[l + K - 1] - X[l]\n if X[l] <= 0 <= X[l + K - 1]:\n D += min(-X[l], X[l + K - 1])\n elif X[l + K - 1] <= 0:\n D += -X[l + K - 1]\n elif X[l] >= 0:\n D += X[l]\n ans = min(ans, D)\nprint(ans)\n", "fast_code_sha256": "1d9c31e5ce2162887674cce50c00de270e79f0fa89cbdada8f3d0255f57d45df", "fast_id": "p03274_1d9c31e5ce2162887674cce50c00de270e79f0fa89cbdada8f3d0255f57d45df", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N, K = list(map(int, input().split()))\nX = list(map(int, input().split()))\nans = 10**18\nfor l in range(N - K + 1):\n D = X[l + K - 1] - X[l]\n if X[l] <= 0 <= X[l + K - 1]:\n D += min(-X[l], X[l + K - 1])\n elif X[l + K - 1] <= 0:\n D += -X[l + K - 1]\n elif X[l] >= 0:\n D += X[l]\n ans = min(ans, D)\nprint(ans)\n", "measured_fast_code_sha256": "1d9c31e5ce2162887674cce50c00de270e79f0fa89cbdada8f3d0255f57d45df", "measured_slow_code": "import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time\n\nsys.setrecursionlimit(10**7)\ninf = 10**20\nmod = 10**9 + 7\n\n\ndef LI():\n return list(map(int, input().split()))\n\n\ndef I():\n return int(eval(input()))\n\n\ndef LS():\n return input().split()\n\n\ndef S():\n return eval(input())\n\n\ndef main():\n n, k = LI()\n l = LI()\n mn = inf\n for i in range(n - k + 1):\n a = l[i]\n b = l[i + k - 1]\n if a < 0 and b > 0:\n mn = min([mn, abs(a) + abs(b) * 2, abs(a) * 2 + abs(b)])\n else:\n mn = min(mn, max(abs(a), abs(b)))\n return mn\n\n\nprint((main()))\n", "measured_slow_code_sha256": "15cce6db7bc6d79dcd48950e05503001080b8e54791a05cbcc84aecc1f823153", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.9806249857954144, "pair_id": "python_v2_5433ce5f3ad851814889c98c", "per_case_slow_code_faster_fraction": 0.35, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03274", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03274_1d9c31e5ce2162887674cce50c00de270e79f0fa89cbdada8f3d0255f57d45df.jsonl.gz", "inputs": "reproduction/python/inputs/p03274.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03274_15cce6db7bc6d79dcd48950e05503001080b8e54791a05cbcc84aecc1f823153.jsonl.gz"}, "slow_code": "import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time\n\nsys.setrecursionlimit(10**7)\ninf = 10**20\nmod = 10**9 + 7\n\n\ndef LI():\n return list(map(int, input().split()))\n\n\ndef I():\n return int(eval(input()))\n\n\ndef LS():\n return input().split()\n\n\ndef S():\n return eval(input())\n\n\ndef main():\n n, k = LI()\n l = LI()\n mn = inf\n for i in range(n - k + 1):\n a = l[i]\n b = l[i + k - 1]\n if a < 0 and b > 0:\n mn = min([mn, abs(a) + abs(b) * 2, abs(a) * 2 + abs(b)])\n else:\n mn = min(mn, max(abs(a), abs(b)))\n return mn\n\n\nprint((main()))\n", "slow_code_sha256": "15cce6db7bc6d79dcd48950e05503001080b8e54791a05cbcc84aecc1f823153", "slow_id": "p03274_15cce6db7bc6d79dcd48950e05503001080b8e54791a05cbcc84aecc1f823153", "speedup": 3.345303260479619, "stratum": "2-4", "within_pair_jaccard": 0.25, "workload": {"case_count": 100, "description": "Start at coordinate 0 and travel along a line at unit speed to light K of N candles at strictly increasing positions x_i. Lighting takes negligible time. Minimize elapsed time; return to 0 is not required. Observed inputs: N=1..100000 (median 10000); K=1..100000 (median 75); x_i=-100000000..100000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1000015, "median": 53814.0, "min": 14}, "input_format": ["N K\nx_1 ... x_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100002, "median": 10002.0, "min": 3}}} -{"case_ids": ["p02707_case_000", "p02707_case_001", "p02707_case_002", "p02707_case_003", "p02707_case_004", "p02707_case_005", "p02707_case_006", "p02707_case_007", "p02707_case_008", "p02707_case_009", "p02707_case_010", "p02707_case_011", "p02707_case_012", "p02707_case_013", "p02707_case_014", "p02707_case_015", "p02707_case_016", "p02707_case_017", "p02707_case_018", "p02707_case_019", "p02707_case_020", "p02707_case_021", "p02707_case_022", "p02707_case_023", "p02707_case_024", "p02707_case_025", "p02707_case_026", "p02707_case_027", "p02707_case_028", "p02707_case_029", "p02707_case_030", "p02707_case_031", "p02707_case_032", "p02707_case_033", "p02707_case_034", "p02707_case_035", "p02707_case_036", "p02707_case_037", "p02707_case_038", "p02707_case_039", "p02707_case_040", "p02707_case_041", "p02707_case_042", "p02707_case_043", "p02707_case_044", "p02707_case_045", "p02707_case_046", "p02707_case_047", "p02707_case_048", "p02707_case_049", "p02707_case_050", "p02707_case_051", "p02707_case_052", "p02707_case_053", "p02707_case_054", "p02707_case_055", "p02707_case_056", "p02707_case_057", "p02707_case_058", "p02707_case_059", "p02707_case_060", "p02707_case_061", "p02707_case_062", "p02707_case_063", "p02707_case_064", "p02707_case_065", "p02707_case_066", "p02707_case_067", "p02707_case_068", "p02707_case_069", "p02707_case_070", "p02707_case_071", "p02707_case_072", "p02707_case_073", "p02707_case_074", "p02707_case_075", "p02707_case_076", "p02707_case_077", "p02707_case_078", "p02707_case_079", "p02707_case_080", "p02707_case_081", "p02707_case_082", "p02707_case_083", "p02707_case_084", "p02707_case_085", "p02707_case_086", "p02707_case_087", "p02707_case_088", "p02707_case_089", "p02707_case_090", "p02707_case_091", "p02707_case_092", "p02707_case_093", "p02707_case_094", "p02707_case_095", "p02707_case_096", "p02707_case_097", "p02707_case_098", "p02707_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "num = int(eval(input()))\nboss = input().split()\nans_list = [0] * num\nfor i_boss in boss:\n ans_list[int(i_boss) - 1] += 1\na = list([str(x) for x in ans_list])\nprint((\"\\n\".join(a)))\n", "fast_code_sha256": "498a95f0d8a1a94709cf73302cdd31345e5afd389407b78c00aaa6afa7c4a0bf", "fast_id": "p02707_498a95f0d8a1a94709cf73302cdd31345e5afd389407b78c00aaa6afa7c4a0bf", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "num = int(eval(input()))\nboss = input().split()\nans_list = [0] * num\nfor i_boss in boss:\n ans_list[int(i_boss) - 1] += 1\na = list([str(x) for x in ans_list])\nprint((\"\\n\".join(a)))\n", "measured_fast_code_sha256": "498a95f0d8a1a94709cf73302cdd31345e5afd389407b78c00aaa6afa7c4a0bf", "measured_slow_code": "n = int(eval(input()))\na_list = list(map(int, input().split()))\nnl = {str(i): 0 for i in range(n)}\nfor a in a_list:\n nl[str(a - 1)] += 1\nfor v in list(nl.values()):\n print((\"{}\".format(v)))\n", "measured_slow_code_sha256": "cd7006129feddcbda91b13d55f55c98244567f8ad1d8bf8cc06342ee60ea4d53", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.4189038280282107, "pair_id": "python_v2_e1e71b925e74ab68d30ebd89", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02707", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02707_498a95f0d8a1a94709cf73302cdd31345e5afd389407b78c00aaa6afa7c4a0bf.jsonl.gz", "inputs": "reproduction/python/inputs/p02707.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02707_cd7006129feddcbda91b13d55f55c98244567f8ad1d8bf8cc06342ee60ea4d53.jsonl.gz"}, "slow_code": "n = int(eval(input()))\na_list = list(map(int, input().split()))\nnl = {str(i): 0 for i in range(n)}\nfor a in a_list:\n nl[str(a - 1)] += 1\nfor v in list(nl.values()):\n print((\"{}\".format(v)))\n", "slow_code_sha256": "cd7006129feddcbda91b13d55f55c98244567f8ad1d8bf8cc06342ee60ea4d53", "slow_id": "p02707_cd7006129feddcbda91b13d55f55c98244567f8ad1d8bf8cc06342ee60ea4d53", "speedup": 2.009581493386482, "stratum": "2-4", "within_pair_jaccard": 0.48148148148148145, "workload": {"case_count": 100, "description": "A company has N numbered members. For member i=2..N, A_i K:\n print((1))\nelse:\n print((int(ans)))\n", "measured_slow_code_sha256": "c6afbfabb4f57c620b796822aa793c63e616de41f9eb4e63aa7e8f88e45d1110", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1051.7573012314097, "pair_id": "python_v2_c874029897d5c7a41e0706f6", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03282", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03282_c65a80990a9a256c90331e32901f5e1de2bd2ae0d5d5bc5754fe2ae140834e11.jsonl.gz", "inputs": "reproduction/python/inputs/p03282.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03282_c6afbfabb4f57c620b796822aa793c63e616de41f9eb4e63aa7e8f88e45d1110.jsonl.gz"}, "slow_code": "import numpy as np\n\nS = np.array(list(map(str, input().rstrip())))\nK = int(eval(input()))\ncnt = 0\nans = 1\nfor i, s in enumerate(S):\n if s != \"1\":\n cnt = i + 1\n ans = s\n break\nif cnt > K:\n print((1))\nelse:\n print((int(ans)))\n", "slow_code_sha256": "c6afbfabb4f57c620b796822aa793c63e616de41f9eb4e63aa7e8f88e45d1110", "slow_id": "p03282_c6afbfabb4f57c620b796822aa793c63e616de41f9eb4e63aa7e8f88e45d1110", "speedup": 1005.9659514050329, "stratum": "8+", "within_pair_jaccard": 0.40625, "workload": {"case_count": 100, "description": "On each day, simultaneously replace digit d by d copies of itself, for digits 1..9. Find the 1-based K-th character after 5*10^15 days starting from S; the expanded string is guaranteed long enough. Observed inputs: S_length=1..100 (median 100); K=1..1000000000000000000; digit=1..9.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 121, "median": 103.0, "min": 4}, "input_format": ["S\nK"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p02572_case_000", "p02572_case_001", "p02572_case_002", "p02572_case_003", "p02572_case_004", "p02572_case_005", "p02572_case_006", "p02572_case_007", "p02572_case_008", "p02572_case_009", "p02572_case_010", "p02572_case_011", "p02572_case_012", "p02572_case_013", "p02572_case_014", "p02572_case_015", "p02572_case_016", "p02572_case_017", "p02572_case_018", "p02572_case_019", "p02572_case_020", "p02572_case_021", "p02572_case_022", "p02572_case_023", "p02572_case_024", "p02572_case_025", "p02572_case_026", "p02572_case_027", "p02572_case_028", "p02572_case_029", "p02572_case_030", "p02572_case_031", "p02572_case_032", "p02572_case_033", "p02572_case_034", "p02572_case_035", "p02572_case_036", "p02572_case_037", "p02572_case_038", "p02572_case_039", "p02572_case_040", "p02572_case_041", "p02572_case_042", "p02572_case_043", "p02572_case_044", "p02572_case_045", "p02572_case_046", "p02572_case_047", "p02572_case_048", "p02572_case_049", "p02572_case_050", "p02572_case_051", "p02572_case_052", "p02572_case_053", "p02572_case_054", "p02572_case_055", "p02572_case_056", "p02572_case_057", "p02572_case_058", "p02572_case_059", "p02572_case_060", "p02572_case_061", "p02572_case_062", "p02572_case_063", "p02572_case_064", "p02572_case_065", "p02572_case_066", "p02572_case_067", "p02572_case_068", "p02572_case_069", "p02572_case_070", "p02572_case_071", "p02572_case_072", "p02572_case_073", "p02572_case_074", "p02572_case_075", "p02572_case_076", "p02572_case_077", "p02572_case_078", "p02572_case_079", "p02572_case_080", "p02572_case_081", "p02572_case_082", "p02572_case_083", "p02572_case_084", "p02572_case_085", "p02572_case_086", "p02572_case_087", "p02572_case_088", "p02572_case_089", "p02572_case_090", "p02572_case_091", "p02572_case_092", "p02572_case_093", "p02572_case_094", "p02572_case_095", "p02572_case_096", "p02572_case_097", "p02572_case_098", "p02572_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\nfrom itertools import accumulate\n\nread = sys.stdin.read\nreadline = sys.stdin.readline\nreadlines = sys.stdin.readlines\nsys.setrecursionlimit(10**9)\nINF = 1 << 60\nMOD = 1000000007\n\n\ndef main():\n N, *A = list(map(int, read().split()))\n total = sum(A) % MOD\n ans = total * total % MOD\n for a in A:\n ans = (ans - a * a) % MOD\n ans = ans * pow(2, MOD - 2, MOD) % MOD\n print(ans)\n return\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "bc1c7a50e9c7d73695fc373c49083f3ca76b69d7d65d1464d978cf8fb277b77d", "fast_id": "p02572_bc1c7a50e9c7d73695fc373c49083f3ca76b69d7d65d1464d978cf8fb277b77d", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\nfrom itertools import accumulate\n\nread = sys.stdin.read\nreadline = sys.stdin.readline\nreadlines = sys.stdin.readlines\nsys.setrecursionlimit(10**9)\nINF = 1 << 60\nMOD = 1000000007\n\n\ndef main():\n N, *A = list(map(int, read().split()))\n total = sum(A) % MOD\n ans = total * total % MOD\n for a in A:\n ans = (ans - a * a) % MOD\n ans = ans * pow(2, MOD - 2, MOD) % MOD\n print(ans)\n return\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "bc1c7a50e9c7d73695fc373c49083f3ca76b69d7d65d1464d978cf8fb277b77d", "measured_slow_code": "import copy\n\nN = int(eval(input()))\nA = list(map(int, input().split()))\nmod = 10**9 + 7\npartial_sum = copy.deepcopy(A)\nsum_now = A[N - 1]\nfor j in range(N - 2, -1, -1):\n sum_now = int((sum_now + A[j]) % mod)\n partial_sum[j] = sum_now\nres = 0\nfor i in range(N - 1):\n res = (res + (A[i] * partial_sum[i + 1]) % mod) % mod\nprint((int(res)))\n", "measured_slow_code_sha256": "9a9a8c4412436852a66bfa0067b57c544f3aec7f532b2c46c6eaa958a2513451", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4.466524651662445, "pair_id": "python_v2_303481333b37759bf4825fb3", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02572", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02572_bc1c7a50e9c7d73695fc373c49083f3ca76b69d7d65d1464d978cf8fb277b77d.jsonl.gz", "inputs": "reproduction/python/inputs/p02572.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02572_9a9a8c4412436852a66bfa0067b57c544f3aec7f532b2c46c6eaa958a2513451.jsonl.gz"}, "slow_code": "import copy\n\nN = int(eval(input()))\nA = list(map(int, input().split()))\nmod = 10**9 + 7\npartial_sum = copy.deepcopy(A)\nsum_now = A[N - 1]\nfor j in range(N - 2, -1, -1):\n sum_now = int((sum_now + A[j]) % mod)\n partial_sum[j] = sum_now\nres = 0\nfor i in range(N - 1):\n res = (res + (A[i] * partial_sum[i + 1]) % mod) % mod\nprint((int(res)))\n", "slow_code_sha256": "9a9a8c4412436852a66bfa0067b57c544f3aec7f532b2c46c6eaa958a2513451", "slow_id": "p02572_9a9a8c4412436852a66bfa0067b57c544f3aec7f532b2c46c6eaa958a2513451", "speedup": 4.245775361341038, "stratum": "4-8", "within_pair_jaccard": 0.27450980392156865, "workload": {"case_count": 100, "description": "For an array of N integers, sum a_i*a_j over all index pairs i b and \"GREATER\" or \"EQUAL\")\n", "fast_code_sha256": "91d7192b6602c28b4193083fd98adbb4ab51f35705035e0ca0b95f33dcb32366", "fast_id": "p03738_91d7192b6602c28b4193083fd98adbb4ab51f35705035e0ca0b95f33dcb32366", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "a = eval(input())\nb = eval(input())\nprint(a < b and \"LESS\" or a > b and \"GREATER\" or \"EQUAL\")\n", "measured_fast_code_sha256": "91d7192b6602c28b4193083fd98adbb4ab51f35705035e0ca0b95f33dcb32366", "measured_slow_code": "# coding:utf-8\nimport math\n\nif __name__ == \"__main__\":\n a = input()\n b = input()\n if len(a) > len(b):\n print(\"GREATER\")\n elif len(a) < len(b):\n print(\"LESS\")\n elif len(a) == len(b):\n for i in range(len(a)):\n if a[i] > b[i]:\n print(\"GREATER\")\n break\n elif a[i] < b[i]:\n print(\"LESS\")\n break\n elif a[i] == b[i] and i == len(a) - 1:\n print(\"EQUAL\")\n", "measured_slow_code_sha256": "d5baa6a15a1c4a76633ab38a051360a64a827577b6553480f73b85ef4ead3a15", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.439601123302303, "pair_id": "python_v2_77f3c1f612e6eb856f18b460", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03738", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03738_91d7192b6602c28b4193083fd98adbb4ab51f35705035e0ca0b95f33dcb32366.jsonl.gz", "inputs": "reproduction/python/inputs/p03738.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03738_d5baa6a15a1c4a76633ab38a051360a64a827577b6553480f73b85ef4ead3a15.jsonl.gz"}, "slow_code": "import math\n\nif __name__ == \"__main__\":\n a = input()\n b = input()\n if len(a) > len(b):\n print(\"GREATER\")\n elif len(a) < len(b):\n print(\"LESS\")\n elif len(a) == len(b):\n for i in range(len(a)):\n if a[i] > b[i]:\n print(\"GREATER\")\n break\n elif a[i] < b[i]:\n print(\"LESS\")\n break\n elif a[i] == b[i] and i == len(a) - 1:\n print(\"EQUAL\")\n", "slow_code_sha256": "51f72b7576f2a6693b915f49f43199e2cd6155a4ebab55cc493d3b8dd74e88d8", "slow_id": "p03738_d5baa6a15a1c4a76633ab38a051360a64a827577b6553480f73b85ef4ead3a15", "speedup": 2.4904587955334105, "stratum": "2-4", "within_pair_jaccard": 0.34782608695652173, "workload": {"case_count": 100, "description": "Compare positive decimal integers A and B and report greater, less, or equal. Neither representation has leading zeros; numbers may exceed machine integer sizes. Observed inputs: A_digits=1..100 (median 7); B_digits=1..100 (median 7).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 202, "median": 18.0, "min": 4}, "input_format": ["A\nB"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p02657_case_000", "p02657_case_001", "p02657_case_002", "p02657_case_003", "p02657_case_004", "p02657_case_005", "p02657_case_006", "p02657_case_007", "p02657_case_008", "p02657_case_009", "p02657_case_010", "p02657_case_011", "p02657_case_012", "p02657_case_013", "p02657_case_014", "p02657_case_015", "p02657_case_016", "p02657_case_017", "p02657_case_018", "p02657_case_019", "p02657_case_020", "p02657_case_021", "p02657_case_022", "p02657_case_023", "p02657_case_024", "p02657_case_025", "p02657_case_026", "p02657_case_027", "p02657_case_028", "p02657_case_029", "p02657_case_030", "p02657_case_031", "p02657_case_032", "p02657_case_033", "p02657_case_034", "p02657_case_035", "p02657_case_036", "p02657_case_037", "p02657_case_038", "p02657_case_039", "p02657_case_040", "p02657_case_041", "p02657_case_042", "p02657_case_043", "p02657_case_044", "p02657_case_045", "p02657_case_046", "p02657_case_047", "p02657_case_048", "p02657_case_049", "p02657_case_050", "p02657_case_051", "p02657_case_052", "p02657_case_053", "p02657_case_054", "p02657_case_055", "p02657_case_056", "p02657_case_057", "p02657_case_058", "p02657_case_059", "p02657_case_060", "p02657_case_061", "p02657_case_062", "p02657_case_063", "p02657_case_064", "p02657_case_065", "p02657_case_066", "p02657_case_067", "p02657_case_068", "p02657_case_069", "p02657_case_070", "p02657_case_071", "p02657_case_072", "p02657_case_073", "p02657_case_074", "p02657_case_075", "p02657_case_076", "p02657_case_077", "p02657_case_078", "p02657_case_079", "p02657_case_080", "p02657_case_081", "p02657_case_082", "p02657_case_083", "p02657_case_084", "p02657_case_085", "p02657_case_086", "p02657_case_087", "p02657_case_088", "p02657_case_089", "p02657_case_090", "p02657_case_091", "p02657_case_092", "p02657_case_093", "p02657_case_094", "p02657_case_095", "p02657_case_096", "p02657_case_097", "p02657_case_098", "p02657_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "a, b = input().split(\" \")\nprint((int(a) * int(b)))\n", "fast_code_sha256": "9e1db52c42374593650f3df676ab08a07d0a5c58b9bbba7915c83431423183c8", "fast_id": "p02657_9e1db52c42374593650f3df676ab08a07d0a5c58b9bbba7915c83431423183c8", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "a, b = input().split(\" \")\nprint((int(a) * int(b)))\n", "measured_fast_code_sha256": "9e1db52c42374593650f3df676ab08a07d0a5c58b9bbba7915c83431423183c8", "measured_slow_code": "a, b = list(map(float, input().split()))\nimport math\n\na = int(math.floor(a))\nb = int(math.floor(b * 100))\nc = math.floor(a * b / 100)\nprint(c)\n", "measured_slow_code_sha256": "b1697d82d892b2441ee34ccc53dde64479bc475c073927fdbb5370e4d2f6f2a7", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.0258742464887742, "pair_id": "python_v2_75577a1559e4171c2bf906f6", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02657", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02657_9e1db52c42374593650f3df676ab08a07d0a5c58b9bbba7915c83431423183c8.jsonl.gz", "inputs": "reproduction/python/inputs/p02657.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02657_b1697d82d892b2441ee34ccc53dde64479bc475c073927fdbb5370e4d2f6f2a7.jsonl.gz"}, "slow_code": "a, b = list(map(float, input().split()))\nimport math\n\na = int(math.floor(a))\nb = int(math.floor(b * 100))\nc = math.floor(a * b / 100)\nprint(c)\n", "slow_code_sha256": "b1697d82d892b2441ee34ccc53dde64479bc475c073927fdbb5370e4d2f6f2a7", "slow_id": "p02657_b1697d82d892b2441ee34ccc53dde64479bc475c073927fdbb5370e4d2f6f2a7", "speedup": 2.026112608795607, "stratum": "2-4", "within_pair_jaccard": 0.42857142857142855, "workload": {"case_count": 100, "description": "Compute the product of the two integer inputs A and B. Observed inputs: A=1..100 (median 34); B=1..100 (median 47.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 8, "median": 6.0, "min": 4}, "input_format": ["A B"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p02700_case_000", "p02700_case_001", "p02700_case_002", "p02700_case_003", "p02700_case_004", "p02700_case_005", "p02700_case_006", "p02700_case_007", "p02700_case_008", "p02700_case_009", "p02700_case_010", "p02700_case_011", "p02700_case_012", "p02700_case_013", "p02700_case_014", "p02700_case_015", "p02700_case_016", "p02700_case_017", "p02700_case_018", "p02700_case_019", "p02700_case_020", "p02700_case_021", "p02700_case_022", "p02700_case_023", "p02700_case_024", "p02700_case_025", "p02700_case_026", "p02700_case_027", "p02700_case_028", "p02700_case_029", "p02700_case_030", "p02700_case_031", "p02700_case_032", "p02700_case_033", "p02700_case_034", "p02700_case_035", "p02700_case_036", "p02700_case_037", "p02700_case_038", "p02700_case_039", "p02700_case_040", "p02700_case_041", "p02700_case_042", "p02700_case_043", "p02700_case_044", "p02700_case_045", "p02700_case_046", "p02700_case_047", "p02700_case_048", "p02700_case_049", "p02700_case_050", "p02700_case_051", "p02700_case_052", "p02700_case_053", "p02700_case_054", "p02700_case_055", "p02700_case_056", "p02700_case_057", "p02700_case_058", "p02700_case_059", "p02700_case_060", "p02700_case_061", "p02700_case_062", "p02700_case_063", "p02700_case_064", "p02700_case_065", "p02700_case_066", "p02700_case_067", "p02700_case_068", "p02700_case_069", "p02700_case_070", "p02700_case_071", "p02700_case_072", "p02700_case_073", "p02700_case_074", "p02700_case_075", "p02700_case_076", "p02700_case_077", "p02700_case_078", "p02700_case_079", "p02700_case_080", "p02700_case_081", "p02700_case_082", "p02700_case_083", "p02700_case_084", "p02700_case_085", "p02700_case_086", "p02700_case_087", "p02700_case_088", "p02700_case_089", "p02700_case_090", "p02700_case_091", "p02700_case_092", "p02700_case_093", "p02700_case_094", "p02700_case_095", "p02700_case_096", "p02700_case_097", "p02700_case_098", "p02700_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "a, b, c, d = list(map(int, input().split()))\nattack_t = c // b\nif c % b != 0:\n attack_t += 1\nattack_a = a // d\nif a % d != 0:\n attack_a += 1\nif attack_a >= attack_t:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "fast_code_sha256": "97e66cf257d6c2323391353a04a7aa5f8c742391877dcc51abf4bc8571960c25", "fast_id": "p02700_97e66cf257d6c2323391353a04a7aa5f8c742391877dcc51abf4bc8571960c25", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "a, b, c, d = list(map(int, input().split()))\nattack_t = c // b\nif c % b != 0:\n attack_t += 1\nattack_a = a // d\nif a % d != 0:\n attack_a += 1\nif attack_a >= attack_t:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "measured_fast_code_sha256": "97e66cf257d6c2323391353a04a7aa5f8c742391877dcc51abf4bc8571960c25", "measured_slow_code": "from math import floor, ceil, sqrt, factorial, log\nfrom collections import Counter, deque\nfrom functools import reduce\n\n# import numpy as np\ndef S():\n return eval(input())\n\n\ndef I():\n return int(eval(input()))\n\n\ndef MS():\n return list(map(str, input().split()))\n\n\ndef MI():\n return list(map(int, input().split()))\n\n\ndef FLI():\n return [int(i) for i in input().split()]\n\n\ndef LS():\n return list(MS())\n\n\ndef LI():\n return list(MI())\n\n\ndef LLS():\n return [list(map(str, l.split())) for l in eval(input())]\n\n\ndef LLI():\n return [list(map(int, l.split())) for l in eval(input())]\n\n\ndef LLSN(n: int):\n return [LS() for _ in range(n)]\n\n\ndef LLIN(n: int):\n return [LI() for _ in range(n)]\n\n\nA, B, C, D = MI()\nx = -(-A // D)\ny = -(-C // B)\nif x >= y:\n print(\"Yes\")\nelse:\n print(\"No\")\n# for i in range(100):\n# a -= B\n# if a <= 0:\n# print(\"Yes\")\n# exit()\n# t -= D\n# if t <= 0:\n# print(\"No\")\n# exit()\n", "measured_slow_code_sha256": "0800076b3be1d259d89fb0c2c371b4341f1c7fc8f7058a2f3f090ffddebf2dcb", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4.223037141269064, "pair_id": "python_v2_5abe92a35e787dfcde4eb975", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02700", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02700_97e66cf257d6c2323391353a04a7aa5f8c742391877dcc51abf4bc8571960c25.jsonl.gz", "inputs": "reproduction/python/inputs/p02700.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02700_0800076b3be1d259d89fb0c2c371b4341f1c7fc8f7058a2f3f090ffddebf2dcb.jsonl.gz"}, "slow_code": "from math import floor, ceil, sqrt, factorial, log\nfrom collections import Counter, deque\nfrom functools import reduce\n\n\ndef S():\n return eval(input())\n\n\ndef I():\n return int(eval(input()))\n\n\ndef MS():\n return list(map(str, input().split()))\n\n\ndef MI():\n return list(map(int, input().split()))\n\n\ndef FLI():\n return [int(i) for i in input().split()]\n\n\ndef LS():\n return list(MS())\n\n\ndef LI():\n return list(MI())\n\n\ndef LLS():\n return [list(map(str, l.split())) for l in eval(input())]\n\n\ndef LLI():\n return [list(map(int, l.split())) for l in eval(input())]\n\n\ndef LLSN(n: int):\n return [LS() for _ in range(n)]\n\n\ndef LLIN(n: int):\n return [LI() for _ in range(n)]\n\n\nA, B, C, D = MI()\nx = -(-A // D)\ny = -(-C // B)\nif x >= y:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "slow_code_sha256": "7feb6456d377ecdd9b0dcbfc30f9b0e6286836e7cba34a2d795c5cf979e98297", "slow_id": "p02700_0800076b3be1d259d89fb0c2c371b4341f1c7fc8f7058a2f3f090ffddebf2dcb", "speedup": 4.222814264324301, "stratum": "4-8", "within_pair_jaccard": 0.1694915254237288, "workload": {"case_count": 100, "description": "Two monsters have health/attack (A,B) and (C,D). Starting with the first monster, they attack alternately, subtracting their attack value from the opponent health. Determine whether the first wins by reducing opposing health to at most zero. Observed inputs: A=1..100 (median 73); B=1..100 (median 48.5); C=1..100 (median 80.5); D=1..100 (median 55).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 16, "median": 12.0, "min": 8}, "input_format": ["A B C D"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 4, "median": 4.0, "min": 4}}} -{"case_ids": ["p02716_case_000", "p02716_case_001", "p02716_case_002", "p02716_case_003", "p02716_case_004", "p02716_case_005", "p02716_case_006", "p02716_case_007", "p02716_case_008", "p02716_case_009", "p02716_case_010", "p02716_case_011", "p02716_case_012", "p02716_case_013", "p02716_case_014", "p02716_case_015", "p02716_case_016", "p02716_case_017", "p02716_case_018", "p02716_case_019", "p02716_case_020", "p02716_case_021", "p02716_case_022", "p02716_case_023", "p02716_case_024", "p02716_case_025", "p02716_case_026", "p02716_case_027", "p02716_case_028", "p02716_case_029", "p02716_case_030", "p02716_case_031", "p02716_case_032", "p02716_case_033", "p02716_case_034", "p02716_case_035", "p02716_case_036", "p02716_case_037", "p02716_case_038", "p02716_case_039", "p02716_case_040", "p02716_case_041", "p02716_case_042", "p02716_case_043", "p02716_case_044", "p02716_case_045", "p02716_case_046", "p02716_case_047", "p02716_case_048", "p02716_case_049", "p02716_case_050", "p02716_case_051", "p02716_case_052", "p02716_case_053", "p02716_case_054", "p02716_case_055", "p02716_case_056", "p02716_case_057", "p02716_case_058", "p02716_case_059", "p02716_case_060", "p02716_case_061", "p02716_case_062", "p02716_case_063", "p02716_case_064", "p02716_case_065", "p02716_case_066", "p02716_case_067", "p02716_case_068", "p02716_case_069", "p02716_case_070", "p02716_case_071", "p02716_case_072", "p02716_case_073", "p02716_case_074", "p02716_case_075", "p02716_case_076", "p02716_case_077", "p02716_case_078", "p02716_case_079", "p02716_case_080", "p02716_case_081", "p02716_case_082", "p02716_case_083", "p02716_case_084", "p02716_case_085", "p02716_case_086", "p02716_case_087", "p02716_case_088", "p02716_case_089", "p02716_case_090", "p02716_case_091", "p02716_case_092", "p02716_case_093", "p02716_case_094", "p02716_case_095", "p02716_case_096", "p02716_case_097", "p02716_case_098", "p02716_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\ninput = sys.stdin.readline\nn = int(eval(input()))\na = list(map(int, input().split()))\ndp = [0] * n\nc = a[0]\ndp[1] = max(a[0], a[1])\nfor i in range(2, n):\n if i % 2 == 0:\n c += a[i]\n dp[i] = max(dp[i - 2] + a[i], dp[i - 1])\n else:\n dp[i] = max(dp[i - 2] + a[i], c)\nprint((dp[-1]))\n", "fast_code_sha256": "c90ec233f5c2e155da8773eaeb4f4f89b96b046ea6e538b68f143636b57d580f", "fast_id": "p02716_c90ec233f5c2e155da8773eaeb4f4f89b96b046ea6e538b68f143636b57d580f", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\ninput = sys.stdin.readline\nn = int(eval(input()))\na = list(map(int, input().split()))\ndp = [0] * n\nc = a[0]\ndp[1] = max(a[0], a[1])\nfor i in range(2, n):\n if i % 2 == 0:\n c += a[i]\n dp[i] = max(dp[i - 2] + a[i], dp[i - 1])\n else:\n dp[i] = max(dp[i - 2] + a[i], c)\nprint((dp[-1]))\n", "measured_fast_code_sha256": "c90ec233f5c2e155da8773eaeb4f4f89b96b046ea6e538b68f143636b57d580f", "measured_slow_code": "from heapq import heappush, heappop, heapify\nfrom collections import deque, defaultdict, Counter\nimport itertools\nfrom itertools import permutations, combinations, accumulate\nimport sys\nimport bisect\nimport string\nimport math\nimport time\n\n\ndef I():\n return int(eval(input()))\n\n\ndef S():\n return eval(input())\n\n\ndef MI():\n return list(map(int, input().split()))\n\n\ndef MS():\n return list(map(str, input().split()))\n\n\ndef LI():\n return [int(i) for i in input().split()]\n\n\ndef LI_():\n return [int(i) - 1 for i in input().split()]\n\n\ndef StoI():\n return [ord(i) - 97 for i in eval(input())]\n\n\ndef ItoS(nn):\n return chr(nn + 97)\n\n\ndef input():\n return sys.stdin.readline().rstrip()\n\n\nyn = {False: \"No\", True: \"Yes\"}\nYN = {False: \"NO\", True: \"YES\"}\nMOD = 10**9 + 7\ninf = float(\"inf\")\nIINF = 10**10\nl_alp = string.ascii_lowercase\nu_alp = string.ascii_uppercase\nts = time.time()\nsys.setrecursionlimit(10**6)\nnums = [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\"]\nshow_flg = False\n# show_flg = True\ndef main():\n N = I()\n a = LI()\n dp = [0] * N\n dp[1] = max(a[0], a[1])\n c = a[0]\n for i in range(2, N):\n if i % 2 == 0:\n c += a[i]\n dp[i] = max(dp[i - 2] + a[i], dp[i - 1])\n else:\n dp[i] = max(dp[i - 2] + a[i], c)\n print((dp[-1]))\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "ae97c447785b06d1f5812a68515622d5acc48349199365015b8b5c8a994bd13d", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4.781072170996999, "pair_id": "python_v2_6e8ab845eeef54660e94bba0", "per_case_slow_code_faster_fraction": 0.27, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02716", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02716_c90ec233f5c2e155da8773eaeb4f4f89b96b046ea6e538b68f143636b57d580f.jsonl.gz", "inputs": "reproduction/python/inputs/p02716.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02716_ae97c447785b06d1f5812a68515622d5acc48349199365015b8b5c8a994bd13d.jsonl.gz"}, "slow_code": "from heapq import heappush, heappop, heapify\nfrom collections import deque, defaultdict, Counter\nimport itertools\nfrom itertools import permutations, combinations, accumulate\nimport sys\nimport bisect\nimport string\nimport math\nimport time\n\n\ndef I():\n return int(eval(input()))\n\n\ndef S():\n return eval(input())\n\n\ndef MI():\n return list(map(int, input().split()))\n\n\ndef MS():\n return list(map(str, input().split()))\n\n\ndef LI():\n return [int(i) for i in input().split()]\n\n\ndef LI_():\n return [int(i) - 1 for i in input().split()]\n\n\ndef StoI():\n return [ord(i) - 97 for i in eval(input())]\n\n\ndef ItoS(nn):\n return chr(nn + 97)\n\n\ndef input():\n return sys.stdin.readline().rstrip()\n\n\nyn = {False: \"No\", True: \"Yes\"}\nYN = {False: \"NO\", True: \"YES\"}\nMOD = 10**9 + 7\ninf = float(\"inf\")\nIINF = 10**10\nl_alp = string.ascii_lowercase\nu_alp = string.ascii_uppercase\nts = time.time()\nsys.setrecursionlimit(10**6)\nnums = [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\"]\nshow_flg = False\n\n\ndef main():\n N = I()\n a = LI()\n dp = [0] * N\n dp[1] = max(a[0], a[1])\n c = a[0]\n for i in range(2, N):\n if i % 2 == 0:\n c += a[i]\n dp[i] = max(dp[i - 2] + a[i], dp[i - 1])\n else:\n dp[i] = max(dp[i - 2] + a[i], c)\n print((dp[-1]))\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "1bcb5d76a0a5d68e7ba9b6269802f1acd8274da41797d4a3bfb682dbc9d2a825", "slow_id": "p02716_ae97c447785b06d1f5812a68515622d5acc48349199365015b8b5c8a994bd13d", "speedup": 2.957957834297895, "stratum": "2-4", "within_pair_jaccard": 0.26666666666666666, "workload": {"case_count": 100, "description": "Choose exactly floor(N/2) entries from an integer array, with no two chosen positions adjacent, to maximize their sum. Values may be negative. Observed inputs: N=2..200000 (median 100); A_i=-1000000000..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 2400007, "median": 1046.5, "min": 10}, "input_format": ["N\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200001, "median": 101.0, "min": 3}}} -{"case_ids": ["p03805_case_000", "p03805_case_001", "p03805_case_002", "p03805_case_003", "p03805_case_004", "p03805_case_005", "p03805_case_006", "p03805_case_007", "p03805_case_008", "p03805_case_009", "p03805_case_010", "p03805_case_011", "p03805_case_012", "p03805_case_013", "p03805_case_014", "p03805_case_015", "p03805_case_016", "p03805_case_017", "p03805_case_018", "p03805_case_019", "p03805_case_020", "p03805_case_021", "p03805_case_022", "p03805_case_023", "p03805_case_024", "p03805_case_025", "p03805_case_026", "p03805_case_027", "p03805_case_028", "p03805_case_029", "p03805_case_030", "p03805_case_031", "p03805_case_032", "p03805_case_033", "p03805_case_034", "p03805_case_035", "p03805_case_036", "p03805_case_037", "p03805_case_038", "p03805_case_039", "p03805_case_040", "p03805_case_041", "p03805_case_042", "p03805_case_043", "p03805_case_044", "p03805_case_045", "p03805_case_046", "p03805_case_047", "p03805_case_048", "p03805_case_049", "p03805_case_050", "p03805_case_051", "p03805_case_052", "p03805_case_053", "p03805_case_054", "p03805_case_055", "p03805_case_056", "p03805_case_057", "p03805_case_058", "p03805_case_059", "p03805_case_060", "p03805_case_061", "p03805_case_062", "p03805_case_063", "p03805_case_064", "p03805_case_065", "p03805_case_066", "p03805_case_067", "p03805_case_068", "p03805_case_069", "p03805_case_070", "p03805_case_071", "p03805_case_072", "p03805_case_073", "p03805_case_074", "p03805_case_075", "p03805_case_076", "p03805_case_077", "p03805_case_078", "p03805_case_079", "p03805_case_080", "p03805_case_081", "p03805_case_082", "p03805_case_083", "p03805_case_084", "p03805_case_085", "p03805_case_086", "p03805_case_087", "p03805_case_088", "p03805_case_089", "p03805_case_090", "p03805_case_091", "p03805_case_092", "p03805_case_093", "p03805_case_094", "p03805_case_095", "p03805_case_096", "p03805_case_097", "p03805_case_098", "p03805_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from collections import defaultdict\nimport itertools\n\nn, m = list(map(int, input().split()))\nconnected_dict = defaultdict(lambda: [])\nfor i in range(m):\n a, b = list(map(int, input().split()))\n connected_dict[a].append(b)\n connected_dict[b].append(a)\ncount = 0\nfor permutation in list(itertools.permutations(list(range(2, n + 1)))):\n flag = True\n pre_num = 1\n for num in permutation:\n if num not in connected_dict[pre_num]:\n flag = False\n break\n pre_num = num\n if flag:\n count += 1\nprint(count)\n", "fast_code_sha256": "151bd42f944ac95c44a3b3fa5702e264684f5dc5ea2d780c7b3be1f1bf679241", "fast_id": "p03805_151bd42f944ac95c44a3b3fa5702e264684f5dc5ea2d780c7b3be1f1bf679241", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from collections import defaultdict\nimport itertools\n\nn, m = list(map(int, input().split()))\nconnected_dict = defaultdict(lambda: [])\nfor i in range(m):\n a, b = list(map(int, input().split()))\n connected_dict[a].append(b)\n connected_dict[b].append(a)\ncount = 0\nfor permutation in list(itertools.permutations(list(range(2, n + 1)))):\n flag = True\n pre_num = 1\n for num in permutation:\n if num not in connected_dict[pre_num]:\n flag = False\n break\n pre_num = num\n if flag:\n count += 1\nprint(count)\n", "measured_fast_code_sha256": "151bd42f944ac95c44a3b3fa5702e264684f5dc5ea2d780c7b3be1f1bf679241", "measured_slow_code": "def getN():\n return int(eval(input()))\n\n\ndef getNM():\n return list(map(int, input().split()))\n\n\ndef getList():\n return list(map(int, input().split()))\n\n\ndef getArray(intn):\n return [int(eval(input())) for i in range(intn)]\n\n\ndef input():\n return sys.stdin.readline().rstrip()\n\n\nfrom collections import defaultdict, deque, Counter\nfrom sys import exit\nimport heapq\nimport math\nimport fractions\nimport copy\nfrom itertools import permutations\nfrom operator import mul\nfrom functools import reduce\nfrom bisect import bisect_left, bisect_right\nimport sys\n\nsys.setrecursionlimit(1000000000)\nmod = 10**9 + 7\nN, M = getNM()\ndist = [[] for i in range(N + 1)]\nfor i in range(M):\n a, b = getNM()\n dist[a - 1].append(b - 1)\n dist[b - 1].append(a - 1)\ncnt = 0\npos = deque([[1 << 0, 0]])\nwhile len(pos) > 0:\n s, v = pos.popleft()\n if s == (1 << N) - 1:\n cnt += 1\n for u in dist[v]:\n if s & (1 << u):\n continue\n pos.append([s | (1 << u), u])\nprint(cnt)\n", "measured_slow_code_sha256": "1ee773003e3c1cf2505debdef879b800379f8e81a80001be71fff6fb14cc8f55", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 12.092012856396899, "pair_id": "python_v2_54dff1db1ba47d5cf35e7706", "per_case_slow_code_faster_fraction": 0.16, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03805", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03805_151bd42f944ac95c44a3b3fa5702e264684f5dc5ea2d780c7b3be1f1bf679241.jsonl.gz", "inputs": "reproduction/python/inputs/p03805.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03805_1ee773003e3c1cf2505debdef879b800379f8e81a80001be71fff6fb14cc8f55.jsonl.gz"}, "slow_code": "def getN():\n return int(eval(input()))\n\n\ndef getNM():\n return list(map(int, input().split()))\n\n\ndef getList():\n return list(map(int, input().split()))\n\n\ndef getArray(intn):\n return [int(eval(input())) for i in range(intn)]\n\n\ndef input():\n return sys.stdin.readline().rstrip()\n\n\nfrom collections import defaultdict, deque, Counter\nfrom sys import exit\nimport heapq\nimport math\nimport fractions\nimport copy\nfrom itertools import permutations\nfrom operator import mul\nfrom functools import reduce\nfrom bisect import bisect_left, bisect_right\nimport sys\n\nsys.setrecursionlimit(1000000000)\nmod = 10**9 + 7\nN, M = getNM()\ndist = [[] for i in range(N + 1)]\nfor i in range(M):\n a, b = getNM()\n dist[a - 1].append(b - 1)\n dist[b - 1].append(a - 1)\ncnt = 0\npos = deque([[1 << 0, 0]])\nwhile len(pos) > 0:\n s, v = pos.popleft()\n if s == (1 << N) - 1:\n cnt += 1\n for u in dist[v]:\n if s & (1 << u):\n continue\n pos.append([s | (1 << u), u])\nprint(cnt)\n", "slow_code_sha256": "1ee773003e3c1cf2505debdef879b800379f8e81a80001be71fff6fb14cc8f55", "slow_id": "p03805_1ee773003e3c1cf2505debdef879b800379f8e81a80001be71fff6fb14cc8f55", "speedup": 6.652190917897154, "stratum": "4-8", "within_pair_jaccard": 0.275, "workload": {"case_count": 100, "description": "Count paths starting at vertex 1 and visiting all N vertices exactly once in a simple unweighted undirected graph. Disconnected graphs and zero edges are allowed. Edges use 1-based endpoints a_i K:\n break\n dp[i + a] = 1\n print((\"First\" if dp[-1] else \"Second\"))\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "a2624425a9b93e6559ac62ba782b26bed674b805c5d6c4a13b00b3b9cc35d295", "fast_id": "p03170_a2624425a9b93e6559ac62ba782b26bed674b805c5d6c4a13b00b3b9cc35d295", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def main():\n N, K, *A = list(map(int, open(0).read().split()))\n dp = [0] * (K + 1)\n for i in range(K):\n if dp[i]:\n continue\n for a in A:\n if i + a > K:\n break\n dp[i + a] = 1\n print((\"First\" if dp[-1] else \"Second\"))\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "a2624425a9b93e6559ac62ba782b26bed674b805c5d6c4a13b00b3b9cc35d295", "measured_slow_code": "N, K = list(map(int, input().split()))\nA = list(map(int, input().split()))\ndp = [\"First\"] * (K + 1)\ndp[0] = \"Second\"\n\n\ndef solve(dp):\n for i in range(1, K + 1):\n for j in range(N):\n dp[i] = \"Second\"\n if dp[i - A[j]] == \"Second\":\n dp[i] = \"First\"\n break\n ans = dp[K]\n return ans\n\n\nprint((solve(dp)))\n", "measured_slow_code_sha256": "8112cd387b0dc72e3c242f7bfd507977d7eda664d1c31dd3923eb0876c50cba5", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 8.258897482766024, "pair_id": "python_v2_0ce568ff434223749648b699", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03170", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03170_a2624425a9b93e6559ac62ba782b26bed674b805c5d6c4a13b00b3b9cc35d295.jsonl.gz", "inputs": "reproduction/python/inputs/p03170.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03170_8112cd387b0dc72e3c242f7bfd507977d7eda664d1c31dd3923eb0876c50cba5.jsonl.gz"}, "slow_code": "N, K = list(map(int, input().split()))\nA = list(map(int, input().split()))\ndp = [\"First\"] * (K + 1)\ndp[0] = \"Second\"\n\n\ndef solve(dp):\n for i in range(1, K + 1):\n for j in range(N):\n dp[i] = \"Second\"\n if dp[i - A[j]] == \"Second\":\n dp[i] = \"First\"\n break\n ans = dp[K]\n return ans\n\n\nprint((solve(dp)))\n", "slow_code_sha256": "8112cd387b0dc72e3c242f7bfd507977d7eda664d1c31dd3923eb0876c50cba5", "slow_id": "p03170_8112cd387b0dc72e3c242f7bfd507977d7eda664d1c31dd3923eb0876c50cba5", "speedup": 7.0233715669195815, "stratum": "4-8", "within_pair_jaccard": 0.6060606060606061, "workload": {"case_count": 100, "description": "Two optimal players alternate removing a permitted number of stones from a pile initially of size K. Allowed removals a_i form a strictly increasing set of N integers. The first player unable to move loses; determine the winner. Observed inputs: N=1..100 (median 100); K=1..100000 (median 100000); a_i=1..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 610, "median": 597.5, "min": 6}, "input_format": ["N K\na_1 ... a_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 102, "median": 102.0, "min": 3}}} -{"case_ids": ["p03767_case_000", "p03767_case_001", "p03767_case_002", "p03767_case_003", "p03767_case_004", "p03767_case_005", "p03767_case_006", "p03767_case_007", "p03767_case_008", "p03767_case_009", "p03767_case_010", "p03767_case_011", "p03767_case_012", "p03767_case_013", "p03767_case_014", "p03767_case_015", "p03767_case_016", "p03767_case_017", "p03767_case_018", "p03767_case_019", "p03767_case_020", "p03767_case_021", "p03767_case_022", "p03767_case_023", "p03767_case_024", "p03767_case_025", "p03767_case_026", "p03767_case_027", "p03767_case_028", "p03767_case_029", "p03767_case_030", "p03767_case_031", "p03767_case_032", "p03767_case_033", "p03767_case_034", "p03767_case_035", "p03767_case_036", "p03767_case_037", "p03767_case_038", "p03767_case_039", "p03767_case_040", "p03767_case_041", "p03767_case_042", "p03767_case_043", "p03767_case_044", "p03767_case_045", "p03767_case_046", "p03767_case_047", "p03767_case_048", "p03767_case_049", "p03767_case_050", "p03767_case_051", "p03767_case_052", "p03767_case_053", "p03767_case_054", "p03767_case_055", "p03767_case_056", "p03767_case_057", "p03767_case_058", "p03767_case_059", "p03767_case_060", "p03767_case_061", "p03767_case_062", "p03767_case_063", "p03767_case_064", "p03767_case_065", "p03767_case_066", "p03767_case_067", "p03767_case_068", "p03767_case_069", "p03767_case_070", "p03767_case_071", "p03767_case_072", "p03767_case_073", "p03767_case_074", "p03767_case_075", "p03767_case_076", "p03767_case_077", "p03767_case_078", "p03767_case_079", "p03767_case_080", "p03767_case_081", "p03767_case_082", "p03767_case_083", "p03767_case_084", "p03767_case_085", "p03767_case_086", "p03767_case_087", "p03767_case_088", "p03767_case_089", "p03767_case_090", "p03767_case_091", "p03767_case_092", "p03767_case_093", "p03767_case_094", "p03767_case_095", "p03767_case_096", "p03767_case_097", "p03767_case_098", "p03767_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\na = list(map(int, input().split()))\na.sort()\nprint((sum(a[n::2])))\n", "fast_code_sha256": "ecf388e097fdf4731a2ffbc914b52c1b309da61cba2083e3b54a7133b06af3b6", "fast_id": "p03767_ecf388e097fdf4731a2ffbc914b52c1b309da61cba2083e3b54a7133b06af3b6", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\na = list(map(int, input().split()))\na.sort()\nprint((sum(a[n::2])))\n", "measured_fast_code_sha256": "ecf388e097fdf4731a2ffbc914b52c1b309da61cba2083e3b54a7133b06af3b6", "measured_slow_code": "from collections import Counter, defaultdict, deque\nfrom heapq import heappop, heappush, heapify\nimport sys, bisect, math, itertools, fractions, pprint\n\nsys.setrecursionlimit(10**8)\nmod = 10**9 + 7\nINF = float(\"inf\")\n\n\ndef inp():\n return int(sys.stdin.readline())\n\n\ndef inpl():\n return list(map(int, sys.stdin.readline().split()))\n\n\nn = inp()\na = inpl()\na.sort(reverse=True)\ncnt = n\nind = 0\nres = 0\nwhile cnt:\n if ind % 2:\n res += a[ind]\n cnt -= 1\n ind += 1\nprint(res)\n", "measured_slow_code_sha256": "7693ad55686e6fd618fa19be5402464b2c1d8a6534c46b08c3072eed6c243853", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.5718659570389963, "pair_id": "python_v2_78e4be42c4af034440c80326", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03767", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03767_ecf388e097fdf4731a2ffbc914b52c1b309da61cba2083e3b54a7133b06af3b6.jsonl.gz", "inputs": "reproduction/python/inputs/p03767.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03767_7693ad55686e6fd618fa19be5402464b2c1d8a6534c46b08c3072eed6c243853.jsonl.gz"}, "slow_code": "from collections import Counter, defaultdict, deque\nfrom heapq import heappop, heappush, heapify\nimport sys, bisect, math, itertools, fractions, pprint\n\nsys.setrecursionlimit(10**8)\nmod = 10**9 + 7\nINF = float(\"inf\")\n\n\ndef inp():\n return int(sys.stdin.readline())\n\n\ndef inpl():\n return list(map(int, sys.stdin.readline().split()))\n\n\nn = inp()\na = inpl()\na.sort(reverse=True)\ncnt = n\nind = 0\nres = 0\nwhile cnt:\n if ind % 2:\n res += a[ind]\n cnt -= 1\n ind += 1\nprint(res)\n", "slow_code_sha256": "7693ad55686e6fd618fa19be5402464b2c1d8a6534c46b08c3072eed6c243853", "slow_id": "p03767_7693ad55686e6fd618fa19be5402464b2c1d8a6534c46b08c3072eed6c243853", "speedup": 6.363325067113005, "stratum": "4-8", "within_pair_jaccard": 0.17307692307692307, "workload": {"case_count": 100, "description": "Partition 3N participants into N disjoint teams of three. A team strength is its second-largest member strength, counting ties. Maximize the sum of team strengths. Observed inputs: N=1..100000 (median 1000); participants=3..300000 (median 3000); a_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 3300007, "median": 29687.0, "min": 8}, "input_format": ["N\na_1 ... a_(3N)"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 300001, "median": 3001.0, "min": 4}}} -{"case_ids": ["p00008_case_000", "p00008_case_001", "p00008_case_002", "p00008_case_003", "p00008_case_004", "p00008_case_005", "p00008_case_006", "p00008_case_007", "p00008_case_008", "p00008_case_009", "p00008_case_010", "p00008_case_011", "p00008_case_012", "p00008_case_013", "p00008_case_014", "p00008_case_015", "p00008_case_016", "p00008_case_017", "p00008_case_018", "p00008_case_019", "p00008_case_020", "p00008_case_021", "p00008_case_022", "p00008_case_023", "p00008_case_024", "p00008_case_025", "p00008_case_026", "p00008_case_027", "p00008_case_028", "p00008_case_029", "p00008_case_030", "p00008_case_031", "p00008_case_032", "p00008_case_033", "p00008_case_034", "p00008_case_035", "p00008_case_036", "p00008_case_037", "p00008_case_038", "p00008_case_039", "p00008_case_040", "p00008_case_041", "p00008_case_042", "p00008_case_043", "p00008_case_044", "p00008_case_045", "p00008_case_046", "p00008_case_047", "p00008_case_048", "p00008_case_049", "p00008_case_050", "p00008_case_051", "p00008_case_052", "p00008_case_053", "p00008_case_054", "p00008_case_055", "p00008_case_056", "p00008_case_057", "p00008_case_058", "p00008_case_059", "p00008_case_060", "p00008_case_061", "p00008_case_062", "p00008_case_063", "p00008_case_064", "p00008_case_065", "p00008_case_066", "p00008_case_067", "p00008_case_068", "p00008_case_069", "p00008_case_070", "p00008_case_071", "p00008_case_072", "p00008_case_073", "p00008_case_074", "p00008_case_075", "p00008_case_076", "p00008_case_077", "p00008_case_078", "p00008_case_079", "p00008_case_080", "p00008_case_081", "p00008_case_082", "p00008_case_083", "p00008_case_084", "p00008_case_085", "p00008_case_086", "p00008_case_087", "p00008_case_088", "p00008_case_089", "p00008_case_090", "p00008_case_091", "p00008_case_092", "p00008_case_093", "p00008_case_094", "p00008_case_095", "p00008_case_096", "p00008_case_097", "p00008_case_098", "p00008_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\na = [0] * 51\nfor i in range(19):\n a[i] = a[36 - i] = (i + 3) * (i + 2) * (i + 1) // 6 - max(\n 2 * (i - 9) * (i - 8) * (i - 7) // 3, 0\n )\nfor e in sys.stdin:\n print((a[int(e)]))\n", "fast_code_sha256": "2976d82837adaad46a6343a936d7192173f7d77383ba3da1e8bc63a620ee677b", "fast_id": "p00008_2976d82837adaad46a6343a936d7192173f7d77383ba3da1e8bc63a620ee677b", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\na = [0] * 51\nfor i in range(19):\n a[i] = a[36 - i] = (i + 3) * (i + 2) * (i + 1) // 6 - max(\n 2 * (i - 9) * (i - 8) * (i - 7) // 3, 0\n )\nfor e in sys.stdin:\n print((a[int(e)]))\n", "measured_fast_code_sha256": "2976d82837adaad46a6343a936d7192173f7d77383ba3da1e8bc63a620ee677b", "measured_slow_code": "import sys, itertools\n\nfor n in map(int, sys.stdin):\n x = 0\n for num in itertools.product(\"0123456789\", repeat=4):\n eq = \"{}+{}+{}+{}\".format(*(num))\n if eval(eq) == n:\n x += 1\n print(x)\n", "measured_slow_code_sha256": "f78324b8c1f2014a7fb42b155a7df64e78b2806e6504b01d6dd4fa1d3a1e1f70", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 7431.52292608089, "pair_id": "python_v2_1956e5a037cecd6d339981d1", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p00008", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p00008_2976d82837adaad46a6343a936d7192173f7d77383ba3da1e8bc63a620ee677b.jsonl.gz", "inputs": "reproduction/python/inputs/p00008.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p00008_f78324b8c1f2014a7fb42b155a7df64e78b2806e6504b01d6dd4fa1d3a1e1f70.jsonl.gz"}, "slow_code": "import sys, itertools\n\nfor n in map(int, sys.stdin):\n x = 0\n for num in itertools.product(\"0123456789\", repeat=4):\n eq = \"{}+{}+{}+{}\".format(*(num))\n if eval(eq) == n:\n x += 1\n print(x)\n", "slow_code_sha256": "f78324b8c1f2014a7fb42b155a7df64e78b2806e6504b01d6dd4fa1d3a1e1f70", "slow_id": "p00008_f78324b8c1f2014a7fb42b155a7df64e78b2806e6504b01d6dd4fa1d3a1e1f70", "speedup": 5822.92173591008, "stratum": "8+", "within_pair_jaccard": 0.2647058823529412, "workload": {"case_count": 100, "description": "For each target n, count ordered quadruples of decimal digits a,b,c,d in 0..9 whose sum is n. Targets are given one per line until end of input. Observed inputs: datasets=1..50 (median 10); n=1..50.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 150, "median": 26.5, "min": 2}, "input_format": ["n_1\n...\nn_D (until EOF)"], "input_format_status": "source_input_section", "input_lines": {"max": 50, "median": 10.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 50, "median": 10.0, "min": 1}}} -{"case_ids": ["p03078_case_000", "p03078_case_001", "p03078_case_002", "p03078_case_003", "p03078_case_004", "p03078_case_005", "p03078_case_006", "p03078_case_007", "p03078_case_008", "p03078_case_009", "p03078_case_010", "p03078_case_011", "p03078_case_012", "p03078_case_013", "p03078_case_014", "p03078_case_015", "p03078_case_016", "p03078_case_017", "p03078_case_018", "p03078_case_019", "p03078_case_020", "p03078_case_021", "p03078_case_022", "p03078_case_023", "p03078_case_024", "p03078_case_025", "p03078_case_026", "p03078_case_027", "p03078_case_028", "p03078_case_029", "p03078_case_030", "p03078_case_031", "p03078_case_032", "p03078_case_033", "p03078_case_034", "p03078_case_035", "p03078_case_036", "p03078_case_037", "p03078_case_038", "p03078_case_039", "p03078_case_040", "p03078_case_041", "p03078_case_042", "p03078_case_043", "p03078_case_044", "p03078_case_045", "p03078_case_046", "p03078_case_047", "p03078_case_048", "p03078_case_049", "p03078_case_050", "p03078_case_051", "p03078_case_052", "p03078_case_053", "p03078_case_054", "p03078_case_055", "p03078_case_056", "p03078_case_057", "p03078_case_059", "p03078_case_060", "p03078_case_061", "p03078_case_062", "p03078_case_063", "p03078_case_064", "p03078_case_065", "p03078_case_066", "p03078_case_067", "p03078_case_069", "p03078_case_070", "p03078_case_071", "p03078_case_072", "p03078_case_073", "p03078_case_074", "p03078_case_075", "p03078_case_076", "p03078_case_077", "p03078_case_078", "p03078_case_079", "p03078_case_080", "p03078_case_081", "p03078_case_082", "p03078_case_083", "p03078_case_084", "p03078_case_085", "p03078_case_086", "p03078_case_087", "p03078_case_088", "p03078_case_089", "p03078_case_090", "p03078_case_091", "p03078_case_092", "p03078_case_093", "p03078_case_094", "p03078_case_095", "p03078_case_096", "p03078_case_097", "p03078_case_098", "p03078_case_099", "p03078_v2_67e3066218a5a534bee9", "p03078_v2_bf0d7ab34a53dfd7f197"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import bisect\nimport heapq\nimport math\nimport random\nimport sys\nfrom collections import Counter, defaultdict, deque\nfrom decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal\nfrom functools import lru_cache, reduce\nfrom itertools import combinations, combinations_with_replacement, product, permutations\nfrom operator import add, mul, sub\n\nsys.setrecursionlimit(100000)\n\n\ndef read_int():\n return int(input())\n\n\ndef read_int_n():\n return list(map(int, input().split()))\n\n\ndef read_float():\n return float(input())\n\n\ndef read_float_n():\n return list(map(float, input().split()))\n\n\ndef read_str():\n return input().strip()\n\n\ndef read_str_n():\n return list(map(str, input().split()))\n\n\ndef error_print(*args):\n print(*args, file=sys.stderr)\n\n\ndef mt(f):\n import time\n\n def wrap(*args, **kwargs):\n s = time.time()\n ret = f(*args, **kwargs)\n e = time.time()\n error_print(e - s, \"sec\")\n return ret\n\n return wrap\n\n\n@mt\ndef slv(A, B, C, K):\n A.sort(reverse=True)\n B.sort(reverse=True)\n C.sort(reverse=True)\n\n def s(i, j, k):\n return A[i] + B[j] + C[k]\n\n used = set()\n cand = []\n if 1 < len(A):\n heapq.heappush(cand, (-s(1, 0, 0), (1, 0, 0)))\n used.add((1, 0, 0))\n if 1 < len(B):\n heapq.heappush(cand, (-s(0, 1, 0), (0, 1, 0)))\n used.add((0, 1, 0))\n if 1 < len(C):\n heapq.heappush(cand, (-s(0, 0, 1), (0, 0, 1)))\n used.add((0, 0, 1))\n print(s(0, 0, 0))\n for _ in range(K - 1):\n v, i = heapq.heappop(cand)\n print(-v)\n ti = (i[0] + 1, i[1], i[2])\n if ti[0] < len(A) and ti not in used:\n heapq.heappush(cand, (-s(*ti), ti))\n used.add(ti)\n ti = (i[0], i[1] + 1, i[2])\n if ti[1] < len(B) and ti not in used:\n heapq.heappush(cand, (-s(*ti), ti))\n used.add(ti)\n ti = (i[0], i[1], i[2] + 1)\n if ti[2] < len(C) and ti not in used:\n heapq.heappush(cand, (-s(*ti), ti))\n used.add(ti)\n\n\ndef main():\n\n X, Y, Z, K = read_int_n()\n A = read_int_n()\n B = read_int_n()\n C = read_int_n()\n (slv(A, B, C, K))\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "208dc3cecc011a1d6f1c280b0bd4e4eec20a113fb34fa0ea4cdd1ef8acb53ffa", "fast_id": "p03078_af3938b5098d66dbd4cf352874439161a52856283bd75df5793b57e872c52749", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "# -*- coding: utf-8 -*-\nimport bisect\nimport heapq\nimport math\nimport random\nimport sys\nfrom collections import Counter, defaultdict, deque\nfrom decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal\nfrom functools import lru_cache, reduce\nfrom itertools import combinations, combinations_with_replacement, product, permutations\nfrom operator import add, mul, sub\n\nsys.setrecursionlimit(100000)\n\n\ndef read_int():\n return int(input())\n\n\ndef read_int_n():\n return list(map(int, input().split()))\n\n\ndef read_float():\n return float(input())\n\n\ndef read_float_n():\n return list(map(float, input().split()))\n\n\ndef read_str():\n return input().strip()\n\n\ndef read_str_n():\n return list(map(str, input().split()))\n\n\ndef error_print(*args):\n print(*args, file=sys.stderr)\n\n\ndef mt(f):\n import time\n\n def wrap(*args, **kwargs):\n s = time.time()\n ret = f(*args, **kwargs)\n e = time.time()\n error_print(e - s, \"sec\")\n return ret\n\n return wrap\n\n\n@mt\ndef slv(A, B, C, K):\n A.sort(reverse=True)\n B.sort(reverse=True)\n C.sort(reverse=True)\n\n def s(i, j, k):\n return A[i] + B[j] + C[k]\n\n used = set()\n cand = []\n if 1 < len(A):\n heapq.heappush(cand, (-s(1, 0, 0), (1, 0, 0)))\n used.add((1, 0, 0))\n if 1 < len(B):\n heapq.heappush(cand, (-s(0, 1, 0), (0, 1, 0)))\n used.add((0, 1, 0))\n if 1 < len(C):\n heapq.heappush(cand, (-s(0, 0, 1), (0, 0, 1)))\n used.add((0, 0, 1))\n print(s(0, 0, 0))\n for _ in range(K - 1):\n v, i = heapq.heappop(cand)\n print(-v)\n ti = (i[0] + 1, i[1], i[2])\n if ti[0] < len(A) and ti not in used:\n heapq.heappush(cand, (-s(*ti), ti))\n used.add(ti)\n ti = (i[0], i[1] + 1, i[2])\n if ti[1] < len(B) and ti not in used:\n heapq.heappush(cand, (-s(*ti), ti))\n used.add(ti)\n ti = (i[0], i[1], i[2] + 1)\n if ti[2] < len(C) and ti not in used:\n heapq.heappush(cand, (-s(*ti), ti))\n used.add(ti)\n\n\ndef main():\n # for _ in range(1000):\n # K = 3000\n # A = [random.randint(1, 10000000000) for _ in range(random.randint(1, 1000))]\n # B = [random.randint(1, 10000000000) for _ in range(random.randint(1, 1000))]\n # C = [random.randint(1, 10000000000) for _ in range(random.randint(1, 1000))]\n # K = min(K, len(A) + len(B) + len(C))\n # slv(A,B,C,K)\n # N = read_int()\n X, Y, Z, K = read_int_n()\n A = read_int_n()\n B = read_int_n()\n C = read_int_n()\n (slv(A, B, C, K))\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "af3938b5098d66dbd4cf352874439161a52856283bd75df5793b57e872c52749", "measured_slow_code": "import heapq\n\nX, Y, Z, K = [int(i) for i in input().split(\" \")]\nA = [int(i) for i in input().split(\" \")]\nB = [int(i) for i in input().split(\" \")]\nC = [int(i) for i in input().split(\" \")]\nAB = []\nfor a in A:\n for b in B:\n AB.append(a + b)\nAB = heapq.nlargest(K, AB)\nABC = []\nfor ab in AB:\n for c in C:\n ABC.append(ab + c)\nfor cake in heapq.nlargest(K, ABC):\n print(cake)\n", "measured_slow_code_sha256": "f692785f7a8045dd21b92d6003fee39b080fd64f8a8b9324756854b8f70f519a", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 27.32678904104389, "pair_id": "python_v2_034f459c2a012e26b7f6494c", "per_case_slow_code_faster_fraction": 0.32, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03078", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03078_af3938b5098d66dbd4cf352874439161a52856283bd75df5793b57e872c52749.jsonl.gz", "inputs": "reproduction/python/inputs/p03078.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03078_f692785f7a8045dd21b92d6003fee39b080fd64f8a8b9324756854b8f70f519a.jsonl.gz"}, "slow_code": "import heapq\n\nX, Y, Z, K = [int(i) for i in input().split(\" \")]\nA = [int(i) for i in input().split(\" \")]\nB = [int(i) for i in input().split(\" \")]\nC = [int(i) for i in input().split(\" \")]\nAB = []\nfor a in A:\n for b in B:\n AB.append(a + b)\nAB = heapq.nlargest(K, AB)\nABC = []\nfor ab in AB:\n for c in C:\n ABC.append(ab + c)\nfor cake in heapq.nlargest(K, ABC):\n print(cake)\n", "slow_code_sha256": "f692785f7a8045dd21b92d6003fee39b080fd64f8a8b9324756854b8f70f519a", "slow_id": "p03078_f692785f7a8045dd21b92d6003fee39b080fd64f8a8b9324756854b8f70f519a", "speedup": 6.143991797319184, "stratum": "4-8", "within_pair_jaccard": 0.1553398058252427, "workload": {"case_count": 100, "description": "Choose one entry from each of arrays A,B,C of lengths X,Y,Z. Print the K largest resulting sums, retaining multiplicities of different index triples. Observed inputs: X=1..1000 (median 100); Y=1..1000 (median 100); Z=1..1000 (median 400); K=1..3000 (median 3000); A_i=1..10000000000; B_i=1..10000000000; C_i=1..10000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 36020, "median": 6015.5, "min": 14}, "input_format": ["X Y Z K\nA_1 ... A_X\nB_1 ... B_Y\nC_1 ... C_Z"], "input_format_status": "source_input_section", "input_lines": {"max": 4, "median": 4.0, "min": 4}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3004, "median": 1804.0, "min": 7}}} -{"case_ids": ["p03371_case_000", "p03371_case_001", "p03371_case_002", "p03371_case_003", "p03371_case_004", "p03371_case_005", "p03371_case_006", "p03371_case_007", "p03371_case_008", "p03371_case_009", "p03371_case_010", "p03371_case_011", "p03371_case_012", "p03371_case_013", "p03371_case_014", "p03371_case_015", "p03371_case_016", "p03371_case_017", "p03371_case_018", "p03371_case_019", "p03371_case_020", "p03371_case_021", "p03371_case_022", "p03371_case_023", "p03371_case_024", "p03371_case_025", "p03371_case_026", "p03371_case_027", "p03371_case_028", "p03371_case_029", "p03371_case_030", "p03371_case_031", "p03371_case_032", "p03371_case_033", "p03371_case_034", "p03371_case_035", "p03371_case_036", "p03371_case_037", "p03371_case_038", "p03371_case_039", "p03371_case_040", "p03371_case_041", "p03371_case_042", "p03371_case_043", "p03371_case_044", "p03371_case_045", "p03371_case_046", "p03371_case_047", "p03371_case_048", "p03371_case_049", "p03371_case_050", "p03371_case_051", "p03371_case_052", "p03371_case_053", "p03371_case_054", "p03371_case_055", "p03371_case_056", "p03371_case_057", "p03371_case_058", "p03371_case_059", "p03371_case_060", "p03371_case_061", "p03371_case_062", "p03371_case_063", "p03371_case_064", "p03371_case_065", "p03371_case_066", "p03371_case_067", "p03371_case_068", "p03371_case_069", "p03371_case_070", "p03371_case_071", "p03371_case_072", "p03371_case_073", "p03371_case_074", "p03371_case_075", "p03371_case_076", "p03371_case_077", "p03371_case_078", "p03371_case_079", "p03371_case_080", "p03371_case_081", "p03371_case_082", "p03371_case_083", "p03371_case_084", "p03371_case_085", "p03371_case_086", "p03371_case_087", "p03371_case_088", "p03371_case_089", "p03371_case_090", "p03371_case_091", "p03371_case_092", "p03371_case_093", "p03371_case_094", "p03371_case_095", "p03371_case_096", "p03371_case_097", "p03371_case_098", "p03371_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "A, B, C, X, Y = list(map(int, input().split()))\nif A + B < 2 * C:\n ans = A * X + B * Y\nelse:\n XY = min(X, Y)\n ans = min(A * (X - XY) + B * (Y - XY) + 2 * C * XY, 2 * C * max(X, Y))\nprint(ans)\n", "fast_code_sha256": "73f1d18be695c1a86ec1bb2887213dc88dab15703abc9e934b1a9c5df78397d9", "fast_id": "p03371_73f1d18be695c1a86ec1bb2887213dc88dab15703abc9e934b1a9c5df78397d9", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "A, B, C, X, Y = list(map(int, input().split()))\nif A + B < 2 * C:\n ans = A * X + B * Y\nelse:\n XY = min(X, Y)\n ans = min(A * (X - XY) + B * (Y - XY) + 2 * C * XY, 2 * C * max(X, Y))\nprint(ans)\n", "measured_fast_code_sha256": "73f1d18be695c1a86ec1bb2887213dc88dab15703abc9e934b1a9c5df78397d9", "measured_slow_code": "a, b, c, x, y = list(map(int, input().split()))\nmi = 10**10\nfor i in range(10**6):\n cost = c * 2 * i + a * max((x - i), 0) + b * max((y - i), 0)\n if cost < mi:\n mi = cost\nprint(mi)\n", "measured_slow_code_sha256": "d423368c3404af0d794647ac92b41960ae5bb9ea8edef19ff71fb40275e2bb52", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 14443.023455361164, "pair_id": "python_v2_c28d62aa41e14b80a82c324e", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03371", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03371_73f1d18be695c1a86ec1bb2887213dc88dab15703abc9e934b1a9c5df78397d9.jsonl.gz", "inputs": "reproduction/python/inputs/p03371.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03371_d423368c3404af0d794647ac92b41960ae5bb9ea8edef19ff71fb40275e2bb52.jsonl.gz"}, "slow_code": "a, b, c, x, y = list(map(int, input().split()))\nmi = 10**10\nfor i in range(10**6):\n cost = c * 2 * i + a * max((x - i), 0) + b * max((y - i), 0)\n if cost < mi:\n mi = cost\nprint(mi)\n", "slow_code_sha256": "d423368c3404af0d794647ac92b41960ae5bb9ea8edef19ff71fb40275e2bb52", "slow_id": "p03371_d423368c3404af0d794647ac92b41960ae5bb9ea8edef19ff71fb40275e2bb52", "speedup": 14444.149149009183, "stratum": "8+", "within_pair_jaccard": 0.28125, "workload": {"case_count": 100, "description": "Whole pizzas of types A and B cost A and B; a mixed half-A/half-B pizza costs C. Buy at least X whole-A and Y whole-B equivalents, combining mixed pizzas in pairs. Minimize cost; surplus is allowed. Observed inputs: A=1..5000; B=1..5000; C=1..5000; X=1..100000 (median 56080.5); Y=1..100000 (median 40245).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 29, "median": 25.5, "min": 10}, "input_format": ["A B C X Y"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 5, "median": 5.0, "min": 5}}} -{"case_ids": ["p02695_case_000", "p02695_case_001", "p02695_case_002", "p02695_case_003", "p02695_case_004", "p02695_case_005", "p02695_case_006", "p02695_case_007", "p02695_case_008", "p02695_case_009", "p02695_case_010", "p02695_case_011", "p02695_case_012", "p02695_case_013", "p02695_case_014", "p02695_case_015", "p02695_case_016", "p02695_case_017", "p02695_case_018", "p02695_case_019", "p02695_case_020", "p02695_case_021", "p02695_case_022", "p02695_case_023", "p02695_case_024", "p02695_case_025", "p02695_case_026", "p02695_case_027", "p02695_case_028", "p02695_case_029", "p02695_case_030", "p02695_case_031", "p02695_case_032", "p02695_case_033", "p02695_case_034", "p02695_case_035", "p02695_case_036", "p02695_case_037", "p02695_case_038", "p02695_case_039", "p02695_case_040", "p02695_case_041", "p02695_case_042", "p02695_case_043", "p02695_case_044", "p02695_case_045", "p02695_case_046", "p02695_case_047", "p02695_case_048", "p02695_case_049", "p02695_case_050", "p02695_case_051", "p02695_case_052", "p02695_case_053", "p02695_case_054", "p02695_case_055", "p02695_case_056", "p02695_case_057", "p02695_case_058", "p02695_case_059", "p02695_case_060", "p02695_case_061", "p02695_case_062", "p02695_case_063", "p02695_case_064", "p02695_case_065", "p02695_case_066", "p02695_case_067", "p02695_case_068", "p02695_case_069", "p02695_case_070", "p02695_case_071", "p02695_case_072", "p02695_case_073", "p02695_case_074", "p02695_case_075", "p02695_case_076", "p02695_case_077", "p02695_case_078", "p02695_case_079", "p02695_case_080", "p02695_case_081", "p02695_case_082", "p02695_case_083", "p02695_case_084", "p02695_case_085", "p02695_case_086", "p02695_case_087", "p02695_case_088", "p02695_case_089", "p02695_case_090", "p02695_case_091", "p02695_case_092", "p02695_case_093", "p02695_case_094", "p02695_case_095", "p02695_case_096", "p02695_case_097", "p02695_case_098", "p02695_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\ninput = sys.stdin.readline\nsys.setrecursionlimit(10**7)\nINF = 10**10\nMOD = 10**9 + 7\nN, M, Q = list(map(int, input().split()))\nquery = []\nfor q in range(Q):\n a, b, c, d = list(map(int, input().split()))\n a -= 1\n b -= 1\n query.append((a, b, c, d))\nold = []\nfor i in range(1, M + 1):\n old.append([i])\nfor j in range(N - 1):\n new = []\n for e in old:\n for i in range(e[-1], M + 1):\n new.append(e + [i])\n old = new\n\nmx = 0\nfor n in new:\n score = 0\n for a, b, c, d in query:\n if n[b] - n[a] == c:\n score += d\n mx = max(score, mx)\nprint(mx)\n", "fast_code_sha256": "7a8dc9b2fbcba45893570fd93fea0015831e7ad0da2989ee7908b68f9ad3f97e", "fast_id": "p02695_88e6e0b3d22f66f2f6f1f4326b17c1acff0238df6b51ea4289ef55937da164a9", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\ninput = sys.stdin.readline\nsys.setrecursionlimit(10**7)\nINF = 10**10\nMOD = 10**9 + 7\nN, M, Q = list(map(int, input().split()))\nquery = []\nfor q in range(Q):\n a, b, c, d = list(map(int, input().split()))\n a -= 1\n b -= 1\n query.append((a, b, c, d))\nold = []\nfor i in range(1, M + 1):\n old.append([i])\nfor j in range(N - 1):\n new = []\n for e in old:\n for i in range(e[-1], M + 1):\n new.append(e + [i])\n old = new\n# print (new)\nmx = 0\nfor n in new:\n score = 0\n for a, b, c, d in query:\n if n[b] - n[a] == c:\n score += d\n mx = max(score, mx)\nprint(mx)\n", "measured_fast_code_sha256": "88e6e0b3d22f66f2f6f1f4326b17c1acff0238df6b51ea4289ef55937da164a9", "measured_slow_code": "n, m, q = list(map(int, input().split()))\nl = []\nfor i in range(q):\n l1, l2, l3, l4 = list(map(int, input().split()))\n l.append([l1, l2, l3, l4])\nB = []\nfor a in range(1, m + 1):\n for b in range(a, m + 1):\n for c in range(b, m + 1):\n for d in range(c, m + 1):\n for e in range(d, m + 1):\n for f in range(e, m + 1):\n for g in range(f, m + 1):\n for h in range(g, m + 1):\n for i in range(h, m + 1):\n for j in range(i, m + 1):\n L = [a, b, c, d, e, f, g, h, i, j]\n A = []\n for I in range(n):\n A.append(L[I])\n C = 0\n for k in range(q):\n if (\n A[l[k][1] - 1] - A[l[k][0] - 1]\n == l[k][2]\n ):\n C += l[k][3]\n B.append(C)\nprint((max(B)))\n", "measured_slow_code_sha256": "4876c20eabffbc9ea2c633c2d996da20261178a9a9451926be7fe13405bb8582", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.548238649841267, "pair_id": "python_v2_0e0aaa992a8a6f48e2b91b65", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02695", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02695_88e6e0b3d22f66f2f6f1f4326b17c1acff0238df6b51ea4289ef55937da164a9.jsonl.gz", "inputs": "reproduction/python/inputs/p02695.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02695_4876c20eabffbc9ea2c633c2d996da20261178a9a9451926be7fe13405bb8582.jsonl.gz"}, "slow_code": "n, m, q = list(map(int, input().split()))\nl = []\nfor i in range(q):\n l1, l2, l3, l4 = list(map(int, input().split()))\n l.append([l1, l2, l3, l4])\nB = []\nfor a in range(1, m + 1):\n for b in range(a, m + 1):\n for c in range(b, m + 1):\n for d in range(c, m + 1):\n for e in range(d, m + 1):\n for f in range(e, m + 1):\n for g in range(f, m + 1):\n for h in range(g, m + 1):\n for i in range(h, m + 1):\n for j in range(i, m + 1):\n L = [a, b, c, d, e, f, g, h, i, j]\n A = []\n for I in range(n):\n A.append(L[I])\n C = 0\n for k in range(q):\n if (\n A[l[k][1] - 1] - A[l[k][0] - 1]\n == l[k][2]\n ):\n C += l[k][3]\n B.append(C)\nprint((max(B)))\n", "slow_code_sha256": "4876c20eabffbc9ea2c633c2d996da20261178a9a9451926be7fe13405bb8582", "slow_id": "p02695_4876c20eabffbc9ea2c633c2d996da20261178a9a9451926be7fe13405bb8582", "speedup": 5.699281821048583, "stratum": "4-8", "within_pair_jaccard": 0.39655172413793105, "workload": {"case_count": 100, "description": "Choose integers 1<=A_1<=...<=A_N<=M to maximize score. Each of Q distinct conditions (a_i,b_i,c_i) awards d_i when A_b_i-A_a_i=c_i. Observed inputs: N=2..10 (median 5); M=1..10 (median 5); Q=1..50 (median 10); c_i=0..9; d_i=1..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 676, "median": 132.0, "min": 14}, "input_format": ["N M Q\na_1 b_1 c_1 d_1\n...\na_Q b_Q c_Q d_Q"], "input_format_status": "source_input_section", "input_lines": {"max": 51, "median": 11.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 203, "median": 43.0, "min": 7}}} -{"case_ids": ["p02406_case_000", "p02406_case_001", "p02406_case_002", "p02406_case_003", "p02406_case_004", "p02406_case_005", "p02406_case_006", "p02406_case_007", "p02406_case_008", "p02406_case_009", "p02406_case_010", "p02406_case_011", "p02406_case_012", "p02406_case_013", "p02406_case_014", "p02406_case_015", "p02406_case_016", "p02406_case_017", "p02406_case_018", "p02406_case_019", "p02406_case_020", "p02406_case_021", "p02406_case_022", "p02406_case_023", "p02406_case_024", "p02406_case_025", "p02406_case_026", "p02406_case_027", "p02406_case_028", "p02406_case_029", "p02406_case_030", "p02406_case_031", "p02406_case_032", "p02406_case_033", "p02406_case_034", "p02406_case_035", "p02406_case_036", "p02406_case_037", "p02406_case_038", "p02406_case_039", "p02406_case_040", "p02406_case_041", "p02406_case_042", "p02406_case_043", "p02406_case_044", "p02406_case_045", "p02406_case_046", "p02406_case_047", "p02406_case_048", "p02406_case_049", "p02406_case_050", "p02406_case_051", "p02406_case_052", "p02406_case_053", "p02406_case_054", "p02406_case_055", "p02406_case_056", "p02406_case_057", "p02406_case_058", "p02406_case_059", "p02406_case_060", "p02406_case_061", "p02406_case_062", "p02406_case_063", "p02406_case_064", "p02406_case_065", "p02406_case_066", "p02406_case_067", "p02406_case_068", "p02406_case_069", "p02406_case_070", "p02406_case_071", "p02406_case_072", "p02406_case_073", "p02406_case_074", "p02406_case_075", "p02406_case_076", "p02406_case_077", "p02406_case_078", "p02406_case_079", "p02406_case_080", "p02406_case_081", "p02406_case_082", "p02406_case_083", "p02406_case_084", "p02406_case_085", "p02406_case_086", "p02406_case_087", "p02406_case_088", "p02406_case_089", "p02406_case_090", "p02406_case_091", "p02406_case_092", "p02406_case_093", "p02406_case_094", "p02406_case_095", "p02406_case_096", "p02406_case_097", "p02406_case_098", "p02406_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "print(\n (\n \"\".join(\n [\n \" \" + str(i)\n for i in range(1, int(eval(input())) + 1)\n if i % 3 == 0 or \"3\" in str(i)\n ]\n )\n )\n)\n", "fast_code_sha256": "ddc904ed4f0cd4b39153ffc2495e7ff359f267ec09c6188344beefc9065e1ed3", "fast_id": "p02406_ddc904ed4f0cd4b39153ffc2495e7ff359f267ec09c6188344beefc9065e1ed3", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "print(\n (\n \"\".join(\n [\n \" \" + str(i)\n for i in range(1, int(eval(input())) + 1)\n if i % 3 == 0 or \"3\" in str(i)\n ]\n )\n )\n)\n", "measured_fast_code_sha256": "ddc904ed4f0cd4b39153ffc2495e7ff359f267ec09c6188344beefc9065e1ed3", "measured_slow_code": "def call_filter(x):\n if x % 3 == 0:\n return True\n while x > 0:\n if x % 10 == 3:\n return True\n x = int(x / 10)\n return False\n\n\ndef call(n):\n for i in [x for x in range(1, n + 1) if call_filter(x)]:\n print(\" {}\".format(i), end=\"\")\n print()\n\n\nn = int(input())\ncall(n)\n", "measured_slow_code_sha256": "0abf5eee2b023be682585a58149c3eb24fc8df3bf70d3811f032e25298261bbc", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.459066953334169, "pair_id": "python_v2_f9876a57d6d2a881afaecdfa", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02406", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02406_ddc904ed4f0cd4b39153ffc2495e7ff359f267ec09c6188344beefc9065e1ed3.jsonl.gz", "inputs": "reproduction/python/inputs/p02406.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02406_0abf5eee2b023be682585a58149c3eb24fc8df3bf70d3811f032e25298261bbc.jsonl.gz"}, "slow_code": "def call_filter(x):\n if x % 3 == 0:\n return True\n while x > 0:\n if x % 10 == 3:\n return True\n x = int(x / 10)\n return False\n\n\ndef call(n):\n for i in [x for x in range(1, n + 1) if call_filter(x)]:\n print(\" {}\".format(i), end=\"\")\n print()\n\n\nn = int(input())\ncall(n)\n", "slow_code_sha256": "0abf5eee2b023be682585a58149c3eb24fc8df3bf70d3811f032e25298261bbc", "slow_id": "p02406_0abf5eee2b023be682585a58149c3eb24fc8df3bf70d3811f032e25298261bbc", "speedup": 2.4030247622519374, "stratum": "2-4", "within_pair_jaccard": 0.4074074074074074, "workload": {"case_count": 100, "description": "Print in ascending order the integers from 1 through n that are divisible by 3 or have a decimal digit 3. A qualifying integer is printed once even if both conditions hold. Observed inputs: n=3..10000 (median 5211).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 6, "median": 5.0, "min": 2}, "input_format": ["n"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p02551_case_000", "p02551_case_001", "p02551_case_002", "p02551_case_003", "p02551_case_004", "p02551_case_005", "p02551_case_006", "p02551_case_007", "p02551_case_008", "p02551_case_009", "p02551_case_010", "p02551_case_011", "p02551_case_012", "p02551_case_013", "p02551_case_014", "p02551_case_015", "p02551_case_016", "p02551_case_017", "p02551_case_018", "p02551_case_019", "p02551_case_020", "p02551_case_021", "p02551_case_022", "p02551_case_023", "p02551_case_024", "p02551_case_025", "p02551_case_026", "p02551_case_027", "p02551_case_028", "p02551_case_029", "p02551_case_030", "p02551_case_031", "p02551_case_032", "p02551_case_033", "p02551_case_034", "p02551_case_035", "p02551_case_036", "p02551_case_037", "p02551_case_038", "p02551_case_039", "p02551_case_040", "p02551_case_041", "p02551_case_042", "p02551_case_043", "p02551_case_044", "p02551_case_045", "p02551_case_046", "p02551_case_047", "p02551_case_048", "p02551_case_049", "p02551_case_050", "p02551_case_051", "p02551_case_052", "p02551_case_053", "p02551_case_054", "p02551_case_055", "p02551_case_056", "p02551_case_057", "p02551_case_058", "p02551_case_059", "p02551_case_060", "p02551_case_061", "p02551_case_062", "p02551_case_063", "p02551_case_064", "p02551_case_065", "p02551_case_066", "p02551_case_067", "p02551_case_068", "p02551_case_069", "p02551_case_070", "p02551_case_071", "p02551_case_072", "p02551_case_073", "p02551_case_074", "p02551_case_075", "p02551_case_076", "p02551_case_077", "p02551_case_078", "p02551_case_079", "p02551_case_080", "p02551_case_081", "p02551_case_082", "p02551_case_083", "p02551_case_084", "p02551_case_085", "p02551_case_086", "p02551_case_087", "p02551_case_088", "p02551_case_089", "p02551_case_090", "p02551_case_091", "p02551_case_092", "p02551_case_093", "p02551_case_094", "p02551_case_095", "p02551_case_096", "p02551_case_097", "p02551_case_098", "p02551_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\nread = sys.stdin.read\nreadline = sys.stdin.readline\nreadlines = sys.stdin.readlines\nsys.setrecursionlimit(10**9)\nINF = 1 << 60\nMOD = 1000000007\n\n\ndef main():\n N, Q, *query = list(map(int, read().split()))\n N -= 2\n row = [N] * N\n col = [N] * N\n R = C = N\n ans = N * N\n for q, x in zip(*[iter(query)] * 2):\n x -= 2\n if q == 1:\n if x < C:\n ans -= R\n for i in range(x + 1, C):\n col[i] = R\n C = x\n else:\n ans -= col[x]\n else:\n if x < R:\n ans -= C\n for i in range(x + 1, R):\n row[i] = C\n R = x\n else:\n ans -= row[x]\n print(ans)\n return\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "563884c909984690cb17a4a75e13aa643e22ac803dadb5d6eff6d3b364daf2a3", "fast_id": "p02551_563884c909984690cb17a4a75e13aa643e22ac803dadb5d6eff6d3b364daf2a3", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\nread = sys.stdin.read\nreadline = sys.stdin.readline\nreadlines = sys.stdin.readlines\nsys.setrecursionlimit(10**9)\nINF = 1 << 60\nMOD = 1000000007\n\n\ndef main():\n N, Q, *query = list(map(int, read().split()))\n N -= 2\n row = [N] * N\n col = [N] * N\n R = C = N\n ans = N * N\n for q, x in zip(*[iter(query)] * 2):\n x -= 2\n if q == 1:\n if x < C:\n ans -= R\n for i in range(x + 1, C):\n col[i] = R\n C = x\n else:\n ans -= col[x]\n else:\n if x < R:\n ans -= C\n for i in range(x + 1, R):\n row[i] = C\n R = x\n else:\n ans -= row[x]\n print(ans)\n return\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "563884c909984690cb17a4a75e13aa643e22ac803dadb5d6eff6d3b364daf2a3", "measured_slow_code": "N, Q = list(map(int, input().split()))\nN -= 2 # 枠を取り除いたサイズに直す\n# ここから33行目まで準備。Binary indexed tree(BIT)というデータ構造を使う。\nBIT = [[0 for i in range(N + 1)] for _ in range(2)] # BITを2つ用意\n# BITでできること。\n# 1, 要素の更新をO(logn)で行う\n# 2, 累積和をO(logn)で求める。\n#  ※ 両方ともそれなりに早くできるのがメリット。\n# 普通の配列だと、1と2がそれぞれO(1),O(n)かかる。\n# 一方、累積和で記録した配列だと、1と2がO(n)とO(1)かかる。\n# 原理は例えばhttp://hos.ac/slides/20140319_bit.pdf参照。(これと別にsegment treeも載ってますが、同じような考え方です。)\n# 以下、実装用の関数。以下のWeb記事から引用させていただきました。\n# https://juppy.hatenablog.com/entry/2018/11/17/%E8%9F%BB%E6%9C%AC_python_Binary_Indexed_Tree_%E7%AB%B6%E6%8A%80%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%9F%E3%83%B3%E3%82%B0\nn = N # (直すのサボりました、ごめんなさい)\n\n\ndef BIT_query(idx, BIT): # 1, BITのidx番目までの要素の和を求める。\n res_sum = 0\n while idx > 0:\n res_sum += BIT[idx]\n idx -= idx & (-idx)\n return res_sum\n\n\ndef BIT_update(idx, x, BIT): # 2, BITのidx番目の要素に、xを足す。\n while idx <= n:\n BIT[idx] += x\n idx += idx & (-idx)\n return\n\n\n# なお、配列番号idxが1から始まることに注意。(BITの0番目には0を入れておき、「0番目までの和」としておいたほうが都合が良い。)\n# 以下、本処理。\n# お約束: たて座標を「右から左へ」、よこ座標を「下から上へ」カウントする。(いつもと反対なので注意)\n# 座標は1からスタートさせる\n# 2つのBITが表す累積和には、それぞれよこ、たて座標における「たて刺し」、「よこ刺し」が刺さる深さ(がNからどれだけ減ったか、負数)を格納する。\n# (もととなる配列の要素ではなく、累積和で表すことに注意。)\nnow = N * N # 現在の黒玉の数。\nmax_x = [\n 0,\n 0,\n] # それぞれ、これまでに刺さった「たて刺し」のうちの最大のよこ座標と、これまでに刺さった「よこ刺し」のうちの最大のたて座標を記録。最初は0とする。\nfor _ in range(Q):\n # 51行目まで整形作業\n s, x = list(map(int, input().split()))\n # s=0が「たて刺し」、s=1が「よこ刺し」を表すようにする\n s -= 1\n # 最初に両端を削った分の調整(スタートを0にしているわけではないので注意)\n x -= 1\n # いつもと逆向きに数える\n x = N + 1 - x\n # どこまで刺さるか\n depth = N + BIT_query(x, BIT[s])\n now -= depth # 刺さった分だけ、黒玉を減らす\n if x > max_x[s]: # 深さの更新処理。今までに刺さったものよりも大きい座標の場合のみ。\n BIT_update(N - depth + 1, max_x[s] - x, BIT[1 - s])\n # 反対側のBITを更新する。今刺さった深さの地点N-depth+1に、max_x[s]-xを足す。累積和なので、N-depth+1より大きい座標すべてにおいて深さが更新される。\n max_x[s] = x\nprint(now)\n# 追記:\n# 刺さる深さを普通の配列で持つと、毎回O(N)回更新するためTLEするかと思い、BITを使いました。\n# しかし57行目にあるように、更新が必要なのはそれまでよりも大きい座標のところに「刺し」が入る時のみです。\n# ここで、これまでの「刺し」の最大座標よりも小さい座標に刺さる「刺し」の深さは、それ以降変化することはありません。\n# また、最大座標よりも大きい座標での「刺し」の深さは、全て同じ値になり、その値1つを記録しておけば十分です。\n# このため、普通の配列に「刺し」の最大座標よりも小さい座標についての深さを記録しておき、\n# 「刺し」の最大座標よりも大きい部分については一括して1つの値で管理しておけば、\n# BITなしでも上記の目的が果たせます。\n", "measured_slow_code_sha256": "cb5752a1f4b2bb1578da80a75a3c754316abdc192a0c7d44da286e61467a61d0", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 6.5958927666081975, "pair_id": "python_v2_942f4cb0fa5c62fbef8ebd9e", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02551", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02551_563884c909984690cb17a4a75e13aa643e22ac803dadb5d6eff6d3b364daf2a3.jsonl.gz", "inputs": "reproduction/python/inputs/p02551.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02551_cb5752a1f4b2bb1578da80a75a3c754316abdc192a0c7d44da286e61467a61d0.jsonl.gz"}, "slow_code": "N, Q = list(map(int, input().split()))\nN -= 2\n\nBIT = [[0 for i in range(N + 1)] for _ in range(2)]\n\n\nn = N\n\n\ndef BIT_query(idx, BIT):\n res_sum = 0\n while idx > 0:\n res_sum += BIT[idx]\n idx -= idx & (-idx)\n return res_sum\n\n\ndef BIT_update(idx, x, BIT):\n while idx <= n:\n BIT[idx] += x\n idx += idx & (-idx)\n return\n\n\nnow = N * N\nmax_x = [\n 0,\n 0,\n]\nfor _ in range(Q):\n\n s, x = list(map(int, input().split()))\n\n s -= 1\n\n x -= 1\n\n x = N + 1 - x\n\n depth = N + BIT_query(x, BIT[s])\n now -= depth\n if x > max_x[s]:\n BIT_update(N - depth + 1, max_x[s] - x, BIT[1 - s])\n\n max_x[s] = x\nprint(now)\n", "slow_code_sha256": "c96bf6d0819d7810e22a68071df9f8300b95e6f6dc7491105b653fdeb461629a", "slow_id": "p02551_cb5752a1f4b2bb1578da80a75a3c754316abdc192a0c7d44da286e61467a61d0", "speedup": 4.6312817466095675, "stratum": "4-8", "within_pair_jaccard": 0.2982456140350877, "workload": {"case_count": 100, "description": "An N-by-N grid starts with black inner cells and white bottom/right borders. Distinct queries 1 x or 2 x turn cells white downward from (1,x) or rightward from (x,1), stopping at the first white cell. Count remaining black cells. Observed inputs: N=3..200000 (median 100000); Q=0..200000 (median 199996); x=2..199999.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1689172, "median": 1577778.0, "min": 4}, "input_format": ["N Q\ntype_1 x_1\n...\ntype_Q x_Q"], "input_format_status": "source_input_section", "input_lines": {"max": 200001, "median": 199997.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 400002, "median": 399994.0, "min": 2}}} -{"case_ids": ["p02361_case_000", "p02361_case_001", "p02361_case_002", "p02361_case_003", "p02361_case_004", "p02361_case_005", "p02361_case_006", "p02361_case_007", "p02361_case_008", "p02361_case_009", "p02361_case_010", "p02361_case_011", "p02361_case_012", "p02361_case_013", "p02361_case_014", "p02361_case_015", "p02361_case_016", "p02361_case_017", "p02361_case_018", "p02361_case_019", "p02361_case_020", "p02361_case_021", "p02361_case_022", "p02361_case_023", "p02361_case_024", "p02361_case_025", "p02361_case_026", "p02361_case_027", "p02361_case_028", "p02361_case_029", "p02361_case_030", "p02361_case_031", "p02361_case_032", "p02361_case_033", "p02361_case_034", "p02361_case_035", "p02361_case_036", "p02361_case_037", "p02361_case_038", "p02361_case_039", "p02361_case_040", "p02361_case_041", "p02361_case_042", "p02361_case_043", "p02361_case_044", "p02361_case_045", "p02361_case_046", "p02361_case_047", "p02361_case_048", "p02361_case_049", "p02361_case_050", "p02361_case_051", "p02361_case_052", "p02361_case_053", "p02361_case_054", "p02361_case_055", "p02361_case_056", "p02361_case_057", "p02361_case_058", "p02361_case_059", "p02361_case_060", "p02361_case_061", "p02361_case_062", "p02361_case_063", "p02361_case_064", "p02361_case_065", "p02361_case_066", "p02361_case_067", "p02361_case_068", "p02361_case_069", "p02361_case_070", "p02361_case_071", "p02361_case_072", "p02361_case_073", "p02361_case_074", "p02361_case_075", "p02361_case_076", "p02361_case_077", "p02361_case_078", "p02361_case_079", "p02361_case_080", "p02361_case_081", "p02361_case_082", "p02361_case_083", "p02361_case_084", "p02361_case_085", "p02361_case_086", "p02361_case_087", "p02361_case_088", "p02361_case_089", "p02361_case_090", "p02361_case_091", "p02361_case_092", "p02361_case_093", "p02361_case_094", "p02361_case_095", "p02361_case_096", "p02361_case_097", "p02361_case_098", "p02361_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "executable_AST_equal_except_explicit_explanatory_string_removal_and_all_frozen_inputs_checker_pass", "fast_code": "import sys\nfrom heapq import heappush, heappop\n\nreadline = sys.stdin.readline\nV, E, r = list(map(int, readline().split()))\ninf = 10**10\nedges = [[] for _ in [None] * V]\nvertices = [inf] * V\nvertices[r] = 0\nfor _ in [None] * E:\n s, t, d = list(map(int, readline().split()))\n edges[s].append((t, d))\nq = [(0, r)]\nrem = V - 1\nwhile q and rem:\n cost, v = heappop(q)\n if vertices[v] < cost:\n continue\n rem -= 1\n for dest, _cost in edges[v]:\n newcost = cost + _cost\n if vertices[dest] > newcost:\n vertices[dest] = newcost\n heappush(q, (newcost, dest))\nprint((\"\\n\".join([str(n) if n != inf else \"INF\" for n in vertices])))\n", "fast_code_sha256": "59bab4d76458b9d52141aa25422a631231c9e446195a30b427396f9e6de3c8eb", "fast_id": "p02361_59bab4d76458b9d52141aa25422a631231c9e446195a30b427396f9e6de3c8eb", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\nfrom heapq import heappush, heappop\n\nreadline = sys.stdin.readline\nV, E, r = list(map(int, readline().split()))\ninf = 10**10\nedges = [[] for _ in [None] * V]\nvertices = [inf] * V\nvertices[r] = 0\nfor _ in [None] * E:\n s, t, d = list(map(int, readline().split()))\n edges[s].append((t, d))\nq = [(0, r)]\nrem = V - 1\nwhile q and rem:\n cost, v = heappop(q)\n if vertices[v] < cost:\n continue\n rem -= 1\n for dest, _cost in edges[v]:\n newcost = cost + _cost\n if vertices[dest] > newcost:\n vertices[dest] = newcost\n heappush(q, (newcost, dest))\nprint((\"\\n\".join([str(n) if n != inf else \"INF\" for n in vertices])))\n", "measured_fast_code_sha256": "59bab4d76458b9d52141aa25422a631231c9e446195a30b427396f9e6de3c8eb", "measured_slow_code": "import heapq\n\n\nclass Edge:\n def __init__(self, dst, weight):\n self.dst, self.weight = dst, weight\n\n def __lt__(self, e):\n return self.weight > e.weight\n\n\nclass Graph:\n def __init__(self, V):\n self.V = V\n self.E = [[] for _ in range(V)]\n\n def add_edge(self, src, dst, weight):\n self.E[src].append(Edge(dst, weight))\n\n\nclass Node:\n def __init__(self, v, cost):\n self.v, self.cost = v, cost\n\n def __lt__(self, n):\n return self.cost < n.cost\n\n\nclass ShortestPath:\n \"\"\"Dijkstra's algorithm : find the shortest path from a vertex\n Complexity: O(E + log(V))\n used in GRL1A(AOJ)\n \"\"\"\n\n def __init__(self, G, INF=10**9):\n \"\"\"V: the number of vertexes\n E: adjacency list (all edge in E must be 0 or positive)\n start: start vertex\n INF: Infinity distance\n \"\"\"\n self.G, self.INF = G, INF\n\n def dijkstra(self, start, goal=None):\n que = list()\n self.dist = [self.INF] * self.G.V # distance from start\n self.prev = [-1] * self.G.V # prev vertex of shortest path\n self.dist[start] = 0\n heapq.heappush(que, Node(start, 0))\n while len(que) > 0:\n n = heapq.heappop(que)\n if self.dist[n.v] < n.cost:\n continue\n if goal is not None and n.v == goal:\n return\n for e in self.G.E[n.v]:\n if self.dist[n.v] + e.weight < self.dist[e.dst]:\n self.dist[e.dst] = self.dist[n.v] + e.weight\n heapq.heappush(que, Node(e.dst, self.dist[e.dst]))\n self.prev[e.dst] = n.v\n\n def getPath(self, end):\n path = [end]\n while self.prev[end] != -1:\n end = self.prev[end]\n return path[::-1]\n\n\nV, E, start = list(map(int, input().split()))\nG = Graph(V)\nfor _ in range(E):\n s, t, d = list(map(int, input().split()))\n G.add_edge(s, t, d)\nINF = 10**9\nsp = ShortestPath(G, INF)\nsp.dijkstra(start)\nfor i in range(G.V):\n print((\"INF\" if sp.dist[i] == INF else sp.dist[i]))\n", "measured_slow_code_sha256": "dea21260225ec6f4d68880220d2242061ac54f41986fb08741093fbf397db38a", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.8382137762512434, "pair_id": "python_v2_7af8a0cf3a0ca4cf10942dbb", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02361", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02361_59bab4d76458b9d52141aa25422a631231c9e446195a30b427396f9e6de3c8eb.jsonl.gz", "inputs": "reproduction/python/inputs/p02361.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02361_dea21260225ec6f4d68880220d2242061ac54f41986fb08741093fbf397db38a.jsonl.gz"}, "slow_code": "import heapq\n\n\nclass Edge:\n def __init__(self, dst, weight):\n self.dst, self.weight = dst, weight\n\n def __lt__(self, e):\n return self.weight > e.weight\n\n\nclass Graph:\n def __init__(self, V):\n self.V = V\n self.E = [[] for _ in range(V)]\n\n def add_edge(self, src, dst, weight):\n self.E[src].append(Edge(dst, weight))\n\n\nclass Node:\n def __init__(self, v, cost):\n self.v, self.cost = v, cost\n\n def __lt__(self, n):\n return self.cost < n.cost\n\n\nclass ShortestPath:\n\n def __init__(self, G, INF=10**9):\n self.G, self.INF = G, INF\n\n def dijkstra(self, start, goal=None):\n que = list()\n self.dist = [self.INF] * self.G.V\n self.prev = [-1] * self.G.V\n self.dist[start] = 0\n heapq.heappush(que, Node(start, 0))\n while len(que) > 0:\n n = heapq.heappop(que)\n if self.dist[n.v] < n.cost:\n continue\n if goal is not None and n.v == goal:\n return\n for e in self.G.E[n.v]:\n if self.dist[n.v] + e.weight < self.dist[e.dst]:\n self.dist[e.dst] = self.dist[n.v] + e.weight\n heapq.heappush(que, Node(e.dst, self.dist[e.dst]))\n self.prev[e.dst] = n.v\n\n def getPath(self, end):\n path = [end]\n while self.prev[end] != -1:\n end = self.prev[end]\n return path[::-1]\n\n\nV, E, start = list(map(int, input().split()))\nG = Graph(V)\nfor _ in range(E):\n s, t, d = list(map(int, input().split()))\n G.add_edge(s, t, d)\nINF = 10**9\nsp = ShortestPath(G, INF)\nsp.dijkstra(start)\nfor i in range(G.V):\n print((\"INF\" if sp.dist[i] == INF else sp.dist[i]))\n", "slow_code_sha256": "68fc94738dddde7b57f71c9dab1a4ead4887b0770aaf9efbc6a509ede5ac8f28", "slow_id": "p02361_dea21260225ec6f4d68880220d2242061ac54f41986fb08741093fbf397db38a", "speedup": 2.0204701497664423, "stratum": "2-4", "within_pair_jaccard": 0.3076923076923077, "workload": {"case_count": 100, "description": "Find shortest-path costs from source r to all vertices of a directed graph with nonnegative edge weights, outputting INF for unreachable vertices. Vertex IDs are 0..V-1; self-loops and parallel directed edges are absent. Observed inputs: V=1..100000 (median 1000); E=0..500000 (median 4999); r=0..99627; d_i=0..10000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 8333729, "median": 48880.5, "min": 6}, "input_format": ["V E r\ns_1 t_1 d_1\n...\ns_E t_E d_E"], "input_format_status": "source_input_section", "input_lines": {"max": 500001, "median": 5000.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1500003, "median": 15000.0, "min": 3}}} -{"case_ids": ["p02642_case_000", "p02642_case_001", "p02642_case_002", "p02642_case_003", "p02642_case_004", "p02642_case_005", "p02642_case_006", "p02642_case_007", "p02642_case_008", "p02642_case_009", "p02642_case_010", "p02642_case_011", "p02642_case_012", "p02642_case_013", "p02642_case_014", "p02642_case_015", "p02642_case_016", "p02642_case_017", "p02642_case_018", "p02642_case_019", "p02642_case_020", "p02642_case_021", "p02642_case_022", "p02642_case_023", "p02642_case_024", "p02642_case_025", "p02642_case_026", "p02642_case_027", "p02642_case_028", "p02642_case_029", "p02642_case_030", "p02642_case_031", "p02642_case_032", "p02642_case_033", "p02642_case_034", "p02642_case_035", "p02642_case_036", "p02642_case_037", "p02642_case_038", "p02642_case_039", "p02642_case_040", "p02642_case_041", "p02642_case_042", "p02642_case_043", "p02642_case_044", "p02642_case_045", "p02642_case_046", "p02642_case_047", "p02642_case_048", "p02642_case_049", "p02642_case_050", "p02642_case_051", "p02642_case_052", "p02642_case_053", "p02642_case_054", "p02642_case_055", "p02642_case_056", "p02642_case_057", "p02642_case_058", "p02642_case_059", "p02642_case_060", "p02642_case_061", "p02642_case_062", "p02642_case_063", "p02642_case_064", "p02642_case_065", "p02642_case_066", "p02642_case_067", "p02642_case_068", "p02642_case_069", "p02642_case_070", "p02642_case_071", "p02642_case_072", "p02642_case_073", "p02642_case_074", "p02642_case_075", "p02642_case_076", "p02642_case_077", "p02642_case_078", "p02642_case_079", "p02642_case_080", "p02642_case_081", "p02642_case_082", "p02642_case_083", "p02642_case_084", "p02642_case_085", "p02642_case_086", "p02642_case_087", "p02642_case_088", "p02642_case_089", "p02642_case_090", "p02642_case_091", "p02642_case_092", "p02642_case_093", "p02642_case_094", "p02642_case_095", "p02642_case_096", "p02642_case_097", "p02642_case_098", "p02642_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\na = list(map(int, input().split()))\na.sort()\nmax_num = a[-1] + 1\ncnt = [0] * (max_num)\na.sort()\nans = 0\nfor i in a:\n cnt[i] += 1\na = set(a)\nfor k in a:\n for l in range(k * 2, (max_num), k):\n cnt[l] += 1\nfor m in a:\n if cnt[m] == 1:\n ans += 1\nprint(ans)\n", "fast_code_sha256": "14d062ba1fdfedcb7da5501ac08db70378afe95bb6ccb7773b4c5b572d572918", "fast_id": "p02642_14d062ba1fdfedcb7da5501ac08db70378afe95bb6ccb7773b4c5b572d572918", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\na = list(map(int, input().split()))\na.sort()\nmax_num = a[-1] + 1\ncnt = [0] * (max_num)\na.sort()\nans = 0\nfor i in a:\n cnt[i] += 1\na = set(a)\nfor k in a:\n for l in range(k * 2, (max_num), k):\n cnt[l] += 1\nfor m in a:\n if cnt[m] == 1:\n ans += 1\nprint(ans)\n", "measured_fast_code_sha256": "14d062ba1fdfedcb7da5501ac08db70378afe95bb6ccb7773b4c5b572d572918", "measured_slow_code": "N = int(eval(input()))\nA = list(map(int, input().split()))\nm = max(A)\nU = [0] * (m + 1)\nfor e in A:\n U[e] += 1\nans = 0\nfor k in range(1, m + 1):\n if U[k] == 1:\n ans += 1\n if U[k] > 0:\n for l in range(2 * k, m + 1, k):\n if U[l] > 0:\n U[l] += 1\nprint(ans)\n", "measured_slow_code_sha256": "bb032738b2a92c573bb8551b5b7382bec1fcfece28073f8018a01331a18cfdcc", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.8305417000477666, "pair_id": "python_v2_c5e6f8794597b2e924e14885", "per_case_slow_code_faster_fraction": 0.05, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02642", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02642_14d062ba1fdfedcb7da5501ac08db70378afe95bb6ccb7773b4c5b572d572918.jsonl.gz", "inputs": "reproduction/python/inputs/p02642.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02642_bb032738b2a92c573bb8551b5b7382bec1fcfece28073f8018a01331a18cfdcc.jsonl.gz"}, "slow_code": "N = int(eval(input()))\nA = list(map(int, input().split()))\nm = max(A)\nU = [0] * (m + 1)\nfor e in A:\n U[e] += 1\nans = 0\nfor k in range(1, m + 1):\n if U[k] == 1:\n ans += 1\n if U[k] > 0:\n for l in range(2 * k, m + 1, k):\n if U[l] > 0:\n U[l] += 1\nprint(ans)\n", "slow_code_sha256": "bb032738b2a92c573bb8551b5b7382bec1fcfece28073f8018a01331a18cfdcc", "slow_id": "p02642_bb032738b2a92c573bb8551b5b7382bec1fcfece28073f8018a01331a18cfdcc", "speedup": 7.9960683166791044, "stratum": "4-8", "within_pair_jaccard": 0.6, "workload": {"case_count": 100, "description": "Count indices i such that no different index j has a value a_j dividing a_i; equal values at different positions are separate entries. Observed inputs: N=5..200000 (median 1000); a_i=1..1000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1600007, "median": 6886.5, "min": 12}, "input_format": ["N\na_1 ... a_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200001, "median": 1001.0, "min": 6}}} -{"case_ids": ["p02763_case_000", "p02763_case_001", "p02763_case_002", "p02763_case_003", "p02763_case_004", "p02763_case_005", "p02763_case_006", "p02763_case_007", "p02763_case_008", "p02763_case_009", "p02763_case_010", "p02763_case_011", "p02763_case_012", "p02763_case_013", "p02763_case_014", "p02763_case_015", "p02763_case_016", "p02763_case_017", "p02763_case_018", "p02763_case_019", "p02763_case_020", "p02763_case_021", "p02763_case_022", "p02763_case_023", "p02763_case_024", "p02763_case_025", "p02763_case_026", "p02763_case_027", "p02763_case_028", "p02763_case_029", "p02763_case_030", "p02763_case_031", "p02763_case_032", "p02763_case_033", "p02763_case_034", "p02763_case_035", "p02763_case_036", "p02763_case_037", "p02763_case_038", "p02763_case_039", "p02763_case_040", "p02763_case_041", "p02763_case_042", "p02763_case_043", "p02763_case_044", "p02763_case_045", "p02763_case_046", "p02763_case_047", "p02763_case_048", "p02763_case_049", "p02763_case_050", "p02763_case_051", "p02763_case_052", "p02763_case_053", "p02763_case_054", "p02763_case_055", "p02763_case_056", "p02763_case_057", "p02763_case_058", "p02763_case_059", "p02763_case_060", "p02763_case_061", "p02763_case_062", "p02763_case_063", "p02763_case_064", "p02763_case_065", "p02763_case_066", "p02763_case_067", "p02763_case_068", "p02763_case_069", "p02763_case_070", "p02763_case_071", "p02763_case_072", "p02763_case_073", "p02763_case_074", "p02763_case_075", "p02763_case_076", "p02763_case_077", "p02763_case_078", "p02763_case_079", "p02763_case_080", "p02763_case_081", "p02763_case_082", "p02763_case_083", "p02763_case_084", "p02763_case_085", "p02763_case_086", "p02763_case_087", "p02763_case_088", "p02763_case_089", "p02763_case_090", "p02763_case_091", "p02763_case_092", "p02763_case_093", "p02763_case_094", "p02763_case_095", "p02763_case_096", "p02763_case_097", "p02763_case_098", "p02763_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "executable_AST_equal_except_explicit_explanatory_string_removal_and_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\nsys.setrecursionlimit(10**6)\nint1 = lambda x: int(x) - 1\np2D = lambda x: print(*x, sep=\"\\n\")\n\n\ndef II():\n return int(sys.stdin.readline())\n\n\ndef MI():\n return map(int, sys.stdin.readline().split())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\ndef LLI(rows_number):\n return [LI() for _ in range(rows_number)]\n\n\ndef SI():\n return sys.stdin.readline()[:-1]\n\n\nclass SegTree:\n def __init__(self, aa):\n n = 1 << (len(aa) - 1).bit_length()\n tree = [0] * (2 * n - 1)\n tree[n - 1 : n - 1 + len(aa)] = aa\n for i in range(n - 2, -1, -1):\n tree[i] = tree[2 * i + 1] | tree[2 * i + 2]\n self.tree = tree\n self.n = n\n\n def update(self, i, a):\n i = self.n - 1 + i\n self.tree[i] = a\n while i:\n i = (i - 1) // 2\n self.tree[i] = self.tree[2 * i + 1] | self.tree[2 * i + 2]\n\n def SegOr(self, l, r, i=0, segl=0, segr=-1):\n if segr == -1:\n segr = self.n\n if r <= segl or segr <= l:\n return 0\n if l <= segl and segr <= r:\n return self.tree[i]\n m = (segl + segr) // 2\n return self.SegOr(l, r, 2 * i + 1, segl, m) | self.SegOr(\n l, r, 2 * i + 2, m, segr\n )\n\n\ndef main():\n code = lambda c: ord(c) - ord(\"a\")\n popcnt = lambda x: bin(x).count(\"1\")\n n = II()\n s = SI()\n aa = [1 << code(c) for c in s]\n st = SegTree(aa)\n q = II()\n for _ in range(q):\n op, x, y = SI().split()\n if op == \"1\":\n i = int(x) - 1\n st.update(i, 1 << code(y))\n else:\n l, r = int(x) - 1, int(y)\n print(popcnt(st.SegOr(l, r)))\n\n\nmain()\n", "fast_code_sha256": "f7b7ddd2b42f6973d7aba8b61d872f27d79c463514ee1eb0b4c44ad11428b580", "fast_id": "p02763_f7b7ddd2b42f6973d7aba8b61d872f27d79c463514ee1eb0b4c44ad11428b580", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\nsys.setrecursionlimit(10**6)\nint1 = lambda x: int(x) - 1\np2D = lambda x: print(*x, sep=\"\\n\")\n\n\ndef II():\n return int(sys.stdin.readline())\n\n\ndef MI():\n return map(int, sys.stdin.readline().split())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\ndef LLI(rows_number):\n return [LI() for _ in range(rows_number)]\n\n\ndef SI():\n return sys.stdin.readline()[:-1]\n\n\nclass SegTree:\n def __init__(self, aa):\n n = 1 << (len(aa) - 1).bit_length()\n tree = [0] * (2 * n - 1)\n tree[n - 1 : n - 1 + len(aa)] = aa\n for i in range(n - 2, -1, -1):\n tree[i] = tree[2 * i + 1] | tree[2 * i + 2]\n self.tree = tree\n self.n = n\n\n def update(self, i, a):\n i = self.n - 1 + i\n self.tree[i] = a\n while i:\n i = (i - 1) // 2\n self.tree[i] = self.tree[2 * i + 1] | self.tree[2 * i + 2]\n\n def SegOr(self, l, r, i=0, segl=0, segr=-1):\n if segr == -1:\n segr = self.n\n if r <= segl or segr <= l:\n return 0\n if l <= segl and segr <= r:\n return self.tree[i]\n m = (segl + segr) // 2\n return self.SegOr(l, r, 2 * i + 1, segl, m) | self.SegOr(\n l, r, 2 * i + 2, m, segr\n )\n\n\ndef main():\n code = lambda c: ord(c) - ord(\"a\")\n popcnt = lambda x: bin(x).count(\"1\")\n n = II()\n s = SI()\n aa = [1 << code(c) for c in s]\n st = SegTree(aa)\n q = II()\n for _ in range(q):\n op, x, y = SI().split()\n if op == \"1\":\n i = int(x) - 1\n st.update(i, 1 << code(y))\n else:\n l, r = int(x) - 1, int(y)\n print(popcnt(st.SegOr(l, r)))\n\n\nmain()\n", "measured_fast_code_sha256": "f7b7ddd2b42f6973d7aba8b61d872f27d79c463514ee1eb0b4c44ad11428b580", "measured_slow_code": "import sys\n\ninput = sys.stdin.readline\n\n\nclass Bit:\n def __init__(self, n):\n self.n = n\n self.tree = [0] * (n + 1)\n self.el = [0] * (n + 1)\n self.depth = n.bit_length() - 1\n\n def sum(self, i):\n \"\"\"区間[0,i) の総和を求める\"\"\"\n s = 0\n i -= 1\n while i >= 0:\n s += self.tree[i]\n i = (i & (i + 1)) - 1\n return s\n\n def add(self, i, x):\n \"\"\"i 番目の要素に x を足す\"\"\"\n self.el[i] += x\n while i < self.n:\n self.tree[i] += x\n i |= i + 1\n\n def get(self, i, j=None):\n \"\"\"部分区間和 [i, j)\"\"\"\n if j is None:\n return self.el[i]\n if i == 0:\n return self.sum(j)\n return self.sum(j) - self.sum(i)\n\n def lower_bound(self, x, equal=False):\n \"\"\"(a0+a1+...+ai < x となる最大の i, その時の a0+a1+...+ai )\n a0+a1+...+ai <= x としたい場合は equal = True\n 二分探索であるため、ai>=0 を満たす必要がある\"\"\"\n sum_ = 0\n pos = -1 # 1-indexed の時は pos = 0\n if not equal:\n for i in range(self.depth, -1, -1):\n k = pos + (1 << i)\n if k < self.n and sum_ + self.tree[k] < x: # 1-indexed の時は k <= self.n\n sum_ += self.tree[k]\n pos += 1 << i\n if equal:\n for i in range(self.depth, -1, -1):\n k = pos + (1 << i)\n if k < self.n and sum_ + self.tree[k] <= x: # 1-indexed の時は k <= self.n\n sum_ += self.tree[k]\n pos += 1 << i\n return pos, sum_\n\n def __getitem__(self, s):\n \"\"\"[a0, a1, a2, ...]\"\"\"\n return self.el[s]\n\n def __iter__(self):\n \"\"\"[a0, a1, a2, ...]\"\"\"\n for s in self.el[: self.n]:\n yield s\n\n def __str__(self):\n text1 = \" \".join([\"element: \"] + list(map(str, self)))\n text2 = \" \".join(\n [\"cumsum(1-indexed): \"]\n + list(str(self.sum(i)) for i in range(1, self.n + 1))\n )\n return \"\\n\".join((text1, text2))\n\n\n####################################################################################################\nimport string\n\nN = int(eval(input()))\nS = input().strip()\nQ = int(eval(input()))\nB = [Bit(N) for _ in range(26)]\nabc = string.ascii_lowercase # [a-z] をロード\nabc2 = dict()\nfor i, s in enumerate(abc):\n abc2[s] = i\nfor i, s in enumerate(S):\n B[abc2[s]].add(i, 1)\nfor _ in range(Q):\n q = list(input().split())\n if q[0] == \"1\":\n a = int(q[1]) - 1\n b = q[2]\n for i in range(26):\n if B[i].el[a] == 1:\n B[i].add(a, -1)\n B[abc2[b]].add(a, 1)\n if q[0] == \"2\":\n a = int(q[1]) - 1\n b = int(q[2]) - 1\n res = 0\n for i in range(26):\n res += B[i].get(a, b + 1) > 0\n print(res)\n", "measured_slow_code_sha256": "f48f6f3e37812c17b5337b9141da770a977eb3ae11af352f28286963282fd6ed", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4.17885398882796, "pair_id": "python_v2_6900582c185bf220d68269be", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02763", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02763_f7b7ddd2b42f6973d7aba8b61d872f27d79c463514ee1eb0b4c44ad11428b580.jsonl.gz", "inputs": "reproduction/python/inputs/p02763.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02763_f48f6f3e37812c17b5337b9141da770a977eb3ae11af352f28286963282fd6ed.jsonl.gz"}, "slow_code": "import sys\n\ninput = sys.stdin.readline\n\n\nclass Bit:\n def __init__(self, n):\n self.n = n\n self.tree = [0] * (n + 1)\n self.el = [0] * (n + 1)\n self.depth = n.bit_length() - 1\n\n def sum(self, i):\n s = 0\n i -= 1\n while i >= 0:\n s += self.tree[i]\n i = (i & (i + 1)) - 1\n return s\n\n def add(self, i, x):\n self.el[i] += x\n while i < self.n:\n self.tree[i] += x\n i |= i + 1\n\n def get(self, i, j=None):\n if j is None:\n return self.el[i]\n if i == 0:\n return self.sum(j)\n return self.sum(j) - self.sum(i)\n\n def lower_bound(self, x, equal=False):\n sum_ = 0\n pos = -1\n if not equal:\n for i in range(self.depth, -1, -1):\n k = pos + (1 << i)\n if k < self.n and sum_ + self.tree[k] < x:\n sum_ += self.tree[k]\n pos += 1 << i\n if equal:\n for i in range(self.depth, -1, -1):\n k = pos + (1 << i)\n if k < self.n and sum_ + self.tree[k] <= x:\n sum_ += self.tree[k]\n pos += 1 << i\n return pos, sum_\n\n def __getitem__(self, s):\n return self.el[s]\n\n def __iter__(self):\n for s in self.el[: self.n]:\n yield s\n\n def __str__(self):\n text1 = \" \".join([\"element: \"] + list(map(str, self)))\n text2 = \" \".join(\n [\"cumsum(1-indexed): \"]\n + list(str(self.sum(i)) for i in range(1, self.n + 1))\n )\n return \"\\n\".join((text1, text2))\n\n\nimport string\n\nN = int(eval(input()))\nS = input().strip()\nQ = int(eval(input()))\nB = [Bit(N) for _ in range(26)]\nabc = string.ascii_lowercase\nabc2 = dict()\nfor i, s in enumerate(abc):\n abc2[s] = i\nfor i, s in enumerate(S):\n B[abc2[s]].add(i, 1)\nfor _ in range(Q):\n q = list(input().split())\n if q[0] == \"1\":\n a = int(q[1]) - 1\n b = q[2]\n for i in range(26):\n if B[i].el[a] == 1:\n B[i].add(a, -1)\n B[abc2[b]].add(a, 1)\n if q[0] == \"2\":\n a = int(q[1]) - 1\n b = int(q[2]) - 1\n res = 0\n for i in range(26):\n res += B[i].get(a, b + 1) > 0\n print(res)\n", "slow_code_sha256": "4fa4a65e4a0df3861053325cb01fa333b2482712b297bcf1214920d237936687", "slow_id": "p02763_f48f6f3e37812c17b5337b9141da770a977eb3ae11af352f28286963282fd6ed", "speedup": 4.001277108738945, "stratum": "4-8", "within_pair_jaccard": 0.256, "workload": {"case_count": 100, "description": "Process Q ordered queries on a lowercase string S of length N. Query 1 i c replaces character i with c; query 2 l r reports the number of distinct letters in inclusive substring [l,r]. At least one type-2 query occurs. Observed inputs: N=1..500000 (median 500000); Q=1..20000 (median 20000); type1_count=0..19999; type2_count=1..20000; substring_length=1..500000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 815322, "median": 720014.0, "min": 12}, "input_format": ["N\nS\nQ\nQ query lines, each: 1 i c or 2 l r"], "input_format_status": "source_input_section", "input_lines": {"max": 20003, "median": 20003.0, "min": 4}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 60003, "median": 60003.0, "min": 6}}} -{"case_ids": ["p03472_case_000", "p03472_case_001", "p03472_case_002", "p03472_case_003", "p03472_case_004", "p03472_case_005", "p03472_case_006", "p03472_case_007", "p03472_case_008", "p03472_case_009", "p03472_case_010", "p03472_case_011", "p03472_case_012", "p03472_case_013", "p03472_case_014", "p03472_case_015", "p03472_case_016", "p03472_case_017", "p03472_case_018", "p03472_case_019", "p03472_case_020", "p03472_case_021", "p03472_case_022", "p03472_case_023", "p03472_case_024", "p03472_case_025", "p03472_case_026", "p03472_case_027", "p03472_case_028", "p03472_case_029", "p03472_case_030", "p03472_case_031", "p03472_case_032", "p03472_case_033", "p03472_case_034", "p03472_case_035", "p03472_case_036", "p03472_case_037", "p03472_case_038", "p03472_case_039", "p03472_case_040", "p03472_case_041", "p03472_case_042", "p03472_case_043", "p03472_case_044", "p03472_case_045", "p03472_case_046", "p03472_case_047", "p03472_case_048", "p03472_case_049", "p03472_case_050", "p03472_case_051", "p03472_case_052", "p03472_case_053", "p03472_case_054", "p03472_case_055", "p03472_case_056", "p03472_case_057", "p03472_case_058", "p03472_case_059", "p03472_case_060", "p03472_case_061", "p03472_case_062", "p03472_case_063", "p03472_case_064", "p03472_case_065", "p03472_case_066", "p03472_case_068", "p03472_case_069", "p03472_case_070", "p03472_case_071", "p03472_case_072", "p03472_case_073", "p03472_case_075", "p03472_case_076", "p03472_case_077", "p03472_case_078", "p03472_case_079", "p03472_case_080", "p03472_case_081", "p03472_case_082", "p03472_case_083", "p03472_case_084", "p03472_case_085", "p03472_case_086", "p03472_case_087", "p03472_case_088", "p03472_case_089", "p03472_case_090", "p03472_case_091", "p03472_case_092", "p03472_case_093", "p03472_case_094", "p03472_case_095", "p03472_case_096", "p03472_case_097", "p03472_case_098", "p03472_case_099", "p03472_v2_152723b81f3e452934a4", "p03472_v2_8069c44687919d0f2aed"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n, h, *t = list(map(int, open(0).read().split()))\nb = sorted(t[1::2])\na = max(t[::2])\nc = 0\nwhile h > 0 and b and b[-1] > a:\n h -= b.pop()\n c += 1\nif h > 0:\n c -= -h // a\nprint(c)\n", "fast_code_sha256": "02952b5343791f7e9cbf755ebc67676afbd1a59fb0391b64459cf3edf5653a17", "fast_id": "p03472_02952b5343791f7e9cbf755ebc67676afbd1a59fb0391b64459cf3edf5653a17", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n, h, *t = list(map(int, open(0).read().split()))\nb = sorted(t[1::2])\na = max(t[::2])\nc = 0\nwhile h > 0 and b and b[-1] > a:\n h -= b.pop()\n c += 1\nif h > 0:\n c -= -h // a\nprint(c)\n", "measured_fast_code_sha256": "02952b5343791f7e9cbf755ebc67676afbd1a59fb0391b64459cf3edf5653a17", "measured_slow_code": "import sys\n\ninput = sys.stdin.readline\nN, H = list(map(int, input().split()))\nkatanas = []\nfor _ in range(N):\n a, b = list(map(int, input().split()))\n katanas.append((a, b))\nmax_a = sorted(katanas, reverse=True)[0][0]\nthrows = []\nfor a, b in katanas:\n if max_a < b:\n throws.append(b)\nans = 0\nfor b in sorted(throws, reverse=True):\n H -= b\n ans += 1\n if H <= 0:\n print(ans)\n sys.exit()\nprint((ans + (H - 1) // max_a + 1))\n", "measured_slow_code_sha256": "1fe6f3809126498268184a8e7e7c9a2544d3e54aaf6046ac7942710e3728b9cd", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.312858193296682, "pair_id": "python_v2_e5d7ac7782c9d268a6c694a5", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03472", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03472_02952b5343791f7e9cbf755ebc67676afbd1a59fb0391b64459cf3edf5653a17.jsonl.gz", "inputs": "reproduction/python/inputs/p03472.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03472_1fe6f3809126498268184a8e7e7c9a2544d3e54aaf6046ac7942710e3728b9cd.jsonl.gz"}, "slow_code": "import sys\n\ninput = sys.stdin.readline\nN, H = list(map(int, input().split()))\nkatanas = []\nfor _ in range(N):\n a, b = list(map(int, input().split()))\n katanas.append((a, b))\nmax_a = sorted(katanas, reverse=True)[0][0]\nthrows = []\nfor a, b in katanas:\n if max_a < b:\n throws.append(b)\nans = 0\nfor b in sorted(throws, reverse=True):\n H -= b\n ans += 1\n if H <= 0:\n print(ans)\n sys.exit()\nprint((ans + (H - 1) // max_a + 1))\n", "slow_code_sha256": "1fe6f3809126498268184a8e7e7c9a2544d3e54aaf6046ac7942710e3728b9cd", "slow_id": "p03472_1fe6f3809126498268184a8e7e7c9a2544d3e54aaf6046ac7942710e3728b9cd", "speedup": 2.7310237009342844, "stratum": "2-4", "within_pair_jaccard": 0.2682926829268293, "workload": {"case_count": 100, "description": "Defeat health H using N swords. Wield sword i repeatedly for a_i damage, or throw it once for b_i damage and lose it permanently. Each attack counts once; a_i<=b_i. Minimize attacks to deal at least H total damage. Observed inputs: N=1..100000 (median 1000); H=1..1000000000 (median 500000000); a_i=1..1000000000; b_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 2200018, "median": 19446.5, "min": 8}, "input_format": ["N H\na_1 b_1\n...\na_N b_N"], "input_format_status": "source_input_section", "input_lines": {"max": 100001, "median": 1001.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200002, "median": 2002.0, "min": 4}}} -{"case_ids": ["p03693_case_000", "p03693_case_001", "p03693_case_002", "p03693_case_003", "p03693_case_004", "p03693_case_005", "p03693_case_006", "p03693_case_007", "p03693_case_008", "p03693_case_009", "p03693_case_010", "p03693_case_011", "p03693_case_012", "p03693_case_013", "p03693_case_014", "p03693_case_015", "p03693_case_016", "p03693_case_017", "p03693_case_018", "p03693_case_019", "p03693_case_020", "p03693_case_021", "p03693_case_022", "p03693_case_023", "p03693_case_024", "p03693_case_025", "p03693_case_026", "p03693_case_027", "p03693_case_028", "p03693_case_029", "p03693_case_030", "p03693_case_031", "p03693_case_032", "p03693_case_033", "p03693_case_034", "p03693_case_035", "p03693_case_036", "p03693_case_037", "p03693_case_038", "p03693_case_039", "p03693_case_040", "p03693_case_041", "p03693_case_042", "p03693_case_043", "p03693_case_044", "p03693_case_045", "p03693_case_046", "p03693_case_047", "p03693_case_048", "p03693_case_049", "p03693_case_050", "p03693_case_051", "p03693_case_052", "p03693_case_053", "p03693_case_054", "p03693_case_055", "p03693_case_056", "p03693_case_057", "p03693_case_058", "p03693_case_059", "p03693_case_060", "p03693_case_061", "p03693_case_062", "p03693_case_063", "p03693_case_064", "p03693_case_065", "p03693_case_066", "p03693_case_067", "p03693_case_068", "p03693_case_069", "p03693_case_070", "p03693_case_071", "p03693_case_072", "p03693_case_073", "p03693_case_074", "p03693_case_075", "p03693_case_076", "p03693_case_077", "p03693_case_078", "p03693_case_079", "p03693_case_080", "p03693_case_081", "p03693_case_082", "p03693_case_083", "p03693_case_084", "p03693_case_085", "p03693_case_086", "p03693_case_087", "p03693_case_088", "p03693_case_089", "p03693_case_090", "p03693_case_091", "p03693_case_092", "p03693_case_093", "p03693_case_094", "p03693_case_095", "p03693_case_096", "p03693_case_097", "p03693_case_098", "p03693_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from collections import defaultdict, deque\nfrom heapq import heappush, heappop\nimport sys\nimport math\nimport bisect\nimport random\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LS():\n return [list(x) for x in sys.stdin.readline().split()]\n\n\ndef S():\n return list(sys.stdin.readline())[:-1]\n\n\ndef IR(n):\n return [I() for i in range(n)]\n\n\ndef LIR(n):\n return [LI() for i in range(n)]\n\n\ndef SR(n):\n return [S() for i in range(n)]\n\n\ndef LSR(n):\n return [LS() for i in range(n)]\n\n\nsys.setrecursionlimit(1000000)\nmod = 1000000007\n\n\ndef solve():\n r, g, b = LI()\n ans = [\"YES\", \"NO\"]\n print((ans[((g << 1) + b) & 3 > 0]))\n return\n\n\nif __name__ == \"__main__\":\n solve()\n", "fast_code_sha256": "2598e9a98706383a1b39a15b40d55a3cbc3bffe11a259c1a8fe1b0d32337b553", "fast_id": "p03693_f76975ea4092e311a9abe1acebb4c1b2854ecc6a6a5725b459e6d2a2499bc758", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "#!usr/bin/env python3\nfrom collections import defaultdict, deque\nfrom heapq import heappush, heappop\nimport sys\nimport math\nimport bisect\nimport random\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LS():\n return [list(x) for x in sys.stdin.readline().split()]\n\n\ndef S():\n return list(sys.stdin.readline())[:-1]\n\n\ndef IR(n):\n return [I() for i in range(n)]\n\n\ndef LIR(n):\n return [LI() for i in range(n)]\n\n\ndef SR(n):\n return [S() for i in range(n)]\n\n\ndef LSR(n):\n return [LS() for i in range(n)]\n\n\nsys.setrecursionlimit(1000000)\nmod = 1000000007\n\n\ndef solve():\n r, g, b = LI()\n ans = [\"YES\", \"NO\"]\n print((ans[((g << 1) + b) & 3 > 0]))\n return\n\n\n# Solve\nif __name__ == \"__main__\":\n solve()\n", "measured_fast_code_sha256": "f76975ea4092e311a9abe1acebb4c1b2854ecc6a6a5725b459e6d2a2499bc758", "measured_slow_code": "import numpy as np\n\nr, g, b = list(map(int, input().split()))\nif (100 * r + 10 * g + b) % 4 == 0:\n print(\"YES\")\nelse:\n print(\"NO\")\n", "measured_slow_code_sha256": "a8d7956b0cbea162ca1db60ee520eccf4efc73cdccbed5370688af05e67aaca2", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 304.2478636033446, "pair_id": "python_v2_5855ceba0b5c35c879e59171", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03693", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03693_f76975ea4092e311a9abe1acebb4c1b2854ecc6a6a5725b459e6d2a2499bc758.jsonl.gz", "inputs": "reproduction/python/inputs/p03693.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03693_a8d7956b0cbea162ca1db60ee520eccf4efc73cdccbed5370688af05e67aaca2.jsonl.gz"}, "slow_code": "import numpy as np\n\nr, g, b = list(map(int, input().split()))\nif (100 * r + 10 * g + b) % 4 == 0:\n print(\"YES\")\nelse:\n print(\"NO\")\n", "slow_code_sha256": "a8d7956b0cbea162ca1db60ee520eccf4efc73cdccbed5370688af05e67aaca2", "slow_id": "p03693_a8d7956b0cbea162ca1db60ee520eccf4efc73cdccbed5370688af05e67aaca2", "speedup": 304.23495535861787, "stratum": "8+", "within_pair_jaccard": 0.2, "workload": {"case_count": 100, "description": "Read three nonzero decimal digits r,g,b and determine whether the three-digit integer formed in that order is divisible by 4. Observed inputs: r=1..9; g=1..9; b=1..9.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 6, "median": 6.0, "min": 6}, "input_format": ["r g b"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3, "median": 3.0, "min": 3}}} -{"case_ids": ["p01314_case_000", "p01314_case_001", "p01314_case_002", "p01314_case_003", "p01314_case_004", "p01314_case_005", "p01314_case_006", "p01314_case_007", "p01314_case_008", "p01314_case_009", "p01314_case_010", "p01314_case_011", "p01314_case_012", "p01314_case_013", "p01314_case_014", "p01314_case_015", "p01314_case_016", "p01314_case_017", "p01314_case_018", "p01314_case_019", "p01314_case_020", "p01314_case_021", "p01314_case_022", "p01314_case_023", "p01314_case_024", "p01314_case_025", "p01314_case_026", "p01314_case_027", "p01314_case_028", "p01314_case_029", "p01314_case_030", "p01314_case_031", "p01314_case_032", "p01314_case_033", "p01314_case_034", "p01314_case_035", "p01314_case_036", "p01314_case_037", "p01314_case_038", "p01314_case_039", "p01314_case_040", "p01314_case_041", "p01314_case_042", "p01314_case_043", "p01314_case_044", "p01314_case_045", "p01314_case_046", "p01314_case_047", "p01314_case_048", "p01314_case_049", "p01314_case_050", "p01314_case_051", "p01314_case_052", "p01314_case_053", "p01314_case_054", "p01314_case_055", "p01314_case_056", "p01314_case_057", "p01314_case_058", "p01314_case_059", "p01314_case_060", "p01314_case_061", "p01314_case_062", "p01314_case_064", "p01314_case_065", "p01314_case_066", "p01314_case_067", "p01314_case_068", "p01314_case_069", "p01314_case_070", "p01314_case_071", "p01314_case_072", "p01314_case_073", "p01314_case_074", "p01314_case_075", "p01314_case_076", "p01314_case_077", "p01314_case_078", "p01314_case_079", "p01314_case_080", "p01314_case_081", "p01314_case_082", "p01314_case_083", "p01314_case_084", "p01314_case_085", "p01314_case_086", "p01314_case_087", "p01314_case_088", "p01314_case_089", "p01314_case_090", "p01314_case_091", "p01314_case_092", "p01314_case_093", "p01314_case_094", "p01314_case_095", "p01314_case_096", "p01314_case_097", "p01314_case_098", "p01314_case_099", "p01314_v2_34e40b6e8aae5233ac6d"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "while 1:\n n = int(input())\n if not n:\n break\n ans = 0\n p = 2\n while p**2 <= 2 * n:\n if not 2 * n % p:\n if (p + 2 * n / p) % 2:\n ans += 1\n p += 1\n print(ans)\n", "fast_code_sha256": "0e1e6407577d3a48d72996404df67430b04e8ba4c37b7de5bed20e5cf2fbd2b5", "fast_id": "p01314_0e1e6407577d3a48d72996404df67430b04e8ba4c37b7de5bed20e5cf2fbd2b5", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "while 1:\n n = int(input())\n if not n:\n break\n ans = 0\n p = 2\n while p**2 <= 2 * n:\n if not 2 * n % p:\n if (p + 2 * n / p) % 2:\n ans += 1\n p += 1\n print(ans)\n", "measured_fast_code_sha256": "0e1e6407577d3a48d72996404df67430b04e8ba4c37b7de5bed20e5cf2fbd2b5", "measured_slow_code": "if __name__ == \"__main__\":\n while True:\n n = int(eval(input()))\n if n == 0:\n break\n nline = [i for i in range(1, n + 1)]\n count = 0\n for i in range(n):\n for j in range(i + 1, n):\n if sum(nline[i:j]) > n:\n break\n if sum(nline[i:j]) == n:\n count += 1\n print(count)\n", "measured_slow_code_sha256": "147e66749bf1abd06001e7ed4470d109896662992c4ff0559988e216660063c6", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 91.93733506199138, "pair_id": "python_v2_248416ad2ccb8e563483df97", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p01314", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p01314_0e1e6407577d3a48d72996404df67430b04e8ba4c37b7de5bed20e5cf2fbd2b5.jsonl.gz", "inputs": "reproduction/python/inputs/p01314.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p01314_147e66749bf1abd06001e7ed4470d109896662992c4ff0559988e216660063c6.jsonl.gz"}, "slow_code": "if __name__ == \"__main__\":\n while True:\n n = int(eval(input()))\n if n == 0:\n break\n nline = [i for i in range(1, n + 1)]\n count = 0\n for i in range(n):\n for j in range(i + 1, n):\n if sum(nline[i:j]) > n:\n break\n if sum(nline[i:j]) == n:\n count += 1\n print(count)\n", "slow_code_sha256": "147e66749bf1abd06001e7ed4470d109896662992c4ff0559988e216660063c6", "slow_id": "p01314_147e66749bf1abd06001e7ed4470d109896662992c4ff0559988e216660063c6", "speedup": 87.74272859812348, "stratum": "8+", "within_pair_jaccard": 0.36, "workload": {"case_count": 100, "description": "For each positive N, count representations as the sum of at least two consecutive positive integers. Each line supplies one N; a final zero ends input. Observed inputs: datasets=4..100 (median 15); N=1..1000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 403, "median": 61.0, "min": 15}, "input_format": ["N_1\n...\nN_D\n0"], "input_format_status": "source_input_section", "input_lines": {"max": 101, "median": 16.0, "min": 5}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 101, "median": 16.0, "min": 5}}} -{"case_ids": ["p02830_case_000", "p02830_case_001", "p02830_case_002", "p02830_case_003", "p02830_case_004", "p02830_case_005", "p02830_case_006", "p02830_case_007", "p02830_case_008", "p02830_case_009", "p02830_case_010", "p02830_case_011", "p02830_case_012", "p02830_case_013", "p02830_case_014", "p02830_case_015", "p02830_case_016", "p02830_case_017", "p02830_case_018", "p02830_case_019", "p02830_case_020", "p02830_case_021", "p02830_case_022", "p02830_case_023", "p02830_case_024", "p02830_case_025", "p02830_case_026", "p02830_case_027", "p02830_case_028", "p02830_case_029", "p02830_case_030", "p02830_case_031", "p02830_case_032", "p02830_case_033", "p02830_case_034", "p02830_case_035", "p02830_case_036", "p02830_case_037", "p02830_case_038", "p02830_case_039", "p02830_case_040", "p02830_case_041", "p02830_case_042", "p02830_case_043", "p02830_case_044", "p02830_case_045", "p02830_case_046", "p02830_case_047", "p02830_case_048", "p02830_case_049", "p02830_case_050", "p02830_case_051", "p02830_case_052", "p02830_case_053", "p02830_case_054", "p02830_case_055", "p02830_case_056", "p02830_case_057", "p02830_case_058", "p02830_case_059", "p02830_case_060", "p02830_case_061", "p02830_case_062", "p02830_case_063", "p02830_case_064", "p02830_case_065", "p02830_case_066", "p02830_case_067", "p02830_case_068", "p02830_case_069", "p02830_case_070", "p02830_case_071", "p02830_case_072", "p02830_case_073", "p02830_case_074", "p02830_case_075", "p02830_case_076", "p02830_case_077", "p02830_case_078", "p02830_case_079", "p02830_case_080", "p02830_case_081", "p02830_case_082", "p02830_case_083", "p02830_case_084", "p02830_case_085", "p02830_case_086", "p02830_case_087", "p02830_case_088", "p02830_case_089", "p02830_case_090", "p02830_case_091", "p02830_case_092", "p02830_case_093", "p02830_case_094", "p02830_case_095", "p02830_case_096", "p02830_case_097", "p02830_case_098", "p02830_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\nN = int(input())\nS, T = input().split()\nif not (1 <= N <= 100):\n sys.exit()\nif not (len(S) == len(T) and len(S) == N):\n sys.exit()\nif not (S.islower() and T.islower()):\n sys.exit()\nfor I in range(N):\n print(S[I], end=\"\")\n print(T[I], end=\"\")\n", "fast_code_sha256": "8d636eca134cf8aabca8c761109550ad7a2aaddb74603d946dc42ab021814e9f", "fast_id": "p02830_8d636eca134cf8aabca8c761109550ad7a2aaddb74603d946dc42ab021814e9f", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\nN = int(input())\nS, T = input().split()\nif not (1 <= N <= 100):\n sys.exit()\nif not (len(S) == len(T) and len(S) == N):\n sys.exit()\nif not (S.islower() and T.islower()):\n sys.exit()\nfor I in range(N):\n print(S[I], end=\"\")\n print(T[I], end=\"\")\n", "measured_fast_code_sha256": "8d636eca134cf8aabca8c761109550ad7a2aaddb74603d946dc42ab021814e9f", "measured_slow_code": "from collections import Counter, defaultdict, deque\nfrom heapq import heappop, heappush, heapify\nimport sys, bisect, math, itertools, fractions, pprint\n\nsys.setrecursionlimit(10**8)\nmod = 10**9 + 7\nmod2 = 998244353\nINF = float(\"inf\")\n\n\ndef inp():\n return int(sys.stdin.readline())\n\n\ndef inpl():\n return list(map(int, sys.stdin.readline().split()))\n\n\ndef inpln(n):\n return list(int(sys.stdin.readline()) for i in range(n))\n\n\nn = inp()\ns, t = input().split()\nres = \"\"\nfor i in range(n):\n res += s[i] + t[i]\nprint(res)\n", "measured_slow_code_sha256": "241afa9a4a462ffb4a4454131541737b779c1c29e81784f31982be1ef01be8e4", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 13.63264968418279, "pair_id": "python_v2_543c5e88fbaf381a9b9d4de8", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02830", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02830_8d636eca134cf8aabca8c761109550ad7a2aaddb74603d946dc42ab021814e9f.jsonl.gz", "inputs": "reproduction/python/inputs/p02830.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02830_241afa9a4a462ffb4a4454131541737b779c1c29e81784f31982be1ef01be8e4.jsonl.gz"}, "slow_code": "from collections import Counter, defaultdict, deque\nfrom heapq import heappop, heappush, heapify\nimport sys, bisect, math, itertools, fractions, pprint\n\nsys.setrecursionlimit(10**8)\nmod = 10**9 + 7\nmod2 = 998244353\nINF = float(\"inf\")\n\n\ndef inp():\n return int(sys.stdin.readline())\n\n\ndef inpl():\n return list(map(int, sys.stdin.readline().split()))\n\n\ndef inpln(n):\n return list(int(sys.stdin.readline()) for i in range(n))\n\n\nn = inp()\ns, t = input().split()\nres = \"\"\nfor i in range(n):\n res += s[i] + t[i]\nprint(res)\n", "slow_code_sha256": "241afa9a4a462ffb4a4454131541737b779c1c29e81784f31982be1ef01be8e4", "slow_id": "p02830_241afa9a4a462ffb4a4454131541737b779c1c29e81784f31982be1ef01be8e4", "speedup": 14.639388499355325, "stratum": "8+", "within_pair_jaccard": 0.14754098360655737, "workload": {"case_count": 100, "description": "Interleave two lowercase strings S and T, both of length N, taking S_1,T_1,S_2,T_2,...,S_N,T_N. Observed inputs: N=1..100 (median 50).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 206, "median": 105.0, "min": 6}, "input_format": ["N\nS T"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3, "median": 3.0, "min": 3}}} -{"case_ids": ["p03288_case_000", "p03288_case_001", "p03288_case_002", "p03288_case_003", "p03288_case_004", "p03288_case_005", "p03288_case_006", "p03288_case_007", "p03288_case_008", "p03288_case_009", "p03288_case_010", "p03288_case_011", "p03288_case_012", "p03288_case_013", "p03288_case_014", "p03288_case_015", "p03288_case_016", "p03288_case_017", "p03288_case_018", "p03288_case_019", "p03288_case_020", "p03288_case_021", "p03288_case_022", "p03288_case_023", "p03288_case_024", "p03288_case_025", "p03288_case_026", "p03288_case_027", "p03288_case_028", "p03288_case_029", "p03288_case_030", "p03288_case_031", "p03288_case_032", "p03288_case_033", "p03288_case_034", "p03288_case_035", "p03288_case_036", "p03288_case_037", "p03288_case_038", "p03288_case_039", "p03288_case_040", "p03288_case_041", "p03288_case_042", "p03288_case_043", "p03288_case_044", "p03288_case_045", "p03288_case_046", "p03288_case_047", "p03288_case_048", "p03288_case_049", "p03288_case_050", "p03288_case_051", "p03288_case_052", "p03288_case_053", "p03288_case_054", "p03288_case_055", "p03288_case_056", "p03288_case_057", "p03288_case_058", "p03288_case_059", "p03288_case_060", "p03288_case_061", "p03288_case_062", "p03288_case_063", "p03288_case_064", "p03288_case_065", "p03288_case_066", "p03288_case_067", "p03288_case_068", "p03288_case_069", "p03288_case_070", "p03288_case_071", "p03288_case_072", "p03288_case_073", "p03288_case_074", "p03288_case_075", "p03288_case_076", "p03288_case_077", "p03288_case_078", "p03288_case_079", "p03288_case_080", "p03288_case_081", "p03288_case_082", "p03288_case_083", "p03288_case_084", "p03288_case_085", "p03288_case_086", "p03288_case_087", "p03288_case_088", "p03288_case_089", "p03288_case_090", "p03288_case_091", "p03288_case_092", "p03288_case_093", "p03288_case_094", "p03288_case_095", "p03288_case_096", "p03288_case_097", "p03288_case_098", "p03288_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "r = int(eval(input()))\nans = \"ARC\"\nif r < 1200:\n ans = \"ABC\"\nelif 2800 <= r:\n ans = \"AGC\"\nprint(ans)\n", "fast_code_sha256": "295f971acabadbb0f7e50b659189554ecb6f423e7975952b2bf01daeaeb6c28a", "fast_id": "p03288_295f971acabadbb0f7e50b659189554ecb6f423e7975952b2bf01daeaeb6c28a", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "r = int(eval(input()))\nans = \"ARC\"\nif r < 1200:\n ans = \"ABC\"\nelif 2800 <= r:\n ans = \"AGC\"\nprint(ans)\n", "measured_fast_code_sha256": "295f971acabadbb0f7e50b659189554ecb6f423e7975952b2bf01daeaeb6c28a", "measured_slow_code": "import bisect, collections, copy, heapq, itertools, math, string\nimport sys\n\n\ndef S():\n return sys.stdin.readline().rstrip()\n\n\ndef M():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef LS():\n return list(sys.stdin.readline().rstrip().split())\n\n\nR = I()\nif R < 1200:\n print(\"ABC\")\nelif R < 2800:\n print(\"ARC\")\nelse:\n print(\"AGC\")\n", "measured_slow_code_sha256": "4b19a6c66c6b24c9d371f629b6a683da99f61809c1d26fcff1386ca6548060d5", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 26.397672993394437, "pair_id": "python_v2_bf0f8287dd4609ffc927102d", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03288", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03288_295f971acabadbb0f7e50b659189554ecb6f423e7975952b2bf01daeaeb6c28a.jsonl.gz", "inputs": "reproduction/python/inputs/p03288.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03288_4b19a6c66c6b24c9d371f629b6a683da99f61809c1d26fcff1386ca6548060d5.jsonl.gz"}, "slow_code": "import bisect, collections, copy, heapq, itertools, math, string\nimport sys\n\n\ndef S():\n return sys.stdin.readline().rstrip()\n\n\ndef M():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef LS():\n return list(sys.stdin.readline().rstrip().split())\n\n\nR = I()\nif R < 1200:\n print(\"ABC\")\nelif R < 2800:\n print(\"ARC\")\nelse:\n print(\"AGC\")\n", "slow_code_sha256": "4b19a6c66c6b24c9d371f629b6a683da99f61809c1d26fcff1386ca6548060d5", "slow_id": "p03288_4b19a6c66c6b24c9d371f629b6a683da99f61809c1d26fcff1386ca6548060d5", "speedup": 26.35583135977933, "stratum": "8+", "within_pair_jaccard": 0.24324324324324326, "workload": {"case_count": 100, "description": "Choose the next eligible category from three ordered categories: the first requires rating below 1200, the second below 2800, and the third accepts every rating. Observed inputs: R=0..4208 (median 1199.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 5, "median": 5.0, "min": 2}, "input_format": ["R"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p02417_case_000", "p02417_case_001", "p02417_case_002", "p02417_case_003", "p02417_case_004", "p02417_case_005", "p02417_case_006", "p02417_case_007", "p02417_case_008", "p02417_case_009", "p02417_case_010", "p02417_case_011", "p02417_case_012", "p02417_case_013", "p02417_case_014", "p02417_case_015", "p02417_case_016", "p02417_case_017", "p02417_case_018", "p02417_case_019", "p02417_case_020", "p02417_case_021", "p02417_case_022", "p02417_case_023", "p02417_case_024", "p02417_case_025", "p02417_case_026", "p02417_case_027", "p02417_case_028", "p02417_case_029", "p02417_case_030", "p02417_case_031", "p02417_case_032", "p02417_case_033", "p02417_case_034", "p02417_case_035", "p02417_case_036", "p02417_case_037", "p02417_case_038", "p02417_case_039", "p02417_case_040", "p02417_case_041", "p02417_case_042", "p02417_case_043", "p02417_case_044", "p02417_case_045", "p02417_case_046", "p02417_case_047", "p02417_case_048", "p02417_case_049", "p02417_case_050", "p02417_case_051", "p02417_case_052", "p02417_case_053", "p02417_case_054", "p02417_case_055", "p02417_case_056", "p02417_case_057", "p02417_case_058", "p02417_case_059", "p02417_case_060", "p02417_case_061", "p02417_case_062", "p02417_case_063", "p02417_case_064", "p02417_case_065", "p02417_case_066", "p02417_case_067", "p02417_case_068", "p02417_case_069", "p02417_case_070", "p02417_case_071", "p02417_case_072", "p02417_case_073", "p02417_case_074", "p02417_case_075", "p02417_case_076", "p02417_case_077", "p02417_case_078", "p02417_case_079", "p02417_case_080", "p02417_case_081", "p02417_case_082", "p02417_case_083", "p02417_case_084", "p02417_case_085", "p02417_case_086", "p02417_case_087", "p02417_case_088", "p02417_case_089", "p02417_case_090", "p02417_case_091", "p02417_case_092", "p02417_case_093", "p02417_case_094", "p02417_case_095", "p02417_case_096", "p02417_case_097", "p02417_case_098", "p02417_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\nchash = {}\nfor i in range(ord(\"a\"), ord(\"z\") + 1):\n chash[chr(i)] = 0\nfor line in sys.stdin:\n for i in range(len(line)):\n if line[i].isalpha():\n chash[line[i].lower()] += 1\nfor i in range(ord(\"a\"), ord(\"z\") + 1):\n print((\"{:s} : {:d}\".format(chr(i), chash[chr(i)])))\n", "fast_code_sha256": "5fb969214acaa42d24b99680bb695ee6c56e7e47861bc6f3117fbd04cdf9041f", "fast_id": "p02417_5fb969214acaa42d24b99680bb695ee6c56e7e47861bc6f3117fbd04cdf9041f", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\nchash = {}\nfor i in range(ord(\"a\"), ord(\"z\") + 1):\n chash[chr(i)] = 0\nfor line in sys.stdin:\n for i in range(len(line)):\n if line[i].isalpha():\n chash[line[i].lower()] += 1\nfor i in range(ord(\"a\"), ord(\"z\") + 1):\n print((\"{:s} : {:d}\".format(chr(i), chash[chr(i)])))\n", "measured_fast_code_sha256": "5fb969214acaa42d24b99680bb695ee6c56e7e47861bc6f3117fbd04cdf9041f", "measured_slow_code": "import sys\n\naz = [\n \"a\",\n \"b\",\n \"c\",\n \"d\",\n \"e\",\n \"f\",\n \"g\",\n \"h\",\n \"i\",\n \"j\",\n \"k\",\n \"l\",\n \"m\",\n \"n\",\n \"o\",\n \"p\",\n \"q\",\n \"r\",\n \"s\",\n \"t\",\n \"u\",\n \"v\",\n \"w\",\n \"x\",\n \"y\",\n \"z\",\n]\nsum_az = [0 for x in range(26)]\nfor x in sys.stdin.read().lower():\n for i in range(26):\n if x == az[i]:\n sum_az[i] += 1\nfor i in range(26):\n print((\"%s : %d\" % (az[i], sum_az[i])))\n", "measured_slow_code_sha256": "91fbc2a5db35b1941d183c86eb7016584b0dbbc404bd11d0ae21847b19ff61be", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 6.774927574024223, "pair_id": "python_v2_4033fbf90a8950ef57c24847", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02417", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02417_5fb969214acaa42d24b99680bb695ee6c56e7e47861bc6f3117fbd04cdf9041f.jsonl.gz", "inputs": "reproduction/python/inputs/p02417.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02417_91fbc2a5db35b1941d183c86eb7016584b0dbbc404bd11d0ae21847b19ff61be.jsonl.gz"}, "slow_code": "import sys\n\naz = [\n \"a\",\n \"b\",\n \"c\",\n \"d\",\n \"e\",\n \"f\",\n \"g\",\n \"h\",\n \"i\",\n \"j\",\n \"k\",\n \"l\",\n \"m\",\n \"n\",\n \"o\",\n \"p\",\n \"q\",\n \"r\",\n \"s\",\n \"t\",\n \"u\",\n \"v\",\n \"w\",\n \"x\",\n \"y\",\n \"z\",\n]\nsum_az = [0 for x in range(26)]\nfor x in sys.stdin.read().lower():\n for i in range(26):\n if x == az[i]:\n sum_az[i] += 1\nfor i in range(26):\n print((\"%s : %d\" % (az[i], sum_az[i])))\n", "slow_code_sha256": "91fbc2a5db35b1941d183c86eb7016584b0dbbc404bd11d0ae21847b19ff61be", "slow_id": "p02417_91fbc2a5db35b1941d183c86eb7016584b0dbbc404bd11d0ae21847b19ff61be", "speedup": 6.132158722909693, "stratum": "4-8", "within_pair_jaccard": 0.3333333333333333, "workload": {"case_count": 100, "description": "Read all text until end of input and count occurrences of each English letter a..z without distinguishing uppercase and lowercase. Other characters do not contribute to the letter counts. Input may contain multiple lines. Observed inputs: lines=1..119 (median 10); content_characters=0..1199 (median 450); ascii_letters=0..1199 (median 300).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1317, "median": 495.0, "min": 1}, "input_format": ["[text lines until EOF]"], "input_format_status": "source_input_section", "input_lines": {"max": 119, "median": 10.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 199, "median": 20.0, "min": 0}}} -{"case_ids": ["p02845_case_000", "p02845_case_001", "p02845_case_002", "p02845_case_003", "p02845_case_004", "p02845_case_005", "p02845_case_006", "p02845_case_007", "p02845_case_008", "p02845_case_009", "p02845_case_010", "p02845_case_011", "p02845_case_012", "p02845_case_013", "p02845_case_014", "p02845_case_015", "p02845_case_016", "p02845_case_017", "p02845_case_018", "p02845_case_019", "p02845_case_020", "p02845_case_021", "p02845_case_022", "p02845_case_023", "p02845_case_024", "p02845_case_025", "p02845_case_026", "p02845_case_027", "p02845_case_028", "p02845_case_029", "p02845_case_030", "p02845_case_031", "p02845_case_032", "p02845_case_033", "p02845_case_034", "p02845_case_035", "p02845_case_036", "p02845_case_037", "p02845_case_038", "p02845_case_039", "p02845_case_040", "p02845_case_041", "p02845_case_042", "p02845_case_043", "p02845_case_044", "p02845_case_045", "p02845_case_046", "p02845_case_047", "p02845_case_048", "p02845_case_049", "p02845_case_050", "p02845_case_051", "p02845_case_052", "p02845_case_053", "p02845_case_054", "p02845_case_055", "p02845_case_056", "p02845_case_057", "p02845_case_058", "p02845_case_059", "p02845_case_060", "p02845_case_061", "p02845_case_062", "p02845_case_063", "p02845_case_064", "p02845_case_065", "p02845_case_066", "p02845_case_067", "p02845_case_068", "p02845_case_069", "p02845_case_070", "p02845_case_071", "p02845_case_072", "p02845_case_073", "p02845_case_074", "p02845_case_075", "p02845_case_076", "p02845_case_077", "p02845_case_078", "p02845_case_079", "p02845_case_080", "p02845_case_081", "p02845_case_082", "p02845_case_083", "p02845_case_084", "p02845_case_085", "p02845_case_086", "p02845_case_087", "p02845_case_088", "p02845_case_089", "p02845_case_090", "p02845_case_091", "p02845_case_092", "p02845_case_093", "p02845_case_094", "p02845_case_095", "p02845_case_096", "p02845_case_097", "p02845_case_098", "p02845_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\nread = sys.stdin.read\nreadline = sys.stdin.readline\nreadlines = sys.stdin.readlines\nsys.setrecursionlimit(10**9)\nINF = 1 << 60\n\n\ndef main():\n MOD = 1000000007\n N, *A = list(map(int, read().split()))\n C = [0] * (N + 1)\n C[0] = 3\n ans = 1\n for a in A:\n ans = ans * C[a] % MOD\n if ans == 0:\n print((0))\n return\n C[a] -= 1\n C[a + 1] += 1\n print(ans)\n return\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "b6834044bcbc77eb8a44d485655e938ae1a4127b00d69345cf12935172ed1f49", "fast_id": "p02845_b6834044bcbc77eb8a44d485655e938ae1a4127b00d69345cf12935172ed1f49", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\nread = sys.stdin.read\nreadline = sys.stdin.readline\nreadlines = sys.stdin.readlines\nsys.setrecursionlimit(10**9)\nINF = 1 << 60\n\n\ndef main():\n MOD = 1000000007\n N, *A = list(map(int, read().split()))\n C = [0] * (N + 1)\n C[0] = 3\n ans = 1\n for a in A:\n ans = ans * C[a] % MOD\n if ans == 0:\n print((0))\n return\n C[a] -= 1\n C[a + 1] += 1\n print(ans)\n return\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "b6834044bcbc77eb8a44d485655e938ae1a4127b00d69345cf12935172ed1f49", "measured_slow_code": "N = int(eval(input()))\nA = list(map(int, input().split()))\nMOD = 1_000_000_007\ncnt = [0, 0, 0]\nans = 1\nfor i in range(N):\n ans *= sum(c == A[i] for c in cnt)\n ans %= MOD\n for j in range(3):\n if cnt[j] == A[i]:\n cnt[j] += 1\n break\nprint(ans)\n", "measured_slow_code_sha256": "7ba69032f2d59ffe9fc67bd7616bd43fa583de9d44ef042066a6c2510e53022b", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 7.783741840892427, "pair_id": "python_v2_b3c925cae1f7210c378dead0", "per_case_slow_code_faster_fraction": 0.03, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02845", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02845_b6834044bcbc77eb8a44d485655e938ae1a4127b00d69345cf12935172ed1f49.jsonl.gz", "inputs": "reproduction/python/inputs/p02845.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02845_7ba69032f2d59ffe9fc67bd7616bd43fa583de9d44ef042066a6c2510e53022b.jsonl.gz"}, "slow_code": "N = int(eval(input()))\nA = list(map(int, input().split()))\nMOD = 1_000_000_007\ncnt = [0, 0, 0]\nans = 1\nfor i in range(N):\n ans *= sum(c == A[i] for c in cnt)\n ans %= MOD\n for j in range(3):\n if cnt[j] == A[i]:\n cnt[j] += 1\n break\nprint(ans)\n", "slow_code_sha256": "7ba69032f2d59ffe9fc67bd7616bd43fa583de9d44ef042066a6c2510e53022b", "slow_id": "p02845_7ba69032f2d59ffe9fc67bd7616bd43fa583de9d44ef042066a6c2510e53022b", "speedup": 4.96317148654498, "stratum": "4-8", "within_pair_jaccard": 0.3409090909090909, "workload": {"case_count": 100, "description": "N people stand in order. Person i reports A_i earlier people wearing their own hat color. Count assignments of red, blue or green hats satisfying all reports, modulo 1000000007. Observed inputs: N=1..100000 (median 1000); A_i=0..99998.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 588893, "median": 3611.5, "min": 4}, "input_format": ["N\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100001, "median": 1001.0, "min": 2}}} -{"case_ids": ["p03767_case_000", "p03767_case_001", "p03767_case_002", "p03767_case_003", "p03767_case_004", "p03767_case_005", "p03767_case_006", "p03767_case_007", "p03767_case_008", "p03767_case_009", "p03767_case_010", "p03767_case_011", "p03767_case_012", "p03767_case_013", "p03767_case_014", "p03767_case_015", "p03767_case_016", "p03767_case_017", "p03767_case_018", "p03767_case_019", "p03767_case_020", "p03767_case_021", "p03767_case_022", "p03767_case_023", "p03767_case_024", "p03767_case_025", "p03767_case_026", "p03767_case_027", "p03767_case_028", "p03767_case_029", "p03767_case_030", "p03767_case_031", "p03767_case_032", "p03767_case_033", "p03767_case_034", "p03767_case_035", "p03767_case_036", "p03767_case_037", "p03767_case_038", "p03767_case_039", "p03767_case_040", "p03767_case_041", "p03767_case_042", "p03767_case_043", "p03767_case_044", "p03767_case_045", "p03767_case_046", "p03767_case_047", "p03767_case_048", "p03767_case_049", "p03767_case_050", "p03767_case_051", "p03767_case_052", "p03767_case_053", "p03767_case_054", "p03767_case_055", "p03767_case_056", "p03767_case_057", "p03767_case_058", "p03767_case_059", "p03767_case_060", "p03767_case_061", "p03767_case_062", "p03767_case_063", "p03767_case_064", "p03767_case_065", "p03767_case_066", "p03767_case_067", "p03767_case_068", "p03767_case_069", "p03767_case_070", "p03767_case_071", "p03767_case_072", "p03767_case_073", "p03767_case_074", "p03767_case_075", "p03767_case_076", "p03767_case_077", "p03767_case_078", "p03767_case_079", "p03767_case_080", "p03767_case_081", "p03767_case_082", "p03767_case_083", "p03767_case_084", "p03767_case_085", "p03767_case_086", "p03767_case_087", "p03767_case_088", "p03767_case_089", "p03767_case_090", "p03767_case_091", "p03767_case_092", "p03767_case_093", "p03767_case_094", "p03767_case_095", "p03767_case_096", "p03767_case_097", "p03767_case_098", "p03767_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def slove():\n import sys\n\n input = sys.stdin.readline\n n = int(input().rstrip(\"\\n\"))\n a = list(map(int, input().rstrip(\"\\n\").split()))\n a.sort(reverse=True)\n print((sum(a[1 : n * 2 : 2])))\n\n\nif __name__ == \"__main__\":\n slove()\n", "fast_code_sha256": "5d9000f8a9f24f22bc737e06135f96775bfa608fba3993571b2765359c2a9263", "fast_id": "p03767_5d9000f8a9f24f22bc737e06135f96775bfa608fba3993571b2765359c2a9263", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def slove():\n import sys\n\n input = sys.stdin.readline\n n = int(input().rstrip(\"\\n\"))\n a = list(map(int, input().rstrip(\"\\n\").split()))\n a.sort(reverse=True)\n print((sum(a[1 : n * 2 : 2])))\n\n\nif __name__ == \"__main__\":\n slove()\n", "measured_fast_code_sha256": "5d9000f8a9f24f22bc737e06135f96775bfa608fba3993571b2765359c2a9263", "measured_slow_code": "from collections import Counter, defaultdict, deque\nfrom heapq import heappop, heappush, heapify\nimport sys, bisect, math, itertools, fractions, pprint\n\nsys.setrecursionlimit(10**8)\nmod = 10**9 + 7\nINF = float(\"inf\")\n\n\ndef inp():\n return int(sys.stdin.readline())\n\n\ndef inpl():\n return list(map(int, sys.stdin.readline().split()))\n\n\nn = inp()\na = inpl()\na.sort(reverse=True)\ncnt = n\nind = 0\nres = 0\nwhile cnt:\n if ind % 2:\n res += a[ind]\n cnt -= 1\n ind += 1\nprint(res)\n", "measured_slow_code_sha256": "7693ad55686e6fd618fa19be5402464b2c1d8a6534c46b08c3072eed6c243853", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.4683537195215886, "pair_id": "python_v2_1ab0d12c8203715290fffd32", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03767", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03767_5d9000f8a9f24f22bc737e06135f96775bfa608fba3993571b2765359c2a9263.jsonl.gz", "inputs": "reproduction/python/inputs/p03767.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03767_7693ad55686e6fd618fa19be5402464b2c1d8a6534c46b08c3072eed6c243853.jsonl.gz"}, "slow_code": "from collections import Counter, defaultdict, deque\nfrom heapq import heappop, heappush, heapify\nimport sys, bisect, math, itertools, fractions, pprint\n\nsys.setrecursionlimit(10**8)\nmod = 10**9 + 7\nINF = float(\"inf\")\n\n\ndef inp():\n return int(sys.stdin.readline())\n\n\ndef inpl():\n return list(map(int, sys.stdin.readline().split()))\n\n\nn = inp()\na = inpl()\na.sort(reverse=True)\ncnt = n\nind = 0\nres = 0\nwhile cnt:\n if ind % 2:\n res += a[ind]\n cnt -= 1\n ind += 1\nprint(res)\n", "slow_code_sha256": "7693ad55686e6fd618fa19be5402464b2c1d8a6534c46b08c3072eed6c243853", "slow_id": "p03767_7693ad55686e6fd618fa19be5402464b2c1d8a6534c46b08c3072eed6c243853", "speedup": 5.4783550578834515, "stratum": "4-8", "within_pair_jaccard": 0.32727272727272727, "workload": {"case_count": 100, "description": "Partition 3N participants into N disjoint teams of three. A team strength is its second-largest member strength, counting ties. Maximize the sum of team strengths. Observed inputs: N=1..100000 (median 1000); participants=3..300000 (median 3000); a_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 3300007, "median": 29687.0, "min": 8}, "input_format": ["N\na_1 ... a_(3N)"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 300001, "median": 3001.0, "min": 4}}} -{"case_ids": ["p03835_case_000", "p03835_case_001", "p03835_case_002", "p03835_case_003", "p03835_case_004", "p03835_case_005", "p03835_case_006", "p03835_case_007", "p03835_case_008", "p03835_case_009", "p03835_case_010", "p03835_case_011", "p03835_case_012", "p03835_case_013", "p03835_case_014", "p03835_case_015", "p03835_case_016", "p03835_case_017", "p03835_case_018", "p03835_case_019", "p03835_case_020", "p03835_case_021", "p03835_case_022", "p03835_case_023", "p03835_case_024", "p03835_case_025", "p03835_case_026", "p03835_case_027", "p03835_case_028", "p03835_case_029", "p03835_case_030", "p03835_case_031", "p03835_case_032", "p03835_case_033", "p03835_case_034", "p03835_case_035", "p03835_case_036", "p03835_case_037", "p03835_case_038", "p03835_case_039", "p03835_case_040", "p03835_case_041", "p03835_case_042", "p03835_case_043", "p03835_case_044", "p03835_case_045", "p03835_case_046", "p03835_case_047", "p03835_case_048", "p03835_case_049", "p03835_case_050", "p03835_case_051", "p03835_case_052", "p03835_case_053", "p03835_case_054", "p03835_case_055", "p03835_case_056", "p03835_case_057", "p03835_case_058", "p03835_case_059", "p03835_case_060", "p03835_case_061", "p03835_case_062", "p03835_case_063", "p03835_case_064", "p03835_case_065", "p03835_case_066", "p03835_case_067", "p03835_case_068", "p03835_case_069", "p03835_case_070", "p03835_case_071", "p03835_case_072", "p03835_case_073", "p03835_case_074", "p03835_case_075", "p03835_case_076", "p03835_case_077", "p03835_case_078", "p03835_case_079", "p03835_case_080", "p03835_case_081", "p03835_case_082", "p03835_case_083", "p03835_case_084", "p03835_case_085", "p03835_case_086", "p03835_case_087", "p03835_case_088", "p03835_case_089", "p03835_case_090", "p03835_case_091", "p03835_case_092", "p03835_case_093", "p03835_case_094", "p03835_case_095", "p03835_case_096", "p03835_case_097", "p03835_case_098", "p03835_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "K, S = list(map(int, input().split()))\nans = 0\nfor Z in range(K + 1):\n r = S - Z\n if r < 0:\n ans += 0\n elif r <= K:\n ans += r + 1\n elif r <= K * 2:\n ans += (K + 1) * 2 - (r + 1)\nprint(ans)\n", "fast_code_sha256": "c2f2c25a913f55de896a42cfed81423ff4cc0c19ac1bc8e35fc294c5e102b07e", "fast_id": "p03835_c2f2c25a913f55de896a42cfed81423ff4cc0c19ac1bc8e35fc294c5e102b07e", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "K, S = list(map(int, input().split()))\nans = 0\nfor Z in range(K + 1):\n r = S - Z\n if r < 0:\n ans += 0\n elif r <= K:\n ans += r + 1\n elif r <= K * 2:\n ans += (K + 1) * 2 - (r + 1)\nprint(ans)\n", "measured_fast_code_sha256": "c2f2c25a913f55de896a42cfed81423ff4cc0c19ac1bc8e35fc294c5e102b07e", "measured_slow_code": "K, S = list(map(int, input().split()))\ns = 0\nfor x in range(min(S, K) + 1):\n for y in range(min(S - x, K) + 1):\n if S - x - y <= K:\n s += 1\nprint(s)\n", "measured_slow_code_sha256": "e1205ac70321c4920de9bfdcd226acbd5ee3a72a0c0560731e7873009543ff89", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 411.7339751410404, "pair_id": "python_v2_c806859e729c45934d0f8277", "per_case_slow_code_faster_fraction": 0.12, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03835", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03835_c2f2c25a913f55de896a42cfed81423ff4cc0c19ac1bc8e35fc294c5e102b07e.jsonl.gz", "inputs": "reproduction/python/inputs/p03835.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03835_e1205ac70321c4920de9bfdcd226acbd5ee3a72a0c0560731e7873009543ff89.jsonl.gz"}, "slow_code": "K, S = list(map(int, input().split()))\ns = 0\nfor x in range(min(S, K) + 1):\n for y in range(min(S - x, K) + 1):\n if S - x - y <= K:\n s += 1\nprint(s)\n", "slow_code_sha256": "e1205ac70321c4920de9bfdcd226acbd5ee3a72a0c0560731e7873009543ff89", "slow_id": "p03835_e1205ac70321c4920de9bfdcd226acbd5ee3a72a0c0560731e7873009543ff89", "speedup": 118.00428007610917, "stratum": "8+", "within_pair_jaccard": 0.6086956521739131, "workload": {"case_count": 100, "description": "Count ordered integer triples (X,Y,Z) satisfying 0<=X,Y,Z<=K and X+Y+Z=S. Observed inputs: K=2..2500 (median 1275.5); S=0..7500 (median 1510.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 10, "median": 9.0, "min": 4}, "input_format": ["K S"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p03449_case_000", "p03449_case_001", "p03449_case_002", "p03449_case_003", "p03449_case_004", "p03449_case_005", "p03449_case_006", "p03449_case_007", "p03449_case_008", "p03449_case_009", "p03449_case_010", "p03449_case_011", "p03449_case_012", "p03449_case_013", "p03449_case_014", "p03449_case_015", "p03449_case_016", "p03449_case_017", "p03449_case_018", "p03449_case_019", "p03449_case_020", "p03449_case_021", "p03449_case_022", "p03449_case_023", "p03449_case_024", "p03449_case_025", "p03449_case_026", "p03449_case_027", "p03449_case_028", "p03449_case_029", "p03449_case_030", "p03449_case_031", "p03449_case_032", "p03449_case_033", "p03449_case_034", "p03449_case_035", "p03449_case_036", "p03449_case_037", "p03449_case_038", "p03449_case_039", "p03449_case_040", "p03449_case_041", "p03449_case_042", "p03449_case_043", "p03449_case_044", "p03449_case_045", "p03449_case_046", "p03449_case_047", "p03449_case_048", "p03449_case_049", "p03449_case_050", "p03449_case_051", "p03449_case_052", "p03449_case_053", "p03449_case_054", "p03449_case_055", "p03449_case_056", "p03449_case_057", "p03449_case_058", "p03449_case_059", "p03449_case_060", "p03449_case_061", "p03449_case_062", "p03449_case_063", "p03449_case_064", "p03449_case_065", "p03449_case_066", "p03449_case_067", "p03449_case_068", "p03449_case_069", "p03449_case_070", "p03449_case_071", "p03449_case_072", "p03449_case_073", "p03449_case_074", "p03449_case_075", "p03449_case_076", "p03449_case_077", "p03449_case_078", "p03449_case_079", "p03449_case_080", "p03449_case_081", "p03449_case_082", "p03449_case_083", "p03449_case_084", "p03449_case_085", "p03449_case_086", "p03449_case_087", "p03449_case_088", "p03449_case_089", "p03449_case_090", "p03449_case_091", "p03449_case_092", "p03449_case_093", "p03449_case_094", "p03449_case_095", "p03449_case_096", "p03449_case_097", "p03449_case_098", "p03449_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N = int(eval(input()))\nS0 = list(map(int, input().split()))\nS1 = list(map(int, input().split()))\nans = 0\nfor i in range(N):\n tmp = sum(S0[: i + 1]) + sum(S1[i:])\n ans = max(tmp, ans)\nprint(ans)\n", "fast_code_sha256": "0d8da106ea3146cd8cc7b09c82139881b290f81b5ab414cb7641e1219f020f13", "fast_id": "p03449_0d8da106ea3146cd8cc7b09c82139881b290f81b5ab414cb7641e1219f020f13", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N = int(eval(input()))\nS0 = list(map(int, input().split()))\nS1 = list(map(int, input().split()))\nans = 0\nfor i in range(N):\n tmp = sum(S0[: i + 1]) + sum(S1[i:])\n ans = max(tmp, ans)\nprint(ans)\n", "measured_fast_code_sha256": "0d8da106ea3146cd8cc7b09c82139881b290f81b5ab414cb7641e1219f020f13", "measured_slow_code": "# import collections\n# aa = collections.Counter(a) # list to list\n# mod = 10**9 + 7\ndef readInts():\n return list(map(int, input().split()))\n\n\ndef main():\n n = int(eval(input()))\n A = [readInts() for _ in range(2)]\n # print(*A)\n # 下に行くidxを決めておく\n idx = 0\n # ゆーてnまでしかいけないけど\n ma_ = -1\n while idx < n:\n j = 0\n cnt = 0 # なんぼあるいたか\n dist = 0 # 距離\n k = 0\n while k <= idx:\n if cnt <= n:\n dist += A[j][k]\n cnt += 1\n else:\n break\n k += 1\n k -= 1\n # ここで下にずらす\n if cnt <= n:\n j += 1\n # print(idx,j,k)\n dist += A[j][k]\n cnt += 1\n k += 1 # 次始まるときはk += 1からだから\n # 右側を探索\n if cnt <= n:\n while k < n:\n if cnt <= n:\n # print(k)\n dist += A[j][k]\n cnt += 1\n else:\n break\n k += 1\n idx += 1\n # print(dist)\n ma_ = max(ma_, dist)\n print(ma_)\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "ef6ef8b6058f8fe2ff3f6c515307d0adaccb7ef0774b4fc4ee42af36434cbe6d", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 5.238069381599729, "pair_id": "python_v2_ccd477b3a732f36c70cf516e", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03449", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03449_0d8da106ea3146cd8cc7b09c82139881b290f81b5ab414cb7641e1219f020f13.jsonl.gz", "inputs": "reproduction/python/inputs/p03449.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03449_ef6ef8b6058f8fe2ff3f6c515307d0adaccb7ef0774b4fc4ee42af36434cbe6d.jsonl.gz"}, "slow_code": "def readInts():\n return list(map(int, input().split()))\n\n\ndef main():\n n = int(eval(input()))\n A = [readInts() for _ in range(2)]\n\n idx = 0\n\n ma_ = -1\n while idx < n:\n j = 0\n cnt = 0\n dist = 0\n k = 0\n while k <= idx:\n if cnt <= n:\n dist += A[j][k]\n cnt += 1\n else:\n break\n k += 1\n k -= 1\n\n if cnt <= n:\n j += 1\n\n dist += A[j][k]\n cnt += 1\n k += 1\n\n if cnt <= n:\n while k < n:\n if cnt <= n:\n\n dist += A[j][k]\n cnt += 1\n else:\n break\n k += 1\n idx += 1\n\n ma_ = max(ma_, dist)\n print(ma_)\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "c9914409980530d0996d00d624d6ced5bcaa5e46404bf56c166db3c30c8b45e2", "slow_id": "p03449_ef6ef8b6058f8fe2ff3f6c515307d0adaccb7ef0774b4fc4ee42af36434cbe6d", "speedup": 4.619445387592291, "stratum": "4-8", "within_pair_jaccard": 0.325, "workload": {"case_count": 100, "description": "Traverse a 2-by-N candy grid from (1,1) to (2,N), moving only right or down and collecting each visited cell, including endpoints. Maximize collected candies. Observed inputs: N=1..100 (median 50); A_i_j=1..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 804, "median": 294.5, "min": 6}, "input_format": ["N\nA_1,1 ... A_1,N\nA_2,1 ... A_2,N"], "input_format_status": "source_input_section", "input_lines": {"max": 3, "median": 3.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 201, "median": 101.0, "min": 3}}} -{"case_ids": ["p03860_case_000", "p03860_case_001", "p03860_case_002", "p03860_case_003", "p03860_case_004", "p03860_case_005", "p03860_case_006", "p03860_case_007", "p03860_case_008", "p03860_case_009", "p03860_case_010", "p03860_case_011", "p03860_case_012", "p03860_case_013", "p03860_case_014", "p03860_case_015", "p03860_case_016", "p03860_case_017", "p03860_case_018", "p03860_case_019", "p03860_case_020", "p03860_case_021", "p03860_case_022", "p03860_case_023", "p03860_case_024", "p03860_case_025", "p03860_case_026", "p03860_case_027", "p03860_case_028", "p03860_case_029", "p03860_case_030", "p03860_case_031", "p03860_case_032", "p03860_case_033", "p03860_case_034", "p03860_case_035", "p03860_case_036", "p03860_case_037", "p03860_case_038", "p03860_case_039", "p03860_case_040", "p03860_case_041", "p03860_case_042", "p03860_case_043", "p03860_case_044", "p03860_case_045", "p03860_case_046", "p03860_case_047", "p03860_case_048", "p03860_case_049", "p03860_case_050", "p03860_case_051", "p03860_case_052", "p03860_case_053", "p03860_case_054", "p03860_case_055", "p03860_case_056", "p03860_case_057", "p03860_case_058", "p03860_case_059", "p03860_case_060", "p03860_case_061", "p03860_case_062", "p03860_case_063", "p03860_case_064", "p03860_case_065", "p03860_case_066", "p03860_case_067", "p03860_case_068", "p03860_case_069", "p03860_case_070", "p03860_case_071", "p03860_case_072", "p03860_case_073", "p03860_case_074", "p03860_case_075", "p03860_case_076", "p03860_case_077", "p03860_case_078", "p03860_case_079", "p03860_case_080", "p03860_case_081", "p03860_case_082", "p03860_case_083", "p03860_case_084", "p03860_case_085", "p03860_case_086", "p03860_case_087", "p03860_case_088", "p03860_case_089", "p03860_case_090", "p03860_case_091", "p03860_case_092", "p03860_case_093", "p03860_case_094", "p03860_case_095", "p03860_case_096", "p03860_case_097", "p03860_case_098", "p03860_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "print(f\"A{input()[8]}C\")\n", "fast_code_sha256": "90a8e7a092d3d647e68284a992517f0cf8a5b33869de9bb095ba08ccc8da1867", "fast_id": "p03860_90a8e7a092d3d647e68284a992517f0cf8a5b33869de9bb095ba08ccc8da1867", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "print(f\"A{input()[8]}C\")\n", "measured_fast_code_sha256": "90a8e7a092d3d647e68284a992517f0cf8a5b33869de9bb095ba08ccc8da1867", "measured_slow_code": "ls = input().split()\nLs = []\n\n\ndef fun():\n print(\"111\")\n print(\"222\")\n print(\"333\")\n print(\"ii\")\n\n\nfor i in ls:\n Ls.append(i[0])\nprint((\"\".join(Ls)))\n", "measured_slow_code_sha256": "f9c7ff6ccba211df6aa7649f397d5aec3b7d4b68331ab1524aeb9717fd467838", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.1053244183913775, "pair_id": "python_v2_a91df56c9b64af38d16b0933", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03860", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03860_90a8e7a092d3d647e68284a992517f0cf8a5b33869de9bb095ba08ccc8da1867.jsonl.gz", "inputs": "reproduction/python/inputs/p03860.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03860_f9c7ff6ccba211df6aa7649f397d5aec3b7d4b68331ab1524aeb9717fd467838.jsonl.gz"}, "slow_code": "ls = input().split()\nLs = []\n\n\ndef fun():\n print(\"111\")\n print(\"222\")\n print(\"333\")\n print(\"ii\")\n\n\nfor i in ls:\n Ls.append(i[0])\nprint((\"\".join(Ls)))\n", "slow_code_sha256": "f9c7ff6ccba211df6aa7649f397d5aec3b7d4b68331ab1524aeb9717fd467838", "slow_id": "p03860_f9c7ff6ccba211df6aa7649f397d5aec3b7d4b68331ab1524aeb9717fd467838", "speedup": 3.0956358303577174, "stratum": "2-4", "within_pair_jaccard": 0.09523809523809523, "workload": {"case_count": 100, "description": "Form a three-letter abbreviation from initials of a fixed prefix, title s, and fixed suffix. Prefix/suffix initials are A and C. The title begins with one uppercase letter followed by lowercase letters; both fixed words have 7 letters. Observed inputs: title_length=1..100 (median 50); fixed_word_length=7.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 117, "median": 67.0, "min": 18}, "input_format": ["prefix s suffix"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3, "median": 3.0, "min": 3}}} -{"case_ids": ["p03291_case_000", "p03291_case_001", "p03291_case_002", "p03291_case_003", "p03291_case_004", "p03291_case_005", "p03291_case_006", "p03291_case_007", "p03291_case_008", "p03291_case_009", "p03291_case_010", "p03291_case_011", "p03291_case_012", "p03291_case_013", "p03291_case_014", "p03291_case_015", "p03291_case_016", "p03291_case_017", "p03291_case_018", "p03291_case_019", "p03291_case_020", "p03291_case_021", "p03291_case_022", "p03291_case_023", "p03291_case_024", "p03291_case_025", "p03291_case_026", "p03291_case_027", "p03291_case_028", "p03291_case_029", "p03291_case_030", "p03291_case_031", "p03291_case_032", "p03291_case_033", "p03291_case_034", "p03291_case_035", "p03291_case_036", "p03291_case_037", "p03291_case_038", "p03291_case_039", "p03291_case_040", "p03291_case_041", "p03291_case_042", "p03291_case_043", "p03291_case_044", "p03291_case_045", "p03291_case_046", "p03291_case_047", "p03291_case_048", "p03291_case_049", "p03291_case_050", "p03291_case_051", "p03291_case_052", "p03291_case_053", "p03291_case_054", "p03291_case_055", "p03291_case_056", "p03291_case_057", "p03291_case_058", "p03291_case_059", "p03291_case_060", "p03291_case_061", "p03291_case_062", "p03291_case_063", "p03291_case_064", "p03291_case_065", "p03291_case_066", "p03291_case_067", "p03291_case_068", "p03291_case_069", "p03291_case_070", "p03291_case_071", "p03291_case_072", "p03291_case_073", "p03291_case_074", "p03291_case_075", "p03291_case_076", "p03291_case_077", "p03291_case_078", "p03291_case_079", "p03291_case_080", "p03291_case_081", "p03291_case_082", "p03291_case_083", "p03291_case_084", "p03291_case_085", "p03291_case_086", "p03291_case_087", "p03291_case_088", "p03291_case_089", "p03291_case_090", "p03291_case_091", "p03291_case_092", "p03291_case_093", "p03291_case_094", "p03291_case_095", "p03291_case_096", "p03291_case_097", "p03291_case_098", "p03291_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "S = input().strip()\nmod = 10**9 + 7\ndp = [1] + [0] * 3\nfor s in S:\n dp1 = dp[:]\n if s == \"A\":\n dp1[1] += dp[0]\n elif s == \"B\":\n dp1[2] += dp[1]\n elif s == \"C\":\n dp1[3] += dp[2]\n else:\n dp1[1] += dp[0]\n dp1[2] += dp[1]\n dp1[3] += dp[2]\n dp1[0] += 2 * dp[0]\n dp1[1] += 2 * dp[1]\n dp1[2] += 2 * dp[2]\n dp1[3] += 2 * dp[3]\n dp = [d % mod for d in dp1]\nprint((dp[-1]))\n", "fast_code_sha256": "fa4e89df610f6b68dc0a1b671138724e22469c009af7af8893a340d0b7f8c7d7", "fast_id": "p03291_fa4e89df610f6b68dc0a1b671138724e22469c009af7af8893a340d0b7f8c7d7", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "S = input().strip()\nmod = 10**9 + 7\ndp = [1] + [0] * 3\nfor s in S:\n dp1 = dp[:]\n if s == \"A\":\n dp1[1] += dp[0]\n elif s == \"B\":\n dp1[2] += dp[1]\n elif s == \"C\":\n dp1[3] += dp[2]\n else:\n dp1[1] += dp[0]\n dp1[2] += dp[1]\n dp1[3] += dp[2]\n dp1[0] += 2 * dp[0]\n dp1[1] += 2 * dp[1]\n dp1[2] += 2 * dp[2]\n dp1[3] += 2 * dp[3]\n dp = [d % mod for d in dp1]\nprint((dp[-1]))\n", "measured_fast_code_sha256": "fa4e89df610f6b68dc0a1b671138724e22469c009af7af8893a340d0b7f8c7d7", "measured_slow_code": "import sys\n\nreadline = sys.stdin.readline\nS = readline().rstrip()\nDIV = 10**9 + 7\ndp = [[0] * 4 for i in range(len(S) + 1)]\n# dp[i + 1][0] : i文字目まで見たとき、ABCの部分文字列がまだ始まっていない場合の数\n# dp[i + 1][1] : i文字目まで見たとき、ABCのAまで一致した場合の数\n# dp[i + 1][2] : i文字目まで見たとき、ABCのBまで一致した場合の数\n# dp[i + 1][3] : i文字目まで見たとき、ABCのCまで一致した場合の数\ndp[0][0] = 1\nfor i in range(len(S)):\n if S[i] == \"A\" or S[i] == \"?\":\n dp[i + 1][0] += dp[i][0] # まだ始まっていない状態をそのまま\n dp[i + 1][1] += dp[i][1] # まだ始まっていない状態をそのまま\n dp[i + 1][2] += dp[i][2] # まだ始ま���ていない状態をそのまま\n dp[i + 1][3] += dp[i][3] # まだ始まっていない状態をそのまま\n dp[i + 1][1] += dp[i][0] # 開始状態に遷移することが出来る\n if S[i] == \"B\" or S[i] == \"?\":\n dp[i + 1][0] += dp[i][0] # その文字を選ばない場合\n dp[i + 1][1] += dp[i][1] # その文字を選ばない場合\n dp[i + 1][2] += dp[i][2] # その文字を選ばない場合\n dp[i + 1][3] += dp[i][3] # その文字を選ばない場合\n dp[i + 1][2] += dp[i][1] # Bを使用した状態に遷移\n if S[i] == \"C\" or S[i] == \"?\":\n dp[i + 1][0] += dp[i][0] # その文字を選ばない場合\n dp[i + 1][1] += dp[i][1] # その文字を選ばない場合\n dp[i + 1][2] += dp[i][2] # その文字を選ばない場合\n dp[i + 1][3] += dp[i][3] # その文字を選ばない場合\n dp[i + 1][3] += dp[i][2] # Cを使用した状態に遷移\n for j in range(4):\n dp[i + 1][j] %= DIV\n# 最後の文字まで見たとき、Cまで一致した場合の数が答え\nprint((dp[len(S)][3]))\n", "measured_slow_code_sha256": "779114b7df427d693de3af90dfa08e7786175a435b3b9452dcde04bae557f05c", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.454589612039397, "pair_id": "python_v2_33b850f9761b95044a90842a", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03291", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03291_fa4e89df610f6b68dc0a1b671138724e22469c009af7af8893a340d0b7f8c7d7.jsonl.gz", "inputs": "reproduction/python/inputs/p03291.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03291_779114b7df427d693de3af90dfa08e7786175a435b3b9452dcde04bae557f05c.jsonl.gz"}, "slow_code": "import sys\n\nreadline = sys.stdin.readline\nS = readline().rstrip()\nDIV = 10**9 + 7\ndp = [[0] * 4 for i in range(len(S) + 1)]\n\n\ndp[0][0] = 1\nfor i in range(len(S)):\n if S[i] == \"A\" or S[i] == \"?\":\n dp[i + 1][0] += dp[i][0]\n dp[i + 1][1] += dp[i][1]\n dp[i + 1][2] += dp[i][2]\n dp[i + 1][3] += dp[i][3]\n dp[i + 1][1] += dp[i][0]\n if S[i] == \"B\" or S[i] == \"?\":\n dp[i + 1][0] += dp[i][0]\n dp[i + 1][1] += dp[i][1]\n dp[i + 1][2] += dp[i][2]\n dp[i + 1][3] += dp[i][3]\n dp[i + 1][2] += dp[i][1]\n if S[i] == \"C\" or S[i] == \"?\":\n dp[i + 1][0] += dp[i][0]\n dp[i + 1][1] += dp[i][1]\n dp[i + 1][2] += dp[i][2]\n dp[i + 1][3] += dp[i][3]\n dp[i + 1][3] += dp[i][2]\n for j in range(4):\n dp[i + 1][j] %= DIV\n\nprint((dp[len(S)][3]))\n", "slow_code_sha256": "bc8b996b668505e4e304571caa360d13a1ae1d85a2eb813c7156a4cbeca12747", "slow_id": "p03291_779114b7df427d693de3af90dfa08e7786175a435b3b9452dcde04bae557f05c", "speedup": 2.51009393101525, "stratum": "2-4", "within_pair_jaccard": 0.4444444444444444, "workload": {"case_count": 100, "description": "For each replacement of every ? in S by A,B or C, count triples i q:\n v -= q\n t += q\n d.append([k, v])\n else:\n t += v\n a += [f\"{k} {t}\"]\nprint((\"\\n\".join(a)))\n", "fast_code_sha256": "415e2fbfbc8c616c80b9b586b9ee67a020d1211659647030cfdfd1b8318829d1", "fast_id": "p02264_415e2fbfbc8c616c80b9b586b9ee67a020d1211659647030cfdfd1b8318829d1", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\nfrom collections import deque\n\ns = sys.stdin.readlines()\nq = int(s[0].split()[1])\nf = lambda x, y: (x, int(y))\nd = deque(f(*e.split()) for e in s[1:])\nt, a = 0, []\nwhile d:\n k, v = d.popleft()\n if v > q:\n v -= q\n t += q\n d.append([k, v])\n else:\n t += v\n a += [f\"{k} {t}\"]\nprint((\"\\n\".join(a)))\n", "measured_fast_code_sha256": "415e2fbfbc8c616c80b9b586b9ee67a020d1211659647030cfdfd1b8318829d1", "measured_slow_code": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nclass Queue:\n def __init__(self):\n self.l = []\n\n def enqueue(self, x):\n self.l.append(x)\n\n def dequeue(self):\n x = self.l[0]\n del self.l[0]\n return x\n\n def is_empty(self):\n return len(self.l) == 0\n\n\nclass Process:\n def __init__(self, name, time):\n self.name = name\n self.time = time\n\n\nif __name__ == \"__main__\":\n n, q = list(map(int, input().split()))\n Q = Queue()\n i = 0\n while i != n:\n tmp = input().split()\n Q.enqueue(Process(tmp[0], int(tmp[1])))\n i += 1\n cnt = 0\n while not Q.is_empty():\n p = Q.dequeue()\n if p.time > q:\n p.time -= q\n cnt += q\n Q.enqueue(p)\n else:\n cnt += p.time\n print(p.name, cnt)\n", "measured_slow_code_sha256": "8fffc1cd65678e3915c1056dbea3a63f7d8529b58e3eba3e7df685e8a7a3cc38", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.3554090690606277, "pair_id": "python_v2_63e52d8601779a6ca591ce78", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02264", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02264_415e2fbfbc8c616c80b9b586b9ee67a020d1211659647030cfdfd1b8318829d1.jsonl.gz", "inputs": "reproduction/python/inputs/p02264.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02264_8fffc1cd65678e3915c1056dbea3a63f7d8529b58e3eba3e7df685e8a7a3cc38.jsonl.gz"}, "slow_code": "class Queue:\n def __init__(self):\n self.l = []\n\n def enqueue(self, x):\n self.l.append(x)\n\n def dequeue(self):\n x = self.l[0]\n del self.l[0]\n return x\n\n def is_empty(self):\n return len(self.l) == 0\n\n\nclass Process:\n def __init__(self, name, time):\n self.name = name\n self.time = time\n\n\nif __name__ == \"__main__\":\n n, q = list(map(int, input().split()))\n Q = Queue()\n i = 0\n while i != n:\n tmp = input().split()\n Q.enqueue(Process(tmp[0], int(tmp[1])))\n i += 1\n cnt = 0\n while not Q.is_empty():\n p = Q.dequeue()\n if p.time > q:\n p.time -= q\n cnt += q\n Q.enqueue(p)\n else:\n cnt += p.time\n print(p.name, cnt)\n", "slow_code_sha256": "4eab27c0f139900fd193b707c9a8cfcc72d1fb519ca557f7fac50cdef510c1ff", "slow_id": "p02264_8fffc1cd65678e3915c1056dbea3a63f7d8529b58e3eba3e7df685e8a7a3cc38", "speedup": 2.281055019628064, "stratum": "2-4", "within_pair_jaccard": 0.2033898305084746, "workload": {"case_count": 100, "description": "Simulate round-robin scheduling for n processes initially queued in input order. Each has a name and required service duration time_i. Give each up to quantum q; requeue unfinished processes at the back. Output names and completion times in completion order. Observed inputs: n=1..100000 (median 30000); q=1..1000; time_i=1..50000; total_service=1..1000000 (median 1000000).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1300168, "median": 254526.5, "min": 11}, "input_format": ["n q\nname_1 time_1\n...\nname_n time_n"], "input_format_status": "source_input_section", "input_lines": {"max": 100001, "median": 30001.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200002, "median": 60002.0, "min": 4}}} -{"case_ids": ["p03649_case_000", "p03649_case_001", "p03649_case_002", "p03649_case_003", "p03649_case_004", "p03649_case_005", "p03649_case_006", "p03649_case_007", "p03649_case_008", "p03649_case_009", "p03649_case_010", "p03649_case_011", "p03649_case_012", "p03649_case_013", "p03649_case_014", "p03649_case_015", "p03649_case_016", "p03649_case_017", "p03649_case_018", "p03649_case_019", "p03649_case_020", "p03649_case_021", "p03649_case_022", "p03649_case_023", "p03649_case_024", "p03649_case_025", "p03649_case_026", "p03649_case_027", "p03649_case_028", "p03649_case_029", "p03649_case_030", "p03649_case_031", "p03649_case_032", "p03649_case_033", "p03649_case_034", "p03649_case_035", "p03649_case_036", "p03649_case_037", "p03649_case_038", "p03649_case_039", "p03649_case_040", "p03649_case_041", "p03649_case_042", "p03649_case_043", "p03649_case_044", "p03649_case_045", "p03649_case_046", "p03649_case_047", "p03649_case_048", "p03649_case_049", "p03649_case_050", "p03649_case_051", "p03649_case_052", "p03649_case_053", "p03649_case_054", "p03649_case_055", "p03649_case_056", "p03649_case_057", "p03649_case_058", "p03649_case_059", "p03649_case_060", "p03649_case_061", "p03649_case_062", "p03649_case_063", "p03649_case_064", "p03649_case_065", "p03649_case_066", "p03649_case_067", "p03649_case_068", "p03649_case_069", "p03649_case_070", "p03649_case_071", "p03649_case_072", "p03649_case_073", "p03649_case_074", "p03649_case_075", "p03649_case_076", "p03649_case_077", "p03649_case_078", "p03649_case_079", "p03649_case_080", "p03649_case_081", "p03649_case_082", "p03649_case_083", "p03649_case_084", "p03649_case_085", "p03649_case_086", "p03649_case_087", "p03649_case_088", "p03649_case_089", "p03649_case_090", "p03649_case_091", "p03649_case_092", "p03649_case_093", "p03649_case_094", "p03649_case_095", "p03649_case_096", "p03649_case_097", "p03649_case_098", "p03649_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\na = list(map(int, input().split()))\nans = 0\nwhile True:\n tmp = 0\n for i in range(n):\n k = -(-(a[i] + 1) // n) - 1\n tmp += k\n a[i] -= k * n\n a[i] -= k\n for i in range(n):\n a[i] += tmp\n if not tmp:\n break\n ans += tmp\nprint(ans)\n", "fast_code_sha256": "2890f8e8770efed4f9c4bcfae3a889c8fe41634ad1976e117b0b362228e642bd", "fast_id": "p03649_2890f8e8770efed4f9c4bcfae3a889c8fe41634ad1976e117b0b362228e642bd", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\na = list(map(int, input().split()))\nans = 0\nwhile True:\n tmp = 0\n for i in range(n):\n k = -(-(a[i] + 1) // n) - 1\n tmp += k\n a[i] -= k * n\n a[i] -= k\n for i in range(n):\n a[i] += tmp\n if not tmp:\n break\n ans += tmp\nprint(ans)\n", "measured_fast_code_sha256": "2890f8e8770efed4f9c4bcfae3a889c8fe41634ad1976e117b0b362228e642bd", "measured_slow_code": "N = int(eval(input()))\nA = list(map(int, input().split()))\n\n\ndef is_possible(C):\n res = 0\n for x in A:\n if x + C - N >= 0:\n res += (x + C - N) // (N + 1) + 1\n # print(res,C)\n return int(res <= C)\n\n\nl = 0 # impossible\nr = 10**30 # possible\nwhile r - l > 1:\n M = (l + r) // 2\n if is_possible(M) > 0:\n r = M\n else:\n l = M\nfor i in range(10**5, -1, -1):\n if is_possible(r - i):\n print((r - i))\n break\n", "measured_slow_code_sha256": "7802cf9e83571cee9bec8533b955c7050920fb8e58d892c4118c792371ce1f89", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 72.78878630247868, "pair_id": "python_v2_e1c30238a335ed794f86a7fd", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03649", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03649_2890f8e8770efed4f9c4bcfae3a889c8fe41634ad1976e117b0b362228e642bd.jsonl.gz", "inputs": "reproduction/python/inputs/p03649.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03649_7802cf9e83571cee9bec8533b955c7050920fb8e58d892c4118c792371ce1f89.jsonl.gz"}, "slow_code": "N = int(eval(input()))\nA = list(map(int, input().split()))\n\n\ndef is_possible(C):\n res = 0\n for x in A:\n if x + C - N >= 0:\n res += (x + C - N) // (N + 1) + 1\n\n return int(res <= C)\n\n\nl = 0\nr = 10**30\nwhile r - l > 1:\n M = (l + r) // 2\n if is_possible(M) > 0:\n r = M\n else:\n l = M\nfor i in range(10**5, -1, -1):\n if is_possible(r - i):\n print((r - i))\n break\n", "slow_code_sha256": "e4305a239f9ea2717f70ed35fb3cc27a2302b00f0e1b22d9b7c48daa06061a76", "slow_id": "p03649_7802cf9e83571cee9bec8533b955c7050920fb8e58d892c4118c792371ce1f89", "speedup": 107.20064056774594, "stratum": "8+", "within_pair_jaccard": 0.42105263157894735, "workload": {"case_count": 100, "description": "While the largest array entry is at least N, choose one maximum entry, subtract N from it, and add 1 to every other entry. Count operations until all entries are below N. Initial values are nonnegative. Observed inputs: N=2..50 (median 20); a_i=0..10000000000001000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 903, "median": 147.5, "min": 6}, "input_format": ["N\na_1 ... a_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 51, "median": 21.0, "min": 3}}} -{"case_ids": ["p00267_case_000", "p00267_case_001", "p00267_case_002", "p00267_case_003", "p00267_case_004", "p00267_case_005", "p00267_case_006", "p00267_case_007", "p00267_case_008", "p00267_case_009", "p00267_case_010", "p00267_case_011", "p00267_case_012", "p00267_case_013", "p00267_case_014", "p00267_case_015", "p00267_case_016", "p00267_case_017", "p00267_case_018", "p00267_case_019", "p00267_case_020", "p00267_case_021", "p00267_case_022", "p00267_case_023", "p00267_case_024", "p00267_case_025", "p00267_case_026", "p00267_case_027", "p00267_case_028", "p00267_case_029", "p00267_case_030", "p00267_case_031", "p00267_case_032", "p00267_case_033", "p00267_case_034", "p00267_case_035", "p00267_case_036", "p00267_case_037", "p00267_case_038", "p00267_case_039", "p00267_case_040", "p00267_case_041", "p00267_case_042", "p00267_case_043", "p00267_case_044", "p00267_case_045", "p00267_case_046", "p00267_case_047", "p00267_case_048", "p00267_case_049", "p00267_case_050", "p00267_case_051", "p00267_case_052", "p00267_case_053", "p00267_case_054", "p00267_case_055", "p00267_case_056", "p00267_case_057", "p00267_case_058", "p00267_case_059", "p00267_case_060", "p00267_case_061", "p00267_case_062", "p00267_case_063", "p00267_case_064", "p00267_case_065", "p00267_case_066", "p00267_case_067", "p00267_case_068", "p00267_case_069", "p00267_case_070", "p00267_case_071", "p00267_case_072", "p00267_case_073", "p00267_case_074", "p00267_case_075", "p00267_case_076", "p00267_case_077", "p00267_case_078", "p00267_case_079", "p00267_case_080", "p00267_case_081", "p00267_case_082", "p00267_case_083", "p00267_case_084", "p00267_case_085", "p00267_case_086", "p00267_case_087", "p00267_case_088", "p00267_case_089", "p00267_case_090", "p00267_case_091", "p00267_case_092", "p00267_case_093", "p00267_case_094", "p00267_case_095", "p00267_case_096", "p00267_case_097", "p00267_case_098", "p00267_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "while True:\n n = int(eval(input()))\n if n == 0:\n break\n a = list(map(int, input().split()))\n b = list(map(int, input().split()))\n a.sort(reverse=True)\n b.sort(reverse=True)\n ans, i = n, -1\n for k in range(0, n, 2):\n i += 1\n if a[k] > b[i]:\n ans = k + 1\n break\n print((\"NA\" if ans == n else ans))\n", "fast_code_sha256": "f669995f41077f5d8b5b30dbecc4d6396ca18799fc085ac8b3731cb00f6f4aa4", "fast_id": "p00267_6f1b8994dd229e6feff1ee53bee9c5e01a0a4789737128aa5b88a5057f093375", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "# AOJ 0272: The Lonely Girl's Lie\n# Python3 2018.6.26 bal4u\nwhile True:\n n = int(eval(input()))\n if n == 0:\n break\n a = list(map(int, input().split()))\n b = list(map(int, input().split()))\n a.sort(reverse=True)\n b.sort(reverse=True)\n ans, i = n, -1\n for k in range(0, n, 2):\n i += 1\n if a[k] > b[i]:\n ans = k + 1\n break\n print((\"NA\" if ans == n else ans))\n", "measured_fast_code_sha256": "6f1b8994dd229e6feff1ee53bee9c5e01a0a4789737128aa5b88a5057f093375", "measured_slow_code": "# AOJ 0272: The Lonely Girl's Lie\n# Python3 2018.6.26 bal4u\ndef counting_sort(nmax, la): # nmax:最大値, n:len(la), a:データリスト\n f = [0] * (nmax + 1)\n nmax = 0\n for a in la:\n f[a] += 1\n if a > nmax:\n nmax = a\n k, i = len(la), nmax\n la = []\n while k:\n if f[i]:\n la += [i] * f[i]\n k -= f[i]\n i -= 1\n return la\n\n\nwhile True:\n n = int(eval(input()))\n if n == 0:\n break\n a = list(map(int, input().split()))\n b = list(map(int, input().split()))\n a = counting_sort(100000, a)\n b = counting_sort(100000, b)\n ans, i = n, -1\n for k in range(0, n, 2):\n i += 1\n if a[k] > b[i]:\n ans = k + 1\n break\n print((\"NA\" if ans == n else ans))\n", "measured_slow_code_sha256": "121c6b2fb2015594dfca021132dc90bcafa6e6e79d4d82ffeebee7da0bff3ce8", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 56.88543506603443, "pair_id": "python_v2_d57b0bec3e95d2d9ff3ddf66", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p00267", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p00267_6f1b8994dd229e6feff1ee53bee9c5e01a0a4789737128aa5b88a5057f093375.jsonl.gz", "inputs": "reproduction/python/inputs/p00267.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p00267_121c6b2fb2015594dfca021132dc90bcafa6e6e79d4d82ffeebee7da0bff3ce8.jsonl.gz"}, "slow_code": "def counting_sort(nmax, la):\n f = [0] * (nmax + 1)\n nmax = 0\n for a in la:\n f[a] += 1\n if a > nmax:\n nmax = a\n k, i = len(la), nmax\n la = []\n while k:\n if f[i]:\n la += [i] * f[i]\n k -= f[i]\n i -= 1\n return la\n\n\nwhile True:\n n = int(eval(input()))\n if n == 0:\n break\n a = list(map(int, input().split()))\n b = list(map(int, input().split()))\n a = counting_sort(100000, a)\n b = counting_sort(100000, b)\n ans, i = n, -1\n for k in range(0, n, 2):\n i += 1\n if a[k] > b[i]:\n ans = k + 1\n break\n print((\"NA\" if ans == n else ans))\n", "slow_code_sha256": "54ce01755426706394185ba79e433944944352764e823d456517a08e77403f77", "slow_id": "p00267_121c6b2fb2015594dfca021132dc90bcafa6e6e79d4d82ffeebee7da0bff3ce8", "speedup": 34.19988690505239, "stratum": "8+", "within_pair_jaccard": 0.7142857142857143, "workload": {"case_count": 100, "description": "Find the smallest team size k with 1<=k 0:\n idx = bisect.bisect_left(l6, a)\n if a == l6[idx]:\n a -= l6[idx]\n else:\n a -= l6[idx - 1]\n p += 1\n q = 0\n while b > 0:\n idx = bisect.bisect_left(l9, b)\n if b == l9[idx]:\n b -= l9[idx]\n else:\n b -= l9[idx - 1]\n q += 1\n ans = min(ans, p + q)\nprint(ans)\n", "measured_slow_code_sha256": "3bc968d0f616033ddfd795ca7a93a332cf62e4e0d2363198f4f7733a27640b4e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 6.071215267893519, "pair_id": "python_v2_ed054918a2c35f9623868d45", "per_case_slow_code_faster_fraction": 0.02, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03329", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03329_d16eca4c6ae9986c748d2f6c716c843cd745fd432d5ea5edce76a8a161abd557.jsonl.gz", "inputs": "reproduction/python/inputs/p03329.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03329_3bc968d0f616033ddfd795ca7a93a332cf62e4e0d2363198f4f7733a27640b4e.jsonl.gz"}, "slow_code": "l9 = []\nl9.append(1)\ntmp = 1\nwhile tmp <= 10**5:\n tmp *= 9\n l9.append(tmp)\nl6 = []\nl6.append(1)\ntmp = 1\nwhile tmp <= 10**5:\n tmp *= 6\n l6.append(tmp)\nimport bisect\n\nn = int(eval(input()))\nans = 10**6\nfor i in range(0, n + 1):\n a = i\n b = n - i\n p = 0\n while a > 0:\n idx = bisect.bisect_left(l6, a)\n if a == l6[idx]:\n a -= l6[idx]\n else:\n a -= l6[idx - 1]\n p += 1\n q = 0\n while b > 0:\n idx = bisect.bisect_left(l9, b)\n if b == l9[idx]:\n b -= l9[idx]\n else:\n b -= l9[idx - 1]\n q += 1\n ans = min(ans, p + q)\nprint(ans)\n", "slow_code_sha256": "3bc968d0f616033ddfd795ca7a93a332cf62e4e0d2363198f4f7733a27640b4e", "slow_id": "p03329_3bc968d0f616033ddfd795ca7a93a332cf62e4e0d2363198f4f7733a27640b4e", "speedup": 6.547832099237313, "stratum": "4-8", "within_pair_jaccard": 0.43902439024390244, "workload": {"case_count": 100, "description": "Withdraw exactly N units with minimum operations. Each operation withdraws 1, a positive integer power of 6, or a positive integer power of 9. Withdrawn money cannot be redeposited. Observed inputs: N=1..100000 (median 5282.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 7, "median": 5.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p03343_case_000", "p03343_case_001", "p03343_case_002", "p03343_case_003", "p03343_case_004", "p03343_case_005", "p03343_case_006", "p03343_case_007", "p03343_case_008", "p03343_case_009", "p03343_case_010", "p03343_case_011", "p03343_case_012", "p03343_case_013", "p03343_case_014", "p03343_case_015", "p03343_case_016", "p03343_case_017", "p03343_case_018", "p03343_case_019", "p03343_case_020", "p03343_case_021", "p03343_case_022", "p03343_case_023", "p03343_case_024", "p03343_case_025", "p03343_case_026", "p03343_case_027", "p03343_case_028", "p03343_case_029", "p03343_case_030", "p03343_case_031", "p03343_case_032", "p03343_case_033", "p03343_case_034", "p03343_case_035", "p03343_case_036", "p03343_case_037", "p03343_case_038", "p03343_case_039", "p03343_case_040", "p03343_case_041", "p03343_case_042", "p03343_case_043", "p03343_case_044", "p03343_case_045", "p03343_case_046", "p03343_case_047", "p03343_case_048", "p03343_case_049", "p03343_case_050", "p03343_case_051", "p03343_case_052", "p03343_case_053", "p03343_case_054", "p03343_case_055", "p03343_case_056", "p03343_case_057", "p03343_case_058", "p03343_case_059", "p03343_case_060", "p03343_case_061", "p03343_case_062", "p03343_case_063", "p03343_case_064", "p03343_case_065", "p03343_case_066", "p03343_case_067", "p03343_case_068", "p03343_case_069", "p03343_case_070", "p03343_case_071", "p03343_case_072", "p03343_case_073", "p03343_case_074", "p03343_case_075", "p03343_case_076", "p03343_case_077", "p03343_case_078", "p03343_case_079", "p03343_case_080", "p03343_case_081", "p03343_case_082", "p03343_case_083", "p03343_case_084", "p03343_case_085", "p03343_case_086", "p03343_case_087", "p03343_case_088", "p03343_case_089", "p03343_case_090", "p03343_case_091", "p03343_case_092", "p03343_case_093", "p03343_case_094", "p03343_case_095", "p03343_case_096", "p03343_case_097", "p03343_case_098", "p03343_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N, K, Q = list(map(int, input().split()))\nA = list(map(int, input().split()))\nD = set()\nfor i in range(N):\n D.add(A[i])\nD = list(D)\nans = float(\"inf\")\nfor Y in D:\n T = []\n tmp = []\n for j in range(N):\n if A[j] >= Y:\n tmp.append(A[j])\n else:\n if len(tmp) >= K:\n tmp = sorted(tmp)\n T += tmp[: len(tmp) - K + 1]\n tmp = []\n if len(tmp) >= K:\n tmp = sorted(tmp)\n T += tmp[: len(tmp) - K + 1]\n if len(T) >= Q:\n T = sorted(T)\n T = T[:Q]\n ans = min(ans, T[-1] - T[0])\nprint(ans)\n", "fast_code_sha256": "b7a50bcc6feb7fd034053a77ca216f3dcb531d4fe421cf97ea0ac41086db53f3", "fast_id": "p03343_b7a50bcc6feb7fd034053a77ca216f3dcb531d4fe421cf97ea0ac41086db53f3", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N, K, Q = list(map(int, input().split()))\nA = list(map(int, input().split()))\nD = set()\nfor i in range(N):\n D.add(A[i])\nD = list(D)\nans = float(\"inf\")\nfor Y in D:\n T = []\n tmp = []\n for j in range(N):\n if A[j] >= Y:\n tmp.append(A[j])\n else:\n if len(tmp) >= K:\n tmp = sorted(tmp)\n T += tmp[: len(tmp) - K + 1]\n tmp = []\n if len(tmp) >= K:\n tmp = sorted(tmp)\n T += tmp[: len(tmp) - K + 1]\n if len(T) >= Q:\n T = sorted(T)\n T = T[:Q]\n ans = min(ans, T[-1] - T[0])\nprint(ans)\n", "measured_fast_code_sha256": "b7a50bcc6feb7fd034053a77ca216f3dcb531d4fe421cf97ea0ac41086db53f3", "measured_slow_code": "n, k, q = list(map(int, input().split()))\na = list(map(int, input().split()))\nans = 10**10\nfor i, y in enumerate(a):\n li = []\n l = 0\n cnd = []\n l_cnd = 0\n for j, x in enumerate(a + [-1]):\n if x < y:\n if l - k + 1 >= 0:\n li.sort()\n cnd += li[: l - k + 1]\n l_cnd += l - k + 1\n li = []\n l = 0\n else:\n li.append(x)\n l += 1\n if l_cnd >= q:\n cnd.sort()\n sub = cnd[q - 1] - y\n ans = min(ans, sub)\nprint(ans)\n", "measured_slow_code_sha256": "99dd2d44382de196d10ae4f2c327d5c91d71e1646ed9d910338f34f2fd115024", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.4123425402302052, "pair_id": "python_v2_6ce823fedef1a6c63721a3ac", "per_case_slow_code_faster_fraction": 0.03, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03343", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03343_b7a50bcc6feb7fd034053a77ca216f3dcb531d4fe421cf97ea0ac41086db53f3.jsonl.gz", "inputs": "reproduction/python/inputs/p03343.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03343_99dd2d44382de196d10ae4f2c327d5c91d71e1646ed9d910338f34f2fd115024.jsonl.gz"}, "slow_code": "n, k, q = list(map(int, input().split()))\na = list(map(int, input().split()))\nans = 10**10\nfor i, y in enumerate(a):\n li = []\n l = 0\n cnd = []\n l_cnd = 0\n for j, x in enumerate(a + [-1]):\n if x < y:\n if l - k + 1 >= 0:\n li.sort()\n cnd += li[: l - k + 1]\n l_cnd += l - k + 1\n li = []\n l = 0\n else:\n li.append(x)\n l += 1\n if l_cnd >= q:\n cnd.sort()\n sub = cnd[q - 1] - y\n ans = min(ans, sub)\nprint(ans)\n", "slow_code_sha256": "99dd2d44382de196d10ae4f2c327d5c91d71e1646ed9d910338f34f2fd115024", "slow_id": "p03343_99dd2d44382de196d10ae4f2c327d5c91d71e1646ed9d910338f34f2fd115024", "speedup": 7.348345823893066, "stratum": "4-8", "within_pair_jaccard": 0.3695652173913043, "workload": {"case_count": 100, "description": "Repeat Q times: choose K consecutive entries of the current sequence and remove one minimum entry from that block. Minimize the largest removed value minus the smallest over all Q removals. Observed inputs: N=1..2000 (median 2000); K=1..2000 (median 1000); Q=1..2000 (median 1000); A_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 22012, "median": 19779.0, "min": 8}, "input_format": ["N K Q\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2003, "median": 2003.0, "min": 4}}} -{"case_ids": ["p02549_case_000", "p02549_case_001", "p02549_case_002", "p02549_case_003", "p02549_case_004", "p02549_case_005", "p02549_case_006", "p02549_case_007", "p02549_case_008", "p02549_case_009", "p02549_case_010", "p02549_case_011", "p02549_case_012", "p02549_case_013", "p02549_case_014", "p02549_case_015", "p02549_case_016", "p02549_case_017", "p02549_case_018", "p02549_case_019", "p02549_case_020", "p02549_case_021", "p02549_case_022", "p02549_case_023", "p02549_case_024", "p02549_case_025", "p02549_case_026", "p02549_case_027", "p02549_case_028", "p02549_case_029", "p02549_case_030", "p02549_case_031", "p02549_case_032", "p02549_case_033", "p02549_case_034", "p02549_case_035", "p02549_case_036", "p02549_case_037", "p02549_case_038", "p02549_case_039", "p02549_case_040", "p02549_case_041", "p02549_case_042", "p02549_case_043", "p02549_case_044", "p02549_case_045", "p02549_case_046", "p02549_case_047", "p02549_case_048", "p02549_case_049", "p02549_case_050", "p02549_case_051", "p02549_case_052", "p02549_case_053", "p02549_case_054", "p02549_case_055", "p02549_case_056", "p02549_case_057", "p02549_case_058", "p02549_case_059", "p02549_case_060", "p02549_case_061", "p02549_case_062", "p02549_case_063", "p02549_case_064", "p02549_case_065", "p02549_case_066", "p02549_case_067", "p02549_case_068", "p02549_case_069", "p02549_case_070", "p02549_case_071", "p02549_case_072", "p02549_case_073", "p02549_case_074", "p02549_case_075", "p02549_case_076", "p02549_case_077", "p02549_case_078", "p02549_case_079", "p02549_case_080", "p02549_case_081", "p02549_case_082", "p02549_case_083", "p02549_case_084", "p02549_case_085", "p02549_case_086", "p02549_case_087", "p02549_case_088", "p02549_case_089", "p02549_case_090", "p02549_case_091", "p02549_case_092", "p02549_case_093", "p02549_case_094", "p02549_case_095", "p02549_case_096", "p02549_case_097", "p02549_case_098", "p02549_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "MOD = 998244353\n\n\ndef solve(lr, dp, n):\n acc_dp = [1] * n\n for i in range(1, n):\n val = 0\n for d in lr:\n a = i - d[0]\n if a < 0:\n continue\n b = i - d[1] - 1\n val += acc_dp[a] - (acc_dp[b] if b >= 0 else 0)\n dp[i] = val % MOD\n acc_dp[i] = (acc_dp[i - 1] + dp[i]) % MOD\n return dp[n - 1]\n\n\ndef main():\n f = open(0)\n n, k = [int(x) for x in f.readline().split()]\n lr = [[int(x) for x in f.readline().split()] for _ in range(k)]\n dp = [0] * n\n dp[0] = 1\n ans = solve(lr, dp, n)\n print(ans)\n\n\nmain()\n", "fast_code_sha256": "2f872558e5927545ab1eb8cb8aa27f65b5fb5a3df11aade1137944ef12e27f50", "fast_id": "p02549_2f872558e5927545ab1eb8cb8aa27f65b5fb5a3df11aade1137944ef12e27f50", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "MOD = 998244353\n\n\ndef solve(lr, dp, n):\n acc_dp = [1] * n\n for i in range(1, n):\n val = 0\n for d in lr:\n a = i - d[0]\n if a < 0:\n continue\n b = i - d[1] - 1\n val += acc_dp[a] - (acc_dp[b] if b >= 0 else 0)\n dp[i] = val % MOD\n acc_dp[i] = (acc_dp[i - 1] + dp[i]) % MOD\n return dp[n - 1]\n\n\ndef main():\n f = open(0)\n n, k = [int(x) for x in f.readline().split()]\n lr = [[int(x) for x in f.readline().split()] for _ in range(k)]\n dp = [0] * n\n dp[0] = 1\n ans = solve(lr, dp, n)\n print(ans)\n\n\nmain()\n", "measured_fast_code_sha256": "2f872558e5927545ab1eb8cb8aa27f65b5fb5a3df11aade1137944ef12e27f50", "measured_slow_code": "mod = 998244353\nn, k = list(map(int, input().split()))\nK = [list(map(int, input().split())) for i in range(k)]\ndp = [0] * (n + 5)\ndp[1] = 1\ndp2 = [0] * (n + 5)\nfor i in range(1, n + 1):\n dp[i] = (dp[i] + dp2[i] + dp2[i - 1]) % mod\n dp2[i] = (dp2[i] + dp2[i - 1]) % mod\n for l, r in K:\n dp2[min(i + l, n + 2)] += dp[i]\n dp2[min(i + l, n + 2)] %= mod\n dp2[min(i + r + 1, n + 2)] -= dp[i]\n dp2[min(i + r + 1, n + 2)] %= mod\nprint((dp[n] % mod))\n", "measured_slow_code_sha256": "44c9516e92f38f09d76b47812276c2878e77eeefdb8dab9cc1137c27ddfc7b8e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4.5311948961722575, "pair_id": "python_v2_0c2a34ebcc6c0fe7103b874f", "per_case_slow_code_faster_fraction": 0.11, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02549", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02549_2f872558e5927545ab1eb8cb8aa27f65b5fb5a3df11aade1137944ef12e27f50.jsonl.gz", "inputs": "reproduction/python/inputs/p02549.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02549_44c9516e92f38f09d76b47812276c2878e77eeefdb8dab9cc1137c27ddfc7b8e.jsonl.gz"}, "slow_code": "mod = 998244353\nn, k = list(map(int, input().split()))\nK = [list(map(int, input().split())) for i in range(k)]\ndp = [0] * (n + 5)\ndp[1] = 1\ndp2 = [0] * (n + 5)\nfor i in range(1, n + 1):\n dp[i] = (dp[i] + dp2[i] + dp2[i - 1]) % mod\n dp2[i] = (dp2[i] + dp2[i - 1]) % mod\n for l, r in K:\n dp2[min(i + l, n + 2)] += dp[i]\n dp2[min(i + l, n + 2)] %= mod\n dp2[min(i + r + 1, n + 2)] -= dp[i]\n dp2[min(i + r + 1, n + 2)] %= mod\nprint((dp[n] % mod))\n", "slow_code_sha256": "44c9516e92f38f09d76b47812276c2878e77eeefdb8dab9cc1137c27ddfc7b8e", "slow_id": "p02549_44c9516e92f38f09d76b47812276c2878e77eeefdb8dab9cc1137c27ddfc7b8e", "speedup": 3.2809239780295147, "stratum": "2-4", "within_pair_jaccard": 0.29545454545454547, "workload": {"case_count": 100, "description": "Count paths from cell 1 to N, modulo 998244353, moving forward by a length in the union of K disjoint inclusive intervals [L_i,R_i], without leaving the row. Observed inputs: N=2..200000 (median 5500); K=1..10 (median 5); L_i=1..200000; R_i=1..200000; allowed_step_count=1..170805 (median 10).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 150, "median": 49.0, "min": 8}, "input_format": ["N K\nL_1 R_1\n...\nL_K R_K"], "input_format_status": "source_input_section", "input_lines": {"max": 11, "median": 6.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 22, "median": 12.0, "min": 4}}} -{"case_ids": ["p03737_case_000", "p03737_case_001", "p03737_case_002", "p03737_case_003", "p03737_case_004", "p03737_case_005", "p03737_case_006", "p03737_case_007", "p03737_case_008", "p03737_case_009", "p03737_case_010", "p03737_case_011", "p03737_case_012", "p03737_case_013", "p03737_case_014", "p03737_case_015", "p03737_case_016", "p03737_case_017", "p03737_case_018", "p03737_case_019", "p03737_case_020", "p03737_case_021", "p03737_case_022", "p03737_case_023", "p03737_case_024", "p03737_case_025", "p03737_case_026", "p03737_case_027", "p03737_case_028", "p03737_case_029", "p03737_case_030", "p03737_case_031", "p03737_case_032", "p03737_case_033", "p03737_case_034", "p03737_case_035", "p03737_case_036", "p03737_case_037", "p03737_case_038", "p03737_case_039", "p03737_case_040", "p03737_case_041", "p03737_case_042", "p03737_case_043", "p03737_case_044", "p03737_case_045", "p03737_case_046", "p03737_case_047", "p03737_case_048", "p03737_case_049", "p03737_case_050", "p03737_case_051", "p03737_case_052", "p03737_case_053", "p03737_case_054", "p03737_case_055", "p03737_case_056", "p03737_case_057", "p03737_case_058", "p03737_case_059", "p03737_case_060", "p03737_case_061", "p03737_case_062", "p03737_case_063", "p03737_case_064", "p03737_case_065", "p03737_case_066", "p03737_case_067", "p03737_case_068", "p03737_case_069", "p03737_case_070", "p03737_case_071", "p03737_case_072", "p03737_case_073", "p03737_case_074", "p03737_case_075", "p03737_case_076", "p03737_case_077", "p03737_case_078", "p03737_case_079", "p03737_case_080", "p03737_case_081", "p03737_case_082", "p03737_case_083", "p03737_case_084", "p03737_case_085", "p03737_case_086", "p03737_case_087", "p03737_case_088", "p03737_case_089", "p03737_case_090", "p03737_case_091", "p03737_case_092", "p03737_case_093", "p03737_case_094", "p03737_case_095", "p03737_case_096", "p03737_case_097", "p03737_case_098", "p03737_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "a, b, c = input().split()\nprint((a[0].upper() + b[0].upper() + c[0].upper()))\n", "fast_code_sha256": "6db8dfdbd1030b078d911aa61a5b641680f88ed6eb95e0c37f40e9fef3717917", "fast_id": "p03737_6db8dfdbd1030b078d911aa61a5b641680f88ed6eb95e0c37f40e9fef3717917", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "a, b, c = input().split()\nprint((a[0].upper() + b[0].upper() + c[0].upper()))\n", "measured_fast_code_sha256": "6db8dfdbd1030b078d911aa61a5b641680f88ed6eb95e0c37f40e9fef3717917", "measured_slow_code": "import numpy as np\nimport math\n\ns = \" \" + input()\nfor i in range(len(s)):\n if s[i] == \" \":\n print(chr(ord(s[i + 1]) - 32), end=\"\")\nprint()\n", "measured_slow_code_sha256": "c5a6a790bfe3c359c7ab2698d0f376a617bb650fa938bf64d595d41523985f6d", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2246.5729101716533, "pair_id": "python_v2_cd2bb6af041742504a0998b0", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03737", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03737_6db8dfdbd1030b078d911aa61a5b641680f88ed6eb95e0c37f40e9fef3717917.jsonl.gz", "inputs": "reproduction/python/inputs/p03737.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03737_c5a6a790bfe3c359c7ab2698d0f376a617bb650fa938bf64d595d41523985f6d.jsonl.gz"}, "slow_code": "import numpy as np\nimport math\n\ns = \" \" + input()\nfor i in range(len(s)):\n if s[i] == \" \":\n print(chr(ord(s[i + 1]) - 32), end=\"\")\nprint()\n", "slow_code_sha256": "c5a6a790bfe3c359c7ab2698d0f376a617bb650fa938bf64d595d41523985f6d", "slow_id": "p03737_c5a6a790bfe3c359c7ab2698d0f376a617bb650fa938bf64d595d41523985f6d", "speedup": 2245.427542578936, "stratum": "8+", "within_pair_jaccard": 0.08, "workload": {"case_count": 100, "description": "Form an acronym from the uppercase first letters of three supplied lowercase words, in their given order. Observed inputs: word_length=1..10.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 33, "median": 18.0, "min": 6}, "input_format": ["s_1 s_2 s_3"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3, "median": 3.0, "min": 3}}} -{"case_ids": ["p03649_case_000", "p03649_case_001", "p03649_case_002", "p03649_case_003", "p03649_case_004", "p03649_case_005", "p03649_case_006", "p03649_case_007", "p03649_case_008", "p03649_case_009", "p03649_case_010", "p03649_case_011", "p03649_case_012", "p03649_case_013", "p03649_case_014", "p03649_case_015", "p03649_case_016", "p03649_case_017", "p03649_case_018", "p03649_case_019", "p03649_case_020", "p03649_case_021", "p03649_case_022", "p03649_case_023", "p03649_case_024", "p03649_case_025", "p03649_case_026", "p03649_case_027", "p03649_case_028", "p03649_case_029", "p03649_case_030", "p03649_case_031", "p03649_case_032", "p03649_case_033", "p03649_case_034", "p03649_case_035", "p03649_case_036", "p03649_case_037", "p03649_case_038", "p03649_case_039", "p03649_case_040", "p03649_case_041", "p03649_case_042", "p03649_case_043", "p03649_case_044", "p03649_case_045", "p03649_case_046", "p03649_case_047", "p03649_case_048", "p03649_case_049", "p03649_case_050", "p03649_case_051", "p03649_case_052", "p03649_case_053", "p03649_case_054", "p03649_case_055", "p03649_case_056", "p03649_case_057", "p03649_case_058", "p03649_case_059", "p03649_case_060", "p03649_case_061", "p03649_case_062", "p03649_case_063", "p03649_case_064", "p03649_case_065", "p03649_case_066", "p03649_case_067", "p03649_case_068", "p03649_case_069", "p03649_case_070", "p03649_case_071", "p03649_case_072", "p03649_case_073", "p03649_case_074", "p03649_case_075", "p03649_case_076", "p03649_case_077", "p03649_case_078", "p03649_case_079", "p03649_case_080", "p03649_case_081", "p03649_case_082", "p03649_case_083", "p03649_case_084", "p03649_case_085", "p03649_case_086", "p03649_case_087", "p03649_case_088", "p03649_case_089", "p03649_case_090", "p03649_case_091", "p03649_case_092", "p03649_case_093", "p03649_case_094", "p03649_case_095", "p03649_case_096", "p03649_case_097", "p03649_case_098", "p03649_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\na = list(map(int, input().split()))\nans = 0\nwhile True:\n tmp = 0\n for i in range(n):\n k = -(-(a[i] + 1) // n) - 1\n tmp += k\n a[i] -= k * n\n a[i] -= k\n for i in range(n):\n a[i] += tmp\n if not tmp:\n break\n ans += tmp\nprint(ans)\n", "fast_code_sha256": "2890f8e8770efed4f9c4bcfae3a889c8fe41634ad1976e117b0b362228e642bd", "fast_id": "p03649_2890f8e8770efed4f9c4bcfae3a889c8fe41634ad1976e117b0b362228e642bd", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\na = list(map(int, input().split()))\nans = 0\nwhile True:\n tmp = 0\n for i in range(n):\n k = -(-(a[i] + 1) // n) - 1\n tmp += k\n a[i] -= k * n\n a[i] -= k\n for i in range(n):\n a[i] += tmp\n if not tmp:\n break\n ans += tmp\nprint(ans)\n", "measured_fast_code_sha256": "2890f8e8770efed4f9c4bcfae3a889c8fe41634ad1976e117b0b362228e642bd", "measured_slow_code": "N = int(eval(input()))\nA = list(map(int, input().split()))\nans = 0\nwhile any([a > N - 1 for a in A]):\n for i in range(N):\n if A[i] <= N - 1:\n continue\n d = A[i] - (N - 1)\n k = -(-d // N)\n A[i] -= k * N\n ans += k\n for j in range(N):\n if j == i:\n continue\n A[j] += k\nprint(ans)\n", "measured_slow_code_sha256": "78eea1ba264ee8d5c99555a655c3b4489083c9f42d3f79e95c6fb8bcd0af74fd", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.754647536965571, "pair_id": "python_v2_1264b1bf11cf61072c98973b", "per_case_slow_code_faster_fraction": 0.19, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03649", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03649_2890f8e8770efed4f9c4bcfae3a889c8fe41634ad1976e117b0b362228e642bd.jsonl.gz", "inputs": "reproduction/python/inputs/p03649.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03649_78eea1ba264ee8d5c99555a655c3b4489083c9f42d3f79e95c6fb8bcd0af74fd.jsonl.gz"}, "slow_code": "N = int(eval(input()))\nA = list(map(int, input().split()))\nans = 0\nwhile any([a > N - 1 for a in A]):\n for i in range(N):\n if A[i] <= N - 1:\n continue\n d = A[i] - (N - 1)\n k = -(-d // N)\n A[i] -= k * N\n ans += k\n for j in range(N):\n if j == i:\n continue\n A[j] += k\nprint(ans)\n", "slow_code_sha256": "78eea1ba264ee8d5c99555a655c3b4489083c9f42d3f79e95c6fb8bcd0af74fd", "slow_id": "p03649_78eea1ba264ee8d5c99555a655c3b4489083c9f42d3f79e95c6fb8bcd0af74fd", "speedup": 2.3736151482797436, "stratum": "2-4", "within_pair_jaccard": 0.6206896551724138, "workload": {"case_count": 100, "description": "While the largest array entry is at least N, choose one maximum entry, subtract N from it, and add 1 to every other entry. Count operations until all entries are below N. Initial values are nonnegative. Observed inputs: N=2..50 (median 20); a_i=0..10000000000001000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 903, "median": 147.5, "min": 6}, "input_format": ["N\na_1 ... a_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 51, "median": 21.0, "min": 3}}} -{"case_ids": ["p02555_case_000", "p02555_case_001", "p02555_case_002", "p02555_case_003", "p02555_case_004", "p02555_case_005", "p02555_case_006", "p02555_case_007", "p02555_case_008", "p02555_case_009", "p02555_case_010", "p02555_case_011", "p02555_case_012", "p02555_case_013", "p02555_case_014", "p02555_case_015", "p02555_case_016", "p02555_case_017", "p02555_case_018", "p02555_case_019", "p02555_case_020", "p02555_case_021", "p02555_case_022", "p02555_case_023", "p02555_case_024", "p02555_case_025", "p02555_case_026", "p02555_case_027", "p02555_case_028", "p02555_case_029", "p02555_case_030", "p02555_case_031", "p02555_case_032", "p02555_case_033", "p02555_case_034", "p02555_case_035", "p02555_case_036", "p02555_case_037", "p02555_case_038", "p02555_case_039", "p02555_case_040", "p02555_case_041", "p02555_case_042", "p02555_case_043", "p02555_case_044", "p02555_case_045", "p02555_case_046", "p02555_case_047", "p02555_case_048", "p02555_case_049", "p02555_case_050", "p02555_case_051", "p02555_case_052", "p02555_case_053", "p02555_case_054", "p02555_case_055", "p02555_case_056", "p02555_case_057", "p02555_case_058", "p02555_case_059", "p02555_case_060", "p02555_case_061", "p02555_case_062", "p02555_case_063", "p02555_case_064", "p02555_case_065", "p02555_case_066", "p02555_case_067", "p02555_case_068", "p02555_case_069", "p02555_case_070", "p02555_case_071", "p02555_case_072", "p02555_case_073", "p02555_case_074", "p02555_case_075", "p02555_case_076", "p02555_case_077", "p02555_case_078", "p02555_case_079", "p02555_case_080", "p02555_case_081", "p02555_case_082", "p02555_case_083", "p02555_case_084", "p02555_case_085", "p02555_case_086", "p02555_case_087", "p02555_case_088", "p02555_case_089", "p02555_case_090", "p02555_case_091", "p02555_case_092", "p02555_case_093", "p02555_case_094", "p02555_case_095", "p02555_case_096", "p02555_case_097", "p02555_case_098", "p02555_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "S = int(eval(input()))\nmod = 10**9 + 7\ndp = [0] * (S + 1)\ndp[0] = 1\nfor i in range(3, S + 1):\n dp[i] = (dp[i - 1] + dp[i - 3]) % mod\nprint((dp[S]))\n", "fast_code_sha256": "baf159faff778e1fe2c63e6af2c4a24452368f4ac8371f63a96788ec4561187e", "fast_id": "p02555_baf159faff778e1fe2c63e6af2c4a24452368f4ac8371f63a96788ec4561187e", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "S = int(eval(input()))\nmod = 10**9 + 7\ndp = [0] * (S + 1)\ndp[0] = 1\nfor i in range(3, S + 1):\n dp[i] = (dp[i - 1] + dp[i - 3]) % mod\nprint((dp[S]))\n", "measured_fast_code_sha256": "baf159faff778e1fe2c63e6af2c4a24452368f4ac8371f63a96788ec4561187e", "measured_slow_code": "import numpy as np\n\nMOD = 10**9 + 7\nn = int(eval(input()))\narr = np.zeros((n + 1, n + 1), dtype=int)\nfor i in np.arange(3, n + 1):\n arr[0, i] = 1\nfor i in np.arange(1, n + 1):\n sum_ = 0\n for j in np.arange(3 * i, n + 1):\n sum_ += arr[i - 1, j]\n sum_ %= MOD\n if j + 3 >= n + 1:\n break\n arr[i, j + 3] = sum_\nans = 0\nfor i in range(n + 1):\n ans += arr[i, n]\n ans %= MOD\nprint(ans)\n", "measured_slow_code_sha256": "c3b18fd66a969908811fb5a7fad4e7d129453840b432daefe2b3186926221742", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1203.45999853918, "pair_id": "python_v2_2969bdff5c21cae9d624b8b1", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02555", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02555_baf159faff778e1fe2c63e6af2c4a24452368f4ac8371f63a96788ec4561187e.jsonl.gz", "inputs": "reproduction/python/inputs/p02555.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02555_c3b18fd66a969908811fb5a7fad4e7d129453840b432daefe2b3186926221742.jsonl.gz"}, "slow_code": "import numpy as np\n\nMOD = 10**9 + 7\nn = int(eval(input()))\narr = np.zeros((n + 1, n + 1), dtype=int)\nfor i in np.arange(3, n + 1):\n arr[0, i] = 1\nfor i in np.arange(1, n + 1):\n sum_ = 0\n for j in np.arange(3 * i, n + 1):\n sum_ += arr[i - 1, j]\n sum_ %= MOD\n if j + 3 >= n + 1:\n break\n arr[i, j + 3] = sum_\nans = 0\nfor i in range(n + 1):\n ans += arr[i, n]\n ans %= MOD\nprint(ans)\n", "slow_code_sha256": "c3b18fd66a969908811fb5a7fad4e7d129453840b432daefe2b3186926221742", "slow_id": "p02555_c3b18fd66a969908811fb5a7fad4e7d129453840b432daefe2b3186926221742", "speedup": 1173.4993656284082, "stratum": "8+", "within_pair_jaccard": 0.4375, "workload": {"case_count": 100, "description": "Count ordered integer sequences whose entries are at least 3 and sum to S, modulo 1000000007. Observed inputs: S=1..2000 (median 1094).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 5, "median": 5.0, "min": 2}, "input_format": ["S"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p02990_case_000", "p02990_case_001", "p02990_case_002", "p02990_case_003", "p02990_case_004", "p02990_case_005", "p02990_case_006", "p02990_case_007", "p02990_case_008", "p02990_case_009", "p02990_case_010", "p02990_case_011", "p02990_case_012", "p02990_case_013", "p02990_case_014", "p02990_case_015", "p02990_case_016", "p02990_case_017", "p02990_case_018", "p02990_case_019", "p02990_case_020", "p02990_case_021", "p02990_case_022", "p02990_case_023", "p02990_case_024", "p02990_case_025", "p02990_case_026", "p02990_case_027", "p02990_case_028", "p02990_case_029", "p02990_case_030", "p02990_case_031", "p02990_case_032", "p02990_case_033", "p02990_case_034", "p02990_case_035", "p02990_case_036", "p02990_case_037", "p02990_case_038", "p02990_case_039", "p02990_case_040", "p02990_case_041", "p02990_case_042", "p02990_case_043", "p02990_case_044", "p02990_case_045", "p02990_case_046", "p02990_case_047", "p02990_case_048", "p02990_case_049", "p02990_case_050", "p02990_case_051", "p02990_case_052", "p02990_case_053", "p02990_case_054", "p02990_case_055", "p02990_case_056", "p02990_case_057", "p02990_case_058", "p02990_case_059", "p02990_case_060", "p02990_case_061", "p02990_case_062", "p02990_case_063", "p02990_case_064", "p02990_case_065", "p02990_case_066", "p02990_case_067", "p02990_case_068", "p02990_case_069", "p02990_case_070", "p02990_case_071", "p02990_case_072", "p02990_case_073", "p02990_case_074", "p02990_case_075", "p02990_case_076", "p02990_case_077", "p02990_case_078", "p02990_case_079", "p02990_case_080", "p02990_case_081", "p02990_case_082", "p02990_case_083", "p02990_case_084", "p02990_case_085", "p02990_case_086", "p02990_case_087", "p02990_case_088", "p02990_case_089", "p02990_case_090", "p02990_case_091", "p02990_case_092", "p02990_case_093", "p02990_case_094", "p02990_case_095", "p02990_case_096", "p02990_case_097", "p02990_case_098", "p02990_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n, k = list(map(int, input().split()))\nm = 10**9 + 7\nb = 1\nr = n - k + 1\nprint((b * r % m))\nfor i in range(2, k + 1):\n b *= k - i + 1\n b //= i - 1\n r *= n - k - i + 2\n r //= i\n print((b * r % m))\n", "fast_code_sha256": "4707c919ec02af3dbc389bd90c0f4823687b18f28fa6bd8e7a1af1a5cf54468b", "fast_id": "p02990_4707c919ec02af3dbc389bd90c0f4823687b18f28fa6bd8e7a1af1a5cf54468b", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n, k = list(map(int, input().split()))\nm = 10**9 + 7\nb = 1\nr = n - k + 1\nprint((b * r % m))\nfor i in range(2, k + 1):\n b *= k - i + 1\n b //= i - 1\n r *= n - k - i + 2\n r //= i\n print((b * r % m))\n", "measured_fast_code_sha256": "4707c919ec02af3dbc389bd90c0f4823687b18f28fa6bd8e7a1af1a5cf54468b", "measured_slow_code": "N_MAX = 10**6\nMOD = 10**9 + 7\nfac, finv, inv = [0] * N_MAX, [0] * N_MAX, [0] * N_MAX\n\n\ndef com_init():\n fac[0], fac[1] = 1, 1\n finv[0], finv[1] = 1, 1\n inv[1] = 1\n for i in range(2, N_MAX):\n fac[i] = fac[i - 1] * i % MOD\n inv[i] = MOD - inv[MOD % i] * (MOD // i) % MOD\n finv[i] = finv[i - 1] * inv[i] % MOD\n\n\ndef com(n, k):\n if n < k:\n return 0\n if n < 0 or k < 0:\n return 0\n return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD\n\n\nn, k = list(map(int, input().split()))\nr = n - k\ncom_init()\nfor i in range(1, k + 1):\n ans = 0\n bi = com(k + i - 1 - i, i - 1)\n if i == 1:\n if r == 0:\n ri_m1 = 1\n else:\n ri_m1 = 0\n else:\n ri_m1 = com(r + i - 2 - (i - 1), i - 2)\n ri = com(r + i - 1 - i, i - 1) if r >= i else 0\n ri_p1 = com(r + i - (i + 1), i) if r >= i + 1 else 0\n ans += bi * ri_m1\n ans += bi * ri * 2\n ans += bi * ri_p1\n ans %= MOD\n print(ans)\n", "measured_slow_code_sha256": "7a2b64f231360106a08f636ee2208fefd03a0a70e2030ab961e1b329fc022332", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 772.6002458778041, "pair_id": "python_v2_050f2cec2405b52a56ef5a58", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02990", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02990_4707c919ec02af3dbc389bd90c0f4823687b18f28fa6bd8e7a1af1a5cf54468b.jsonl.gz", "inputs": "reproduction/python/inputs/p02990.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02990_7a2b64f231360106a08f636ee2208fefd03a0a70e2030ab961e1b329fc022332.jsonl.gz"}, "slow_code": "N_MAX = 10**6\nMOD = 10**9 + 7\nfac, finv, inv = [0] * N_MAX, [0] * N_MAX, [0] * N_MAX\n\n\ndef com_init():\n fac[0], fac[1] = 1, 1\n finv[0], finv[1] = 1, 1\n inv[1] = 1\n for i in range(2, N_MAX):\n fac[i] = fac[i - 1] * i % MOD\n inv[i] = MOD - inv[MOD % i] * (MOD // i) % MOD\n finv[i] = finv[i - 1] * inv[i] % MOD\n\n\ndef com(n, k):\n if n < k:\n return 0\n if n < 0 or k < 0:\n return 0\n return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD\n\n\nn, k = list(map(int, input().split()))\nr = n - k\ncom_init()\nfor i in range(1, k + 1):\n ans = 0\n bi = com(k + i - 1 - i, i - 1)\n if i == 1:\n if r == 0:\n ri_m1 = 1\n else:\n ri_m1 = 0\n else:\n ri_m1 = com(r + i - 2 - (i - 1), i - 2)\n ri = com(r + i - 1 - i, i - 1) if r >= i else 0\n ri_p1 = com(r + i - (i + 1), i) if r >= i + 1 else 0\n ans += bi * ri_m1\n ans += bi * ri * 2\n ans += bi * ri_p1\n ans %= MOD\n print(ans)\n", "slow_code_sha256": "7a2b64f231360106a08f636ee2208fefd03a0a70e2030ab961e1b329fc022332", "slow_id": "p02990_7a2b64f231360106a08f636ee2208fefd03a0a70e2030ab961e1b329fc022332", "speedup": 1058.0881722765237, "stratum": "8+", "within_pair_jaccard": 0.46153846153846156, "workload": {"case_count": 100, "description": "Arrange K identical blue and N-K identical red balls in a row. For each i=1..K, count arrangements requiring exactly i moves to collect the blue balls, where a move collects any consecutive blue block. Output counts modulo 1000000007. Observed inputs: N=1..2000 (median 1234); K=1..2000 (median 807.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 10, "median": 9.0, "min": 4}, "input_format": ["N K"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p00008_case_000", "p00008_case_001", "p00008_case_002", "p00008_case_003", "p00008_case_004", "p00008_case_005", "p00008_case_006", "p00008_case_007", "p00008_case_008", "p00008_case_009", "p00008_case_010", "p00008_case_011", "p00008_case_012", "p00008_case_013", "p00008_case_014", "p00008_case_015", "p00008_case_016", "p00008_case_017", "p00008_case_018", "p00008_case_019", "p00008_case_020", "p00008_case_021", "p00008_case_022", "p00008_case_023", "p00008_case_024", "p00008_case_025", "p00008_case_026", "p00008_case_027", "p00008_case_028", "p00008_case_029", "p00008_case_030", "p00008_case_031", "p00008_case_032", "p00008_case_033", "p00008_case_034", "p00008_case_035", "p00008_case_036", "p00008_case_037", "p00008_case_038", "p00008_case_039", "p00008_case_040", "p00008_case_041", "p00008_case_042", "p00008_case_043", "p00008_case_044", "p00008_case_045", "p00008_case_046", "p00008_case_047", "p00008_case_048", "p00008_case_049", "p00008_case_050", "p00008_case_051", "p00008_case_052", "p00008_case_053", "p00008_case_054", "p00008_case_055", "p00008_case_056", "p00008_case_057", "p00008_case_058", "p00008_case_059", "p00008_case_060", "p00008_case_061", "p00008_case_062", "p00008_case_063", "p00008_case_064", "p00008_case_065", "p00008_case_066", "p00008_case_067", "p00008_case_068", "p00008_case_069", "p00008_case_070", "p00008_case_071", "p00008_case_072", "p00008_case_073", "p00008_case_074", "p00008_case_075", "p00008_case_076", "p00008_case_077", "p00008_case_078", "p00008_case_079", "p00008_case_080", "p00008_case_081", "p00008_case_082", "p00008_case_083", "p00008_case_084", "p00008_case_085", "p00008_case_086", "p00008_case_087", "p00008_case_088", "p00008_case_089", "p00008_case_090", "p00008_case_091", "p00008_case_092", "p00008_case_093", "p00008_case_094", "p00008_case_095", "p00008_case_096", "p00008_case_097", "p00008_case_098", "p00008_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\nimport math\n\n\ndef nCr(n, k):\n if 0 <= k <= n:\n nk, kk = 1, 1\n for t in range(1, min(k, n - k) + 1):\n nk = nk * n\n kk = kk * t\n n -= 1\n return nk // kk\n else:\n return 0\n\n\np = [0] * 51\nv = 0\nfor i in range(19):\n t = nCr(i + 3, i)\n v = v + 4 * nCr(i - 8, i - 10)\n p[i] = t - v\n p[36 - i] = p[i]\nfor i in sys.stdin:\n print((p[int(i)]))\n", "fast_code_sha256": "44be25f53df0ca596505e4d9b67f2cfd23a3c35d2b23c46b5226914d16aa5a4d", "fast_id": "p00008_44be25f53df0ca596505e4d9b67f2cfd23a3c35d2b23c46b5226914d16aa5a4d", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\nimport math\n\n\ndef nCr(n, k):\n if 0 <= k <= n:\n nk, kk = 1, 1\n for t in range(1, min(k, n - k) + 1):\n nk = nk * n\n kk = kk * t\n n -= 1\n return nk // kk\n else:\n return 0\n\n\np = [0] * 51\nv = 0\nfor i in range(19):\n t = nCr(i + 3, i)\n v = v + 4 * nCr(i - 8, i - 10)\n p[i] = t - v\n p[36 - i] = p[i]\nfor i in sys.stdin:\n print((p[int(i)]))\n", "measured_fast_code_sha256": "44be25f53df0ca596505e4d9b67f2cfd23a3c35d2b23c46b5226914d16aa5a4d", "measured_slow_code": "import sys, itertools\n\nfor n in map(int, sys.stdin):\n x = 0\n for num in itertools.product(\"0123456789\", repeat=4):\n eq = \"{}+{}+{}+{}\".format(*(num))\n if eval(eq) == n:\n x += 1\n print(x)\n", "measured_slow_code_sha256": "f78324b8c1f2014a7fb42b155a7df64e78b2806e6504b01d6dd4fa1d3a1e1f70", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3888.169964290516, "pair_id": "python_v2_a724dfd469c3e79672dd11a8", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p00008", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p00008_44be25f53df0ca596505e4d9b67f2cfd23a3c35d2b23c46b5226914d16aa5a4d.jsonl.gz", "inputs": "reproduction/python/inputs/p00008.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p00008_f78324b8c1f2014a7fb42b155a7df64e78b2806e6504b01d6dd4fa1d3a1e1f70.jsonl.gz"}, "slow_code": "import sys, itertools\n\nfor n in map(int, sys.stdin):\n x = 0\n for num in itertools.product(\"0123456789\", repeat=4):\n eq = \"{}+{}+{}+{}\".format(*(num))\n if eval(eq) == n:\n x += 1\n print(x)\n", "slow_code_sha256": "f78324b8c1f2014a7fb42b155a7df64e78b2806e6504b01d6dd4fa1d3a1e1f70", "slow_id": "p00008_f78324b8c1f2014a7fb42b155a7df64e78b2806e6504b01d6dd4fa1d3a1e1f70", "speedup": 3112.918996021851, "stratum": "8+", "within_pair_jaccard": 0.2857142857142857, "workload": {"case_count": 100, "description": "For each target n, count ordered quadruples of decimal digits a,b,c,d in 0..9 whose sum is n. Targets are given one per line until end of input. Observed inputs: datasets=1..50 (median 10); n=1..50.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 150, "median": 26.5, "min": 2}, "input_format": ["n_1\n...\nn_D (until EOF)"], "input_format_status": "source_input_section", "input_lines": {"max": 50, "median": 10.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 50, "median": 10.0, "min": 1}}} -{"case_ids": ["p02948_case_000", "p02948_case_001", "p02948_case_002", "p02948_case_003", "p02948_case_004", "p02948_case_005", "p02948_case_006", "p02948_case_007", "p02948_case_008", "p02948_case_009", "p02948_case_010", "p02948_case_011", "p02948_case_012", "p02948_case_013", "p02948_case_014", "p02948_case_015", "p02948_case_016", "p02948_case_017", "p02948_case_018", "p02948_case_019", "p02948_case_020", "p02948_case_021", "p02948_case_022", "p02948_case_023", "p02948_case_024", "p02948_case_025", "p02948_case_026", "p02948_case_027", "p02948_case_028", "p02948_case_029", "p02948_case_030", "p02948_case_031", "p02948_case_032", "p02948_case_033", "p02948_case_034", "p02948_case_035", "p02948_case_036", "p02948_case_037", "p02948_case_038", "p02948_case_039", "p02948_case_040", "p02948_case_041", "p02948_case_042", "p02948_case_043", "p02948_case_044", "p02948_case_045", "p02948_case_046", "p02948_case_047", "p02948_case_048", "p02948_case_049", "p02948_case_050", "p02948_case_051", "p02948_case_052", "p02948_case_053", "p02948_case_054", "p02948_case_055", "p02948_case_056", "p02948_case_057", "p02948_case_058", "p02948_case_059", "p02948_case_060", "p02948_case_061", "p02948_case_062", "p02948_case_063", "p02948_case_064", "p02948_case_065", "p02948_case_066", "p02948_case_067", "p02948_case_068", "p02948_case_069", "p02948_case_070", "p02948_case_071", "p02948_case_072", "p02948_case_073", "p02948_case_074", "p02948_case_075", "p02948_case_076", "p02948_case_077", "p02948_case_078", "p02948_case_079", "p02948_case_080", "p02948_case_081", "p02948_case_082", "p02948_case_083", "p02948_case_084", "p02948_case_085", "p02948_case_086", "p02948_case_087", "p02948_case_088", "p02948_case_089", "p02948_case_090", "p02948_case_091", "p02948_case_092", "p02948_case_093", "p02948_case_094", "p02948_case_095", "p02948_case_096", "p02948_case_097", "p02948_case_098", "p02948_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from heapq import *\n\nN, M, *t = list(map(int, open(0).read().split()))\nv = [[] for _ in \"_\" * M]\nz = i = 0\nfor _ in \"_\" * N:\n M < t[i] or v[t[i] - 1].append(t[i + 1])\n i += 2\nq = []\nfor i in v:\n for j in i:\n heappush(q, -j)\n z -= len(q) and heappop(q)\nprint(z)\n", "fast_code_sha256": "78195a2740d448817b390133128ddb97072787be3c728274df837dfcfab111dc", "fast_id": "p02948_78195a2740d448817b390133128ddb97072787be3c728274df837dfcfab111dc", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from heapq import *\n\nN, M, *t = list(map(int, open(0).read().split()))\nv = [[] for _ in \"_\" * M]\nz = i = 0\nfor _ in \"_\" * N:\n M < t[i] or v[t[i] - 1].append(t[i + 1])\n i += 2\nq = []\nfor i in v:\n for j in i:\n heappush(q, -j)\n z -= len(q) and heappop(q)\nprint(z)\n", "measured_fast_code_sha256": "78195a2740d448817b390133128ddb97072787be3c728274df837dfcfab111dc", "measured_slow_code": "from heapq import *\n\n(n, m), *t = [list(map(int, s.split())) for s in open(0)]\nq = [0] * 7**6\nv = [[] for _ in q]\nz = 0\nfor a, b in t:\n v[a - 1] += [b]\nfor i in v[:m]:\n for j in i:\n heappush(q, -j)\n z -= heappop(q)\nprint(z)\n", "measured_slow_code_sha256": "fe7802b8128b6ff2f5d5f284b0cd0e9663cbc9b92a6886cda80720b8fe77987a", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.4812894013426707, "pair_id": "python_v2_cf74abb957ce0971dd51218a", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02948", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02948_78195a2740d448817b390133128ddb97072787be3c728274df837dfcfab111dc.jsonl.gz", "inputs": "reproduction/python/inputs/p02948.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02948_fe7802b8128b6ff2f5d5f284b0cd0e9663cbc9b92a6886cda80720b8fe77987a.jsonl.gz"}, "slow_code": "from heapq import *\n\n(n, m), *t = [list(map(int, s.split())) for s in open(0)]\nq = [0] * 7**6\nv = [[] for _ in q]\nz = 0\nfor a, b in t:\n v[a - 1] += [b]\nfor i in v[:m]:\n for j in i:\n heappush(q, -j)\n z -= heappop(q)\nprint(z)\n", "slow_code_sha256": "fe7802b8128b6ff2f5d5f284b0cd0e9663cbc9b92a6886cda80720b8fe77987a", "slow_id": "p02948_fe7802b8128b6ff2f5d5f284b0cd0e9663cbc9b92a6886cda80720b8fe77987a", "speedup": 2.187102830113487, "stratum": "2-4", "within_pair_jaccard": 0.5945945945945946, "workload": {"case_count": 100, "description": "Each of N one-off jobs can be done in one day, paying B_i after A_i days. At most one job is done daily, starting today. Maximize rewards received no later than M days from today; jobs cannot be repeated. Observed inputs: N=1..100000 (median 100000); M=1..100000 (median 100000); A_i=1..100000; B_i=1..10000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1300014, "median": 1077655.5, "min": 14}, "input_format": ["N M\nA_1 B_1\n...\nA_N B_N"], "input_format_status": "source_input_section", "input_lines": {"max": 100001, "median": 100001.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200002, "median": 200002.0, "min": 4}}} -{"case_ids": ["p03806_case_000", "p03806_case_001", "p03806_case_002", "p03806_case_003", "p03806_case_004", "p03806_case_005", "p03806_case_006", "p03806_case_007", "p03806_case_008", "p03806_case_009", "p03806_case_010", "p03806_case_011", "p03806_case_012", "p03806_case_013", "p03806_case_014", "p03806_case_015", "p03806_case_016", "p03806_case_017", "p03806_case_018", "p03806_case_019", "p03806_case_020", "p03806_case_021", "p03806_case_022", "p03806_case_023", "p03806_case_024", "p03806_case_025", "p03806_case_026", "p03806_case_027", "p03806_case_028", "p03806_case_029", "p03806_case_030", "p03806_case_031", "p03806_case_032", "p03806_case_033", "p03806_case_034", "p03806_case_035", "p03806_case_036", "p03806_case_037", "p03806_case_038", "p03806_case_039", "p03806_case_040", "p03806_case_041", "p03806_case_042", "p03806_case_043", "p03806_case_044", "p03806_case_045", "p03806_case_046", "p03806_case_047", "p03806_case_048", "p03806_case_049", "p03806_case_050", "p03806_case_051", "p03806_case_052", "p03806_case_053", "p03806_case_054", "p03806_case_055", "p03806_case_056", "p03806_case_057", "p03806_case_058", "p03806_case_059", "p03806_case_060", "p03806_case_061", "p03806_case_062", "p03806_case_063", "p03806_case_064", "p03806_case_065", "p03806_case_066", "p03806_case_067", "p03806_case_068", "p03806_case_069", "p03806_case_070", "p03806_case_071", "p03806_case_072", "p03806_case_073", "p03806_case_074", "p03806_case_075", "p03806_case_076", "p03806_case_077", "p03806_case_078", "p03806_case_079", "p03806_case_080", "p03806_case_081", "p03806_case_082", "p03806_case_083", "p03806_case_084", "p03806_case_085", "p03806_case_086", "p03806_case_087", "p03806_case_088", "p03806_case_089", "p03806_case_090", "p03806_case_091", "p03806_case_092", "p03806_case_093", "p03806_case_094", "p03806_case_095", "p03806_case_096", "p03806_case_097", "p03806_case_098", "p03806_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from itertools import permutations\nimport sys\n\nsys.setrecursionlimit(10**6)\nfrom bisect import *\nfrom collections import *\nfrom heapq import *\n\n\ndef II():\n return int(sys.stdin.readline())\n\n\ndef MI():\n return map(int, sys.stdin.readline().split())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\ndef SI():\n return sys.stdin.readline()[:-1]\n\n\ndef LLI(rows_number):\n return [LI() for _ in range(rows_number)]\n\n\nint1 = lambda x: int(x) - 1\n\n\ndef MI1():\n return map(int1, sys.stdin.readline().split())\n\n\ndef LI1():\n return list(map(int1, sys.stdin.readline().split()))\n\n\np2D = lambda x: print(*x, sep=\"\\n\")\ndij = [(1, 0), (0, 1), (-1, 0), (0, -1)]\n\n\ndef main():\n inf = 10**9\n n, ma, mb = MI()\n vv = []\n cc = []\n for _ in range(n):\n a, b, c = MI()\n vv.append(a * mb - b * ma)\n cc.append(c)\n dp = [[inf] * 8005 for _ in range(n + 1)]\n for i in range(n):\n v, c = vv[i], cc[i]\n dp[i + 1][4000 + v] = min(dp[i + 1][4000 + v], c)\n for j in range(8005):\n pre = dp[i][j]\n if pre == inf:\n continue\n dp[i + 1][j] = min(dp[i + 1][j], pre)\n dp[i + 1][j + v] = min(dp[i + 1][j + v], pre + c)\n ans = dp[-1][4000]\n if ans == inf:\n print(-1)\n else:\n print(ans)\n\n\nmain()\n", "fast_code_sha256": "d811f7d92be0aae9622f751e76c6d3dcfc4ba7e99019edb2e8b89b9883ead31c", "fast_id": "p03806_d811f7d92be0aae9622f751e76c6d3dcfc4ba7e99019edb2e8b89b9883ead31c", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from itertools import permutations\nimport sys\n\nsys.setrecursionlimit(10**6)\nfrom bisect import *\nfrom collections import *\nfrom heapq import *\n\n\ndef II():\n return int(sys.stdin.readline())\n\n\ndef MI():\n return map(int, sys.stdin.readline().split())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\ndef SI():\n return sys.stdin.readline()[:-1]\n\n\ndef LLI(rows_number):\n return [LI() for _ in range(rows_number)]\n\n\nint1 = lambda x: int(x) - 1\n\n\ndef MI1():\n return map(int1, sys.stdin.readline().split())\n\n\ndef LI1():\n return list(map(int1, sys.stdin.readline().split()))\n\n\np2D = lambda x: print(*x, sep=\"\\n\")\ndij = [(1, 0), (0, 1), (-1, 0), (0, -1)]\n\n\ndef main():\n inf = 10**9\n n, ma, mb = MI()\n vv = []\n cc = []\n for _ in range(n):\n a, b, c = MI()\n vv.append(a * mb - b * ma)\n cc.append(c)\n dp = [[inf] * 8005 for _ in range(n + 1)]\n for i in range(n):\n v, c = vv[i], cc[i]\n dp[i + 1][4000 + v] = min(dp[i + 1][4000 + v], c)\n for j in range(8005):\n pre = dp[i][j]\n if pre == inf:\n continue\n dp[i + 1][j] = min(dp[i + 1][j], pre)\n dp[i + 1][j + v] = min(dp[i + 1][j + v], pre + c)\n ans = dp[-1][4000]\n if ans == inf:\n print(-1)\n else:\n print(ans)\n\n\nmain()\n", "measured_fast_code_sha256": "d811f7d92be0aae9622f751e76c6d3dcfc4ba7e99019edb2e8b89b9883ead31c", "measured_slow_code": "N, Ma, Mb = list(map(int, input().split()))\n# 入力値の受け取り方を変える\narr = [list(map(int, input().split())) for _ in range(N)]\n# a = [0] * N\n# b = [0] * N\n# c = [0] * N\n# for i in range(N):\n# a[i], b[i], c[i] = map(int, input().split())\n# TLEになってしまうためinfを5000とかで設定する\nINF = 5000\n# さらに計算量を落とすため10 * N + 1などを定数で設定する → 関係なかったため戻す\n# 最小値を求める問題なのでinfで初期化\n# dp[i][sun_a][sum_b]で考えていく\ndp = [\n [[INF for _ in range(10 * N + 1)] for _ in range(10 * N + 1)] for _ in range(N + 1)\n]\n# 初期選択状態を0とする\ndp[0][0][0] = 0\nfor i in range(N):\n a, b, c = arr[i]\n for j in range(10 * N + 1):\n for k in range(10 * N + 1):\n if dp[i][j][k] == INF:\n continue\n # 選ばなかった場合\n dp[i + 1][j][k] = min(dp[i + 1][j][k], dp[i][j][k])\n # 選んだ場合\n dp[i + 1][j + a][k + b] = min(dp[i + 1][j + a][k + b], dp[i][j][k] + c)\nans = INF\n# 0スタートは何を選んでいない状態となり最小値が0になってしまうため1から開始する\n# TLEになったため変更\n# for i in range(1,10 * N + 1):\n# for j in range(1,10 * N + 1):\n# if i * Mb != j * Ma:\n# continue\n# ans = min(ans, dp[N][i][j])\n#\nfor i in range(1, 10 * N + 1):\n if i * Ma > 10 * N or i * Mb > 10 * N:\n break\n ans = min(ans, dp[N][i * Ma][i * Mb])\nif ans == INF:\n print((-1))\nelse:\n print(ans)\n", "measured_slow_code_sha256": "300ea98018e92ef9ea1c6599df2d30cb81530179c8dac2696b84d606c80a4bab", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 10.020457777494514, "pair_id": "python_v2_71ba5fbab28ff3bc8e9a4186", "per_case_slow_code_faster_fraction": 0.26, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03806", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03806_d811f7d92be0aae9622f751e76c6d3dcfc4ba7e99019edb2e8b89b9883ead31c.jsonl.gz", "inputs": "reproduction/python/inputs/p03806.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03806_300ea98018e92ef9ea1c6599df2d30cb81530179c8dac2696b84d606c80a4bab.jsonl.gz"}, "slow_code": "N, Ma, Mb = list(map(int, input().split()))\n\narr = [list(map(int, input().split())) for _ in range(N)]\n\n\nINF = 5000\n\n\ndp = [\n [[INF for _ in range(10 * N + 1)] for _ in range(10 * N + 1)] for _ in range(N + 1)\n]\n\ndp[0][0][0] = 0\nfor i in range(N):\n a, b, c = arr[i]\n for j in range(10 * N + 1):\n for k in range(10 * N + 1):\n if dp[i][j][k] == INF:\n continue\n\n dp[i + 1][j][k] = min(dp[i + 1][j][k], dp[i][j][k])\n\n dp[i + 1][j + a][k + b] = min(dp[i + 1][j + a][k + b], dp[i][j][k] + c)\nans = INF\n\n\nfor i in range(1, 10 * N + 1):\n if i * Ma > 10 * N or i * Mb > 10 * N:\n break\n ans = min(ans, dp[N][i * Ma][i * Mb])\nif ans == INF:\n print((-1))\nelse:\n print(ans)\n", "slow_code_sha256": "95e4906e454bb163e1b4231db07053c6afbce8b5256db968433c63cccddfc002", "slow_id": "p03806_300ea98018e92ef9ea1c6599df2d30cb81530179c8dac2696b84d606c80a4bab", "speedup": 5.591896911837697, "stratum": "4-8", "within_pair_jaccard": 0.3108108108108108, "workload": {"case_count": 100, "description": "Choose a nonempty subset of N packages to obtain substances A and B in ratio M_a:M_b at minimum total cost. Package i supplies amounts a_i and b_i at cost c_i. Observed inputs: N=1..40 (median 20); M_a=1..10; M_b=1..10; a_i=1..10; b_i=1..10; c_i=1..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 298, "median": 150.0, "min": 13}, "input_format": ["N M_a M_b\na_1 b_1 c_1\n...\na_N b_N c_N"], "input_format_status": "source_input_section", "input_lines": {"max": 41, "median": 21.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 123, "median": 63.0, "min": 6}}} -{"case_ids": ["p02732_case_000", "p02732_case_001", "p02732_case_002", "p02732_case_003", "p02732_case_004", "p02732_case_005", "p02732_case_006", "p02732_case_007", "p02732_case_008", "p02732_case_009", "p02732_case_010", "p02732_case_011", "p02732_case_012", "p02732_case_013", "p02732_case_014", "p02732_case_015", "p02732_case_016", "p02732_case_017", "p02732_case_018", "p02732_case_019", "p02732_case_020", "p02732_case_021", "p02732_case_022", "p02732_case_023", "p02732_case_024", "p02732_case_025", "p02732_case_026", "p02732_case_027", "p02732_case_028", "p02732_case_029", "p02732_case_030", "p02732_case_031", "p02732_case_032", "p02732_case_033", "p02732_case_034", "p02732_case_035", "p02732_case_036", "p02732_case_037", "p02732_case_038", "p02732_case_039", "p02732_case_040", "p02732_case_041", "p02732_case_042", "p02732_case_043", "p02732_case_044", "p02732_case_045", "p02732_case_046", "p02732_case_047", "p02732_case_048", "p02732_case_049", "p02732_case_050", "p02732_case_051", "p02732_case_052", "p02732_case_053", "p02732_case_054", "p02732_case_055", "p02732_case_056", "p02732_case_057", "p02732_case_058", "p02732_case_059", "p02732_case_060", "p02732_case_061", "p02732_case_062", "p02732_case_063", "p02732_case_064", "p02732_case_065", "p02732_case_066", "p02732_case_067", "p02732_case_068", "p02732_case_069", "p02732_case_070", "p02732_case_071", "p02732_case_072", "p02732_case_073", "p02732_case_074", "p02732_case_075", "p02732_case_076", "p02732_case_077", "p02732_case_078", "p02732_case_079", "p02732_case_080", "p02732_case_081", "p02732_case_082", "p02732_case_083", "p02732_case_084", "p02732_case_085", "p02732_case_086", "p02732_case_087", "p02732_case_088", "p02732_case_089", "p02732_case_090", "p02732_case_091", "p02732_case_092", "p02732_case_093", "p02732_case_094", "p02732_case_095", "p02732_case_096", "p02732_case_097", "p02732_case_098", "p02732_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from collections import Counter\n\nn = int(eval(input()))\nA = list(map(int, input().split()))\n\nFreq = Counter(A)\n\nans_max = 0\nfor kv in list(Freq.items()):\n ans_max += kv[1] * (kv[1] - 1) // 2\nfor a in A:\n\n if Freq.get(a) == 1:\n print(ans_max)\n continue\n\n x = Freq.get(a)\n diff = (x * (x - 1) // 2) - ((x - 1) * (x - 2) // 2)\n\n ans = ans_max - diff\n print(ans)\n", "fast_code_sha256": "26734030bcda400044c5bc316b9e9cf9ea4fd118cda90874dbbc196f92e4bc76", "fast_id": "p02732_c12bafaac4a619c4303dc3ae6c0f6b42d9fa951098e8a97794aeba3f3ef79885", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from collections import Counter\n\nn = int(eval(input()))\nA = list(map(int, input().split()))\n# 書かれた番号の頻度\nFreq = Counter(A)\n# 答えの最大値\nans_max = 0\nfor kv in list(Freq.items()):\n ans_max += kv[1] * (kv[1] - 1) // 2\nfor a in A:\n # 1個しか存在しない番号は、取り除いても答えに影響しない\n if Freq.get(a) == 1:\n print(ans_max)\n continue\n # x個の場合と、x-1個の場合と、の差分\n x = Freq.get(a)\n diff = (x * (x - 1) // 2) - ((x - 1) * (x - 2) // 2)\n # そのぶんだけ、答えの最大値から減らす\n ans = ans_max - diff\n print(ans)\n", "measured_fast_code_sha256": "c12bafaac4a619c4303dc3ae6c0f6b42d9fa951098e8a97794aeba3f3ef79885", "measured_slow_code": "from functools import reduce\n\n\ndef d_banned_k():\n from collections import Counter\n from functools import reduce\n\n N = int(eval(input()))\n A = [int(i) for i in input().split()]\n\n def comb(n, r):\n numerator = reduce(lambda x, y: x * y, list(range(n, n - r, -1)))\n denominator = reduce(lambda x, y: x * y, list(range(1, r + 1)))\n return numerator // denominator\n\n count = Counter(A)\n total = sum(comb(c, 2) for c in list(count.values()))\n ans = []\n for a in A:\n v = count[a]\n ans.append(total - comb(v, 2) + comb(v - 1, 2))\n return \" \".join(map(str, ans))\n\n\nprint((d_banned_k()))\n", "measured_slow_code_sha256": "715c50a0bd5503a1c5a8f5900a3590d1b55c78b7a98e77c948ef59c2a023b3ea", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.6862714005658734, "pair_id": "python_v2_53e4ed111db19220c8563c3a", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02732", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02732_c12bafaac4a619c4303dc3ae6c0f6b42d9fa951098e8a97794aeba3f3ef79885.jsonl.gz", "inputs": "reproduction/python/inputs/p02732.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02732_715c50a0bd5503a1c5a8f5900a3590d1b55c78b7a98e77c948ef59c2a023b3ea.jsonl.gz"}, "slow_code": "from functools import reduce\n\n\ndef d_banned_k():\n from collections import Counter\n from functools import reduce\n\n N = int(eval(input()))\n A = [int(i) for i in input().split()]\n\n def comb(n, r):\n numerator = reduce(lambda x, y: x * y, list(range(n, n - r, -1)))\n denominator = reduce(lambda x, y: x * y, list(range(1, r + 1)))\n return numerator // denominator\n\n count = Counter(A)\n total = sum(comb(c, 2) for c in list(count.values()))\n ans = []\n for a in A:\n v = count[a]\n ans.append(total - comb(v, 2) + comb(v - 1, 2))\n return \" \".join(map(str, ans))\n\n\nprint((d_banned_k()))\n", "slow_code_sha256": "715c50a0bd5503a1c5a8f5900a3590d1b55c78b7a98e77c948ef59c2a023b3ea", "slow_id": "p02732_715c50a0bd5503a1c5a8f5900a3590d1b55c78b7a98e77c948ef59c2a023b3ea", "speedup": 2.567933865891802, "stratum": "2-4", "within_pair_jaccard": 0.36538461538461536, "workload": {"case_count": 100, "description": "For each position k in an N-ball sequence, exclude only that ball and count unordered pairs of distinct remaining balls carrying equal integer values A_i. Observed inputs: N=3..200000 (median 550); A_i=1..200000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1400007, "median": 1155.0, "min": 8}, "input_format": ["N\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200001, "median": 551.0, "min": 4}}} -{"case_ids": ["p02630_case_000", "p02630_case_001", "p02630_case_002", "p02630_case_003", "p02630_case_004", "p02630_case_005", "p02630_case_006", "p02630_case_007", "p02630_case_008", "p02630_case_009", "p02630_case_010", "p02630_case_011", "p02630_case_012", "p02630_case_013", "p02630_case_014", "p02630_case_015", "p02630_case_016", "p02630_case_017", "p02630_case_018", "p02630_case_019", "p02630_case_020", "p02630_case_021", "p02630_case_022", "p02630_case_023", "p02630_case_024", "p02630_case_025", "p02630_case_026", "p02630_case_027", "p02630_case_028", "p02630_case_029", "p02630_case_030", "p02630_case_031", "p02630_case_032", "p02630_case_033", "p02630_case_034", "p02630_case_035", "p02630_case_036", "p02630_case_037", "p02630_case_038", "p02630_case_039", "p02630_case_040", "p02630_case_041", "p02630_case_042", "p02630_case_043", "p02630_case_044", "p02630_case_045", "p02630_case_046", "p02630_case_047", "p02630_case_048", "p02630_case_049", "p02630_case_050", "p02630_case_051", "p02630_case_052", "p02630_case_053", "p02630_case_054", "p02630_case_055", "p02630_case_056", "p02630_case_057", "p02630_case_058", "p02630_case_059", "p02630_case_060", "p02630_case_061", "p02630_case_062", "p02630_case_063", "p02630_case_064", "p02630_case_065", "p02630_case_066", "p02630_case_067", "p02630_case_068", "p02630_case_069", "p02630_case_070", "p02630_case_071", "p02630_case_072", "p02630_case_073", "p02630_case_074", "p02630_case_075", "p02630_case_076", "p02630_case_077", "p02630_case_078", "p02630_case_079", "p02630_case_080", "p02630_case_081", "p02630_case_082", "p02630_case_083", "p02630_case_084", "p02630_case_085", "p02630_case_086", "p02630_case_087", "p02630_case_088", "p02630_case_089", "p02630_case_090", "p02630_case_091", "p02630_case_092", "p02630_case_093", "p02630_case_094", "p02630_case_095", "p02630_case_096", "p02630_case_097", "p02630_case_098", "p02630_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from collections import *\n\neval(input())\ns = sum(A := list(map(int, input().split())))\nA = Counter(A)\nfor i in range(int(eval(input()))):\n b, c = list(map(int, input().split()))\n s += (c - b) * A[b]\n A[c] += A[b]\n A[b] = 0\n print(s)\n", "fast_code_sha256": "bdb6e5fdc72ade6300e28d6abcf22e8aa9147491ce09421a7ba5683f97311575", "fast_id": "p02630_bdb6e5fdc72ade6300e28d6abcf22e8aa9147491ce09421a7ba5683f97311575", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from collections import *\n\neval(input())\ns = sum(A := list(map(int, input().split())))\nA = Counter(A)\nfor i in range(int(eval(input()))):\n b, c = list(map(int, input().split()))\n s += (c - b) * A[b]\n A[c] += A[b]\n A[b] = 0\n print(s)\n", "measured_fast_code_sha256": "bdb6e5fdc72ade6300e28d6abcf22e8aa9147491ce09421a7ba5683f97311575", "measured_slow_code": "v = [0 for i in range(100001)]\nn = int(eval(input()))\nar = list(map(int, input().split()))\ns = 0\nfor i in ar:\n s += i\n v[i] += 1\nq = int(eval(input()))\nfor i in range(q):\n a, b = list(map(int, input().split()))\n s -= a * v[a]\n s += b * v[a]\n v[b] += v[a]\n v[a] = 0\n print(s)\n", "measured_slow_code_sha256": "c0c92be78298924f693e00b5a206080ad2444c946ea53f1a3ffdfc6b6a35e213", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.7166683848344464, "pair_id": "python_v2_5e09aa98a599dc30fccdb814", "per_case_slow_code_faster_fraction": 0.36, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02630", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02630_bdb6e5fdc72ade6300e28d6abcf22e8aa9147491ce09421a7ba5683f97311575.jsonl.gz", "inputs": "reproduction/python/inputs/p02630.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02630_c0c92be78298924f693e00b5a206080ad2444c946ea53f1a3ffdfc6b6a35e213.jsonl.gz"}, "slow_code": "v = [0 for i in range(100001)]\nn = int(eval(input()))\nar = list(map(int, input().split()))\ns = 0\nfor i in ar:\n s += i\n v[i] += 1\nq = int(eval(input()))\nfor i in range(q):\n a, b = list(map(int, input().split()))\n s -= a * v[a]\n s += b * v[a]\n v[b] += v[a]\n v[a] = 0\n print(s)\n", "slow_code_sha256": "c0c92be78298924f693e00b5a206080ad2444c946ea53f1a3ffdfc6b6a35e213", "slow_id": "p02630_c0c92be78298924f693e00b5a206080ad2444c946ea53f1a3ffdfc6b6a35e213", "speedup": 4.714285088650679, "stratum": "4-8", "within_pair_jaccard": 0.5, "workload": {"case_count": 100, "description": "Process Q updates in order on an integer array: replace every current occurrence of B_i with C_i, where B_i!=C_i. After each update, output the sum of all array entries. Observed inputs: N=1..100000 (median 1000); Q=1..100000 (median 1000); A_i=1..100000; B_i=1..100000; C_i=1..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 2000014, "median": 176600.5, "min": 10}, "input_format": ["N\nA_1 ... A_N\nQ\nB_1 C_1\n...\nB_Q C_Q"], "input_format_status": "source_input_section", "input_lines": {"max": 100003, "median": 1003.0, "min": 4}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 300002, "median": 30002.0, "min": 5}}} -{"case_ids": ["p02640_case_000", "p02640_case_001", "p02640_case_002", "p02640_case_003", "p02640_case_004", "p02640_case_005", "p02640_case_006", "p02640_case_007", "p02640_case_008", "p02640_case_009", "p02640_case_010", "p02640_case_011", "p02640_case_012", "p02640_case_013", "p02640_case_014", "p02640_case_015", "p02640_case_016", "p02640_case_017", "p02640_case_018", "p02640_case_019", "p02640_case_020", "p02640_case_021", "p02640_case_022", "p02640_case_023", "p02640_case_024", "p02640_case_025", "p02640_case_026", "p02640_case_027", "p02640_case_028", "p02640_case_029", "p02640_case_030", "p02640_case_031", "p02640_case_032", "p02640_case_033", "p02640_case_034", "p02640_case_035", "p02640_case_036", "p02640_case_037", "p02640_case_038", "p02640_case_039", "p02640_case_040", "p02640_case_041", "p02640_case_042", "p02640_case_043", "p02640_case_044", "p02640_case_045", "p02640_case_046", "p02640_case_047", "p02640_case_048", "p02640_case_049", "p02640_case_050", "p02640_case_051", "p02640_case_052", "p02640_case_053", "p02640_case_054", "p02640_case_055", "p02640_case_056", "p02640_case_057", "p02640_case_058", "p02640_case_059", "p02640_case_060", "p02640_case_061", "p02640_case_062", "p02640_case_063", "p02640_case_064", "p02640_case_065", "p02640_case_066", "p02640_case_067", "p02640_case_068", "p02640_case_069", "p02640_case_070", "p02640_case_071", "p02640_case_072", "p02640_case_073", "p02640_case_074", "p02640_case_075", "p02640_case_076", "p02640_case_077", "p02640_case_078", "p02640_case_079", "p02640_case_080", "p02640_case_081", "p02640_case_082", "p02640_case_083", "p02640_case_084", "p02640_case_085", "p02640_case_086", "p02640_case_087", "p02640_case_088", "p02640_case_089", "p02640_case_090", "p02640_case_091", "p02640_case_092", "p02640_case_093", "p02640_case_094", "p02640_case_095", "p02640_case_096", "p02640_case_097", "p02640_case_098", "p02640_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "x, y = [int(x) for x in input().split()]\nfor i in range(x + 1):\n ans = \"No\"\n b = x - i\n if (i * 2 + b * 4) == y:\n ans = \"Yes\"\n break\nprint(ans)\n", "fast_code_sha256": "8be6fab60cbb0835a7b785db5120fb63fb563cbc99a2259dd192835026c9ab10", "fast_id": "p02640_8be6fab60cbb0835a7b785db5120fb63fb563cbc99a2259dd192835026c9ab10", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "x, y = [int(x) for x in input().split()]\nfor i in range(x + 1):\n ans = \"No\"\n b = x - i\n if (i * 2 + b * 4) == y:\n ans = \"Yes\"\n break\nprint(ans)\n", "measured_fast_code_sha256": "8be6fab60cbb0835a7b785db5120fb63fb563cbc99a2259dd192835026c9ab10", "measured_slow_code": "x, y = list(map(int, input().split()))\nfor i in range(0, 101):\n for j in range(0, 101):\n if i + j == x and i * 2 + j * 4 == y:\n print(\"Yes\")\n exit()\nprint(\"No\")\n# print('Yes' if y%2 == 0 and x >= y//2 and y // 4 - (y%4) //2 <= x else 'No')\n", "measured_slow_code_sha256": "b81aa7896b39a5e204fdfa9ca3f63685a6d18d86724afc22b841cf9b49e7766b", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 6.591159951749715, "pair_id": "python_v2_2e54c14acee1a2bc6a751eb8", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02640", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02640_8be6fab60cbb0835a7b785db5120fb63fb563cbc99a2259dd192835026c9ab10.jsonl.gz", "inputs": "reproduction/python/inputs/p02640.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02640_b81aa7896b39a5e204fdfa9ca3f63685a6d18d86724afc22b841cf9b49e7766b.jsonl.gz"}, "slow_code": "x, y = list(map(int, input().split()))\nfor i in range(0, 101):\n for j in range(0, 101):\n if i + j == x and i * 2 + j * 4 == y:\n print(\"Yes\")\n exit()\nprint(\"No\")\n", "slow_code_sha256": "ac09bdaf0871ab87a33221ec8a163d2052febe18d868feae44e613cae3f3a95f", "slow_id": "p02640_b81aa7896b39a5e204fdfa9ca3f63685a6d18d86724afc22b841cf9b49e7766b", "speedup": 6.8625267319097505, "stratum": "4-8", "within_pair_jaccard": 0.5769230769230769, "workload": {"case_count": 100, "description": "Determine whether X animals can have Y legs in total when each animal is either a two-legged crane or a four-legged turtle. Observed inputs: X=1..100 (median 18); Y=1..100 (median 41).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 8, "median": 6.0, "min": 4}, "input_format": ["X Y"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p03221_case_000", "p03221_case_001", "p03221_case_002", "p03221_case_003", "p03221_case_004", "p03221_case_005", "p03221_case_006", "p03221_case_007", "p03221_case_008", "p03221_case_009", "p03221_case_010", "p03221_case_011", "p03221_case_012", "p03221_case_013", "p03221_case_014", "p03221_case_015", "p03221_case_016", "p03221_case_017", "p03221_case_018", "p03221_case_019", "p03221_case_020", "p03221_case_021", "p03221_case_022", "p03221_case_023", "p03221_case_024", "p03221_case_025", "p03221_case_026", "p03221_case_027", "p03221_case_028", "p03221_case_029", "p03221_case_030", "p03221_case_031", "p03221_case_032", "p03221_case_033", "p03221_case_034", "p03221_case_035", "p03221_case_036", "p03221_case_037", "p03221_case_038", "p03221_case_039", "p03221_case_040", "p03221_case_041", "p03221_case_042", "p03221_case_043", "p03221_case_044", "p03221_case_045", "p03221_case_046", "p03221_case_047", "p03221_case_048", "p03221_case_049", "p03221_case_050", "p03221_case_051", "p03221_case_052", "p03221_case_053", "p03221_case_054", "p03221_case_055", "p03221_case_056", "p03221_case_057", "p03221_case_058", "p03221_case_059", "p03221_case_060", "p03221_case_061", "p03221_case_062", "p03221_case_063", "p03221_case_064", "p03221_case_065", "p03221_case_066", "p03221_case_067", "p03221_case_068", "p03221_case_069", "p03221_case_070", "p03221_case_071", "p03221_case_072", "p03221_case_073", "p03221_case_074", "p03221_case_075", "p03221_case_076", "p03221_case_077", "p03221_case_078", "p03221_case_079", "p03221_case_080", "p03221_case_081", "p03221_case_082", "p03221_case_083", "p03221_case_084", "p03221_case_085", "p03221_case_086", "p03221_case_087", "p03221_case_088", "p03221_case_089", "p03221_case_090", "p03221_case_091", "p03221_case_092", "p03221_case_093", "p03221_case_094", "p03221_case_095", "p03221_case_096", "p03221_case_097", "p03221_case_098", "p03221_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N, M = list(map(int, input().split()))\nPY = [[i, 0] + list(map(int, input().split())) for i in range(M)]\n\nPY.sort(key=lambda x: (x[2], x[3]))\np = -1\nnum = 1\nfor i, py in enumerate(PY):\n if p != py[2]:\n p = py[2]\n num = 1\n PY[i][1] = num\n else:\n num += 1\n PY[i][1] = num\nPY.sort(key=lambda x: x[0])\nfor py in PY:\n print((\"{:0=6}{:0=6}\".format(py[2], py[1])))\n", "fast_code_sha256": "446c1847691f0ecb04da97bcbe66d24dd0c1eeed40c2c18f97ed77e5facef6c0", "fast_id": "p03221_1e233513c032390ccc2d445bbda82aa67312f6ef0e85198df39820cae157c054", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N, M = list(map(int, input().split()))\nPY = [[i, 0] + list(map(int, input().split())) for i in range(M)]\n# [index, nth city, pref num, birth year]\nPY.sort(key=lambda x: (x[2], x[3]))\np = -1\nnum = 1\nfor i, py in enumerate(PY):\n if p != py[2]:\n p = py[2]\n num = 1\n PY[i][1] = num\n else:\n num += 1\n PY[i][1] = num\nPY.sort(key=lambda x: x[0])\nfor py in PY:\n print((\"{:0=6}{:0=6}\".format(py[2], py[1])))\n", "measured_fast_code_sha256": "1e233513c032390ccc2d445bbda82aa67312f6ef0e85198df39820cae157c054", "measured_slow_code": "N, M = list(map(int, input().split()))\nP = []\nY = []\narr = [[] for j in range(10**5 + 1)]\nfor i in range(M):\n listA = list(map(int, input().split()))\n P.append(listA[0])\n Y.append(listA[1])\n arr[listA[0]].append(listA[1])\nfor i in range(N + 1):\n arr[i].sort()\nfor i in range(M):\n # 二部探索\n left = 0\n right = len(arr[P[i]]) - 1\n while left <= right:\n mid = (left + right) // 2\n if arr[P[i]][mid] == Y[i]:\n k = mid\n break\n elif arr[P[i]][mid] > Y[i]:\n right = mid - 1\n else:\n left = mid + 1\n print((str(P[i]).rjust(6, \"0\") + str(k + 1).rjust(6, \"0\")))\n", "measured_slow_code_sha256": "bac932e565fc824f54938c4edcf17024edb8ebfd73deb80882c8006e56a416b6", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4.346561281353525, "pair_id": "python_v2_f7f9c04dac1b7992bf8cc8df", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03221", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03221_1e233513c032390ccc2d445bbda82aa67312f6ef0e85198df39820cae157c054.jsonl.gz", "inputs": "reproduction/python/inputs/p03221.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03221_bac932e565fc824f54938c4edcf17024edb8ebfd73deb80882c8006e56a416b6.jsonl.gz"}, "slow_code": "N, M = list(map(int, input().split()))\nP = []\nY = []\narr = [[] for j in range(10**5 + 1)]\nfor i in range(M):\n listA = list(map(int, input().split()))\n P.append(listA[0])\n Y.append(listA[1])\n arr[listA[0]].append(listA[1])\nfor i in range(N + 1):\n arr[i].sort()\nfor i in range(M):\n\n left = 0\n right = len(arr[P[i]]) - 1\n while left <= right:\n mid = (left + right) // 2\n if arr[P[i]][mid] == Y[i]:\n k = mid\n break\n elif arr[P[i]][mid] > Y[i]:\n right = mid - 1\n else:\n left = mid + 1\n print((str(P[i]).rjust(6, \"0\") + str(k + 1).rjust(6, \"0\")))\n", "slow_code_sha256": "9a9b5b8d60f2f6a437fd75f31baba74dc5ed7ac13071d840e26b691e2ff91cac", "slow_id": "p03221_bac932e565fc824f54938c4edcf17024edb8ebfd73deb80882c8006e56a416b6", "speedup": 7.129024043715674, "stratum": "4-8", "within_pair_jaccard": 0.3829787234042553, "workload": {"case_count": 100, "description": "For each city, output a 12-digit ID formed from its prefecture P_i and its 1-based establishment rank within that prefecture, each zero-padded to six digits. Establishment years Y_i are globally distinct. Preserve input city order. Observed inputs: N=1..100000 (median 1000); M=1..100000 (median 1000); P_i=1..100000; Y_i=674542..991757127.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1600014, "median": 13905.0, "min": 16}, "input_format": ["N M\nP_1 Y_1\n...\nP_M Y_M"], "input_format_status": "source_input_section", "input_lines": {"max": 100001, "median": 1001.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200002, "median": 2002.0, "min": 4}}} -{"case_ids": ["p03598_case_000", "p03598_case_001", "p03598_case_002", "p03598_case_003", "p03598_case_004", "p03598_case_005", "p03598_case_006", "p03598_case_007", "p03598_case_008", "p03598_case_009", "p03598_case_010", "p03598_case_011", "p03598_case_012", "p03598_case_013", "p03598_case_014", "p03598_case_015", "p03598_case_016", "p03598_case_017", "p03598_case_018", "p03598_case_019", "p03598_case_020", "p03598_case_021", "p03598_case_022", "p03598_case_023", "p03598_case_024", "p03598_case_025", "p03598_case_026", "p03598_case_027", "p03598_case_028", "p03598_case_029", "p03598_case_030", "p03598_case_031", "p03598_case_032", "p03598_case_033", "p03598_case_034", "p03598_case_035", "p03598_case_036", "p03598_case_037", "p03598_case_038", "p03598_case_039", "p03598_case_040", "p03598_case_041", "p03598_case_042", "p03598_case_043", "p03598_case_044", "p03598_case_045", "p03598_case_046", "p03598_case_047", "p03598_case_048", "p03598_case_049", "p03598_case_050", "p03598_case_051", "p03598_case_052", "p03598_case_053", "p03598_case_054", "p03598_case_055", "p03598_case_056", "p03598_case_057", "p03598_case_058", "p03598_case_059", "p03598_case_060", "p03598_case_061", "p03598_case_062", "p03598_case_063", "p03598_case_064", "p03598_case_065", "p03598_case_066", "p03598_case_067", "p03598_case_068", "p03598_case_069", "p03598_case_070", "p03598_case_071", "p03598_case_072", "p03598_case_073", "p03598_case_074", "p03598_case_075", "p03598_case_076", "p03598_case_077", "p03598_case_078", "p03598_case_079", "p03598_case_080", "p03598_case_081", "p03598_case_082", "p03598_case_083", "p03598_case_084", "p03598_case_085", "p03598_case_086", "p03598_case_087", "p03598_case_088", "p03598_case_089", "p03598_case_090", "p03598_case_091", "p03598_case_092", "p03598_case_093", "p03598_case_094", "p03598_case_095", "p03598_case_096", "p03598_case_097", "p03598_case_098", "p03598_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n, k = int(eval(input())), int(eval(input()))\nprint(\n (sum([min(abs(i * 2), abs((i - k) * 2)) for i in list(map(int, input().split()))]))\n)\n", "fast_code_sha256": "c138ac39a967b806098677bc3723baf085bdbf461e9ac05dfbbc950da2f15b09", "fast_id": "p03598_c138ac39a967b806098677bc3723baf085bdbf461e9ac05dfbbc950da2f15b09", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n, k = int(eval(input())), int(eval(input()))\nprint(\n (sum([min(abs(i * 2), abs((i - k) * 2)) for i in list(map(int, input().split()))]))\n)\n", "measured_fast_code_sha256": "c138ac39a967b806098677bc3723baf085bdbf461e9ac05dfbbc950da2f15b09", "measured_slow_code": "import sys\n\nstdin = sys.stdin\ninf = 1 << 60\nmod = 1000000007\nni = lambda: int(ns())\nnin = lambda y: [ni() for _ in range(y)]\nna = lambda: list(map(int, stdin.readline().split()))\nnan = lambda y: [na() for _ in range(y)]\nnf = lambda: float(ns())\nnfn = lambda y: [nf() for _ in range(y)]\nnfa = lambda: list(map(float, stdin.readline().split()))\nnfan = lambda y: [nfa() for _ in range(y)]\nns = lambda: stdin.readline().rstrip()\nnsn = lambda y: [ns() for _ in range(y)]\nncl = lambda y: [list(ns()) for _ in range(y)]\nnas = lambda: stdin.readline().split()\nn = ni()\nk = ni()\nx = na()\nans = 0\nfor i in range(n):\n ans += min(abs(x[i]) * 2, abs(x[i] - k) * 2)\nprint(ans)\n", "measured_slow_code_sha256": "a66300914442ee82bfcfdd13cd1522bcabf2d0a85e3def79bf6a7e26cf75b1bb", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.684242631415575, "pair_id": "python_v2_2c68e4cd49df933a1c8c4e1e", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03598", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03598_c138ac39a967b806098677bc3723baf085bdbf461e9ac05dfbbc950da2f15b09.jsonl.gz", "inputs": "reproduction/python/inputs/p03598.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03598_a66300914442ee82bfcfdd13cd1522bcabf2d0a85e3def79bf6a7e26cf75b1bb.jsonl.gz"}, "slow_code": "import sys\n\nstdin = sys.stdin\ninf = 1 << 60\nmod = 1000000007\nni = lambda: int(ns())\nnin = lambda y: [ni() for _ in range(y)]\nna = lambda: list(map(int, stdin.readline().split()))\nnan = lambda y: [na() for _ in range(y)]\nnf = lambda: float(ns())\nnfn = lambda y: [nf() for _ in range(y)]\nnfa = lambda: list(map(float, stdin.readline().split()))\nnfan = lambda y: [nfa() for _ in range(y)]\nns = lambda: stdin.readline().rstrip()\nnsn = lambda y: [ns() for _ in range(y)]\nncl = lambda y: [list(ns()) for _ in range(y)]\nnas = lambda: stdin.readline().split()\nn = ni()\nk = ni()\nx = na()\nans = 0\nfor i in range(n):\n ans += min(abs(x[i]) * 2, abs(x[i] - k) * 2)\nprint(ans)\n", "slow_code_sha256": "a66300914442ee82bfcfdd13cd1522bcabf2d0a85e3def79bf6a7e26cf75b1bb", "slow_id": "p03598_a66300914442ee82bfcfdd13cd1522bcabf2d0a85e3def79bf6a7e26cf75b1bb", "speedup": 3.0061495154887132, "stratum": "2-4", "within_pair_jaccard": 0.2826086956521739, "workload": {"case_count": 100, "description": "For each ball at (x_i,i), choose a robot from (0,i) or (K,i) to collect it and return to that endpoint. Minimize total travel distance over all N balls; every x_i lies strictly between 0 and K. Observed inputs: N=1..100 (median 89); K=2..100 (median 73); x_i=1..99.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 308, "median": 206.0, "min": 6}, "input_format": ["N\nK\nx_1 ... x_N"], "input_format_status": "source_input_section", "input_lines": {"max": 3, "median": 3.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 102, "median": 91.0, "min": 3}}} -{"case_ids": ["p02712_case_000", "p02712_case_001", "p02712_case_002", "p02712_case_003", "p02712_case_004", "p02712_case_005", "p02712_case_006", "p02712_case_007", "p02712_case_008", "p02712_case_009", "p02712_case_010", "p02712_case_011", "p02712_case_012", "p02712_case_013", "p02712_case_014", "p02712_case_015", "p02712_case_016", "p02712_case_017", "p02712_case_018", "p02712_case_019", "p02712_case_020", "p02712_case_021", "p02712_case_022", "p02712_case_023", "p02712_case_024", "p02712_case_025", "p02712_case_026", "p02712_case_027", "p02712_case_028", "p02712_case_029", "p02712_case_030", "p02712_case_031", "p02712_case_032", "p02712_case_033", "p02712_case_034", "p02712_case_035", "p02712_case_036", "p02712_case_037", "p02712_case_038", "p02712_case_039", "p02712_case_040", "p02712_case_041", "p02712_case_042", "p02712_case_043", "p02712_case_044", "p02712_case_045", "p02712_case_046", "p02712_case_047", "p02712_case_048", "p02712_case_049", "p02712_case_050", "p02712_case_051", "p02712_case_052", "p02712_case_053", "p02712_case_054", "p02712_case_055", "p02712_case_056", "p02712_case_057", "p02712_case_058", "p02712_case_059", "p02712_case_060", "p02712_case_061", "p02712_case_062", "p02712_case_063", "p02712_case_064", "p02712_case_065", "p02712_case_066", "p02712_case_067", "p02712_case_068", "p02712_case_069", "p02712_case_070", "p02712_case_071", "p02712_case_072", "p02712_case_073", "p02712_case_074", "p02712_case_075", "p02712_case_076", "p02712_case_077", "p02712_case_078", "p02712_case_079", "p02712_case_080", "p02712_case_081", "p02712_case_082", "p02712_case_083", "p02712_case_084", "p02712_case_085", "p02712_case_086", "p02712_case_087", "p02712_case_088", "p02712_case_089", "p02712_case_090", "p02712_case_091", "p02712_case_092", "p02712_case_093", "p02712_case_094", "p02712_case_095", "p02712_case_096", "p02712_case_097", "p02712_case_098", "p02712_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N = int(eval(input()))\nans = int(\n N * (N + 1) / 2\n - (N // 3) * (N // 3 + 1) / 2 * 3\n - (N // 5) * (N // 5 + 1) / 2 * 5\n + (N // 15) * (N // 15 + 1) / 2 * 15\n)\nprint(ans)\n", "fast_code_sha256": "48bca5ec537e2c0d335a2f12dd6d8f572e8554225e88eac3eb9ee080f8838834", "fast_id": "p02712_48bca5ec537e2c0d335a2f12dd6d8f572e8554225e88eac3eb9ee080f8838834", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N = int(eval(input()))\nans = int(\n N * (N + 1) / 2\n - (N // 3) * (N // 3 + 1) / 2 * 3\n - (N // 5) * (N // 5 + 1) / 2 * 5\n + (N // 15) * (N // 15 + 1) / 2 * 15\n)\nprint(ans)\n", "measured_fast_code_sha256": "48bca5ec537e2c0d335a2f12dd6d8f572e8554225e88eac3eb9ee080f8838834", "measured_slow_code": "n = int(eval(input()))\na = [0 for i in range(n)]\ncount = 0\nfor i in range(n):\n if (i + 1) % 3 == 0 or (i + 1) % 5 == 0:\n continue\n else:\n a[i] = i + 1\n count += i + 1\nprint(count)\n", "measured_slow_code_sha256": "cc3f9e0e6116014af910f8b40835b1f31de095fd1860f0d0844bf40df1c5751a", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3087.9687439503086, "pair_id": "python_v2_eef78e909e9700a64f683e92", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02712", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02712_48bca5ec537e2c0d335a2f12dd6d8f572e8554225e88eac3eb9ee080f8838834.jsonl.gz", "inputs": "reproduction/python/inputs/p02712.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02712_cc3f9e0e6116014af910f8b40835b1f31de095fd1860f0d0844bf40df1c5751a.jsonl.gz"}, "slow_code": "n = int(eval(input()))\na = [0 for i in range(n)]\ncount = 0\nfor i in range(n):\n if (i + 1) % 3 == 0 or (i + 1) % 5 == 0:\n continue\n else:\n a[i] = i + 1\n count += i + 1\nprint(count)\n", "slow_code_sha256": "cc3f9e0e6116014af910f8b40835b1f31de095fd1860f0d0844bf40df1c5751a", "slow_id": "p02712_cc3f9e0e6116014af910f8b40835b1f31de095fd1860f0d0844bf40df1c5751a", "speedup": 850.7983987667284, "stratum": "8+", "within_pair_jaccard": 0.22727272727272727, "workload": {"case_count": 100, "description": "Sum numeric terms among the first N FizzBuzz terms: multiples of 3 or 5 are words, and every other term i is the number i. Observed inputs: N=1..1000000 (median 360236).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 8, "median": 7.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p02244_case_000", "p02244_case_001", "p02244_case_002", "p02244_case_003", "p02244_case_004", "p02244_case_005", "p02244_case_006", "p02244_case_007", "p02244_case_008", "p02244_case_009", "p02244_case_010", "p02244_case_011", "p02244_case_012", "p02244_case_013", "p02244_case_014", "p02244_case_015", "p02244_case_016", "p02244_case_017", "p02244_case_018", "p02244_case_019", "p02244_case_020", "p02244_case_021", "p02244_case_022", "p02244_case_023", "p02244_case_024", "p02244_case_025", "p02244_case_026", "p02244_case_027", "p02244_case_028", "p02244_case_029", "p02244_case_030", "p02244_case_031", "p02244_case_032", "p02244_case_033", "p02244_case_034", "p02244_case_035", "p02244_case_036", "p02244_case_037", "p02244_case_038", "p02244_case_039", "p02244_case_040", "p02244_case_041", "p02244_case_042", "p02244_case_043", "p02244_case_044", "p02244_case_045", "p02244_case_046", "p02244_case_047", "p02244_case_048", "p02244_case_049", "p02244_case_050", "p02244_case_051", "p02244_case_052", "p02244_case_053", "p02244_case_054", "p02244_case_055", "p02244_case_056", "p02244_case_057", "p02244_case_058", "p02244_case_059", "p02244_case_060", "p02244_case_061", "p02244_case_062", "p02244_case_063", "p02244_case_064", "p02244_case_065", "p02244_case_066", "p02244_case_067", "p02244_case_068", "p02244_case_069", "p02244_case_070", "p02244_case_071", "p02244_case_072", "p02244_case_073", "p02244_case_074", "p02244_case_075", "p02244_case_076", "p02244_case_077", "p02244_case_078", "p02244_case_079", "p02244_case_080", "p02244_case_081", "p02244_case_082", "p02244_case_083", "p02244_case_084", "p02244_case_085", "p02244_case_086", "p02244_case_087", "p02244_case_088", "p02244_case_089", "p02244_case_090", "p02244_case_091", "p02244_case_092", "p02244_case_093", "p02244_case_094", "p02244_case_095", "p02244_case_096", "p02244_case_097", "p02244_case_098", "p02244_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import itertools\n\nN, Q, row, col = eval(input()), [], list(range(8)), list(range(8))\nfor _ in range(N):\n r, c = list(map(int, input().split()))\n Q.append((r, c))\n row.remove(r)\n col.remove(c)\nfor l in itertools.permutations(col):\n queen = Q + list(zip(row, l))\n if not any(\n any(\n (r1 != r2 or c1 != c2)\n and (r1 == r2 or c1 == c2 or r1 + c1 == r2 + c2 or r1 - c1 == r2 - c2)\n for r2, c2 in queen\n )\n for r1, c1 in queen\n ):\n print(\n \"\\n\".join(\n \"\".join(\"Q\" if (r, c) in queen else \".\" for c in range(8))\n for r in range(8)\n )\n )\n break\n", "fast_code_sha256": "e71ff87ba6dca84fe3a97db8c3e9b502e0b0ae4a7787e5880b5247fcd12162f6", "fast_id": "p02244_e71ff87ba6dca84fe3a97db8c3e9b502e0b0ae4a7787e5880b5247fcd12162f6", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import itertools\n\nN, Q, row, col = eval(input()), [], list(range(8)), list(range(8))\nfor _ in range(N):\n r, c = list(map(int, input().split()))\n Q.append((r, c))\n row.remove(r)\n col.remove(c)\nfor l in itertools.permutations(col):\n queen = Q + list(zip(row, l))\n if not any(\n any(\n (r1 != r2 or c1 != c2)\n and (r1 == r2 or c1 == c2 or r1 + c1 == r2 + c2 or r1 - c1 == r2 - c2)\n for r2, c2 in queen\n )\n for r1, c1 in queen\n ):\n print(\n \"\\n\".join(\n \"\".join(\"Q\" if (r, c) in queen else \".\" for c in range(8))\n for r in range(8)\n )\n )\n break\n", "measured_fast_code_sha256": "e71ff87ba6dca84fe3a97db8c3e9b502e0b0ae4a7787e5880b5247fcd12162f6", "measured_slow_code": "from functools import lru_cache\n\ncc = [[\".\" for i in range(8)] for j in range(8)]\n\n\ndef check(cc, a, b):\n ss = list(zip(*cc))\n if \"Q\" in cc[a]:\n return False\n if \"Q\" in ss[b]:\n return False\n d = []\n for i in range(8):\n for j in range(8):\n try:\n if j + abs(a - i) == b:\n d.append(cc[i][j])\n if j - abs(a - i) == b:\n d.append(cc[i][j])\n except IndexError:\n continue\n if \"Q\" in d:\n return False\n return True\n\n\ndef chess(s, queen):\n if queen == 8:\n return s\n for i in range(8):\n for j in range(8):\n if check(s, i, j):\n sol = s\n sol[i][j] = \"Q\"\n if chess(sol, queen + 1) != [[]]:\n return sol\n else:\n sol[i][j] = \".\"\n return [[]]\n\n\nk = int(eval(input()))\nfor i in range(k):\n a, b = [int(x) for x in input().split()]\n cc[a][b] = \"Q\"\nans = chess(cc, k)\nprint((\"\\n\".join(list([\"\".join(x) for x in ans]))))\n", "measured_slow_code_sha256": "94ec109ccd8bd9441b7a500ac9b67e1cafa7fd6c57f646835c6b0dc73a712deb", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.294220370438868, "pair_id": "python_v2_0282de8710beb74ce18078a8", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02244", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02244_e71ff87ba6dca84fe3a97db8c3e9b502e0b0ae4a7787e5880b5247fcd12162f6.jsonl.gz", "inputs": "reproduction/python/inputs/p02244.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02244_94ec109ccd8bd9441b7a500ac9b67e1cafa7fd6c57f646835c6b0dc73a712deb.jsonl.gz"}, "slow_code": "from functools import lru_cache\n\ncc = [[\".\" for i in range(8)] for j in range(8)]\n\n\ndef check(cc, a, b):\n ss = list(zip(*cc))\n if \"Q\" in cc[a]:\n return False\n if \"Q\" in ss[b]:\n return False\n d = []\n for i in range(8):\n for j in range(8):\n try:\n if j + abs(a - i) == b:\n d.append(cc[i][j])\n if j - abs(a - i) == b:\n d.append(cc[i][j])\n except IndexError:\n continue\n if \"Q\" in d:\n return False\n return True\n\n\ndef chess(s, queen):\n if queen == 8:\n return s\n for i in range(8):\n for j in range(8):\n if check(s, i, j):\n sol = s\n sol[i][j] = \"Q\"\n if chess(sol, queen + 1) != [[]]:\n return sol\n else:\n sol[i][j] = \".\"\n return [[]]\n\n\nk = int(eval(input()))\nfor i in range(k):\n a, b = [int(x) for x in input().split()]\n cc[a][b] = \"Q\"\nans = chess(cc, k)\nprint((\"\\n\".join(list([\"\".join(x) for x in ans]))))\n", "slow_code_sha256": "94ec109ccd8bd9441b7a500ac9b67e1cafa7fd6c57f646835c6b0dc73a712deb", "slow_id": "p02244_94ec109ccd8bd9441b7a500ac9b67e1cafa7fd6c57f646835c6b0dc73a712deb", "speedup": 3.5901314187637885, "stratum": "2-4", "within_pair_jaccard": 0.2878787878787879, "workload": {"case_count": 100, "description": "Complete an 8-by-8 board to eight nonattacking queens while preserving k fixed placements. Queens must differ in row, column and diagonal; coordinates are 0-based. The saved input has exactly one completion. Output Q for queens and . for empty cells. Observed inputs: k=2..8 (median 4); row=0..7; column=0..7.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 34, "median": 18.0, "min": 10}, "input_format": ["k\nr_1 c_1\n...\nr_k c_k"], "input_format_status": "source_input_section", "input_lines": {"max": 9, "median": 5.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 17, "median": 9.0, "min": 5}}} -{"case_ids": ["p03713_case_000", "p03713_case_001", "p03713_case_002", "p03713_case_003", "p03713_case_004", "p03713_case_005", "p03713_case_006", "p03713_case_007", "p03713_case_008", "p03713_case_009", "p03713_case_010", "p03713_case_011", "p03713_case_012", "p03713_case_013", "p03713_case_014", "p03713_case_015", "p03713_case_016", "p03713_case_017", "p03713_case_018", "p03713_case_019", "p03713_case_020", "p03713_case_021", "p03713_case_022", "p03713_case_023", "p03713_case_024", "p03713_case_025", "p03713_case_026", "p03713_case_027", "p03713_case_028", "p03713_case_029", "p03713_case_030", "p03713_case_031", "p03713_case_032", "p03713_case_033", "p03713_case_034", "p03713_case_035", "p03713_case_036", "p03713_case_037", "p03713_case_038", "p03713_case_039", "p03713_case_040", "p03713_case_041", "p03713_case_042", "p03713_case_043", "p03713_case_044", "p03713_case_045", "p03713_case_046", "p03713_case_047", "p03713_case_048", "p03713_case_049", "p03713_case_050", "p03713_case_051", "p03713_case_052", "p03713_case_053", "p03713_case_054", "p03713_case_055", "p03713_case_056", "p03713_case_057", "p03713_case_058", "p03713_case_059", "p03713_case_060", "p03713_case_061", "p03713_case_062", "p03713_case_063", "p03713_case_064", "p03713_case_065", "p03713_case_066", "p03713_case_067", "p03713_case_068", "p03713_case_069", "p03713_case_070", "p03713_case_071", "p03713_case_072", "p03713_case_073", "p03713_case_074", "p03713_case_075", "p03713_case_076", "p03713_case_077", "p03713_case_078", "p03713_case_079", "p03713_case_080", "p03713_case_081", "p03713_case_082", "p03713_case_083", "p03713_case_084", "p03713_case_085", "p03713_case_086", "p03713_case_087", "p03713_case_088", "p03713_case_089", "p03713_case_090", "p03713_case_091", "p03713_case_092", "p03713_case_093", "p03713_case_094", "p03713_case_095", "p03713_case_096", "p03713_case_097", "p03713_case_098", "p03713_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "H, W = list(map(int, input().split()))\nif H % 3 == 0 or W % 3 == 0:\n print((0))\n exit()\nans = H * W\n\nfor h in range(1, H + 1):\n a = h * W\n\n b = ((H - h) // 2) * W\n c = H * W - a - b\n ans = min(ans, max([a, b, c]) - min([a, b, c]))\n\n b = (H - h) * (W // 2)\n c = H * W - a - b\n ans = min(ans, max([a, b, c]) - min([a, b, c]))\n\nfor w in range(1, W + 1):\n a = H * w\n\n b = (W - w) * (H // 2)\n c = H * W - a - b\n ans = min(ans, max([a, b, c]) - min([a, b, c]))\n\n b = ((W - w) // 2) * H\n c = H * W - a - b\n ans = min(ans, max([a, b, c]) - min([a, b, c]))\nprint(ans)\n", "fast_code_sha256": "180cfaeb3024b07a03347373b5a4375a14383a3c63d95b5ddf25a877245fc491", "fast_id": "p03713_230026fc092eb81d1f28ac162b7d87de026832e26c1b9ee04d7fe6109fd46cfb", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "H, W = list(map(int, input().split()))\nif H % 3 == 0 or W % 3 == 0:\n print((0))\n exit()\nans = H * W\n# 高さを変えて調べる\nfor h in range(1, H + 1):\n a = h * W\n # 残りを高さで割る場合\n b = ((H - h) // 2) * W\n c = H * W - a - b\n ans = min(ans, max([a, b, c]) - min([a, b, c]))\n # 残りを幅で割る場合\n b = (H - h) * (W // 2)\n c = H * W - a - b\n ans = min(ans, max([a, b, c]) - min([a, b, c]))\n# 幅を変えて調べる\nfor w in range(1, W + 1):\n a = H * w\n # 残りを高さで割る場合\n b = (W - w) * (H // 2)\n c = H * W - a - b\n ans = min(ans, max([a, b, c]) - min([a, b, c]))\n # 残りを幅で割る場合\n b = ((W - w) // 2) * H\n c = H * W - a - b\n ans = min(ans, max([a, b, c]) - min([a, b, c]))\nprint(ans)\n", "measured_fast_code_sha256": "230026fc092eb81d1f28ac162b7d87de026832e26c1b9ee04d7fe6109fd46cfb", "measured_slow_code": "def answer(H, W, ans):\n for x in range(1, W):\n y1 = H // 2\n Sa1 = H * x\n Sb1 = (W - x) * y1\n Sc1 = (W - x) * (H - y1)\n M = max(Sa1, Sb1, Sc1)\n m = min(Sa1, Sb1, Sc1)\n y2 = (W - x) // 2\n Sa2 = H * x\n Sb2 = H * y2\n Sc2 = H * (W - x - y2)\n M2 = max(Sa2, Sb2, Sc2)\n m2 = min(Sa2, Sb2, Sc2)\n if ans > min(M - m, M2 - m2):\n ans = min(M - m, M2 - m2)\n return ans\n\n\nif __name__ == \"__main__\":\n H, W = [int(i) for i in input().split()]\n ans = H * W\n ans = answer(H, W, ans)\n H, W = W, H\n if answer(H, W, ans) < ans:\n ans = answer(H, W, ans)\n print(ans)\n", "measured_slow_code_sha256": "b6f55d32b2be7c1b48c7e6912b9a7bd32004560e6fca8e785937ccf5c07eff29", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.176915924116802, "pair_id": "python_v2_165b74720f1d8421cde46652", "per_case_slow_code_faster_fraction": 0.48, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03713", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03713_230026fc092eb81d1f28ac162b7d87de026832e26c1b9ee04d7fe6109fd46cfb.jsonl.gz", "inputs": "reproduction/python/inputs/p03713.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03713_b6f55d32b2be7c1b48c7e6912b9a7bd32004560e6fca8e785937ccf5c07eff29.jsonl.gz"}, "slow_code": "def answer(H, W, ans):\n for x in range(1, W):\n y1 = H // 2\n Sa1 = H * x\n Sb1 = (W - x) * y1\n Sc1 = (W - x) * (H - y1)\n M = max(Sa1, Sb1, Sc1)\n m = min(Sa1, Sb1, Sc1)\n y2 = (W - x) // 2\n Sa2 = H * x\n Sb2 = H * y2\n Sc2 = H * (W - x - y2)\n M2 = max(Sa2, Sb2, Sc2)\n m2 = min(Sa2, Sb2, Sc2)\n if ans > min(M - m, M2 - m2):\n ans = min(M - m, M2 - m2)\n return ans\n\n\nif __name__ == \"__main__\":\n H, W = [int(i) for i in input().split()]\n ans = H * W\n ans = answer(H, W, ans)\n H, W = W, H\n if answer(H, W, ans) < ans:\n ans = answer(H, W, ans)\n print(ans)\n", "slow_code_sha256": "b6f55d32b2be7c1b48c7e6912b9a7bd32004560e6fca8e785937ccf5c07eff29", "slow_id": "p03713_b6f55d32b2be7c1b48c7e6912b9a7bd32004560e6fca8e785937ccf5c07eff29", "speedup": 7.8296948242401605, "stratum": "4-8", "within_pair_jaccard": 0.3181818181818182, "workload": {"case_count": 100, "description": "Divide an H-by-W grid-aligned rectangular bar into exactly three nonempty rectangular pieces along cell borders. Minimize the difference between the largest and smallest areas. The bar is implicit, not listed cell by cell. Observed inputs: H=2..100000 (median 54760.5); W=2..100000 (median 40128.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 14, "median": 11.5, "min": 4}, "input_format": ["H W"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p02261_case_000", "p02261_case_001", "p02261_case_002", "p02261_case_003", "p02261_case_004", "p02261_case_005", "p02261_case_006", "p02261_case_007", "p02261_case_008", "p02261_case_009", "p02261_case_010", "p02261_case_011", "p02261_case_012", "p02261_case_013", "p02261_case_014", "p02261_case_015", "p02261_case_016", "p02261_case_017", "p02261_case_018", "p02261_case_019", "p02261_case_020", "p02261_case_021", "p02261_case_022", "p02261_case_023", "p02261_case_024", "p02261_case_025", "p02261_case_026", "p02261_case_027", "p02261_case_028", "p02261_case_029", "p02261_case_030", "p02261_case_031", "p02261_case_032", "p02261_case_033", "p02261_case_034", "p02261_case_035", "p02261_case_036", "p02261_case_037", "p02261_case_038", "p02261_case_039", "p02261_case_040", "p02261_case_041", "p02261_case_042", "p02261_case_043", "p02261_case_044", "p02261_case_045", "p02261_case_046", "p02261_case_047", "p02261_case_048", "p02261_case_049", "p02261_case_050", "p02261_case_051", "p02261_case_052", "p02261_case_053", "p02261_case_054", "p02261_case_055", "p02261_case_056", "p02261_case_057", "p02261_case_058", "p02261_case_059", "p02261_case_060", "p02261_case_061", "p02261_case_062", "p02261_case_063", "p02261_case_064", "p02261_case_065", "p02261_case_066", "p02261_case_067", "p02261_case_068", "p02261_case_069", "p02261_case_070", "p02261_case_071", "p02261_case_072", "p02261_case_073", "p02261_case_074", "p02261_case_075", "p02261_case_076", "p02261_case_077", "p02261_case_078", "p02261_case_079", "p02261_case_080", "p02261_case_081", "p02261_case_082", "p02261_case_083", "p02261_case_084", "p02261_case_085", "p02261_case_086", "p02261_case_087", "p02261_case_088", "p02261_case_089", "p02261_case_090", "p02261_case_091", "p02261_case_092", "p02261_case_093", "p02261_case_094", "p02261_case_095", "p02261_case_096", "p02261_case_097", "p02261_case_098", "p02261_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def bubble_sort(A, n):\n for i in range(n):\n for j in range(n - 1, i, -1):\n if A[j][1] < A[j - 1][1]:\n A[j], A[j - 1] = A[j - 1], A[j]\n print((\" \".join(A)))\n\n\ndef selection_sort(A, n):\n for i in range(n):\n minj = i\n for j in range(i, n):\n if A[j][1] < A[minj][1]:\n minj = j\n if i != minj:\n A[i], A[minj] = A[minj], A[i]\n print((\" \".join(A)))\n\n\nif __name__ == \"__main__\":\n n = int(eval(input()))\n A = list(input().split())\n B = A[:]\n bubble_sort(A, n)\n print(\"Stable\")\n selection_sort(B, n)\n print((\"Stable\" if A == B else \"Not stable\"))\n", "fast_code_sha256": "a49ac918a01831449bf3aec0e5b1c11acd6e04aea985279f3dc2999da687ae86", "fast_id": "p02261_a49ac918a01831449bf3aec0e5b1c11acd6e04aea985279f3dc2999da687ae86", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def bubble_sort(A, n):\n for i in range(n):\n for j in range(n - 1, i, -1):\n if A[j][1] < A[j - 1][1]:\n A[j], A[j - 1] = A[j - 1], A[j]\n print((\" \".join(A)))\n\n\ndef selection_sort(A, n):\n for i in range(n):\n minj = i\n for j in range(i, n):\n if A[j][1] < A[minj][1]:\n minj = j\n if i != minj:\n A[i], A[minj] = A[minj], A[i]\n print((\" \".join(A)))\n\n\nif __name__ == \"__main__\":\n n = int(eval(input()))\n A = list(input().split())\n B = A[:]\n bubble_sort(A, n)\n print(\"Stable\")\n selection_sort(B, n)\n print((\"Stable\" if A == B else \"Not stable\"))\n", "measured_fast_code_sha256": "a49ac918a01831449bf3aec0e5b1c11acd6e04aea985279f3dc2999da687ae86", "measured_slow_code": "class Card:\n def __init__(self, card):\n self.card = card\n self.mark = card[0]\n self.number = card[1]\n\n def __lt__(self, other):\n if not isinstance(other, Card):\n return NotImplemented\n return self.number < other.number\n\n def __eq__(self, other):\n if not isinstance(other, Card):\n return NotImplemented\n return self.mark == other.mark and self.number == other.number\n\n def __repr__(self):\n return \"{}{}\".format(self.mark, self.number)\n\n\ndef BubbleSort(target):\n ls = target.copy()\n flag = 1\n while flag:\n flag = 0\n for i in range(len(ls) - 1, 0, -1):\n if ls[i] < ls[i - 1]:\n ls[i], ls[i - 1] = ls[i - 1], ls[i]\n flag = 1\n print((\" \".join(map(str, ls))))\n return sorted(ls)\n\n\ndef SelectSort(target):\n ls = target.copy()\n for i in range(len(ls)):\n minj = i\n for j in range(i + 1, len(ls)):\n if ls[j] < ls[minj]:\n minj = j\n if ls[i] != ls[minj]:\n ls[i], ls[minj] = ls[minj], ls[i]\n print((\" \".join(map(str, ls))))\n return sorted(ls)\n\n\ndef judge(original, sorted_list):\n if original == sorted_list:\n print(\"Stable\")\n else:\n print(\"Not stable\")\n\n\n_ = int(eval(input()))\nl2 = [Card(i) for i in input().split()]\nl2_sort = sorted(l2)\nbubble = BubbleSort(l2)\njudge(l2_sort, bubble)\nselect = SelectSort(l2)\njudge(l2_sort, select)\n", "measured_slow_code_sha256": "63fb47313d43df57a65763bf53ef7a8b437263f3ca4346979cfa2712a3b6daec", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.9845112360346722, "pair_id": "python_v2_1e7a471664518b58ce0f714e", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02261", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02261_a49ac918a01831449bf3aec0e5b1c11acd6e04aea985279f3dc2999da687ae86.jsonl.gz", "inputs": "reproduction/python/inputs/p02261.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02261_63fb47313d43df57a65763bf53ef7a8b437263f3ca4346979cfa2712a3b6daec.jsonl.gz"}, "slow_code": "class Card:\n def __init__(self, card):\n self.card = card\n self.mark = card[0]\n self.number = card[1]\n\n def __lt__(self, other):\n if not isinstance(other, Card):\n return NotImplemented\n return self.number < other.number\n\n def __eq__(self, other):\n if not isinstance(other, Card):\n return NotImplemented\n return self.mark == other.mark and self.number == other.number\n\n def __repr__(self):\n return \"{}{}\".format(self.mark, self.number)\n\n\ndef BubbleSort(target):\n ls = target.copy()\n flag = 1\n while flag:\n flag = 0\n for i in range(len(ls) - 1, 0, -1):\n if ls[i] < ls[i - 1]:\n ls[i], ls[i - 1] = ls[i - 1], ls[i]\n flag = 1\n print((\" \".join(map(str, ls))))\n return sorted(ls)\n\n\ndef SelectSort(target):\n ls = target.copy()\n for i in range(len(ls)):\n minj = i\n for j in range(i + 1, len(ls)):\n if ls[j] < ls[minj]:\n minj = j\n if ls[i] != ls[minj]:\n ls[i], ls[minj] = ls[minj], ls[i]\n print((\" \".join(map(str, ls))))\n return sorted(ls)\n\n\ndef judge(original, sorted_list):\n if original == sorted_list:\n print(\"Stable\")\n else:\n print(\"Not stable\")\n\n\n_ = int(eval(input()))\nl2 = [Card(i) for i in input().split()]\nl2_sort = sorted(l2)\nbubble = BubbleSort(l2)\njudge(l2_sort, bubble)\nselect = SelectSort(l2)\njudge(l2_sort, select)\n", "slow_code_sha256": "63fb47313d43df57a65763bf53ef7a8b437263f3ca4346979cfa2712a3b6daec", "slow_id": "p02261_63fb47313d43df57a65763bf53ef7a8b437263f3ca4346979cfa2712a3b6daec", "speedup": 2.059358229042562, "stratum": "2-4", "within_pair_jaccard": 0.296875, "workload": {"case_count": 100, "description": "Apply backward-scanning strict-comparison bubble sort and swap-based selection sort choosing the first minimum in the remaining suffix. Output both card sequences sorted by rank and whether each preserves input order among equal ranks. Cards have suits S,H,C,D and ranks 1..9. Observed inputs: N=1..36 (median 10); rank=1..9; distinct_ranks=1..9 (median 4).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 111, "median": 33.0, "min": 5}, "input_format": ["N\ncard_1 ... card_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 37, "median": 11.0, "min": 2}}} -{"case_ids": ["p03803_case_000", "p03803_case_001", "p03803_case_002", "p03803_case_003", "p03803_case_004", "p03803_case_005", "p03803_case_006", "p03803_case_007", "p03803_case_008", "p03803_case_009", "p03803_case_010", "p03803_case_011", "p03803_case_012", "p03803_case_013", "p03803_case_014", "p03803_case_015", "p03803_case_016", "p03803_case_017", "p03803_case_018", "p03803_case_019", "p03803_case_020", "p03803_case_021", "p03803_case_022", "p03803_case_023", "p03803_case_024", "p03803_case_025", "p03803_case_026", "p03803_case_027", "p03803_case_028", "p03803_case_029", "p03803_case_030", "p03803_case_031", "p03803_case_032", "p03803_case_033", "p03803_case_034", "p03803_case_035", "p03803_case_036", "p03803_case_037", "p03803_case_038", "p03803_case_039", "p03803_case_040", "p03803_case_041", "p03803_case_042", "p03803_case_043", "p03803_case_044", "p03803_case_045", "p03803_case_046", "p03803_case_047", "p03803_case_048", "p03803_case_049", "p03803_case_050", "p03803_case_051", "p03803_case_052", "p03803_case_053", "p03803_case_054", "p03803_case_055", "p03803_case_056", "p03803_case_057", "p03803_case_058", "p03803_case_059", "p03803_case_060", "p03803_case_061", "p03803_case_062", "p03803_case_063", "p03803_case_064", "p03803_case_065", "p03803_case_066", "p03803_case_067", "p03803_case_068", "p03803_case_069", "p03803_case_070", "p03803_case_071", "p03803_case_072", "p03803_case_073", "p03803_case_074", "p03803_case_075", "p03803_case_076", "p03803_case_077", "p03803_case_078", "p03803_case_079", "p03803_case_080", "p03803_case_081", "p03803_case_082", "p03803_case_083", "p03803_case_084", "p03803_case_085", "p03803_case_086", "p03803_case_087", "p03803_case_088", "p03803_case_089", "p03803_case_090", "p03803_case_091", "p03803_case_092", "p03803_case_093", "p03803_case_094", "p03803_case_095", "p03803_case_096", "p03803_case_097", "p03803_case_098", "p03803_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "A, B = list(map(int, input().split()))\n\nif A == B:\n print(\"Draw\")\n\nelif A == 1 or B != 1 and A > B:\n print(\"Alice\")\n\nelse:\n print(\"Bob\")\n", "fast_code_sha256": "6d98fb7a581d9ec172cb808be4fb74123b45642ba14ca47f8b5e8a1727073d4d", "fast_id": "p03803_60a32b9f1c436de1ae00e0d41718126a4c2f969ad54056fca190134188e691f3", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "# AliceのスコアAとBobのスコアBを整数で入力\nA, B = list(map(int, input().split()))\n# AとBが同じならDrawを出力\nif A == B:\n print(\"Draw\")\n# Aが1か、Bが1でなく且つAがBより大きいならAliceを出力\nelif A == 1 or B != 1 and A > B:\n print(\"Alice\")\n# Bの方が強ければBobを出力\nelse:\n print(\"Bob\")\n", "measured_fast_code_sha256": "60a32b9f1c436de1ae00e0d41718126a4c2f969ad54056fca190134188e691f3", "measured_slow_code": "import sys, math\nfrom functools import lru_cache\nfrom itertools import accumulate\n\nsys.setrecursionlimit(10**9)\nMOD = 10**9 + 7\n\n\ndef input():\n return sys.stdin.readline()[:-1]\n\n\ndef mi():\n return list(map(int, input().split()))\n\n\ndef ii():\n return int(eval(input()))\n\n\ndef i2(n):\n tmp = [list(mi()) for i in range(n)]\n return [list(i) for i in zip(*tmp)]\n\n\nA, B = mi()\nif A == B:\n print(\"Draw\")\nelif A == 1:\n print(\"Alice\")\nelif B == 1:\n print(\"Bob\")\nelse:\n if A > B:\n print(\"Alice\")\n else:\n print(\"Bob\")\n", "measured_slow_code_sha256": "0bd5df2a157ba82c7c25ec618ddd2b8ac3a7b93747b5c4b4114a2cd42e8e257e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.1372253965413206, "pair_id": "python_v2_f663fc7926dcad3d3b843320", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03803", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03803_60a32b9f1c436de1ae00e0d41718126a4c2f969ad54056fca190134188e691f3.jsonl.gz", "inputs": "reproduction/python/inputs/p03803.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03803_0bd5df2a157ba82c7c25ec618ddd2b8ac3a7b93747b5c4b4114a2cd42e8e257e.jsonl.gz"}, "slow_code": "import sys, math\nfrom functools import lru_cache\nfrom itertools import accumulate\n\nsys.setrecursionlimit(10**9)\nMOD = 10**9 + 7\n\n\ndef input():\n return sys.stdin.readline()[:-1]\n\n\ndef mi():\n return list(map(int, input().split()))\n\n\ndef ii():\n return int(eval(input()))\n\n\ndef i2(n):\n tmp = [list(mi()) for i in range(n)]\n return [list(i) for i in zip(*tmp)]\n\n\nA, B = mi()\nif A == B:\n print(\"Draw\")\nelif A == 1:\n print(\"Alice\")\nelif B == 1:\n print(\"Bob\")\nelse:\n if A > B:\n print(\"Alice\")\n else:\n print(\"Bob\")\n", "slow_code_sha256": "0bd5df2a157ba82c7c25ec618ddd2b8ac3a7b93747b5c4b4114a2cd42e8e257e", "slow_id": "p03803_0bd5df2a157ba82c7c25ec618ddd2b8ac3a7b93747b5c4b4114a2cd42e8e257e", "speedup": 3.1385109948363903, "stratum": "2-4", "within_pair_jaccard": 0.3333333333333333, "workload": {"case_count": 100, "description": "Compare two card ranks A,B from 1..13. Rank 1 is strongest; the other ranks increase in strength from 2 through 13. Report the first player, second player, or a draw. Observed inputs: A=1..13 (median 6); B=1..13 (median 6.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 6, "median": 4.0, "min": 4}, "input_format": ["A B"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p00775_case_000", "p00775_case_001", "p00775_case_002", "p00775_case_003", "p00775_case_004", "p00775_case_005", "p00775_case_006", "p00775_case_007", "p00775_case_008", "p00775_case_009", "p00775_case_010", "p00775_case_011", "p00775_case_012", "p00775_case_013", "p00775_case_014", "p00775_case_015", "p00775_case_016", "p00775_case_017", "p00775_case_018", "p00775_case_019", "p00775_case_020", "p00775_case_021", "p00775_case_022", "p00775_case_023", "p00775_case_024", "p00775_case_025", "p00775_case_026", "p00775_case_027", "p00775_case_028", "p00775_case_029", "p00775_case_030", "p00775_case_031", "p00775_case_032", "p00775_case_033", "p00775_case_034", "p00775_case_035", "p00775_case_036", "p00775_case_037", "p00775_case_038", "p00775_case_039", "p00775_case_040", "p00775_case_041", "p00775_case_042", "p00775_case_043", "p00775_case_044", "p00775_case_045", "p00775_case_046", "p00775_case_047", "p00775_case_048", "p00775_case_049", "p00775_case_050", "p00775_case_051", "p00775_case_052", "p00775_case_053", "p00775_case_054", "p00775_case_055", "p00775_case_056", "p00775_case_057", "p00775_case_058", "p00775_case_059", "p00775_case_060", "p00775_case_061", "p00775_case_062", "p00775_case_063", "p00775_case_064", "p00775_case_065", "p00775_case_066", "p00775_case_067", "p00775_case_068", "p00775_case_069", "p00775_case_070", "p00775_case_071", "p00775_case_072", "p00775_case_073", "p00775_case_074", "p00775_case_075", "p00775_case_076", "p00775_case_077", "p00775_case_078", "p00775_case_079", "p00775_case_080", "p00775_case_081", "p00775_case_082", "p00775_case_083", "p00775_case_084", "p00775_case_085", "p00775_case_086", "p00775_case_087", "p00775_case_088", "p00775_case_089", "p00775_case_090", "p00775_case_091", "p00775_case_092", "p00775_case_093", "p00775_case_094", "p00775_case_095", "p00775_case_096", "p00775_case_097", "p00775_case_098", "p00775_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from math import sqrt\n\nwhile True:\n R, N = list(map(int, input().split()))\n if not (R | N):\n break\n geta = 20\n buildings = [0] * (geta * 2)\n for _ in range(N):\n xl, xr, h = list(map(int, input().split()))\n for i in range(xl + geta, xr + geta):\n buildings[i] = max(buildings[i], h)\n print(\n (\n min(\n buildings[i]\n - sqrt(R * R - (i - geta + (i < geta)) * (i - geta + (i < geta)))\n + R\n for i in range(-R + geta, R + geta)\n )\n )\n )\n", "fast_code_sha256": "d01a3b994ea420f84f1fec9d04b81e669100b8678a5fdca6b824945b066ea855", "fast_id": "p00775_d01a3b994ea420f84f1fec9d04b81e669100b8678a5fdca6b824945b066ea855", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from math import sqrt\n\nwhile True:\n R, N = list(map(int, input().split()))\n if not (R | N):\n break\n geta = 20\n buildings = [0] * (geta * 2)\n for _ in range(N):\n xl, xr, h = list(map(int, input().split()))\n for i in range(xl + geta, xr + geta):\n buildings[i] = max(buildings[i], h)\n print(\n (\n min(\n buildings[i]\n - sqrt(R * R - (i - geta + (i < geta)) * (i - geta + (i < geta)))\n + R\n for i in range(-R + geta, R + geta)\n )\n )\n )\n", "measured_fast_code_sha256": "d01a3b994ea420f84f1fec9d04b81e669100b8678a5fdca6b824945b066ea855", "measured_slow_code": "while True:\n R, N = list(map(int, input().split()))\n if not (R | N):\n break\n geta = 20\n buildings = [0] * (geta * 2)\n for _ in range(N):\n xl, xr, h = list(map(int, input().split()))\n for i in range(xl + geta, xr + geta):\n buildings[i] = max(buildings[i], h)\n sun = [0] * (geta * 2)\n for i in range(-R + geta, R + geta):\n if i < geta:\n buildings[i] -= pow(R * R - (i - geta + 1) * (i - geta + 1), 0.5) - R\n else:\n buildings[i] -= pow(R * R - (i - geta) * (i - geta), 0.5) - R\n left, right = 0, 20\n while right - left > 1e-4:\n mid = (left + right) / 2\n flag = True\n for i in range(-R + geta, R + geta):\n if i < geta:\n flag &= buildings[i] >= mid\n else:\n y = pow(R * R - (i - geta) * (i - geta), 0.5)\n flag &= buildings[i] >= mid\n if flag:\n left = mid\n else:\n right = mid\n print((\"{:.20f}\".format(left)))\n", "measured_slow_code_sha256": "8e02c59ca5af7184abc0b41186c69b5afed95dc9f0416b5d3e79c7e06f9ac494", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.597425441652452, "pair_id": "python_v2_7f852ddade038d66c42f79cd", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p00775", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p00775_d01a3b994ea420f84f1fec9d04b81e669100b8678a5fdca6b824945b066ea855.jsonl.gz", "inputs": "reproduction/python/inputs/p00775.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p00775_8e02c59ca5af7184abc0b41186c69b5afed95dc9f0416b5d3e79c7e06f9ac494.jsonl.gz"}, "slow_code": "while True:\n R, N = list(map(int, input().split()))\n if not (R | N):\n break\n geta = 20\n buildings = [0] * (geta * 2)\n for _ in range(N):\n xl, xr, h = list(map(int, input().split()))\n for i in range(xl + geta, xr + geta):\n buildings[i] = max(buildings[i], h)\n sun = [0] * (geta * 2)\n for i in range(-R + geta, R + geta):\n if i < geta:\n buildings[i] -= pow(R * R - (i - geta + 1) * (i - geta + 1), 0.5) - R\n else:\n buildings[i] -= pow(R * R - (i - geta) * (i - geta), 0.5) - R\n left, right = 0, 20\n while right - left > 1e-4:\n mid = (left + right) / 2\n flag = True\n for i in range(-R + geta, R + geta):\n if i < geta:\n flag &= buildings[i] >= mid\n else:\n y = pow(R * R - (i - geta) * (i - geta), 0.5)\n flag &= buildings[i] >= mid\n if flag:\n left = mid\n else:\n right = mid\n print((\"{:.20f}\".format(left)))\n", "slow_code_sha256": "8e02c59ca5af7184abc0b41186c69b5afed95dc9f0416b5d3e79c7e06f9ac494", "slow_id": "p00775_8e02c59ca5af7184abc0b41186c69b5afed95dc9f0416b5d3e79c7e06f9ac494", "speedup": 2.7475593125652935, "stratum": "2-4", "within_pair_jaccard": 0.5869565217391305, "workload": {"case_count": 100, "description": "For each dataset, find the last t>=0 when the radius-r disk centered at (0,t-r) is entirely covered by n building rectangles [xl_i,xr_i]x[0,h_i] together with y<=0. Rectangles may overlap or touch. A final 0 0 ends input. Observed inputs: datasets=1..5 (median 1); r=1..20; n=0..20; total_rectangles=0..92 (median 16.5); xl_i=-20..19; xr_i=-19..20; h_i=1..20.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 806, "median": 156.5, "min": 8}, "input_format": ["r_1 n_1\n[n_1 lines: xl_i xr_i h_i]\n[next datasets]\n0 0"], "input_format_status": "source_input_section", "input_lines": {"max": 98, "median": 20.5, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 288, "median": 56.0, "min": 4}}} -{"case_ids": ["p02418_case_000", "p02418_case_001", "p02418_case_002", "p02418_case_003", "p02418_case_004", "p02418_case_005", "p02418_case_006", "p02418_case_007", "p02418_case_008", "p02418_case_009", "p02418_case_010", "p02418_case_011", "p02418_case_012", "p02418_case_013", "p02418_case_014", "p02418_case_015", "p02418_case_016", "p02418_case_017", "p02418_case_018", "p02418_case_019", "p02418_case_020", "p02418_case_021", "p02418_case_022", "p02418_case_023", "p02418_case_024", "p02418_case_025", "p02418_case_026", "p02418_case_027", "p02418_case_028", "p02418_case_029", "p02418_case_030", "p02418_case_031", "p02418_case_032", "p02418_case_033", "p02418_case_034", "p02418_case_035", "p02418_case_036", "p02418_case_037", "p02418_case_038", "p02418_case_039", "p02418_case_040", "p02418_case_041", "p02418_case_042", "p02418_case_043", "p02418_case_044", "p02418_case_045", "p02418_case_046", "p02418_case_047", "p02418_case_048", "p02418_case_049", "p02418_case_050", "p02418_case_051", "p02418_case_052", "p02418_case_053", "p02418_case_054", "p02418_case_055", "p02418_case_056", "p02418_case_057", "p02418_case_058", "p02418_case_059", "p02418_case_060", "p02418_case_061", "p02418_case_062", "p02418_case_063", "p02418_case_064", "p02418_case_065", "p02418_case_066", "p02418_case_067", "p02418_case_068", "p02418_case_069", "p02418_case_070", "p02418_case_071", "p02418_case_072", "p02418_case_073", "p02418_case_074", "p02418_case_075", "p02418_case_076", "p02418_case_077", "p02418_case_078", "p02418_case_079", "p02418_case_080", "p02418_case_081", "p02418_case_082", "p02418_case_083", "p02418_case_084", "p02418_case_085", "p02418_case_086", "p02418_case_087", "p02418_case_088", "p02418_case_089", "p02418_case_090", "p02418_case_091", "p02418_case_092", "p02418_case_093", "p02418_case_094", "p02418_case_095", "p02418_case_096", "p02418_case_097", "p02418_case_098", "p02418_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "executable_AST_equal_except_explicit_explanatory_string_removal_and_all_frozen_inputs_checker_pass", "fast_code": "ring = input() * 2\nword = input()\nif ring.find(word) != -1:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "fast_code_sha256": "4038bcef7f71e4bcbad1ce3a74a10cdc90a93fcdef292e18cbaf676738ce8578", "fast_id": "p02418_4038bcef7f71e4bcbad1ce3a74a10cdc90a93fcdef292e18cbaf676738ce8578", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "ring = input() * 2\nword = input()\nif ring.find(word) != -1:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "measured_fast_code_sha256": "4038bcef7f71e4bcbad1ce3a74a10cdc90a93fcdef292e18cbaf676738ce8578", "measured_slow_code": "# -*- coding: utf-8 -*-\n\"\"\"\nhttp://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_8_D&lang=jp\n\"\"\"\nimport sys\nfrom sys import stdin\n\ninput = stdin.readline\n\n\ndef main(args):\n s = input().strip()\n p = input().strip()\n s = s + s[:-1]\n if p in s:\n print(\"Yes\")\n else:\n print(\"No\")\n\n\nif __name__ == \"__main__\":\n main(sys.argv[1:])\n", "measured_slow_code_sha256": "4a465a7c40e8301396e930b29aaf192efcb0d409e3d2d3b58e59d606c0aba5fa", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.0849051746656135, "pair_id": "python_v2_e14667c88c80d764091720d7", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02418", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02418_4038bcef7f71e4bcbad1ce3a74a10cdc90a93fcdef292e18cbaf676738ce8578.jsonl.gz", "inputs": "reproduction/python/inputs/p02418.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02418_4a465a7c40e8301396e930b29aaf192efcb0d409e3d2d3b58e59d606c0aba5fa.jsonl.gz"}, "slow_code": "import sys\nfrom sys import stdin\n\ninput = stdin.readline\n\n\ndef main(args):\n s = input().strip()\n p = input().strip()\n s = s + s[:-1]\n if p in s:\n print(\"Yes\")\n else:\n print(\"No\")\n\n\nif __name__ == \"__main__\":\n main(sys.argv[1:])\n", "slow_code_sha256": "a7502251daa34c9d1f4077de1ba0b7e4db196550bc7d1d061290578a54373e1c", "slow_id": "p02418_4a465a7c40e8301396e930b29aaf192efcb0d409e3d2d3b58e59d606c0aba5fa", "speedup": 2.084100151836687, "stratum": "2-4", "within_pair_jaccard": 0.25925925925925924, "workload": {"case_count": 100, "description": "Decide whether lowercase pattern p appears contiguously in circular text s, allowing a match to cross the end-to-start boundary. The pattern is nonempty and no longer than the ring text. Observed inputs: s_length=1..100 (median 50); p_length=1..100 (median 15).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 202, "median": 89.5, "min": 4}, "input_format": ["s\np"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p02883_case_000", "p02883_case_001", "p02883_case_002", "p02883_case_003", "p02883_case_004", "p02883_case_005", "p02883_case_006", "p02883_case_007", "p02883_case_008", "p02883_case_009", "p02883_case_010", "p02883_case_011", "p02883_case_012", "p02883_case_013", "p02883_case_014", "p02883_case_015", "p02883_case_016", "p02883_case_017", "p02883_case_018", "p02883_case_019", "p02883_case_020", "p02883_case_021", "p02883_case_022", "p02883_case_023", "p02883_case_024", "p02883_case_025", "p02883_case_026", "p02883_case_027", "p02883_case_028", "p02883_case_029", "p02883_case_030", "p02883_case_031", "p02883_case_032", "p02883_case_033", "p02883_case_034", "p02883_case_035", "p02883_case_036", "p02883_case_037", "p02883_case_038", "p02883_case_039", "p02883_case_040", "p02883_case_041", "p02883_case_042", "p02883_case_043", "p02883_case_044", "p02883_case_045", "p02883_case_046", "p02883_case_047", "p02883_case_048", "p02883_case_049", "p02883_case_050", "p02883_case_051", "p02883_case_052", "p02883_case_053", "p02883_case_054", "p02883_case_055", "p02883_case_056", "p02883_case_057", "p02883_case_058", "p02883_case_059", "p02883_case_060", "p02883_case_061", "p02883_case_062", "p02883_case_063", "p02883_case_064", "p02883_case_065", "p02883_case_066", "p02883_case_067", "p02883_case_068", "p02883_case_069", "p02883_case_070", "p02883_case_071", "p02883_case_072", "p02883_case_073", "p02883_case_074", "p02883_case_075", "p02883_case_076", "p02883_case_077", "p02883_case_078", "p02883_case_079", "p02883_case_080", "p02883_case_081", "p02883_case_082", "p02883_case_083", "p02883_case_084", "p02883_case_085", "p02883_case_086", "p02883_case_087", "p02883_case_088", "p02883_case_089", "p02883_case_090", "p02883_case_091", "p02883_case_092", "p02883_case_093", "p02883_case_094", "p02883_case_095", "p02883_case_096", "p02883_case_097", "p02883_case_098", "p02883_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "executable_AST_equal_except_explicit_explanatory_string_removal_and_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\nread = sys.stdin.read\nreadline = sys.stdin.readline\nreadlines = sys.stdin.readlines\nsys.setrecursionlimit(10**9)\nINF = 1 << 60\nMOD = 1000000007\n\n\ndef main():\n N, K, *AF = list(map(int, read().split()))\n A = AF[:N]\n F = AF[N:]\n A.sort()\n F.sort(reverse=True)\n C = [a * f for a, f in zip(A, F)]\n\n def is_ok(cost):\n k = 0\n for c, f in zip(C, F):\n if c > cost:\n k += (c - cost + f - 1) // f\n return k <= K\n\n ok = max(C)\n ng = -1\n while ok - ng > 1:\n mid = (ok + ng) // 2\n if is_ok(mid):\n ok = mid\n else:\n ng = mid\n print(ok)\n return\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "78e07429bd6b18a24bb9452bffb214fae3238ca75d7395c732e7197d41429249", "fast_id": "p02883_78e07429bd6b18a24bb9452bffb214fae3238ca75d7395c732e7197d41429249", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\nread = sys.stdin.read\nreadline = sys.stdin.readline\nreadlines = sys.stdin.readlines\nsys.setrecursionlimit(10**9)\nINF = 1 << 60\nMOD = 1000000007\n\n\ndef main():\n N, K, *AF = list(map(int, read().split()))\n A = AF[:N]\n F = AF[N:]\n A.sort()\n F.sort(reverse=True)\n C = [a * f for a, f in zip(A, F)]\n\n def is_ok(cost):\n k = 0\n for c, f in zip(C, F):\n if c > cost:\n k += (c - cost + f - 1) // f\n return k <= K\n\n ok = max(C)\n ng = -1\n while ok - ng > 1:\n mid = (ok + ng) // 2\n if is_ok(mid):\n ok = mid\n else:\n ng = mid\n print(ok)\n return\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "78e07429bd6b18a24bb9452bffb214fae3238ca75d7395c732e7197d41429249", "measured_slow_code": "# -*- coding: utf-8 -*-\nimport sys\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef list2d(a, b, c):\n return [[c] * b for i in range(a)]\n\n\ndef list3d(a, b, c, d):\n return [[[d] * c for j in range(b)] for i in range(a)]\n\n\ndef list4d(a, b, c, d, e):\n return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]\n\n\ndef ceil(x, y=1):\n return int(-(-x // y))\n\n\ndef INT():\n return int(eval(input()))\n\n\ndef MAP():\n return list(map(int, input().split()))\n\n\ndef LIST(N=None):\n return list(MAP()) if N is None else [INT() for i in range(N)]\n\n\ndef Yes():\n print(\"Yes\")\n\n\ndef No():\n print(\"No\")\n\n\ndef YES():\n print(\"YES\")\n\n\ndef NO():\n print(\"NO\")\n\n\nsys.setrecursionlimit(10**7)\nINF = 10**18\nMOD = 10**9 + 7\n\n\ndef bisearch_min(mn, mx, func):\n \"\"\"条件を満たす最小値を見つける二分探索\"\"\"\n ok = mx\n ng = mn\n while ng + 1 < ok:\n mid = (ok + ng) // 2\n if func(mid):\n # 下を探しに行く\n ok = mid\n else:\n # 上を探しに行く\n ng = mid\n return ok\n\n\nN, K = MAP()\nA = LIST()\nB = LIST()\nA.sort(reverse=True)\nB.sort()\n\n\ndef check(m):\n k = 0\n for i, a in enumerate(A):\n b = B[i]\n k += max(ceil(a - m / b), 0)\n if k > K:\n return False\n return True\n\n\nprint((bisearch_min(-1, 10**12, check)))\n", "measured_slow_code_sha256": "4f4a13e5333f347bf2d2991652e312f399d355fb41776c7913ab6a96ff5161f3", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.6155345313572713, "pair_id": "python_v2_f74a6c4931783bd51046f77c", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02883", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02883_78e07429bd6b18a24bb9452bffb214fae3238ca75d7395c732e7197d41429249.jsonl.gz", "inputs": "reproduction/python/inputs/p02883.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02883_4f4a13e5333f347bf2d2991652e312f399d355fb41776c7913ab6a96ff5161f3.jsonl.gz"}, "slow_code": "import sys\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef list2d(a, b, c):\n return [[c] * b for i in range(a)]\n\n\ndef list3d(a, b, c, d):\n return [[[d] * c for j in range(b)] for i in range(a)]\n\n\ndef list4d(a, b, c, d, e):\n return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]\n\n\ndef ceil(x, y=1):\n return int(-(-x // y))\n\n\ndef INT():\n return int(eval(input()))\n\n\ndef MAP():\n return list(map(int, input().split()))\n\n\ndef LIST(N=None):\n return list(MAP()) if N is None else [INT() for i in range(N)]\n\n\ndef Yes():\n print(\"Yes\")\n\n\ndef No():\n print(\"No\")\n\n\ndef YES():\n print(\"YES\")\n\n\ndef NO():\n print(\"NO\")\n\n\nsys.setrecursionlimit(10**7)\nINF = 10**18\nMOD = 10**9 + 7\n\n\ndef bisearch_min(mn, mx, func):\n ok = mx\n ng = mn\n while ng + 1 < ok:\n mid = (ok + ng) // 2\n if func(mid):\n\n ok = mid\n else:\n\n ng = mid\n return ok\n\n\nN, K = MAP()\nA = LIST()\nB = LIST()\nA.sort(reverse=True)\nB.sort()\n\n\ndef check(m):\n k = 0\n for i, a in enumerate(A):\n b = B[i]\n k += max(ceil(a - m / b), 0)\n if k > K:\n return False\n return True\n\n\nprint((bisearch_min(-1, 10**12, check)))\n", "slow_code_sha256": "3224e00a1ef11e1951254ca5848501fa156f61f500db82b6b9576730d7e3e2af", "slow_id": "p02883_4f4a13e5333f347bf2d2991652e312f399d355fb41776c7913ab6a96ff5161f3", "speedup": 3.1866830643098107, "stratum": "2-4", "within_pair_jaccard": 0.41379310344827586, "workload": {"case_count": 100, "description": "Assign N people bijectively to N foods to minimize the longest finishing time. Person i has coefficient A_i; food j takes A_i*F_j time. At most K training steps may each reduce a coefficient by 1, never below zero. Observed inputs: N=1..200000 (median 10); K=0..1000000000000000000; A_i=1..1000000; F_i=1..1000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 3200027, "median": 147.0, "min": 8}, "input_format": ["N K\nA_1 ... A_N\nF_1 ... F_N"], "input_format_status": "source_input_section", "input_lines": {"max": 3, "median": 3.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 400002, "median": 22.0, "min": 4}}} -{"case_ids": ["p02792_case_000", "p02792_case_001", "p02792_case_002", "p02792_case_003", "p02792_case_004", "p02792_case_005", "p02792_case_006", "p02792_case_007", "p02792_case_008", "p02792_case_009", "p02792_case_010", "p02792_case_011", "p02792_case_012", "p02792_case_013", "p02792_case_014", "p02792_case_015", "p02792_case_016", "p02792_case_017", "p02792_case_018", "p02792_case_019", "p02792_case_020", "p02792_case_021", "p02792_case_022", "p02792_case_023", "p02792_case_024", "p02792_case_025", "p02792_case_026", "p02792_case_027", "p02792_case_028", "p02792_case_029", "p02792_case_030", "p02792_case_031", "p02792_case_032", "p02792_case_033", "p02792_case_034", "p02792_case_035", "p02792_case_036", "p02792_case_037", "p02792_case_038", "p02792_case_039", "p02792_case_040", "p02792_case_041", "p02792_case_042", "p02792_case_043", "p02792_case_044", "p02792_case_045", "p02792_case_046", "p02792_case_047", "p02792_case_048", "p02792_case_049", "p02792_case_050", "p02792_case_051", "p02792_case_052", "p02792_case_053", "p02792_case_054", "p02792_case_055", "p02792_case_056", "p02792_case_057", "p02792_case_058", "p02792_case_059", "p02792_case_060", "p02792_case_061", "p02792_case_062", "p02792_case_063", "p02792_case_064", "p02792_case_065", "p02792_case_066", "p02792_case_067", "p02792_case_068", "p02792_case_069", "p02792_case_070", "p02792_case_071", "p02792_case_072", "p02792_case_073", "p02792_case_074", "p02792_case_075", "p02792_case_076", "p02792_case_077", "p02792_case_078", "p02792_case_079", "p02792_case_080", "p02792_case_081", "p02792_case_082", "p02792_case_083", "p02792_case_084", "p02792_case_085", "p02792_case_086", "p02792_case_087", "p02792_case_088", "p02792_case_089", "p02792_case_090", "p02792_case_091", "p02792_case_092", "p02792_case_093", "p02792_case_094", "p02792_case_095", "p02792_case_096", "p02792_case_097", "p02792_case_098", "p02792_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\nC = [[0] * 10 for _ in range(10)]\nfor i in range(1, n + 1):\n C[int(str(i)[0])][i % 10] += 1\nans = 0\nfor i in range(10):\n for j in range(10):\n ans += C[i][j] * C[j][i]\nprint(ans)\n", "fast_code_sha256": "f12ae9ee0fe0a21a9752eb3c25a2c761603a290e082735bb14fdd097acf25026", "fast_id": "p02792_f12ae9ee0fe0a21a9752eb3c25a2c761603a290e082735bb14fdd097acf25026", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\nC = [[0] * 10 for _ in range(10)]\nfor i in range(1, n + 1):\n C[int(str(i)[0])][i % 10] += 1\nans = 0\nfor i in range(10):\n for j in range(10):\n ans += C[i][j] * C[j][i]\nprint(ans)\n", "measured_fast_code_sha256": "f12ae9ee0fe0a21a9752eb3c25a2c761603a290e082735bb14fdd097acf25026", "measured_slow_code": "N = int(eval(input()))\ndigit = len(str(N))\nans = 0\nfor a in range(1, 10):\n for b in range(1, 10):\n x, y = 0, 0\n if a == b:\n if a <= N:\n x += 1\n y += 1\n if a * 10 + b <= N:\n x += 1\n if b * 10 + a <= N:\n y += 1\n if digit <= 2:\n ans += x * y\n continue\n d = 3\n while d < digit:\n x += 10 ** (d - 2)\n y += 10 ** (d - 2)\n d += 1\n for i in range(10 ** (digit - 2)):\n if int(str(a) + str(i).zfill(digit - 2) + str(b)) <= N:\n x += 1\n if int(str(b) + str(i).zfill(digit - 2) + str(a)) <= N:\n y += 1\n ans += x * y\nprint(ans)\n", "measured_slow_code_sha256": "2e02d2845efb9f787514b31c173a608442fd55765532739847b63fd3580a333f", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.566661227670852, "pair_id": "python_v2_07771db843ac37acf004debb", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02792", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02792_f12ae9ee0fe0a21a9752eb3c25a2c761603a290e082735bb14fdd097acf25026.jsonl.gz", "inputs": "reproduction/python/inputs/p02792.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02792_2e02d2845efb9f787514b31c173a608442fd55765532739847b63fd3580a333f.jsonl.gz"}, "slow_code": "N = int(eval(input()))\ndigit = len(str(N))\nans = 0\nfor a in range(1, 10):\n for b in range(1, 10):\n x, y = 0, 0\n if a == b:\n if a <= N:\n x += 1\n y += 1\n if a * 10 + b <= N:\n x += 1\n if b * 10 + a <= N:\n y += 1\n if digit <= 2:\n ans += x * y\n continue\n d = 3\n while d < digit:\n x += 10 ** (d - 2)\n y += 10 ** (d - 2)\n d += 1\n for i in range(10 ** (digit - 2)):\n if int(str(a) + str(i).zfill(digit - 2) + str(b)) <= N:\n x += 1\n if int(str(b) + str(i).zfill(digit - 2) + str(a)) <= N:\n y += 1\n ans += x * y\nprint(ans)\n", "slow_code_sha256": "2e02d2845efb9f787514b31c173a608442fd55765532739847b63fd3580a333f", "slow_id": "p02792_2e02d2845efb9f787514b31c173a608442fd55765532739847b63fd3580a333f", "speedup": 4.435938492572608, "stratum": "4-8", "within_pair_jaccard": 0.41935483870967744, "workload": {"case_count": 100, "description": "Count ordered pairs of positive integers (A,B), each at most N, whose decimal first and last digits are reversed between A and B. Leading zeros are not used. Observed inputs: N=1..200000 (median 106.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 7, "median": 4.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p02934_case_000", "p02934_case_001", "p02934_case_002", "p02934_case_003", "p02934_case_004", "p02934_case_005", "p02934_case_006", "p02934_case_007", "p02934_case_008", "p02934_case_009", "p02934_case_010", "p02934_case_011", "p02934_case_012", "p02934_case_013", "p02934_case_014", "p02934_case_015", "p02934_case_016", "p02934_case_017", "p02934_case_018", "p02934_case_019", "p02934_case_020", "p02934_case_021", "p02934_case_022", "p02934_case_023", "p02934_case_024", "p02934_case_025", "p02934_case_026", "p02934_case_027", "p02934_case_028", "p02934_case_029", "p02934_case_030", "p02934_case_031", "p02934_case_032", "p02934_case_033", "p02934_case_034", "p02934_case_035", "p02934_case_036", "p02934_case_037", "p02934_case_038", "p02934_case_039", "p02934_case_040", "p02934_case_041", "p02934_case_042", "p02934_case_043", "p02934_case_044", "p02934_case_045", "p02934_case_046", "p02934_case_047", "p02934_case_048", "p02934_case_049", "p02934_case_050", "p02934_case_051", "p02934_case_052", "p02934_case_053", "p02934_case_054", "p02934_case_055", "p02934_case_056", "p02934_case_057", "p02934_case_058", "p02934_case_059", "p02934_case_060", "p02934_case_061", "p02934_case_062", "p02934_case_063", "p02934_case_064", "p02934_case_065", "p02934_case_066", "p02934_case_067", "p02934_case_068", "p02934_case_069", "p02934_case_070", "p02934_case_071", "p02934_case_072", "p02934_case_073", "p02934_case_074", "p02934_case_075", "p02934_case_076", "p02934_case_077", "p02934_case_078", "p02934_case_079", "p02934_case_080", "p02934_case_081", "p02934_case_082", "p02934_case_083", "p02934_case_084", "p02934_case_085", "p02934_case_086", "p02934_case_087", "p02934_case_088", "p02934_case_089", "p02934_case_090", "p02934_case_091", "p02934_case_092", "p02934_case_093", "p02934_case_094", "p02934_case_095", "p02934_case_096", "p02934_case_097", "p02934_case_098", "p02934_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from functools import reduce\n\neval(input())\na = [int(i) for i in input().split()]\nprint((1 / reduce(lambda x, y: x + 1 / y, [0] + a)))\n", "fast_code_sha256": "a75a9a87acf5a5f6a58790db00e966d1036a519dbf1387b78da30d5ab2b9434f", "fast_id": "p02934_a75a9a87acf5a5f6a58790db00e966d1036a519dbf1387b78da30d5ab2b9434f", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from functools import reduce\n\neval(input())\na = [int(i) for i in input().split()]\nprint((1 / reduce(lambda x, y: x + 1 / y, [0] + a)))\n", "measured_fast_code_sha256": "a75a9a87acf5a5f6a58790db00e966d1036a519dbf1387b78da30d5ab2b9434f", "measured_slow_code": "n = int(eval(input()))\nlist = list(map(int, input().split()))\nproduct_list = [1] * n\nfor i in range(len(list)):\n for j in range(len(list)):\n if i != j:\n product_list[i] *= list[j]\nproduct_sum = 0\nfor i in range(len(list)):\n product_sum += product_list[i]\ntotal_product = product_list[0] * list[0]\nprint((total_product / product_sum))\n", "measured_slow_code_sha256": "085acbea4b5df909b4c8404a10101cc5523564869b3b17a29531909ce9117992", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 12.119770566863703, "pair_id": "python_v2_f835e91f81a3463295874816", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02934", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02934_a75a9a87acf5a5f6a58790db00e966d1036a519dbf1387b78da30d5ab2b9434f.jsonl.gz", "inputs": "reproduction/python/inputs/p02934.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02934_085acbea4b5df909b4c8404a10101cc5523564869b3b17a29531909ce9117992.jsonl.gz"}, "slow_code": "n = int(eval(input()))\nlist = list(map(int, input().split()))\nproduct_list = [1] * n\nfor i in range(len(list)):\n for j in range(len(list)):\n if i != j:\n product_list[i] *= list[j]\nproduct_sum = 0\nfor i in range(len(list)):\n product_sum += product_list[i]\ntotal_product = product_list[0] * list[0]\nprint((total_product / product_sum))\n", "slow_code_sha256": "085acbea4b5df909b4c8404a10101cc5523564869b3b17a29531909ce9117992", "slow_id": "p02934_085acbea4b5df909b4c8404a10101cc5523564869b3b17a29531909ce9117992", "speedup": 7.567007537986467, "stratum": "4-8", "within_pair_jaccard": 0.35714285714285715, "workload": {"case_count": 100, "description": "Compute the reciprocal of the sum of reciprocals of N positive input integers A_i, as a real number. Observed inputs: N=1..100 (median 50); A_i=1..1000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 504, "median": 114.0, "min": 4}, "input_format": ["N\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 101, "median": 51.0, "min": 2}}} -{"case_ids": ["p03025_case_000", "p03025_case_001", "p03025_case_002", "p03025_case_003", "p03025_case_004", "p03025_case_005", "p03025_case_006", "p03025_case_007", "p03025_case_008", "p03025_case_009", "p03025_case_010", "p03025_case_011", "p03025_case_012", "p03025_case_013", "p03025_case_014", "p03025_case_015", "p03025_case_016", "p03025_case_017", "p03025_case_018", "p03025_case_019", "p03025_case_020", "p03025_case_021", "p03025_case_022", "p03025_case_023", "p03025_case_024", "p03025_case_025", "p03025_case_026", "p03025_case_027", "p03025_case_028", "p03025_case_029", "p03025_case_030", "p03025_case_031", "p03025_case_032", "p03025_case_033", "p03025_case_034", "p03025_case_035", "p03025_case_036", "p03025_case_037", "p03025_case_038", "p03025_case_039", "p03025_case_040", "p03025_case_041", "p03025_case_042", "p03025_case_043", "p03025_case_044", "p03025_case_045", "p03025_case_046", "p03025_case_047", "p03025_case_048", "p03025_case_049", "p03025_case_050", "p03025_case_051", "p03025_case_052", "p03025_case_053", "p03025_case_054", "p03025_case_055", "p03025_case_056", "p03025_case_057", "p03025_case_058", "p03025_case_059", "p03025_case_060", "p03025_case_061", "p03025_case_062", "p03025_case_063", "p03025_case_064", "p03025_case_065", "p03025_case_066", "p03025_case_067", "p03025_case_068", "p03025_case_069", "p03025_case_070", "p03025_case_071", "p03025_case_072", "p03025_case_073", "p03025_case_074", "p03025_case_075", "p03025_case_076", "p03025_case_077", "p03025_case_078", "p03025_case_079", "p03025_case_080", "p03025_case_081", "p03025_case_082", "p03025_case_083", "p03025_case_084", "p03025_case_085", "p03025_case_086", "p03025_case_087", "p03025_case_088", "p03025_case_089", "p03025_case_090", "p03025_case_091", "p03025_case_092", "p03025_case_093", "p03025_case_094", "p03025_case_095", "p03025_case_096", "p03025_case_097", "p03025_case_098", "p03025_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "executable_AST_equal_except_explicit_explanatory_string_removal_and_all_frozen_inputs_checker_pass", "fast_code": "class Combination:\n\n def __init__(self, n, MOD):\n self.fact = [1]\n for i in range(1, n + 1):\n self.fact.append(self.fact[-1] * i % MOD)\n self.inv_fact = [pow(self.fact[i], MOD - 2, MOD) for i in range(n + 1)]\n self.MOD = MOD\n\n def factorial(self, k):\n return self.fact[k]\n\n def inverse_factorial(self, k):\n return self.inv_fact[k]\n\n def combination(self, k, r):\n return (self.fact[k] * self.inv_fact[k - r] * self.inv_fact[r]) % self.MOD\n\n\nfrom fractions import Fraction\n\nMOD = 10**9 + 7\nn, a, b, c = list(map(int, input().split()))\n\ncomb = Combination(2 * n, MOD)\nmod_li = [1]\nfor i in range(1, 2 * n + 1):\n mod_li.append(mod_li[-1] * (a + b) % MOD)\np1 = [1]\np2 = [1]\nfor i in range(1, n + 1):\n p1.append((p1[-1] * a) % MOD)\n p2.append((p2[-1] * b) % MOD)\nq = mod_li[2 * n - 1]\np = 0\nfor i in range(n):\n tmp_bunshi = (\n (n + i) * (mod_li[n - i - 1]) * p1[n] * p2[i] * comb.combination(n - 1 + i, i)\n )\n tmp_bunshi += (\n (n + i) * (mod_li[n - i - 1]) * p2[n] * p1[i] * comb.combination(n - 1 + i, i)\n )\n p += tmp_bunshi\n p %= MOD\np *= 100\nq *= a + b\nans = Fraction(p, q)\np = ans.numerator\nq = ans.denominator\nprint(((pow(q, MOD - 2, MOD) * p) % MOD))\n", "fast_code_sha256": "70ddd5f840b4cf045630f383c5a4dc0b67936d1255ea8e844b2833042d45ffc1", "fast_id": "p03025_afdc02d7fb2abeb1970c2a5c2791e7792fd3f3e6fc1ceb09e19fccefdfb05385", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "# Combinationクラス\nclass Combination:\n \"\"\"\n 計算量:階乗・逆元テーブルの作成O(N)\n nCkを求めるO(1)\n \"\"\"\n\n def __init__(self, n, MOD):\n self.fact = [1]\n for i in range(1, n + 1):\n self.fact.append(self.fact[-1] * i % MOD)\n self.inv_fact = [pow(self.fact[i], MOD - 2, MOD) for i in range(n + 1)]\n self.MOD = MOD\n\n def factorial(self, k):\n \"\"\"k!を求める\"\"\"\n return self.fact[k]\n\n def inverse_factorial(self, k):\n \"\"\"k!の逆元を求める\"\"\"\n return self.inv_fact[k]\n\n def combination(self, k, r):\n \"\"\"kCrを求める\"\"\"\n return (self.fact[k] * self.inv_fact[k - r] * self.inv_fact[r]) % self.MOD\n\n\nfrom fractions import Fraction\n\nMOD = 10**9 + 7\nn, a, b, c = list(map(int, input().split()))\n# n-1から2n-2まで\ncomb = Combination(2 * n, MOD)\nmod_li = [1]\nfor i in range(1, 2 * n + 1):\n mod_li.append(mod_li[-1] * (a + b) % MOD)\np1 = [1]\np2 = [1]\nfor i in range(1, n + 1):\n p1.append((p1[-1] * a) % MOD)\n p2.append((p2[-1] * b) % MOD)\nq = mod_li[2 * n - 1]\np = 0\nfor i in range(n):\n tmp_bunshi = (\n (n + i) * (mod_li[n - i - 1]) * p1[n] * p2[i] * comb.combination(n - 1 + i, i)\n )\n tmp_bunshi += (\n (n + i) * (mod_li[n - i - 1]) * p2[n] * p1[i] * comb.combination(n - 1 + i, i)\n )\n p += tmp_bunshi\n p %= MOD\np *= 100\nq *= a + b\nans = Fraction(p, q)\np = ans.numerator\nq = ans.denominator\nprint(((pow(q, MOD - 2, MOD) * p) % MOD))\n", "measured_fast_code_sha256": "afdc02d7fb2abeb1970c2a5c2791e7792fd3f3e6fc1ceb09e19fccefdfb05385", "measured_slow_code": "class Combination:\n \"\"\"階乗とその逆元のテーブルをO(N)で事前作成し、組み合わせの計算をO(1)で行う\"\"\"\n\n def __init__(self, n, MOD):\n self.fact = [1]\n for i in range(1, n + 1):\n self.fact.append(self.fact[-1] * i % MOD)\n self.inv_fact = [0] * (n + 1)\n self.inv_fact[n] = pow(self.fact[n], MOD - 2, MOD)\n for i in reversed(list(range(n))):\n self.inv_fact[i] = self.inv_fact[i + 1] * (i + 1) % MOD\n self.MOD = MOD\n\n def factorial(self, k):\n \"\"\"k!を求める O(1)\"\"\"\n return self.fact[k]\n\n def inverse_factorial(self, k):\n \"\"\"k!の逆元を求める O(1)\"\"\"\n return self.inv_fact[k]\n\n def permutation(self, k, r):\n \"\"\"kPrを求める O(1)\"\"\"\n if k < r:\n return 0\n return (self.fact[k] * self.inv_fact[k - r]) % self.MOD\n\n def combination(self, k, r):\n \"\"\"kCrを求める O(1)\"\"\"\n if k < r:\n return 0\n return (self.fact[k] * self.inv_fact[k - r] * self.inv_fact[r]) % self.MOD\n\n\nn, a, b, c = list(map(int, input().split()))\nMOD = 10**9 + 7\ncomb = Combination(10**6, MOD)\npa = a * pow(a + b, MOD - 2, MOD) % MOD\npb = b * pow(a + b, MOD - 2, MOD) % MOD\nec = 100 * pow(100 - c, MOD - 2, MOD) % MOD\nans1 = 0\ntmp = pow(pa, n, MOD)\nfor i in range(n):\n ans1 += tmp * pow(pb, i, MOD) * comb.combination(n - 1 + i, i) * (n + i) * ec\n ans1 %= MOD\nans2 = 0\ntmp = pow(pb, n, MOD)\nfor i in range(n):\n ans2 += tmp * pow(pa, i, MOD) * comb.combination(n - 1 + i, i) * (n + i) * ec\n ans2 %= MOD\nprint(((ans1 + ans2) % MOD))\n", "measured_slow_code_sha256": "1a12b8ea879f96b088964b1f0aad1794bc8494b3705ba8644097e802ebbf8368", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.558735935914441, "pair_id": "python_v2_a7a5514f12f513764a85d1ea", "per_case_slow_code_faster_fraction": 0.15, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03025", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03025_afdc02d7fb2abeb1970c2a5c2791e7792fd3f3e6fc1ceb09e19fccefdfb05385.jsonl.gz", "inputs": "reproduction/python/inputs/p03025.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03025_1a12b8ea879f96b088964b1f0aad1794bc8494b3705ba8644097e802ebbf8368.jsonl.gz"}, "slow_code": "class Combination:\n\n def __init__(self, n, MOD):\n self.fact = [1]\n for i in range(1, n + 1):\n self.fact.append(self.fact[-1] * i % MOD)\n self.inv_fact = [0] * (n + 1)\n self.inv_fact[n] = pow(self.fact[n], MOD - 2, MOD)\n for i in reversed(list(range(n))):\n self.inv_fact[i] = self.inv_fact[i + 1] * (i + 1) % MOD\n self.MOD = MOD\n\n def factorial(self, k):\n return self.fact[k]\n\n def inverse_factorial(self, k):\n return self.inv_fact[k]\n\n def permutation(self, k, r):\n if k < r:\n return 0\n return (self.fact[k] * self.inv_fact[k - r]) % self.MOD\n\n def combination(self, k, r):\n if k < r:\n return 0\n return (self.fact[k] * self.inv_fact[k - r] * self.inv_fact[r]) % self.MOD\n\n\nn, a, b, c = list(map(int, input().split()))\nMOD = 10**9 + 7\ncomb = Combination(10**6, MOD)\npa = a * pow(a + b, MOD - 2, MOD) % MOD\npb = b * pow(a + b, MOD - 2, MOD) % MOD\nec = 100 * pow(100 - c, MOD - 2, MOD) % MOD\nans1 = 0\ntmp = pow(pa, n, MOD)\nfor i in range(n):\n ans1 += tmp * pow(pb, i, MOD) * comb.combination(n - 1 + i, i) * (n + i) * ec\n ans1 %= MOD\nans2 = 0\ntmp = pow(pb, n, MOD)\nfor i in range(n):\n ans2 += tmp * pow(pa, i, MOD) * comb.combination(n - 1 + i, i) * (n + i) * ec\n ans2 %= MOD\nprint(((ans1 + ans2) % MOD))\n", "slow_code_sha256": "4beee02380c6c3585bdb6fc92af0f09ee4640bc8f85fad5bb75630ccb510c7e7", "slow_id": "p03025_1a12b8ea879f96b088964b1f0aad1794bc8494b3705ba8644097e802ebbf8368", "speedup": 5.561137947530671, "stratum": "4-8", "within_pair_jaccard": 0.56, "workload": {"case_count": 100, "description": "Repeat games until either player has N wins. Per-game outcomes are first-player win with probability A percent, second-player win B percent, or draw C percent; A+B+C=100 and A+B>0. Output the expected game count modulo 1000000007 as P*Q^(-1). Observed inputs: N=1..100000 (median 42922); A=0..100; B=0..100; C=0..99.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 16, "median": 13.0, "min": 9}, "input_format": ["N A B C"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 4, "median": 4.0, "min": 4}}} -{"case_ids": ["p03371_case_000", "p03371_case_001", "p03371_case_002", "p03371_case_003", "p03371_case_004", "p03371_case_005", "p03371_case_006", "p03371_case_007", "p03371_case_008", "p03371_case_009", "p03371_case_010", "p03371_case_011", "p03371_case_012", "p03371_case_013", "p03371_case_014", "p03371_case_015", "p03371_case_016", "p03371_case_017", "p03371_case_018", "p03371_case_019", "p03371_case_020", "p03371_case_021", "p03371_case_022", "p03371_case_023", "p03371_case_024", "p03371_case_025", "p03371_case_026", "p03371_case_027", "p03371_case_028", "p03371_case_029", "p03371_case_030", "p03371_case_031", "p03371_case_032", "p03371_case_033", "p03371_case_034", "p03371_case_035", "p03371_case_036", "p03371_case_037", "p03371_case_038", "p03371_case_039", "p03371_case_040", "p03371_case_041", "p03371_case_042", "p03371_case_043", "p03371_case_044", "p03371_case_045", "p03371_case_046", "p03371_case_047", "p03371_case_048", "p03371_case_049", "p03371_case_050", "p03371_case_051", "p03371_case_052", "p03371_case_053", "p03371_case_054", "p03371_case_055", "p03371_case_056", "p03371_case_057", "p03371_case_058", "p03371_case_059", "p03371_case_060", "p03371_case_061", "p03371_case_062", "p03371_case_063", "p03371_case_064", "p03371_case_065", "p03371_case_066", "p03371_case_067", "p03371_case_068", "p03371_case_069", "p03371_case_070", "p03371_case_071", "p03371_case_072", "p03371_case_073", "p03371_case_074", "p03371_case_075", "p03371_case_076", "p03371_case_077", "p03371_case_078", "p03371_case_079", "p03371_case_080", "p03371_case_081", "p03371_case_082", "p03371_case_083", "p03371_case_084", "p03371_case_085", "p03371_case_086", "p03371_case_087", "p03371_case_088", "p03371_case_089", "p03371_case_090", "p03371_case_091", "p03371_case_092", "p03371_case_093", "p03371_case_094", "p03371_case_095", "p03371_case_096", "p03371_case_097", "p03371_case_098", "p03371_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "a, b, c, x, y = list(map(int, input().split()))\nab = c * 2\nif a + b > ab:\n t = ab * min(x, y)\n d = max(x, y) - min(x, y)\n if x > y:\n dd = a * d\n else:\n dd = b * d\n print((t + ab * d if dd > ab * d else t + dd))\nelse:\n print((a * x + b * y))\n", "fast_code_sha256": "dec70d9929970770ab4b866b423a9d708353800784f03f8e9964ad63ad6dd8e2", "fast_id": "p03371_dec70d9929970770ab4b866b423a9d708353800784f03f8e9964ad63ad6dd8e2", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "a, b, c, x, y = list(map(int, input().split()))\nab = c * 2\nif a + b > ab:\n t = ab * min(x, y)\n d = max(x, y) - min(x, y)\n if x > y:\n dd = a * d\n else:\n dd = b * d\n print((t + ab * d if dd > ab * d else t + dd))\nelse:\n print((a * x + b * y))\n", "measured_fast_code_sha256": "dec70d9929970770ab4b866b423a9d708353800784f03f8e9964ad63ad6dd8e2", "measured_slow_code": "a, b, c, x, y = list(map(int, input().split()))\nmi = 10**10\nfor i in range(10**6):\n cost = c * 2 * i + a * max((x - i), 0) + b * max((y - i), 0)\n if cost < mi:\n mi = cost\nprint(mi)\n", "measured_slow_code_sha256": "d423368c3404af0d794647ac92b41960ae5bb9ea8edef19ff71fb40275e2bb52", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 11661.957422624964, "pair_id": "python_v2_fa425141937b9288d47f4a37", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03371", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03371_dec70d9929970770ab4b866b423a9d708353800784f03f8e9964ad63ad6dd8e2.jsonl.gz", "inputs": "reproduction/python/inputs/p03371.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03371_d423368c3404af0d794647ac92b41960ae5bb9ea8edef19ff71fb40275e2bb52.jsonl.gz"}, "slow_code": "a, b, c, x, y = list(map(int, input().split()))\nmi = 10**10\nfor i in range(10**6):\n cost = c * 2 * i + a * max((x - i), 0) + b * max((y - i), 0)\n if cost < mi:\n mi = cost\nprint(mi)\n", "slow_code_sha256": "d423368c3404af0d794647ac92b41960ae5bb9ea8edef19ff71fb40275e2bb52", "slow_id": "p03371_d423368c3404af0d794647ac92b41960ae5bb9ea8edef19ff71fb40275e2bb52", "speedup": 11580.086089350836, "stratum": "8+", "within_pair_jaccard": 0.4827586206896552, "workload": {"case_count": 100, "description": "Whole pizzas of types A and B cost A and B; a mixed half-A/half-B pizza costs C. Buy at least X whole-A and Y whole-B equivalents, combining mixed pizzas in pairs. Minimize cost; surplus is allowed. Observed inputs: A=1..5000; B=1..5000; C=1..5000; X=1..100000 (median 56080.5); Y=1..100000 (median 40245).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 29, "median": 25.5, "min": 10}, "input_format": ["A B C X Y"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 5, "median": 5.0, "min": 5}}} -{"case_ids": ["p02660_case_000", "p02660_case_001", "p02660_case_002", "p02660_case_003", "p02660_case_004", "p02660_case_005", "p02660_case_006", "p02660_case_007", "p02660_case_008", "p02660_case_009", "p02660_case_010", "p02660_case_011", "p02660_case_012", "p02660_case_013", "p02660_case_014", "p02660_case_015", "p02660_case_016", "p02660_case_017", "p02660_case_018", "p02660_case_019", "p02660_case_020", "p02660_case_021", "p02660_case_022", "p02660_case_023", "p02660_case_024", "p02660_case_025", "p02660_case_026", "p02660_case_027", "p02660_case_028", "p02660_case_029", "p02660_case_030", "p02660_case_031", "p02660_case_032", "p02660_case_033", "p02660_case_034", "p02660_case_035", "p02660_case_036", "p02660_case_037", "p02660_case_038", "p02660_case_039", "p02660_case_040", "p02660_case_041", "p02660_case_042", "p02660_case_043", "p02660_case_044", "p02660_case_045", "p02660_case_046", "p02660_case_047", "p02660_case_048", "p02660_case_049", "p02660_case_050", "p02660_case_051", "p02660_case_052", "p02660_case_053", "p02660_case_054", "p02660_case_055", "p02660_case_056", "p02660_case_057", "p02660_case_058", "p02660_case_059", "p02660_case_060", "p02660_case_061", "p02660_case_062", "p02660_case_063", "p02660_case_064", "p02660_case_065", "p02660_case_066", "p02660_case_067", "p02660_case_068", "p02660_case_069", "p02660_case_070", "p02660_case_071", "p02660_case_072", "p02660_case_073", "p02660_case_074", "p02660_case_075", "p02660_case_076", "p02660_case_077", "p02660_case_078", "p02660_case_079", "p02660_case_080", "p02660_case_081", "p02660_case_082", "p02660_case_083", "p02660_case_084", "p02660_case_085", "p02660_case_086", "p02660_case_087", "p02660_case_088", "p02660_case_089", "p02660_case_090", "p02660_case_091", "p02660_case_092", "p02660_case_093", "p02660_case_094", "p02660_case_095", "p02660_case_096", "p02660_case_097", "p02660_case_098", "p02660_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "executable_AST_equal_except_explicit_explanatory_string_removal_and_all_frozen_inputs_checker_pass", "fast_code": "import itertools\nimport math\nimport fractions\nimport functools\nimport copy\nfrom collections import deque\nfrom functools import reduce\nfrom decimal import Decimal\n\nn = int(eval(input()))\n\n\ndef how_many_prime(n):\n prime = {}\n num = n\n i = 2\n while True:\n if i * i > n:\n if num > 1:\n prime[num] = 1\n break\n while num % i == 0:\n prime[i] = prime.get(i, 0) + 1\n num = num // i\n i += 1\n return prime\n\n\nprime = how_many_prime(n)\ncount = 0\nfor val in list(prime.values()):\n use = 1\n while True:\n if val < use:\n break\n val -= use\n use += 1\n count += 1\nprint(count)\n", "fast_code_sha256": "d22f1c20d03a5a6719dae24cf3e12d90665ba9707e1ae2885997b3a135f76c50", "fast_id": "p02660_d22f1c20d03a5a6719dae24cf3e12d90665ba9707e1ae2885997b3a135f76c50", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import itertools\nimport math\nimport fractions\nimport functools\nimport copy\nfrom collections import deque\nfrom functools import reduce\nfrom decimal import Decimal\n\nn = int(eval(input()))\n\n\ndef how_many_prime(n):\n prime = {}\n num = n\n i = 2\n while True:\n if i * i > n:\n if num > 1:\n prime[num] = 1\n break\n while num % i == 0:\n prime[i] = prime.get(i, 0) + 1\n num = num // i\n i += 1\n return prime\n\n\nprime = how_many_prime(n)\ncount = 0\nfor val in list(prime.values()):\n use = 1\n while True:\n if val < use:\n break\n val -= use\n use += 1\n count += 1\nprint(count)\n", "measured_fast_code_sha256": "d22f1c20d03a5a6719dae24cf3e12d90665ba9707e1ae2885997b3a135f76c50", "measured_slow_code": "import numpy as np\nimport sys\n\n# import copy\ndef xnxn(n=0):\n \"\"\"\n args:\n int n: a number of lows to read\n example:\n input 1\n retrun 1\n input 1 2 3\n return [1,2,3]\n input 1 2 3\n 4\n return [[1,2,3],\n [4]]\n \"\"\"\n if n == 0:\n temp = list(map(int, input().split()))\n if len(temp) == 1:\n return temp[0]\n elif len(temp) > 1:\n return temp\n else:\n temp = [list(map(int, input().split())) for _ in range(n)]\n return temp\n\n\ndef sp_xnxn(n=0):\n \"\"\"\n args:\n int n: a number of lows to read\n example\n input 1\n retrun [1]\n input 123\n return [1,2,3]\n input 123\n 4\n return [[1,2,3],\n [4]]\n \"\"\"\n if n == 0:\n return [int(k) for k in xsxs()]\n else:\n return [[int(k) for k in xsxs()] for _ in range(n)]\n\n\ndef xsxs(n=0):\n \"\"\"\n args:\n int n: a number of lows to read\n example:\n input AA\n retrun AA\n input A BBB CC\n return [\"A\",\"BBB\",\"CC\"]\n input A BB CCC\n D\n return [[\"A\",\"BBB\",\"CC\"],\n [\"D\"]]\n \"\"\"\n if n == 0:\n temp = list(input().split())\n if len(temp) == 1:\n return temp[0]\n elif len(temp) > 1:\n return temp\n else:\n return [list(input().split()) for _ in range(n)]\n\n\ndef sp_xsxs(n=0):\n \"\"\"\n args:\n int n: a number of lows to read\n example:\n input A\n retrun [\"A\"]\n input ABC\n return [\"A\",\"B\",\"C\"]\n input ABC\n D\n return [[\"A\",\"B\",\"C\"],\n [\"D\"]]\n \"\"\"\n if n == 0:\n return [s for s in xsxs()]\n else:\n return [[s for s in xsxs()] for _ in range(n)]\n\n\ndef p_num(a):\n if a == 1:\n return [[a, 1]]\n else:\n tmp = 2\n ans = []\n while tmp < np.sqrt(a) + 1:\n n = 0\n p = [tmp]\n while a % tmp == 0:\n a = int(a / tmp)\n # p.append(tmp)\n n += 1\n c = 1\n if n != 0:\n p.append(n)\n ans.append(p)\n tmp += 1\n c = 0\n if c == 0 and a != 1:\n ans.append([a, 1])\n return ans\n\n\nn = xnxn()\nif n == 1:\n print((0))\n sys.exit()\nelse:\n a = p_num(n)\n c = 0\n for num in a:\n i = 1\n while num[1] - i > -1:\n num[1] -= i\n i += 1\n c += 1\n print(c)\n", "measured_slow_code_sha256": "1e001da6da556beb6c062a6c3d70fff79210c8de209532e9be2277daea370147", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 11.539574638377704, "pair_id": "python_v2_527d5c7fe9ba1ab630c3a221", "per_case_slow_code_faster_fraction": 0.22, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02660", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02660_d22f1c20d03a5a6719dae24cf3e12d90665ba9707e1ae2885997b3a135f76c50.jsonl.gz", "inputs": "reproduction/python/inputs/p02660.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02660_1e001da6da556beb6c062a6c3d70fff79210c8de209532e9be2277daea370147.jsonl.gz"}, "slow_code": "import numpy as np\nimport sys\n\n\ndef xnxn(n=0):\n if n == 0:\n temp = list(map(int, input().split()))\n if len(temp) == 1:\n return temp[0]\n elif len(temp) > 1:\n return temp\n else:\n temp = [list(map(int, input().split())) for _ in range(n)]\n return temp\n\n\ndef sp_xnxn(n=0):\n if n == 0:\n return [int(k) for k in xsxs()]\n else:\n return [[int(k) for k in xsxs()] for _ in range(n)]\n\n\ndef xsxs(n=0):\n if n == 0:\n temp = list(input().split())\n if len(temp) == 1:\n return temp[0]\n elif len(temp) > 1:\n return temp\n else:\n return [list(input().split()) for _ in range(n)]\n\n\ndef sp_xsxs(n=0):\n if n == 0:\n return [s for s in xsxs()]\n else:\n return [[s for s in xsxs()] for _ in range(n)]\n\n\ndef p_num(a):\n if a == 1:\n return [[a, 1]]\n else:\n tmp = 2\n ans = []\n while tmp < np.sqrt(a) + 1:\n n = 0\n p = [tmp]\n while a % tmp == 0:\n a = int(a / tmp)\n\n n += 1\n c = 1\n if n != 0:\n p.append(n)\n ans.append(p)\n tmp += 1\n c = 0\n if c == 0 and a != 1:\n ans.append([a, 1])\n return ans\n\n\nn = xnxn()\nif n == 1:\n print((0))\n sys.exit()\nelse:\n a = p_num(n)\n c = 0\n for num in a:\n i = 1\n while num[1] - i > -1:\n num[1] -= i\n i += 1\n c += 1\n print(c)\n", "slow_code_sha256": "c64e2163bbc96a46229eff42141503b7087d0832181258c593502e97f84f6fe7", "slow_id": "p02660_1e001da6da556beb6c062a6c3d70fff79210c8de209532e9be2277daea370147", "speedup": 7.7290724058323645, "stratum": "4-8", "within_pair_jaccard": 0.19540229885057472, "workload": {"case_count": 100, "description": "Starting with integer N, repeatedly divide by a prime power p^e with e>=1 that divides the current value and has never been chosen before. Maximize the number of divisions. Observed inputs: N=1..992540114224 (median 452657355.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 13, "median": 10.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p02971_case_000", "p02971_case_001", "p02971_case_002", "p02971_case_003", "p02971_case_004", "p02971_case_005", "p02971_case_006", "p02971_case_007", "p02971_case_008", "p02971_case_009", "p02971_case_010", "p02971_case_011", "p02971_case_012", "p02971_case_013", "p02971_case_014", "p02971_case_015", "p02971_case_016", "p02971_case_017", "p02971_case_018", "p02971_case_019", "p02971_case_020", "p02971_case_021", "p02971_case_022", "p02971_case_023", "p02971_case_024", "p02971_case_025", "p02971_case_026", "p02971_case_027", "p02971_case_028", "p02971_case_029", "p02971_case_030", "p02971_case_031", "p02971_case_032", "p02971_case_033", "p02971_case_034", "p02971_case_035", "p02971_case_036", "p02971_case_037", "p02971_case_038", "p02971_case_039", "p02971_case_040", "p02971_case_041", "p02971_case_042", "p02971_case_043", "p02971_case_044", "p02971_case_045", "p02971_case_046", "p02971_case_047", "p02971_case_048", "p02971_case_049", "p02971_case_050", "p02971_case_051", "p02971_case_052", "p02971_case_053", "p02971_case_054", "p02971_case_055", "p02971_case_056", "p02971_case_057", "p02971_case_058", "p02971_case_059", "p02971_case_060", "p02971_case_061", "p02971_case_062", "p02971_case_063", "p02971_case_064", "p02971_case_065", "p02971_case_066", "p02971_case_067", "p02971_case_068", "p02971_case_069", "p02971_case_070", "p02971_case_071", "p02971_case_072", "p02971_case_073", "p02971_case_074", "p02971_case_075", "p02971_case_076", "p02971_case_077", "p02971_case_078", "p02971_case_079", "p02971_case_080", "p02971_case_081", "p02971_case_082", "p02971_case_083", "p02971_case_084", "p02971_case_085", "p02971_case_086", "p02971_case_087", "p02971_case_088", "p02971_case_089", "p02971_case_090", "p02971_case_091", "p02971_case_092", "p02971_case_093", "p02971_case_094", "p02971_case_095", "p02971_case_096", "p02971_case_097", "p02971_case_098", "p02971_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from sys import stdin\n\nn = int(stdin.readline().rstrip())\nli = list(int(stdin.readline().rstrip()) for _ in range(n))\nli_to = sorted(li)\none = li_to[-1]\ntwo = li_to[-2]\nfor i in range(n):\n if one == li[i]:\n print(two)\n else:\n print(one)\n", "fast_code_sha256": "410642ef7e1a2dd48a9843ed5e1a9b68d0a1e61878a3f3464b7a63a9e7d8384e", "fast_id": "p02971_410642ef7e1a2dd48a9843ed5e1a9b68d0a1e61878a3f3464b7a63a9e7d8384e", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from sys import stdin\n\nn = int(stdin.readline().rstrip())\nli = list(int(stdin.readline().rstrip()) for _ in range(n))\nli_to = sorted(li)\none = li_to[-1]\ntwo = li_to[-2]\nfor i in range(n):\n if one == li[i]:\n print(two)\n else:\n print(one)\n", "measured_fast_code_sha256": "410642ef7e1a2dd48a9843ed5e1a9b68d0a1e61878a3f3464b7a63a9e7d8384e", "measured_slow_code": "N = int(eval(input()))\nA = []\nfor i in range(N):\n A.append(int(eval(input())))\nAs = sorted(A, reverse=True)\nfor j in A:\n if j == As[0]:\n print((As[1]))\n else:\n print((As[0]))\n", "measured_slow_code_sha256": "574406044bb1599cddf064526e1d32459b948c359a5a1de966a35ad9affef810", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4.1986182463889365, "pair_id": "python_v2_609400df5608255a73d963f1", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02971", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02971_410642ef7e1a2dd48a9843ed5e1a9b68d0a1e61878a3f3464b7a63a9e7d8384e.jsonl.gz", "inputs": "reproduction/python/inputs/p02971.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02971_574406044bb1599cddf064526e1d32459b948c359a5a1de966a35ad9affef810.jsonl.gz"}, "slow_code": "N = int(eval(input()))\nA = []\nfor i in range(N):\n A.append(int(eval(input())))\nAs = sorted(A, reverse=True)\nfor j in A:\n if j == As[0]:\n print((As[1]))\n else:\n print((As[0]))\n", "slow_code_sha256": "574406044bb1599cddf064526e1d32459b948c359a5a1de966a35ad9affef810", "slow_id": "p02971_574406044bb1599cddf064526e1d32459b948c359a5a1de966a35ad9affef810", "speedup": 2.91511976397671, "stratum": "2-4", "within_pair_jaccard": 0.29411764705882354, "workload": {"case_count": 100, "description": "For each position i of an N-element integer sequence, output the maximum among all other N-1 entries. Equal values at different positions remain separate entries. Observed inputs: N=2..200000 (median 550); A_i=1..200000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1400007, "median": 2604.5, "min": 8}, "input_format": ["N\nA_1\n...\nA_N"], "input_format_status": "source_input_section", "input_lines": {"max": 200001, "median": 551.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200001, "median": 551.0, "min": 3}}} -{"case_ids": ["p03244_case_000", "p03244_case_001", "p03244_case_002", "p03244_case_003", "p03244_case_004", "p03244_case_005", "p03244_case_006", "p03244_case_007", "p03244_case_008", "p03244_case_009", "p03244_case_010", "p03244_case_011", "p03244_case_012", "p03244_case_013", "p03244_case_014", "p03244_case_015", "p03244_case_016", "p03244_case_017", "p03244_case_018", "p03244_case_019", "p03244_case_020", "p03244_case_021", "p03244_case_022", "p03244_case_023", "p03244_case_024", "p03244_case_025", "p03244_case_026", "p03244_case_027", "p03244_case_028", "p03244_case_029", "p03244_case_030", "p03244_case_031", "p03244_case_032", "p03244_case_033", "p03244_case_034", "p03244_case_035", "p03244_case_036", "p03244_case_037", "p03244_case_038", "p03244_case_039", "p03244_case_040", "p03244_case_041", "p03244_case_042", "p03244_case_043", "p03244_case_044", "p03244_case_045", "p03244_case_046", "p03244_case_047", "p03244_case_048", "p03244_case_049", "p03244_case_050", "p03244_case_051", "p03244_case_052", "p03244_case_053", "p03244_case_054", "p03244_case_055", "p03244_case_056", "p03244_case_057", "p03244_case_058", "p03244_case_059", "p03244_case_060", "p03244_case_061", "p03244_case_062", "p03244_case_063", "p03244_case_064", "p03244_case_065", "p03244_case_066", "p03244_case_067", "p03244_case_068", "p03244_case_069", "p03244_case_070", "p03244_case_071", "p03244_case_072", "p03244_case_073", "p03244_case_074", "p03244_case_075", "p03244_case_076", "p03244_case_077", "p03244_case_078", "p03244_case_079", "p03244_case_080", "p03244_case_081", "p03244_case_082", "p03244_case_083", "p03244_case_084", "p03244_case_085", "p03244_case_086", "p03244_case_087", "p03244_case_088", "p03244_case_089", "p03244_case_090", "p03244_case_091", "p03244_case_092", "p03244_case_093", "p03244_case_094", "p03244_case_095", "p03244_case_096", "p03244_case_097", "p03244_case_098", "p03244_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from collections import Counter\n\nn = int(eval(input()))\nv = list(map(int, input().split()))\nv1 = Counter(v[::2]).most_common()\nv2 = Counter(v[1::2]).most_common()\nv1.append((0, 0))\nv2.append((0, 0))\nans = n\nif v1[0][0] == v2[0][0]:\n ans -= max(v1[0][1] + v2[1][1], v1[1][1] + v2[0][1])\nelse:\n ans -= v1[0][1] + v2[0][1]\nprint(ans)\n", "fast_code_sha256": "c4caeaf3f2b3e435f88e64270a48fa33a3ecfd032a1a5cc76e2bf1b78584e822", "fast_id": "p03244_c4caeaf3f2b3e435f88e64270a48fa33a3ecfd032a1a5cc76e2bf1b78584e822", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from collections import Counter\n\nn = int(eval(input()))\nv = list(map(int, input().split()))\nv1 = Counter(v[::2]).most_common()\nv2 = Counter(v[1::2]).most_common()\nv1.append((0, 0))\nv2.append((0, 0))\nans = n\nif v1[0][0] == v2[0][0]:\n ans -= max(v1[0][1] + v2[1][1], v1[1][1] + v2[0][1])\nelse:\n ans -= v1[0][1] + v2[0][1]\nprint(ans)\n", "measured_fast_code_sha256": "c4caeaf3f2b3e435f88e64270a48fa33a3ecfd032a1a5cc76e2bf1b78584e822", "measured_slow_code": "import numpy as np\n\neven = np.zeros(100001, dtype=int)\nodd = np.zeros(100001, dtype=int)\nn = int(eval(input()))\nv = list(map(int, input().split()))\nfor i in range(n):\n if i % 2 == 0:\n even[v[i]] += 1\n else:\n odd[v[i]] += 1\ne1 = even.argmax()\ne1n = even.max()\no1 = odd.argmax()\no1n = odd.max()\n# print(e1, e1n, o1, o1n)\nif e1 == o1:\n e2n = np.sort(even)[-2]\n o2n = np.sort(odd)[-2]\n # print(e2n, o2n)\n print((min(n - e1n - o2n, n - e2n - o1n)))\nelse:\n print((n - e1n - o1n))\n", "measured_slow_code_sha256": "100838eb35611188aaa0e6508544517c0abf47ad6e005b321a85725c0e9840dd", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 458.2492344553797, "pair_id": "python_v2_dc052e6a4299859b134c8eff", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03244", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03244_c4caeaf3f2b3e435f88e64270a48fa33a3ecfd032a1a5cc76e2bf1b78584e822.jsonl.gz", "inputs": "reproduction/python/inputs/p03244.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03244_100838eb35611188aaa0e6508544517c0abf47ad6e005b321a85725c0e9840dd.jsonl.gz"}, "slow_code": "import numpy as np\n\neven = np.zeros(100001, dtype=int)\nodd = np.zeros(100001, dtype=int)\nn = int(eval(input()))\nv = list(map(int, input().split()))\nfor i in range(n):\n if i % 2 == 0:\n even[v[i]] += 1\n else:\n odd[v[i]] += 1\ne1 = even.argmax()\ne1n = even.max()\no1 = odd.argmax()\no1n = odd.max()\n\nif e1 == o1:\n e2n = np.sort(even)[-2]\n o2n = np.sort(odd)[-2]\n\n print((min(n - e1n - o2n, n - e2n - o1n)))\nelse:\n print((n - e1n - o1n))\n", "slow_code_sha256": "a39b059af4b03221115ad0dd54a76e5f423fd6c8173a18ffdbed4e08ab13360c", "slow_id": "p03244_100838eb35611188aaa0e6508544517c0abf47ad6e005b321a85725c0e9840dd", "speedup": 172.81354702701162, "stratum": "8+", "within_pair_jaccard": 0.35555555555555557, "workload": {"case_count": 100, "description": "Replace as few entries of an even-length sequence as possible so values repeat with period 2 and exactly two distinct values occur. Equal adjacent parity classes are not permitted in the result. Observed inputs: N=2..100000 (median 100); v_i=1..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 600007, "median": 598.5, "min": 12}, "input_format": ["n\nv_1 ... v_n"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100001, "median": 101.0, "min": 3}}} -{"case_ids": ["p03221_case_000", "p03221_case_001", "p03221_case_002", "p03221_case_003", "p03221_case_004", "p03221_case_005", "p03221_case_006", "p03221_case_007", "p03221_case_008", "p03221_case_009", "p03221_case_010", "p03221_case_011", "p03221_case_012", "p03221_case_013", "p03221_case_014", "p03221_case_015", "p03221_case_016", "p03221_case_017", "p03221_case_018", "p03221_case_019", "p03221_case_020", "p03221_case_021", "p03221_case_022", "p03221_case_023", "p03221_case_024", "p03221_case_025", "p03221_case_026", "p03221_case_027", "p03221_case_028", "p03221_case_029", "p03221_case_030", "p03221_case_031", "p03221_case_032", "p03221_case_033", "p03221_case_034", "p03221_case_035", "p03221_case_036", "p03221_case_037", "p03221_case_038", "p03221_case_039", "p03221_case_040", "p03221_case_041", "p03221_case_042", "p03221_case_043", "p03221_case_044", "p03221_case_045", "p03221_case_046", "p03221_case_047", "p03221_case_048", "p03221_case_049", "p03221_case_050", "p03221_case_051", "p03221_case_052", "p03221_case_053", "p03221_case_054", "p03221_case_055", "p03221_case_056", "p03221_case_057", "p03221_case_058", "p03221_case_059", "p03221_case_060", "p03221_case_061", "p03221_case_062", "p03221_case_063", "p03221_case_064", "p03221_case_065", "p03221_case_066", "p03221_case_067", "p03221_case_068", "p03221_case_069", "p03221_case_070", "p03221_case_071", "p03221_case_072", "p03221_case_073", "p03221_case_074", "p03221_case_075", "p03221_case_076", "p03221_case_077", "p03221_case_078", "p03221_case_079", "p03221_case_080", "p03221_case_081", "p03221_case_082", "p03221_case_083", "p03221_case_084", "p03221_case_085", "p03221_case_086", "p03221_case_087", "p03221_case_088", "p03221_case_089", "p03221_case_090", "p03221_case_091", "p03221_case_092", "p03221_case_093", "p03221_case_094", "p03221_case_095", "p03221_case_096", "p03221_case_097", "p03221_case_098", "p03221_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n, m = list(map(int, input().split()))\narr = []\nfor i in range(m):\n ls = list(map(int, input().split())) + [i]\n arr.append(ls)\narr.sort(key=lambda x: x[1])\n\n\ndef st(a):\n b = list(str(a))\n while len(b) <= 5:\n b.insert(0, \"0\")\n c = \"\".join(b)\n return c\n\n\ndic = {}\nfor j in range(m):\n if arr[j][0] in dic:\n dic[arr[j][0]] += 1\n arr[j] += [dic[arr[j][0]]]\n else:\n dic[arr[j][0]] = 1\n arr[j] += [dic[arr[j][0]]]\narr.sort(key=lambda x: x[2])\nfor y in range(m):\n print((\"{}{}\".format(st(arr[y][0]), st(arr[y][3]))))\n", "fast_code_sha256": "b90b08e70522a44231020ab584d9c96e274e2058901f178d46c36824a16018cd", "fast_id": "p03221_b90b08e70522a44231020ab584d9c96e274e2058901f178d46c36824a16018cd", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n, m = list(map(int, input().split()))\narr = []\nfor i in range(m):\n ls = list(map(int, input().split())) + [i]\n arr.append(ls)\narr.sort(key=lambda x: x[1])\n\n\ndef st(a):\n b = list(str(a))\n while len(b) <= 5:\n b.insert(0, \"0\")\n c = \"\".join(b)\n return c\n\n\ndic = {}\nfor j in range(m):\n if arr[j][0] in dic:\n dic[arr[j][0]] += 1\n arr[j] += [dic[arr[j][0]]]\n else:\n dic[arr[j][0]] = 1\n arr[j] += [dic[arr[j][0]]]\narr.sort(key=lambda x: x[2])\nfor y in range(m):\n print((\"{}{}\".format(st(arr[y][0]), st(arr[y][3]))))\n", "measured_fast_code_sha256": "b90b08e70522a44231020ab584d9c96e274e2058901f178d46c36824a16018cd", "measured_slow_code": "N, M = list(map(int, input().split()))\nP = []\nY = []\narr = [[] for j in range(10**5 + 1)]\nfor i in range(M):\n listA = list(map(int, input().split()))\n P.append(listA[0])\n Y.append(listA[1])\n arr[listA[0]].append(listA[1])\nfor i in range(N + 1):\n arr[i].sort()\nfor i in range(M):\n # 二部探索\n left = 0\n right = len(arr[P[i]]) - 1\n while left <= right:\n mid = (left + right) // 2\n if arr[P[i]][mid] == Y[i]:\n k = mid\n break\n elif arr[P[i]][mid] > Y[i]:\n right = mid - 1\n else:\n left = mid + 1\n print((str(P[i]).rjust(6, \"0\") + str(k + 1).rjust(6, \"0\")))\n", "measured_slow_code_sha256": "bac932e565fc824f54938c4edcf17024edb8ebfd73deb80882c8006e56a416b6", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.710117220845288, "pair_id": "python_v2_ecddeab8513f222fae490e05", "per_case_slow_code_faster_fraction": 0.3, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03221", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03221_b90b08e70522a44231020ab584d9c96e274e2058901f178d46c36824a16018cd.jsonl.gz", "inputs": "reproduction/python/inputs/p03221.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03221_bac932e565fc824f54938c4edcf17024edb8ebfd73deb80882c8006e56a416b6.jsonl.gz"}, "slow_code": "N, M = list(map(int, input().split()))\nP = []\nY = []\narr = [[] for j in range(10**5 + 1)]\nfor i in range(M):\n listA = list(map(int, input().split()))\n P.append(listA[0])\n Y.append(listA[1])\n arr[listA[0]].append(listA[1])\nfor i in range(N + 1):\n arr[i].sort()\nfor i in range(M):\n\n left = 0\n right = len(arr[P[i]]) - 1\n while left <= right:\n mid = (left + right) // 2\n if arr[P[i]][mid] == Y[i]:\n k = mid\n break\n elif arr[P[i]][mid] > Y[i]:\n right = mid - 1\n else:\n left = mid + 1\n print((str(P[i]).rjust(6, \"0\") + str(k + 1).rjust(6, \"0\")))\n", "slow_code_sha256": "9a9b5b8d60f2f6a437fd75f31baba74dc5ed7ac13071d840e26b691e2ff91cac", "slow_id": "p03221_bac932e565fc824f54938c4edcf17024edb8ebfd73deb80882c8006e56a416b6", "speedup": 4.73324136944314, "stratum": "4-8", "within_pair_jaccard": 0.4, "workload": {"case_count": 100, "description": "For each city, output a 12-digit ID formed from its prefecture P_i and its 1-based establishment rank within that prefecture, each zero-padded to six digits. Establishment years Y_i are globally distinct. Preserve input city order. Observed inputs: N=1..100000 (median 1000); M=1..100000 (median 1000); P_i=1..100000; Y_i=674542..991757127.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1600014, "median": 13905.0, "min": 16}, "input_format": ["N M\nP_1 Y_1\n...\nP_M Y_M"], "input_format_status": "source_input_section", "input_lines": {"max": 100001, "median": 1001.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200002, "median": 2002.0, "min": 4}}} -{"case_ids": ["p02641_case_000", "p02641_case_001", "p02641_case_002", "p02641_case_003", "p02641_case_004", "p02641_case_005", "p02641_case_006", "p02641_case_007", "p02641_case_008", "p02641_case_009", "p02641_case_010", "p02641_case_011", "p02641_case_012", "p02641_case_013", "p02641_case_014", "p02641_case_015", "p02641_case_016", "p02641_case_017", "p02641_case_018", "p02641_case_019", "p02641_case_020", "p02641_case_021", "p02641_case_022", "p02641_case_023", "p02641_case_024", "p02641_case_025", "p02641_case_026", "p02641_case_027", "p02641_case_028", "p02641_case_029", "p02641_case_030", "p02641_case_031", "p02641_case_032", "p02641_case_033", "p02641_case_034", "p02641_case_035", "p02641_case_036", "p02641_case_037", "p02641_case_038", "p02641_case_039", "p02641_case_040", "p02641_case_041", "p02641_case_042", "p02641_case_043", "p02641_case_044", "p02641_case_045", "p02641_case_046", "p02641_case_047", "p02641_case_048", "p02641_case_049", "p02641_case_050", "p02641_case_051", "p02641_case_052", "p02641_case_053", "p02641_case_054", "p02641_case_055", "p02641_case_056", "p02641_case_057", "p02641_case_058", "p02641_case_059", "p02641_case_060", "p02641_case_061", "p02641_case_062", "p02641_case_063", "p02641_case_064", "p02641_case_065", "p02641_case_066", "p02641_case_067", "p02641_case_068", "p02641_case_069", "p02641_case_070", "p02641_case_071", "p02641_case_072", "p02641_case_073", "p02641_case_074", "p02641_case_075", "p02641_case_076", "p02641_case_077", "p02641_case_078", "p02641_case_079", "p02641_case_080", "p02641_case_081", "p02641_case_082", "p02641_case_083", "p02641_case_084", "p02641_case_085", "p02641_case_086", "p02641_case_087", "p02641_case_088", "p02641_case_089", "p02641_case_090", "p02641_case_091", "p02641_case_092", "p02641_case_093", "p02641_case_094", "p02641_case_095", "p02641_case_096", "p02641_case_097", "p02641_case_098", "p02641_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "X, N = list(map(int, input().split()))\nif N == 0:\n print(X)\n exit()\nelse:\n P = list(map(int, input().split()))\nL = [i for i in range(0, 102) if i not in P]\nif X in L:\n ANS = X\nelse:\n L.append(X)\n L = sorted(L)\n n = L.index(X)\n if L[n + 1] - L[n] < L[n] - L[n - 1]:\n ANS = L[n + 1]\n else:\n ANS = L[n - 1]\nprint(ANS)\n", "fast_code_sha256": "e88c6445042f3b66c9c2bb18a6d419bf3bd004b3f451ae421c0ba4d415fa5104", "fast_id": "p02641_e88c6445042f3b66c9c2bb18a6d419bf3bd004b3f451ae421c0ba4d415fa5104", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "X, N = list(map(int, input().split()))\nif N == 0:\n print(X)\n exit()\nelse:\n P = list(map(int, input().split()))\nL = [i for i in range(0, 102) if i not in P]\nif X in L:\n ANS = X\nelse:\n L.append(X)\n L = sorted(L)\n n = L.index(X)\n if L[n + 1] - L[n] < L[n] - L[n - 1]:\n ANS = L[n + 1]\n else:\n ANS = L[n - 1]\nprint(ANS)\n", "measured_fast_code_sha256": "e88c6445042f3b66c9c2bb18a6d419bf3bd004b3f451ae421c0ba4d415fa5104", "measured_slow_code": "x, n = list(map(int, input().split()))\nif n == 0:\n print(x)\n exit()\narr = list(map(int, input().split())) # p1 ... pn\narr2 = []\narr3 = []\nfor i in range(-50, 110):\n if not i in arr:\n arr2.append(i)\n arr3.append(abs(x - i))\nn2 = min([i for i, v in enumerate(arr3) if v == min(arr3)])\nprint((arr2[n2]))\n", "measured_slow_code_sha256": "56a803f01b0149391407a67301955076fc165a7ad3ad3f8f8a9f51ab5d8af60e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.8929596835529838, "pair_id": "python_v2_42957a7da520f506d053abe0", "per_case_slow_code_faster_fraction": 0.03, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02641", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02641_e88c6445042f3b66c9c2bb18a6d419bf3bd004b3f451ae421c0ba4d415fa5104.jsonl.gz", "inputs": "reproduction/python/inputs/p02641.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02641_56a803f01b0149391407a67301955076fc165a7ad3ad3f8f8a9f51ab5d8af60e.jsonl.gz"}, "slow_code": "x, n = list(map(int, input().split()))\nif n == 0:\n print(x)\n exit()\narr = list(map(int, input().split()))\narr2 = []\narr3 = []\nfor i in range(-50, 110):\n if not i in arr:\n arr2.append(i)\n arr3.append(abs(x - i))\nn2 = min([i for i, v in enumerate(arr3) if v == min(arr3)])\nprint((arr2[n2]))\n", "slow_code_sha256": "85cbb5049fb6ba315c1cc49d08aa7371cf037161b52bac8a421580f3486b7f72", "slow_id": "p02641_56a803f01b0149391407a67301955076fc165a7ad3ad3f8f8a9f51ab5d8af60e", "speedup": 2.042646252766005, "stratum": "2-4", "within_pair_jaccard": 0.43243243243243246, "workload": {"case_count": 100, "description": "Find an integer not in the N distinct forbidden values p_i that is closest to X. Integers need not be positive; ties favor the smaller integer. Observed inputs: X=1..100 (median 50); N=0..100 (median 99); p_i=1..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 300, "median": 295.0, "min": 4}, "input_format": ["X N\np_1 ... p_N (line omitted if N=0)"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 102, "median": 101.0, "min": 2}}} -{"case_ids": ["p03244_case_000", "p03244_case_001", "p03244_case_002", "p03244_case_003", "p03244_case_004", "p03244_case_005", "p03244_case_006", "p03244_case_007", "p03244_case_008", "p03244_case_009", "p03244_case_010", "p03244_case_011", "p03244_case_012", "p03244_case_013", "p03244_case_014", "p03244_case_015", "p03244_case_016", "p03244_case_017", "p03244_case_018", "p03244_case_019", "p03244_case_020", "p03244_case_021", "p03244_case_022", "p03244_case_023", "p03244_case_024", "p03244_case_025", "p03244_case_026", "p03244_case_027", "p03244_case_028", "p03244_case_029", "p03244_case_030", "p03244_case_031", "p03244_case_032", "p03244_case_033", "p03244_case_034", "p03244_case_035", "p03244_case_036", "p03244_case_037", "p03244_case_038", "p03244_case_039", "p03244_case_040", "p03244_case_041", "p03244_case_042", "p03244_case_043", "p03244_case_044", "p03244_case_045", "p03244_case_046", "p03244_case_047", "p03244_case_048", "p03244_case_049", "p03244_case_050", "p03244_case_051", "p03244_case_052", "p03244_case_053", "p03244_case_054", "p03244_case_055", "p03244_case_056", "p03244_case_057", "p03244_case_058", "p03244_case_059", "p03244_case_060", "p03244_case_061", "p03244_case_062", "p03244_case_063", "p03244_case_064", "p03244_case_065", "p03244_case_066", "p03244_case_067", "p03244_case_068", "p03244_case_069", "p03244_case_070", "p03244_case_071", "p03244_case_072", "p03244_case_073", "p03244_case_074", "p03244_case_075", "p03244_case_076", "p03244_case_077", "p03244_case_078", "p03244_case_079", "p03244_case_080", "p03244_case_081", "p03244_case_082", "p03244_case_083", "p03244_case_084", "p03244_case_085", "p03244_case_086", "p03244_case_087", "p03244_case_088", "p03244_case_089", "p03244_case_090", "p03244_case_091", "p03244_case_092", "p03244_case_093", "p03244_case_094", "p03244_case_095", "p03244_case_096", "p03244_case_097", "p03244_case_098", "p03244_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from collections import Counter\n\nn = int(eval(input()))\nv = list(map(int, input().split()))\nv1 = Counter(v[::2]).most_common()\nv2 = Counter(v[1::2]).most_common()\nv1.append((0, 0))\nv2.append((0, 0))\nif v1[0][0] != v2[0][0]:\n print((n - v1[0][1] - v2[0][1]))\nelse:\n print((min(n - v1[0][1] - v2[1][1], n - v1[1][1] - v2[0][1])))\n", "fast_code_sha256": "81ca0d996be48ce54ec018c834f60d7eef9dbdab43b577bcaed380acfa0a8165", "fast_id": "p03244_81ca0d996be48ce54ec018c834f60d7eef9dbdab43b577bcaed380acfa0a8165", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from collections import Counter\n\nn = int(eval(input()))\nv = list(map(int, input().split()))\nv1 = Counter(v[::2]).most_common()\nv2 = Counter(v[1::2]).most_common()\nv1.append((0, 0))\nv2.append((0, 0))\nif v1[0][0] != v2[0][0]:\n print((n - v1[0][1] - v2[0][1]))\nelse:\n print((min(n - v1[0][1] - v2[1][1], n - v1[1][1] - v2[0][1])))\n", "measured_fast_code_sha256": "81ca0d996be48ce54ec018c834f60d7eef9dbdab43b577bcaed380acfa0a8165", "measured_slow_code": "import numpy as np\n\neven = np.zeros(100001, dtype=int)\nodd = np.zeros(100001, dtype=int)\nn = int(eval(input()))\nv = list(map(int, input().split()))\nfor i in range(n):\n if i % 2 == 0:\n even[v[i]] += 1\n else:\n odd[v[i]] += 1\ne1 = even.argmax()\ne1n = even.max()\no1 = odd.argmax()\no1n = odd.max()\n# print(e1, e1n, o1, o1n)\nif e1 == o1:\n e2n = np.sort(even)[-2]\n o2n = np.sort(odd)[-2]\n # print(e2n, o2n)\n print((min(n - e1n - o2n, n - e2n - o1n)))\nelse:\n print((n - e1n - o1n))\n", "measured_slow_code_sha256": "100838eb35611188aaa0e6508544517c0abf47ad6e005b321a85725c0e9840dd", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 462.6254903848833, "pair_id": "python_v2_8782634870b5820745d21020", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03244", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03244_81ca0d996be48ce54ec018c834f60d7eef9dbdab43b577bcaed380acfa0a8165.jsonl.gz", "inputs": "reproduction/python/inputs/p03244.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03244_100838eb35611188aaa0e6508544517c0abf47ad6e005b321a85725c0e9840dd.jsonl.gz"}, "slow_code": "import numpy as np\n\neven = np.zeros(100001, dtype=int)\nodd = np.zeros(100001, dtype=int)\nn = int(eval(input()))\nv = list(map(int, input().split()))\nfor i in range(n):\n if i % 2 == 0:\n even[v[i]] += 1\n else:\n odd[v[i]] += 1\ne1 = even.argmax()\ne1n = even.max()\no1 = odd.argmax()\no1n = odd.max()\n\nif e1 == o1:\n e2n = np.sort(even)[-2]\n o2n = np.sort(odd)[-2]\n\n print((min(n - e1n - o2n, n - e2n - o1n)))\nelse:\n print((n - e1n - o1n))\n", "slow_code_sha256": "a39b059af4b03221115ad0dd54a76e5f423fd6c8173a18ffdbed4e08ab13360c", "slow_id": "p03244_100838eb35611188aaa0e6508544517c0abf47ad6e005b321a85725c0e9840dd", "speedup": 174.14453467623534, "stratum": "8+", "within_pair_jaccard": 0.36363636363636365, "workload": {"case_count": 100, "description": "Replace as few entries of an even-length sequence as possible so values repeat with period 2 and exactly two distinct values occur. Equal adjacent parity classes are not permitted in the result. Observed inputs: N=2..100000 (median 100); v_i=1..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 600007, "median": 598.5, "min": 12}, "input_format": ["n\nv_1 ... v_n"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100001, "median": 101.0, "min": 3}}} -{"case_ids": ["p03636_case_000", "p03636_case_001", "p03636_case_002", "p03636_case_003", "p03636_case_004", "p03636_case_005", "p03636_case_006", "p03636_case_007", "p03636_case_008", "p03636_case_009", "p03636_case_010", "p03636_case_011", "p03636_case_012", "p03636_case_013", "p03636_case_014", "p03636_case_015", "p03636_case_016", "p03636_case_017", "p03636_case_018", "p03636_case_019", "p03636_case_020", "p03636_case_021", "p03636_case_022", "p03636_case_023", "p03636_case_024", "p03636_case_025", "p03636_case_026", "p03636_case_027", "p03636_case_028", "p03636_case_029", "p03636_case_030", "p03636_case_031", "p03636_case_032", "p03636_case_033", "p03636_case_034", "p03636_case_035", "p03636_case_036", "p03636_case_037", "p03636_case_038", "p03636_case_039", "p03636_case_040", "p03636_case_041", "p03636_case_042", "p03636_case_043", "p03636_case_044", "p03636_case_045", "p03636_case_046", "p03636_case_047", "p03636_case_048", "p03636_case_049", "p03636_case_050", "p03636_case_051", "p03636_case_052", "p03636_case_053", "p03636_case_054", "p03636_case_055", "p03636_case_056", "p03636_case_057", "p03636_case_058", "p03636_case_059", "p03636_case_060", "p03636_case_061", "p03636_case_062", "p03636_case_063", "p03636_case_064", "p03636_case_065", "p03636_case_066", "p03636_case_067", "p03636_case_068", "p03636_case_069", "p03636_case_070", "p03636_case_071", "p03636_case_072", "p03636_case_073", "p03636_case_074", "p03636_case_075", "p03636_case_076", "p03636_case_077", "p03636_case_078", "p03636_case_079", "p03636_case_080", "p03636_case_081", "p03636_case_082", "p03636_case_083", "p03636_case_084", "p03636_case_085", "p03636_case_086", "p03636_case_087", "p03636_case_088", "p03636_case_089", "p03636_case_090", "p03636_case_091", "p03636_case_092", "p03636_case_093", "p03636_case_094", "p03636_case_095", "p03636_case_096", "p03636_case_097", "p03636_case_098", "p03636_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "a, *b, c = input()\nprint(a, len(b), c, sep=\"\")\n", "fast_code_sha256": "609aaacbc3ca3a070f6d10f1764a4fe238bfcc0848f58c3e30360e8ac581ed62", "fast_id": "p03636_609aaacbc3ca3a070f6d10f1764a4fe238bfcc0848f58c3e30360e8ac581ed62", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "a, *b, c = input()\nprint(a, len(b), c, sep=\"\")\n", "measured_fast_code_sha256": "609aaacbc3ca3a070f6d10f1764a4fe238bfcc0848f58c3e30360e8ac581ed62", "measured_slow_code": "import sys\n\nstdin = sys.stdin\nsys.setrecursionlimit(10**7)\ni_i = lambda: int(i_s())\ni_l = lambda: list(map(int, stdin.readline().split()))\ni_s = lambda: stdin.readline().rstrip()\ns = i_s()\nprint((s[0] + str(len(s) - 2) + s[-1]))\n", "measured_slow_code_sha256": "d8a200333716652286e0767b3ceb6ced784b07df576eeb7cc77878fbcd3e057b", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.649827483932879, "pair_id": "python_v2_184e99c7f62018f50492f90a", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03636", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03636_609aaacbc3ca3a070f6d10f1764a4fe238bfcc0848f58c3e30360e8ac581ed62.jsonl.gz", "inputs": "reproduction/python/inputs/p03636.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03636_d8a200333716652286e0767b3ceb6ced784b07df576eeb7cc77878fbcd3e057b.jsonl.gz"}, "slow_code": "import sys\n\nstdin = sys.stdin\nsys.setrecursionlimit(10**7)\ni_i = lambda: int(i_s())\ni_l = lambda: list(map(int, stdin.readline().split()))\ni_s = lambda: stdin.readline().rstrip()\ns = i_s()\nprint((s[0] + str(len(s) - 2) + s[-1]))\n", "slow_code_sha256": "d8a200333716652286e0767b3ceb6ced784b07df576eeb7cc77878fbcd3e057b", "slow_id": "p03636_d8a200333716652286e0767b3ceb6ced784b07df576eeb7cc77878fbcd3e057b", "speedup": 2.6440989836386803, "stratum": "2-4", "within_pair_jaccard": 0.07142857142857142, "workload": {"case_count": 100, "description": "Abbreviate a lowercase word s as its first letter, the number of letters between the first and last, and its last letter. Observed inputs: s_length=3..100 (median 50).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 101, "median": 51.0, "min": 4}, "input_format": ["s"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p02549_case_000", "p02549_case_001", "p02549_case_002", "p02549_case_003", "p02549_case_004", "p02549_case_005", "p02549_case_006", "p02549_case_007", "p02549_case_008", "p02549_case_009", "p02549_case_010", "p02549_case_011", "p02549_case_012", "p02549_case_013", "p02549_case_014", "p02549_case_015", "p02549_case_016", "p02549_case_017", "p02549_case_018", "p02549_case_019", "p02549_case_020", "p02549_case_021", "p02549_case_022", "p02549_case_023", "p02549_case_024", "p02549_case_025", "p02549_case_026", "p02549_case_027", "p02549_case_028", "p02549_case_029", "p02549_case_030", "p02549_case_031", "p02549_case_032", "p02549_case_033", "p02549_case_034", "p02549_case_035", "p02549_case_036", "p02549_case_037", "p02549_case_038", "p02549_case_039", "p02549_case_040", "p02549_case_041", "p02549_case_042", "p02549_case_043", "p02549_case_044", "p02549_case_045", "p02549_case_046", "p02549_case_047", "p02549_case_048", "p02549_case_049", "p02549_case_050", "p02549_case_051", "p02549_case_052", "p02549_case_053", "p02549_case_054", "p02549_case_055", "p02549_case_056", "p02549_case_057", "p02549_case_058", "p02549_case_059", "p02549_case_060", "p02549_case_061", "p02549_case_062", "p02549_case_063", "p02549_case_064", "p02549_case_065", "p02549_case_066", "p02549_case_067", "p02549_case_068", "p02549_case_069", "p02549_case_070", "p02549_case_071", "p02549_case_072", "p02549_case_073", "p02549_case_074", "p02549_case_075", "p02549_case_076", "p02549_case_077", "p02549_case_078", "p02549_case_079", "p02549_case_080", "p02549_case_081", "p02549_case_082", "p02549_case_083", "p02549_case_084", "p02549_case_085", "p02549_case_086", "p02549_case_087", "p02549_case_088", "p02549_case_089", "p02549_case_090", "p02549_case_091", "p02549_case_092", "p02549_case_093", "p02549_case_094", "p02549_case_095", "p02549_case_096", "p02549_case_097", "p02549_case_098", "p02549_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "p = 998244353\nn, k = list(map(int, input().split()))\nLRs = []\nfor j in range(k):\n lj, rj = list(map(int, input().split()))\n LRs.append((lj, rj))\nA = [0] * (n + 1)\ni0 = min(lj for lj, rj in LRs)\nA[0] = 1\nA[i0] = 1\nfor i in range(i0 + 1, n):\n A[i] = A[i - 1]\n for j in range(k):\n lj, rj = LRs[j]\n if i - lj >= 0:\n A[i] += A[i - lj]\n if i - 1 - rj >= 0:\n A[i] -= A[i - 1 - rj]\n A[i] %= p\nprint((A[n - 1]))\n", "fast_code_sha256": "1674d29b1c29eb7a515765fc686af9133c83b8ae4dd702bef2d311bfef74ecad", "fast_id": "p02549_1674d29b1c29eb7a515765fc686af9133c83b8ae4dd702bef2d311bfef74ecad", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "p = 998244353\nn, k = list(map(int, input().split()))\nLRs = []\nfor j in range(k):\n lj, rj = list(map(int, input().split()))\n LRs.append((lj, rj))\nA = [0] * (n + 1)\ni0 = min(lj for lj, rj in LRs)\nA[0] = 1\nA[i0] = 1\nfor i in range(i0 + 1, n):\n A[i] = A[i - 1]\n for j in range(k):\n lj, rj = LRs[j]\n if i - lj >= 0:\n A[i] += A[i - lj]\n if i - 1 - rj >= 0:\n A[i] -= A[i - 1 - rj]\n A[i] %= p\nprint((A[n - 1]))\n", "measured_fast_code_sha256": "1674d29b1c29eb7a515765fc686af9133c83b8ae4dd702bef2d311bfef74ecad", "measured_slow_code": "mod = 998244353\nn, k = list(map(int, input().split()))\nK = [list(map(int, input().split())) for i in range(k)]\ndp = [0] * (n + 5)\ndp[1] = 1\ndp2 = [0] * (n + 5)\nfor i in range(1, n + 1):\n dp[i] = (dp[i] + dp2[i] + dp2[i - 1]) % mod\n dp2[i] = (dp2[i] + dp2[i - 1]) % mod\n for l, r in K:\n dp2[min(i + l, n + 2)] += dp[i]\n dp2[min(i + l, n + 2)] %= mod\n dp2[min(i + r + 1, n + 2)] -= dp[i]\n dp2[min(i + r + 1, n + 2)] %= mod\nprint((dp[n] % mod))\n", "measured_slow_code_sha256": "44c9516e92f38f09d76b47812276c2878e77eeefdb8dab9cc1137c27ddfc7b8e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.8716901429654262, "pair_id": "python_v2_45b9461740a58aad88b7f6dc", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02549", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02549_1674d29b1c29eb7a515765fc686af9133c83b8ae4dd702bef2d311bfef74ecad.jsonl.gz", "inputs": "reproduction/python/inputs/p02549.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02549_44c9516e92f38f09d76b47812276c2878e77eeefdb8dab9cc1137c27ddfc7b8e.jsonl.gz"}, "slow_code": "mod = 998244353\nn, k = list(map(int, input().split()))\nK = [list(map(int, input().split())) for i in range(k)]\ndp = [0] * (n + 5)\ndp[1] = 1\ndp2 = [0] * (n + 5)\nfor i in range(1, n + 1):\n dp[i] = (dp[i] + dp2[i] + dp2[i - 1]) % mod\n dp2[i] = (dp2[i] + dp2[i - 1]) % mod\n for l, r in K:\n dp2[min(i + l, n + 2)] += dp[i]\n dp2[min(i + l, n + 2)] %= mod\n dp2[min(i + r + 1, n + 2)] -= dp[i]\n dp2[min(i + r + 1, n + 2)] %= mod\nprint((dp[n] % mod))\n", "slow_code_sha256": "44c9516e92f38f09d76b47812276c2878e77eeefdb8dab9cc1137c27ddfc7b8e", "slow_id": "p02549_44c9516e92f38f09d76b47812276c2878e77eeefdb8dab9cc1137c27ddfc7b8e", "speedup": 2.5889325378909365, "stratum": "2-4", "within_pair_jaccard": 0.48484848484848486, "workload": {"case_count": 100, "description": "Count paths from cell 1 to N, modulo 998244353, moving forward by a length in the union of K disjoint inclusive intervals [L_i,R_i], without leaving the row. Observed inputs: N=2..200000 (median 5500); K=1..10 (median 5); L_i=1..200000; R_i=1..200000; allowed_step_count=1..170805 (median 10).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 150, "median": 49.0, "min": 8}, "input_format": ["N K\nL_1 R_1\n...\nL_K R_K"], "input_format_status": "source_input_section", "input_lines": {"max": 11, "median": 6.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 22, "median": 12.0, "min": 4}}} -{"case_ids": ["p02990_case_000", "p02990_case_001", "p02990_case_002", "p02990_case_003", "p02990_case_004", "p02990_case_005", "p02990_case_006", "p02990_case_007", "p02990_case_008", "p02990_case_009", "p02990_case_010", "p02990_case_011", "p02990_case_012", "p02990_case_013", "p02990_case_014", "p02990_case_015", "p02990_case_016", "p02990_case_017", "p02990_case_018", "p02990_case_019", "p02990_case_020", "p02990_case_021", "p02990_case_022", "p02990_case_023", "p02990_case_024", "p02990_case_025", "p02990_case_026", "p02990_case_027", "p02990_case_028", "p02990_case_029", "p02990_case_030", "p02990_case_031", "p02990_case_032", "p02990_case_033", "p02990_case_034", "p02990_case_035", "p02990_case_036", "p02990_case_037", "p02990_case_038", "p02990_case_039", "p02990_case_040", "p02990_case_041", "p02990_case_042", "p02990_case_043", "p02990_case_044", "p02990_case_045", "p02990_case_046", "p02990_case_047", "p02990_case_048", "p02990_case_049", "p02990_case_050", "p02990_case_051", "p02990_case_052", "p02990_case_053", "p02990_case_054", "p02990_case_055", "p02990_case_056", "p02990_case_057", "p02990_case_058", "p02990_case_059", "p02990_case_060", "p02990_case_061", "p02990_case_062", "p02990_case_063", "p02990_case_064", "p02990_case_065", "p02990_case_066", "p02990_case_067", "p02990_case_068", "p02990_case_069", "p02990_case_070", "p02990_case_071", "p02990_case_072", "p02990_case_073", "p02990_case_074", "p02990_case_075", "p02990_case_076", "p02990_case_077", "p02990_case_078", "p02990_case_079", "p02990_case_080", "p02990_case_081", "p02990_case_082", "p02990_case_083", "p02990_case_084", "p02990_case_085", "p02990_case_086", "p02990_case_087", "p02990_case_088", "p02990_case_089", "p02990_case_090", "p02990_case_091", "p02990_case_092", "p02990_case_093", "p02990_case_094", "p02990_case_095", "p02990_case_096", "p02990_case_097", "p02990_case_098", "p02990_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def comb(n, r):\n if r < 0 or r > n:\n return 0\n r = min(r, n - r)\n return g1[n] * g2[r] * g2[n - r] % MOD\n\n\nMOD = 10**9 + 7\nMAXN = 4000 + 10\ng1 = [1, 1]\ng2 = [1, 1]\ninverse = [0, 1]\nfor i in range(2, MAXN + 1):\n g1.append((g1[-1] * i) % MOD)\n inverse.append(-inverse[MOD % i] * (MOD // i) % MOD)\n g2.append((g2[-1] * inverse[-1]) % MOD)\n\n\ndef f(n, k):\n if n < k:\n return 0\n if n == 0 and k == 0:\n return 1\n if k < 1:\n return 0\n return f2(n - k, k)\n\n\ndef f2(n, k):\n return comb(n + k - 1, k - 1)\n\n\nN, K = list(map(int, input().split()))\nfor i in range(1, K + 1):\n b = f(K, i)\n r = f(N - K, i - 1) + 2 * f(N - K, i) + f(N - K, i + 1)\n print(((b * r) % MOD))\n", "fast_code_sha256": "90774dfde5e17237290c974eb2501dba5ef993279ae87f8e9c9e4f197f51686a", "fast_id": "p02990_90774dfde5e17237290c974eb2501dba5ef993279ae87f8e9c9e4f197f51686a", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def comb(n, r):\n if r < 0 or r > n:\n return 0\n r = min(r, n - r)\n return g1[n] * g2[r] * g2[n - r] % MOD\n\n\nMOD = 10**9 + 7\nMAXN = 4000 + 10\ng1 = [1, 1]\ng2 = [1, 1]\ninverse = [0, 1]\nfor i in range(2, MAXN + 1):\n g1.append((g1[-1] * i) % MOD)\n inverse.append(-inverse[MOD % i] * (MOD // i) % MOD)\n g2.append((g2[-1] * inverse[-1]) % MOD)\n\n\ndef f(n, k):\n if n < k:\n return 0\n if n == 0 and k == 0:\n return 1\n if k < 1:\n return 0\n return f2(n - k, k)\n\n\ndef f2(n, k):\n return comb(n + k - 1, k - 1)\n\n\nN, K = list(map(int, input().split()))\nfor i in range(1, K + 1):\n b = f(K, i)\n r = f(N - K, i - 1) + 2 * f(N - K, i) + f(N - K, i + 1)\n print(((b * r) % MOD))\n", "measured_fast_code_sha256": "90774dfde5e17237290c974eb2501dba5ef993279ae87f8e9c9e4f197f51686a", "measured_slow_code": "N_MAX = 200000\nMOD = 10**9 + 7\nfac, finv, inv = [0] * N_MAX, [0] * N_MAX, [0] * N_MAX\n\n\ndef com_init():\n fac[0], fac[1] = 1, 1\n finv[0], finv[1] = 1, 1\n inv[1] = 1\n for i in range(2, N_MAX):\n fac[i] = fac[i - 1] * i % MOD\n inv[i] = MOD - inv[MOD % i] * (MOD // i) % MOD\n finv[i] = finv[i - 1] * inv[i] % MOD\n\n\ndef com(n, k):\n if n < k:\n return 0\n if n < 0 or k < 0:\n return 0\n return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD\n\n\ndef main():\n n, k = list(map(int, input().split()))\n if n == k:\n for i in range(1, k + 1):\n if i == 1:\n print((1))\n else:\n print((0))\n return\n com_init()\n for i in range(1, k + 1):\n b = k\n r = n - k\n ans = (\n com(b - 1, i - 1) * com(r - 1, i - 1) * 2\n + com(b - 1, i - 1) * com(r - 1, i - 1 - 1)\n + com(b - 1, i - 1) * com(r - 1, i + 1 - 1)\n )\n print((ans % MOD))\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "b3e3896f1a2da242bb8c885fcc813e28bd04e29d9e736cb626eb88627e20740e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 23.194921574026623, "pair_id": "python_v2_8f97fee4e4af033ce6aff865", "per_case_slow_code_faster_fraction": 0.26, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02990", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02990_90774dfde5e17237290c974eb2501dba5ef993279ae87f8e9c9e4f197f51686a.jsonl.gz", "inputs": "reproduction/python/inputs/p02990.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02990_b3e3896f1a2da242bb8c885fcc813e28bd04e29d9e736cb626eb88627e20740e.jsonl.gz"}, "slow_code": "N_MAX = 200000\nMOD = 10**9 + 7\nfac, finv, inv = [0] * N_MAX, [0] * N_MAX, [0] * N_MAX\n\n\ndef com_init():\n fac[0], fac[1] = 1, 1\n finv[0], finv[1] = 1, 1\n inv[1] = 1\n for i in range(2, N_MAX):\n fac[i] = fac[i - 1] * i % MOD\n inv[i] = MOD - inv[MOD % i] * (MOD // i) % MOD\n finv[i] = finv[i - 1] * inv[i] % MOD\n\n\ndef com(n, k):\n if n < k:\n return 0\n if n < 0 or k < 0:\n return 0\n return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD\n\n\ndef main():\n n, k = list(map(int, input().split()))\n if n == k:\n for i in range(1, k + 1):\n if i == 1:\n print((1))\n else:\n print((0))\n return\n com_init()\n for i in range(1, k + 1):\n b = k\n r = n - k\n ans = (\n com(b - 1, i - 1) * com(r - 1, i - 1) * 2\n + com(b - 1, i - 1) * com(r - 1, i - 1 - 1)\n + com(b - 1, i - 1) * com(r - 1, i + 1 - 1)\n )\n print((ans % MOD))\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "b3e3896f1a2da242bb8c885fcc813e28bd04e29d9e736cb626eb88627e20740e", "slow_id": "p02990_b3e3896f1a2da242bb8c885fcc813e28bd04e29d9e736cb626eb88627e20740e", "speedup": 6.42911218559864, "stratum": "4-8", "within_pair_jaccard": 0.5, "workload": {"case_count": 100, "description": "Arrange K identical blue and N-K identical red balls in a row. For each i=1..K, count arrangements requiring exactly i moves to collect the blue balls, where a move collects any consecutive blue block. Output counts modulo 1000000007. Observed inputs: N=1..2000 (median 1234); K=1..2000 (median 807.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 10, "median": 9.0, "min": 4}, "input_format": ["N K"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p03030_case_000", "p03030_case_001", "p03030_case_002", "p03030_case_003", "p03030_case_004", "p03030_case_005", "p03030_case_006", "p03030_case_007", "p03030_case_008", "p03030_case_009", "p03030_case_010", "p03030_case_011", "p03030_case_012", "p03030_case_013", "p03030_case_014", "p03030_case_015", "p03030_case_016", "p03030_case_017", "p03030_case_018", "p03030_case_019", "p03030_case_020", "p03030_case_021", "p03030_case_022", "p03030_case_023", "p03030_case_024", "p03030_case_025", "p03030_case_026", "p03030_case_027", "p03030_case_028", "p03030_case_029", "p03030_case_030", "p03030_case_031", "p03030_case_032", "p03030_case_033", "p03030_case_034", "p03030_case_035", "p03030_case_036", "p03030_case_037", "p03030_case_038", "p03030_case_039", "p03030_case_040", "p03030_case_041", "p03030_case_042", "p03030_case_043", "p03030_case_044", "p03030_case_045", "p03030_case_046", "p03030_case_047", "p03030_case_048", "p03030_case_049", "p03030_case_050", "p03030_case_051", "p03030_case_052", "p03030_case_053", "p03030_case_054", "p03030_case_055", "p03030_case_056", "p03030_case_057", "p03030_case_058", "p03030_case_059", "p03030_case_060", "p03030_case_061", "p03030_case_062", "p03030_case_063", "p03030_case_064", "p03030_case_065", "p03030_case_066", "p03030_case_067", "p03030_case_068", "p03030_case_069", "p03030_case_070", "p03030_case_071", "p03030_case_072", "p03030_case_073", "p03030_case_074", "p03030_case_075", "p03030_case_076", "p03030_case_077", "p03030_case_078", "p03030_case_079", "p03030_case_080", "p03030_case_081", "p03030_case_082", "p03030_case_083", "p03030_case_084", "p03030_case_085", "p03030_case_086", "p03030_case_087", "p03030_case_088", "p03030_case_089", "p03030_case_090", "p03030_case_091", "p03030_case_092", "p03030_case_093", "p03030_case_094", "p03030_case_095", "p03030_case_096", "p03030_case_097", "p03030_case_098", "p03030_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\nd = sorted(\n list(list(input().split()) + [i + 1] for i in range(n)),\n key=lambda x: (x[0], -int(x[1])),\n)\nfor v in d:\n print((v[2]))\n", "fast_code_sha256": "fd71892198c251d576382e7375b4ee9fb59f0ac7a9c844bc1fe0e5aca023be63", "fast_id": "p03030_fd71892198c251d576382e7375b4ee9fb59f0ac7a9c844bc1fe0e5aca023be63", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\nd = sorted(\n list(list(input().split()) + [i + 1] for i in range(n)),\n key=lambda x: (x[0], -int(x[1])),\n)\nfor v in d:\n print((v[2]))\n", "measured_fast_code_sha256": "fd71892198c251d576382e7375b4ee9fb59f0ac7a9c844bc1fe0e5aca023be63", "measured_slow_code": "from operator import itemgetter\n\nn = int(eval(input()))\ny, s = list(), list()\nfor i in range(1, n + 1):\n S = input().split()\n S[1] = int(S[1])\n S.append(i)\n s.append(S)\ny = sorted(s, key=itemgetter(0))\nfor i in range(n):\n for j in range(1, n):\n if (y[j - 1][0] == y[j][0]) & (y[j - 1][1] < y[j][1]):\n y[j - 1], y[j] = y[j], y[j - 1]\nfor i in range(n):\n print((y[i][2]))\n", "measured_slow_code_sha256": "99641740840f9779b461fa1fb26d6b0b74d487b77fa798155bb3a136f008e321", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 7.660286760649103, "pair_id": "python_v2_c1876e7a7a51991cfbf83bc4", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03030", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03030_fd71892198c251d576382e7375b4ee9fb59f0ac7a9c844bc1fe0e5aca023be63.jsonl.gz", "inputs": "reproduction/python/inputs/p03030.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03030_99641740840f9779b461fa1fb26d6b0b74d487b77fa798155bb3a136f008e321.jsonl.gz"}, "slow_code": "from operator import itemgetter\n\nn = int(eval(input()))\ny, s = list(), list()\nfor i in range(1, n + 1):\n S = input().split()\n S[1] = int(S[1])\n S.append(i)\n s.append(S)\ny = sorted(s, key=itemgetter(0))\nfor i in range(n):\n for j in range(1, n):\n if (y[j - 1][0] == y[j][0]) & (y[j - 1][1] < y[j][1]):\n y[j - 1], y[j] = y[j], y[j - 1]\nfor i in range(n):\n print((y[i][2]))\n", "slow_code_sha256": "99641740840f9779b461fa1fb26d6b0b74d487b77fa798155bb3a136f008e321", "slow_id": "p03030_99641740840f9779b461fa1fb26d6b0b74d487b77fa798155bb3a136f008e321", "speedup": 5.597148871973423, "stratum": "4-8", "within_pair_jaccard": 0.5333333333333333, "workload": {"case_count": 100, "description": "Sort restaurants by lowercase city name lexicographically, breaking equal-city ties by decreasing score P_i, and output their original 1-based IDs. All scores are distinct. Observed inputs: N=1..100 (median 50); name_length=1..10; P_i=0..100; distinct_cities=1..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1395, "median": 463.0, "min": 7}, "input_format": ["N\nS_1 P_1\n...\nS_N P_N"], "input_format_status": "source_input_section", "input_lines": {"max": 101, "median": 51.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 201, "median": 101.0, "min": 3}}} -{"case_ids": ["p01314_case_000", "p01314_case_001", "p01314_case_002", "p01314_case_003", "p01314_case_004", "p01314_case_005", "p01314_case_006", "p01314_case_007", "p01314_case_008", "p01314_case_009", "p01314_case_010", "p01314_case_011", "p01314_case_012", "p01314_case_013", "p01314_case_014", "p01314_case_015", "p01314_case_016", "p01314_case_017", "p01314_case_018", "p01314_case_019", "p01314_case_020", "p01314_case_021", "p01314_case_022", "p01314_case_023", "p01314_case_024", "p01314_case_025", "p01314_case_026", "p01314_case_027", "p01314_case_028", "p01314_case_029", "p01314_case_030", "p01314_case_031", "p01314_case_032", "p01314_case_033", "p01314_case_034", "p01314_case_035", "p01314_case_036", "p01314_case_037", "p01314_case_038", "p01314_case_039", "p01314_case_040", "p01314_case_041", "p01314_case_042", "p01314_case_043", "p01314_case_044", "p01314_case_045", "p01314_case_046", "p01314_case_047", "p01314_case_048", "p01314_case_049", "p01314_case_050", "p01314_case_051", "p01314_case_052", "p01314_case_053", "p01314_case_054", "p01314_case_055", "p01314_case_056", "p01314_case_057", "p01314_case_058", "p01314_case_059", "p01314_case_060", "p01314_case_061", "p01314_case_062", "p01314_case_064", "p01314_case_065", "p01314_case_066", "p01314_case_067", "p01314_case_068", "p01314_case_069", "p01314_case_070", "p01314_case_071", "p01314_case_072", "p01314_case_073", "p01314_case_074", "p01314_case_075", "p01314_case_076", "p01314_case_077", "p01314_case_078", "p01314_case_079", "p01314_case_080", "p01314_case_081", "p01314_case_082", "p01314_case_083", "p01314_case_084", "p01314_case_085", "p01314_case_086", "p01314_case_087", "p01314_case_088", "p01314_case_089", "p01314_case_090", "p01314_case_091", "p01314_case_092", "p01314_case_093", "p01314_case_094", "p01314_case_095", "p01314_case_096", "p01314_case_097", "p01314_case_098", "p01314_case_099", "p01314_v2_34e40b6e8aae5233ac6d"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\nif sys.version_info[0] >= 3:\n raw_input = input\ntry:\n while True:\n n = int(input())\n if n == 0:\n break\n r = 0\n i = 1\n while 1:\n n -= i\n i += 1\n if n < i:\n break\n if n % i == 0:\n r += 1\n print(r)\nexcept EOFError:\n pass\n", "fast_code_sha256": "7ac456954b984cf0c10d7f92d148f525270e3d0edfc73dd668dad6b922793916", "fast_id": "p01314_d97ea95baf27b6d79304b226287509a03c34cf52d3fcf9888cb3a939972b30c9", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "#!/usr/bin/python\nimport sys\n\nif sys.version_info[0] >= 3:\n raw_input = input\ntry:\n while True:\n n = int(input())\n if n == 0:\n break\n r = 0\n i = 1\n while 1:\n n -= i\n i += 1\n if n < i:\n break\n if n % i == 0:\n r += 1\n print(r)\nexcept EOFError:\n pass\n", "measured_fast_code_sha256": "d97ea95baf27b6d79304b226287509a03c34cf52d3fcf9888cb3a939972b30c9", "measured_slow_code": "if __name__ == \"__main__\":\n while True:\n n = int(eval(input()))\n if n == 0:\n break\n nline = [i for i in range(1, n + 1)]\n count = 0\n for i in range(n):\n for j in range(i + 1, n):\n if sum(nline[i:j]) > n:\n break\n if sum(nline[i:j]) == n:\n count += 1\n print(count)\n", "measured_slow_code_sha256": "147e66749bf1abd06001e7ed4470d109896662992c4ff0559988e216660063c6", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 123.08946115083877, "pair_id": "python_v2_2925b2c1b2f6b5d532f8f4c4", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p01314", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p01314_d97ea95baf27b6d79304b226287509a03c34cf52d3fcf9888cb3a939972b30c9.jsonl.gz", "inputs": "reproduction/python/inputs/p01314.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p01314_147e66749bf1abd06001e7ed4470d109896662992c4ff0559988e216660063c6.jsonl.gz"}, "slow_code": "if __name__ == \"__main__\":\n while True:\n n = int(eval(input()))\n if n == 0:\n break\n nline = [i for i in range(1, n + 1)]\n count = 0\n for i in range(n):\n for j in range(i + 1, n):\n if sum(nline[i:j]) > n:\n break\n if sum(nline[i:j]) == n:\n count += 1\n print(count)\n", "slow_code_sha256": "147e66749bf1abd06001e7ed4470d109896662992c4ff0559988e216660063c6", "slow_id": "p01314_147e66749bf1abd06001e7ed4470d109896662992c4ff0559988e216660063c6", "speedup": 118.44107448557929, "stratum": "8+", "within_pair_jaccard": 0.3548387096774194, "workload": {"case_count": 100, "description": "For each positive N, count representations as the sum of at least two consecutive positive integers. Each line supplies one N; a final zero ends input. Observed inputs: datasets=4..100 (median 15); N=1..1000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 403, "median": 61.0, "min": 15}, "input_format": ["N_1\n...\nN_D\n0"], "input_format_status": "source_input_section", "input_lines": {"max": 101, "median": 16.0, "min": 5}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 101, "median": 16.0, "min": 5}}} -{"case_ids": ["p02994_case_000", "p02994_case_001", "p02994_case_002", "p02994_case_003", "p02994_case_004", "p02994_case_005", "p02994_case_006", "p02994_case_007", "p02994_case_008", "p02994_case_009", "p02994_case_010", "p02994_case_011", "p02994_case_012", "p02994_case_013", "p02994_case_014", "p02994_case_015", "p02994_case_016", "p02994_case_017", "p02994_case_018", "p02994_case_019", "p02994_case_020", "p02994_case_021", "p02994_case_022", "p02994_case_023", "p02994_case_024", "p02994_case_025", "p02994_case_026", "p02994_case_027", "p02994_case_028", "p02994_case_029", "p02994_case_030", "p02994_case_031", "p02994_case_032", "p02994_case_033", "p02994_case_034", "p02994_case_035", "p02994_case_036", "p02994_case_037", "p02994_case_038", "p02994_case_039", "p02994_case_040", "p02994_case_041", "p02994_case_042", "p02994_case_043", "p02994_case_044", "p02994_case_045", "p02994_case_046", "p02994_case_047", "p02994_case_048", "p02994_case_049", "p02994_case_050", "p02994_case_051", "p02994_case_052", "p02994_case_053", "p02994_case_054", "p02994_case_055", "p02994_case_056", "p02994_case_057", "p02994_case_058", "p02994_case_059", "p02994_case_060", "p02994_case_061", "p02994_case_062", "p02994_case_063", "p02994_case_064", "p02994_case_065", "p02994_case_066", "p02994_case_067", "p02994_case_068", "p02994_case_069", "p02994_case_070", "p02994_case_071", "p02994_case_072", "p02994_case_073", "p02994_case_074", "p02994_case_075", "p02994_case_076", "p02994_case_077", "p02994_case_078", "p02994_case_079", "p02994_case_080", "p02994_case_081", "p02994_case_082", "p02994_case_083", "p02994_case_084", "p02994_case_085", "p02994_case_086", "p02994_case_087", "p02994_case_088", "p02994_case_089", "p02994_case_090", "p02994_case_091", "p02994_case_092", "p02994_case_093", "p02994_case_094", "p02994_case_095", "p02994_case_096", "p02994_case_097", "p02994_case_098", "p02994_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n, l = list(map(int, input().split()))\napple = []\nfor i in range(n):\n apple.append(l + i)\nmin_num = 10**5\nsum_num = sum(apple)\nfor i in range(n):\n tmp = abs(sum_num - (sum_num - apple[i]))\n if tmp < min_num:\n min_num = min(tmp, min_num)\n flag = apple[i]\nif flag >= 0:\n print((sum(apple) - min_num))\nelse:\n print((sum(apple) + min_num))\n", "fast_code_sha256": "718b7fbc5916e8c37fb962c5d0d6deea14378a66e56aaa1f6d269928cd50a0cf", "fast_id": "p02994_718b7fbc5916e8c37fb962c5d0d6deea14378a66e56aaa1f6d269928cd50a0cf", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n, l = list(map(int, input().split()))\napple = []\nfor i in range(n):\n apple.append(l + i)\nmin_num = 10**5\nsum_num = sum(apple)\nfor i in range(n):\n tmp = abs(sum_num - (sum_num - apple[i]))\n if tmp < min_num:\n min_num = min(tmp, min_num)\n flag = apple[i]\nif flag >= 0:\n print((sum(apple) - min_num))\nelse:\n print((sum(apple) + min_num))\n", "measured_fast_code_sha256": "718b7fbc5916e8c37fb962c5d0d6deea14378a66e56aaa1f6d269928cd50a0cf", "measured_slow_code": "import copy\n\nN, L = list(map(int, input().split()))\napple_taste = [L + i for i in range(N)]\npie_taste = sum(apple_taste)\nmin_diff = 100000\nfor i in range(N):\n ap = copy.deepcopy(apple_taste)\n ap[i] = 0\n pie_taste2 = sum(ap)\n diff = abs(pie_taste - pie_taste2)\n if diff < min_diff:\n min_diff = diff\n min_index = i\napple_taste[min_index] = 0\nprint((sum(apple_taste)))\n", "measured_slow_code_sha256": "d149410d46bed6b8690e0200021300cc5187b2715c0717e93e6c392866beb39e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 45.67934197002056, "pair_id": "python_v2_f4668a5363bd963093a68980", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02994", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02994_718b7fbc5916e8c37fb962c5d0d6deea14378a66e56aaa1f6d269928cd50a0cf.jsonl.gz", "inputs": "reproduction/python/inputs/p02994.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02994_d149410d46bed6b8690e0200021300cc5187b2715c0717e93e6c392866beb39e.jsonl.gz"}, "slow_code": "import copy\n\nN, L = list(map(int, input().split()))\napple_taste = [L + i for i in range(N)]\npie_taste = sum(apple_taste)\nmin_diff = 100000\nfor i in range(N):\n ap = copy.deepcopy(apple_taste)\n ap[i] = 0\n pie_taste2 = sum(ap)\n diff = abs(pie_taste - pie_taste2)\n if diff < min_diff:\n min_diff = diff\n min_index = i\napple_taste[min_index] = 0\nprint((sum(apple_taste)))\n", "slow_code_sha256": "d149410d46bed6b8690e0200021300cc5187b2715c0717e93e6c392866beb39e", "slow_id": "p02994_d149410d46bed6b8690e0200021300cc5187b2715c0717e93e6c392866beb39e", "speedup": 36.1221371751948, "stratum": "8+", "within_pair_jaccard": 0.358974358974359, "workload": {"case_count": 100, "description": "N apples have flavors L,L+1,...,L+N-1, possibly negative. Remove one apple to minimize the absolute difference between the remaining flavor sum and the original total; output the remaining sum. Observed inputs: N=2..200 (median 100); L=-100..100 (median -14).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 9, "median": 7.0, "min": 4}, "input_format": ["N L"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p01268_case_000", "p01268_case_001", "p01268_case_002", "p01268_case_003", "p01268_case_004", "p01268_case_005", "p01268_case_006", "p01268_case_007", "p01268_case_008", "p01268_case_009", "p01268_case_010", "p01268_case_011", "p01268_case_012", "p01268_case_013", "p01268_case_014", "p01268_case_015", "p01268_case_016", "p01268_case_017", "p01268_case_018", "p01268_case_019", "p01268_case_020", "p01268_case_021", "p01268_case_022", "p01268_case_023", "p01268_case_024", "p01268_case_025", "p01268_case_026", "p01268_case_027", "p01268_case_028", "p01268_case_029", "p01268_case_030", "p01268_case_031", "p01268_case_032", "p01268_case_033", "p01268_case_034", "p01268_case_035", "p01268_case_036", "p01268_case_037", "p01268_case_038", "p01268_case_039", "p01268_case_040", "p01268_case_041", "p01268_case_042", "p01268_case_043", "p01268_case_044", "p01268_case_045", "p01268_case_046", "p01268_case_047", "p01268_case_048", "p01268_case_049", "p01268_case_050", "p01268_case_051", "p01268_case_052", "p01268_case_053", "p01268_case_054", "p01268_case_055", "p01268_case_056", "p01268_case_057", "p01268_case_058", "p01268_case_059", "p01268_case_060", "p01268_case_061", "p01268_case_062", "p01268_case_063", "p01268_case_064", "p01268_case_065", "p01268_case_066", "p01268_case_067", "p01268_case_068", "p01268_case_069", "p01268_case_070", "p01268_case_071", "p01268_case_072", "p01268_case_073", "p01268_case_074", "p01268_case_075", "p01268_case_076", "p01268_case_077", "p01268_case_078", "p01268_case_079", "p01268_case_080", "p01268_case_081", "p01268_case_082", "p01268_case_083", "p01268_case_084", "p01268_case_085", "p01268_case_086", "p01268_case_087", "p01268_case_088", "p01268_case_089", "p01268_case_090", "p01268_case_091", "p01268_case_092", "p01268_case_093", "p01268_case_094", "p01268_case_095", "p01268_case_096", "p01268_case_097", "p01268_case_098", "p01268_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import itertools\n\nr = 110000\ns = int(r * 0.5)\np = [1] * r\np[0] = 0\nfor i in range(1, s):\n if p[i]:\n p[2 * i + 1 :: i + 1] = [0 for x in range(2 * i + 1, r, i + 1)]\nwhile 1:\n N, P = list(map(int, input().split()))\n if N == -1:\n break\n i = N + 1\n prime = [0] * 23\n j = 0\n while j < 23:\n if p[i - 1] == 1:\n prime[j] = i\n j += 1\n i += 1\n wa = sorted(\n [sum(comb) for comb in itertools.combinations(prime, 2)]\n + [2 * a for a in prime]\n )\n print(wa[P - 1])\n", "fast_code_sha256": "7fe3505b14debd492c9069694168656769541e009f6c206df88bb70b828e72c9", "fast_id": "p01268_7fe3505b14debd492c9069694168656769541e009f6c206df88bb70b828e72c9", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import itertools\n\nr = 110000\ns = int(r * 0.5)\np = [1] * r\np[0] = 0\nfor i in range(1, s):\n if p[i]:\n p[2 * i + 1 :: i + 1] = [0 for x in range(2 * i + 1, r, i + 1)]\nwhile 1:\n N, P = list(map(int, input().split()))\n if N == -1:\n break\n i = N + 1\n prime = [0] * 23\n j = 0\n while j < 23:\n if p[i - 1] == 1:\n prime[j] = i\n j += 1\n i += 1\n wa = sorted(\n [sum(comb) for comb in itertools.combinations(prime, 2)]\n + [2 * a for a in prime]\n )\n print(wa[P - 1])\n", "measured_fast_code_sha256": "7fe3505b14debd492c9069694168656769541e009f6c206df88bb70b828e72c9", "measured_slow_code": "from bisect import bisect_right as br\nfrom itertools import combinations_with_replacement as cwr\n\nMAX = 110000\nROOT = 340\ntf = [True] * MAX\ntf[0] = tf[1] = False\nfor i in range(2, ROOT + 1):\n if tf[i]:\n for j in range(i * i, MAX, i):\n tf[j] = False\nprimes = [i for i in range(MAX) if tf[i]]\nwhile True:\n n, p = list(map(int, input().split()))\n if n == -1:\n break\n init = br(primes, n)\n choice = primes[init : init + 100]\n lst = []\n for i, j in cwr(choice, 2):\n lst.append(i + j)\n lst.sort()\n print((lst[p - 1]))\n", "measured_slow_code_sha256": "0a932eb6633858ba78c6cf0f7f33ce8a7678b6c98d01696a6e1a5b5d1b92803d", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.179424579367579, "pair_id": "python_v2_60d76a5c0184b2199583b34c", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p01268", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p01268_7fe3505b14debd492c9069694168656769541e009f6c206df88bb70b828e72c9.jsonl.gz", "inputs": "reproduction/python/inputs/p01268.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p01268_0a932eb6633858ba78c6cf0f7f33ce8a7678b6c98d01696a6e1a5b5d1b92803d.jsonl.gz"}, "slow_code": "from bisect import bisect_right as br\nfrom itertools import combinations_with_replacement as cwr\n\nMAX = 110000\nROOT = 340\ntf = [True] * MAX\ntf[0] = tf[1] = False\nfor i in range(2, ROOT + 1):\n if tf[i]:\n for j in range(i * i, MAX, i):\n tf[j] = False\nprimes = [i for i in range(MAX) if tf[i]]\nwhile True:\n n, p = list(map(int, input().split()))\n if n == -1:\n break\n init = br(primes, n)\n choice = primes[init : init + 100]\n lst = []\n for i, j in cwr(choice, 2):\n lst.append(i + j)\n lst.sort()\n print((lst[p - 1]))\n", "slow_code_sha256": "0a932eb6633858ba78c6cf0f7f33ce8a7678b6c98d01696a6e1a5b5d1b92803d", "slow_id": "p01268_0a932eb6633858ba78c6cf0f7f33ce8a7678b6c98d01696a6e1a5b5d1b92803d", "speedup": 2.2831365016401857, "stratum": "2-4", "within_pair_jaccard": 0.375, "workload": {"case_count": 100, "description": "For each N,P, consider unordered pairs of primes strictly greater than N, allowing equal primes. Sort their sums with multiplicity and output the P-th smallest sum, with P indexed from 1. A final -1 -1 ends input. Observed inputs: datasets=1..100 (median 20); N=0..100000; P=1..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 891, "median": 182.5, "min": 14}, "input_format": ["N_1 P_1\n...\nN_D P_D\n-1 -1"], "input_format_status": "source_input_section", "input_lines": {"max": 101, "median": 21.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 202, "median": 42.0, "min": 4}}} -{"case_ids": ["p03502_case_000", "p03502_case_001", "p03502_case_002", "p03502_case_003", "p03502_case_004", "p03502_case_005", "p03502_case_006", "p03502_case_007", "p03502_case_008", "p03502_case_009", "p03502_case_010", "p03502_case_011", "p03502_case_012", "p03502_case_013", "p03502_case_014", "p03502_case_015", "p03502_case_016", "p03502_case_017", "p03502_case_018", "p03502_case_019", "p03502_case_020", "p03502_case_021", "p03502_case_022", "p03502_case_023", "p03502_case_024", "p03502_case_025", "p03502_case_026", "p03502_case_027", "p03502_case_028", "p03502_case_029", "p03502_case_030", "p03502_case_031", "p03502_case_032", "p03502_case_033", "p03502_case_034", "p03502_case_035", "p03502_case_036", "p03502_case_037", "p03502_case_038", "p03502_case_039", "p03502_case_040", "p03502_case_041", "p03502_case_042", "p03502_case_043", "p03502_case_044", "p03502_case_045", "p03502_case_046", "p03502_case_047", "p03502_case_048", "p03502_case_049", "p03502_case_050", "p03502_case_051", "p03502_case_052", "p03502_case_053", "p03502_case_054", "p03502_case_055", "p03502_case_056", "p03502_case_057", "p03502_case_058", "p03502_case_059", "p03502_case_060", "p03502_case_061", "p03502_case_062", "p03502_case_063", "p03502_case_064", "p03502_case_065", "p03502_case_066", "p03502_case_067", "p03502_case_068", "p03502_case_069", "p03502_case_070", "p03502_case_071", "p03502_case_072", "p03502_case_073", "p03502_case_074", "p03502_case_075", "p03502_case_076", "p03502_case_077", "p03502_case_078", "p03502_case_079", "p03502_case_080", "p03502_case_081", "p03502_case_082", "p03502_case_083", "p03502_case_084", "p03502_case_085", "p03502_case_086", "p03502_case_087", "p03502_case_088", "p03502_case_089", "p03502_case_090", "p03502_case_091", "p03502_case_092", "p03502_case_093", "p03502_case_094", "p03502_case_095", "p03502_case_096", "p03502_case_097", "p03502_case_098", "p03502_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\n\n\ndef ds(n):\n return sum(map(int, str(n)))\n\n\nprint((\"Yes\" if n % ds(n) == 0 else \"No\"))\n", "fast_code_sha256": "f8ac70fb77cb19e9c435438282a67ef9e761514625c99bc623d3943fb1a6f9a1", "fast_id": "p03502_f8ac70fb77cb19e9c435438282a67ef9e761514625c99bc623d3943fb1a6f9a1", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\n\n\ndef ds(n):\n return sum(map(int, str(n)))\n\n\nprint((\"Yes\" if n % ds(n) == 0 else \"No\"))\n", "measured_fast_code_sha256": "f8ac70fb77cb19e9c435438282a67ef9e761514625c99bc623d3943fb1a6f9a1", "measured_slow_code": "import sys\nimport math\nimport collections\nimport itertools\nimport array\nimport inspect\n\n# Set max recursion limit\nsys.setrecursionlimit(10000)\n# Debug output\ndef chkprint(*args):\n names = {id(v): k for k, v in list(inspect.currentframe().f_back.f_locals.items())}\n print((\", \".join(names.get(id(arg), \"???\") + \" = \" + repr(arg) for arg in args)))\n\n\n# Binary converter\ndef to_bin(x):\n return bin(x)[2:]\n\n\ndef li_input():\n return [int(_) for _ in input().split()]\n\n\n# --------------------------------------------\ndp = None\n\n\ndef main():\n X = int(eval(input()))\n if X % sum(list(map(int, list(str(X))))) == 0:\n print(\"Yes\")\n else:\n print(\"No\")\n\n\nmain()\n", "measured_slow_code_sha256": "9657e24fd296bdb183cb812efcaa41e0e4d09edff18e911040359edf4aba2689", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 46.934476204778676, "pair_id": "python_v2_f4316c9ec7c007613115bc4a", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03502", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03502_f8ac70fb77cb19e9c435438282a67ef9e761514625c99bc623d3943fb1a6f9a1.jsonl.gz", "inputs": "reproduction/python/inputs/p03502.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03502_9657e24fd296bdb183cb812efcaa41e0e4d09edff18e911040359edf4aba2689.jsonl.gz"}, "slow_code": "import sys\nimport math\nimport collections\nimport itertools\nimport array\nimport inspect\n\n\nsys.setrecursionlimit(10000)\n\n\ndef chkprint(*args):\n names = {id(v): k for k, v in list(inspect.currentframe().f_back.f_locals.items())}\n print((\", \".join(names.get(id(arg), \"???\") + \" = \" + repr(arg) for arg in args)))\n\n\ndef to_bin(x):\n return bin(x)[2:]\n\n\ndef li_input():\n return [int(_) for _ in input().split()]\n\n\ndp = None\n\n\ndef main():\n X = int(eval(input()))\n if X % sum(list(map(int, list(str(X))))) == 0:\n print(\"Yes\")\n else:\n print(\"No\")\n\n\nmain()\n", "slow_code_sha256": "04afcb0636d6758b9c1fd4024fff2537c6c73d327a7f8a692ef75cf80e1d3933", "slow_id": "p03502_9657e24fd296bdb183cb812efcaa41e0e4d09edff18e911040359edf4aba2689", "speedup": 47.08710596060574, "stratum": "8+", "within_pair_jaccard": 0.2641509433962264, "workload": {"case_count": 100, "description": "Determine whether positive integer N is divisible by the sum of its decimal digits. Observed inputs: N=1..100000000 (median 8425409).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 10, "median": 8.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p00008_case_000", "p00008_case_001", "p00008_case_002", "p00008_case_003", "p00008_case_004", "p00008_case_005", "p00008_case_006", "p00008_case_007", "p00008_case_008", "p00008_case_009", "p00008_case_010", "p00008_case_011", "p00008_case_012", "p00008_case_013", "p00008_case_014", "p00008_case_015", "p00008_case_016", "p00008_case_017", "p00008_case_018", "p00008_case_019", "p00008_case_020", "p00008_case_021", "p00008_case_022", "p00008_case_023", "p00008_case_024", "p00008_case_025", "p00008_case_026", "p00008_case_027", "p00008_case_028", "p00008_case_029", "p00008_case_030", "p00008_case_031", "p00008_case_032", "p00008_case_033", "p00008_case_034", "p00008_case_035", "p00008_case_036", "p00008_case_037", "p00008_case_038", "p00008_case_039", "p00008_case_040", "p00008_case_041", "p00008_case_042", "p00008_case_043", "p00008_case_044", "p00008_case_045", "p00008_case_046", "p00008_case_047", "p00008_case_048", "p00008_case_049", "p00008_case_050", "p00008_case_051", "p00008_case_052", "p00008_case_053", "p00008_case_054", "p00008_case_055", "p00008_case_056", "p00008_case_057", "p00008_case_058", "p00008_case_059", "p00008_case_060", "p00008_case_061", "p00008_case_062", "p00008_case_063", "p00008_case_064", "p00008_case_065", "p00008_case_066", "p00008_case_067", "p00008_case_068", "p00008_case_069", "p00008_case_070", "p00008_case_071", "p00008_case_072", "p00008_case_073", "p00008_case_074", "p00008_case_075", "p00008_case_076", "p00008_case_077", "p00008_case_078", "p00008_case_079", "p00008_case_080", "p00008_case_081", "p00008_case_082", "p00008_case_083", "p00008_case_084", "p00008_case_085", "p00008_case_086", "p00008_case_087", "p00008_case_088", "p00008_case_089", "p00008_case_090", "p00008_case_091", "p00008_case_092", "p00008_case_093", "p00008_case_094", "p00008_case_095", "p00008_case_096", "p00008_case_097", "p00008_case_098", "p00008_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\na = [0] * 51\nfor i in range(10):\n a[i] = a[36 - i] = (i + 3) * (i + 2) * (i + 1) // 6\nfor i in range(10, 19):\n a[i] = a[36 - i] = (i + 3) * (i + 2) * (i + 1) // 6 - a[i - 10] * 4\nfor e in map(int, sys.stdin):\n print((a[e]))\n", "fast_code_sha256": "49052a776f54c51472062b4967b2c17ba31e82792aa55cd7c67f5eec0b671d80", "fast_id": "p00008_49052a776f54c51472062b4967b2c17ba31e82792aa55cd7c67f5eec0b671d80", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\na = [0] * 51\nfor i in range(10):\n a[i] = a[36 - i] = (i + 3) * (i + 2) * (i + 1) // 6\nfor i in range(10, 19):\n a[i] = a[36 - i] = (i + 3) * (i + 2) * (i + 1) // 6 - a[i - 10] * 4\nfor e in map(int, sys.stdin):\n print((a[e]))\n", "measured_fast_code_sha256": "49052a776f54c51472062b4967b2c17ba31e82792aa55cd7c67f5eec0b671d80", "measured_slow_code": "import sys, itertools\n\nfor n in map(int, sys.stdin):\n x = 0\n for num in itertools.product(\"0123456789\", repeat=4):\n eq = \"{}+{}+{}+{}\".format(*(num))\n if eval(eq) == n:\n x += 1\n print(x)\n", "measured_slow_code_sha256": "f78324b8c1f2014a7fb42b155a7df64e78b2806e6504b01d6dd4fa1d3a1e1f70", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 6831.605235943225, "pair_id": "python_v2_c66fde84d03d490deed43619", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p00008", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p00008_49052a776f54c51472062b4967b2c17ba31e82792aa55cd7c67f5eec0b671d80.jsonl.gz", "inputs": "reproduction/python/inputs/p00008.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p00008_f78324b8c1f2014a7fb42b155a7df64e78b2806e6504b01d6dd4fa1d3a1e1f70.jsonl.gz"}, "slow_code": "import sys, itertools\n\nfor n in map(int, sys.stdin):\n x = 0\n for num in itertools.product(\"0123456789\", repeat=4):\n eq = \"{}+{}+{}+{}\".format(*(num))\n if eval(eq) == n:\n x += 1\n print(x)\n", "slow_code_sha256": "f78324b8c1f2014a7fb42b155a7df64e78b2806e6504b01d6dd4fa1d3a1e1f70", "slow_id": "p00008_f78324b8c1f2014a7fb42b155a7df64e78b2806e6504b01d6dd4fa1d3a1e1f70", "speedup": 5385.149485757619, "stratum": "8+", "within_pair_jaccard": 0.3125, "workload": {"case_count": 100, "description": "For each target n, count ordered quadruples of decimal digits a,b,c,d in 0..9 whose sum is n. Targets are given one per line until end of input. Observed inputs: datasets=1..50 (median 10); n=1..50.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 150, "median": 26.5, "min": 2}, "input_format": ["n_1\n...\nn_D (until EOF)"], "input_format_status": "source_input_section", "input_lines": {"max": 50, "median": 10.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 50, "median": 10.0, "min": 1}}} -{"case_ids": ["p03948_case_000", "p03948_case_001", "p03948_case_002", "p03948_case_003", "p03948_case_004", "p03948_case_005", "p03948_case_006", "p03948_case_007", "p03948_case_008", "p03948_case_009", "p03948_case_010", "p03948_case_011", "p03948_case_012", "p03948_case_013", "p03948_case_014", "p03948_case_015", "p03948_case_016", "p03948_case_017", "p03948_case_018", "p03948_case_019", "p03948_case_020", "p03948_case_021", "p03948_case_022", "p03948_case_023", "p03948_case_024", "p03948_case_025", "p03948_case_026", "p03948_case_027", "p03948_case_028", "p03948_case_029", "p03948_case_030", "p03948_case_031", "p03948_case_032", "p03948_case_033", "p03948_case_034", "p03948_case_035", "p03948_case_036", "p03948_case_037", "p03948_case_038", "p03948_case_039", "p03948_case_040", "p03948_case_041", "p03948_case_042", "p03948_case_043", "p03948_case_044", "p03948_case_045", "p03948_case_046", "p03948_case_047", "p03948_case_048", "p03948_case_049", "p03948_case_050", "p03948_case_051", "p03948_case_052", "p03948_case_053", "p03948_case_054", "p03948_case_055", "p03948_case_056", "p03948_case_057", "p03948_case_058", "p03948_case_059", "p03948_case_060", "p03948_case_061", "p03948_case_062", "p03948_case_063", "p03948_case_064", "p03948_case_065", "p03948_case_066", "p03948_case_067", "p03948_case_068", "p03948_case_069", "p03948_case_070", "p03948_case_071", "p03948_case_072", "p03948_case_073", "p03948_case_074", "p03948_case_075", "p03948_case_076", "p03948_case_077", "p03948_case_078", "p03948_case_079", "p03948_case_080", "p03948_case_081", "p03948_case_082", "p03948_case_083", "p03948_case_084", "p03948_case_085", "p03948_case_086", "p03948_case_087", "p03948_case_088", "p03948_case_089", "p03948_case_090", "p03948_case_091", "p03948_case_092", "p03948_case_093", "p03948_case_094", "p03948_case_095", "p03948_case_096", "p03948_case_097", "p03948_case_098", "p03948_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N, T = list(map(int, input().split()))\nA = list(map(int, input().split()))\ncnt = max_profit = 0\nINF = float(\"inf\")\nmin_cost = INF\nfor a in A:\n profit = a - min_cost\n if profit == max_profit:\n cnt += 1\n elif profit > max_profit:\n cnt = 1\n max_profit = profit\n min_cost = min(min_cost, a)\nprint(cnt)\n", "fast_code_sha256": "9728f9990e9b40f7ab86ca8a4e9e0084bf49b9ee51395b6556945e71b7bc9979", "fast_id": "p03948_9728f9990e9b40f7ab86ca8a4e9e0084bf49b9ee51395b6556945e71b7bc9979", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N, T = list(map(int, input().split()))\nA = list(map(int, input().split()))\ncnt = max_profit = 0\nINF = float(\"inf\")\nmin_cost = INF\nfor a in A:\n profit = a - min_cost\n if profit == max_profit:\n cnt += 1\n elif profit > max_profit:\n cnt = 1\n max_profit = profit\n min_cost = min(min_cost, a)\nprint(cnt)\n", "measured_fast_code_sha256": "9728f9990e9b40f7ab86ca8a4e9e0084bf49b9ee51395b6556945e71b7bc9979", "measured_slow_code": "N, T = list(map(int, input().split()))\nA = list(map(int, input().split()))\nB = [0] * N\nC = [0] * N\nh = A[0]\nB[0] = h\nfor i in range(1, N):\n h = min(A[i], h)\n B[i] = h\nh = A[-1]\nC[-1] = h\nfor i in range(N - 2, -1, -1):\n h = max(A[i], h)\n C[i] = h\nB = B[:-1]\nC = C[1:]\nD = list([C[x] - B[x] for x in range(N - 1)])\nt = max(D)\ns = 0\nD.append(0)\nfor i in range(N - 1):\n if D[i] == t and D[i] > D[i + 1]:\n s += 1\nprint(s)\n", "measured_slow_code_sha256": "d2e58444cc1a8d5237ba224ae14ac6e70605e5881707e135fee7ffb9581c7a9e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.001195407785615, "pair_id": "python_v2_4ea6560a17e2ab84ff0ce24d", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03948", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03948_9728f9990e9b40f7ab86ca8a4e9e0084bf49b9ee51395b6556945e71b7bc9979.jsonl.gz", "inputs": "reproduction/python/inputs/p03948.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03948_d2e58444cc1a8d5237ba224ae14ac6e70605e5881707e135fee7ffb9581c7a9e.jsonl.gz"}, "slow_code": "N, T = list(map(int, input().split()))\nA = list(map(int, input().split()))\nB = [0] * N\nC = [0] * N\nh = A[0]\nB[0] = h\nfor i in range(1, N):\n h = min(A[i], h)\n B[i] = h\nh = A[-1]\nC[-1] = h\nfor i in range(N - 2, -1, -1):\n h = max(A[i], h)\n C[i] = h\nB = B[:-1]\nC = C[1:]\nD = list([C[x] - B[x] for x in range(N - 1)])\nt = max(D)\ns = 0\nD.append(0)\nfor i in range(N - 1):\n if D[i] == t and D[i] > D[i + 1]:\n s += 1\nprint(s)\n", "slow_code_sha256": "d2e58444cc1a8d5237ba224ae14ac6e70605e5881707e135fee7ffb9581c7a9e", "slow_id": "p03948_d2e58444cc1a8d5237ba224ae14ac6e70605e5881707e135fee7ffb9581c7a9e", "speedup": 2.0117198646976817, "stratum": "2-4", "within_pair_jaccard": 0.40540540540540543, "workload": {"case_count": 100, "description": "A trader moves through N towns in order with no initial apples and unlimited cash. At prices A_i, at most T individual purchases plus sales maximize profit. Change prices to nonnegative integers, paying total absolute change, to reduce that optimal profit by at least 1. Initial prices are distinct and profit is positive. Observed inputs: N=2..100000 (median 10000); T=2..1000000000; A_i=1..999999998.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1000006, "median": 74420.5, "min": 8}, "input_format": ["N T\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100002, "median": 10002.0, "min": 4}}} -{"case_ids": ["p03292_case_000", "p03292_case_001", "p03292_case_002", "p03292_case_003", "p03292_case_004", "p03292_case_005", "p03292_case_006", "p03292_case_007", "p03292_case_008", "p03292_case_009", "p03292_case_010", "p03292_case_011", "p03292_case_012", "p03292_case_013", "p03292_case_014", "p03292_case_015", "p03292_case_016", "p03292_case_017", "p03292_case_018", "p03292_case_019", "p03292_case_020", "p03292_case_021", "p03292_case_022", "p03292_case_023", "p03292_case_024", "p03292_case_025", "p03292_case_026", "p03292_case_027", "p03292_case_028", "p03292_case_029", "p03292_case_030", "p03292_case_031", "p03292_case_032", "p03292_case_033", "p03292_case_034", "p03292_case_035", "p03292_case_036", "p03292_case_037", "p03292_case_038", "p03292_case_039", "p03292_case_040", "p03292_case_041", "p03292_case_042", "p03292_case_043", "p03292_case_044", "p03292_case_045", "p03292_case_046", "p03292_case_047", "p03292_case_048", "p03292_case_049", "p03292_case_050", "p03292_case_051", "p03292_case_052", "p03292_case_053", "p03292_case_054", "p03292_case_055", "p03292_case_056", "p03292_case_057", "p03292_case_058", "p03292_case_059", "p03292_case_060", "p03292_case_061", "p03292_case_062", "p03292_case_063", "p03292_case_064", "p03292_case_065", "p03292_case_066", "p03292_case_067", "p03292_case_068", "p03292_case_069", "p03292_case_070", "p03292_case_071", "p03292_case_072", "p03292_case_073", "p03292_case_074", "p03292_case_075", "p03292_case_076", "p03292_case_077", "p03292_case_078", "p03292_case_079", "p03292_case_080", "p03292_case_081", "p03292_case_082", "p03292_case_083", "p03292_case_084", "p03292_case_085", "p03292_case_086", "p03292_case_087", "p03292_case_088", "p03292_case_089", "p03292_case_090", "p03292_case_091", "p03292_case_092", "p03292_case_093", "p03292_case_094", "p03292_case_095", "p03292_case_096", "p03292_case_097", "p03292_case_098", "p03292_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "a = list(map(int, input().split()))\na.sort()\nprint((abs(a[0] - a[1]) + abs(a[1] - a[2])))\n", "fast_code_sha256": "dbd350b32c9a321094be118186d75675a1d4b57f45f363051debc6add16a98be", "fast_id": "p03292_dbd350b32c9a321094be118186d75675a1d4b57f45f363051debc6add16a98be", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "a = list(map(int, input().split()))\na.sort()\nprint((abs(a[0] - a[1]) + abs(a[1] - a[2])))\n", "measured_fast_code_sha256": "dbd350b32c9a321094be118186d75675a1d4b57f45f363051debc6add16a98be", "measured_slow_code": "A1, A2, A3 = list(map(int, input().split()))\nA = [A1, A2, A3]\nA.append(A1)\n\n\ndef A_(i):\n if A[i] - A[i + 1] >= 0:\n return A[i] - A[i + 1]\n else:\n return A[i + 1] - A[i]\n\n\nB = [A_(i) for i in range(3)]\nB.append(A_(0))\nB.append(A_(1))\n\n\ndef sum(j):\n return B[j] + B[j + 1]\n\n\nC = [sum(j) for j in range(3)]\nprint((min(C)))\n", "measured_slow_code_sha256": "faa891db4ffaee1d866cb055fc25102fe2fdbef2a88825c6cf3be4f0ebd9170c", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.308622074767629, "pair_id": "python_v2_47154c093655f88d477da4ea", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03292", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03292_dbd350b32c9a321094be118186d75675a1d4b57f45f363051debc6add16a98be.jsonl.gz", "inputs": "reproduction/python/inputs/p03292.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03292_faa891db4ffaee1d866cb055fc25102fe2fdbef2a88825c6cf3be4f0ebd9170c.jsonl.gz"}, "slow_code": "A1, A2, A3 = list(map(int, input().split()))\nA = [A1, A2, A3]\nA.append(A1)\n\n\ndef A_(i):\n if A[i] - A[i + 1] >= 0:\n return A[i] - A[i + 1]\n else:\n return A[i + 1] - A[i]\n\n\nB = [A_(i) for i in range(3)]\nB.append(A_(0))\nB.append(A_(1))\n\n\ndef sum(j):\n return B[j] + B[j + 1]\n\n\nC = [sum(j) for j in range(3)]\nprint((min(C)))\n", "slow_code_sha256": "faa891db4ffaee1d866cb055fc25102fe2fdbef2a88825c6cf3be4f0ebd9170c", "slow_id": "p03292_faa891db4ffaee1d866cb055fc25102fe2fdbef2a88825c6cf3be4f0ebd9170c", "speedup": 3.3063957919713878, "stratum": "2-4", "within_pair_jaccard": 0.25, "workload": {"case_count": 100, "description": "Complete three tasks in any order. The first costs zero; moving from task i to task j costs |A_j-A_i|. Minimize total cost while completing all tasks. Observed inputs: A_i=1..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 12, "median": 9.0, "min": 6}, "input_format": ["A_1 A_2 A_3"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3, "median": 3.0, "min": 3}}} -{"case_ids": ["p02675_case_000", "p02675_case_001", "p02675_case_002", "p02675_case_003", "p02675_case_004", "p02675_case_005", "p02675_case_006", "p02675_case_007", "p02675_case_008", "p02675_case_009", "p02675_case_010", "p02675_case_011", "p02675_case_012", "p02675_case_013", "p02675_case_014", "p02675_case_015", "p02675_case_016", "p02675_case_017", "p02675_case_018", "p02675_case_019", "p02675_case_020", "p02675_case_021", "p02675_case_022", "p02675_case_023", "p02675_case_024", "p02675_case_025", "p02675_case_026", "p02675_case_027", "p02675_case_028", "p02675_case_029", "p02675_case_030", "p02675_case_031", "p02675_case_032", "p02675_case_033", "p02675_case_034", "p02675_case_035", "p02675_case_036", "p02675_case_037", "p02675_case_038", "p02675_case_039", "p02675_case_040", "p02675_case_041", "p02675_case_042", "p02675_case_043", "p02675_case_044", "p02675_case_045", "p02675_case_046", "p02675_case_047", "p02675_case_048", "p02675_case_049", "p02675_case_050", "p02675_case_051", "p02675_case_052", "p02675_case_053", "p02675_case_054", "p02675_case_055", "p02675_case_056", "p02675_case_057", "p02675_case_058", "p02675_case_059", "p02675_case_060", "p02675_case_061", "p02675_case_062", "p02675_case_063", "p02675_case_064", "p02675_case_065", "p02675_case_066", "p02675_case_067", "p02675_case_068", "p02675_case_069", "p02675_case_070", "p02675_case_071", "p02675_case_072", "p02675_case_073", "p02675_case_074", "p02675_case_075", "p02675_case_076", "p02675_case_077", "p02675_case_078", "p02675_case_079", "p02675_case_080", "p02675_case_081", "p02675_case_082", "p02675_case_083", "p02675_case_084", "p02675_case_085", "p02675_case_086", "p02675_case_087", "p02675_case_088", "p02675_case_089", "p02675_case_090", "p02675_case_091", "p02675_case_092", "p02675_case_093", "p02675_case_094", "p02675_case_095", "p02675_case_096", "p02675_case_097", "p02675_case_098", "p02675_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(input()[-1])\nif n == 3:\n print(\"bon\")\nelif n in set([0, 1, 6, 8]):\n print(\"pon\")\nelse:\n print(\"hon\")\n", "fast_code_sha256": "a41c0f5ce6fb7310cad09179075a7a5c3c044cf70990259800478d19339156e1", "fast_id": "p02675_a41c0f5ce6fb7310cad09179075a7a5c3c044cf70990259800478d19339156e1", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(input()[-1])\nif n == 3:\n print(\"bon\")\nelif n in set([0, 1, 6, 8]):\n print(\"pon\")\nelse:\n print(\"hon\")\n", "measured_fast_code_sha256": "a41c0f5ce6fb7310cad09179075a7a5c3c044cf70990259800478d19339156e1", "measured_slow_code": "# coding: utf-8\nimport sys\nimport math\nimport collections\nimport itertools\nimport bisect\n\nINF = 10**13\nMOD = 10**9 + 7\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef gcd(x, y):\n return x if y == 0 else gcd(y, x % y)\n\n\ndef lcm(x, y):\n return (x * y) // gcd(x, y)\n\n\ndef I():\n return int(input())\n\n\ndef LI():\n return [int(x) for x in input().split()]\n\n\ndef RI(N):\n return [int(input()) for _ in range(N)]\n\n\ndef LRI(N):\n return [[int(x) for x in input().split()] for _ in range(N)]\n\n\ndef LS():\n return input().split()\n\n\ndef RS(N):\n return [input() for _ in range(N)]\n\n\ndef LRS(N):\n return [input().split() for _ in range(N)]\n\n\ndef PL(L):\n print(*L, sep=\"\\n\")\n\n\ndef YesNo(B):\n print(\"Yes\" if B else \"No\")\n\n\ndef YESNO(B):\n print(\"YES\" if B else \"NO\")\n\n\nN = input()\nn = int(N[-1])\nif n in [2, 4, 5, 7, 9]:\n print(\"hon\")\nelif n in [0, 1, 6, 8]:\n print(\"pon\")\nelse:\n print(\"bon\")\n", "measured_slow_code_sha256": "2d3c735c213ec81bc8c26091e19ebd8461e366cff4fed305d8b06c8c2e49be9d", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 7.212702350159802, "pair_id": "python_v2_d247e6b64bfc86dc3204d147", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02675", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02675_a41c0f5ce6fb7310cad09179075a7a5c3c044cf70990259800478d19339156e1.jsonl.gz", "inputs": "reproduction/python/inputs/p02675.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02675_2d3c735c213ec81bc8c26091e19ebd8461e366cff4fed305d8b06c8c2e49be9d.jsonl.gz"}, "slow_code": "import sys\nimport math\nimport collections\nimport itertools\nimport bisect\n\nINF = 10**13\nMOD = 10**9 + 7\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef gcd(x, y):\n return x if y == 0 else gcd(y, x % y)\n\n\ndef lcm(x, y):\n return (x * y) // gcd(x, y)\n\n\ndef I():\n return int(input())\n\n\ndef LI():\n return [int(x) for x in input().split()]\n\n\ndef RI(N):\n return [int(input()) for _ in range(N)]\n\n\ndef LRI(N):\n return [[int(x) for x in input().split()] for _ in range(N)]\n\n\ndef LS():\n return input().split()\n\n\ndef RS(N):\n return [input() for _ in range(N)]\n\n\ndef LRS(N):\n return [input().split() for _ in range(N)]\n\n\ndef PL(L):\n print(*L, sep=\"\\n\")\n\n\ndef YesNo(B):\n print(\"Yes\" if B else \"No\")\n\n\ndef YESNO(B):\n print(\"YES\" if B else \"NO\")\n\n\nN = input()\nn = int(N[-1])\nif n in [2, 4, 5, 7, 9]:\n print(\"hon\")\nelif n in [0, 1, 6, 8]:\n print(\"pon\")\nelse:\n print(\"bon\")\n", "slow_code_sha256": "da5a21f4ebfb4d44ad88c7f5db5f559a60e0742e11d07068514eea6e5e1d7a49", "slow_id": "p02675_2d3c735c213ec81bc8c26091e19ebd8461e366cff4fed305d8b06c8c2e49be9d", "speedup": 7.216380766479004, "stratum": "4-8", "within_pair_jaccard": 0.23809523809523808, "workload": {"case_count": 100, "description": "Output a counter pronunciation determined by the last decimal digit of N: hon for 2,4,5,7,9; pon for 0,1,6,8; bon for 3. Observed inputs: N=1..999 (median 404).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 4, "median": 4.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p02848_case_000", "p02848_case_001", "p02848_case_002", "p02848_case_003", "p02848_case_004", "p02848_case_005", "p02848_case_006", "p02848_case_007", "p02848_case_008", "p02848_case_009", "p02848_case_010", "p02848_case_011", "p02848_case_012", "p02848_case_013", "p02848_case_014", "p02848_case_015", "p02848_case_016", "p02848_case_017", "p02848_case_018", "p02848_case_019", "p02848_case_020", "p02848_case_021", "p02848_case_022", "p02848_case_023", "p02848_case_024", "p02848_case_025", "p02848_case_026", "p02848_case_027", "p02848_case_028", "p02848_case_029", "p02848_case_030", "p02848_case_031", "p02848_case_032", "p02848_case_033", "p02848_case_034", "p02848_case_035", "p02848_case_036", "p02848_case_037", "p02848_case_038", "p02848_case_039", "p02848_case_040", "p02848_case_041", "p02848_case_042", "p02848_case_043", "p02848_case_044", "p02848_case_045", "p02848_case_046", "p02848_case_047", "p02848_case_048", "p02848_case_049", "p02848_case_050", "p02848_case_051", "p02848_case_052", "p02848_case_053", "p02848_case_054", "p02848_case_055", "p02848_case_056", "p02848_case_057", "p02848_case_058", "p02848_case_059", "p02848_case_060", "p02848_case_061", "p02848_case_062", "p02848_case_063", "p02848_case_064", "p02848_case_065", "p02848_case_066", "p02848_case_067", "p02848_case_068", "p02848_case_069", "p02848_case_070", "p02848_case_071", "p02848_case_072", "p02848_case_073", "p02848_case_074", "p02848_case_075", "p02848_case_076", "p02848_case_077", "p02848_case_078", "p02848_case_079", "p02848_case_080", "p02848_case_081", "p02848_case_082", "p02848_case_083", "p02848_case_084", "p02848_case_085", "p02848_case_086", "p02848_case_087", "p02848_case_088", "p02848_case_089", "p02848_case_090", "p02848_case_091", "p02848_case_092", "p02848_case_093", "p02848_case_094", "p02848_case_095", "p02848_case_096", "p02848_case_097", "p02848_case_098", "p02848_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "s = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\nn = int(input())\nx = input()\na = ord(\"A\")\nprint(\"\".join([s[(ord(c) - a + n) % 26] for c in x]))\n", "fast_code_sha256": "b9b377895112e4c99f6470ef8bdf76c96f8f88338618602457f984055da5d8d7", "fast_id": "p02848_b9b377895112e4c99f6470ef8bdf76c96f8f88338618602457f984055da5d8d7", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "s = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\nn = int(input())\nx = input()\na = ord(\"A\")\nprint(\"\".join([s[(ord(c) - a + n) % 26] for c in x]))\n", "measured_fast_code_sha256": "b9b377895112e4c99f6470ef8bdf76c96f8f88338618602457f984055da5d8d7", "measured_slow_code": "import sys, re\nfrom collections import deque, defaultdict, Counter\nfrom math import (\n ceil,\n sqrt,\n hypot,\n factorial,\n pi,\n sin,\n cos,\n tan,\n asin,\n acos,\n atan,\n radians,\n degrees,\n log2,\n)\nfrom itertools import (\n accumulate,\n permutations,\n combinations,\n combinations_with_replacement,\n product,\n groupby,\n)\nfrom operator import itemgetter, mul\nfrom copy import deepcopy\nfrom string import ascii_lowercase, ascii_uppercase, digits\nfrom bisect import bisect, bisect_left\nfrom heapq import heappush, heappop\nfrom functools import reduce\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef INT():\n return int(input())\n\n\ndef MAP():\n return map(int, input().split())\n\n\ndef LIST():\n return list(map(int, input().split()))\n\n\ndef ZIP(n):\n return zip(*(MAP() for _ in range(n)))\n\n\nimport numpy as np\n\nsys.setrecursionlimit(10**9)\nINF = float(\"inf\")\nmod = 10**9 + 7\nN = INT()\nS = input()\nA = [chr(65 + (ord(S[i]) - 65 + N) % 26) for i in range(len(S))]\nprint(*A, sep=\"\")\n", "measured_slow_code_sha256": "ed676805c3906f0b8eec9da5d2ece621b230f36d3c01a97c7d0f10d1fb5f8673", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 28.52099362503074, "pair_id": "python_v2_65c5a04b722692bedeb054fe", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02848", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02848_b9b377895112e4c99f6470ef8bdf76c96f8f88338618602457f984055da5d8d7.jsonl.gz", "inputs": "reproduction/python/inputs/p02848.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02848_ed676805c3906f0b8eec9da5d2ece621b230f36d3c01a97c7d0f10d1fb5f8673.jsonl.gz"}, "slow_code": "import sys, re\nfrom collections import deque, defaultdict, Counter\nfrom math import (\n ceil,\n sqrt,\n hypot,\n factorial,\n pi,\n sin,\n cos,\n tan,\n asin,\n acos,\n atan,\n radians,\n degrees,\n log2,\n)\nfrom itertools import (\n accumulate,\n permutations,\n combinations,\n combinations_with_replacement,\n product,\n groupby,\n)\nfrom operator import itemgetter, mul\nfrom copy import deepcopy\nfrom string import ascii_lowercase, ascii_uppercase, digits\nfrom bisect import bisect, bisect_left\nfrom heapq import heappush, heappop\nfrom functools import reduce\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef INT():\n return int(input())\n\n\ndef MAP():\n return map(int, input().split())\n\n\ndef LIST():\n return list(map(int, input().split()))\n\n\ndef ZIP(n):\n return zip(*(MAP() for _ in range(n)))\n\n\nimport numpy as np\n\nsys.setrecursionlimit(10**9)\nINF = float(\"inf\")\nmod = 10**9 + 7\nN = INT()\nS = input()\nA = [chr(65 + (ord(S[i]) - 65 + N) % 26) for i in range(len(S))]\nprint(*A, sep=\"\")\n", "slow_code_sha256": "ed676805c3906f0b8eec9da5d2ece621b230f36d3c01a97c7d0f10d1fb5f8673", "slow_id": "p02848_ed676805c3906f0b8eec9da5d2ece621b230f36d3c01a97c7d0f10d1fb5f8673", "speedup": 62.0242472097233, "stratum": "8+", "within_pair_jaccard": 0.09574468085106383, "workload": {"case_count": 100, "description": "Shift every uppercase letter of S forward by N alphabetical positions, wrapping from Z to A, and output the resulting string. Observed inputs: N=0..26 (median 13); S_length=1..10000 (median 10000).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 10004, "median": 10004.0, "min": 4}, "input_format": ["N\nS"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p03126_case_000", "p03126_case_001", "p03126_case_002", "p03126_case_003", "p03126_case_004", "p03126_case_005", "p03126_case_006", "p03126_case_007", "p03126_case_008", "p03126_case_009", "p03126_case_010", "p03126_case_011", "p03126_case_012", "p03126_case_013", "p03126_case_014", "p03126_case_015", "p03126_case_016", "p03126_case_017", "p03126_case_018", "p03126_case_019", "p03126_case_020", "p03126_case_021", "p03126_case_022", "p03126_case_023", "p03126_case_024", "p03126_case_025", "p03126_case_026", "p03126_case_027", "p03126_case_028", "p03126_case_029", "p03126_case_030", "p03126_case_031", "p03126_case_032", "p03126_case_033", "p03126_case_034", "p03126_case_035", "p03126_case_036", "p03126_case_037", "p03126_case_038", "p03126_case_039", "p03126_case_040", "p03126_case_041", "p03126_case_042", "p03126_case_043", "p03126_case_044", "p03126_case_045", "p03126_case_046", "p03126_case_047", "p03126_case_048", "p03126_case_049", "p03126_case_050", "p03126_case_051", "p03126_case_052", "p03126_case_053", "p03126_case_054", "p03126_case_055", "p03126_case_056", "p03126_case_057", "p03126_case_058", "p03126_case_059", "p03126_case_060", "p03126_case_061", "p03126_case_062", "p03126_case_063", "p03126_case_064", "p03126_case_065", "p03126_case_066", "p03126_case_067", "p03126_case_068", "p03126_case_069", "p03126_case_070", "p03126_case_071", "p03126_case_072", "p03126_case_073", "p03126_case_074", "p03126_case_075", "p03126_case_076", "p03126_case_077", "p03126_case_078", "p03126_case_079", "p03126_case_080", "p03126_case_081", "p03126_case_082", "p03126_case_083", "p03126_case_084", "p03126_case_085", "p03126_case_086", "p03126_case_087", "p03126_case_088", "p03126_case_089", "p03126_case_090", "p03126_case_091", "p03126_case_092", "p03126_case_093", "p03126_case_094", "p03126_case_095", "p03126_case_096", "p03126_case_097", "p03126_case_098", "p03126_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n, m = list(map(int, input().split()))\ns = set(range(1, m + 1))\nfor _ in range(n):\n k, *a = list(map(int, input().split()))\n s &= set(a)\nprint((len(s)))\n", "fast_code_sha256": "cf0769b31f7033ebdc0e56276c7e0d91eba5a1cd549c2557455d0582b46f88b8", "fast_id": "p03126_cf0769b31f7033ebdc0e56276c7e0d91eba5a1cd549c2557455d0582b46f88b8", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n, m = list(map(int, input().split()))\ns = set(range(1, m + 1))\nfor _ in range(n):\n k, *a = list(map(int, input().split()))\n s &= set(a)\nprint((len(s)))\n", "measured_fast_code_sha256": "cf0769b31f7033ebdc0e56276c7e0d91eba5a1cd549c2557455d0582b46f88b8", "measured_slow_code": "N, M = list(map(int, input().split()))\nlist = [list(map(int, input().split())) for x in range(N)]\n# 一列目削除\nfor i in range(0, N):\n list[i].pop(0)\nstock = []\n# 解答が全リストにあるか探索\nfor i in range(0, N):\n for j in range(0, len(list[i])):\n cnt = 0\n for k in range(0, N):\n if list[i][j] in list[k]:\n cnt += 1\n if cnt == N:\n stock.append(list[i][j])\nif N == 1:\n stock = list[i]\nprint((len(set(stock))))\n", "measured_slow_code_sha256": "cba8544a349f34548c0cfacd2e62b0d692bf5fdacfd135926ebf79dcf82a2da4", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4.678527613767601, "pair_id": "python_v2_5a36a7244ecfb0e4dfd54f2d", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03126", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03126_cf0769b31f7033ebdc0e56276c7e0d91eba5a1cd549c2557455d0582b46f88b8.jsonl.gz", "inputs": "reproduction/python/inputs/p03126.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03126_cba8544a349f34548c0cfacd2e62b0d692bf5fdacfd135926ebf79dcf82a2da4.jsonl.gz"}, "slow_code": "N, M = list(map(int, input().split()))\nlist = [list(map(int, input().split())) for x in range(N)]\n\nfor i in range(0, N):\n list[i].pop(0)\nstock = []\n\nfor i in range(0, N):\n for j in range(0, len(list[i])):\n cnt = 0\n for k in range(0, N):\n if list[i][j] in list[k]:\n cnt += 1\n if cnt == N:\n stock.append(list[i][j])\nif N == 1:\n stock = list[i]\nprint((len(set(stock))))\n", "slow_code_sha256": "0dc68db287c1c51e9e3ae700494383cca10de9412a38ef778d71183366a2ba69", "slow_id": "p03126_cba8544a349f34548c0cfacd2e62b0d692bf5fdacfd135926ebf79dcf82a2da4", "speedup": 6.009663078915811, "stratum": "4-8", "within_pair_jaccard": 0.4482758620689655, "workload": {"case_count": 100, "description": "Each of N people lists K_i distinct liked food IDs A_i,j from 1..M. Count food kinds liked by every person; the lists need not be sorted. Observed inputs: N=1..30 (median 13); M=1..30 (median 15); K_i=1..30.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 2526, "median": 177.0, "min": 8}, "input_format": ["N M\nK_1 A_1,1 ... A_1,K_1\n...\nK_N A_N,1 ... A_N,K_N"], "input_format_status": "source_input_section", "input_lines": {"max": 31, "median": 14.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 932, "median": 83.0, "min": 4}}} -{"case_ids": ["p03738_case_000", "p03738_case_001", "p03738_case_002", "p03738_case_003", "p03738_case_004", "p03738_case_005", "p03738_case_006", "p03738_case_007", "p03738_case_008", "p03738_case_009", "p03738_case_010", "p03738_case_011", "p03738_case_012", "p03738_case_013", "p03738_case_014", "p03738_case_015", "p03738_case_016", "p03738_case_017", "p03738_case_018", "p03738_case_019", "p03738_case_020", "p03738_case_021", "p03738_case_022", "p03738_case_023", "p03738_case_024", "p03738_case_025", "p03738_case_026", "p03738_case_027", "p03738_case_028", "p03738_case_029", "p03738_case_030", "p03738_case_031", "p03738_case_032", "p03738_case_033", "p03738_case_034", "p03738_case_035", "p03738_case_036", "p03738_case_037", "p03738_case_038", "p03738_case_039", "p03738_case_040", "p03738_case_041", "p03738_case_042", "p03738_case_043", "p03738_case_044", "p03738_case_045", "p03738_case_046", "p03738_case_047", "p03738_case_048", "p03738_case_049", "p03738_case_050", "p03738_case_051", "p03738_case_052", "p03738_case_053", "p03738_case_054", "p03738_case_055", "p03738_case_056", "p03738_case_057", "p03738_case_058", "p03738_case_059", "p03738_case_060", "p03738_case_061", "p03738_case_062", "p03738_case_063", "p03738_case_064", "p03738_case_065", "p03738_case_066", "p03738_case_067", "p03738_case_068", "p03738_case_069", "p03738_case_070", "p03738_case_071", "p03738_case_072", "p03738_case_073", "p03738_case_074", "p03738_case_075", "p03738_case_076", "p03738_case_077", "p03738_case_078", "p03738_case_079", "p03738_case_080", "p03738_case_081", "p03738_case_082", "p03738_case_083", "p03738_case_084", "p03738_case_085", "p03738_case_086", "p03738_case_087", "p03738_case_088", "p03738_case_089", "p03738_case_090", "p03738_case_091", "p03738_case_092", "p03738_case_093", "p03738_case_094", "p03738_case_095", "p03738_case_096", "p03738_case_097", "p03738_case_098", "p03738_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "a = int(eval(input())) - int(eval(input()))\nprint((a > 0 and \"GREATER\" or a < 0 and \"LESS\" or \"EQUAL\"))\n", "fast_code_sha256": "55544230816fd7d657cc5324cb41e22f86528020642dc127eaa0dd214065aa0b", "fast_id": "p03738_55544230816fd7d657cc5324cb41e22f86528020642dc127eaa0dd214065aa0b", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "a = int(eval(input())) - int(eval(input()))\nprint((a > 0 and \"GREATER\" or a < 0 and \"LESS\" or \"EQUAL\"))\n", "measured_fast_code_sha256": "55544230816fd7d657cc5324cb41e22f86528020642dc127eaa0dd214065aa0b", "measured_slow_code": "# -*- coding: utf-8 -*-\nA = list(str(eval(input())))\nB = list(str(eval(input())))\nif len(A) > len(B):\n print(\"GREATER\")\nelif len(A) < len(B):\n print(\"LESS\")\nelif A == B:\n print(\"EQUAL\")\nelse:\n for i in range(len(A)):\n if A[i] > B[i]:\n print(\"GREATER\")\n break\n elif A[i] < B[i]:\n print(\"LESS\")\n break\n", "measured_slow_code_sha256": "f2a1dc6e63c74cb266417a6249cc5c8560500fe64b277e583f61bdec48e478cd", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.2895626399614533, "pair_id": "python_v2_25fa3ee464d5368151ed6ec2", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03738", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03738_55544230816fd7d657cc5324cb41e22f86528020642dc127eaa0dd214065aa0b.jsonl.gz", "inputs": "reproduction/python/inputs/p03738.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03738_f2a1dc6e63c74cb266417a6249cc5c8560500fe64b277e583f61bdec48e478cd.jsonl.gz"}, "slow_code": "A = list(str(eval(input())))\nB = list(str(eval(input())))\nif len(A) > len(B):\n print(\"GREATER\")\nelif len(A) < len(B):\n print(\"LESS\")\nelif A == B:\n print(\"EQUAL\")\nelse:\n for i in range(len(A)):\n if A[i] > B[i]:\n print(\"GREATER\")\n break\n elif A[i] < B[i]:\n print(\"LESS\")\n break\n", "slow_code_sha256": "c3e74afb0ea1ccab204561bca43b19e98b453893af9553ffe8e101cd13c9d1e9", "slow_id": "p03738_f2a1dc6e63c74cb266417a6249cc5c8560500fe64b277e583f61bdec48e478cd", "speedup": 2.287709995850699, "stratum": "2-4", "within_pair_jaccard": 0.25, "workload": {"case_count": 100, "description": "Compare positive decimal integers A and B and report greater, less, or equal. Neither representation has leading zeros; numbers may exceed machine integer sizes. Observed inputs: A_digits=1..100 (median 7); B_digits=1..100 (median 7).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 202, "median": 18.0, "min": 4}, "input_format": ["A\nB"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p02595_case_000", "p02595_case_001", "p02595_case_002", "p02595_case_003", "p02595_case_004", "p02595_case_005", "p02595_case_006", "p02595_case_007", "p02595_case_008", "p02595_case_009", "p02595_case_010", "p02595_case_011", "p02595_case_012", "p02595_case_013", "p02595_case_014", "p02595_case_015", "p02595_case_016", "p02595_case_017", "p02595_case_018", "p02595_case_019", "p02595_case_020", "p02595_case_021", "p02595_case_022", "p02595_case_023", "p02595_case_024", "p02595_case_025", "p02595_case_026", "p02595_case_027", "p02595_case_028", "p02595_case_029", "p02595_case_030", "p02595_case_031", "p02595_case_032", "p02595_case_033", "p02595_case_034", "p02595_case_035", "p02595_case_036", "p02595_case_037", "p02595_case_038", "p02595_case_039", "p02595_case_040", "p02595_case_041", "p02595_case_042", "p02595_case_043", "p02595_case_044", "p02595_case_045", "p02595_case_046", "p02595_case_047", "p02595_case_048", "p02595_case_049", "p02595_case_050", "p02595_case_051", "p02595_case_052", "p02595_case_053", "p02595_case_054", "p02595_case_055", "p02595_case_056", "p02595_case_057", "p02595_case_058", "p02595_case_059", "p02595_case_060", "p02595_case_061", "p02595_case_062", "p02595_case_063", "p02595_case_064", "p02595_case_065", "p02595_case_066", "p02595_case_067", "p02595_case_068", "p02595_case_069", "p02595_case_070", "p02595_case_071", "p02595_case_072", "p02595_case_073", "p02595_case_074", "p02595_case_075", "p02595_case_076", "p02595_case_077", "p02595_case_078", "p02595_case_079", "p02595_case_080", "p02595_case_081", "p02595_case_082", "p02595_case_083", "p02595_case_084", "p02595_case_085", "p02595_case_086", "p02595_case_087", "p02595_case_088", "p02595_case_089", "p02595_case_090", "p02595_case_091", "p02595_case_092", "p02595_case_093", "p02595_case_094", "p02595_case_095", "p02595_case_096", "p02595_case_097", "p02595_case_098", "p02595_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n, d = list(map(int, input().split()))\nd *= d\ncnt = 0\nfor i in range(n):\n x, y = list(map(int, input().split()))\n if x * x + y * y <= d:\n cnt += 1\nprint(cnt)\n", "fast_code_sha256": "92aca33b2d71b7102fdbc534c175eeae698c626cae626a7c08492217e2aeb790", "fast_id": "p02595_92aca33b2d71b7102fdbc534c175eeae698c626cae626a7c08492217e2aeb790", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n, d = list(map(int, input().split()))\nd *= d\ncnt = 0\nfor i in range(n):\n x, y = list(map(int, input().split()))\n if x * x + y * y <= d:\n cnt += 1\nprint(cnt)\n", "measured_fast_code_sha256": "92aca33b2d71b7102fdbc534c175eeae698c626cae626a7c08492217e2aeb790", "measured_slow_code": "from decimal import *\n\ngetcontext().prec = 50\nN, D = list(map(int, input().split()))\n\n\ndef distance(x1, x2, y1, y2):\n dx = x2 - x1\n dy = y2 - y1\n return (dx * dx + dy * dy).sqrt()\n\n\nX = [0] * N\nY = [0] * N\nfor i in range(N):\n X[i], Y[i] = list(map(Decimal, input().split()))\nans = 0\nfor i in range(N):\n if distance(0, X[i], 0, Y[i]) <= D:\n ans += 1\nprint(ans)\n", "measured_slow_code_sha256": "1559f276e022453eb8e8e92cd54d60648c4bba1cc009c4b0eef1eaf17b1ef72e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.6660241121578, "pair_id": "python_v2_5af0cd31334d1bb24233511b", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02595", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02595_92aca33b2d71b7102fdbc534c175eeae698c626cae626a7c08492217e2aeb790.jsonl.gz", "inputs": "reproduction/python/inputs/p02595.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02595_1559f276e022453eb8e8e92cd54d60648c4bba1cc009c4b0eef1eaf17b1ef72e.jsonl.gz"}, "slow_code": "from decimal import *\n\ngetcontext().prec = 50\nN, D = list(map(int, input().split()))\n\n\ndef distance(x1, x2, y1, y2):\n dx = x2 - x1\n dy = y2 - y1\n return (dx * dx + dy * dy).sqrt()\n\n\nX = [0] * N\nY = [0] * N\nfor i in range(N):\n X[i], Y[i] = list(map(Decimal, input().split()))\nans = 0\nfor i in range(N):\n if distance(0, X[i], 0, Y[i]) <= D:\n ans += 1\nprint(ans)\n", "slow_code_sha256": "1559f276e022453eb8e8e92cd54d60648c4bba1cc009c4b0eef1eaf17b1ef72e", "slow_id": "p02595_1559f276e022453eb8e8e92cd54d60648c4bba1cc009c4b0eef1eaf17b1ef72e", "speedup": 5.037991873839146, "stratum": "4-8", "within_pair_jaccard": 0.325, "workload": {"case_count": 100, "description": "Count listed plane points (X_i,Y_i) whose Euclidean distance from the origin is at most D; repeated points count separately. Observed inputs: N=1..200000 (median 100000); D=0..200000 (median 100000); X_i=-200000..200000; Y_i=-200000..200000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 3000082, "median": 1388902.0, "min": 8}, "input_format": ["N D\nX_1 Y_1\n...\nX_N Y_N"], "input_format_status": "source_input_section", "input_lines": {"max": 200001, "median": 100001.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 400002, "median": 200002.0, "min": 4}}} -{"case_ids": ["p01224_case_000", "p01224_case_001", "p01224_case_002", "p01224_case_003", "p01224_case_004", "p01224_case_005", "p01224_case_006", "p01224_case_007", "p01224_case_008", "p01224_case_009", "p01224_case_010", "p01224_case_011", "p01224_case_012", "p01224_case_013", "p01224_case_014", "p01224_case_015", "p01224_case_016", "p01224_case_017", "p01224_case_018", "p01224_case_019", "p01224_case_020", "p01224_case_021", "p01224_case_022", "p01224_case_023", "p01224_case_024", "p01224_case_025", "p01224_case_026", "p01224_case_027", "p01224_case_028", "p01224_case_029", "p01224_case_030", "p01224_case_031", "p01224_case_032", "p01224_case_033", "p01224_case_034", "p01224_case_035", "p01224_case_036", "p01224_case_037", "p01224_case_038", "p01224_case_039", "p01224_case_040", "p01224_case_041", "p01224_case_042", "p01224_case_043", "p01224_case_044", "p01224_case_045", "p01224_case_046", "p01224_case_047", "p01224_case_048", "p01224_case_049", "p01224_case_050", "p01224_case_051", "p01224_case_052", "p01224_case_053", "p01224_case_054", "p01224_case_055", "p01224_case_056", "p01224_case_057", "p01224_case_058", "p01224_case_059", "p01224_case_060", "p01224_case_061", "p01224_case_062", "p01224_case_063", "p01224_case_064", "p01224_case_065", "p01224_case_066", "p01224_case_067", "p01224_case_068", "p01224_case_069", "p01224_case_070", "p01224_case_071", "p01224_case_072", "p01224_case_073", "p01224_case_074", "p01224_case_075", "p01224_case_076", "p01224_case_077", "p01224_case_078", "p01224_case_079", "p01224_case_080", "p01224_case_081", "p01224_case_082", "p01224_case_083", "p01224_case_084", "p01224_case_085", "p01224_case_086", "p01224_case_087", "p01224_case_088", "p01224_case_089", "p01224_case_090", "p01224_case_091", "p01224_case_092", "p01224_case_093", "p01224_case_094", "p01224_case_095", "p01224_case_096", "p01224_case_097", "p01224_case_098", "p01224_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def div(n):\n ls = []\n i = 2\n while i * i <= n:\n c = 0\n if n % i == 0:\n while n % i == 0:\n n /= i\n c += 1\n if c > 0:\n ls.append([i, c])\n i += 1\n if n > 1:\n ls.append([n, 1])\n ans = 1\n for b, p in ls:\n ans *= (b ** (p + 1) - 1) / (b - 1)\n return ans\n\n\nwhile 1:\n n = eval(input())\n if n == 0:\n break\n d = div(n) - n\n if d == n:\n print(\"perfect number\")\n elif d < n:\n print(\"deficient number\")\n else:\n print(\"abundant number\")\n", "fast_code_sha256": "d0046c61dc6c94f15c0f18e7119bac1d2485c0a9e9a73bd737c9e975209bd15e", "fast_id": "p01224_d0046c61dc6c94f15c0f18e7119bac1d2485c0a9e9a73bd737c9e975209bd15e", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def div(n):\n ls = []\n i = 2\n while i * i <= n:\n c = 0\n if n % i == 0:\n while n % i == 0:\n n /= i\n c += 1\n if c > 0:\n ls.append([i, c])\n i += 1\n if n > 1:\n ls.append([n, 1])\n ans = 1\n for b, p in ls:\n ans *= (b ** (p + 1) - 1) / (b - 1)\n return ans\n\n\nwhile 1:\n n = eval(input())\n if n == 0:\n break\n d = div(n) - n\n if d == n:\n print(\"perfect number\")\n elif d < n:\n print(\"deficient number\")\n else:\n print(\"abundant number\")\n", "measured_fast_code_sha256": "d0046c61dc6c94f15c0f18e7119bac1d2485c0a9e9a73bd737c9e975209bd15e", "measured_slow_code": "from math import sqrt\n\nP = \"perfect number\"\nD = \"deficient number\"\nA = \"abundant number\"\nwhile True:\n n = eval(input())\n if n == 0:\n break\n if n == 1:\n print(D)\n continue\n su = 1\n temp = n\n for i in range(2, int(sqrt(n)) + 1):\n cnt = 0\n while temp % i == 0:\n temp /= i\n cnt += 1\n if cnt:\n su *= (i ** (cnt + 1) - 1) / (i - 1)\n if temp == 1:\n su -= n\n break\n if temp != 1:\n su *= (temp**2 - 1) / (temp - 1)\n su -= n\n print(P if n == su else (D if su < n else A))\n", "measured_slow_code_sha256": "66194bc1a7ae54de44e09b5f93d1f79e3416a467c501ca1310dc3f13610e492e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.1654861945608141, "pair_id": "python_v2_a3c3aa35c4a40d81f50c3f12", "per_case_slow_code_faster_fraction": 0.11, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p01224", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p01224_d0046c61dc6c94f15c0f18e7119bac1d2485c0a9e9a73bd737c9e975209bd15e.jsonl.gz", "inputs": "reproduction/python/inputs/p01224.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p01224_66194bc1a7ae54de44e09b5f93d1f79e3416a467c501ca1310dc3f13610e492e.jsonl.gz"}, "slow_code": "from math import sqrt\n\nP = \"perfect number\"\nD = \"deficient number\"\nA = \"abundant number\"\nwhile True:\n n = eval(input())\n if n == 0:\n break\n if n == 1:\n print(D)\n continue\n su = 1\n temp = n\n for i in range(2, int(sqrt(n)) + 1):\n cnt = 0\n while temp % i == 0:\n temp /= i\n cnt += 1\n if cnt:\n su *= (i ** (cnt + 1) - 1) / (i - 1)\n if temp == 1:\n su -= n\n break\n if temp != 1:\n su *= (temp**2 - 1) / (temp - 1)\n su -= n\n print(P if n == su else (D if su < n else A))\n", "slow_code_sha256": "66194bc1a7ae54de44e09b5f93d1f79e3416a467c501ca1310dc3f13610e492e", "slow_id": "p01224_66194bc1a7ae54de44e09b5f93d1f79e3416a467c501ca1310dc3f13610e492e", "speedup": 2.28201854381855, "stratum": "2-4", "within_pair_jaccard": 0.4186046511627907, "workload": {"case_count": 100, "description": "For each positive integer N, compare N with the sum of its positive divisors excluding N itself. Classify it as perfect, deficient or abundant when the sum equals, is below or exceeds N, respectively. A final zero ends the queries. Observed inputs: datasets=1..100 (median 50); N=1..100000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 896, "median": 202.0, "min": 4}, "input_format": ["N_1\n...\nN_D\n0"], "input_format_status": "source_input_section", "input_lines": {"max": 101, "median": 51.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 101, "median": 51.0, "min": 2}}} -{"case_ids": ["p03700_case_000", "p03700_case_001", "p03700_case_002", "p03700_case_003", "p03700_case_004", "p03700_case_005", "p03700_case_006", "p03700_case_007", "p03700_case_008", "p03700_case_009", "p03700_case_010", "p03700_case_011", "p03700_case_012", "p03700_case_013", "p03700_case_014", "p03700_case_015", "p03700_case_016", "p03700_case_017", "p03700_case_018", "p03700_case_019", "p03700_case_020", "p03700_case_021", "p03700_case_022", "p03700_case_023", "p03700_case_024", "p03700_case_025", "p03700_case_026", "p03700_case_027", "p03700_case_028", "p03700_case_029", "p03700_case_030", "p03700_case_031", "p03700_case_032", "p03700_case_033", "p03700_case_034", "p03700_case_035", "p03700_case_036", "p03700_case_037", "p03700_case_038", "p03700_case_039", "p03700_case_040", "p03700_case_041", "p03700_case_042", "p03700_case_043", "p03700_case_044", "p03700_case_045", "p03700_case_046", "p03700_case_047", "p03700_case_048", "p03700_case_049", "p03700_case_050", "p03700_case_051", "p03700_case_052", "p03700_case_053", "p03700_case_054", "p03700_case_055", "p03700_case_056", "p03700_case_057", "p03700_case_058", "p03700_case_059", "p03700_case_060", "p03700_case_061", "p03700_case_062", "p03700_case_063", "p03700_case_064", "p03700_case_065", "p03700_case_066", "p03700_case_067", "p03700_case_068", "p03700_case_069", "p03700_case_070", "p03700_case_071", "p03700_case_072", "p03700_case_073", "p03700_case_074", "p03700_case_075", "p03700_case_076", "p03700_case_077", "p03700_case_078", "p03700_case_079", "p03700_case_080", "p03700_case_081", "p03700_case_082", "p03700_case_083", "p03700_case_084", "p03700_case_085", "p03700_case_086", "p03700_case_087", "p03700_case_088", "p03700_case_089", "p03700_case_090", "p03700_case_091", "p03700_case_092", "p03700_case_093", "p03700_case_094", "p03700_case_095", "p03700_case_096", "p03700_case_097", "p03700_case_098", "p03700_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n, a, b = list(map(int, input().split()))\nh = [int(eval(input())) for i in range(n)]\nok = 10**9\nng = 0\nwhile abs(ok - ng) > 1:\n mid = (ok + ng) // 2\n l = [i - (mid * b) for i in h]\n cnt = 0\n for j in l:\n if j <= 0:\n continue\n cnt += (j + a - b - 1) // (a - b)\n if cnt <= mid:\n ok = mid\n else:\n ng = mid\nprint(ok)\n", "fast_code_sha256": "a60785b8426d7e81c1725887e6d0a4c4d8c11673456ba5f14f77e2618f11f6f9", "fast_id": "p03700_a60785b8426d7e81c1725887e6d0a4c4d8c11673456ba5f14f77e2618f11f6f9", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n, a, b = list(map(int, input().split()))\nh = [int(eval(input())) for i in range(n)]\nok = 10**9\nng = 0\nwhile abs(ok - ng) > 1:\n mid = (ok + ng) // 2\n l = [i - (mid * b) for i in h]\n cnt = 0\n for j in l:\n if j <= 0:\n continue\n cnt += (j + a - b - 1) // (a - b)\n if cnt <= mid:\n ok = mid\n else:\n ng = mid\nprint(ok)\n", "measured_fast_code_sha256": "a60785b8426d7e81c1725887e6d0a4c4d8c11673456ba5f14f77e2618f11f6f9", "measured_slow_code": "import numpy as np\n\nN, A, B = list(map(int, input().split()))\nH = np.zeros(shape=N, dtype=\"int64\")\nfor _ in range(N):\n h = int(eval(input()))\n H[_] = h\n\n\ndef calc(num, a):\n a -= num * B\n a = (a - 1) // (A - B) + 1\n if sum(a[a > 0]) <= num:\n return True\n else:\n return False\n\n\nstart = 0\nend = 10**10\nwhile end - start > 1:\n mid = (start + end) // 2\n if calc(mid, H.copy()):\n end = mid\n else:\n start = mid\nprint(end)\n", "measured_slow_code_sha256": "4f614769a7e22dddcb85c7a9aa9d9cee3d9896b34340a1e7d8590ac4705426eb", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 0.5312151634910443, "pair_id": "python_v2_95a8be0a437f0f2e358bddc6", "per_case_slow_code_faster_fraction": 0.75, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03700", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03700_a60785b8426d7e81c1725887e6d0a4c4d8c11673456ba5f14f77e2618f11f6f9.jsonl.gz", "inputs": "reproduction/python/inputs/p03700.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03700_4f614769a7e22dddcb85c7a9aa9d9cee3d9896b34340a1e7d8590ac4705426eb.jsonl.gz"}, "slow_code": "import numpy as np\n\nN, A, B = list(map(int, input().split()))\nH = np.zeros(shape=N, dtype=\"int64\")\nfor _ in range(N):\n h = int(eval(input()))\n H[_] = h\n\n\ndef calc(num, a):\n a -= num * B\n a = (a - 1) // (A - B) + 1\n if sum(a[a > 0]) <= num:\n return True\n else:\n return False\n\n\nstart = 0\nend = 10**10\nwhile end - start > 1:\n mid = (start + end) // 2\n if calc(mid, H.copy()):\n end = mid\n else:\n start = mid\nprint(end)\n", "slow_code_sha256": "4f614769a7e22dddcb85c7a9aa9d9cee3d9896b34340a1e7d8590ac4705426eb", "slow_id": "p03700_4f614769a7e22dddcb85c7a9aa9d9cee3d9896b34340a1e7d8590ac4705426eb", "speedup": 2.467930833773768, "stratum": "2-4", "within_pair_jaccard": 0.3584905660377358, "workload": {"case_count": 100, "description": "Each explosion targets one living monster for A damage and damages every other monster by B, with A>B. Monsters vanish at health <=0. Minimize explosions needed to eliminate all N monsters of initial health h_i. Observed inputs: N=1..100000 (median 100000); A=2..1000000000; B=1..999999999; h_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1100028, "median": 988832.0, "min": 10}, "input_format": ["N A B\nh_1\n...\nh_N"], "input_format_status": "source_input_section", "input_lines": {"max": 100001, "median": 100001.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100003, "median": 100003.0, "min": 4}}} -{"case_ids": ["p03796_case_000", "p03796_case_001", "p03796_case_002", "p03796_case_003", "p03796_case_004", "p03796_case_005", "p03796_case_006", "p03796_case_007", "p03796_case_008", "p03796_case_009", "p03796_case_010", "p03796_case_011", "p03796_case_012", "p03796_case_013", "p03796_case_014", "p03796_case_015", "p03796_case_016", "p03796_case_017", "p03796_case_018", "p03796_case_019", "p03796_case_020", "p03796_case_021", "p03796_case_022", "p03796_case_023", "p03796_case_024", "p03796_case_025", "p03796_case_026", "p03796_case_027", "p03796_case_028", "p03796_case_029", "p03796_case_030", "p03796_case_031", "p03796_case_032", "p03796_case_033", "p03796_case_034", "p03796_case_035", "p03796_case_036", "p03796_case_037", "p03796_case_038", "p03796_case_039", "p03796_case_040", "p03796_case_041", "p03796_case_042", "p03796_case_043", "p03796_case_044", "p03796_case_045", "p03796_case_046", "p03796_case_047", "p03796_case_048", "p03796_case_049", "p03796_case_050", "p03796_case_051", "p03796_case_052", "p03796_case_053", "p03796_case_054", "p03796_case_055", "p03796_case_056", "p03796_case_057", "p03796_case_058", "p03796_case_059", "p03796_case_060", "p03796_case_061", "p03796_case_062", "p03796_case_063", "p03796_case_064", "p03796_case_065", "p03796_case_066", "p03796_case_067", "p03796_case_068", "p03796_case_069", "p03796_case_070", "p03796_case_071", "p03796_case_072", "p03796_case_073", "p03796_case_074", "p03796_case_075", "p03796_case_076", "p03796_case_077", "p03796_case_078", "p03796_case_079", "p03796_case_080", "p03796_case_081", "p03796_case_082", "p03796_case_083", "p03796_case_084", "p03796_case_085", "p03796_case_086", "p03796_case_087", "p03796_case_088", "p03796_case_089", "p03796_case_090", "p03796_case_091", "p03796_case_092", "p03796_case_093", "p03796_case_094", "p03796_case_095", "p03796_case_096", "p03796_case_097", "p03796_case_098", "p03796_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\ndiv = 10**9 + 7\npw = 1\nfor i in range(1, n + 1):\n pw = (pw * i) % div\nprint(pw)\n", "fast_code_sha256": "ebaf3ef7c61474a4570db542d9b5c8080aa17b3e30b9593f9eda4c5f05c12d3a", "fast_id": "p03796_ebaf3ef7c61474a4570db542d9b5c8080aa17b3e30b9593f9eda4c5f05c12d3a", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\ndiv = 10**9 + 7\npw = 1\nfor i in range(1, n + 1):\n pw = (pw * i) % div\nprint(pw)\n", "measured_fast_code_sha256": "ebaf3ef7c61474a4570db542d9b5c8080aa17b3e30b9593f9eda4c5f05c12d3a", "measured_slow_code": "# ABC 055: B – Training Camp\nfrom math import factorial\n\nn = int(eval(input()))\nprint((factorial(n) % (10**9 + 7)))\n", "measured_slow_code_sha256": "43b257e85e546d9470ced772c67918bde77d5626a2fd04dea2e6a84c615224a5", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4.058250745843973, "pair_id": "python_v2_e1e344641bf895016716e68f", "per_case_slow_code_faster_fraction": 0.35, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03796", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03796_ebaf3ef7c61474a4570db542d9b5c8080aa17b3e30b9593f9eda4c5f05c12d3a.jsonl.gz", "inputs": "reproduction/python/inputs/p03796.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03796_43b257e85e546d9470ced772c67918bde77d5626a2fd04dea2e6a84c615224a5.jsonl.gz"}, "slow_code": "from math import factorial\n\nn = int(eval(input()))\nprint((factorial(n) % (10**9 + 7)))\n", "slow_code_sha256": "5ff598b9800e1bd896356b079e05a6afa89737def3d95243ef8ae46ed85960b1", "slow_id": "p03796_43b257e85e546d9470ced772c67918bde77d5626a2fd04dea2e6a84c615224a5", "speedup": 2.491454538047646, "stratum": "2-4", "within_pair_jaccard": 0.42105263157894735, "workload": {"case_count": 100, "description": "Starting with power 1, multiply it by i for i=1..N in order. Output the final power modulo 1000000007. Observed inputs: N=1..100000 (median 31648.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 7, "median": 6.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p03240_case_000", "p03240_case_001", "p03240_case_002", "p03240_case_003", "p03240_case_004", "p03240_case_005", "p03240_case_006", "p03240_case_007", "p03240_case_008", "p03240_case_009", "p03240_case_010", "p03240_case_011", "p03240_case_012", "p03240_case_013", "p03240_case_014", "p03240_case_015", "p03240_case_016", "p03240_case_017", "p03240_case_018", "p03240_case_019", "p03240_case_020", "p03240_case_021", "p03240_case_022", "p03240_case_023", "p03240_case_024", "p03240_case_025", "p03240_case_026", "p03240_case_027", "p03240_case_028", "p03240_case_029", "p03240_case_030", "p03240_case_031", "p03240_case_032", "p03240_case_033", "p03240_case_034", "p03240_case_035", "p03240_case_036", "p03240_case_037", "p03240_case_038", "p03240_case_039", "p03240_case_040", "p03240_case_041", "p03240_case_042", "p03240_case_043", "p03240_case_044", "p03240_case_045", "p03240_case_046", "p03240_case_047", "p03240_case_048", "p03240_case_049", "p03240_case_050", "p03240_case_051", "p03240_case_052", "p03240_case_053", "p03240_case_054", "p03240_case_055", "p03240_case_056", "p03240_case_057", "p03240_case_058", "p03240_case_059", "p03240_case_060", "p03240_case_061", "p03240_case_062", "p03240_case_063", "p03240_case_064", "p03240_case_065", "p03240_case_066", "p03240_case_067", "p03240_case_068", "p03240_case_069", "p03240_case_070", "p03240_case_071", "p03240_case_072", "p03240_case_073", "p03240_case_074", "p03240_case_075", "p03240_case_076", "p03240_case_077", "p03240_case_078", "p03240_case_079", "p03240_case_080", "p03240_case_081", "p03240_case_082", "p03240_case_083", "p03240_case_084", "p03240_case_085", "p03240_case_086", "p03240_case_087", "p03240_case_088", "p03240_case_089", "p03240_case_090", "p03240_case_091", "p03240_case_092", "p03240_case_093", "p03240_case_094", "p03240_case_095", "p03240_case_096", "p03240_case_097", "p03240_case_098", "p03240_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "executable_AST_equal_except_explicit_explanatory_string_removal_and_all_frozen_inputs_checker_pass", "fast_code": "n = int(input())\nXYH = []\nfor _ in range(n):\n x, y, h = map(int, input().split())\n if h != 0:\n XYH.append([x, y, h])\nflag = False\nans = XYH[0]\nfor i in range(101):\n for j in range(101):\n tempH = abs(XYH[0][0] - i) + abs(XYH[0][1] - j) + XYH[0][2]\n for x, y, h in XYH[1:]:\n if abs(x - i) + abs(y - j) + h != tempH:\n flag = False\n break\n else:\n flag = True\n if flag:\n ans = [i, j, tempH]\n break\n if flag:\n break\nprint(*ans, sep=\" \")\n", "fast_code_sha256": "7d152829fabdaf68d6940ede064ea95c3e04f687d89b63c8893ae52fbdbff32d", "fast_id": "p03240_7d152829fabdaf68d6940ede064ea95c3e04f687d89b63c8893ae52fbdbff32d", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(input())\nXYH = []\nfor _ in range(n):\n x, y, h = map(int, input().split())\n if h != 0:\n XYH.append([x, y, h])\nflag = False\nans = XYH[0]\nfor i in range(101):\n for j in range(101):\n tempH = abs(XYH[0][0] - i) + abs(XYH[0][1] - j) + XYH[0][2]\n for x, y, h in XYH[1:]:\n if abs(x - i) + abs(y - j) + h != tempH:\n flag = False\n break\n else:\n flag = True\n if flag:\n ans = [i, j, tempH]\n break\n if flag:\n break\nprint(*ans, sep=\" \")\n", "measured_fast_code_sha256": "7d152829fabdaf68d6940ede064ea95c3e04f687d89b63c8893ae52fbdbff32d", "measured_slow_code": "import numpy as np\n\nN = int(eval(input()))\nx, y, h = np.array([list(map(int, input().split())) for i in range(N)]).T\n\"\"\"\nx = [0 for i in range(N)]\ny = [0 for i in range(N)]\nh = [0 for i in range(N)]\nfor i in range(N):\n x[i], y[i], h[i] = map(int, input().split())\n\"\"\"\nH = 0\nCx = 0\nCy = 0\nFlag = True\nfor i in range(101):\n for j in range(101):\n Flag = True\n for k in range(N):\n if h[k] != 0:\n H = h[k] + abs(i - x[k]) + abs(j - y[k])\n break\n for k in range(N):\n if h[k] != max(H - abs(i - x[k]) - abs(j - y[k]), 0):\n Flag = False\n break\n if Flag:\n Cx, Cy = i, j\n break\n if Flag:\n break\nprint((\"{} {} {}\".format(Cx, Cy, H)))\n", "measured_slow_code_sha256": "7335b8f814fadff817ea3d797eb47069b6471e295b0639a1a649c1b8aea437e5", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 13.570163187252053, "pair_id": "python_v2_de296a49ff1e7e84680960ca", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03240", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03240_7d152829fabdaf68d6940ede064ea95c3e04f687d89b63c8893ae52fbdbff32d.jsonl.gz", "inputs": "reproduction/python/inputs/p03240.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03240_7335b8f814fadff817ea3d797eb47069b6471e295b0639a1a649c1b8aea437e5.jsonl.gz"}, "slow_code": "import numpy as np\n\nN = int(eval(input()))\nx, y, h = np.array([list(map(int, input().split())) for i in range(N)]).T\nH = 0\nCx = 0\nCy = 0\nFlag = True\nfor i in range(101):\n for j in range(101):\n Flag = True\n for k in range(N):\n if h[k] != 0:\n H = h[k] + abs(i - x[k]) + abs(j - y[k])\n break\n for k in range(N):\n if h[k] != max(H - abs(i - x[k]) - abs(j - y[k]), 0):\n Flag = False\n break\n if Flag:\n Cx, Cy = i, j\n break\n if Flag:\n break\nprint((\"{} {} {}\".format(Cx, Cy, H)))\n", "slow_code_sha256": "2b73a8d0ed51a5904d37fa90f680662d0779f1a36233aa1fe89473f78eb7c3e5", "slow_id": "p03240_7335b8f814fadff817ea3d797eb47069b6471e295b0639a1a649c1b8aea437e5", "speedup": 16.770774008716316, "stratum": "8+", "within_pair_jaccard": 0.425531914893617, "workload": {"case_count": 100, "description": "Recover unique integer center (C_X,C_Y) in 0..100 and height H>=1 from N distinct observations (x_i,y_i,h_i) satisfying h_i=max(H-|x_i-C_X|-|y_i-C_Y|,0). Observed inputs: N=3..100 (median 50); x_i=0..100; y_i=0..100; h_i=1299707..999999997.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1594, "median": 798.0, "min": 49}, "input_format": ["N\nx_1 y_1 h_1\n...\nx_N y_N h_N"], "input_format_status": "source_input_section", "input_lines": {"max": 101, "median": 51.0, "min": 4}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 301, "median": 151.0, "min": 10}}} -{"case_ids": ["p03371_case_000", "p03371_case_001", "p03371_case_002", "p03371_case_003", "p03371_case_004", "p03371_case_005", "p03371_case_006", "p03371_case_007", "p03371_case_008", "p03371_case_009", "p03371_case_010", "p03371_case_011", "p03371_case_012", "p03371_case_013", "p03371_case_014", "p03371_case_015", "p03371_case_016", "p03371_case_017", "p03371_case_018", "p03371_case_019", "p03371_case_020", "p03371_case_021", "p03371_case_022", "p03371_case_023", "p03371_case_024", "p03371_case_025", "p03371_case_026", "p03371_case_027", "p03371_case_028", "p03371_case_029", "p03371_case_030", "p03371_case_031", "p03371_case_032", "p03371_case_033", "p03371_case_034", "p03371_case_035", "p03371_case_036", "p03371_case_037", "p03371_case_038", "p03371_case_039", "p03371_case_040", "p03371_case_041", "p03371_case_042", "p03371_case_043", "p03371_case_044", "p03371_case_045", "p03371_case_046", "p03371_case_047", "p03371_case_048", "p03371_case_049", "p03371_case_050", "p03371_case_051", "p03371_case_052", "p03371_case_053", "p03371_case_054", "p03371_case_055", "p03371_case_056", "p03371_case_057", "p03371_case_058", "p03371_case_059", "p03371_case_060", "p03371_case_061", "p03371_case_062", "p03371_case_063", "p03371_case_064", "p03371_case_065", "p03371_case_066", "p03371_case_067", "p03371_case_068", "p03371_case_069", "p03371_case_070", "p03371_case_071", "p03371_case_072", "p03371_case_073", "p03371_case_074", "p03371_case_075", "p03371_case_076", "p03371_case_077", "p03371_case_078", "p03371_case_079", "p03371_case_080", "p03371_case_081", "p03371_case_082", "p03371_case_083", "p03371_case_084", "p03371_case_085", "p03371_case_086", "p03371_case_087", "p03371_case_088", "p03371_case_089", "p03371_case_090", "p03371_case_091", "p03371_case_092", "p03371_case_093", "p03371_case_094", "p03371_case_095", "p03371_case_096", "p03371_case_097", "p03371_case_098", "p03371_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "a, b, c, x, y = list(map(int, input().split()))\nans = 0\nif a + b > c * 2:\n z = min(x, y)\n ans += z * c * 2\n x -= z\n y -= z\nif a > c * 2:\n ans += x * c * 2\n y = max(0, y - x)\n x = 0\nif b > c * 2:\n ans += y * c * 2\n x = max(0, x - y)\n y = 0\nans += a * x\nans += b * y\nprint(ans)\n", "fast_code_sha256": "35a33dad8f5be8890baa9526d964785e035e1a32a1d1dfea596700d61ebeae76", "fast_id": "p03371_35a33dad8f5be8890baa9526d964785e035e1a32a1d1dfea596700d61ebeae76", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "a, b, c, x, y = list(map(int, input().split()))\nans = 0\nif a + b > c * 2:\n z = min(x, y)\n ans += z * c * 2\n x -= z\n y -= z\nif a > c * 2:\n ans += x * c * 2\n y = max(0, y - x)\n x = 0\nif b > c * 2:\n ans += y * c * 2\n x = max(0, x - y)\n y = 0\nans += a * x\nans += b * y\nprint(ans)\n", "measured_fast_code_sha256": "35a33dad8f5be8890baa9526d964785e035e1a32a1d1dfea596700d61ebeae76", "measured_slow_code": "a, b, c, x, y = list(map(int, input().split()))\nmi = 10**10\nfor i in range(10**6):\n cost = c * 2 * i + a * max((x - i), 0) + b * max((y - i), 0)\n if cost < mi:\n mi = cost\nprint(mi)\n", "measured_slow_code_sha256": "d423368c3404af0d794647ac92b41960ae5bb9ea8edef19ff71fb40275e2bb52", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 9993.113725870176, "pair_id": "python_v2_f5f07a17333193d2ce31f610", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03371", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03371_35a33dad8f5be8890baa9526d964785e035e1a32a1d1dfea596700d61ebeae76.jsonl.gz", "inputs": "reproduction/python/inputs/p03371.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03371_d423368c3404af0d794647ac92b41960ae5bb9ea8edef19ff71fb40275e2bb52.jsonl.gz"}, "slow_code": "a, b, c, x, y = list(map(int, input().split()))\nmi = 10**10\nfor i in range(10**6):\n cost = c * 2 * i + a * max((x - i), 0) + b * max((y - i), 0)\n if cost < mi:\n mi = cost\nprint(mi)\n", "slow_code_sha256": "d423368c3404af0d794647ac92b41960ae5bb9ea8edef19ff71fb40275e2bb52", "slow_id": "p03371_d423368c3404af0d794647ac92b41960ae5bb9ea8edef19ff71fb40275e2bb52", "speedup": 9922.722516007161, "stratum": "8+", "within_pair_jaccard": 0.5769230769230769, "workload": {"case_count": 100, "description": "Whole pizzas of types A and B cost A and B; a mixed half-A/half-B pizza costs C. Buy at least X whole-A and Y whole-B equivalents, combining mixed pizzas in pairs. Minimize cost; surplus is allowed. Observed inputs: A=1..5000; B=1..5000; C=1..5000; X=1..100000 (median 56080.5); Y=1..100000 (median 40245).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 29, "median": 25.5, "min": 10}, "input_format": ["A B C X Y"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 5, "median": 5.0, "min": 5}}} -{"case_ids": ["p02556_case_000", "p02556_case_001", "p02556_case_002", "p02556_case_003", "p02556_case_004", "p02556_case_005", "p02556_case_006", "p02556_case_007", "p02556_case_008", "p02556_case_009", "p02556_case_010", "p02556_case_011", "p02556_case_012", "p02556_case_013", "p02556_case_014", "p02556_case_015", "p02556_case_016", "p02556_case_017", "p02556_case_018", "p02556_case_019", "p02556_case_020", "p02556_case_021", "p02556_case_022", "p02556_case_023", "p02556_case_024", "p02556_case_025", "p02556_case_026", "p02556_case_027", "p02556_case_028", "p02556_case_029", "p02556_case_030", "p02556_case_031", "p02556_case_032", "p02556_case_033", "p02556_case_034", "p02556_case_035", "p02556_case_036", "p02556_case_037", "p02556_case_038", "p02556_case_039", "p02556_case_040", "p02556_case_041", "p02556_case_042", "p02556_case_043", "p02556_case_044", "p02556_case_045", "p02556_case_046", "p02556_case_047", "p02556_case_048", "p02556_case_049", "p02556_case_050", "p02556_case_051", "p02556_case_052", "p02556_case_053", "p02556_case_054", "p02556_case_055", "p02556_case_056", "p02556_case_057", "p02556_case_058", "p02556_case_059", "p02556_case_060", "p02556_case_061", "p02556_case_062", "p02556_case_063", "p02556_case_064", "p02556_case_065", "p02556_case_066", "p02556_case_067", "p02556_case_068", "p02556_case_069", "p02556_case_070", "p02556_case_071", "p02556_case_072", "p02556_case_073", "p02556_case_074", "p02556_case_075", "p02556_case_076", "p02556_case_077", "p02556_case_078", "p02556_case_079", "p02556_case_080", "p02556_case_081", "p02556_case_082", "p02556_case_083", "p02556_case_084", "p02556_case_085", "p02556_case_086", "p02556_case_087", "p02556_case_088", "p02556_case_089", "p02556_case_090", "p02556_case_091", "p02556_case_092", "p02556_case_093", "p02556_case_094", "p02556_case_095", "p02556_case_096", "p02556_case_097", "p02556_case_098", "p02556_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def main():\n point_count = int(eval(input()))\n sums = set()\n diffs = set()\n for _ in range(point_count):\n x, y = [int(x) for x in input().split()]\n sums.add(x + y)\n diffs.add(x - y)\n pat_sum = max(sums) - min(sums)\n pat_diff = max(diffs) - min(diffs)\n return max(pat_sum, pat_diff)\n\n\nif __name__ == \"__main__\":\n print((main()))\n", "fast_code_sha256": "5ced6e0b952d86ed809d917d485c647faa0cc370d7b4fdcc6c1cd87683767c80", "fast_id": "p02556_7896bc590cfdf788519614e85615135d8291cfa5c7b9f8a2aaf117c848422c17", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def main():\n point_count = int(eval(input()))\n sums = set()\n diffs = set()\n for _ in range(point_count):\n x, y = [int(x) for x in input().split()]\n sums.add(x + y)\n diffs.add(x - y)\n pat_sum = max(sums) - min(sums) # max (Xi + Yi) - (Xj + Yj)\n pat_diff = max(diffs) - min(diffs) # max (Xi - Yi) - (Xj - Yj)\n return max(pat_sum, pat_diff)\n\n\nif __name__ == \"__main__\":\n print((main()))\n", "measured_fast_code_sha256": "7896bc590cfdf788519614e85615135d8291cfa5c7b9f8a2aaf117c848422c17", "measured_slow_code": "N = int(eval(input()))\n\n\ndef dist(A, B):\n return abs(A[0] - B[0]) + abs(A[1] - B[1])\n\n\nXY = [tuple(map(int, input().split())) for _ in range(N)]\nINF = -(10**10)\nans = 0\nfor O in [(INF, INF), (-INF, INF), (INF, -INF), (-INF, -INF)]:\n S = XY[0]\n for xy in XY:\n if dist(O, S) < dist(O, xy):\n S = xy\n O = S\n for xy in XY:\n if dist(O, S) < dist(O, xy):\n S = xy\n ans = max(ans, dist(O, S))\nprint(ans)\n", "measured_slow_code_sha256": "05dfc996f7e3842463d6cd57d02877a281066db95acd7311507e26b5daabff76", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4.63624362559505, "pair_id": "python_v2_68844ff491b617268b215b1f", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02556", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02556_7896bc590cfdf788519614e85615135d8291cfa5c7b9f8a2aaf117c848422c17.jsonl.gz", "inputs": "reproduction/python/inputs/p02556.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02556_05dfc996f7e3842463d6cd57d02877a281066db95acd7311507e26b5daabff76.jsonl.gz"}, "slow_code": "N = int(eval(input()))\n\n\ndef dist(A, B):\n return abs(A[0] - B[0]) + abs(A[1] - B[1])\n\n\nXY = [tuple(map(int, input().split())) for _ in range(N)]\nINF = -(10**10)\nans = 0\nfor O in [(INF, INF), (-INF, INF), (INF, -INF), (-INF, -INF)]:\n S = XY[0]\n for xy in XY:\n if dist(O, S) < dist(O, xy):\n S = xy\n O = S\n for xy in XY:\n if dist(O, S) < dist(O, xy):\n S = xy\n ans = max(ans, dist(O, S))\nprint(ans)\n", "slow_code_sha256": "05dfc996f7e3842463d6cd57d02877a281066db95acd7311507e26b5daabff76", "slow_id": "p02556_05dfc996f7e3842463d6cd57d02877a281066db95acd7311507e26b5daabff76", "speedup": 3.119564157461502, "stratum": "2-4", "within_pair_jaccard": 0.30952380952380953, "workload": {"case_count": 100, "description": "Find the maximum Manhattan distance |x_i-x_j|+|y_i-y_j| between two distinct indexed points among N. Repeated coordinates are allowed. Observed inputs: N=2..200000 (median 1000); x_i=1..1000000000; y_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 4000007, "median": 19715.0, "min": 28}, "input_format": ["N\nx_1 y_1\n...\nx_N y_N"], "input_format_status": "source_input_section", "input_lines": {"max": 200001, "median": 1001.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 400001, "median": 2001.0, "min": 5}}} -{"case_ids": ["p03762_case_000", "p03762_case_001", "p03762_case_002", "p03762_case_003", "p03762_case_004", "p03762_case_005", "p03762_case_006", "p03762_case_007", "p03762_case_008", "p03762_case_009", "p03762_case_010", "p03762_case_011", "p03762_case_012", "p03762_case_013", "p03762_case_014", "p03762_case_015", "p03762_case_016", "p03762_case_017", "p03762_case_018", "p03762_case_019", "p03762_case_020", "p03762_case_021", "p03762_case_022", "p03762_case_023", "p03762_case_024", "p03762_case_025", "p03762_case_026", "p03762_case_027", "p03762_case_028", "p03762_case_029", "p03762_case_030", "p03762_case_031", "p03762_case_032", "p03762_case_033", "p03762_case_034", "p03762_case_035", "p03762_case_036", "p03762_case_037", "p03762_case_038", "p03762_case_039", "p03762_case_040", "p03762_case_041", "p03762_case_042", "p03762_case_043", "p03762_case_044", "p03762_case_045", "p03762_case_046", "p03762_case_047", "p03762_case_048", "p03762_case_049", "p03762_case_050", "p03762_case_051", "p03762_case_052", "p03762_case_053", "p03762_case_054", "p03762_case_055", "p03762_case_056", "p03762_case_057", "p03762_case_058", "p03762_case_059", "p03762_case_060", "p03762_case_061", "p03762_case_062", "p03762_case_063", "p03762_case_064", "p03762_case_065", "p03762_case_066", "p03762_case_067", "p03762_case_068", "p03762_case_069", "p03762_case_070", "p03762_case_071", "p03762_case_072", "p03762_case_073", "p03762_case_074", "p03762_case_075", "p03762_case_076", "p03762_case_077", "p03762_case_078", "p03762_case_079", "p03762_case_080", "p03762_case_081", "p03762_case_082", "p03762_case_083", "p03762_case_084", "p03762_case_085", "p03762_case_086", "p03762_case_087", "p03762_case_088", "p03762_case_089", "p03762_case_090", "p03762_case_091", "p03762_case_092", "p03762_case_093", "p03762_case_094", "p03762_case_095", "p03762_case_096", "p03762_case_097", "p03762_case_098", "p03762_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n, m = list(map(int, input().split()))\nx = list(map(int, input().split()))\ny = list(map(int, input().split()))\nmod = 10**9 + 7\nx.sort()\ny.sort()\nsx, sy = 0, 0\nfor k in range(1, n + 1):\n sx += (2 * k - n - 1) * x[k - 1]\n sx %= mod\nfor k in range(1, m + 1):\n sy += (2 * k - m - 1) * y[k - 1]\n sy %= mod\nprint(((sx * sy) % mod))\n", "fast_code_sha256": "cf141fe4be37a735643ffdfdad9e379eeef8fe630c6da705b023ec631614c21e", "fast_id": "p03762_cf141fe4be37a735643ffdfdad9e379eeef8fe630c6da705b023ec631614c21e", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n, m = list(map(int, input().split()))\nx = list(map(int, input().split()))\ny = list(map(int, input().split()))\nmod = 10**9 + 7\nx.sort()\ny.sort()\nsx, sy = 0, 0\nfor k in range(1, n + 1):\n sx += (2 * k - n - 1) * x[k - 1]\n sx %= mod\nfor k in range(1, m + 1):\n sy += (2 * k - m - 1) * y[k - 1]\n sy %= mod\nprint(((sx * sy) % mod))\n", "measured_fast_code_sha256": "cf141fe4be37a735643ffdfdad9e379eeef8fe630c6da705b023ec631614c21e", "measured_slow_code": "import sys\nimport numpy as np\n\nMOD = 10**9 + 7\nI = np.array(sys.stdin.read().split(), dtype=np.int64)\nn, m = I[:2]\nx = I[2 : 2 + n]\ny = I[2 + n :]\n\n\ndef main():\n sx = np.cumsum(x) % MOD\n sy = np.cumsum(y) % MOD\n sdx = (\n np.sum((sx[n - 1] - sx[: n - 1]) - x[: n - 1] * ((n - 1) - np.arange(n - 1)))\n % MOD\n )\n sdy = (\n np.sum((sy[m - 1] - sy[: m - 1]) - y[: m - 1] * ((m - 1) - np.arange(m - 1)))\n % MOD\n )\n ans = sdx * sdy % MOD\n return ans\n\n\nif __name__ == \"__main__\":\n ans = main()\n print(ans)\n", "measured_slow_code_sha256": "982e2a132ff9a9ee086902a77e4d38984ae35b417d1949db3c426a0eec331800", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.1984493351823455, "pair_id": "python_v2_0e29d3bca22ccc9e8c2da979", "per_case_slow_code_faster_fraction": 0.34, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03762", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03762_cf141fe4be37a735643ffdfdad9e379eeef8fe630c6da705b023ec631614c21e.jsonl.gz", "inputs": "reproduction/python/inputs/p03762.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03762_982e2a132ff9a9ee086902a77e4d38984ae35b417d1949db3c426a0eec331800.jsonl.gz"}, "slow_code": "import sys\nimport numpy as np\n\nMOD = 10**9 + 7\nI = np.array(sys.stdin.read().split(), dtype=np.int64)\nn, m = I[:2]\nx = I[2 : 2 + n]\ny = I[2 + n :]\n\n\ndef main():\n sx = np.cumsum(x) % MOD\n sy = np.cumsum(y) % MOD\n sdx = (\n np.sum((sx[n - 1] - sx[: n - 1]) - x[: n - 1] * ((n - 1) - np.arange(n - 1)))\n % MOD\n )\n sdy = (\n np.sum((sy[m - 1] - sy[: m - 1]) - y[: m - 1] * ((m - 1) - np.arange(m - 1)))\n % MOD\n )\n ans = sdx * sdy % MOD\n return ans\n\n\nif __name__ == \"__main__\":\n ans = main()\n print(ans)\n", "slow_code_sha256": "982e2a132ff9a9ee086902a77e4d38984ae35b417d1949db3c426a0eec331800", "slow_id": "p03762_982e2a132ff9a9ee086902a77e4d38984ae35b417d1949db3c426a0eec331800", "speedup": 7.441421262598347, "stratum": "4-8", "within_pair_jaccard": 0.2708333333333333, "workload": {"case_count": 100, "description": "Vertical lines x=x_i and horizontal lines y=y_i have strictly increasing coordinate lists. Sum areas of all rectangles formed by choosing two lines of each orientation, modulo 1000000007. Observed inputs: n=2..100000 (median 50000); m=2..100000 (median 50000); x_i=-1000000000..1000000000; y_i=-1000000000..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 2200016, "median": 1038968.5, "min": 44}, "input_format": ["n m\nx_1 ... x_n\ny_1 ... y_m"], "input_format_status": "source_input_section", "input_lines": {"max": 3, "median": 3.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200002, "median": 100003.0, "min": 6}}} -{"case_ids": ["p03251_case_000", "p03251_case_001", "p03251_case_002", "p03251_case_003", "p03251_case_004", "p03251_case_005", "p03251_case_006", "p03251_case_007", "p03251_case_008", "p03251_case_009", "p03251_case_010", "p03251_case_011", "p03251_case_012", "p03251_case_013", "p03251_case_014", "p03251_case_015", "p03251_case_016", "p03251_case_017", "p03251_case_018", "p03251_case_019", "p03251_case_020", "p03251_case_021", "p03251_case_022", "p03251_case_023", "p03251_case_024", "p03251_case_025", "p03251_case_026", "p03251_case_027", "p03251_case_028", "p03251_case_029", "p03251_case_030", "p03251_case_031", "p03251_case_032", "p03251_case_033", "p03251_case_034", "p03251_case_035", "p03251_case_036", "p03251_case_037", "p03251_case_038", "p03251_case_039", "p03251_case_040", "p03251_case_041", "p03251_case_042", "p03251_case_043", "p03251_case_044", "p03251_case_045", "p03251_case_046", "p03251_case_047", "p03251_case_048", "p03251_case_049", "p03251_case_050", "p03251_case_051", "p03251_case_052", "p03251_case_053", "p03251_case_054", "p03251_case_055", "p03251_case_056", "p03251_case_057", "p03251_case_058", "p03251_case_059", "p03251_case_060", "p03251_case_061", "p03251_case_062", "p03251_case_063", "p03251_case_064", "p03251_case_065", "p03251_case_066", "p03251_case_067", "p03251_case_068", "p03251_case_069", "p03251_case_070", "p03251_case_071", "p03251_case_072", "p03251_case_073", "p03251_case_074", "p03251_case_075", "p03251_case_076", "p03251_case_077", "p03251_case_078", "p03251_case_079", "p03251_case_080", "p03251_case_081", "p03251_case_082", "p03251_case_083", "p03251_case_084", "p03251_case_085", "p03251_case_086", "p03251_case_087", "p03251_case_088", "p03251_case_089", "p03251_case_090", "p03251_case_091", "p03251_case_092", "p03251_case_093", "p03251_case_094", "p03251_case_095", "p03251_case_096", "p03251_case_097", "p03251_case_098", "p03251_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N, M, X, Y = list(map(int, input().split()))\nx = list(map(int, input().split()))\ny = list(map(int, input().split()))\nans = \"War\"\nfor z in range(X + 1, Y + 1):\n if max(x) < z and min(y) >= z:\n ans = \"No War\"\n break\nprint(ans)\n", "fast_code_sha256": "4ceb26db4c28db0cf02b68d638230008074a8dd18112e92c3750c45d16a6d663", "fast_id": "p03251_4ceb26db4c28db0cf02b68d638230008074a8dd18112e92c3750c45d16a6d663", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N, M, X, Y = list(map(int, input().split()))\nx = list(map(int, input().split()))\ny = list(map(int, input().split()))\nans = \"War\"\nfor z in range(X + 1, Y + 1):\n if max(x) < z and min(y) >= z:\n ans = \"No War\"\n break\nprint(ans)\n", "measured_fast_code_sha256": "4ceb26db4c28db0cf02b68d638230008074a8dd18112e92c3750c45d16a6d663", "measured_slow_code": "# -*- coding: utf-8 -*-\nimport bisect\nimport heapq\nimport math\nimport random\nimport sys\nfrom collections import Counter, defaultdict, deque\nfrom decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal\nfrom functools import lru_cache, reduce\nfrom itertools import combinations, combinations_with_replacement, product, permutations\nfrom operator import add, mul, sub\n\nsys.setrecursionlimit(10000)\n\n\ndef read_int():\n return int(input())\n\n\ndef read_int_n():\n return list(map(int, input().split()))\n\n\ndef read_float():\n return float(input())\n\n\ndef read_float_n():\n return list(map(float, input().split()))\n\n\ndef read_str():\n return input().strip()\n\n\ndef read_str_n():\n return list(map(str, input().split()))\n\n\ndef error_print(*args):\n print(*args, file=sys.stderr)\n\n\ndef mt(f):\n import time\n\n def wrap(*args, **kwargs):\n s = time.time()\n ret = f(*args, **kwargs)\n e = time.time()\n error_print(e - s, \"sec\")\n return ret\n\n return wrap\n\n\n@mt\ndef slv(N, M, X, Y, x, y):\n mx = max(x)\n my = min(y)\n error_print(mx, my)\n if mx < my and (my > X and mx < Y):\n return \"No War\"\n return \"War\"\n\n\ndef main():\n N, M, X, Y = read_int_n()\n x = read_int_n()\n y = read_int_n()\n print(slv(N, M, X, Y, x, y))\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "5ce8798f598c49e1a4c395a4c8846ff472fdaac4991833a8da4555eab052e27f", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 7.3539975495322, "pair_id": "python_v2_3cf48b67b78b7cff934ad633", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03251", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03251_4ceb26db4c28db0cf02b68d638230008074a8dd18112e92c3750c45d16a6d663.jsonl.gz", "inputs": "reproduction/python/inputs/p03251.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03251_5ce8798f598c49e1a4c395a4c8846ff472fdaac4991833a8da4555eab052e27f.jsonl.gz"}, "slow_code": "import bisect\nimport heapq\nimport math\nimport random\nimport sys\nfrom collections import Counter, defaultdict, deque\nfrom decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal\nfrom functools import lru_cache, reduce\nfrom itertools import combinations, combinations_with_replacement, product, permutations\nfrom operator import add, mul, sub\n\nsys.setrecursionlimit(10000)\n\n\ndef read_int():\n return int(input())\n\n\ndef read_int_n():\n return list(map(int, input().split()))\n\n\ndef read_float():\n return float(input())\n\n\ndef read_float_n():\n return list(map(float, input().split()))\n\n\ndef read_str():\n return input().strip()\n\n\ndef read_str_n():\n return list(map(str, input().split()))\n\n\ndef error_print(*args):\n print(*args, file=sys.stderr)\n\n\ndef mt(f):\n import time\n\n def wrap(*args, **kwargs):\n s = time.time()\n ret = f(*args, **kwargs)\n e = time.time()\n error_print(e - s, \"sec\")\n return ret\n\n return wrap\n\n\n@mt\ndef slv(N, M, X, Y, x, y):\n mx = max(x)\n my = min(y)\n error_print(mx, my)\n if mx < my and (my > X and mx < Y):\n return \"No War\"\n return \"War\"\n\n\ndef main():\n N, M, X, Y = read_int_n()\n x = read_int_n()\n y = read_int_n()\n print(slv(N, M, X, Y, x, y))\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "5a881080c64c83352de556b20fff7b0700f2ff443a5f03182fd4ed0f3d7f6e7c", "slow_id": "p03251_5ce8798f598c49e1a4c395a4c8846ff472fdaac4991833a8da4555eab052e27f", "speedup": 6.464422194932198, "stratum": "4-8", "within_pair_jaccard": 0.21428571428571427, "workload": {"case_count": 100, "description": "Determine whether an integer Z satisfies X=Z. Each coordinate list is distinct internally and excludes its own capital X or Y. Lists are not necessarily sorted. Observed inputs: N=1..100 (median 50); M=1..100 (median 50); X=-100..99; Y=-99..100; x_i=-100..100; y_i=-100..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 706, "median": 356.0, "min": 20}, "input_format": ["N M X Y\nx_1 ... x_N\ny_1 ... y_M"], "input_format_status": "source_input_section", "input_lines": {"max": 3, "median": 3.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 204, "median": 104.0, "min": 6}}} -{"case_ids": ["p03737_case_000", "p03737_case_001", "p03737_case_002", "p03737_case_003", "p03737_case_004", "p03737_case_005", "p03737_case_006", "p03737_case_007", "p03737_case_008", "p03737_case_009", "p03737_case_010", "p03737_case_011", "p03737_case_012", "p03737_case_013", "p03737_case_014", "p03737_case_015", "p03737_case_016", "p03737_case_017", "p03737_case_018", "p03737_case_019", "p03737_case_020", "p03737_case_021", "p03737_case_022", "p03737_case_023", "p03737_case_024", "p03737_case_025", "p03737_case_026", "p03737_case_027", "p03737_case_028", "p03737_case_029", "p03737_case_030", "p03737_case_031", "p03737_case_032", "p03737_case_033", "p03737_case_034", "p03737_case_035", "p03737_case_036", "p03737_case_037", "p03737_case_038", "p03737_case_039", "p03737_case_040", "p03737_case_041", "p03737_case_042", "p03737_case_043", "p03737_case_044", "p03737_case_045", "p03737_case_046", "p03737_case_047", "p03737_case_048", "p03737_case_049", "p03737_case_050", "p03737_case_051", "p03737_case_052", "p03737_case_053", "p03737_case_054", "p03737_case_055", "p03737_case_056", "p03737_case_057", "p03737_case_058", "p03737_case_059", "p03737_case_060", "p03737_case_061", "p03737_case_062", "p03737_case_063", "p03737_case_064", "p03737_case_065", "p03737_case_066", "p03737_case_067", "p03737_case_068", "p03737_case_069", "p03737_case_070", "p03737_case_071", "p03737_case_072", "p03737_case_073", "p03737_case_074", "p03737_case_075", "p03737_case_076", "p03737_case_077", "p03737_case_078", "p03737_case_079", "p03737_case_080", "p03737_case_081", "p03737_case_082", "p03737_case_083", "p03737_case_084", "p03737_case_085", "p03737_case_086", "p03737_case_087", "p03737_case_088", "p03737_case_089", "p03737_case_090", "p03737_case_091", "p03737_case_092", "p03737_case_093", "p03737_case_094", "p03737_case_095", "p03737_case_096", "p03737_case_097", "p03737_case_098", "p03737_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "a, *_ = zip(*input().upper().split())\nprint(*a, sep=\"\")\n", "fast_code_sha256": "8f20d49a25e29b9916e2295c2aad54b88f227ffe8f0e847faa1cf0ccac47ff69", "fast_id": "p03737_8f20d49a25e29b9916e2295c2aad54b88f227ffe8f0e847faa1cf0ccac47ff69", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "a, *_ = zip(*input().upper().split())\nprint(*a, sep=\"\")\n", "measured_fast_code_sha256": "8f20d49a25e29b9916e2295c2aad54b88f227ffe8f0e847faa1cf0ccac47ff69", "measured_slow_code": "import numpy as np\nimport math\n\ns = \" \" + input()\nfor i in range(len(s)):\n if s[i] == \" \":\n print(chr(ord(s[i + 1]) - 32), end=\"\")\nprint()\n", "measured_slow_code_sha256": "c5a6a790bfe3c359c7ab2698d0f376a617bb650fa938bf64d595d41523985f6d", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2705.7957232634544, "pair_id": "python_v2_0c64b352e2e99efc1740f535", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03737", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03737_8f20d49a25e29b9916e2295c2aad54b88f227ffe8f0e847faa1cf0ccac47ff69.jsonl.gz", "inputs": "reproduction/python/inputs/p03737.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03737_c5a6a790bfe3c359c7ab2698d0f376a617bb650fa938bf64d595d41523985f6d.jsonl.gz"}, "slow_code": "import numpy as np\nimport math\n\ns = \" \" + input()\nfor i in range(len(s)):\n if s[i] == \" \":\n print(chr(ord(s[i + 1]) - 32), end=\"\")\nprint()\n", "slow_code_sha256": "c5a6a790bfe3c359c7ab2698d0f376a617bb650fa938bf64d595d41523985f6d", "slow_id": "p03737_c5a6a790bfe3c359c7ab2698d0f376a617bb650fa938bf64d595d41523985f6d", "speedup": 2702.207287670808, "stratum": "8+", "within_pair_jaccard": 0.08, "workload": {"case_count": 100, "description": "Form an acronym from the uppercase first letters of three supplied lowercase words, in their given order. Observed inputs: word_length=1..10.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 33, "median": 18.0, "min": 6}, "input_format": ["s_1 s_2 s_3"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3, "median": 3.0, "min": 3}}} -{"case_ids": ["p02709_case_000", "p02709_case_001", "p02709_case_002", "p02709_case_003", "p02709_case_004", "p02709_case_005", "p02709_case_006", "p02709_case_007", "p02709_case_008", "p02709_case_009", "p02709_case_010", "p02709_case_011", "p02709_case_012", "p02709_case_013", "p02709_case_014", "p02709_case_015", "p02709_case_016", "p02709_case_017", "p02709_case_018", "p02709_case_019", "p02709_case_020", "p02709_case_021", "p02709_case_022", "p02709_case_023", "p02709_case_024", "p02709_case_025", "p02709_case_026", "p02709_case_027", "p02709_case_028", "p02709_case_029", "p02709_case_030", "p02709_case_031", "p02709_case_032", "p02709_case_033", "p02709_case_034", "p02709_case_035", "p02709_case_036", "p02709_case_037", "p02709_case_038", "p02709_case_039", "p02709_case_040", "p02709_case_041", "p02709_case_042", "p02709_case_043", "p02709_case_044", "p02709_case_045", "p02709_case_046", "p02709_case_047", "p02709_case_048", "p02709_case_049", "p02709_case_050", "p02709_case_051", "p02709_case_052", "p02709_case_053", "p02709_case_054", "p02709_case_055", "p02709_case_056", "p02709_case_057", "p02709_case_058", "p02709_case_059", "p02709_case_060", "p02709_case_061", "p02709_case_062", "p02709_case_063", "p02709_case_064", "p02709_case_065", "p02709_case_066", "p02709_case_067", "p02709_case_068", "p02709_case_069", "p02709_case_070", "p02709_case_071", "p02709_case_072", "p02709_case_073", "p02709_case_074", "p02709_case_075", "p02709_case_076", "p02709_case_077", "p02709_case_078", "p02709_case_079", "p02709_case_080", "p02709_case_081", "p02709_case_082", "p02709_case_083", "p02709_case_084", "p02709_case_085", "p02709_case_086", "p02709_case_087", "p02709_case_088", "p02709_case_089", "p02709_case_090", "p02709_case_091", "p02709_case_092", "p02709_case_093", "p02709_case_094", "p02709_case_095", "p02709_case_096", "p02709_case_097", "p02709_case_098", "p02709_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from collections import defaultdict\n\nn = int(eval(input()))\na_ = list(map(int, input().split()))\na = []\nfor i, ai in enumerate(a_):\n a.append([1 + i, ai])\na.sort(key=lambda x: x[1], reverse=True)\ndp = defaultdict(lambda: 0)\ndp[(0, 1)] = max(a[0][1] * (n - a[0][0]), 0)\ndp[(1, 0)] = max(a[0][1] * (a[0][0] - 1), 0)\nfor i in range(2, n + 1):\n for x in range(i + 1):\n y = i - x\n if x == 0:\n dp[(x, y)] = dp[(x, y - 1)] + a[i - 1][1] * (n - a[i - 1][0] - (y - 1))\n elif y == 0:\n dp[(x, y)] = dp[(x - 1, y)] + a[i - 1][1] * (a[i - 1][0] - 1 - (x - 1))\n else:\n dp[(x, y)] = max(\n dp[(x - 1, y)] + a[i - 1][1] * (a[i - 1][0] - 1 - (x - 1)),\n dp[(x, y - 1)] + a[i - 1][1] * (n - a[i - 1][0] - (y - 1)),\n )\nans = 0\nfor i in range(n + 1):\n ans = max(ans, dp[(i, n - i)])\nprint(ans)\n", "fast_code_sha256": "728c34924db4f0c24422c19ac1502af4e0e174ad2e07bd99fedf5c5e8a7a7e1a", "fast_id": "p02709_303eefb4104b70927f9ffb02a044f19d84e60ddfb1623e1f450d9db5d1f45164", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from collections import defaultdict\n\nn = int(eval(input()))\na_ = list(map(int, input().split()))\na = []\nfor i, ai in enumerate(a_):\n a.append([1 + i, ai])\na.sort(key=lambda x: x[1], reverse=True)\ndp = defaultdict(lambda: 0)\ndp[(0, 1)] = max(a[0][1] * (n - a[0][0]), 0)\ndp[(1, 0)] = max(a[0][1] * (a[0][0] - 1), 0)\nfor i in range(2, n + 1): # i人目の幼児。a[i-1]\n for x in range(i + 1):\n y = i - x\n if x == 0:\n dp[(x, y)] = dp[(x, y - 1)] + a[i - 1][1] * (n - a[i - 1][0] - (y - 1))\n elif y == 0:\n dp[(x, y)] = dp[(x - 1, y)] + a[i - 1][1] * (a[i - 1][0] - 1 - (x - 1))\n else:\n dp[(x, y)] = max(\n dp[(x - 1, y)] + a[i - 1][1] * (a[i - 1][0] - 1 - (x - 1)),\n dp[(x, y - 1)] + a[i - 1][1] * (n - a[i - 1][0] - (y - 1)),\n )\nans = 0\nfor i in range(n + 1):\n ans = max(ans, dp[(i, n - i)])\nprint(ans)\n", "measured_fast_code_sha256": "303eefb4104b70927f9ffb02a044f19d84e60ddfb1623e1f450d9db5d1f45164", "measured_slow_code": "import sys\nimport numpy as np\n\n\ndef f(n, a_):\n a = []\n for i, ai in enumerate(a_):\n a.append([1 + i, ai])\n a.sort(key=lambda x: x[1], reverse=True)\n dp = np.zeros(\n (n + 1, n + 1), np.int64\n ) # dp[i,j]:i人目までを配置し終えていて、そのうちj人を右に置いた時の最大値。j<=i\n dp[1, 1] = a[0][1] * (n - a[0][0])\n dp[1, 0] = a[0][1] * (a[0][0] - 1)\n for i in range(2, n + 1): # i人目の幼児。a[i-1]\n dp[i, 0] = dp[i - 1, 0] + a[i - 1][1] * abs(\n (a[i - 1][0] - 1 - (i - 1))\n ) # i人目を左にする。その時左に溜まっているのはi-1人\n dp[i, i] = dp[i - 1, i - 1] + a[i - 1][1] * abs(\n (n - a[i - 1][0] - (i - 1))\n ) # i人目を右にする。その時右に溜まっているのはi-1人\n # i人目を左に\n l = dp[i - 1, 1:i] + [\n a[i - 1][1] * abs((a[i - 1][0] - 1 - j)) for j in range(i - 2, -1, -1)\n ] # j:左に溜まっている人数\n # i人目を右に\n r = dp[i - 1, : i - 1] + [\n a[i - 1][1] * abs((n - a[i - 1][0] - j)) for j in range(i - 1)\n ] # j:右に溜まっている人数\n dp[i, 1:i] = np.maximum(l, r)\n return max(dp[n])\n\n\nif __name__ == \"__main__\":\n input = sys.stdin.readline\n n = int(eval(input()))\n a_ = list(map(int, input().split()))\n print((f(n, a_)))\n", "measured_slow_code_sha256": "3d838e07742b6038959605af2d3df1f36b7399126fc563b9a2c8f3bce236aaea", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 0.6266546982560854, "pair_id": "python_v2_ed5cd84b24003006a945dd92", "per_case_slow_code_faster_fraction": 0.55, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02709", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02709_303eefb4104b70927f9ffb02a044f19d84e60ddfb1623e1f450d9db5d1f45164.jsonl.gz", "inputs": "reproduction/python/inputs/p02709.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02709_3d838e07742b6038959605af2d3df1f36b7399126fc563b9a2c8f3bce236aaea.jsonl.gz"}, "slow_code": "import sys\nimport numpy as np\n\n\ndef f(n, a_):\n a = []\n for i, ai in enumerate(a_):\n a.append([1 + i, ai])\n a.sort(key=lambda x: x[1], reverse=True)\n dp = np.zeros((n + 1, n + 1), np.int64)\n dp[1, 1] = a[0][1] * (n - a[0][0])\n dp[1, 0] = a[0][1] * (a[0][0] - 1)\n for i in range(2, n + 1):\n dp[i, 0] = dp[i - 1, 0] + a[i - 1][1] * abs((a[i - 1][0] - 1 - (i - 1)))\n dp[i, i] = dp[i - 1, i - 1] + a[i - 1][1] * abs((n - a[i - 1][0] - (i - 1)))\n\n l = dp[i - 1, 1:i] + [\n a[i - 1][1] * abs((a[i - 1][0] - 1 - j)) for j in range(i - 2, -1, -1)\n ]\n\n r = dp[i - 1, : i - 1] + [\n a[i - 1][1] * abs((n - a[i - 1][0] - j)) for j in range(i - 1)\n ]\n dp[i, 1:i] = np.maximum(l, r)\n return max(dp[n])\n\n\nif __name__ == \"__main__\":\n input = sys.stdin.readline\n n = int(eval(input()))\n a_ = list(map(int, input().split()))\n print((f(n, a_)))\n", "slow_code_sha256": "aa98af4784f39634c1b1369b22ff40f05d4ea9461af1aad5cd1db169f1d8c6f4", "slow_id": "p02709_3d838e07742b6038959605af2d3df1f36b7399126fc563b9a2c8f3bce236aaea", "speedup": 5.923613003960932, "stratum": "4-8", "within_pair_jaccard": 0.5454545454545454, "workload": {"case_count": 100, "description": "Rearrange N children arbitrarily. Moving the child originally at position x to position y earns A_x*|x-y| happiness. Maximize total happiness. Observed inputs: N=2..2000 (median 1000); A_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 22005, "median": 9885.5, "min": 6}, "input_format": ["N\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2001, "median": 1001.0, "min": 3}}} -{"case_ids": ["p03699_case_000", "p03699_case_001", "p03699_case_002", "p03699_case_003", "p03699_case_004", "p03699_case_005", "p03699_case_006", "p03699_case_007", "p03699_case_008", "p03699_case_009", "p03699_case_010", "p03699_case_011", "p03699_case_012", "p03699_case_013", "p03699_case_014", "p03699_case_015", "p03699_case_016", "p03699_case_017", "p03699_case_018", "p03699_case_019", "p03699_case_020", "p03699_case_021", "p03699_case_022", "p03699_case_023", "p03699_case_024", "p03699_case_025", "p03699_case_026", "p03699_case_027", "p03699_case_028", "p03699_case_029", "p03699_case_030", "p03699_case_031", "p03699_case_032", "p03699_case_033", "p03699_case_034", "p03699_case_035", "p03699_case_036", "p03699_case_037", "p03699_case_038", "p03699_case_039", "p03699_case_040", "p03699_case_041", "p03699_case_042", "p03699_case_043", "p03699_case_044", "p03699_case_045", "p03699_case_046", "p03699_case_047", "p03699_case_048", "p03699_case_049", "p03699_case_050", "p03699_case_051", "p03699_case_052", "p03699_case_053", "p03699_case_054", "p03699_case_055", "p03699_case_056", "p03699_case_057", "p03699_case_058", "p03699_case_059", "p03699_case_060", "p03699_case_061", "p03699_case_062", "p03699_case_063", "p03699_case_064", "p03699_case_065", "p03699_case_066", "p03699_case_067", "p03699_case_068", "p03699_case_069", "p03699_case_070", "p03699_case_071", "p03699_case_072", "p03699_case_073", "p03699_case_074", "p03699_case_075", "p03699_case_076", "p03699_case_077", "p03699_case_078", "p03699_case_079", "p03699_case_080", "p03699_case_081", "p03699_case_082", "p03699_case_083", "p03699_case_084", "p03699_case_085", "p03699_case_086", "p03699_case_087", "p03699_case_088", "p03699_case_089", "p03699_case_090", "p03699_case_091", "p03699_case_092", "p03699_case_093", "p03699_case_094", "p03699_case_095", "p03699_case_096", "p03699_case_097", "p03699_case_098", "p03699_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\ns = sorted([int(eval(input())) for i in range(n)])\nans = 0\nif sum(s) % 10 != 0:\n print((sum(s)))\nelse:\n for i in s:\n if i % 10 != 0:\n ans = sum(s) - i\n print(ans)\n break\n if ans == 0:\n print(ans)\n", "fast_code_sha256": "281e9d543cc6c1d296b383a13e557b7a6fe3d3821ed6a91eb48f72e5b26ce242", "fast_id": "p03699_281e9d543cc6c1d296b383a13e557b7a6fe3d3821ed6a91eb48f72e5b26ce242", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\ns = sorted([int(eval(input())) for i in range(n)])\nans = 0\nif sum(s) % 10 != 0:\n print((sum(s)))\nelse:\n for i in s:\n if i % 10 != 0:\n ans = sum(s) - i\n print(ans)\n break\n if ans == 0:\n print(ans)\n", "measured_fast_code_sha256": "281e9d543cc6c1d296b383a13e557b7a6fe3d3821ed6a91eb48f72e5b26ce242", "measured_slow_code": "n = int(eval(input()))\na = [int(eval(input())) for _ in range(n)]\ndp = [[] for _ in range(n + 1)]\nfor i in range(n + 1):\n dp[i] += [-1 for _ in range(10010)]\ndp[0][0] = 1\nfor i in range(n):\n for j in range(10010):\n if dp[i][j] == 1:\n dp[i + 1][j] = 1\n dp[i + 1][j + a[i]] = 1\nans = 0\nfor i in range(10010):\n if dp[n][i] == 1:\n if i % 10 != 0:\n ans = max(ans, i)\nprint(ans)\n", "measured_slow_code_sha256": "9c4a51b8f4ba22ed5163c6625c8ee551d52c7589ed51b5dd88791465550e96e2", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 365.4197645929295, "pair_id": "python_v2_54c043e4eee4c7ba42223c70", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03699", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03699_281e9d543cc6c1d296b383a13e557b7a6fe3d3821ed6a91eb48f72e5b26ce242.jsonl.gz", "inputs": "reproduction/python/inputs/p03699.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03699_9c4a51b8f4ba22ed5163c6625c8ee551d52c7589ed51b5dd88791465550e96e2.jsonl.gz"}, "slow_code": "n = int(eval(input()))\na = [int(eval(input())) for _ in range(n)]\ndp = [[] for _ in range(n + 1)]\nfor i in range(n + 1):\n dp[i] += [-1 for _ in range(10010)]\ndp[0][0] = 1\nfor i in range(n):\n for j in range(10010):\n if dp[i][j] == 1:\n dp[i + 1][j] = 1\n dp[i + 1][j + a[i]] = 1\nans = 0\nfor i in range(10010):\n if dp[n][i] == 1:\n if i % 10 != 0:\n ans = max(ans, i)\nprint(ans)\n", "slow_code_sha256": "9c4a51b8f4ba22ed5163c6625c8ee551d52c7589ed51b5dd88791465550e96e2", "slow_id": "p03699_9c4a51b8f4ba22ed5163c6625c8ee551d52c7589ed51b5dd88791465550e96e2", "speedup": 235.4399706925101, "stratum": "8+", "within_pair_jaccard": 0.52, "workload": {"case_count": 100, "description": "Choose which of N questions to answer correctly, scoring s_i per correct answer. A total divisible by 10 displays as zero; other totals display unchanged. Maximize the displayed score. Observed inputs: N=1..100 (median 50); s_i=1..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 403, "median": 146.0, "min": 4}, "input_format": ["N\ns_1\n...\ns_N"], "input_format_status": "source_input_section", "input_lines": {"max": 101, "median": 51.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 101, "median": 51.0, "min": 2}}} -{"case_ids": ["p02848_case_000", "p02848_case_001", "p02848_case_002", "p02848_case_003", "p02848_case_004", "p02848_case_005", "p02848_case_006", "p02848_case_007", "p02848_case_008", "p02848_case_009", "p02848_case_010", "p02848_case_011", "p02848_case_012", "p02848_case_013", "p02848_case_014", "p02848_case_015", "p02848_case_016", "p02848_case_017", "p02848_case_018", "p02848_case_019", "p02848_case_020", "p02848_case_021", "p02848_case_022", "p02848_case_023", "p02848_case_024", "p02848_case_025", "p02848_case_026", "p02848_case_027", "p02848_case_028", "p02848_case_029", "p02848_case_030", "p02848_case_031", "p02848_case_032", "p02848_case_033", "p02848_case_034", "p02848_case_035", "p02848_case_036", "p02848_case_037", "p02848_case_038", "p02848_case_039", "p02848_case_040", "p02848_case_041", "p02848_case_042", "p02848_case_043", "p02848_case_044", "p02848_case_045", "p02848_case_046", "p02848_case_047", "p02848_case_048", "p02848_case_049", "p02848_case_050", "p02848_case_051", "p02848_case_052", "p02848_case_053", "p02848_case_054", "p02848_case_055", "p02848_case_056", "p02848_case_057", "p02848_case_058", "p02848_case_059", "p02848_case_060", "p02848_case_061", "p02848_case_062", "p02848_case_063", "p02848_case_064", "p02848_case_065", "p02848_case_066", "p02848_case_067", "p02848_case_068", "p02848_case_069", "p02848_case_070", "p02848_case_071", "p02848_case_072", "p02848_case_073", "p02848_case_074", "p02848_case_075", "p02848_case_076", "p02848_case_077", "p02848_case_078", "p02848_case_079", "p02848_case_080", "p02848_case_081", "p02848_case_082", "p02848_case_083", "p02848_case_084", "p02848_case_085", "p02848_case_086", "p02848_case_087", "p02848_case_088", "p02848_case_089", "p02848_case_090", "p02848_case_091", "p02848_case_092", "p02848_case_093", "p02848_case_094", "p02848_case_095", "p02848_case_096", "p02848_case_097", "p02848_case_098", "p02848_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\nimport math\nimport collections\nimport itertools\nfrom inspect import currentframe\n\nINF = 10**10\nMOD = 10**9 + 7\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef gcd(x, y):\n return y if x % y == 0 else gcd(y, x % y)\n\n\ndef lcm(x, y):\n return (x * y) // gcd(x, y)\n\n\ndef I():\n return int(input())\n\n\ndef MI():\n return map(int, input().split())\n\n\ndef LI():\n return [int(x) for x in input().split()]\n\n\ndef RI(N):\n return [int(input()) for _ in range(N)]\n\n\ndef LRI(N):\n return [[int(x) for x in input().split()] for _ in range(N)]\n\n\ndef chkprint(*args):\n names = {id(v): k for k, v in currentframe().f_back.f_locals.items()}\n print(\", \".join(names.get(id(arg), \"???\") + \" = \" + repr(arg) for arg in args))\n\n\nN = I()\nS = input()\nalp = [\n \"A\",\n \"B\",\n \"C\",\n \"D\",\n \"E\",\n \"F\",\n \"G\",\n \"H\",\n \"I\",\n \"J\",\n \"K\",\n \"L\",\n \"M\",\n \"N\",\n \"O\",\n \"P\",\n \"Q\",\n \"R\",\n \"S\",\n \"T\",\n \"U\",\n \"V\",\n \"W\",\n \"X\",\n \"Y\",\n \"Z\",\n]\nfor s in S:\n print(alp[(alp.index(s) + N) % 26], end=\"\")\n", "fast_code_sha256": "4e03a4428b1aa0327e66a8cb999ff15a637eaad3acbd2fd2d565e47714f697dd", "fast_id": "p02848_28ec796f8eb56af2fabfccd11148299be75fe687af7fbeca1341511e952857a1", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "# coding: utf-8\nimport sys\nimport math\nimport collections\nimport itertools\nfrom inspect import currentframe\n\nINF = 10**10\nMOD = 10**9 + 7\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef gcd(x, y):\n return y if x % y == 0 else gcd(y, x % y)\n\n\ndef lcm(x, y):\n return (x * y) // gcd(x, y)\n\n\ndef I():\n return int(input())\n\n\ndef MI():\n return map(int, input().split())\n\n\ndef LI():\n return [int(x) for x in input().split()]\n\n\ndef RI(N):\n return [int(input()) for _ in range(N)]\n\n\ndef LRI(N):\n return [[int(x) for x in input().split()] for _ in range(N)]\n\n\ndef chkprint(*args):\n names = {id(v): k for k, v in currentframe().f_back.f_locals.items()}\n print(\", \".join(names.get(id(arg), \"???\") + \" = \" + repr(arg) for arg in args))\n\n\nN = I()\nS = input()\nalp = [\n \"A\",\n \"B\",\n \"C\",\n \"D\",\n \"E\",\n \"F\",\n \"G\",\n \"H\",\n \"I\",\n \"J\",\n \"K\",\n \"L\",\n \"M\",\n \"N\",\n \"O\",\n \"P\",\n \"Q\",\n \"R\",\n \"S\",\n \"T\",\n \"U\",\n \"V\",\n \"W\",\n \"X\",\n \"Y\",\n \"Z\",\n]\nfor s in S:\n print(alp[(alp.index(s) + N) % 26], end=\"\")\n", "measured_fast_code_sha256": "28ec796f8eb56af2fabfccd11148299be75fe687af7fbeca1341511e952857a1", "measured_slow_code": "import sys, re\nfrom collections import deque, defaultdict, Counter\nfrom math import (\n ceil,\n sqrt,\n hypot,\n factorial,\n pi,\n sin,\n cos,\n tan,\n asin,\n acos,\n atan,\n radians,\n degrees,\n log2,\n)\nfrom itertools import (\n accumulate,\n permutations,\n combinations,\n combinations_with_replacement,\n product,\n groupby,\n)\nfrom operator import itemgetter, mul\nfrom copy import deepcopy\nfrom string import ascii_lowercase, ascii_uppercase, digits, ascii_letters\nfrom bisect import bisect, bisect_left\nfrom heapq import heappush, heappop\nfrom functools import reduce\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef INT():\n return int(input())\n\n\ndef MAP():\n return map(int, input().split())\n\n\ndef LIST():\n return list(map(int, input().split()))\n\n\ndef ZIP(n):\n return zip(*(MAP() for _ in range(n)))\n\n\nimport numpy as np\n\nsys.setrecursionlimit(10**9)\nINF = float(\"inf\")\nmod = 10**9 + 7\nN = INT()\nS = input()\nans = [ascii_uppercase[(ascii_uppercase.index(S[i]) + N) % 26] for i in range(len(S))]\n# print(ans)\nprint(*ans, sep=\"\")\n", "measured_slow_code_sha256": "2035cd9ee148f20f8214ff8f831f3a3ab5fba163f67d68b8f930abaa365f99ee", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 6.111909883834737, "pair_id": "python_v2_96aceb06345c8f805a0c6bd3", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02848", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02848_28ec796f8eb56af2fabfccd11148299be75fe687af7fbeca1341511e952857a1.jsonl.gz", "inputs": "reproduction/python/inputs/p02848.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02848_2035cd9ee148f20f8214ff8f831f3a3ab5fba163f67d68b8f930abaa365f99ee.jsonl.gz"}, "slow_code": "import sys, re\nfrom collections import deque, defaultdict, Counter\nfrom math import (\n ceil,\n sqrt,\n hypot,\n factorial,\n pi,\n sin,\n cos,\n tan,\n asin,\n acos,\n atan,\n radians,\n degrees,\n log2,\n)\nfrom itertools import (\n accumulate,\n permutations,\n combinations,\n combinations_with_replacement,\n product,\n groupby,\n)\nfrom operator import itemgetter, mul\nfrom copy import deepcopy\nfrom string import ascii_lowercase, ascii_uppercase, digits, ascii_letters\nfrom bisect import bisect, bisect_left\nfrom heapq import heappush, heappop\nfrom functools import reduce\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef INT():\n return int(input())\n\n\ndef MAP():\n return map(int, input().split())\n\n\ndef LIST():\n return list(map(int, input().split()))\n\n\ndef ZIP(n):\n return zip(*(MAP() for _ in range(n)))\n\n\nimport numpy as np\n\nsys.setrecursionlimit(10**9)\nINF = float(\"inf\")\nmod = 10**9 + 7\nN = INT()\nS = input()\nans = [ascii_uppercase[(ascii_uppercase.index(S[i]) + N) % 26] for i in range(len(S))]\n\nprint(*ans, sep=\"\")\n", "slow_code_sha256": "e34642f16557597f18ad2b4c4499a358ee696a0bcc22331e3fa1500f4c62c66c", "slow_id": "p02848_2035cd9ee148f20f8214ff8f831f3a3ab5fba163f67d68b8f930abaa365f99ee", "speedup": 8.675964661624905, "stratum": "8+", "within_pair_jaccard": 0.19858156028368795, "workload": {"case_count": 100, "description": "Shift every uppercase letter of S forward by N alphabetical positions, wrapping from Z to A, and output the resulting string. Observed inputs: N=0..26 (median 13); S_length=1..10000 (median 10000).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 10004, "median": 10004.0, "min": 4}, "input_format": ["N\nS"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p02555_case_000", "p02555_case_001", "p02555_case_002", "p02555_case_003", "p02555_case_004", "p02555_case_005", "p02555_case_006", "p02555_case_007", "p02555_case_008", "p02555_case_009", "p02555_case_010", "p02555_case_011", "p02555_case_012", "p02555_case_013", "p02555_case_014", "p02555_case_015", "p02555_case_016", "p02555_case_017", "p02555_case_018", "p02555_case_019", "p02555_case_020", "p02555_case_021", "p02555_case_022", "p02555_case_023", "p02555_case_024", "p02555_case_025", "p02555_case_026", "p02555_case_027", "p02555_case_028", "p02555_case_029", "p02555_case_030", "p02555_case_031", "p02555_case_032", "p02555_case_033", "p02555_case_034", "p02555_case_035", "p02555_case_036", "p02555_case_037", "p02555_case_038", "p02555_case_039", "p02555_case_040", "p02555_case_041", "p02555_case_042", "p02555_case_043", "p02555_case_044", "p02555_case_045", "p02555_case_046", "p02555_case_047", "p02555_case_048", "p02555_case_049", "p02555_case_050", "p02555_case_051", "p02555_case_052", "p02555_case_053", "p02555_case_054", "p02555_case_055", "p02555_case_056", "p02555_case_057", "p02555_case_058", "p02555_case_059", "p02555_case_060", "p02555_case_061", "p02555_case_062", "p02555_case_063", "p02555_case_064", "p02555_case_065", "p02555_case_066", "p02555_case_067", "p02555_case_068", "p02555_case_069", "p02555_case_070", "p02555_case_071", "p02555_case_072", "p02555_case_073", "p02555_case_074", "p02555_case_075", "p02555_case_076", "p02555_case_077", "p02555_case_078", "p02555_case_079", "p02555_case_080", "p02555_case_081", "p02555_case_082", "p02555_case_083", "p02555_case_084", "p02555_case_085", "p02555_case_086", "p02555_case_087", "p02555_case_088", "p02555_case_089", "p02555_case_090", "p02555_case_091", "p02555_case_092", "p02555_case_093", "p02555_case_094", "p02555_case_095", "p02555_case_096", "p02555_case_097", "p02555_case_098", "p02555_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "s = int(eval(input()))\na = b = 0\nc = int(s > 2)\nfor _ in range(s - 3):\n a, b, c = b, c, (a + c) % (10**9 + 7)\nprint(c)\n", "fast_code_sha256": "6a882d2a5423b1f6b3f7524d4d393bad5b717d8c1f08a3765c460fbb340b4113", "fast_id": "p02555_6a882d2a5423b1f6b3f7524d4d393bad5b717d8c1f08a3765c460fbb340b4113", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "s = int(eval(input()))\na = b = 0\nc = int(s > 2)\nfor _ in range(s - 3):\n a, b, c = b, c, (a + c) % (10**9 + 7)\nprint(c)\n", "measured_fast_code_sha256": "6a882d2a5423b1f6b3f7524d4d393bad5b717d8c1f08a3765c460fbb340b4113", "measured_slow_code": "MOD = 10**9 + 7\nMAX = 1000010\nfac = [0] * MAX\nfinv = [0] * MAX\ninv = [0] * MAX\n\n\ndef COMinit():\n fac[0] = fac[1] = 1\n finv[0] = finv[1] = 1\n inv[1] = 1\n for i in range(2, MAX):\n fac[i] = fac[i - 1] * i % MOD\n inv[i] = MOD - inv[MOD % i] * (MOD // i) % MOD\n finv[i] = finv[i - 1] * inv[i] % MOD\n\n\ndef COM(n, k):\n res = 1\n for i in range(k):\n res = res * (n - i) % MOD\n return res * finv[k] % MOD\n\n\ns = int(eval(input()))\nx = s // 3\nCOMinit()\nans = 0\nfor i in range(x):\n ans = (ans + COM(s - 2 * (i + 1) - 1, i)) % MOD\n # print(COM(s-2*(i+1)-1, i))\nprint(ans)\n", "measured_slow_code_sha256": "3a531d5d2ca61d288b4238085118dccbb6b1c04598e7aed0a116bd9571a93b35", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2536.083958834534, "pair_id": "python_v2_33aaf6a9ce1ee44e5d5743b7", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02555", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02555_6a882d2a5423b1f6b3f7524d4d393bad5b717d8c1f08a3765c460fbb340b4113.jsonl.gz", "inputs": "reproduction/python/inputs/p02555.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02555_3a531d5d2ca61d288b4238085118dccbb6b1c04598e7aed0a116bd9571a93b35.jsonl.gz"}, "slow_code": "MOD = 10**9 + 7\nMAX = 1000010\nfac = [0] * MAX\nfinv = [0] * MAX\ninv = [0] * MAX\n\n\ndef COMinit():\n fac[0] = fac[1] = 1\n finv[0] = finv[1] = 1\n inv[1] = 1\n for i in range(2, MAX):\n fac[i] = fac[i - 1] * i % MOD\n inv[i] = MOD - inv[MOD % i] * (MOD // i) % MOD\n finv[i] = finv[i - 1] * inv[i] % MOD\n\n\ndef COM(n, k):\n res = 1\n for i in range(k):\n res = res * (n - i) % MOD\n return res * finv[k] % MOD\n\n\ns = int(eval(input()))\nx = s // 3\nCOMinit()\nans = 0\nfor i in range(x):\n ans = (ans + COM(s - 2 * (i + 1) - 1, i)) % MOD\n\nprint(ans)\n", "slow_code_sha256": "4cbb98a33bd3d00b5b2726ac654cdc33a13286133f35ef468e9d5a4be6a55fa2", "slow_id": "p02555_3a531d5d2ca61d288b4238085118dccbb6b1c04598e7aed0a116bd9571a93b35", "speedup": 3527.0841664484465, "stratum": "8+", "within_pair_jaccard": 0.37142857142857144, "workload": {"case_count": 100, "description": "Count ordered integer sequences whose entries are at least 3 and sum to S, modulo 1000000007. Observed inputs: S=1..2000 (median 1094).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 5, "median": 5.0, "min": 2}, "input_format": ["S"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p03292_case_000", "p03292_case_001", "p03292_case_002", "p03292_case_003", "p03292_case_004", "p03292_case_005", "p03292_case_006", "p03292_case_007", "p03292_case_008", "p03292_case_009", "p03292_case_010", "p03292_case_011", "p03292_case_012", "p03292_case_013", "p03292_case_014", "p03292_case_015", "p03292_case_016", "p03292_case_017", "p03292_case_018", "p03292_case_019", "p03292_case_020", "p03292_case_021", "p03292_case_022", "p03292_case_023", "p03292_case_024", "p03292_case_025", "p03292_case_026", "p03292_case_027", "p03292_case_028", "p03292_case_029", "p03292_case_030", "p03292_case_031", "p03292_case_032", "p03292_case_033", "p03292_case_034", "p03292_case_035", "p03292_case_036", "p03292_case_037", "p03292_case_038", "p03292_case_039", "p03292_case_040", "p03292_case_041", "p03292_case_042", "p03292_case_043", "p03292_case_044", "p03292_case_045", "p03292_case_046", "p03292_case_047", "p03292_case_048", "p03292_case_049", "p03292_case_050", "p03292_case_051", "p03292_case_052", "p03292_case_053", "p03292_case_054", "p03292_case_055", "p03292_case_056", "p03292_case_057", "p03292_case_058", "p03292_case_059", "p03292_case_060", "p03292_case_061", "p03292_case_062", "p03292_case_063", "p03292_case_064", "p03292_case_065", "p03292_case_066", "p03292_case_067", "p03292_case_068", "p03292_case_069", "p03292_case_070", "p03292_case_071", "p03292_case_072", "p03292_case_073", "p03292_case_074", "p03292_case_075", "p03292_case_076", "p03292_case_077", "p03292_case_078", "p03292_case_079", "p03292_case_080", "p03292_case_081", "p03292_case_082", "p03292_case_083", "p03292_case_084", "p03292_case_085", "p03292_case_086", "p03292_case_087", "p03292_case_088", "p03292_case_089", "p03292_case_090", "p03292_case_091", "p03292_case_092", "p03292_case_093", "p03292_case_094", "p03292_case_095", "p03292_case_096", "p03292_case_097", "p03292_case_098", "p03292_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "(*a,) = list(map(int, input().split()))\nprint((max(a) - min(a)))\n", "fast_code_sha256": "096b89a8a76eb58d2ef19de5f5d0086035ff0c6e9b7acaf74a4349ddcd17ff35", "fast_id": "p03292_096b89a8a76eb58d2ef19de5f5d0086035ff0c6e9b7acaf74a4349ddcd17ff35", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "(*a,) = list(map(int, input().split()))\nprint((max(a) - min(a)))\n", "measured_fast_code_sha256": "096b89a8a76eb58d2ef19de5f5d0086035ff0c6e9b7acaf74a4349ddcd17ff35", "measured_slow_code": "a, b, c = list(map(int, input().split()))\nans = 9999\nans = min(ans, abs(a - b) + abs(b - c), abs(a - c) + abs(c - b))\nans = min(ans, abs(b - a) + abs(a - c), abs(b - c) + abs(c - a))\nans = min(ans, abs(c - a) + abs(a - b), abs(c - b) + abs(b - a))\nprint(ans)\n", "measured_slow_code_sha256": "f60b0a699a2d92dfcbb5b26a370092e660bc85afffa65c600089419b521caefb", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.020951368048763, "pair_id": "python_v2_97c21a711bd44344ce9714f8", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03292", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03292_096b89a8a76eb58d2ef19de5f5d0086035ff0c6e9b7acaf74a4349ddcd17ff35.jsonl.gz", "inputs": "reproduction/python/inputs/p03292.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03292_f60b0a699a2d92dfcbb5b26a370092e660bc85afffa65c600089419b521caefb.jsonl.gz"}, "slow_code": "a, b, c = list(map(int, input().split()))\nans = 9999\nans = min(ans, abs(a - b) + abs(b - c), abs(a - c) + abs(c - b))\nans = min(ans, abs(b - a) + abs(a - c), abs(b - c) + abs(c - a))\nans = min(ans, abs(c - a) + abs(a - b), abs(c - b) + abs(b - a))\nprint(ans)\n", "slow_code_sha256": "f60b0a699a2d92dfcbb5b26a370092e660bc85afffa65c600089419b521caefb", "slow_id": "p03292_f60b0a699a2d92dfcbb5b26a370092e660bc85afffa65c600089419b521caefb", "speedup": 3.0194443633610546, "stratum": "2-4", "within_pair_jaccard": 0.5714285714285714, "workload": {"case_count": 100, "description": "Complete three tasks in any order. The first costs zero; moving from task i to task j costs |A_j-A_i|. Minimize total cost while completing all tasks. Observed inputs: A_i=1..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 12, "median": 9.0, "min": 6}, "input_format": ["A_1 A_2 A_3"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3, "median": 3.0, "min": 3}}} -{"case_ids": ["p02264_case_000", "p02264_case_001", "p02264_case_002", "p02264_case_003", "p02264_case_004", "p02264_case_005", "p02264_case_006", "p02264_case_007", "p02264_case_008", "p02264_case_009", "p02264_case_010", "p02264_case_011", "p02264_case_012", "p02264_case_013", "p02264_case_014", "p02264_case_015", "p02264_case_016", "p02264_case_017", "p02264_case_018", "p02264_case_019", "p02264_case_020", "p02264_case_021", "p02264_case_022", "p02264_case_023", "p02264_case_024", "p02264_case_025", "p02264_case_026", "p02264_case_027", "p02264_case_028", "p02264_case_029", "p02264_case_030", "p02264_case_031", "p02264_case_032", "p02264_case_033", "p02264_case_034", "p02264_case_035", "p02264_case_036", "p02264_case_037", "p02264_case_038", "p02264_case_039", "p02264_case_040", "p02264_case_041", "p02264_case_042", "p02264_case_043", "p02264_case_044", "p02264_case_045", "p02264_case_046", "p02264_case_047", "p02264_case_048", "p02264_case_049", "p02264_case_050", "p02264_case_051", "p02264_case_052", "p02264_case_053", "p02264_case_054", "p02264_case_055", "p02264_case_056", "p02264_case_057", "p02264_case_058", "p02264_case_059", "p02264_case_060", "p02264_case_061", "p02264_case_062", "p02264_case_063", "p02264_case_064", "p02264_case_065", "p02264_case_066", "p02264_case_067", "p02264_case_068", "p02264_case_069", "p02264_case_070", "p02264_case_071", "p02264_case_072", "p02264_case_073", "p02264_case_074", "p02264_case_075", "p02264_case_076", "p02264_case_077", "p02264_case_078", "p02264_case_079", "p02264_case_080", "p02264_case_081", "p02264_case_082", "p02264_case_083", "p02264_case_084", "p02264_case_085", "p02264_case_086", "p02264_case_087", "p02264_case_088", "p02264_case_089", "p02264_case_090", "p02264_case_091", "p02264_case_092", "p02264_case_093", "p02264_case_094", "p02264_case_095", "p02264_case_096", "p02264_case_097", "p02264_case_098", "p02264_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\nfrom collections import deque\n\ns = sys.stdin.readlines()\nq = int(s[0].split()[1])\nf = lambda x, y: (x, int(y))\nd = deque(f(*e.split()) for e in s[1:])\nt, a = 0, []\nwhile d:\n k, v = d.popleft()\n if v > q:\n v -= q\n t += q\n d.append([k, v])\n else:\n t += v\n a += [f\"{k} {t}\"]\nprint(*a, sep=\"\\n\")\n", "fast_code_sha256": "ffd6746babe59de48f50f77abd6bc1a2c4d5727d43b468b81ae0081d9337f307", "fast_id": "p02264_ffd6746babe59de48f50f77abd6bc1a2c4d5727d43b468b81ae0081d9337f307", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\nfrom collections import deque\n\ns = sys.stdin.readlines()\nq = int(s[0].split()[1])\nf = lambda x, y: (x, int(y))\nd = deque(f(*e.split()) for e in s[1:])\nt, a = 0, []\nwhile d:\n k, v = d.popleft()\n if v > q:\n v -= q\n t += q\n d.append([k, v])\n else:\n t += v\n a += [f\"{k} {t}\"]\nprint(*a, sep=\"\\n\")\n", "measured_fast_code_sha256": "ffd6746babe59de48f50f77abd6bc1a2c4d5727d43b468b81ae0081d9337f307", "measured_slow_code": "class Queue:\n def __init__(self, n):\n self.values = [None] * n\n self.n = n\n self.s = 0\n self.t = 0\n\n def next(self, p):\n ret = p + 1\n if ret >= self.n:\n ret = 0\n return ret\n\n def enqueue(self, x):\n if self.next(self.s) == self.t:\n raise Exception(\"Overflow\")\n self.values[self.s] = x\n self.s = self.next(self.s)\n\n def dequeue(self):\n if self.s == self.t:\n raise Exception(\"Underflow\")\n ret = self.values[self.t]\n self.t = self.next(self.t)\n return ret\n\n\nn, q = list(map(int, input().split(\" \")))\nqueue = Queue(n + 1)\nfor _ in range(n):\n name, time = input().split(\" \")\n time = int(time)\n queue.enqueue((name, time))\ncompleted = []\ncur = 0\nwhile len(completed) < n:\n name, time = queue.dequeue()\n res = time - q\n if res <= 0:\n cur += time\n completed.append((name, cur))\n else:\n cur += q\n queue.enqueue((name, res))\nfor name, time in completed:\n print(name, time)\n", "measured_slow_code_sha256": "a1340768971238fb58507a0f8ca6f200e92420bac7eb4c6dd5fbd6b4ec30302d", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.849500458477715, "pair_id": "python_v2_821bb59a3e640ef77d5d95da", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02264", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02264_ffd6746babe59de48f50f77abd6bc1a2c4d5727d43b468b81ae0081d9337f307.jsonl.gz", "inputs": "reproduction/python/inputs/p02264.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02264_a1340768971238fb58507a0f8ca6f200e92420bac7eb4c6dd5fbd6b4ec30302d.jsonl.gz"}, "slow_code": "class Queue:\n def __init__(self, n):\n self.values = [None] * n\n self.n = n\n self.s = 0\n self.t = 0\n\n def next(self, p):\n ret = p + 1\n if ret >= self.n:\n ret = 0\n return ret\n\n def enqueue(self, x):\n if self.next(self.s) == self.t:\n raise Exception(\"Overflow\")\n self.values[self.s] = x\n self.s = self.next(self.s)\n\n def dequeue(self):\n if self.s == self.t:\n raise Exception(\"Underflow\")\n ret = self.values[self.t]\n self.t = self.next(self.t)\n return ret\n\n\nn, q = list(map(int, input().split(\" \")))\nqueue = Queue(n + 1)\nfor _ in range(n):\n name, time = input().split(\" \")\n time = int(time)\n queue.enqueue((name, time))\ncompleted = []\ncur = 0\nwhile len(completed) < n:\n name, time = queue.dequeue()\n res = time - q\n if res <= 0:\n cur += time\n completed.append((name, cur))\n else:\n cur += q\n queue.enqueue((name, res))\nfor name, time in completed:\n print(name, time)\n", "slow_code_sha256": "a1340768971238fb58507a0f8ca6f200e92420bac7eb4c6dd5fbd6b4ec30302d", "slow_id": "p02264_a1340768971238fb58507a0f8ca6f200e92420bac7eb4c6dd5fbd6b4ec30302d", "speedup": 3.0042982360632418, "stratum": "2-4", "within_pair_jaccard": 0.25806451612903225, "workload": {"case_count": 100, "description": "Simulate round-robin scheduling for n processes initially queued in input order. Each has a name and required service duration time_i. Give each up to quantum q; requeue unfinished processes at the back. Output names and completion times in completion order. Observed inputs: n=1..100000 (median 30000); q=1..1000; time_i=1..50000; total_service=1..1000000 (median 1000000).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1300168, "median": 254526.5, "min": 11}, "input_format": ["n q\nname_1 time_1\n...\nname_n time_n"], "input_format_status": "source_input_section", "input_lines": {"max": 100001, "median": 30001.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200002, "median": 60002.0, "min": 4}}} -{"case_ids": ["p03566_case_000", "p03566_case_001", "p03566_case_002", "p03566_case_003", "p03566_case_004", "p03566_case_005", "p03566_case_006", "p03566_case_007", "p03566_case_008", "p03566_case_009", "p03566_case_010", "p03566_case_011", "p03566_case_012", "p03566_case_013", "p03566_case_014", "p03566_case_015", "p03566_case_016", "p03566_case_017", "p03566_case_018", "p03566_case_019", "p03566_case_020", "p03566_case_021", "p03566_case_022", "p03566_case_023", "p03566_case_024", "p03566_case_025", "p03566_case_026", "p03566_case_027", "p03566_case_028", "p03566_case_029", "p03566_case_030", "p03566_case_031", "p03566_case_032", "p03566_case_033", "p03566_case_034", "p03566_case_035", "p03566_case_036", "p03566_case_037", "p03566_case_038", "p03566_case_039", "p03566_case_040", "p03566_case_041", "p03566_case_042", "p03566_case_043", "p03566_case_044", "p03566_case_045", "p03566_case_046", "p03566_case_047", "p03566_case_048", "p03566_case_049", "p03566_case_050", "p03566_case_051", "p03566_case_052", "p03566_case_053", "p03566_case_054", "p03566_case_055", "p03566_case_056", "p03566_case_057", "p03566_case_058", "p03566_case_059", "p03566_case_060", "p03566_case_061", "p03566_case_062", "p03566_case_063", "p03566_case_064", "p03566_case_065", "p03566_case_066", "p03566_case_067", "p03566_case_068", "p03566_case_069", "p03566_case_070", "p03566_case_071", "p03566_case_072", "p03566_case_073", "p03566_case_074", "p03566_case_075", "p03566_case_076", "p03566_case_077", "p03566_case_078", "p03566_case_079", "p03566_case_080", "p03566_case_081", "p03566_case_082", "p03566_case_083", "p03566_case_084", "p03566_case_085", "p03566_case_086", "p03566_case_087", "p03566_case_088", "p03566_case_089", "p03566_case_090", "p03566_case_091", "p03566_case_092", "p03566_case_093", "p03566_case_094", "p03566_case_095", "p03566_case_096", "p03566_case_097", "p03566_case_098", "p03566_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N = int(eval(input()))\nt = [0] + list(map(int, input().split()))\nv = [0] + list(map(int, input().split()))\nmax_speed_from_left = [0] * (N + 1)\nmax_speed_from_right = [0] * (N + 1)\nfor i in range(1, N):\n start = max_speed_from_left[i - 1]\n max_speed_from_left[i] = min(start + t[i], v[i], v[i + 1])\nfor i in range(N - 1, 0, -1):\n start = max_speed_from_right[i + 1]\n max_speed_from_right[i] = min(start + t[i + 1], v[i], v[i + 1])\nspeed = [min(x, y) for x, y in zip(max_speed_from_left, max_speed_from_right)]\n\n\ndef dist(left_speed, right_speed, t, v):\n x = (v - left_speed) + (v - right_speed)\n if x >= t:\n v = (left_speed + right_speed + t) / 2\n x = t\n\n d = (left_speed + v) * (v - left_speed) / 2\n d += v * (t - x)\n d += (right_speed + v) * (v - right_speed) / 2\n return d\n\n\nans = 0\nfor i in range(1, N + 1):\n ans += dist(speed[i - 1], speed[i], t[i], v[i])\nprint(ans)\n", "fast_code_sha256": "ef1c28ef48931930eb7ce24038e625888f0f8676c6c52b301f6f650ffbd6b3a4", "fast_id": "p03566_2872c8f1cd410c9c29ad2d7bf9df4f8977d8d4f7c0c79a70b6c8f20aa8f1d2de", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N = int(eval(input()))\nt = [0] + list(map(int, input().split()))\nv = [0] + list(map(int, input().split()))\nmax_speed_from_left = [0] * (N + 1) # index i = t[i] とt[i + 1]の間\nmax_speed_from_right = [0] * (N + 1) # index i = t[i] とt[i + 1]の間\nfor i in range(1, N):\n start = max_speed_from_left[i - 1]\n max_speed_from_left[i] = min(start + t[i], v[i], v[i + 1])\nfor i in range(N - 1, 0, -1):\n start = max_speed_from_right[i + 1]\n max_speed_from_right[i] = min(start + t[i + 1], v[i], v[i + 1])\nspeed = [min(x, y) for x, y in zip(max_speed_from_left, max_speed_from_right)]\n\n\ndef dist(left_speed, right_speed, t, v):\n x = (v - left_speed) + (v - right_speed)\n if x >= t:\n v = (left_speed + right_speed + t) / 2\n x = t\n # 最高速度vに到達してt-x余る\n d = (left_speed + v) * (v - left_speed) / 2\n d += v * (t - x)\n d += (right_speed + v) * (v - right_speed) / 2\n return d\n\n\nans = 0\nfor i in range(1, N + 1):\n ans += dist(speed[i - 1], speed[i], t[i], v[i])\nprint(ans)\n", "measured_fast_code_sha256": "2872c8f1cd410c9c29ad2d7bf9df4f8977d8d4f7c0c79a70b6c8f20aa8f1d2de", "measured_slow_code": "import heapq\n\nn = int(eval(input()))\ninf = 10000000000000\nans = [[-1, -1] for i in range(n)]\nans[-1][1], ans[0][0] = 0, 0\nt = list(map(int, input().split()))\nv = list(map(int, input().split()))\nv2 = []\nfor i in range(n):\n heapq.heappush(v2, (v[i], i))\n\n\ndef next(y, wh):\n global ans, n\n ansi = inf\n if wh:\n r1, r2 = list(range(y[1] - 1, -1, -1)), list(range(y[1], n))\n else:\n r1, r2 = list(range(y[1], -1, -1)), list(range(y[1] + 1, n))\n now = 0\n for j in r1:\n if ans[j][1] != -1:\n ansi = min(ansi, ans[j][1] + now)\n now += t[j]\n if ans[j][0] != -1:\n ansi = min(ansi, ans[j][0] + now)\n now = 0\n for j in r2:\n if ans[j][0] != -1:\n ansi = min(ansi, ans[j][0] + now)\n now += t[j]\n if ans[j][1] != -1:\n ansi = min(ansi, ans[j][1] + now)\n if wh:\n ans[y[1]][0] = min(ansi, y[0])\n ans[y[1] - 1][1] = ans[y[1]][0]\n else:\n ans[y[1]][1] = min(ansi, y[0])\n ans[y[1] + 1][0] = ans[y[1]][1]\n\n\nfor i in range(n):\n y = heapq.heappop(v2)\n if ans[y[1]][0] == -1:\n next(y, True)\n if ans[y[1]][1] == -1:\n next(y, False)\nanswer = 0\nfor i in range(n):\n h = min((t[i] + sum(ans[i])) / 2, v[i])\n answer += (h**2 - ans[i][0] ** 2) / 2\n answer += (h**2 - ans[i][1] ** 2) / 2\n answer += h * (t[i] + sum(ans[i]) - 2 * h)\nprint(answer)\n", "measured_slow_code_sha256": "e080acc822dc90b94acbd1874bafc617cc0405efef250948b23c795bba65bd1b", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 7.042324917450628, "pair_id": "python_v2_132662244e6738f2e2271006", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03566", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03566_2872c8f1cd410c9c29ad2d7bf9df4f8977d8d4f7c0c79a70b6c8f20aa8f1d2de.jsonl.gz", "inputs": "reproduction/python/inputs/p03566.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03566_e080acc822dc90b94acbd1874bafc617cc0405efef250948b23c795bba65bd1b.jsonl.gz"}, "slow_code": "import heapq\n\nn = int(eval(input()))\ninf = 10000000000000\nans = [[-1, -1] for i in range(n)]\nans[-1][1], ans[0][0] = 0, 0\nt = list(map(int, input().split()))\nv = list(map(int, input().split()))\nv2 = []\nfor i in range(n):\n heapq.heappush(v2, (v[i], i))\n\n\ndef next(y, wh):\n global ans, n\n ansi = inf\n if wh:\n r1, r2 = list(range(y[1] - 1, -1, -1)), list(range(y[1], n))\n else:\n r1, r2 = list(range(y[1], -1, -1)), list(range(y[1] + 1, n))\n now = 0\n for j in r1:\n if ans[j][1] != -1:\n ansi = min(ansi, ans[j][1] + now)\n now += t[j]\n if ans[j][0] != -1:\n ansi = min(ansi, ans[j][0] + now)\n now = 0\n for j in r2:\n if ans[j][0] != -1:\n ansi = min(ansi, ans[j][0] + now)\n now += t[j]\n if ans[j][1] != -1:\n ansi = min(ansi, ans[j][1] + now)\n if wh:\n ans[y[1]][0] = min(ansi, y[0])\n ans[y[1] - 1][1] = ans[y[1]][0]\n else:\n ans[y[1]][1] = min(ansi, y[0])\n ans[y[1] + 1][0] = ans[y[1]][1]\n\n\nfor i in range(n):\n y = heapq.heappop(v2)\n if ans[y[1]][0] == -1:\n next(y, True)\n if ans[y[1]][1] == -1:\n next(y, False)\nanswer = 0\nfor i in range(n):\n h = min((t[i] + sum(ans[i])) / 2, v[i])\n answer += (h**2 - ans[i][0] ** 2) / 2\n answer += (h**2 - ans[i][1] ** 2) / 2\n answer += h * (t[i] + sum(ans[i]) - 2 * h)\nprint(answer)\n", "slow_code_sha256": "e080acc822dc90b94acbd1874bafc617cc0405efef250948b23c795bba65bd1b", "slow_id": "p03566_e080acc822dc90b94acbd1874bafc617cc0405efef250948b23c795bba65bd1b", "speedup": 6.102811661344091, "stratum": "4-8", "within_pair_jaccard": 0.38181818181818183, "workload": {"case_count": 100, "description": "Maximize distance traveled over N consecutive time segments of durations t_i with speed caps v_i. Speed is nonnegative, starts and ends at zero, and acceleration stays between -1 and 1 distance-units per second squared. Observed inputs: N=1..100 (median 60); t_i=1..200; v_i=1..100; total_duration=1..20000 (median 4520.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 804, "median": 390.5, "min": 6}, "input_format": ["N\nt_1 ... t_N\nv_1 ... v_N"], "input_format_status": "source_input_section", "input_lines": {"max": 3, "median": 3.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 201, "median": 121.0, "min": 3}}} -{"case_ids": ["p02699_case_000", "p02699_case_001", "p02699_case_002", "p02699_case_003", "p02699_case_004", "p02699_case_005", "p02699_case_006", "p02699_case_007", "p02699_case_008", "p02699_case_009", "p02699_case_010", "p02699_case_011", "p02699_case_012", "p02699_case_013", "p02699_case_014", "p02699_case_015", "p02699_case_016", "p02699_case_017", "p02699_case_018", "p02699_case_019", "p02699_case_020", "p02699_case_021", "p02699_case_022", "p02699_case_023", "p02699_case_024", "p02699_case_025", "p02699_case_026", "p02699_case_027", "p02699_case_028", "p02699_case_029", "p02699_case_030", "p02699_case_031", "p02699_case_032", "p02699_case_033", "p02699_case_034", "p02699_case_035", "p02699_case_036", "p02699_case_037", "p02699_case_038", "p02699_case_039", "p02699_case_040", "p02699_case_041", "p02699_case_042", "p02699_case_043", "p02699_case_044", "p02699_case_045", "p02699_case_046", "p02699_case_047", "p02699_case_048", "p02699_case_049", "p02699_case_050", "p02699_case_051", "p02699_case_052", "p02699_case_053", "p02699_case_054", "p02699_case_055", "p02699_case_056", "p02699_case_057", "p02699_case_058", "p02699_case_059", "p02699_case_060", "p02699_case_061", "p02699_case_062", "p02699_case_063", "p02699_case_064", "p02699_case_065", "p02699_case_066", "p02699_case_067", "p02699_case_068", "p02699_case_069", "p02699_case_070", "p02699_case_071", "p02699_case_072", "p02699_case_073", "p02699_case_074", "p02699_case_075", "p02699_case_076", "p02699_case_077", "p02699_case_078", "p02699_case_079", "p02699_case_080", "p02699_case_081", "p02699_case_082", "p02699_case_083", "p02699_case_084", "p02699_case_085", "p02699_case_086", "p02699_case_087", "p02699_case_088", "p02699_case_089", "p02699_case_090", "p02699_case_091", "p02699_case_092", "p02699_case_093", "p02699_case_094", "p02699_case_095", "p02699_case_096", "p02699_case_097", "p02699_case_098", "p02699_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "s, w = map(int, input().split())\nprint(\"unsafe\") if w >= s else print(\"safe\")\n", "fast_code_sha256": "3f65538115180e09902679739ec85edb37a82a1b82145d4fa6c2db569ed43870", "fast_id": "p02699_3f65538115180e09902679739ec85edb37a82a1b82145d4fa6c2db569ed43870", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "s, w = map(int, input().split())\nprint(\"unsafe\") if w >= s else print(\"safe\")\n", "measured_fast_code_sha256": "3f65538115180e09902679739ec85edb37a82a1b82145d4fa6c2db569ed43870", "measured_slow_code": "#!/usr/bin/env python3\n# A\nimport sys\nimport math\nfrom bisect import bisect_right as br\nfrom bisect import bisect_left as bl\n\nsys.setrecursionlimit(2147483647)\nfrom heapq import heappush, heappop, heappushpop\nfrom collections import defaultdict\nfrom itertools import accumulate\nfrom collections import Counter\nfrom collections import deque\nfrom operator import itemgetter\nfrom itertools import permutations\n\nmod = 10**9 + 7\ninf = float(\"inf\")\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\ns, w = LI()\nif w >= s:\n print(\"unsafe\")\nelse:\n print(\"safe\")\n", "measured_slow_code_sha256": "084d274c57f95a15e9ad65a8072a788828494b876c9fb00ba76e955369e619b4", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4.144584057433018, "pair_id": "python_v2_b3187e21923bc304095f59e0", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02699", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02699_3f65538115180e09902679739ec85edb37a82a1b82145d4fa6c2db569ed43870.jsonl.gz", "inputs": "reproduction/python/inputs/p02699.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02699_084d274c57f95a15e9ad65a8072a788828494b876c9fb00ba76e955369e619b4.jsonl.gz"}, "slow_code": "import sys\nimport math\nfrom bisect import bisect_right as br\nfrom bisect import bisect_left as bl\n\nsys.setrecursionlimit(2147483647)\nfrom heapq import heappush, heappop, heappushpop\nfrom collections import defaultdict\nfrom itertools import accumulate\nfrom collections import Counter\nfrom collections import deque\nfrom operator import itemgetter\nfrom itertools import permutations\n\nmod = 10**9 + 7\ninf = float(\"inf\")\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\ns, w = LI()\nif w >= s:\n print(\"unsafe\")\nelse:\n print(\"safe\")\n", "slow_code_sha256": "2b15fcde67ed0713d312a3aaee502dd9087cb59a31e02c65162aa10dcbc89fbe", "slow_id": "p02699_084d274c57f95a15e9ad65a8072a788828494b876c9fb00ba76e955369e619b4", "speedup": 4.1418215865726005, "stratum": "4-8", "within_pair_jaccard": 0.20408163265306123, "workload": {"case_count": 100, "description": "Given S sheep and W wolves, report unsafe if wolves are at least as numerous as sheep, and safe otherwise. Observed inputs: S=1..100 (median 38); W=1..100 (median 49.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 8, "median": 6.0, "min": 4}, "input_format": ["S W"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p02640_case_000", "p02640_case_001", "p02640_case_002", "p02640_case_003", "p02640_case_004", "p02640_case_005", "p02640_case_006", "p02640_case_007", "p02640_case_008", "p02640_case_009", "p02640_case_010", "p02640_case_011", "p02640_case_012", "p02640_case_013", "p02640_case_014", "p02640_case_015", "p02640_case_016", "p02640_case_017", "p02640_case_018", "p02640_case_019", "p02640_case_020", "p02640_case_021", "p02640_case_022", "p02640_case_023", "p02640_case_024", "p02640_case_025", "p02640_case_026", "p02640_case_027", "p02640_case_028", "p02640_case_029", "p02640_case_030", "p02640_case_031", "p02640_case_032", "p02640_case_033", "p02640_case_034", "p02640_case_035", "p02640_case_036", "p02640_case_037", "p02640_case_038", "p02640_case_039", "p02640_case_040", "p02640_case_041", "p02640_case_042", "p02640_case_043", "p02640_case_044", "p02640_case_045", "p02640_case_046", "p02640_case_047", "p02640_case_048", "p02640_case_049", "p02640_case_050", "p02640_case_051", "p02640_case_052", "p02640_case_053", "p02640_case_054", "p02640_case_055", "p02640_case_056", "p02640_case_057", "p02640_case_058", "p02640_case_059", "p02640_case_060", "p02640_case_061", "p02640_case_062", "p02640_case_063", "p02640_case_064", "p02640_case_065", "p02640_case_066", "p02640_case_067", "p02640_case_068", "p02640_case_069", "p02640_case_070", "p02640_case_071", "p02640_case_072", "p02640_case_073", "p02640_case_074", "p02640_case_075", "p02640_case_076", "p02640_case_077", "p02640_case_078", "p02640_case_079", "p02640_case_080", "p02640_case_081", "p02640_case_082", "p02640_case_083", "p02640_case_084", "p02640_case_085", "p02640_case_086", "p02640_case_087", "p02640_case_088", "p02640_case_089", "p02640_case_090", "p02640_case_091", "p02640_case_092", "p02640_case_093", "p02640_case_094", "p02640_case_095", "p02640_case_096", "p02640_case_097", "p02640_case_098", "p02640_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "x, y = list(map(int, input().split()))\nprint((\"NYoe s\"[(2 * x <= y <= 4 * x) > y % 2 :: 2]))\n", "fast_code_sha256": "a956c7a4cf9f25b4cc82406f7bcaf7852e580776013b21d53dd603807fb8f305", "fast_id": "p02640_a956c7a4cf9f25b4cc82406f7bcaf7852e580776013b21d53dd603807fb8f305", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "x, y = list(map(int, input().split()))\nprint((\"NYoe s\"[(2 * x <= y <= 4 * x) > y % 2 :: 2]))\n", "measured_fast_code_sha256": "a956c7a4cf9f25b4cc82406f7bcaf7852e580776013b21d53dd603807fb8f305", "measured_slow_code": "X, Y = (int(x) for x in input().split())\nFlag = False\nfor A in range(0, X + 1):\n for B in range(0, X + 1):\n if A + B == X and 2 * A + 4 * B == Y:\n Flag = True\n if Flag:\n break\nif Flag:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "measured_slow_code_sha256": "001136f60415c5c4318edea1d984f576b84824fa86ba5571a3840f57e678ed18", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.7369338385680733, "pair_id": "python_v2_c5d006e4276eaba24ffdb7e8", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02640", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02640_a956c7a4cf9f25b4cc82406f7bcaf7852e580776013b21d53dd603807fb8f305.jsonl.gz", "inputs": "reproduction/python/inputs/p02640.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02640_001136f60415c5c4318edea1d984f576b84824fa86ba5571a3840f57e678ed18.jsonl.gz"}, "slow_code": "X, Y = (int(x) for x in input().split())\nFlag = False\nfor A in range(0, X + 1):\n for B in range(0, X + 1):\n if A + B == X and 2 * A + 4 * B == Y:\n Flag = True\n if Flag:\n break\nif Flag:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "slow_code_sha256": "001136f60415c5c4318edea1d984f576b84824fa86ba5571a3840f57e678ed18", "slow_id": "p02640_001136f60415c5c4318edea1d984f576b84824fa86ba5571a3840f57e678ed18", "speedup": 4.121681405765261, "stratum": "4-8", "within_pair_jaccard": 0.23333333333333334, "workload": {"case_count": 100, "description": "Determine whether X animals can have Y legs in total when each animal is either a two-legged crane or a four-legged turtle. Observed inputs: X=1..100 (median 18); Y=1..100 (median 41).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 8, "median": 6.0, "min": 4}, "input_format": ["X Y"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p02804_case_000", "p02804_case_001", "p02804_case_002", "p02804_case_003", "p02804_case_004", "p02804_case_005", "p02804_case_006", "p02804_case_007", "p02804_case_008", "p02804_case_009", "p02804_case_010", "p02804_case_011", "p02804_case_012", "p02804_case_013", "p02804_case_014", "p02804_case_015", "p02804_case_016", "p02804_case_017", "p02804_case_018", "p02804_case_019", "p02804_case_020", "p02804_case_021", "p02804_case_022", "p02804_case_023", "p02804_case_024", "p02804_case_025", "p02804_case_026", "p02804_case_027", "p02804_case_028", "p02804_case_029", "p02804_case_030", "p02804_case_031", "p02804_case_032", "p02804_case_033", "p02804_case_034", "p02804_case_035", "p02804_case_036", "p02804_case_037", "p02804_case_038", "p02804_case_039", "p02804_case_040", "p02804_case_041", "p02804_case_042", "p02804_case_043", "p02804_case_044", "p02804_case_045", "p02804_case_046", "p02804_case_047", "p02804_case_048", "p02804_case_049", "p02804_case_050", "p02804_case_051", "p02804_case_052", "p02804_case_053", "p02804_case_054", "p02804_case_055", "p02804_case_056", "p02804_case_057", "p02804_case_058", "p02804_case_059", "p02804_case_060", "p02804_case_061", "p02804_case_062", "p02804_case_063", "p02804_case_064", "p02804_case_065", "p02804_case_066", "p02804_case_067", "p02804_case_068", "p02804_case_069", "p02804_case_070", "p02804_case_071", "p02804_case_072", "p02804_case_073", "p02804_case_074", "p02804_case_075", "p02804_case_076", "p02804_case_077", "p02804_case_078", "p02804_case_079", "p02804_case_080", "p02804_case_081", "p02804_case_082", "p02804_case_083", "p02804_case_084", "p02804_case_085", "p02804_case_086", "p02804_case_087", "p02804_case_088", "p02804_case_089", "p02804_case_090", "p02804_case_091", "p02804_case_092", "p02804_case_093", "p02804_case_094", "p02804_case_095", "p02804_case_096", "p02804_case_097", "p02804_case_098", "p02804_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "mod = 10**9 + 7\n\n\ndef cmb(n, r, p):\n if (r < 0) or (n < r):\n return 0\n r = min(r, n - r)\n return fact[n] * factinv[r] * factinv[n - r] % p\n\n\nfact = [1, 1]\nfactinv = [1, 1]\ninv = [0, 1]\np = mod\nfor i in range(2, 10**5 + 1):\n fact.append((fact[-1] * i) % p)\n inv.append((-inv[p % i] * (p // i)) % p)\n factinv.append((factinv[-1] * inv[-1]) % p)\nN, K = list(map(int, input().split()))\nA = sorted(map(int, input().split()))\nR = sorted(A, reverse=True)\nans = 0\nfor i in range(N - K + 1):\n t = cmb(N - i - 1, K - 1, mod)\n mi = A[i] * t % mod\n ma = A[N - (i + 1)] * t % mod\n ans = (ans + ma - mi) % mod\nprint(ans)\n", "fast_code_sha256": "7ba76d8749129cd17417a2ada0a943c09cf0118a1602df98da321a7dfb8121fa", "fast_id": "p02804_7df9b2d4a3a2426f2d7ef3524541707d3f02d6202a43ec1e9fe6580721779e81", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "mod = 10**9 + 7\n\n\ndef cmb(n, r, p):\n if (r < 0) or (n < r):\n return 0\n r = min(r, n - r)\n return fact[n] * factinv[r] * factinv[n - r] % p\n\n\nfact = [1, 1] # fact[n] = (n! mod p)\nfactinv = [1, 1] # factinv[n] = ((n!)^(-1) mod p)\ninv = [0, 1] # factinv 計算用\np = mod\nfor i in range(2, 10**5 + 1):\n fact.append((fact[-1] * i) % p)\n inv.append((-inv[p % i] * (p // i)) % p)\n factinv.append((factinv[-1] * inv[-1]) % p)\nN, K = list(map(int, input().split()))\nA = sorted(map(int, input().split()))\nR = sorted(A, reverse=True)\nans = 0\nfor i in range(N - K + 1):\n t = cmb(N - i - 1, K - 1, mod)\n mi = A[i] * t % mod\n ma = A[N - (i + 1)] * t % mod\n ans = (ans + ma - mi) % mod\nprint(ans)\n", "measured_fast_code_sha256": "7df9b2d4a3a2426f2d7ef3524541707d3f02d6202a43ec1e9fe6580721779e81", "measured_slow_code": "N_MAX = 10**6\nMOD = 10**9 + 7\nfac, finv, inv = [0] * N_MAX, [0] * N_MAX, [0] * N_MAX\n\n\ndef com_init():\n fac[0], fac[1] = 1, 1\n finv[0], finv[1] = 1, 1\n inv[1] = 1\n for i in range(2, N_MAX):\n fac[i] = fac[i - 1] * i % MOD\n inv[i] = MOD - inv[MOD % i] * (MOD // i) % MOD\n finv[i] = finv[i - 1] * inv[i] % MOD\n\n\ndef com(n, k):\n if n < k:\n return 0\n if n < 0 or k < 0:\n return 0\n return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD\n\n\nn, k = list(map(int, input().split()))\nal = list(map(int, input().split()))\ncom_init()\nal.sort()\nans_max = 0\nans_min = 0\nfor i, a in enumerate(al):\n ans_max += a * com(i, k - 1)\n ans_max %= MOD\n ans_min += a * com(n - 1 - i, k - 1)\n ans_min %= MOD\nprint(((ans_max - ans_min) % MOD))\n", "measured_slow_code_sha256": "7a118ce2764a5719ed366c9c22ffc653766a914f4a46e16d4f0cdc6623af51e1", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 8.223526732253944, "pair_id": "python_v2_8cc6966eb76ce31a1fac466b", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02804", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02804_7df9b2d4a3a2426f2d7ef3524541707d3f02d6202a43ec1e9fe6580721779e81.jsonl.gz", "inputs": "reproduction/python/inputs/p02804.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02804_7a118ce2764a5719ed366c9c22ffc653766a914f4a46e16d4f0cdc6623af51e1.jsonl.gz"}, "slow_code": "N_MAX = 10**6\nMOD = 10**9 + 7\nfac, finv, inv = [0] * N_MAX, [0] * N_MAX, [0] * N_MAX\n\n\ndef com_init():\n fac[0], fac[1] = 1, 1\n finv[0], finv[1] = 1, 1\n inv[1] = 1\n for i in range(2, N_MAX):\n fac[i] = fac[i - 1] * i % MOD\n inv[i] = MOD - inv[MOD % i] * (MOD // i) % MOD\n finv[i] = finv[i - 1] * inv[i] % MOD\n\n\ndef com(n, k):\n if n < k:\n return 0\n if n < 0 or k < 0:\n return 0\n return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD\n\n\nn, k = list(map(int, input().split()))\nal = list(map(int, input().split()))\ncom_init()\nal.sort()\nans_max = 0\nans_min = 0\nfor i, a in enumerate(al):\n ans_max += a * com(i, k - 1)\n ans_max %= MOD\n ans_min += a * com(n - 1 - i, k - 1)\n ans_min %= MOD\nprint(((ans_max - ans_min) % MOD))\n", "slow_code_sha256": "7a118ce2764a5719ed366c9c22ffc653766a914f4a46e16d4f0cdc6623af51e1", "slow_id": "p02804_7a118ce2764a5719ed366c9c22ffc653766a914f4a46e16d4f0cdc6623af51e1", "speedup": 6.924126099091412, "stratum": "4-8", "within_pair_jaccard": 0.39285714285714285, "workload": {"case_count": 100, "description": "For every choice of K distinct indices among N array positions, take the largest selected value minus the smallest. Sum these differences modulo 1000000007. Equal values at different indices are distinct choices. Observed inputs: N=1..100000 (median 100); K=1..100000 (median 5); A_i=-1000000000..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1200009, "median": 1046.0, "min": 10}, "input_format": ["N K\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100002, "median": 102.0, "min": 3}}} -{"case_ids": ["p03593_case_000", "p03593_case_001", "p03593_case_002", "p03593_case_003", "p03593_case_004", "p03593_case_005", "p03593_case_006", "p03593_case_007", "p03593_case_008", "p03593_case_009", "p03593_case_010", "p03593_case_011", "p03593_case_012", "p03593_case_013", "p03593_case_014", "p03593_case_015", "p03593_case_016", "p03593_case_017", "p03593_case_018", "p03593_case_019", "p03593_case_020", "p03593_case_021", "p03593_case_022", "p03593_case_023", "p03593_case_024", "p03593_case_025", "p03593_case_026", "p03593_case_027", "p03593_case_028", "p03593_case_029", "p03593_case_030", "p03593_case_031", "p03593_case_032", "p03593_case_033", "p03593_case_034", "p03593_case_035", "p03593_case_036", "p03593_case_037", "p03593_case_038", "p03593_case_039", "p03593_case_040", "p03593_case_041", "p03593_case_042", "p03593_case_043", "p03593_case_044", "p03593_case_045", "p03593_case_046", "p03593_case_047", "p03593_case_048", "p03593_case_049", "p03593_case_050", "p03593_case_051", "p03593_case_052", "p03593_case_053", "p03593_case_054", "p03593_case_055", "p03593_case_056", "p03593_case_057", "p03593_case_058", "p03593_case_059", "p03593_case_060", "p03593_case_061", "p03593_case_062", "p03593_case_063", "p03593_case_064", "p03593_case_065", "p03593_case_066", "p03593_case_067", "p03593_case_068", "p03593_case_069", "p03593_case_070", "p03593_case_071", "p03593_case_072", "p03593_case_073", "p03593_case_074", "p03593_case_075", "p03593_case_076", "p03593_case_077", "p03593_case_078", "p03593_case_079", "p03593_case_080", "p03593_case_081", "p03593_case_082", "p03593_case_083", "p03593_case_084", "p03593_case_085", "p03593_case_086", "p03593_case_087", "p03593_case_088", "p03593_case_089", "p03593_case_090", "p03593_case_091", "p03593_case_092", "p03593_case_093", "p03593_case_094", "p03593_case_095", "p03593_case_096", "p03593_case_097", "p03593_case_098", "p03593_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from collections import Counter\n\n\ndef main():\n H, W, *A = open(0).read().split()\n H, W, C = int(H), int(W), list(Counter(\"\".join(A)).values())\n single = H & W & 1\n double = (H >> 1 if W & 1 else 0) + (W >> 1 if H & 1 else 0)\n C_mod4, C_div4 = list(zip(*[(i % 4, i // 4) for i in C]))\n flg = C_mod4.count(1) + C_mod4.count(3) <= single and C_mod4.count(2) <= double\n print((\"Yes\" if flg else \"No\"))\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "2d8057a8593c6890611cb12de17b230598b8581555985c155063c3a54394e014", "fast_id": "p03593_c177b5b6b9f30c7fd56c170eb12163023c6db1c8a97b734e471c2fc91733f649", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "# code-festival-2017-qualaC - Palindromic Matrix\nfrom collections import Counter\n\n\ndef main():\n H, W, *A = open(0).read().split()\n H, W, C = int(H), int(W), list(Counter(\"\".join(A)).values())\n single = H & W & 1\n double = (H >> 1 if W & 1 else 0) + (W >> 1 if H & 1 else 0)\n C_mod4, C_div4 = list(zip(*[(i % 4, i // 4) for i in C]))\n flg = C_mod4.count(1) + C_mod4.count(3) <= single and C_mod4.count(2) <= double\n print((\"Yes\" if flg else \"No\"))\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "c177b5b6b9f30c7fd56c170eb12163023c6db1c8a97b734e471c2fc91733f649", "measured_slow_code": "import sys\n\nstdin = sys.stdin\nsys.setrecursionlimit(10**7)\n\n\ndef li():\n return list(map(int, stdin.readline().split()))\n\n\ndef li_():\n return [int(x) - 1 for x in stdin.readline().split()]\n\n\ndef lf():\n return list(map(float, stdin.readline().split()))\n\n\ndef ls():\n return stdin.readline().split()\n\n\ndef ns():\n return stdin.readline().rstrip()\n\n\ndef lc():\n return list(ns())\n\n\ndef ni():\n return int(stdin.readline())\n\n\ndef nf():\n return float(stdin.readline())\n\n\nfrom collections import defaultdict\n\n\ndef judge(cnts, h, w):\n odd_cnt = 0\n mod4_2_cnt = 0\n mod4_0_cnt = 0\n for key, val in list(cnts.items()):\n if val % 2 == 1:\n odd_cnt += 1\n elif val % 4 == 2:\n mod4_2_cnt += 1\n else:\n mod4_0_cnt += 1\n if h == 1 and w == 1:\n return True\n elif h == 1:\n if w % 2 == 1:\n return True if odd_cnt == 1 else False\n else:\n return True if odd_cnt == 0 else False\n elif w == 1:\n if h % 2 == 1:\n return True if odd_cnt == 1 else False\n else:\n return True if odd_cnt == 0 else False\n elif h % 2 == 1 and w % 2 == 1:\n return True if mod4_2_cnt == (w // 2 + h // 2) and odd_cnt == 1 else False\n elif h % 2 == 1:\n return True if mod4_2_cnt == (w // 2) and odd_cnt == 0 else False\n elif w % 2 == 1:\n return True if mod4_2_cnt == (h // 2) and odd_cnt == 0 else False\n else:\n return True if mod4_2_cnt == 0 and odd_cnt == 0 else False\n\n\nh, w = li()\na = [ns() for _ in range(h)]\nchar_cnt = defaultdict(int)\nfor ai in a:\n for aij in ai:\n char_cnt[aij] += 1\nprint((\"Yes\" if judge(char_cnt, h, w) else \"No\"))\n", "measured_slow_code_sha256": "2669f1bac8b8659463194324a59012de5ef4bcedae5fa2d42d20fa1c7e412b52", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.413211657015518, "pair_id": "python_v2_088a6d0ecf0d2fa6e58c24a7", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03593", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03593_c177b5b6b9f30c7fd56c170eb12163023c6db1c8a97b734e471c2fc91733f649.jsonl.gz", "inputs": "reproduction/python/inputs/p03593.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03593_2669f1bac8b8659463194324a59012de5ef4bcedae5fa2d42d20fa1c7e412b52.jsonl.gz"}, "slow_code": "import sys\n\nstdin = sys.stdin\nsys.setrecursionlimit(10**7)\n\n\ndef li():\n return list(map(int, stdin.readline().split()))\n\n\ndef li_():\n return [int(x) - 1 for x in stdin.readline().split()]\n\n\ndef lf():\n return list(map(float, stdin.readline().split()))\n\n\ndef ls():\n return stdin.readline().split()\n\n\ndef ns():\n return stdin.readline().rstrip()\n\n\ndef lc():\n return list(ns())\n\n\ndef ni():\n return int(stdin.readline())\n\n\ndef nf():\n return float(stdin.readline())\n\n\nfrom collections import defaultdict\n\n\ndef judge(cnts, h, w):\n odd_cnt = 0\n mod4_2_cnt = 0\n mod4_0_cnt = 0\n for key, val in list(cnts.items()):\n if val % 2 == 1:\n odd_cnt += 1\n elif val % 4 == 2:\n mod4_2_cnt += 1\n else:\n mod4_0_cnt += 1\n if h == 1 and w == 1:\n return True\n elif h == 1:\n if w % 2 == 1:\n return True if odd_cnt == 1 else False\n else:\n return True if odd_cnt == 0 else False\n elif w == 1:\n if h % 2 == 1:\n return True if odd_cnt == 1 else False\n else:\n return True if odd_cnt == 0 else False\n elif h % 2 == 1 and w % 2 == 1:\n return True if mod4_2_cnt == (w // 2 + h // 2) and odd_cnt == 1 else False\n elif h % 2 == 1:\n return True if mod4_2_cnt == (w // 2) and odd_cnt == 0 else False\n elif w % 2 == 1:\n return True if mod4_2_cnt == (h // 2) and odd_cnt == 0 else False\n else:\n return True if mod4_2_cnt == 0 and odd_cnt == 0 else False\n\n\nh, w = li()\na = [ns() for _ in range(h)]\nchar_cnt = defaultdict(int)\nfor ai in a:\n for aij in ai:\n char_cnt[aij] += 1\nprint((\"Yes\" if judge(char_cnt, h, w) else \"No\"))\n", "slow_code_sha256": "2669f1bac8b8659463194324a59012de5ef4bcedae5fa2d42d20fa1c7e412b52", "slow_id": "p03593_2669f1bac8b8659463194324a59012de5ef4bcedae5fa2d42d20fa1c7e412b52", "speedup": 2.446522509489532, "stratum": "2-4", "within_pair_jaccard": 0.21518987341772153, "workload": {"case_count": 100, "description": "Rearrange all lowercase letters of an H-by-W matrix arbitrarily, preserving dimensions. Determine whether every row and every column can simultaneously be a palindrome. Observed inputs: H=1..100 (median 4.5); W=1..100 (median 4.5); cells=1..10000; distinct_letters=1..26.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 10108, "median": 105.0, "min": 6}, "input_format": ["H W\nrow_1\n...\nrow_H (each row has W lowercase letters)"], "input_format_status": "source_input_section", "input_lines": {"max": 101, "median": 5.5, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 102, "median": 6.5, "min": 3}}} -{"case_ids": ["p03251_case_000", "p03251_case_001", "p03251_case_002", "p03251_case_003", "p03251_case_004", "p03251_case_005", "p03251_case_006", "p03251_case_007", "p03251_case_008", "p03251_case_009", "p03251_case_010", "p03251_case_011", "p03251_case_012", "p03251_case_013", "p03251_case_014", "p03251_case_015", "p03251_case_016", "p03251_case_017", "p03251_case_018", "p03251_case_019", "p03251_case_020", "p03251_case_021", "p03251_case_022", "p03251_case_023", "p03251_case_024", "p03251_case_025", "p03251_case_026", "p03251_case_027", "p03251_case_028", "p03251_case_029", "p03251_case_030", "p03251_case_031", "p03251_case_032", "p03251_case_033", "p03251_case_034", "p03251_case_035", "p03251_case_036", "p03251_case_037", "p03251_case_038", "p03251_case_039", "p03251_case_040", "p03251_case_041", "p03251_case_042", "p03251_case_043", "p03251_case_044", "p03251_case_045", "p03251_case_046", "p03251_case_047", "p03251_case_048", "p03251_case_049", "p03251_case_050", "p03251_case_051", "p03251_case_052", "p03251_case_053", "p03251_case_054", "p03251_case_055", "p03251_case_056", "p03251_case_057", "p03251_case_058", "p03251_case_059", "p03251_case_060", "p03251_case_061", "p03251_case_062", "p03251_case_063", "p03251_case_064", "p03251_case_065", "p03251_case_066", "p03251_case_067", "p03251_case_068", "p03251_case_069", "p03251_case_070", "p03251_case_071", "p03251_case_072", "p03251_case_073", "p03251_case_074", "p03251_case_075", "p03251_case_076", "p03251_case_077", "p03251_case_078", "p03251_case_079", "p03251_case_080", "p03251_case_081", "p03251_case_082", "p03251_case_083", "p03251_case_084", "p03251_case_085", "p03251_case_086", "p03251_case_087", "p03251_case_088", "p03251_case_089", "p03251_case_090", "p03251_case_091", "p03251_case_092", "p03251_case_093", "p03251_case_094", "p03251_case_095", "p03251_case_096", "p03251_case_097", "p03251_case_098", "p03251_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "s = input()\nn, m, x, y = [int(x) for x in s.split()]\nxx = [int(a) for a in input().split()]\nyy = [int(a) for a in input().split()]\nxx = sorted(xx)\nyy = sorted(yy)\nif xx[-1] >= y or yy[0] <= x or xx[-1] >= yy[0]:\n print(\"War\")\nelse:\n print(\"No War\")\n", "fast_code_sha256": "015047b170b9c1e69815320904314181f54f1d92d1527ba6cbad8ecfb12b3c42", "fast_id": "p03251_bbb46fd0d96d4c381198c2311c4195f70f0dd6dc4e22422ee5082fdcad0e52d8", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\ns = input()\nn, m, x, y = [int(x) for x in s.split()]\nxx = [int(a) for a in input().split()]\nyy = [int(a) for a in input().split()]\nxx = sorted(xx)\nyy = sorted(yy)\nif xx[-1] >= y or yy[0] <= x or xx[-1] >= yy[0]:\n print(\"War\")\nelse:\n print(\"No War\")\n", "measured_fast_code_sha256": "bbb46fd0d96d4c381198c2311c4195f70f0dd6dc4e22422ee5082fdcad0e52d8", "measured_slow_code": "# -*- coding: utf-8 -*-\nimport bisect\nimport heapq\nimport math\nimport random\nimport sys\nfrom collections import Counter, defaultdict, deque\nfrom decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal\nfrom functools import lru_cache, reduce\nfrom itertools import combinations, combinations_with_replacement, product, permutations\nfrom operator import add, mul, sub\n\nsys.setrecursionlimit(10000)\n\n\ndef read_int():\n return int(input())\n\n\ndef read_int_n():\n return list(map(int, input().split()))\n\n\ndef read_float():\n return float(input())\n\n\ndef read_float_n():\n return list(map(float, input().split()))\n\n\ndef read_str():\n return input().strip()\n\n\ndef read_str_n():\n return list(map(str, input().split()))\n\n\ndef error_print(*args):\n print(*args, file=sys.stderr)\n\n\ndef mt(f):\n import time\n\n def wrap(*args, **kwargs):\n s = time.time()\n ret = f(*args, **kwargs)\n e = time.time()\n error_print(e - s, \"sec\")\n return ret\n\n return wrap\n\n\n@mt\ndef slv(N, M, X, Y, x, y):\n mx = max(x)\n my = min(y)\n error_print(mx, my)\n if mx < my and (my > X and mx < Y):\n return \"No War\"\n return \"War\"\n\n\ndef main():\n N, M, X, Y = read_int_n()\n x = read_int_n()\n y = read_int_n()\n print(slv(N, M, X, Y, x, y))\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "5ce8798f598c49e1a4c395a4c8846ff472fdaac4991833a8da4555eab052e27f", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 7.450848547446245, "pair_id": "python_v2_46cebb6071f36a033b7f0fde", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03251", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03251_bbb46fd0d96d4c381198c2311c4195f70f0dd6dc4e22422ee5082fdcad0e52d8.jsonl.gz", "inputs": "reproduction/python/inputs/p03251.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03251_5ce8798f598c49e1a4c395a4c8846ff472fdaac4991833a8da4555eab052e27f.jsonl.gz"}, "slow_code": "import bisect\nimport heapq\nimport math\nimport random\nimport sys\nfrom collections import Counter, defaultdict, deque\nfrom decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal\nfrom functools import lru_cache, reduce\nfrom itertools import combinations, combinations_with_replacement, product, permutations\nfrom operator import add, mul, sub\n\nsys.setrecursionlimit(10000)\n\n\ndef read_int():\n return int(input())\n\n\ndef read_int_n():\n return list(map(int, input().split()))\n\n\ndef read_float():\n return float(input())\n\n\ndef read_float_n():\n return list(map(float, input().split()))\n\n\ndef read_str():\n return input().strip()\n\n\ndef read_str_n():\n return list(map(str, input().split()))\n\n\ndef error_print(*args):\n print(*args, file=sys.stderr)\n\n\ndef mt(f):\n import time\n\n def wrap(*args, **kwargs):\n s = time.time()\n ret = f(*args, **kwargs)\n e = time.time()\n error_print(e - s, \"sec\")\n return ret\n\n return wrap\n\n\n@mt\ndef slv(N, M, X, Y, x, y):\n mx = max(x)\n my = min(y)\n error_print(mx, my)\n if mx < my and (my > X and mx < Y):\n return \"No War\"\n return \"War\"\n\n\ndef main():\n N, M, X, Y = read_int_n()\n x = read_int_n()\n y = read_int_n()\n print(slv(N, M, X, Y, x, y))\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "5a881080c64c83352de556b20fff7b0700f2ff443a5f03182fd4ed0f3d7f6e7c", "slow_id": "p03251_5ce8798f598c49e1a4c395a4c8846ff472fdaac4991833a8da4555eab052e27f", "speedup": 7.645284232649253, "stratum": "4-8", "within_pair_jaccard": 0.11235955056179775, "workload": {"case_count": 100, "description": "Determine whether an integer Z satisfies X=Z. Each coordinate list is distinct internally and excludes its own capital X or Y. Lists are not necessarily sorted. Observed inputs: N=1..100 (median 50); M=1..100 (median 50); X=-100..99; Y=-99..100; x_i=-100..100; y_i=-100..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 706, "median": 356.0, "min": 20}, "input_format": ["N M X Y\nx_1 ... x_N\ny_1 ... y_M"], "input_format_status": "source_input_section", "input_lines": {"max": 3, "median": 3.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 204, "median": 104.0, "min": 6}}} -{"case_ids": ["p03185_case_000", "p03185_case_001", "p03185_case_002", "p03185_case_003", "p03185_case_004", "p03185_case_005", "p03185_case_006", "p03185_case_007", "p03185_case_008", "p03185_case_009", "p03185_case_010", "p03185_case_011", "p03185_case_012", "p03185_case_013", "p03185_case_014", "p03185_case_015", "p03185_case_016", "p03185_case_017", "p03185_case_018", "p03185_case_019", "p03185_case_020", "p03185_case_021", "p03185_case_022", "p03185_case_023", "p03185_case_024", "p03185_case_025", "p03185_case_026", "p03185_case_027", "p03185_case_028", "p03185_case_029", "p03185_case_030", "p03185_case_031", "p03185_case_032", "p03185_case_033", "p03185_case_034", "p03185_case_035", "p03185_case_036", "p03185_case_037", "p03185_case_038", "p03185_case_039", "p03185_case_040", "p03185_case_041", "p03185_case_042", "p03185_case_043", "p03185_case_044", "p03185_case_045", "p03185_case_046", "p03185_case_047", "p03185_case_048", "p03185_case_049", "p03185_case_050", "p03185_case_051", "p03185_case_052", "p03185_case_053", "p03185_case_054", "p03185_case_055", "p03185_case_056", "p03185_case_057", "p03185_case_058", "p03185_case_059", "p03185_case_060", "p03185_case_061", "p03185_case_062", "p03185_case_063", "p03185_case_064", "p03185_case_065", "p03185_case_066", "p03185_case_067", "p03185_case_068", "p03185_case_069", "p03185_case_070", "p03185_case_071", "p03185_case_072", "p03185_case_073", "p03185_case_074", "p03185_case_075", "p03185_case_076", "p03185_case_077", "p03185_case_078", "p03185_case_079", "p03185_case_080", "p03185_case_081", "p03185_case_082", "p03185_case_083", "p03185_case_084", "p03185_case_085", "p03185_case_086", "p03185_case_087", "p03185_case_088", "p03185_case_089", "p03185_case_090", "p03185_case_091", "p03185_case_092", "p03185_case_093", "p03185_case_094", "p03185_case_095", "p03185_case_096", "p03185_case_097", "p03185_case_098", "p03185_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N, C = list(map(int, input().split()))\nhs = list(map(int, input().split()))\nlines = [(-2 * hs[0], hs[0] ** 2)]\nI = 0\nfor h in hs[1:]:\n u, v = lines[I]\n while I + 1 < len(lines):\n uu, vv = lines[I + 1]\n if u * h + v < uu * h + vv:\n break\n u, v = uu, vv\n I += 1\n r = u * h + v + h**2 + C\n a, b = -2 * h, r + h**2\n (e, f) = lines[-1]\n while len(lines) - 1:\n (c, d), (e, f) = (e, f), lines[-2]\n if (c - e) * (b - d) < (d - f) * (a - c):\n break\n lines.pop()\n lines.append((a, b))\nprint(r)\n", "fast_code_sha256": "7dfca9eb6adfb71b30ea843e795c6c0957ea1ed8fbd2e0ee01f5a4b53ace9316", "fast_id": "p03185_7dfca9eb6adfb71b30ea843e795c6c0957ea1ed8fbd2e0ee01f5a4b53ace9316", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N, C = list(map(int, input().split()))\nhs = list(map(int, input().split()))\nlines = [(-2 * hs[0], hs[0] ** 2)]\nI = 0\nfor h in hs[1:]:\n u, v = lines[I]\n while I + 1 < len(lines):\n uu, vv = lines[I + 1]\n if u * h + v < uu * h + vv:\n break\n u, v = uu, vv\n I += 1\n r = u * h + v + h**2 + C\n a, b = -2 * h, r + h**2\n (e, f) = lines[-1]\n while len(lines) - 1:\n (c, d), (e, f) = (e, f), lines[-2]\n if (c - e) * (b - d) < (d - f) * (a - c):\n break\n lines.pop()\n lines.append((a, b))\nprint(r)\n", "measured_fast_code_sha256": "7dfca9eb6adfb71b30ea843e795c6c0957ea1ed8fbd2e0ee01f5a4b53ace9316", "measured_slow_code": "def fi(i, x):\n a, b = lines[i]\n return a * x + b\n\n\ndef find(x):\n def f(i):\n return fi(i + 1, x) > fi(i, x)\n\n mn, mx = -1, len(lines) - 1\n idx = (mn + mx) // 2\n while mx - mn > 1:\n if f(idx):\n mx, idx = idx, (mn + idx) // 2\n continue\n mn, idx = idx, (mx + idx) // 2\n return fi(idx + 1, x)\n\n\ndef insert(a, b):\n (e, f) = lines[-1]\n while len(lines) - 1:\n (c, d), (e, f) = (e, f), lines[-2]\n if (c - e) * (b - d) < (d - f) * (a - c):\n break\n lines.pop()\n lines.append((a, b))\n\n\nN, C = list(map(int, input().split()))\nhs = list(map(int, input().split()))\nlines = [(-2 * hs[0], hs[0] ** 2)]\nfor h in hs[1:]:\n r = find(h) + h**2 + C\n insert(-2 * h, r + h**2)\nprint(r)\n", "measured_slow_code_sha256": "3cfce86d654bd06d40adb96ffc83f2ac55718a181a816c4771301b82f47e3cae", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.5822296925529051, "pair_id": "python_v2_f153e4917aa0bb2fab8e62b2", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03185", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03185_7dfca9eb6adfb71b30ea843e795c6c0957ea1ed8fbd2e0ee01f5a4b53ace9316.jsonl.gz", "inputs": "reproduction/python/inputs/p03185.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03185_3cfce86d654bd06d40adb96ffc83f2ac55718a181a816c4771301b82f47e3cae.jsonl.gz"}, "slow_code": "def fi(i, x):\n a, b = lines[i]\n return a * x + b\n\n\ndef find(x):\n def f(i):\n return fi(i + 1, x) > fi(i, x)\n\n mn, mx = -1, len(lines) - 1\n idx = (mn + mx) // 2\n while mx - mn > 1:\n if f(idx):\n mx, idx = idx, (mn + idx) // 2\n continue\n mn, idx = idx, (mx + idx) // 2\n return fi(idx + 1, x)\n\n\ndef insert(a, b):\n (e, f) = lines[-1]\n while len(lines) - 1:\n (c, d), (e, f) = (e, f), lines[-2]\n if (c - e) * (b - d) < (d - f) * (a - c):\n break\n lines.pop()\n lines.append((a, b))\n\n\nN, C = list(map(int, input().split()))\nhs = list(map(int, input().split()))\nlines = [(-2 * hs[0], hs[0] ** 2)]\nfor h in hs[1:]:\n r = find(h) + h**2 + C\n insert(-2 * h, r + h**2)\nprint(r)\n", "slow_code_sha256": "3cfce86d654bd06d40adb96ffc83f2ac55718a181a816c4771301b82f47e3cae", "slow_id": "p03185_3cfce86d654bd06d40adb96ffc83f2ac55718a181a816c4771301b82f47e3cae", "speedup": 2.0991978584437883, "stratum": "2-4", "within_pair_jaccard": 0.6444444444444445, "workload": {"case_count": 100, "description": "A frog starts at stone 1 and may jump to any later stone. A jump i to j costs (h_j-h_i)^2+C. Heights h_i are strictly increasing; minimize total cost to reach stone N. Observed inputs: N=2..200000 (median 10000); C=1..1000000000000; h_i=1..1000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1400022, "median": 70021.0, "min": 8}, "input_format": ["N C\nh_1 ... h_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200002, "median": 10002.0, "min": 4}}} -{"case_ids": ["p02930_case_000", "p02930_case_001", "p02930_case_002", "p02930_case_003", "p02930_case_004", "p02930_case_005", "p02930_case_006", "p02930_case_007", "p02930_case_008", "p02930_case_009", "p02930_case_010", "p02930_case_011", "p02930_case_012", "p02930_case_013", "p02930_case_014", "p02930_case_015", "p02930_case_016", "p02930_case_017", "p02930_case_018", "p02930_case_019", "p02930_case_020", "p02930_case_021", "p02930_case_022", "p02930_case_023", "p02930_case_024", "p02930_case_025", "p02930_case_026", "p02930_case_027", "p02930_case_028", "p02930_case_029", "p02930_case_030", "p02930_case_031", "p02930_case_032", "p02930_case_033", "p02930_case_034", "p02930_case_035", "p02930_case_036", "p02930_case_037", "p02930_case_038", "p02930_case_039", "p02930_case_040", "p02930_case_041", "p02930_case_042", "p02930_case_043", "p02930_case_044", "p02930_case_045", "p02930_case_046", "p02930_case_047", "p02930_case_048", "p02930_case_049", "p02930_case_050", "p02930_case_051", "p02930_case_052", "p02930_case_053", "p02930_case_054", "p02930_case_055", "p02930_case_056", "p02930_case_057", "p02930_case_058", "p02930_case_059", "p02930_case_060", "p02930_case_061", "p02930_case_062", "p02930_case_063", "p02930_case_064", "p02930_case_065", "p02930_case_066", "p02930_case_067", "p02930_case_068", "p02930_case_069", "p02930_case_070", "p02930_case_071", "p02930_case_072", "p02930_case_073", "p02930_case_074", "p02930_case_075", "p02930_case_076", "p02930_case_077", "p02930_case_078", "p02930_case_079", "p02930_case_080", "p02930_case_081", "p02930_case_082", "p02930_case_083", "p02930_case_084", "p02930_case_085", "p02930_case_086", "p02930_case_087", "p02930_case_088", "p02930_case_089", "p02930_case_090", "p02930_case_091", "p02930_case_092", "p02930_case_093", "p02930_case_094", "p02930_case_095", "p02930_case_096", "p02930_case_097", "p02930_case_098", "p02930_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = eval(input())\nwhile n:\n n -= 1\n for j in range(n):\n print(bin(j + 1)[::-1].find(\"1\") + 1)\n", "fast_code_sha256": "ad30eeb2746fdc30b636e578b2a7d004d2de4c68ec0258c9cc201952f4f751bb", "fast_id": "p02930_ad30eeb2746fdc30b636e578b2a7d004d2de4c68ec0258c9cc201952f4f751bb", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = eval(input())\nwhile n:\n n -= 1\n for j in range(n):\n print(bin(j + 1)[::-1].find(\"1\") + 1)\n", "measured_fast_code_sha256": "ad30eeb2746fdc30b636e578b2a7d004d2de4c68ec0258c9cc201952f4f751bb", "measured_slow_code": "N, j = int(eval(input())), 0\nexec(\"print(*[9-format(i+1,'09b').rfind('1')for i in range(N)][:N-j-1]);j+=1;\" * N)\n", "measured_slow_code_sha256": "e92d2c5b381e0dc13fec91e29d5b05e3c0b38db0ebb8a73555cd4f93676c88e6", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.0307870979440423, "pair_id": "python_v2_961f7a596d84f35dda6f85dc", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02930", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02930_ad30eeb2746fdc30b636e578b2a7d004d2de4c68ec0258c9cc201952f4f751bb.jsonl.gz", "inputs": "reproduction/python/inputs/p02930.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02930_e92d2c5b381e0dc13fec91e29d5b05e3c0b38db0ebb8a73555cd4f93676c88e6.jsonl.gz"}, "slow_code": "N, j = int(eval(input())), 0\nexec(\"print(*[9-format(i+1,'09b').rfind('1')for i in range(N)][:N-j-1]);j+=1;\" * N)\n", "slow_code_sha256": "e92d2c5b381e0dc13fec91e29d5b05e3c0b38db0ebb8a73555cd4f93676c88e6", "slow_id": "p02930_e92d2c5b381e0dc13fec91e29d5b05e3c0b38db0ebb8a73555cd4f93676c88e6", "speedup": 2.2848215143217185, "stratum": "2-4", "within_pair_jaccard": 0.38095238095238093, "workload": {"case_count": 100, "description": "Assign positive integer levels to edges of an implicit complete graph on N vertices. Every closed walk using only one level must have even length. Output a valid assignment minimizing the highest level. Observed inputs: N=2..500 (median 191); implicit_edges=1..124750.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 4, "median": 4.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p03606_case_000", "p03606_case_001", "p03606_case_002", "p03606_case_003", "p03606_case_004", "p03606_case_005", "p03606_case_006", "p03606_case_007", "p03606_case_008", "p03606_case_009", "p03606_case_010", "p03606_case_011", "p03606_case_012", "p03606_case_013", "p03606_case_014", "p03606_case_015", "p03606_case_016", "p03606_case_017", "p03606_case_018", "p03606_case_019", "p03606_case_020", "p03606_case_021", "p03606_case_022", "p03606_case_023", "p03606_case_024", "p03606_case_025", "p03606_case_026", "p03606_case_027", "p03606_case_028", "p03606_case_029", "p03606_case_030", "p03606_case_031", "p03606_case_032", "p03606_case_033", "p03606_case_034", "p03606_case_035", "p03606_case_036", "p03606_case_037", "p03606_case_038", "p03606_case_039", "p03606_case_040", "p03606_case_041", "p03606_case_042", "p03606_case_043", "p03606_case_044", "p03606_case_045", "p03606_case_046", "p03606_case_047", "p03606_case_048", "p03606_case_049", "p03606_case_050", "p03606_case_051", "p03606_case_052", "p03606_case_053", "p03606_case_054", "p03606_case_055", "p03606_case_056", "p03606_case_057", "p03606_case_058", "p03606_case_059", "p03606_case_060", "p03606_case_061", "p03606_case_062", "p03606_case_063", "p03606_case_064", "p03606_case_065", "p03606_case_066", "p03606_case_067", "p03606_case_068", "p03606_case_069", "p03606_case_070", "p03606_case_071", "p03606_case_072", "p03606_case_073", "p03606_case_074", "p03606_case_075", "p03606_case_076", "p03606_case_077", "p03606_case_078", "p03606_case_079", "p03606_case_080", "p03606_case_081", "p03606_case_082", "p03606_case_083", "p03606_case_084", "p03606_case_085", "p03606_case_086", "p03606_case_087", "p03606_case_088", "p03606_case_089", "p03606_case_090", "p03606_case_091", "p03606_case_092", "p03606_case_093", "p03606_case_094", "p03606_case_095", "p03606_case_096", "p03606_case_097", "p03606_case_098", "p03606_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\ninput = sys.stdin.readline\n\n\ndef I():\n return int(eval(input()))\n\n\ndef MI():\n return list(map(int, input().split()))\n\n\ndef LI():\n return list(map(int, input().split()))\n\n\ndef main():\n mod = 10**9 + 7\n N = I()\n ans = 0\n for i in range(N):\n l, r = MI()\n ans += (r - l) + 1\n print(ans)\n\n\nmain()\n", "fast_code_sha256": "4b0d182b7cdfed7d72f1e0aee293a0f06b1e8254b3d88651dfc93fbf3a90eb35", "fast_id": "p03606_4b0d182b7cdfed7d72f1e0aee293a0f06b1e8254b3d88651dfc93fbf3a90eb35", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\ninput = sys.stdin.readline\n\n\ndef I():\n return int(eval(input()))\n\n\ndef MI():\n return list(map(int, input().split()))\n\n\ndef LI():\n return list(map(int, input().split()))\n\n\ndef main():\n mod = 10**9 + 7\n N = I()\n ans = 0\n for i in range(N):\n l, r = MI()\n ans += (r - l) + 1\n print(ans)\n\n\nmain()\n", "measured_fast_code_sha256": "4b0d182b7cdfed7d72f1e0aee293a0f06b1e8254b3d88651dfc93fbf3a90eb35", "measured_slow_code": "import collections\n\nn = int(eval(input()))\nl = [list(map(int, input().split())) for _ in range(n)]\nd = {}\nfor i in range(len(l)):\n for j in range(l[i][0], l[i][1] + 1):\n d[j] = 1\nprint((len(d)))\n", "measured_slow_code_sha256": "91ed37766e83e1c57b3ed54e34dd70e87dd0159574758547062baadff81ba4dd", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.9306827396020125, "pair_id": "python_v2_64fe0c2d0da5d5c924deea1d", "per_case_slow_code_faster_fraction": 0.24, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03606", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03606_4b0d182b7cdfed7d72f1e0aee293a0f06b1e8254b3d88651dfc93fbf3a90eb35.jsonl.gz", "inputs": "reproduction/python/inputs/p03606.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03606_91ed37766e83e1c57b3ed54e34dd70e87dd0159574758547062baadff81ba4dd.jsonl.gz"}, "slow_code": "import collections\n\nn = int(eval(input()))\nl = [list(map(int, input().split())) for _ in range(n)]\nd = {}\nfor i in range(len(l)):\n for j in range(l[i][0], l[i][1] + 1):\n d[j] = 1\nprint((len(d)))\n", "slow_code_sha256": "91ed37766e83e1c57b3ed54e34dd70e87dd0159574758547062baadff81ba4dd", "slow_id": "p03606_91ed37766e83e1c57b3ed54e34dd70e87dd0159574758547062baadff81ba4dd", "speedup": 7.3047542137394, "stratum": "4-8", "within_pair_jaccard": 0.40540540540540543, "workload": {"case_count": 100, "description": "N groups occupy disjoint inclusive seat intervals [l_i,r_i] in a theater with seats 1..100000. Count the total seated people. Intervals need not be listed in order. Observed inputs: N=1..1000 (median 2); l_i=1..99992; r_i=5..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 11813, "median": 26.0, "min": 11}, "input_format": ["N\nl_1 r_1\n...\nl_N r_N"], "input_format_status": "source_input_section", "input_lines": {"max": 1001, "median": 3.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2001, "median": 5.0, "min": 3}}} -{"case_ids": ["p03294_case_000", "p03294_case_001", "p03294_case_002", "p03294_case_003", "p03294_case_004", "p03294_case_005", "p03294_case_006", "p03294_case_007", "p03294_case_008", "p03294_case_009", "p03294_case_010", "p03294_case_011", "p03294_case_012", "p03294_case_013", "p03294_case_014", "p03294_case_015", "p03294_case_016", "p03294_case_017", "p03294_case_018", "p03294_case_019", "p03294_case_020", "p03294_case_021", "p03294_case_022", "p03294_case_023", "p03294_case_024", "p03294_case_025", "p03294_case_026", "p03294_case_027", "p03294_case_028", "p03294_case_029", "p03294_case_030", "p03294_case_031", "p03294_case_032", "p03294_case_033", "p03294_case_034", "p03294_case_035", "p03294_case_036", "p03294_case_037", "p03294_case_038", "p03294_case_039", "p03294_case_040", "p03294_case_041", "p03294_case_042", "p03294_case_043", "p03294_case_044", "p03294_case_045", "p03294_case_046", "p03294_case_047", "p03294_case_048", "p03294_case_049", "p03294_case_050", "p03294_case_051", "p03294_case_052", "p03294_case_053", "p03294_case_054", "p03294_case_055", "p03294_case_056", "p03294_case_057", "p03294_case_058", "p03294_case_059", "p03294_case_060", "p03294_case_061", "p03294_case_062", "p03294_case_063", "p03294_case_064", "p03294_case_065", "p03294_case_066", "p03294_case_067", "p03294_case_068", "p03294_case_069", "p03294_case_070", "p03294_case_071", "p03294_case_072", "p03294_case_073", "p03294_case_074", "p03294_case_075", "p03294_case_076", "p03294_case_077", "p03294_case_078", "p03294_case_079", "p03294_case_080", "p03294_case_081", "p03294_case_082", "p03294_case_083", "p03294_case_084", "p03294_case_085", "p03294_case_086", "p03294_case_087", "p03294_case_088", "p03294_case_089", "p03294_case_090", "p03294_case_091", "p03294_case_092", "p03294_case_093", "p03294_case_094", "p03294_case_095", "p03294_case_096", "p03294_case_097", "p03294_case_098", "p03294_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = eval(input())\nA = list(map(int, input().split()))\nfor i in range(int(n)):\n A[i] -= 1\nprint((sum(A)))\n", "fast_code_sha256": "b2edb05d7c541afb6555136a699e7845cc68581fc25684f4f895e08611d62486", "fast_id": "p03294_b2edb05d7c541afb6555136a699e7845cc68581fc25684f4f895e08611d62486", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = eval(input())\nA = list(map(int, input().split()))\nfor i in range(int(n)):\n A[i] -= 1\nprint((sum(A)))\n", "measured_fast_code_sha256": "b2edb05d7c541afb6555136a699e7845cc68581fc25684f4f895e08611d62486", "measured_slow_code": "from functools import reduce\n\nn = (int)(eval(input()))\na = (list)(list(map(int, input().split())))\n\n\ndef calcMod(a, m):\n return sum([m % v for v in a])\n\n\ndef mul(a, b):\n return a * b\n\n\nprint((calcMod(a, reduce(mul, a) - 1)))\n", "measured_slow_code_sha256": "f83e22904e6c5822a77418d395b643df90f45b5996bfb7366667792519f35be8", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 10.856502596170717, "pair_id": "python_v2_18c4d36eb732b1c02f560b58", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03294", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03294_b2edb05d7c541afb6555136a699e7845cc68581fc25684f4f895e08611d62486.jsonl.gz", "inputs": "reproduction/python/inputs/p03294.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03294_f83e22904e6c5822a77418d395b643df90f45b5996bfb7366667792519f35be8.jsonl.gz"}, "slow_code": "from functools import reduce\n\nn = (int)(eval(input()))\na = (list)(list(map(int, input().split())))\n\n\ndef calcMod(a, m):\n return sum([m % v for v in a])\n\n\ndef mul(a, b):\n return a * b\n\n\nprint((calcMod(a, reduce(mul, a) - 1)))\n", "slow_code_sha256": "f83e22904e6c5822a77418d395b643df90f45b5996bfb7366667792519f35be8", "slow_id": "p03294_f83e22904e6c5822a77418d395b643df90f45b5996bfb7366667792519f35be8", "speedup": 7.389058026025614, "stratum": "4-8", "within_pair_jaccard": 0.4444444444444444, "workload": {"case_count": 100, "description": "For N positive integers a_i, maximize sum_i (m mod a_i) over all nonnegative integers m. Observed inputs: N=2..3000 (median 3000); a_i=2..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 21005, "median": 13229.0, "min": 6}, "input_format": ["N\na_1 ... a_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3001, "median": 3001.0, "min": 3}}} -{"case_ids": ["p03472_case_000", "p03472_case_001", "p03472_case_002", "p03472_case_003", "p03472_case_004", "p03472_case_005", "p03472_case_006", "p03472_case_007", "p03472_case_008", "p03472_case_009", "p03472_case_010", "p03472_case_011", "p03472_case_012", "p03472_case_013", "p03472_case_014", "p03472_case_015", "p03472_case_016", "p03472_case_017", "p03472_case_018", "p03472_case_019", "p03472_case_020", "p03472_case_021", "p03472_case_022", "p03472_case_023", "p03472_case_024", "p03472_case_025", "p03472_case_026", "p03472_case_027", "p03472_case_028", "p03472_case_029", "p03472_case_030", "p03472_case_031", "p03472_case_032", "p03472_case_033", "p03472_case_034", "p03472_case_035", "p03472_case_036", "p03472_case_037", "p03472_case_038", "p03472_case_039", "p03472_case_040", "p03472_case_041", "p03472_case_042", "p03472_case_043", "p03472_case_044", "p03472_case_045", "p03472_case_046", "p03472_case_047", "p03472_case_048", "p03472_case_049", "p03472_case_050", "p03472_case_051", "p03472_case_052", "p03472_case_053", "p03472_case_054", "p03472_case_055", "p03472_case_056", "p03472_case_057", "p03472_case_058", "p03472_case_059", "p03472_case_060", "p03472_case_061", "p03472_case_062", "p03472_case_063", "p03472_case_064", "p03472_case_065", "p03472_case_066", "p03472_case_068", "p03472_case_069", "p03472_case_070", "p03472_case_071", "p03472_case_072", "p03472_case_073", "p03472_case_075", "p03472_case_076", "p03472_case_077", "p03472_case_078", "p03472_case_079", "p03472_case_080", "p03472_case_081", "p03472_case_082", "p03472_case_083", "p03472_case_084", "p03472_case_085", "p03472_case_086", "p03472_case_087", "p03472_case_088", "p03472_case_089", "p03472_case_090", "p03472_case_091", "p03472_case_092", "p03472_case_093", "p03472_case_094", "p03472_case_095", "p03472_case_096", "p03472_case_097", "p03472_case_098", "p03472_case_099", "p03472_v2_152723b81f3e452934a4", "p03472_v2_8069c44687919d0f2aed"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n, h, *k = list(map(int, open(0).read().split()))\na = 0\nb = []\nfor i, j in zip(*[iter(k)] * 2):\n a = max(a, i)\n b.append(j)\nb = sorted(b, reverse=True)\nans = 0\nwhile ans < n and b[ans] > a and h > 0:\n h -= b[ans]\n ans += 1\nif h > 0:\n ans += (h + a - 1) // a\nprint(ans)\n", "fast_code_sha256": "9bdb75de5f6bd2e0327efa1c546680f12b414176c5a7d9bd21e16693d22fdfc0", "fast_id": "p03472_9bdb75de5f6bd2e0327efa1c546680f12b414176c5a7d9bd21e16693d22fdfc0", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n, h, *k = list(map(int, open(0).read().split()))\na = 0\nb = []\nfor i, j in zip(*[iter(k)] * 2):\n a = max(a, i)\n b.append(j)\nb = sorted(b, reverse=True)\nans = 0\nwhile ans < n and b[ans] > a and h > 0:\n h -= b[ans]\n ans += 1\nif h > 0:\n ans += (h + a - 1) // a\nprint(ans)\n", "measured_fast_code_sha256": "9bdb75de5f6bd2e0327efa1c546680f12b414176c5a7d9bd21e16693d22fdfc0", "measured_slow_code": "import sys\nfrom collections import defaultdict, Counter\nfrom itertools import product, groupby, count, permutations, combinations\nfrom math import pi, sqrt, floor\nfrom collections import deque\nfrom bisect import bisect, bisect_left, bisect_right\nfrom string import ascii_lowercase\nfrom functools import lru_cache, reduce\nfrom operator import xor\nfrom heapq import heappush, heappop\n\nINF = float(\"inf\")\nsys.setrecursionlimit(10**7)\n# 4近傍(右, 下, 左, 上)\ndy4, dx4 = [0, -1, 0, 1], [1, 0, -1, 0]\n\n\ndef inside(y: int, x: int, H: int, W: int) -> bool:\n return 0 <= y < H and 0 <= x < W\n\n\ndef ceil(a, b):\n return (a + b - 1) // b\n\n\ndef solve(N, H, a_b):\n max_a = -1\n for a, b in a_b:\n max_a = max(max_a, a)\n good_b = []\n for a, b in a_b:\n if b >= max_a:\n good_b.append(b)\n ans = 0\n for b in sorted(good_b, reverse=True):\n ans += 1\n H -= b\n if H <= 0:\n return ans\n return ans + ceil(H, max_a)\n\n\ndef main():\n N, H = list(map(int, input().split()))\n l = []\n for _ in range(N):\n a, b = list(map(int, input().split()))\n l.append((a, b))\n print((solve(N, H, l)))\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "e6fb53d428c218a9dad43f71415fff4137faea0247973c73ffa368e3f80a96bc", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.711179318239095, "pair_id": "python_v2_9d7314fe0f6035b979bf23d2", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03472", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03472_9bdb75de5f6bd2e0327efa1c546680f12b414176c5a7d9bd21e16693d22fdfc0.jsonl.gz", "inputs": "reproduction/python/inputs/p03472.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03472_e6fb53d428c218a9dad43f71415fff4137faea0247973c73ffa368e3f80a96bc.jsonl.gz"}, "slow_code": "import sys\nfrom collections import defaultdict, Counter\nfrom itertools import product, groupby, count, permutations, combinations\nfrom math import pi, sqrt, floor\nfrom collections import deque\nfrom bisect import bisect, bisect_left, bisect_right\nfrom string import ascii_lowercase\nfrom functools import lru_cache, reduce\nfrom operator import xor\nfrom heapq import heappush, heappop\n\nINF = float(\"inf\")\nsys.setrecursionlimit(10**7)\n\ndy4, dx4 = [0, -1, 0, 1], [1, 0, -1, 0]\n\n\ndef inside(y: int, x: int, H: int, W: int) -> bool:\n return 0 <= y < H and 0 <= x < W\n\n\ndef ceil(a, b):\n return (a + b - 1) // b\n\n\ndef solve(N, H, a_b):\n max_a = -1\n for a, b in a_b:\n max_a = max(max_a, a)\n good_b = []\n for a, b in a_b:\n if b >= max_a:\n good_b.append(b)\n ans = 0\n for b in sorted(good_b, reverse=True):\n ans += 1\n H -= b\n if H <= 0:\n return ans\n return ans + ceil(H, max_a)\n\n\ndef main():\n N, H = list(map(int, input().split()))\n l = []\n for _ in range(N):\n a, b = list(map(int, input().split()))\n l.append((a, b))\n print((solve(N, H, l)))\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "959a20db4ae0f00d8957b9a1432326d6e5fea394771c477e31dea94e932699eb", "slow_id": "p03472_e6fb53d428c218a9dad43f71415fff4137faea0247973c73ffa368e3f80a96bc", "speedup": 3.522393689015172, "stratum": "2-4", "within_pair_jaccard": 0.21348314606741572, "workload": {"case_count": 100, "description": "Defeat health H using N swords. Wield sword i repeatedly for a_i damage, or throw it once for b_i damage and lose it permanently. Each attack counts once; a_i<=b_i. Minimize attacks to deal at least H total damage. Observed inputs: N=1..100000 (median 1000); H=1..1000000000 (median 500000000); a_i=1..1000000000; b_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 2200018, "median": 19446.5, "min": 8}, "input_format": ["N H\na_1 b_1\n...\na_N b_N"], "input_format_status": "source_input_section", "input_lines": {"max": 100001, "median": 1001.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200002, "median": 2002.0, "min": 4}}} -{"case_ids": ["p03329_case_000", "p03329_case_001", "p03329_case_002", "p03329_case_003", "p03329_case_004", "p03329_case_005", "p03329_case_006", "p03329_case_007", "p03329_case_008", "p03329_case_009", "p03329_case_010", "p03329_case_011", "p03329_case_012", "p03329_case_013", "p03329_case_014", "p03329_case_015", "p03329_case_016", "p03329_case_017", "p03329_case_018", "p03329_case_019", "p03329_case_020", "p03329_case_021", "p03329_case_022", "p03329_case_023", "p03329_case_024", "p03329_case_025", "p03329_case_026", "p03329_case_027", "p03329_case_028", "p03329_case_029", "p03329_case_030", "p03329_case_031", "p03329_case_032", "p03329_case_033", "p03329_case_034", "p03329_case_035", "p03329_case_036", "p03329_case_037", "p03329_case_038", "p03329_case_039", "p03329_case_040", "p03329_case_041", "p03329_case_042", "p03329_case_043", "p03329_case_044", "p03329_case_045", "p03329_case_046", "p03329_case_047", "p03329_case_048", "p03329_case_049", "p03329_case_050", "p03329_case_051", "p03329_case_052", "p03329_case_053", "p03329_case_054", "p03329_case_055", "p03329_case_056", "p03329_case_057", "p03329_case_058", "p03329_case_059", "p03329_case_060", "p03329_case_061", "p03329_case_062", "p03329_case_063", "p03329_case_064", "p03329_case_065", "p03329_case_066", "p03329_case_067", "p03329_case_068", "p03329_case_069", "p03329_case_070", "p03329_case_071", "p03329_case_072", "p03329_case_073", "p03329_case_074", "p03329_case_075", "p03329_case_076", "p03329_case_077", "p03329_case_078", "p03329_case_079", "p03329_case_080", "p03329_case_081", "p03329_case_082", "p03329_case_083", "p03329_case_084", "p03329_case_085", "p03329_case_086", "p03329_case_087", "p03329_case_088", "p03329_case_089", "p03329_case_090", "p03329_case_091", "p03329_case_092", "p03329_case_093", "p03329_case_094", "p03329_case_095", "p03329_case_096", "p03329_case_097", "p03329_case_098", "p03329_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N = int(eval(input()))\nsixs = [6**i for i in range(1, 7)]\nnines = [9**i for i in range(1, 6)]\ntmp = {}\n\n\ndef dfs(n):\n if n < 6:\n return n\n if n in tmp:\n return tmp[n]\n m = 10**9 + 7\n if n >= 9:\n max_nine = max(nine for nine in nines if nine <= n)\n if n % max_nine == 0:\n m = min(m, n // max_nine)\n else:\n m = min(m, dfs(n - max_nine) + 1)\n max_six = max(six for six in sixs if six <= n)\n if n % max_six == 0:\n m = min(m, n // max_six)\n tmp[n] = min(m, dfs(n - max_six) + 1)\n return tmp[n]\n\n\nprint((dfs(N)))\n", "fast_code_sha256": "8a16d58ba1b2f27049215d9a438bbca28f84c608e831115d5306f1aa2c301a6d", "fast_id": "p03329_8a16d58ba1b2f27049215d9a438bbca28f84c608e831115d5306f1aa2c301a6d", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N = int(eval(input()))\nsixs = [6**i for i in range(1, 7)]\nnines = [9**i for i in range(1, 6)]\ntmp = {}\n\n\ndef dfs(n):\n if n < 6:\n return n\n if n in tmp:\n return tmp[n]\n m = 10**9 + 7\n if n >= 9:\n max_nine = max(nine for nine in nines if nine <= n)\n if n % max_nine == 0:\n m = min(m, n // max_nine)\n else:\n m = min(m, dfs(n - max_nine) + 1)\n max_six = max(six for six in sixs if six <= n)\n if n % max_six == 0:\n m = min(m, n // max_six)\n tmp[n] = min(m, dfs(n - max_six) + 1)\n return tmp[n]\n\n\nprint((dfs(N)))\n", "measured_fast_code_sha256": "8a16d58ba1b2f27049215d9a438bbca28f84c608e831115d5306f1aa2c301a6d", "measured_slow_code": "n = int(eval(input()))\nk9 = 5\nk6 = 6\nn9 = 9**k9\nsmin = n\nfor i9 in range(n9):\n ii9 = i9\n s = 0\n m = 0\n astr = \"\"\n for ii in range(1, k9 + 2):\n r9 = ii9 % 9\n ii9 = (ii9 - r9) // 9\n s = s * 9 + r9\n m = m + r9\n astr = astr + str(r9)\n # print(\"i9\",i9,\"astr\",astr,\"s\",s,\"m\",m)\n nr = n - s\n nr1 = nr\n # print(\"nr\",nr,\"m\",m)\n if nr == 0:\n snra = m\n # print(nr,m)\n elif nr > 0:\n snra = m\n for jj in range(k6, -1, -1):\n nra = nr1 // (6**jj)\n nr1 = nr1 % (6**jj)\n snra = snra + nra\n # print(\"jj\",jj,\"nra\",nra,\"nr1\",nr1)\n if smin > snra:\n smin = snra\nprint(smin)\n", "measured_slow_code_sha256": "112cb14713b16c849463df028f1f5a909490a9b48748b2aa56af52590c63bf80", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1272.6889328002878, "pair_id": "python_v2_44d1175d3a4ec9aac5f9fbb5", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03329", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03329_8a16d58ba1b2f27049215d9a438bbca28f84c608e831115d5306f1aa2c301a6d.jsonl.gz", "inputs": "reproduction/python/inputs/p03329.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03329_112cb14713b16c849463df028f1f5a909490a9b48748b2aa56af52590c63bf80.jsonl.gz"}, "slow_code": "n = int(eval(input()))\nk9 = 5\nk6 = 6\nn9 = 9**k9\nsmin = n\nfor i9 in range(n9):\n ii9 = i9\n s = 0\n m = 0\n astr = \"\"\n for ii in range(1, k9 + 2):\n r9 = ii9 % 9\n ii9 = (ii9 - r9) // 9\n s = s * 9 + r9\n m = m + r9\n astr = astr + str(r9)\n\n nr = n - s\n nr1 = nr\n\n if nr == 0:\n snra = m\n\n elif nr > 0:\n snra = m\n for jj in range(k6, -1, -1):\n nra = nr1 // (6**jj)\n nr1 = nr1 % (6**jj)\n snra = snra + nra\n\n if smin > snra:\n smin = snra\nprint(smin)\n", "slow_code_sha256": "fb090435a661e9225aa98f3353af462d8f138d073c0f311ebd2db4e36ee5e685", "slow_id": "p03329_112cb14713b16c849463df028f1f5a909490a9b48748b2aa56af52590c63bf80", "speedup": 1230.1597222584564, "stratum": "8+", "within_pair_jaccard": 0.28, "workload": {"case_count": 100, "description": "Withdraw exactly N units with minimum operations. Each operation withdraws 1, a positive integer power of 6, or a positive integer power of 9. Withdrawn money cannot be redeposited. Observed inputs: N=1..100000 (median 5282.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 7, "median": 5.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p02657_case_000", "p02657_case_001", "p02657_case_002", "p02657_case_003", "p02657_case_004", "p02657_case_005", "p02657_case_006", "p02657_case_007", "p02657_case_008", "p02657_case_009", "p02657_case_010", "p02657_case_011", "p02657_case_012", "p02657_case_013", "p02657_case_014", "p02657_case_015", "p02657_case_016", "p02657_case_017", "p02657_case_018", "p02657_case_019", "p02657_case_020", "p02657_case_021", "p02657_case_022", "p02657_case_023", "p02657_case_024", "p02657_case_025", "p02657_case_026", "p02657_case_027", "p02657_case_028", "p02657_case_029", "p02657_case_030", "p02657_case_031", "p02657_case_032", "p02657_case_033", "p02657_case_034", "p02657_case_035", "p02657_case_036", "p02657_case_037", "p02657_case_038", "p02657_case_039", "p02657_case_040", "p02657_case_041", "p02657_case_042", "p02657_case_043", "p02657_case_044", "p02657_case_045", "p02657_case_046", "p02657_case_047", "p02657_case_048", "p02657_case_049", "p02657_case_050", "p02657_case_051", "p02657_case_052", "p02657_case_053", "p02657_case_054", "p02657_case_055", "p02657_case_056", "p02657_case_057", "p02657_case_058", "p02657_case_059", "p02657_case_060", "p02657_case_061", "p02657_case_062", "p02657_case_063", "p02657_case_064", "p02657_case_065", "p02657_case_066", "p02657_case_067", "p02657_case_068", "p02657_case_069", "p02657_case_070", "p02657_case_071", "p02657_case_072", "p02657_case_073", "p02657_case_074", "p02657_case_075", "p02657_case_076", "p02657_case_077", "p02657_case_078", "p02657_case_079", "p02657_case_080", "p02657_case_081", "p02657_case_082", "p02657_case_083", "p02657_case_084", "p02657_case_085", "p02657_case_086", "p02657_case_087", "p02657_case_088", "p02657_case_089", "p02657_case_090", "p02657_case_091", "p02657_case_092", "p02657_case_093", "p02657_case_094", "p02657_case_095", "p02657_case_096", "p02657_case_097", "p02657_case_098", "p02657_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "a, b = input().split()\nprint((int(a) * int(b)))\n", "fast_code_sha256": "c307bd3922a7fd6a39ca6146bb6ae423a9fe44a679293cb509d5e948a8f810d5", "fast_id": "p02657_c307bd3922a7fd6a39ca6146bb6ae423a9fe44a679293cb509d5e948a8f810d5", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "a, b = input().split()\nprint((int(a) * int(b)))\n", "measured_fast_code_sha256": "c307bd3922a7fd6a39ca6146bb6ae423a9fe44a679293cb509d5e948a8f810d5", "measured_slow_code": "import math\n\na, b = [float(x) for x in input().split()]\na = int(a)\nb = int(b * 100)\nprint((int(math.floor(a * b) // 100)))\n", "measured_slow_code_sha256": "200b1c449f415dbd19883ab8d7d3fbd558bd29ecaa3e49199f40362ea5213e2b", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.0604585832256324, "pair_id": "python_v2_c85e461037ab4fa743af90e1", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02657", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02657_c307bd3922a7fd6a39ca6146bb6ae423a9fe44a679293cb509d5e948a8f810d5.jsonl.gz", "inputs": "reproduction/python/inputs/p02657.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02657_200b1c449f415dbd19883ab8d7d3fbd558bd29ecaa3e49199f40362ea5213e2b.jsonl.gz"}, "slow_code": "import math\n\na, b = [float(x) for x in input().split()]\na = int(a)\nb = int(b * 100)\nprint((int(math.floor(a * b) // 100)))\n", "slow_code_sha256": "200b1c449f415dbd19883ab8d7d3fbd558bd29ecaa3e49199f40362ea5213e2b", "slow_id": "p02657_200b1c449f415dbd19883ab8d7d3fbd558bd29ecaa3e49199f40362ea5213e2b", "speedup": 2.0591911666350127, "stratum": "2-4", "within_pair_jaccard": 0.42857142857142855, "workload": {"case_count": 100, "description": "Compute the product of the two integer inputs A and B. Observed inputs: A=1..100 (median 34); B=1..100 (median 47.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 8, "median": 6.0, "min": 4}, "input_format": ["A B"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p02554_case_000", "p02554_case_001", "p02554_case_002", "p02554_case_003", "p02554_case_004", "p02554_case_005", "p02554_case_006", "p02554_case_007", "p02554_case_008", "p02554_case_009", "p02554_case_010", "p02554_case_011", "p02554_case_012", "p02554_case_013", "p02554_case_014", "p02554_case_015", "p02554_case_016", "p02554_case_017", "p02554_case_018", "p02554_case_019", "p02554_case_020", "p02554_case_021", "p02554_case_022", "p02554_case_023", "p02554_case_024", "p02554_case_025", "p02554_case_026", "p02554_case_027", "p02554_case_028", "p02554_case_029", "p02554_case_030", "p02554_case_031", "p02554_case_032", "p02554_case_033", "p02554_case_034", "p02554_case_035", "p02554_case_036", "p02554_case_037", "p02554_case_038", "p02554_case_039", "p02554_case_040", "p02554_case_041", "p02554_case_042", "p02554_case_043", "p02554_case_044", "p02554_case_045", "p02554_case_046", "p02554_case_047", "p02554_case_048", "p02554_case_049", "p02554_case_050", "p02554_case_051", "p02554_case_052", "p02554_case_053", "p02554_case_054", "p02554_case_055", "p02554_case_056", "p02554_case_057", "p02554_case_058", "p02554_case_059", "p02554_case_060", "p02554_case_061", "p02554_case_062", "p02554_case_063", "p02554_case_064", "p02554_case_065", "p02554_case_066", "p02554_case_067", "p02554_case_068", "p02554_case_069", "p02554_case_070", "p02554_case_071", "p02554_case_072", "p02554_case_073", "p02554_case_074", "p02554_case_075", "p02554_case_076", "p02554_case_077", "p02554_case_078", "p02554_case_079", "p02554_case_080", "p02554_case_081", "p02554_case_082", "p02554_case_083", "p02554_case_084", "p02554_case_085", "p02554_case_086", "p02554_case_087", "p02554_case_088", "p02554_case_089", "p02554_case_090", "p02554_case_091", "p02554_case_092", "p02554_case_093", "p02554_case_094", "p02554_case_095", "p02554_case_096", "p02554_case_097", "p02554_case_098", "p02554_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "executable_AST_equal_except_explicit_explanatory_string_removal_and_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\nMOD = 10**9 + 7\nprint(((pow(10, n, MOD) - 2 * pow(9, n, MOD) + pow(8, n, MOD)) % MOD))\n", "fast_code_sha256": "7484a1afd7c42c01bc5516cf17d9c35f7921e04b8deb70c4078b4526037ef3f2", "fast_id": "p02554_7484a1afd7c42c01bc5516cf17d9c35f7921e04b8deb70c4078b4526037ef3f2", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\nMOD = 10**9 + 7\nprint(((pow(10, n, MOD) - 2 * pow(9, n, MOD) + pow(8, n, MOD)) % MOD))\n", "measured_fast_code_sha256": "7484a1afd7c42c01bc5516cf17d9c35f7921e04b8deb70c4078b4526037ef3f2", "measured_slow_code": "MOD = 10**9 + 7\n\n\ndef solve(n):\n \"\"\"\n 0: {}\n 1: {0}\n 2: {9}\n 3: {0,9}\n \"\"\"\n dp = [[0] * 4 for i in range(n + 1)]\n dp[0][0] = 1\n for i in range(n):\n dp[i + 1][3] = (10 * dp[i][3] + dp[i][2] + dp[i][1]) % MOD\n dp[i + 1][2] = (9 * dp[i][2] + dp[i][0]) % MOD\n dp[i + 1][1] = (9 * dp[i][1] + dp[i][0]) % MOD\n dp[i + 1][0] = (8 * dp[i][0]) % MOD\n return dp[n][3]\n\n\nn = int(eval(input()))\nprint((solve(n)))\n", "measured_slow_code_sha256": "1216aa013ca95268c8cea10ef1956fc82ecf53c33048dc021f31f4ae82487ba4", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 11042.75729494336, "pair_id": "python_v2_258ebfb0d5bf6a4f5d17c70a", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02554", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02554_7484a1afd7c42c01bc5516cf17d9c35f7921e04b8deb70c4078b4526037ef3f2.jsonl.gz", "inputs": "reproduction/python/inputs/p02554.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02554_1216aa013ca95268c8cea10ef1956fc82ecf53c33048dc021f31f4ae82487ba4.jsonl.gz"}, "slow_code": "MOD = 10**9 + 7\n\n\ndef solve(n):\n dp = [[0] * 4 for i in range(n + 1)]\n dp[0][0] = 1\n for i in range(n):\n dp[i + 1][3] = (10 * dp[i][3] + dp[i][2] + dp[i][1]) % MOD\n dp[i + 1][2] = (9 * dp[i][2] + dp[i][0]) % MOD\n dp[i + 1][1] = (9 * dp[i][1] + dp[i][0]) % MOD\n dp[i + 1][0] = (8 * dp[i][0]) % MOD\n return dp[n][3]\n\n\nn = int(eval(input()))\nprint((solve(n)))\n", "slow_code_sha256": "d34cbcef17a1809eb9aaea9acac748f4f348edb348ac1a61f3b30198ffe07352", "slow_id": "p02554_1216aa013ca95268c8cea10ef1956fc82ecf53c33048dc021f31f4ae82487ba4", "speedup": 2105.160424638251, "stratum": "8+", "within_pair_jaccard": 0.4583333333333333, "workload": {"case_count": 100, "description": "Count length-N sequences over digits 0..9 containing both 0 and 9, modulo 1000000007. Observed inputs: N=1..1000000 (median 299407).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 8, "median": 7.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p03030_case_000", "p03030_case_001", "p03030_case_002", "p03030_case_003", "p03030_case_004", "p03030_case_005", "p03030_case_006", "p03030_case_007", "p03030_case_008", "p03030_case_009", "p03030_case_010", "p03030_case_011", "p03030_case_012", "p03030_case_013", "p03030_case_014", "p03030_case_015", "p03030_case_016", "p03030_case_017", "p03030_case_018", "p03030_case_019", "p03030_case_020", "p03030_case_021", "p03030_case_022", "p03030_case_023", "p03030_case_024", "p03030_case_025", "p03030_case_026", "p03030_case_027", "p03030_case_028", "p03030_case_029", "p03030_case_030", "p03030_case_031", "p03030_case_032", "p03030_case_033", "p03030_case_034", "p03030_case_035", "p03030_case_036", "p03030_case_037", "p03030_case_038", "p03030_case_039", "p03030_case_040", "p03030_case_041", "p03030_case_042", "p03030_case_043", "p03030_case_044", "p03030_case_045", "p03030_case_046", "p03030_case_047", "p03030_case_048", "p03030_case_049", "p03030_case_050", "p03030_case_051", "p03030_case_052", "p03030_case_053", "p03030_case_054", "p03030_case_055", "p03030_case_056", "p03030_case_057", "p03030_case_058", "p03030_case_059", "p03030_case_060", "p03030_case_061", "p03030_case_062", "p03030_case_063", "p03030_case_064", "p03030_case_065", "p03030_case_066", "p03030_case_067", "p03030_case_068", "p03030_case_069", "p03030_case_070", "p03030_case_071", "p03030_case_072", "p03030_case_073", "p03030_case_074", "p03030_case_075", "p03030_case_076", "p03030_case_077", "p03030_case_078", "p03030_case_079", "p03030_case_080", "p03030_case_081", "p03030_case_082", "p03030_case_083", "p03030_case_084", "p03030_case_085", "p03030_case_086", "p03030_case_087", "p03030_case_088", "p03030_case_089", "p03030_case_090", "p03030_case_091", "p03030_case_092", "p03030_case_093", "p03030_case_094", "p03030_case_095", "p03030_case_096", "p03030_case_097", "p03030_case_098", "p03030_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\nsp = [[input().split(), i + 1] for i in range(n)]\nsp = sorted(sp, key=lambda x: (x[0][0], -int(x[0][1])))\nfor i in range(n):\n print((sp[i][1]))\n", "fast_code_sha256": "a608c3ac8df5a73167a92a04c86f2fdb15d45e00c54253d6e68a9ff5e33ea86b", "fast_id": "p03030_a608c3ac8df5a73167a92a04c86f2fdb15d45e00c54253d6e68a9ff5e33ea86b", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\nsp = [[input().split(), i + 1] for i in range(n)]\nsp = sorted(sp, key=lambda x: (x[0][0], -int(x[0][1])))\nfor i in range(n):\n print((sp[i][1]))\n", "measured_fast_code_sha256": "a608c3ac8df5a73167a92a04c86f2fdb15d45e00c54253d6e68a9ff5e33ea86b", "measured_slow_code": "# import numpy as np\n# import numpypy as np\nimport sys\n\ninput = sys.stdin.readline\n\n\ndef eprint(*args, **kwargs):\n print(*args, file=sys.stderr, **kwargs)\n\n\n# import math\n# import string\n# import fractions\n# from fractions import Fraction\n# from fractions import gcd\n# def lcm(n,m):\n# return int(n*m/gcd(n,m))\n# import re\n# # import array\n# import copy\n# import functools\n# import operator\n# import collections\n# import itertools\n# import bisect\n# import heapq\n# from heapq import heappush\n# from heapq import heappop\n# # from itertools import accumulate\n# # from collections import deque\n# import random\nfrom queue import PriorityQueue as pq\n\n# class ReversePriorityQueue(PriorityQueue):\n# def __cmp__(self, other):\n# return -cmp(self.degree, other.degree)\n# # def put(self, tup):\n# newtup = tup[0] * -1, tup[1]\n# PriorityQueue.put(self, newtup)\n# def get(self):\n# tup = PriorityQueue.get(self)\n# newtup = tup[0] * -1, tup[1]\n# return newtup\ndef main():\n n = int(eval(input()))\n dict = {}\n for i in range(1, n + 1):\n str_x, num = input().split()\n num = int(num)\n if str_x in dict:\n dict[str_x].put((-num, i))\n # dict[str_x].sort(key = lambda x : x[1])\n else:\n a = pq()\n dict[str_x] = a\n dict[str_x].put((-num, i))\n # a.put([num,i])\n eprint(dict)\n ll = sorted(list(dict.items()))\n eprint(ll)\n # for i in ll:\n # for j in i[1]:\n # print(j[1])\n for item in ll:\n while item[1].qsize():\n print((item[1].get())[1])\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "a25145b5dc837356f86d086b296689b8dc43e00da1e20428c8c9aa47d606904a", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4.767061563535878, "pair_id": "python_v2_17c0bb71b5253c71708efd08", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03030", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03030_a608c3ac8df5a73167a92a04c86f2fdb15d45e00c54253d6e68a9ff5e33ea86b.jsonl.gz", "inputs": "reproduction/python/inputs/p03030.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03030_a25145b5dc837356f86d086b296689b8dc43e00da1e20428c8c9aa47d606904a.jsonl.gz"}, "slow_code": "import sys\n\ninput = sys.stdin.readline\n\n\ndef eprint(*args, **kwargs):\n print(*args, file=sys.stderr, **kwargs)\n\n\nfrom queue import PriorityQueue as pq\n\n\ndef main():\n n = int(eval(input()))\n dict = {}\n for i in range(1, n + 1):\n str_x, num = input().split()\n num = int(num)\n if str_x in dict:\n dict[str_x].put((-num, i))\n\n else:\n a = pq()\n dict[str_x] = a\n dict[str_x].put((-num, i))\n\n eprint(dict)\n ll = sorted(list(dict.items()))\n eprint(ll)\n\n for item in ll:\n while item[1].qsize():\n print((item[1].get())[1])\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "1c8ba277370dec6948055508f046494819c5729144951826d127d44ed33b74ab", "slow_id": "p03030_a25145b5dc837356f86d086b296689b8dc43e00da1e20428c8c9aa47d606904a", "speedup": 5.3634038621395055, "stratum": "4-8", "within_pair_jaccard": 0.24489795918367346, "workload": {"case_count": 100, "description": "Sort restaurants by lowercase city name lexicographically, breaking equal-city ties by decreasing score P_i, and output their original 1-based IDs. All scores are distinct. Observed inputs: N=1..100 (median 50); name_length=1..10; P_i=0..100; distinct_cities=1..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1395, "median": 463.0, "min": 7}, "input_format": ["N\nS_1 P_1\n...\nS_N P_N"], "input_format_status": "source_input_section", "input_lines": {"max": 101, "median": 51.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 201, "median": 101.0, "min": 3}}} -{"case_ids": ["p03317_case_000", "p03317_case_001", "p03317_case_002", "p03317_case_003", "p03317_case_004", "p03317_case_005", "p03317_case_006", "p03317_case_007", "p03317_case_008", "p03317_case_009", "p03317_case_010", "p03317_case_011", "p03317_case_012", "p03317_case_013", "p03317_case_014", "p03317_case_015", "p03317_case_016", "p03317_case_017", "p03317_case_018", "p03317_case_019", "p03317_case_020", "p03317_case_021", "p03317_case_022", "p03317_case_023", "p03317_case_024", "p03317_case_025", "p03317_case_026", "p03317_case_027", "p03317_case_028", "p03317_case_029", "p03317_case_030", "p03317_case_031", "p03317_case_032", "p03317_case_033", "p03317_case_034", "p03317_case_035", "p03317_case_036", "p03317_case_037", "p03317_case_038", "p03317_case_039", "p03317_case_040", "p03317_case_041", "p03317_case_042", "p03317_case_043", "p03317_case_044", "p03317_case_045", "p03317_case_046", "p03317_case_047", "p03317_case_048", "p03317_case_049", "p03317_case_050", "p03317_case_051", "p03317_case_052", "p03317_case_053", "p03317_case_054", "p03317_case_055", "p03317_case_056", "p03317_case_057", "p03317_case_058", "p03317_case_059", "p03317_case_060", "p03317_case_061", "p03317_case_062", "p03317_case_063", "p03317_case_064", "p03317_case_065", "p03317_case_066", "p03317_case_067", "p03317_case_068", "p03317_case_069", "p03317_case_070", "p03317_case_071", "p03317_case_072", "p03317_case_073", "p03317_case_074", "p03317_case_075", "p03317_case_076", "p03317_case_077", "p03317_case_078", "p03317_case_079", "p03317_case_080", "p03317_case_081", "p03317_case_082", "p03317_case_083", "p03317_case_084", "p03317_case_085", "p03317_case_086", "p03317_case_087", "p03317_case_088", "p03317_case_089", "p03317_case_090", "p03317_case_091", "p03317_case_092", "p03317_case_093", "p03317_case_094", "p03317_case_095", "p03317_case_096", "p03317_case_097", "p03317_case_098", "p03317_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N, K = list(map(int, input().split()))\nli = list(map(int, input().split()))\nif N == K:\n print((1))\n quit()\ni = 1\nN = N - K\nwhile N >= K:\n N = N - K + 1\n i = i + 1\nprint((i + 1))\n", "fast_code_sha256": "db5756692a6264c580a095b1a2e599bcd5f8b9d5e0999cafe1063a7fedfe9f24", "fast_id": "p03317_817dd18fb076fe764c058863d46156fa9dd6dce07f33ab7029a2a1920fbb650e", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "# your code goes here\nN, K = list(map(int, input().split()))\nli = list(map(int, input().split()))\nif N == K:\n print((1))\n quit()\ni = 1\nN = N - K\nwhile N >= K:\n N = N - K + 1\n i = i + 1\nprint((i + 1))\n", "measured_fast_code_sha256": "817dd18fb076fe764c058863d46156fa9dd6dce07f33ab7029a2a1920fbb650e", "measured_slow_code": "import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time\n\nsys.setrecursionlimit(10**7)\ninf = 10**20\nmod = 10**9 + 7\n\n\ndef LI():\n return list(map(int, input().split()))\n\n\ndef I():\n return int(eval(input()))\n\n\ndef LS():\n return input().split()\n\n\ndef S():\n return eval(input())\n\n\ndef main():\n a, b = LI()\n l = LI()\n c = 1\n _b = b\n while True:\n if a <= _b:\n break\n else:\n _b += b - 1\n c += 1\n return c\n\n\nprint((main()))\n", "measured_slow_code_sha256": "40f790b9daefbd644d38ba942e539d6681ed03212cd68a297874ac055d84131a", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 25.44397325408834, "pair_id": "python_v2_83d8437142edbeacc494f575", "per_case_slow_code_faster_fraction": 0.06, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03317", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03317_817dd18fb076fe764c058863d46156fa9dd6dce07f33ab7029a2a1920fbb650e.jsonl.gz", "inputs": "reproduction/python/inputs/p03317.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03317_40f790b9daefbd644d38ba942e539d6681ed03212cd68a297874ac055d84131a.jsonl.gz"}, "slow_code": "import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time\n\nsys.setrecursionlimit(10**7)\ninf = 10**20\nmod = 10**9 + 7\n\n\ndef LI():\n return list(map(int, input().split()))\n\n\ndef I():\n return int(eval(input()))\n\n\ndef LS():\n return input().split()\n\n\ndef S():\n return eval(input())\n\n\ndef main():\n a, b = LI()\n l = LI()\n c = 1\n _b = b\n while True:\n if a <= _b:\n break\n else:\n _b += b - 1\n c += 1\n return c\n\n\nprint((main()))\n", "slow_code_sha256": "40f790b9daefbd644d38ba942e539d6681ed03212cd68a297874ac055d84131a", "slow_id": "p03317_40f790b9daefbd644d38ba942e539d6681ed03212cd68a297874ac055d84131a", "speedup": 6.9293742179228115, "stratum": "4-8", "within_pair_jaccard": 0.18, "workload": {"case_count": 100, "description": "Starting with a permutation of 1..N, repeatedly select K consecutive entries and replace all of them by their current minimum. Find the minimum operations needed to make every entry equal. Observed inputs: N=2..100000 (median 100); K=2..100000 (median 5); A_i=1..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 588909, "median": 299.0, "min": 8}, "input_format": ["N K\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100002, "median": 102.0, "min": 4}}} -{"case_ids": ["p03126_case_000", "p03126_case_001", "p03126_case_002", "p03126_case_003", "p03126_case_004", "p03126_case_005", "p03126_case_006", "p03126_case_007", "p03126_case_008", "p03126_case_009", "p03126_case_010", "p03126_case_011", "p03126_case_012", "p03126_case_013", "p03126_case_014", "p03126_case_015", "p03126_case_016", "p03126_case_017", "p03126_case_018", "p03126_case_019", "p03126_case_020", "p03126_case_021", "p03126_case_022", "p03126_case_023", "p03126_case_024", "p03126_case_025", "p03126_case_026", "p03126_case_027", "p03126_case_028", "p03126_case_029", "p03126_case_030", "p03126_case_031", "p03126_case_032", "p03126_case_033", "p03126_case_034", "p03126_case_035", "p03126_case_036", "p03126_case_037", "p03126_case_038", "p03126_case_039", "p03126_case_040", "p03126_case_041", "p03126_case_042", "p03126_case_043", "p03126_case_044", "p03126_case_045", "p03126_case_046", "p03126_case_047", "p03126_case_048", "p03126_case_049", "p03126_case_050", "p03126_case_051", "p03126_case_052", "p03126_case_053", "p03126_case_054", "p03126_case_055", "p03126_case_056", "p03126_case_057", "p03126_case_058", "p03126_case_059", "p03126_case_060", "p03126_case_061", "p03126_case_062", "p03126_case_063", "p03126_case_064", "p03126_case_065", "p03126_case_066", "p03126_case_067", "p03126_case_068", "p03126_case_069", "p03126_case_070", "p03126_case_071", "p03126_case_072", "p03126_case_073", "p03126_case_074", "p03126_case_075", "p03126_case_076", "p03126_case_077", "p03126_case_078", "p03126_case_079", "p03126_case_080", "p03126_case_081", "p03126_case_082", "p03126_case_083", "p03126_case_084", "p03126_case_085", "p03126_case_086", "p03126_case_087", "p03126_case_088", "p03126_case_089", "p03126_case_090", "p03126_case_091", "p03126_case_092", "p03126_case_093", "p03126_case_094", "p03126_case_095", "p03126_case_096", "p03126_case_097", "p03126_case_098", "p03126_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N, M = list(map(int, input().split()))\nfood = set(range(1, M + 1))\nfor i in range(N):\n A = list(map(int, input().split()[1:]))\n food &= set(A)\nprint((len(food)))\n", "fast_code_sha256": "eb59173593586205e197b93d6038318bf5f846c2e7abe8ca0ba85de5bc717a07", "fast_id": "p03126_eb59173593586205e197b93d6038318bf5f846c2e7abe8ca0ba85de5bc717a07", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N, M = list(map(int, input().split()))\nfood = set(range(1, M + 1))\nfor i in range(N):\n A = list(map(int, input().split()[1:]))\n food &= set(A)\nprint((len(food)))\n", "measured_fast_code_sha256": "eb59173593586205e197b93d6038318bf5f846c2e7abe8ca0ba85de5bc717a07", "measured_slow_code": "N, M = list(map(int, input().split()))\nK = [0] * N\nA = [list(map(int, input().split())) for i in range(N)]\ncount = 0\nfor i in range(1, M + 1, 1):\n likecount = 0\n for j in range(N):\n for k in range(1, A[j][0] + 1, 1):\n if A[j][k] == i:\n likecount += 1\n if likecount == N:\n count += 1\nprint(count)\n", "measured_slow_code_sha256": "0f7452cbac3152780e6e45e4ccdb0d439fed784a94d652759a76c518063b3e0f", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4.107687651723717, "pair_id": "python_v2_c8c246c3ba358c32f50fefee", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03126", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03126_eb59173593586205e197b93d6038318bf5f846c2e7abe8ca0ba85de5bc717a07.jsonl.gz", "inputs": "reproduction/python/inputs/p03126.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03126_0f7452cbac3152780e6e45e4ccdb0d439fed784a94d652759a76c518063b3e0f.jsonl.gz"}, "slow_code": "N, M = list(map(int, input().split()))\nK = [0] * N\nA = [list(map(int, input().split())) for i in range(N)]\ncount = 0\nfor i in range(1, M + 1, 1):\n likecount = 0\n for j in range(N):\n for k in range(1, A[j][0] + 1, 1):\n if A[j][k] == i:\n likecount += 1\n if likecount == N:\n count += 1\nprint(count)\n", "slow_code_sha256": "0f7452cbac3152780e6e45e4ccdb0d439fed784a94d652759a76c518063b3e0f", "slow_id": "p03126_0f7452cbac3152780e6e45e4ccdb0d439fed784a94d652759a76c518063b3e0f", "speedup": 4.534542838325146, "stratum": "4-8", "within_pair_jaccard": 0.5833333333333334, "workload": {"case_count": 100, "description": "Each of N people lists K_i distinct liked food IDs A_i,j from 1..M. Count food kinds liked by every person; the lists need not be sorted. Observed inputs: N=1..30 (median 13); M=1..30 (median 15); K_i=1..30.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 2526, "median": 177.0, "min": 8}, "input_format": ["N M\nK_1 A_1,1 ... A_1,K_1\n...\nK_N A_N,1 ... A_N,K_N"], "input_format_status": "source_input_section", "input_lines": {"max": 31, "median": 14.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 932, "median": 83.0, "min": 4}}} -{"case_ids": ["p03801_case_000", "p03801_case_001", "p03801_case_002", "p03801_case_003", "p03801_case_004", "p03801_case_005", "p03801_case_006", "p03801_case_007", "p03801_case_008", "p03801_case_009", "p03801_case_010", "p03801_case_011", "p03801_case_012", "p03801_case_013", "p03801_case_014", "p03801_case_015", "p03801_case_016", "p03801_case_017", "p03801_case_018", "p03801_case_019", "p03801_case_020", "p03801_case_021", "p03801_case_022", "p03801_case_023", "p03801_case_024", "p03801_case_025", "p03801_case_026", "p03801_case_027", "p03801_case_028", "p03801_case_029", "p03801_case_030", "p03801_case_031", "p03801_case_032", "p03801_case_033", "p03801_case_034", "p03801_case_035", "p03801_case_036", "p03801_case_037", "p03801_case_038", "p03801_case_039", "p03801_case_040", "p03801_case_041", "p03801_case_042", "p03801_case_043", "p03801_case_044", "p03801_case_045", "p03801_case_046", "p03801_case_047", "p03801_case_048", "p03801_case_049", "p03801_case_050", "p03801_case_051", "p03801_case_052", "p03801_case_053", "p03801_case_054", "p03801_case_055", "p03801_case_056", "p03801_case_057", "p03801_case_058", "p03801_case_059", "p03801_case_060", "p03801_case_061", "p03801_case_062", "p03801_case_063", "p03801_case_064", "p03801_case_065", "p03801_case_066", "p03801_case_067", "p03801_case_068", "p03801_case_069", "p03801_case_070", "p03801_case_071", "p03801_case_072", "p03801_case_073", "p03801_case_074", "p03801_case_075", "p03801_case_076", "p03801_case_077", "p03801_case_078", "p03801_case_079", "p03801_case_080", "p03801_case_081", "p03801_case_082", "p03801_case_083", "p03801_case_084", "p03801_case_085", "p03801_case_086", "p03801_case_087", "p03801_case_088", "p03801_case_089", "p03801_case_090", "p03801_case_091", "p03801_case_092", "p03801_case_093", "p03801_case_094", "p03801_case_095", "p03801_case_096", "p03801_case_097", "p03801_case_098", "p03801_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N = int(eval(input()))\nA = [int(a) for a in input().split()]\nans = [0] * N\nnum = 0\nB = sorted(A)\nj = 0\nfor i in range(N):\n cnt = 0\n while j < N and B[j] <= A[i]:\n cnt += max(0, B[j] - num)\n j += 1\n ans[i] = cnt + max(0, (N - j) * (A[i] - num))\n num = max(num, A[i])\nfor a in ans:\n print(a)\n", "fast_code_sha256": "df09b764b4b36c4dd1a32444ee002c3308b4ad2d11bc9074e919e34e92013560", "fast_id": "p03801_df09b764b4b36c4dd1a32444ee002c3308b4ad2d11bc9074e919e34e92013560", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N = int(eval(input()))\nA = [int(a) for a in input().split()]\nans = [0] * N\nnum = 0\nB = sorted(A)\nj = 0\nfor i in range(N):\n cnt = 0\n while j < N and B[j] <= A[i]:\n cnt += max(0, B[j] - num)\n j += 1\n ans[i] = cnt + max(0, (N - j) * (A[i] - num))\n num = max(num, A[i])\nfor a in ans:\n print(a)\n", "measured_fast_code_sha256": "df09b764b4b36c4dd1a32444ee002c3308b4ad2d11bc9074e919e34e92013560", "measured_slow_code": "from collections import defaultdict\nimport sys\n\n\nclass BIT:\n def __init__(self, number):\n self.n = number\n self.list = [0] * (number + 1)\n\n def add(self, i, x): # ith added x 1indexed\n while i <= self.n:\n self.list[i] += x\n i += i & -i\n\n def search(self, i): # 1-i sum\n s = 0\n while i > 0:\n s += self.list[i]\n i -= i & -i\n return s\n\n def suma(self, i, j): # i,i+1,..j sum\n return self.search(j) - self.search(i - 1)\n\n\nN = int(eval(input()))\nA = [int(i) for i in input().split()]\nC = sorted(set(A))\nndd = defaultdict(int)\nfor i in range(len(C)):\n ndd[i + 1] = C[i]\ndd = defaultdict(int)\nfor i in range(len(C)):\n dd[C[i]] = i + 1\n# print(ndd,dd)\nvisit = [0] * N\nvisit[0] = 1\ns = A[0]\nH = []\nH.append(s)\nfor i in range(1, N):\n if s < A[i]:\n s = A[i]\n H.append(s)\n visit[i] = 1\nBITI = BIT(N + 1)\nBITI2 = BIT(N + 1)\nj = len(H) - 1\nl = dd[H[j]]\nnum = sum(A)\nT = [0] * N\nans = 0\nfor i in range(N - 1, -1, -1):\n if l == dd[A[0]]:\n break\n BITI.add(dd[A[i]], A[i])\n BITI2.add(dd[A[i]], 1)\n if dd[A[i]] == l and visit[i] == 1:\n T[i] = (\n BITI.suma(dd[H[j - 1]], N + 1)\n - BITI2.suma(dd[H[j - 1]], N + 1) * H[j - 1]\n - ans\n )\n ans += T[i]\n # print(i,j,l,T[i],ans)\n j -= 1\n l = dd[H[j]]\nx = num - sum(T)\nT[0] = x\n# print(visit,T)\nfor t in T:\n print(t)\n", "measured_slow_code_sha256": "40cdb704510a327363c2183827f02e9385c4a8e8deb4ae92265564da9b8e0f50", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.2327443032452954, "pair_id": "python_v2_604162ceadad3a90d4614953", "per_case_slow_code_faster_fraction": 0.07, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03801", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03801_df09b764b4b36c4dd1a32444ee002c3308b4ad2d11bc9074e919e34e92013560.jsonl.gz", "inputs": "reproduction/python/inputs/p03801.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03801_40cdb704510a327363c2183827f02e9385c4a8e8deb4ae92265564da9b8e0f50.jsonl.gz"}, "slow_code": "from collections import defaultdict\nimport sys\n\n\nclass BIT:\n def __init__(self, number):\n self.n = number\n self.list = [0] * (number + 1)\n\n def add(self, i, x):\n while i <= self.n:\n self.list[i] += x\n i += i & -i\n\n def search(self, i):\n s = 0\n while i > 0:\n s += self.list[i]\n i -= i & -i\n return s\n\n def suma(self, i, j):\n return self.search(j) - self.search(i - 1)\n\n\nN = int(eval(input()))\nA = [int(i) for i in input().split()]\nC = sorted(set(A))\nndd = defaultdict(int)\nfor i in range(len(C)):\n ndd[i + 1] = C[i]\ndd = defaultdict(int)\nfor i in range(len(C)):\n dd[C[i]] = i + 1\n\nvisit = [0] * N\nvisit[0] = 1\ns = A[0]\nH = []\nH.append(s)\nfor i in range(1, N):\n if s < A[i]:\n s = A[i]\n H.append(s)\n visit[i] = 1\nBITI = BIT(N + 1)\nBITI2 = BIT(N + 1)\nj = len(H) - 1\nl = dd[H[j]]\nnum = sum(A)\nT = [0] * N\nans = 0\nfor i in range(N - 1, -1, -1):\n if l == dd[A[0]]:\n break\n BITI.add(dd[A[i]], A[i])\n BITI2.add(dd[A[i]], 1)\n if dd[A[i]] == l and visit[i] == 1:\n T[i] = (\n BITI.suma(dd[H[j - 1]], N + 1)\n - BITI2.suma(dd[H[j - 1]], N + 1) * H[j - 1]\n - ans\n )\n ans += T[i]\n\n j -= 1\n l = dd[H[j]]\nx = num - sum(T)\nT[0] = x\n\nfor t in T:\n print(t)\n", "slow_code_sha256": "16fad88fa10618a2d3253fe477e8c221495b37e3b11f228319dc3cf0097c8388", "slow_id": "p03801_40cdb704510a327363c2183827f02e9385c4a8e8deb4ae92265564da9b8e0f50", "speedup": 2.6708583195042768, "stratum": "2-4", "within_pair_jaccard": 0.3275862068965517, "workload": {"case_count": 100, "description": "Repeat until N stone piles are empty: append the smallest index among current largest piles, then remove one stone from any nonempty pile. Among possible output sequences, choose the lexicographically smallest and report each index frequency. Observed inputs: N=1..100000 (median 1000); a_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1100007, "median": 9900.0, "min": 4}, "input_format": ["N\na_1 ... a_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100001, "median": 1001.0, "min": 2}}} -{"case_ids": ["p03775_case_000", "p03775_case_001", "p03775_case_002", "p03775_case_003", "p03775_case_004", "p03775_case_005", "p03775_case_006", "p03775_case_007", "p03775_case_008", "p03775_case_009", "p03775_case_010", "p03775_case_011", "p03775_case_012", "p03775_case_013", "p03775_case_014", "p03775_case_015", "p03775_case_016", "p03775_case_017", "p03775_case_018", "p03775_case_019", "p03775_case_020", "p03775_case_021", "p03775_case_022", "p03775_case_023", "p03775_case_024", "p03775_case_025", "p03775_case_026", "p03775_case_027", "p03775_case_028", "p03775_case_029", "p03775_case_030", "p03775_case_031", "p03775_case_032", "p03775_case_033", "p03775_case_034", "p03775_case_035", "p03775_case_036", "p03775_case_037", "p03775_case_038", "p03775_case_039", "p03775_case_040", "p03775_case_041", "p03775_case_042", "p03775_case_043", "p03775_case_044", "p03775_case_045", "p03775_case_046", "p03775_case_047", "p03775_case_048", "p03775_case_049", "p03775_case_050", "p03775_case_051", "p03775_case_052", "p03775_case_053", "p03775_case_054", "p03775_case_055", "p03775_case_056", "p03775_case_057", "p03775_case_058", "p03775_case_059", "p03775_case_060", "p03775_case_061", "p03775_case_062", "p03775_case_063", "p03775_case_064", "p03775_case_065", "p03775_case_066", "p03775_case_067", "p03775_case_068", "p03775_case_069", "p03775_case_070", "p03775_case_071", "p03775_case_072", "p03775_case_073", "p03775_case_074", "p03775_case_075", "p03775_case_076", "p03775_case_077", "p03775_case_078", "p03775_case_079", "p03775_case_080", "p03775_case_081", "p03775_case_082", "p03775_case_083", "p03775_case_084", "p03775_case_085", "p03775_case_086", "p03775_case_087", "p03775_case_088", "p03775_case_089", "p03775_case_090", "p03775_case_091", "p03775_case_092", "p03775_case_093", "p03775_case_094", "p03775_case_095", "p03775_case_096", "p03775_case_097", "p03775_case_098", "p03775_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import math\nimport sys\n\nn = int(eval(input()))\nmi = int(math.log10(n))\nnb = n\nm = 1\nfor i in range(1, int(nb**0.5) + 2):\n if n % i == 0:\n mi = min(mi, max(int(math.log10(n / i)), int(math.log10(i))))\nprint((mi + 1))\n", "fast_code_sha256": "21072253f4c4bf0ce7d478d960cebff18fbf5819c7b03ef62bf4b28c8525f610", "fast_id": "p03775_21072253f4c4bf0ce7d478d960cebff18fbf5819c7b03ef62bf4b28c8525f610", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import math\nimport sys\n\nn = int(eval(input()))\nmi = int(math.log10(n))\nnb = n\nm = 1\nfor i in range(1, int(nb**0.5) + 2):\n if n % i == 0:\n mi = min(mi, max(int(math.log10(n / i)), int(math.log10(i))))\nprint((mi + 1))\n", "measured_fast_code_sha256": "21072253f4c4bf0ce7d478d960cebff18fbf5819c7b03ef62bf4b28c8525f610", "measured_slow_code": "n = int(eval(input()))\n\n\ndef cal(a):\n return len(str(a))\n\n\nm = 11\nfor j in range(1, 10**6 + 1):\n if n % j == 0:\n m = min(m, max(cal(j), cal(n // j)))\n # print(m)\nprint(m)\n", "measured_slow_code_sha256": "7ab001f5efb675596da434bf3ef9e7fa9f9ec3b0d345cb8726f7720241f1422c", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 229.09838451747106, "pair_id": "python_v2_3c41b596ddb5ff87cae1be1f", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03775", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03775_21072253f4c4bf0ce7d478d960cebff18fbf5819c7b03ef62bf4b28c8525f610.jsonl.gz", "inputs": "reproduction/python/inputs/p03775.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03775_7ab001f5efb675596da434bf3ef9e7fa9f9ec3b0d345cb8726f7720241f1422c.jsonl.gz"}, "slow_code": "n = int(eval(input()))\n\n\ndef cal(a):\n return len(str(a))\n\n\nm = 11\nfor j in range(1, 10**6 + 1):\n if n % j == 0:\n m = min(m, max(cal(j), cal(n // j)))\n\nprint(m)\n", "slow_code_sha256": "0bd50a29ee4b8ed24f88df4bdfcabb76a7a6778570de4e74b5c8ddab42febd8f", "slow_id": "p03775_7ab001f5efb675596da434bf3ef9e7fa9f9ec3b0d345cb8726f7720241f1422c", "speedup": 193.96678015560664, "stratum": "8+", "within_pair_jaccard": 0.42424242424242425, "workload": {"case_count": 100, "description": "Among positive integer factorizations A*B=N, minimize the larger decimal digit count of A and B. Observed inputs: N=1..10000000000 (median 15771778).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 12, "median": 9.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p03309_case_000", "p03309_case_001", "p03309_case_002", "p03309_case_003", "p03309_case_004", "p03309_case_005", "p03309_case_006", "p03309_case_007", "p03309_case_008", "p03309_case_009", "p03309_case_010", "p03309_case_011", "p03309_case_012", "p03309_case_013", "p03309_case_014", "p03309_case_015", "p03309_case_016", "p03309_case_017", "p03309_case_018", "p03309_case_019", "p03309_case_020", "p03309_case_021", "p03309_case_022", "p03309_case_023", "p03309_case_024", "p03309_case_025", "p03309_case_026", "p03309_case_027", "p03309_case_028", "p03309_case_029", "p03309_case_030", "p03309_case_031", "p03309_case_032", "p03309_case_033", "p03309_case_034", "p03309_case_035", "p03309_case_036", "p03309_case_037", "p03309_case_038", "p03309_case_039", "p03309_case_040", "p03309_case_041", "p03309_case_042", "p03309_case_043", "p03309_case_044", "p03309_case_045", "p03309_case_046", "p03309_case_047", "p03309_case_048", "p03309_case_049", "p03309_case_050", "p03309_case_051", "p03309_case_052", "p03309_case_053", "p03309_case_054", "p03309_case_055", "p03309_case_056", "p03309_case_057", "p03309_case_058", "p03309_case_059", "p03309_case_060", "p03309_case_061", "p03309_case_062", "p03309_case_063", "p03309_case_064", "p03309_case_065", "p03309_case_066", "p03309_case_067", "p03309_case_068", "p03309_case_069", "p03309_case_070", "p03309_case_071", "p03309_case_072", "p03309_case_073", "p03309_case_074", "p03309_case_075", "p03309_case_076", "p03309_case_077", "p03309_case_078", "p03309_case_079", "p03309_case_080", "p03309_case_081", "p03309_case_082", "p03309_case_083", "p03309_case_084", "p03309_case_085", "p03309_case_086", "p03309_case_087", "p03309_case_088", "p03309_case_089", "p03309_case_090", "p03309_case_091", "p03309_case_092", "p03309_case_093", "p03309_case_094", "p03309_case_095", "p03309_case_096", "p03309_case_097", "p03309_case_098", "p03309_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\na = list(map(int, input().split()))\nfor i in range(n):\n a[i] -= i + 1\nmedian = -1\na.sort()\nif n % 2 == 0:\n median = (a[n // 2] + a[n // 2 - 1]) // 2\nelse:\n median = a[n // 2]\n\n\ndef comp(x):\n su = 0\n for i in a:\n su += abs(i - x)\n return su\n\n\nprint((min(comp(median), comp(median + 1))))\n", "fast_code_sha256": "c7f5f0de5509b8a35c16245b29a408c303043e680b72b0594d4e075979ad5bbf", "fast_id": "p03309_c7f5f0de5509b8a35c16245b29a408c303043e680b72b0594d4e075979ad5bbf", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\na = list(map(int, input().split()))\nfor i in range(n):\n a[i] -= i + 1\nmedian = -1\na.sort()\nif n % 2 == 0:\n median = (a[n // 2] + a[n // 2 - 1]) // 2\nelse:\n median = a[n // 2]\n\n\ndef comp(x):\n su = 0\n for i in a:\n su += abs(i - x)\n return su\n\n\nprint((min(comp(median), comp(median + 1))))\n", "measured_fast_code_sha256": "c7f5f0de5509b8a35c16245b29a408c303043e680b72b0594d4e075979ad5bbf", "measured_slow_code": "# -*- coding: utf-8 -*-\n# AtCoder Beginner Contest\nif __name__ == \"__main__\":\n from statistics import median\n\n n = int(eval(input()))\n a = list(map(int, input().split()))\n total = 0\n # See:\n # https://www.youtube.com/watch?v=UX4AuiCVtN4\n # https://beta.atcoder.jp/contests/abc102/submissions/2768315\n mod_a = sorted([ai - i for i, ai in enumerate(a, 1)])\n b = median(mod_a)\n for i in range(n):\n total += abs(mod_a[i] - b)\n print((int(total)))\n", "measured_slow_code_sha256": "cc6340aab617e7100bd4d51ff3921118d5d3dad1bda63cfcf3f2026a849def46", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.639547631365317, "pair_id": "python_v2_626f32b0b4112609f33788b0", "per_case_slow_code_faster_fraction": 0.42, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03309", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03309_c7f5f0de5509b8a35c16245b29a408c303043e680b72b0594d4e075979ad5bbf.jsonl.gz", "inputs": "reproduction/python/inputs/p03309.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03309_cc6340aab617e7100bd4d51ff3921118d5d3dad1bda63cfcf3f2026a849def46.jsonl.gz"}, "slow_code": "if __name__ == \"__main__\":\n from statistics import median\n\n n = int(eval(input()))\n a = list(map(int, input().split()))\n total = 0\n\n mod_a = sorted([ai - i for i, ai in enumerate(a, 1)])\n b = median(mod_a)\n for i in range(n):\n total += abs(mod_a[i] - b)\n print((int(total)))\n", "slow_code_sha256": "364f3596fd84d0acd37a6dd5d8da1a36ebb61efbb957346157757658db88473b", "slow_id": "p03309_cc6340aab617e7100bd4d51ff3921118d5d3dad1bda63cfcf3f2026a849def46", "speedup": 3.815007268379895, "stratum": "2-4", "within_pair_jaccard": 0.47368421052631576, "workload": {"case_count": 100, "description": "Choose any integer b to minimize sum_i |A_i-(b+i)| for a sequence with positions indexed from 1 through N. Observed inputs: N=1..200000 (median 1000); A_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 2000226, "median": 9899.5, "min": 4}, "input_format": ["N\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200001, "median": 1001.0, "min": 2}}} -{"case_ids": ["p03077_case_000", "p03077_case_001", "p03077_case_002", "p03077_case_003", "p03077_case_004", "p03077_case_005", "p03077_case_006", "p03077_case_007", "p03077_case_008", "p03077_case_009", "p03077_case_010", "p03077_case_011", "p03077_case_012", "p03077_case_013", "p03077_case_014", "p03077_case_015", "p03077_case_016", "p03077_case_017", "p03077_case_018", "p03077_case_019", "p03077_case_020", "p03077_case_021", "p03077_case_022", "p03077_case_023", "p03077_case_024", "p03077_case_025", "p03077_case_026", "p03077_case_027", "p03077_case_028", "p03077_case_029", "p03077_case_030", "p03077_case_031", "p03077_case_032", "p03077_case_033", "p03077_case_034", "p03077_case_035", "p03077_case_036", "p03077_case_037", "p03077_case_038", "p03077_case_039", "p03077_case_040", "p03077_case_041", "p03077_case_042", "p03077_case_043", "p03077_case_044", "p03077_case_045", "p03077_case_046", "p03077_case_047", "p03077_case_048", "p03077_case_049", "p03077_case_050", "p03077_case_051", "p03077_case_052", "p03077_case_053", "p03077_case_054", "p03077_case_055", "p03077_case_056", "p03077_case_057", "p03077_case_058", "p03077_case_059", "p03077_case_060", "p03077_case_061", "p03077_case_062", "p03077_case_063", "p03077_case_064", "p03077_case_065", "p03077_case_066", "p03077_case_067", "p03077_case_068", "p03077_case_069", "p03077_case_070", "p03077_case_071", "p03077_case_072", "p03077_case_073", "p03077_case_074", "p03077_case_075", "p03077_case_076", "p03077_case_077", "p03077_case_078", "p03077_case_079", "p03077_case_080", "p03077_case_081", "p03077_case_082", "p03077_case_083", "p03077_case_084", "p03077_case_085", "p03077_case_086", "p03077_case_087", "p03077_case_088", "p03077_case_089", "p03077_case_090", "p03077_case_091", "p03077_case_092", "p03077_case_093", "p03077_case_094", "p03077_case_095", "p03077_case_096", "p03077_case_097", "p03077_case_098", "p03077_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\ns2nn = lambda s: [int(c) for c in s.split(\" \")]\nss2nn = lambda ss: [int(s) for s in list(ss)]\nss2nnn = lambda ss: [s2nn(s) for s in list(ss)]\ni2s = lambda: sys.stdin.readline().rstrip()\ni2n = lambda: int(i2s())\ni2nn = lambda: s2nn(i2s())\nii2ss = lambda n: [sys.stdin.readline() for _ in range(n)]\nii2nn = lambda n: ss2nn(ii2ss(n))\nii2nnn = lambda n: ss2nnn(ii2ss(n))\nimport math\n\n\ndef main():\n N = i2n()\n ABCDE = ii2nn(5)\n m = min(ABCDE)\n n = int(math.ceil(N / m)) + 4\n print(n)\n\n\nmain()\n", "fast_code_sha256": "a90cc8f3ad97bee728be3d3a2054cdf6caa4cb111cfd9c964b877de67c1ab1d7", "fast_id": "p03077_ec186682a96a8871c1b73b1af3feee8dad7169ddf50fa980d8fe187af859f2ec", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "# AtCoder Beginner Contest 123\n# https://atcoder.jp/contests/abc123\nimport sys\n\ns2nn = lambda s: [int(c) for c in s.split(\" \")]\nss2nn = lambda ss: [int(s) for s in list(ss)]\nss2nnn = lambda ss: [s2nn(s) for s in list(ss)]\ni2s = lambda: sys.stdin.readline().rstrip()\ni2n = lambda: int(i2s())\ni2nn = lambda: s2nn(i2s())\nii2ss = lambda n: [sys.stdin.readline() for _ in range(n)]\nii2nn = lambda n: ss2nn(ii2ss(n))\nii2nnn = lambda n: ss2nnn(ii2ss(n))\nimport math\n\n\ndef main():\n N = i2n()\n ABCDE = ii2nn(5)\n m = min(ABCDE)\n n = int(math.ceil(N / m)) + 4\n print(n)\n\n\nmain()\n", "measured_fast_code_sha256": "ec186682a96a8871c1b73b1af3feee8dad7169ddf50fa980d8fe187af859f2ec", "measured_slow_code": "# -*- coding: utf-8 -*-\nimport sys\nimport numpy as np\n\n\ndef get_num():\n return int(eval(input()))\n\n\ndef get_nums(n):\n res = [0 for _ in range(n)]\n for i in range(n):\n res[i] = int(eval(input()))\n return res\n\n\ndef get_numbers():\n return list(map(int, input().split()))\n\n\nn = get_num()\ncosts = get_nums(5)\nmax_time = 0\nfor cost in costs:\n max_time = max(max_time, int(np.ceil(n / cost)))\nprint((max_time + 4))\n", "measured_slow_code_sha256": "34caf7325f4819bd719f1f977d4c7833f1b8eae1073783274c70d879e08aa59a", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 357.59384053227535, "pair_id": "python_v2_a15b59d8aaa121593f1f146c", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03077", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03077_ec186682a96a8871c1b73b1af3feee8dad7169ddf50fa980d8fe187af859f2ec.jsonl.gz", "inputs": "reproduction/python/inputs/p03077.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03077_34caf7325f4819bd719f1f977d4c7833f1b8eae1073783274c70d879e08aa59a.jsonl.gz"}, "slow_code": "import sys\nimport numpy as np\n\n\ndef get_num():\n return int(eval(input()))\n\n\ndef get_nums(n):\n res = [0 for _ in range(n)]\n for i in range(n):\n res[i] = int(eval(input()))\n return res\n\n\ndef get_numbers():\n return list(map(int, input().split()))\n\n\nn = get_num()\ncosts = get_nums(5)\nmax_time = 0\nfor cost in costs:\n max_time = max(max_time, int(np.ceil(n / cost)))\nprint((max_time + 4))\n", "slow_code_sha256": "ab58e9cb16ab933309b0c60e055e71406d283b0d16126adf763de4e9caa5d6fb", "slow_id": "p03077_34caf7325f4819bd719f1f977d4c7833f1b8eae1073783274c70d879e08aa59a", "speedup": 357.52251239832924, "stratum": "8+", "within_pair_jaccard": 0.2777777777777778, "workload": {"case_count": 100, "description": "Move N people through five successive transport links with capacities A,B,C,D,E. Each link takes one minute and dispatches one vehicle at every integer time starting at 0; transfers take no time. Find when everyone can arrive. Observed inputs: N=1..1000000000000000; capacities=1..1000000000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 102, "median": 82.0, "min": 12}, "input_format": ["N\nA\nB\nC\nD\nE"], "input_format_status": "source_input_section", "input_lines": {"max": 6, "median": 6.0, "min": 6}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 6, "median": 6.0, "min": 6}}} -{"case_ids": ["p02956_case_000", "p02956_case_001", "p02956_case_002", "p02956_case_003", "p02956_case_004", "p02956_case_005", "p02956_case_006", "p02956_case_007", "p02956_case_008", "p02956_case_009", "p02956_case_010", "p02956_case_011", "p02956_case_012", "p02956_case_013", "p02956_case_014", "p02956_case_015", "p02956_case_016", "p02956_case_017", "p02956_case_018", "p02956_case_019", "p02956_case_020", "p02956_case_021", "p02956_case_022", "p02956_case_023", "p02956_case_024", "p02956_case_025", "p02956_case_026", "p02956_case_027", "p02956_case_028", "p02956_case_029", "p02956_case_030", "p02956_case_031", "p02956_case_032", "p02956_case_033", "p02956_case_034", "p02956_case_035", "p02956_case_036", "p02956_case_037", "p02956_case_038", "p02956_case_039", "p02956_case_040", "p02956_case_041", "p02956_case_042", "p02956_case_043", "p02956_case_044", "p02956_case_045", "p02956_case_046", "p02956_case_047", "p02956_case_048", "p02956_case_049", "p02956_case_050", "p02956_case_051", "p02956_case_052", "p02956_case_053", "p02956_case_054", "p02956_case_055", "p02956_case_056", "p02956_case_057", "p02956_case_058", "p02956_case_059", "p02956_case_060", "p02956_case_061", "p02956_case_062", "p02956_case_063", "p02956_case_064", "p02956_case_065", "p02956_case_066", "p02956_case_067", "p02956_case_068", "p02956_case_069", "p02956_case_070", "p02956_case_071", "p02956_case_072", "p02956_case_073", "p02956_case_074", "p02956_case_075", "p02956_case_076", "p02956_case_077", "p02956_case_078", "p02956_case_079", "p02956_case_080", "p02956_case_081", "p02956_case_082", "p02956_case_083", "p02956_case_084", "p02956_case_085", "p02956_case_086", "p02956_case_087", "p02956_case_088", "p02956_case_089", "p02956_case_090", "p02956_case_091", "p02956_case_092", "p02956_case_093", "p02956_case_094", "p02956_case_095", "p02956_case_096", "p02956_case_097", "p02956_case_098", "p02956_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\ninput = sys.stdin.readline\nsys.setrecursionlimit(10**7)\nMOD = 998244353\nN = int(eval(input()))\nXY = [[int(x) for x in input().split()] for _ in range(N)]\nXY.sort()\nX, Y = list(zip(*XY))\nY_rank = {x: i for i, x in enumerate(sorted(Y), 1)}\n\n\ndef BIT_update(tree, x):\n while x <= N:\n tree[x] += 1\n x += x & (-x)\n\n\ndef BIT_sum(tree, x):\n ret = 0\n while x:\n ret += tree[x]\n x -= x & (-x)\n return ret\n\n\npow2 = [1]\nfor _ in range(N):\n pow2.append(pow2[-1] * 2 % MOD)\nanswer = 0\ntree = [0] * (N + 1)\nfor L, (x, y) in enumerate(XY):\n y = Y_rank[y]\n R = N - 1 - L\n D = y - 1\n U = N - 1 - D\n LD = BIT_sum(tree, y)\n BIT_update(tree, y)\n LU = L - LD\n RD = D - LD\n RU = R - RD\n\n cnt = pow2[N]\n cnt -= pow2[L]\n cnt -= pow2[R]\n cnt -= pow2[D]\n cnt -= pow2[U]\n cnt += pow2[LD]\n cnt += pow2[LU]\n cnt += pow2[RD]\n cnt += pow2[RU]\n cnt -= 1\n answer += cnt\nanswer %= MOD\nprint(answer)\n", "fast_code_sha256": "20fe085db322ba70d10e68f89404750173ced5521fd05b3ed343af82cc95a436", "fast_id": "p02956_98847dc745804ffedc68345a7f72ee0f29ec77de07b77102351ea8d26538f18c", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\ninput = sys.stdin.readline\nsys.setrecursionlimit(10**7)\nMOD = 998244353\nN = int(eval(input()))\nXY = [[int(x) for x in input().split()] for _ in range(N)]\nXY.sort() # X ascending\nX, Y = list(zip(*XY))\nY_rank = {x: i for i, x in enumerate(sorted(Y), 1)}\n\n\ndef BIT_update(tree, x):\n while x <= N:\n tree[x] += 1\n x += x & (-x)\n\n\ndef BIT_sum(tree, x):\n ret = 0\n while x:\n ret += tree[x]\n x -= x & (-x)\n return ret\n\n\npow2 = [1]\nfor _ in range(N):\n pow2.append(pow2[-1] * 2 % MOD)\nanswer = 0\ntree = [0] * (N + 1)\nfor L, (x, y) in enumerate(XY):\n y = Y_rank[y]\n R = N - 1 - L\n D = y - 1\n U = N - 1 - D\n LD = BIT_sum(tree, y)\n BIT_update(tree, y)\n LU = L - LD\n RD = D - LD\n RU = R - RD\n # bounding box が自分自身を含むような集合を数える\n # 全体から引く\n cnt = pow2[N]\n cnt -= pow2[L]\n cnt -= pow2[R]\n cnt -= pow2[D]\n cnt -= pow2[U]\n cnt += pow2[LD]\n cnt += pow2[LU]\n cnt += pow2[RD]\n cnt += pow2[RU]\n cnt -= 1\n answer += cnt\nanswer %= MOD\nprint(answer)\n", "measured_fast_code_sha256": "98847dc745804ffedc68345a7f72ee0f29ec77de07b77102351ea8d26538f18c", "measured_slow_code": "import sys, queue, math, copy, itertools, bisect, collections, heapq\n\n\ndef main():\n MOD = 998244353\n LI = lambda: [int(x) for x in sys.stdin.readline().split()]\n NI = lambda: int(sys.stdin.readline())\n N = NI()\n dat = [LI() for _ in range(N)]\n dat.sort()\n yo = [y for _, y in dat]\n yo.sort()\n up = [0] * N\n dw = [0] * N\n bit = [0] * (N + 1)\n\n def bit_add(i):\n while i <= N:\n bit[i] += 1\n i += i & -i\n\n def bit_sum(i):\n ret = 0\n while i > 0:\n ret += bit[i]\n i -= i & -i\n return ret\n\n for i in range(N):\n x, y = dat[i]\n y = bisect.bisect_left(yo, y) + 1\n up[i] = bit_sum(y)\n bit_add(y)\n bit = [0] * (N + 1)\n for i in range(N - 1, -1, -1):\n x, y = dat[i]\n y = bisect.bisect_left(yo, y) + 1\n dw[i] = bit_sum(y)\n bit_add(y)\n ans = N * pow(2, N - 1, MOD)\n for i in range(N):\n a = i - up[i]\n b = up[i]\n c = N - (i + 1) - dw[i]\n d = dw[i]\n pa = pow(2, a, MOD)\n pb = pow(2, b, MOD)\n pc = pow(2, c, MOD)\n pd = pow(2, d, MOD)\n p = (pow(2, a + d, MOD) - 1) - (pa - 1) - (pd - 1)\n q = (pow(2, b + c, MOD) - 1) - (pb - 1) - (pc - 1)\n x = p * (pb + pc - 1)\n y = q * (pa + pd - 1)\n z = p * q\n ans = (ans + x + y + z) % MOD\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "5fb4e470bffee1e77fe67869002cfa051bc0f9ceb4f803ffff28bd835f4edb34", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.536598557080314, "pair_id": "python_v2_d07d037a55ad652658c59c04", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02956", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02956_98847dc745804ffedc68345a7f72ee0f29ec77de07b77102351ea8d26538f18c.jsonl.gz", "inputs": "reproduction/python/inputs/p02956.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02956_5fb4e470bffee1e77fe67869002cfa051bc0f9ceb4f803ffff28bd835f4edb34.jsonl.gz"}, "slow_code": "import sys, queue, math, copy, itertools, bisect, collections, heapq\n\n\ndef main():\n MOD = 998244353\n LI = lambda: [int(x) for x in sys.stdin.readline().split()]\n NI = lambda: int(sys.stdin.readline())\n N = NI()\n dat = [LI() for _ in range(N)]\n dat.sort()\n yo = [y for _, y in dat]\n yo.sort()\n up = [0] * N\n dw = [0] * N\n bit = [0] * (N + 1)\n\n def bit_add(i):\n while i <= N:\n bit[i] += 1\n i += i & -i\n\n def bit_sum(i):\n ret = 0\n while i > 0:\n ret += bit[i]\n i -= i & -i\n return ret\n\n for i in range(N):\n x, y = dat[i]\n y = bisect.bisect_left(yo, y) + 1\n up[i] = bit_sum(y)\n bit_add(y)\n bit = [0] * (N + 1)\n for i in range(N - 1, -1, -1):\n x, y = dat[i]\n y = bisect.bisect_left(yo, y) + 1\n dw[i] = bit_sum(y)\n bit_add(y)\n ans = N * pow(2, N - 1, MOD)\n for i in range(N):\n a = i - up[i]\n b = up[i]\n c = N - (i + 1) - dw[i]\n d = dw[i]\n pa = pow(2, a, MOD)\n pb = pow(2, b, MOD)\n pc = pow(2, c, MOD)\n pd = pow(2, d, MOD)\n p = (pow(2, a + d, MOD) - 1) - (pa - 1) - (pd - 1)\n q = (pow(2, b + c, MOD) - 1) - (pb - 1) - (pc - 1)\n x = p * (pb + pc - 1)\n y = q * (pa + pd - 1)\n z = p * q\n ans = (ans + x + y + z) % MOD\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "5fb4e470bffee1e77fe67869002cfa051bc0f9ceb4f803ffff28bd835f4edb34", "slow_id": "p02956_5fb4e470bffee1e77fe67869002cfa051bc0f9ceb4f803ffff28bd835f4edb34", "speedup": 2.6124307566556464, "stratum": "2-4", "within_pair_jaccard": 0.2840909090909091, "workload": {"case_count": 100, "description": "For each nonempty subset of N plane points, count all original points in its smallest axis-aligned bounding rectangle, including boundaries. Sum these counts modulo 998244353. All x coordinates are distinct, as are all y coordinates. Observed inputs: N=1..200000 (median 1000); x_i=-1000000000..1000000000; y_i=-1000000000..999999000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 4200009, "median": 20809.0, "min": 20}, "input_format": ["N\nx_1 y_1\n...\nx_N y_N"], "input_format_status": "source_input_section", "input_lines": {"max": 200001, "median": 1001.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 400001, "median": 2001.0, "min": 3}}} -{"case_ids": ["p03566_case_000", "p03566_case_001", "p03566_case_002", "p03566_case_003", "p03566_case_004", "p03566_case_005", "p03566_case_006", "p03566_case_007", "p03566_case_008", "p03566_case_009", "p03566_case_010", "p03566_case_011", "p03566_case_012", "p03566_case_013", "p03566_case_014", "p03566_case_015", "p03566_case_016", "p03566_case_017", "p03566_case_018", "p03566_case_019", "p03566_case_020", "p03566_case_021", "p03566_case_022", "p03566_case_023", "p03566_case_024", "p03566_case_025", "p03566_case_026", "p03566_case_027", "p03566_case_028", "p03566_case_029", "p03566_case_030", "p03566_case_031", "p03566_case_032", "p03566_case_033", "p03566_case_034", "p03566_case_035", "p03566_case_036", "p03566_case_037", "p03566_case_038", "p03566_case_039", "p03566_case_040", "p03566_case_041", "p03566_case_042", "p03566_case_043", "p03566_case_044", "p03566_case_045", "p03566_case_046", "p03566_case_047", "p03566_case_048", "p03566_case_049", "p03566_case_050", "p03566_case_051", "p03566_case_052", "p03566_case_053", "p03566_case_054", "p03566_case_055", "p03566_case_056", "p03566_case_057", "p03566_case_058", "p03566_case_059", "p03566_case_060", "p03566_case_061", "p03566_case_062", "p03566_case_063", "p03566_case_064", "p03566_case_065", "p03566_case_066", "p03566_case_067", "p03566_case_068", "p03566_case_069", "p03566_case_070", "p03566_case_071", "p03566_case_072", "p03566_case_073", "p03566_case_074", "p03566_case_075", "p03566_case_076", "p03566_case_077", "p03566_case_078", "p03566_case_079", "p03566_case_080", "p03566_case_081", "p03566_case_082", "p03566_case_083", "p03566_case_084", "p03566_case_085", "p03566_case_086", "p03566_case_087", "p03566_case_088", "p03566_case_089", "p03566_case_090", "p03566_case_091", "p03566_case_092", "p03566_case_093", "p03566_case_094", "p03566_case_095", "p03566_case_096", "p03566_case_097", "p03566_case_098", "p03566_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def calc_area(v_end, v_start, v_max, dt):\n kouten_v = (v_end + v_start + dt) / 2\n kouten_t = kouten_v - v_start\n if 0 < kouten_t < dt:\n area = (v_start + kouten_v) * kouten_t / 2\n area += (v_end + kouten_v) * (dt - kouten_t) / 2\n area -= max(0, (kouten_v - v_max)) ** 2\n else:\n area = (v_start + v_end) * dt / 2\n return area\n\n\ndef main():\n\n n = int(eval(input()))\n t = [int(i) for i in input().split()]\n v = [int(i) for i in input().split()]\n\n max_velocity = [0]\n for i in range(1, n):\n max_velocity_ = min(v[i - 1], v[i], max_velocity[i - 1] + t[i - 1])\n max_velocity.append(max_velocity_)\n max_velocity.append(0)\n\n for i in range(n - 1):\n if max_velocity[-(i + 1)] - max_velocity[-(i + 2)] < -t[-(i + 1)]:\n max_velocity[-(i + 2)] = max_velocity[-(i + 1)] + t[-(i + 1)]\n\n ans = 0\n for i in range(n):\n ans += calc_area(max_velocity[i + 1], max_velocity[i], v[i], t[i])\n print(ans)\n\n\nmain()\n", "fast_code_sha256": "a16ad46c25afcc872ffdcecc1fc2488ab024ba2926890f3b3b73a77ac9799ba5", "fast_id": "p03566_745ddbba495ff86d8ef795671a21728a3a97d40f4051f365cd66ffaf6066ffab", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "# 区間ごとの面積を計算する\ndef calc_area(v_end, v_start, v_max, dt):\n kouten_v = (v_end + v_start + dt) / 2\n kouten_t = kouten_v - v_start\n if 0 < kouten_t < dt:\n area = (v_start + kouten_v) * kouten_t / 2 # 左側\n area += (v_end + kouten_v) * (dt - kouten_t) / 2 # 右側\n area -= max(0, (kouten_v - v_max)) ** 2 # 上の三角形\n else:\n area = (v_start + v_end) * dt / 2\n return area\n\n\ndef main():\n # 与えられた入力を受け取る\n n = int(eval(input()))\n t = [int(i) for i in input().split()]\n v = [int(i) for i in input().split()]\n # 各区間の許容最大速度を計算する\n # (この段階では傾きが-1未満になる可能性がある)\n max_velocity = [0]\n for i in range(1, n):\n max_velocity_ = min(v[i - 1], v[i], max_velocity[i - 1] + t[i - 1])\n max_velocity.append(max_velocity_)\n max_velocity.append(0)\n # 後ろから走査して、傾きが-1未満を満たすように許容速度をfittingする\n for i in range(n - 1):\n if max_velocity[-(i + 1)] - max_velocity[-(i + 2)] < -t[-(i + 1)]:\n max_velocity[-(i + 2)] = max_velocity[-(i + 1)] + t[-(i + 1)]\n # 各区間の面積を計算して足し合わせる\n ans = 0\n for i in range(n):\n ans += calc_area(max_velocity[i + 1], max_velocity[i], v[i], t[i])\n print(ans)\n\n\nmain()\n", "measured_fast_code_sha256": "745ddbba495ff86d8ef795671a21728a3a97d40f4051f365cd66ffaf6066ffab", "measured_slow_code": "import heapq\n\nn = int(eval(input()))\ninf = 10000000000000\nans = [[-1, -1] for i in range(n)]\nans[-1][1], ans[0][0] = 0, 0\nt = list(map(int, input().split()))\nv = list(map(int, input().split()))\nv2 = []\nfor i in range(n):\n heapq.heappush(v2, (v[i], i))\n\n\ndef next(y, wh):\n global ans, n\n ansi = inf\n if wh:\n r1, r2 = list(range(y[1] - 1, -1, -1)), list(range(y[1], n))\n else:\n r1, r2 = list(range(y[1], -1, -1)), list(range(y[1] + 1, n))\n now = 0\n for j in r1:\n if ans[j][1] != -1:\n ansi = min(ansi, ans[j][1] + now)\n now += t[j]\n if ans[j][0] != -1:\n ansi = min(ansi, ans[j][0] + now)\n now = 0\n for j in r2:\n if ans[j][0] != -1:\n ansi = min(ansi, ans[j][0] + now)\n now += t[j]\n if ans[j][1] != -1:\n ansi = min(ansi, ans[j][1] + now)\n if wh:\n ans[y[1]][0] = min(ansi, y[0])\n ans[y[1] - 1][1] = ans[y[1]][0]\n else:\n ans[y[1]][1] = min(ansi, y[0])\n ans[y[1] + 1][0] = ans[y[1]][1]\n\n\nfor i in range(n):\n y = heapq.heappop(v2)\n if ans[y[1]][0] == -1:\n next(y, True)\n if ans[y[1]][1] == -1:\n next(y, False)\nanswer = 0\nfor i in range(n):\n h = min((t[i] + sum(ans[i])) / 2, v[i])\n answer += (h**2 - ans[i][0] ** 2) / 2\n answer += (h**2 - ans[i][1] ** 2) / 2\n answer += h * (t[i] + sum(ans[i]) - 2 * h)\nprint(answer)\n", "measured_slow_code_sha256": "e080acc822dc90b94acbd1874bafc617cc0405efef250948b23c795bba65bd1b", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 7.477007032450933, "pair_id": "python_v2_54268f3315014b85c79dc4ed", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03566", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03566_745ddbba495ff86d8ef795671a21728a3a97d40f4051f365cd66ffaf6066ffab.jsonl.gz", "inputs": "reproduction/python/inputs/p03566.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03566_e080acc822dc90b94acbd1874bafc617cc0405efef250948b23c795bba65bd1b.jsonl.gz"}, "slow_code": "import heapq\n\nn = int(eval(input()))\ninf = 10000000000000\nans = [[-1, -1] for i in range(n)]\nans[-1][1], ans[0][0] = 0, 0\nt = list(map(int, input().split()))\nv = list(map(int, input().split()))\nv2 = []\nfor i in range(n):\n heapq.heappush(v2, (v[i], i))\n\n\ndef next(y, wh):\n global ans, n\n ansi = inf\n if wh:\n r1, r2 = list(range(y[1] - 1, -1, -1)), list(range(y[1], n))\n else:\n r1, r2 = list(range(y[1], -1, -1)), list(range(y[1] + 1, n))\n now = 0\n for j in r1:\n if ans[j][1] != -1:\n ansi = min(ansi, ans[j][1] + now)\n now += t[j]\n if ans[j][0] != -1:\n ansi = min(ansi, ans[j][0] + now)\n now = 0\n for j in r2:\n if ans[j][0] != -1:\n ansi = min(ansi, ans[j][0] + now)\n now += t[j]\n if ans[j][1] != -1:\n ansi = min(ansi, ans[j][1] + now)\n if wh:\n ans[y[1]][0] = min(ansi, y[0])\n ans[y[1] - 1][1] = ans[y[1]][0]\n else:\n ans[y[1]][1] = min(ansi, y[0])\n ans[y[1] + 1][0] = ans[y[1]][1]\n\n\nfor i in range(n):\n y = heapq.heappop(v2)\n if ans[y[1]][0] == -1:\n next(y, True)\n if ans[y[1]][1] == -1:\n next(y, False)\nanswer = 0\nfor i in range(n):\n h = min((t[i] + sum(ans[i])) / 2, v[i])\n answer += (h**2 - ans[i][0] ** 2) / 2\n answer += (h**2 - ans[i][1] ** 2) / 2\n answer += h * (t[i] + sum(ans[i]) - 2 * h)\nprint(answer)\n", "slow_code_sha256": "e080acc822dc90b94acbd1874bafc617cc0405efef250948b23c795bba65bd1b", "slow_id": "p03566_e080acc822dc90b94acbd1874bafc617cc0405efef250948b23c795bba65bd1b", "speedup": 6.547744473015357, "stratum": "4-8", "within_pair_jaccard": 0.3508771929824561, "workload": {"case_count": 100, "description": "Maximize distance traveled over N consecutive time segments of durations t_i with speed caps v_i. Speed is nonnegative, starts and ends at zero, and acceleration stays between -1 and 1 distance-units per second squared. Observed inputs: N=1..100 (median 60); t_i=1..200; v_i=1..100; total_duration=1..20000 (median 4520.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 804, "median": 390.5, "min": 6}, "input_format": ["N\nt_1 ... t_N\nv_1 ... v_N"], "input_format_status": "source_input_section", "input_lines": {"max": 3, "median": 3.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 201, "median": 121.0, "min": 3}}} -{"case_ids": ["p02577_case_000", "p02577_case_001", "p02577_case_002", "p02577_case_003", "p02577_case_004", "p02577_case_005", "p02577_case_006", "p02577_case_007", "p02577_case_008", "p02577_case_009", "p02577_case_010", "p02577_case_011", "p02577_case_012", "p02577_case_013", "p02577_case_014", "p02577_case_015", "p02577_case_016", "p02577_case_017", "p02577_case_018", "p02577_case_019", "p02577_case_020", "p02577_case_021", "p02577_case_022", "p02577_case_023", "p02577_case_024", "p02577_case_025", "p02577_case_026", "p02577_case_027", "p02577_case_028", "p02577_case_029", "p02577_case_030", "p02577_case_031", "p02577_case_032", "p02577_case_033", "p02577_case_034", "p02577_case_035", "p02577_case_036", "p02577_case_037", "p02577_case_038", "p02577_case_039", "p02577_case_040", "p02577_case_041", "p02577_case_042", "p02577_case_043", "p02577_case_044", "p02577_case_045", "p02577_case_046", "p02577_case_047", "p02577_case_048", "p02577_case_049", "p02577_case_050", "p02577_case_051", "p02577_case_052", "p02577_case_053", "p02577_case_054", "p02577_case_055", "p02577_case_056", "p02577_case_057", "p02577_case_058", "p02577_case_059", "p02577_case_060", "p02577_case_061", "p02577_case_062", "p02577_case_063", "p02577_case_064", "p02577_case_065", "p02577_case_066", "p02577_case_067", "p02577_case_068", "p02577_case_069", "p02577_case_070", "p02577_case_071", "p02577_case_072", "p02577_case_073", "p02577_case_074", "p02577_case_075", "p02577_case_076", "p02577_case_077", "p02577_case_078", "p02577_case_079", "p02577_case_080", "p02577_case_081", "p02577_case_082", "p02577_case_083", "p02577_case_084", "p02577_case_085", "p02577_case_086", "p02577_case_087", "p02577_case_088", "p02577_case_089", "p02577_case_090", "p02577_case_091", "p02577_case_092", "p02577_case_093", "p02577_case_094", "p02577_case_095", "p02577_case_096", "p02577_case_097", "p02577_case_098", "p02577_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\n\ndef LI2():\n return list(map(int, sys.stdin.readline().rstrip()))\n\n\nprint((\"Yes\" if sum(LI2()) % 9 == 0 else \"No\"))\n", "fast_code_sha256": "20e53009872fe9dd782675e880075268b3e0af9f6ce2a7d4557ec94173ec9057", "fast_id": "p02577_ce0a0d0ae51f3f6bf73ecce01b3d6b08555952927912c9657b6e00ca81b16186", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\n\ndef LI2():\n return list(map(int, sys.stdin.readline().rstrip())) # 空白なし\n\n\nprint((\"Yes\" if sum(LI2()) % 9 == 0 else \"No\"))\n", "measured_fast_code_sha256": "ce0a0d0ae51f3f6bf73ecce01b3d6b08555952927912c9657b6e00ca81b16186", "measured_slow_code": "import sys\n\nsys.setrecursionlimit(10**7)\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\ndef MI():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().rstrip().split())) # 空白あり\n\n\ndef LI2():\n return list(map(int, sys.stdin.readline().rstrip())) # 空白なし\n\n\ndef S():\n return sys.stdin.readline().rstrip()\n\n\ndef LS():\n return list(sys.stdin.readline().rstrip().split()) # 空白あり\n\n\ndef LS2():\n return list(sys.stdin.readline().rstrip()) # 空白なし\n\n\nN = LI2()\nprint((\"Yes\" if sum(N) % 9 == 0 else \"No\"))\n", "measured_slow_code_sha256": "1695d36830b635de7a833cb7583d4932c3ef84eb29ed4a411ae07564db734213", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.48418898514873, "pair_id": "python_v2_a2cfa2f0642202f45d9eb756", "per_case_slow_code_faster_fraction": 0.26, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02577", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02577_ce0a0d0ae51f3f6bf73ecce01b3d6b08555952927912c9657b6e00ca81b16186.jsonl.gz", "inputs": "reproduction/python/inputs/p02577.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02577_1695d36830b635de7a833cb7583d4932c3ef84eb29ed4a411ae07564db734213.jsonl.gz"}, "slow_code": "import sys\n\nsys.setrecursionlimit(10**7)\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\ndef MI():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef LI2():\n return list(map(int, sys.stdin.readline().rstrip()))\n\n\ndef S():\n return sys.stdin.readline().rstrip()\n\n\ndef LS():\n return list(sys.stdin.readline().rstrip().split())\n\n\ndef LS2():\n return list(sys.stdin.readline().rstrip())\n\n\nN = LI2()\nprint((\"Yes\" if sum(N) % 9 == 0 else \"No\"))\n", "slow_code_sha256": "9343e3453d3b21aae3ee17e8f056a2eab92db2a957cffcda54a09aac937cf7e3", "slow_id": "p02577_1695d36830b635de7a833cb7583d4932c3ef84eb29ed4a411ae07564db734213", "speedup": 2.0972042330382656, "stratum": "2-4", "within_pair_jaccard": 0.6333333333333333, "workload": {"case_count": 100, "description": "Determine whether the nonnegative integer represented by the supplied decimal digit string N is divisible by 9. The representation may contain up to 200000 digits; zero is allowed. Observed inputs: input_length=1..200000 (median 10).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 200001, "median": 11.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p02780_case_000", "p02780_case_001", "p02780_case_002", "p02780_case_003", "p02780_case_004", "p02780_case_005", "p02780_case_006", "p02780_case_007", "p02780_case_008", "p02780_case_009", "p02780_case_010", "p02780_case_011", "p02780_case_012", "p02780_case_013", "p02780_case_014", "p02780_case_015", "p02780_case_016", "p02780_case_017", "p02780_case_018", "p02780_case_019", "p02780_case_020", "p02780_case_021", "p02780_case_022", "p02780_case_023", "p02780_case_024", "p02780_case_025", "p02780_case_026", "p02780_case_027", "p02780_case_028", "p02780_case_029", "p02780_case_030", "p02780_case_031", "p02780_case_032", "p02780_case_033", "p02780_case_034", "p02780_case_035", "p02780_case_036", "p02780_case_037", "p02780_case_038", "p02780_case_039", "p02780_case_040", "p02780_case_041", "p02780_case_042", "p02780_case_043", "p02780_case_044", "p02780_case_045", "p02780_case_046", "p02780_case_047", "p02780_case_048", "p02780_case_049", "p02780_case_050", "p02780_case_051", "p02780_case_052", "p02780_case_053", "p02780_case_054", "p02780_case_055", "p02780_case_056", "p02780_case_057", "p02780_case_058", "p02780_case_059", "p02780_case_060", "p02780_case_061", "p02780_case_062", "p02780_case_063", "p02780_case_064", "p02780_case_065", "p02780_case_066", "p02780_case_067", "p02780_case_068", "p02780_case_069", "p02780_case_070", "p02780_case_071", "p02780_case_072", "p02780_case_073", "p02780_case_074", "p02780_case_075", "p02780_case_076", "p02780_case_077", "p02780_case_078", "p02780_case_079", "p02780_case_080", "p02780_case_081", "p02780_case_082", "p02780_case_083", "p02780_case_084", "p02780_case_085", "p02780_case_086", "p02780_case_087", "p02780_case_088", "p02780_case_089", "p02780_case_090", "p02780_case_091", "p02780_case_092", "p02780_case_093", "p02780_case_094", "p02780_case_095", "p02780_case_096", "p02780_case_097", "p02780_case_098", "p02780_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N, K = list(map(int, input().split()))\np = list(map(int, input().split()))\nP = [(1 + p[i]) / 2 for i in range(N)]\nans = sum(P[:K])\ntmp = ans\nfor i in range(N - K):\n tmp = tmp - P[i] + P[i + K]\n ans = max(ans, tmp)\nprint(ans)\n", "fast_code_sha256": "3d7776ff2c7a018ac2b014bf30f1a6b662678335e06558907de5ae67d608ca43", "fast_id": "p02780_3d7776ff2c7a018ac2b014bf30f1a6b662678335e06558907de5ae67d608ca43", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N, K = list(map(int, input().split()))\np = list(map(int, input().split()))\nP = [(1 + p[i]) / 2 for i in range(N)]\nans = sum(P[:K])\ntmp = ans\nfor i in range(N - K):\n tmp = tmp - P[i] + P[i + K]\n ans = max(ans, tmp)\nprint(ans)\n", "measured_fast_code_sha256": "3d7776ff2c7a018ac2b014bf30f1a6b662678335e06558907de5ae67d608ca43", "measured_slow_code": "class BIT:\n def __init__(self, n):\n self.node = [0 for _ in range(n + 1)]\n\n def add(self, idx, w):\n i = idx\n while i < len(self.node) - 1:\n self.node[i] += w\n i |= i + 1\n\n def sum_(self, idx):\n ret, i = 0, idx - 1\n while i >= 0:\n ret += self.node[i]\n i = (i & (i + 1)) - 1\n return ret\n\n def sum(self, l, r):\n return self.sum_(r) - self.sum_(l)\n\n\nn, k = list(map(int, input().split()))\ntree = BIT(n)\np = [int(x) for x in input().split()]\nfor i in range(n):\n tree.add(i, (1 + p[i]) / 2)\nans = 0\nfor i in range(n - k + 1):\n ans = max(ans, tree.sum(i, i + k))\nprint(ans)\n", "measured_slow_code_sha256": "f0e0a2a27a21da5cf3bfa118c0651e9d7851f3f79494b7c4374dbb95d552c6f4", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 6.304822308296249, "pair_id": "python_v2_76a21dc93aa979c881f587da", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02780", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02780_3d7776ff2c7a018ac2b014bf30f1a6b662678335e06558907de5ae67d608ca43.jsonl.gz", "inputs": "reproduction/python/inputs/p02780.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02780_f0e0a2a27a21da5cf3bfa118c0651e9d7851f3f79494b7c4374dbb95d552c6f4.jsonl.gz"}, "slow_code": "class BIT:\n def __init__(self, n):\n self.node = [0 for _ in range(n + 1)]\n\n def add(self, idx, w):\n i = idx\n while i < len(self.node) - 1:\n self.node[i] += w\n i |= i + 1\n\n def sum_(self, idx):\n ret, i = 0, idx - 1\n while i >= 0:\n ret += self.node[i]\n i = (i & (i + 1)) - 1\n return ret\n\n def sum(self, l, r):\n return self.sum_(r) - self.sum_(l)\n\n\nn, k = list(map(int, input().split()))\ntree = BIT(n)\np = [int(x) for x in input().split()]\nfor i in range(n):\n tree.add(i, (1 + p[i]) / 2)\nans = 0\nfor i in range(n - k + 1):\n ans = max(ans, tree.sum(i, i + k))\nprint(ans)\n", "slow_code_sha256": "f0e0a2a27a21da5cf3bfa118c0651e9d7851f3f79494b7c4374dbb95d552c6f4", "slow_id": "p02780_f0e0a2a27a21da5cf3bfa118c0651e9d7851f3f79494b7c4374dbb95d552c6f4", "speedup": 5.071061582542133, "stratum": "4-8", "within_pair_jaccard": 0.38095238095238093, "workload": {"case_count": 100, "description": "Die i independently yields an integer uniformly from 1 to p_i. Choose K consecutive dice among N to maximize the expected sum of the rolls. Observed inputs: N=1..200000 (median 1000); K=1..200000 (median 5); p_i=1..1000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1000014, "median": 3877.5, "min": 8}, "input_format": ["N K\np_1 ... p_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200002, "median": 1002.0, "min": 3}}} -{"case_ids": ["p03767_case_000", "p03767_case_001", "p03767_case_002", "p03767_case_003", "p03767_case_004", "p03767_case_005", "p03767_case_006", "p03767_case_007", "p03767_case_008", "p03767_case_009", "p03767_case_010", "p03767_case_011", "p03767_case_012", "p03767_case_013", "p03767_case_014", "p03767_case_015", "p03767_case_016", "p03767_case_017", "p03767_case_018", "p03767_case_019", "p03767_case_020", "p03767_case_021", "p03767_case_022", "p03767_case_023", "p03767_case_024", "p03767_case_025", "p03767_case_026", "p03767_case_027", "p03767_case_028", "p03767_case_029", "p03767_case_030", "p03767_case_031", "p03767_case_032", "p03767_case_033", "p03767_case_034", "p03767_case_035", "p03767_case_036", "p03767_case_037", "p03767_case_038", "p03767_case_039", "p03767_case_040", "p03767_case_041", "p03767_case_042", "p03767_case_043", "p03767_case_044", "p03767_case_045", "p03767_case_046", "p03767_case_047", "p03767_case_048", "p03767_case_049", "p03767_case_050", "p03767_case_051", "p03767_case_052", "p03767_case_053", "p03767_case_054", "p03767_case_055", "p03767_case_056", "p03767_case_057", "p03767_case_058", "p03767_case_059", "p03767_case_060", "p03767_case_061", "p03767_case_062", "p03767_case_063", "p03767_case_064", "p03767_case_065", "p03767_case_066", "p03767_case_067", "p03767_case_068", "p03767_case_069", "p03767_case_070", "p03767_case_071", "p03767_case_072", "p03767_case_073", "p03767_case_074", "p03767_case_075", "p03767_case_076", "p03767_case_077", "p03767_case_078", "p03767_case_079", "p03767_case_080", "p03767_case_081", "p03767_case_082", "p03767_case_083", "p03767_case_084", "p03767_case_085", "p03767_case_086", "p03767_case_087", "p03767_case_088", "p03767_case_089", "p03767_case_090", "p03767_case_091", "p03767_case_092", "p03767_case_093", "p03767_case_094", "p03767_case_095", "p03767_case_096", "p03767_case_097", "p03767_case_098", "p03767_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N = int(eval(input()))\nprint((sum(sorted(map(int, input().split()))[N : 3 * N : 2])))\n", "fast_code_sha256": "fa7a1b916f20adbde0637ad94f0c364d62e556c10039f6a74be0259675794db4", "fast_id": "p03767_fa7a1b916f20adbde0637ad94f0c364d62e556c10039f6a74be0259675794db4", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N = int(eval(input()))\nprint((sum(sorted(map(int, input().split()))[N : 3 * N : 2])))\n", "measured_fast_code_sha256": "fa7a1b916f20adbde0637ad94f0c364d62e556c10039f6a74be0259675794db4", "measured_slow_code": "from collections import Counter, defaultdict, deque\nfrom heapq import heappop, heappush, heapify\nimport sys, bisect, math, itertools, fractions, pprint\n\nsys.setrecursionlimit(10**8)\nmod = 10**9 + 7\nINF = float(\"inf\")\n\n\ndef inp():\n return int(sys.stdin.readline())\n\n\ndef inpl():\n return list(map(int, sys.stdin.readline().split()))\n\n\nn = inp()\na = inpl()\na.sort(reverse=True)\ncnt = n\nind = 0\nres = 0\nwhile cnt:\n if ind % 2:\n res += a[ind]\n cnt -= 1\n ind += 1\nprint(res)\n", "measured_slow_code_sha256": "7693ad55686e6fd618fa19be5402464b2c1d8a6534c46b08c3072eed6c243853", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.5893241786040804, "pair_id": "python_v2_0531df1894d11f4a5d5cc999", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03767", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03767_fa7a1b916f20adbde0637ad94f0c364d62e556c10039f6a74be0259675794db4.jsonl.gz", "inputs": "reproduction/python/inputs/p03767.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03767_7693ad55686e6fd618fa19be5402464b2c1d8a6534c46b08c3072eed6c243853.jsonl.gz"}, "slow_code": "from collections import Counter, defaultdict, deque\nfrom heapq import heappop, heappush, heapify\nimport sys, bisect, math, itertools, fractions, pprint\n\nsys.setrecursionlimit(10**8)\nmod = 10**9 + 7\nINF = float(\"inf\")\n\n\ndef inp():\n return int(sys.stdin.readline())\n\n\ndef inpl():\n return list(map(int, sys.stdin.readline().split()))\n\n\nn = inp()\na = inpl()\na.sort(reverse=True)\ncnt = n\nind = 0\nres = 0\nwhile cnt:\n if ind % 2:\n res += a[ind]\n cnt -= 1\n ind += 1\nprint(res)\n", "slow_code_sha256": "7693ad55686e6fd618fa19be5402464b2c1d8a6534c46b08c3072eed6c243853", "slow_id": "p03767_7693ad55686e6fd618fa19be5402464b2c1d8a6534c46b08c3072eed6c243853", "speedup": 6.595913346447832, "stratum": "4-8", "within_pair_jaccard": 0.09090909090909091, "workload": {"case_count": 100, "description": "Partition 3N participants into N disjoint teams of three. A team strength is its second-largest member strength, counting ties. Maximize the sum of team strengths. Observed inputs: N=1..100000 (median 1000); participants=3..300000 (median 3000); a_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 3300007, "median": 29687.0, "min": 8}, "input_format": ["N\na_1 ... a_(3N)"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 300001, "median": 3001.0, "min": 4}}} -{"case_ids": ["p03719_case_000", "p03719_case_001", "p03719_case_002", "p03719_case_003", "p03719_case_004", "p03719_case_005", "p03719_case_006", "p03719_case_007", "p03719_case_008", "p03719_case_009", "p03719_case_010", "p03719_case_011", "p03719_case_012", "p03719_case_013", "p03719_case_014", "p03719_case_015", "p03719_case_016", "p03719_case_017", "p03719_case_018", "p03719_case_019", "p03719_case_020", "p03719_case_021", "p03719_case_022", "p03719_case_023", "p03719_case_024", "p03719_case_025", "p03719_case_026", "p03719_case_027", "p03719_case_028", "p03719_case_029", "p03719_case_030", "p03719_case_031", "p03719_case_032", "p03719_case_033", "p03719_case_034", "p03719_case_035", "p03719_case_036", "p03719_case_037", "p03719_case_038", "p03719_case_039", "p03719_case_040", "p03719_case_041", "p03719_case_042", "p03719_case_043", "p03719_case_044", "p03719_case_045", "p03719_case_046", "p03719_case_047", "p03719_case_048", "p03719_case_049", "p03719_case_050", "p03719_case_051", "p03719_case_052", "p03719_case_053", "p03719_case_054", "p03719_case_055", "p03719_case_056", "p03719_case_057", "p03719_case_058", "p03719_case_059", "p03719_case_060", "p03719_case_061", "p03719_case_062", "p03719_case_063", "p03719_case_064", "p03719_case_065", "p03719_case_066", "p03719_case_067", "p03719_case_068", "p03719_case_069", "p03719_case_070", "p03719_case_071", "p03719_case_072", "p03719_case_073", "p03719_case_074", "p03719_case_075", "p03719_case_076", "p03719_case_077", "p03719_case_078", "p03719_case_079", "p03719_case_080", "p03719_case_081", "p03719_case_082", "p03719_case_083", "p03719_case_084", "p03719_case_085", "p03719_case_086", "p03719_case_087", "p03719_case_088", "p03719_case_089", "p03719_case_090", "p03719_case_091", "p03719_case_092", "p03719_case_093", "p03719_case_094", "p03719_case_095", "p03719_case_096", "p03719_case_097", "p03719_case_098", "p03719_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "A, B, C = [int(x) for x in input().strip().split(\" \")]\nif not C < A and not C > B:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "fast_code_sha256": "3390bdcb02a65b89b682e7dbbc5beb00be319ff8217b9a5bbec13b32cc1d85cc", "fast_id": "p03719_3390bdcb02a65b89b682e7dbbc5beb00be319ff8217b9a5bbec13b32cc1d85cc", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "A, B, C = [int(x) for x in input().strip().split(\" \")]\nif not C < A and not C > B:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "measured_fast_code_sha256": "3390bdcb02a65b89b682e7dbbc5beb00be319ff8217b9a5bbec13b32cc1d85cc", "measured_slow_code": "import functools\nimport os\nimport sys\n\nsys.setrecursionlimit(10000)\nINF = float(\"inf\")\n\n\ndef inp():\n return int(eval(input()))\n\n\ndef inpf():\n return float(eval(input()))\n\n\ndef inps():\n return eval(input())\n\n\ndef inl():\n return list(map(int, input().split()))\n\n\ndef inlf():\n return list(map(float, input().split()))\n\n\ndef inls():\n return input().split()\n\n\ndef inpm(line):\n return [inp() for _ in range(line)]\n\n\ndef inpfm(line):\n return [inpf() for _ in range(line)]\n\n\ndef inpsm(line):\n return [inps() for _ in range(line)]\n\n\ndef inlm(line):\n return [inl() for _ in range(line)]\n\n\ndef inlfm(line):\n return [inlf() for _ in range(line)]\n\n\ndef inlsm(line):\n return [inls() for _ in range(line)]\n\n\ndef Yesif(cond):\n print((\"Yes\" if cond else \"No\"))\n\n\ndef YESIF(cond):\n print((\"YES\" if cond else \"NO\"))\n\n\ndef yesif(cond):\n print((\"yes\" if cond else \"no\"))\n\n\na, b, c = inl()\nYesif(a <= c <= b)\n", "measured_slow_code_sha256": "0acae026c7e63eed2245b851c8d32eee934659ca23b9e50786cb323f85625345", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 6.37746090436519, "pair_id": "python_v2_aeb851d5782744d76cfc54de", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03719", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03719_3390bdcb02a65b89b682e7dbbc5beb00be319ff8217b9a5bbec13b32cc1d85cc.jsonl.gz", "inputs": "reproduction/python/inputs/p03719.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03719_0acae026c7e63eed2245b851c8d32eee934659ca23b9e50786cb323f85625345.jsonl.gz"}, "slow_code": "import functools\nimport os\nimport sys\n\nsys.setrecursionlimit(10000)\nINF = float(\"inf\")\n\n\ndef inp():\n return int(eval(input()))\n\n\ndef inpf():\n return float(eval(input()))\n\n\ndef inps():\n return eval(input())\n\n\ndef inl():\n return list(map(int, input().split()))\n\n\ndef inlf():\n return list(map(float, input().split()))\n\n\ndef inls():\n return input().split()\n\n\ndef inpm(line):\n return [inp() for _ in range(line)]\n\n\ndef inpfm(line):\n return [inpf() for _ in range(line)]\n\n\ndef inpsm(line):\n return [inps() for _ in range(line)]\n\n\ndef inlm(line):\n return [inl() for _ in range(line)]\n\n\ndef inlfm(line):\n return [inlf() for _ in range(line)]\n\n\ndef inlsm(line):\n return [inls() for _ in range(line)]\n\n\ndef Yesif(cond):\n print((\"Yes\" if cond else \"No\"))\n\n\ndef YESIF(cond):\n print((\"YES\" if cond else \"NO\"))\n\n\ndef yesif(cond):\n print((\"yes\" if cond else \"no\"))\n\n\na, b, c = inl()\nYesif(a <= c <= b)\n", "slow_code_sha256": "0acae026c7e63eed2245b851c8d32eee934659ca23b9e50786cb323f85625345", "slow_id": "p03719_0acae026c7e63eed2245b851c8d32eee934659ca23b9e50786cb323f85625345", "speedup": 6.379586201603627, "stratum": "4-8", "within_pair_jaccard": 0.17543859649122806, "workload": {"case_count": 100, "description": "Determine whether C is at least A and at most B. The supplied bounds A and B need not be ordered. Observed inputs: A=-100..100 (median -2.5); B=-100..100 (median -17); C=-100..100 (median -9).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 14, "median": 10.0, "min": 7}, "input_format": ["A B C"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3, "median": 3.0, "min": 3}}} -{"case_ids": ["p02612_case_000", "p02612_case_001", "p02612_case_002", "p02612_case_003", "p02612_case_004", "p02612_case_005", "p02612_case_006", "p02612_case_007", "p02612_case_008", "p02612_case_009", "p02612_case_010", "p02612_case_011", "p02612_case_012", "p02612_case_013", "p02612_case_014", "p02612_case_015", "p02612_case_016", "p02612_case_017", "p02612_case_018", "p02612_case_019", "p02612_case_020", "p02612_case_021", "p02612_case_022", "p02612_case_023", "p02612_case_024", "p02612_case_025", "p02612_case_026", "p02612_case_027", "p02612_case_028", "p02612_case_029", "p02612_case_030", "p02612_case_031", "p02612_case_032", "p02612_case_033", "p02612_case_034", "p02612_case_035", "p02612_case_036", "p02612_case_037", "p02612_case_038", "p02612_case_039", "p02612_case_040", "p02612_case_041", "p02612_case_042", "p02612_case_043", "p02612_case_044", "p02612_case_045", "p02612_case_046", "p02612_case_047", "p02612_case_048", "p02612_case_049", "p02612_case_050", "p02612_case_051", "p02612_case_052", "p02612_case_053", "p02612_case_054", "p02612_case_055", "p02612_case_056", "p02612_case_057", "p02612_case_058", "p02612_case_059", "p02612_case_060", "p02612_case_061", "p02612_case_062", "p02612_case_063", "p02612_case_064", "p02612_case_065", "p02612_case_066", "p02612_case_067", "p02612_case_068", "p02612_case_069", "p02612_case_070", "p02612_case_071", "p02612_case_072", "p02612_case_073", "p02612_case_074", "p02612_case_075", "p02612_case_076", "p02612_case_077", "p02612_case_078", "p02612_case_079", "p02612_case_080", "p02612_case_081", "p02612_case_082", "p02612_case_083", "p02612_case_084", "p02612_case_085", "p02612_case_086", "p02612_case_087", "p02612_case_088", "p02612_case_089", "p02612_case_090", "p02612_case_091", "p02612_case_092", "p02612_case_093", "p02612_case_094", "p02612_case_095", "p02612_case_096", "p02612_case_097", "p02612_case_098", "p02612_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "print((-int(eval(input())) % 1000))\n", "fast_code_sha256": "bf2b25d30147294ff0276ceb1faeae7b06783207fa7b8ca256752e56cdee77d1", "fast_id": "p02612_bf2b25d30147294ff0276ceb1faeae7b06783207fa7b8ca256752e56cdee77d1", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "print((-int(eval(input())) % 1000))\n", "measured_fast_code_sha256": "bf2b25d30147294ff0276ceb1faeae7b06783207fa7b8ca256752e56cdee77d1", "measured_slow_code": "import sys\n\n\ndef Ii():\n return int(sys.stdin.readline())\n\n\ndef Mi():\n return list(map(int, sys.stdin.buffer.readline().split()))\n\n\ndef Li():\n return list(map(int, sys.stdin.buffer.readline().split()))\n\n\nn = Ii()\na = n % 1000\nif a == 0:\n print((0))\nelse:\n print((1000 - a))\n", "measured_slow_code_sha256": "486e81cc66275807ffb489c81f6621446128ea2a8f5f188eb842554d9fce0e45", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.585444425061855, "pair_id": "python_v2_55f6e5b694e087ea1ef6ffa5", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02612", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02612_bf2b25d30147294ff0276ceb1faeae7b06783207fa7b8ca256752e56cdee77d1.jsonl.gz", "inputs": "reproduction/python/inputs/p02612.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02612_486e81cc66275807ffb489c81f6621446128ea2a8f5f188eb842554d9fce0e45.jsonl.gz"}, "slow_code": "import sys\n\n\ndef Ii():\n return int(sys.stdin.readline())\n\n\ndef Mi():\n return list(map(int, sys.stdin.buffer.readline().split()))\n\n\ndef Li():\n return list(map(int, sys.stdin.buffer.readline().split()))\n\n\nn = Ii()\na = n % 1000\nif a == 0:\n print((0))\nelse:\n print((1000 - a))\n", "slow_code_sha256": "486e81cc66275807ffb489c81f6621446128ea2a8f5f188eb842554d9fce0e45", "slow_id": "p02612_486e81cc66275807ffb489c81f6621446128ea2a8f5f188eb842554d9fce0e45", "speedup": 3.575106354356572, "stratum": "2-4", "within_pair_jaccard": 0.13043478260869565, "workload": {"case_count": 100, "description": "Find the change received for a price N when paying with the minimum sufficient number of 1000-unit bills. Observed inputs: N=1..10000 (median 5000.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 6, "median": 5.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p02703_case_000", "p02703_case_001", "p02703_case_002", "p02703_case_003", "p02703_case_004", "p02703_case_005", "p02703_case_006", "p02703_case_007", "p02703_case_008", "p02703_case_009", "p02703_case_010", "p02703_case_011", "p02703_case_012", "p02703_case_013", "p02703_case_014", "p02703_case_015", "p02703_case_016", "p02703_case_017", "p02703_case_018", "p02703_case_019", "p02703_case_020", "p02703_case_021", "p02703_case_022", "p02703_case_023", "p02703_case_024", "p02703_case_025", "p02703_case_026", "p02703_case_027", "p02703_case_028", "p02703_case_029", "p02703_case_030", "p02703_case_031", "p02703_case_032", "p02703_case_033", "p02703_case_034", "p02703_case_035", "p02703_case_036", "p02703_case_037", "p02703_case_038", "p02703_case_039", "p02703_case_040", "p02703_case_041", "p02703_case_042", "p02703_case_043", "p02703_case_044", "p02703_case_045", "p02703_case_046", "p02703_case_047", "p02703_case_048", "p02703_case_049", "p02703_case_050", "p02703_case_051", "p02703_case_052", "p02703_case_053", "p02703_case_054", "p02703_case_055", "p02703_case_056", "p02703_case_057", "p02703_case_058", "p02703_case_059", "p02703_case_060", "p02703_case_061", "p02703_case_062", "p02703_case_063", "p02703_case_064", "p02703_case_065", "p02703_case_066", "p02703_case_067", "p02703_case_068", "p02703_case_069", "p02703_case_070", "p02703_case_071", "p02703_case_072", "p02703_case_073", "p02703_case_074", "p02703_case_075", "p02703_case_076", "p02703_case_077", "p02703_case_078", "p02703_case_079", "p02703_case_080", "p02703_case_081", "p02703_case_082", "p02703_case_083", "p02703_case_084", "p02703_case_085", "p02703_case_086", "p02703_case_087", "p02703_case_088", "p02703_case_089", "p02703_case_090", "p02703_case_091", "p02703_case_092", "p02703_case_093", "p02703_case_094", "p02703_case_095", "p02703_case_096", "p02703_case_097", "p02703_case_098", "p02703_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\nfrom heapq import heapify, heappop, heappush\n\nsr = lambda: sys.stdin.readline().rstrip()\nir = lambda: int(sr())\nlr = lambda: list(map(int, sr().split()))\n\nN, M, S = lr()\nUVAB = [lr() for _ in range(M)]\nCD = [lr() for _ in range(N)]\nAmax = 0\nfor i in range(M):\n a = UVAB[i][2]\n if a > Amax:\n Amax = a\nlimit = Amax * (N - 1)\nS = min(S, limit)\ngraph = [[] for _ in range(N + 1)]\nfor u, v, a, b in UVAB:\n graph[u].append((v, a, b))\n graph[v].append((u, a, b))\n\n\ndef dijkstra(start):\n\n INF = 10**15\n dist = [[INF for _ in range(limit + 1)] for _ in range(N + 1)]\n dist[1][S] = 0\n que = [(0, S, 1)]\n while que:\n time, silver, prev = heappop(que)\n if dist[prev][silver] < time:\n continue\n for next, a, b in graph[prev]:\n t = time + b\n si = silver - a\n if si < 0:\n continue\n if dist[next][si] > t:\n dist[next][si] = t\n heappush(que, (t, si, next))\n c, d = CD[prev - 1]\n si = min(limit, silver + c)\n while dist[prev][si] > time + d:\n dist[prev][si] = time + d\n heappush(que, (time + d, si, prev))\n si += c\n si = min(limit, si)\n time += d\n return dist\n\n\ndist = dijkstra(1)\nfor i in range(2, N + 1):\n d = dist[i]\n answer = min(d)\n print(answer)\n", "fast_code_sha256": "cf5ec513ccd40bda2ee4fef5b71dbbed5c51cb14be7b8ee5383525a868af9741", "fast_id": "p02703_1c37fb7d48386e9b262662027d58efebe6614c7758c45f81971d94d0dfd3df19", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "# coding: utf-8\nimport sys\nfrom heapq import heapify, heappop, heappush\n\nsr = lambda: sys.stdin.readline().rstrip()\nir = lambda: int(sr())\nlr = lambda: list(map(int, sr().split()))\n# 同じ地点で銀貨の枚数によって別の状態として扱う(最大max(A)*(N-1))\nN, M, S = lr()\nUVAB = [lr() for _ in range(M)]\nCD = [lr() for _ in range(N)] # 0-indexed\nAmax = 0\nfor i in range(M):\n a = UVAB[i][2]\n if a > Amax:\n Amax = a\nlimit = Amax * (N - 1)\nS = min(S, limit)\ngraph = [[] for _ in range(N + 1)] # 1-indexed\nfor u, v, a, b in UVAB:\n graph[u].append((v, a, b))\n graph[v].append((u, a, b))\n\n\ndef dijkstra(start):\n # 時間、銀貨の枚数、現在地をqueへ\n INF = 10**15\n dist = [[INF for _ in range(limit + 1)] for _ in range(N + 1)]\n dist[1][S] = 0\n que = [(0, S, 1)]\n while que:\n time, silver, prev = heappop(que)\n if dist[prev][silver] < time:\n continue\n for next, a, b in graph[prev]:\n t = time + b\n si = silver - a\n if si < 0:\n continue\n if dist[next][si] > t:\n dist[next][si] = t\n heappush(que, (t, si, next))\n c, d = CD[prev - 1]\n si = min(limit, silver + c)\n while dist[prev][si] > time + d:\n dist[prev][si] = time + d\n heappush(que, (time + d, si, prev))\n si += c\n si = min(limit, si)\n time += d\n return dist\n\n\ndist = dijkstra(1)\nfor i in range(2, N + 1):\n d = dist[i]\n answer = min(d)\n print(answer)\n# 前解いたものをPyPyで\n", "measured_fast_code_sha256": "1c37fb7d48386e9b262662027d58efebe6614c7758c45f81971d94d0dfd3df19", "measured_slow_code": "import sys\nfrom heapq import heappush, heappop\nimport numpy as np\n\n\ndef input():\n return sys.stdin.readline().rstrip()\n\n\ndef ii():\n return int(input())\n\n\ndef mi():\n return map(int, input().split())\n\n\ndef li():\n return list(mi())\n\n\ndef main():\n def dijkstra(s):\n def push(v, s, x):\n if s < 0:\n return\n if dist[v, s] <= x:\n return\n dist[v, s] = x\n heappush(que, (x, v, s))\n\n inf = 10**18\n dist = np.full((n, MAX_S + 1), inf, dtype=int)\n # time, remain, node\n que = []\n push(0, s, 0)\n while que:\n x, v, s = heappop(que)\n if dist[v, s] < x:\n continue\n ns = min(s + c[v], MAX_S)\n push(v, ns, x + d[v])\n for nv, a, b in adj[v]:\n push(nv, s - a, x + b)\n return np.min(dist, axis=1)\n\n n, m, s = mi()\n adj = [[] for i in range(n)]\n MAX_S = 0\n for i in range(m):\n u, v, a, b = mi()\n u -= 1\n v -= 1\n adj[u].append((v, a, b))\n adj[v].append((u, a, b))\n MAX_S = max(MAX_S, a)\n MAX_S *= n - 1\n s = min(s, MAX_S)\n c, d = [0] * n, [0] * n\n for i in range(n):\n c[i], d[i] = mi()\n ans = dijkstra(s)\n print(*ans[1:], sep=\"\\n\")\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "13ddc35e7eb74d73b0b3c8f42eca38b92bc94e091a7090e12213a091ef6feb16", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.140596514579369, "pair_id": "python_v2_18ff4bc978230d2d085a360f", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02703", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02703_1c37fb7d48386e9b262662027d58efebe6614c7758c45f81971d94d0dfd3df19.jsonl.gz", "inputs": "reproduction/python/inputs/p02703.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02703_13ddc35e7eb74d73b0b3c8f42eca38b92bc94e091a7090e12213a091ef6feb16.jsonl.gz"}, "slow_code": "import sys\nfrom heapq import heappush, heappop\nimport numpy as np\n\n\ndef input():\n return sys.stdin.readline().rstrip()\n\n\ndef ii():\n return int(input())\n\n\ndef mi():\n return map(int, input().split())\n\n\ndef li():\n return list(mi())\n\n\ndef main():\n def dijkstra(s):\n def push(v, s, x):\n if s < 0:\n return\n if dist[v, s] <= x:\n return\n dist[v, s] = x\n heappush(que, (x, v, s))\n\n inf = 10**18\n dist = np.full((n, MAX_S + 1), inf, dtype=int)\n\n que = []\n push(0, s, 0)\n while que:\n x, v, s = heappop(que)\n if dist[v, s] < x:\n continue\n ns = min(s + c[v], MAX_S)\n push(v, ns, x + d[v])\n for nv, a, b in adj[v]:\n push(nv, s - a, x + b)\n return np.min(dist, axis=1)\n\n n, m, s = mi()\n adj = [[] for i in range(n)]\n MAX_S = 0\n for i in range(m):\n u, v, a, b = mi()\n u -= 1\n v -= 1\n adj[u].append((v, a, b))\n adj[v].append((u, a, b))\n MAX_S = max(MAX_S, a)\n MAX_S *= n - 1\n s = min(s, MAX_S)\n c, d = [0] * n, [0] * n\n for i in range(n):\n c[i], d[i] = mi()\n ans = dijkstra(s)\n print(*ans[1:], sep=\"\\n\")\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "8367a3613f4d9a1208ac0ab45c2708eb9c7ae580813c618185432ad6e30b1042", "slow_id": "p02703_13ddc35e7eb74d73b0b3c8f42eca38b92bc94e091a7090e12213a091ef6feb16", "speedup": 6.504947108157921, "stratum": "4-8", "within_pair_jaccard": 0.4157303370786517, "workload": {"case_count": 100, "description": "Find minimum travel time from city 1 to every other city in a connected undirected graph. Start with S silver and 10^100 gold coins. Edge i costs A_i silver and B_i minutes; in city i, each gold exchanges for C_i silver in D_i minutes. Observed inputs: N=2..50 (median 50); M=1..100 (median 100); S=0..1000000000 (median 0); A_i=1..50; B_i=1..1000000000; C_i=1..1000000000; D_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 2839, "median": 1347.5, "min": 31}, "input_format": ["N M S\nU_1 V_1 A_1 B_1\n...\nU_M V_M A_M B_M\nC_1 D_1\n...\nC_N D_N"], "input_format_status": "source_input_section", "input_lines": {"max": 151, "median": 151.0, "min": 4}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 503, "median": 503.0, "min": 11}}} -{"case_ids": ["p03240_case_000", "p03240_case_001", "p03240_case_002", "p03240_case_003", "p03240_case_004", "p03240_case_005", "p03240_case_006", "p03240_case_007", "p03240_case_008", "p03240_case_009", "p03240_case_010", "p03240_case_011", "p03240_case_012", "p03240_case_013", "p03240_case_014", "p03240_case_015", "p03240_case_016", "p03240_case_017", "p03240_case_018", "p03240_case_019", "p03240_case_020", "p03240_case_021", "p03240_case_022", "p03240_case_023", "p03240_case_024", "p03240_case_025", "p03240_case_026", "p03240_case_027", "p03240_case_028", "p03240_case_029", "p03240_case_030", "p03240_case_031", "p03240_case_032", "p03240_case_033", "p03240_case_034", "p03240_case_035", "p03240_case_036", "p03240_case_037", "p03240_case_038", "p03240_case_039", "p03240_case_040", "p03240_case_041", "p03240_case_042", "p03240_case_043", "p03240_case_044", "p03240_case_045", "p03240_case_046", "p03240_case_047", "p03240_case_048", "p03240_case_049", "p03240_case_050", "p03240_case_051", "p03240_case_052", "p03240_case_053", "p03240_case_054", "p03240_case_055", "p03240_case_056", "p03240_case_057", "p03240_case_058", "p03240_case_059", "p03240_case_060", "p03240_case_061", "p03240_case_062", "p03240_case_063", "p03240_case_064", "p03240_case_065", "p03240_case_066", "p03240_case_067", "p03240_case_068", "p03240_case_069", "p03240_case_070", "p03240_case_071", "p03240_case_072", "p03240_case_073", "p03240_case_074", "p03240_case_075", "p03240_case_076", "p03240_case_077", "p03240_case_078", "p03240_case_079", "p03240_case_080", "p03240_case_081", "p03240_case_082", "p03240_case_083", "p03240_case_084", "p03240_case_085", "p03240_case_086", "p03240_case_087", "p03240_case_088", "p03240_case_089", "p03240_case_090", "p03240_case_091", "p03240_case_092", "p03240_case_093", "p03240_case_094", "p03240_case_095", "p03240_case_096", "p03240_case_097", "p03240_case_098", "p03240_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(input())\nXYH = []\nfor _ in range(n):\n x, y, h = map(int, input().split())\n if h != 0:\n XYH.append([x, y, h])\nflag = False\nans = XYH[0]\nfor i in range(101):\n for j in range(101):\n tempH = abs(XYH[0][0] - i) + abs(XYH[0][1] - j) + XYH[0][2]\n for x, y, h in XYH[1:]:\n if abs(x - i) + abs(y - j) + h != tempH:\n flag = False\n break\n else:\n flag = True\n if flag:\n ans = [i, j, tempH]\n break\n if flag:\n break\nprint(*ans, sep=\" \")\n", "fast_code_sha256": "7d152829fabdaf68d6940ede064ea95c3e04f687d89b63c8893ae52fbdbff32d", "fast_id": "p03240_7d152829fabdaf68d6940ede064ea95c3e04f687d89b63c8893ae52fbdbff32d", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(input())\nXYH = []\nfor _ in range(n):\n x, y, h = map(int, input().split())\n if h != 0:\n XYH.append([x, y, h])\nflag = False\nans = XYH[0]\nfor i in range(101):\n for j in range(101):\n tempH = abs(XYH[0][0] - i) + abs(XYH[0][1] - j) + XYH[0][2]\n for x, y, h in XYH[1:]:\n if abs(x - i) + abs(y - j) + h != tempH:\n flag = False\n break\n else:\n flag = True\n if flag:\n ans = [i, j, tempH]\n break\n if flag:\n break\nprint(*ans, sep=\" \")\n", "measured_fast_code_sha256": "7d152829fabdaf68d6940ede064ea95c3e04f687d89b63c8893ae52fbdbff32d", "measured_slow_code": "import math\n\nn = int(eval(input()))\nx = [0 for i in range(n)]\ny = [0 for i in range(n)]\nh = [0 for i in range(n)]\njudge = False\nfor i in range(n):\n x[i], y[i], h[i] = list(map(int, input().split()))\nfor i in range(0, 101):\n for j in range(0, 101):\n for k in range(0, n):\n if h[k] != 0:\n true_h = h[k] + int(math.fabs(x[k] - i)) + int(math.fabs(y[k] - j))\n break\n judge = True\n for k in range(n):\n dum_h = max(true_h - int(math.fabs(x[k] - i)) - int(math.fabs(y[k] - j)), 0)\n if h[k] != dum_h:\n judge = False\n break\n # print(k)\n if judge is True:\n break\n if judge is True:\n break\nprint((\"{} {} {}\".format(i, j, true_h)))\n", "measured_slow_code_sha256": "d8c72961362efaa75706105038ea037d0e693a948d13d5ff911684dd10351521", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.607590658696054, "pair_id": "python_v2_403d23b6f77bd3fa0f30204d", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03240", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03240_7d152829fabdaf68d6940ede064ea95c3e04f687d89b63c8893ae52fbdbff32d.jsonl.gz", "inputs": "reproduction/python/inputs/p03240.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03240_d8c72961362efaa75706105038ea037d0e693a948d13d5ff911684dd10351521.jsonl.gz"}, "slow_code": "import math\n\nn = int(eval(input()))\nx = [0 for i in range(n)]\ny = [0 for i in range(n)]\nh = [0 for i in range(n)]\njudge = False\nfor i in range(n):\n x[i], y[i], h[i] = list(map(int, input().split()))\nfor i in range(0, 101):\n for j in range(0, 101):\n for k in range(0, n):\n if h[k] != 0:\n true_h = h[k] + int(math.fabs(x[k] - i)) + int(math.fabs(y[k] - j))\n break\n judge = True\n for k in range(n):\n dum_h = max(true_h - int(math.fabs(x[k] - i)) - int(math.fabs(y[k] - j)), 0)\n if h[k] != dum_h:\n judge = False\n break\n\n if judge is True:\n break\n if judge is True:\n break\nprint((\"{} {} {}\".format(i, j, true_h)))\n", "slow_code_sha256": "5ef70bc141553c2d6856c41ffb402c1ab6bd08e8ee2dd8d9311cc53181815501", "slow_id": "p03240_d8c72961362efaa75706105038ea037d0e693a948d13d5ff911684dd10351521", "speedup": 2.676118889085976, "stratum": "2-4", "within_pair_jaccard": 0.46511627906976744, "workload": {"case_count": 100, "description": "Recover unique integer center (C_X,C_Y) in 0..100 and height H>=1 from N distinct observations (x_i,y_i,h_i) satisfying h_i=max(H-|x_i-C_X|-|y_i-C_Y|,0). Observed inputs: N=3..100 (median 50); x_i=0..100; y_i=0..100; h_i=1299707..999999997.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1594, "median": 798.0, "min": 49}, "input_format": ["N\nx_1 y_1 h_1\n...\nx_N y_N h_N"], "input_format_status": "source_input_section", "input_lines": {"max": 101, "median": 51.0, "min": 4}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 301, "median": 151.0, "min": 10}}} -{"case_ids": ["p03419_case_000", "p03419_case_001", "p03419_case_002", "p03419_case_003", "p03419_case_004", "p03419_case_005", "p03419_case_006", "p03419_case_007", "p03419_case_008", "p03419_case_009", "p03419_case_010", "p03419_case_011", "p03419_case_012", "p03419_case_013", "p03419_case_014", "p03419_case_015", "p03419_case_016", "p03419_case_017", "p03419_case_018", "p03419_case_019", "p03419_case_020", "p03419_case_021", "p03419_case_022", "p03419_case_023", "p03419_case_024", "p03419_case_025", "p03419_case_026", "p03419_case_027", "p03419_case_028", "p03419_case_029", "p03419_case_030", "p03419_case_031", "p03419_case_032", "p03419_case_033", "p03419_case_034", "p03419_case_035", "p03419_case_036", "p03419_case_037", "p03419_case_038", "p03419_case_039", "p03419_case_040", "p03419_case_041", "p03419_case_042", "p03419_case_043", "p03419_case_044", "p03419_case_045", "p03419_case_046", "p03419_case_047", "p03419_case_048", "p03419_case_049", "p03419_case_050", "p03419_case_051", "p03419_case_052", "p03419_case_053", "p03419_case_054", "p03419_case_055", "p03419_case_056", "p03419_case_057", "p03419_case_058", "p03419_case_059", "p03419_case_060", "p03419_case_061", "p03419_case_062", "p03419_case_063", "p03419_case_064", "p03419_case_065", "p03419_case_066", "p03419_case_067", "p03419_case_068", "p03419_case_069", "p03419_case_070", "p03419_case_071", "p03419_case_072", "p03419_case_073", "p03419_case_074", "p03419_case_075", "p03419_case_076", "p03419_case_077", "p03419_case_078", "p03419_case_079", "p03419_case_080", "p03419_case_081", "p03419_case_082", "p03419_case_083", "p03419_case_084", "p03419_case_085", "p03419_case_086", "p03419_case_087", "p03419_case_088", "p03419_case_089", "p03419_case_090", "p03419_case_091", "p03419_case_092", "p03419_case_093", "p03419_case_094", "p03419_case_095", "p03419_case_096", "p03419_case_097", "p03419_case_098", "p03419_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n, m = [int(x) for x in input().split()]\nprint((abs(n - 2) * abs(m - 2)))\n", "fast_code_sha256": "1fcaa6d8159029177063631e6b35094aadb732bcf87238281e554e973b1a44c2", "fast_id": "p03419_1fcaa6d8159029177063631e6b35094aadb732bcf87238281e554e973b1a44c2", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n, m = [int(x) for x in input().split()]\nprint((abs(n - 2) * abs(m - 2)))\n", "measured_fast_code_sha256": "1fcaa6d8159029177063631e6b35094aadb732bcf87238281e554e973b1a44c2", "measured_slow_code": "def calc0(N, M):\n cell = [[0 for i in range(M)] for j in range(N)]\n for i in range(M):\n for j in range(N):\n for y in range(-1, 2):\n for x in range(-1, 2):\n xx = i + x\n yy = j + y\n if 0 <= xx < M and 0 <= yy < N:\n cell[yy][xx] ^= 1\n r = 0\n for i in range(M):\n for j in range(N):\n if cell[j][i]:\n r += 1\n return r\n\n\ndef calc(N, M):\n if N == 1 and M == 1:\n return 1\n if N >= 2 and M >= 2:\n return (N - 2) * (M - 2)\n if N == 1:\n return M - 2\n return N - 2\n\n\nN, M = [int(_) for _ in input().split()]\nprint((calc(N, M)))\n", "measured_slow_code_sha256": "03759bbd848f3c06ca221a2e3cc07d0592161ce2c92214006d02107382720a3e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4.956254118452957, "pair_id": "python_v2_33b76d622daafa6e6e0a326d", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03419", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03419_1fcaa6d8159029177063631e6b35094aadb732bcf87238281e554e973b1a44c2.jsonl.gz", "inputs": "reproduction/python/inputs/p03419.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03419_03759bbd848f3c06ca221a2e3cc07d0592161ce2c92214006d02107382720a3e.jsonl.gz"}, "slow_code": "def calc0(N, M):\n cell = [[0 for i in range(M)] for j in range(N)]\n for i in range(M):\n for j in range(N):\n for y in range(-1, 2):\n for x in range(-1, 2):\n xx = i + x\n yy = j + y\n if 0 <= xx < M and 0 <= yy < N:\n cell[yy][xx] ^= 1\n r = 0\n for i in range(M):\n for j in range(N):\n if cell[j][i]:\n r += 1\n return r\n\n\ndef calc(N, M):\n if N == 1 and M == 1:\n return 1\n if N >= 2 and M >= 2:\n return (N - 2) * (M - 2)\n if N == 1:\n return M - 2\n return N - 2\n\n\nN, M = [int(_) for _ in input().split()]\nprint((calc(N, M)))\n", "slow_code_sha256": "03759bbd848f3c06ca221a2e3cc07d0592161ce2c92214006d02107382720a3e", "slow_id": "p03419_03759bbd848f3c06ca221a2e3cc07d0592161ce2c92214006d02107382720a3e", "speedup": 4.958710519474387, "stratum": "4-8", "within_pair_jaccard": 0.26666666666666666, "workload": {"case_count": 100, "description": "An implicit N-by-M rectangle has one face-up card per cell. Once per cell, flip its own card and each of its eight neighboring cards that exists. Count face-down cards after all operations. Observed inputs: N=1..1000000000 (median 411600306.5); M=1..1000000000 (median 380900118.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 22, "median": 18.5, "min": 4}, "input_format": ["N M"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p03112_case_000", "p03112_case_001", "p03112_case_002", "p03112_case_003", "p03112_case_004", "p03112_case_005", "p03112_case_006", "p03112_case_007", "p03112_case_008", "p03112_case_009", "p03112_case_010", "p03112_case_011", "p03112_case_012", "p03112_case_013", "p03112_case_014", "p03112_case_015", "p03112_case_016", "p03112_case_017", "p03112_case_018", "p03112_case_019", "p03112_case_020", "p03112_case_021", "p03112_case_022", "p03112_case_023", "p03112_case_024", "p03112_case_025", "p03112_case_026", "p03112_case_027", "p03112_case_028", "p03112_case_029", "p03112_case_030", "p03112_case_031", "p03112_case_032", "p03112_case_033", "p03112_case_034", "p03112_case_035", "p03112_case_036", "p03112_case_037", "p03112_case_038", "p03112_case_039", "p03112_case_040", "p03112_case_041", "p03112_case_042", "p03112_case_043", "p03112_case_044", "p03112_case_045", "p03112_case_046", "p03112_case_047", "p03112_case_048", "p03112_case_049", "p03112_case_050", "p03112_case_051", "p03112_case_052", "p03112_case_053", "p03112_case_054", "p03112_case_055", "p03112_case_056", "p03112_case_057", "p03112_case_058", "p03112_case_059", "p03112_case_060", "p03112_case_061", "p03112_case_062", "p03112_case_063", "p03112_case_064", "p03112_case_065", "p03112_case_066", "p03112_case_067", "p03112_case_068", "p03112_case_069", "p03112_case_070", "p03112_case_071", "p03112_case_072", "p03112_case_073", "p03112_case_074", "p03112_case_075", "p03112_case_076", "p03112_case_077", "p03112_case_078", "p03112_case_079", "p03112_case_080", "p03112_case_081", "p03112_case_082", "p03112_case_083", "p03112_case_084", "p03112_case_085", "p03112_case_086", "p03112_case_087", "p03112_case_088", "p03112_case_089", "p03112_case_090", "p03112_case_091", "p03112_case_092", "p03112_case_093", "p03112_case_094", "p03112_case_095", "p03112_case_096", "p03112_case_097", "p03112_case_098", "p03112_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "executable_AST_equal_except_explicit_explanatory_string_removal_and_all_frozen_inputs_checker_pass", "fast_code": "import sys\nimport bisect\n\n\nINF = float(\"inf\")\nMOD = 10**9 + 7\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef LI_():\n return [int(x) - 1 for x in sys.stdin.readline().split()]\n\n\ndef LS():\n return sys.stdin.readline().split()\n\n\ndef II():\n return int(sys.stdin.readline())\n\n\ndef SI():\n return eval(input())\n\n\na, b, q = LI()\nA = [-INF] + [II() for _ in range(a)] + [INF]\nB = [-INF] + [II() for _ in range(b)] + [INF]\nfor _ in range(q):\n x = II()\n ans = INF\n x_a = bisect.bisect_left(A, x)\n for k in [-1, 0]:\n tmp = abs(x - A[x_a + k])\n x_b = bisect.bisect_left(B, A[x_a + k])\n tmp += min(abs(B[x_b] - A[x_a + k]), abs(B[x_b - 1] - A[x_a + k]))\n ans = min(ans, tmp)\n x_b = bisect.bisect_left(B, x)\n for k in [-1, 0]:\n tmp = abs(x - B[x_b + k])\n x_a = bisect.bisect_left(A, B[x_b + k])\n tmp += min(abs(A[x_a] - B[x_b + k]), abs(A[x_a - 1] - B[x_b + k]))\n ans = min(ans, tmp)\n print(ans)\n", "fast_code_sha256": "61b8c4b23d7359fc0446fb71c3280bcc1042a632541fed8cfd8a4dc1a939e336", "fast_id": "p03112_b1e896ab7e9e0452f80ac48c8fab9792e0ab08ad5276de541dafadd4501abb98", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "# coding:utf-8\nimport sys\nimport bisect\n\n# from collections import Counter, defaultdict\nINF = float(\"inf\")\nMOD = 10**9 + 7\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef LI_():\n return [int(x) - 1 for x in sys.stdin.readline().split()]\n\n\ndef LS():\n return sys.stdin.readline().split()\n\n\ndef II():\n return int(sys.stdin.readline())\n\n\ndef SI():\n return eval(input())\n\n\na, b, q = LI()\nA = [-INF] + [II() for _ in range(a)] + [INF]\nB = [-INF] + [II() for _ in range(b)] + [INF]\nfor _ in range(q):\n x = II()\n ans = INF\n x_a = bisect.bisect_left(A, x)\n for k in [-1, 0]:\n tmp = abs(x - A[x_a + k])\n x_b = bisect.bisect_left(B, A[x_a + k])\n tmp += min(abs(B[x_b] - A[x_a + k]), abs(B[x_b - 1] - A[x_a + k]))\n ans = min(ans, tmp)\n x_b = bisect.bisect_left(B, x)\n for k in [-1, 0]:\n tmp = abs(x - B[x_b + k])\n x_a = bisect.bisect_left(A, B[x_b + k])\n tmp += min(abs(A[x_a] - B[x_b + k]), abs(A[x_a - 1] - B[x_b + k]))\n ans = min(ans, tmp)\n print(ans)\n", "measured_fast_code_sha256": "b1e896ab7e9e0452f80ac48c8fab9792e0ab08ad5276de541dafadd4501abb98", "measured_slow_code": "# -*- coding: utf-8 -*-\n\"\"\"\n参考:https://img.atcoder.jp/abc119/editorial.pdf\n・前計算しないで直接やる版\n・INFがfloat('inf')だとダメで10**18にしたらいけた。INF-INFがnanになるからだった。\n・上記を考慮して修正版\n\"\"\"\nimport sys, re\nfrom collections import deque, defaultdict, Counter\nfrom math import sqrt, hypot, factorial, pi, sin, cos, radians, log10\n\nif sys.version_info.minor >= 5:\n from math import gcd\nelse:\n from fractions import gcd\nfrom heapq import heappop, heappush, heapify, heappushpop\nfrom bisect import bisect_left, bisect_right\nfrom itertools import permutations, combinations, product, accumulate\nfrom operator import itemgetter, mul, xor\nfrom copy import copy, deepcopy\nfrom functools import reduce, partial\nfrom fractions import Fraction\nfrom string import ascii_lowercase, ascii_uppercase, digits\nfrom datetime import date\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef list2d(a, b, c):\n return [[c] * b for i in range(a)]\n\n\ndef list3d(a, b, c, d):\n return [[[d] * c for j in range(b)] for i in range(a)]\n\n\ndef ceil(x, y=1):\n return int(-(-x // y))\n\n\ndef round(x):\n return int((x * 2 + 1) // 2)\n\n\ndef fermat(x, y, MOD):\n return x * pow(y, MOD - 2, MOD) % MOD\n\n\ndef lcm(x, y):\n return (x * y) // gcd(x, y)\n\n\ndef lcm_list(nums):\n return reduce(lcm, nums, 1)\n\n\ndef gcd_list(nums):\n return reduce(gcd, nums, nums[0])\n\n\ndef INT():\n return int(eval(input()))\n\n\ndef MAP():\n return list(map(int, input().split()))\n\n\ndef LIST():\n return list(map(int, input().split()))\n\n\ndef Yes():\n print(\"Yes\")\n\n\ndef No():\n print(\"No\")\n\n\ndef YES():\n print(\"YES\")\n\n\ndef NO():\n print(\"NO\")\n\n\nsys.setrecursionlimit(10**9)\nINF = float(\"inf\")\nMOD = 10**9 + 7\nA, B, Q = MAP()\nS = [-INF] * (A + 2)\nfor i in range(A):\n S[i + 1] = INT()\nT = [-INF] * (B + 2)\nfor i in range(B):\n T[i + 1] = INT()\nS[-1] = T[-1] = INF\nfor i in range(Q):\n dist1 = dist2 = dist3 = dist4 = INF\n x = INT()\n # 地点xから左に一番近い神社\n idx1 = bisect_right(S, x) - 1\n # 右に一番近い神社\n idx2 = bisect_left(S, x)\n idx3 = bisect_right(T, x) - 1\n idx4 = bisect_left(T, x)\n # idx1番目の神社に行く\n dist1 = x - S[idx1]\n # idx1番目の神社から、xから右か左に一番近かった寺に行く\n if dist1 != INF:\n dist1 += min(abs(S[idx1] - T[idx3]), abs(S[idx1] - T[idx4]))\n dist2 = S[idx2] - x\n if dist2 != INF:\n dist2 += min(abs(S[idx2] - T[idx3]), abs(S[idx2] - T[idx4]))\n dist3 = x - T[idx3]\n if dist3 != INF:\n dist3 += min(abs(T[idx3] - S[idx1]), abs(T[idx3] - S[idx2]))\n dist4 = T[idx4] - x\n if dist4 != INF:\n dist4 += min(abs(T[idx4] - S[idx1]), abs(T[idx4] - S[idx2]))\n print((min(dist1, dist2, dist3, dist4)))\n", "measured_slow_code_sha256": "075f3d0646b6b85cb5ae32f4ea2d0d59acf39147bd9650aafe37dade27ea98fa", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.177150456051137, "pair_id": "python_v2_902838c1fe7952a6810c1b80", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03112", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03112_b1e896ab7e9e0452f80ac48c8fab9792e0ab08ad5276de541dafadd4501abb98.jsonl.gz", "inputs": "reproduction/python/inputs/p03112.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03112_075f3d0646b6b85cb5ae32f4ea2d0d59acf39147bd9650aafe37dade27ea98fa.jsonl.gz"}, "slow_code": "import sys, re\nfrom collections import deque, defaultdict, Counter\nfrom math import sqrt, hypot, factorial, pi, sin, cos, radians, log10\n\nif sys.version_info.minor >= 5:\n from math import gcd\nelse:\n from fractions import gcd\nfrom heapq import heappop, heappush, heapify, heappushpop\nfrom bisect import bisect_left, bisect_right\nfrom itertools import permutations, combinations, product, accumulate\nfrom operator import itemgetter, mul, xor\nfrom copy import copy, deepcopy\nfrom functools import reduce, partial\nfrom fractions import Fraction\nfrom string import ascii_lowercase, ascii_uppercase, digits\nfrom datetime import date\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef list2d(a, b, c):\n return [[c] * b for i in range(a)]\n\n\ndef list3d(a, b, c, d):\n return [[[d] * c for j in range(b)] for i in range(a)]\n\n\ndef ceil(x, y=1):\n return int(-(-x // y))\n\n\ndef round(x):\n return int((x * 2 + 1) // 2)\n\n\ndef fermat(x, y, MOD):\n return x * pow(y, MOD - 2, MOD) % MOD\n\n\ndef lcm(x, y):\n return (x * y) // gcd(x, y)\n\n\ndef lcm_list(nums):\n return reduce(lcm, nums, 1)\n\n\ndef gcd_list(nums):\n return reduce(gcd, nums, nums[0])\n\n\ndef INT():\n return int(eval(input()))\n\n\ndef MAP():\n return list(map(int, input().split()))\n\n\ndef LIST():\n return list(map(int, input().split()))\n\n\ndef Yes():\n print(\"Yes\")\n\n\ndef No():\n print(\"No\")\n\n\ndef YES():\n print(\"YES\")\n\n\ndef NO():\n print(\"NO\")\n\n\nsys.setrecursionlimit(10**9)\nINF = float(\"inf\")\nMOD = 10**9 + 7\nA, B, Q = MAP()\nS = [-INF] * (A + 2)\nfor i in range(A):\n S[i + 1] = INT()\nT = [-INF] * (B + 2)\nfor i in range(B):\n T[i + 1] = INT()\nS[-1] = T[-1] = INF\nfor i in range(Q):\n dist1 = dist2 = dist3 = dist4 = INF\n x = INT()\n\n idx1 = bisect_right(S, x) - 1\n\n idx2 = bisect_left(S, x)\n idx3 = bisect_right(T, x) - 1\n idx4 = bisect_left(T, x)\n\n dist1 = x - S[idx1]\n\n if dist1 != INF:\n dist1 += min(abs(S[idx1] - T[idx3]), abs(S[idx1] - T[idx4]))\n dist2 = S[idx2] - x\n if dist2 != INF:\n dist2 += min(abs(S[idx2] - T[idx3]), abs(S[idx2] - T[idx4]))\n dist3 = x - T[idx3]\n if dist3 != INF:\n dist3 += min(abs(T[idx3] - S[idx1]), abs(T[idx3] - S[idx2]))\n dist4 = T[idx4] - x\n if dist4 != INF:\n dist4 += min(abs(T[idx4] - S[idx1]), abs(T[idx4] - S[idx2]))\n print((min(dist1, dist2, dist3, dist4)))\n", "slow_code_sha256": "77daaa725f47eb183a0e25b50b7e6255b814e50d5067b476fe004c62248fd0dc", "slow_id": "p03112_075f3d0646b6b85cb5ae32f4ea2d0d59acf39147bd9650aafe37dade27ea98fa", "speedup": 3.5168862859239103, "stratum": "2-4", "within_pair_jaccard": 0.2302158273381295, "workload": {"case_count": 100, "description": "For each starting coordinate x_i on a line, minimize travel distance needed to visit at least one shrine s_j and one temple t_j in any order. Shrine and temple lists are strictly increasing; all shrine, temple and query coordinates are distinct. Observed inputs: A=1..100000 (median 1000); B=1..100000 (median 1000); Q=1..100000 (median 1000); s_i=1..9999998614; t_i=10814..10000000000; x_i=1631..9999995619.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 3267071, "median": 267821.5, "min": 31}, "input_format": ["A B Q\ns_1\n...\ns_A\nt_1\n...\nt_B\nx_1\n...\nx_Q"], "input_format_status": "source_input_section", "input_lines": {"max": 300001, "median": 30001.0, "min": 4}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 300003, "median": 30003.0, "min": 6}}} -{"case_ids": ["p03136_case_000", "p03136_case_001", "p03136_case_002", "p03136_case_003", "p03136_case_004", "p03136_case_005", "p03136_case_006", "p03136_case_007", "p03136_case_008", "p03136_case_009", "p03136_case_010", "p03136_case_011", "p03136_case_012", "p03136_case_013", "p03136_case_014", "p03136_case_015", "p03136_case_016", "p03136_case_017", "p03136_case_018", "p03136_case_019", "p03136_case_020", "p03136_case_021", "p03136_case_022", "p03136_case_023", "p03136_case_024", "p03136_case_025", "p03136_case_026", "p03136_case_027", "p03136_case_028", "p03136_case_029", "p03136_case_030", "p03136_case_031", "p03136_case_032", "p03136_case_033", "p03136_case_034", "p03136_case_035", "p03136_case_036", "p03136_case_037", "p03136_case_038", "p03136_case_039", "p03136_case_040", "p03136_case_041", "p03136_case_042", "p03136_case_043", "p03136_case_044", "p03136_case_045", "p03136_case_046", "p03136_case_047", "p03136_case_048", "p03136_case_049", "p03136_case_050", "p03136_case_051", "p03136_case_052", "p03136_case_053", "p03136_case_054", "p03136_case_055", "p03136_case_056", "p03136_case_057", "p03136_case_058", "p03136_case_059", "p03136_case_060", "p03136_case_061", "p03136_case_062", "p03136_case_063", "p03136_case_064", "p03136_case_065", "p03136_case_066", "p03136_case_067", "p03136_case_068", "p03136_case_069", "p03136_case_070", "p03136_case_071", "p03136_case_072", "p03136_case_073", "p03136_case_074", "p03136_case_075", "p03136_case_076", "p03136_case_077", "p03136_case_078", "p03136_case_079", "p03136_case_080", "p03136_case_081", "p03136_case_082", "p03136_case_083", "p03136_case_084", "p03136_case_085", "p03136_case_086", "p03136_case_087", "p03136_case_088", "p03136_case_089", "p03136_case_090", "p03136_case_091", "p03136_case_092", "p03136_case_093", "p03136_case_094", "p03136_case_095", "p03136_case_096", "p03136_case_097", "p03136_case_098", "p03136_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from collections import Counter\n\n\ndef inputlist():\n return [int(j) for j in input().split()]\n\n\nN = int(eval(input()))\nL = inputlist()\nL.sort()\ns = 0\nfor i in range(N - 1):\n s += L[i]\nif s > L[-1]:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "fast_code_sha256": "500da897d6884a4a46e1a3a21d125c24375248a0c05deb82db041abc5ed41dfe", "fast_id": "p03136_8ca6165063a3afd29fb5c8aa3aeb866b35552c9bef692d474dd89fd8e20642b7", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "# template\nfrom collections import Counter\n\n\ndef inputlist():\n return [int(j) for j in input().split()]\n\n\n# template\nN = int(eval(input()))\nL = inputlist()\nL.sort()\ns = 0\nfor i in range(N - 1):\n s += L[i]\nif s > L[-1]:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "measured_fast_code_sha256": "8ca6165063a3afd29fb5c8aa3aeb866b35552c9bef692d474dd89fd8e20642b7", "measured_slow_code": "def examA():\n T, X = LI()\n ans = T / X\n print(ans)\n return\n\n\ndef examB():\n N = I()\n L = LI()\n ans = \"Yes\"\n if max(L) * 2 >= sum(L):\n ans = \"No\"\n print(ans)\n return\n\n\nimport sys, copy, bisect, itertools, heapq, math\nfrom heapq import heappop, heappush, heapify\nfrom collections import Counter, defaultdict, deque\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\ndef LSI():\n return list(map(str, sys.stdin.readline().split()))\n\n\ndef LS():\n return sys.stdin.readline().split()\n\n\ndef SI():\n return sys.stdin.readline().strip()\n\n\nmod = 10**9 + 7\ninf = float(\"inf\")\nif __name__ == \"__main__\":\n examB()\n", "measured_slow_code_sha256": "4be873c382d7f88cc1e36527ba71e39cb04cebba58534d56f1501f183fdfdcbd", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 6.710531648532644, "pair_id": "python_v2_b321f8109a92ff60e781446c", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03136", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03136_8ca6165063a3afd29fb5c8aa3aeb866b35552c9bef692d474dd89fd8e20642b7.jsonl.gz", "inputs": "reproduction/python/inputs/p03136.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03136_4be873c382d7f88cc1e36527ba71e39cb04cebba58534d56f1501f183fdfdcbd.jsonl.gz"}, "slow_code": "def examA():\n T, X = LI()\n ans = T / X\n print(ans)\n return\n\n\ndef examB():\n N = I()\n L = LI()\n ans = \"Yes\"\n if max(L) * 2 >= sum(L):\n ans = \"No\"\n print(ans)\n return\n\n\nimport sys, copy, bisect, itertools, heapq, math\nfrom heapq import heappop, heappush, heapify\nfrom collections import Counter, defaultdict, deque\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\ndef LSI():\n return list(map(str, sys.stdin.readline().split()))\n\n\ndef LS():\n return sys.stdin.readline().split()\n\n\ndef SI():\n return sys.stdin.readline().strip()\n\n\nmod = 10**9 + 7\ninf = float(\"inf\")\nif __name__ == \"__main__\":\n examB()\n", "slow_code_sha256": "4be873c382d7f88cc1e36527ba71e39cb04cebba58534d56f1501f183fdfdcbd", "slow_id": "p03136_4be873c382d7f88cc1e36527ba71e39cb04cebba58534d56f1501f183fdfdcbd", "speedup": 6.7069421669856455, "stratum": "4-8", "within_pair_jaccard": 0.2153846153846154, "workload": {"case_count": 100, "description": "Determine whether N supplied positive side lengths L_i can form a nondegenerate polygon in the plane; convexity is not required. Observed inputs: N=3..10 (median 6); L_i=1..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 43, "median": 17.0, "min": 8}, "input_format": ["N\nL_1 ... L_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 11, "median": 7.0, "min": 4}}} -{"case_ids": ["p03061_case_000", "p03061_case_001", "p03061_case_002", "p03061_case_003", "p03061_case_004", "p03061_case_005", "p03061_case_006", "p03061_case_007", "p03061_case_008", "p03061_case_009", "p03061_case_010", "p03061_case_011", "p03061_case_012", "p03061_case_013", "p03061_case_014", "p03061_case_015", "p03061_case_016", "p03061_case_017", "p03061_case_018", "p03061_case_019", "p03061_case_020", "p03061_case_021", "p03061_case_022", "p03061_case_023", "p03061_case_024", "p03061_case_025", "p03061_case_026", "p03061_case_027", "p03061_case_028", "p03061_case_029", "p03061_case_030", "p03061_case_031", "p03061_case_032", "p03061_case_033", "p03061_case_034", "p03061_case_035", "p03061_case_036", "p03061_case_037", "p03061_case_038", "p03061_case_039", "p03061_case_040", "p03061_case_041", "p03061_case_042", "p03061_case_043", "p03061_case_044", "p03061_case_045", "p03061_case_046", "p03061_case_047", "p03061_case_048", "p03061_case_049", "p03061_case_050", "p03061_case_051", "p03061_case_052", "p03061_case_053", "p03061_case_054", "p03061_case_055", "p03061_case_056", "p03061_case_057", "p03061_case_058", "p03061_case_059", "p03061_case_060", "p03061_case_061", "p03061_case_062", "p03061_case_063", "p03061_case_064", "p03061_case_065", "p03061_case_066", "p03061_case_067", "p03061_case_068", "p03061_case_069", "p03061_case_070", "p03061_case_071", "p03061_case_072", "p03061_case_073", "p03061_case_074", "p03061_case_075", "p03061_case_076", "p03061_case_077", "p03061_case_078", "p03061_case_079", "p03061_case_080", "p03061_case_081", "p03061_case_082", "p03061_case_083", "p03061_case_084", "p03061_case_085", "p03061_case_086", "p03061_case_087", "p03061_case_088", "p03061_case_089", "p03061_case_090", "p03061_case_091", "p03061_case_092", "p03061_case_093", "p03061_case_094", "p03061_case_095", "p03061_case_096", "p03061_case_097", "p03061_case_098", "p03061_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def gcd(x, y):\n if x < y:\n x, y = y, x\n if y == 0:\n return x\n return gcd(y, x % y)\n\n\nN = int(eval(input()))\nA = list(map(int, input().split()))\nL = [0]\nR = [0]\nM = []\nfor i in range(N):\n L.append(gcd(L[i], A[i]))\n R.append(gcd(R[i], A[N - i - 1]))\nR.reverse()\nprint((max([gcd(L[i], R[i + 1]) for i in range(N)])))\n", "fast_code_sha256": "a552d955fedb17d592f4edfa234441419df0bf3a474e8a60c93bef78c28feca1", "fast_id": "p03061_a552d955fedb17d592f4edfa234441419df0bf3a474e8a60c93bef78c28feca1", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def gcd(x, y):\n if x < y:\n x, y = y, x\n if y == 0:\n return x\n return gcd(y, x % y)\n\n\nN = int(eval(input()))\nA = list(map(int, input().split()))\nL = [0]\nR = [0]\nM = []\nfor i in range(N):\n L.append(gcd(L[i], A[i]))\n R.append(gcd(R[i], A[N - i - 1]))\nR.reverse()\nprint((max([gcd(L[i], R[i + 1]) for i in range(N)])))\n", "measured_fast_code_sha256": "a552d955fedb17d592f4edfa234441419df0bf3a474e8a60c93bef78c28feca1", "measured_slow_code": "def gcdf(a):\n a.sort()\n a0 = a[0]\n a = [int(x % a0) for x in a if x % a0 != 0]\n if len(a) == 0:\n return a0\n else:\n a.append(a0)\n a0 = min(a)\n return gcdf(a)\n\n\nn = int(eval(input()))\na = list(map(int, input().split()))\nif n == 2:\n print((max(a)))\nelif n < 2**8:\n gcdv = 0\n for i in range(n):\n acpy = list(a)\n del acpy[i]\n gcdx = gcdf(acpy)\n if gcdx > gcdv:\n gcdv = gcdx\n print(gcdv)\nelse:\n m = int(n / 100)\n ns = int(n / m)\n rgcd = []\n for mi in range(m):\n ms = ns * mi\n if mi == m - 1:\n am = a[ms:n]\n else:\n am = a[ms : ms + ns]\n gcdm = gcdf(am)\n rgcd.append(gcdm)\n gcdv = 0\n for mi in range(m):\n rgcd1 = list(rgcd)\n del rgcd1[mi]\n gcdrg1 = gcdf(rgcd1)\n ms = ns * mi\n if mi == m - 1:\n am = a[ms:n]\n else:\n am = a[ms : ms + ns]\n # print(mi,gcdf(am),len(am),gcdf(rgcd1))\n for i in range(len(am)):\n acpy = list(am)\n # del acpy[i]\n # acpy.append(gcdrg1)\n acpy[i] = gcdrg1\n gcdx = gcdf(acpy)\n if gcdx > gcdv:\n gcdv = gcdx\n print(gcdv)\n", "measured_slow_code_sha256": "2d1ac3c9fc00324fbe7020d274a3ccaef85c4cb391d9f2865533fe63f653f25e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 5.034293209771141, "pair_id": "python_v2_aa6a8841d12a179805ff3207", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03061", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03061_a552d955fedb17d592f4edfa234441419df0bf3a474e8a60c93bef78c28feca1.jsonl.gz", "inputs": "reproduction/python/inputs/p03061.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03061_2d1ac3c9fc00324fbe7020d274a3ccaef85c4cb391d9f2865533fe63f653f25e.jsonl.gz"}, "slow_code": "def gcdf(a):\n a.sort()\n a0 = a[0]\n a = [int(x % a0) for x in a if x % a0 != 0]\n if len(a) == 0:\n return a0\n else:\n a.append(a0)\n a0 = min(a)\n return gcdf(a)\n\n\nn = int(eval(input()))\na = list(map(int, input().split()))\nif n == 2:\n print((max(a)))\nelif n < 2**8:\n gcdv = 0\n for i in range(n):\n acpy = list(a)\n del acpy[i]\n gcdx = gcdf(acpy)\n if gcdx > gcdv:\n gcdv = gcdx\n print(gcdv)\nelse:\n m = int(n / 100)\n ns = int(n / m)\n rgcd = []\n for mi in range(m):\n ms = ns * mi\n if mi == m - 1:\n am = a[ms:n]\n else:\n am = a[ms : ms + ns]\n gcdm = gcdf(am)\n rgcd.append(gcdm)\n gcdv = 0\n for mi in range(m):\n rgcd1 = list(rgcd)\n del rgcd1[mi]\n gcdrg1 = gcdf(rgcd1)\n ms = ns * mi\n if mi == m - 1:\n am = a[ms:n]\n else:\n am = a[ms : ms + ns]\n\n for i in range(len(am)):\n acpy = list(am)\n\n acpy[i] = gcdrg1\n gcdx = gcdf(acpy)\n if gcdx > gcdv:\n gcdv = gcdx\n print(gcdv)\n", "slow_code_sha256": "fb07db8e5e4b2567dc3a88a66ec68ddc15c21275b763c8b6a73c40b8a66faae8", "slow_id": "p03061_2d1ac3c9fc00324fbe7020d274a3ccaef85c4cb391d9f2865533fe63f653f25e", "speedup": 4.160826163882304, "stratum": "4-8", "within_pair_jaccard": 0.36538461538461536, "workload": {"case_count": 100, "description": "Replace exactly one of N positive array entries by any integer in 1..1000000000, possibly leaving it unchanged. Maximize the greatest common divisor of the resulting array. Observed inputs: N=2..100000 (median 1000); A_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1000007, "median": 10005.0, "min": 20}, "input_format": ["N\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100001, "median": 1001.0, "min": 3}}} -{"case_ids": ["p02793_case_000", "p02793_case_001", "p02793_case_002", "p02793_case_003", "p02793_case_004", "p02793_case_005", "p02793_case_006", "p02793_case_007", "p02793_case_008", "p02793_case_009", "p02793_case_010", "p02793_case_011", "p02793_case_012", "p02793_case_013", "p02793_case_014", "p02793_case_015", "p02793_case_016", "p02793_case_017", "p02793_case_018", "p02793_case_019", "p02793_case_020", "p02793_case_021", "p02793_case_022", "p02793_case_023", "p02793_case_024", "p02793_case_025", "p02793_case_026", "p02793_case_027", "p02793_case_028", "p02793_case_029", "p02793_case_030", "p02793_case_031", "p02793_case_032", "p02793_case_033", "p02793_case_034", "p02793_case_035", "p02793_case_036", "p02793_case_037", "p02793_case_038", "p02793_case_039", "p02793_case_040", "p02793_case_041", "p02793_case_042", "p02793_case_043", "p02793_case_044", "p02793_case_045", "p02793_case_046", "p02793_case_047", "p02793_case_048", "p02793_case_049", "p02793_case_050", "p02793_case_051", "p02793_case_052", "p02793_case_053", "p02793_case_054", "p02793_case_055", "p02793_case_056", "p02793_case_057", "p02793_case_058", "p02793_case_059", "p02793_case_060", "p02793_case_061", "p02793_case_062", "p02793_case_063", "p02793_case_064", "p02793_case_065", "p02793_case_066", "p02793_case_067", "p02793_case_068", "p02793_case_069", "p02793_case_070", "p02793_case_071", "p02793_case_072", "p02793_case_073", "p02793_case_074", "p02793_case_075", "p02793_case_076", "p02793_case_077", "p02793_case_078", "p02793_case_079", "p02793_case_080", "p02793_case_081", "p02793_case_082", "p02793_case_083", "p02793_case_084", "p02793_case_085", "p02793_case_086", "p02793_case_087", "p02793_case_088", "p02793_case_089", "p02793_case_090", "p02793_case_091", "p02793_case_092", "p02793_case_093", "p02793_case_094", "p02793_case_095", "p02793_case_096", "p02793_case_097", "p02793_case_098", "p02793_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from functools import reduce\n\n\nMOD = 10**9 + 7\n\n\ndef gcd(a, b):\n while b:\n a, b = b, a % b\n return a\n\n\ndef lcm(x, y):\n return (x * y) // gcd(x, y)\n\n\ndef gcd_list(numbers):\n return reduce(gcd, numbers)\n\n\ndef lcm_list(numbers):\n return reduce(lcm, numbers)\n\n\nn = int(eval(input()))\na = list(map(int, input().split()))\nlcm_ = lcm_list(a)\nb = list([lcm_ // x for x in a])\nans = 0\nfor i in range(len(b)):\n ans += b[i]\nprint((ans % MOD))\n", "fast_code_sha256": "8055a8166993e0d218b2760f0eca2255ebf5ef59a057bdd9b22159c4b26c14e6", "fast_id": "p02793_96b6accdd2ff84453098d0dc3b1176cc08591c7f8921bb69f76b7a10c36966f2", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from functools import reduce\n\n# python > pypy\nMOD = 10**9 + 7\n\n\ndef gcd(a, b):\n while b:\n a, b = b, a % b\n return a\n\n\ndef lcm(x, y):\n return (x * y) // gcd(x, y)\n\n\ndef gcd_list(numbers):\n return reduce(gcd, numbers)\n\n\ndef lcm_list(numbers):\n return reduce(lcm, numbers)\n\n\nn = int(eval(input()))\na = list(map(int, input().split()))\nlcm_ = lcm_list(a)\nb = list([lcm_ // x for x in a])\nans = 0\nfor i in range(len(b)):\n ans += b[i]\nprint((ans % MOD))\n", "measured_fast_code_sha256": "96b6accdd2ff84453098d0dc3b1176cc08591c7f8921bb69f76b7a10c36966f2", "measured_slow_code": "class PrimeOptimizer:\n def __init__(self, MAX_NUM=10**3):\n is_prime = [True] * MAX_NUM\n is_prime[0] = False\n is_prime[1] = False\n primes = []\n for i in range(MAX_NUM):\n if is_prime[i]:\n primes.append(i)\n for j in range(2 * i, MAX_NUM, i):\n is_prime[j] = False\n self.primes = primes\n\n def prime_factorization(self, x):\n res = {}\n for prime in self.primes:\n while x % prime == 0:\n if not prime in res:\n res[prime] = 0\n res[prime] += 1\n x //= prime\n if x > 1:\n res[x] = 1\n return res\n\n\nMOD = 10**9 + 7\n\n\ndef mod_pow(p, q):\n res = 1\n while q:\n if q & 1:\n res = (res * p) % MOD\n p = (p * p) % MOD\n q //= 2\n return res\n\n\ndef mod_inv(p):\n return mod_pow(p, MOD - 2)\n\n\ndef solve(n, a):\n primeOpt = PrimeOptimizer()\n D = {}\n for i in range(n):\n prime_num_mapping = primeOpt.prime_factorization(a[i])\n for prime, num in list(prime_num_mapping.items()):\n if not prime in D:\n D[prime] = 0\n D[prime] = max(D[prime], num)\n L = 1\n for prime, num in list(D.items()):\n L = (L * mod_pow(prime, num)) % MOD\n res = sum([L * mod_inv(x) % MOD for x in a])\n return res % MOD\n\n\nN = int(eval(input()))\nA = list(map(int, input().split()))\nprint((solve(N, A)))\n", "measured_slow_code_sha256": "66d145443a372a5a43407dc9cf71d71447bec89f203c9422197e66c8dd97343d", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 5.606596650708267, "pair_id": "python_v2_1b65ca814dd9fcb4fa707849", "per_case_slow_code_faster_fraction": 0.01, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02793", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02793_96b6accdd2ff84453098d0dc3b1176cc08591c7f8921bb69f76b7a10c36966f2.jsonl.gz", "inputs": "reproduction/python/inputs/p02793.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02793_66d145443a372a5a43407dc9cf71d71447bec89f203c9422197e66c8dd97343d.jsonl.gz"}, "slow_code": "class PrimeOptimizer:\n def __init__(self, MAX_NUM=10**3):\n is_prime = [True] * MAX_NUM\n is_prime[0] = False\n is_prime[1] = False\n primes = []\n for i in range(MAX_NUM):\n if is_prime[i]:\n primes.append(i)\n for j in range(2 * i, MAX_NUM, i):\n is_prime[j] = False\n self.primes = primes\n\n def prime_factorization(self, x):\n res = {}\n for prime in self.primes:\n while x % prime == 0:\n if not prime in res:\n res[prime] = 0\n res[prime] += 1\n x //= prime\n if x > 1:\n res[x] = 1\n return res\n\n\nMOD = 10**9 + 7\n\n\ndef mod_pow(p, q):\n res = 1\n while q:\n if q & 1:\n res = (res * p) % MOD\n p = (p * p) % MOD\n q //= 2\n return res\n\n\ndef mod_inv(p):\n return mod_pow(p, MOD - 2)\n\n\ndef solve(n, a):\n primeOpt = PrimeOptimizer()\n D = {}\n for i in range(n):\n prime_num_mapping = primeOpt.prime_factorization(a[i])\n for prime, num in list(prime_num_mapping.items()):\n if not prime in D:\n D[prime] = 0\n D[prime] = max(D[prime], num)\n L = 1\n for prime, num in list(D.items()):\n L = (L * mod_pow(prime, num)) % MOD\n res = sum([L * mod_inv(x) % MOD for x in a])\n return res % MOD\n\n\nN = int(eval(input()))\nA = list(map(int, input().split()))\nprint((solve(N, A)))\n", "slow_code_sha256": "66d145443a372a5a43407dc9cf71d71447bec89f203c9422197e66c8dd97343d", "slow_id": "p02793_66d145443a372a5a43407dc9cf71d71447bec89f203c9422197e66c8dd97343d", "speedup": 6.031050257321945, "stratum": "4-8", "within_pair_jaccard": 0.3142857142857143, "workload": {"case_count": 100, "description": "Choose positive integers B_i so that every A_i*B_i has the same value, minimizing sum B_i. Output that minimum modulo 1000000007. Observed inputs: N=1..10000 (median 1000); A_i=1..1000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 70006, "median": 6279.5, "min": 4}, "input_format": ["N\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 10001, "median": 1001.0, "min": 2}}} -{"case_ids": ["p02995_case_000", "p02995_case_001", "p02995_case_002", "p02995_case_003", "p02995_case_004", "p02995_case_005", "p02995_case_006", "p02995_case_007", "p02995_case_008", "p02995_case_009", "p02995_case_010", "p02995_case_011", "p02995_case_012", "p02995_case_013", "p02995_case_014", "p02995_case_015", "p02995_case_016", "p02995_case_017", "p02995_case_018", "p02995_case_019", "p02995_case_020", "p02995_case_021", "p02995_case_022", "p02995_case_023", "p02995_case_024", "p02995_case_025", "p02995_case_026", "p02995_case_027", "p02995_case_028", "p02995_case_029", "p02995_case_030", "p02995_case_031", "p02995_case_032", "p02995_case_033", "p02995_case_034", "p02995_case_035", "p02995_case_036", "p02995_case_037", "p02995_case_038", "p02995_case_039", "p02995_case_040", "p02995_case_041", "p02995_case_042", "p02995_case_043", "p02995_case_044", "p02995_case_045", "p02995_case_046", "p02995_case_047", "p02995_case_048", "p02995_case_049", "p02995_case_050", "p02995_case_051", "p02995_case_052", "p02995_case_053", "p02995_case_054", "p02995_case_055", "p02995_case_056", "p02995_case_057", "p02995_case_058", "p02995_case_059", "p02995_case_060", "p02995_case_061", "p02995_case_062", "p02995_case_063", "p02995_case_064", "p02995_case_065", "p02995_case_066", "p02995_case_067", "p02995_case_068", "p02995_case_069", "p02995_case_070", "p02995_case_071", "p02995_case_072", "p02995_case_073", "p02995_case_074", "p02995_case_075", "p02995_case_076", "p02995_case_077", "p02995_case_078", "p02995_case_079", "p02995_case_080", "p02995_case_081", "p02995_case_082", "p02995_case_083", "p02995_case_084", "p02995_case_085", "p02995_case_086", "p02995_case_087", "p02995_case_088", "p02995_case_089", "p02995_case_090", "p02995_case_091", "p02995_case_092", "p02995_case_093", "p02995_case_094", "p02995_case_095", "p02995_case_096", "p02995_case_097", "p02995_case_098", "p02995_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import math as m\n\nA, B, C, D = list(map(int, input().split()))\nA -= 1\ng = C * D // m.gcd(C, D)\nx = B // C - A // C\ny = B // D - A // D\nz = B // g - A // g\nprint((B - A - x - y + z))\n", "fast_code_sha256": "284acad32f039b02d479f3e10e518b3399b8810722821631f54eb37aa1b6351e", "fast_id": "p02995_284acad32f039b02d479f3e10e518b3399b8810722821631f54eb37aa1b6351e", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import math as m\n\nA, B, C, D = list(map(int, input().split()))\nA -= 1\ng = C * D // m.gcd(C, D)\nx = B // C - A // C\ny = B // D - A // D\nz = B // g - A // g\nprint((B - A - x - y + z))\n", "measured_fast_code_sha256": "284acad32f039b02d479f3e10e518b3399b8810722821631f54eb37aa1b6351e", "measured_slow_code": "import sys\n\nsys.setrecursionlimit(10**7)\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\ndef MI():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().rstrip().split())) # 空白あり\n\n\ndef LI2():\n return list(map(int, sys.stdin.readline().rstrip())) # 空白なし\n\n\ndef S():\n return sys.stdin.readline().rstrip()\n\n\ndef LS():\n return list(sys.stdin.readline().rstrip().split()) # 空白あり\n\n\ndef LS2():\n return list(sys.stdin.readline().rstrip()) # 空白なし\n\n\nA, B, C, D = MI()\nfrom math import gcd\n\n\ndef f(n):\n return n - n // C - n // D + n // ((C * D) // gcd(C, D))\n\n\nprint((f(B) - f(A - 1)))\n", "measured_slow_code_sha256": "c2f5bc360099cc643a35a40406bd46a274a8a5ff8b8696ae88a7e38cfd81242e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.507856543016198, "pair_id": "python_v2_fb1348b90e7ff8ae6d3dc12c", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02995", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02995_284acad32f039b02d479f3e10e518b3399b8810722821631f54eb37aa1b6351e.jsonl.gz", "inputs": "reproduction/python/inputs/p02995.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02995_c2f5bc360099cc643a35a40406bd46a274a8a5ff8b8696ae88a7e38cfd81242e.jsonl.gz"}, "slow_code": "import sys\n\nsys.setrecursionlimit(10**7)\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\ndef MI():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef LI2():\n return list(map(int, sys.stdin.readline().rstrip()))\n\n\ndef S():\n return sys.stdin.readline().rstrip()\n\n\ndef LS():\n return list(sys.stdin.readline().rstrip().split())\n\n\ndef LS2():\n return list(sys.stdin.readline().rstrip())\n\n\nA, B, C, D = MI()\nfrom math import gcd\n\n\ndef f(n):\n return n - n // C - n // D + n // ((C * D) // gcd(C, D))\n\n\nprint((f(B) - f(A - 1)))\n", "slow_code_sha256": "13e5da75774e374f0ecc4a7f6f857dc7a5cfdcb8d1ce9b650399f2172f149df2", "slow_id": "p02995_c2f5bc360099cc643a35a40406bd46a274a8a5ff8b8696ae88a7e38cfd81242e", "speedup": 2.5087040667452922, "stratum": "2-4", "within_pair_jaccard": 0.3076923076923077, "workload": {"case_count": 100, "description": "Count integers in inclusive interval [A,B] divisible by neither C nor D. The interval is given by endpoints, not by listing its members. Observed inputs: A=1..992930041683160624; B=1..1000000000000000000; C=1..1000000000; D=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 58, "median": 58.0, "min": 8}, "input_format": ["A B C D"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 4, "median": 4.0, "min": 4}}} -{"case_ids": ["p03563_case_000", "p03563_case_001", "p03563_case_002", "p03563_case_003", "p03563_case_004", "p03563_case_005", "p03563_case_006", "p03563_case_007", "p03563_case_008", "p03563_case_009", "p03563_case_010", "p03563_case_011", "p03563_case_012", "p03563_case_013", "p03563_case_014", "p03563_case_015", "p03563_case_016", "p03563_case_017", "p03563_case_018", "p03563_case_019", "p03563_case_020", "p03563_case_021", "p03563_case_022", "p03563_case_023", "p03563_case_024", "p03563_case_025", "p03563_case_026", "p03563_case_027", "p03563_case_028", "p03563_case_029", "p03563_case_030", "p03563_case_031", "p03563_case_032", "p03563_case_033", "p03563_case_034", "p03563_case_035", "p03563_case_036", "p03563_case_037", "p03563_case_038", "p03563_case_039", "p03563_case_040", "p03563_case_041", "p03563_case_042", "p03563_case_043", "p03563_case_044", "p03563_case_045", "p03563_case_046", "p03563_case_047", "p03563_case_048", "p03563_case_049", "p03563_case_050", "p03563_case_051", "p03563_case_052", "p03563_case_053", "p03563_case_054", "p03563_case_055", "p03563_case_056", "p03563_case_057", "p03563_case_058", "p03563_case_059", "p03563_case_060", "p03563_case_061", "p03563_case_062", "p03563_case_063", "p03563_case_064", "p03563_case_065", "p03563_case_066", "p03563_case_067", "p03563_case_068", "p03563_case_069", "p03563_case_070", "p03563_case_071", "p03563_case_072", "p03563_case_073", "p03563_case_074", "p03563_case_075", "p03563_case_076", "p03563_case_077", "p03563_case_078", "p03563_case_079", "p03563_case_080", "p03563_case_081", "p03563_case_082", "p03563_case_083", "p03563_case_084", "p03563_case_085", "p03563_case_086", "p03563_case_087", "p03563_case_088", "p03563_case_089", "p03563_case_090", "p03563_case_091", "p03563_case_092", "p03563_case_093", "p03563_case_094", "p03563_case_095", "p03563_case_096", "p03563_case_097", "p03563_case_098", "p03563_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "r = int(eval(input()))\ng = int(eval(input()))\nprint((r + (g - r) * 2))\n", "fast_code_sha256": "473b082646548bea82ff86ac46a6626391d950751bd899d44dac28bc01aa5cbf", "fast_id": "p03563_473b082646548bea82ff86ac46a6626391d950751bd899d44dac28bc01aa5cbf", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "r = int(eval(input()))\ng = int(eval(input()))\nprint((r + (g - r) * 2))\n", "measured_fast_code_sha256": "473b082646548bea82ff86ac46a6626391d950751bd899d44dac28bc01aa5cbf", "measured_slow_code": "import numpy as np\n\nlst = []\nR = int(eval(input()))\nG = int(eval(input()))\nans = G - R + G\nprint(ans)\n", "measured_slow_code_sha256": "59c6641cd1def8a06b45e4c0f0ace3ffa49de62fc97f73e0499cc3875cec5d01", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1717.23856580159, "pair_id": "python_v2_2e177c5952426dfa5185ee5f", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03563", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03563_473b082646548bea82ff86ac46a6626391d950751bd899d44dac28bc01aa5cbf.jsonl.gz", "inputs": "reproduction/python/inputs/p03563.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03563_59c6641cd1def8a06b45e4c0f0ace3ffa49de62fc97f73e0499cc3875cec5d01.jsonl.gz"}, "slow_code": "import numpy as np\n\nlst = []\nR = int(eval(input()))\nG = int(eval(input()))\nans = G - R + G\nprint(ans)\n", "slow_code_sha256": "59c6641cd1def8a06b45e4c0f0ace3ffa49de62fc97f73e0499cc3875cec5d01", "slow_id": "p03563_59c6641cd1def8a06b45e4c0f0ace3ffa49de62fc97f73e0499cc3875cec5d01", "speedup": 1712.8675578128828, "stratum": "8+", "within_pair_jaccard": 0.26666666666666666, "workload": {"case_count": 100, "description": "A new rating is the arithmetic mean of current rating R and a performance value. Find the performance required for the new rating to equal G; it may be negative. Observed inputs: R=0..4500 (median 2451.5); G=0..4500 (median 1662.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 10, "median": 10.0, "min": 4}, "input_format": ["R\nG"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p02724_case_000", "p02724_case_001", "p02724_case_002", "p02724_case_003", "p02724_case_004", "p02724_case_005", "p02724_case_006", "p02724_case_007", "p02724_case_008", "p02724_case_009", "p02724_case_010", "p02724_case_011", "p02724_case_012", "p02724_case_013", "p02724_case_014", "p02724_case_015", "p02724_case_016", "p02724_case_017", "p02724_case_018", "p02724_case_019", "p02724_case_020", "p02724_case_021", "p02724_case_022", "p02724_case_023", "p02724_case_024", "p02724_case_025", "p02724_case_026", "p02724_case_027", "p02724_case_028", "p02724_case_029", "p02724_case_030", "p02724_case_031", "p02724_case_032", "p02724_case_033", "p02724_case_034", "p02724_case_035", "p02724_case_036", "p02724_case_037", "p02724_case_038", "p02724_case_039", "p02724_case_040", "p02724_case_041", "p02724_case_042", "p02724_case_043", "p02724_case_044", "p02724_case_045", "p02724_case_046", "p02724_case_047", "p02724_case_048", "p02724_case_049", "p02724_case_050", "p02724_case_051", "p02724_case_052", "p02724_case_053", "p02724_case_054", "p02724_case_055", "p02724_case_056", "p02724_case_057", "p02724_case_058", "p02724_case_059", "p02724_case_060", "p02724_case_061", "p02724_case_062", "p02724_case_063", "p02724_case_064", "p02724_case_065", "p02724_case_066", "p02724_case_067", "p02724_case_068", "p02724_case_069", "p02724_case_070", "p02724_case_071", "p02724_case_072", "p02724_case_073", "p02724_case_074", "p02724_case_075", "p02724_case_076", "p02724_case_077", "p02724_case_078", "p02724_case_079", "p02724_case_080", "p02724_case_081", "p02724_case_082", "p02724_case_083", "p02724_case_084", "p02724_case_085", "p02724_case_086", "p02724_case_087", "p02724_case_088", "p02724_case_089", "p02724_case_090", "p02724_case_091", "p02724_case_092", "p02724_case_093", "p02724_case_094", "p02724_case_095", "p02724_case_096", "p02724_case_097", "p02724_case_098", "p02724_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from collections import deque\n\ns = int(eval(input()))\nbig = int(s / 500)\ns = s - big * 500\nprint((big * 1000 + int(s / 5) * 5))\n", "fast_code_sha256": "6109348b68c46cc54f130156e464a37472ee23a29b7f7afb3e1446cfb2cf115d", "fast_id": "p02724_6109348b68c46cc54f130156e464a37472ee23a29b7f7afb3e1446cfb2cf115d", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from collections import deque\n\ns = int(eval(input()))\nbig = int(s / 500)\ns = s - big * 500\nprint((big * 1000 + int(s / 5) * 5))\n", "measured_fast_code_sha256": "6109348b68c46cc54f130156e464a37472ee23a29b7f7afb3e1446cfb2cf115d", "measured_slow_code": "def main():\n x = int(eval(input()))\n ans = 0\n while x >= 500:\n x -= 500\n ans += 1000\n while x >= 5:\n x -= 5\n ans += 5\n print(ans)\n\n\nmain()\n", "measured_slow_code_sha256": "07c5a845a98dce83f42c711c0408dc4dad947c9351918518d0af13bec53b52eb", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2601.323101978281, "pair_id": "python_v2_5e83cafb4c95ebd8de24fcc8", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02724", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02724_6109348b68c46cc54f130156e464a37472ee23a29b7f7afb3e1446cfb2cf115d.jsonl.gz", "inputs": "reproduction/python/inputs/p02724.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02724_07c5a845a98dce83f42c711c0408dc4dad947c9351918518d0af13bec53b52eb.jsonl.gz"}, "slow_code": "def main():\n x = int(eval(input()))\n ans = 0\n while x >= 500:\n x -= 500\n ans += 1000\n while x >= 5:\n x -= 5\n ans += 5\n print(ans)\n\n\nmain()\n", "slow_code_sha256": "07c5a845a98dce83f42c711c0408dc4dad947c9351918518d0af13bec53b52eb", "slow_id": "p02724_07c5a845a98dce83f42c711c0408dc4dad947c9351918518d0af13bec53b52eb", "speedup": 734.0149023074251, "stratum": "8+", "within_pair_jaccard": 0.3684210526315789, "workload": {"case_count": 100, "description": "Exchange amount X into coins of values 500,100,50,10,5,1. Maximize happiness: each 500-value coin earns 1000 points and each 5-value coin earns 5; other coins earn none. Observed inputs: X=0..1000000000 (median 393604620).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 11, "median": 10.0, "min": 2}, "input_format": ["X"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p02881_case_000", "p02881_case_001", "p02881_case_002", "p02881_case_003", "p02881_case_004", "p02881_case_005", "p02881_case_006", "p02881_case_007", "p02881_case_008", "p02881_case_009", "p02881_case_010", "p02881_case_011", "p02881_case_012", "p02881_case_013", "p02881_case_014", "p02881_case_015", "p02881_case_016", "p02881_case_017", "p02881_case_018", "p02881_case_019", "p02881_case_020", "p02881_case_021", "p02881_case_022", "p02881_case_023", "p02881_case_024", "p02881_case_025", "p02881_case_026", "p02881_case_027", "p02881_case_028", "p02881_case_029", "p02881_case_030", "p02881_case_031", "p02881_case_032", "p02881_case_033", "p02881_case_034", "p02881_case_035", "p02881_case_036", "p02881_case_037", "p02881_case_038", "p02881_case_039", "p02881_case_040", "p02881_case_041", "p02881_case_042", "p02881_case_043", "p02881_case_044", "p02881_case_045", "p02881_case_046", "p02881_case_047", "p02881_case_048", "p02881_case_049", "p02881_case_050", "p02881_case_051", "p02881_case_052", "p02881_case_053", "p02881_case_054", "p02881_case_055", "p02881_case_056", "p02881_case_057", "p02881_case_058", "p02881_case_059", "p02881_case_060", "p02881_case_061", "p02881_case_062", "p02881_case_063", "p02881_case_064", "p02881_case_065", "p02881_case_066", "p02881_case_067", "p02881_case_068", "p02881_case_069", "p02881_case_070", "p02881_case_071", "p02881_case_072", "p02881_case_073", "p02881_case_074", "p02881_case_075", "p02881_case_076", "p02881_case_077", "p02881_case_078", "p02881_case_079", "p02881_case_080", "p02881_case_081", "p02881_case_082", "p02881_case_083", "p02881_case_084", "p02881_case_085", "p02881_case_086", "p02881_case_087", "p02881_case_088", "p02881_case_089", "p02881_case_090", "p02881_case_091", "p02881_case_092", "p02881_case_093", "p02881_case_094", "p02881_case_095", "p02881_case_096", "p02881_case_097", "p02881_case_098", "p02881_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N = int(eval(input()))\nx = int(N**0.5)\nfor i in range(x, 0, -1):\n if N % i == 0:\n y = N // i\n break\nans = N // y + y - 2\nprint(ans)\n", "fast_code_sha256": "385f918e70558d30ce24cedf0de5f4a96a7aad60475bd5eec62a4ce0ebe4edee", "fast_id": "p02881_385f918e70558d30ce24cedf0de5f4a96a7aad60475bd5eec62a4ce0ebe4edee", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N = int(eval(input()))\nx = int(N**0.5)\nfor i in range(x, 0, -1):\n if N % i == 0:\n y = N // i\n break\nans = N // y + y - 2\nprint(ans)\n", "measured_fast_code_sha256": "385f918e70558d30ce24cedf0de5f4a96a7aad60475bd5eec62a4ce0ebe4edee", "measured_slow_code": "def main():\n N = int(eval(input()))\n loop = int(N**0.5)\n ans = float(\"inf\")\n for i in range(1, loop + 1):\n if N % i == 0:\n j = N // i\n tmp = i + j - 2\n if tmp < ans:\n ans = tmp\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "59afd1990aed2abbcad83b7d4f6a1ac5d50dc6bca1f8640231c0a3d4aa8d5485", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.4401961364298115, "pair_id": "python_v2_13d78436aa263b8f50dd9a6f", "per_case_slow_code_faster_fraction": 0.25, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02881", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02881_385f918e70558d30ce24cedf0de5f4a96a7aad60475bd5eec62a4ce0ebe4edee.jsonl.gz", "inputs": "reproduction/python/inputs/p02881.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02881_59afd1990aed2abbcad83b7d4f6a1ac5d50dc6bca1f8640231c0a3d4aa8d5485.jsonl.gz"}, "slow_code": "def main():\n N = int(eval(input()))\n loop = int(N**0.5)\n ans = float(\"inf\")\n for i in range(1, loop + 1):\n if N % i == 0:\n j = N // i\n tmp = i + j - 2\n if tmp < ans:\n ans = tmp\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "59afd1990aed2abbcad83b7d4f6a1ac5d50dc6bca1f8640231c0a3d4aa8d5485", "slow_id": "p02881_59afd1990aed2abbcad83b7d4f6a1ac5d50dc6bca1f8640231c0a3d4aa8d5485", "speedup": 6.6469393325221935, "stratum": "4-8", "within_pair_jaccard": 0.5185185185185185, "workload": {"case_count": 100, "description": "On an infinite grid with value i*j at cell (i,j), start at (1,1). Each move increases exactly one coordinate by 1. Minimize moves to reach any cell of value N. Observed inputs: N=2..1000000000000 (median 260337887119.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 14, "median": 13.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p02660_case_000", "p02660_case_001", "p02660_case_002", "p02660_case_003", "p02660_case_004", "p02660_case_005", "p02660_case_006", "p02660_case_007", "p02660_case_008", "p02660_case_009", "p02660_case_010", "p02660_case_011", "p02660_case_012", "p02660_case_013", "p02660_case_014", "p02660_case_015", "p02660_case_016", "p02660_case_017", "p02660_case_018", "p02660_case_019", "p02660_case_020", "p02660_case_021", "p02660_case_022", "p02660_case_023", "p02660_case_024", "p02660_case_025", "p02660_case_026", "p02660_case_027", "p02660_case_028", "p02660_case_029", "p02660_case_030", "p02660_case_031", "p02660_case_032", "p02660_case_033", "p02660_case_034", "p02660_case_035", "p02660_case_036", "p02660_case_037", "p02660_case_038", "p02660_case_039", "p02660_case_040", "p02660_case_041", "p02660_case_042", "p02660_case_043", "p02660_case_044", "p02660_case_045", "p02660_case_046", "p02660_case_047", "p02660_case_048", "p02660_case_049", "p02660_case_050", "p02660_case_051", "p02660_case_052", "p02660_case_053", "p02660_case_054", "p02660_case_055", "p02660_case_056", "p02660_case_057", "p02660_case_058", "p02660_case_059", "p02660_case_060", "p02660_case_061", "p02660_case_062", "p02660_case_063", "p02660_case_064", "p02660_case_065", "p02660_case_066", "p02660_case_067", "p02660_case_068", "p02660_case_069", "p02660_case_070", "p02660_case_071", "p02660_case_072", "p02660_case_073", "p02660_case_074", "p02660_case_075", "p02660_case_076", "p02660_case_077", "p02660_case_078", "p02660_case_079", "p02660_case_080", "p02660_case_081", "p02660_case_082", "p02660_case_083", "p02660_case_084", "p02660_case_085", "p02660_case_086", "p02660_case_087", "p02660_case_088", "p02660_case_089", "p02660_case_090", "p02660_case_091", "p02660_case_092", "p02660_case_093", "p02660_case_094", "p02660_case_095", "p02660_case_096", "p02660_case_097", "p02660_case_098", "p02660_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def factorization(n):\n arr = []\n temp = n\n for i in range(2, int(-(-(n**0.5) // 1)) + 1):\n if temp % i == 0:\n cnt = 0\n while temp % i == 0:\n cnt += 1\n temp //= i\n arr.append([i, cnt])\n if temp != 1:\n arr.append([temp, 1])\n if arr == []:\n arr.append([n, 1])\n return arr\n\n\ndef readinput():\n n = int(eval(input()))\n return n\n\n\ndef possibleCnt(n):\n cnt = 0\n resu = n\n for i in range(1, n + 1):\n if resu >= i:\n cnt += 1\n resu -= i\n\n return cnt\n\n\ndef main(n):\n ansList = factorization(n)\n\n count = 0\n for l in ansList:\n if l[0] != 1:\n count += possibleCnt(l[1])\n return count\n\n\nif __name__ == \"__main__\":\n n = readinput()\n ans = main(n)\n print(ans)\n", "fast_code_sha256": "6e39388440dba2f5867cb009ffac67ea1392bf250a55cda25cb1181359a5e9c0", "fast_id": "p02660_32711959d0214afb0d72c7b9bca891ee04b3ef8d7762d54ffc7b47ef14dc2129", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def factorization(n):\n arr = []\n temp = n\n for i in range(2, int(-(-(n**0.5) // 1)) + 1):\n if temp % i == 0:\n cnt = 0\n while temp % i == 0:\n cnt += 1\n temp //= i\n arr.append([i, cnt])\n if temp != 1:\n arr.append([temp, 1])\n if arr == []:\n arr.append([n, 1])\n return arr\n\n\ndef readinput():\n n = int(eval(input()))\n return n\n\n\ndef possibleCnt(n):\n cnt = 0\n resu = n\n for i in range(1, n + 1):\n if resu >= i:\n cnt += 1\n resu -= i\n # print(cnt,resu)\n return cnt\n\n\ndef main(n):\n ansList = factorization(n)\n # print(ansList)\n count = 0\n for l in ansList:\n if l[0] != 1:\n count += possibleCnt(l[1])\n return count\n\n\nif __name__ == \"__main__\":\n n = readinput()\n ans = main(n)\n print(ans)\n", "measured_fast_code_sha256": "32711959d0214afb0d72c7b9bca891ee04b3ef8d7762d54ffc7b47ef14dc2129", "measured_slow_code": "n = int(eval(input()))\na = p = 1\nwhile p < 6**8:\n c = t = 0\n p += 1\n while n % p < 1:\n n //= p\n x = c == t\n t += x\n c += 1 - t * x\n a += x\nprint((a - (n < 2)))\n", "measured_slow_code_sha256": "8301217799053ca8035ba7e5e9be7529b06a7e4ccf5a0cb39174661c0dc1c031", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 208.91676262450207, "pair_id": "python_v2_c06042667cb82e2456d12572", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02660", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02660_32711959d0214afb0d72c7b9bca891ee04b3ef8d7762d54ffc7b47ef14dc2129.jsonl.gz", "inputs": "reproduction/python/inputs/p02660.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02660_8301217799053ca8035ba7e5e9be7529b06a7e4ccf5a0cb39174661c0dc1c031.jsonl.gz"}, "slow_code": "n = int(eval(input()))\na = p = 1\nwhile p < 6**8:\n c = t = 0\n p += 1\n while n % p < 1:\n n //= p\n x = c == t\n t += x\n c += 1 - t * x\n a += x\nprint((a - (n < 2)))\n", "slow_code_sha256": "8301217799053ca8035ba7e5e9be7529b06a7e4ccf5a0cb39174661c0dc1c031", "slow_id": "p02660_8301217799053ca8035ba7e5e9be7529b06a7e4ccf5a0cb39174661c0dc1c031", "speedup": 165.86577888630987, "stratum": "8+", "within_pair_jaccard": 0.23076923076923078, "workload": {"case_count": 100, "description": "Starting with integer N, repeatedly divide by a prime power p^e with e>=1 that divides the current value and has never been chosen before. Maximize the number of divisions. Observed inputs: N=1..992540114224 (median 452657355.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 13, "median": 10.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p02890_case_000", "p02890_case_001", "p02890_case_002", "p02890_case_003", "p02890_case_004", "p02890_case_005", "p02890_case_006", "p02890_case_007", "p02890_case_008", "p02890_case_009", "p02890_case_010", "p02890_case_011", "p02890_case_012", "p02890_case_013", "p02890_case_014", "p02890_case_015", "p02890_case_016", "p02890_case_017", "p02890_case_018", "p02890_case_019", "p02890_case_020", "p02890_case_021", "p02890_case_022", "p02890_case_023", "p02890_case_024", "p02890_case_025", "p02890_case_026", "p02890_case_027", "p02890_case_028", "p02890_case_029", "p02890_case_030", "p02890_case_031", "p02890_case_032", "p02890_case_033", "p02890_case_034", "p02890_case_035", "p02890_case_036", "p02890_case_037", "p02890_case_038", "p02890_case_039", "p02890_case_040", "p02890_case_041", "p02890_case_042", "p02890_case_043", "p02890_case_044", "p02890_case_045", "p02890_case_046", "p02890_case_047", "p02890_case_048", "p02890_case_049", "p02890_case_050", "p02890_case_051", "p02890_case_052", "p02890_case_053", "p02890_case_054", "p02890_case_055", "p02890_case_056", "p02890_case_057", "p02890_case_058", "p02890_case_059", "p02890_case_060", "p02890_case_061", "p02890_case_062", "p02890_case_063", "p02890_case_064", "p02890_case_065", "p02890_case_066", "p02890_case_067", "p02890_case_068", "p02890_case_069", "p02890_case_070", "p02890_case_071", "p02890_case_072", "p02890_case_073", "p02890_case_074", "p02890_case_075", "p02890_case_076", "p02890_case_077", "p02890_case_078", "p02890_case_079", "p02890_case_080", "p02890_case_081", "p02890_case_082", "p02890_case_083", "p02890_case_084", "p02890_case_085", "p02890_case_086", "p02890_case_087", "p02890_case_088", "p02890_case_089", "p02890_case_090", "p02890_case_091", "p02890_case_092", "p02890_case_093", "p02890_case_094", "p02890_case_095", "p02890_case_096", "p02890_case_097", "p02890_case_098", "p02890_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "executable_AST_equal_except_explicit_explanatory_string_removal_and_all_frozen_inputs_checker_pass", "fast_code": "from collections import Counter\n\nN = int(eval(input()))\nC = sorted(list(Counter(list(map(int, input().split()))).values()))\nrest = N\nremoved = 0\nfor K in range(1, N + 1):\n d = K - removed\n while C and C[-1] > rest // d:\n rest -= C[-1]\n C.pop()\n removed += 1\n d -= 1\n print((rest // d))\n", "fast_code_sha256": "07946d257ddf30d41e39f411c7f28872f47e5cdcedd7ff44a4a43570b5a8d815", "fast_id": "p02890_07946d257ddf30d41e39f411c7f28872f47e5cdcedd7ff44a4a43570b5a8d815", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from collections import Counter\n\nN = int(eval(input()))\nC = sorted(list(Counter(list(map(int, input().split()))).values()))\nrest = N\nremoved = 0\nfor K in range(1, N + 1):\n d = K - removed\n while C and C[-1] > rest // d:\n rest -= C[-1]\n C.pop()\n removed += 1\n d -= 1\n print((rest // d))\n", "measured_fast_code_sha256": "07946d257ddf30d41e39f411c7f28872f47e5cdcedd7ff44a4a43570b5a8d815", "measured_slow_code": "#!/usr/bin/env python3\nimport sys\nimport math\nfrom bisect import bisect_right as br\nfrom bisect import bisect_left as bl\n\nsys.setrecursionlimit(2147483647)\nfrom heapq import heappush, heappop, heappushpop\nfrom collections import defaultdict\nfrom itertools import accumulate\nfrom collections import Counter\nfrom collections import deque\nfrom operator import itemgetter\nfrom itertools import permutations\n\nmod = 10**9 + 7\ninf = float(\"inf\")\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\n\"\"\"\n.2分探索を考える\n.各kに対してx回以上抜き出せるかという問いを考える\n.各数の個数を数えて数iの個数をCiとする\n.各数iを抜き出せるのはCiまで\n ⇒各数を抜き出す回数min(Ci,x)\n.Σmin(Ci,x)はkx以上でなければいけない(k個x回抜き出すため)\n.これを満たすときx回抜き出せる\n.このままではO(n^2(logn))なので工夫する\n.Σ(min(Ci,x))はk依存でないのでここを工夫する(Σ(min(Ci,x))をSxとする)\n.SxはSx-1と比べてx以上のCiの数だけ増える(x以上のCiの数をDxとする)\n.Sx := Sx-1 + Dx\n.Dxを求める時はCのリストについてbisectを行う。\n.Sx >= k*xとなるxの最大値を2分探索で求める。(O(nlogn))\n\"\"\"\nn = I()\na = LI()\ncnt = list(Counter(a).values())\ncnt.sort()\nm = len(cnt)\nS = [0] * (n + 1)\nfor x in range(1, n + 1):\n l = bl(cnt, x)\n S[x] = S[x - 1] + (m - l)\nfor k in range(1, n + 1):\n high, low = n + 1, 0\n while high - low > 1:\n mid = (high + low) // 2\n if S[mid] >= k * mid:\n low = mid\n else:\n high = mid\n print(low)\n", "measured_slow_code_sha256": "683b16708a4919fe826584e325a20783d2265d979233683a19a27263211ea906", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 7.447452793034341, "pair_id": "python_v2_f12a06ef571d15efd56f0b63", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02890", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02890_07946d257ddf30d41e39f411c7f28872f47e5cdcedd7ff44a4a43570b5a8d815.jsonl.gz", "inputs": "reproduction/python/inputs/p02890.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02890_683b16708a4919fe826584e325a20783d2265d979233683a19a27263211ea906.jsonl.gz"}, "slow_code": "import sys\nimport math\nfrom bisect import bisect_right as br\nfrom bisect import bisect_left as bl\n\nsys.setrecursionlimit(2147483647)\nfrom heapq import heappush, heappop, heappushpop\nfrom collections import defaultdict\nfrom itertools import accumulate\nfrom collections import Counter\nfrom collections import deque\nfrom operator import itemgetter\nfrom itertools import permutations\n\nmod = 10**9 + 7\ninf = float(\"inf\")\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\nn = I()\na = LI()\ncnt = list(Counter(a).values())\ncnt.sort()\nm = len(cnt)\nS = [0] * (n + 1)\nfor x in range(1, n + 1):\n l = bl(cnt, x)\n S[x] = S[x - 1] + (m - l)\nfor k in range(1, n + 1):\n high, low = n + 1, 0\n while high - low > 1:\n mid = (high + low) // 2\n if S[mid] >= k * mid:\n low = mid\n else:\n high = mid\n print(low)\n", "slow_code_sha256": "2c57f5c3d6e04ae779c203c63a7a33316889e85db23460b3b699e27933e99fbd", "slow_id": "p02890_683b16708a4919fe826584e325a20783d2265d979233683a19a27263211ea906", "speedup": 6.344357676864725, "stratum": "4-8", "within_pair_jaccard": 0.1568627450980392, "workload": {"case_count": 100, "description": "For each K=1..N, find the maximum number of disjoint groups of exactly K cards that can be removed, requiring all values within each group to differ. The same N-card multiset is considered independently for every K. Observed inputs: N=1..300000 (median 100000); A_i=1..300000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 2100007, "median": 238900.5, "min": 4}, "input_format": ["N\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 300001, "median": 100001.0, "min": 2}}} -{"case_ids": ["p02732_case_000", "p02732_case_001", "p02732_case_002", "p02732_case_003", "p02732_case_004", "p02732_case_005", "p02732_case_006", "p02732_case_007", "p02732_case_008", "p02732_case_009", "p02732_case_010", "p02732_case_011", "p02732_case_012", "p02732_case_013", "p02732_case_014", "p02732_case_015", "p02732_case_016", "p02732_case_017", "p02732_case_018", "p02732_case_019", "p02732_case_020", "p02732_case_021", "p02732_case_022", "p02732_case_023", "p02732_case_024", "p02732_case_025", "p02732_case_026", "p02732_case_027", "p02732_case_028", "p02732_case_029", "p02732_case_030", "p02732_case_031", "p02732_case_032", "p02732_case_033", "p02732_case_034", "p02732_case_035", "p02732_case_036", "p02732_case_037", "p02732_case_038", "p02732_case_039", "p02732_case_040", "p02732_case_041", "p02732_case_042", "p02732_case_043", "p02732_case_044", "p02732_case_045", "p02732_case_046", "p02732_case_047", "p02732_case_048", "p02732_case_049", "p02732_case_050", "p02732_case_051", "p02732_case_052", "p02732_case_053", "p02732_case_054", "p02732_case_055", "p02732_case_056", "p02732_case_057", "p02732_case_058", "p02732_case_059", "p02732_case_060", "p02732_case_061", "p02732_case_062", "p02732_case_063", "p02732_case_064", "p02732_case_065", "p02732_case_066", "p02732_case_067", "p02732_case_068", "p02732_case_069", "p02732_case_070", "p02732_case_071", "p02732_case_072", "p02732_case_073", "p02732_case_074", "p02732_case_075", "p02732_case_076", "p02732_case_077", "p02732_case_078", "p02732_case_079", "p02732_case_080", "p02732_case_081", "p02732_case_082", "p02732_case_083", "p02732_case_084", "p02732_case_085", "p02732_case_086", "p02732_case_087", "p02732_case_088", "p02732_case_089", "p02732_case_090", "p02732_case_091", "p02732_case_092", "p02732_case_093", "p02732_case_094", "p02732_case_095", "p02732_case_096", "p02732_case_097", "p02732_case_098", "p02732_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import collections\n\n\ndef myAnswer(N: int, A: list) -> None:\n dic = collections.Counter(A)\n total = 0\n for value in list(dic.values()):\n total += value * (value - 1) // 2\n for a in A:\n print((total - (dic[a] - 1)))\n\n\ndef modelAnswer():\n return\n\n\ndef main():\n N = int(eval(input()))\n A = list(map(int, input().split()))\n myAnswer(N, A[:])\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "b7b8235fce3c8914e22b2710ff6799014c7410a36ea1f799ef976444b407f32e", "fast_id": "p02732_b7b8235fce3c8914e22b2710ff6799014c7410a36ea1f799ef976444b407f32e", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import collections\n\n\ndef myAnswer(N: int, A: list) -> None:\n dic = collections.Counter(A)\n total = 0\n for value in list(dic.values()):\n total += value * (value - 1) // 2\n for a in A:\n print((total - (dic[a] - 1)))\n\n\ndef modelAnswer():\n return\n\n\ndef main():\n N = int(eval(input()))\n A = list(map(int, input().split()))\n myAnswer(N, A[:])\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "b7b8235fce3c8914e22b2710ff6799014c7410a36ea1f799ef976444b407f32e", "measured_slow_code": "from functools import reduce\n\n\ndef d_banned_k():\n from collections import Counter\n from functools import reduce\n\n N = int(eval(input()))\n A = [int(i) for i in input().split()]\n\n def comb(n, r):\n numerator = reduce(lambda x, y: x * y, list(range(n, n - r, -1)))\n denominator = reduce(lambda x, y: x * y, list(range(1, r + 1)))\n return numerator // denominator\n\n count = Counter(A)\n total = sum(comb(c, 2) for c in list(count.values()))\n ans = []\n for a in A:\n v = count[a]\n ans.append(total - comb(v, 2) + comb(v - 1, 2))\n return \" \".join(map(str, ans))\n\n\nprint((d_banned_k()))\n", "measured_slow_code_sha256": "715c50a0bd5503a1c5a8f5900a3590d1b55c78b7a98e77c948ef59c2a023b3ea", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4.205439389913751, "pair_id": "python_v2_872c44a2c5fee7be03caa40f", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02732", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02732_b7b8235fce3c8914e22b2710ff6799014c7410a36ea1f799ef976444b407f32e.jsonl.gz", "inputs": "reproduction/python/inputs/p02732.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02732_715c50a0bd5503a1c5a8f5900a3590d1b55c78b7a98e77c948ef59c2a023b3ea.jsonl.gz"}, "slow_code": "from functools import reduce\n\n\ndef d_banned_k():\n from collections import Counter\n from functools import reduce\n\n N = int(eval(input()))\n A = [int(i) for i in input().split()]\n\n def comb(n, r):\n numerator = reduce(lambda x, y: x * y, list(range(n, n - r, -1)))\n denominator = reduce(lambda x, y: x * y, list(range(1, r + 1)))\n return numerator // denominator\n\n count = Counter(A)\n total = sum(comb(c, 2) for c in list(count.values()))\n ans = []\n for a in A:\n v = count[a]\n ans.append(total - comb(v, 2) + comb(v - 1, 2))\n return \" \".join(map(str, ans))\n\n\nprint((d_banned_k()))\n", "slow_code_sha256": "715c50a0bd5503a1c5a8f5900a3590d1b55c78b7a98e77c948ef59c2a023b3ea", "slow_id": "p02732_715c50a0bd5503a1c5a8f5900a3590d1b55c78b7a98e77c948ef59c2a023b3ea", "speedup": 3.4474488780707473, "stratum": "2-4", "within_pair_jaccard": 0.37735849056603776, "workload": {"case_count": 100, "description": "For each position k in an N-ball sequence, exclude only that ball and count unordered pairs of distinct remaining balls carrying equal integer values A_i. Observed inputs: N=3..200000 (median 550); A_i=1..200000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1400007, "median": 1155.0, "min": 8}, "input_format": ["N\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200001, "median": 551.0, "min": 4}}} -{"case_ids": ["p03013_case_000", "p03013_case_001", "p03013_case_002", "p03013_case_003", "p03013_case_004", "p03013_case_005", "p03013_case_006", "p03013_case_007", "p03013_case_008", "p03013_case_009", "p03013_case_010", "p03013_case_011", "p03013_case_012", "p03013_case_013", "p03013_case_014", "p03013_case_015", "p03013_case_016", "p03013_case_017", "p03013_case_018", "p03013_case_019", "p03013_case_020", "p03013_case_021", "p03013_case_022", "p03013_case_023", "p03013_case_024", "p03013_case_025", "p03013_case_026", "p03013_case_027", "p03013_case_028", "p03013_case_029", "p03013_case_030", "p03013_case_031", "p03013_case_032", "p03013_case_033", "p03013_case_034", "p03013_case_035", "p03013_case_036", "p03013_case_037", "p03013_case_038", "p03013_case_039", "p03013_case_040", "p03013_case_041", "p03013_case_042", "p03013_case_043", "p03013_case_044", "p03013_case_045", "p03013_case_046", "p03013_case_047", "p03013_case_048", "p03013_case_049", "p03013_case_050", "p03013_case_051", "p03013_case_052", "p03013_case_053", "p03013_case_054", "p03013_case_055", "p03013_case_056", "p03013_case_057", "p03013_case_058", "p03013_case_059", "p03013_case_060", "p03013_case_061", "p03013_case_062", "p03013_case_063", "p03013_case_064", "p03013_case_065", "p03013_case_066", "p03013_case_067", "p03013_case_068", "p03013_case_069", "p03013_case_070", "p03013_case_071", "p03013_case_072", "p03013_case_073", "p03013_case_074", "p03013_case_075", "p03013_case_076", "p03013_case_077", "p03013_case_078", "p03013_case_079", "p03013_case_080", "p03013_case_081", "p03013_case_082", "p03013_case_083", "p03013_case_084", "p03013_case_085", "p03013_case_086", "p03013_case_087", "p03013_case_088", "p03013_case_089", "p03013_case_090", "p03013_case_091", "p03013_case_092", "p03013_case_093", "p03013_case_094", "p03013_case_095", "p03013_case_096", "p03013_case_097", "p03013_case_098", "p03013_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\nN, M = list(map(int, input().split()))\nif M == 0:\n alist = set()\nelse:\n\n alist = set(map(int, sys.stdin))\ndp = [0] * (N + 1)\ndp[0] = 1\ndp[1] = 1 if 1 not in alist else 0\nMOD = 10**9 + 7\nfor i in range(2, N + 1):\n if i in alist:\n continue\n dp[i] = (dp[i - 1] + dp[i - 2]) % MOD\nprint((dp[N]))\n", "fast_code_sha256": "35dec6fc5770cf4d7b9621f258b5fe80dc7a1beb9ce612bddcc28ef1a07df64c", "fast_id": "p03013_caafad57c12dd7f73a70c01e6f3a04d5e61c35d2f6f40fac4b9d85d515329111", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\nN, M = list(map(int, input().split()))\nif M == 0:\n alist = set()\nelse:\n # Input below rows\n alist = set(map(int, sys.stdin))\ndp = [0] * (N + 1)\ndp[0] = 1\ndp[1] = 1 if 1 not in alist else 0\nMOD = 10**9 + 7\nfor i in range(2, N + 1):\n if i in alist:\n continue\n dp[i] = (dp[i - 1] + dp[i - 2]) % MOD\nprint((dp[N]))\n", "measured_fast_code_sha256": "caafad57c12dd7f73a70c01e6f3a04d5e61c35d2f6f40fac4b9d85d515329111", "measured_slow_code": "n, m = list(map(int, input().split()))\ndp = [0] * (n + 3)\na = [int(eval(input())) for i in range(m)]\nmod = 10**9 + 7\nfor i in range(m):\n dp[a[i]] = -1\ndp[0] = 1\nif dp[1] != -1:\n dp[1] += dp[0]\nfor i in range(n + 1):\n if dp[i + 2] == -1:\n continue\n if dp[i] != -1:\n dp[i + 2] += dp[i]\n if dp[i + 1] != -1:\n dp[i + 2] += dp[i + 1]\n dp[i + 2] %= mod\nprint((dp[n] % mod))\n", "measured_slow_code_sha256": "62db3d0ef606be9ceb452bb70ce9888687db47f5aaa4f3513c9f4e41562943b7", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.403884369303391, "pair_id": "python_v2_edf67ab1e0fb733ca1a5f695", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03013", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03013_caafad57c12dd7f73a70c01e6f3a04d5e61c35d2f6f40fac4b9d85d515329111.jsonl.gz", "inputs": "reproduction/python/inputs/p03013.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03013_62db3d0ef606be9ceb452bb70ce9888687db47f5aaa4f3513c9f4e41562943b7.jsonl.gz"}, "slow_code": "n, m = list(map(int, input().split()))\ndp = [0] * (n + 3)\na = [int(eval(input())) for i in range(m)]\nmod = 10**9 + 7\nfor i in range(m):\n dp[a[i]] = -1\ndp[0] = 1\nif dp[1] != -1:\n dp[1] += dp[0]\nfor i in range(n + 1):\n if dp[i + 2] == -1:\n continue\n if dp[i] != -1:\n dp[i + 2] += dp[i]\n if dp[i + 1] != -1:\n dp[i + 2] += dp[i + 1]\n dp[i + 2] %= mod\nprint((dp[n] % mod))\n", "slow_code_sha256": "62db3d0ef606be9ceb452bb70ce9888687db47f5aaa4f3513c9f4e41562943b7", "slow_id": "p03013_62db3d0ef606be9ceb452bb70ce9888687db47f5aaa4f3513c9f4e41562943b7", "speedup": 4.316741827015591, "stratum": "4-8", "within_pair_jaccard": 0.5428571428571428, "workload": {"case_count": 100, "description": "Count ways to climb from step 0 to N using jumps of 1 or 2, never landing on the M listed broken steps. Broken indices are strictly increasing and lie in 1..N-1. Output modulo 1000000007. Observed inputs: N=1..100000 (median 100000); M=0..99999 (median 12345); a_i=1..99999.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 588901, "median": 72724.0, "min": 4}, "input_format": ["N M\na_1\n...\na_M"], "input_format_status": "source_input_section", "input_lines": {"max": 100000, "median": 12346.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100001, "median": 12347.0, "min": 2}}} -{"case_ids": ["p03025_case_000", "p03025_case_001", "p03025_case_002", "p03025_case_003", "p03025_case_004", "p03025_case_005", "p03025_case_006", "p03025_case_007", "p03025_case_008", "p03025_case_009", "p03025_case_010", "p03025_case_011", "p03025_case_012", "p03025_case_013", "p03025_case_014", "p03025_case_015", "p03025_case_016", "p03025_case_017", "p03025_case_018", "p03025_case_019", "p03025_case_020", "p03025_case_021", "p03025_case_022", "p03025_case_023", "p03025_case_024", "p03025_case_025", "p03025_case_026", "p03025_case_027", "p03025_case_028", "p03025_case_029", "p03025_case_030", "p03025_case_031", "p03025_case_032", "p03025_case_033", "p03025_case_034", "p03025_case_035", "p03025_case_036", "p03025_case_037", "p03025_case_038", "p03025_case_039", "p03025_case_040", "p03025_case_041", "p03025_case_042", "p03025_case_043", "p03025_case_044", "p03025_case_045", "p03025_case_046", "p03025_case_047", "p03025_case_048", "p03025_case_049", "p03025_case_050", "p03025_case_051", "p03025_case_052", "p03025_case_053", "p03025_case_054", "p03025_case_055", "p03025_case_056", "p03025_case_057", "p03025_case_058", "p03025_case_059", "p03025_case_060", "p03025_case_061", "p03025_case_062", "p03025_case_063", "p03025_case_064", "p03025_case_065", "p03025_case_066", "p03025_case_067", "p03025_case_068", "p03025_case_069", "p03025_case_070", "p03025_case_071", "p03025_case_072", "p03025_case_073", "p03025_case_074", "p03025_case_075", "p03025_case_076", "p03025_case_077", "p03025_case_078", "p03025_case_079", "p03025_case_080", "p03025_case_081", "p03025_case_082", "p03025_case_083", "p03025_case_084", "p03025_case_085", "p03025_case_086", "p03025_case_087", "p03025_case_088", "p03025_case_089", "p03025_case_090", "p03025_case_091", "p03025_case_092", "p03025_case_093", "p03025_case_094", "p03025_case_095", "p03025_case_096", "p03025_case_097", "p03025_case_098", "p03025_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "executable_AST_equal_except_explicit_explanatory_string_removal_and_all_frozen_inputs_checker_pass", "fast_code": "from collections import defaultdict, deque\nfrom heapq import heappush, heappop\nimport sys\nimport math\nimport bisect\nimport random\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LS():\n return [list(x) for x in sys.stdin.readline().split()]\n\n\ndef S():\n res = list(sys.stdin.readline())\n if res[-1] == \"\\n\":\n return res[:-1]\n return res\n\n\ndef IR(n):\n return [I() for i in range(n)]\n\n\ndef LIR(n):\n return [LI() for i in range(n)]\n\n\ndef SR(n):\n return [S() for i in range(n)]\n\n\ndef LSR(n):\n return [LS() for i in range(n)]\n\n\nsys.setrecursionlimit(1000000)\nmod = 1000000007\n\n\ndef solve():\n n, a, b, c = LI()\n inv_100 = pow(100, mod - 2, mod)\n a = a * inv_100 % mod\n b = b * inv_100 % mod\n c = (1 - c * inv_100) % mod\n c = pow(c, mod - 2, mod)\n fact = [1]\n N = 2 * n\n for i in range(1, N + 1):\n fact.append(fact[-1] * i % mod)\n inv = [None] * (N + 1)\n inv[N] = pow(fact[N], mod - 2, mod)\n for i in range(N)[::-1]:\n inv[i] = inv[i + 1] * (i + 1) % mod\n ans = 0\n fa, fb, fc = pow(b, n, mod), pow(a, n, mod), pow(c, n + 1, mod)\n for i in range(n):\n ans += inv[i] * fact[n + i] * fc * (fb + fa) % mod\n ans %= mod\n fa *= a\n fb *= b\n fc *= c\n if fa >= mod:\n fa %= mod\n if fb >= mod:\n fb %= mod\n if fc >= mod:\n fc %= mod\n print((ans * inv[n - 1] % mod))\n return\n\n\nif __name__ == \"__main__\":\n solve()\n", "fast_code_sha256": "ed1c5350b8aa7e968256870a8eb7a385d39644d07887e8b02d7c885d46cd886e", "fast_id": "p03025_69312b14dacd3fcb1bf39c5fc397d9669916a2bfe08b21a3dfc5a3bcfe7c90ee", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "#!usr/bin/env python3\nfrom collections import defaultdict, deque\nfrom heapq import heappush, heappop\nimport sys\nimport math\nimport bisect\nimport random\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LS():\n return [list(x) for x in sys.stdin.readline().split()]\n\n\ndef S():\n res = list(sys.stdin.readline())\n if res[-1] == \"\\n\":\n return res[:-1]\n return res\n\n\ndef IR(n):\n return [I() for i in range(n)]\n\n\ndef LIR(n):\n return [LI() for i in range(n)]\n\n\ndef SR(n):\n return [S() for i in range(n)]\n\n\ndef LSR(n):\n return [LS() for i in range(n)]\n\n\nsys.setrecursionlimit(1000000)\nmod = 1000000007\n\n\ndef solve():\n n, a, b, c = LI()\n inv_100 = pow(100, mod - 2, mod)\n a = a * inv_100 % mod\n b = b * inv_100 % mod\n c = (1 - c * inv_100) % mod\n c = pow(c, mod - 2, mod)\n fact = [1]\n N = 2 * n\n for i in range(1, N + 1):\n fact.append(fact[-1] * i % mod)\n inv = [None] * (N + 1)\n inv[N] = pow(fact[N], mod - 2, mod)\n for i in range(N)[::-1]:\n inv[i] = inv[i + 1] * (i + 1) % mod\n ans = 0\n fa, fb, fc = pow(b, n, mod), pow(a, n, mod), pow(c, n + 1, mod)\n for i in range(n):\n ans += inv[i] * fact[n + i] * fc * (fb + fa) % mod\n ans %= mod\n fa *= a\n fb *= b\n fc *= c\n if fa >= mod:\n fa %= mod\n if fb >= mod:\n fb %= mod\n if fc >= mod:\n fc %= mod\n print((ans * inv[n - 1] % mod))\n return\n\n\n# Solve\nif __name__ == \"__main__\":\n solve()\n", "measured_fast_code_sha256": "69312b14dacd3fcb1bf39c5fc397d9669916a2bfe08b21a3dfc5a3bcfe7c90ee", "measured_slow_code": "# Combinationクラス\nclass Combination:\n \"\"\"\n 計算量:階乗・逆元テーブルの作成O(N)\n nCkを求めるO(1)\n \"\"\"\n\n def __init__(self, n, MOD):\n self.fact = [1]\n for i in range(1, n + 1):\n self.fact.append(self.fact[-1] * i % MOD)\n self.inv_fact = [pow(self.fact[i], MOD - 2, MOD) for i in range(n + 1)]\n self.MOD = MOD\n\n def factorial(self, k):\n \"\"\"k!を求める\"\"\"\n return self.fact[k]\n\n def inverse_factorial(self, k):\n \"\"\"k!の逆元を求める\"\"\"\n return self.inv_fact[k]\n\n def combination(self, k, r):\n \"\"\"kCrを求める\"\"\"\n return (self.fact[k] * self.inv_fact[k - r] * self.inv_fact[r]) % self.MOD\n\n\nfrom fractions import Fraction\n\nMOD = 10**9 + 7\nn, a, b, c = list(map(int, input().split()))\n# n-1から2n-2まで\ncomb = Combination(2 * n, MOD)\nmod_li = [1]\nfor i in range(1, 2 * n + 1):\n mod_li.append(mod_li[-1] * (a + b) % MOD)\np1 = [1]\np2 = [1]\nfor i in range(1, n + 1):\n p1.append((p1[-1] * a) % MOD)\n p2.append((p2[-1] * b) % MOD)\nq = mod_li[2 * n - 1]\np = 0\nfor i in range(n):\n tmp_bunshi = (\n (n + i) * (mod_li[n - i - 1]) * p1[n] * p2[i] * comb.combination(n - 1 + i, i)\n )\n tmp_bunshi += (\n (n + i) * (mod_li[n - i - 1]) * p2[n] * p1[i] * comb.combination(n - 1 + i, i)\n )\n p += tmp_bunshi\n p %= MOD\np *= 100\nq *= a + b\nans = Fraction(p, q)\np = ans.numerator\nq = ans.denominator\nprint(((pow(q, MOD - 2, MOD) * p) % MOD))\n", "measured_slow_code_sha256": "afdc02d7fb2abeb1970c2a5c2791e7792fd3f3e6fc1ceb09e19fccefdfb05385", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 5.428806543539475, "pair_id": "python_v2_bd15f36974b075c538e7171d", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03025", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03025_69312b14dacd3fcb1bf39c5fc397d9669916a2bfe08b21a3dfc5a3bcfe7c90ee.jsonl.gz", "inputs": "reproduction/python/inputs/p03025.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03025_afdc02d7fb2abeb1970c2a5c2791e7792fd3f3e6fc1ceb09e19fccefdfb05385.jsonl.gz"}, "slow_code": "class Combination:\n\n def __init__(self, n, MOD):\n self.fact = [1]\n for i in range(1, n + 1):\n self.fact.append(self.fact[-1] * i % MOD)\n self.inv_fact = [pow(self.fact[i], MOD - 2, MOD) for i in range(n + 1)]\n self.MOD = MOD\n\n def factorial(self, k):\n return self.fact[k]\n\n def inverse_factorial(self, k):\n return self.inv_fact[k]\n\n def combination(self, k, r):\n return (self.fact[k] * self.inv_fact[k - r] * self.inv_fact[r]) % self.MOD\n\n\nfrom fractions import Fraction\n\nMOD = 10**9 + 7\nn, a, b, c = list(map(int, input().split()))\n\ncomb = Combination(2 * n, MOD)\nmod_li = [1]\nfor i in range(1, 2 * n + 1):\n mod_li.append(mod_li[-1] * (a + b) % MOD)\np1 = [1]\np2 = [1]\nfor i in range(1, n + 1):\n p1.append((p1[-1] * a) % MOD)\n p2.append((p2[-1] * b) % MOD)\nq = mod_li[2 * n - 1]\np = 0\nfor i in range(n):\n tmp_bunshi = (\n (n + i) * (mod_li[n - i - 1]) * p1[n] * p2[i] * comb.combination(n - 1 + i, i)\n )\n tmp_bunshi += (\n (n + i) * (mod_li[n - i - 1]) * p2[n] * p1[i] * comb.combination(n - 1 + i, i)\n )\n p += tmp_bunshi\n p %= MOD\np *= 100\nq *= a + b\nans = Fraction(p, q)\np = ans.numerator\nq = ans.denominator\nprint(((pow(q, MOD - 2, MOD) * p) % MOD))\n", "slow_code_sha256": "70ddd5f840b4cf045630f383c5a4dc0b67936d1255ea8e844b2833042d45ffc1", "slow_id": "p03025_afdc02d7fb2abeb1970c2a5c2791e7792fd3f3e6fc1ceb09e19fccefdfb05385", "speedup": 5.449047530794823, "stratum": "4-8", "within_pair_jaccard": 0.2631578947368421, "workload": {"case_count": 100, "description": "Repeat games until either player has N wins. Per-game outcomes are first-player win with probability A percent, second-player win B percent, or draw C percent; A+B+C=100 and A+B>0. Output the expected game count modulo 1000000007 as P*Q^(-1). Observed inputs: N=1..100000 (median 42922); A=0..100; B=0..100; C=0..99.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 16, "median": 13.0, "min": 9}, "input_format": ["N A B C"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 4, "median": 4.0, "min": 4}}} -{"case_ids": ["p03449_case_000", "p03449_case_001", "p03449_case_002", "p03449_case_003", "p03449_case_004", "p03449_case_005", "p03449_case_006", "p03449_case_007", "p03449_case_008", "p03449_case_009", "p03449_case_010", "p03449_case_011", "p03449_case_012", "p03449_case_013", "p03449_case_014", "p03449_case_015", "p03449_case_016", "p03449_case_017", "p03449_case_018", "p03449_case_019", "p03449_case_020", "p03449_case_021", "p03449_case_022", "p03449_case_023", "p03449_case_024", "p03449_case_025", "p03449_case_026", "p03449_case_027", "p03449_case_028", "p03449_case_029", "p03449_case_030", "p03449_case_031", "p03449_case_032", "p03449_case_033", "p03449_case_034", "p03449_case_035", "p03449_case_036", "p03449_case_037", "p03449_case_038", "p03449_case_039", "p03449_case_040", "p03449_case_041", "p03449_case_042", "p03449_case_043", "p03449_case_044", "p03449_case_045", "p03449_case_046", "p03449_case_047", "p03449_case_048", "p03449_case_049", "p03449_case_050", "p03449_case_051", "p03449_case_052", "p03449_case_053", "p03449_case_054", "p03449_case_055", "p03449_case_056", "p03449_case_057", "p03449_case_058", "p03449_case_059", "p03449_case_060", "p03449_case_061", "p03449_case_062", "p03449_case_063", "p03449_case_064", "p03449_case_065", "p03449_case_066", "p03449_case_067", "p03449_case_068", "p03449_case_069", "p03449_case_070", "p03449_case_071", "p03449_case_072", "p03449_case_073", "p03449_case_074", "p03449_case_075", "p03449_case_076", "p03449_case_077", "p03449_case_078", "p03449_case_079", "p03449_case_080", "p03449_case_081", "p03449_case_082", "p03449_case_083", "p03449_case_084", "p03449_case_085", "p03449_case_086", "p03449_case_087", "p03449_case_088", "p03449_case_089", "p03449_case_090", "p03449_case_091", "p03449_case_092", "p03449_case_093", "p03449_case_094", "p03449_case_095", "p03449_case_096", "p03449_case_097", "p03449_case_098", "p03449_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N = int(eval(input()))\nnum_list = []\nwhile True:\n try:\n num_list.append(list(map(int, input().split())))\n except:\n break\nsum_list = []\nfor k in range(N):\n sum_list.append(sum(num_list[0][0 : k + 1]) + sum(num_list[1][k : N + 1]))\nprint((max(sum_list)))\n", "fast_code_sha256": "fd102ef97ba97e59a8cb9663116d750b8a6e9941777a02669909b41cee16cf37", "fast_id": "p03449_fd102ef97ba97e59a8cb9663116d750b8a6e9941777a02669909b41cee16cf37", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N = int(eval(input()))\nnum_list = []\nwhile True:\n try:\n num_list.append(list(map(int, input().split())))\n except:\n break\nsum_list = []\nfor k in range(N):\n sum_list.append(sum(num_list[0][0 : k + 1]) + sum(num_list[1][k : N + 1]))\nprint((max(sum_list)))\n", "measured_fast_code_sha256": "fd102ef97ba97e59a8cb9663116d750b8a6e9941777a02669909b41cee16cf37", "measured_slow_code": "#!/usr/bin/env python3\nimport sys\n\n\ndef dfs(x: int, y: int):\n if y == 1 and x == (N - 1):\n return A[y][x]\n elif y > 1 or x > N - 1:\n return 0\n else:\n return max(dfs(x + 1, y), dfs(x, y + 1)) + A[y][x]\n\n\ndef solve(N: int, A: \"List[List[int]]\"):\n print((dfs(0, 0)))\n return\n\n\n# Generated by 1.1.5 https://github.com/kyuridenamida/atcoder-tools (tips: You use the default template now. You can remove this line by using your custom template)\ndef main():\n def iterate_tokens():\n for line in sys.stdin:\n for word in line.split():\n yield word\n\n tokens = iterate_tokens()\n global N, A\n N = int(next(tokens)) # type: int\n A = [\n [int(next(tokens)) for _ in range(N)] for _ in range(2)\n ] # type: \"List[List[int]]\"\n solve(N, A)\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "4f58caefb49442690396b859be0085109334a84091e907cb62b5503b39be5afa", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 7.593807942831124, "pair_id": "python_v2_8bbedf8ced29d802d2a9c9bf", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03449", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03449_fd102ef97ba97e59a8cb9663116d750b8a6e9941777a02669909b41cee16cf37.jsonl.gz", "inputs": "reproduction/python/inputs/p03449.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03449_4f58caefb49442690396b859be0085109334a84091e907cb62b5503b39be5afa.jsonl.gz"}, "slow_code": "import sys\n\n\ndef dfs(x: int, y: int):\n if y == 1 and x == (N - 1):\n return A[y][x]\n elif y > 1 or x > N - 1:\n return 0\n else:\n return max(dfs(x + 1, y), dfs(x, y + 1)) + A[y][x]\n\n\ndef solve(N: int, A: \"List[List[int]]\"):\n print((dfs(0, 0)))\n return\n\n\ndef main():\n def iterate_tokens():\n for line in sys.stdin:\n for word in line.split():\n yield word\n\n tokens = iterate_tokens()\n global N, A\n N = int(next(tokens))\n A = [[int(next(tokens)) for _ in range(N)] for _ in range(2)]\n solve(N, A)\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "16e134b9190b06e98124559663599dcf24302b97cd85dfc00b6b6350ef402631", "slow_id": "p03449_4f58caefb49442690396b859be0085109334a84091e907cb62b5503b39be5afa", "speedup": 5.645028674405993, "stratum": "4-8", "within_pair_jaccard": 0.19230769230769232, "workload": {"case_count": 100, "description": "Traverse a 2-by-N candy grid from (1,1) to (2,N), moving only right or down and collecting each visited cell, including endpoints. Maximize collected candies. Observed inputs: N=1..100 (median 50); A_i_j=1..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 804, "median": 294.5, "min": 6}, "input_format": ["N\nA_1,1 ... A_1,N\nA_2,1 ... A_2,N"], "input_format_status": "source_input_section", "input_lines": {"max": 3, "median": 3.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 201, "median": 101.0, "min": 3}}} -{"case_ids": ["p02570_case_000", "p02570_case_001", "p02570_case_002", "p02570_case_003", "p02570_case_004", "p02570_case_005", "p02570_case_006", "p02570_case_007", "p02570_case_008", "p02570_case_009", "p02570_case_010", "p02570_case_011", "p02570_case_012", "p02570_case_013", "p02570_case_014", "p02570_case_015", "p02570_case_016", "p02570_case_017", "p02570_case_018", "p02570_case_019", "p02570_case_020", "p02570_case_021", "p02570_case_022", "p02570_case_023", "p02570_case_024", "p02570_case_025", "p02570_case_026", "p02570_case_027", "p02570_case_028", "p02570_case_029", "p02570_case_030", "p02570_case_031", "p02570_case_032", "p02570_case_033", "p02570_case_034", "p02570_case_035", "p02570_case_036", "p02570_case_037", "p02570_case_038", "p02570_case_039", "p02570_case_040", "p02570_case_041", "p02570_case_042", "p02570_case_043", "p02570_case_044", "p02570_case_045", "p02570_case_046", "p02570_case_047", "p02570_case_048", "p02570_case_049", "p02570_case_050", "p02570_case_051", "p02570_case_052", "p02570_case_053", "p02570_case_054", "p02570_case_055", "p02570_case_056", "p02570_case_057", "p02570_case_058", "p02570_case_059", "p02570_case_060", "p02570_case_061", "p02570_case_062", "p02570_case_063", "p02570_case_064", "p02570_case_065", "p02570_case_066", "p02570_case_067", "p02570_case_068", "p02570_case_069", "p02570_case_070", "p02570_case_071", "p02570_case_072", "p02570_case_073", "p02570_case_074", "p02570_case_075", "p02570_case_076", "p02570_case_077", "p02570_case_078", "p02570_case_079", "p02570_case_080", "p02570_case_081", "p02570_case_082", "p02570_case_083", "p02570_case_084", "p02570_case_085", "p02570_case_086", "p02570_case_087", "p02570_case_088", "p02570_case_089", "p02570_case_090", "p02570_case_091", "p02570_case_092", "p02570_case_093", "p02570_case_094", "p02570_case_095", "p02570_case_096", "p02570_case_097", "p02570_case_098", "p02570_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "executable_AST_equal_except_explicit_explanatory_string_removal_and_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\nread = sys.stdin.read\nreadlines = sys.stdin.readlines\nfrom collections import Counter\n\n\ndef main():\n d, t, s = list(map(int, input().split()))\n dis = s * t\n if d > dis:\n print(\"No\")\n else:\n print(\"Yes\")\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "fddd0a83774174bd00184a1c73cd6a45e2356da016ece3ad64cf5f3dd5768430", "fast_id": "p02570_fddd0a83774174bd00184a1c73cd6a45e2356da016ece3ad64cf5f3dd5768430", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\nread = sys.stdin.read\nreadlines = sys.stdin.readlines\nfrom collections import Counter\n\n\ndef main():\n d, t, s = list(map(int, input().split()))\n dis = s * t\n if d > dis:\n print(\"No\")\n else:\n print(\"Yes\")\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "fddd0a83774174bd00184a1c73cd6a45e2356da016ece3ad64cf5f3dd5768430", "measured_slow_code": "def LI():\n return list(map(int, input().split()))\n\n\ndef II():\n return int(input())\n\n\ndef yes():\n return print(\"Yes\")\n\n\ndef no():\n return print(\"No\")\n\n\n# INF=float(\"inf\")\n# from collections import deque, defaultdict, Counter\n# from heapq import heappop, heappush\n# from itertools import product, combinations\n# from functools import reduce, lru_cache\n# from math import pi, gcd\n# from decimal import Decimal\nclass Combination:\n \"\"\"\n O(n)の前計算を1回行うことで,O(1)でnCr mod mを求められる\n n_max = 10**6のとき前処理は約950ms (PyPyなら約340ms, 10**7で約1800ms)\n 使用例:\n comb = Combination(1000000)\n print(comb(5, 3)) # 10\n \"\"\"\n\n def __init__(self, n_max, mod=10**9 + 7):\n self.mod = mod\n self.modinv = self.make_modinv_list(n_max)\n self.fac, self.facinv = self.make_factorial_list(n_max)\n\n def __call__(self, n, r):\n return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n - r] % self.mod\n\n def make_factorial_list(self, n):\n # 階乗のリストと階乗のmod逆元のリストを返す O(n)\n # self.make_modinv_list()が先に実行されている必���がある\n fac = [1]\n facinv = [1]\n for i in range(1, n + 1):\n fac.append(fac[i - 1] * i % self.mod)\n facinv.append(facinv[i - 1] * self.modinv[i] % self.mod)\n return fac, facinv\n\n def make_modinv_list(self, n):\n # 0からnまでのmod逆元のリストを返す O(n)\n modinv = [0] * (n + 1)\n modinv[1] = 1\n for i in range(2, n + 1):\n modinv[i] = self.mod - self.mod // i * modinv[self.mod % i] % self.mod\n return modinv\n\n\nclass Unionfind:\n def __init__(self, N):\n self.p = list(range(N))\n self.rank = [0] * N\n self.size = [1] * N\n\n def root(self, x):\n if self.p[x] != x:\n self.p[x] = self.root(self.p[x])\n return self.p[x]\n\n def same(self, x, y):\n return self.root(x) == self.root(y)\n\n def unite(self, x, y):\n u = self.root(x)\n v = self.root(y)\n if u == v:\n return\n if self.rank[u] < self.rank[v]:\n self.p[u] = v\n self.size[v] += self.size[u]\n self.size[u] = 0\n else:\n self.p[v] = u\n self.size[u] += self.size[v]\n self.size[v] = 0\n if self.rank[u] == self.rank[v]:\n self.rank[u] += 1\n\n def count(self, x):\n return self.size[self.root(x)]\n\n\nd, t, s = LI()\nif d <= t * s:\n yes()\nelse:\n no()\n", "measured_slow_code_sha256": "7df3ffb5a8416f2149c9ce5f388659f4fb80cc7488ec540c2ef41ccf0a9e9129", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 6.580120123674129, "pair_id": "python_v2_86cf3b2473d6a96fa97bf11f", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02570", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02570_fddd0a83774174bd00184a1c73cd6a45e2356da016ece3ad64cf5f3dd5768430.jsonl.gz", "inputs": "reproduction/python/inputs/p02570.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02570_7df3ffb5a8416f2149c9ce5f388659f4fb80cc7488ec540c2ef41ccf0a9e9129.jsonl.gz"}, "slow_code": "def LI():\n return list(map(int, input().split()))\n\n\ndef II():\n return int(input())\n\n\ndef yes():\n return print(\"Yes\")\n\n\ndef no():\n return print(\"No\")\n\n\nclass Combination:\n\n def __init__(self, n_max, mod=10**9 + 7):\n self.mod = mod\n self.modinv = self.make_modinv_list(n_max)\n self.fac, self.facinv = self.make_factorial_list(n_max)\n\n def __call__(self, n, r):\n return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n - r] % self.mod\n\n def make_factorial_list(self, n):\n\n fac = [1]\n facinv = [1]\n for i in range(1, n + 1):\n fac.append(fac[i - 1] * i % self.mod)\n facinv.append(facinv[i - 1] * self.modinv[i] % self.mod)\n return fac, facinv\n\n def make_modinv_list(self, n):\n\n modinv = [0] * (n + 1)\n modinv[1] = 1\n for i in range(2, n + 1):\n modinv[i] = self.mod - self.mod // i * modinv[self.mod % i] % self.mod\n return modinv\n\n\nclass Unionfind:\n def __init__(self, N):\n self.p = list(range(N))\n self.rank = [0] * N\n self.size = [1] * N\n\n def root(self, x):\n if self.p[x] != x:\n self.p[x] = self.root(self.p[x])\n return self.p[x]\n\n def same(self, x, y):\n return self.root(x) == self.root(y)\n\n def unite(self, x, y):\n u = self.root(x)\n v = self.root(y)\n if u == v:\n return\n if self.rank[u] < self.rank[v]:\n self.p[u] = v\n self.size[v] += self.size[u]\n self.size[u] = 0\n else:\n self.p[v] = u\n self.size[u] += self.size[v]\n self.size[v] = 0\n if self.rank[u] == self.rank[v]:\n self.rank[u] += 1\n\n def count(self, x):\n return self.size[self.root(x)]\n\n\nd, t, s = LI()\nif d <= t * s:\n yes()\nelse:\n no()\n", "slow_code_sha256": "09b0c0d43abbb6955208c35fb1cca343f1b4cbf34ced526e48c841c54fa3ed5f", "slow_id": "p02570_7df3ffb5a8416f2149c9ce5f388659f4fb80cc7488ec540c2ef41ccf0a9e9129", "speedup": 6.579704590337169, "stratum": "4-8", "within_pair_jaccard": 0.1728395061728395, "workload": {"case_count": 100, "description": "Determine whether traveling distance D meters at constant speed S meters per minute reaches the destination within T minutes. Observed inputs: D=1..10000 (median 823); T=1..10000 (median 471); S=1..10000 (median 523).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 18, "median": 12.0, "min": 6}, "input_format": ["D T S"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3, "median": 3.0, "min": 3}}} -{"case_ids": ["p03136_case_000", "p03136_case_001", "p03136_case_002", "p03136_case_003", "p03136_case_004", "p03136_case_005", "p03136_case_006", "p03136_case_007", "p03136_case_008", "p03136_case_009", "p03136_case_010", "p03136_case_011", "p03136_case_012", "p03136_case_013", "p03136_case_014", "p03136_case_015", "p03136_case_016", "p03136_case_017", "p03136_case_018", "p03136_case_019", "p03136_case_020", "p03136_case_021", "p03136_case_022", "p03136_case_023", "p03136_case_024", "p03136_case_025", "p03136_case_026", "p03136_case_027", "p03136_case_028", "p03136_case_029", "p03136_case_030", "p03136_case_031", "p03136_case_032", "p03136_case_033", "p03136_case_034", "p03136_case_035", "p03136_case_036", "p03136_case_037", "p03136_case_038", "p03136_case_039", "p03136_case_040", "p03136_case_041", "p03136_case_042", "p03136_case_043", "p03136_case_044", "p03136_case_045", "p03136_case_046", "p03136_case_047", "p03136_case_048", "p03136_case_049", "p03136_case_050", "p03136_case_051", "p03136_case_052", "p03136_case_053", "p03136_case_054", "p03136_case_055", "p03136_case_056", "p03136_case_057", "p03136_case_058", "p03136_case_059", "p03136_case_060", "p03136_case_061", "p03136_case_062", "p03136_case_063", "p03136_case_064", "p03136_case_065", "p03136_case_066", "p03136_case_067", "p03136_case_068", "p03136_case_069", "p03136_case_070", "p03136_case_071", "p03136_case_072", "p03136_case_073", "p03136_case_074", "p03136_case_075", "p03136_case_076", "p03136_case_077", "p03136_case_078", "p03136_case_079", "p03136_case_080", "p03136_case_081", "p03136_case_082", "p03136_case_083", "p03136_case_084", "p03136_case_085", "p03136_case_086", "p03136_case_087", "p03136_case_088", "p03136_case_089", "p03136_case_090", "p03136_case_091", "p03136_case_092", "p03136_case_093", "p03136_case_094", "p03136_case_095", "p03136_case_096", "p03136_case_097", "p03136_case_098", "p03136_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\n\ns2nn = lambda s: [int(c) for c in s.split(\" \")]\nss2nn = lambda ss: [int(s) for s in ss]\nss2nnn = lambda ss: [s2nn(s) for s in ss]\ni2s = lambda: sys.stdin.readline().rstrip()\ni2n = lambda: int(i2s())\ni2nn = lambda: s2nn(i2s())\nii2ss = lambda n: [sys.stdin.readline().rstrip() for _ in range(n)]\nii2nn = lambda n: ss2nn(ii2ss(n))\nii2nnn = lambda n: ss2nnn(ii2ss(n))\n\n\ndef main():\n N = i2n()\n L = i2nn()\n L.sort()\n l1 = sum(L[:-1])\n l2 = L[-1]\n if l1 > l2:\n print(\"Yes\")\n else:\n print(\"No\")\n\n\nmain()\n", "fast_code_sha256": "f9578c0fb5e956297cd15169afe302f909b9a50050d5b4ef873208a33154e1b8", "fast_id": "p03136_a0928ef73f64f1466965517f37d75deaa1adfa83984323ee0a56bce7df5edf3a", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "# ContestName\n# URL\nimport sys\n\n# import numpy as np\ns2nn = lambda s: [int(c) for c in s.split(\" \")]\nss2nn = lambda ss: [int(s) for s in ss]\nss2nnn = lambda ss: [s2nn(s) for s in ss]\ni2s = lambda: sys.stdin.readline().rstrip()\ni2n = lambda: int(i2s())\ni2nn = lambda: s2nn(i2s())\nii2ss = lambda n: [sys.stdin.readline().rstrip() for _ in range(n)]\nii2nn = lambda n: ss2nn(ii2ss(n))\nii2nnn = lambda n: ss2nnn(ii2ss(n))\n\n\ndef main():\n N = i2n()\n L = i2nn()\n L.sort()\n l1 = sum(L[:-1])\n l2 = L[-1]\n if l1 > l2:\n print(\"Yes\")\n else:\n print(\"No\")\n\n\nmain()\n", "measured_fast_code_sha256": "a0928ef73f64f1466965517f37d75deaa1adfa83984323ee0a56bce7df5edf3a", "measured_slow_code": "import numpy as np\n\nN = int(eval(input()))\nL = np.array(list(map(int, input().split())))\nL[::-1].sort()\nif L[0] < L[1:].sum():\n print(\"Yes\")\nelse:\n print(\"No\")\n", "measured_slow_code_sha256": "c1d13b37a289cb233c6849d4a958851f4c3b4f284375eaec46ef2e5a34eb2366", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 356.6754382676835, "pair_id": "python_v2_176d22d0a3317a89f34fcdab", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03136", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03136_a0928ef73f64f1466965517f37d75deaa1adfa83984323ee0a56bce7df5edf3a.jsonl.gz", "inputs": "reproduction/python/inputs/p03136.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03136_c1d13b37a289cb233c6849d4a958851f4c3b4f284375eaec46ef2e5a34eb2366.jsonl.gz"}, "slow_code": "import numpy as np\n\nN = int(eval(input()))\nL = np.array(list(map(int, input().split())))\nL[::-1].sort()\nif L[0] < L[1:].sum():\n print(\"Yes\")\nelse:\n print(\"No\")\n", "slow_code_sha256": "c1d13b37a289cb233c6849d4a958851f4c3b4f284375eaec46ef2e5a34eb2366", "slow_id": "p03136_c1d13b37a289cb233c6849d4a958851f4c3b4f284375eaec46ef2e5a34eb2366", "speedup": 356.49775043067694, "stratum": "8+", "within_pair_jaccard": 0.2708333333333333, "workload": {"case_count": 100, "description": "Determine whether N supplied positive side lengths L_i can form a nondegenerate polygon in the plane; convexity is not required. Observed inputs: N=3..10 (median 6); L_i=1..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 43, "median": 17.0, "min": 8}, "input_format": ["N\nL_1 ... L_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 11, "median": 7.0, "min": 4}}} -{"case_ids": ["p02786_case_000", "p02786_case_001", "p02786_case_002", "p02786_case_003", "p02786_case_004", "p02786_case_005", "p02786_case_006", "p02786_case_007", "p02786_case_008", "p02786_case_009", "p02786_case_010", "p02786_case_011", "p02786_case_012", "p02786_case_013", "p02786_case_014", "p02786_case_015", "p02786_case_016", "p02786_case_017", "p02786_case_018", "p02786_case_019", "p02786_case_020", "p02786_case_021", "p02786_case_022", "p02786_case_023", "p02786_case_024", "p02786_case_025", "p02786_case_026", "p02786_case_027", "p02786_case_028", "p02786_case_029", "p02786_case_030", "p02786_case_031", "p02786_case_032", "p02786_case_033", "p02786_case_034", "p02786_case_035", "p02786_case_036", "p02786_case_037", "p02786_case_038", "p02786_case_039", "p02786_case_040", "p02786_case_041", "p02786_case_042", "p02786_case_043", "p02786_case_044", "p02786_case_045", "p02786_case_046", "p02786_case_047", "p02786_case_048", "p02786_case_049", "p02786_case_050", "p02786_case_051", "p02786_case_052", "p02786_case_053", "p02786_case_054", "p02786_case_055", "p02786_case_056", "p02786_case_057", "p02786_case_058", "p02786_case_059", "p02786_case_060", "p02786_case_061", "p02786_case_062", "p02786_case_063", "p02786_case_064", "p02786_case_065", "p02786_case_066", "p02786_case_067", "p02786_case_068", "p02786_case_069", "p02786_case_070", "p02786_case_071", "p02786_case_072", "p02786_case_073", "p02786_case_074", "p02786_case_075", "p02786_case_076", "p02786_case_077", "p02786_case_078", "p02786_case_079", "p02786_case_080", "p02786_case_081", "p02786_case_082", "p02786_case_083", "p02786_case_084", "p02786_case_085", "p02786_case_086", "p02786_case_087", "p02786_case_088", "p02786_case_089", "p02786_case_090", "p02786_case_091", "p02786_case_092", "p02786_case_093", "p02786_case_094", "p02786_case_095", "p02786_case_096", "p02786_case_097", "p02786_case_098", "p02786_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from math import floor\n\n\ndef kill(life):\n if life in list(dp.keys()):\n return dp[life]\n if life == 1:\n dp[life] = 1\n return 1\n elif life > 1:\n dp[life] = kill(floor(life / 2)) * 2 + 1\n return dp[life]\n\n\nh = int(eval(input()))\ndp = {}\nprint((kill(h)))\n", "fast_code_sha256": "4286cea2bb217454f5ecb201542a12761cb923a5fc10ca0c5eaae027acb54b5c", "fast_id": "p02786_4286cea2bb217454f5ecb201542a12761cb923a5fc10ca0c5eaae027acb54b5c", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from math import floor\n\n\ndef kill(life):\n if life in list(dp.keys()):\n return dp[life]\n if life == 1:\n dp[life] = 1\n return 1\n elif life > 1:\n dp[life] = kill(floor(life / 2)) * 2 + 1\n return dp[life]\n\n\nh = int(eval(input()))\ndp = {}\nprint((kill(h)))\n", "measured_fast_code_sha256": "4286cea2bb217454f5ecb201542a12761cb923a5fc10ca0c5eaae027acb54b5c", "measured_slow_code": "import numpy as np\n\nH = eval(input())\nH = int(H)\n\n\ndef count(H):\n count = 1\n while True:\n if int(H / 2) == 0:\n break\n else:\n H = int(H / 2)\n count += 1\n continue\n return count\n\n\nA = 0\nfor i in range(int(count(H))):\n A += 2**i\nprint(A)\n", "measured_slow_code_sha256": "09a65063dc765e4cefad5eee9e2b182a86482cf81649dc4a8e732b6ba516a72e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 640.1060946805118, "pair_id": "python_v2_8ec0f9e5cf2220778a29668c", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02786", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02786_4286cea2bb217454f5ecb201542a12761cb923a5fc10ca0c5eaae027acb54b5c.jsonl.gz", "inputs": "reproduction/python/inputs/p02786.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02786_09a65063dc765e4cefad5eee9e2b182a86482cf81649dc4a8e732b6ba516a72e.jsonl.gz"}, "slow_code": "import numpy as np\n\nH = eval(input())\nH = int(H)\n\n\ndef count(H):\n count = 1\n while True:\n if int(H / 2) == 0:\n break\n else:\n H = int(H / 2)\n count += 1\n continue\n return count\n\n\nA = 0\nfor i in range(int(count(H))):\n A += 2**i\nprint(A)\n", "slow_code_sha256": "09a65063dc765e4cefad5eee9e2b182a86482cf81649dc4a8e732b6ba516a72e", "slow_id": "p02786_09a65063dc765e4cefad5eee9e2b182a86482cf81649dc4a8e732b6ba516a72e", "speedup": 694.4289795233539, "stratum": "8+", "within_pair_jaccard": 0.3055555555555556, "workload": {"case_count": 100, "description": "One monster initially has health H. An attack kills a health-1 monster; a monster of health X>1 instead becomes two monsters of health floor(X/2). Find the minimum attacks to eliminate all monsters. Observed inputs: H=1..1000000000000 (median 9236181246).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 14, "median": 11.5, "min": 2}, "input_format": ["H"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p03575_case_000", "p03575_case_001", "p03575_case_002", "p03575_case_003", "p03575_case_004", "p03575_case_005", "p03575_case_006", "p03575_case_007", "p03575_case_008", "p03575_case_009", "p03575_case_010", "p03575_case_011", "p03575_case_012", "p03575_case_013", "p03575_case_014", "p03575_case_015", "p03575_case_016", "p03575_case_017", "p03575_case_018", "p03575_case_019", "p03575_case_020", "p03575_case_021", "p03575_case_022", "p03575_case_023", "p03575_case_024", "p03575_case_025", "p03575_case_026", "p03575_case_027", "p03575_case_028", "p03575_case_029", "p03575_case_030", "p03575_case_031", "p03575_case_032", "p03575_case_033", "p03575_case_034", "p03575_case_035", "p03575_case_036", "p03575_case_037", "p03575_case_038", "p03575_case_039", "p03575_case_040", "p03575_case_041", "p03575_case_042", "p03575_case_043", "p03575_case_044", "p03575_case_045", "p03575_case_046", "p03575_case_047", "p03575_case_048", "p03575_case_049", "p03575_case_050", "p03575_case_051", "p03575_case_052", "p03575_case_053", "p03575_case_054", "p03575_case_055", "p03575_case_056", "p03575_case_057", "p03575_case_058", "p03575_case_059", "p03575_case_060", "p03575_case_061", "p03575_case_062", "p03575_case_063", "p03575_case_064", "p03575_case_065", "p03575_case_066", "p03575_case_067", "p03575_case_068", "p03575_case_069", "p03575_case_070", "p03575_case_071", "p03575_case_072", "p03575_case_073", "p03575_case_074", "p03575_case_075", "p03575_case_076", "p03575_case_077", "p03575_case_078", "p03575_case_079", "p03575_case_080", "p03575_case_081", "p03575_case_082", "p03575_case_083", "p03575_case_084", "p03575_case_085", "p03575_case_086", "p03575_case_087", "p03575_case_088", "p03575_case_089", "p03575_case_090", "p03575_case_091", "p03575_case_092", "p03575_case_093", "p03575_case_094", "p03575_case_095", "p03575_case_096", "p03575_case_097", "p03575_case_098", "p03575_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N, M = list(map(int, input().split()))\nT = [[0] * N for i in range(N)]\nG = []\nfor i in range(M):\n a, b = [int(x) - 1 for x in input().split()]\n T[a][b] = 1\n T[b][a] = 1\n G.append((a, b))\n\n\ndef check(N, T):\n A = [0] * N\n Q = [0]\n while Q:\n q = Q.pop()\n if A[q]:\n continue\n A[q] = 1\n for c in range(N):\n if T[q][c]:\n Q.append(c)\n return sum(A) != N\n\n\nans = 0\nfor g in G:\n a, b = g[0], g[1]\n T[a][b] = 0\n T[b][a] = 0\n if check(N, T):\n ans += 1\n T[a][b] = 1\n T[b][a] = 1\nprint(ans)\n", "fast_code_sha256": "6b0ce86bdfa788463f730472f9e926f7c1cb2e281bda7dfc76645e3f89072d4f", "fast_id": "p03575_6b0ce86bdfa788463f730472f9e926f7c1cb2e281bda7dfc76645e3f89072d4f", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N, M = list(map(int, input().split()))\nT = [[0] * N for i in range(N)]\nG = []\nfor i in range(M):\n a, b = [int(x) - 1 for x in input().split()]\n T[a][b] = 1\n T[b][a] = 1\n G.append((a, b))\n\n\ndef check(N, T):\n A = [0] * N\n Q = [0]\n while Q:\n q = Q.pop()\n if A[q]:\n continue\n A[q] = 1\n for c in range(N):\n if T[q][c]:\n Q.append(c)\n return sum(A) != N\n\n\nans = 0\nfor g in G:\n a, b = g[0], g[1]\n T[a][b] = 0\n T[b][a] = 0\n if check(N, T):\n ans += 1\n T[a][b] = 1\n T[b][a] = 1\nprint(ans)\n", "measured_fast_code_sha256": "6b0ce86bdfa788463f730472f9e926f7c1cb2e281bda7dfc76645e3f89072d4f", "measured_slow_code": "import sys, re, os\nfrom collections import deque, defaultdict, Counter\nfrom math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians\nfrom itertools import permutations, combinations, product, accumulate\nfrom operator import itemgetter, mul\nfrom copy import deepcopy\nfrom string import ascii_lowercase, ascii_uppercase, digits\nfrom heapq import heapify, heappop, heappush\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef INT():\n return int(eval(input()))\n\n\ndef MAP():\n return list(map(int, input().split()))\n\n\ndef S_MAP():\n return list(map(str, input().split()))\n\n\ndef LIST():\n return list(map(int, input().split()))\n\n\ndef S_LIST():\n return list(map(str, input().split()))\n\n\nsys.setrecursionlimit(10**9)\nINF = float(\"inf\")\nmod = 10**9 + 7\n\n\ndef dijkstra(E, start):\n N_d = len(E)\n dist = [INF] * N_d\n dist[start] = 0\n q = [(0, start)]\n while q:\n dist_v, v = heappop(q)\n if dist[v] != dist_v:\n continue\n for u, dist_vu in E[v]:\n dist_u = dist_v + dist_vu\n if dist_u < dist[u]:\n dist[u] = dist_u\n heappush(q, (dist_u, u))\n return dist\n\n\nN, M = MAP()\nL = [LIST() for i in range(M)]\ngraph = defaultdict(list)\nfor a, b in L:\n graph[a - 1].append((b - 1, 1))\n graph[b - 1].append((a - 1, 1))\nans = 0\nfor i in range(M):\n a, b = L[i]\n E = deepcopy(graph)\n E[a - 1].remove((b - 1, 1))\n E[b - 1].remove((a - 1, 1))\n dist = dijkstra(E, 0)\n if dist.count(INF) > 0:\n ans += 1\nprint(ans)\n", "measured_slow_code_sha256": "3b0c75c5164a810f84adc515ed302d05d4140b865ec422b1df702b4974d0a4da", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 6.714872273665784, "pair_id": "python_v2_f2e9ab48d1c8d2a27f024ccb", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03575", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03575_6b0ce86bdfa788463f730472f9e926f7c1cb2e281bda7dfc76645e3f89072d4f.jsonl.gz", "inputs": "reproduction/python/inputs/p03575.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03575_3b0c75c5164a810f84adc515ed302d05d4140b865ec422b1df702b4974d0a4da.jsonl.gz"}, "slow_code": "import sys, re, os\nfrom collections import deque, defaultdict, Counter\nfrom math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians\nfrom itertools import permutations, combinations, product, accumulate\nfrom operator import itemgetter, mul\nfrom copy import deepcopy\nfrom string import ascii_lowercase, ascii_uppercase, digits\nfrom heapq import heapify, heappop, heappush\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef INT():\n return int(eval(input()))\n\n\ndef MAP():\n return list(map(int, input().split()))\n\n\ndef S_MAP():\n return list(map(str, input().split()))\n\n\ndef LIST():\n return list(map(int, input().split()))\n\n\ndef S_LIST():\n return list(map(str, input().split()))\n\n\nsys.setrecursionlimit(10**9)\nINF = float(\"inf\")\nmod = 10**9 + 7\n\n\ndef dijkstra(E, start):\n N_d = len(E)\n dist = [INF] * N_d\n dist[start] = 0\n q = [(0, start)]\n while q:\n dist_v, v = heappop(q)\n if dist[v] != dist_v:\n continue\n for u, dist_vu in E[v]:\n dist_u = dist_v + dist_vu\n if dist_u < dist[u]:\n dist[u] = dist_u\n heappush(q, (dist_u, u))\n return dist\n\n\nN, M = MAP()\nL = [LIST() for i in range(M)]\ngraph = defaultdict(list)\nfor a, b in L:\n graph[a - 1].append((b - 1, 1))\n graph[b - 1].append((a - 1, 1))\nans = 0\nfor i in range(M):\n a, b = L[i]\n E = deepcopy(graph)\n E[a - 1].remove((b - 1, 1))\n E[b - 1].remove((a - 1, 1))\n dist = dijkstra(E, 0)\n if dist.count(INF) > 0:\n ans += 1\nprint(ans)\n", "slow_code_sha256": "3b0c75c5164a810f84adc515ed302d05d4140b865ec422b1df702b4974d0a4da", "slow_id": "p03575_3b0c75c5164a810f84adc515ed302d05d4140b865ec422b1df702b4974d0a4da", "speedup": 5.786723190932959, "stratum": "4-8", "within_pair_jaccard": 0.23300970873786409, "workload": {"case_count": 100, "description": "Count bridges in a connected simple undirected graph: a bridge is an edge whose removal disconnects it. Vertices are numbered 1..N and each listed edge has a_i B else \"Bob\" if A < B else \"Draw\"))\n", "fast_code_sha256": "8f31da9f181df8d9653ca8231baf892a5417a8ec911591c2e8372961dbc2e140", "fast_id": "p03803_8f31da9f181df8d9653ca8231baf892a5417a8ec911591c2e8372961dbc2e140", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "A, B = list(map(int, input().split()))\nif A == 1:\n A = 14\nif B == 1:\n B = 14\nprint((\"Alice\" if A > B else \"Bob\" if A < B else \"Draw\"))\n", "measured_fast_code_sha256": "8f31da9f181df8d9653ca8231baf892a5417a8ec911591c2e8372961dbc2e140", "measured_slow_code": "import sys, math\nfrom functools import lru_cache\nfrom itertools import accumulate\n\nsys.setrecursionlimit(10**9)\nMOD = 10**9 + 7\n\n\ndef input():\n return sys.stdin.readline()[:-1]\n\n\ndef mi():\n return list(map(int, input().split()))\n\n\ndef ii():\n return int(eval(input()))\n\n\ndef i2(n):\n tmp = [list(mi()) for i in range(n)]\n return [list(i) for i in zip(*tmp)]\n\n\nA, B = mi()\nif A == B:\n print(\"Draw\")\nelif A == 1:\n print(\"Alice\")\nelif B == 1:\n print(\"Bob\")\nelse:\n if A > B:\n print(\"Alice\")\n else:\n print(\"Bob\")\n", "measured_slow_code_sha256": "0bd5df2a157ba82c7c25ec618ddd2b8ac3a7b93747b5c4b4114a2cd42e8e257e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.2014634165149043, "pair_id": "python_v2_973d88571fa32663fa4bcc61", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03803", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03803_8f31da9f181df8d9653ca8231baf892a5417a8ec911591c2e8372961dbc2e140.jsonl.gz", "inputs": "reproduction/python/inputs/p03803.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03803_0bd5df2a157ba82c7c25ec618ddd2b8ac3a7b93747b5c4b4114a2cd42e8e257e.jsonl.gz"}, "slow_code": "import sys, math\nfrom functools import lru_cache\nfrom itertools import accumulate\n\nsys.setrecursionlimit(10**9)\nMOD = 10**9 + 7\n\n\ndef input():\n return sys.stdin.readline()[:-1]\n\n\ndef mi():\n return list(map(int, input().split()))\n\n\ndef ii():\n return int(eval(input()))\n\n\ndef i2(n):\n tmp = [list(mi()) for i in range(n)]\n return [list(i) for i in zip(*tmp)]\n\n\nA, B = mi()\nif A == B:\n print(\"Draw\")\nelif A == 1:\n print(\"Alice\")\nelif B == 1:\n print(\"Bob\")\nelse:\n if A > B:\n print(\"Alice\")\n else:\n print(\"Bob\")\n", "slow_code_sha256": "0bd5df2a157ba82c7c25ec618ddd2b8ac3a7b93747b5c4b4114a2cd42e8e257e", "slow_id": "p03803_0bd5df2a157ba82c7c25ec618ddd2b8ac3a7b93747b5c4b4114a2cd42e8e257e", "speedup": 3.2015363566536488, "stratum": "2-4", "within_pair_jaccard": 0.3181818181818182, "workload": {"case_count": 100, "description": "Compare two card ranks A,B from 1..13. Rank 1 is strongest; the other ranks increase in strength from 2 through 13. Report the first player, second player, or a draw. Observed inputs: A=1..13 (median 6); B=1..13 (median 6.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 6, "median": 4.0, "min": 4}, "input_format": ["A B"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p01224_case_000", "p01224_case_001", "p01224_case_002", "p01224_case_003", "p01224_case_004", "p01224_case_005", "p01224_case_006", "p01224_case_007", "p01224_case_008", "p01224_case_009", "p01224_case_010", "p01224_case_011", "p01224_case_012", "p01224_case_013", "p01224_case_014", "p01224_case_015", "p01224_case_016", "p01224_case_017", "p01224_case_018", "p01224_case_019", "p01224_case_020", "p01224_case_021", "p01224_case_022", "p01224_case_023", "p01224_case_024", "p01224_case_025", "p01224_case_026", "p01224_case_027", "p01224_case_028", "p01224_case_029", "p01224_case_030", "p01224_case_031", "p01224_case_032", "p01224_case_033", "p01224_case_034", "p01224_case_035", "p01224_case_036", "p01224_case_037", "p01224_case_038", "p01224_case_039", "p01224_case_040", "p01224_case_041", "p01224_case_042", "p01224_case_043", "p01224_case_044", "p01224_case_045", "p01224_case_046", "p01224_case_047", "p01224_case_048", "p01224_case_049", "p01224_case_050", "p01224_case_051", "p01224_case_052", "p01224_case_053", "p01224_case_054", "p01224_case_055", "p01224_case_056", "p01224_case_057", "p01224_case_058", "p01224_case_059", "p01224_case_060", "p01224_case_061", "p01224_case_062", "p01224_case_063", "p01224_case_064", "p01224_case_065", "p01224_case_066", "p01224_case_067", "p01224_case_068", "p01224_case_069", "p01224_case_070", "p01224_case_071", "p01224_case_072", "p01224_case_073", "p01224_case_074", "p01224_case_075", "p01224_case_076", "p01224_case_077", "p01224_case_078", "p01224_case_079", "p01224_case_080", "p01224_case_081", "p01224_case_082", "p01224_case_083", "p01224_case_084", "p01224_case_085", "p01224_case_086", "p01224_case_087", "p01224_case_088", "p01224_case_089", "p01224_case_090", "p01224_case_091", "p01224_case_092", "p01224_case_093", "p01224_case_094", "p01224_case_095", "p01224_case_096", "p01224_case_097", "p01224_case_098", "p01224_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "P = \"perfect number\"\nD = \"deficient number\"\nA = \"abundant number\"\nwhile True:\n n = int(input())\n if n == 0:\n break\n if n == 1:\n print(D)\n continue\n su = 1\n t = n\n i = 2\n while i**2 <= t:\n if t % i == 0:\n cnt = 0\n while t % i == 0:\n t /= i\n cnt += 1\n su *= (i ** (cnt + 1) - 1) / (i - 1)\n i += 1\n if t > 1:\n su *= (t**2 - 1) / (t - 1)\n su -= n\n print(P if n == su else (D if su < n else A))\n", "fast_code_sha256": "56cea743b48b7a076bbd9f52c91c7e72f3ce5d3563f4cc35917d717a9d52aee2", "fast_id": "p01224_56cea743b48b7a076bbd9f52c91c7e72f3ce5d3563f4cc35917d717a9d52aee2", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "P = \"perfect number\"\nD = \"deficient number\"\nA = \"abundant number\"\nwhile True:\n n = int(input())\n if n == 0:\n break\n if n == 1:\n print(D)\n continue\n su = 1\n t = n\n i = 2\n while i**2 <= t:\n if t % i == 0:\n cnt = 0\n while t % i == 0:\n t /= i\n cnt += 1\n su *= (i ** (cnt + 1) - 1) / (i - 1)\n i += 1\n if t > 1:\n su *= (t**2 - 1) / (t - 1)\n su -= n\n print(P if n == su else (D if su < n else A))\n", "measured_fast_code_sha256": "56cea743b48b7a076bbd9f52c91c7e72f3ce5d3563f4cc35917d717a9d52aee2", "measured_slow_code": "from math import sqrt\n\nP = \"perfect number\"\nD = \"deficient number\"\nA = \"abundant number\"\nwhile True:\n n = eval(input())\n if n == 0:\n break\n if n == 1:\n print(D)\n continue\n su = 1\n temp = n\n for i in range(2, int(sqrt(n)) + 1):\n cnt = 0\n while temp % i == 0:\n temp /= i\n cnt += 1\n if cnt:\n su *= (i ** (cnt + 1) - 1) / (i - 1)\n if temp == 1:\n su -= n\n break\n if temp != 1:\n su *= (temp**2 - 1) / (temp - 1)\n su -= n\n print(P if n == su else (D if su < n else A))\n", "measured_slow_code_sha256": "66194bc1a7ae54de44e09b5f93d1f79e3416a467c501ca1310dc3f13610e492e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.9906552544428924, "pair_id": "python_v2_310c381616d1b341af082371", "per_case_slow_code_faster_fraction": 0.05, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p01224", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p01224_56cea743b48b7a076bbd9f52c91c7e72f3ce5d3563f4cc35917d717a9d52aee2.jsonl.gz", "inputs": "reproduction/python/inputs/p01224.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p01224_66194bc1a7ae54de44e09b5f93d1f79e3416a467c501ca1310dc3f13610e492e.jsonl.gz"}, "slow_code": "from math import sqrt\n\nP = \"perfect number\"\nD = \"deficient number\"\nA = \"abundant number\"\nwhile True:\n n = eval(input())\n if n == 0:\n break\n if n == 1:\n print(D)\n continue\n su = 1\n temp = n\n for i in range(2, int(sqrt(n)) + 1):\n cnt = 0\n while temp % i == 0:\n temp /= i\n cnt += 1\n if cnt:\n su *= (i ** (cnt + 1) - 1) / (i - 1)\n if temp == 1:\n su -= n\n break\n if temp != 1:\n su *= (temp**2 - 1) / (temp - 1)\n su -= n\n print(P if n == su else (D if su < n else A))\n", "slow_code_sha256": "66194bc1a7ae54de44e09b5f93d1f79e3416a467c501ca1310dc3f13610e492e", "slow_id": "p01224_66194bc1a7ae54de44e09b5f93d1f79e3416a467c501ca1310dc3f13610e492e", "speedup": 2.339444045115134, "stratum": "2-4", "within_pair_jaccard": 0.696969696969697, "workload": {"case_count": 100, "description": "For each positive integer N, compare N with the sum of its positive divisors excluding N itself. Classify it as perfect, deficient or abundant when the sum equals, is below or exceeds N, respectively. A final zero ends the queries. Observed inputs: datasets=1..100 (median 50); N=1..100000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 896, "median": 202.0, "min": 4}, "input_format": ["N_1\n...\nN_D\n0"], "input_format_status": "source_input_section", "input_lines": {"max": 101, "median": 51.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 101, "median": 51.0, "min": 2}}} -{"case_ids": ["p02780_case_000", "p02780_case_001", "p02780_case_002", "p02780_case_003", "p02780_case_004", "p02780_case_005", "p02780_case_006", "p02780_case_007", "p02780_case_008", "p02780_case_009", "p02780_case_010", "p02780_case_011", "p02780_case_012", "p02780_case_013", "p02780_case_014", "p02780_case_015", "p02780_case_016", "p02780_case_017", "p02780_case_018", "p02780_case_019", "p02780_case_020", "p02780_case_021", "p02780_case_022", "p02780_case_023", "p02780_case_024", "p02780_case_025", "p02780_case_026", "p02780_case_027", "p02780_case_028", "p02780_case_029", "p02780_case_030", "p02780_case_031", "p02780_case_032", "p02780_case_033", "p02780_case_034", "p02780_case_035", "p02780_case_036", "p02780_case_037", "p02780_case_038", "p02780_case_039", "p02780_case_040", "p02780_case_041", "p02780_case_042", "p02780_case_043", "p02780_case_044", "p02780_case_045", "p02780_case_046", "p02780_case_047", "p02780_case_048", "p02780_case_049", "p02780_case_050", "p02780_case_051", "p02780_case_052", "p02780_case_053", "p02780_case_054", "p02780_case_055", "p02780_case_056", "p02780_case_057", "p02780_case_058", "p02780_case_059", "p02780_case_060", "p02780_case_061", "p02780_case_062", "p02780_case_063", "p02780_case_064", "p02780_case_065", "p02780_case_066", "p02780_case_067", "p02780_case_068", "p02780_case_069", "p02780_case_070", "p02780_case_071", "p02780_case_072", "p02780_case_073", "p02780_case_074", "p02780_case_075", "p02780_case_076", "p02780_case_077", "p02780_case_078", "p02780_case_079", "p02780_case_080", "p02780_case_081", "p02780_case_082", "p02780_case_083", "p02780_case_084", "p02780_case_085", "p02780_case_086", "p02780_case_087", "p02780_case_088", "p02780_case_089", "p02780_case_090", "p02780_case_091", "p02780_case_092", "p02780_case_093", "p02780_case_094", "p02780_case_095", "p02780_case_096", "p02780_case_097", "p02780_case_098", "p02780_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N, K = list(map(int, input().split()))\np = list(map(int, input().split()))\nexp = [(1 + p[i]) / 2 for i in range(N)]\ns = sum(exp[:K])\nans = s\nfor i in range(K, N):\n s -= exp[i - K]\n s += exp[i]\n ans = max(ans, s)\nprint(ans)\n", "fast_code_sha256": "bd2f23791d3c2e6f8ca046d0d74149d26f8793e5e97d3905c1acd4d775938e74", "fast_id": "p02780_bd2f23791d3c2e6f8ca046d0d74149d26f8793e5e97d3905c1acd4d775938e74", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N, K = list(map(int, input().split()))\np = list(map(int, input().split()))\nexp = [(1 + p[i]) / 2 for i in range(N)]\ns = sum(exp[:K])\nans = s\nfor i in range(K, N):\n s -= exp[i - K]\n s += exp[i]\n ans = max(ans, s)\nprint(ans)\n", "measured_fast_code_sha256": "bd2f23791d3c2e6f8ca046d0d74149d26f8793e5e97d3905c1acd4d775938e74", "measured_slow_code": "class BIT:\n def __init__(self, n):\n self.node = [0 for _ in range(n + 1)]\n\n def add(self, idx, w):\n i = idx\n while i < len(self.node) - 1:\n self.node[i] += w\n i |= i + 1\n\n def sum_(self, idx):\n ret, i = 0, idx - 1\n while i >= 0:\n ret += self.node[i]\n i = (i & (i + 1)) - 1\n return ret\n\n def sum(self, l, r):\n return self.sum_(r) - self.sum_(l)\n\n\nn, k = list(map(int, input().split()))\ntree = BIT(n)\np = [int(x) for x in input().split()]\nfor i in range(n):\n tree.add(i, (1 + p[i]) / 2)\nans = 0\nfor i in range(n - k + 1):\n ans = max(ans, tree.sum(i, i + k))\nprint(ans)\n", "measured_slow_code_sha256": "f0e0a2a27a21da5cf3bfa118c0651e9d7851f3f79494b7c4374dbb95d552c6f4", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 6.055545151855647, "pair_id": "python_v2_15757e254469b9b123225643", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02780", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02780_bd2f23791d3c2e6f8ca046d0d74149d26f8793e5e97d3905c1acd4d775938e74.jsonl.gz", "inputs": "reproduction/python/inputs/p02780.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02780_f0e0a2a27a21da5cf3bfa118c0651e9d7851f3f79494b7c4374dbb95d552c6f4.jsonl.gz"}, "slow_code": "class BIT:\n def __init__(self, n):\n self.node = [0 for _ in range(n + 1)]\n\n def add(self, idx, w):\n i = idx\n while i < len(self.node) - 1:\n self.node[i] += w\n i |= i + 1\n\n def sum_(self, idx):\n ret, i = 0, idx - 1\n while i >= 0:\n ret += self.node[i]\n i = (i & (i + 1)) - 1\n return ret\n\n def sum(self, l, r):\n return self.sum_(r) - self.sum_(l)\n\n\nn, k = list(map(int, input().split()))\ntree = BIT(n)\np = [int(x) for x in input().split()]\nfor i in range(n):\n tree.add(i, (1 + p[i]) / 2)\nans = 0\nfor i in range(n - k + 1):\n ans = max(ans, tree.sum(i, i + k))\nprint(ans)\n", "slow_code_sha256": "f0e0a2a27a21da5cf3bfa118c0651e9d7851f3f79494b7c4374dbb95d552c6f4", "slow_id": "p02780_f0e0a2a27a21da5cf3bfa118c0651e9d7851f3f79494b7c4374dbb95d552c6f4", "speedup": 4.928358762587977, "stratum": "4-8", "within_pair_jaccard": 0.38095238095238093, "workload": {"case_count": 100, "description": "Die i independently yields an integer uniformly from 1 to p_i. Choose K consecutive dice among N to maximize the expected sum of the rolls. Observed inputs: N=1..200000 (median 1000); K=1..200000 (median 5); p_i=1..1000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1000014, "median": 3877.5, "min": 8}, "input_format": ["N K\np_1 ... p_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200002, "median": 1002.0, "min": 3}}} -{"case_ids": ["p02573_case_000", "p02573_case_001", "p02573_case_002", "p02573_case_003", "p02573_case_004", "p02573_case_005", "p02573_case_006", "p02573_case_007", "p02573_case_008", "p02573_case_009", "p02573_case_010", "p02573_case_011", "p02573_case_012", "p02573_case_013", "p02573_case_014", "p02573_case_015", "p02573_case_016", "p02573_case_017", "p02573_case_018", "p02573_case_019", "p02573_case_020", "p02573_case_021", "p02573_case_022", "p02573_case_023", "p02573_case_024", "p02573_case_025", "p02573_case_026", "p02573_case_027", "p02573_case_028", "p02573_case_029", "p02573_case_030", "p02573_case_031", "p02573_case_032", "p02573_case_033", "p02573_case_034", "p02573_case_035", "p02573_case_036", "p02573_case_037", "p02573_case_038", "p02573_case_039", "p02573_case_040", "p02573_case_041", "p02573_case_042", "p02573_case_043", "p02573_case_044", "p02573_case_045", "p02573_case_046", "p02573_case_047", "p02573_case_048", "p02573_case_049", "p02573_case_050", "p02573_case_051", "p02573_case_052", "p02573_case_053", "p02573_case_054", "p02573_case_055", "p02573_case_056", "p02573_case_057", "p02573_case_058", "p02573_case_059", "p02573_case_060", "p02573_case_061", "p02573_case_062", "p02573_case_063", "p02573_case_064", "p02573_case_065", "p02573_case_066", "p02573_case_067", "p02573_case_068", "p02573_case_069", "p02573_case_070", "p02573_case_071", "p02573_case_072", "p02573_case_073", "p02573_case_074", "p02573_case_075", "p02573_case_076", "p02573_case_077", "p02573_case_078", "p02573_case_079", "p02573_case_080", "p02573_case_081", "p02573_case_082", "p02573_case_083", "p02573_case_084", "p02573_case_085", "p02573_case_086", "p02573_case_087", "p02573_case_088", "p02573_case_089", "p02573_case_090", "p02573_case_091", "p02573_case_092", "p02573_case_093", "p02573_case_094", "p02573_case_095", "p02573_case_096", "p02573_case_097", "p02573_case_098", "p02573_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\ninput = sys.stdin.readline\nn, m = list(map(int, input().split()))\nes = [[] for _ in range(n)]\nfor i in range(m):\n a, b = list(map(int, input().split()))\n es[a - 1].append(b - 1)\n es[b - 1].append(a - 1)\nans = 0\nfrom collections import deque\n\nused = [0 for _ in range(n)]\nfor i in range(n):\n if used[i] == 0:\n d = deque([i])\n cnt = 0\n while d:\n now = d.popleft()\n cnt += 1\n used[now] = 1\n for e in es[now]:\n if used[e] == 0:\n used[e] = 1\n d.append(e)\n ans = max(cnt, ans)\nprint(ans)\n", "fast_code_sha256": "80763d8bbf9160e605a9a5d877f1e2a5dd0cda59fe5c5e3bbffe19852d02222b", "fast_id": "p02573_80763d8bbf9160e605a9a5d877f1e2a5dd0cda59fe5c5e3bbffe19852d02222b", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\ninput = sys.stdin.readline\nn, m = list(map(int, input().split()))\nes = [[] for _ in range(n)]\nfor i in range(m):\n a, b = list(map(int, input().split()))\n es[a - 1].append(b - 1)\n es[b - 1].append(a - 1)\nans = 0\nfrom collections import deque\n\nused = [0 for _ in range(n)]\nfor i in range(n):\n if used[i] == 0:\n d = deque([i])\n cnt = 0\n while d:\n now = d.popleft()\n cnt += 1\n used[now] = 1\n for e in es[now]:\n if used[e] == 0:\n used[e] = 1\n d.append(e)\n ans = max(cnt, ans)\nprint(ans)\n", "measured_fast_code_sha256": "80763d8bbf9160e605a9a5d877f1e2a5dd0cda59fe5c5e3bbffe19852d02222b", "measured_slow_code": "class UFTree:\n def __init__(self, N):\n self.nodes = [Node(i) for i in range(N)]\n self.N = N\n\n def find_max_child_num(self):\n result = 0\n for i in range(self.N):\n result = max(result, self.nodes[i].child_num)\n return result\n\n\nclass Node:\n def __init__(self, ID):\n self.ID = ID\n self.parent = None\n self.child_num = 0\n self.rank = 1\n\n def get_root(self):\n if self.parent is None:\n return self\n return self.parent.get_root()\n\n def is_in_same_tree(self, another):\n return self.get_root().ID == another.get_root().ID\n\n def concat(self, another):\n if self.is_in_same_tree(another):\n return\n sr = self.get_root()\n ar = another.get_root()\n if sr.rank > ar.rank:\n parent, child = sr, ar\n else:\n parent, child = ar, sr\n parent.child_num += child.child_num + 1\n parent.rank = max(parent.rank, child.rank + 1)\n child.parent = parent\n\n\nN, M = list(map(int, input().split()))\ntree = UFTree(N)\nAB = []\nfor i in range(M):\n l = list(map(int, input().split()))\n AB.append(l)\nfor i in range(M):\n a, b = AB[i][0], AB[i][1]\n a -= 1\n b -= 1\n tree.nodes[a].concat(tree.nodes[b])\n# # for debug\n# for i in range(N):\n# n = tree.nodes[i]\n# if n.parent is None:\n# print(i + 1, \"is root\")\n# else:\n# print(\"parent of\", i + 1, \"is\", n.parent.ID + 1)\nprint((tree.find_max_child_num() + 1))\n", "measured_slow_code_sha256": "61baf93eb941c46a29ae15eea5da6ae278cbf5a1e1d3cae98504f09eefb23457", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.0756593906584646, "pair_id": "python_v2_cddd35637d03a8b6d91f3869", "per_case_slow_code_faster_fraction": 0.02, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02573", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02573_80763d8bbf9160e605a9a5d877f1e2a5dd0cda59fe5c5e3bbffe19852d02222b.jsonl.gz", "inputs": "reproduction/python/inputs/p02573.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02573_61baf93eb941c46a29ae15eea5da6ae278cbf5a1e1d3cae98504f09eefb23457.jsonl.gz"}, "slow_code": "class UFTree:\n def __init__(self, N):\n self.nodes = [Node(i) for i in range(N)]\n self.N = N\n\n def find_max_child_num(self):\n result = 0\n for i in range(self.N):\n result = max(result, self.nodes[i].child_num)\n return result\n\n\nclass Node:\n def __init__(self, ID):\n self.ID = ID\n self.parent = None\n self.child_num = 0\n self.rank = 1\n\n def get_root(self):\n if self.parent is None:\n return self\n return self.parent.get_root()\n\n def is_in_same_tree(self, another):\n return self.get_root().ID == another.get_root().ID\n\n def concat(self, another):\n if self.is_in_same_tree(another):\n return\n sr = self.get_root()\n ar = another.get_root()\n if sr.rank > ar.rank:\n parent, child = sr, ar\n else:\n parent, child = ar, sr\n parent.child_num += child.child_num + 1\n parent.rank = max(parent.rank, child.rank + 1)\n child.parent = parent\n\n\nN, M = list(map(int, input().split()))\ntree = UFTree(N)\nAB = []\nfor i in range(M):\n l = list(map(int, input().split()))\n AB.append(l)\nfor i in range(M):\n a, b = AB[i][0], AB[i][1]\n a -= 1\n b -= 1\n tree.nodes[a].concat(tree.nodes[b])\n\n\nprint((tree.find_max_child_num() + 1))\n", "slow_code_sha256": "8e42dd739f11f939e13d222704f39ba6136c1588861267c41088dccb0e91dc37", "slow_id": "p02573_61baf93eb941c46a29ae15eea5da6ae278cbf5a1e1d3cae98504f09eefb23457", "speedup": 2.0082232129420436, "stratum": "2-4", "within_pair_jaccard": 0.26153846153846155, "workload": {"case_count": 100, "description": "M given undirected friendship facts on N people imply all friendships by transitivity. Partition everyone into as few groups as possible with no friends together. Repeated facts are allowed, but a fact never joins a person to themself. Observed inputs: N=2..200000 (median 10000); M=0..200000 (median 20000).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 2578581, "median": 195468.5, "min": 4}, "input_format": ["N M\nA_1 B_1\n...\nA_M B_M"], "input_format_status": "source_input_section", "input_lines": {"max": 200001, "median": 20001.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 400002, "median": 40002.0, "min": 2}}} -{"case_ids": ["p02417_case_000", "p02417_case_001", "p02417_case_002", "p02417_case_003", "p02417_case_004", "p02417_case_005", "p02417_case_006", "p02417_case_007", "p02417_case_008", "p02417_case_009", "p02417_case_010", "p02417_case_011", "p02417_case_012", "p02417_case_013", "p02417_case_014", "p02417_case_015", "p02417_case_016", "p02417_case_017", "p02417_case_018", "p02417_case_019", "p02417_case_020", "p02417_case_021", "p02417_case_022", "p02417_case_023", "p02417_case_024", "p02417_case_025", "p02417_case_026", "p02417_case_027", "p02417_case_028", "p02417_case_029", "p02417_case_030", "p02417_case_031", "p02417_case_032", "p02417_case_033", "p02417_case_034", "p02417_case_035", "p02417_case_036", "p02417_case_037", "p02417_case_038", "p02417_case_039", "p02417_case_040", "p02417_case_041", "p02417_case_042", "p02417_case_043", "p02417_case_044", "p02417_case_045", "p02417_case_046", "p02417_case_047", "p02417_case_048", "p02417_case_049", "p02417_case_050", "p02417_case_051", "p02417_case_052", "p02417_case_053", "p02417_case_054", "p02417_case_055", "p02417_case_056", "p02417_case_057", "p02417_case_058", "p02417_case_059", "p02417_case_060", "p02417_case_061", "p02417_case_062", "p02417_case_063", "p02417_case_064", "p02417_case_065", "p02417_case_066", "p02417_case_067", "p02417_case_068", "p02417_case_069", "p02417_case_070", "p02417_case_071", "p02417_case_072", "p02417_case_073", "p02417_case_074", "p02417_case_075", "p02417_case_076", "p02417_case_077", "p02417_case_078", "p02417_case_079", "p02417_case_080", "p02417_case_081", "p02417_case_082", "p02417_case_083", "p02417_case_084", "p02417_case_085", "p02417_case_086", "p02417_case_087", "p02417_case_088", "p02417_case_089", "p02417_case_090", "p02417_case_091", "p02417_case_092", "p02417_case_093", "p02417_case_094", "p02417_case_095", "p02417_case_096", "p02417_case_097", "p02417_case_098", "p02417_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "alpha = \"abcdefghijklmnopqrstuvwxyz\"\ntext = \"\"\nwhile True:\n try:\n text += input().lower()\n except:\n break\n[print(\"{} : {}\".format(key, text.count(key))) for key in alpha]\n", "fast_code_sha256": "d6b6871e692160af7f0d73d4608c82582507b0bb8a329d5b9f01972611b52bcc", "fast_id": "p02417_d6b6871e692160af7f0d73d4608c82582507b0bb8a329d5b9f01972611b52bcc", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "alpha = \"abcdefghijklmnopqrstuvwxyz\"\ntext = \"\"\nwhile True:\n try:\n text += input().lower()\n except:\n break\n[print(\"{} : {}\".format(key, text.count(key))) for key in alpha]\n", "measured_fast_code_sha256": "d6b6871e692160af7f0d73d4608c82582507b0bb8a329d5b9f01972611b52bcc", "measured_slow_code": "a = [0] * 26\nw = \"abcdefghijklmnopqrstuvwxyz\"\ntry:\n while True:\n s = list(input().upper())\n for i in s:\n if i == \"A\":\n a[0] += 1\n elif i == \"B\":\n a[1] += 1\n elif i == \"C\":\n a[2] += 1\n elif i == \"D\":\n a[3] += 1\n elif i == \"E\":\n a[4] += 1\n elif i == \"F\":\n a[5] += 1\n elif i == \"G\":\n a[6] += 1\n elif i == \"H\":\n a[7] += 1\n elif i == \"I\":\n a[8] += 1\n elif i == \"J\":\n a[9] += 1\n elif i == \"K\":\n a[10] += 1\n elif i == \"L\":\n a[11] += 1\n elif i == \"M\":\n a[12] += 1\n elif i == \"N\":\n a[13] += 1\n elif i == \"O\":\n a[14] += 1\n elif i == \"P\":\n a[15] += 1\n elif i == \"Q\":\n a[16] += 1\n elif i == \"R\":\n a[17] += 1\n elif i == \"S\":\n a[18] += 1\n elif i == \"T\":\n a[19] += 1\n elif i == \"U\":\n a[20] += 1\n elif i == \"V\":\n a[21] += 1\n elif i == \"W\":\n a[22] += 1\n elif i == \"X\":\n a[23] += 1\n elif i == \"Y\":\n a[24] += 1\n elif i == \"Z\":\n a[25] += 1\nexcept EOFError:\n pass\nfor i in range(26):\n print(w[i : i + 1], \":\", str(a[i]))\n", "measured_slow_code_sha256": "eba8ff064d91bd334752fa85969781cb8d76d5d6444c4537dbf886c48a0fb75f", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 7.643809268303354, "pair_id": "python_v2_6db60b2e61755fef4e8337ea", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02417", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02417_d6b6871e692160af7f0d73d4608c82582507b0bb8a329d5b9f01972611b52bcc.jsonl.gz", "inputs": "reproduction/python/inputs/p02417.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02417_eba8ff064d91bd334752fa85969781cb8d76d5d6444c4537dbf886c48a0fb75f.jsonl.gz"}, "slow_code": "a = [0] * 26\nw = \"abcdefghijklmnopqrstuvwxyz\"\ntry:\n while True:\n s = list(input().upper())\n for i in s:\n if i == \"A\":\n a[0] += 1\n elif i == \"B\":\n a[1] += 1\n elif i == \"C\":\n a[2] += 1\n elif i == \"D\":\n a[3] += 1\n elif i == \"E\":\n a[4] += 1\n elif i == \"F\":\n a[5] += 1\n elif i == \"G\":\n a[6] += 1\n elif i == \"H\":\n a[7] += 1\n elif i == \"I\":\n a[8] += 1\n elif i == \"J\":\n a[9] += 1\n elif i == \"K\":\n a[10] += 1\n elif i == \"L\":\n a[11] += 1\n elif i == \"M\":\n a[12] += 1\n elif i == \"N\":\n a[13] += 1\n elif i == \"O\":\n a[14] += 1\n elif i == \"P\":\n a[15] += 1\n elif i == \"Q\":\n a[16] += 1\n elif i == \"R\":\n a[17] += 1\n elif i == \"S\":\n a[18] += 1\n elif i == \"T\":\n a[19] += 1\n elif i == \"U\":\n a[20] += 1\n elif i == \"V\":\n a[21] += 1\n elif i == \"W\":\n a[22] += 1\n elif i == \"X\":\n a[23] += 1\n elif i == \"Y\":\n a[24] += 1\n elif i == \"Z\":\n a[25] += 1\nexcept EOFError:\n pass\nfor i in range(26):\n print(w[i : i + 1], \":\", str(a[i]))\n", "slow_code_sha256": "eba8ff064d91bd334752fa85969781cb8d76d5d6444c4537dbf886c48a0fb75f", "slow_id": "p02417_eba8ff064d91bd334752fa85969781cb8d76d5d6444c4537dbf886c48a0fb75f", "speedup": 7.954515057800551, "stratum": "4-8", "within_pair_jaccard": 0.1111111111111111, "workload": {"case_count": 100, "description": "Read all text until end of input and count occurrences of each English letter a..z without distinguishing uppercase and lowercase. Other characters do not contribute to the letter counts. Input may contain multiple lines. Observed inputs: lines=1..119 (median 10); content_characters=0..1199 (median 450); ascii_letters=0..1199 (median 300).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1317, "median": 495.0, "min": 1}, "input_format": ["[text lines until EOF]"], "input_format_status": "source_input_section", "input_lines": {"max": 119, "median": 10.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 199, "median": 20.0, "min": 0}}} -{"case_ids": ["p02831_case_000", "p02831_case_001", "p02831_case_002", "p02831_case_003", "p02831_case_004", "p02831_case_005", "p02831_case_006", "p02831_case_007", "p02831_case_008", "p02831_case_009", "p02831_case_010", "p02831_case_011", "p02831_case_012", "p02831_case_013", "p02831_case_014", "p02831_case_015", "p02831_case_016", "p02831_case_017", "p02831_case_018", "p02831_case_019", "p02831_case_020", "p02831_case_021", "p02831_case_022", "p02831_case_023", "p02831_case_024", "p02831_case_025", "p02831_case_026", "p02831_case_027", "p02831_case_028", "p02831_case_029", "p02831_case_030", "p02831_case_031", "p02831_case_032", "p02831_case_033", "p02831_case_034", "p02831_case_035", "p02831_case_036", "p02831_case_037", "p02831_case_038", "p02831_case_039", "p02831_case_040", "p02831_case_041", "p02831_case_042", "p02831_case_043", "p02831_case_044", "p02831_case_045", "p02831_case_046", "p02831_case_047", "p02831_case_048", "p02831_case_049", "p02831_case_050", "p02831_case_051", "p02831_case_052", "p02831_case_053", "p02831_case_054", "p02831_case_055", "p02831_case_056", "p02831_case_057", "p02831_case_058", "p02831_case_059", "p02831_case_060", "p02831_case_061", "p02831_case_062", "p02831_case_063", "p02831_case_064", "p02831_case_065", "p02831_case_066", "p02831_case_067", "p02831_case_068", "p02831_case_069", "p02831_case_070", "p02831_case_071", "p02831_case_072", "p02831_case_073", "p02831_case_074", "p02831_case_075", "p02831_case_076", "p02831_case_077", "p02831_case_078", "p02831_case_079", "p02831_case_080", "p02831_case_081", "p02831_case_082", "p02831_case_083", "p02831_case_084", "p02831_case_085", "p02831_case_086", "p02831_case_087", "p02831_case_088", "p02831_case_089", "p02831_case_090", "p02831_case_091", "p02831_case_092", "p02831_case_093", "p02831_case_094", "p02831_case_095", "p02831_case_096", "p02831_case_097", "p02831_case_098", "p02831_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "a, b = list(map(int, input().split()))\n\n\nlcm = 0\nfor i in range(1, b + 1):\n if (a * i) % b == 0:\n lcm = a * i\n break\nprint(lcm)\n", "fast_code_sha256": "ad15dfc499da082f4d9ae1e4bd642828f2041a0f8458603ec4a6a281e75788aa", "fast_id": "p02831_a9ccc957e4a5b3baec5986744f600e314f6759e39921b5a2449786c280ec9aa7", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "a, b = list(map(int, input().split()))\n# aの倍数を順に探索する\n# abはa, bの公倍数なので、高々B回で十分。O(B)\nlcm = 0\nfor i in range(1, b + 1):\n if (a * i) % b == 0:\n lcm = a * i\n break\nprint(lcm)\n", "measured_fast_code_sha256": "a9ccc957e4a5b3baec5986744f600e314f6759e39921b5a2449786c280ec9aa7", "measured_slow_code": "a, b = list(map(int, input().split()))\ngcd = 0\nfor i in range(max(a, b), 0, -1):\n if a % i == 0 and b % i == 0:\n gcd = i\n break\nprint((a * b // gcd))\n", "measured_slow_code_sha256": "3de3fe8bb1afacef9e4d94cddd67b61d71115eb2182c7ba15fc5dcbd918bfe9c", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.1569227238284323, "pair_id": "python_v2_a7bf3b340074b3420700dca1", "per_case_slow_code_faster_fraction": 0.4, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02831", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02831_a9ccc957e4a5b3baec5986744f600e314f6759e39921b5a2449786c280ec9aa7.jsonl.gz", "inputs": "reproduction/python/inputs/p02831.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02831_3de3fe8bb1afacef9e4d94cddd67b61d71115eb2182c7ba15fc5dcbd918bfe9c.jsonl.gz"}, "slow_code": "a, b = list(map(int, input().split()))\ngcd = 0\nfor i in range(max(a, b), 0, -1):\n if a % i == 0 and b % i == 0:\n gcd = i\n break\nprint((a * b // gcd))\n", "slow_code_sha256": "3de3fe8bb1afacef9e4d94cddd67b61d71115eb2182c7ba15fc5dcbd918bfe9c", "slow_id": "p02831_3de3fe8bb1afacef9e4d94cddd67b61d71115eb2182c7ba15fc5dcbd918bfe9c", "speedup": 3.3620162362294628, "stratum": "2-4", "within_pair_jaccard": 0.8, "workload": {"case_count": 100, "description": "Find the minimum positive number of indivisible snack pieces that can be distributed equally either to A guests or to B guests, with each guest receiving at least one piece. A and B differ. Observed inputs: A=1..100000 (median 59009.5); B=1..99999 (median 42628).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 13, "median": 12.0, "min": 4}, "input_format": ["A B"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p04000_case_000", "p04000_case_001", "p04000_case_002", "p04000_case_003", "p04000_case_004", "p04000_case_005", "p04000_case_006", "p04000_case_007", "p04000_case_008", "p04000_case_009", "p04000_case_010", "p04000_case_011", "p04000_case_012", "p04000_case_013", "p04000_case_014", "p04000_case_015", "p04000_case_016", "p04000_case_017", "p04000_case_018", "p04000_case_019", "p04000_case_020", "p04000_case_021", "p04000_case_022", "p04000_case_023", "p04000_case_024", "p04000_case_025", "p04000_case_026", "p04000_case_027", "p04000_case_028", "p04000_case_029", "p04000_case_030", "p04000_case_031", "p04000_case_032", "p04000_case_033", "p04000_case_034", "p04000_case_035", "p04000_case_036", "p04000_case_037", "p04000_case_038", "p04000_case_039", "p04000_case_040", "p04000_case_041", "p04000_case_042", "p04000_case_043", "p04000_case_044", "p04000_case_045", "p04000_case_046", "p04000_case_047", "p04000_case_048", "p04000_case_049", "p04000_case_050", "p04000_case_051", "p04000_case_052", "p04000_case_053", "p04000_case_054", "p04000_case_055", "p04000_case_056", "p04000_case_057", "p04000_case_058", "p04000_case_059", "p04000_case_060", "p04000_case_061", "p04000_case_062", "p04000_case_063", "p04000_case_064", "p04000_case_065", "p04000_case_066", "p04000_case_067", "p04000_case_068", "p04000_case_069", "p04000_case_070", "p04000_case_071", "p04000_case_072", "p04000_case_073", "p04000_case_074", "p04000_case_075", "p04000_case_076", "p04000_case_077", "p04000_case_078", "p04000_case_079", "p04000_case_080", "p04000_case_081", "p04000_case_082", "p04000_case_083", "p04000_case_084", "p04000_case_085", "p04000_case_086", "p04000_case_087", "p04000_case_088", "p04000_case_089", "p04000_case_090", "p04000_case_091", "p04000_case_092", "p04000_case_093", "p04000_case_094", "p04000_case_095", "p04000_case_096", "p04000_case_097", "p04000_case_098", "p04000_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "h, w, n = map(int, input().split())\nfrom itertools import product as pr\nfrom collections import Counter as co\n\nans = [(h - 2) * (w - 2)] + [0] * 9\nio = [tuple(map(int, input().split())) for i in range(n)]\nfor k, v in co(\n co(\n [\n (a - x) * w + b - y\n for x, y in pr(range(3), repeat=2)\n for a, b in io\n if h - 1 > a - x > 0 < b - y < w - 1\n ]\n ).values()\n).items():\n ans[k] = v\n ans[0] -= v\nprint(*ans, sep=\"\\n\")\n", "fast_code_sha256": "179f19d32bfd3c7f375699a4c65c546ee213f4ad9e3ecec852d6caaa99b23bd7", "fast_id": "p04000_179f19d32bfd3c7f375699a4c65c546ee213f4ad9e3ecec852d6caaa99b23bd7", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "h, w, n = map(int, input().split())\nfrom itertools import product as pr\nfrom collections import Counter as co\n\nans = [(h - 2) * (w - 2)] + [0] * 9\nio = [tuple(map(int, input().split())) for i in range(n)]\nfor k, v in co(\n co(\n [\n (a - x) * w + b - y\n for x, y in pr(range(3), repeat=2)\n for a, b in io\n if h - 1 > a - x > 0 < b - y < w - 1\n ]\n ).values()\n).items():\n ans[k] = v\n ans[0] -= v\nprint(*ans, sep=\"\\n\")\n", "measured_fast_code_sha256": "179f19d32bfd3c7f375699a4c65c546ee213f4ad9e3ecec852d6caaa99b23bd7", "measured_slow_code": "H, W, N = list(map(int, input().split()))\nB = set([])\nfor i in range(N):\n a, b = list(map(int, input().split()))\n a -= 1\n b -= 1\n B.add((a, b))\n# print(B)\nBB = list(B)\nans = [0 for _ in range(10)]\nfor i in range(N):\n cnt = 0\n temp = 0\n x, y = BB[i]\n # print(x,y)\n for sx in range(max(0, x - 2), min(x, H - 3) + 1):\n for sy in range(max(0, y - 2), min(y, W - 3) + 1):\n temp = 0\n for p in range(3):\n for q in range(3):\n if (sx + p, sy + q) in B:\n temp += 1\n # print(sx,sy,temp)\n ans[temp] += 1\nfor i in range(1, 10):\n ans[i] = ans[i] // i\nans[0] = (H - 2) * (W - 2) - sum(ans[1:])\nfor t in ans:\n print(t)\n", "measured_slow_code_sha256": "a36bab8f921599e4ca7482c881bfcc39764a8e5acc14a246031adfce3dcc98b4", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.1667052347129268, "pair_id": "python_v2_b4f32a7f0ef17b21f91f483b", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p04000", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p04000_179f19d32bfd3c7f375699a4c65c546ee213f4ad9e3ecec852d6caaa99b23bd7.jsonl.gz", "inputs": "reproduction/python/inputs/p04000.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p04000_a36bab8f921599e4ca7482c881bfcc39764a8e5acc14a246031adfce3dcc98b4.jsonl.gz"}, "slow_code": "H, W, N = list(map(int, input().split()))\nB = set([])\nfor i in range(N):\n a, b = list(map(int, input().split()))\n a -= 1\n b -= 1\n B.add((a, b))\n\nBB = list(B)\nans = [0 for _ in range(10)]\nfor i in range(N):\n cnt = 0\n temp = 0\n x, y = BB[i]\n\n for sx in range(max(0, x - 2), min(x, H - 3) + 1):\n for sy in range(max(0, y - 2), min(y, W - 3) + 1):\n temp = 0\n for p in range(3):\n for q in range(3):\n if (sx + p, sy + q) in B:\n temp += 1\n\n ans[temp] += 1\nfor i in range(1, 10):\n ans[i] = ans[i] // i\nans[0] = (H - 2) * (W - 2) - sum(ans[1:])\nfor t in ans:\n print(t)\n", "slow_code_sha256": "12645471e5b932b71064020cd96552bd93299a86ffda13a17e3ba1b8f76a6c83", "slow_id": "p04000_a36bab8f921599e4ca7482c881bfcc39764a8e5acc14a246031adfce3dcc98b4", "speedup": 3.038995720530817, "stratum": "2-4", "within_pair_jaccard": 0.31666666666666665, "workload": {"case_count": 100, "description": "An H-by-W grid starts white; N distinct listed cells become black. For each j=0..9, count 3-by-3 subrectangles containing exactly j black cells. Only black coordinates are supplied, not the full grid. Observed inputs: H=3..1000000000; W=3..1000000000; N=0..100000 (median 1000); a_i=1..1000000000; b_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1978094, "median": 7447.0, "min": 6}, "input_format": ["H W N\na_1 b_1\n...\na_N b_N"], "input_format_status": "source_input_section", "input_lines": {"max": 100001, "median": 1001.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200003, "median": 2003.0, "min": 3}}} -{"case_ids": ["p02793_case_000", "p02793_case_001", "p02793_case_002", "p02793_case_003", "p02793_case_004", "p02793_case_005", "p02793_case_006", "p02793_case_007", "p02793_case_008", "p02793_case_009", "p02793_case_010", "p02793_case_011", "p02793_case_012", "p02793_case_013", "p02793_case_014", "p02793_case_015", "p02793_case_016", "p02793_case_017", "p02793_case_018", "p02793_case_019", "p02793_case_020", "p02793_case_021", "p02793_case_022", "p02793_case_023", "p02793_case_024", "p02793_case_025", "p02793_case_026", "p02793_case_027", "p02793_case_028", "p02793_case_029", "p02793_case_030", "p02793_case_031", "p02793_case_032", "p02793_case_033", "p02793_case_034", "p02793_case_035", "p02793_case_036", "p02793_case_037", "p02793_case_038", "p02793_case_039", "p02793_case_040", "p02793_case_041", "p02793_case_042", "p02793_case_043", "p02793_case_044", "p02793_case_045", "p02793_case_046", "p02793_case_047", "p02793_case_048", "p02793_case_049", "p02793_case_050", "p02793_case_051", "p02793_case_052", "p02793_case_053", "p02793_case_054", "p02793_case_055", "p02793_case_056", "p02793_case_057", "p02793_case_058", "p02793_case_059", "p02793_case_060", "p02793_case_061", "p02793_case_062", "p02793_case_063", "p02793_case_064", "p02793_case_065", "p02793_case_066", "p02793_case_067", "p02793_case_068", "p02793_case_069", "p02793_case_070", "p02793_case_071", "p02793_case_072", "p02793_case_073", "p02793_case_074", "p02793_case_075", "p02793_case_076", "p02793_case_077", "p02793_case_078", "p02793_case_079", "p02793_case_080", "p02793_case_081", "p02793_case_082", "p02793_case_083", "p02793_case_084", "p02793_case_085", "p02793_case_086", "p02793_case_087", "p02793_case_088", "p02793_case_089", "p02793_case_090", "p02793_case_091", "p02793_case_092", "p02793_case_093", "p02793_case_094", "p02793_case_095", "p02793_case_096", "p02793_case_097", "p02793_case_098", "p02793_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def gcd(a, b):\n while b:\n a, b = b, a % b\n return a\n\n\ndef lcm(a, b):\n return a * b // gcd(a, b)\n\n\nn = int(eval(input()))\na = list(map(int, input().split()))\nans = 0\nmod = 10**9 + 7\nl = a[0]\nfor i in range(1, n):\n l = lcm(l, a[i])\nl %= mod\nfor i in a:\n ans += l * pow(i, mod - 2, mod) % mod\n ans %= mod\nprint(ans)\n", "fast_code_sha256": "4a2a5ca5797cf19089d33a895e8164c8cf0ce9705f8e9007ee45208bdbc6c162", "fast_id": "p02793_4a2a5ca5797cf19089d33a895e8164c8cf0ce9705f8e9007ee45208bdbc6c162", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def gcd(a, b):\n while b:\n a, b = b, a % b\n return a\n\n\ndef lcm(a, b):\n return a * b // gcd(a, b)\n\n\nn = int(eval(input()))\na = list(map(int, input().split()))\nans = 0\nmod = 10**9 + 7\nl = a[0]\nfor i in range(1, n):\n l = lcm(l, a[i])\nl %= mod\nfor i in a:\n ans += l * pow(i, mod - 2, mod) % mod\n ans %= mod\nprint(ans)\n", "measured_fast_code_sha256": "4a2a5ca5797cf19089d33a895e8164c8cf0ce9705f8e9007ee45208bdbc6c162", "measured_slow_code": "class PrimeOptimizer:\n def __init__(self, MAX_NUM=10**3):\n is_prime = [True] * MAX_NUM\n is_prime[0] = False\n is_prime[1] = False\n primes = []\n for i in range(MAX_NUM):\n if is_prime[i]:\n primes.append(i)\n for j in range(2 * i, MAX_NUM, i):\n is_prime[j] = False\n self.primes = primes\n\n def prime_factorization(self, x):\n res = {}\n for prime in self.primes:\n while x % prime == 0:\n if not prime in res:\n res[prime] = 0\n res[prime] += 1\n x //= prime\n if x > 1:\n res[x] = 1\n return res\n\n\nMOD = 10**9 + 7\n\n\ndef mod_pow(p, q):\n res = 1\n while q:\n if q & 1:\n res = (res * p) % MOD\n p = (p * p) % MOD\n q //= 2\n return res\n\n\ndef mod_inv(p):\n return mod_pow(p, MOD - 2)\n\n\ndef solve(n, a):\n primeOpt = PrimeOptimizer()\n D = {}\n for i in range(n):\n prime_num_mapping = primeOpt.prime_factorization(a[i])\n for prime, num in list(prime_num_mapping.items()):\n if not prime in D:\n D[prime] = 0\n D[prime] = max(D[prime], num)\n L = 1\n for prime, num in list(D.items()):\n L = (L * mod_pow(prime, num)) % MOD\n res = sum([L * mod_inv(x) % MOD for x in a])\n return res % MOD\n\n\nN = int(eval(input()))\nA = list(map(int, input().split()))\nprint((solve(N, A)))\n", "measured_slow_code_sha256": "66d145443a372a5a43407dc9cf71d71447bec89f203c9422197e66c8dd97343d", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 5.02212920506633, "pair_id": "python_v2_788b03fbc714409f660477d0", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02793", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02793_4a2a5ca5797cf19089d33a895e8164c8cf0ce9705f8e9007ee45208bdbc6c162.jsonl.gz", "inputs": "reproduction/python/inputs/p02793.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02793_66d145443a372a5a43407dc9cf71d71447bec89f203c9422197e66c8dd97343d.jsonl.gz"}, "slow_code": "class PrimeOptimizer:\n def __init__(self, MAX_NUM=10**3):\n is_prime = [True] * MAX_NUM\n is_prime[0] = False\n is_prime[1] = False\n primes = []\n for i in range(MAX_NUM):\n if is_prime[i]:\n primes.append(i)\n for j in range(2 * i, MAX_NUM, i):\n is_prime[j] = False\n self.primes = primes\n\n def prime_factorization(self, x):\n res = {}\n for prime in self.primes:\n while x % prime == 0:\n if not prime in res:\n res[prime] = 0\n res[prime] += 1\n x //= prime\n if x > 1:\n res[x] = 1\n return res\n\n\nMOD = 10**9 + 7\n\n\ndef mod_pow(p, q):\n res = 1\n while q:\n if q & 1:\n res = (res * p) % MOD\n p = (p * p) % MOD\n q //= 2\n return res\n\n\ndef mod_inv(p):\n return mod_pow(p, MOD - 2)\n\n\ndef solve(n, a):\n primeOpt = PrimeOptimizer()\n D = {}\n for i in range(n):\n prime_num_mapping = primeOpt.prime_factorization(a[i])\n for prime, num in list(prime_num_mapping.items()):\n if not prime in D:\n D[prime] = 0\n D[prime] = max(D[prime], num)\n L = 1\n for prime, num in list(D.items()):\n L = (L * mod_pow(prime, num)) % MOD\n res = sum([L * mod_inv(x) % MOD for x in a])\n return res % MOD\n\n\nN = int(eval(input()))\nA = list(map(int, input().split()))\nprint((solve(N, A)))\n", "slow_code_sha256": "66d145443a372a5a43407dc9cf71d71447bec89f203c9422197e66c8dd97343d", "slow_id": "p02793_66d145443a372a5a43407dc9cf71d71447bec89f203c9422197e66c8dd97343d", "speedup": 4.216280808561572, "stratum": "4-8", "within_pair_jaccard": 0.3492063492063492, "workload": {"case_count": 100, "description": "Choose positive integers B_i so that every A_i*B_i has the same value, minimizing sum B_i. Output that minimum modulo 1000000007. Observed inputs: N=1..10000 (median 1000); A_i=1..1000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 70006, "median": 6279.5, "min": 4}, "input_format": ["N\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 10001, "median": 1001.0, "min": 2}}} -{"case_ids": ["p02417_case_000", "p02417_case_001", "p02417_case_002", "p02417_case_003", "p02417_case_004", "p02417_case_005", "p02417_case_006", "p02417_case_007", "p02417_case_008", "p02417_case_009", "p02417_case_010", "p02417_case_011", "p02417_case_012", "p02417_case_013", "p02417_case_014", "p02417_case_015", "p02417_case_016", "p02417_case_017", "p02417_case_018", "p02417_case_019", "p02417_case_020", "p02417_case_021", "p02417_case_022", "p02417_case_023", "p02417_case_024", "p02417_case_025", "p02417_case_026", "p02417_case_027", "p02417_case_028", "p02417_case_029", "p02417_case_030", "p02417_case_031", "p02417_case_032", "p02417_case_033", "p02417_case_034", "p02417_case_035", "p02417_case_036", "p02417_case_037", "p02417_case_038", "p02417_case_039", "p02417_case_040", "p02417_case_041", "p02417_case_042", "p02417_case_043", "p02417_case_044", "p02417_case_045", "p02417_case_046", "p02417_case_047", "p02417_case_048", "p02417_case_049", "p02417_case_050", "p02417_case_051", "p02417_case_052", "p02417_case_053", "p02417_case_054", "p02417_case_055", "p02417_case_056", "p02417_case_057", "p02417_case_058", "p02417_case_059", "p02417_case_060", "p02417_case_061", "p02417_case_062", "p02417_case_063", "p02417_case_064", "p02417_case_065", "p02417_case_066", "p02417_case_067", "p02417_case_068", "p02417_case_069", "p02417_case_070", "p02417_case_071", "p02417_case_072", "p02417_case_073", "p02417_case_074", "p02417_case_075", "p02417_case_076", "p02417_case_077", "p02417_case_078", "p02417_case_079", "p02417_case_080", "p02417_case_081", "p02417_case_082", "p02417_case_083", "p02417_case_084", "p02417_case_085", "p02417_case_086", "p02417_case_087", "p02417_case_088", "p02417_case_089", "p02417_case_090", "p02417_case_091", "p02417_case_092", "p02417_case_093", "p02417_case_094", "p02417_case_095", "p02417_case_096", "p02417_case_097", "p02417_case_098", "p02417_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\nchash = {}\nfor i in range(ord(\"a\"), ord(\"z\") + 1):\n chash[chr(i)] = 0\nlines = sys.stdin.readlines()\nfor i in range(len(lines)):\n for j in range(len(lines[i])):\n if lines[i][j].isalpha():\n chash[lines[i][j].lower()] += 1\nfor i in range(ord(\"a\"), ord(\"z\") + 1):\n print((\"{:s} : {:d}\".format(chr(i), chash[chr(i)])))\n", "fast_code_sha256": "36da24ff50e818fe64ed4eba2d5468a0f22772e67949241ff0bd9289506350d5", "fast_id": "p02417_36da24ff50e818fe64ed4eba2d5468a0f22772e67949241ff0bd9289506350d5", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\nchash = {}\nfor i in range(ord(\"a\"), ord(\"z\") + 1):\n chash[chr(i)] = 0\nlines = sys.stdin.readlines()\nfor i in range(len(lines)):\n for j in range(len(lines[i])):\n if lines[i][j].isalpha():\n chash[lines[i][j].lower()] += 1\nfor i in range(ord(\"a\"), ord(\"z\") + 1):\n print((\"{:s} : {:d}\".format(chr(i), chash[chr(i)])))\n", "measured_fast_code_sha256": "36da24ff50e818fe64ed4eba2d5468a0f22772e67949241ff0bd9289506350d5", "measured_slow_code": "import sys\n\naz = [\n \"a\",\n \"b\",\n \"c\",\n \"d\",\n \"e\",\n \"f\",\n \"g\",\n \"h\",\n \"i\",\n \"j\",\n \"k\",\n \"l\",\n \"m\",\n \"n\",\n \"o\",\n \"p\",\n \"q\",\n \"r\",\n \"s\",\n \"t\",\n \"u\",\n \"v\",\n \"w\",\n \"x\",\n \"y\",\n \"z\",\n]\nsum_az = [0 for x in range(26)]\nfor x in sys.stdin.read().lower():\n for i in range(26):\n if x == az[i]:\n sum_az[i] += 1\nfor i in range(26):\n print((\"%s : %d\" % (az[i], sum_az[i])))\n", "measured_slow_code_sha256": "91fbc2a5db35b1941d183c86eb7016584b0dbbc404bd11d0ae21847b19ff61be", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 5.908461696067217, "pair_id": "python_v2_16ef8679a38a2b8ab690faf8", "per_case_slow_code_faster_fraction": 0.01, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02417", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02417_36da24ff50e818fe64ed4eba2d5468a0f22772e67949241ff0bd9289506350d5.jsonl.gz", "inputs": "reproduction/python/inputs/p02417.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02417_91fbc2a5db35b1941d183c86eb7016584b0dbbc404bd11d0ae21847b19ff61be.jsonl.gz"}, "slow_code": "import sys\n\naz = [\n \"a\",\n \"b\",\n \"c\",\n \"d\",\n \"e\",\n \"f\",\n \"g\",\n \"h\",\n \"i\",\n \"j\",\n \"k\",\n \"l\",\n \"m\",\n \"n\",\n \"o\",\n \"p\",\n \"q\",\n \"r\",\n \"s\",\n \"t\",\n \"u\",\n \"v\",\n \"w\",\n \"x\",\n \"y\",\n \"z\",\n]\nsum_az = [0 for x in range(26)]\nfor x in sys.stdin.read().lower():\n for i in range(26):\n if x == az[i]:\n sum_az[i] += 1\nfor i in range(26):\n print((\"%s : %d\" % (az[i], sum_az[i])))\n", "slow_code_sha256": "91fbc2a5db35b1941d183c86eb7016584b0dbbc404bd11d0ae21847b19ff61be", "slow_id": "p02417_91fbc2a5db35b1941d183c86eb7016584b0dbbc404bd11d0ae21847b19ff61be", "speedup": 5.291224555834662, "stratum": "4-8", "within_pair_jaccard": 0.3469387755102041, "workload": {"case_count": 100, "description": "Read all text until end of input and count occurrences of each English letter a..z without distinguishing uppercase and lowercase. Other characters do not contribute to the letter counts. Input may contain multiple lines. Observed inputs: lines=1..119 (median 10); content_characters=0..1199 (median 450); ascii_letters=0..1199 (median 300).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1317, "median": 495.0, "min": 1}, "input_format": ["[text lines until EOF]"], "input_format_status": "source_input_section", "input_lines": {"max": 119, "median": 10.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 199, "median": 20.0, "min": 0}}} -{"case_ids": ["p02362_case_000", "p02362_case_001", "p02362_case_002", "p02362_case_003", "p02362_case_004", "p02362_case_005", "p02362_case_006", "p02362_case_007", "p02362_case_008", "p02362_case_009", "p02362_case_010", "p02362_case_011", "p02362_case_012", "p02362_case_013", "p02362_case_014", "p02362_case_015", "p02362_case_016", "p02362_case_017", "p02362_case_018", "p02362_case_019", "p02362_case_020", "p02362_case_021", "p02362_case_022", "p02362_case_023", "p02362_case_024", "p02362_case_025", "p02362_case_026", "p02362_case_027", "p02362_case_028", "p02362_case_029", "p02362_case_030", "p02362_case_031", "p02362_case_032", "p02362_case_033", "p02362_case_034", "p02362_case_035", "p02362_case_036", "p02362_case_037", "p02362_case_038", "p02362_case_039", "p02362_case_040", "p02362_case_041", "p02362_case_042", "p02362_case_043", "p02362_case_044", "p02362_case_045", "p02362_case_046", "p02362_case_047", "p02362_case_048", "p02362_case_049", "p02362_case_050", "p02362_case_051", "p02362_case_052", "p02362_case_053", "p02362_case_054", "p02362_case_055", "p02362_case_056", "p02362_case_057", "p02362_case_058", "p02362_case_059", "p02362_case_060", "p02362_case_061", "p02362_case_062", "p02362_case_063", "p02362_case_064", "p02362_case_065", "p02362_case_066", "p02362_case_067", "p02362_case_068", "p02362_case_069", "p02362_case_070", "p02362_case_071", "p02362_case_072", "p02362_case_073", "p02362_case_074", "p02362_case_075", "p02362_case_076", "p02362_case_077", "p02362_case_078", "p02362_case_079", "p02362_case_080", "p02362_case_081", "p02362_case_082", "p02362_case_083", "p02362_case_084", "p02362_case_085", "p02362_case_086", "p02362_case_087", "p02362_case_088", "p02362_case_089", "p02362_case_090", "p02362_case_091", "p02362_case_092", "p02362_case_093", "p02362_case_094", "p02362_case_095", "p02362_case_096", "p02362_case_097", "p02362_case_098", "p02362_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\nfile_input = sys.stdin\nV, E, r = map(int, file_input.readline().split())\nedges = []\nfor line in file_input:\n edges.append(tuple(map(int, line.split())))\n\ndistance = [float(\"inf\")] * V\ndistance[r] = 0\nnotUpdated = True\nfor i in range(V - 1):\n notUpdated = True\n for s, t, w in edges:\n temp_d = distance[s] + w\n if temp_d < distance[t]:\n distance[t] = temp_d\n notUpdated = False\n if notUpdated:\n break\n\nif notUpdated:\n print(*map(lambda x: str(x).upper(), distance), sep=\"\\n\")\nelse:\n flag = True\n for s, t, w in edges:\n temp_d = distance[s] + w\n if temp_d < distance[t]:\n print(\"NEGATIVE CYCLE\")\n flag = False\n break\n if flag:\n print(*map(lambda x: str(x).upper(), distance), sep=\"\\n\")\n", "fast_code_sha256": "3fe7b411ed933f44322c3ebc9db01922f20d7ad447ad58aa9934f7062ce01d40", "fast_id": "p02362_a876e50adb7fb20d6c6d462a1e2209a28830057167cd88325e76836aef56d5a3", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "# Input acceptance\nimport sys\n\nfile_input = sys.stdin\nV, E, r = map(int, file_input.readline().split())\nedges = []\nfor line in file_input:\n edges.append(tuple(map(int, line.split())))\n# Bellman???Ford algorithm\ndistance = [float(\"inf\")] * V\ndistance[r] = 0\nnotUpdated = True\nfor i in range(V - 1):\n notUpdated = True\n for s, t, w in edges:\n temp_d = distance[s] + w\n if temp_d < distance[t]:\n distance[t] = temp_d\n notUpdated = False\n if notUpdated:\n break\n# Output\nif notUpdated:\n print(*map(lambda x: str(x).upper(), distance), sep=\"\\n\")\nelse:\n flag = True\n for s, t, w in edges:\n temp_d = distance[s] + w\n if temp_d < distance[t]:\n print(\"NEGATIVE CYCLE\")\n flag = False\n break\n if flag:\n print(*map(lambda x: str(x).upper(), distance), sep=\"\\n\")\n", "measured_fast_code_sha256": "a876e50adb7fb20d6c6d462a1e2209a28830057167cd88325e76836aef56d5a3", "measured_slow_code": "from sys import stdin\nfrom collections import deque\n\nV, E, R = [int(x) for x in stdin.readline().split()]\nd = {}\ntick = False\nINF = float(\"inf\")\nfor i in range(V):\n d[i] = INF\nd[R] = 0\nweight = {}\nst = deque([])\nfor i in range(1, V + 1):\n for j in range(E):\n if i == 1:\n s, t, w = [int(x) for x in stdin.readline().split()]\n weight[(s, t)] = w\n st.append((s, t))\n (s, t) = st.popleft()\n if d[t] > d[s] + weight[(s, t)]:\n d[t] = d[s] + weight[(s, t)]\n if i == V:\n print(\"NEGATIVE CYCLE\")\n tick = True\n break\n st.append((s, t))\nif not tick:\n for k in range(V):\n if d[k] == float(\"inf\"):\n print(\"INF\")\n else:\n print((d[k]))\n", "measured_slow_code_sha256": "a4869b36b9d12ca77358a6e2beaf495c662e8b526bbaccd3ebb037a9734124f9", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.210087393485672, "pair_id": "python_v2_4fc2b93edc9b1a225e4e59ce", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02362", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02362_a876e50adb7fb20d6c6d462a1e2209a28830057167cd88325e76836aef56d5a3.jsonl.gz", "inputs": "reproduction/python/inputs/p02362.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02362_a4869b36b9d12ca77358a6e2beaf495c662e8b526bbaccd3ebb037a9734124f9.jsonl.gz"}, "slow_code": "from sys import stdin\nfrom collections import deque\n\nV, E, R = [int(x) for x in stdin.readline().split()]\nd = {}\ntick = False\nINF = float(\"inf\")\nfor i in range(V):\n d[i] = INF\nd[R] = 0\nweight = {}\nst = deque([])\nfor i in range(1, V + 1):\n for j in range(E):\n if i == 1:\n s, t, w = [int(x) for x in stdin.readline().split()]\n weight[(s, t)] = w\n st.append((s, t))\n (s, t) = st.popleft()\n if d[t] > d[s] + weight[(s, t)]:\n d[t] = d[s] + weight[(s, t)]\n if i == V:\n print(\"NEGATIVE CYCLE\")\n tick = True\n break\n st.append((s, t))\nif not tick:\n for k in range(V):\n if d[k] == float(\"inf\"):\n print(\"INF\")\n else:\n print((d[k]))\n", "slow_code_sha256": "a4869b36b9d12ca77358a6e2beaf495c662e8b526bbaccd3ebb037a9734124f9", "slow_id": "p02362_a4869b36b9d12ca77358a6e2beaf495c662e8b526bbaccd3ebb037a9734124f9", "speedup": 4.310780317517176, "stratum": "4-8", "within_pair_jaccard": 0.5087719298245614, "workload": {"case_count": 100, "description": "For a directed graph with signed edge weights, output NEGATIVE CYCLE if a negative cycle is reachable from source r. Otherwise output shortest-path costs from r, using INF for unreachable vertices. IDs are 0..V-1; no self-loops or parallel directed edges. Observed inputs: V=1..1000 (median 50); E=0..2000 (median 50); r=0..999; d_i=-10000..10000; negative_edges=0..1041 (median 25).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 26410, "median": 573.0, "min": 6}, "input_format": ["V E r\ns_1 t_1 d_1\n...\ns_E t_E d_E"], "input_format_status": "source_input_section", "input_lines": {"max": 2001, "median": 51.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 6003, "median": 153.0, "min": 3}}} -{"case_ids": ["p02729_case_000", "p02729_case_001", "p02729_case_002", "p02729_case_003", "p02729_case_004", "p02729_case_005", "p02729_case_006", "p02729_case_007", "p02729_case_008", "p02729_case_009", "p02729_case_010", "p02729_case_011", "p02729_case_012", "p02729_case_013", "p02729_case_014", "p02729_case_015", "p02729_case_016", "p02729_case_017", "p02729_case_018", "p02729_case_019", "p02729_case_020", "p02729_case_021", "p02729_case_022", "p02729_case_023", "p02729_case_024", "p02729_case_025", "p02729_case_026", "p02729_case_027", "p02729_case_028", "p02729_case_029", "p02729_case_030", "p02729_case_031", "p02729_case_032", "p02729_case_033", "p02729_case_034", "p02729_case_035", "p02729_case_036", "p02729_case_037", "p02729_case_038", "p02729_case_039", "p02729_case_040", "p02729_case_041", "p02729_case_042", "p02729_case_043", "p02729_case_044", "p02729_case_045", "p02729_case_046", "p02729_case_047", "p02729_case_048", "p02729_case_049", "p02729_case_050", "p02729_case_051", "p02729_case_052", "p02729_case_053", "p02729_case_054", "p02729_case_055", "p02729_case_056", "p02729_case_057", "p02729_case_058", "p02729_case_059", "p02729_case_060", "p02729_case_061", "p02729_case_062", "p02729_case_063", "p02729_case_064", "p02729_case_065", "p02729_case_066", "p02729_case_067", "p02729_case_068", "p02729_case_069", "p02729_case_070", "p02729_case_071", "p02729_case_072", "p02729_case_073", "p02729_case_074", "p02729_case_075", "p02729_case_076", "p02729_case_077", "p02729_case_078", "p02729_case_079", "p02729_case_080", "p02729_case_081", "p02729_case_082", "p02729_case_083", "p02729_case_084", "p02729_case_085", "p02729_case_086", "p02729_case_087", "p02729_case_088", "p02729_case_089", "p02729_case_090", "p02729_case_091", "p02729_case_092", "p02729_case_093", "p02729_case_094", "p02729_case_095", "p02729_case_096", "p02729_case_097", "p02729_case_098", "p02729_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N, M = list(map(int, input().split()))\nif N <= 1:\n a = 0\nelse:\n a = N * (N - 1) // 2\nif M <= 1:\n b = 0\nelse:\n b = M * (M - 1) // 2\nprint((a + b))\n", "fast_code_sha256": "4e5c848edf0d2b333d09ea0bbad111222f40c6b56736c2a32c69fc1464fa22b0", "fast_id": "p02729_4e5c848edf0d2b333d09ea0bbad111222f40c6b56736c2a32c69fc1464fa22b0", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N, M = list(map(int, input().split()))\nif N <= 1:\n a = 0\nelse:\n a = N * (N - 1) // 2\nif M <= 1:\n b = 0\nelse:\n b = M * (M - 1) // 2\nprint((a + b))\n", "measured_fast_code_sha256": "4e5c848edf0d2b333d09ea0bbad111222f40c6b56736c2a32c69fc1464fa22b0", "measured_slow_code": "a, b = list(map(int, input().split()))\nimport itertools\n\na1 = len(list(itertools.combinations(list(range(a)), 2)))\nb1 = len(list(itertools.combinations(list(range(b)), 2)))\nprint((a1 + b1))\n", "measured_slow_code_sha256": "cceb77711a14726b9b2382bddd14ea9448a327cbb9328832bc3b11455366cb07", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4.598163808079907, "pair_id": "python_v2_aa16d439d5df4da3f7ac6311", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02729", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02729_4e5c848edf0d2b333d09ea0bbad111222f40c6b56736c2a32c69fc1464fa22b0.jsonl.gz", "inputs": "reproduction/python/inputs/p02729.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02729_cceb77711a14726b9b2382bddd14ea9448a327cbb9328832bc3b11455366cb07.jsonl.gz"}, "slow_code": "a, b = list(map(int, input().split()))\nimport itertools\n\na1 = len(list(itertools.combinations(list(range(a)), 2)))\nb1 = len(list(itertools.combinations(list(range(b)), 2)))\nprint((a1 + b1))\n", "slow_code_sha256": "cceb77711a14726b9b2382bddd14ea9448a327cbb9328832bc3b11455366cb07", "slow_id": "p02729_cceb77711a14726b9b2382bddd14ea9448a327cbb9328832bc3b11455366cb07", "speedup": 5.429053470854925, "stratum": "4-8", "within_pair_jaccard": 0.36363636363636365, "workload": {"case_count": 100, "description": "There are N individually distinct balls with even values and M with odd values. Count unordered pairs of different balls whose values sum to an even number. Observed inputs: N=0..100 (median 34.5); M=0..100 (median 31.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 8, "median": 5.0, "min": 4}, "input_format": ["N M"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p03209_case_000", "p03209_case_001", "p03209_case_002", "p03209_case_003", "p03209_case_004", "p03209_case_005", "p03209_case_006", "p03209_case_007", "p03209_case_008", "p03209_case_009", "p03209_case_010", "p03209_case_011", "p03209_case_012", "p03209_case_013", "p03209_case_014", "p03209_case_015", "p03209_case_016", "p03209_case_017", "p03209_case_018", "p03209_case_019", "p03209_case_020", "p03209_case_021", "p03209_case_022", "p03209_case_023", "p03209_case_024", "p03209_case_025", "p03209_case_026", "p03209_case_027", "p03209_case_028", "p03209_case_029", "p03209_case_030", "p03209_case_031", "p03209_case_032", "p03209_case_033", "p03209_case_034", "p03209_case_035", "p03209_case_036", "p03209_case_037", "p03209_case_038", "p03209_case_039", "p03209_case_040", "p03209_case_041", "p03209_case_042", "p03209_case_043", "p03209_case_044", "p03209_case_045", "p03209_case_046", "p03209_case_047", "p03209_case_048", "p03209_case_049", "p03209_case_050", "p03209_case_051", "p03209_case_052", "p03209_case_053", "p03209_case_054", "p03209_case_055", "p03209_case_056", "p03209_case_057", "p03209_case_058", "p03209_case_059", "p03209_case_060", "p03209_case_061", "p03209_case_062", "p03209_case_063", "p03209_case_064", "p03209_case_065", "p03209_case_066", "p03209_case_067", "p03209_case_068", "p03209_case_069", "p03209_case_070", "p03209_case_071", "p03209_case_072", "p03209_case_073", "p03209_case_074", "p03209_case_075", "p03209_case_076", "p03209_case_077", "p03209_case_078", "p03209_case_079", "p03209_case_080", "p03209_case_081", "p03209_case_082", "p03209_case_083", "p03209_case_084", "p03209_case_085", "p03209_case_086", "p03209_case_087", "p03209_case_088", "p03209_case_089", "p03209_case_090", "p03209_case_091", "p03209_case_092", "p03209_case_093", "p03209_case_094", "p03209_case_095", "p03209_case_096", "p03209_case_097", "p03209_case_098", "p03209_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def f(L, x):\n if L == 0:\n return 0 if x <= 0 else 1\n if x <= total[L - 1] + 1:\n return f(L - 1, x - 1)\n else:\n return patties[L - 1] + 1 + f(L - 1, x - total[L - 1] - 2)\n\n\nN, X = list(map(int, input().split()))\ntotal = [1]\npatties = [1]\nfor i in range(50):\n total.append(total[-1] * 2 + 3)\n patties.append(patties[-1] * 2 + 1)\nprint((f(N, X)))\n", "fast_code_sha256": "af93ae5b5358d82779151bd5ba92d0b27867572750edec28a359053bd079fb2b", "fast_id": "p03209_af93ae5b5358d82779151bd5ba92d0b27867572750edec28a359053bd079fb2b", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def f(L, x):\n if L == 0:\n return 0 if x <= 0 else 1\n if x <= total[L - 1] + 1:\n return f(L - 1, x - 1)\n else:\n return patties[L - 1] + 1 + f(L - 1, x - total[L - 1] - 2)\n\n\nN, X = list(map(int, input().split()))\ntotal = [1]\npatties = [1]\nfor i in range(50):\n total.append(total[-1] * 2 + 3)\n patties.append(patties[-1] * 2 + 1)\nprint((f(N, X)))\n", "measured_fast_code_sha256": "af93ae5b5358d82779151bd5ba92d0b27867572750edec28a359053bd079fb2b", "measured_slow_code": "N, X = list(map(int, input().split()))\n# 層の総数\nT = [1]\nfor i in range(1, 50 + 1):\n T.append(T[i - 1] * 2 + 3)\n\n\ndef hash(n, x):\n return \"{0:d},{1:d}\".format(n, x)\n\n\n# レベルnバーガーの下からx層内のパティの数\nmemo = dict()\n\n\ndef solve(n, x):\n global T, memo\n if hash(n, x) in memo:\n return memo[hash(n, x)]\n if n == 0 and x >= 1:\n memo[hash(n, x)] = 1\n return 1\n if x <= 1:\n memo[hash(n, x)] = 0\n return 0\n memo[hash(n, x)] = solve(n - 1, min(x - 1, T[n - 1]))\n if x >= T[n - 1] + 2:\n memo[hash(n, x)] += 1\n if x >= T[n - 1] + 3:\n memo[hash(n, x)] += solve(n - 1, min(x - 1 - T[n - 1] - 1, T[n - 1]))\n return memo[hash(n, x)]\n\n\nprint((solve(N, X)))\n", "measured_slow_code_sha256": "d810806da4e3ff396dd2f9e6a8463b4981d8f62dd34c3ba133bb44352184e910", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.1324735169966376, "pair_id": "python_v2_428619c40a0f088d7398d580", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03209", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03209_af93ae5b5358d82779151bd5ba92d0b27867572750edec28a359053bd079fb2b.jsonl.gz", "inputs": "reproduction/python/inputs/p03209.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03209_d810806da4e3ff396dd2f9e6a8463b4981d8f62dd34c3ba133bb44352184e910.jsonl.gz"}, "slow_code": "N, X = list(map(int, input().split()))\n\nT = [1]\nfor i in range(1, 50 + 1):\n T.append(T[i - 1] * 2 + 3)\n\n\ndef hash(n, x):\n return \"{0:d},{1:d}\".format(n, x)\n\n\nmemo = dict()\n\n\ndef solve(n, x):\n global T, memo\n if hash(n, x) in memo:\n return memo[hash(n, x)]\n if n == 0 and x >= 1:\n memo[hash(n, x)] = 1\n return 1\n if x <= 1:\n memo[hash(n, x)] = 0\n return 0\n memo[hash(n, x)] = solve(n - 1, min(x - 1, T[n - 1]))\n if x >= T[n - 1] + 2:\n memo[hash(n, x)] += 1\n if x >= T[n - 1] + 3:\n memo[hash(n, x)] += solve(n - 1, min(x - 1 - T[n - 1] - 1, T[n - 1]))\n return memo[hash(n, x)]\n\n\nprint((solve(N, X)))\n", "slow_code_sha256": "dbd3b0158d3748e0d99cec055f9e692949bfea6a1e16dd750ed0447f840bf070", "slow_id": "p03209_d810806da4e3ff396dd2f9e6a8463b4981d8f62dd34c3ba133bb44352184e910", "speedup": 2.843228376327953, "stratum": "2-4", "within_pair_jaccard": 0.5789473684210527, "workload": {"case_count": 100, "description": "Level-0 burger is one patty. Level L>0 stacks bun, level-(L-1) burger, patty, level-(L-1) burger, bun, from bottom upward. Count patties in the bottom X layers of a level-N burger; the layered object is implicit, not listed. Observed inputs: N=1..50 (median 27.5); X=1..4503599627370493.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 20, "median": 11.0, "min": 4}, "input_format": ["N X"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p02971_case_000", "p02971_case_001", "p02971_case_002", "p02971_case_003", "p02971_case_004", "p02971_case_005", "p02971_case_006", "p02971_case_007", "p02971_case_008", "p02971_case_009", "p02971_case_010", "p02971_case_011", "p02971_case_012", "p02971_case_013", "p02971_case_014", "p02971_case_015", "p02971_case_016", "p02971_case_017", "p02971_case_018", "p02971_case_019", "p02971_case_020", "p02971_case_021", "p02971_case_022", "p02971_case_023", "p02971_case_024", "p02971_case_025", "p02971_case_026", "p02971_case_027", "p02971_case_028", "p02971_case_029", "p02971_case_030", "p02971_case_031", "p02971_case_032", "p02971_case_033", "p02971_case_034", "p02971_case_035", "p02971_case_036", "p02971_case_037", "p02971_case_038", "p02971_case_039", "p02971_case_040", "p02971_case_041", "p02971_case_042", "p02971_case_043", "p02971_case_044", "p02971_case_045", "p02971_case_046", "p02971_case_047", "p02971_case_048", "p02971_case_049", "p02971_case_050", "p02971_case_051", "p02971_case_052", "p02971_case_053", "p02971_case_054", "p02971_case_055", "p02971_case_056", "p02971_case_057", "p02971_case_058", "p02971_case_059", "p02971_case_060", "p02971_case_061", "p02971_case_062", "p02971_case_063", "p02971_case_064", "p02971_case_065", "p02971_case_066", "p02971_case_067", "p02971_case_068", "p02971_case_069", "p02971_case_070", "p02971_case_071", "p02971_case_072", "p02971_case_073", "p02971_case_074", "p02971_case_075", "p02971_case_076", "p02971_case_077", "p02971_case_078", "p02971_case_079", "p02971_case_080", "p02971_case_081", "p02971_case_082", "p02971_case_083", "p02971_case_084", "p02971_case_085", "p02971_case_086", "p02971_case_087", "p02971_case_088", "p02971_case_089", "p02971_case_090", "p02971_case_091", "p02971_case_092", "p02971_case_093", "p02971_case_094", "p02971_case_095", "p02971_case_096", "p02971_case_097", "p02971_case_098", "p02971_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\nread = sys.stdin.read\nreadline = sys.stdin.readline\nreadlines = sys.stdin.readlines\n\n\ndef main():\n N, *A = list(map(int, read().split()))\n A_ = sorted(A)\n m = max(A)\n for a in A:\n if a == m:\n print((A_[-2]))\n else:\n print(m)\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "1c6500df6434b4b516268de2191bc284b12208aa6d004a63137b0accccbd60de", "fast_id": "p02971_1c6500df6434b4b516268de2191bc284b12208aa6d004a63137b0accccbd60de", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\nread = sys.stdin.read\nreadline = sys.stdin.readline\nreadlines = sys.stdin.readlines\n\n\ndef main():\n N, *A = list(map(int, read().split()))\n A_ = sorted(A)\n m = max(A)\n for a in A:\n if a == m:\n print((A_[-2]))\n else:\n print(m)\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "1c6500df6434b4b516268de2191bc284b12208aa6d004a63137b0accccbd60de", "measured_slow_code": "N = int(eval(input()))\nA = []\nfor n in range(N):\n A.append(int(eval(input())))\nB = [0 for n in range(N)]\nB[0] = A[0]\nfor n in range(N - 1):\n B[n + 1] = max(B[n], A[n + 1])\nC = [0 for n in range(N)]\nC[-1] = A[-1]\nfor n in range(N - 1):\n C[-n - 2] = max(C[-n - 1], A[-n - 2])\nfor n in range(N):\n if n == 0:\n print((C[1]))\n elif n == N - 1:\n print((B[N - 2]))\n else:\n print((max(B[n - 1], C[n + 1])))\n", "measured_slow_code_sha256": "e6e57f68f3fdc316cc31aeebb4557798af4c5acadca510eedbfbac5837388225", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 7.248328429033741, "pair_id": "python_v2_904e58545a3b5be56253c648", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02971", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02971_1c6500df6434b4b516268de2191bc284b12208aa6d004a63137b0accccbd60de.jsonl.gz", "inputs": "reproduction/python/inputs/p02971.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02971_e6e57f68f3fdc316cc31aeebb4557798af4c5acadca510eedbfbac5837388225.jsonl.gz"}, "slow_code": "N = int(eval(input()))\nA = []\nfor n in range(N):\n A.append(int(eval(input())))\nB = [0 for n in range(N)]\nB[0] = A[0]\nfor n in range(N - 1):\n B[n + 1] = max(B[n], A[n + 1])\nC = [0 for n in range(N)]\nC[-1] = A[-1]\nfor n in range(N - 1):\n C[-n - 2] = max(C[-n - 1], A[-n - 2])\nfor n in range(N):\n if n == 0:\n print((C[1]))\n elif n == N - 1:\n print((B[N - 2]))\n else:\n print((max(B[n - 1], C[n + 1])))\n", "slow_code_sha256": "e6e57f68f3fdc316cc31aeebb4557798af4c5acadca510eedbfbac5837388225", "slow_id": "p02971_e6e57f68f3fdc316cc31aeebb4557798af4c5acadca510eedbfbac5837388225", "speedup": 5.303823820220901, "stratum": "4-8", "within_pair_jaccard": 0.2702702702702703, "workload": {"case_count": 100, "description": "For each position i of an N-element integer sequence, output the maximum among all other N-1 entries. Equal values at different positions remain separate entries. Observed inputs: N=2..200000 (median 550); A_i=1..200000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1400007, "median": 2604.5, "min": 8}, "input_format": ["N\nA_1\n...\nA_N"], "input_format_status": "source_input_section", "input_lines": {"max": 200001, "median": 551.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200001, "median": 551.0, "min": 3}}} -{"case_ids": ["p02982_case_000", "p02982_case_001", "p02982_case_002", "p02982_case_003", "p02982_case_004", "p02982_case_005", "p02982_case_006", "p02982_case_007", "p02982_case_008", "p02982_case_009", "p02982_case_010", "p02982_case_011", "p02982_case_012", "p02982_case_013", "p02982_case_014", "p02982_case_015", "p02982_case_016", "p02982_case_017", "p02982_case_018", "p02982_case_019", "p02982_case_020", "p02982_case_021", "p02982_case_022", "p02982_case_023", "p02982_case_024", "p02982_case_025", "p02982_case_026", "p02982_case_027", "p02982_case_028", "p02982_case_029", "p02982_case_030", "p02982_case_031", "p02982_case_032", "p02982_case_033", "p02982_case_034", "p02982_case_035", "p02982_case_036", "p02982_case_037", "p02982_case_038", "p02982_case_039", "p02982_case_040", "p02982_case_041", "p02982_case_042", "p02982_case_043", "p02982_case_044", "p02982_case_045", "p02982_case_046", "p02982_case_047", "p02982_case_048", "p02982_case_049", "p02982_case_050", "p02982_case_051", "p02982_case_052", "p02982_case_053", "p02982_case_054", "p02982_case_055", "p02982_case_056", "p02982_case_057", "p02982_case_058", "p02982_case_059", "p02982_case_060", "p02982_case_061", "p02982_case_062", "p02982_case_063", "p02982_case_064", "p02982_case_065", "p02982_case_066", "p02982_case_067", "p02982_case_068", "p02982_case_069", "p02982_case_070", "p02982_case_071", "p02982_case_072", "p02982_case_073", "p02982_case_074", "p02982_case_075", "p02982_case_076", "p02982_case_077", "p02982_case_078", "p02982_case_079", "p02982_case_080", "p02982_case_081", "p02982_case_082", "p02982_case_083", "p02982_case_084", "p02982_case_085", "p02982_case_086", "p02982_case_087", "p02982_case_088", "p02982_case_089", "p02982_case_090", "p02982_case_091", "p02982_case_092", "p02982_case_093", "p02982_case_094", "p02982_case_095", "p02982_case_096", "p02982_case_097", "p02982_case_098", "p02982_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N, D = list(map(int, input().split()))\nX = [list(map(int, input().split())) for _ in range(N)]\nS = {i**2 for i in range(1000)}\nans = (\n sum(a != b and sum((x - y) ** 2 for x, y in zip(a, b)) in S for a in X for b in X)\n // 2\n)\nprint(ans)\n", "fast_code_sha256": "08eadd1f06c4e53b1609a10a7af33c43ca14b042ad86b9a70693441a7a153acd", "fast_id": "p02982_08eadd1f06c4e53b1609a10a7af33c43ca14b042ad86b9a70693441a7a153acd", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N, D = list(map(int, input().split()))\nX = [list(map(int, input().split())) for _ in range(N)]\nS = {i**2 for i in range(1000)}\nans = (\n sum(a != b and sum((x - y) ** 2 for x, y in zip(a, b)) in S for a in X for b in X)\n // 2\n)\nprint(ans)\n", "measured_fast_code_sha256": "08eadd1f06c4e53b1609a10a7af33c43ca14b042ad86b9a70693441a7a153acd", "measured_slow_code": "from numpy import *\n\nn, *x = [int32(t.split()) for t in open(0)]\nprint((sum(j == int(j) for i in x for j in map(linalg.norm, i - x)) - n[0] >> 1))\n", "measured_slow_code_sha256": "8ff50014837e2e91e70d850adc84476cf7c0aad5ec8292d51447d9bb59555c48", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 139.77925281807404, "pair_id": "python_v2_ae69c3d2bfc367fa805891f0", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02982", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02982_08eadd1f06c4e53b1609a10a7af33c43ca14b042ad86b9a70693441a7a153acd.jsonl.gz", "inputs": "reproduction/python/inputs/p02982.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02982_8ff50014837e2e91e70d850adc84476cf7c0aad5ec8292d51447d9bb59555c48.jsonl.gz"}, "slow_code": "from numpy import *\n\nn, *x = [int32(t.split()) for t in open(0)]\nprint((sum(j == int(j) for i in x for j in map(linalg.norm, i - x)) - n[0] >> 1))\n", "slow_code_sha256": "8ff50014837e2e91e70d850adc84476cf7c0aad5ec8292d51447d9bb59555c48", "slow_id": "p02982_8ff50014837e2e91e70d850adc84476cf7c0aad5ec8292d51447d9bb59555c48", "speedup": 125.12774213231559, "stratum": "8+", "within_pair_jaccard": 0.24324324324324326, "workload": {"case_count": 100, "description": "Given N distinct points with integer coordinates in D dimensions, count unordered pairs at integer Euclidean distance. Observed inputs: N=2..10 (median 5); D=1..10 (median 3); X_i_j=-20..20.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 321, "median": 50.0, "min": 8}, "input_format": ["N D\nX_1,1 ... X_1,D\n...\nX_N,1 ... X_N,D"], "input_format_status": "source_input_section", "input_lines": {"max": 11, "median": 6.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 102, "median": 17.0, "min": 4}}} -{"case_ids": ["p02612_case_000", "p02612_case_001", "p02612_case_002", "p02612_case_003", "p02612_case_004", "p02612_case_005", "p02612_case_006", "p02612_case_007", "p02612_case_008", "p02612_case_009", "p02612_case_010", "p02612_case_011", "p02612_case_012", "p02612_case_013", "p02612_case_014", "p02612_case_015", "p02612_case_016", "p02612_case_017", "p02612_case_018", "p02612_case_019", "p02612_case_020", "p02612_case_021", "p02612_case_022", "p02612_case_023", "p02612_case_024", "p02612_case_025", "p02612_case_026", "p02612_case_027", "p02612_case_028", "p02612_case_029", "p02612_case_030", "p02612_case_031", "p02612_case_032", "p02612_case_033", "p02612_case_034", "p02612_case_035", "p02612_case_036", "p02612_case_037", "p02612_case_038", "p02612_case_039", "p02612_case_040", "p02612_case_041", "p02612_case_042", "p02612_case_043", "p02612_case_044", "p02612_case_045", "p02612_case_046", "p02612_case_047", "p02612_case_048", "p02612_case_049", "p02612_case_050", "p02612_case_051", "p02612_case_052", "p02612_case_053", "p02612_case_054", "p02612_case_055", "p02612_case_056", "p02612_case_057", "p02612_case_058", "p02612_case_059", "p02612_case_060", "p02612_case_061", "p02612_case_062", "p02612_case_063", "p02612_case_064", "p02612_case_065", "p02612_case_066", "p02612_case_067", "p02612_case_068", "p02612_case_069", "p02612_case_070", "p02612_case_071", "p02612_case_072", "p02612_case_073", "p02612_case_074", "p02612_case_075", "p02612_case_076", "p02612_case_077", "p02612_case_078", "p02612_case_079", "p02612_case_080", "p02612_case_081", "p02612_case_082", "p02612_case_083", "p02612_case_084", "p02612_case_085", "p02612_case_086", "p02612_case_087", "p02612_case_088", "p02612_case_089", "p02612_case_090", "p02612_case_091", "p02612_case_092", "p02612_case_093", "p02612_case_094", "p02612_case_095", "p02612_case_096", "p02612_case_097", "p02612_case_098", "p02612_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "print((-int(eval(input())) % 1000))\n", "fast_code_sha256": "bf2b25d30147294ff0276ceb1faeae7b06783207fa7b8ca256752e56cdee77d1", "fast_id": "p02612_bf2b25d30147294ff0276ceb1faeae7b06783207fa7b8ca256752e56cdee77d1", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "print((-int(eval(input())) % 1000))\n", "measured_fast_code_sha256": "bf2b25d30147294ff0276ceb1faeae7b06783207fa7b8ca256752e56cdee77d1", "measured_slow_code": "N = int(eval(input()))\nB = N // 1000\nif N <= 1000:\n print((1000 - N))\nelif N % 1000 == 0:\n print((0))\nelif N > 1000:\n print((((B + 1) * 1000) - N))\n", "measured_slow_code_sha256": "93e590a19c921767e21882d7b228be2019ad9fb9efcb3153b4a1639c8ba04b3c", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.424096763604136, "pair_id": "python_v2_98e02d504aa06f9032d72316", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02612", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02612_bf2b25d30147294ff0276ceb1faeae7b06783207fa7b8ca256752e56cdee77d1.jsonl.gz", "inputs": "reproduction/python/inputs/p02612.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02612_93e590a19c921767e21882d7b228be2019ad9fb9efcb3153b4a1639c8ba04b3c.jsonl.gz"}, "slow_code": "N = int(eval(input()))\nB = N // 1000\nif N <= 1000:\n print((1000 - N))\nelif N % 1000 == 0:\n print((0))\nelif N > 1000:\n print((((B + 1) * 1000) - N))\n", "slow_code_sha256": "93e590a19c921767e21882d7b228be2019ad9fb9efcb3153b4a1639c8ba04b3c", "slow_id": "p02612_93e590a19c921767e21882d7b228be2019ad9fb9efcb3153b4a1639c8ba04b3c", "speedup": 2.4168622239899658, "stratum": "2-4", "within_pair_jaccard": 0.45454545454545453, "workload": {"case_count": 100, "description": "Find the change received for a price N when paying with the minimum sufficient number of 1000-unit bills. Observed inputs: N=1..10000 (median 5000.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 6, "median": 5.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p03212_case_000", "p03212_case_001", "p03212_case_002", "p03212_case_003", "p03212_case_004", "p03212_case_005", "p03212_case_006", "p03212_case_007", "p03212_case_008", "p03212_case_009", "p03212_case_010", "p03212_case_011", "p03212_case_012", "p03212_case_013", "p03212_case_014", "p03212_case_015", "p03212_case_016", "p03212_case_017", "p03212_case_018", "p03212_case_019", "p03212_case_020", "p03212_case_021", "p03212_case_022", "p03212_case_023", "p03212_case_024", "p03212_case_025", "p03212_case_026", "p03212_case_027", "p03212_case_028", "p03212_case_029", "p03212_case_030", "p03212_case_031", "p03212_case_032", "p03212_case_033", "p03212_case_034", "p03212_case_035", "p03212_case_036", "p03212_case_037", "p03212_case_038", "p03212_case_039", "p03212_case_040", "p03212_case_041", "p03212_case_042", "p03212_case_043", "p03212_case_044", "p03212_case_045", "p03212_case_046", "p03212_case_047", "p03212_case_048", "p03212_case_049", "p03212_case_050", "p03212_case_051", "p03212_case_052", "p03212_case_053", "p03212_case_054", "p03212_case_055", "p03212_case_056", "p03212_case_057", "p03212_case_058", "p03212_case_059", "p03212_case_060", "p03212_case_061", "p03212_case_062", "p03212_case_063", "p03212_case_064", "p03212_case_065", "p03212_case_066", "p03212_case_067", "p03212_case_068", "p03212_case_069", "p03212_case_070", "p03212_case_071", "p03212_case_072", "p03212_case_073", "p03212_case_074", "p03212_case_075", "p03212_case_076", "p03212_case_077", "p03212_case_078", "p03212_case_079", "p03212_case_080", "p03212_case_081", "p03212_case_082", "p03212_case_083", "p03212_case_084", "p03212_case_085", "p03212_case_086", "p03212_case_087", "p03212_case_088", "p03212_case_089", "p03212_case_090", "p03212_case_091", "p03212_case_092", "p03212_case_093", "p03212_case_094", "p03212_case_095", "p03212_case_096", "p03212_case_097", "p03212_case_098", "p03212_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import itertools\n\nN = int(eval(input()))\nans = 0\nS = []\nfor i in range(10):\n S += list(itertools.product(\"357\", repeat=i))\nfor s in S:\n if len(set(s)) > 2 and int(\"\".join(s)) <= N:\n ans += 1\nprint(ans)\n", "fast_code_sha256": "8c459e8eff528e57c94dccca2cd52c2cfde0176c2128a06cf6977d6d2cf03785", "fast_id": "p03212_8c459e8eff528e57c94dccca2cd52c2cfde0176c2128a06cf6977d6d2cf03785", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import itertools\n\nN = int(eval(input()))\nans = 0\nS = []\nfor i in range(10):\n S += list(itertools.product(\"357\", repeat=i))\nfor s in S:\n if len(set(s)) > 2 and int(\"\".join(s)) <= N:\n ans += 1\nprint(ans)\n", "measured_fast_code_sha256": "8c459e8eff528e57c94dccca2cd52c2cfde0176c2128a06cf6977d6d2cf03785", "measured_slow_code": "def DFS(n):\n if len(n) >= 3 and len(set(list(n)) & {\"3\", \"5\", \"7\"}) == 3:\n A.append(int(n))\n if len(n) < 10:\n for i in (\"3\", \"5\", \"7\"):\n DFS(n + i)\n\n\nn = int(eval(input()))\nA = []\nfor i in (\"3\", \"5\", \"7\"):\n DFS(i)\nA.sort()\ncnt = 0\nwhile 1:\n if A[cnt] <= n:\n cnt += 1\n else:\n break\nprint(cnt)\n", "measured_slow_code_sha256": "0673030745e51e0e71ea989ca56078e7009b913375c5bf3cc0e026cce49704f1", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4.064303023416432, "pair_id": "python_v2_a9ae97070a9877ac9d847f08", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03212", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03212_8c459e8eff528e57c94dccca2cd52c2cfde0176c2128a06cf6977d6d2cf03785.jsonl.gz", "inputs": "reproduction/python/inputs/p03212.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03212_0673030745e51e0e71ea989ca56078e7009b913375c5bf3cc0e026cce49704f1.jsonl.gz"}, "slow_code": "def DFS(n):\n if len(n) >= 3 and len(set(list(n)) & {\"3\", \"5\", \"7\"}) == 3:\n A.append(int(n))\n if len(n) < 10:\n for i in (\"3\", \"5\", \"7\"):\n DFS(n + i)\n\n\nn = int(eval(input()))\nA = []\nfor i in (\"3\", \"5\", \"7\"):\n DFS(i)\nA.sort()\ncnt = 0\nwhile 1:\n if A[cnt] <= n:\n cnt += 1\n else:\n break\nprint(cnt)\n", "slow_code_sha256": "0673030745e51e0e71ea989ca56078e7009b913375c5bf3cc0e026cce49704f1", "slow_id": "p03212_0673030745e51e0e71ea989ca56078e7009b913375c5bf3cc0e026cce49704f1", "speedup": 4.061388007932409, "stratum": "4-8", "within_pair_jaccard": 0.375, "workload": {"case_count": 100, "description": "Count positive integers at most N whose decimal digits use only 3,5,7 and contain each of those three digits at least once. Observed inputs: N=1..999999999 (median 133260161.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 10, "median": 10.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p02669_case_000", "p02669_case_001", "p02669_case_002", "p02669_case_003", "p02669_case_004", "p02669_case_005", "p02669_case_006", "p02669_case_007", "p02669_case_008", "p02669_case_009", "p02669_case_010", "p02669_case_011", "p02669_case_012", "p02669_case_013", "p02669_case_014", "p02669_case_015", "p02669_case_016", "p02669_case_017", "p02669_case_018", "p02669_case_019", "p02669_case_020", "p02669_case_021", "p02669_case_022", "p02669_case_023", "p02669_case_024", "p02669_case_025", "p02669_case_026", "p02669_case_027", "p02669_case_028", "p02669_case_029", "p02669_case_030", "p02669_case_031", "p02669_case_032", "p02669_case_033", "p02669_case_034", "p02669_case_035", "p02669_case_036", "p02669_case_037", "p02669_case_038", "p02669_case_039", "p02669_case_040", "p02669_case_041", "p02669_case_042", "p02669_case_043", "p02669_case_044", "p02669_case_045", "p02669_case_046", "p02669_case_047", "p02669_case_048", "p02669_case_049", "p02669_case_050", "p02669_case_051", "p02669_case_052", "p02669_case_054", "p02669_case_055", "p02669_case_056", "p02669_case_057", "p02669_case_058", "p02669_case_059", "p02669_case_060", "p02669_case_061", "p02669_case_062", "p02669_case_063", "p02669_case_064", "p02669_case_065", "p02669_case_066", "p02669_case_067", "p02669_case_068", "p02669_case_069", "p02669_case_070", "p02669_case_071", "p02669_case_072", "p02669_case_073", "p02669_case_074", "p02669_case_075", "p02669_case_076", "p02669_case_077", "p02669_case_078", "p02669_case_080", "p02669_case_081", "p02669_case_082", "p02669_case_083", "p02669_case_084", "p02669_case_085", "p02669_case_086", "p02669_case_087", "p02669_case_088", "p02669_case_089", "p02669_case_090", "p02669_case_091", "p02669_case_092", "p02669_case_093", "p02669_case_094", "p02669_case_095", "p02669_case_096", "p02669_case_097", "p02669_case_098", "p02669_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 98, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def f(k):\n if k == 1:\n return d\n if k == 0:\n return 0\n if k in m:\n return m[k]\n s = min(\n k * d,\n f(k // 2) + a + k % 2 * d,\n f((k + 1) // 2) + a + -k % 2 * d,\n f(k // 3) + b + k % 3 * d,\n f((k + 2) // 3) + b + -k % 3 * d,\n f(k // 5) + c + k % 5 * d,\n f((k + 4) // 5) + c + -k % 5 * d,\n )\n m[k] = s\n return s\n\n\nfor _ in range(int(eval(input()))):\n m = {}\n n, a, b, c, d = list(map(int, input().split()))\n print((f(n)))\n", "fast_code_sha256": "9521ea956556c8bca351a0fb0d99d7f29ecb173a21af4e3045b14fa48dad0430", "fast_id": "p02669_9521ea956556c8bca351a0fb0d99d7f29ecb173a21af4e3045b14fa48dad0430", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def f(k):\n if k == 1:\n return d\n if k == 0:\n return 0\n if k in m:\n return m[k]\n s = min(\n k * d,\n f(k // 2) + a + k % 2 * d,\n f((k + 1) // 2) + a + -k % 2 * d,\n f(k // 3) + b + k % 3 * d,\n f((k + 2) // 3) + b + -k % 3 * d,\n f(k // 5) + c + k % 5 * d,\n f((k + 4) // 5) + c + -k % 5 * d,\n )\n m[k] = s\n return s\n\n\nfor _ in range(int(eval(input()))):\n m = {}\n n, a, b, c, d = list(map(int, input().split()))\n print((f(n)))\n", "measured_fast_code_sha256": "9521ea956556c8bca351a0fb0d99d7f29ecb173a21af4e3045b14fa48dad0430", "measured_slow_code": "import sys\n\ndivs = [2, 3, 5]\nt = int(eval(input()))\nfor _ in range(t):\n n, a, b, c, d = list(map(int, input().split()))\n costs = [a, b, c]\n dp = {}\n\n def dfs(x):\n if x in dp:\n return dp[x]\n # print(x, file=sys.stderr)\n if x == 0:\n dp[x] = 0\n return dp[x]\n ret = x * d\n for i in range(-4, 5):\n if x - i < 0:\n continue\n nx = x - i\n for cost, div in zip(costs, divs):\n if nx % div != 0 or nx // div >= x:\n continue\n ret = min(ret, dfs(nx // div) + cost + abs(i) * d)\n dp[x] = ret\n return ret\n\n print((dfs(n)))\n", "measured_slow_code_sha256": "5dc16e69171829fb825a4382d7ae818d1f78cf50ef12255ba28fcf6c6591e0e1", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 11.901614097650649, "pair_id": "python_v2_4c17c3afa8eedfbe595aa223", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02669", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02669_9521ea956556c8bca351a0fb0d99d7f29ecb173a21af4e3045b14fa48dad0430.jsonl.gz", "inputs": "reproduction/python/inputs/p02669.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02669_5dc16e69171829fb825a4382d7ae818d1f78cf50ef12255ba28fcf6c6591e0e1.jsonl.gz"}, "slow_code": "import sys\n\ndivs = [2, 3, 5]\nt = int(eval(input()))\nfor _ in range(t):\n n, a, b, c, d = list(map(int, input().split()))\n costs = [a, b, c]\n dp = {}\n\n def dfs(x):\n if x in dp:\n return dp[x]\n\n if x == 0:\n dp[x] = 0\n return dp[x]\n ret = x * d\n for i in range(-4, 5):\n if x - i < 0:\n continue\n nx = x - i\n for cost, div in zip(costs, divs):\n if nx % div != 0 or nx // div >= x:\n continue\n ret = min(ret, dfs(nx // div) + cost + abs(i) * d)\n dp[x] = ret\n return ret\n\n print((dfs(n)))\n", "slow_code_sha256": "ca3505b4e5755f2e5a6dda25d2ba0ee1f8926fae7d5ee6e43c499cad98b2e89b", "slow_id": "p02669_5dc16e69171829fb825a4382d7ae818d1f78cf50ef12255ba28fcf6c6591e0e1", "speedup": 7.377084777321196, "stratum": "4-8", "within_pair_jaccard": 0.5, "workload": {"case_count": 98, "description": "For each of T cases, find the minimum cost to change 0 into N. Multiplication by 2, 3 or 5 costs A, B or C respectively; increasing or decreasing by 1 costs D. Operations may be repeated in any order. Observed inputs: T=1..10 (median 1); N=1..999999995042541824; A=1..1000000000; B=1..1000000000; C=1..1000000000; D=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 98, "input_bytes": {"max": 592, "median": 43.5, "min": 12}, "input_format": ["T\nN_1 A_1 B_1 C_1 D_1\n...\nN_T A_T B_T C_T D_T"], "input_format_status": "source_input_section", "input_lines": {"max": 11, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 51, "median": 6.0, "min": 6}}} -{"case_ids": ["p03261_case_000", "p03261_case_001", "p03261_case_002", "p03261_case_003", "p03261_case_004", "p03261_case_005", "p03261_case_006", "p03261_case_007", "p03261_case_008", "p03261_case_009", "p03261_case_010", "p03261_case_011", "p03261_case_012", "p03261_case_013", "p03261_case_014", "p03261_case_015", "p03261_case_016", "p03261_case_017", "p03261_case_018", "p03261_case_019", "p03261_case_020", "p03261_case_021", "p03261_case_022", "p03261_case_023", "p03261_case_024", "p03261_case_025", "p03261_case_026", "p03261_case_027", "p03261_case_028", "p03261_case_029", "p03261_case_030", "p03261_case_031", "p03261_case_032", "p03261_case_033", "p03261_case_034", "p03261_case_035", "p03261_case_036", "p03261_case_037", "p03261_case_038", "p03261_case_039", "p03261_case_040", "p03261_case_041", "p03261_case_042", "p03261_case_044", "p03261_case_045", "p03261_case_046", "p03261_case_047", "p03261_case_048", "p03261_case_049", "p03261_case_050", "p03261_case_051", "p03261_case_052", "p03261_case_053", "p03261_case_054", "p03261_case_055", "p03261_case_056", "p03261_case_057", "p03261_case_058", "p03261_case_059", "p03261_case_060", "p03261_case_061", "p03261_case_062", "p03261_case_063", "p03261_case_064", "p03261_case_065", "p03261_case_066", "p03261_case_067", "p03261_case_068", "p03261_case_069", "p03261_case_070", "p03261_case_071", "p03261_case_072", "p03261_case_073", "p03261_case_074", "p03261_case_075", "p03261_case_076", "p03261_case_077", "p03261_case_078", "p03261_case_079", "p03261_case_080", "p03261_case_081", "p03261_case_082", "p03261_case_083", "p03261_case_084", "p03261_case_085", "p03261_case_086", "p03261_case_087", "p03261_case_088", "p03261_case_089", "p03261_case_090", "p03261_case_091", "p03261_case_092", "p03261_case_093", "p03261_case_094", "p03261_case_095", "p03261_case_096", "p03261_case_097", "p03261_case_098", "p03261_case_099", "p03261_v2_9a6d341a1b9e508a7651"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "l = open(0).readlines()[1:]\nprint((\"YNeos\"[any(a[-2] != b[0] * l.count(a) for a, b in zip(l, l[1:])) :: 2]))\n", "fast_code_sha256": "41ca3f0e87b68277c575f3c05bc4d4d0a118974755d14ead187e1a329982fbac", "fast_id": "p03261_41ca3f0e87b68277c575f3c05bc4d4d0a118974755d14ead187e1a329982fbac", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "l = open(0).readlines()[1:]\nprint((\"YNeos\"[any(a[-2] != b[0] * l.count(a) for a, b in zip(l, l[1:])) :: 2]))\n", "measured_fast_code_sha256": "41ca3f0e87b68277c575f3c05bc4d4d0a118974755d14ead187e1a329982fbac", "measured_slow_code": "import sys\n\nstdin = sys.stdin\ninf = 1 << 60\nmod = 1000000007\nni = lambda: int(ns())\nnin = lambda y: [ni() for _ in range(y)]\nna = lambda: list(map(int, stdin.readline().split()))\nnan = lambda y: [na() for _ in range(y)]\nns = lambda: stdin.readline().rstrip()\nnsn = lambda y: [ns() for _ in range(y)]\nncl = lambda y: [list(ns()) for _ in range(y)]\nnas = lambda: stdin.readline().split()\nfrom collections import defaultdict\n\nN = ni()\nW = nsn(N)\nd = defaultdict(int)\nflag = True\nfor i in range(N):\n if i and W[i - 1][-1] != W[i][0]:\n flag = False\n if d[W[i]] >= 1:\n flag = False\n d[W[i]] += 1\nprint((\"Yes\" if flag else \"No\"))\n", "measured_slow_code_sha256": "b8edf8bfe255e97eaa522659a47a80fed76af05861a73db78ecf2fbd1a8cfe7e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.7471639324885846, "pair_id": "python_v2_6e60766d9371b7926b9c5216", "per_case_slow_code_faster_fraction": 0.12, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03261", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03261_41ca3f0e87b68277c575f3c05bc4d4d0a118974755d14ead187e1a329982fbac.jsonl.gz", "inputs": "reproduction/python/inputs/p03261.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03261_b8edf8bfe255e97eaa522659a47a80fed76af05861a73db78ecf2fbd1a8cfe7e.jsonl.gz"}, "slow_code": "import sys\n\nstdin = sys.stdin\ninf = 1 << 60\nmod = 1000000007\nni = lambda: int(ns())\nnin = lambda y: [ni() for _ in range(y)]\nna = lambda: list(map(int, stdin.readline().split()))\nnan = lambda y: [na() for _ in range(y)]\nns = lambda: stdin.readline().rstrip()\nnsn = lambda y: [ns() for _ in range(y)]\nncl = lambda y: [list(ns()) for _ in range(y)]\nnas = lambda: stdin.readline().split()\nfrom collections import defaultdict\n\nN = ni()\nW = nsn(N)\nd = defaultdict(int)\nflag = True\nfor i in range(N):\n if i and W[i - 1][-1] != W[i][0]:\n flag = False\n if d[W[i]] >= 1:\n flag = False\n d[W[i]] += 1\nprint((\"Yes\" if flag else \"No\"))\n", "slow_code_sha256": "b8edf8bfe255e97eaa522659a47a80fed76af05861a73db78ecf2fbd1a8cfe7e", "slow_id": "p03261_b8edf8bfe255e97eaa522659a47a80fed76af05861a73db78ecf2fbd1a8cfe7e", "speedup": 2.6560979234109707, "stratum": "2-4", "within_pair_jaccard": 0.09090909090909091, "workload": {"case_count": 100, "description": "Check whether N lowercase words form a valid word-chain history: each word after the first starts with the preceding word last letter, and no whole word is repeated. Invalid histories are legal inputs. Observed inputs: N=2..100 (median 10); word_length=1..10.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1104, "median": 113.0, "min": 6}, "input_format": ["N\nW_1\n...\nW_N"], "input_format_status": "source_input_section", "input_lines": {"max": 101, "median": 11.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 101, "median": 11.0, "min": 3}}} -{"case_ids": ["p03317_case_000", "p03317_case_001", "p03317_case_002", "p03317_case_003", "p03317_case_004", "p03317_case_005", "p03317_case_006", "p03317_case_007", "p03317_case_008", "p03317_case_009", "p03317_case_010", "p03317_case_011", "p03317_case_012", "p03317_case_013", "p03317_case_014", "p03317_case_015", "p03317_case_016", "p03317_case_017", "p03317_case_018", "p03317_case_019", "p03317_case_020", "p03317_case_021", "p03317_case_022", "p03317_case_023", "p03317_case_024", "p03317_case_025", "p03317_case_026", "p03317_case_027", "p03317_case_028", "p03317_case_029", "p03317_case_030", "p03317_case_031", "p03317_case_032", "p03317_case_033", "p03317_case_034", "p03317_case_035", "p03317_case_036", "p03317_case_037", "p03317_case_038", "p03317_case_039", "p03317_case_040", "p03317_case_041", "p03317_case_042", "p03317_case_043", "p03317_case_044", "p03317_case_045", "p03317_case_046", "p03317_case_047", "p03317_case_048", "p03317_case_049", "p03317_case_050", "p03317_case_051", "p03317_case_052", "p03317_case_053", "p03317_case_054", "p03317_case_055", "p03317_case_056", "p03317_case_057", "p03317_case_058", "p03317_case_059", "p03317_case_060", "p03317_case_061", "p03317_case_062", "p03317_case_063", "p03317_case_064", "p03317_case_065", "p03317_case_066", "p03317_case_067", "p03317_case_068", "p03317_case_069", "p03317_case_070", "p03317_case_071", "p03317_case_072", "p03317_case_073", "p03317_case_074", "p03317_case_075", "p03317_case_076", "p03317_case_077", "p03317_case_078", "p03317_case_079", "p03317_case_080", "p03317_case_081", "p03317_case_082", "p03317_case_083", "p03317_case_084", "p03317_case_085", "p03317_case_086", "p03317_case_087", "p03317_case_088", "p03317_case_089", "p03317_case_090", "p03317_case_091", "p03317_case_092", "p03317_case_093", "p03317_case_094", "p03317_case_095", "p03317_case_096", "p03317_case_097", "p03317_case_098", "p03317_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N, K = list(map(int, input().split()))\nprint(((N - 2) // (K - 1) + 1))\n", "fast_code_sha256": "579610e03242ba0bcafef8f3a8deacc5024df980a28f406c54a8b4dcc502b6a7", "fast_id": "p03317_579610e03242ba0bcafef8f3a8deacc5024df980a28f406c54a8b4dcc502b6a7", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N, K = list(map(int, input().split()))\nprint(((N - 2) // (K - 1) + 1))\n", "measured_fast_code_sha256": "579610e03242ba0bcafef8f3a8deacc5024df980a28f406c54a8b4dcc502b6a7", "measured_slow_code": "from collections import Counter\nfrom math import *\n\nN, K = [int(x) for x in input().strip().split()]\nA = [int(x) for x in input().strip().split()]\nA.sort()\nc = Counter(A)\nminc = c[A[0]]\nres = len(A) - minc\nprint((ceil(res / (K - 1))))\n", "measured_slow_code_sha256": "a49e8701c648359100d415e821b1668f4d7ae2ccaf0a530fd721c1bee96df392", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4.419310782682773, "pair_id": "python_v2_c94c1c88b0fbbc940b37418c", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03317", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03317_579610e03242ba0bcafef8f3a8deacc5024df980a28f406c54a8b4dcc502b6a7.jsonl.gz", "inputs": "reproduction/python/inputs/p03317.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03317_a49e8701c648359100d415e821b1668f4d7ae2ccaf0a530fd721c1bee96df392.jsonl.gz"}, "slow_code": "from collections import Counter\nfrom math import *\n\nN, K = [int(x) for x in input().strip().split()]\nA = [int(x) for x in input().strip().split()]\nA.sort()\nc = Counter(A)\nminc = c[A[0]]\nres = len(A) - minc\nprint((ceil(res / (K - 1))))\n", "slow_code_sha256": "a49e8701c648359100d415e821b1668f4d7ae2ccaf0a530fd721c1bee96df392", "slow_id": "p03317_a49e8701c648359100d415e821b1668f4d7ae2ccaf0a530fd721c1bee96df392", "speedup": 37.978111620472845, "stratum": "8+", "within_pair_jaccard": 0.2222222222222222, "workload": {"case_count": 100, "description": "Starting with a permutation of 1..N, repeatedly select K consecutive entries and replace all of them by their current minimum. Find the minimum operations needed to make every entry equal. Observed inputs: N=2..100000 (median 100); K=2..100000 (median 5); A_i=1..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 588909, "median": 299.0, "min": 8}, "input_format": ["N K\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100002, "median": 102.0, "min": 4}}} -{"case_ids": ["p03972_case_000", "p03972_case_001", "p03972_case_002", "p03972_case_003", "p03972_case_004", "p03972_case_005", "p03972_case_006", "p03972_case_007", "p03972_case_008", "p03972_case_009", "p03972_case_010", "p03972_case_011", "p03972_case_012", "p03972_case_013", "p03972_case_014", "p03972_case_015", "p03972_case_016", "p03972_case_017", "p03972_case_018", "p03972_case_019", "p03972_case_020", "p03972_case_021", "p03972_case_022", "p03972_case_023", "p03972_case_024", "p03972_case_025", "p03972_case_026", "p03972_case_027", "p03972_case_028", "p03972_case_029", "p03972_case_030", "p03972_case_031", "p03972_case_032", "p03972_case_033", "p03972_case_034", "p03972_case_035", "p03972_case_036", "p03972_case_037", "p03972_case_038", "p03972_case_039", "p03972_case_040", "p03972_case_041", "p03972_case_042", "p03972_case_043", "p03972_case_044", "p03972_case_045", "p03972_case_046", "p03972_case_047", "p03972_case_048", "p03972_case_049", "p03972_case_050", "p03972_case_051", "p03972_case_052", "p03972_case_053", "p03972_case_054", "p03972_case_055", "p03972_case_056", "p03972_case_057", "p03972_case_058", "p03972_case_059", "p03972_case_060", "p03972_case_061", "p03972_case_062", "p03972_case_063", "p03972_case_064", "p03972_case_065", "p03972_case_066", "p03972_case_067", "p03972_case_068", "p03972_case_069", "p03972_case_070", "p03972_case_071", "p03972_case_072", "p03972_case_073", "p03972_case_074", "p03972_case_075", "p03972_case_076", "p03972_case_077", "p03972_case_078", "p03972_case_079", "p03972_case_080", "p03972_case_081", "p03972_case_082", "p03972_case_083", "p03972_case_084", "p03972_case_085", "p03972_case_086", "p03972_case_087", "p03972_case_088", "p03972_case_089", "p03972_case_090", "p03972_case_091", "p03972_case_092", "p03972_case_093", "p03972_case_094", "p03972_case_095", "p03972_case_096", "p03972_case_097", "p03972_case_098", "p03972_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "w, h, *L = list(map(int, open(0).read().split()))\nP = L[:w]\nQ = [-qj for qj in L[w:]]\nx, y, ans = w, h, 0\nfor c in sorted(P + Q, key=abs):\n if c > 0:\n if x:\n ans += c * (y + 1)\n x -= 1\n else:\n if y:\n ans -= c * (x + 1)\n y -= 1\nprint(ans)\n", "fast_code_sha256": "e017ce0a742d01e8892c0abe2d44772f6ec0cff2cca270665ae25ecd66f25668", "fast_id": "p03972_e017ce0a742d01e8892c0abe2d44772f6ec0cff2cca270665ae25ecd66f25668", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "w, h, *L = list(map(int, open(0).read().split()))\nP = L[:w]\nQ = [-qj for qj in L[w:]]\nx, y, ans = w, h, 0\nfor c in sorted(P + Q, key=abs):\n if c > 0:\n if x:\n ans += c * (y + 1)\n x -= 1\n else:\n if y:\n ans -= c * (x + 1)\n y -= 1\nprint(ans)\n", "measured_fast_code_sha256": "e017ce0a742d01e8892c0abe2d44772f6ec0cff2cca270665ae25ecd66f25668", "measured_slow_code": "W, H = list(map(int, input().split()))\nP = [(int(eval(input())), 0) for i in range(W)]\nQ = [(int(eval(input())), 1) for i in range(H)]\nE = sorted(P + Q)\nused = [W + 1, H + 1]\nans = 0\nfor e, f in E:\n ans += e * used[1 - f]\n used[f] -= 1\nprint(ans)\n", "measured_slow_code_sha256": "13cb625d78acd745c6b507de0e8032c0bb09ea576635a23c07368c3938d7b12b", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 7.112347777479776, "pair_id": "python_v2_1635c0fcdbcc77b0e9a01f91", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03972", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03972_e017ce0a742d01e8892c0abe2d44772f6ec0cff2cca270665ae25ecd66f25668.jsonl.gz", "inputs": "reproduction/python/inputs/p03972.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03972_13cb625d78acd745c6b507de0e8032c0bb09ea576635a23c07368c3938d7b12b.jsonl.gz"}, "slow_code": "W, H = list(map(int, input().split()))\nP = [(int(eval(input())), 0) for i in range(W)]\nQ = [(int(eval(input())), 1) for i in range(H)]\nE = sorted(P + Q)\nused = [W + 1, H + 1]\nans = 0\nfor e, f in E:\n ans += e * used[1 - f]\n used[f] -= 1\nprint(ans)\n", "slow_code_sha256": "13cb625d78acd745c6b507de0e8032c0bb09ea576635a23c07368c3938d7b12b", "slow_id": "p03972_13cb625d78acd745c6b507de0e8032c0bb09ea576635a23c07368c3938d7b12b", "speedup": 6.645748335324004, "stratum": "4-8", "within_pair_jaccard": 0.3611111111111111, "workload": {"case_count": 100, "description": "Connect all vertices of a (W+1)-by-(H+1) rectangular grid at minimum total edge cost. Horizontal edge costs at column i are p_i; vertical edge costs at row j are q_j. Observed inputs: W=1..100000 (median 99999); H=1..100000 (median 99999); p_i=1..100000000; q_j=1..100000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 2000014, "median": 888948.0, "min": 8}, "input_format": ["W H\np_0\n...\np_(W-1)\nq_0\n...\nq_(H-1)"], "input_format_status": "source_input_section", "input_lines": {"max": 200001, "median": 100003.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200002, "median": 100004.0, "min": 4}}} -{"case_ids": ["p04006_case_000", "p04006_case_001", "p04006_case_002", "p04006_case_003", "p04006_case_004", "p04006_case_005", "p04006_case_006", "p04006_case_007", "p04006_case_008", "p04006_case_009", "p04006_case_010", "p04006_case_011", "p04006_case_012", "p04006_case_013", "p04006_case_014", "p04006_case_015", "p04006_case_016", "p04006_case_017", "p04006_case_018", "p04006_case_019", "p04006_case_020", "p04006_case_021", "p04006_case_022", "p04006_case_023", "p04006_case_024", "p04006_case_025", "p04006_case_026", "p04006_case_027", "p04006_case_028", "p04006_case_029", "p04006_case_030", "p04006_case_031", "p04006_case_032", "p04006_case_033", "p04006_case_034", "p04006_case_035", "p04006_case_036", "p04006_case_037", "p04006_case_038", "p04006_case_039", "p04006_case_040", "p04006_case_041", "p04006_case_042", "p04006_case_043", "p04006_case_044", "p04006_case_045", "p04006_case_046", "p04006_case_047", "p04006_case_048", "p04006_case_049", "p04006_case_050", "p04006_case_051", "p04006_case_052", "p04006_case_053", "p04006_case_054", "p04006_case_055", "p04006_case_056", "p04006_case_057", "p04006_case_058", "p04006_case_059", "p04006_case_060", "p04006_case_061", "p04006_case_062", "p04006_case_063", "p04006_case_064", "p04006_case_065", "p04006_case_066", "p04006_case_067", "p04006_case_068", "p04006_case_069", "p04006_case_070", "p04006_case_071", "p04006_case_072", "p04006_case_073", "p04006_case_074", "p04006_case_075", "p04006_case_076", "p04006_case_077", "p04006_case_078", "p04006_case_079", "p04006_case_080", "p04006_case_081", "p04006_case_082", "p04006_case_083", "p04006_case_084", "p04006_case_085", "p04006_case_086", "p04006_case_087", "p04006_case_088", "p04006_case_089", "p04006_case_090", "p04006_case_091", "p04006_case_092", "p04006_case_093", "p04006_case_094", "p04006_case_095", "p04006_case_096", "p04006_case_097", "p04006_case_098"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 99, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def read():\n return [int(i) for i in input().split(\" \")]\n\n\nN, x = read()\nA = read()\nans = sum(A)\ntempcost = ans\nBC = A[:]\nfor i in range(1, N):\n BC = [BC[j - 1] if BC[j - 1] < BC[j] else BC[j] for j in range(N)]\n tempcost = x * i + sum(BC)\n if ans > tempcost:\n ans = tempcost\n else:\n break\nprint(ans)\n", "fast_code_sha256": "82bf4f276c0a09fe27a6e4132487b584e11a65cfb83dd419a366bd2029a5d62a", "fast_id": "p04006_82bf4f276c0a09fe27a6e4132487b584e11a65cfb83dd419a366bd2029a5d62a", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def read():\n return [int(i) for i in input().split(\" \")]\n\n\nN, x = read()\nA = read()\nans = sum(A)\ntempcost = ans\nBC = A[:]\nfor i in range(1, N):\n BC = [BC[j - 1] if BC[j - 1] < BC[j] else BC[j] for j in range(N)]\n tempcost = x * i + sum(BC)\n if ans > tempcost:\n ans = tempcost\n else:\n break\nprint(ans)\n", "measured_fast_code_sha256": "82bf4f276c0a09fe27a6e4132487b584e11a65cfb83dd419a366bd2029a5d62a", "measured_slow_code": "import numpy as np\nfrom copy import deepcopy\n\nN, x = list(map(int, input().split()))\nA = list(map(int, input().split()))\n\n\ndef myfunc(N, x, A):\n B = deepcopy(np.array(A))\n m = sum(B)\n\n def apppop(A):\n A.append(A[0])\n A.pop(0)\n\n for idx in range(1, N):\n apppop(A)\n np.fmin(B, A, out=B)\n m = min(np.sum(B) + idx * x, m)\n print(int(m))\n\n\nmyfunc(N, x, A)\n", "measured_slow_code_sha256": "91e1e2c740659f8110b6da7065d298174d653edb3135242031e3d37884d00c98", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 305.75397552835966, "pair_id": "python_v2_7a1218242ee4ebd04e4e4faa", "per_case_slow_code_faster_fraction": 0.12121212121212122, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p04006", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p04006_82bf4f276c0a09fe27a6e4132487b584e11a65cfb83dd419a366bd2029a5d62a.jsonl.gz", "inputs": "reproduction/python/inputs/p04006.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p04006_91e1e2c740659f8110b6da7065d298174d653edb3135242031e3d37884d00c98.jsonl.gz"}, "slow_code": "import numpy as np\nfrom copy import deepcopy\n\nN, x = list(map(int, input().split()))\nA = list(map(int, input().split()))\n\n\ndef myfunc(N, x, A):\n B = deepcopy(np.array(A))\n m = sum(B)\n\n def apppop(A):\n A.append(A[0])\n A.pop(0)\n\n for idx in range(1, N):\n apppop(A)\n np.fmin(B, A, out=B)\n m = min(np.sum(B) + idx * x, m)\n print(int(m))\n\n\nmyfunc(N, x, A)\n", "slow_code_sha256": "91e1e2c740659f8110b6da7065d298174d653edb3135242031e3d37884d00c98", "slow_id": "p04006_91e1e2c740659f8110b6da7065d298174d653edb3135242031e3d37884d00c98", "speedup": 96.7822623329425, "stratum": "8+", "within_pair_jaccard": 0.29545454545454547, "workload": {"case_count": 99, "description": "Starting with no slimes, acquire all N colors. Catching a missing color i costs a_i time; a spell costs x and rotates every held color i to i+1, wrapping N to 1. Minimize total time. Observed inputs: N=2..2000 (median 1000); x=1..1000000000; a_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 99, "input_bytes": {"max": 20015, "median": 5795, "min": 10}, "input_format": ["N x\na_1 ... a_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2002, "median": 1002, "min": 4}}} -{"case_ids": ["p02881_case_000", "p02881_case_001", "p02881_case_002", "p02881_case_003", "p02881_case_004", "p02881_case_005", "p02881_case_006", "p02881_case_007", "p02881_case_008", "p02881_case_009", "p02881_case_010", "p02881_case_011", "p02881_case_012", "p02881_case_013", "p02881_case_014", "p02881_case_015", "p02881_case_016", "p02881_case_017", "p02881_case_018", "p02881_case_019", "p02881_case_020", "p02881_case_021", "p02881_case_022", "p02881_case_023", "p02881_case_024", "p02881_case_025", "p02881_case_026", "p02881_case_027", "p02881_case_028", "p02881_case_029", "p02881_case_030", "p02881_case_031", "p02881_case_032", "p02881_case_033", "p02881_case_034", "p02881_case_035", "p02881_case_036", "p02881_case_037", "p02881_case_038", "p02881_case_039", "p02881_case_040", "p02881_case_041", "p02881_case_042", "p02881_case_043", "p02881_case_044", "p02881_case_045", "p02881_case_046", "p02881_case_047", "p02881_case_048", "p02881_case_049", "p02881_case_050", "p02881_case_051", "p02881_case_052", "p02881_case_053", "p02881_case_054", "p02881_case_055", "p02881_case_056", "p02881_case_057", "p02881_case_058", "p02881_case_059", "p02881_case_060", "p02881_case_061", "p02881_case_062", "p02881_case_063", "p02881_case_064", "p02881_case_065", "p02881_case_066", "p02881_case_067", "p02881_case_068", "p02881_case_069", "p02881_case_070", "p02881_case_071", "p02881_case_072", "p02881_case_073", "p02881_case_074", "p02881_case_075", "p02881_case_076", "p02881_case_077", "p02881_case_078", "p02881_case_079", "p02881_case_080", "p02881_case_081", "p02881_case_082", "p02881_case_083", "p02881_case_084", "p02881_case_085", "p02881_case_086", "p02881_case_087", "p02881_case_088", "p02881_case_089", "p02881_case_090", "p02881_case_091", "p02881_case_092", "p02881_case_093", "p02881_case_094", "p02881_case_095", "p02881_case_096", "p02881_case_097", "p02881_case_098", "p02881_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N = int(eval(input()))\nx = int(N**0.5)\nfor i in range(x, 0, -1):\n if N % i == 0:\n y = N // i\n break\nans = N // y + y - 2\nprint(ans)\n", "fast_code_sha256": "385f918e70558d30ce24cedf0de5f4a96a7aad60475bd5eec62a4ce0ebe4edee", "fast_id": "p02881_385f918e70558d30ce24cedf0de5f4a96a7aad60475bd5eec62a4ce0ebe4edee", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N = int(eval(input()))\nx = int(N**0.5)\nfor i in range(x, 0, -1):\n if N % i == 0:\n y = N // i\n break\nans = N // y + y - 2\nprint(ans)\n", "measured_fast_code_sha256": "385f918e70558d30ce24cedf0de5f4a96a7aad60475bd5eec62a4ce0ebe4edee", "measured_slow_code": "import sys\n\n\ndef divisors(n):\n res = []\n for i in range(1, int(n**0.5) + 1):\n if n % i:\n continue\n res.append(i)\n res.append(n // i)\n return res\n\n\nn = int(sys.stdin.readline().rstrip())\n\n\ndef main():\n res = divisors(n)\n print((res[-1] + res[-2] - 2))\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "28eda992eed4d282f61a604cf38592d85120f32b71c9516297db88165c63acfd", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.5281359279597306, "pair_id": "python_v2_7bc5ef06614f1c3be4c0a53b", "per_case_slow_code_faster_fraction": 0.26, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02881", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02881_385f918e70558d30ce24cedf0de5f4a96a7aad60475bd5eec62a4ce0ebe4edee.jsonl.gz", "inputs": "reproduction/python/inputs/p02881.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02881_28eda992eed4d282f61a604cf38592d85120f32b71c9516297db88165c63acfd.jsonl.gz"}, "slow_code": "import sys\n\n\ndef divisors(n):\n res = []\n for i in range(1, int(n**0.5) + 1):\n if n % i:\n continue\n res.append(i)\n res.append(n // i)\n return res\n\n\nn = int(sys.stdin.readline().rstrip())\n\n\ndef main():\n res = divisors(n)\n print((res[-1] + res[-2] - 2))\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "28eda992eed4d282f61a604cf38592d85120f32b71c9516297db88165c63acfd", "slow_id": "p02881_28eda992eed4d282f61a604cf38592d85120f32b71c9516297db88165c63acfd", "speedup": 6.151521995284416, "stratum": "4-8", "within_pair_jaccard": 0.30303030303030304, "workload": {"case_count": 100, "description": "On an infinite grid with value i*j at cell (i,j), start at (1,1). Each move increases exactly one coordinate by 1. Minimize moves to reach any cell of value N. Observed inputs: N=2..1000000000000 (median 260337887119.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 14, "median": 13.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p02554_case_000", "p02554_case_001", "p02554_case_002", "p02554_case_003", "p02554_case_004", "p02554_case_005", "p02554_case_006", "p02554_case_007", "p02554_case_008", "p02554_case_009", "p02554_case_010", "p02554_case_011", "p02554_case_012", "p02554_case_013", "p02554_case_014", "p02554_case_015", "p02554_case_016", "p02554_case_017", "p02554_case_018", "p02554_case_019", "p02554_case_020", "p02554_case_021", "p02554_case_022", "p02554_case_023", "p02554_case_024", "p02554_case_025", "p02554_case_026", "p02554_case_027", "p02554_case_028", "p02554_case_029", "p02554_case_030", "p02554_case_031", "p02554_case_032", "p02554_case_033", "p02554_case_034", "p02554_case_035", "p02554_case_036", "p02554_case_037", "p02554_case_038", "p02554_case_039", "p02554_case_040", "p02554_case_041", "p02554_case_042", "p02554_case_043", "p02554_case_044", "p02554_case_045", "p02554_case_046", "p02554_case_047", "p02554_case_048", "p02554_case_049", "p02554_case_050", "p02554_case_051", "p02554_case_052", "p02554_case_053", "p02554_case_054", "p02554_case_055", "p02554_case_056", "p02554_case_057", "p02554_case_058", "p02554_case_059", "p02554_case_060", "p02554_case_061", "p02554_case_062", "p02554_case_063", "p02554_case_064", "p02554_case_065", "p02554_case_066", "p02554_case_067", "p02554_case_068", "p02554_case_069", "p02554_case_070", "p02554_case_071", "p02554_case_072", "p02554_case_073", "p02554_case_074", "p02554_case_075", "p02554_case_076", "p02554_case_077", "p02554_case_078", "p02554_case_079", "p02554_case_080", "p02554_case_081", "p02554_case_082", "p02554_case_083", "p02554_case_084", "p02554_case_085", "p02554_case_086", "p02554_case_087", "p02554_case_088", "p02554_case_089", "p02554_case_090", "p02554_case_091", "p02554_case_092", "p02554_case_093", "p02554_case_094", "p02554_case_095", "p02554_case_096", "p02554_case_097", "p02554_case_098", "p02554_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "executable_AST_equal_except_explicit_explanatory_string_removal_and_all_frozen_inputs_checker_pass", "fast_code": "N = int(eval(input()))\nMOD = 10**9 + 7\nval1 = pow(9, N, MOD)\nval2 = pow(8, N, MOD)\nans = pow(10, N, MOD) - 2 * val1 + val2\nprint((ans % MOD))\n", "fast_code_sha256": "931290005b6494488a3db3167dc8d901b0ed6aa8ebc2799fa65710fb0cd2a9d5", "fast_id": "p02554_931290005b6494488a3db3167dc8d901b0ed6aa8ebc2799fa65710fb0cd2a9d5", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N = int(eval(input()))\nMOD = 10**9 + 7\nval1 = pow(9, N, MOD)\nval2 = pow(8, N, MOD)\nans = pow(10, N, MOD) - 2 * val1 + val2\nprint((ans % MOD))\n", "measured_fast_code_sha256": "931290005b6494488a3db3167dc8d901b0ed6aa8ebc2799fa65710fb0cd2a9d5", "measured_slow_code": "MOD = 10**9 + 7\n\n\ndef solve(n):\n \"\"\"\n 0: {}\n 1: {0}\n 2: {9}\n 3: {0,9}\n \"\"\"\n dp = [[0] * 4 for i in range(n + 1)]\n dp[0][0] = 1\n for i in range(n):\n dp[i + 1][3] = (10 * dp[i][3] + dp[i][2] + dp[i][1]) % MOD\n dp[i + 1][2] = (9 * dp[i][2] + dp[i][0]) % MOD\n dp[i + 1][1] = (9 * dp[i][1] + dp[i][0]) % MOD\n dp[i + 1][0] = (8 * dp[i][0]) % MOD\n return dp[n][3]\n\n\nn = int(eval(input()))\nprint((solve(n)))\n", "measured_slow_code_sha256": "1216aa013ca95268c8cea10ef1956fc82ecf53c33048dc021f31f4ae82487ba4", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 9437.511734546266, "pair_id": "python_v2_f2e8406443ed6507351b0112", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02554", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02554_931290005b6494488a3db3167dc8d901b0ed6aa8ebc2799fa65710fb0cd2a9d5.jsonl.gz", "inputs": "reproduction/python/inputs/p02554.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02554_1216aa013ca95268c8cea10ef1956fc82ecf53c33048dc021f31f4ae82487ba4.jsonl.gz"}, "slow_code": "MOD = 10**9 + 7\n\n\ndef solve(n):\n dp = [[0] * 4 for i in range(n + 1)]\n dp[0][0] = 1\n for i in range(n):\n dp[i + 1][3] = (10 * dp[i][3] + dp[i][2] + dp[i][1]) % MOD\n dp[i + 1][2] = (9 * dp[i][2] + dp[i][0]) % MOD\n dp[i + 1][1] = (9 * dp[i][1] + dp[i][0]) % MOD\n dp[i + 1][0] = (8 * dp[i][0]) % MOD\n return dp[n][3]\n\n\nn = int(eval(input()))\nprint((solve(n)))\n", "slow_code_sha256": "d34cbcef17a1809eb9aaea9acac748f4f348edb348ac1a61f3b30198ffe07352", "slow_id": "p02554_1216aa013ca95268c8cea10ef1956fc82ecf53c33048dc021f31f4ae82487ba4", "speedup": 1796.8443395117338, "stratum": "8+", "within_pair_jaccard": 0.35714285714285715, "workload": {"case_count": 100, "description": "Count length-N sequences over digits 0..9 containing both 0 and 9, modulo 1000000007. Observed inputs: N=1..1000000 (median 299407).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 8, "median": 7.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p03013_case_000", "p03013_case_001", "p03013_case_002", "p03013_case_003", "p03013_case_004", "p03013_case_005", "p03013_case_006", "p03013_case_007", "p03013_case_008", "p03013_case_009", "p03013_case_010", "p03013_case_011", "p03013_case_012", "p03013_case_013", "p03013_case_014", "p03013_case_015", "p03013_case_016", "p03013_case_017", "p03013_case_018", "p03013_case_019", "p03013_case_020", "p03013_case_021", "p03013_case_022", "p03013_case_023", "p03013_case_024", "p03013_case_025", "p03013_case_026", "p03013_case_027", "p03013_case_028", "p03013_case_029", "p03013_case_030", "p03013_case_031", "p03013_case_032", "p03013_case_033", "p03013_case_034", "p03013_case_035", "p03013_case_036", "p03013_case_037", "p03013_case_038", "p03013_case_039", "p03013_case_040", "p03013_case_041", "p03013_case_042", "p03013_case_043", "p03013_case_044", "p03013_case_045", "p03013_case_046", "p03013_case_047", "p03013_case_048", "p03013_case_049", "p03013_case_050", "p03013_case_051", "p03013_case_052", "p03013_case_053", "p03013_case_054", "p03013_case_055", "p03013_case_056", "p03013_case_057", "p03013_case_058", "p03013_case_059", "p03013_case_060", "p03013_case_061", "p03013_case_062", "p03013_case_063", "p03013_case_064", "p03013_case_065", "p03013_case_066", "p03013_case_067", "p03013_case_068", "p03013_case_069", "p03013_case_070", "p03013_case_071", "p03013_case_072", "p03013_case_073", "p03013_case_074", "p03013_case_075", "p03013_case_076", "p03013_case_077", "p03013_case_078", "p03013_case_079", "p03013_case_080", "p03013_case_081", "p03013_case_082", "p03013_case_083", "p03013_case_084", "p03013_case_085", "p03013_case_086", "p03013_case_087", "p03013_case_088", "p03013_case_089", "p03013_case_090", "p03013_case_091", "p03013_case_092", "p03013_case_093", "p03013_case_094", "p03013_case_095", "p03013_case_096", "p03013_case_097", "p03013_case_098", "p03013_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\nN, M = list(map(int, input().split()))\nans = [-1] * (N + 1)\nfor line in sys.stdin:\n ans[int(line)] = 0\nans[0] = 1\nif ans[1]:\n ans[1] = 1\nfor i in range(2, N + 1):\n if ans[i]:\n ans[i] = (ans[i - 1] + ans[i - 2]) % 1000000007\nprint((ans[N]))\n", "fast_code_sha256": "0fbcf304b55cbbfc76d27472c6e0786d4c49d4266d43eb3e6f21d54e1bdb2699", "fast_id": "p03013_ca7c3575955efba9f139fb28d4e990f1bba7b12ddabd6997bfd6ebc39eac6922", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\nN, M = list(map(int, input().split()))\nans = [-1] * (N + 1) # not evaluated yet\nfor line in sys.stdin:\n ans[int(line)] = 0 # unreachable\nans[0] = 1 # reachable\nif ans[1]: # if not unreachable\n ans[1] = 1\nfor i in range(2, N + 1):\n if ans[i]:\n ans[i] = (ans[i - 1] + ans[i - 2]) % 1000000007\nprint((ans[N]))\n", "measured_fast_code_sha256": "ca7c3575955efba9f139fb28d4e990f1bba7b12ddabd6997bfd6ebc39eac6922", "measured_slow_code": "MOD = 10**9 + 7\nN, M = list(map(int, input().split()))\na = [int(eval(input())) for k in range(M)]\ndp = [0] * (N + 2)\ndp[0] = 1\nfor e in a:\n dp[e] = -1\nfor k in range(N):\n if dp[k] != -1:\n if dp[k + 1] != -1:\n dp[k + 1] += dp[k]\n dp[k + 1] %= MOD\n if dp[k + 2] != -1:\n dp[k + 2] += dp[k]\n dp[k + 2] %= MOD\nprint((max(0, dp[N])))\n", "measured_slow_code_sha256": "4a80d25e3e49718fb943ef50228efaa460f0d9079accba468908a8cb7a7eecf9", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.837200706748116, "pair_id": "python_v2_7ccf10dcb3bcfd6668ad7166", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03013", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03013_ca7c3575955efba9f139fb28d4e990f1bba7b12ddabd6997bfd6ebc39eac6922.jsonl.gz", "inputs": "reproduction/python/inputs/p03013.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03013_4a80d25e3e49718fb943ef50228efaa460f0d9079accba468908a8cb7a7eecf9.jsonl.gz"}, "slow_code": "MOD = 10**9 + 7\nN, M = list(map(int, input().split()))\na = [int(eval(input())) for k in range(M)]\ndp = [0] * (N + 2)\ndp[0] = 1\nfor e in a:\n dp[e] = -1\nfor k in range(N):\n if dp[k] != -1:\n if dp[k + 1] != -1:\n dp[k + 1] += dp[k]\n dp[k + 1] %= MOD\n if dp[k + 2] != -1:\n dp[k + 2] += dp[k]\n dp[k + 2] %= MOD\nprint((max(0, dp[N])))\n", "slow_code_sha256": "4a80d25e3e49718fb943ef50228efaa460f0d9079accba468908a8cb7a7eecf9", "slow_id": "p03013_4a80d25e3e49718fb943ef50228efaa460f0d9079accba468908a8cb7a7eecf9", "speedup": 4.461285491653472, "stratum": "4-8", "within_pair_jaccard": 0.46875, "workload": {"case_count": 100, "description": "Count ways to climb from step 0 to N using jumps of 1 or 2, never landing on the M listed broken steps. Broken indices are strictly increasing and lie in 1..N-1. Output modulo 1000000007. Observed inputs: N=1..100000 (median 100000); M=0..99999 (median 12345); a_i=1..99999.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 588901, "median": 72724.0, "min": 4}, "input_format": ["N M\na_1\n...\na_M"], "input_format_status": "source_input_section", "input_lines": {"max": 100000, "median": 12346.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100001, "median": 12347.0, "min": 2}}} -{"case_ids": ["p02707_case_000", "p02707_case_001", "p02707_case_002", "p02707_case_003", "p02707_case_004", "p02707_case_005", "p02707_case_006", "p02707_case_007", "p02707_case_008", "p02707_case_009", "p02707_case_010", "p02707_case_011", "p02707_case_012", "p02707_case_013", "p02707_case_014", "p02707_case_015", "p02707_case_016", "p02707_case_017", "p02707_case_018", "p02707_case_019", "p02707_case_020", "p02707_case_021", "p02707_case_022", "p02707_case_023", "p02707_case_024", "p02707_case_025", "p02707_case_026", "p02707_case_027", "p02707_case_028", "p02707_case_029", "p02707_case_030", "p02707_case_031", "p02707_case_032", "p02707_case_033", "p02707_case_034", "p02707_case_035", "p02707_case_036", "p02707_case_037", "p02707_case_038", "p02707_case_039", "p02707_case_040", "p02707_case_041", "p02707_case_042", "p02707_case_043", "p02707_case_044", "p02707_case_045", "p02707_case_046", "p02707_case_047", "p02707_case_048", "p02707_case_049", "p02707_case_050", "p02707_case_051", "p02707_case_052", "p02707_case_053", "p02707_case_054", "p02707_case_055", "p02707_case_056", "p02707_case_057", "p02707_case_058", "p02707_case_059", "p02707_case_060", "p02707_case_061", "p02707_case_062", "p02707_case_063", "p02707_case_064", "p02707_case_065", "p02707_case_066", "p02707_case_067", "p02707_case_068", "p02707_case_069", "p02707_case_070", "p02707_case_071", "p02707_case_072", "p02707_case_073", "p02707_case_074", "p02707_case_075", "p02707_case_076", "p02707_case_077", "p02707_case_078", "p02707_case_079", "p02707_case_080", "p02707_case_081", "p02707_case_082", "p02707_case_083", "p02707_case_084", "p02707_case_085", "p02707_case_086", "p02707_case_087", "p02707_case_088", "p02707_case_089", "p02707_case_090", "p02707_case_091", "p02707_case_092", "p02707_case_093", "p02707_case_094", "p02707_case_095", "p02707_case_096", "p02707_case_097", "p02707_case_098", "p02707_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "a = int(eval(input()))\nb = [0] * a\nfor c in map(int, input().split()):\n b[c - 1] = b[c - 1] + 1\nprint((\"\\n\".join(map(str, b))))\n", "fast_code_sha256": "77f76a38867beb641e47757dba2bd5b430b6e0e083272ea4226efd20efb0d38e", "fast_id": "p02707_77f76a38867beb641e47757dba2bd5b430b6e0e083272ea4226efd20efb0d38e", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "a = int(eval(input()))\nb = [0] * a\nfor c in map(int, input().split()):\n b[c - 1] = b[c - 1] + 1\nprint((\"\\n\".join(map(str, b))))\n", "measured_fast_code_sha256": "77f76a38867beb641e47757dba2bd5b430b6e0e083272ea4226efd20efb0d38e", "measured_slow_code": "N = int(eval(input()))\n(*A,) = sorted(map(int, input().split()))\nimport bisect\n\nfor i in range(1, N + 1):\n print((bisect.bisect_right(A, i) - bisect.bisect_left(A, i)))\n", "measured_slow_code_sha256": "b0bbbf8788e5f791d52ab03649f3b13292c89e5d624dcbdf5953421651272f86", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.9356799627787815, "pair_id": "python_v2_09739e9a94c82bee72649de3", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02707", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02707_77f76a38867beb641e47757dba2bd5b430b6e0e083272ea4226efd20efb0d38e.jsonl.gz", "inputs": "reproduction/python/inputs/p02707.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02707_b0bbbf8788e5f791d52ab03649f3b13292c89e5d624dcbdf5953421651272f86.jsonl.gz"}, "slow_code": "N = int(eval(input()))\n(*A,) = sorted(map(int, input().split()))\nimport bisect\n\nfor i in range(1, N + 1):\n print((bisect.bisect_right(A, i) - bisect.bisect_left(A, i)))\n", "slow_code_sha256": "b0bbbf8788e5f791d52ab03649f3b13292c89e5d624dcbdf5953421651272f86", "slow_id": "p02707_b0bbbf8788e5f791d52ab03649f3b13292c89e5d624dcbdf5953421651272f86", "speedup": 2.3083746201613176, "stratum": "2-4", "within_pair_jaccard": 0.36, "workload": {"case_count": 100, "description": "A company has N numbered members. For member i=2..N, A_i nmax:\n print((0))\nelse:\n print((nmax - nmin + 1))\n", "fast_code_sha256": "88d3c7337d939da75e737e5df2426c4cedd0531d0d15f412b2dc43808b00f3e6", "fast_id": "p03037_88d3c7337d939da75e737e5df2426c4cedd0531d0d15f412b2dc43808b00f3e6", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N, M = list(map(int, input().split()))\nnmin = 1\nnmax = N\nfor _ in range(M):\n l, r = list(map(int, input().split()))\n nmin = max(nmin, l)\n nmax = min(nmax, r)\nif nmin > nmax:\n print((0))\nelse:\n print((nmax - nmin + 1))\n", "measured_fast_code_sha256": "88d3c7337d939da75e737e5df2426c4cedd0531d0d15f412b2dc43808b00f3e6", "measured_slow_code": "import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, queue, copy\n\nsys.setrecursionlimit(10**7)\ninf = 10**20\nmod = 10**9 + 7\ndd = [(-1, 0), (0, 1), (1, 0), (0, -1)]\nddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef LI_():\n return [int(x) - 1 for x in sys.stdin.readline().split()]\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LS():\n return sys.stdin.readline().split()\n\n\ndef S():\n return eval(input())\n\n\ndef main():\n n, k = LI()\n l = [0] * (n + 1)\n for _ in range(k):\n a, b = LI()\n l[a - 1] += 1\n l[b] -= 1\n for i in range(n - 1):\n l[i + 1] += l[i]\n ans = 0\n for x in l[:-1]:\n if x == k:\n ans += 1\n return ans\n\n\nprint((main()))\n", "measured_slow_code_sha256": "603682b2a1acebd824f0081d6dbfdc82575d41c2aa8f541e6ca8387c5cde8833", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.768577393844066, "pair_id": "python_v2_c3cd4a11c415876077682bd7", "per_case_slow_code_faster_fraction": 0.43, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03037", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03037_88d3c7337d939da75e737e5df2426c4cedd0531d0d15f412b2dc43808b00f3e6.jsonl.gz", "inputs": "reproduction/python/inputs/p03037.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03037_603682b2a1acebd824f0081d6dbfdc82575d41c2aa8f541e6ca8387c5cde8833.jsonl.gz"}, "slow_code": "import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, queue, copy\n\nsys.setrecursionlimit(10**7)\ninf = 10**20\nmod = 10**9 + 7\ndd = [(-1, 0), (0, 1), (1, 0), (0, -1)]\nddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef LI_():\n return [int(x) - 1 for x in sys.stdin.readline().split()]\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LS():\n return sys.stdin.readline().split()\n\n\ndef S():\n return eval(input())\n\n\ndef main():\n n, k = LI()\n l = [0] * (n + 1)\n for _ in range(k):\n a, b = LI()\n l[a - 1] += 1\n l[b] -= 1\n for i in range(n - 1):\n l[i + 1] += l[i]\n ans = 0\n for x in l[:-1]:\n if x == k:\n ans += 1\n return ans\n\n\nprint((main()))\n", "slow_code_sha256": "603682b2a1acebd824f0081d6dbfdc82575d41c2aa8f541e6ca8387c5cde8833", "slow_id": "p03037_603682b2a1acebd824f0081d6dbfdc82575d41c2aa8f541e6ca8387c5cde8833", "speedup": 4.578207497651763, "stratum": "4-8", "within_pair_jaccard": 0.1875, "workload": {"case_count": 100, "description": "There are N numbered access cards and M gates. Gate i accepts card IDs in inclusive interval [L_i,R_i]. Count individual cards that each permit passage through every gate. Observed inputs: N=1..100000 (median 99999); M=1..100000 (median 1000); L_i=1..100000; R_i=1..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1200014, "median": 7912.0, "min": 8}, "input_format": ["N M\nL_1 R_1\n...\nL_M R_M"], "input_format_status": "source_input_section", "input_lines": {"max": 100001, "median": 1001.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200002, "median": 2002.0, "min": 4}}} -{"case_ids": ["p03636_case_000", "p03636_case_001", "p03636_case_002", "p03636_case_003", "p03636_case_004", "p03636_case_005", "p03636_case_006", "p03636_case_007", "p03636_case_008", "p03636_case_009", "p03636_case_010", "p03636_case_011", "p03636_case_012", "p03636_case_013", "p03636_case_014", "p03636_case_015", "p03636_case_016", "p03636_case_017", "p03636_case_018", "p03636_case_019", "p03636_case_020", "p03636_case_021", "p03636_case_022", "p03636_case_023", "p03636_case_024", "p03636_case_025", "p03636_case_026", "p03636_case_027", "p03636_case_028", "p03636_case_029", "p03636_case_030", "p03636_case_031", "p03636_case_032", "p03636_case_033", "p03636_case_034", "p03636_case_035", "p03636_case_036", "p03636_case_037", "p03636_case_038", "p03636_case_039", "p03636_case_040", "p03636_case_041", "p03636_case_042", "p03636_case_043", "p03636_case_044", "p03636_case_045", "p03636_case_046", "p03636_case_047", "p03636_case_048", "p03636_case_049", "p03636_case_050", "p03636_case_051", "p03636_case_052", "p03636_case_053", "p03636_case_054", "p03636_case_055", "p03636_case_056", "p03636_case_057", "p03636_case_058", "p03636_case_059", "p03636_case_060", "p03636_case_061", "p03636_case_062", "p03636_case_063", "p03636_case_064", "p03636_case_065", "p03636_case_066", "p03636_case_067", "p03636_case_068", "p03636_case_069", "p03636_case_070", "p03636_case_071", "p03636_case_072", "p03636_case_073", "p03636_case_074", "p03636_case_075", "p03636_case_076", "p03636_case_077", "p03636_case_078", "p03636_case_079", "p03636_case_080", "p03636_case_081", "p03636_case_082", "p03636_case_083", "p03636_case_084", "p03636_case_085", "p03636_case_086", "p03636_case_087", "p03636_case_088", "p03636_case_089", "p03636_case_090", "p03636_case_091", "p03636_case_092", "p03636_case_093", "p03636_case_094", "p03636_case_095", "p03636_case_096", "p03636_case_097", "p03636_case_098", "p03636_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "a, *b, c = input()\nprint(a, len(b), c, sep=\"\")\n", "fast_code_sha256": "609aaacbc3ca3a070f6d10f1764a4fe238bfcc0848f58c3e30360e8ac581ed62", "fast_id": "p03636_609aaacbc3ca3a070f6d10f1764a4fe238bfcc0848f58c3e30360e8ac581ed62", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "a, *b, c = input()\nprint(a, len(b), c, sep=\"\")\n", "measured_fast_code_sha256": "609aaacbc3ca3a070f6d10f1764a4fe238bfcc0848f58c3e30360e8ac581ed62", "measured_slow_code": "import sys\n\nsys.setrecursionlimit(10**7)\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().rstrip().split())) # 空白あり\n\n\ndef LI2():\n return list(map(int, sys.stdin.readline().rstrip())) # 空白なし\n\n\ndef S():\n return sys.stdin.readline().rstrip()\n\n\ndef LS():\n return list(sys.stdin.readline().rstrip().split()) # 空白あり\n\n\ndef LS2():\n return list(sys.stdin.readline().rstrip()) # 空白なし\n\n\ns = LS2()\nprint((s[0] + str(len(s) - 2) + s[-1]))\n", "measured_slow_code_sha256": "5494f91b3cea4c891c6cbf71fe983d4d33ab7f0ec16a1291db2cdbe427651f21", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4.534769799266954, "pair_id": "python_v2_cef5400e1f8d143614253fe0", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03636", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03636_609aaacbc3ca3a070f6d10f1764a4fe238bfcc0848f58c3e30360e8ac581ed62.jsonl.gz", "inputs": "reproduction/python/inputs/p03636.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03636_5494f91b3cea4c891c6cbf71fe983d4d33ab7f0ec16a1291db2cdbe427651f21.jsonl.gz"}, "slow_code": "import sys\n\nsys.setrecursionlimit(10**7)\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef LI2():\n return list(map(int, sys.stdin.readline().rstrip()))\n\n\ndef S():\n return sys.stdin.readline().rstrip()\n\n\ndef LS():\n return list(sys.stdin.readline().rstrip().split())\n\n\ndef LS2():\n return list(sys.stdin.readline().rstrip())\n\n\ns = LS2()\nprint((s[0] + str(len(s) - 2) + s[-1]))\n", "slow_code_sha256": "da6dc96aa5d834038d28d109d605a384e0fe4a59a283760b08b599d7fd1f90de", "slow_id": "p03636_5494f91b3cea4c891c6cbf71fe983d4d33ab7f0ec16a1291db2cdbe427651f21", "speedup": 4.523517661140319, "stratum": "4-8", "within_pair_jaccard": 0.0625, "workload": {"case_count": 100, "description": "Abbreviate a lowercase word s as its first letter, the number of letters between the first and last, and its last letter. Observed inputs: s_length=3..100 (median 50).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 101, "median": 51.0, "min": 4}, "input_format": ["s"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p03700_case_000", "p03700_case_001", "p03700_case_002", "p03700_case_003", "p03700_case_004", "p03700_case_005", "p03700_case_006", "p03700_case_007", "p03700_case_008", "p03700_case_009", "p03700_case_010", "p03700_case_011", "p03700_case_012", "p03700_case_013", "p03700_case_014", "p03700_case_015", "p03700_case_016", "p03700_case_017", "p03700_case_018", "p03700_case_019", "p03700_case_020", "p03700_case_021", "p03700_case_022", "p03700_case_023", "p03700_case_024", "p03700_case_025", "p03700_case_026", "p03700_case_027", "p03700_case_028", "p03700_case_029", "p03700_case_030", "p03700_case_031", "p03700_case_032", "p03700_case_033", "p03700_case_034", "p03700_case_035", "p03700_case_036", "p03700_case_037", "p03700_case_038", "p03700_case_039", "p03700_case_040", "p03700_case_041", "p03700_case_042", "p03700_case_043", "p03700_case_044", "p03700_case_045", "p03700_case_046", "p03700_case_047", "p03700_case_048", "p03700_case_049", "p03700_case_050", "p03700_case_051", "p03700_case_052", "p03700_case_053", "p03700_case_054", "p03700_case_055", "p03700_case_056", "p03700_case_057", "p03700_case_058", "p03700_case_059", "p03700_case_060", "p03700_case_061", "p03700_case_062", "p03700_case_063", "p03700_case_064", "p03700_case_065", "p03700_case_066", "p03700_case_067", "p03700_case_068", "p03700_case_069", "p03700_case_070", "p03700_case_071", "p03700_case_072", "p03700_case_073", "p03700_case_074", "p03700_case_075", "p03700_case_076", "p03700_case_077", "p03700_case_078", "p03700_case_079", "p03700_case_080", "p03700_case_081", "p03700_case_082", "p03700_case_083", "p03700_case_084", "p03700_case_085", "p03700_case_086", "p03700_case_087", "p03700_case_088", "p03700_case_089", "p03700_case_090", "p03700_case_091", "p03700_case_092", "p03700_case_093", "p03700_case_094", "p03700_case_095", "p03700_case_096", "p03700_case_097", "p03700_case_098", "p03700_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "_, a, b, *H = list(map(int, open(0).read().split()))\nl, r = 0, 10**9\nwhile r - l > 1:\n m = (l + r) // 2\n if -sum(min(0, (h - m * b) // (b - a)) for h in H) > m:\n l = m\n else:\n r = m\nprint(r)\n", "fast_code_sha256": "dfc21526141391946fe1a7cc9119e0ef1b46fbd2a3ae7971e780a56f8a86c370", "fast_id": "p03700_dfc21526141391946fe1a7cc9119e0ef1b46fbd2a3ae7971e780a56f8a86c370", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "_, a, b, *H = list(map(int, open(0).read().split()))\nl, r = 0, 10**9\nwhile r - l > 1:\n m = (l + r) // 2\n if -sum(min(0, (h - m * b) // (b - a)) for h in H) > m:\n l = m\n else:\n r = m\nprint(r)\n", "measured_fast_code_sha256": "dfc21526141391946fe1a7cc9119e0ef1b46fbd2a3ae7971e780a56f8a86c370", "measured_slow_code": "import numpy as np\n\nN, A, B = list(map(int, input().split()))\nH = np.zeros(shape=N, dtype=\"int64\")\nfor _ in range(N):\n h = int(eval(input()))\n H[_] = h\n\n\ndef calc(num, a):\n a -= num * B\n a = (a - 1) // (A - B) + 1\n if sum(a[a > 0]) <= num:\n return True\n else:\n return False\n\n\nstart = 0\nend = 10**10\nwhile end - start > 1:\n mid = (start + end) // 2\n if calc(mid, H.copy()):\n end = mid\n else:\n start = mid\nprint(end)\n", "measured_slow_code_sha256": "4f614769a7e22dddcb85c7a9aa9d9cee3d9896b34340a1e7d8590ac4705426eb", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 0.5419026449631288, "pair_id": "python_v2_3f9369e51173f0cb3869ac6b", "per_case_slow_code_faster_fraction": 0.54, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03700", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03700_dfc21526141391946fe1a7cc9119e0ef1b46fbd2a3ae7971e780a56f8a86c370.jsonl.gz", "inputs": "reproduction/python/inputs/p03700.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03700_4f614769a7e22dddcb85c7a9aa9d9cee3d9896b34340a1e7d8590ac4705426eb.jsonl.gz"}, "slow_code": "import numpy as np\n\nN, A, B = list(map(int, input().split()))\nH = np.zeros(shape=N, dtype=\"int64\")\nfor _ in range(N):\n h = int(eval(input()))\n H[_] = h\n\n\ndef calc(num, a):\n a -= num * B\n a = (a - 1) // (A - B) + 1\n if sum(a[a > 0]) <= num:\n return True\n else:\n return False\n\n\nstart = 0\nend = 10**10\nwhile end - start > 1:\n mid = (start + end) // 2\n if calc(mid, H.copy()):\n end = mid\n else:\n start = mid\nprint(end)\n", "slow_code_sha256": "4f614769a7e22dddcb85c7a9aa9d9cee3d9896b34340a1e7d8590ac4705426eb", "slow_id": "p03700_4f614769a7e22dddcb85c7a9aa9d9cee3d9896b34340a1e7d8590ac4705426eb", "speedup": 3.027124663918093, "stratum": "2-4", "within_pair_jaccard": 0.32, "workload": {"case_count": 100, "description": "Each explosion targets one living monster for A damage and damages every other monster by B, with A>B. Monsters vanish at health <=0. Minimize explosions needed to eliminate all N monsters of initial health h_i. Observed inputs: N=1..100000 (median 100000); A=2..1000000000; B=1..999999999; h_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1100028, "median": 988832.0, "min": 10}, "input_format": ["N A B\nh_1\n...\nh_N"], "input_format_status": "source_input_section", "input_lines": {"max": 100001, "median": 100001.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100003, "median": 100003.0, "min": 4}}} -{"case_ids": ["p02681_case_000", "p02681_case_001", "p02681_case_002", "p02681_case_003", "p02681_case_004", "p02681_case_005", "p02681_case_006", "p02681_case_007", "p02681_case_008", "p02681_case_009", "p02681_case_010", "p02681_case_011", "p02681_case_012", "p02681_case_013", "p02681_case_014", "p02681_case_015", "p02681_case_016", "p02681_case_017", "p02681_case_018", "p02681_case_019", "p02681_case_020", "p02681_case_021", "p02681_case_022", "p02681_case_023", "p02681_case_024", "p02681_case_025", "p02681_case_026", "p02681_case_027", "p02681_case_028", "p02681_case_029", "p02681_case_030", "p02681_case_031", "p02681_case_032", "p02681_case_033", "p02681_case_034", "p02681_case_035", "p02681_case_036", "p02681_case_037", "p02681_case_038", "p02681_case_039", "p02681_case_040", "p02681_case_041", "p02681_case_042", "p02681_case_043", "p02681_case_044", "p02681_case_045", "p02681_case_046", "p02681_case_047", "p02681_case_048", "p02681_case_049", "p02681_case_050", "p02681_case_051", "p02681_case_052", "p02681_case_053", "p02681_case_054", "p02681_case_055", "p02681_case_056", "p02681_case_057", "p02681_case_058", "p02681_case_059", "p02681_case_060", "p02681_case_061", "p02681_case_062", "p02681_case_063", "p02681_case_064", "p02681_case_065", "p02681_case_066", "p02681_case_067", "p02681_case_068", "p02681_case_069", "p02681_case_070", "p02681_case_071", "p02681_case_072", "p02681_case_073", "p02681_case_074", "p02681_case_075", "p02681_case_076", "p02681_case_077", "p02681_case_078", "p02681_case_079", "p02681_case_080", "p02681_case_081", "p02681_case_082", "p02681_case_083", "p02681_case_084", "p02681_case_085", "p02681_case_086", "p02681_case_087", "p02681_case_088", "p02681_case_089", "p02681_case_090", "p02681_case_091", "p02681_case_092", "p02681_case_093", "p02681_case_094", "p02681_case_095", "p02681_case_096", "p02681_case_097", "p02681_case_098", "p02681_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from sys import stdin\n\n\ndef main():\n\n readline = stdin.readline\n S = readline().strip()\n T = readline().strip()\n for i in range(len(S)):\n if S[i] != T[i]:\n print(\"No\")\n break\n else:\n print(\"Yes\")\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "8a61637a1d14703b9160385c39f4e993c52449f2d33b71138f9ace68f4e4be79", "fast_id": "p02681_1a581c8d8cc0c5caa1dbf8ee92d900953e3408791a4cd33a35a82a324ed716c6", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from sys import stdin\n\n\ndef main():\n # 入力\n readline = stdin.readline\n S = readline().strip()\n T = readline().strip()\n for i in range(len(S)):\n if S[i] != T[i]:\n print(\"No\")\n break\n else:\n print(\"Yes\")\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "1a581c8d8cc0c5caa1dbf8ee92d900953e3408791a4cd33a35a82a324ed716c6", "measured_slow_code": "#!/usr/bin/env python3\n# Generated by https://github.com/kyuridenamida/atcoder-tools\nfrom typing import *\nimport itertools\nimport math\nimport sys\n\nINF = float(\"inf\")\nYES = \"Yes\" # type: str\nNO = \"No\" # type: str\n\n\ndef solve(S: str, T: str):\n return [NO, YES][S == T[:-1]]\n\n\ndef main():\n sys.setrecursionlimit(10**6)\n\n def iterate_tokens():\n for line in sys.stdin:\n for word in line.split():\n yield word\n\n tokens = iterate_tokens()\n S = next(tokens) # type: str\n T = next(tokens) # type: str\n print((solve(S, T)))\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "e11f3e444910fe42a6baf012b95849e72747767315b4086506c83bd0c43f1245", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 19.49847854420751, "pair_id": "python_v2_888d37f50d8a6d2b75ac3c19", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02681", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02681_1a581c8d8cc0c5caa1dbf8ee92d900953e3408791a4cd33a35a82a324ed716c6.jsonl.gz", "inputs": "reproduction/python/inputs/p02681.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02681_e11f3e444910fe42a6baf012b95849e72747767315b4086506c83bd0c43f1245.jsonl.gz"}, "slow_code": "from typing import *\nimport itertools\nimport math\nimport sys\n\nINF = float(\"inf\")\nYES = \"Yes\"\nNO = \"No\"\n\n\ndef solve(S: str, T: str):\n return [NO, YES][S == T[:-1]]\n\n\ndef main():\n sys.setrecursionlimit(10**6)\n\n def iterate_tokens():\n for line in sys.stdin:\n for word in line.split():\n yield word\n\n tokens = iterate_tokens()\n S = next(tokens)\n T = next(tokens)\n print((solve(S, T)))\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "aead1926afd539d76d7800cd27f3761ad24e19df52b7dacf9e4a54d6feb221d2", "slow_id": "p02681_e11f3e444910fe42a6baf012b95849e72747767315b4086506c83bd0c43f1245", "speedup": 19.46299748574494, "stratum": "8+", "within_pair_jaccard": 0.35555555555555557, "workload": {"case_count": 100, "description": "Determine whether lowercase string T can be obtained by appending exactly one lowercase letter to the end of S. T is guaranteed to have length |S|+1. Observed inputs: S_length=1..10 (median 5); T_length=2..11 (median 6).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 23, "median": 13.0, "min": 5}, "input_format": ["S\nT"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p03737_case_000", "p03737_case_001", "p03737_case_002", "p03737_case_003", "p03737_case_004", "p03737_case_005", "p03737_case_006", "p03737_case_007", "p03737_case_008", "p03737_case_009", "p03737_case_010", "p03737_case_011", "p03737_case_012", "p03737_case_013", "p03737_case_014", "p03737_case_015", "p03737_case_016", "p03737_case_017", "p03737_case_018", "p03737_case_019", "p03737_case_020", "p03737_case_021", "p03737_case_022", "p03737_case_023", "p03737_case_024", "p03737_case_025", "p03737_case_026", "p03737_case_027", "p03737_case_028", "p03737_case_029", "p03737_case_030", "p03737_case_031", "p03737_case_032", "p03737_case_033", "p03737_case_034", "p03737_case_035", "p03737_case_036", "p03737_case_037", "p03737_case_038", "p03737_case_039", "p03737_case_040", "p03737_case_041", "p03737_case_042", "p03737_case_043", "p03737_case_044", "p03737_case_045", "p03737_case_046", "p03737_case_047", "p03737_case_048", "p03737_case_049", "p03737_case_050", "p03737_case_051", "p03737_case_052", "p03737_case_053", "p03737_case_054", "p03737_case_055", "p03737_case_056", "p03737_case_057", "p03737_case_058", "p03737_case_059", "p03737_case_060", "p03737_case_061", "p03737_case_062", "p03737_case_063", "p03737_case_064", "p03737_case_065", "p03737_case_066", "p03737_case_067", "p03737_case_068", "p03737_case_069", "p03737_case_070", "p03737_case_071", "p03737_case_072", "p03737_case_073", "p03737_case_074", "p03737_case_075", "p03737_case_076", "p03737_case_077", "p03737_case_078", "p03737_case_079", "p03737_case_080", "p03737_case_081", "p03737_case_082", "p03737_case_083", "p03737_case_084", "p03737_case_085", "p03737_case_086", "p03737_case_087", "p03737_case_088", "p03737_case_089", "p03737_case_090", "p03737_case_091", "p03737_case_092", "p03737_case_093", "p03737_case_094", "p03737_case_095", "p03737_case_096", "p03737_case_097", "p03737_case_098", "p03737_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def generate_acronym(l1: list) -> str:\n answer = \"\"\n for i, word in enumerate(l1):\n\n answer += word[0].upper()\n return answer\n\n\nlists = list(map(str, input().split()))\nprint((generate_acronym(lists)))\n", "fast_code_sha256": "f2acecf8ec095af96485c316c6f0bfbf9c1f317c466a4cd3cb68726b2823506d", "fast_id": "p03737_4890498b309b7ec43710ae8f53962d9b23bf0c7b5e058a250de236c4a946a0aa", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def generate_acronym(l1: list) -> str:\n answer = \"\"\n for i, word in enumerate(l1):\n # answer.append(word[0].upper())\n answer += word[0].upper()\n return answer\n\n\nlists = list(map(str, input().split()))\nprint((generate_acronym(lists)))\n", "measured_fast_code_sha256": "4890498b309b7ec43710ae8f53962d9b23bf0c7b5e058a250de236c4a946a0aa", "measured_slow_code": "import numpy as np\nimport math\n\ns = \" \" + input()\nfor i in range(len(s)):\n if s[i] == \" \":\n print(chr(ord(s[i + 1]) - 32), end=\"\")\nprint()\n", "measured_slow_code_sha256": "c5a6a790bfe3c359c7ab2698d0f376a617bb650fa938bf64d595d41523985f6d", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1223.9431232759684, "pair_id": "python_v2_2ecb81269615092fcc760bf1", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03737", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03737_4890498b309b7ec43710ae8f53962d9b23bf0c7b5e058a250de236c4a946a0aa.jsonl.gz", "inputs": "reproduction/python/inputs/p03737.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03737_c5a6a790bfe3c359c7ab2698d0f376a617bb650fa938bf64d595d41523985f6d.jsonl.gz"}, "slow_code": "import numpy as np\nimport math\n\ns = \" \" + input()\nfor i in range(len(s)):\n if s[i] == \" \":\n print(chr(ord(s[i + 1]) - 32), end=\"\")\nprint()\n", "slow_code_sha256": "c5a6a790bfe3c359c7ab2698d0f376a617bb650fa938bf64d595d41523985f6d", "slow_id": "p03737_c5a6a790bfe3c359c7ab2698d0f376a617bb650fa938bf64d595d41523985f6d", "speedup": 1223.0477647490557, "stratum": "8+", "within_pair_jaccard": 0.15151515151515152, "workload": {"case_count": 100, "description": "Form an acronym from the uppercase first letters of three supplied lowercase words, in their given order. Observed inputs: word_length=1..10.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 33, "median": 18.0, "min": 6}, "input_format": ["s_1 s_2 s_3"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3, "median": 3.0, "min": 3}}} -{"case_ids": ["p02795_case_000", "p02795_case_001", "p02795_case_002", "p02795_case_003", "p02795_case_004", "p02795_case_005", "p02795_case_006", "p02795_case_007", "p02795_case_008", "p02795_case_009", "p02795_case_010", "p02795_case_011", "p02795_case_012", "p02795_case_013", "p02795_case_014", "p02795_case_015", "p02795_case_016", "p02795_case_017", "p02795_case_018", "p02795_case_019", "p02795_case_020", "p02795_case_021", "p02795_case_022", "p02795_case_023", "p02795_case_024", "p02795_case_025", "p02795_case_026", "p02795_case_027", "p02795_case_028", "p02795_case_029", "p02795_case_030", "p02795_case_031", "p02795_case_032", "p02795_case_033", "p02795_case_034", "p02795_case_035", "p02795_case_036", "p02795_case_037", "p02795_case_038", "p02795_case_039", "p02795_case_040", "p02795_case_041", "p02795_case_042", "p02795_case_043", "p02795_case_044", "p02795_case_045", "p02795_case_046", "p02795_case_047", "p02795_case_048", "p02795_case_049", "p02795_case_050", "p02795_case_051", "p02795_case_052", "p02795_case_053", "p02795_case_054", "p02795_case_055", "p02795_case_056", "p02795_case_057", "p02795_case_058", "p02795_case_059", "p02795_case_060", "p02795_case_061", "p02795_case_062", "p02795_case_063", "p02795_case_064", "p02795_case_065", "p02795_case_066", "p02795_case_067", "p02795_case_068", "p02795_case_069", "p02795_case_070", "p02795_case_071", "p02795_case_072", "p02795_case_073", "p02795_case_074", "p02795_case_075", "p02795_case_076", "p02795_case_077", "p02795_case_078", "p02795_case_079", "p02795_case_080", "p02795_case_081", "p02795_case_082", "p02795_case_083", "p02795_case_084", "p02795_case_085", "p02795_case_086", "p02795_case_087", "p02795_case_088", "p02795_case_089", "p02795_case_090", "p02795_case_091", "p02795_case_092", "p02795_case_093", "p02795_case_094", "p02795_case_095", "p02795_case_096", "p02795_case_097", "p02795_case_098", "p02795_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "h, w, n = int(eval(input())), int(eval(input())), int(eval(input()))\na = max(h, w)\nprint(((n + a - 1) // a))\n", "fast_code_sha256": "799357d89f6b25d06561da5e9b99e0802a7c29f1da18e31bc96db0b597d10eff", "fast_id": "p02795_799357d89f6b25d06561da5e9b99e0802a7c29f1da18e31bc96db0b597d10eff", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "h, w, n = int(eval(input())), int(eval(input())), int(eval(input()))\na = max(h, w)\nprint(((n + a - 1) // a))\n", "measured_fast_code_sha256": "799357d89f6b25d06561da5e9b99e0802a7c29f1da18e31bc96db0b597d10eff", "measured_slow_code": "H = int(eval(input()))\nW = int(eval(input()))\nN = int(eval(input()))\nHW = H * W\nans = H + W\nfor h in range(0, H + 1):\n for w in range(0, W + 1):\n cntB = HW - (H - h) * (W - w)\n if cntB >= N:\n ans = min(ans, h + w)\nprint(ans)\n", "measured_slow_code_sha256": "d022aa6ac902af8c6f29b3436e57b45e34d81f5307014236b2787c2022497c3f", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 30.339690676290175, "pair_id": "python_v2_0ef0b35367b7615a875a697c", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02795", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02795_799357d89f6b25d06561da5e9b99e0802a7c29f1da18e31bc96db0b597d10eff.jsonl.gz", "inputs": "reproduction/python/inputs/p02795.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02795_d022aa6ac902af8c6f29b3436e57b45e34d81f5307014236b2787c2022497c3f.jsonl.gz"}, "slow_code": "H = int(eval(input()))\nW = int(eval(input()))\nN = int(eval(input()))\nHW = H * W\nans = H + W\nfor h in range(0, H + 1):\n for w in range(0, W + 1):\n cntB = HW - (H - h) * (W - w)\n if cntB >= N:\n ans = min(ans, h + w)\nprint(ans)\n", "slow_code_sha256": "d022aa6ac902af8c6f29b3436e57b45e34d81f5307014236b2787c2022497c3f", "slow_id": "p02795_d022aa6ac902af8c6f29b3436e57b45e34d81f5307014236b2787c2022497c3f", "speedup": 18.860768264713265, "stratum": "8+", "within_pair_jaccard": 0.3181818181818182, "workload": {"case_count": 100, "description": "An implicit H-by-W white grid can be painted black one whole row or column per operation. Minimize operations needed for at least N black cells; the target does not exceed the grid area. Observed inputs: H=1..100 (median 60); W=1..100 (median 75); N=1..10000 (median 1281).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 14, "median": 11.0, "min": 6}, "input_format": ["H\nW\nN"], "input_format_status": "source_input_section", "input_lines": {"max": 3, "median": 3.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3, "median": 3.0, "min": 3}}} -{"case_ids": ["p02786_case_000", "p02786_case_001", "p02786_case_002", "p02786_case_003", "p02786_case_004", "p02786_case_005", "p02786_case_006", "p02786_case_007", "p02786_case_008", "p02786_case_009", "p02786_case_010", "p02786_case_011", "p02786_case_012", "p02786_case_013", "p02786_case_014", "p02786_case_015", "p02786_case_016", "p02786_case_017", "p02786_case_018", "p02786_case_019", "p02786_case_020", "p02786_case_021", "p02786_case_022", "p02786_case_023", "p02786_case_024", "p02786_case_025", "p02786_case_026", "p02786_case_027", "p02786_case_028", "p02786_case_029", "p02786_case_030", "p02786_case_031", "p02786_case_032", "p02786_case_033", "p02786_case_034", "p02786_case_035", "p02786_case_036", "p02786_case_037", "p02786_case_038", "p02786_case_039", "p02786_case_040", "p02786_case_041", "p02786_case_042", "p02786_case_043", "p02786_case_044", "p02786_case_045", "p02786_case_046", "p02786_case_047", "p02786_case_048", "p02786_case_049", "p02786_case_050", "p02786_case_051", "p02786_case_052", "p02786_case_053", "p02786_case_054", "p02786_case_055", "p02786_case_056", "p02786_case_057", "p02786_case_058", "p02786_case_059", "p02786_case_060", "p02786_case_061", "p02786_case_062", "p02786_case_063", "p02786_case_064", "p02786_case_065", "p02786_case_066", "p02786_case_067", "p02786_case_068", "p02786_case_069", "p02786_case_070", "p02786_case_071", "p02786_case_072", "p02786_case_073", "p02786_case_074", "p02786_case_075", "p02786_case_076", "p02786_case_077", "p02786_case_078", "p02786_case_079", "p02786_case_080", "p02786_case_081", "p02786_case_082", "p02786_case_083", "p02786_case_084", "p02786_case_085", "p02786_case_086", "p02786_case_087", "p02786_case_088", "p02786_case_089", "p02786_case_090", "p02786_case_091", "p02786_case_092", "p02786_case_093", "p02786_case_094", "p02786_case_095", "p02786_case_096", "p02786_case_097", "p02786_case_098", "p02786_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "print((2 ** len(bin(int(eval(input())))) // 4 - 1))\n", "fast_code_sha256": "616ce4a6320f09c63327b41eb9e11b621bc16378d67ab436444d8439d5150617", "fast_id": "p02786_616ce4a6320f09c63327b41eb9e11b621bc16378d67ab436444d8439d5150617", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "print((2 ** len(bin(int(eval(input())))) // 4 - 1))\n", "measured_fast_code_sha256": "616ce4a6320f09c63327b41eb9e11b621bc16378d67ab436444d8439d5150617", "measured_slow_code": "import numpy as np\n\nH = eval(input())\nH = int(H)\n\n\ndef count(H):\n count = 1\n while True:\n if int(H / 2) == 0:\n break\n else:\n H = int(H / 2)\n count += 1\n continue\n return count\n\n\nA = 0\nfor i in range(int(count(H))):\n A += 2**i\nprint(A)\n", "measured_slow_code_sha256": "09a65063dc765e4cefad5eee9e2b182a86482cf81649dc4a8e732b6ba516a72e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2435.919994398563, "pair_id": "python_v2_bcb934d16595174be60b000f", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02786", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02786_616ce4a6320f09c63327b41eb9e11b621bc16378d67ab436444d8439d5150617.jsonl.gz", "inputs": "reproduction/python/inputs/p02786.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02786_09a65063dc765e4cefad5eee9e2b182a86482cf81649dc4a8e732b6ba516a72e.jsonl.gz"}, "slow_code": "import numpy as np\n\nH = eval(input())\nH = int(H)\n\n\ndef count(H):\n count = 1\n while True:\n if int(H / 2) == 0:\n break\n else:\n H = int(H / 2)\n count += 1\n continue\n return count\n\n\nA = 0\nfor i in range(int(count(H))):\n A += 2**i\nprint(A)\n", "slow_code_sha256": "09a65063dc765e4cefad5eee9e2b182a86482cf81649dc4a8e732b6ba516a72e", "slow_id": "p02786_09a65063dc765e4cefad5eee9e2b182a86482cf81649dc4a8e732b6ba516a72e", "speedup": 2441.2123015855277, "stratum": "8+", "within_pair_jaccard": 0.17857142857142858, "workload": {"case_count": 100, "description": "One monster initially has health H. An attack kills a health-1 monster; a monster of health X>1 instead becomes two monsters of health floor(X/2). Find the minimum attacks to eliminate all monsters. Observed inputs: H=1..1000000000000 (median 9236181246).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 14, "median": 11.5, "min": 2}, "input_format": ["H"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p00741_case_000", "p00741_case_001", "p00741_case_002", "p00741_case_003", "p00741_case_004", "p00741_case_005", "p00741_case_006", "p00741_case_007", "p00741_case_008", "p00741_case_009", "p00741_case_010", "p00741_case_011", "p00741_case_012", "p00741_case_013", "p00741_case_014", "p00741_case_015", "p00741_case_016", "p00741_case_017", "p00741_case_018", "p00741_case_019", "p00741_case_020", "p00741_case_021", "p00741_case_022", "p00741_case_023", "p00741_case_024", "p00741_case_025", "p00741_case_026", "p00741_case_027", "p00741_case_028", "p00741_case_029", "p00741_case_030", "p00741_case_031", "p00741_case_032", "p00741_case_033", "p00741_case_034", "p00741_case_035", "p00741_case_036", "p00741_case_037", "p00741_case_038", "p00741_case_039", "p00741_case_040", "p00741_case_041", "p00741_case_042", "p00741_case_043", "p00741_case_044", "p00741_case_045", "p00741_case_046", "p00741_case_047", "p00741_case_048", "p00741_case_049", "p00741_case_050", "p00741_case_051", "p00741_case_052", "p00741_case_053", "p00741_case_054", "p00741_case_055", "p00741_case_056", "p00741_case_057", "p00741_case_058", "p00741_case_059", "p00741_case_060", "p00741_case_061", "p00741_case_062", "p00741_case_063", "p00741_case_064", "p00741_case_065", "p00741_case_066", "p00741_case_067", "p00741_case_068", "p00741_case_069", "p00741_case_070", "p00741_case_071", "p00741_case_072", "p00741_case_073", "p00741_case_074", "p00741_case_075", "p00741_case_076", "p00741_case_077", "p00741_case_078", "p00741_case_079", "p00741_case_080", "p00741_case_081", "p00741_case_082", "p00741_case_083", "p00741_case_084", "p00741_case_085", "p00741_case_086", "p00741_case_087", "p00741_case_088", "p00741_case_089", "p00741_case_090", "p00741_case_091", "p00741_case_092", "p00741_case_093", "p00741_case_094", "p00741_case_095", "p00741_case_096", "p00741_case_097", "p00741_case_098", "p00741_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def solve():\n from collections import deque\n\n while True:\n w, h = [int(x) + 2 for x in input().split()]\n if w == 2:\n break\n result = 0\n a = [\"0\"] * w\n for _ in [0] * (h - 2):\n a += [\"0\"] + input().split() + [\"0\"]\n a += [\"0\"] * w\n for i in range(w * h):\n if a[i] != \"1\":\n continue\n a[i] = \"0\"\n result += 1\n dq = deque([i])\n while dq:\n j = dq.popleft()\n for dest in (\n j - w - 1,\n j - w,\n j - w + 1,\n j - 1,\n j + 1,\n j + w - 1,\n j + w,\n j + w + 1,\n ):\n if a[dest] == \"1\":\n a[dest] = \"0\"\n dq.append(dest)\n print(result)\n\n\nif __name__ == \"__main__\":\n solve()\n", "fast_code_sha256": "577388b59770baa4e5ed373cc61dbcb2b4e3d4d4674e0c711c5066e60422b0d3", "fast_id": "p00741_577388b59770baa4e5ed373cc61dbcb2b4e3d4d4674e0c711c5066e60422b0d3", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def solve():\n from collections import deque\n\n while True:\n w, h = [int(x) + 2 for x in input().split()]\n if w == 2:\n break\n result = 0\n a = [\"0\"] * w\n for _ in [0] * (h - 2):\n a += [\"0\"] + input().split() + [\"0\"]\n a += [\"0\"] * w\n for i in range(w * h):\n if a[i] != \"1\":\n continue\n a[i] = \"0\"\n result += 1\n dq = deque([i])\n while dq:\n j = dq.popleft()\n for dest in (\n j - w - 1,\n j - w,\n j - w + 1,\n j - 1,\n j + 1,\n j + w - 1,\n j + w,\n j + w + 1,\n ):\n if a[dest] == \"1\":\n a[dest] = \"0\"\n dq.append(dest)\n print(result)\n\n\nif __name__ == \"__main__\":\n solve()\n", "measured_fast_code_sha256": "577388b59770baa4e5ed373cc61dbcb2b4e3d4d4674e0c711c5066e60422b0d3", "measured_slow_code": "import sys\nfrom pprint import pprint\n\n\nclass UnionFind:\n def __init__(self):\n self._parent = {}\n self._rank = {}\n self._equiv = {}\n\n def _find(self, x):\n if self._parent[x] == x:\n return self._parent[x]\n else:\n p = self._find(self._parent[x])\n self._parent[x] = p\n return p\n\n def _set_parent(self, child, parent):\n self._parent[child] = parent\n self._equiv[parent].update(self._equiv.pop(child))\n\n def _union(self, x, y):\n x = self._find(x)\n y = self._find(y)\n if x == y:\n return\n if self._rank[x] > self._rank[y]:\n self._set_parent(y, x)\n elif self._rank[x] < self._rank[y]:\n self._set_parent(x, y)\n else:\n self._set_parent(x, y)\n self._rank[x] += 1\n\n def _make_set(self, x):\n self._parent[x] = x\n self._rank[x] = 0\n self._equiv[x] = {x}\n\n def unite(self, *elements):\n if not elements:\n return\n for x in elements:\n if x in self._parent:\n continue\n self._make_set(x)\n x0 = elements[0]\n for x in elements[1:]:\n self._union(x0, x)\n\n def groups(self):\n return [set(e) for e in list(self._equiv.values())]\n\n\ndef pairs(ncol, nrow):\n # ?????????\n for x in range(ncol - 1):\n for y in range(nrow):\n yield [(x, y), (x + 1, y)]\n # ?????????\n for x in range(ncol):\n for y in range(nrow - 1):\n yield [(x, y), (x, y + 1)]\n # ???????????????\n for x in range(ncol - 1):\n for y in range(nrow - 1):\n yield [(x, y), (x + 1, y + 1)]\n # ???????????????\n for x in range(ncol - 1):\n for y in range(1, nrow):\n yield [(x, y), (x + 1, y - 1)]\n\n\ndef solve(ncol, nrow, rows):\n f = UnionFind()\n for x in range(ncol):\n for y in range(nrow):\n if rows[y][x]:\n f.unite((x, y))\n for (x1, y1), (x2, y2) in pairs(ncol, nrow):\n if rows[y1][x1] and rows[y2][x2]:\n f.unite((x1, y1), (x2, y2))\n return len(f.groups())\n\n\ndef main():\n while True:\n ncol, nrow = list(map(int, input().split()))\n if ncol == 0 and nrow == 0:\n break\n rows = []\n for _ in range(nrow):\n row = list(map(int, input().split()))\n rows.append(row)\n print((solve(ncol, nrow, rows)))\n\n\nmain()\n", "measured_slow_code_sha256": "0735c1a312ae16acc97c209d4348af561ba3d9c718d6566dd5c307d9219cab61", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 5.956169478311292, "pair_id": "python_v2_9f4f4f7d01264720c9f2fe15", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p00741", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p00741_577388b59770baa4e5ed373cc61dbcb2b4e3d4d4674e0c711c5066e60422b0d3.jsonl.gz", "inputs": "reproduction/python/inputs/p00741.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p00741_0735c1a312ae16acc97c209d4348af561ba3d9c718d6566dd5c307d9219cab61.jsonl.gz"}, "slow_code": "import sys\nfrom pprint import pprint\n\n\nclass UnionFind:\n def __init__(self):\n self._parent = {}\n self._rank = {}\n self._equiv = {}\n\n def _find(self, x):\n if self._parent[x] == x:\n return self._parent[x]\n else:\n p = self._find(self._parent[x])\n self._parent[x] = p\n return p\n\n def _set_parent(self, child, parent):\n self._parent[child] = parent\n self._equiv[parent].update(self._equiv.pop(child))\n\n def _union(self, x, y):\n x = self._find(x)\n y = self._find(y)\n if x == y:\n return\n if self._rank[x] > self._rank[y]:\n self._set_parent(y, x)\n elif self._rank[x] < self._rank[y]:\n self._set_parent(x, y)\n else:\n self._set_parent(x, y)\n self._rank[x] += 1\n\n def _make_set(self, x):\n self._parent[x] = x\n self._rank[x] = 0\n self._equiv[x] = {x}\n\n def unite(self, *elements):\n if not elements:\n return\n for x in elements:\n if x in self._parent:\n continue\n self._make_set(x)\n x0 = elements[0]\n for x in elements[1:]:\n self._union(x0, x)\n\n def groups(self):\n return [set(e) for e in list(self._equiv.values())]\n\n\ndef pairs(ncol, nrow):\n\n for x in range(ncol - 1):\n for y in range(nrow):\n yield [(x, y), (x + 1, y)]\n\n for x in range(ncol):\n for y in range(nrow - 1):\n yield [(x, y), (x, y + 1)]\n\n for x in range(ncol - 1):\n for y in range(nrow - 1):\n yield [(x, y), (x + 1, y + 1)]\n\n for x in range(ncol - 1):\n for y in range(1, nrow):\n yield [(x, y), (x + 1, y - 1)]\n\n\ndef solve(ncol, nrow, rows):\n f = UnionFind()\n for x in range(ncol):\n for y in range(nrow):\n if rows[y][x]:\n f.unite((x, y))\n for (x1, y1), (x2, y2) in pairs(ncol, nrow):\n if rows[y1][x1] and rows[y2][x2]:\n f.unite((x1, y1), (x2, y2))\n return len(f.groups())\n\n\ndef main():\n while True:\n ncol, nrow = list(map(int, input().split()))\n if ncol == 0 and nrow == 0:\n break\n rows = []\n for _ in range(nrow):\n row = list(map(int, input().split()))\n rows.append(row)\n print((solve(ncol, nrow, rows)))\n\n\nmain()\n", "slow_code_sha256": "a10583df4146149ff2d8bb1bf5e10386b85381f734796329c7fab07cb9105b27", "slow_id": "p00741_0735c1a312ae16acc97c209d4348af561ba3d9c718d6566dd5c307d9219cab61", "speedup": 5.928024374416366, "stratum": "4-8", "within_pair_jaccard": 0.25925925925925924, "workload": {"case_count": 100, "description": "For each binary map of width w and height h, count land components using horizontal, vertical and diagonal adjacency. Values 1 and 0 denote land and sea; outside the map is sea. A final 0 0 ends the maps. Observed inputs: datasets=1..50 (median 1); w=1..50; h=1..50; cells_per_map=1..2500; total_cells=1..12500 (median 2500).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 25034, "median": 5010.0, "min": 10}, "input_format": ["w_1 h_1\n[h_1 rows of w_1 binary integers]\n[next maps]\n0 0"], "input_format_status": "source_input_section", "input_lines": {"max": 551, "median": 52.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 12512, "median": 2504.0, "min": 5}}} -{"case_ids": ["p03330_case_000", "p03330_case_001", "p03330_case_002", "p03330_case_003", "p03330_case_004", "p03330_case_005", "p03330_case_006", "p03330_case_007", "p03330_case_008", "p03330_case_009", "p03330_case_010", "p03330_case_011", "p03330_case_012", "p03330_case_013", "p03330_case_014", "p03330_case_015", "p03330_case_016", "p03330_case_017", "p03330_case_018", "p03330_case_019", "p03330_case_020", "p03330_case_021", "p03330_case_022", "p03330_case_023", "p03330_case_024", "p03330_case_025", "p03330_case_026", "p03330_case_027", "p03330_case_028", "p03330_case_029", "p03330_case_030", "p03330_case_031", "p03330_case_032", "p03330_case_033", "p03330_case_034", "p03330_case_035", "p03330_case_036", "p03330_case_037", "p03330_case_038", "p03330_case_039", "p03330_case_040", "p03330_case_041", "p03330_case_042", "p03330_case_043", "p03330_case_044", "p03330_case_045", "p03330_case_046", "p03330_case_047", "p03330_case_048", "p03330_case_049", "p03330_case_050", "p03330_case_051", "p03330_case_052", "p03330_case_053", "p03330_case_054", "p03330_case_055", "p03330_case_056", "p03330_case_057", "p03330_case_058", "p03330_case_059", "p03330_case_060", "p03330_case_061", "p03330_case_062", "p03330_case_063", "p03330_case_064", "p03330_case_065", "p03330_case_066", "p03330_case_067", "p03330_case_068", "p03330_case_069", "p03330_case_070", "p03330_case_071", "p03330_case_072", "p03330_case_073", "p03330_case_074", "p03330_case_075", "p03330_case_076", "p03330_case_077", "p03330_case_078", "p03330_case_079", "p03330_case_080", "p03330_case_081", "p03330_case_082", "p03330_case_083", "p03330_case_084", "p03330_case_085", "p03330_case_086", "p03330_case_087", "p03330_case_088", "p03330_case_089", "p03330_case_090", "p03330_case_091", "p03330_case_092", "p03330_case_093", "p03330_case_094", "p03330_case_095", "p03330_case_096", "p03330_case_097", "p03330_case_098", "p03330_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from collections import Counter, defaultdict, deque\nimport sys, heapq, bisect, math, itertools, string, queue\n\nsys.setrecursionlimit(10**8)\nmod = 10**9 + 7\n\n\ndef inp():\n return int(sys.stdin.readline())\n\n\ndef inpl():\n return list(map(int, sys.stdin.readline().split()))\n\n\ndef inpl_str():\n return list(sys.stdin.readline().split())\n\n\ndef inpln(n):\n return list(int(sys.stdin.readline()) for i in range(n))\n\n\nn, C = inpl()\nd = []\nc = []\nfor i in range(C):\n d.append(inpl())\nfor i in range(n):\n c.append(inpl())\nd0 = defaultdict(int)\nd1 = defaultdict(int)\nd2 = defaultdict(int)\ndd = [d0, d1, d2]\nfor y in range(n):\n for x in range(n):\n t = (x + y + 2) % 3\n dd[t][c[x][y]] += 1\n\nres = [[] for i in range(3)]\nfor i in range(C):\n for j in range(3):\n tmp = 0\n for key in list(dd[j].keys()):\n tmp += d[key - 1][i] * dd[j][key]\n res[j].append([i, tmp])\nfor i in range(3):\n res[i].sort(key=lambda x: x[1])\n\nans = mod\nfor i in range(3):\n for j in range(3):\n for k in range(3):\n if (\n res[0][i][0] == res[1][j][0]\n or res[0][i][0] == res[2][k][0]\n or res[2][k][0] == res[1][j][0]\n ):\n continue\n ans = min(res[0][i][1] + res[1][j][1] + res[2][k][1], ans)\nprint(ans)\n", "fast_code_sha256": "75037892fbe0d3f8ec2f6cad07c769abb92a7779fb94ebaf53c5f1ef1cf5a970", "fast_id": "p03330_2bf84a04b2c862b8fc6cada5361225248d707fa385c9679c1031ce69470c3f9c", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from collections import Counter, defaultdict, deque\nimport sys, heapq, bisect, math, itertools, string, queue\n\nsys.setrecursionlimit(10**8)\nmod = 10**9 + 7\n\n\ndef inp():\n return int(sys.stdin.readline())\n\n\ndef inpl():\n return list(map(int, sys.stdin.readline().split()))\n\n\ndef inpl_str():\n return list(sys.stdin.readline().split())\n\n\ndef inpln(n):\n return list(int(sys.stdin.readline()) for i in range(n))\n\n\nn, C = inpl()\nd = []\nc = []\nfor i in range(C):\n d.append(inpl())\nfor i in range(n):\n c.append(inpl())\nd0 = defaultdict(int)\nd1 = defaultdict(int)\nd2 = defaultdict(int)\ndd = [d0, d1, d2]\nfor y in range(n):\n for x in range(n):\n t = (x + y + 2) % 3\n dd[t][c[x][y]] += 1\n# print(dd)\nres = [[] for i in range(3)]\nfor i in range(C):\n for j in range(3):\n tmp = 0\n for key in list(dd[j].keys()):\n tmp += d[key - 1][i] * dd[j][key]\n res[j].append([i, tmp])\nfor i in range(3):\n res[i].sort(key=lambda x: x[1])\n# print(res)\nans = mod\nfor i in range(3):\n for j in range(3):\n for k in range(3):\n if (\n res[0][i][0] == res[1][j][0]\n or res[0][i][0] == res[2][k][0]\n or res[2][k][0] == res[1][j][0]\n ):\n continue\n ans = min(res[0][i][1] + res[1][j][1] + res[2][k][1], ans)\nprint(ans)\n", "measured_fast_code_sha256": "2bf84a04b2c862b8fc6cada5361225248d707fa385c9679c1031ce69470c3f9c", "measured_slow_code": "from itertools import permutations\n\nn, c = list(map(int, input().split()))\nD = [list(map(int, input().split())) for _ in range(c)]\nC = [list(map(int, input().split())) for _ in range(n)]\ncolors = [[0] * c for _ in range(3)]\nfor i in range(n):\n for j in range(n):\n c_ij = C[i][j] - 1\n index = (i + j) % 3\n for col in range(c):\n colors[index][col] += D[c_ij][col]\nans = 1000 * 500**2\nfor c0, c1, c2 in permutations(list(range(c)), 3):\n diff = colors[0][c0] + colors[1][c1] + colors[2][c2]\n ans = min(ans, diff)\nprint(ans)\n", "measured_slow_code_sha256": "3bd4658cdee1a3e303306cb3c909ff4c2e9f6d0ee5a849d5106e04c5a82307d6", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 13.524811164759143, "pair_id": "python_v2_b34c6a0b3cd61191e4382121", "per_case_slow_code_faster_fraction": 0.09, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03330", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03330_2bf84a04b2c862b8fc6cada5361225248d707fa385c9679c1031ce69470c3f9c.jsonl.gz", "inputs": "reproduction/python/inputs/p03330.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03330_3bd4658cdee1a3e303306cb3c909ff4c2e9f6d0ee5a849d5106e04c5a82307d6.jsonl.gz"}, "slow_code": "from itertools import permutations\n\nn, c = list(map(int, input().split()))\nD = [list(map(int, input().split())) for _ in range(c)]\nC = [list(map(int, input().split())) for _ in range(n)]\ncolors = [[0] * c for _ in range(3)]\nfor i in range(n):\n for j in range(n):\n c_ij = C[i][j] - 1\n index = (i + j) % 3\n for col in range(c):\n colors[index][col] += D[c_ij][col]\nans = 1000 * 500**2\nfor c0, c1, c2 in permutations(list(range(c)), 3):\n diff = colors[0][c0] + colors[1][c1] + colors[2][c2]\n ans = min(ans, diff)\nprint(ans)\n", "slow_code_sha256": "3bd4658cdee1a3e303306cb3c909ff4c2e9f6d0ee5a849d5106e04c5a82307d6", "slow_id": "p03330_3bd4658cdee1a3e303306cb3c909ff4c2e9f6d0ee5a849d5106e04c5a82307d6", "speedup": 5.302675780107717, "stratum": "4-8", "within_pair_jaccard": 0.27848101265822783, "workload": {"case_count": 100, "description": "Repaint an N-by-N grid using C colors with cost D_X,Y for changing X to Y. All cells sharing (row+column) mod 3 must finish with one common color, and the three residue classes must use distinct colors. Minimize total cost. Observed inputs: N=1..500 (median 500); C=3..30 (median 30); grid_cells=1..250000; D_i_j=0..1000; color=1..30.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 753462, "median": 500951.5, "min": 24}, "input_format": ["N C\nD_1,1 ... D_1,C\n...\nD_C,1 ... D_C,C\nc_1,1 ... c_1,N\n...\nc_N,1 ... c_N,N"], "input_format_status": "source_input_section", "input_lines": {"max": 531, "median": 518.5, "min": 5}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 250902, "median": 250464.5, "min": 12}}} -{"case_ids": ["p03274_case_000", "p03274_case_001", "p03274_case_002", "p03274_case_003", "p03274_case_004", "p03274_case_005", "p03274_case_006", "p03274_case_007", "p03274_case_008", "p03274_case_009", "p03274_case_010", "p03274_case_011", "p03274_case_012", "p03274_case_013", "p03274_case_014", "p03274_case_015", "p03274_case_016", "p03274_case_017", "p03274_case_018", "p03274_case_019", "p03274_case_020", "p03274_case_021", "p03274_case_022", "p03274_case_023", "p03274_case_024", "p03274_case_025", "p03274_case_026", "p03274_case_027", "p03274_case_028", "p03274_case_029", "p03274_case_030", "p03274_case_031", "p03274_case_032", "p03274_case_033", "p03274_case_034", "p03274_case_035", "p03274_case_036", "p03274_case_037", "p03274_case_038", "p03274_case_039", "p03274_case_040", "p03274_case_041", "p03274_case_042", "p03274_case_043", "p03274_case_044", "p03274_case_045", "p03274_case_046", "p03274_case_047", "p03274_case_048", "p03274_case_049", "p03274_case_050", "p03274_case_051", "p03274_case_052", "p03274_case_053", "p03274_case_054", "p03274_case_055", "p03274_case_056", "p03274_case_057", "p03274_case_058", "p03274_case_059", "p03274_case_060", "p03274_case_061", "p03274_case_062", "p03274_case_063", "p03274_case_064", "p03274_case_065", "p03274_case_066", "p03274_case_067", "p03274_case_068", "p03274_case_069", "p03274_case_070", "p03274_case_071", "p03274_case_072", "p03274_case_073", "p03274_case_074", "p03274_case_075", "p03274_case_076", "p03274_case_077", "p03274_case_078", "p03274_case_079", "p03274_case_080", "p03274_case_081", "p03274_case_082", "p03274_case_083", "p03274_case_084", "p03274_case_085", "p03274_case_086", "p03274_case_087", "p03274_case_088", "p03274_case_089", "p03274_case_090", "p03274_case_091", "p03274_case_092", "p03274_case_093", "p03274_case_094", "p03274_case_095", "p03274_case_096", "p03274_case_097", "p03274_case_098", "p03274_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "iN, iK = [int(_) for _ in input().split()]\naX = [int(_) for _ in input().split()]\nans = 10**9\niDiff = iN - iK\nfor i in range(iDiff + 1):\n iL = aX[i]\n iR = aX[iN - iDiff + i - 1]\n ans = min(ans, abs(iL) + abs(iL - iR), abs(iR) + abs(iR - iL))\nprint(ans)\n", "fast_code_sha256": "d1345043c0ceb8a8df115e5d2e9ace088520cbcf79d0b09e7b3eae23e31aca45", "fast_id": "p03274_d1345043c0ceb8a8df115e5d2e9ace088520cbcf79d0b09e7b3eae23e31aca45", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "iN, iK = [int(_) for _ in input().split()]\naX = [int(_) for _ in input().split()]\nans = 10**9\niDiff = iN - iK\nfor i in range(iDiff + 1):\n iL = aX[i]\n iR = aX[iN - iDiff + i - 1]\n ans = min(ans, abs(iL) + abs(iL - iR), abs(iR) + abs(iR - iL))\nprint(ans)\n", "measured_fast_code_sha256": "d1345043c0ceb8a8df115e5d2e9ace088520cbcf79d0b09e7b3eae23e31aca45", "measured_slow_code": "import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time\n\nsys.setrecursionlimit(10**7)\ninf = 10**20\nmod = 10**9 + 7\n\n\ndef LI():\n return list(map(int, input().split()))\n\n\ndef I():\n return int(eval(input()))\n\n\ndef LS():\n return input().split()\n\n\ndef S():\n return eval(input())\n\n\ndef main():\n n, k = LI()\n l = LI()\n mn = inf\n for i in range(n - k + 1):\n a = l[i]\n b = l[i + k - 1]\n if a < 0 and b > 0:\n mn = min([mn, abs(a) + abs(b) * 2, abs(a) * 2 + abs(b)])\n else:\n mn = min(mn, max(abs(a), abs(b)))\n return mn\n\n\nprint((main()))\n", "measured_slow_code_sha256": "15cce6db7bc6d79dcd48950e05503001080b8e54791a05cbcc84aecc1f823153", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.5105348458255317, "pair_id": "python_v2_8c0af23e6830e096c1429dfa", "per_case_slow_code_faster_fraction": 0.41, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03274", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03274_d1345043c0ceb8a8df115e5d2e9ace088520cbcf79d0b09e7b3eae23e31aca45.jsonl.gz", "inputs": "reproduction/python/inputs/p03274.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03274_15cce6db7bc6d79dcd48950e05503001080b8e54791a05cbcc84aecc1f823153.jsonl.gz"}, "slow_code": "import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time\n\nsys.setrecursionlimit(10**7)\ninf = 10**20\nmod = 10**9 + 7\n\n\ndef LI():\n return list(map(int, input().split()))\n\n\ndef I():\n return int(eval(input()))\n\n\ndef LS():\n return input().split()\n\n\ndef S():\n return eval(input())\n\n\ndef main():\n n, k = LI()\n l = LI()\n mn = inf\n for i in range(n - k + 1):\n a = l[i]\n b = l[i + k - 1]\n if a < 0 and b > 0:\n mn = min([mn, abs(a) + abs(b) * 2, abs(a) * 2 + abs(b)])\n else:\n mn = min(mn, max(abs(a), abs(b)))\n return mn\n\n\nprint((main()))\n", "slow_code_sha256": "15cce6db7bc6d79dcd48950e05503001080b8e54791a05cbcc84aecc1f823153", "slow_id": "p03274_15cce6db7bc6d79dcd48950e05503001080b8e54791a05cbcc84aecc1f823153", "speedup": 3.337252098093104, "stratum": "2-4", "within_pair_jaccard": 0.21311475409836064, "workload": {"case_count": 100, "description": "Start at coordinate 0 and travel along a line at unit speed to light K of N candles at strictly increasing positions x_i. Lighting takes negligible time. Minimize elapsed time; return to 0 is not required. Observed inputs: N=1..100000 (median 10000); K=1..100000 (median 75); x_i=-100000000..100000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1000015, "median": 53814.0, "min": 14}, "input_format": ["N K\nx_1 ... x_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100002, "median": 10002.0, "min": 3}}} -{"case_ids": ["p03125_case_000", "p03125_case_001", "p03125_case_002", "p03125_case_003", "p03125_case_004", "p03125_case_005", "p03125_case_006", "p03125_case_007", "p03125_case_008", "p03125_case_009", "p03125_case_010", "p03125_case_011", "p03125_case_012", "p03125_case_013", "p03125_case_014", "p03125_case_015", "p03125_case_016", "p03125_case_017", "p03125_case_018", "p03125_case_019", "p03125_case_020", "p03125_case_021", "p03125_case_022", "p03125_case_023", "p03125_case_024", "p03125_case_025", "p03125_case_026", "p03125_case_027", "p03125_case_028", "p03125_case_029", "p03125_case_030", "p03125_case_031", "p03125_case_032", "p03125_case_033", "p03125_case_034", "p03125_case_035", "p03125_case_036", "p03125_case_037", "p03125_case_038", "p03125_case_039", "p03125_case_040", "p03125_case_041", "p03125_case_042", "p03125_case_043", "p03125_case_044", "p03125_case_045", "p03125_case_046", "p03125_case_047", "p03125_case_048", "p03125_case_049", "p03125_case_050", "p03125_case_051", "p03125_case_052", "p03125_case_053", "p03125_case_054", "p03125_case_055", "p03125_case_056", "p03125_case_057", "p03125_case_058", "p03125_case_059", "p03125_case_060", "p03125_case_061", "p03125_case_062", "p03125_case_063", "p03125_case_064", "p03125_case_065", "p03125_case_066", "p03125_case_067", "p03125_case_068", "p03125_case_069", "p03125_case_070", "p03125_case_071", "p03125_case_072", "p03125_case_073", "p03125_case_074", "p03125_case_075", "p03125_case_076", "p03125_case_077", "p03125_case_078", "p03125_case_079", "p03125_case_080", "p03125_case_081", "p03125_case_082", "p03125_case_083", "p03125_case_084", "p03125_case_085", "p03125_case_086", "p03125_case_087", "p03125_case_088", "p03125_case_089", "p03125_case_090", "p03125_case_091", "p03125_case_092", "p03125_case_093", "p03125_case_094", "p03125_case_095", "p03125_case_096", "p03125_case_097", "p03125_case_098", "p03125_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "a, b = list(map(int, input().split()))\nprint(([b + a, b - a][b % a > 0]))\n", "fast_code_sha256": "75c1e42c7e98436206dd42a5140a4f4a458a8534f36159d0be7f96ccc1882d13", "fast_id": "p03125_75c1e42c7e98436206dd42a5140a4f4a458a8534f36159d0be7f96ccc1882d13", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "a, b = list(map(int, input().split()))\nprint(([b + a, b - a][b % a > 0]))\n", "measured_fast_code_sha256": "75c1e42c7e98436206dd42a5140a4f4a458a8534f36159d0be7f96ccc1882d13", "measured_slow_code": "#!/usr/bin/env python3\nimport sys\nimport math\nfrom bisect import bisect_right as br\nfrom bisect import bisect_left as bl\n\nsys.setrecursionlimit(2147483647)\nfrom heapq import heappush, heappop, heappushpop\nfrom collections import defaultdict\nfrom itertools import accumulate\nfrom collections import Counter\nfrom collections import deque\nfrom operator import itemgetter\nfrom itertools import permutations\n\nmod = 10**9 + 7\ninf = float(\"inf\")\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\na, b = LI()\nif b % a == 0:\n print((a + b))\nelse:\n print((b - a))\n", "measured_slow_code_sha256": "4b613364292341c90cb223444cc17d712d2692c86eaf7401941c05ab19a835ea", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.566573302556262, "pair_id": "python_v2_4a45b9c4f7488bfebf29aeda", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03125", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03125_75c1e42c7e98436206dd42a5140a4f4a458a8534f36159d0be7f96ccc1882d13.jsonl.gz", "inputs": "reproduction/python/inputs/p03125.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03125_4b613364292341c90cb223444cc17d712d2692c86eaf7401941c05ab19a835ea.jsonl.gz"}, "slow_code": "import sys\nimport math\nfrom bisect import bisect_right as br\nfrom bisect import bisect_left as bl\n\nsys.setrecursionlimit(2147483647)\nfrom heapq import heappush, heappop, heappushpop\nfrom collections import defaultdict\nfrom itertools import accumulate\nfrom collections import Counter\nfrom collections import deque\nfrom operator import itemgetter\nfrom itertools import permutations\n\nmod = 10**9 + 7\ninf = float(\"inf\")\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\na, b = LI()\nif b % a == 0:\n print((a + b))\nelse:\n print((b - a))\n", "slow_code_sha256": "8b3f73d78db4b17be952c8e49db130961979c1aa4d15ae41972fb4783a0ae1cc", "slow_id": "p03125_4b613364292341c90cb223444cc17d712d2692c86eaf7401941c05ab19a835ea", "speedup": 3.564436364929375, "stratum": "2-4", "within_pair_jaccard": 0.16666666666666666, "workload": {"case_count": 100, "description": "Given positive integers A<=B, output A+B if A divides B, otherwise output B-A. Observed inputs: A=1..20 (median 5); B=1..20 (median 13).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 6, "median": 5.0, "min": 4}, "input_format": ["A B"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p03556_case_000", "p03556_case_001", "p03556_case_002", "p03556_case_003", "p03556_case_004", "p03556_case_005", "p03556_case_006", "p03556_case_007", "p03556_case_008", "p03556_case_009", "p03556_case_010", "p03556_case_011", "p03556_case_012", "p03556_case_013", "p03556_case_014", "p03556_case_015", "p03556_case_016", "p03556_case_017", "p03556_case_018", "p03556_case_019", "p03556_case_020", "p03556_case_021", "p03556_case_022", "p03556_case_023", "p03556_case_024", "p03556_case_025", "p03556_case_026", "p03556_case_027", "p03556_case_028", "p03556_case_029", "p03556_case_030", "p03556_case_031", "p03556_case_032", "p03556_case_033", "p03556_case_034", "p03556_case_035", "p03556_case_036", "p03556_case_037", "p03556_case_038", "p03556_case_039", "p03556_case_040", "p03556_case_041", "p03556_case_042", "p03556_case_043", "p03556_case_044", "p03556_case_045", "p03556_case_046", "p03556_case_047", "p03556_case_048", "p03556_case_049", "p03556_case_050", "p03556_case_051", "p03556_case_052", "p03556_case_053", "p03556_case_054", "p03556_case_055", "p03556_case_056", "p03556_case_057", "p03556_case_058", "p03556_case_059", "p03556_case_060", "p03556_case_061", "p03556_case_062", "p03556_case_063", "p03556_case_064", "p03556_case_065", "p03556_case_066", "p03556_case_067", "p03556_case_068", "p03556_case_069", "p03556_case_070", "p03556_case_071", "p03556_case_072", "p03556_case_073", "p03556_case_074", "p03556_case_075", "p03556_case_076", "p03556_case_077", "p03556_case_078", "p03556_case_079", "p03556_case_080", "p03556_case_081", "p03556_case_082", "p03556_case_083", "p03556_case_084", "p03556_case_085", "p03556_case_086", "p03556_case_087", "p03556_case_088", "p03556_case_089", "p03556_case_090", "p03556_case_091", "p03556_case_092", "p03556_case_093", "p03556_case_094", "p03556_case_095", "p03556_case_096", "p03556_case_097", "p03556_case_098", "p03556_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N = int(eval(input()))\nN = int(N**0.5)\nprint((N * N))\n", "fast_code_sha256": "9bd99fec9e6ec4fee9368ad961d397fb9380f635a86a7ba86920d6bcf2974eb8", "fast_id": "p03556_9bd99fec9e6ec4fee9368ad961d397fb9380f635a86a7ba86920d6bcf2974eb8", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N = int(eval(input()))\nN = int(N**0.5)\nprint((N * N))\n", "measured_fast_code_sha256": "9bd99fec9e6ec4fee9368ad961d397fb9380f635a86a7ba86920d6bcf2974eb8", "measured_slow_code": "import functools\nimport itertools\nimport numpy as np\nimport sys\n\nMAX_INT = int(10e10)\nMIN_INT = -MAX_INT\nmod = 1000000007\nsys.setrecursionlimit(1000000)\n\n\ndef IL():\n return list(map(int, input().split()))\n\n\ndef SL():\n return input().split()\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef S():\n return eval(input())\n\n\nN = I()\nans = [pow(i, 2) for i in range(100000) if pow(i, 2) <= N]\nprint((ans[-1]))\n", "measured_slow_code_sha256": "b08038f2cfa38828c3451135e0ae29ee0ad4cf29b9ef9a8abfaa3be486afcc2d", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3772.8315287220594, "pair_id": "python_v2_20f3f00c8f4f7436a8298aab", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03556", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03556_9bd99fec9e6ec4fee9368ad961d397fb9380f635a86a7ba86920d6bcf2974eb8.jsonl.gz", "inputs": "reproduction/python/inputs/p03556.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03556_b08038f2cfa38828c3451135e0ae29ee0ad4cf29b9ef9a8abfaa3be486afcc2d.jsonl.gz"}, "slow_code": "import functools\nimport itertools\nimport numpy as np\nimport sys\n\nMAX_INT = int(10e10)\nMIN_INT = -MAX_INT\nmod = 1000000007\nsys.setrecursionlimit(1000000)\n\n\ndef IL():\n return list(map(int, input().split()))\n\n\ndef SL():\n return input().split()\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef S():\n return eval(input())\n\n\nN = I()\nans = [pow(i, 2) for i in range(100000) if pow(i, 2) <= N]\nprint((ans[-1]))\n", "slow_code_sha256": "b08038f2cfa38828c3451135e0ae29ee0ad4cf29b9ef9a8abfaa3be486afcc2d", "slow_id": "p03556_b08038f2cfa38828c3451135e0ae29ee0ad4cf29b9ef9a8abfaa3be486afcc2d", "speedup": 3771.2280540829843, "stratum": "8+", "within_pair_jaccard": 0.11904761904761904, "workload": {"case_count": 100, "description": "Find the largest integer square not exceeding positive input N. Observed inputs: N=1..1000000000 (median 266490422).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 11, "median": 10.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p03558_case_000", "p03558_case_001", "p03558_case_002", "p03558_case_003", "p03558_case_004", "p03558_case_005", "p03558_case_006", "p03558_case_007", "p03558_case_008", "p03558_case_009", "p03558_case_010", "p03558_case_011", "p03558_case_012", "p03558_case_013", "p03558_case_014", "p03558_case_015", "p03558_case_016", "p03558_case_017", "p03558_case_018", "p03558_case_019", "p03558_case_020", "p03558_case_021", "p03558_case_022", "p03558_case_023", "p03558_case_024", "p03558_case_025", "p03558_case_026", "p03558_case_027", "p03558_case_028", "p03558_case_029", "p03558_case_030", "p03558_case_031", "p03558_case_032", "p03558_case_033", "p03558_case_034", "p03558_case_035", "p03558_case_036", "p03558_case_037", "p03558_case_038", "p03558_case_039", "p03558_case_040", "p03558_case_041", "p03558_case_042", "p03558_case_043", "p03558_case_044", "p03558_case_045", "p03558_case_046", "p03558_case_047", "p03558_case_048", "p03558_case_049", "p03558_case_050", "p03558_case_051", "p03558_case_052", "p03558_case_053", "p03558_case_054", "p03558_case_055", "p03558_case_056", "p03558_case_057", "p03558_case_058", "p03558_case_059", "p03558_case_060", "p03558_case_061", "p03558_case_062", "p03558_case_063", "p03558_case_064", "p03558_case_065", "p03558_case_066", "p03558_case_067", "p03558_case_068", "p03558_case_069", "p03558_case_070", "p03558_case_071", "p03558_case_072", "p03558_case_073", "p03558_case_074", "p03558_case_075", "p03558_case_076", "p03558_case_077", "p03558_case_078", "p03558_case_079", "p03558_case_080", "p03558_case_081", "p03558_case_082", "p03558_case_083", "p03558_case_084", "p03558_case_085", "p03558_case_086", "p03558_case_087", "p03558_case_088", "p03558_case_089", "p03558_case_090", "p03558_case_091", "p03558_case_092", "p03558_case_093", "p03558_case_094", "p03558_case_095", "p03558_case_096", "p03558_case_097", "p03558_case_098", "p03558_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "executable_AST_equal_except_explicit_explanatory_string_removal_and_all_frozen_inputs_checker_pass", "fast_code": "from collections import deque\n\n\ndef solve(K):\n checked = [99999999999] * (K + 1)\n queue = deque()\n queue.append((1, 1))\n checked[1] = 1\n while queue:\n x, n = queue.popleft()\n if x == 0:\n return n\n _ = (x * 10) % K\n if n < checked[_]:\n queue.appendleft((_, n))\n checked[_] = n\n _ = (x + 1) % K\n if n + 1 < checked[_]:\n queue.append((_, n + 1))\n checked[_] = n + 1\n return None\n\n\nK = int(eval(input()))\nprint((solve(K)))\n", "fast_code_sha256": "bade334d850baa79c30c63b127211354a56f0a74387511e74bb04b26a2ac47b2", "fast_id": "p03558_bade334d850baa79c30c63b127211354a56f0a74387511e74bb04b26a2ac47b2", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from collections import deque\n\n\ndef solve(K):\n checked = [99999999999] * (K + 1)\n queue = deque()\n queue.append((1, 1))\n checked[1] = 1\n while queue:\n x, n = queue.popleft()\n if x == 0:\n return n\n _ = (x * 10) % K\n if n < checked[_]:\n queue.appendleft((_, n))\n checked[_] = n\n _ = (x + 1) % K\n if n + 1 < checked[_]:\n queue.append((_, n + 1))\n checked[_] = n + 1\n return None\n\n\nK = int(eval(input()))\nprint((solve(K)))\n", "measured_fast_code_sha256": "bade334d850baa79c30c63b127211354a56f0a74387511e74bb04b26a2ac47b2", "measured_slow_code": "# coding: utf-8\n# Your code here!\n\"\"\"\n01-BFS\n辺の重みが0 or 1 のとき、dequeを使ってdijkstraを高速化できる\n\"\"\"\nfrom collections import deque\n\n\ndef bfs01(g, start):\n n = len(g)\n res = [float(\"inf\")] * n # startからの最短距離\n res[start] = 0\n pending = n - 1 # 未確定の点の個数\n q = deque([(0, start)]) # (そこまでの距離、点)\n while q and pending:\n dv, v = q.popleft()\n if res[v] < dv:\n continue\n pending -= 1\n # if v==goal: break\n for to, cost in g[v]:\n if dv + cost < res[to]:\n res[to] = dv + cost\n if cost:\n q.append((res[to], to))\n else:\n q.appendleft((res[to], to))\n return res\n\n\n######################################################################\n# ARC084 small multiple\n#\n######################################################################\nimport sys\n\nsys.setrecursionlimit(10**6)\nreadline = sys.stdin.readline # 文字列入力のときは注意\nk = int(eval(input()))\ng = [[] for _ in range(k)]\nfor i in range(k):\n g[i].append(((i + 1) % k, 1))\n g[i].append((10 * i % k, 0))\nres = bfs01(g, 1)\nprint((res[0] + 1))\n", "measured_slow_code_sha256": "5f35f96f280f319d024f2d3d07196cab1ceb7da585338fc01299f2b757443aa2", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.8663083037168917, "pair_id": "python_v2_11197cdfa1372fe80205c405", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03558", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03558_bade334d850baa79c30c63b127211354a56f0a74387511e74bb04b26a2ac47b2.jsonl.gz", "inputs": "reproduction/python/inputs/p03558.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03558_5f35f96f280f319d024f2d3d07196cab1ceb7da585338fc01299f2b757443aa2.jsonl.gz"}, "slow_code": "from collections import deque\n\n\ndef bfs01(g, start):\n n = len(g)\n res = [float(\"inf\")] * n\n res[start] = 0\n pending = n - 1\n q = deque([(0, start)])\n while q and pending:\n dv, v = q.popleft()\n if res[v] < dv:\n continue\n pending -= 1\n\n for to, cost in g[v]:\n if dv + cost < res[to]:\n res[to] = dv + cost\n if cost:\n q.append((res[to], to))\n else:\n q.appendleft((res[to], to))\n return res\n\n\nimport sys\n\nsys.setrecursionlimit(10**6)\nreadline = sys.stdin.readline\nk = int(eval(input()))\ng = [[] for _ in range(k)]\nfor i in range(k):\n g[i].append(((i + 1) % k, 1))\n g[i].append((10 * i % k, 0))\nres = bfs01(g, 1)\nprint((res[0] + 1))\n", "slow_code_sha256": "f35f1eea5cd14a6f077768d39acd6576a774f6899093cc32001834bcc2a00d21", "slow_id": "p03558_5f35f96f280f319d024f2d3d07196cab1ceb7da585338fc01299f2b757443aa2", "speedup": 4.146985602465169, "stratum": "4-8", "within_pair_jaccard": 0.3389830508474576, "workload": {"case_count": 100, "description": "Find the smallest decimal digit sum among all positive integer multiples of K. Observed inputs: K=2..100000 (median 10205.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 7, "median": 5.5, "min": 2}, "input_format": ["K"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p02619_case_012", "p02619_case_013", "p02619_case_025", "p02619_case_026", "p02619_case_043", "p02619_case_044", "p02619_case_052", "p02619_case_053", "p02619_case_054", "p02619_case_073", "p02619_case_082", "p02619_case_083", "p02619_case_084", "p02619_case_092", "p02619_case_093", "p02619_v2_a2beef34f549391bcfab", "p02619_v2_d53b9ea5c5792673310a", "p02619_v2_75570918b98373695774", "p02619_v2_381934e3c9fc81ea5d4c", "p02619_v2_3225c49e05d4c20437e8", "p02619_v2_9f23fee4b2e5100bc2a2", "p02619_v2_3800a1516910270b469a", "p02619_v2_d9fa0876b5c6fdeae69e", "p02619_v2_b68f2c1e092b62c538a2", "p02619_v2_73760848946232a8e083", "p02619_v2_d3e4441b330d8b6e7455", "p02619_v2_76ead5910dcc4e2ba1f8", "p02619_v2_2029613353251ee9b7b2", "p02619_v2_2cb134243aa86388d6ba", "p02619_v2_30836e495158435b7b7c", "p02619_v2_339d84622dee7fdc1293", "p02619_v2_d3d5077e7c93e478e065", "p02619_v2_8253b2db731014b88083", "p02619_v2_2177c78f8621448ff155", "p02619_v2_d013df1aba56dc1d54ec", "p02619_v2_64826e27e1f5562b535a", "p02619_v2_9a891e42e9c46b5f3297", "p02619_v2_f1c00f7e95d622403758", "p02619_v2_710d4c5a4c95dcb68dec", "p02619_v2_439934a48b010195dbcd", "p02619_v2_4c37cf7a7dffe9b33f12", "p02619_v2_c8fad05224bc16a1b361", "p02619_v2_94bb7ae7786707cb4819", "p02619_v2_b3aaed51d4273a3ddba7", "p02619_v2_923e8744ad333f07cb64", "p02619_v2_3366f1adb54ecf21860c", "p02619_v2_0b51cc642981f62d0357", "p02619_v2_8e243df56a059b7ad743", "p02619_v2_0a8cb716b509085fe4b0", "p02619_v2_3b76655f387f7cb6d2ab", "p02619_v2_20299f78a75b5a756735", "p02619_v2_35258a2e89d62fc747b7", "p02619_v2_c94c4b9b4349ad6555bc", "p02619_v2_82d82c4a4a2d2183a610", "p02619_v2_d65957a2498629e788ad", "p02619_v2_cd61595422151a528aa5", "p02619_v2_d520c6f8f3f4d009c27c", "p02619_v2_4942ad457c0812fc3998", "p02619_v2_592ad6d8afe1f286b012", "p02619_v2_88f615fd6f0c7cd063e8", "p02619_v2_6679f24e3b7857ca6d32", "p02619_v2_11435a6bd84618d89bc3", "p02619_v2_857222b39e874dca5a4b", "p02619_v2_82dfd729740a78ac73c6", "p02619_v2_d87a4f20bb0c6931f905", "p02619_v2_6a64dbf42d62a65fcc1d", "p02619_v2_babacbd289499ec0ef4d", "p02619_v2_9c068c7f4ca10041380f", "p02619_v2_5532e28a006d07cf62cf", "p02619_v2_e76e422d063bddc50a1f", "p02619_v2_28584da94df0912874ff", "p02619_v2_6ebe44795b5ec9b8e21d", "p02619_v2_c14cae75992aa93e75b8", "p02619_v2_bdce12ee0a07d9d30b58", "p02619_v2_9d1eceea3701f7462f2b", "p02619_v2_97eb955edc648882b88c", "p02619_v2_d105efd93f9223472ed6", "p02619_v2_4348b0c773fc04fab240", "p02619_v2_3a716d97d5adc38425d1", "p02619_v2_ce64eae3a4c1a2d7cc27", "p02619_v2_f9e870aa23e988febc60", "p02619_v2_94937661fb4430a22568", "p02619_v2_557ae170292f4ec040cc", "p02619_v2_8814fdf99bc803fc8e0c", "p02619_v2_9188b3f61f9e38da6bb2", "p02619_v2_746658d85cc29634ceaa", "p02619_v2_f4db407594deac9161c4", "p02619_v2_7202c8c24a6735e3305a", "p02619_v2_87e6dc866c355591194f", "p02619_v2_90793b392e65559b556d", "p02619_v2_8c53e7c0e7cd81f14876", "p02619_v2_ce531317332dfe8af29d", "p02619_v2_54d30225714f808b8394", "p02619_v2_d7591d957a11b4b18a7f", "p02619_v2_753bfc942a0618ae1f4e", "p02619_v2_7da054c5c0df8db3a7fa", "p02619_v2_a96f964491ca5e8c9c0c", "p02619_v2_e5201f8fcebe77f9e4d2", "p02619_v2_ca2955dbd7b011893c5e", "p02619_v2_b271f7c12ae1b71c0287"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "D = int(eval(input()))\nc = list(map(int, input().split()))\ns = [list(map(int, input().split())) for _ in range(D)]\nt = [int(eval(input())) for _ in range(D)]\nlasts = [[-1] * 26 for _ in range(D + 1)]\nS = 0\nfor d in range(D):\n S += s[d][t[d] - 1]\n for i in range(26):\n if i == t[d] - 1:\n lasts[d + 1][i] = d\n else:\n lasts[d + 1][i] = lasts[d][i]\n for i in range(26):\n S -= c[i] * (d - lasts[d + 1][i])\n print(S)\n", "fast_code_sha256": "3fbec6b8d07f8c068b406adf35bf0ba34b1cccb6198d217333c5ea91e98fc016", "fast_id": "p02619_3fbec6b8d07f8c068b406adf35bf0ba34b1cccb6198d217333c5ea91e98fc016", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "D = int(eval(input()))\nc = list(map(int, input().split()))\ns = [list(map(int, input().split())) for _ in range(D)]\nt = [int(eval(input())) for _ in range(D)]\nlasts = [[-1] * 26 for _ in range(D + 1)]\nS = 0\nfor d in range(D):\n S += s[d][t[d] - 1]\n for i in range(26):\n if i == t[d] - 1:\n lasts[d + 1][i] = d\n else:\n lasts[d + 1][i] = lasts[d][i]\n for i in range(26):\n S -= c[i] * (d - lasts[d + 1][i])\n print(S)\n", "measured_fast_code_sha256": "3fbec6b8d07f8c068b406adf35bf0ba34b1cccb6198d217333c5ea91e98fc016", "measured_slow_code": "import numpy as np\n\nD = int(eval(input()))\nc = [int(i) for i in input().split()]\ns = []\nfor d in range(D):\n s.append([int(i) for i in input().split()])\nt = []\nfor d in range(D):\n t.append(int(eval(input())) - 1)\nv = [0] * D\nlast = [[0 for i in range(26)] for d in range(D)]\nfor d in range(D):\n if d >= 1:\n last[d] = last[d - 1][:]\n last[d][t[d]] = d + 1\nfor d in range(D):\n v[d] = s[d][t[d]] - sum([c[i] * (d + 1 - last[d][i]) for i in range(26)])\nv_sum = 0\nfor d in range(D):\n v_sum += v[d]\n print(v_sum)\n", "measured_slow_code_sha256": "e06ba4d62ffe23f292e9554193c989e47766a38ef3e00279117101508edbb374", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 6.519899856733585, "pair_id": "python_v2_670730d341e0e0c9ca56a3b5", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02619", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02619_3fbec6b8d07f8c068b406adf35bf0ba34b1cccb6198d217333c5ea91e98fc016.jsonl.gz", "inputs": "reproduction/python/inputs/p02619.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02619_e06ba4d62ffe23f292e9554193c989e47766a38ef3e00279117101508edbb374.jsonl.gz"}, "slow_code": "import numpy as np\n\nD = int(eval(input()))\nc = [int(i) for i in input().split()]\ns = []\nfor d in range(D):\n s.append([int(i) for i in input().split()])\nt = []\nfor d in range(D):\n t.append(int(eval(input())) - 1)\nv = [0] * D\nlast = [[0 for i in range(26)] for d in range(D)]\nfor d in range(D):\n if d >= 1:\n last[d] = last[d - 1][:]\n last[d][t[d]] = d + 1\nfor d in range(D):\n v[d] = s[d][t[d]] - sum([c[i] * (d + 1 - last[d][i]) for i in range(26)])\nv_sum = 0\nfor d in range(D):\n v_sum += v[d]\n print(v_sum)\n", "slow_code_sha256": "e06ba4d62ffe23f292e9554193c989e47766a38ef3e00279117101508edbb374", "slow_id": "p02619_e06ba4d62ffe23f292e9554193c989e47766a38ef3e00279117101508edbb374", "speedup": 6.492803797844002, "stratum": "4-8", "within_pair_jaccard": 0.5454545454545454, "workload": {"case_count": 100, "description": "For a fixed schedule t_d of 26 contest types, output daily cumulative satisfaction, initially zero. On day d add s_d,t_d, then subtract sum_i c_i*(d-last_i), where last_i is the latest day of type i, or 0 if never held. Observed inputs: D=365; c_i=0..100; s_d_i=0..20000; t_d=1..26.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 57778, "median": 20062.0, "min": 19985}, "input_format": ["D\nc_1 ... c_26\ns_1,1 ... s_1,26\n...\ns_D,1 ... s_D,26\nt_1\n...\nt_D"], "input_format_status": "source_input_section", "input_lines": {"max": 732, "median": 732.0, "min": 732}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 9882, "median": 9882.0, "min": 9882}}} -{"case_ids": ["p03775_case_000", "p03775_case_001", "p03775_case_002", "p03775_case_003", "p03775_case_004", "p03775_case_005", "p03775_case_006", "p03775_case_007", "p03775_case_008", "p03775_case_009", "p03775_case_010", "p03775_case_011", "p03775_case_012", "p03775_case_013", "p03775_case_014", "p03775_case_015", "p03775_case_016", "p03775_case_017", "p03775_case_018", "p03775_case_019", "p03775_case_020", "p03775_case_021", "p03775_case_022", "p03775_case_023", "p03775_case_024", "p03775_case_025", "p03775_case_026", "p03775_case_027", "p03775_case_028", "p03775_case_029", "p03775_case_030", "p03775_case_031", "p03775_case_032", "p03775_case_033", "p03775_case_034", "p03775_case_035", "p03775_case_036", "p03775_case_037", "p03775_case_038", "p03775_case_039", "p03775_case_040", "p03775_case_041", "p03775_case_042", "p03775_case_043", "p03775_case_044", "p03775_case_045", "p03775_case_046", "p03775_case_047", "p03775_case_048", "p03775_case_049", "p03775_case_050", "p03775_case_051", "p03775_case_052", "p03775_case_053", "p03775_case_054", "p03775_case_055", "p03775_case_056", "p03775_case_057", "p03775_case_058", "p03775_case_059", "p03775_case_060", "p03775_case_061", "p03775_case_062", "p03775_case_063", "p03775_case_064", "p03775_case_065", "p03775_case_066", "p03775_case_067", "p03775_case_068", "p03775_case_069", "p03775_case_070", "p03775_case_071", "p03775_case_072", "p03775_case_073", "p03775_case_074", "p03775_case_075", "p03775_case_076", "p03775_case_077", "p03775_case_078", "p03775_case_079", "p03775_case_080", "p03775_case_081", "p03775_case_082", "p03775_case_083", "p03775_case_084", "p03775_case_085", "p03775_case_086", "p03775_case_087", "p03775_case_088", "p03775_case_089", "p03775_case_090", "p03775_case_091", "p03775_case_092", "p03775_case_093", "p03775_case_094", "p03775_case_095", "p03775_case_096", "p03775_case_097", "p03775_case_098", "p03775_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\nif n == 6983776800:\n print((5))\n exit()\n\n\ndef prime_factorize(n):\n a = []\n while n % 2 == 0:\n a.append(2)\n n //= 2\n f = 3\n while f**2 <= n:\n if n % f == 0:\n a.append(f)\n n //= f\n else:\n f += 2\n if n != 1:\n a.append(n)\n return a\n\n\nF = prime_factorize(n)\nA, B = 1, 1\nfor i in F[::-1]:\n if A <= B:\n A *= i\n else:\n B *= i\nprint((max(len(str(A)), len(str(B)))))\n", "fast_code_sha256": "16771a04e6276b491192dc984b7d0363d20dc7ef3d6fad47bf439b11ebe5f507", "fast_id": "p03775_16771a04e6276b491192dc984b7d0363d20dc7ef3d6fad47bf439b11ebe5f507", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\nif n == 6983776800:\n print((5))\n exit()\n\n\ndef prime_factorize(n):\n a = []\n while n % 2 == 0:\n a.append(2)\n n //= 2\n f = 3\n while f**2 <= n:\n if n % f == 0:\n a.append(f)\n n //= f\n else:\n f += 2\n if n != 1:\n a.append(n)\n return a\n\n\nF = prime_factorize(n)\nA, B = 1, 1\nfor i in F[::-1]:\n if A <= B:\n A *= i\n else:\n B *= i\nprint((max(len(str(A)), len(str(B)))))\n", "measured_fast_code_sha256": "16771a04e6276b491192dc984b7d0363d20dc7ef3d6fad47bf439b11ebe5f507", "measured_slow_code": "n = int(eval(input()))\n\n\ndef cal(a):\n return len(str(a))\n\n\nm = 11\nfor j in range(1, 10**6 + 1):\n if n % j == 0:\n m = min(m, max(cal(j), cal(n // j)))\n # print(m)\nprint(m)\n", "measured_slow_code_sha256": "7ab001f5efb675596da434bf3ef9e7fa9f9ec3b0d345cb8726f7720241f1422c", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1018.5348768188148, "pair_id": "python_v2_fd5f1714abbe60b8859e6ea7", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03775", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03775_16771a04e6276b491192dc984b7d0363d20dc7ef3d6fad47bf439b11ebe5f507.jsonl.gz", "inputs": "reproduction/python/inputs/p03775.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03775_7ab001f5efb675596da434bf3ef9e7fa9f9ec3b0d345cb8726f7720241f1422c.jsonl.gz"}, "slow_code": "n = int(eval(input()))\n\n\ndef cal(a):\n return len(str(a))\n\n\nm = 11\nfor j in range(1, 10**6 + 1):\n if n % j == 0:\n m = min(m, max(cal(j), cal(n // j)))\n\nprint(m)\n", "slow_code_sha256": "0bd50a29ee4b8ed24f88df4bdfcabb76a7a6778570de4e74b5c8ddab42febd8f", "slow_id": "p03775_7ab001f5efb675596da434bf3ef9e7fa9f9ec3b0d345cb8726f7720241f1422c", "speedup": 485.3782684790623, "stratum": "8+", "within_pair_jaccard": 0.42105263157894735, "workload": {"case_count": 100, "description": "Among positive integer factorizations A*B=N, minimize the larger decimal digit count of A and B. Observed inputs: N=1..10000000000 (median 15771778).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 12, "median": 9.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p03719_case_000", "p03719_case_001", "p03719_case_002", "p03719_case_003", "p03719_case_004", "p03719_case_005", "p03719_case_006", "p03719_case_007", "p03719_case_008", "p03719_case_009", "p03719_case_010", "p03719_case_011", "p03719_case_012", "p03719_case_013", "p03719_case_014", "p03719_case_015", "p03719_case_016", "p03719_case_017", "p03719_case_018", "p03719_case_019", "p03719_case_020", "p03719_case_021", "p03719_case_022", "p03719_case_023", "p03719_case_024", "p03719_case_025", "p03719_case_026", "p03719_case_027", "p03719_case_028", "p03719_case_029", "p03719_case_030", "p03719_case_031", "p03719_case_032", "p03719_case_033", "p03719_case_034", "p03719_case_035", "p03719_case_036", "p03719_case_037", "p03719_case_038", "p03719_case_039", "p03719_case_040", "p03719_case_041", "p03719_case_042", "p03719_case_043", "p03719_case_044", "p03719_case_045", "p03719_case_046", "p03719_case_047", "p03719_case_048", "p03719_case_049", "p03719_case_050", "p03719_case_051", "p03719_case_052", "p03719_case_053", "p03719_case_054", "p03719_case_055", "p03719_case_056", "p03719_case_057", "p03719_case_058", "p03719_case_059", "p03719_case_060", "p03719_case_061", "p03719_case_062", "p03719_case_063", "p03719_case_064", "p03719_case_065", "p03719_case_066", "p03719_case_067", "p03719_case_068", "p03719_case_069", "p03719_case_070", "p03719_case_071", "p03719_case_072", "p03719_case_073", "p03719_case_074", "p03719_case_075", "p03719_case_076", "p03719_case_077", "p03719_case_078", "p03719_case_079", "p03719_case_080", "p03719_case_081", "p03719_case_082", "p03719_case_083", "p03719_case_084", "p03719_case_085", "p03719_case_086", "p03719_case_087", "p03719_case_088", "p03719_case_089", "p03719_case_090", "p03719_case_091", "p03719_case_092", "p03719_case_093", "p03719_case_094", "p03719_case_095", "p03719_case_096", "p03719_case_097", "p03719_case_098", "p03719_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\n\ndef solve():\n a, b, c = list(map(int, input().split()))\n print((\"Yes\" if a <= c <= b else \"No\"))\n\n\nif __name__ == \"__main__\":\n solve()\n", "fast_code_sha256": "03a82928a4f5d348f6e9b606de233c7c97e0e7a762710bd793e06c6ea800673b", "fast_id": "p03719_03a82928a4f5d348f6e9b606de233c7c97e0e7a762710bd793e06c6ea800673b", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\n\ndef solve():\n a, b, c = list(map(int, input().split()))\n print((\"Yes\" if a <= c <= b else \"No\"))\n\n\nif __name__ == \"__main__\":\n solve()\n", "measured_fast_code_sha256": "03a82928a4f5d348f6e9b606de233c7c97e0e7a762710bd793e06c6ea800673b", "measured_slow_code": "import functools\nimport os\nimport sys\n\nsys.setrecursionlimit(10000)\nINF = float(\"inf\")\n\n\ndef inp():\n return int(input())\n\n\ndef inpf():\n return float(input())\n\n\ndef inps():\n return input()\n\n\ndef inl():\n return list(map(int, input().split()))\n\n\ndef inlf():\n return list(map(float, input().split()))\n\n\ndef inls():\n return input().split()\n\n\ndef inpm(line):\n return [inp() for _ in range(line)]\n\n\ndef inpfm(line):\n return [inpf() for _ in range(line)]\n\n\ndef inpsm(line):\n return [inps() for _ in range(line)]\n\n\ndef inlm(line):\n return [inl() for _ in range(line)]\n\n\ndef inlfm(line):\n return [inlf() for _ in range(line)]\n\n\ndef inlsm(line):\n return [inls() for _ in range(line)]\n\n\ndef debug(fn):\n if not os.getenv(\"LOCAL\"):\n return fn\n\n @functools.wraps(fn)\n def wrapper(*args, **kwargs):\n ret = fn(*args, **kwargs)\n print(\n \"DEBUG: {}({}) -> \".format(\n fn.__name__,\n \", \".join(\n list(map(str, args))\n + [\"{}={}\".format(k, str(v)) for k, v in kwargs.items()]\n ),\n ),\n end=\"\",\n )\n print(ret)\n return ret\n\n return wrapper\n\n\na, b, c = inl()\nprint(\"Yes\" if a <= c <= b else \"No\")\n", "measured_slow_code_sha256": "e07af57e860ffe85b1dd4d3f584cfb93b6bc335ebd7477239056a77e404a4988", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 6.701567484109109, "pair_id": "python_v2_df004450871ff44db2b91ab1", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03719", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03719_03a82928a4f5d348f6e9b606de233c7c97e0e7a762710bd793e06c6ea800673b.jsonl.gz", "inputs": "reproduction/python/inputs/p03719.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03719_e07af57e860ffe85b1dd4d3f584cfb93b6bc335ebd7477239056a77e404a4988.jsonl.gz"}, "slow_code": "import functools\nimport os\nimport sys\n\nsys.setrecursionlimit(10000)\nINF = float(\"inf\")\n\n\ndef inp():\n return int(input())\n\n\ndef inpf():\n return float(input())\n\n\ndef inps():\n return input()\n\n\ndef inl():\n return list(map(int, input().split()))\n\n\ndef inlf():\n return list(map(float, input().split()))\n\n\ndef inls():\n return input().split()\n\n\ndef inpm(line):\n return [inp() for _ in range(line)]\n\n\ndef inpfm(line):\n return [inpf() for _ in range(line)]\n\n\ndef inpsm(line):\n return [inps() for _ in range(line)]\n\n\ndef inlm(line):\n return [inl() for _ in range(line)]\n\n\ndef inlfm(line):\n return [inlf() for _ in range(line)]\n\n\ndef inlsm(line):\n return [inls() for _ in range(line)]\n\n\ndef debug(fn):\n if not os.getenv(\"LOCAL\"):\n return fn\n\n @functools.wraps(fn)\n def wrapper(*args, **kwargs):\n ret = fn(*args, **kwargs)\n print(\n \"DEBUG: {}({}) -> \".format(\n fn.__name__,\n \", \".join(\n list(map(str, args))\n + [\"{}={}\".format(k, str(v)) for k, v in kwargs.items()]\n ),\n ),\n end=\"\",\n )\n print(ret)\n return ret\n\n return wrapper\n\n\na, b, c = inl()\nprint(\"Yes\" if a <= c <= b else \"No\")\n", "slow_code_sha256": "e07af57e860ffe85b1dd4d3f584cfb93b6bc335ebd7477239056a77e404a4988", "slow_id": "p03719_e07af57e860ffe85b1dd4d3f584cfb93b6bc335ebd7477239056a77e404a4988", "speedup": 6.700567773510979, "stratum": "4-8", "within_pair_jaccard": 0.27419354838709675, "workload": {"case_count": 100, "description": "Determine whether C is at least A and at most B. The supplied bounds A and B need not be ordered. Observed inputs: A=-100..100 (median -2.5); B=-100..100 (median -17); C=-100..100 (median -9).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 14, "median": 10.0, "min": 7}, "input_format": ["A B C"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3, "median": 3.0, "min": 3}}} -{"case_ids": ["p02817_case_000", "p02817_case_001", "p02817_case_002", "p02817_case_003", "p02817_case_004", "p02817_case_005", "p02817_case_006", "p02817_case_007", "p02817_case_008", "p02817_case_009", "p02817_case_010", "p02817_case_011", "p02817_case_012", "p02817_case_013", "p02817_case_014", "p02817_case_015", "p02817_case_016", "p02817_case_017", "p02817_case_018", "p02817_case_019", "p02817_case_020", "p02817_case_021", "p02817_case_022", "p02817_case_023", "p02817_case_024", "p02817_case_025", "p02817_case_026", "p02817_case_027", "p02817_case_028", "p02817_case_029", "p02817_case_030", "p02817_case_031", "p02817_case_032", "p02817_case_033", "p02817_case_034", "p02817_case_035", "p02817_case_036", "p02817_case_037", "p02817_case_038", "p02817_case_039", "p02817_case_040", "p02817_case_041", "p02817_case_042", "p02817_case_043", "p02817_case_044", "p02817_case_045", "p02817_case_046", "p02817_case_047", "p02817_case_048", "p02817_case_049", "p02817_case_050", "p02817_case_051", "p02817_case_052", "p02817_case_053", "p02817_case_054", "p02817_case_055", "p02817_case_056", "p02817_case_057", "p02817_case_058", "p02817_case_059", "p02817_case_060", "p02817_case_061", "p02817_case_062", "p02817_case_063", "p02817_case_064", "p02817_case_065", "p02817_case_066", "p02817_case_067", "p02817_case_068", "p02817_case_069", "p02817_case_070", "p02817_case_071", "p02817_case_072", "p02817_case_073", "p02817_case_074", "p02817_case_075", "p02817_case_076", "p02817_case_077", "p02817_case_078", "p02817_case_079", "p02817_case_080", "p02817_case_081", "p02817_case_082", "p02817_case_083", "p02817_case_084", "p02817_case_085", "p02817_case_086", "p02817_case_087", "p02817_case_088", "p02817_case_089", "p02817_case_090", "p02817_case_091", "p02817_case_092", "p02817_case_093", "p02817_case_094", "p02817_case_095", "p02817_case_096", "p02817_case_097", "p02817_case_098", "p02817_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "s, t = input().split()\nprint((t + s))\n", "fast_code_sha256": "33dcebe1a6bd6b2029351d524f7527f05a8365e65ae141221b45237fbfb1783d", "fast_id": "p02817_33dcebe1a6bd6b2029351d524f7527f05a8365e65ae141221b45237fbfb1783d", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "s, t = input().split()\nprint((t + s))\n", "measured_fast_code_sha256": "33dcebe1a6bd6b2029351d524f7527f05a8365e65ae141221b45237fbfb1783d", "measured_slow_code": "import sys\n\nS, T = input().split()\nif not (S.islower() and T.islower()):\n sys.exit()\nif not (1 <= len(S) <= 100 and 1 <= len(S) <= 100):\n sys.exit()\nprint(T, S, sep=\"\")\n", "measured_slow_code_sha256": "9f4657cb00c8c33f0584f0326d64e41b8f42d7a77cc35ee9515364c99ba0c794", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.6966274573451656, "pair_id": "python_v2_9d17f0c10de0556c48920680", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02817", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02817_33dcebe1a6bd6b2029351d524f7527f05a8365e65ae141221b45237fbfb1783d.jsonl.gz", "inputs": "reproduction/python/inputs/p02817.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02817_9f4657cb00c8c33f0584f0326d64e41b8f42d7a77cc35ee9515364c99ba0c794.jsonl.gz"}, "slow_code": "import sys\n\nS, T = input().split()\nif not (S.islower() and T.islower()):\n sys.exit()\nif not (1 <= len(S) <= 100 and 1 <= len(S) <= 100):\n sys.exit()\nprint(T, S, sep=\"\")\n", "slow_code_sha256": "9f4657cb00c8c33f0584f0326d64e41b8f42d7a77cc35ee9515364c99ba0c794", "slow_id": "p02817_9f4657cb00c8c33f0584f0326d64e41b8f42d7a77cc35ee9515364c99ba0c794", "speedup": 2.694928867426236, "stratum": "2-4", "within_pair_jaccard": 0.16666666666666666, "workload": {"case_count": 100, "description": "Given lowercase strings S and T, output their concatenation in the order T then S, with no separating space. Observed inputs: S_length=1..100 (median 50); T_length=1..100 (median 50).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 202, "median": 102.0, "min": 4}, "input_format": ["S T"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p03556_case_000", "p03556_case_001", "p03556_case_002", "p03556_case_003", "p03556_case_004", "p03556_case_005", "p03556_case_006", "p03556_case_007", "p03556_case_008", "p03556_case_009", "p03556_case_010", "p03556_case_011", "p03556_case_012", "p03556_case_013", "p03556_case_014", "p03556_case_015", "p03556_case_016", "p03556_case_017", "p03556_case_018", "p03556_case_019", "p03556_case_020", "p03556_case_021", "p03556_case_022", "p03556_case_023", "p03556_case_024", "p03556_case_025", "p03556_case_026", "p03556_case_027", "p03556_case_028", "p03556_case_029", "p03556_case_030", "p03556_case_031", "p03556_case_032", "p03556_case_033", "p03556_case_034", "p03556_case_035", "p03556_case_036", "p03556_case_037", "p03556_case_038", "p03556_case_039", "p03556_case_040", "p03556_case_041", "p03556_case_042", "p03556_case_043", "p03556_case_044", "p03556_case_045", "p03556_case_046", "p03556_case_047", "p03556_case_048", "p03556_case_049", "p03556_case_050", "p03556_case_051", "p03556_case_052", "p03556_case_053", "p03556_case_054", "p03556_case_055", "p03556_case_056", "p03556_case_057", "p03556_case_058", "p03556_case_059", "p03556_case_060", "p03556_case_061", "p03556_case_062", "p03556_case_063", "p03556_case_064", "p03556_case_065", "p03556_case_066", "p03556_case_067", "p03556_case_068", "p03556_case_069", "p03556_case_070", "p03556_case_071", "p03556_case_072", "p03556_case_073", "p03556_case_074", "p03556_case_075", "p03556_case_076", "p03556_case_077", "p03556_case_078", "p03556_case_079", "p03556_case_080", "p03556_case_081", "p03556_case_082", "p03556_case_083", "p03556_case_084", "p03556_case_085", "p03556_case_086", "p03556_case_087", "p03556_case_088", "p03556_case_089", "p03556_case_090", "p03556_case_091", "p03556_case_092", "p03556_case_093", "p03556_case_094", "p03556_case_095", "p03556_case_096", "p03556_case_097", "p03556_case_098", "p03556_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import math\n\ni = int(eval(input()))\nr = math.sqrt(i)\nir = int(r)\nprint((ir * ir))\n", "fast_code_sha256": "055ea82692caf532cba37fabe5475d1f818a9782fbb3ecb3849a6afaa05f3056", "fast_id": "p03556_055ea82692caf532cba37fabe5475d1f818a9782fbb3ecb3849a6afaa05f3056", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import math\n\ni = int(eval(input()))\nr = math.sqrt(i)\nir = int(r)\nprint((ir * ir))\n", "measured_fast_code_sha256": "055ea82692caf532cba37fabe5475d1f818a9782fbb3ecb3849a6afaa05f3056", "measured_slow_code": "import functools\nimport itertools\nimport numpy as np\nimport sys\n\nMAX_INT = int(10e10)\nMIN_INT = -MAX_INT\nmod = 1000000007\nsys.setrecursionlimit(1000000)\n\n\ndef IL():\n return list(map(int, input().split()))\n\n\ndef SL():\n return input().split()\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef S():\n return eval(input())\n\n\nN = I()\nans = [pow(i, 2) for i in range(100000) if pow(i, 2) <= N]\nprint((ans[-1]))\n", "measured_slow_code_sha256": "b08038f2cfa38828c3451135e0ae29ee0ad4cf29b9ef9a8abfaa3be486afcc2d", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3017.358954747535, "pair_id": "python_v2_52e9202f7b0e60505aefb0b3", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03556", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03556_055ea82692caf532cba37fabe5475d1f818a9782fbb3ecb3849a6afaa05f3056.jsonl.gz", "inputs": "reproduction/python/inputs/p03556.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03556_b08038f2cfa38828c3451135e0ae29ee0ad4cf29b9ef9a8abfaa3be486afcc2d.jsonl.gz"}, "slow_code": "import functools\nimport itertools\nimport numpy as np\nimport sys\n\nMAX_INT = int(10e10)\nMIN_INT = -MAX_INT\nmod = 1000000007\nsys.setrecursionlimit(1000000)\n\n\ndef IL():\n return list(map(int, input().split()))\n\n\ndef SL():\n return input().split()\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef S():\n return eval(input())\n\n\nN = I()\nans = [pow(i, 2) for i in range(100000) if pow(i, 2) <= N]\nprint((ans[-1]))\n", "slow_code_sha256": "b08038f2cfa38828c3451135e0ae29ee0ad4cf29b9ef9a8abfaa3be486afcc2d", "slow_id": "p03556_b08038f2cfa38828c3451135e0ae29ee0ad4cf29b9ef9a8abfaa3be486afcc2d", "speedup": 3015.0968480090287, "stratum": "8+", "within_pair_jaccard": 0.13636363636363635, "workload": {"case_count": 100, "description": "Find the largest integer square not exceeding positive input N. Observed inputs: N=1..1000000000 (median 266490422).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 11, "median": 10.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p03609_case_000", "p03609_case_001", "p03609_case_002", "p03609_case_003", "p03609_case_004", "p03609_case_005", "p03609_case_006", "p03609_case_007", "p03609_case_008", "p03609_case_009", "p03609_case_010", "p03609_case_011", "p03609_case_012", "p03609_case_013", "p03609_case_014", "p03609_case_015", "p03609_case_016", "p03609_case_017", "p03609_case_018", "p03609_case_019", "p03609_case_020", "p03609_case_021", "p03609_case_022", "p03609_case_023", "p03609_case_024", "p03609_case_025", "p03609_case_026", "p03609_case_027", "p03609_case_028", "p03609_case_029", "p03609_case_030", "p03609_case_031", "p03609_case_032", "p03609_case_033", "p03609_case_034", "p03609_case_035", "p03609_case_036", "p03609_case_037", "p03609_case_038", "p03609_case_039", "p03609_case_040", "p03609_case_041", "p03609_case_042", "p03609_case_043", "p03609_case_044", "p03609_case_045", "p03609_case_046", "p03609_case_047", "p03609_case_048", "p03609_case_049", "p03609_case_050", "p03609_case_051", "p03609_case_052", "p03609_case_053", "p03609_case_054", "p03609_case_055", "p03609_case_056", "p03609_case_057", "p03609_case_058", "p03609_case_059", "p03609_case_060", "p03609_case_061", "p03609_case_062", "p03609_case_063", "p03609_case_064", "p03609_case_065", "p03609_case_066", "p03609_case_067", "p03609_case_068", "p03609_case_069", "p03609_case_070", "p03609_case_071", "p03609_case_072", "p03609_case_073", "p03609_case_074", "p03609_case_075", "p03609_case_076", "p03609_case_077", "p03609_case_078", "p03609_case_079", "p03609_case_080", "p03609_case_081", "p03609_case_082", "p03609_case_083", "p03609_case_084", "p03609_case_085", "p03609_case_086", "p03609_case_087", "p03609_case_088", "p03609_case_089", "p03609_case_090", "p03609_case_091", "p03609_case_092", "p03609_case_093", "p03609_case_094", "p03609_case_095", "p03609_case_096", "p03609_case_097", "p03609_case_098", "p03609_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def main():\n x, t = list(map(int, input().split()))\n print((max(0, x - t)))\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "f75fd3a8199400a04c8f3465afb7585249a1e681130ed028fbd76cbeec919e06", "fast_id": "p03609_f75fd3a8199400a04c8f3465afb7585249a1e681130ed028fbd76cbeec919e06", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def main():\n x, t = list(map(int, input().split()))\n print((max(0, x - t)))\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "f75fd3a8199400a04c8f3465afb7585249a1e681130ed028fbd76cbeec919e06", "measured_slow_code": "import numpy as np\n\nx, t = list(map(int, input().split()))\nprint((np.max(np.array([x - t, 0]))))\n", "measured_slow_code_sha256": "a299dbf158d9b4197e8d6e9bc8a56f5dae0f1a29a154060b4dbf82a91b0fb59c", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1649.259383146948, "pair_id": "python_v2_22c368b9c4a8359dd4041159", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03609", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03609_f75fd3a8199400a04c8f3465afb7585249a1e681130ed028fbd76cbeec919e06.jsonl.gz", "inputs": "reproduction/python/inputs/p03609.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03609_a299dbf158d9b4197e8d6e9bc8a56f5dae0f1a29a154060b4dbf82a91b0fb59c.jsonl.gz"}, "slow_code": "import numpy as np\n\nx, t = list(map(int, input().split()))\nprint((np.max(np.array([x - t, 0]))))\n", "slow_code_sha256": "a299dbf158d9b4197e8d6e9bc8a56f5dae0f1a29a154060b4dbf82a91b0fb59c", "slow_id": "p03609_a299dbf158d9b4197e8d6e9bc8a56f5dae0f1a29a154060b4dbf82a91b0fb59c", "speedup": 1648.4181511803556, "stratum": "8+", "within_pair_jaccard": 0.5, "workload": {"case_count": 100, "description": "An upper hourglass bulb starts with X grams and loses one gram per second until empty. Report grams remaining after t seconds. Observed inputs: X=1..1000000000 (median 278882159.5); t=1..1000000000 (median 259647859.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 22, "median": 20.0, "min": 4}, "input_format": ["X t"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p04014_case_000", "p04014_case_001", "p04014_case_002", "p04014_case_003", "p04014_case_004", "p04014_case_005", "p04014_case_006", "p04014_case_007", "p04014_case_008", "p04014_case_009", "p04014_case_010", "p04014_case_011", "p04014_case_012", "p04014_case_013", "p04014_case_014", "p04014_case_015", "p04014_case_016", "p04014_case_017", "p04014_case_018", "p04014_case_019", "p04014_case_020", "p04014_case_021", "p04014_case_022", "p04014_case_023", "p04014_case_024", "p04014_case_025", "p04014_case_026", "p04014_case_027", "p04014_case_028", "p04014_case_029", "p04014_case_030", "p04014_case_031", "p04014_case_032", "p04014_case_033", "p04014_case_034", "p04014_case_035", "p04014_case_036", "p04014_case_037", "p04014_case_038", "p04014_case_039", "p04014_case_040", "p04014_case_041", "p04014_case_042", "p04014_case_043", "p04014_case_044", "p04014_case_045", "p04014_case_046", "p04014_case_047", "p04014_case_048", "p04014_case_049", "p04014_case_050", "p04014_case_051", "p04014_case_052", "p04014_case_053", "p04014_case_054", "p04014_case_055", "p04014_case_056", "p04014_case_057", "p04014_case_058", "p04014_case_059", "p04014_case_060", "p04014_case_061", "p04014_case_062", "p04014_case_063", "p04014_case_064", "p04014_case_065", "p04014_case_066", "p04014_case_067", "p04014_case_068", "p04014_case_069", "p04014_case_070", "p04014_case_071", "p04014_case_072", "p04014_case_073", "p04014_case_074", "p04014_case_075", "p04014_case_076", "p04014_case_077", "p04014_case_078", "p04014_case_079", "p04014_case_080", "p04014_case_081", "p04014_case_082", "p04014_case_083", "p04014_case_084", "p04014_case_085", "p04014_case_086", "p04014_case_087", "p04014_case_088", "p04014_case_089", "p04014_case_090", "p04014_case_091", "p04014_case_092", "p04014_case_093", "p04014_case_094", "p04014_case_095", "p04014_case_096", "p04014_case_097", "p04014_case_098", "p04014_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\nn = int(eval(input()))\ns = int(eval(input()))\n\n\ndef f(b, n):\n if n < b:\n return n\n else:\n return f(b, n // b) + n % b\n\n\nif s == n:\n print((n + 1))\n sys.exit(0)\nif n < s:\n print((-1))\n sys.exit(0)\nans = None\nfor i in range(2, n):\n if i * i > n:\n break\n if f(i, n) == s:\n ans = i\n break\nfor i in range(1, n):\n if i * i > n:\n break\n if (n - s) % i == 0:\n b = (n - s) // i + 1\n if f(b, n) == s:\n if ans is None:\n ans = (n - s) // i + 1\n else:\n ans = min((ans, (n - s) // i + 1))\nif ans is None:\n print((-1))\nelse:\n print(ans)\n", "fast_code_sha256": "9f205f7f14f8a8391a0e84e5bbc9266ac57a944177527cfa1158bad6b697fbee", "fast_id": "p04014_9f205f7f14f8a8391a0e84e5bbc9266ac57a944177527cfa1158bad6b697fbee", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\nn = int(eval(input()))\ns = int(eval(input()))\n\n\ndef f(b, n):\n if n < b:\n return n\n else:\n return f(b, n // b) + n % b\n\n\nif s == n:\n print((n + 1))\n sys.exit(0)\nif n < s:\n print((-1))\n sys.exit(0)\nans = None\nfor i in range(2, n):\n if i * i > n:\n break\n if f(i, n) == s:\n ans = i\n break\nfor i in range(1, n):\n if i * i > n:\n break\n if (n - s) % i == 0:\n b = (n - s) // i + 1\n if f(b, n) == s:\n if ans is None:\n ans = (n - s) // i + 1\n else:\n ans = min((ans, (n - s) // i + 1))\nif ans is None:\n print((-1))\nelse:\n print(ans)\n", "measured_fast_code_sha256": "9f205f7f14f8a8391a0e84e5bbc9266ac57a944177527cfa1158bad6b697fbee", "measured_slow_code": "from math import floor, sqrt\n\nINF = 10**20\n\n\ndef f(b, n):\n if n < b:\n return n\n else:\n return f(b, n // b) + (n % b)\n\n\ndef main():\n n = int(eval(input()))\n s = int(eval(input()))\n ans = INF\n # 1桁\n if n == s:\n ans = min(ans, n + 1)\n # 2桁\n for p in range(1, int(sqrt(n)) + 1):\n q = s - p\n b = (n - q) // p\n if 2 <= b and f(b, n) == s:\n ans = min(ans, b)\n # 3桁以上\n for b in range(2, int(sqrt(n)) + 1):\n if f(b, n) == s:\n ans = min(ans, b)\n print((-1 if ans == INF else ans))\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "c95ad2a8dc940041977600eb1078f63d16cb258708724f5b3b59e88e5ff612b9", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.0708370367685587, "pair_id": "python_v2_ff15cdbec349703416466d76", "per_case_slow_code_faster_fraction": 0.28, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p04014", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p04014_9f205f7f14f8a8391a0e84e5bbc9266ac57a944177527cfa1158bad6b697fbee.jsonl.gz", "inputs": "reproduction/python/inputs/p04014.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p04014_c95ad2a8dc940041977600eb1078f63d16cb258708724f5b3b59e88e5ff612b9.jsonl.gz"}, "slow_code": "from math import floor, sqrt\n\nINF = 10**20\n\n\ndef f(b, n):\n if n < b:\n return n\n else:\n return f(b, n // b) + (n % b)\n\n\ndef main():\n n = int(eval(input()))\n s = int(eval(input()))\n ans = INF\n\n if n == s:\n ans = min(ans, n + 1)\n\n for p in range(1, int(sqrt(n)) + 1):\n q = s - p\n b = (n - q) // p\n if 2 <= b and f(b, n) == s:\n ans = min(ans, b)\n\n for b in range(2, int(sqrt(n)) + 1):\n if f(b, n) == s:\n ans = min(ans, b)\n print((-1 if ans == INF else ans))\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "29cce6a043e57af2f8084b7594ae7495531a30dede09cf51b56088a83bb9cffb", "slow_id": "p04014_c95ad2a8dc940041977600eb1078f63d16cb258708724f5b3b59e88e5ff612b9", "speedup": 5.125051501956496, "stratum": "4-8", "within_pair_jaccard": 0.5, "workload": {"case_count": 100, "description": "Find the smallest integer base b>=2 in which positive integer n has digit sum s, or report -1 if no such base exists. Observed inputs: n=1..99999999999; s=1..99999999999.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 24, "median": 14.0, "min": 4}, "input_format": ["n\ns"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p03222_case_000", "p03222_case_001", "p03222_case_002", "p03222_case_003", "p03222_case_004", "p03222_case_005", "p03222_case_006", "p03222_case_007", "p03222_case_008", "p03222_case_009", "p03222_case_010", "p03222_case_011", "p03222_case_012", "p03222_case_013", "p03222_case_014", "p03222_case_015", "p03222_case_016", "p03222_case_017", "p03222_case_018", "p03222_case_019", "p03222_case_020", "p03222_case_021", "p03222_case_022", "p03222_case_023", "p03222_case_024", "p03222_case_025", "p03222_case_026", "p03222_case_027", "p03222_case_028", "p03222_case_029", "p03222_case_030", "p03222_case_031", "p03222_case_032", "p03222_case_033", "p03222_case_034", "p03222_case_035", "p03222_case_036", "p03222_case_037", "p03222_case_038", "p03222_case_039", "p03222_case_040", "p03222_case_041", "p03222_case_042", "p03222_case_043", "p03222_case_044", "p03222_case_045", "p03222_case_046", "p03222_case_047", "p03222_case_048", "p03222_case_049", "p03222_case_050", "p03222_case_051", "p03222_case_052", "p03222_case_053", "p03222_case_054", "p03222_case_055", "p03222_case_056", "p03222_case_057", "p03222_case_058", "p03222_case_059", "p03222_case_060", "p03222_case_061", "p03222_case_062", "p03222_case_063", "p03222_case_064", "p03222_case_065", "p03222_case_066", "p03222_case_067", "p03222_case_068", "p03222_case_069", "p03222_case_070", "p03222_case_071", "p03222_case_072", "p03222_case_073", "p03222_case_074", "p03222_case_075", "p03222_case_076", "p03222_case_077", "p03222_case_078", "p03222_case_079", "p03222_case_080", "p03222_case_081", "p03222_case_082", "p03222_case_083", "p03222_case_084", "p03222_case_085", "p03222_case_086", "p03222_case_087", "p03222_case_088", "p03222_case_089", "p03222_case_090", "p03222_case_091", "p03222_case_092", "p03222_case_093", "p03222_case_094", "p03222_case_095", "p03222_case_096", "p03222_case_097", "p03222_case_098", "p03222_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\nMOD = 10**9 + 7\nh, w, k = list(map(int, sys.stdin.readline().split()))\n\n\ndef main():\n if w == 1:\n return 1\n ok = []\n for i in range(2 ** (w - 1)):\n prev = False\n for j in range(w - 1):\n if i >> j & 1:\n if prev:\n break\n else:\n prev = True\n else:\n prev = False\n else:\n ok.append(i)\n lcr = [(letter, 0) for letter in \"lcr\"]\n a = [dict(lcr) for _ in range(w)]\n for i in ok:\n j = 0\n while j < w:\n if i >> j & 1:\n a[j][\"r\"] += 1\n a[j + 1][\"l\"] += 1\n j += 2\n else:\n a[j][\"c\"] += 1\n j += 1\n res = [0] * w\n res[0] = 1\n for _ in range(h):\n nex = [0] * w\n for j in range(w):\n if j == 0:\n nex[j] = res[j] * a[j][\"c\"] + res[j + 1] * a[j][\"r\"]\n elif j < w - 1:\n nex[j] = (\n res[j - 1] * a[j][\"l\"] + res[j] * a[j][\"c\"] + res[j + 1] * a[j][\"r\"]\n )\n else:\n nex[j] = res[j - 1] * a[j][\"l\"] + res[j] * a[j][\"c\"]\n for j in range(w):\n nex[j] %= MOD\n res = nex\n return res[k - 1]\n\n\nif __name__ == \"__main__\":\n ans = main()\n print(ans)\n", "fast_code_sha256": "cfe970827b906a080e1f9e7f022041c9f0c0a81f12244e331c8ed6bb5acfacbb", "fast_id": "p03222_cfe970827b906a080e1f9e7f022041c9f0c0a81f12244e331c8ed6bb5acfacbb", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\nMOD = 10**9 + 7\nh, w, k = list(map(int, sys.stdin.readline().split()))\n\n\ndef main():\n if w == 1:\n return 1\n ok = []\n for i in range(2 ** (w - 1)):\n prev = False\n for j in range(w - 1):\n if i >> j & 1:\n if prev:\n break\n else:\n prev = True\n else:\n prev = False\n else:\n ok.append(i)\n lcr = [(letter, 0) for letter in \"lcr\"]\n a = [dict(lcr) for _ in range(w)]\n for i in ok:\n j = 0\n while j < w:\n if i >> j & 1:\n a[j][\"r\"] += 1\n a[j + 1][\"l\"] += 1\n j += 2\n else:\n a[j][\"c\"] += 1\n j += 1\n res = [0] * w\n res[0] = 1\n for _ in range(h):\n nex = [0] * w\n for j in range(w):\n if j == 0:\n nex[j] = res[j] * a[j][\"c\"] + res[j + 1] * a[j][\"r\"]\n elif j < w - 1:\n nex[j] = (\n res[j - 1] * a[j][\"l\"] + res[j] * a[j][\"c\"] + res[j + 1] * a[j][\"r\"]\n )\n else:\n nex[j] = res[j - 1] * a[j][\"l\"] + res[j] * a[j][\"c\"]\n for j in range(w):\n nex[j] %= MOD\n res = nex\n return res[k - 1]\n\n\nif __name__ == \"__main__\":\n ans = main()\n print(ans)\n", "measured_fast_code_sha256": "cfe970827b906a080e1f9e7f022041c9f0c0a81f12244e331c8ed6bb5acfacbb", "measured_slow_code": "from itertools import product\n\nH, W, K = list(map(int, input().split()))\nMOD = 10**9 + 7\ndp = [[0] * W for i in range(H + 1)]\ndp[0][0] = 1\n\n\ndef calc(w):\n if w <= 0:\n return 1\n ret = 0\n for pattern in product([0, 1], repeat=w):\n pattern = \"\".join(list(map(str, pattern)))\n if \"11\" not in pattern:\n ret += 1\n return ret\n\n\nfor h in range(H):\n for w in range(W):\n dp[h + 1][w] = (dp[h + 1][w] + dp[h][w] * calc(w - 1) * calc(W - w - 2)) % MOD\n if w + 1 < W:\n dp[h + 1][w + 1] = (\n dp[h + 1][w + 1] + dp[h][w] * calc(w - 1) * calc(W - w - 3) % MOD\n )\n if w - 1 >= 0:\n dp[h + 1][w - 1] = (\n dp[h + 1][w - 1] + dp[h][w] * calc(w - 2) * calc(W - w - 2) % MOD\n )\nprint((dp[H][K - 1] % MOD))\n", "measured_slow_code_sha256": "efe15798bd9323303879de374c005d19f7662008b0dd93365b20891e94c40f49", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 7.051053476327419, "pair_id": "python_v2_485b840268bca156b21f4109", "per_case_slow_code_faster_fraction": 0.19, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03222", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03222_cfe970827b906a080e1f9e7f022041c9f0c0a81f12244e331c8ed6bb5acfacbb.jsonl.gz", "inputs": "reproduction/python/inputs/p03222.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03222_efe15798bd9323303879de374c005d19f7662008b0dd93365b20891e94c40f49.jsonl.gz"}, "slow_code": "from itertools import product\n\nH, W, K = list(map(int, input().split()))\nMOD = 10**9 + 7\ndp = [[0] * W for i in range(H + 1)]\ndp[0][0] = 1\n\n\ndef calc(w):\n if w <= 0:\n return 1\n ret = 0\n for pattern in product([0, 1], repeat=w):\n pattern = \"\".join(list(map(str, pattern)))\n if \"11\" not in pattern:\n ret += 1\n return ret\n\n\nfor h in range(H):\n for w in range(W):\n dp[h + 1][w] = (dp[h + 1][w] + dp[h][w] * calc(w - 1) * calc(W - w - 2)) % MOD\n if w + 1 < W:\n dp[h + 1][w + 1] = (\n dp[h + 1][w + 1] + dp[h][w] * calc(w - 1) * calc(W - w - 3) % MOD\n )\n if w - 1 >= 0:\n dp[h + 1][w - 1] = (\n dp[h + 1][w - 1] + dp[h][w] * calc(w - 2) * calc(W - w - 2) % MOD\n )\nprint((dp[H][K - 1] % MOD))\n", "slow_code_sha256": "efe15798bd9323303879de374c005d19f7662008b0dd93365b20891e94c40f49", "slow_id": "p03222_efe15798bd9323303879de374c005d19f7662008b0dd93365b20891e94c40f49", "speedup": 5.945264353098406, "stratum": "4-8", "within_pair_jaccard": 0.3283582089552239, "workload": {"case_count": 100, "description": "Count ladder lotteries with W vertical lines and H horizontal levels. At each level, links join adjacent verticals and cannot share endpoints. Following links from the top-left must end at bottom column K. Output modulo 1000000007. Observed inputs: H=1..100 (median 50); W=1..8 (median 5); K=1..8 (median 2.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 8, "median": 7.0, "min": 6}, "input_format": ["H W K"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3, "median": 3.0, "min": 3}}} -{"case_ids": ["p03803_case_000", "p03803_case_001", "p03803_case_002", "p03803_case_003", "p03803_case_004", "p03803_case_005", "p03803_case_006", "p03803_case_007", "p03803_case_008", "p03803_case_009", "p03803_case_010", "p03803_case_011", "p03803_case_012", "p03803_case_013", "p03803_case_014", "p03803_case_015", "p03803_case_016", "p03803_case_017", "p03803_case_018", "p03803_case_019", "p03803_case_020", "p03803_case_021", "p03803_case_022", "p03803_case_023", "p03803_case_024", "p03803_case_025", "p03803_case_026", "p03803_case_027", "p03803_case_028", "p03803_case_029", "p03803_case_030", "p03803_case_031", "p03803_case_032", "p03803_case_033", "p03803_case_034", "p03803_case_035", "p03803_case_036", "p03803_case_037", "p03803_case_038", "p03803_case_039", "p03803_case_040", "p03803_case_041", "p03803_case_042", "p03803_case_043", "p03803_case_044", "p03803_case_045", "p03803_case_046", "p03803_case_047", "p03803_case_048", "p03803_case_049", "p03803_case_050", "p03803_case_051", "p03803_case_052", "p03803_case_053", "p03803_case_054", "p03803_case_055", "p03803_case_056", "p03803_case_057", "p03803_case_058", "p03803_case_059", "p03803_case_060", "p03803_case_061", "p03803_case_062", "p03803_case_063", "p03803_case_064", "p03803_case_065", "p03803_case_066", "p03803_case_067", "p03803_case_068", "p03803_case_069", "p03803_case_070", "p03803_case_071", "p03803_case_072", "p03803_case_073", "p03803_case_074", "p03803_case_075", "p03803_case_076", "p03803_case_077", "p03803_case_078", "p03803_case_079", "p03803_case_080", "p03803_case_081", "p03803_case_082", "p03803_case_083", "p03803_case_084", "p03803_case_085", "p03803_case_086", "p03803_case_087", "p03803_case_088", "p03803_case_089", "p03803_case_090", "p03803_case_091", "p03803_case_092", "p03803_case_093", "p03803_case_094", "p03803_case_095", "p03803_case_096", "p03803_case_097", "p03803_case_098", "p03803_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "a, b = list(map(int, input().split()))\nprint(([\"Draw\", [\"Bob\", \"Alice\"][(a - 2) % 13 > (b - 2) % 13]][a != b]))\n", "fast_code_sha256": "b24cda5b59e9141df1721e751c498ab19354c9e58b27b11a5d1f20643ab392c4", "fast_id": "p03803_b24cda5b59e9141df1721e751c498ab19354c9e58b27b11a5d1f20643ab392c4", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "a, b = list(map(int, input().split()))\nprint(([\"Draw\", [\"Bob\", \"Alice\"][(a - 2) % 13 > (b - 2) % 13]][a != b]))\n", "measured_fast_code_sha256": "b24cda5b59e9141df1721e751c498ab19354c9e58b27b11a5d1f20643ab392c4", "measured_slow_code": "import sys, math\nfrom functools import lru_cache\nfrom itertools import accumulate\n\nsys.setrecursionlimit(10**9)\nMOD = 10**9 + 7\n\n\ndef input():\n return sys.stdin.readline()[:-1]\n\n\ndef mi():\n return list(map(int, input().split()))\n\n\ndef ii():\n return int(eval(input()))\n\n\ndef i2(n):\n tmp = [list(mi()) for i in range(n)]\n return [list(i) for i in zip(*tmp)]\n\n\nA, B = mi()\nif A == B:\n print(\"Draw\")\nelif A == 1:\n print(\"Alice\")\nelif B == 1:\n print(\"Bob\")\nelse:\n if A > B:\n print(\"Alice\")\n else:\n print(\"Bob\")\n", "measured_slow_code_sha256": "0bd5df2a157ba82c7c25ec618ddd2b8ac3a7b93747b5c4b4114a2cd42e8e257e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.530255093146166, "pair_id": "python_v2_70cfffebf535f3cbb88bc7b8", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03803", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03803_b24cda5b59e9141df1721e751c498ab19354c9e58b27b11a5d1f20643ab392c4.jsonl.gz", "inputs": "reproduction/python/inputs/p03803.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03803_0bd5df2a157ba82c7c25ec618ddd2b8ac3a7b93747b5c4b4114a2cd42e8e257e.jsonl.gz"}, "slow_code": "import sys, math\nfrom functools import lru_cache\nfrom itertools import accumulate\n\nsys.setrecursionlimit(10**9)\nMOD = 10**9 + 7\n\n\ndef input():\n return sys.stdin.readline()[:-1]\n\n\ndef mi():\n return list(map(int, input().split()))\n\n\ndef ii():\n return int(eval(input()))\n\n\ndef i2(n):\n tmp = [list(mi()) for i in range(n)]\n return [list(i) for i in zip(*tmp)]\n\n\nA, B = mi()\nif A == B:\n print(\"Draw\")\nelif A == 1:\n print(\"Alice\")\nelif B == 1:\n print(\"Bob\")\nelse:\n if A > B:\n print(\"Alice\")\n else:\n print(\"Bob\")\n", "slow_code_sha256": "0bd5df2a157ba82c7c25ec618ddd2b8ac3a7b93747b5c4b4114a2cd42e8e257e", "slow_id": "p03803_0bd5df2a157ba82c7c25ec618ddd2b8ac3a7b93747b5c4b4114a2cd42e8e257e", "speedup": 3.528836253632195, "stratum": "2-4", "within_pair_jaccard": 0.19148936170212766, "workload": {"case_count": 100, "description": "Compare two card ranks A,B from 1..13. Rank 1 is strongest; the other ranks increase in strength from 2 through 13. Report the first player, second player, or a draw. Observed inputs: A=1..13 (median 6); B=1..13 (median 6.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 6, "median": 4.0, "min": 4}, "input_format": ["A B"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p02669_case_000", "p02669_case_001", "p02669_case_002", "p02669_case_003", "p02669_case_004", "p02669_case_005", "p02669_case_006", "p02669_case_007", "p02669_case_008", "p02669_case_009", "p02669_case_010", "p02669_case_011", "p02669_case_012", "p02669_case_013", "p02669_case_014", "p02669_case_015", "p02669_case_016", "p02669_case_017", "p02669_case_018", "p02669_case_019", "p02669_case_020", "p02669_case_021", "p02669_case_022", "p02669_case_023", "p02669_case_024", "p02669_case_025", "p02669_case_026", "p02669_case_027", "p02669_case_028", "p02669_case_029", "p02669_case_030", "p02669_case_031", "p02669_case_032", "p02669_case_033", "p02669_case_034", "p02669_case_035", "p02669_case_036", "p02669_case_037", "p02669_case_038", "p02669_case_039", "p02669_case_040", "p02669_case_041", "p02669_case_042", "p02669_case_043", "p02669_case_044", "p02669_case_045", "p02669_case_046", "p02669_case_047", "p02669_case_048", "p02669_case_049", "p02669_case_050", "p02669_case_051", "p02669_case_052", "p02669_case_054", "p02669_case_055", "p02669_case_056", "p02669_case_057", "p02669_case_058", "p02669_case_059", "p02669_case_060", "p02669_case_061", "p02669_case_062", "p02669_case_063", "p02669_case_064", "p02669_case_065", "p02669_case_066", "p02669_case_067", "p02669_case_068", "p02669_case_069", "p02669_case_070", "p02669_case_071", "p02669_case_072", "p02669_case_073", "p02669_case_074", "p02669_case_075", "p02669_case_076", "p02669_case_077", "p02669_case_078", "p02669_case_080", "p02669_case_081", "p02669_case_082", "p02669_case_083", "p02669_case_084", "p02669_case_085", "p02669_case_086", "p02669_case_087", "p02669_case_088", "p02669_case_089", "p02669_case_090", "p02669_case_091", "p02669_case_092", "p02669_case_093", "p02669_case_094", "p02669_case_095", "p02669_case_096", "p02669_case_097", "p02669_case_098", "p02669_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 98, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\nsys.setrecursionlimit(10**8)\nT = int(eval(input()))\n\n\ndef solve(N):\n if N == 0:\n return 0\n if N == 1:\n return D\n if N in dic:\n return dic[N]\n tmp = N * D\n if N % 2 == 0:\n tmp = min(tmp, solve(N // 2) + A)\n else:\n tmp = min(tmp, solve((N - 1) // 2) + A + D, solve((N + 1) // 2) + A + D)\n if N % 3 == 0:\n tmp = min(tmp, solve(N // 3) + B)\n else:\n b = N % 3\n tmp = min(\n tmp,\n solve((N + (3 - b)) // 3) + B + (3 - b) * D,\n solve((N - b) // 3) + B + b * D,\n )\n if N % 5 == 0:\n tmp = min(tmp, solve(N // 5) + C)\n else:\n c = N % 5\n tmp = min(\n tmp,\n solve((N - c) // 5) + C + D * c,\n solve((N + (5 - c)) // 5) + C + D * (5 - c),\n )\n dic[N] = tmp\n return tmp\n\n\nfor _ in range(T):\n N, A, B, C, D = list(map(int, input().split()))\n dic = {}\n print((solve(N)))\n", "fast_code_sha256": "327c47eed7c39c83e5d0648140e597c5234b1072e6b80625d65d70883523a061", "fast_id": "p02669_327c47eed7c39c83e5d0648140e597c5234b1072e6b80625d65d70883523a061", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\nsys.setrecursionlimit(10**8)\nT = int(eval(input()))\n\n\ndef solve(N):\n if N == 0:\n return 0\n if N == 1:\n return D\n if N in dic:\n return dic[N]\n tmp = N * D\n if N % 2 == 0:\n tmp = min(tmp, solve(N // 2) + A)\n else:\n tmp = min(tmp, solve((N - 1) // 2) + A + D, solve((N + 1) // 2) + A + D)\n if N % 3 == 0:\n tmp = min(tmp, solve(N // 3) + B)\n else:\n b = N % 3\n tmp = min(\n tmp,\n solve((N + (3 - b)) // 3) + B + (3 - b) * D,\n solve((N - b) // 3) + B + b * D,\n )\n if N % 5 == 0:\n tmp = min(tmp, solve(N // 5) + C)\n else:\n c = N % 5\n tmp = min(\n tmp,\n solve((N - c) // 5) + C + D * c,\n solve((N + (5 - c)) // 5) + C + D * (5 - c),\n )\n dic[N] = tmp\n return tmp\n\n\nfor _ in range(T):\n N, A, B, C, D = list(map(int, input().split()))\n dic = {}\n print((solve(N)))\n", "measured_fast_code_sha256": "327c47eed7c39c83e5d0648140e597c5234b1072e6b80625d65d70883523a061", "measured_slow_code": "import sys\n\ndivs = [2, 3, 5]\nt = int(eval(input()))\nfor _ in range(t):\n n, a, b, c, d = list(map(int, input().split()))\n costs = [a, b, c]\n dp = {}\n\n def dfs(x):\n if x in dp:\n return dp[x]\n # print(x, file=sys.stderr)\n if x == 0:\n dp[x] = 0\n return dp[x]\n ret = x * d\n for i in range(-4, 5):\n if x - i < 0:\n continue\n nx = x - i\n for cost, div in zip(costs, divs):\n if nx % div != 0 or nx // div >= x:\n continue\n ret = min(ret, dfs(nx // div) + cost + abs(i) * d)\n dp[x] = ret\n return ret\n\n print((dfs(n)))\n", "measured_slow_code_sha256": "5dc16e69171829fb825a4382d7ae818d1f78cf50ef12255ba28fcf6c6591e0e1", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 12.448394673081609, "pair_id": "python_v2_9906fc0b23d8fe9c586d774d", "per_case_slow_code_faster_fraction": 0.14285714285714285, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02669", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02669_327c47eed7c39c83e5d0648140e597c5234b1072e6b80625d65d70883523a061.jsonl.gz", "inputs": "reproduction/python/inputs/p02669.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02669_5dc16e69171829fb825a4382d7ae818d1f78cf50ef12255ba28fcf6c6591e0e1.jsonl.gz"}, "slow_code": "import sys\n\ndivs = [2, 3, 5]\nt = int(eval(input()))\nfor _ in range(t):\n n, a, b, c, d = list(map(int, input().split()))\n costs = [a, b, c]\n dp = {}\n\n def dfs(x):\n if x in dp:\n return dp[x]\n\n if x == 0:\n dp[x] = 0\n return dp[x]\n ret = x * d\n for i in range(-4, 5):\n if x - i < 0:\n continue\n nx = x - i\n for cost, div in zip(costs, divs):\n if nx % div != 0 or nx // div >= x:\n continue\n ret = min(ret, dfs(nx // div) + cost + abs(i) * d)\n dp[x] = ret\n return ret\n\n print((dfs(n)))\n", "slow_code_sha256": "ca3505b4e5755f2e5a6dda25d2ba0ee1f8926fae7d5ee6e43c499cad98b2e89b", "slow_id": "p02669_5dc16e69171829fb825a4382d7ae818d1f78cf50ef12255ba28fcf6c6591e0e1", "speedup": 6.8812668641758865, "stratum": "4-8", "within_pair_jaccard": 0.41818181818181815, "workload": {"case_count": 98, "description": "For each of T cases, find the minimum cost to change 0 into N. Multiplication by 2, 3 or 5 costs A, B or C respectively; increasing or decreasing by 1 costs D. Operations may be repeated in any order. Observed inputs: T=1..10 (median 1); N=1..999999995042541824; A=1..1000000000; B=1..1000000000; C=1..1000000000; D=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 98, "input_bytes": {"max": 592, "median": 43.5, "min": 12}, "input_format": ["T\nN_1 A_1 B_1 C_1 D_1\n...\nN_T A_T B_T C_T D_T"], "input_format_status": "source_input_section", "input_lines": {"max": 11, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 51, "median": 6.0, "min": 6}}} -{"case_ids": ["p03288_case_000", "p03288_case_001", "p03288_case_002", "p03288_case_003", "p03288_case_004", "p03288_case_005", "p03288_case_006", "p03288_case_007", "p03288_case_008", "p03288_case_009", "p03288_case_010", "p03288_case_011", "p03288_case_012", "p03288_case_013", "p03288_case_014", "p03288_case_015", "p03288_case_016", "p03288_case_017", "p03288_case_018", "p03288_case_019", "p03288_case_020", "p03288_case_021", "p03288_case_022", "p03288_case_023", "p03288_case_024", "p03288_case_025", "p03288_case_026", "p03288_case_027", "p03288_case_028", "p03288_case_029", "p03288_case_030", "p03288_case_031", "p03288_case_032", "p03288_case_033", "p03288_case_034", "p03288_case_035", "p03288_case_036", "p03288_case_037", "p03288_case_038", "p03288_case_039", "p03288_case_040", "p03288_case_041", "p03288_case_042", "p03288_case_043", "p03288_case_044", "p03288_case_045", "p03288_case_046", "p03288_case_047", "p03288_case_048", "p03288_case_049", "p03288_case_050", "p03288_case_051", "p03288_case_052", "p03288_case_053", "p03288_case_054", "p03288_case_055", "p03288_case_056", "p03288_case_057", "p03288_case_058", "p03288_case_059", "p03288_case_060", "p03288_case_061", "p03288_case_062", "p03288_case_063", "p03288_case_064", "p03288_case_065", "p03288_case_066", "p03288_case_067", "p03288_case_068", "p03288_case_069", "p03288_case_070", "p03288_case_071", "p03288_case_072", "p03288_case_073", "p03288_case_074", "p03288_case_075", "p03288_case_076", "p03288_case_077", "p03288_case_078", "p03288_case_079", "p03288_case_080", "p03288_case_081", "p03288_case_082", "p03288_case_083", "p03288_case_084", "p03288_case_085", "p03288_case_086", "p03288_case_087", "p03288_case_088", "p03288_case_089", "p03288_case_090", "p03288_case_091", "p03288_case_092", "p03288_case_093", "p03288_case_094", "p03288_case_095", "p03288_case_096", "p03288_case_097", "p03288_case_098", "p03288_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "print((\"A\" + \"BRG\"[(int(eval(input())) + 400) // 1600] + \"C\"))\n", "fast_code_sha256": "72b71a4c2a434a9d0a0a9d484d7636764d97594d3350c5893fe481f19a5f8124", "fast_id": "p03288_72b71a4c2a434a9d0a0a9d484d7636764d97594d3350c5893fe481f19a5f8124", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "print((\"A\" + \"BRG\"[(int(eval(input())) + 400) // 1600] + \"C\"))\n", "measured_fast_code_sha256": "72b71a4c2a434a9d0a0a9d484d7636764d97594d3350c5893fe481f19a5f8124", "measured_slow_code": "import bisect, collections, copy, heapq, itertools, math, string\nimport sys\n\n\ndef S():\n return sys.stdin.readline().rstrip()\n\n\ndef M():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef LS():\n return list(sys.stdin.readline().rstrip().split())\n\n\nR = I()\nif R < 1200:\n print(\"ABC\")\nelif R < 2800:\n print(\"ARC\")\nelse:\n print(\"AGC\")\n", "measured_slow_code_sha256": "4b19a6c66c6b24c9d371f629b6a683da99f61809c1d26fcff1386ca6548060d5", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 38.675281937116935, "pair_id": "python_v2_21df9c75566c3b68350159ac", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03288", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03288_72b71a4c2a434a9d0a0a9d484d7636764d97594d3350c5893fe481f19a5f8124.jsonl.gz", "inputs": "reproduction/python/inputs/p03288.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03288_4b19a6c66c6b24c9d371f629b6a683da99f61809c1d26fcff1386ca6548060d5.jsonl.gz"}, "slow_code": "import bisect, collections, copy, heapq, itertools, math, string\nimport sys\n\n\ndef S():\n return sys.stdin.readline().rstrip()\n\n\ndef M():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef LS():\n return list(sys.stdin.readline().rstrip().split())\n\n\nR = I()\nif R < 1200:\n print(\"ABC\")\nelif R < 2800:\n print(\"ARC\")\nelse:\n print(\"AGC\")\n", "slow_code_sha256": "4b19a6c66c6b24c9d371f629b6a683da99f61809c1d26fcff1386ca6548060d5", "slow_id": "p03288_4b19a6c66c6b24c9d371f629b6a683da99f61809c1d26fcff1386ca6548060d5", "speedup": 38.57424021440494, "stratum": "8+", "within_pair_jaccard": 0.05263157894736842, "workload": {"case_count": 100, "description": "Choose the next eligible category from three ordered categories: the first requires rating below 1200, the second below 2800, and the third accepts every rating. Observed inputs: R=0..4208 (median 1199.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 5, "median": 5.0, "min": 2}, "input_format": ["R"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p02628_case_000", "p02628_case_001", "p02628_case_002", "p02628_case_003", "p02628_case_004", "p02628_case_005", "p02628_case_006", "p02628_case_007", "p02628_case_008", "p02628_case_009", "p02628_case_010", "p02628_case_011", "p02628_case_012", "p02628_case_013", "p02628_case_014", "p02628_case_015", "p02628_case_016", "p02628_case_017", "p02628_case_018", "p02628_case_019", "p02628_case_020", "p02628_case_021", "p02628_case_022", "p02628_case_023", "p02628_case_024", "p02628_case_025", "p02628_case_026", "p02628_case_027", "p02628_case_028", "p02628_case_029", "p02628_case_030", "p02628_case_031", "p02628_case_032", "p02628_case_033", "p02628_case_034", "p02628_case_035", "p02628_case_036", "p02628_case_037", "p02628_case_038", "p02628_case_039", "p02628_case_040", "p02628_case_041", "p02628_case_042", "p02628_case_043", "p02628_case_044", "p02628_case_045", "p02628_case_046", "p02628_case_047", "p02628_case_048", "p02628_case_049", "p02628_case_050", "p02628_case_051", "p02628_case_052", "p02628_case_053", "p02628_case_054", "p02628_case_055", "p02628_case_056", "p02628_case_057", "p02628_case_058", "p02628_case_059", "p02628_case_060", "p02628_case_061", "p02628_case_062", "p02628_case_063", "p02628_case_064", "p02628_case_065", "p02628_case_066", "p02628_case_067", "p02628_case_068", "p02628_case_069", "p02628_case_070", "p02628_case_071", "p02628_case_072", "p02628_case_073", "p02628_case_074", "p02628_case_075", "p02628_case_076", "p02628_case_077", "p02628_case_078", "p02628_case_079", "p02628_case_080", "p02628_case_081", "p02628_case_082", "p02628_case_083", "p02628_case_084", "p02628_case_085", "p02628_case_086", "p02628_case_087", "p02628_case_088", "p02628_case_089", "p02628_case_090", "p02628_case_091", "p02628_case_092", "p02628_case_093", "p02628_case_094", "p02628_case_095", "p02628_case_096", "p02628_case_097", "p02628_case_098", "p02628_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N, K = list(map(int, input().split()))\np = list(map(int, input().split()))\nprint((sum(sorted(p)[:K])))\n", "fast_code_sha256": "39f508bfbeebafeed596d9cf0d1ac8ae5aabb7b0f7fb18da6b1964d9d5e58f0a", "fast_id": "p02628_39f508bfbeebafeed596d9cf0d1ac8ae5aabb7b0f7fb18da6b1964d9d5e58f0a", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N, K = list(map(int, input().split()))\np = list(map(int, input().split()))\nprint((sum(sorted(p)[:K])))\n", "measured_fast_code_sha256": "39f508bfbeebafeed596d9cf0d1ac8ae5aabb7b0f7fb18da6b1964d9d5e58f0a", "measured_slow_code": "N, K = list(map(int, input().split()))\nP = list(map(int, input().split()))\n\n\ndef bubblesort(l):\n for index in range(len(l) - 1, 0, -1):\n for low in range(index):\n if l[low] > l[low + 1]:\n tmp = l[low + 1]\n l[low + 1] = l[low]\n l[low] = tmp\n return l\n\n\nbubblesort(P)\nsum = 0\nfor i in range(K):\n sum = sum + P[i]\nprint(sum)\n", "measured_slow_code_sha256": "12fc0a6880b1658c0eaeba3aa7dd7893393cf5c052e40105869e3784eb2f1caa", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 18.551434543833686, "pair_id": "python_v2_579897288e7f6cdfb3ddc2ed", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02628", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02628_39f508bfbeebafeed596d9cf0d1ac8ae5aabb7b0f7fb18da6b1964d9d5e58f0a.jsonl.gz", "inputs": "reproduction/python/inputs/p02628.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02628_12fc0a6880b1658c0eaeba3aa7dd7893393cf5c052e40105869e3784eb2f1caa.jsonl.gz"}, "slow_code": "N, K = list(map(int, input().split()))\nP = list(map(int, input().split()))\n\n\ndef bubblesort(l):\n for index in range(len(l) - 1, 0, -1):\n for low in range(index):\n if l[low] > l[low + 1]:\n tmp = l[low + 1]\n l[low + 1] = l[low]\n l[low] = tmp\n return l\n\n\nbubblesort(P)\nsum = 0\nfor i in range(K):\n sum = sum + P[i]\nprint(sum)\n", "slow_code_sha256": "12fc0a6880b1658c0eaeba3aa7dd7893393cf5c052e40105869e3784eb2f1caa", "slow_id": "p02628_12fc0a6880b1658c0eaeba3aa7dd7893393cf5c052e40105869e3784eb2f1caa", "speedup": 44.87615894272947, "stratum": "8+", "within_pair_jaccard": 0.3333333333333333, "workload": {"case_count": 100, "description": "Choose K distinct kinds among N fruits, buying one item of each, to minimize the total price. Price p_i is the cost of one item of kind i. Observed inputs: N=1..1000 (median 100); K=1..1000 (median 99); p_i=1..1000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 5010, "median": 457.0, "min": 6}, "input_format": ["N K\np_1 ... p_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1002, "median": 102.0, "min": 3}}} -{"case_ids": ["p02848_case_000", "p02848_case_001", "p02848_case_002", "p02848_case_003", "p02848_case_004", "p02848_case_005", "p02848_case_006", "p02848_case_007", "p02848_case_008", "p02848_case_009", "p02848_case_010", "p02848_case_011", "p02848_case_012", "p02848_case_013", "p02848_case_014", "p02848_case_015", "p02848_case_016", "p02848_case_017", "p02848_case_018", "p02848_case_019", "p02848_case_020", "p02848_case_021", "p02848_case_022", "p02848_case_023", "p02848_case_024", "p02848_case_025", "p02848_case_026", "p02848_case_027", "p02848_case_028", "p02848_case_029", "p02848_case_030", "p02848_case_031", "p02848_case_032", "p02848_case_033", "p02848_case_034", "p02848_case_035", "p02848_case_036", "p02848_case_037", "p02848_case_038", "p02848_case_039", "p02848_case_040", "p02848_case_041", "p02848_case_042", "p02848_case_043", "p02848_case_044", "p02848_case_045", "p02848_case_046", "p02848_case_047", "p02848_case_048", "p02848_case_049", "p02848_case_050", "p02848_case_051", "p02848_case_052", "p02848_case_053", "p02848_case_054", "p02848_case_055", "p02848_case_056", "p02848_case_057", "p02848_case_058", "p02848_case_059", "p02848_case_060", "p02848_case_061", "p02848_case_062", "p02848_case_063", "p02848_case_064", "p02848_case_065", "p02848_case_066", "p02848_case_067", "p02848_case_068", "p02848_case_069", "p02848_case_070", "p02848_case_071", "p02848_case_072", "p02848_case_073", "p02848_case_074", "p02848_case_075", "p02848_case_076", "p02848_case_077", "p02848_case_078", "p02848_case_079", "p02848_case_080", "p02848_case_081", "p02848_case_082", "p02848_case_083", "p02848_case_084", "p02848_case_085", "p02848_case_086", "p02848_case_087", "p02848_case_088", "p02848_case_089", "p02848_case_090", "p02848_case_091", "p02848_case_092", "p02848_case_093", "p02848_case_094", "p02848_case_095", "p02848_case_096", "p02848_case_097", "p02848_case_098", "p02848_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "s = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\nn = int(input())\nx = input()\na = ord(\"A\")\nprint(\"\".join([s[(ord(c) - a + n) % 26] for c in x]))\n", "fast_code_sha256": "b9b377895112e4c99f6470ef8bdf76c96f8f88338618602457f984055da5d8d7", "fast_id": "p02848_b9b377895112e4c99f6470ef8bdf76c96f8f88338618602457f984055da5d8d7", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "s = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\nn = int(input())\nx = input()\na = ord(\"A\")\nprint(\"\".join([s[(ord(c) - a + n) % 26] for c in x]))\n", "measured_fast_code_sha256": "b9b377895112e4c99f6470ef8bdf76c96f8f88338618602457f984055da5d8d7", "measured_slow_code": "N = int(input())\nS = input()\nfor s in S:\n ans = chr((ord(s) - ord(\"A\") + N) % 26 + ord(\"A\"))\n print(ans, end=\"\")\n", "measured_slow_code_sha256": "7dc27a09ef2c9b461fbcb4fe978ad658f28d48d6f3e4857cd289415097f687c2", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.616544936709422, "pair_id": "python_v2_dc47a204e8fc7173930cb670", "per_case_slow_code_faster_fraction": 0.12, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02848", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02848_b9b377895112e4c99f6470ef8bdf76c96f8f88338618602457f984055da5d8d7.jsonl.gz", "inputs": "reproduction/python/inputs/p02848.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02848_7dc27a09ef2c9b461fbcb4fe978ad658f28d48d6f3e4857cd289415097f687c2.jsonl.gz"}, "slow_code": "N = int(input())\nS = input()\nfor s in S:\n ans = chr((ord(s) - ord(\"A\") + N) % 26 + ord(\"A\"))\n print(ans, end=\"\")\n", "slow_code_sha256": "7dc27a09ef2c9b461fbcb4fe978ad658f28d48d6f3e4857cd289415097f687c2", "slow_id": "p02848_7dc27a09ef2c9b461fbcb4fe978ad658f28d48d6f3e4857cd289415097f687c2", "speedup": 2.8721973161580467, "stratum": "2-4", "within_pair_jaccard": 0.45, "workload": {"case_count": 100, "description": "Shift every uppercase letter of S forward by N alphabetical positions, wrapping from Z to A, and output the resulting string. Observed inputs: N=0..26 (median 13); S_length=1..10000 (median 10000).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 10004, "median": 10004.0, "min": 4}, "input_format": ["N\nS"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p03719_case_000", "p03719_case_001", "p03719_case_002", "p03719_case_003", "p03719_case_004", "p03719_case_005", "p03719_case_006", "p03719_case_007", "p03719_case_008", "p03719_case_009", "p03719_case_010", "p03719_case_011", "p03719_case_012", "p03719_case_013", "p03719_case_014", "p03719_case_015", "p03719_case_016", "p03719_case_017", "p03719_case_018", "p03719_case_019", "p03719_case_020", "p03719_case_021", "p03719_case_022", "p03719_case_023", "p03719_case_024", "p03719_case_025", "p03719_case_026", "p03719_case_027", "p03719_case_028", "p03719_case_029", "p03719_case_030", "p03719_case_031", "p03719_case_032", "p03719_case_033", "p03719_case_034", "p03719_case_035", "p03719_case_036", "p03719_case_037", "p03719_case_038", "p03719_case_039", "p03719_case_040", "p03719_case_041", "p03719_case_042", "p03719_case_043", "p03719_case_044", "p03719_case_045", "p03719_case_046", "p03719_case_047", "p03719_case_048", "p03719_case_049", "p03719_case_050", "p03719_case_051", "p03719_case_052", "p03719_case_053", "p03719_case_054", "p03719_case_055", "p03719_case_056", "p03719_case_057", "p03719_case_058", "p03719_case_059", "p03719_case_060", "p03719_case_061", "p03719_case_062", "p03719_case_063", "p03719_case_064", "p03719_case_065", "p03719_case_066", "p03719_case_067", "p03719_case_068", "p03719_case_069", "p03719_case_070", "p03719_case_071", "p03719_case_072", "p03719_case_073", "p03719_case_074", "p03719_case_075", "p03719_case_076", "p03719_case_077", "p03719_case_078", "p03719_case_079", "p03719_case_080", "p03719_case_081", "p03719_case_082", "p03719_case_083", "p03719_case_084", "p03719_case_085", "p03719_case_086", "p03719_case_087", "p03719_case_088", "p03719_case_089", "p03719_case_090", "p03719_case_091", "p03719_case_092", "p03719_case_093", "p03719_case_094", "p03719_case_095", "p03719_case_096", "p03719_case_097", "p03719_case_098", "p03719_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\nfrom collections import Counter\n\nsys.setrecursionlimit(10**7)\ninf = 1 << 100\n\n\ndef solve():\n a, b, c = list(map(int, input().split()))\n print((\"Yes\" if a <= c <= b else \"No\"))\n\n\nif __name__ == \"__main__\":\n solve()\n", "fast_code_sha256": "e4568f06d34affbe8f49bff8eab899c2a6324651236175327b224cbfd303fd53", "fast_id": "p03719_e4568f06d34affbe8f49bff8eab899c2a6324651236175327b224cbfd303fd53", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\nfrom collections import Counter\n\nsys.setrecursionlimit(10**7)\ninf = 1 << 100\n\n\ndef solve():\n a, b, c = list(map(int, input().split()))\n print((\"Yes\" if a <= c <= b else \"No\"))\n\n\nif __name__ == \"__main__\":\n solve()\n", "measured_fast_code_sha256": "e4568f06d34affbe8f49bff8eab899c2a6324651236175327b224cbfd303fd53", "measured_slow_code": "import functools\nimport os\nimport sys\n\nsys.setrecursionlimit(10000)\nINF = float(\"inf\")\n\n\ndef inp():\n return int(eval(input()))\n\n\ndef inpf():\n return float(eval(input()))\n\n\ndef inps():\n return eval(input())\n\n\ndef inl():\n return list(map(int, input().split()))\n\n\ndef inlf():\n return list(map(float, input().split()))\n\n\ndef inls():\n return input().split()\n\n\ndef inpm(line):\n return [inp() for _ in range(line)]\n\n\ndef inpfm(line):\n return [inpf() for _ in range(line)]\n\n\ndef inpsm(line):\n return [inps() for _ in range(line)]\n\n\ndef inlm(line):\n return [inl() for _ in range(line)]\n\n\ndef inlfm(line):\n return [inlf() for _ in range(line)]\n\n\ndef inlsm(line):\n return [inls() for _ in range(line)]\n\n\ndef Yesif(cond):\n print((\"Yes\" if cond else \"No\"))\n\n\ndef YESIF(cond):\n print((\"YES\" if cond else \"NO\"))\n\n\ndef yesif(cond):\n print((\"yes\" if cond else \"no\"))\n\n\na, b, c = inl()\nYesif(a <= c <= b)\n", "measured_slow_code_sha256": "0acae026c7e63eed2245b851c8d32eee934659ca23b9e50786cb323f85625345", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4.625540475827609, "pair_id": "python_v2_dfdf8c7df6825dce9943a90d", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03719", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03719_e4568f06d34affbe8f49bff8eab899c2a6324651236175327b224cbfd303fd53.jsonl.gz", "inputs": "reproduction/python/inputs/p03719.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03719_0acae026c7e63eed2245b851c8d32eee934659ca23b9e50786cb323f85625345.jsonl.gz"}, "slow_code": "import functools\nimport os\nimport sys\n\nsys.setrecursionlimit(10000)\nINF = float(\"inf\")\n\n\ndef inp():\n return int(eval(input()))\n\n\ndef inpf():\n return float(eval(input()))\n\n\ndef inps():\n return eval(input())\n\n\ndef inl():\n return list(map(int, input().split()))\n\n\ndef inlf():\n return list(map(float, input().split()))\n\n\ndef inls():\n return input().split()\n\n\ndef inpm(line):\n return [inp() for _ in range(line)]\n\n\ndef inpfm(line):\n return [inpf() for _ in range(line)]\n\n\ndef inpsm(line):\n return [inps() for _ in range(line)]\n\n\ndef inlm(line):\n return [inl() for _ in range(line)]\n\n\ndef inlfm(line):\n return [inlf() for _ in range(line)]\n\n\ndef inlsm(line):\n return [inls() for _ in range(line)]\n\n\ndef Yesif(cond):\n print((\"Yes\" if cond else \"No\"))\n\n\ndef YESIF(cond):\n print((\"YES\" if cond else \"NO\"))\n\n\ndef yesif(cond):\n print((\"yes\" if cond else \"no\"))\n\n\na, b, c = inl()\nYesif(a <= c <= b)\n", "slow_code_sha256": "0acae026c7e63eed2245b851c8d32eee934659ca23b9e50786cb323f85625345", "slow_id": "p03719_0acae026c7e63eed2245b851c8d32eee934659ca23b9e50786cb323f85625345", "speedup": 4.6270630775794, "stratum": "4-8", "within_pair_jaccard": 0.3, "workload": {"case_count": 100, "description": "Determine whether C is at least A and at most B. The supplied bounds A and B need not be ordered. Observed inputs: A=-100..100 (median -2.5); B=-100..100 (median -17); C=-100..100 (median -9).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 14, "median": 10.0, "min": 7}, "input_format": ["A B C"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3, "median": 3.0, "min": 3}}} -{"case_ids": ["p03472_case_000", "p03472_case_001", "p03472_case_002", "p03472_case_003", "p03472_case_004", "p03472_case_005", "p03472_case_006", "p03472_case_007", "p03472_case_008", "p03472_case_009", "p03472_case_010", "p03472_case_011", "p03472_case_012", "p03472_case_013", "p03472_case_014", "p03472_case_015", "p03472_case_016", "p03472_case_017", "p03472_case_018", "p03472_case_019", "p03472_case_020", "p03472_case_021", "p03472_case_022", "p03472_case_023", "p03472_case_024", "p03472_case_025", "p03472_case_026", "p03472_case_027", "p03472_case_028", "p03472_case_029", "p03472_case_030", "p03472_case_031", "p03472_case_032", "p03472_case_033", "p03472_case_034", "p03472_case_035", "p03472_case_036", "p03472_case_037", "p03472_case_038", "p03472_case_039", "p03472_case_040", "p03472_case_041", "p03472_case_042", "p03472_case_043", "p03472_case_044", "p03472_case_045", "p03472_case_046", "p03472_case_047", "p03472_case_048", "p03472_case_049", "p03472_case_050", "p03472_case_051", "p03472_case_052", "p03472_case_053", "p03472_case_054", "p03472_case_055", "p03472_case_056", "p03472_case_057", "p03472_case_058", "p03472_case_059", "p03472_case_060", "p03472_case_061", "p03472_case_062", "p03472_case_063", "p03472_case_064", "p03472_case_065", "p03472_case_066", "p03472_case_068", "p03472_case_069", "p03472_case_070", "p03472_case_071", "p03472_case_072", "p03472_case_073", "p03472_case_075", "p03472_case_076", "p03472_case_077", "p03472_case_078", "p03472_case_079", "p03472_case_080", "p03472_case_081", "p03472_case_082", "p03472_case_083", "p03472_case_084", "p03472_case_085", "p03472_case_086", "p03472_case_087", "p03472_case_088", "p03472_case_089", "p03472_case_090", "p03472_case_091", "p03472_case_092", "p03472_case_093", "p03472_case_094", "p03472_case_095", "p03472_case_096", "p03472_case_097", "p03472_case_098", "p03472_case_099", "p03472_v2_152723b81f3e452934a4", "p03472_v2_8069c44687919d0f2aed"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n, h, *t = list(map(int, open(0).read().split()))\nb = sorted(t[1::2])\na = max(t[::2])\nc = 0\nwhile h > 0 and b and b[-1] > a:\n h -= b.pop()\n c += 1\nif h > 0:\n c -= -h // a\nprint(c)\n", "fast_code_sha256": "02952b5343791f7e9cbf755ebc67676afbd1a59fb0391b64459cf3edf5653a17", "fast_id": "p03472_02952b5343791f7e9cbf755ebc67676afbd1a59fb0391b64459cf3edf5653a17", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n, h, *t = list(map(int, open(0).read().split()))\nb = sorted(t[1::2])\na = max(t[::2])\nc = 0\nwhile h > 0 and b and b[-1] > a:\n h -= b.pop()\n c += 1\nif h > 0:\n c -= -h // a\nprint(c)\n", "measured_fast_code_sha256": "02952b5343791f7e9cbf755ebc67676afbd1a59fb0391b64459cf3edf5653a17", "measured_slow_code": "import sys\nfrom collections import defaultdict, Counter\nfrom itertools import product, groupby, count, permutations, combinations\nfrom math import pi, sqrt, floor\nfrom collections import deque\nfrom bisect import bisect, bisect_left, bisect_right\nfrom string import ascii_lowercase\nfrom functools import lru_cache, reduce\nfrom operator import xor\nfrom heapq import heappush, heappop\n\nINF = float(\"inf\")\nsys.setrecursionlimit(10**7)\n# 4近傍(右, 下, 左, 上)\ndy4, dx4 = [0, -1, 0, 1], [1, 0, -1, 0]\n\n\ndef inside(y: int, x: int, H: int, W: int) -> bool:\n return 0 <= y < H and 0 <= x < W\n\n\ndef ceil(a, b):\n return (a + b - 1) // b\n\n\ndef solve(N, H, a_b):\n max_a = -1\n for a, b in a_b:\n max_a = max(max_a, a)\n good_b = []\n for a, b in a_b:\n if b >= max_a:\n good_b.append(b)\n ans = 0\n for b in sorted(good_b, reverse=True):\n ans += 1\n H -= b\n if H <= 0:\n return ans\n return ans + ceil(H, max_a)\n\n\ndef main():\n N, H = list(map(int, input().split()))\n l = []\n for _ in range(N):\n a, b = list(map(int, input().split()))\n l.append((a, b))\n print((solve(N, H, l)))\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "e6fb53d428c218a9dad43f71415fff4137faea0247973c73ffa368e3f80a96bc", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4.907030294694453, "pair_id": "python_v2_5dcad7df78624eca0fd25784", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03472", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03472_02952b5343791f7e9cbf755ebc67676afbd1a59fb0391b64459cf3edf5653a17.jsonl.gz", "inputs": "reproduction/python/inputs/p03472.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03472_e6fb53d428c218a9dad43f71415fff4137faea0247973c73ffa368e3f80a96bc.jsonl.gz"}, "slow_code": "import sys\nfrom collections import defaultdict, Counter\nfrom itertools import product, groupby, count, permutations, combinations\nfrom math import pi, sqrt, floor\nfrom collections import deque\nfrom bisect import bisect, bisect_left, bisect_right\nfrom string import ascii_lowercase\nfrom functools import lru_cache, reduce\nfrom operator import xor\nfrom heapq import heappush, heappop\n\nINF = float(\"inf\")\nsys.setrecursionlimit(10**7)\n\ndy4, dx4 = [0, -1, 0, 1], [1, 0, -1, 0]\n\n\ndef inside(y: int, x: int, H: int, W: int) -> bool:\n return 0 <= y < H and 0 <= x < W\n\n\ndef ceil(a, b):\n return (a + b - 1) // b\n\n\ndef solve(N, H, a_b):\n max_a = -1\n for a, b in a_b:\n max_a = max(max_a, a)\n good_b = []\n for a, b in a_b:\n if b >= max_a:\n good_b.append(b)\n ans = 0\n for b in sorted(good_b, reverse=True):\n ans += 1\n H -= b\n if H <= 0:\n return ans\n return ans + ceil(H, max_a)\n\n\ndef main():\n N, H = list(map(int, input().split()))\n l = []\n for _ in range(N):\n a, b = list(map(int, input().split()))\n l.append((a, b))\n print((solve(N, H, l)))\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "959a20db4ae0f00d8957b9a1432326d6e5fea394771c477e31dea94e932699eb", "slow_id": "p03472_e6fb53d428c218a9dad43f71415fff4137faea0247973c73ffa368e3f80a96bc", "speedup": 5.691445788504642, "stratum": "4-8", "within_pair_jaccard": 0.14942528735632185, "workload": {"case_count": 100, "description": "Defeat health H using N swords. Wield sword i repeatedly for a_i damage, or throw it once for b_i damage and lose it permanently. Each attack counts once; a_i<=b_i. Minimize attacks to deal at least H total damage. Observed inputs: N=1..100000 (median 1000); H=1..1000000000 (median 500000000); a_i=1..1000000000; b_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 2200018, "median": 19446.5, "min": 8}, "input_format": ["N H\na_1 b_1\n...\na_N b_N"], "input_format_status": "source_input_section", "input_lines": {"max": 100001, "median": 1001.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200002, "median": 2002.0, "min": 4}}} -{"case_ids": ["p02890_case_000", "p02890_case_001", "p02890_case_002", "p02890_case_003", "p02890_case_004", "p02890_case_005", "p02890_case_006", "p02890_case_007", "p02890_case_008", "p02890_case_009", "p02890_case_010", "p02890_case_011", "p02890_case_012", "p02890_case_013", "p02890_case_014", "p02890_case_015", "p02890_case_016", "p02890_case_017", "p02890_case_018", "p02890_case_019", "p02890_case_020", "p02890_case_021", "p02890_case_022", "p02890_case_023", "p02890_case_024", "p02890_case_025", "p02890_case_026", "p02890_case_027", "p02890_case_028", "p02890_case_029", "p02890_case_030", "p02890_case_031", "p02890_case_032", "p02890_case_033", "p02890_case_034", "p02890_case_035", "p02890_case_036", "p02890_case_037", "p02890_case_038", "p02890_case_039", "p02890_case_040", "p02890_case_041", "p02890_case_042", "p02890_case_043", "p02890_case_044", "p02890_case_045", "p02890_case_046", "p02890_case_047", "p02890_case_048", "p02890_case_049", "p02890_case_050", "p02890_case_051", "p02890_case_052", "p02890_case_053", "p02890_case_054", "p02890_case_055", "p02890_case_056", "p02890_case_057", "p02890_case_058", "p02890_case_059", "p02890_case_060", "p02890_case_061", "p02890_case_062", "p02890_case_063", "p02890_case_064", "p02890_case_065", "p02890_case_066", "p02890_case_067", "p02890_case_068", "p02890_case_069", "p02890_case_070", "p02890_case_071", "p02890_case_072", "p02890_case_073", "p02890_case_074", "p02890_case_075", "p02890_case_076", "p02890_case_077", "p02890_case_078", "p02890_case_079", "p02890_case_080", "p02890_case_081", "p02890_case_082", "p02890_case_083", "p02890_case_084", "p02890_case_085", "p02890_case_086", "p02890_case_087", "p02890_case_088", "p02890_case_089", "p02890_case_090", "p02890_case_091", "p02890_case_092", "p02890_case_093", "p02890_case_094", "p02890_case_095", "p02890_case_096", "p02890_case_097", "p02890_case_098", "p02890_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "executable_AST_equal_except_explicit_explanatory_string_removal_and_all_frozen_inputs_checker_pass", "fast_code": "import sys\nimport math\nfrom bisect import bisect_right as br\nfrom bisect import bisect_left as bl\n\nsys.setrecursionlimit(2147483647)\nfrom heapq import heappush, heappop, heappushpop\nfrom collections import defaultdict\nfrom itertools import accumulate\nfrom collections import Counter\nfrom collections import deque\nfrom operator import itemgetter\nfrom itertools import permutations\n\nmod = 10**9 + 7\ninf = float(\"inf\")\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\nn = I()\na = LI()\ncnt = list(Counter(a).values())\nd = [0] * (n + 1)\nfor i in cnt:\n d[i] += 1\nd = list(accumulate(d))\nm = d[-1]\nS = [0] * (n + 1)\nfor i in range(1, n + 1):\n S[i] = S[i - 1] + (m - d[i - 1])\nS2 = [0] * (n + 1)\nfor i in range(1, n + 1):\n S2[i] = S[i] // i\ntmp = n\nfor k in range(1, n + 1):\n while S2[tmp] < k:\n tmp -= 1\n if tmp <= 0:\n print((0))\n break\n else:\n print(tmp)\n", "fast_code_sha256": "d4bfacd7048ccdfc66b383573f450cbdb0fee4f058a5173f25de8ffc19a3a2f7", "fast_id": "p02890_d958a5389d02ce6d4c9289086102f28ac6d39bce99aea035f13eab42153c83ec", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "#!/usr/bin/env python3\nimport sys\nimport math\nfrom bisect import bisect_right as br\nfrom bisect import bisect_left as bl\n\nsys.setrecursionlimit(2147483647)\nfrom heapq import heappush, heappop, heappushpop\nfrom collections import defaultdict\nfrom itertools import accumulate\nfrom collections import Counter\nfrom collections import deque\nfrom operator import itemgetter\nfrom itertools import permutations\n\nmod = 10**9 + 7\ninf = float(\"inf\")\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\n\"\"\"\n.2分探索を考える\n.各kに対してx回以上抜き出せるかという問いを考える\n.各数の個数を数えて数iの個数をCiとする\n.各数iを抜き出せるのはCiまで\n ⇒各数を抜き出す回数min(Ci,x)\n.Σmin(Ci,x)はkx以上でなければいけない(k個x回抜き出すため)\n.これを満たすときx回抜き出せる\n.このままではO(n^2(logn))なので工夫する\n.Σ(min(Ci,x))はk依存でないのでここを工夫する(Σ(min(Ci,x))をSxとする)\n.SxはSx-1と比べてx以上のCiの数だけ増える(x以上のCiの数をDxとする)\n.Sx := Sx-1 + Dx\n.Dxを求める時はCのリストについてbisectを行う。\n⇒Ciの個数のリストdを用意してdの累積和を用意しておくとO(n)\n.Sx >= k*xとなるxの最大値を2分探索で求める。(O(nlogn))\n⇒変形すると,Sx/x >= kであり、各kに対してSx/xは単調減少なのでO(n)\n\"\"\"\nn = I()\na = LI()\ncnt = list(Counter(a).values())\nd = [0] * (n + 1)\nfor i in cnt:\n d[i] += 1\nd = list(accumulate(d))\nm = d[-1]\nS = [0] * (n + 1)\nfor i in range(1, n + 1):\n S[i] = S[i - 1] + (m - d[i - 1])\nS2 = [0] * (n + 1)\nfor i in range(1, n + 1):\n S2[i] = S[i] // i\ntmp = n\nfor k in range(1, n + 1):\n while S2[tmp] < k:\n tmp -= 1\n if tmp <= 0:\n print((0))\n break\n else:\n print(tmp)\n", "measured_fast_code_sha256": "d958a5389d02ce6d4c9289086102f28ac6d39bce99aea035f13eab42153c83ec", "measured_slow_code": "#!/usr/bin/env python3\nimport sys\nimport math\nfrom bisect import bisect_right as br\nfrom bisect import bisect_left as bl\n\nsys.setrecursionlimit(2147483647)\nfrom heapq import heappush, heappop, heappushpop\nfrom collections import defaultdict\nfrom itertools import accumulate\nfrom collections import Counter\nfrom collections import deque\nfrom operator import itemgetter\nfrom itertools import permutations\n\nmod = 10**9 + 7\ninf = float(\"inf\")\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\n\"\"\"\n.2分探索を考える\n.各kに対してx回以上抜き出せるかという問いを考える\n.各数の個数を数えて数iの個数をCiとする\n.各数iを抜き出せるのはCiまで\n ⇒各数を抜き出す回数min(Ci,x)\n.Σmin(Ci,x)はkx以上でなければいけない(k個x回抜き出すため)\n.これを満たすときx回抜き出せる\n.このままではO(n^2(logn))なので工夫する\n.Σ(min(Ci,x))はk依存でないのでここを工夫する(Σ(min(Ci,x))をSxとする)\n.SxはSx-1と比べてx以上のCiの数だけ増える(x以上のCiの数をDxとする)\n.Sx := Sx-1 + Dx\n.Dxを求める時はCのリストについてbisectを行う。\n.Sx >= k*xとなるxの最大値を2分探索で求める。(O(nlogn))\n\"\"\"\nn = I()\na = LI()\ncnt = list(Counter(a).values())\ncnt.sort()\nm = len(cnt)\nS = [0] * (n + 1)\nfor x in range(1, n + 1):\n l = bl(cnt, x)\n S[x] = S[x - 1] + (m - l)\nfor k in range(1, n + 1):\n high, low = n + 1, 0\n while high - low > 1:\n mid = (high + low) // 2\n if S[mid] >= k * mid:\n low = mid\n else:\n high = mid\n print(low)\n", "measured_slow_code_sha256": "683b16708a4919fe826584e325a20783d2265d979233683a19a27263211ea906", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4.44734775412458, "pair_id": "python_v2_3c1ed882f2552985e726e24e", "per_case_slow_code_faster_fraction": 0.16, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02890", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02890_d958a5389d02ce6d4c9289086102f28ac6d39bce99aea035f13eab42153c83ec.jsonl.gz", "inputs": "reproduction/python/inputs/p02890.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02890_683b16708a4919fe826584e325a20783d2265d979233683a19a27263211ea906.jsonl.gz"}, "slow_code": "import sys\nimport math\nfrom bisect import bisect_right as br\nfrom bisect import bisect_left as bl\n\nsys.setrecursionlimit(2147483647)\nfrom heapq import heappush, heappop, heappushpop\nfrom collections import defaultdict\nfrom itertools import accumulate\nfrom collections import Counter\nfrom collections import deque\nfrom operator import itemgetter\nfrom itertools import permutations\n\nmod = 10**9 + 7\ninf = float(\"inf\")\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\nn = I()\na = LI()\ncnt = list(Counter(a).values())\ncnt.sort()\nm = len(cnt)\nS = [0] * (n + 1)\nfor x in range(1, n + 1):\n l = bl(cnt, x)\n S[x] = S[x - 1] + (m - l)\nfor k in range(1, n + 1):\n high, low = n + 1, 0\n while high - low > 1:\n mid = (high + low) // 2\n if S[mid] >= k * mid:\n low = mid\n else:\n high = mid\n print(low)\n", "slow_code_sha256": "2c57f5c3d6e04ae779c203c63a7a33316889e85db23460b3b699e27933e99fbd", "slow_id": "p02890_683b16708a4919fe826584e325a20783d2265d979233683a19a27263211ea906", "speedup": 3.383595702801351, "stratum": "2-4", "within_pair_jaccard": 0.8415841584158416, "workload": {"case_count": 100, "description": "For each K=1..N, find the maximum number of disjoint groups of exactly K cards that can be removed, requiring all values within each group to differ. The same N-card multiset is considered independently for every K. Observed inputs: N=1..300000 (median 100000); A_i=1..300000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 2100007, "median": 238900.5, "min": 4}, "input_format": ["N\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 300001, "median": 100001.0, "min": 2}}} -{"case_ids": ["p03455_case_000", "p03455_case_001", "p03455_case_002", "p03455_case_003", "p03455_case_004", "p03455_case_005", "p03455_case_006", "p03455_case_007", "p03455_case_008", "p03455_case_009", "p03455_case_010", "p03455_case_011", "p03455_case_012", "p03455_case_013", "p03455_case_014", "p03455_case_015", "p03455_case_016", "p03455_case_017", "p03455_case_018", "p03455_case_019", "p03455_case_020", "p03455_case_021", "p03455_case_022", "p03455_case_023", "p03455_case_024", "p03455_case_025", "p03455_case_026", "p03455_case_027", "p03455_case_028", "p03455_case_029", "p03455_case_030", "p03455_case_031", "p03455_case_032", "p03455_case_033", "p03455_case_034", "p03455_case_035", "p03455_case_036", "p03455_case_037", "p03455_case_038", "p03455_case_039", "p03455_case_040", "p03455_case_041", "p03455_case_042", "p03455_case_043", "p03455_case_044", "p03455_case_045", "p03455_case_046", "p03455_case_047", "p03455_case_048", "p03455_case_049", "p03455_case_050", "p03455_case_051", "p03455_case_052", "p03455_case_053", "p03455_case_054", "p03455_case_055", "p03455_case_056", "p03455_case_057", "p03455_case_058", "p03455_case_059", "p03455_case_060", "p03455_case_061", "p03455_case_062", "p03455_case_063", "p03455_case_064", "p03455_case_065", "p03455_case_066", "p03455_case_067", "p03455_case_068", "p03455_case_069", "p03455_case_070", "p03455_case_071", "p03455_case_072", "p03455_case_073", "p03455_case_074", "p03455_case_075", "p03455_case_076", "p03455_case_077", "p03455_case_078", "p03455_case_079", "p03455_case_080", "p03455_case_081", "p03455_case_082", "p03455_case_083", "p03455_case_084", "p03455_case_085", "p03455_case_086", "p03455_case_087", "p03455_case_088", "p03455_case_089", "p03455_case_090", "p03455_case_091", "p03455_case_092", "p03455_case_093", "p03455_case_094", "p03455_case_095", "p03455_case_096", "p03455_case_097", "p03455_case_098", "p03455_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "a, b = list(map(int, input().split()))\nprint((\"EOvdedn\"[a * b % 2 :: 2]))\n", "fast_code_sha256": "013bd4927b63ad8310a8bbd0f90b8d032b0bfd8e03cc0243efe0100c008f1093", "fast_id": "p03455_013bd4927b63ad8310a8bbd0f90b8d032b0bfd8e03cc0243efe0100c008f1093", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "a, b = list(map(int, input().split()))\nprint((\"EOvdedn\"[a * b % 2 :: 2]))\n", "measured_fast_code_sha256": "013bd4927b63ad8310a8bbd0f90b8d032b0bfd8e03cc0243efe0100c008f1093", "measured_slow_code": "def ketanowa(p):\n ans = 0\n p = str(p)\n for i in p:\n ans += int(i)\n return ans\n\n\ndef main():\n temp = input().split(\" \")\n n = int(temp[0])\n a = int(temp[1])\n if n * a % 2 == 0:\n print(\"Even\")\n else:\n print(\"Odd\")\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "1e58957cce6049d366f3189df1c6244aa3226734d9f71da11d6221cbf487aae2", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.603430705341861, "pair_id": "python_v2_94970381b8715b7d6a081186", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03455", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03455_013bd4927b63ad8310a8bbd0f90b8d032b0bfd8e03cc0243efe0100c008f1093.jsonl.gz", "inputs": "reproduction/python/inputs/p03455.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03455_1e58957cce6049d366f3189df1c6244aa3226734d9f71da11d6221cbf487aae2.jsonl.gz"}, "slow_code": "def ketanowa(p):\n ans = 0\n p = str(p)\n for i in p:\n ans += int(i)\n return ans\n\n\ndef main():\n temp = input().split(\" \")\n n = int(temp[0])\n a = int(temp[1])\n if n * a % 2 == 0:\n print(\"Even\")\n else:\n print(\"Odd\")\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "1e58957cce6049d366f3189df1c6244aa3226734d9f71da11d6221cbf487aae2", "slow_id": "p03455_1e58957cce6049d366f3189df1c6244aa3226734d9f71da11d6221cbf487aae2", "speedup": 2.601176246007368, "stratum": "2-4", "within_pair_jaccard": 0.2, "workload": {"case_count": 100, "description": "Determine whether the product of two supplied positive integers a and b is odd or even. Observed inputs: a=1..10000 (median 7119); b=1..10000 (median 5506.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 12, "median": 10.0, "min": 4}, "input_format": ["a b"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p02716_case_000", "p02716_case_001", "p02716_case_002", "p02716_case_003", "p02716_case_004", "p02716_case_005", "p02716_case_006", "p02716_case_007", "p02716_case_008", "p02716_case_009", "p02716_case_010", "p02716_case_011", "p02716_case_012", "p02716_case_013", "p02716_case_014", "p02716_case_015", "p02716_case_016", "p02716_case_017", "p02716_case_018", "p02716_case_019", "p02716_case_020", "p02716_case_021", "p02716_case_022", "p02716_case_023", "p02716_case_024", "p02716_case_025", "p02716_case_026", "p02716_case_027", "p02716_case_028", "p02716_case_029", "p02716_case_030", "p02716_case_031", "p02716_case_032", "p02716_case_033", "p02716_case_034", "p02716_case_035", "p02716_case_036", "p02716_case_037", "p02716_case_038", "p02716_case_039", "p02716_case_040", "p02716_case_041", "p02716_case_042", "p02716_case_043", "p02716_case_044", "p02716_case_045", "p02716_case_046", "p02716_case_047", "p02716_case_048", "p02716_case_049", "p02716_case_050", "p02716_case_051", "p02716_case_052", "p02716_case_053", "p02716_case_054", "p02716_case_055", "p02716_case_056", "p02716_case_057", "p02716_case_058", "p02716_case_059", "p02716_case_060", "p02716_case_061", "p02716_case_062", "p02716_case_063", "p02716_case_064", "p02716_case_065", "p02716_case_066", "p02716_case_067", "p02716_case_068", "p02716_case_069", "p02716_case_070", "p02716_case_071", "p02716_case_072", "p02716_case_073", "p02716_case_074", "p02716_case_075", "p02716_case_076", "p02716_case_077", "p02716_case_078", "p02716_case_079", "p02716_case_080", "p02716_case_081", "p02716_case_082", "p02716_case_083", "p02716_case_084", "p02716_case_085", "p02716_case_086", "p02716_case_087", "p02716_case_088", "p02716_case_089", "p02716_case_090", "p02716_case_091", "p02716_case_092", "p02716_case_093", "p02716_case_094", "p02716_case_095", "p02716_case_096", "p02716_case_097", "p02716_case_098", "p02716_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\nl = list(map(int, input().split()))\np = [0] * n\nd = [0] * n\nfor i in range(n):\n p[i] = l[i] + (p[i - 2] if i > 1 else 0)\nfor i in range(1, n):\n d[i] = p[i - 1] if (i & 1) else d[i - 1]\n d[i] = max(d[i], l[i] + (d[i - 2] if i > 1 else 0))\nprint((d[-1]))\n", "fast_code_sha256": "c99433f04c3933fd58c56652be6a5c57fad46a0fbea959f404c4dff1c8007131", "fast_id": "p02716_c99433f04c3933fd58c56652be6a5c57fad46a0fbea959f404c4dff1c8007131", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\nl = list(map(int, input().split()))\np = [0] * n\nd = [0] * n\nfor i in range(n):\n p[i] = l[i] + (p[i - 2] if i > 1 else 0)\nfor i in range(1, n):\n d[i] = p[i - 1] if (i & 1) else d[i - 1]\n d[i] = max(d[i], l[i] + (d[i - 2] if i > 1 else 0))\nprint((d[-1]))\n", "measured_fast_code_sha256": "c99433f04c3933fd58c56652be6a5c57fad46a0fbea959f404c4dff1c8007131", "measured_slow_code": "C = -(10**15 + 7)\n\n\ndef main():\n from collections import defaultdict\n\n N = int(eval(input()))\n K = N // 2\n A = [int(i) for i in input().split()]\n dp = defaultdict(lambda: C)\n for i in range(N + 1):\n dp[i, 0] = 0\n if i != 0:\n dp[(i, 1)] = max(dp[i - 1, 1], A[i - 1])\n for i in range(2, N + 1):\n for j in range(i // 2 - 1, (i + 1) // 2 + 1):\n if j < 0:\n continue\n # A_i(1-index)でj個選ばなければいけない\n dp[i, j] = max(\n dp[i, j],\n dp[i - 2, j - 1] + A[i - 1],\n dp[i - 3, j - 1] + A[i - 1],\n dp[i - 4, j - 1] + A[i - 1],\n )\n print((max(dp[N, K], dp[N - 1, K], dp[N - 2, K])))\n # for i in range(N+1):\n # for j in range(K+1):\n # print(\"{:>4}\".format(dp[i, j] if dp[i, j] != C else \"C\"),\n # end=\" \" if j != K else \"\\n\")\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "e0091a9b9deccd6ac161e28fc03ef99b2dfd2dba84ead05783e45d658cc28bd0", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.1976550375218675, "pair_id": "python_v2_ef843a597d89806e7d7bdc6f", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02716", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02716_c99433f04c3933fd58c56652be6a5c57fad46a0fbea959f404c4dff1c8007131.jsonl.gz", "inputs": "reproduction/python/inputs/p02716.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02716_e0091a9b9deccd6ac161e28fc03ef99b2dfd2dba84ead05783e45d658cc28bd0.jsonl.gz"}, "slow_code": "C = -(10**15 + 7)\n\n\ndef main():\n from collections import defaultdict\n\n N = int(eval(input()))\n K = N // 2\n A = [int(i) for i in input().split()]\n dp = defaultdict(lambda: C)\n for i in range(N + 1):\n dp[i, 0] = 0\n if i != 0:\n dp[(i, 1)] = max(dp[i - 1, 1], A[i - 1])\n for i in range(2, N + 1):\n for j in range(i // 2 - 1, (i + 1) // 2 + 1):\n if j < 0:\n continue\n\n dp[i, j] = max(\n dp[i, j],\n dp[i - 2, j - 1] + A[i - 1],\n dp[i - 3, j - 1] + A[i - 1],\n dp[i - 4, j - 1] + A[i - 1],\n )\n print((max(dp[N, K], dp[N - 1, K], dp[N - 2, K])))\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "df39c3ce8c4ff15d3390419aee36b903bfab2cef5b1f71f30ea85ada047502b8", "slow_id": "p02716_e0091a9b9deccd6ac161e28fc03ef99b2dfd2dba84ead05783e45d658cc28bd0", "speedup": 3.0513951513228883, "stratum": "2-4", "within_pair_jaccard": 0.3333333333333333, "workload": {"case_count": 100, "description": "Choose exactly floor(N/2) entries from an integer array, with no two chosen positions adjacent, to maximize their sum. Values may be negative. Observed inputs: N=2..200000 (median 100); A_i=-1000000000..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 2400007, "median": 1046.5, "min": 10}, "input_format": ["N\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200001, "median": 101.0, "min": 3}}} -{"case_ids": ["p03558_case_000", "p03558_case_001", "p03558_case_002", "p03558_case_003", "p03558_case_004", "p03558_case_005", "p03558_case_006", "p03558_case_007", "p03558_case_008", "p03558_case_009", "p03558_case_010", "p03558_case_011", "p03558_case_012", "p03558_case_013", "p03558_case_014", "p03558_case_015", "p03558_case_016", "p03558_case_017", "p03558_case_018", "p03558_case_019", "p03558_case_020", "p03558_case_021", "p03558_case_022", "p03558_case_023", "p03558_case_024", "p03558_case_025", "p03558_case_026", "p03558_case_027", "p03558_case_028", "p03558_case_029", "p03558_case_030", "p03558_case_031", "p03558_case_032", "p03558_case_033", "p03558_case_034", "p03558_case_035", "p03558_case_036", "p03558_case_037", "p03558_case_038", "p03558_case_039", "p03558_case_040", "p03558_case_041", "p03558_case_042", "p03558_case_043", "p03558_case_044", "p03558_case_045", "p03558_case_046", "p03558_case_047", "p03558_case_048", "p03558_case_049", "p03558_case_050", "p03558_case_051", "p03558_case_052", "p03558_case_053", "p03558_case_054", "p03558_case_055", "p03558_case_056", "p03558_case_057", "p03558_case_058", "p03558_case_059", "p03558_case_060", "p03558_case_061", "p03558_case_062", "p03558_case_063", "p03558_case_064", "p03558_case_065", "p03558_case_066", "p03558_case_067", "p03558_case_068", "p03558_case_069", "p03558_case_070", "p03558_case_071", "p03558_case_072", "p03558_case_073", "p03558_case_074", "p03558_case_075", "p03558_case_076", "p03558_case_077", "p03558_case_078", "p03558_case_079", "p03558_case_080", "p03558_case_081", "p03558_case_082", "p03558_case_083", "p03558_case_084", "p03558_case_085", "p03558_case_086", "p03558_case_087", "p03558_case_088", "p03558_case_089", "p03558_case_090", "p03558_case_091", "p03558_case_092", "p03558_case_093", "p03558_case_094", "p03558_case_095", "p03558_case_096", "p03558_case_097", "p03558_case_098", "p03558_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def solve(K):\n checked = [False] * K\n\n def calc(x):\n while not checked[x]:\n checked[x] = True\n yield x\n x = (x * 10) % K\n\n i = 0\n xs = [0]\n while 1:\n i += 1\n ys = []\n for x in xs:\n for z in calc((x + 1) % K):\n if z == 0:\n return i\n ys.append(z)\n xs = ys\n\n\nK = int(eval(input()))\nprint((solve(K)))\n", "fast_code_sha256": "df78678cc468f931c4deecedae5654556a3e34626187f1eb870d9dc288d371ff", "fast_id": "p03558_df78678cc468f931c4deecedae5654556a3e34626187f1eb870d9dc288d371ff", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def solve(K):\n checked = [False] * K\n\n def calc(x):\n while not checked[x]:\n checked[x] = True\n yield x\n x = (x * 10) % K\n\n i = 0\n xs = [0]\n while 1:\n i += 1\n ys = []\n for x in xs:\n for z in calc((x + 1) % K):\n if z == 0:\n return i\n ys.append(z)\n xs = ys\n\n\nK = int(eval(input()))\nprint((solve(K)))\n", "measured_fast_code_sha256": "df78678cc468f931c4deecedae5654556a3e34626187f1eb870d9dc288d371ff", "measured_slow_code": "import sys\n\nINF = 1 << 60\nMOD = 10**9 + 7 # 998244353\nsys.setrecursionlimit(2147483647)\ninput = lambda: sys.stdin.readline().rstrip()\n\n\ndef resolve():\n k = int(eval(input()))\n dist = [INF] * k\n dist[1] = 1\n queue = [1]\n for v in queue:\n tmp = [v]\n for v in tmp:\n if dist[10 * v % k] > dist[v]:\n dist[10 * v % k] = dist[v]\n tmp.append(10 * v % k)\n if dist[(v + 1) % k] > dist[v] + 1:\n dist[(v + 1) % k] = dist[v] + 1\n queue.append((v + 1) % k)\n print((dist[0]))\n\n\nresolve()\n", "measured_slow_code_sha256": "ee9515bb59f3ea352b6743bf182a443ee7d47b5d0c5c4f7b80ebba756d0ef1b8", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.2204213300535067, "pair_id": "python_v2_e8f40f43f6062b148270746b", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03558", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03558_df78678cc468f931c4deecedae5654556a3e34626187f1eb870d9dc288d371ff.jsonl.gz", "inputs": "reproduction/python/inputs/p03558.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03558_ee9515bb59f3ea352b6743bf182a443ee7d47b5d0c5c4f7b80ebba756d0ef1b8.jsonl.gz"}, "slow_code": "import sys\n\nINF = 1 << 60\nMOD = 10**9 + 7\nsys.setrecursionlimit(2147483647)\ninput = lambda: sys.stdin.readline().rstrip()\n\n\ndef resolve():\n k = int(eval(input()))\n dist = [INF] * k\n dist[1] = 1\n queue = [1]\n for v in queue:\n tmp = [v]\n for v in tmp:\n if dist[10 * v % k] > dist[v]:\n dist[10 * v % k] = dist[v]\n tmp.append(10 * v % k)\n if dist[(v + 1) % k] > dist[v] + 1:\n dist[(v + 1) % k] = dist[v] + 1\n queue.append((v + 1) % k)\n print((dist[0]))\n\n\nresolve()\n", "slow_code_sha256": "3ecd4f0095332ca71fa16ab329abd81020c5ec80d28916f50a4ac56390039e02", "slow_id": "p03558_ee9515bb59f3ea352b6743bf182a443ee7d47b5d0c5c4f7b80ebba756d0ef1b8", "speedup": 3.342733281825936, "stratum": "2-4", "within_pair_jaccard": 0.2608695652173913, "workload": {"case_count": 100, "description": "Find the smallest decimal digit sum among all positive integer multiples of K. Observed inputs: K=2..100000 (median 10205.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 7, "median": 5.5, "min": 2}, "input_format": ["K"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p02716_case_000", "p02716_case_001", "p02716_case_002", "p02716_case_003", "p02716_case_004", "p02716_case_005", "p02716_case_006", "p02716_case_007", "p02716_case_008", "p02716_case_009", "p02716_case_010", "p02716_case_011", "p02716_case_012", "p02716_case_013", "p02716_case_014", "p02716_case_015", "p02716_case_016", "p02716_case_017", "p02716_case_018", "p02716_case_019", "p02716_case_020", "p02716_case_021", "p02716_case_022", "p02716_case_023", "p02716_case_024", "p02716_case_025", "p02716_case_026", "p02716_case_027", "p02716_case_028", "p02716_case_029", "p02716_case_030", "p02716_case_031", "p02716_case_032", "p02716_case_033", "p02716_case_034", "p02716_case_035", "p02716_case_036", "p02716_case_037", "p02716_case_038", "p02716_case_039", "p02716_case_040", "p02716_case_041", "p02716_case_042", "p02716_case_043", "p02716_case_044", "p02716_case_045", "p02716_case_046", "p02716_case_047", "p02716_case_048", "p02716_case_049", "p02716_case_050", "p02716_case_051", "p02716_case_052", "p02716_case_053", "p02716_case_054", "p02716_case_055", "p02716_case_056", "p02716_case_057", "p02716_case_058", "p02716_case_059", "p02716_case_060", "p02716_case_061", "p02716_case_062", "p02716_case_063", "p02716_case_064", "p02716_case_065", "p02716_case_066", "p02716_case_067", "p02716_case_068", "p02716_case_069", "p02716_case_070", "p02716_case_071", "p02716_case_072", "p02716_case_073", "p02716_case_074", "p02716_case_075", "p02716_case_076", "p02716_case_077", "p02716_case_078", "p02716_case_079", "p02716_case_080", "p02716_case_081", "p02716_case_082", "p02716_case_083", "p02716_case_084", "p02716_case_085", "p02716_case_086", "p02716_case_087", "p02716_case_088", "p02716_case_089", "p02716_case_090", "p02716_case_091", "p02716_case_092", "p02716_case_093", "p02716_case_094", "p02716_case_095", "p02716_case_096", "p02716_case_097", "p02716_case_098", "p02716_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\na = list(map(int, input().split()))\ndp = [0 for i in range(3)]\nfor i in range(1, n + 1):\n ai = a[i - 1]\n if i % 2:\n dp[1] = max(dp[0], dp[1])\n dp[0] += ai\n if i % 2 == 0:\n dp[2] = max(dp[1], dp[2])\n dp[1] += ai\n if i >= 3 and i % 2:\n dp[2] += ai\nif n % 2 == 0:\n print((max(dp[0], dp[1])))\nelse:\n print((max(dp[1], dp[2])))\n", "fast_code_sha256": "6a3cdcd9f3583b074d03ea7703d2aae34a281b10dd49ae86774466be09719b14", "fast_id": "p02716_6a3cdcd9f3583b074d03ea7703d2aae34a281b10dd49ae86774466be09719b14", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\na = list(map(int, input().split()))\ndp = [0 for i in range(3)]\nfor i in range(1, n + 1):\n ai = a[i - 1]\n if i % 2:\n dp[1] = max(dp[0], dp[1])\n dp[0] += ai\n if i % 2 == 0:\n dp[2] = max(dp[1], dp[2])\n dp[1] += ai\n if i >= 3 and i % 2:\n dp[2] += ai\nif n % 2 == 0:\n print((max(dp[0], dp[1])))\nelse:\n print((max(dp[1], dp[2])))\n", "measured_fast_code_sha256": "6a3cdcd9f3583b074d03ea7703d2aae34a281b10dd49ae86774466be09719b14", "measured_slow_code": "C = -(10**15 + 7)\n\n\ndef main():\n from collections import defaultdict\n\n N = int(eval(input()))\n K = N // 2\n A = [int(i) for i in input().split()]\n dp = defaultdict(lambda: C)\n for i in range(N + 1):\n dp[i, 0] = 0\n if i != 0:\n dp[(i, 1)] = max(dp[i - 1, 1], A[i - 1])\n for i in range(2, N + 1):\n for j in range(i // 2 - 1, (i + 1) // 2 + 1):\n if j < 0:\n continue\n # A_i(1-index)でj個選ばなければいけない\n dp[i, j] = max(\n dp[i, j],\n dp[i - 2, j - 1] + A[i - 1],\n dp[i - 3, j - 1] + A[i - 1],\n dp[i - 4, j - 1] + A[i - 1],\n )\n print((max(dp[N, K], dp[N - 1, K], dp[N - 2, K])))\n # for i in range(N+1):\n # for j in range(K+1):\n # print(\"{:>4}\".format(dp[i, j] if dp[i, j] != C else \"C\"),\n # end=\" \" if j != K else \"\\n\")\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "e0091a9b9deccd6ac161e28fc03ef99b2dfd2dba84ead05783e45d658cc28bd0", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.056728863631884, "pair_id": "python_v2_54b9dd3f1c8caf227dc15d7c", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02716", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02716_6a3cdcd9f3583b074d03ea7703d2aae34a281b10dd49ae86774466be09719b14.jsonl.gz", "inputs": "reproduction/python/inputs/p02716.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02716_e0091a9b9deccd6ac161e28fc03ef99b2dfd2dba84ead05783e45d658cc28bd0.jsonl.gz"}, "slow_code": "C = -(10**15 + 7)\n\n\ndef main():\n from collections import defaultdict\n\n N = int(eval(input()))\n K = N // 2\n A = [int(i) for i in input().split()]\n dp = defaultdict(lambda: C)\n for i in range(N + 1):\n dp[i, 0] = 0\n if i != 0:\n dp[(i, 1)] = max(dp[i - 1, 1], A[i - 1])\n for i in range(2, N + 1):\n for j in range(i // 2 - 1, (i + 1) // 2 + 1):\n if j < 0:\n continue\n\n dp[i, j] = max(\n dp[i, j],\n dp[i - 2, j - 1] + A[i - 1],\n dp[i - 3, j - 1] + A[i - 1],\n dp[i - 4, j - 1] + A[i - 1],\n )\n print((max(dp[N, K], dp[N - 1, K], dp[N - 2, K])))\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "df39c3ce8c4ff15d3390419aee36b903bfab2cef5b1f71f30ea85ada047502b8", "slow_id": "p02716_e0091a9b9deccd6ac161e28fc03ef99b2dfd2dba84ead05783e45d658cc28bd0", "speedup": 3.004517926306213, "stratum": "2-4", "within_pair_jaccard": 0.38095238095238093, "workload": {"case_count": 100, "description": "Choose exactly floor(N/2) entries from an integer array, with no two chosen positions adjacent, to maximize their sum. Values may be negative. Observed inputs: N=2..200000 (median 100); A_i=-1000000000..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 2400007, "median": 1046.5, "min": 10}, "input_format": ["N\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200001, "median": 101.0, "min": 3}}} -{"case_ids": ["p03636_case_000", "p03636_case_001", "p03636_case_002", "p03636_case_003", "p03636_case_004", "p03636_case_005", "p03636_case_006", "p03636_case_007", "p03636_case_008", "p03636_case_009", "p03636_case_010", "p03636_case_011", "p03636_case_012", "p03636_case_013", "p03636_case_014", "p03636_case_015", "p03636_case_016", "p03636_case_017", "p03636_case_018", "p03636_case_019", "p03636_case_020", "p03636_case_021", "p03636_case_022", "p03636_case_023", "p03636_case_024", "p03636_case_025", "p03636_case_026", "p03636_case_027", "p03636_case_028", "p03636_case_029", "p03636_case_030", "p03636_case_031", "p03636_case_032", "p03636_case_033", "p03636_case_034", "p03636_case_035", "p03636_case_036", "p03636_case_037", "p03636_case_038", "p03636_case_039", "p03636_case_040", "p03636_case_041", "p03636_case_042", "p03636_case_043", "p03636_case_044", "p03636_case_045", "p03636_case_046", "p03636_case_047", "p03636_case_048", "p03636_case_049", "p03636_case_050", "p03636_case_051", "p03636_case_052", "p03636_case_053", "p03636_case_054", "p03636_case_055", "p03636_case_056", "p03636_case_057", "p03636_case_058", "p03636_case_059", "p03636_case_060", "p03636_case_061", "p03636_case_062", "p03636_case_063", "p03636_case_064", "p03636_case_065", "p03636_case_066", "p03636_case_067", "p03636_case_068", "p03636_case_069", "p03636_case_070", "p03636_case_071", "p03636_case_072", "p03636_case_073", "p03636_case_074", "p03636_case_075", "p03636_case_076", "p03636_case_077", "p03636_case_078", "p03636_case_079", "p03636_case_080", "p03636_case_081", "p03636_case_082", "p03636_case_083", "p03636_case_084", "p03636_case_085", "p03636_case_086", "p03636_case_087", "p03636_case_088", "p03636_case_089", "p03636_case_090", "p03636_case_091", "p03636_case_092", "p03636_case_093", "p03636_case_094", "p03636_case_095", "p03636_case_096", "p03636_case_097", "p03636_case_098", "p03636_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\n\ndef LS2():\n return list(sys.stdin.readline().rstrip())\n\n\ns = LS2()\nprint((s[0] + str(len(s) - 2) + s[-1]))\n", "fast_code_sha256": "47a30a0977dd298e960bee922b0a4f2ce31ef23466de0e7327d84731c6a7007f", "fast_id": "p03636_a8f2beff358e4b1aab7c9afc72df19f07878ce91898a6b68d012c7f6fbaa111d", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\n\ndef LS2():\n return list(sys.stdin.readline().rstrip()) # 空白なし\n\n\ns = LS2()\nprint((s[0] + str(len(s) - 2) + s[-1]))\n", "measured_fast_code_sha256": "a8f2beff358e4b1aab7c9afc72df19f07878ce91898a6b68d012c7f6fbaa111d", "measured_slow_code": "import sys\n\nsys.setrecursionlimit(10**7)\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().rstrip().split())) # 空白あり\n\n\ndef LI2():\n return list(map(int, sys.stdin.readline().rstrip())) # 空白なし\n\n\ndef S():\n return sys.stdin.readline().rstrip()\n\n\ndef LS():\n return list(sys.stdin.readline().rstrip().split()) # 空白あり\n\n\ndef LS2():\n return list(sys.stdin.readline().rstrip()) # 空白なし\n\n\ns = LS2()\nprint((s[0] + str(len(s) - 2) + s[-1]))\n", "measured_slow_code_sha256": "5494f91b3cea4c891c6cbf71fe983d4d33ab7f0ec16a1291db2cdbe427651f21", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.978642618585477, "pair_id": "python_v2_44fbcf064181bafcaee8eaec", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03636", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03636_a8f2beff358e4b1aab7c9afc72df19f07878ce91898a6b68d012c7f6fbaa111d.jsonl.gz", "inputs": "reproduction/python/inputs/p03636.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03636_5494f91b3cea4c891c6cbf71fe983d4d33ab7f0ec16a1291db2cdbe427651f21.jsonl.gz"}, "slow_code": "import sys\n\nsys.setrecursionlimit(10**7)\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef LI2():\n return list(map(int, sys.stdin.readline().rstrip()))\n\n\ndef S():\n return sys.stdin.readline().rstrip()\n\n\ndef LS():\n return list(sys.stdin.readline().rstrip().split())\n\n\ndef LS2():\n return list(sys.stdin.readline().rstrip())\n\n\ns = LS2()\nprint((s[0] + str(len(s) - 2) + s[-1]))\n", "slow_code_sha256": "da6dc96aa5d834038d28d109d605a384e0fe4a59a283760b08b599d7fd1f90de", "slow_id": "p03636_5494f91b3cea4c891c6cbf71fe983d4d33ab7f0ec16a1291db2cdbe427651f21", "speedup": 2.9756418090264662, "stratum": "2-4", "within_pair_jaccard": 0.5925925925925926, "workload": {"case_count": 100, "description": "Abbreviate a lowercase word s as its first letter, the number of letters between the first and last, and its last letter. Observed inputs: s_length=3..100 (median 50).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 101, "median": 51.0, "min": 4}, "input_format": ["s"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p00053_case_000", "p00053_case_001", "p00053_case_002", "p00053_case_003", "p00053_case_004", "p00053_case_005", "p00053_case_006", "p00053_case_007", "p00053_case_008", "p00053_case_009", "p00053_case_010", "p00053_case_011", "p00053_case_012", "p00053_case_013", "p00053_case_014", "p00053_case_015", "p00053_case_016", "p00053_case_017", "p00053_case_018", "p00053_case_019", "p00053_case_020", "p00053_case_021", "p00053_case_022", "p00053_case_023", "p00053_case_024", "p00053_case_025", "p00053_case_026", "p00053_case_027", "p00053_case_028", "p00053_case_029", "p00053_case_030", "p00053_case_031", "p00053_case_032", "p00053_case_033", "p00053_case_034", "p00053_case_035", "p00053_case_036", "p00053_case_037", "p00053_case_038", "p00053_case_039", "p00053_case_040", "p00053_case_041", "p00053_case_042", "p00053_case_043", "p00053_case_044", "p00053_case_045", "p00053_case_046", "p00053_case_047", "p00053_case_048", "p00053_case_049", "p00053_case_050", "p00053_case_051", "p00053_case_052", "p00053_case_053", "p00053_case_054", "p00053_case_055", "p00053_case_056", "p00053_case_057", "p00053_case_058", "p00053_case_059", "p00053_case_060", "p00053_case_061", "p00053_case_062", "p00053_case_063", "p00053_case_064", "p00053_case_065", "p00053_case_066", "p00053_case_067", "p00053_case_068", "p00053_case_069", "p00053_case_070", "p00053_case_071", "p00053_case_072", "p00053_case_073", "p00053_case_074", "p00053_case_075", "p00053_case_076", "p00053_case_077", "p00053_case_078", "p00053_case_079", "p00053_case_080", "p00053_case_081", "p00053_case_082", "p00053_case_083", "p00053_case_084", "p00053_case_085", "p00053_case_086", "p00053_case_087", "p00053_case_088", "p00053_case_089", "p00053_case_090", "p00053_case_091", "p00053_case_092", "p00053_case_093", "p00053_case_094", "p00053_case_095", "p00053_case_096", "p00053_case_097", "p00053_case_098", "p00053_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "s = [0]\nM = 104850\np = [1] * M\nS = 0\nfor i in range(2, M):\n if p[i]:\n for j in range(i * i, M, i):\n p[j] = 0\n S += i\n s.append(S)\nwhile 1:\n n = eval(input())\n if n == 0:\n break\n print(s[n])\n", "fast_code_sha256": "09bf5d0d342feea8a2f21191badddda2ed0fca1f3c0b3c1083fafbad4af87956", "fast_id": "p00053_09bf5d0d342feea8a2f21191badddda2ed0fca1f3c0b3c1083fafbad4af87956", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "s = [0]\nM = 104850\np = [1] * M\nS = 0\nfor i in range(2, M):\n if p[i]:\n for j in range(i * i, M, i):\n p[j] = 0\n S += i\n s.append(S)\nwhile 1:\n n = eval(input())\n if n == 0:\n break\n print(s[n])\n", "measured_fast_code_sha256": "09bf5d0d342feea8a2f21191badddda2ed0fca1f3c0b3c1083fafbad4af87956", "measured_slow_code": "import math\n\nr = 105000\nsqrt = int(math.sqrt(r))\np = [1] * r\np[0] = 0\nfor i in range(1, sqrt):\n if p[i]:\n for j in range(2 * i + 1, r, i + 1):\n p[j] = 0\nwhile True:\n n = int(input())\n if not n:\n break\n i, num, sum = 0, 0, 0\n while num < n:\n if p[i] == 1:\n num += 1\n sum += i + 1\n i += 1\n print(sum)\n", "measured_slow_code_sha256": "8cca1698214485b76a9b0e12f8e91dd9d3daa2c366ec968e4e5180fe1f6d3e7b", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4.576377014589353, "pair_id": "python_v2_742793703d4607bf3dfd0991", "per_case_slow_code_faster_fraction": 0.18, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p00053", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p00053_09bf5d0d342feea8a2f21191badddda2ed0fca1f3c0b3c1083fafbad4af87956.jsonl.gz", "inputs": "reproduction/python/inputs/p00053.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p00053_8cca1698214485b76a9b0e12f8e91dd9d3daa2c366ec968e4e5180fe1f6d3e7b.jsonl.gz"}, "slow_code": "import math\n\nr = 105000\nsqrt = int(math.sqrt(r))\np = [1] * r\np[0] = 0\nfor i in range(1, sqrt):\n if p[i]:\n for j in range(2 * i + 1, r, i + 1):\n p[j] = 0\nwhile True:\n n = int(input())\n if not n:\n break\n i, num, sum = 0, 0, 0\n while num < n:\n if p[i] == 1:\n num += 1\n sum += i + 1\n i += 1\n print(sum)\n", "slow_code_sha256": "8cca1698214485b76a9b0e12f8e91dd9d3daa2c366ec968e4e5180fe1f6d3e7b", "slow_id": "p00053_8cca1698214485b76a9b0e12f8e91dd9d3daa2c366ec968e4e5180fe1f6d3e7b", "speedup": 4.016838281367147, "stratum": "4-8", "within_pair_jaccard": 0.4838709677419355, "workload": {"case_count": 100, "description": "For each n, compute the sum of the first n primes. Each line supplies one n; the final zero terminates input and is not a query. Observed inputs: datasets=1..50 (median 25); n=1..10000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 302, "median": 120.0, "min": 4}, "input_format": ["n_1\n...\nn_D\n0"], "input_format_status": "source_input_section", "input_lines": {"max": 51, "median": 26.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 51, "median": 26.0, "min": 2}}} -{"case_ids": ["p03575_case_000", "p03575_case_001", "p03575_case_002", "p03575_case_003", "p03575_case_004", "p03575_case_005", "p03575_case_006", "p03575_case_007", "p03575_case_008", "p03575_case_009", "p03575_case_010", "p03575_case_011", "p03575_case_012", "p03575_case_013", "p03575_case_014", "p03575_case_015", "p03575_case_016", "p03575_case_017", "p03575_case_018", "p03575_case_019", "p03575_case_020", "p03575_case_021", "p03575_case_022", "p03575_case_023", "p03575_case_024", "p03575_case_025", "p03575_case_026", "p03575_case_027", "p03575_case_028", "p03575_case_029", "p03575_case_030", "p03575_case_031", "p03575_case_032", "p03575_case_033", "p03575_case_034", "p03575_case_035", "p03575_case_036", "p03575_case_037", "p03575_case_038", "p03575_case_039", "p03575_case_040", "p03575_case_041", "p03575_case_042", "p03575_case_043", "p03575_case_044", "p03575_case_045", "p03575_case_046", "p03575_case_047", "p03575_case_048", "p03575_case_049", "p03575_case_050", "p03575_case_051", "p03575_case_052", "p03575_case_053", "p03575_case_054", "p03575_case_055", "p03575_case_056", "p03575_case_057", "p03575_case_058", "p03575_case_059", "p03575_case_060", "p03575_case_061", "p03575_case_062", "p03575_case_063", "p03575_case_064", "p03575_case_065", "p03575_case_066", "p03575_case_067", "p03575_case_068", "p03575_case_069", "p03575_case_070", "p03575_case_071", "p03575_case_072", "p03575_case_073", "p03575_case_074", "p03575_case_075", "p03575_case_076", "p03575_case_077", "p03575_case_078", "p03575_case_079", "p03575_case_080", "p03575_case_081", "p03575_case_082", "p03575_case_083", "p03575_case_084", "p03575_case_085", "p03575_case_086", "p03575_case_087", "p03575_case_088", "p03575_case_089", "p03575_case_090", "p03575_case_091", "p03575_case_092", "p03575_case_093", "p03575_case_094", "p03575_case_095", "p03575_case_096", "p03575_case_097", "p03575_case_098", "p03575_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\nsys.setrecursionlimit(10**8)\n\n\ndef ii():\n return int(sys.stdin.readline())\n\n\ndef mi():\n return list(map(int, sys.stdin.readline().split()))\n\n\ndef li():\n return list(map(int, sys.stdin.readline().split()))\n\n\ndef li2(N):\n return [list(map(int, sys.stdin.readline().split())) for _ in range(N)]\n\n\ndef dp2(ini, i, j):\n return [[ini] * i for _ in range(j)]\n\n\ndef dp3(ini, i, j, k):\n return [[[ini] * i for _ in range(j)] for _ in range(k)]\n\n\nN, M = mi()\nmemo = []\nrel = [[] for i in range(N)]\nfor i in range(M):\n s, t = mi()\n s, t = s - 1, t - 1\n memo.append((s, t))\n rel[s].append(t)\n rel[t].append(s)\n\n\ndef dfs(v):\n for nv in rel[v]:\n if not used[nv]:\n used[nv] = 1\n dfs(nv)\n if sum(used) == N:\n global flag\n flag = 1\n return\n\n\ncnt = M\nfor x in range(M):\n s, t = memo[x][0], memo[x][1]\n rel[s].remove(t)\n rel[t].remove(s)\n flag = 0\n used = [0] * N\n dfs(0)\n if flag:\n cnt -= 1\n rel[s].append(t)\n rel[t].append(s)\nprint(cnt)\n", "fast_code_sha256": "e8bdc191a536c7010a890cc32dea3dc2fcef6ecb6d335e44163c64067dc8e4cf", "fast_id": "p03575_de92383fba6c0229e79fd952746235f6bc15a40ddc958d6c687f9ee23252de58", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\nsys.setrecursionlimit(10**8)\n\n\ndef ii():\n return int(sys.stdin.readline())\n\n\ndef mi():\n return list(map(int, sys.stdin.readline().split()))\n\n\ndef li():\n return list(map(int, sys.stdin.readline().split()))\n\n\ndef li2(N):\n return [list(map(int, sys.stdin.readline().split())) for _ in range(N)]\n\n\ndef dp2(ini, i, j):\n return [[ini] * i for _ in range(j)]\n\n\ndef dp3(ini, i, j, k):\n return [[[ini] * i for _ in range(j)] for _ in range(k)]\n\n\n# import bisect #bisect.bisect_left(B, a)\n# from collections import defaultdict #d = defaultdict(int) d[key] += value\n# from itertools import accumulate #list(accumulate(A))\n## DFS\nN, M = mi()\nmemo = []\nrel = [[] for i in range(N)]\nfor i in range(M):\n s, t = mi()\n s, t = s - 1, t - 1\n memo.append((s, t))\n rel[s].append(t)\n rel[t].append(s)\n\n\ndef dfs(v):\n for nv in rel[v]:\n if not used[nv]:\n used[nv] = 1\n dfs(nv)\n if sum(used) == N:\n global flag\n flag = 1\n return\n\n\ncnt = M\nfor x in range(M):\n s, t = memo[x][0], memo[x][1]\n rel[s].remove(t)\n rel[t].remove(s)\n flag = 0\n used = [0] * N\n dfs(0)\n if flag:\n cnt -= 1\n rel[s].append(t)\n rel[t].append(s)\nprint(cnt)\n", "measured_fast_code_sha256": "de92383fba6c0229e79fd952746235f6bc15a40ddc958d6c687f9ee23252de58", "measured_slow_code": "import sys, re, os\nfrom collections import deque, defaultdict, Counter\nfrom math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians\nfrom itertools import permutations, combinations, product, accumulate\nfrom operator import itemgetter, mul\nfrom copy import deepcopy\nfrom string import ascii_lowercase, ascii_uppercase, digits\nfrom heapq import heapify, heappop, heappush\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef INT():\n return int(eval(input()))\n\n\ndef MAP():\n return list(map(int, input().split()))\n\n\ndef S_MAP():\n return list(map(str, input().split()))\n\n\ndef LIST():\n return list(map(int, input().split()))\n\n\ndef S_LIST():\n return list(map(str, input().split()))\n\n\nsys.setrecursionlimit(10**9)\nINF = float(\"inf\")\nmod = 10**9 + 7\n\n\ndef dijkstra(E, start):\n N_d = len(E)\n dist = [INF] * N_d\n dist[start] = 0\n q = [(0, start)]\n while q:\n dist_v, v = heappop(q)\n if dist[v] != dist_v:\n continue\n for u, dist_vu in E[v]:\n dist_u = dist_v + dist_vu\n if dist_u < dist[u]:\n dist[u] = dist_u\n heappush(q, (dist_u, u))\n return dist\n\n\nN, M = MAP()\nL = [LIST() for i in range(M)]\ngraph = defaultdict(list)\nfor a, b in L:\n graph[a - 1].append((b - 1, 1))\n graph[b - 1].append((a - 1, 1))\nans = 0\nfor i in range(M):\n a, b = L[i]\n E = deepcopy(graph)\n E[a - 1].remove((b - 1, 1))\n E[b - 1].remove((a - 1, 1))\n dist = dijkstra(E, 0)\n if dist.count(INF) > 0:\n ans += 1\nprint(ans)\n", "measured_slow_code_sha256": "3b0c75c5164a810f84adc515ed302d05d4140b865ec422b1df702b4974d0a4da", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 7.402538430524558, "pair_id": "python_v2_e98b91148412d284d1302ac1", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03575", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03575_de92383fba6c0229e79fd952746235f6bc15a40ddc958d6c687f9ee23252de58.jsonl.gz", "inputs": "reproduction/python/inputs/p03575.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03575_3b0c75c5164a810f84adc515ed302d05d4140b865ec422b1df702b4974d0a4da.jsonl.gz"}, "slow_code": "import sys, re, os\nfrom collections import deque, defaultdict, Counter\nfrom math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians\nfrom itertools import permutations, combinations, product, accumulate\nfrom operator import itemgetter, mul\nfrom copy import deepcopy\nfrom string import ascii_lowercase, ascii_uppercase, digits\nfrom heapq import heapify, heappop, heappush\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef INT():\n return int(eval(input()))\n\n\ndef MAP():\n return list(map(int, input().split()))\n\n\ndef S_MAP():\n return list(map(str, input().split()))\n\n\ndef LIST():\n return list(map(int, input().split()))\n\n\ndef S_LIST():\n return list(map(str, input().split()))\n\n\nsys.setrecursionlimit(10**9)\nINF = float(\"inf\")\nmod = 10**9 + 7\n\n\ndef dijkstra(E, start):\n N_d = len(E)\n dist = [INF] * N_d\n dist[start] = 0\n q = [(0, start)]\n while q:\n dist_v, v = heappop(q)\n if dist[v] != dist_v:\n continue\n for u, dist_vu in E[v]:\n dist_u = dist_v + dist_vu\n if dist_u < dist[u]:\n dist[u] = dist_u\n heappush(q, (dist_u, u))\n return dist\n\n\nN, M = MAP()\nL = [LIST() for i in range(M)]\ngraph = defaultdict(list)\nfor a, b in L:\n graph[a - 1].append((b - 1, 1))\n graph[b - 1].append((a - 1, 1))\nans = 0\nfor i in range(M):\n a, b = L[i]\n E = deepcopy(graph)\n E[a - 1].remove((b - 1, 1))\n E[b - 1].remove((a - 1, 1))\n dist = dijkstra(E, 0)\n if dist.count(INF) > 0:\n ans += 1\nprint(ans)\n", "slow_code_sha256": "3b0c75c5164a810f84adc515ed302d05d4140b865ec422b1df702b4974d0a4da", "slow_id": "p03575_3b0c75c5164a810f84adc515ed302d05d4140b865ec422b1df702b4974d0a4da", "speedup": 7.3842549264183885, "stratum": "4-8", "within_pair_jaccard": 0.21367521367521367, "workload": {"case_count": 100, "description": "Count bridges in a connected simple undirected graph: a bridge is an edge whose removal disconnects it. Vertices are numbered 1..N and each listed edge has a_i 2 * c:\n if x == y:\n print((c * 2 * x))\n elif x < y:\n print((min(c * 2 * x + b * (y - x), c * 2 * y)))\n else:\n print((min(c * 2 * y + a * (x - y), c * 2 * x)))\n", "fast_code_sha256": "fa77e9bd5adc46505a1238c5aca13d77243249b42e416b437a2ee915d04fc79a", "fast_id": "p03371_fa77e9bd5adc46505a1238c5aca13d77243249b42e416b437a2ee915d04fc79a", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "a, b, c, x, y = list(map(int, input().split()))\nif a + b <= 2 * c:\n print((a * x + b * y))\nelif a + b > 2 * c:\n if x == y:\n print((c * 2 * x))\n elif x < y:\n print((min(c * 2 * x + b * (y - x), c * 2 * y)))\n else:\n print((min(c * 2 * y + a * (x - y), c * 2 * x)))\n", "measured_fast_code_sha256": "fa77e9bd5adc46505a1238c5aca13d77243249b42e416b437a2ee915d04fc79a", "measured_slow_code": "a, b, c, x, y = list(map(int, input().split()))\nmi = 10**10\nfor i in range(10**6):\n cost = c * 2 * i + a * max((x - i), 0) + b * max((y - i), 0)\n if cost < mi:\n mi = cost\nprint(mi)\n", "measured_slow_code_sha256": "d423368c3404af0d794647ac92b41960ae5bb9ea8edef19ff71fb40275e2bb52", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 11620.765656784777, "pair_id": "python_v2_39a420527777003acfc00b3d", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03371", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03371_fa77e9bd5adc46505a1238c5aca13d77243249b42e416b437a2ee915d04fc79a.jsonl.gz", "inputs": "reproduction/python/inputs/p03371.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03371_d423368c3404af0d794647ac92b41960ae5bb9ea8edef19ff71fb40275e2bb52.jsonl.gz"}, "slow_code": "a, b, c, x, y = list(map(int, input().split()))\nmi = 10**10\nfor i in range(10**6):\n cost = c * 2 * i + a * max((x - i), 0) + b * max((y - i), 0)\n if cost < mi:\n mi = cost\nprint(mi)\n", "slow_code_sha256": "d423368c3404af0d794647ac92b41960ae5bb9ea8edef19ff71fb40275e2bb52", "slow_id": "p03371_d423368c3404af0d794647ac92b41960ae5bb9ea8edef19ff71fb40275e2bb52", "speedup": 11562.75978300799, "stratum": "8+", "within_pair_jaccard": 0.5, "workload": {"case_count": 100, "description": "Whole pizzas of types A and B cost A and B; a mixed half-A/half-B pizza costs C. Buy at least X whole-A and Y whole-B equivalents, combining mixed pizzas in pairs. Minimize cost; surplus is allowed. Observed inputs: A=1..5000; B=1..5000; C=1..5000; X=1..100000 (median 56080.5); Y=1..100000 (median 40245).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 29, "median": 25.5, "min": 10}, "input_format": ["A B C X Y"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 5, "median": 5.0, "min": 5}}} -{"case_ids": ["p03296_case_000", "p03296_case_001", "p03296_case_002", "p03296_case_003", "p03296_case_004", "p03296_case_005", "p03296_case_006", "p03296_case_007", "p03296_case_008", "p03296_case_009", "p03296_case_010", "p03296_case_011", "p03296_case_012", "p03296_case_013", "p03296_case_014", "p03296_case_015", "p03296_case_016", "p03296_case_017", "p03296_case_018", "p03296_case_019", "p03296_case_020", "p03296_case_021", "p03296_case_022", "p03296_case_023", "p03296_case_024", "p03296_case_025", "p03296_case_026", "p03296_case_027", "p03296_case_028", "p03296_case_029", "p03296_case_030", "p03296_case_031", "p03296_case_032", "p03296_case_033", "p03296_case_034", "p03296_case_035", "p03296_case_036", "p03296_case_037", "p03296_case_038", "p03296_case_039", "p03296_case_040", "p03296_case_041", "p03296_case_042", "p03296_case_043", "p03296_case_044", "p03296_case_045", "p03296_case_046", "p03296_case_047", "p03296_case_048", "p03296_case_049", "p03296_case_050", "p03296_case_051", "p03296_case_052", "p03296_case_053", "p03296_case_054", "p03296_case_055", "p03296_case_056", "p03296_case_057", "p03296_case_058", "p03296_case_059", "p03296_case_060", "p03296_case_061", "p03296_case_062", "p03296_case_063", "p03296_case_064", "p03296_case_065", "p03296_case_066", "p03296_case_067", "p03296_case_068", "p03296_case_069", "p03296_case_070", "p03296_case_071", "p03296_case_072", "p03296_case_073", "p03296_case_074", "p03296_case_075", "p03296_case_076", "p03296_case_077", "p03296_case_078", "p03296_case_079", "p03296_case_080", "p03296_case_081", "p03296_case_082", "p03296_case_083", "p03296_case_084", "p03296_case_085", "p03296_case_086", "p03296_case_087", "p03296_case_088", "p03296_case_089", "p03296_case_090", "p03296_case_091", "p03296_case_092", "p03296_case_093", "p03296_case_094", "p03296_case_095", "p03296_case_096", "p03296_case_097", "p03296_case_098", "p03296_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from itertools import groupby\n\nN, *A = list(map(int, open(0).read().split()))\nprint((sum(len(tuple(v)) // 2 for _, v in groupby(A))))\n", "fast_code_sha256": "2ecf79b93b64ccdb9a4ac892c59a7362eb0dec68cca68be0de61616d39332c15", "fast_id": "p03296_2ecf79b93b64ccdb9a4ac892c59a7362eb0dec68cca68be0de61616d39332c15", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from itertools import groupby\n\nN, *A = list(map(int, open(0).read().split()))\nprint((sum(len(tuple(v)) // 2 for _, v in groupby(A))))\n", "measured_fast_code_sha256": "2ecf79b93b64ccdb9a4ac892c59a7362eb0dec68cca68be0de61616d39332c15", "measured_slow_code": "# coding:utf-8\nimport sys\n\nINF = float(\"inf\")\nMOD = 10**9 + 7\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef LI_():\n return [int(x) - 1 for x in sys.stdin.readline().split()]\n\n\ndef LF():\n return [float(x) for x in sys.stdin.readline().split()]\n\n\ndef LS():\n return sys.stdin.readline().split()\n\n\ndef II():\n return int(sys.stdin.readline())\n\n\ndef SI():\n return eval(input())\n\n\ndef main():\n n = II()\n A = LI()\n res = 0\n for i in range(1, n):\n if A[i] == A[i - 1]:\n A[i] = 0\n res += 1\n return res\n\n\nprint((main()))\n", "measured_slow_code_sha256": "a260e38fd68198bd3b846ed815f9f7842be8a43a1a00830ef94d4cac2df063d2", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.6892228054924634, "pair_id": "python_v2_c2dccd0132b5bb7449e08639", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03296", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03296_2ecf79b93b64ccdb9a4ac892c59a7362eb0dec68cca68be0de61616d39332c15.jsonl.gz", "inputs": "reproduction/python/inputs/p03296.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03296_a260e38fd68198bd3b846ed815f9f7842be8a43a1a00830ef94d4cac2df063d2.jsonl.gz"}, "slow_code": "import sys\n\nINF = float(\"inf\")\nMOD = 10**9 + 7\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef LI_():\n return [int(x) - 1 for x in sys.stdin.readline().split()]\n\n\ndef LF():\n return [float(x) for x in sys.stdin.readline().split()]\n\n\ndef LS():\n return sys.stdin.readline().split()\n\n\ndef II():\n return int(sys.stdin.readline())\n\n\ndef SI():\n return eval(input())\n\n\ndef main():\n n = II()\n A = LI()\n res = 0\n for i in range(1, n):\n if A[i] == A[i - 1]:\n A[i] = 0\n res += 1\n return res\n\n\nprint((main()))\n", "slow_code_sha256": "98718a5692a33a090df0421f7d48f7b20be3a15dafddd3f88613c957f01f774b", "slow_id": "p03296_a260e38fd68198bd3b846ed815f9f7842be8a43a1a00830ef94d4cac2df063d2", "speedup": 2.3958469740712593, "stratum": "2-4", "within_pair_jaccard": 0.125, "workload": {"case_count": 100, "description": "Change the colors of as few entries as possible so no adjacent pair has equal colors. Each change replaces one color by any of 10000 available colors. Observed inputs: N=2..100 (median 50); A_i=1..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 304, "median": 143.5, "min": 6}, "input_format": ["N\na_1 ... a_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 101, "median": 51.0, "min": 3}}} -{"case_ids": ["p02732_case_000", "p02732_case_001", "p02732_case_002", "p02732_case_003", "p02732_case_004", "p02732_case_005", "p02732_case_006", "p02732_case_007", "p02732_case_008", "p02732_case_009", "p02732_case_010", "p02732_case_011", "p02732_case_012", "p02732_case_013", "p02732_case_014", "p02732_case_015", "p02732_case_016", "p02732_case_017", "p02732_case_018", "p02732_case_019", "p02732_case_020", "p02732_case_021", "p02732_case_022", "p02732_case_023", "p02732_case_024", "p02732_case_025", "p02732_case_026", "p02732_case_027", "p02732_case_028", "p02732_case_029", "p02732_case_030", "p02732_case_031", "p02732_case_032", "p02732_case_033", "p02732_case_034", "p02732_case_035", "p02732_case_036", "p02732_case_037", "p02732_case_038", "p02732_case_039", "p02732_case_040", "p02732_case_041", "p02732_case_042", "p02732_case_043", "p02732_case_044", "p02732_case_045", "p02732_case_046", "p02732_case_047", "p02732_case_048", "p02732_case_049", "p02732_case_050", "p02732_case_051", "p02732_case_052", "p02732_case_053", "p02732_case_054", "p02732_case_055", "p02732_case_056", "p02732_case_057", "p02732_case_058", "p02732_case_059", "p02732_case_060", "p02732_case_061", "p02732_case_062", "p02732_case_063", "p02732_case_064", "p02732_case_065", "p02732_case_066", "p02732_case_067", "p02732_case_068", "p02732_case_069", "p02732_case_070", "p02732_case_071", "p02732_case_072", "p02732_case_073", "p02732_case_074", "p02732_case_075", "p02732_case_076", "p02732_case_077", "p02732_case_078", "p02732_case_079", "p02732_case_080", "p02732_case_081", "p02732_case_082", "p02732_case_083", "p02732_case_084", "p02732_case_085", "p02732_case_086", "p02732_case_087", "p02732_case_088", "p02732_case_089", "p02732_case_090", "p02732_case_091", "p02732_case_092", "p02732_case_093", "p02732_case_094", "p02732_case_095", "p02732_case_096", "p02732_case_097", "p02732_case_098", "p02732_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "executable_AST_equal_except_explicit_explanatory_string_removal_and_all_frozen_inputs_checker_pass", "fast_code": "from functools import reduce\n\n\ndef d_banned_k():\n from collections import Counter\n from functools import reduce\n\n N = int(eval(input()))\n A = [int(i) for i in input().split()]\n\n def comb(n, r):\n numerator = reduce(lambda x, y: x * y, list(range(n, n - r, -1)))\n denominator = reduce(lambda x, y: x * y, list(range(1, r + 1)))\n return numerator // denominator\n\n count = Counter(A)\n total = sum(comb(c, 2) for c in list(count.values()))\n ans = []\n for a in A:\n v = count[a]\n ans.append(total - comb(v, 2) + comb(v - 1, 2))\n return \" \".join(map(str, ans))\n\n\nprint((d_banned_k()))\n", "fast_code_sha256": "715c50a0bd5503a1c5a8f5900a3590d1b55c78b7a98e77c948ef59c2a023b3ea", "fast_id": "p02732_715c50a0bd5503a1c5a8f5900a3590d1b55c78b7a98e77c948ef59c2a023b3ea", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from functools import reduce\n\n\ndef d_banned_k():\n from collections import Counter\n from functools import reduce\n\n N = int(eval(input()))\n A = [int(i) for i in input().split()]\n\n def comb(n, r):\n numerator = reduce(lambda x, y: x * y, list(range(n, n - r, -1)))\n denominator = reduce(lambda x, y: x * y, list(range(1, r + 1)))\n return numerator // denominator\n\n count = Counter(A)\n total = sum(comb(c, 2) for c in list(count.values()))\n ans = []\n for a in A:\n v = count[a]\n ans.append(total - comb(v, 2) + comb(v - 1, 2))\n return \" \".join(map(str, ans))\n\n\nprint((d_banned_k()))\n", "measured_fast_code_sha256": "715c50a0bd5503a1c5a8f5900a3590d1b55c78b7a98e77c948ef59c2a023b3ea", "measured_slow_code": "# coding: utf-8\n# Your code here!\n# coding: utf-8\nimport sys\n\nsys.setrecursionlimit(10000000)\n# const\ndxdy = ((1, 0), (0, 1))\n# my functions here!\ndef pin(type=int):\n return list(map(type, input().rstrip().split()))\n\n\ndef resolve():\n (N,) = pin()\n A = list(pin())\n from collections import Counter as ct\n\n a = ct(A)\n t = list(a.items())\n # print(t)\n Sum = 0\n for l in list(a.values()):\n Sum += (l * (l - 1)) // 2\n ans = [0] * N\n for j in list(a.items()):\n x, y = j\n ans[x - 1] = Sum - ((y * (y - 1)) // 2) + (((y - 2) * (y - 1)) // 2)\n for i in A:\n print((ans[i - 1]))\n\n\n\"\"\" \n#printデバッグ消した?\n#前の問題の結果見てないのに次の問題に行くの?\n\"\"\"\n\"\"\"\nお前カッコ閉じるの忘れてるだろ\n\"\"\"\nimport sys\nfrom io import StringIO\nimport unittest\n\n\nclass TestClass(unittest.TestCase):\n def assertIO(self, input, output):\n stdout, stdin = sys.stdout, sys.stdin\n sys.stdout, sys.stdin = StringIO(), StringIO(input)\n resolve()\n sys.stdout.seek(0)\n out = sys.stdout.read()[:-1]\n sys.stdout, sys.stdin = stdout, stdin\n self.assertEqual(out, output)\n\n def test_入力例_1(self):\n input = \"\"\"5\n1 1 2 1 2\"\"\"\n output = \"\"\"2\n2\n3\n2\n3\"\"\"\n self.assertIO(input, output)\n\n def test_入力例_2(self):\n input = \"\"\"4\n1 2 3 4\"\"\"\n output = \"\"\"0\n0\n0\n0\"\"\"\n self.assertIO(input, output)\n\n def test_入力例_3(self):\n input = \"\"\"5\n3 3 3 3 3\"\"\"\n output = \"\"\"6\n6\n6\n6\n6\"\"\"\n self.assertIO(input, output)\n\n def test_入力例_4(self):\n input = \"\"\"8\n1 2 1 4 2 1 4 1\"\"\"\n output = \"\"\"5\n7\n5\n7\n7\n5\n7\n5\"\"\"\n self.assertIO(input, output)\n\n\nif __name__ == \"__main__\":\n resolve()\n", "measured_slow_code_sha256": "9d17ca3de5bff1fb4ca10fcde86e0ee4d7d8890320b402e1b2344cb473a994ae", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 14.439913948897441, "pair_id": "python_v2_3e32893e1d30f7739b0405b2", "per_case_slow_code_faster_fraction": 0.25, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02732", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02732_715c50a0bd5503a1c5a8f5900a3590d1b55c78b7a98e77c948ef59c2a023b3ea.jsonl.gz", "inputs": "reproduction/python/inputs/p02732.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02732_9d17ca3de5bff1fb4ca10fcde86e0ee4d7d8890320b402e1b2344cb473a994ae.jsonl.gz"}, "slow_code": "import sys\n\nsys.setrecursionlimit(10000000)\n\ndxdy = ((1, 0), (0, 1))\n\n\ndef pin(type=int):\n return list(map(type, input().rstrip().split()))\n\n\ndef resolve():\n (N,) = pin()\n A = list(pin())\n from collections import Counter as ct\n\n a = ct(A)\n t = list(a.items())\n\n Sum = 0\n for l in list(a.values()):\n Sum += (l * (l - 1)) // 2\n ans = [0] * N\n for j in list(a.items()):\n x, y = j\n ans[x - 1] = Sum - ((y * (y - 1)) // 2) + (((y - 2) * (y - 1)) // 2)\n for i in A:\n print((ans[i - 1]))\n\n\nimport sys\nfrom io import StringIO\nimport unittest\n\n\nclass TestClass(unittest.TestCase):\n def assertIO(self, input, output):\n stdout, stdin = sys.stdout, sys.stdin\n sys.stdout, sys.stdin = StringIO(), StringIO(input)\n resolve()\n sys.stdout.seek(0)\n out = sys.stdout.read()[:-1]\n sys.stdout, sys.stdin = stdout, stdin\n self.assertEqual(out, output)\n\n def test_入力例_1(self):\n input = \"\"\"5\n1 1 2 1 2\"\"\"\n output = \"\"\"2\n2\n3\n2\n3\"\"\"\n self.assertIO(input, output)\n\n def test_入力例_2(self):\n input = \"\"\"4\n1 2 3 4\"\"\"\n output = \"\"\"0\n0\n0\n0\"\"\"\n self.assertIO(input, output)\n\n def test_入力例_3(self):\n input = \"\"\"5\n3 3 3 3 3\"\"\"\n output = \"\"\"6\n6\n6\n6\n6\"\"\"\n self.assertIO(input, output)\n\n def test_入力例_4(self):\n input = \"\"\"8\n1 2 1 4 2 1 4 1\"\"\"\n output = \"\"\"5\n7\n5\n7\n7\n5\n7\n5\"\"\"\n self.assertIO(input, output)\n\n\nif __name__ == \"__main__\":\n resolve()\n", "slow_code_sha256": "ab39497edd589ec48b0519088a7352daeebc2eed8c1dd4c3682e7f5541533e42", "slow_id": "p02732_9d17ca3de5bff1fb4ca10fcde86e0ee4d7d8890320b402e1b2344cb473a994ae", "speedup": 7.54551271377537, "stratum": "4-8", "within_pair_jaccard": 0.2727272727272727, "workload": {"case_count": 100, "description": "For each position k in an N-ball sequence, exclude only that ball and count unordered pairs of distinct remaining balls carrying equal integer values A_i. Observed inputs: N=3..200000 (median 550); A_i=1..200000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1400007, "median": 1155.0, "min": 8}, "input_format": ["N\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200001, "median": 551.0, "min": 4}}} -{"case_ids": ["p02700_case_000", "p02700_case_001", "p02700_case_002", "p02700_case_003", "p02700_case_004", "p02700_case_005", "p02700_case_006", "p02700_case_007", "p02700_case_008", "p02700_case_009", "p02700_case_010", "p02700_case_011", "p02700_case_012", "p02700_case_013", "p02700_case_014", "p02700_case_015", "p02700_case_016", "p02700_case_017", "p02700_case_018", "p02700_case_019", "p02700_case_020", "p02700_case_021", "p02700_case_022", "p02700_case_023", "p02700_case_024", "p02700_case_025", "p02700_case_026", "p02700_case_027", "p02700_case_028", "p02700_case_029", "p02700_case_030", "p02700_case_031", "p02700_case_032", "p02700_case_033", "p02700_case_034", "p02700_case_035", "p02700_case_036", "p02700_case_037", "p02700_case_038", "p02700_case_039", "p02700_case_040", "p02700_case_041", "p02700_case_042", "p02700_case_043", "p02700_case_044", "p02700_case_045", "p02700_case_046", "p02700_case_047", "p02700_case_048", "p02700_case_049", "p02700_case_050", "p02700_case_051", "p02700_case_052", "p02700_case_053", "p02700_case_054", "p02700_case_055", "p02700_case_056", "p02700_case_057", "p02700_case_058", "p02700_case_059", "p02700_case_060", "p02700_case_061", "p02700_case_062", "p02700_case_063", "p02700_case_064", "p02700_case_065", "p02700_case_066", "p02700_case_067", "p02700_case_068", "p02700_case_069", "p02700_case_070", "p02700_case_071", "p02700_case_072", "p02700_case_073", "p02700_case_074", "p02700_case_075", "p02700_case_076", "p02700_case_077", "p02700_case_078", "p02700_case_079", "p02700_case_080", "p02700_case_081", "p02700_case_082", "p02700_case_083", "p02700_case_084", "p02700_case_085", "p02700_case_086", "p02700_case_087", "p02700_case_088", "p02700_case_089", "p02700_case_090", "p02700_case_091", "p02700_case_092", "p02700_case_093", "p02700_case_094", "p02700_case_095", "p02700_case_096", "p02700_case_097", "p02700_case_098", "p02700_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "A, B, C, D = list(map(int, input().split()))\nprint((\"No\" if -A // D > -C // B else \"Yes\"))\n", "fast_code_sha256": "2048af1f6a52a5012c5b48423ac818e2d4abe254733759e0fa2416f5e415c11b", "fast_id": "p02700_2048af1f6a52a5012c5b48423ac818e2d4abe254733759e0fa2416f5e415c11b", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "A, B, C, D = list(map(int, input().split()))\nprint((\"No\" if -A // D > -C // B else \"Yes\"))\n", "measured_fast_code_sha256": "2048af1f6a52a5012c5b48423ac818e2d4abe254733759e0fa2416f5e415c11b", "measured_slow_code": "from math import floor, ceil, sqrt, factorial, log\nfrom collections import Counter, deque\nfrom functools import reduce\n\n# import numpy as np\ndef S():\n return eval(input())\n\n\ndef I():\n return int(eval(input()))\n\n\ndef MS():\n return list(map(str, input().split()))\n\n\ndef MI():\n return list(map(int, input().split()))\n\n\ndef FLI():\n return [int(i) for i in input().split()]\n\n\ndef LS():\n return list(MS())\n\n\ndef LI():\n return list(MI())\n\n\ndef LLS():\n return [list(map(str, l.split())) for l in eval(input())]\n\n\ndef LLI():\n return [list(map(int, l.split())) for l in eval(input())]\n\n\ndef LLSN(n: int):\n return [LS() for _ in range(n)]\n\n\ndef LLIN(n: int):\n return [LI() for _ in range(n)]\n\n\nA, B, C, D = MI()\nx = -(-A // D)\ny = -(-C // B)\nif x >= y:\n print(\"Yes\")\nelse:\n print(\"No\")\n# for i in range(100):\n# a -= B\n# if a <= 0:\n# print(\"Yes\")\n# exit()\n# t -= D\n# if t <= 0:\n# print(\"No\")\n# exit()\n", "measured_slow_code_sha256": "0800076b3be1d259d89fb0c2c371b4341f1c7fc8f7058a2f3f090ffddebf2dcb", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 7.168862090995862, "pair_id": "python_v2_bb6201eb2ab11a28a22ab191", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02700", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02700_2048af1f6a52a5012c5b48423ac818e2d4abe254733759e0fa2416f5e415c11b.jsonl.gz", "inputs": "reproduction/python/inputs/p02700.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02700_0800076b3be1d259d89fb0c2c371b4341f1c7fc8f7058a2f3f090ffddebf2dcb.jsonl.gz"}, "slow_code": "from math import floor, ceil, sqrt, factorial, log\nfrom collections import Counter, deque\nfrom functools import reduce\n\n\ndef S():\n return eval(input())\n\n\ndef I():\n return int(eval(input()))\n\n\ndef MS():\n return list(map(str, input().split()))\n\n\ndef MI():\n return list(map(int, input().split()))\n\n\ndef FLI():\n return [int(i) for i in input().split()]\n\n\ndef LS():\n return list(MS())\n\n\ndef LI():\n return list(MI())\n\n\ndef LLS():\n return [list(map(str, l.split())) for l in eval(input())]\n\n\ndef LLI():\n return [list(map(int, l.split())) for l in eval(input())]\n\n\ndef LLSN(n: int):\n return [LS() for _ in range(n)]\n\n\ndef LLIN(n: int):\n return [LI() for _ in range(n)]\n\n\nA, B, C, D = MI()\nx = -(-A // D)\ny = -(-C // B)\nif x >= y:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "slow_code_sha256": "7feb6456d377ecdd9b0dcbfc30f9b0e6286836e7cba34a2d795c5cf979e98297", "slow_id": "p02700_0800076b3be1d259d89fb0c2c371b4341f1c7fc8f7058a2f3f090ffddebf2dcb", "speedup": 7.1630508524897225, "stratum": "4-8", "within_pair_jaccard": 0.23529411764705882, "workload": {"case_count": 100, "description": "Two monsters have health/attack (A,B) and (C,D). Starting with the first monster, they attack alternately, subtracting their attack value from the opponent health. Determine whether the first wins by reducing opposing health to at most zero. Observed inputs: A=1..100 (median 73); B=1..100 (median 48.5); C=1..100 (median 80.5); D=1..100 (median 55).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 16, "median": 12.0, "min": 8}, "input_format": ["A B C D"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 4, "median": 4.0, "min": 4}}} -{"case_ids": ["p02783_case_000", "p02783_case_001", "p02783_case_002", "p02783_case_003", "p02783_case_004", "p02783_case_005", "p02783_case_006", "p02783_case_007", "p02783_case_008", "p02783_case_009", "p02783_case_010", "p02783_case_011", "p02783_case_012", "p02783_case_013", "p02783_case_014", "p02783_case_015", "p02783_case_016", "p02783_case_017", "p02783_case_018", "p02783_case_019", "p02783_case_020", "p02783_case_021", "p02783_case_022", "p02783_case_023", "p02783_case_024", "p02783_case_025", "p02783_case_026", "p02783_case_027", "p02783_case_028", "p02783_case_029", "p02783_case_030", "p02783_case_031", "p02783_case_032", "p02783_case_033", "p02783_case_034", "p02783_case_035", "p02783_case_036", "p02783_case_037", "p02783_case_038", "p02783_case_039", "p02783_case_040", "p02783_case_041", "p02783_case_042", "p02783_case_043", "p02783_case_044", "p02783_case_045", "p02783_case_046", "p02783_case_047", "p02783_case_048", "p02783_case_049", "p02783_case_050", "p02783_case_051", "p02783_case_052", "p02783_case_053", "p02783_case_054", "p02783_case_055", "p02783_case_056", "p02783_case_057", "p02783_case_058", "p02783_case_059", "p02783_case_060", "p02783_case_061", "p02783_case_062", "p02783_case_063", "p02783_case_064", "p02783_case_065", "p02783_case_066", "p02783_case_067", "p02783_case_068", "p02783_case_069", "p02783_case_070", "p02783_case_071", "p02783_case_072", "p02783_case_073", "p02783_case_074", "p02783_case_075", "p02783_case_076", "p02783_case_077", "p02783_case_078", "p02783_case_079", "p02783_case_080", "p02783_case_081", "p02783_case_082", "p02783_case_083", "p02783_case_084", "p02783_case_085", "p02783_case_086", "p02783_case_087", "p02783_case_088", "p02783_case_089", "p02783_case_090", "p02783_case_091", "p02783_case_092", "p02783_case_093", "p02783_case_094", "p02783_case_095", "p02783_case_096", "p02783_case_097", "p02783_case_098", "p02783_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "print((-eval(input().replace(\" \", \"//-\"))))\n", "fast_code_sha256": "e1d9e340d852a03ca46be152e59b5f3462bc58905e10c303457409383d0cf1e5", "fast_id": "p02783_e1d9e340d852a03ca46be152e59b5f3462bc58905e10c303457409383d0cf1e5", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "print((-eval(input().replace(\" \", \"//-\"))))\n", "measured_fast_code_sha256": "e1d9e340d852a03ca46be152e59b5f3462bc58905e10c303457409383d0cf1e5", "measured_slow_code": "import sys\nimport socket\n\nhostname = socket.gethostname()\nif hostname == \"F451C\":\n sys.stdin = open(\"a1.in\")\n\n\ndef read_int_list():\n return list(map(int, input().split()))\n\n\ndef read_str_list():\n return input().split()\n\n\ndef read_int():\n return int(eval(input()))\n\n\ndef read_str():\n return eval(input())\n\n\ndef main_0():\n H, A = read_int_list()\n res = 0\n for i in range(10001):\n H = H - A\n res += 1\n if H <= 0:\n break\n print(res)\n\n\ndef main_1():\n H, A = read_int_list()\n res = H // A\n if H % A != 0:\n res += 1\n print(res)\n\n\ndef main():\n H, A = read_int_list()\n res = 0\n while H > 0:\n H -= A\n res += 1\n print(res)\n\n\nmain()\n", "measured_slow_code_sha256": "d5fe1e3cebc325b88118764de6cebe3ff7e094ae5446fe951fc1767a79f70b68", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 82.59971974078037, "pair_id": "python_v2_d0cc96be93b0c55b428c4833", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02783", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02783_e1d9e340d852a03ca46be152e59b5f3462bc58905e10c303457409383d0cf1e5.jsonl.gz", "inputs": "reproduction/python/inputs/p02783.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02783_d5fe1e3cebc325b88118764de6cebe3ff7e094ae5446fe951fc1767a79f70b68.jsonl.gz"}, "slow_code": "import sys\nimport socket\n\nhostname = socket.gethostname()\nif hostname == \"F451C\":\n sys.stdin = open(\"a1.in\")\n\n\ndef read_int_list():\n return list(map(int, input().split()))\n\n\ndef read_str_list():\n return input().split()\n\n\ndef read_int():\n return int(eval(input()))\n\n\ndef read_str():\n return eval(input())\n\n\ndef main_0():\n H, A = read_int_list()\n res = 0\n for i in range(10001):\n H = H - A\n res += 1\n if H <= 0:\n break\n print(res)\n\n\ndef main_1():\n H, A = read_int_list()\n res = H // A\n if H % A != 0:\n res += 1\n print(res)\n\n\ndef main():\n H, A = read_int_list()\n res = 0\n while H > 0:\n H -= A\n res += 1\n print(res)\n\n\nmain()\n", "slow_code_sha256": "d5fe1e3cebc325b88118764de6cebe3ff7e094ae5446fe951fc1767a79f70b68", "slow_id": "p02783_d5fe1e3cebc325b88118764de6cebe3ff7e094ae5446fe951fc1767a79f70b68", "speedup": 82.8810293699157, "stratum": "8+", "within_pair_jaccard": 0.07692307692307693, "workload": {"case_count": 100, "description": "A monster starts with health H; each attack reduces it by A. Find the number of attacks required to reduce health to zero or below. Observed inputs: H=1..10000 (median 5766.5); A=1..10000 (median 4105.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 12, "median": 10.0, "min": 8}, "input_format": ["H A"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p03035_case_000", "p03035_case_001", "p03035_case_002", "p03035_case_003", "p03035_case_004", "p03035_case_005", "p03035_case_006", "p03035_case_007", "p03035_case_008", "p03035_case_009", "p03035_case_010", "p03035_case_011", "p03035_case_012", "p03035_case_013", "p03035_case_014", "p03035_case_015", "p03035_case_016", "p03035_case_017", "p03035_case_018", "p03035_case_019", "p03035_case_020", "p03035_case_021", "p03035_case_022", "p03035_case_023", "p03035_case_024", "p03035_case_025", "p03035_case_026", "p03035_case_027", "p03035_case_028", "p03035_case_029", "p03035_case_030", "p03035_case_031", "p03035_case_032", "p03035_case_033", "p03035_case_034", "p03035_case_035", "p03035_case_036", "p03035_case_037", "p03035_case_038", "p03035_case_039", "p03035_case_040", "p03035_case_041", "p03035_case_042", "p03035_case_043", "p03035_case_044", "p03035_case_045", "p03035_case_046", "p03035_case_047", "p03035_case_048", "p03035_case_049", "p03035_case_050", "p03035_case_051", "p03035_case_052", "p03035_case_053", "p03035_case_054", "p03035_case_055", "p03035_case_056", "p03035_case_057", "p03035_case_058", "p03035_case_059", "p03035_case_060", "p03035_case_061", "p03035_case_062", "p03035_case_063", "p03035_case_064", "p03035_case_065", "p03035_case_066", "p03035_case_067", "p03035_case_068", "p03035_case_069", "p03035_case_070", "p03035_case_071", "p03035_case_072", "p03035_case_073", "p03035_case_074", "p03035_case_075", "p03035_case_076", "p03035_case_077", "p03035_case_078", "p03035_case_079", "p03035_case_080", "p03035_case_081", "p03035_case_082", "p03035_case_083", "p03035_case_084", "p03035_case_085", "p03035_case_086", "p03035_case_087", "p03035_case_088", "p03035_case_089", "p03035_case_090", "p03035_case_091", "p03035_case_092", "p03035_case_093", "p03035_case_094", "p03035_case_095", "p03035_case_096", "p03035_case_097", "p03035_case_098", "p03035_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "a, b = list(map(int, input().split()))\nprint((0 if a <= 5 else b if a >= 13 else b // 2))\n", "fast_code_sha256": "98847d3ae7e1c9ecfbdc0868a01128cbdaa73b8b461dbf962f08e5677bce8643", "fast_id": "p03035_98847d3ae7e1c9ecfbdc0868a01128cbdaa73b8b461dbf962f08e5677bce8643", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "a, b = list(map(int, input().split()))\nprint((0 if a <= 5 else b if a >= 13 else b // 2))\n", "measured_fast_code_sha256": "98847d3ae7e1c9ecfbdc0868a01128cbdaa73b8b461dbf962f08e5677bce8643", "measured_slow_code": "import sys, math, collections, heapq, itertools\n\nF = sys.stdin\n\n\ndef single_input():\n return F.readline().strip(\"\\n\")\n\n\ndef line_input():\n return F.readline().strip(\"\\n\").split()\n\n\ndef gcd(a, b):\n a, b = max(a, b), min(a, b)\n while a % b > 0:\n a, b = b, a % b\n return b\n\n\ndef solve():\n A, B = list(map(int, line_input()))\n if A >= 13:\n print(B)\n elif A >= 6:\n print((B // 2))\n else:\n print((0))\n return 0\n\n\nif __name__ == \"__main__\":\n solve()\n", "measured_slow_code_sha256": "a03feaf840d71ae8aa582d21d70bb7cc8063992d1b30834ae4cabc43c65fc6f6", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.6207934328791556, "pair_id": "python_v2_f7e54e5be4c8f92e64a451fb", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03035", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03035_98847d3ae7e1c9ecfbdc0868a01128cbdaa73b8b461dbf962f08e5677bce8643.jsonl.gz", "inputs": "reproduction/python/inputs/p03035.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03035_a03feaf840d71ae8aa582d21d70bb7cc8063992d1b30834ae4cabc43c65fc6f6.jsonl.gz"}, "slow_code": "import sys, math, collections, heapq, itertools\n\nF = sys.stdin\n\n\ndef single_input():\n return F.readline().strip(\"\\n\")\n\n\ndef line_input():\n return F.readline().strip(\"\\n\").split()\n\n\ndef gcd(a, b):\n a, b = max(a, b), min(a, b)\n while a % b > 0:\n a, b = b, a % b\n return b\n\n\ndef solve():\n A, B = list(map(int, line_input()))\n if A >= 13:\n print(B)\n elif A >= 6:\n print((B // 2))\n else:\n print((0))\n return 0\n\n\nif __name__ == \"__main__\":\n solve()\n", "slow_code_sha256": "a03feaf840d71ae8aa582d21d70bb7cc8063992d1b30834ae4cabc43c65fc6f6", "slow_id": "p03035_a03feaf840d71ae8aa582d21d70bb7cc8063992d1b30834ae4cabc43c65fc6f6", "speedup": 3.6211734902736774, "stratum": "2-4", "within_pair_jaccard": 0.28205128205128205, "workload": {"case_count": 100, "description": "Find a ticket price for age A: full even price B at age >=13, half price at ages 6..12, and free at ages 0..5. Observed inputs: A=0..100 (median 21); B=2..1000 (median 183).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 9, "median": 6.0, "min": 4}, "input_format": ["A B"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p03558_case_000", "p03558_case_001", "p03558_case_002", "p03558_case_003", "p03558_case_004", "p03558_case_005", "p03558_case_006", "p03558_case_007", "p03558_case_008", "p03558_case_009", "p03558_case_010", "p03558_case_011", "p03558_case_012", "p03558_case_013", "p03558_case_014", "p03558_case_015", "p03558_case_016", "p03558_case_017", "p03558_case_018", "p03558_case_019", "p03558_case_020", "p03558_case_021", "p03558_case_022", "p03558_case_023", "p03558_case_024", "p03558_case_025", "p03558_case_026", "p03558_case_027", "p03558_case_028", "p03558_case_029", "p03558_case_030", "p03558_case_031", "p03558_case_032", "p03558_case_033", "p03558_case_034", "p03558_case_035", "p03558_case_036", "p03558_case_037", "p03558_case_038", "p03558_case_039", "p03558_case_040", "p03558_case_041", "p03558_case_042", "p03558_case_043", "p03558_case_044", "p03558_case_045", "p03558_case_046", "p03558_case_047", "p03558_case_048", "p03558_case_049", "p03558_case_050", "p03558_case_051", "p03558_case_052", "p03558_case_053", "p03558_case_054", "p03558_case_055", "p03558_case_056", "p03558_case_057", "p03558_case_058", "p03558_case_059", "p03558_case_060", "p03558_case_061", "p03558_case_062", "p03558_case_063", "p03558_case_064", "p03558_case_065", "p03558_case_066", "p03558_case_067", "p03558_case_068", "p03558_case_069", "p03558_case_070", "p03558_case_071", "p03558_case_072", "p03558_case_073", "p03558_case_074", "p03558_case_075", "p03558_case_076", "p03558_case_077", "p03558_case_078", "p03558_case_079", "p03558_case_080", "p03558_case_081", "p03558_case_082", "p03558_case_083", "p03558_case_084", "p03558_case_085", "p03558_case_086", "p03558_case_087", "p03558_case_088", "p03558_case_089", "p03558_case_090", "p03558_case_091", "p03558_case_092", "p03558_case_093", "p03558_case_094", "p03558_case_095", "p03558_case_096", "p03558_case_097", "p03558_case_098", "p03558_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from collections import deque\n\n\ndef solve(K):\n checked = [99999999999] * (K + 1)\n queue = deque()\n queue.append((1, 1))\n checked[1] = 1\n while queue:\n x, n = queue.popleft()\n if x == 0:\n return n\n _ = (x * 10) % K\n if n < checked[_]:\n queue.appendleft((_, n))\n checked[_] = n\n _ = (x + 1) % K\n if n + 1 < checked[_]:\n queue.append((_, n + 1))\n checked[_] = n + 1\n return None\n\n\nK = int(eval(input()))\nprint((solve(K)))\n", "fast_code_sha256": "bade334d850baa79c30c63b127211354a56f0a74387511e74bb04b26a2ac47b2", "fast_id": "p03558_bade334d850baa79c30c63b127211354a56f0a74387511e74bb04b26a2ac47b2", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from collections import deque\n\n\ndef solve(K):\n checked = [99999999999] * (K + 1)\n queue = deque()\n queue.append((1, 1))\n checked[1] = 1\n while queue:\n x, n = queue.popleft()\n if x == 0:\n return n\n _ = (x * 10) % K\n if n < checked[_]:\n queue.appendleft((_, n))\n checked[_] = n\n _ = (x + 1) % K\n if n + 1 < checked[_]:\n queue.append((_, n + 1))\n checked[_] = n + 1\n return None\n\n\nK = int(eval(input()))\nprint((solve(K)))\n", "measured_fast_code_sha256": "bade334d850baa79c30c63b127211354a56f0a74387511e74bb04b26a2ac47b2", "measured_slow_code": "import sys\n\nINF = 1 << 60\nMOD = 10**9 + 7 # 998244353\nsys.setrecursionlimit(2147483647)\ninput = lambda: sys.stdin.readline().rstrip()\nfrom collections import deque\n\n\ndef resolve():\n k = int(eval(input()))\n dist = [INF] * k\n dist[1] = 1\n queue = deque([1])\n while queue:\n v = queue.pop()\n if dist[10 * v % k] > dist[v]:\n dist[10 * v % k] = dist[v]\n queue.appendleft(10 * v % k)\n if dist[(v + 1) % k] > dist[v] + 1:\n dist[(v + 1) % k] = dist[v] + 1\n queue.append((v + 1) % k)\n print((dist[0]))\n\n\nresolve()\n", "measured_slow_code_sha256": "ca95e00432cb9fe0049dbb5eaaa7811261a70a8ad0e2620591022d8cc0b42655", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 6.9828277249286534, "pair_id": "python_v2_8c63feed62dde574a60fb3a1", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03558", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03558_bade334d850baa79c30c63b127211354a56f0a74387511e74bb04b26a2ac47b2.jsonl.gz", "inputs": "reproduction/python/inputs/p03558.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03558_ca95e00432cb9fe0049dbb5eaaa7811261a70a8ad0e2620591022d8cc0b42655.jsonl.gz"}, "slow_code": "import sys\n\nINF = 1 << 60\nMOD = 10**9 + 7\nsys.setrecursionlimit(2147483647)\ninput = lambda: sys.stdin.readline().rstrip()\nfrom collections import deque\n\n\ndef resolve():\n k = int(eval(input()))\n dist = [INF] * k\n dist[1] = 1\n queue = deque([1])\n while queue:\n v = queue.pop()\n if dist[10 * v % k] > dist[v]:\n dist[10 * v % k] = dist[v]\n queue.appendleft(10 * v % k)\n if dist[(v + 1) % k] > dist[v] + 1:\n dist[(v + 1) % k] = dist[v] + 1\n queue.append((v + 1) % k)\n print((dist[0]))\n\n\nresolve()\n", "slow_code_sha256": "ce02cacb8b88aa27060d7b5768b97cf46b2cc67abce7ba697788693a9f69936d", "slow_id": "p03558_ca95e00432cb9fe0049dbb5eaaa7811261a70a8ad0e2620591022d8cc0b42655", "speedup": 6.201991630213259, "stratum": "4-8", "within_pair_jaccard": 0.38636363636363635, "workload": {"case_count": 100, "description": "Find the smallest decimal digit sum among all positive integer multiples of K. Observed inputs: K=2..100000 (median 10205.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 7, "median": 5.5, "min": 2}, "input_format": ["K"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p02572_case_000", "p02572_case_001", "p02572_case_002", "p02572_case_003", "p02572_case_004", "p02572_case_005", "p02572_case_006", "p02572_case_007", "p02572_case_008", "p02572_case_009", "p02572_case_010", "p02572_case_011", "p02572_case_012", "p02572_case_013", "p02572_case_014", "p02572_case_015", "p02572_case_016", "p02572_case_017", "p02572_case_018", "p02572_case_019", "p02572_case_020", "p02572_case_021", "p02572_case_022", "p02572_case_023", "p02572_case_024", "p02572_case_025", "p02572_case_026", "p02572_case_027", "p02572_case_028", "p02572_case_029", "p02572_case_030", "p02572_case_031", "p02572_case_032", "p02572_case_033", "p02572_case_034", "p02572_case_035", "p02572_case_036", "p02572_case_037", "p02572_case_038", "p02572_case_039", "p02572_case_040", "p02572_case_041", "p02572_case_042", "p02572_case_043", "p02572_case_044", "p02572_case_045", "p02572_case_046", "p02572_case_047", "p02572_case_048", "p02572_case_049", "p02572_case_050", "p02572_case_051", "p02572_case_052", "p02572_case_053", "p02572_case_054", "p02572_case_055", "p02572_case_056", "p02572_case_057", "p02572_case_058", "p02572_case_059", "p02572_case_060", "p02572_case_061", "p02572_case_062", "p02572_case_063", "p02572_case_064", "p02572_case_065", "p02572_case_066", "p02572_case_067", "p02572_case_068", "p02572_case_069", "p02572_case_070", "p02572_case_071", "p02572_case_072", "p02572_case_073", "p02572_case_074", "p02572_case_075", "p02572_case_076", "p02572_case_077", "p02572_case_078", "p02572_case_079", "p02572_case_080", "p02572_case_081", "p02572_case_082", "p02572_case_083", "p02572_case_084", "p02572_case_085", "p02572_case_086", "p02572_case_087", "p02572_case_088", "p02572_case_089", "p02572_case_090", "p02572_case_091", "p02572_case_092", "p02572_case_093", "p02572_case_094", "p02572_case_095", "p02572_case_096", "p02572_case_097", "p02572_case_098", "p02572_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "mod = 10**9 + 7\nn = int(eval(input()))\na = list(map(int, input().split()))\nans = 0\nsum_arr = sum(a)\nfor i in a:\n sum_arr -= i\n ans += i * sum_arr\nprint((ans % mod))\n", "fast_code_sha256": "129ca6aa2f3da47302258a7b95626bdcb4dc210495f38dd965b8211161c04a1a", "fast_id": "p02572_129ca6aa2f3da47302258a7b95626bdcb4dc210495f38dd965b8211161c04a1a", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "mod = 10**9 + 7\nn = int(eval(input()))\na = list(map(int, input().split()))\nans = 0\nsum_arr = sum(a)\nfor i in a:\n sum_arr -= i\n ans += i * sum_arr\nprint((ans % mod))\n", "measured_fast_code_sha256": "129ca6aa2f3da47302258a7b95626bdcb4dc210495f38dd965b8211161c04a1a", "measured_slow_code": "import copy\n\nN = int(eval(input()))\nA = list(map(int, input().split()))\nmod = 10**9 + 7\npartial_sum = copy.deepcopy(A)\nsum_now = A[N - 1]\nfor j in range(N - 2, -1, -1):\n sum_now = int((sum_now + A[j]) % mod)\n partial_sum[j] = sum_now\nres = 0\nfor i in range(N - 1):\n res = (res + (A[i] * partial_sum[i + 1]) % mod) % mod\nprint((int(res)))\n", "measured_slow_code_sha256": "9a9a8c4412436852a66bfa0067b57c544f3aec7f532b2c46c6eaa958a2513451", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.5377631650811656, "pair_id": "python_v2_70743c3156a434a2f0ec2b88", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02572", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02572_129ca6aa2f3da47302258a7b95626bdcb4dc210495f38dd965b8211161c04a1a.jsonl.gz", "inputs": "reproduction/python/inputs/p02572.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02572_9a9a8c4412436852a66bfa0067b57c544f3aec7f532b2c46c6eaa958a2513451.jsonl.gz"}, "slow_code": "import copy\n\nN = int(eval(input()))\nA = list(map(int, input().split()))\nmod = 10**9 + 7\npartial_sum = copy.deepcopy(A)\nsum_now = A[N - 1]\nfor j in range(N - 2, -1, -1):\n sum_now = int((sum_now + A[j]) % mod)\n partial_sum[j] = sum_now\nres = 0\nfor i in range(N - 1):\n res = (res + (A[i] * partial_sum[i + 1]) % mod) % mod\nprint((int(res)))\n", "slow_code_sha256": "9a9a8c4412436852a66bfa0067b57c544f3aec7f532b2c46c6eaa958a2513451", "slow_id": "p02572_9a9a8c4412436852a66bfa0067b57c544f3aec7f532b2c46c6eaa958a2513451", "speedup": 4.503261903813874, "stratum": "4-8", "within_pair_jaccard": 0.46875, "workload": {"case_count": 100, "description": "For an array of N integers, sum a_i*a_j over all index pairs i= self.n:\n ret = 0\n return ret\n\n def enqueue(self, x):\n if self.next(self.s) == self.t:\n raise Exception(\"Overflow\")\n self.values[self.s] = x\n self.s = self.next(self.s)\n\n def dequeue(self):\n if self.s == self.t:\n raise Exception(\"Underflow\")\n ret = self.values[self.t]\n self.t = self.next(self.t)\n return ret\n\n\nn, q = list(map(int, input().split(\" \")))\nqueue = Queue(n + 1)\nfor _ in range(n):\n name, time = input().split(\" \")\n time = int(time)\n queue.enqueue((name, time))\ncompleted = []\ncur = 0\nwhile len(completed) < n:\n name, time = queue.dequeue()\n res = time - q\n if res <= 0:\n cur += time\n completed.append((name, cur))\n else:\n cur += q\n queue.enqueue((name, res))\nfor name, time in completed:\n print(name, time)\n", "measured_slow_code_sha256": "a1340768971238fb58507a0f8ca6f200e92420bac7eb4c6dd5fbd6b4ec30302d", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.009831727094215, "pair_id": "python_v2_1a85c593b2f4ad0a73e77ceb", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02264", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02264_13649e760c62f105bbb58fd1fc2b2e21247c4f0cfb9b134a986ababf099202b9.jsonl.gz", "inputs": "reproduction/python/inputs/p02264.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02264_a1340768971238fb58507a0f8ca6f200e92420bac7eb4c6dd5fbd6b4ec30302d.jsonl.gz"}, "slow_code": "class Queue:\n def __init__(self, n):\n self.values = [None] * n\n self.n = n\n self.s = 0\n self.t = 0\n\n def next(self, p):\n ret = p + 1\n if ret >= self.n:\n ret = 0\n return ret\n\n def enqueue(self, x):\n if self.next(self.s) == self.t:\n raise Exception(\"Overflow\")\n self.values[self.s] = x\n self.s = self.next(self.s)\n\n def dequeue(self):\n if self.s == self.t:\n raise Exception(\"Underflow\")\n ret = self.values[self.t]\n self.t = self.next(self.t)\n return ret\n\n\nn, q = list(map(int, input().split(\" \")))\nqueue = Queue(n + 1)\nfor _ in range(n):\n name, time = input().split(\" \")\n time = int(time)\n queue.enqueue((name, time))\ncompleted = []\ncur = 0\nwhile len(completed) < n:\n name, time = queue.dequeue()\n res = time - q\n if res <= 0:\n cur += time\n completed.append((name, cur))\n else:\n cur += q\n queue.enqueue((name, res))\nfor name, time in completed:\n print(name, time)\n", "slow_code_sha256": "a1340768971238fb58507a0f8ca6f200e92420bac7eb4c6dd5fbd6b4ec30302d", "slow_id": "p02264_a1340768971238fb58507a0f8ca6f200e92420bac7eb4c6dd5fbd6b4ec30302d", "speedup": 2.3190928578597094, "stratum": "2-4", "within_pair_jaccard": 0.3220338983050847, "workload": {"case_count": 100, "description": "Simulate round-robin scheduling for n processes initially queued in input order. Each has a name and required service duration time_i. Give each up to quantum q; requeue unfinished processes at the back. Output names and completion times in completion order. Observed inputs: n=1..100000 (median 30000); q=1..1000; time_i=1..50000; total_service=1..1000000 (median 1000000).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1300168, "median": 254526.5, "min": 11}, "input_format": ["n q\nname_1 time_1\n...\nname_n time_n"], "input_format_status": "source_input_section", "input_lines": {"max": 100001, "median": 30001.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200002, "median": 60002.0, "min": 4}}} -{"case_ids": ["p02763_case_000", "p02763_case_001", "p02763_case_002", "p02763_case_003", "p02763_case_004", "p02763_case_005", "p02763_case_006", "p02763_case_007", "p02763_case_008", "p02763_case_009", "p02763_case_010", "p02763_case_011", "p02763_case_012", "p02763_case_013", "p02763_case_014", "p02763_case_015", "p02763_case_016", "p02763_case_017", "p02763_case_018", "p02763_case_019", "p02763_case_020", "p02763_case_021", "p02763_case_022", "p02763_case_023", "p02763_case_024", "p02763_case_025", "p02763_case_026", "p02763_case_027", "p02763_case_028", "p02763_case_029", "p02763_case_030", "p02763_case_031", "p02763_case_032", "p02763_case_033", "p02763_case_034", "p02763_case_035", "p02763_case_036", "p02763_case_037", "p02763_case_038", "p02763_case_039", "p02763_case_040", "p02763_case_041", "p02763_case_042", "p02763_case_043", "p02763_case_044", "p02763_case_045", "p02763_case_046", "p02763_case_047", "p02763_case_048", "p02763_case_049", "p02763_case_050", "p02763_case_051", "p02763_case_052", "p02763_case_053", "p02763_case_054", "p02763_case_055", "p02763_case_056", "p02763_case_057", "p02763_case_058", "p02763_case_059", "p02763_case_060", "p02763_case_061", "p02763_case_062", "p02763_case_063", "p02763_case_064", "p02763_case_065", "p02763_case_066", "p02763_case_067", "p02763_case_068", "p02763_case_069", "p02763_case_070", "p02763_case_071", "p02763_case_072", "p02763_case_073", "p02763_case_074", "p02763_case_075", "p02763_case_076", "p02763_case_077", "p02763_case_078", "p02763_case_079", "p02763_case_080", "p02763_case_081", "p02763_case_082", "p02763_case_083", "p02763_case_084", "p02763_case_085", "p02763_case_086", "p02763_case_087", "p02763_case_088", "p02763_case_089", "p02763_case_090", "p02763_case_091", "p02763_case_092", "p02763_case_093", "p02763_case_094", "p02763_case_095", "p02763_case_096", "p02763_case_097", "p02763_case_098", "p02763_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "executable_AST_equal_except_explicit_explanatory_string_removal_and_all_frozen_inputs_checker_pass", "fast_code": "f = input\nn, s, q = int(f()), list(f()), int(f())\nd = {chr(97 + i): [] for i in range(26)}\nfor i in range(n):\n d[s[i]] += [i]\nfrom bisect import *\n\nfor i in range(q):\n a, b, c = f().split()\n b = int(b) - 1\n if a == \"1\":\n if s[b] == c:\n continue\n d[s[b]].pop(bisect(d[s[b]], b) - 1)\n s[b] = c\n insort(d[c], b)\n else:\n t = 0\n for l in list(d.values()):\n m = bisect(l, b - 1)\n if m < len(l) and l[m] < int(c):\n t += 1\n print(t)\n", "fast_code_sha256": "9ae81acdf62a7eab974b49bfdd746ffed7ee35c04fa2af21419e31fe779d2ee5", "fast_id": "p02763_9ae81acdf62a7eab974b49bfdd746ffed7ee35c04fa2af21419e31fe779d2ee5", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "f = input\nn, s, q = int(f()), list(f()), int(f())\nd = {chr(97 + i): [] for i in range(26)}\nfor i in range(n):\n d[s[i]] += [i]\nfrom bisect import *\n\nfor i in range(q):\n a, b, c = f().split()\n b = int(b) - 1\n if a == \"1\":\n if s[b] == c:\n continue\n d[s[b]].pop(bisect(d[s[b]], b) - 1)\n s[b] = c\n insort(d[c], b)\n else:\n t = 0\n for l in list(d.values()):\n m = bisect(l, b - 1)\n if m < len(l) and l[m] < int(c):\n t += 1\n print(t)\n", "measured_fast_code_sha256": "9ae81acdf62a7eab974b49bfdd746ffed7ee35c04fa2af21419e31fe779d2ee5", "measured_slow_code": "import sys\n\ninput = sys.stdin.readline\n\n\nclass Bit:\n def __init__(self, n):\n self.n = n\n self.tree = [0] * (n + 1)\n self.el = [0] * (n + 1)\n self.depth = n.bit_length() - 1\n\n def sum(self, i):\n \"\"\"区間[0,i) の総和を求める\"\"\"\n s = 0\n i -= 1\n while i >= 0:\n s += self.tree[i]\n i = (i & (i + 1)) - 1\n return s\n\n def add(self, i, x):\n \"\"\"i 番目の要素に x を足す\"\"\"\n self.el[i] += x\n while i < self.n:\n self.tree[i] += x\n i |= i + 1\n\n def get(self, i, j=None):\n \"\"\"部分区間和 [i, j)\"\"\"\n if j is None:\n return self.el[i]\n if i == 0:\n return self.sum(j)\n return self.sum(j) - self.sum(i)\n\n def lower_bound(self, x, equal=False):\n \"\"\"(a0+a1+...+ai < x となる最大の i, その時の a0+a1+...+ai )\n a0+a1+...+ai <= x としたい場合は equal = True\n 二分探索であるため、ai>=0 を満たす必要がある\"\"\"\n sum_ = 0\n pos = -1 # 1-indexed の時は pos = 0\n if not equal:\n for i in range(self.depth, -1, -1):\n k = pos + (1 << i)\n if k < self.n and sum_ + self.tree[k] < x: # 1-indexed の時は k <= self.n\n sum_ += self.tree[k]\n pos += 1 << i\n if equal:\n for i in range(self.depth, -1, -1):\n k = pos + (1 << i)\n if k < self.n and sum_ + self.tree[k] <= x: # 1-indexed の時は k <= self.n\n sum_ += self.tree[k]\n pos += 1 << i\n return pos, sum_\n\n def __getitem__(self, s):\n \"\"\"[a0, a1, a2, ...]\"\"\"\n return self.el[s]\n\n def __iter__(self):\n \"\"\"[a0, a1, a2, ...]\"\"\"\n for s in self.el[: self.n]:\n yield s\n\n def __str__(self):\n text1 = \" \".join([\"element: \"] + list(map(str, self)))\n text2 = \" \".join(\n [\"cumsum(1-indexed): \"]\n + list(str(self.sum(i)) for i in range(1, self.n + 1))\n )\n return \"\\n\".join((text1, text2))\n\n\n####################################################################################################\nimport string\n\nN = int(eval(input()))\nS = input().strip()\nQ = int(eval(input()))\nB = [Bit(N) for _ in range(26)]\nabc = string.ascii_lowercase # [a-z] をロード\nabc2 = dict()\nfor i, s in enumerate(abc):\n abc2[s] = i\nfor i, s in enumerate(S):\n B[abc2[s]].add(i, 1)\nfor _ in range(Q):\n q = list(input().split())\n if q[0] == \"1\":\n a = int(q[1]) - 1\n b = q[2]\n for i in range(26):\n if B[i].el[a] == 1:\n B[i].add(a, -1)\n B[abc2[b]].add(a, 1)\n if q[0] == \"2\":\n a = int(q[1]) - 1\n b = int(q[2]) - 1\n res = 0\n for i in range(26):\n res += B[i].get(a, b + 1) > 0\n print(res)\n", "measured_slow_code_sha256": "f48f6f3e37812c17b5337b9141da770a977eb3ae11af352f28286963282fd6ed", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 5.594264508292427, "pair_id": "python_v2_93fad12df76f7594488f9d59", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02763", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02763_9ae81acdf62a7eab974b49bfdd746ffed7ee35c04fa2af21419e31fe779d2ee5.jsonl.gz", "inputs": "reproduction/python/inputs/p02763.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02763_f48f6f3e37812c17b5337b9141da770a977eb3ae11af352f28286963282fd6ed.jsonl.gz"}, "slow_code": "import sys\n\ninput = sys.stdin.readline\n\n\nclass Bit:\n def __init__(self, n):\n self.n = n\n self.tree = [0] * (n + 1)\n self.el = [0] * (n + 1)\n self.depth = n.bit_length() - 1\n\n def sum(self, i):\n s = 0\n i -= 1\n while i >= 0:\n s += self.tree[i]\n i = (i & (i + 1)) - 1\n return s\n\n def add(self, i, x):\n self.el[i] += x\n while i < self.n:\n self.tree[i] += x\n i |= i + 1\n\n def get(self, i, j=None):\n if j is None:\n return self.el[i]\n if i == 0:\n return self.sum(j)\n return self.sum(j) - self.sum(i)\n\n def lower_bound(self, x, equal=False):\n sum_ = 0\n pos = -1\n if not equal:\n for i in range(self.depth, -1, -1):\n k = pos + (1 << i)\n if k < self.n and sum_ + self.tree[k] < x:\n sum_ += self.tree[k]\n pos += 1 << i\n if equal:\n for i in range(self.depth, -1, -1):\n k = pos + (1 << i)\n if k < self.n and sum_ + self.tree[k] <= x:\n sum_ += self.tree[k]\n pos += 1 << i\n return pos, sum_\n\n def __getitem__(self, s):\n return self.el[s]\n\n def __iter__(self):\n for s in self.el[: self.n]:\n yield s\n\n def __str__(self):\n text1 = \" \".join([\"element: \"] + list(map(str, self)))\n text2 = \" \".join(\n [\"cumsum(1-indexed): \"]\n + list(str(self.sum(i)) for i in range(1, self.n + 1))\n )\n return \"\\n\".join((text1, text2))\n\n\nimport string\n\nN = int(eval(input()))\nS = input().strip()\nQ = int(eval(input()))\nB = [Bit(N) for _ in range(26)]\nabc = string.ascii_lowercase\nabc2 = dict()\nfor i, s in enumerate(abc):\n abc2[s] = i\nfor i, s in enumerate(S):\n B[abc2[s]].add(i, 1)\nfor _ in range(Q):\n q = list(input().split())\n if q[0] == \"1\":\n a = int(q[1]) - 1\n b = q[2]\n for i in range(26):\n if B[i].el[a] == 1:\n B[i].add(a, -1)\n B[abc2[b]].add(a, 1)\n if q[0] == \"2\":\n a = int(q[1]) - 1\n b = int(q[2]) - 1\n res = 0\n for i in range(26):\n res += B[i].get(a, b + 1) > 0\n print(res)\n", "slow_code_sha256": "4fa4a65e4a0df3861053325cb01fa333b2482712b297bcf1214920d237936687", "slow_id": "p02763_f48f6f3e37812c17b5337b9141da770a977eb3ae11af352f28286963282fd6ed", "speedup": 5.188631375856921, "stratum": "4-8", "within_pair_jaccard": 0.18867924528301888, "workload": {"case_count": 100, "description": "Process Q ordered queries on a lowercase string S of length N. Query 1 i c replaces character i with c; query 2 l r reports the number of distinct letters in inclusive substring [l,r]. At least one type-2 query occurs. Observed inputs: N=1..500000 (median 500000); Q=1..20000 (median 20000); type1_count=0..19999; type2_count=1..20000; substring_length=1..500000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 815322, "median": 720014.0, "min": 12}, "input_format": ["N\nS\nQ\nQ query lines, each: 1 i c or 2 l r"], "input_format_status": "source_input_section", "input_lines": {"max": 20003, "median": 20003.0, "min": 4}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 60003, "median": 60003.0, "min": 6}}} -{"case_ids": ["p03449_case_000", "p03449_case_001", "p03449_case_002", "p03449_case_003", "p03449_case_004", "p03449_case_005", "p03449_case_006", "p03449_case_007", "p03449_case_008", "p03449_case_009", "p03449_case_010", "p03449_case_011", "p03449_case_012", "p03449_case_013", "p03449_case_014", "p03449_case_015", "p03449_case_016", "p03449_case_017", "p03449_case_018", "p03449_case_019", "p03449_case_020", "p03449_case_021", "p03449_case_022", "p03449_case_023", "p03449_case_024", "p03449_case_025", "p03449_case_026", "p03449_case_027", "p03449_case_028", "p03449_case_029", "p03449_case_030", "p03449_case_031", "p03449_case_032", "p03449_case_033", "p03449_case_034", "p03449_case_035", "p03449_case_036", "p03449_case_037", "p03449_case_038", "p03449_case_039", "p03449_case_040", "p03449_case_041", "p03449_case_042", "p03449_case_043", "p03449_case_044", "p03449_case_045", "p03449_case_046", "p03449_case_047", "p03449_case_048", "p03449_case_049", "p03449_case_050", "p03449_case_051", "p03449_case_052", "p03449_case_053", "p03449_case_054", "p03449_case_055", "p03449_case_056", "p03449_case_057", "p03449_case_058", "p03449_case_059", "p03449_case_060", "p03449_case_061", "p03449_case_062", "p03449_case_063", "p03449_case_064", "p03449_case_065", "p03449_case_066", "p03449_case_067", "p03449_case_068", "p03449_case_069", "p03449_case_070", "p03449_case_071", "p03449_case_072", "p03449_case_073", "p03449_case_074", "p03449_case_075", "p03449_case_076", "p03449_case_077", "p03449_case_078", "p03449_case_079", "p03449_case_080", "p03449_case_081", "p03449_case_082", "p03449_case_083", "p03449_case_084", "p03449_case_085", "p03449_case_086", "p03449_case_087", "p03449_case_088", "p03449_case_089", "p03449_case_090", "p03449_case_091", "p03449_case_092", "p03449_case_093", "p03449_case_094", "p03449_case_095", "p03449_case_096", "p03449_case_097", "p03449_case_098", "p03449_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n, *a = list(map(int, open(0).read().split()))\nprint((max(sum(a[: i + 1] + a[n + i :]) for i in range(n))))\n", "fast_code_sha256": "05f7e2460f3fd41e1d0a4a0e68deb81c5f3b00895b29aad014048cf67771eb3e", "fast_id": "p03449_05f7e2460f3fd41e1d0a4a0e68deb81c5f3b00895b29aad014048cf67771eb3e", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n, *a = list(map(int, open(0).read().split()))\nprint((max(sum(a[: i + 1] + a[n + i :]) for i in range(n))))\n", "measured_fast_code_sha256": "05f7e2460f3fd41e1d0a4a0e68deb81c5f3b00895b29aad014048cf67771eb3e", "measured_slow_code": "#!/usr/bin/env python3\nimport sys\n\n\ndef dfs(x: int, y: int):\n if y == 1 and x == (N - 1):\n return A[y][x]\n elif y > 1 or x > N - 1:\n return 0\n else:\n return max(dfs(x + 1, y), dfs(x, y + 1)) + A[y][x]\n\n\ndef solve(N: int, A: \"List[List[int]]\"):\n print((dfs(0, 0)))\n return\n\n\n# Generated by 1.1.5 https://github.com/kyuridenamida/atcoder-tools (tips: You use the default template now. You can remove this line by using your custom template)\ndef main():\n def iterate_tokens():\n for line in sys.stdin:\n for word in line.split():\n yield word\n\n tokens = iterate_tokens()\n global N, A\n N = int(next(tokens)) # type: int\n A = [\n [int(next(tokens)) for _ in range(N)] for _ in range(2)\n ] # type: \"List[List[int]]\"\n solve(N, A)\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "4f58caefb49442690396b859be0085109334a84091e907cb62b5503b39be5afa", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 9.379006759617344, "pair_id": "python_v2_d7acde09970c6f74ea96e7cb", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03449", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03449_05f7e2460f3fd41e1d0a4a0e68deb81c5f3b00895b29aad014048cf67771eb3e.jsonl.gz", "inputs": "reproduction/python/inputs/p03449.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03449_4f58caefb49442690396b859be0085109334a84091e907cb62b5503b39be5afa.jsonl.gz"}, "slow_code": "import sys\n\n\ndef dfs(x: int, y: int):\n if y == 1 and x == (N - 1):\n return A[y][x]\n elif y > 1 or x > N - 1:\n return 0\n else:\n return max(dfs(x + 1, y), dfs(x, y + 1)) + A[y][x]\n\n\ndef solve(N: int, A: \"List[List[int]]\"):\n print((dfs(0, 0)))\n return\n\n\ndef main():\n def iterate_tokens():\n for line in sys.stdin:\n for word in line.split():\n yield word\n\n tokens = iterate_tokens()\n global N, A\n N = int(next(tokens))\n A = [[int(next(tokens)) for _ in range(N)] for _ in range(2)]\n solve(N, A)\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "16e134b9190b06e98124559663599dcf24302b97cd85dfc00b6b6350ef402631", "slow_id": "p03449_4f58caefb49442690396b859be0085109334a84091e907cb62b5503b39be5afa", "speedup": 7.066906584518042, "stratum": "4-8", "within_pair_jaccard": 0.1956521739130435, "workload": {"case_count": 100, "description": "Traverse a 2-by-N candy grid from (1,1) to (2,N), moving only right or down and collecting each visited cell, including endpoints. Maximize collected candies. Observed inputs: N=1..100 (median 50); A_i_j=1..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 804, "median": 294.5, "min": 6}, "input_format": ["N\nA_1,1 ... A_1,N\nA_2,1 ... A_2,N"], "input_format_status": "source_input_section", "input_lines": {"max": 3, "median": 3.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 201, "median": 101.0, "min": 3}}} -{"case_ids": ["p02725_case_000", "p02725_case_001", "p02725_case_002", "p02725_case_003", "p02725_case_004", "p02725_case_005", "p02725_case_006", "p02725_case_007", "p02725_case_008", "p02725_case_009", "p02725_case_010", "p02725_case_011", "p02725_case_012", "p02725_case_013", "p02725_case_014", "p02725_case_015", "p02725_case_016", "p02725_case_017", "p02725_case_018", "p02725_case_019", "p02725_case_020", "p02725_case_021", "p02725_case_022", "p02725_case_023", "p02725_case_024", "p02725_case_025", "p02725_case_026", "p02725_case_027", "p02725_case_028", "p02725_case_029", "p02725_case_030", "p02725_case_031", "p02725_case_032", "p02725_case_033", "p02725_case_034", "p02725_case_035", "p02725_case_036", "p02725_case_037", "p02725_case_038", "p02725_case_039", "p02725_case_040", "p02725_case_041", "p02725_case_042", "p02725_case_043", "p02725_case_044", "p02725_case_045", "p02725_case_046", "p02725_case_047", "p02725_case_048", "p02725_case_049", "p02725_case_050", "p02725_case_051", "p02725_case_052", "p02725_case_053", "p02725_case_054", "p02725_case_055", "p02725_case_056", "p02725_case_057", "p02725_case_058", "p02725_case_059", "p02725_case_060", "p02725_case_061", "p02725_case_062", "p02725_case_063", "p02725_case_064", "p02725_case_065", "p02725_case_066", "p02725_case_067", "p02725_case_068", "p02725_case_069", "p02725_case_070", "p02725_case_071", "p02725_case_072", "p02725_case_073", "p02725_case_074", "p02725_case_075", "p02725_case_076", "p02725_case_077", "p02725_case_078", "p02725_case_079", "p02725_case_080", "p02725_case_081", "p02725_case_082", "p02725_case_083", "p02725_case_084", "p02725_case_085", "p02725_case_086", "p02725_case_087", "p02725_case_088", "p02725_case_089", "p02725_case_090", "p02725_case_091", "p02725_case_092", "p02725_case_093", "p02725_case_094", "p02725_case_095", "p02725_case_096", "p02725_case_097", "p02725_case_098", "p02725_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "K, N = list(map(int, input().split()))\nA = list(map(int, input().split()))\nA += [A[0] + K]\nprint((min(K - (A[i + 1] - A[i]) for i in range(N))))\n", "fast_code_sha256": "b57e83c6251a91cd14cc8a0ec267c4181918473e124f681fae786b1f47792bfc", "fast_id": "p02725_b57e83c6251a91cd14cc8a0ec267c4181918473e124f681fae786b1f47792bfc", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "K, N = list(map(int, input().split()))\nA = list(map(int, input().split()))\nA += [A[0] + K]\nprint((min(K - (A[i + 1] - A[i]) for i in range(N))))\n", "measured_fast_code_sha256": "b57e83c6251a91cd14cc8a0ec267c4181918473e124f681fae786b1f47792bfc", "measured_slow_code": "from sys import stdin\n\ninp = stdin.readline\nn, k = [int(x) for x in inp().strip().split()]\narray = [int(x) for x in inp().strip().split()]\ndistance = [0] * (k * 2)\nfor i in range(k - 1):\n distance[i] = array[i + 1] - array[i]\ndistance[k - 1] = n - array[k - 1] + array[0]\ndistance[2 * k - 1] = n - array[k - 1] + array[0]\nfor i in range(k - 1):\n distance[k + i] = array[i + 1] - array[i]\nminimum = 999999999\ncount = 0\ntotal = 0\ncountLimit = k - 1\nfor i in range(k * 2):\n if count < countLimit:\n total += distance[i]\n count += 1\n else:\n if minimum > total:\n minimum = total\n total += distance[i]\n total -= distance[i - countLimit]\nprint(minimum)\n", "measured_slow_code_sha256": "9164aae6c8839a29a40c85ad8ba3bfc05c8440fc08a285145380122a94d7f972", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.9778135420322385, "pair_id": "python_v2_171adb17178daf29156abc35", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02725", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02725_b57e83c6251a91cd14cc8a0ec267c4181918473e124f681fae786b1f47792bfc.jsonl.gz", "inputs": "reproduction/python/inputs/p02725.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02725_9164aae6c8839a29a40c85ad8ba3bfc05c8440fc08a285145380122a94d7f972.jsonl.gz"}, "slow_code": "from sys import stdin\n\ninp = stdin.readline\nn, k = [int(x) for x in inp().strip().split()]\narray = [int(x) for x in inp().strip().split()]\ndistance = [0] * (k * 2)\nfor i in range(k - 1):\n distance[i] = array[i + 1] - array[i]\ndistance[k - 1] = n - array[k - 1] + array[0]\ndistance[2 * k - 1] = n - array[k - 1] + array[0]\nfor i in range(k - 1):\n distance[k + i] = array[i + 1] - array[i]\nminimum = 999999999\ncount = 0\ntotal = 0\ncountLimit = k - 1\nfor i in range(k * 2):\n if count < countLimit:\n total += distance[i]\n count += 1\n else:\n if minimum > total:\n minimum = total\n total += distance[i]\n total -= distance[i - countLimit]\nprint(minimum)\n", "slow_code_sha256": "9164aae6c8839a29a40c85ad8ba3bfc05c8440fc08a285145380122a94d7f972", "slow_id": "p02725_9164aae6c8839a29a40c85ad8ba3bfc05c8440fc08a285145380122a94d7f972", "speedup": 3.2626160575863103, "stratum": "2-4", "within_pair_jaccard": 0.25, "workload": {"case_count": 100, "description": "On a circular path of circumference K, houses have strictly increasing clockwise positions A_i. Starting at any house, find the minimum distance along the circle needed to visit all N houses; return to the start is not required. Observed inputs: K=2..1000000 (median 100); N=2..200000 (median 50); A_i=0..999999.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1399579, "median": 156.0, "min": 8}, "input_format": ["K N\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200002, "median": 52.0, "min": 4}}} -{"case_ids": ["p02956_case_000", "p02956_case_001", "p02956_case_002", "p02956_case_003", "p02956_case_004", "p02956_case_005", "p02956_case_006", "p02956_case_007", "p02956_case_008", "p02956_case_009", "p02956_case_010", "p02956_case_011", "p02956_case_012", "p02956_case_013", "p02956_case_014", "p02956_case_015", "p02956_case_016", "p02956_case_017", "p02956_case_018", "p02956_case_019", "p02956_case_020", "p02956_case_021", "p02956_case_022", "p02956_case_023", "p02956_case_024", "p02956_case_025", "p02956_case_026", "p02956_case_027", "p02956_case_028", "p02956_case_029", "p02956_case_030", "p02956_case_031", "p02956_case_032", "p02956_case_033", "p02956_case_034", "p02956_case_035", "p02956_case_036", "p02956_case_037", "p02956_case_038", "p02956_case_039", "p02956_case_040", "p02956_case_041", "p02956_case_042", "p02956_case_043", "p02956_case_044", "p02956_case_045", "p02956_case_046", "p02956_case_047", "p02956_case_048", "p02956_case_049", "p02956_case_050", "p02956_case_051", "p02956_case_052", "p02956_case_053", "p02956_case_054", "p02956_case_055", "p02956_case_056", "p02956_case_057", "p02956_case_058", "p02956_case_059", "p02956_case_060", "p02956_case_061", "p02956_case_062", "p02956_case_063", "p02956_case_064", "p02956_case_065", "p02956_case_066", "p02956_case_067", "p02956_case_068", "p02956_case_069", "p02956_case_070", "p02956_case_071", "p02956_case_072", "p02956_case_073", "p02956_case_074", "p02956_case_075", "p02956_case_076", "p02956_case_077", "p02956_case_078", "p02956_case_079", "p02956_case_080", "p02956_case_081", "p02956_case_082", "p02956_case_083", "p02956_case_084", "p02956_case_085", "p02956_case_086", "p02956_case_087", "p02956_case_088", "p02956_case_089", "p02956_case_090", "p02956_case_091", "p02956_case_092", "p02956_case_093", "p02956_case_094", "p02956_case_095", "p02956_case_096", "p02956_case_097", "p02956_case_098", "p02956_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys, queue, math, copy, itertools, bisect, collections, heapq\n\n\ndef main():\n MOD = 998244353\n LI = lambda: [int(x) for x in sys.stdin.readline().split()]\n NI = lambda: int(sys.stdin.readline())\n N = NI()\n dat = [LI() for _ in range(N)]\n dat.sort()\n yo = [y for _, y in dat]\n yo.sort()\n up = [0] * N\n dw = [0] * N\n bit = [0] * (N + 1)\n\n def bit_add(i):\n while i <= N:\n bit[i] += 1\n i += i & -i\n\n def bit_sum(i):\n ret = 0\n while i > 0:\n ret += bit[i]\n i -= i & -i\n return ret\n\n for i in range(N):\n x, y = dat[i]\n y = bisect.bisect_left(yo, y) + 1\n up[i] = bit_sum(y)\n bit_add(y)\n bit = [0] * (N + 1)\n for i in range(N - 1, -1, -1):\n x, y = dat[i]\n y = bisect.bisect_left(yo, y) + 1\n dw[i] = bit_sum(y)\n bit_add(y)\n ans = N * pow(2, N - 1, MOD)\n for i in range(N):\n a = i - up[i]\n b = up[i]\n c = N - (i + 1) - dw[i]\n d = dw[i]\n pa = pow(2, a, MOD)\n pb = pow(2, b, MOD)\n pc = pow(2, c, MOD)\n pd = pow(2, d, MOD)\n p = (pow(2, a + d, MOD) - 1) - (pa - 1) - (pd - 1)\n q = (pow(2, b + c, MOD) - 1) - (pb - 1) - (pc - 1)\n x = p * (pb + pc - 1)\n y = q * (pa + pd - 1)\n z = p * q\n ans = (ans + x + y + z) % MOD\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "5fb4e470bffee1e77fe67869002cfa051bc0f9ceb4f803ffff28bd835f4edb34", "fast_id": "p02956_5fb4e470bffee1e77fe67869002cfa051bc0f9ceb4f803ffff28bd835f4edb34", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys, queue, math, copy, itertools, bisect, collections, heapq\n\n\ndef main():\n MOD = 998244353\n LI = lambda: [int(x) for x in sys.stdin.readline().split()]\n NI = lambda: int(sys.stdin.readline())\n N = NI()\n dat = [LI() for _ in range(N)]\n dat.sort()\n yo = [y for _, y in dat]\n yo.sort()\n up = [0] * N\n dw = [0] * N\n bit = [0] * (N + 1)\n\n def bit_add(i):\n while i <= N:\n bit[i] += 1\n i += i & -i\n\n def bit_sum(i):\n ret = 0\n while i > 0:\n ret += bit[i]\n i -= i & -i\n return ret\n\n for i in range(N):\n x, y = dat[i]\n y = bisect.bisect_left(yo, y) + 1\n up[i] = bit_sum(y)\n bit_add(y)\n bit = [0] * (N + 1)\n for i in range(N - 1, -1, -1):\n x, y = dat[i]\n y = bisect.bisect_left(yo, y) + 1\n dw[i] = bit_sum(y)\n bit_add(y)\n ans = N * pow(2, N - 1, MOD)\n for i in range(N):\n a = i - up[i]\n b = up[i]\n c = N - (i + 1) - dw[i]\n d = dw[i]\n pa = pow(2, a, MOD)\n pb = pow(2, b, MOD)\n pc = pow(2, c, MOD)\n pd = pow(2, d, MOD)\n p = (pow(2, a + d, MOD) - 1) - (pa - 1) - (pd - 1)\n q = (pow(2, b + c, MOD) - 1) - (pb - 1) - (pc - 1)\n x = p * (pb + pc - 1)\n y = q * (pa + pd - 1)\n z = p * q\n ans = (ans + x + y + z) % MOD\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "5fb4e470bffee1e77fe67869002cfa051bc0f9ceb4f803ffff28bd835f4edb34", "measured_slow_code": "import sys\n\nreadline = sys.stdin.readline\n\n\nclass BIT:\n # 1-indexed\n def __init__(self, n):\n self.size = n\n self.tree = [0] * (n + 1)\n self.p = 2 ** (n.bit_length() - 1)\n self.dep = n.bit_length()\n\n def get(self, i):\n s = 0\n while i > 0:\n s += self.tree[i]\n i -= i & -i\n return s\n\n def add(self, i, x):\n while i <= self.size:\n self.tree[i] += x\n i += i & -i\n\n def bl(self, v):\n if v <= 0:\n return -1\n s = 0\n k = self.p\n for _ in range(self.dep):\n if s + k <= self.size and self.tree[s + k] < v:\n s += k\n v -= self.tree[s + k]\n k //= 2\n return s + 1\n\n\ndef compress(L):\n L2 = list(set(L))\n L2.sort()\n C = {v: k for k, v in enumerate(L2)}\n return L2, C\n\n\nMOD = 998244353\nN = int(readline())\nXY = [list(map(int, readline().split())) for _ in range(N)]\nXY.sort()\nZ = [-(10**10)]\nfor x, y in XY:\n Z.append(y)\n_, CC = compress(Z)\nXY = [(x, CC[y]) for x, y in XY]\nSS, SB, BS, BB = [None] * N, [None] * N, [None] * N, [None] * N\nT = BIT(N)\nfor i in range(N):\n k = i\n y = XY[i][1]\n l = T.get(y)\n SS[i] = l\n SB[i] = k - l\n T.add(y, 1)\nT = BIT(N)\nfor i in range(N - 1, -1, -1):\n k = N - 1 - i\n y = XY[i][1]\n l = T.get(y)\n BS[i] = l\n BB[i] = k - l\n T.add(y, 1)\nP2 = [1] * 1341398\nfor i in range(1, len(P2)):\n P2[i] = P2[i - 1] * 2 % MOD\nans = 0\nfor i in range(N):\n ss = SS[i]\n sb = SB[i]\n bs = BS[i]\n bb = BB[i]\n ans = (ans + P2[N - 1]) % MOD\n ans = (ans + P2[N - 1 - ss - bb] * (P2[ss] - 1) * (P2[bb] - 1)) % MOD\n ans = (ans + P2[N - 1 - sb - bs] * (P2[sb] - 1) * (P2[bs] - 1)) % MOD\n ans = (ans - (P2[sb] - 1) * (P2[bs] - 1) * (P2[ss] - 1) * (P2[bb] - 1)) % MOD\nprint(ans)\n", "measured_slow_code_sha256": "8042986ea709f7be4a36940bb65dd281b3740a58e66e7c9edcc0eeee56205242", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 28.048516426333777, "pair_id": "python_v2_1e05de470351fb5b0d74ea16", "per_case_slow_code_faster_fraction": 0.13, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02956", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02956_5fb4e470bffee1e77fe67869002cfa051bc0f9ceb4f803ffff28bd835f4edb34.jsonl.gz", "inputs": "reproduction/python/inputs/p02956.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02956_8042986ea709f7be4a36940bb65dd281b3740a58e66e7c9edcc0eeee56205242.jsonl.gz"}, "slow_code": "import sys\n\nreadline = sys.stdin.readline\n\n\nclass BIT:\n\n def __init__(self, n):\n self.size = n\n self.tree = [0] * (n + 1)\n self.p = 2 ** (n.bit_length() - 1)\n self.dep = n.bit_length()\n\n def get(self, i):\n s = 0\n while i > 0:\n s += self.tree[i]\n i -= i & -i\n return s\n\n def add(self, i, x):\n while i <= self.size:\n self.tree[i] += x\n i += i & -i\n\n def bl(self, v):\n if v <= 0:\n return -1\n s = 0\n k = self.p\n for _ in range(self.dep):\n if s + k <= self.size and self.tree[s + k] < v:\n s += k\n v -= self.tree[s + k]\n k //= 2\n return s + 1\n\n\ndef compress(L):\n L2 = list(set(L))\n L2.sort()\n C = {v: k for k, v in enumerate(L2)}\n return L2, C\n\n\nMOD = 998244353\nN = int(readline())\nXY = [list(map(int, readline().split())) for _ in range(N)]\nXY.sort()\nZ = [-(10**10)]\nfor x, y in XY:\n Z.append(y)\n_, CC = compress(Z)\nXY = [(x, CC[y]) for x, y in XY]\nSS, SB, BS, BB = [None] * N, [None] * N, [None] * N, [None] * N\nT = BIT(N)\nfor i in range(N):\n k = i\n y = XY[i][1]\n l = T.get(y)\n SS[i] = l\n SB[i] = k - l\n T.add(y, 1)\nT = BIT(N)\nfor i in range(N - 1, -1, -1):\n k = N - 1 - i\n y = XY[i][1]\n l = T.get(y)\n BS[i] = l\n BB[i] = k - l\n T.add(y, 1)\nP2 = [1] * 1341398\nfor i in range(1, len(P2)):\n P2[i] = P2[i - 1] * 2 % MOD\nans = 0\nfor i in range(N):\n ss = SS[i]\n sb = SB[i]\n bs = BS[i]\n bb = BB[i]\n ans = (ans + P2[N - 1]) % MOD\n ans = (ans + P2[N - 1 - ss - bb] * (P2[ss] - 1) * (P2[bb] - 1)) % MOD\n ans = (ans + P2[N - 1 - sb - bs] * (P2[sb] - 1) * (P2[bs] - 1)) % MOD\n ans = (ans - (P2[sb] - 1) * (P2[bs] - 1) * (P2[ss] - 1) * (P2[bb] - 1)) % MOD\nprint(ans)\n", "slow_code_sha256": "e43f92f24f0e96eef9c4232af95007e4efdc9b0608e734256316ff5cc0636981", "slow_id": "p02956_8042986ea709f7be4a36940bb65dd281b3740a58e66e7c9edcc0eeee56205242", "speedup": 29.925813049095755, "stratum": "8+", "within_pair_jaccard": 0.2621359223300971, "workload": {"case_count": 100, "description": "For each nonempty subset of N plane points, count all original points in its smallest axis-aligned bounding rectangle, including boundaries. Sum these counts modulo 998244353. All x coordinates are distinct, as are all y coordinates. Observed inputs: N=1..200000 (median 1000); x_i=-1000000000..1000000000; y_i=-1000000000..999999000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 4200009, "median": 20809.0, "min": 20}, "input_format": ["N\nx_1 y_1\n...\nx_N y_N"], "input_format_status": "source_input_section", "input_lines": {"max": 200001, "median": 1001.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 400001, "median": 2001.0, "min": 3}}} -{"case_ids": ["p02922_case_000", "p02922_case_001", "p02922_case_002", "p02922_case_003", "p02922_case_004", "p02922_case_005", "p02922_case_006", "p02922_case_007", "p02922_case_008", "p02922_case_009", "p02922_case_010", "p02922_case_011", "p02922_case_012", "p02922_case_013", "p02922_case_014", "p02922_case_015", "p02922_case_016", "p02922_case_017", "p02922_case_018", "p02922_case_019", "p02922_case_020", "p02922_case_021", "p02922_case_022", "p02922_case_023", "p02922_case_024", "p02922_case_025", "p02922_case_026", "p02922_case_027", "p02922_case_028", "p02922_case_029", "p02922_case_030", "p02922_case_031", "p02922_case_032", "p02922_case_033", "p02922_case_034", "p02922_case_035", "p02922_case_036", "p02922_case_037", "p02922_case_038", "p02922_case_039", "p02922_case_040", "p02922_case_041", "p02922_case_042", "p02922_case_043", "p02922_case_044", "p02922_case_045", "p02922_case_046", "p02922_case_047", "p02922_case_048", "p02922_case_049", "p02922_case_050", "p02922_case_051", "p02922_case_052", "p02922_case_053", "p02922_case_054", "p02922_case_055", "p02922_case_056", "p02922_case_057", "p02922_case_058", "p02922_case_059", "p02922_case_060", "p02922_case_061", "p02922_case_062", "p02922_case_063", "p02922_case_064", "p02922_case_065", "p02922_case_066", "p02922_case_067", "p02922_case_068", "p02922_case_069", "p02922_case_070", "p02922_case_071", "p02922_case_072", "p02922_case_073", "p02922_case_074", "p02922_case_075", "p02922_case_076", "p02922_case_077", "p02922_case_078", "p02922_case_079", "p02922_case_080", "p02922_case_081", "p02922_case_082", "p02922_case_083", "p02922_case_084", "p02922_case_085", "p02922_case_086", "p02922_case_087", "p02922_case_088", "p02922_case_089", "p02922_case_090", "p02922_case_091", "p02922_case_092", "p02922_case_093", "p02922_case_094", "p02922_case_095", "p02922_case_096", "p02922_case_097", "p02922_case_098", "p02922_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\n\ndef solve(A: int, B: int):\n p = 1\n ans = 0\n while True:\n if p >= B:\n print(ans)\n break\n p -= 1\n p += A\n ans += 1\n return\n\n\ndef main():\n def iterate_tokens():\n for line in sys.stdin:\n for word in line.split():\n yield word\n\n tokens = iterate_tokens()\n A = int(next(tokens))\n B = int(next(tokens))\n solve(A, B)\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "46d5e13d5ee73381d9edbaa5ce879fa747d9ae74e5e035474c2d621e154c6e6e", "fast_id": "p02922_08173dc7c11027f0eed162aa363c1a786f81ea8654ddd1eac0ed7859fb6b50d8", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "#!/usr/bin/env python3\nimport sys\n\n\ndef solve(A: int, B: int):\n p = 1\n ans = 0\n while True:\n if p >= B:\n print(ans)\n break\n p -= 1\n p += A\n ans += 1\n return\n\n\n# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools (tips: You use the default template now. You can remove this line by using your custom template)\ndef main():\n def iterate_tokens():\n for line in sys.stdin:\n for word in line.split():\n yield word\n\n tokens = iterate_tokens()\n A = int(next(tokens)) # type: int\n B = int(next(tokens)) # type: int\n solve(A, B)\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "08173dc7c11027f0eed162aa363c1a786f81ea8654ddd1eac0ed7859fb6b50d8", "measured_slow_code": "from copy import deepcopy\nfrom math import ceil\n\nif __name__ == \"__main__\":\n a = list(map(int, input().split()))\n n = deepcopy(a[0])\n i = 1\n if a[0] == a[1]:\n print(i)\n elif a[1] == 1:\n print((0))\n elif a[0] >= a[1]:\n print(i)\n else:\n while True:\n i += 1\n n += a[0] - 1\n if n >= a[1]:\n print(i)\n break\n", "measured_slow_code_sha256": "00e867b7d2095675b21d44aa0203e42270e0c7d7b6d93feade6e801e5b2a696c", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4.622987592431154, "pair_id": "python_v2_fe32902956aa84a98f191407", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02922", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02922_08173dc7c11027f0eed162aa363c1a786f81ea8654ddd1eac0ed7859fb6b50d8.jsonl.gz", "inputs": "reproduction/python/inputs/p02922.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02922_00e867b7d2095675b21d44aa0203e42270e0c7d7b6d93feade6e801e5b2a696c.jsonl.gz"}, "slow_code": "from copy import deepcopy\nfrom math import ceil\n\nif __name__ == \"__main__\":\n a = list(map(int, input().split()))\n n = deepcopy(a[0])\n i = 1\n if a[0] == a[1]:\n print(i)\n elif a[1] == 1:\n print((0))\n elif a[0] >= a[1]:\n print(i)\n else:\n while True:\n i += 1\n n += a[0] - 1\n if n >= a[1]:\n print(i)\n break\n", "slow_code_sha256": "00e867b7d2095675b21d44aa0203e42270e0c7d7b6d93feade6e801e5b2a696c", "slow_id": "p02922_00e867b7d2095675b21d44aa0203e42270e0c7d7b6d93feade6e801e5b2a696c", "speedup": 4.622853502329994, "stratum": "4-8", "within_pair_jaccard": 0.27906976744186046, "workload": {"case_count": 100, "description": "Start with one empty electrical socket. Installing a strip consumes one socket and provides A empty sockets. Find the fewest strips needed to have at least B empty sockets. Observed inputs: A=2..20 (median 8); B=1..20 (median 7).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 6, "median": 4.5, "min": 4}, "input_format": ["A B"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p02628_case_000", "p02628_case_001", "p02628_case_002", "p02628_case_003", "p02628_case_004", "p02628_case_005", "p02628_case_006", "p02628_case_007", "p02628_case_008", "p02628_case_009", "p02628_case_010", "p02628_case_011", "p02628_case_012", "p02628_case_013", "p02628_case_014", "p02628_case_015", "p02628_case_016", "p02628_case_017", "p02628_case_018", "p02628_case_019", "p02628_case_020", "p02628_case_021", "p02628_case_022", "p02628_case_023", "p02628_case_024", "p02628_case_025", "p02628_case_026", "p02628_case_027", "p02628_case_028", "p02628_case_029", "p02628_case_030", "p02628_case_031", "p02628_case_032", "p02628_case_033", "p02628_case_034", "p02628_case_035", "p02628_case_036", "p02628_case_037", "p02628_case_038", "p02628_case_039", "p02628_case_040", "p02628_case_041", "p02628_case_042", "p02628_case_043", "p02628_case_044", "p02628_case_045", "p02628_case_046", "p02628_case_047", "p02628_case_048", "p02628_case_049", "p02628_case_050", "p02628_case_051", "p02628_case_052", "p02628_case_053", "p02628_case_054", "p02628_case_055", "p02628_case_056", "p02628_case_057", "p02628_case_058", "p02628_case_059", "p02628_case_060", "p02628_case_061", "p02628_case_062", "p02628_case_063", "p02628_case_064", "p02628_case_065", "p02628_case_066", "p02628_case_067", "p02628_case_068", "p02628_case_069", "p02628_case_070", "p02628_case_071", "p02628_case_072", "p02628_case_073", "p02628_case_074", "p02628_case_075", "p02628_case_076", "p02628_case_077", "p02628_case_078", "p02628_case_079", "p02628_case_080", "p02628_case_081", "p02628_case_082", "p02628_case_083", "p02628_case_084", "p02628_case_085", "p02628_case_086", "p02628_case_087", "p02628_case_088", "p02628_case_089", "p02628_case_090", "p02628_case_091", "p02628_case_092", "p02628_case_093", "p02628_case_094", "p02628_case_095", "p02628_case_096", "p02628_case_097", "p02628_case_098", "p02628_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n, k = list(map(int, input().split()))\np = list(map(int, input().split()))\np.sort()\nprint((sum(p[0:k])))\n", "fast_code_sha256": "c04521b6567e2d2e8733be44f049f5f46d51c44474134bb710f179a68c008cdf", "fast_id": "p02628_c04521b6567e2d2e8733be44f049f5f46d51c44474134bb710f179a68c008cdf", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n, k = list(map(int, input().split()))\np = list(map(int, input().split()))\np.sort()\nprint((sum(p[0:k])))\n", "measured_fast_code_sha256": "c04521b6567e2d2e8733be44f049f5f46d51c44474134bb710f179a68c008cdf", "measured_slow_code": "N, K = list(map(int, input().split()))\nP = list(map(int, input().split()))\n\n\ndef bubblesort(l):\n for index in range(len(l) - 1, 0, -1):\n for low in range(index):\n if l[low] > l[low + 1]:\n tmp = l[low + 1]\n l[low + 1] = l[low]\n l[low] = tmp\n return l\n\n\nbubblesort(P)\nsum = 0\nfor i in range(K):\n sum = sum + P[i]\nprint(sum)\n", "measured_slow_code_sha256": "12fc0a6880b1658c0eaeba3aa7dd7893393cf5c052e40105869e3784eb2f1caa", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 18.23870244538154, "pair_id": "python_v2_3eaaf7593b9008b54b49f6c1", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02628", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02628_c04521b6567e2d2e8733be44f049f5f46d51c44474134bb710f179a68c008cdf.jsonl.gz", "inputs": "reproduction/python/inputs/p02628.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02628_12fc0a6880b1658c0eaeba3aa7dd7893393cf5c052e40105869e3784eb2f1caa.jsonl.gz"}, "slow_code": "N, K = list(map(int, input().split()))\nP = list(map(int, input().split()))\n\n\ndef bubblesort(l):\n for index in range(len(l) - 1, 0, -1):\n for low in range(index):\n if l[low] > l[low + 1]:\n tmp = l[low + 1]\n l[low + 1] = l[low]\n l[low] = tmp\n return l\n\n\nbubblesort(P)\nsum = 0\nfor i in range(K):\n sum = sum + P[i]\nprint(sum)\n", "slow_code_sha256": "12fc0a6880b1658c0eaeba3aa7dd7893393cf5c052e40105869e3784eb2f1caa", "slow_id": "p02628_12fc0a6880b1658c0eaeba3aa7dd7893393cf5c052e40105869e3784eb2f1caa", "speedup": 44.40659155129648, "stratum": "8+", "within_pair_jaccard": 0.27586206896551724, "workload": {"case_count": 100, "description": "Choose K distinct kinds among N fruits, buying one item of each, to minimize the total price. Price p_i is the cost of one item of kind i. Observed inputs: N=1..1000 (median 100); K=1..1000 (median 99); p_i=1..1000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 5010, "median": 457.0, "min": 6}, "input_format": ["N K\np_1 ... p_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1002, "median": 102.0, "min": 3}}} -{"case_ids": ["p02244_case_000", "p02244_case_001", "p02244_case_002", "p02244_case_003", "p02244_case_004", "p02244_case_005", "p02244_case_006", "p02244_case_007", "p02244_case_008", "p02244_case_009", "p02244_case_010", "p02244_case_011", "p02244_case_012", "p02244_case_013", "p02244_case_014", "p02244_case_015", "p02244_case_016", "p02244_case_017", "p02244_case_018", "p02244_case_019", "p02244_case_020", "p02244_case_021", "p02244_case_022", "p02244_case_023", "p02244_case_024", "p02244_case_025", "p02244_case_026", "p02244_case_027", "p02244_case_028", "p02244_case_029", "p02244_case_030", "p02244_case_031", "p02244_case_032", "p02244_case_033", "p02244_case_034", "p02244_case_035", "p02244_case_036", "p02244_case_037", "p02244_case_038", "p02244_case_039", "p02244_case_040", "p02244_case_041", "p02244_case_042", "p02244_case_043", "p02244_case_044", "p02244_case_045", "p02244_case_046", "p02244_case_047", "p02244_case_048", "p02244_case_049", "p02244_case_050", "p02244_case_051", "p02244_case_052", "p02244_case_053", "p02244_case_054", "p02244_case_055", "p02244_case_056", "p02244_case_057", "p02244_case_058", "p02244_case_059", "p02244_case_060", "p02244_case_061", "p02244_case_062", "p02244_case_063", "p02244_case_064", "p02244_case_065", "p02244_case_066", "p02244_case_067", "p02244_case_068", "p02244_case_069", "p02244_case_070", "p02244_case_071", "p02244_case_072", "p02244_case_073", "p02244_case_074", "p02244_case_075", "p02244_case_076", "p02244_case_077", "p02244_case_078", "p02244_case_079", "p02244_case_080", "p02244_case_081", "p02244_case_082", "p02244_case_083", "p02244_case_084", "p02244_case_085", "p02244_case_086", "p02244_case_087", "p02244_case_088", "p02244_case_089", "p02244_case_090", "p02244_case_091", "p02244_case_092", "p02244_case_093", "p02244_case_094", "p02244_case_095", "p02244_case_096", "p02244_case_097", "p02244_case_098", "p02244_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from sys import stdin\nfrom itertools import permutations as per\n\n\ndef check(queen):\n for r1, c1 in queen:\n if not all(\n (r1 == r2 and c1 == c2) or (r1 + c1 != r2 + c2 and r1 - c1 != r2 - c2)\n for r2, c2 in queen\n ):\n return False\n return True\n\n\nk = int(stdin.readline())\nR, C = [[i for i in range(8)] for _ in range(2)]\nq = []\nfor _ in range(k):\n r, c = list(map(int, stdin.readline().split()))\n q.append((r, c))\n R.remove(r)\n C.remove(c)\nfor l in per(C):\n q_tmp = q[:] + [(r, c) for r, c in zip(R, l)]\n if check(q_tmp):\n for i, j in sorted(q_tmp):\n print((\".\" * j + \"Q\" + \".\" * (8 - j - 1)))\n break\n", "fast_code_sha256": "31644107abdb229d82244a8597859d7d2c902d0dc996119e84797e16528bcaed", "fast_id": "p02244_31644107abdb229d82244a8597859d7d2c902d0dc996119e84797e16528bcaed", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from sys import stdin\nfrom itertools import permutations as per\n\n\ndef check(queen):\n for r1, c1 in queen:\n if not all(\n (r1 == r2 and c1 == c2) or (r1 + c1 != r2 + c2 and r1 - c1 != r2 - c2)\n for r2, c2 in queen\n ):\n return False\n return True\n\n\nk = int(stdin.readline())\nR, C = [[i for i in range(8)] for _ in range(2)]\nq = []\nfor _ in range(k):\n r, c = list(map(int, stdin.readline().split()))\n q.append((r, c))\n R.remove(r)\n C.remove(c)\nfor l in per(C):\n q_tmp = q[:] + [(r, c) for r, c in zip(R, l)]\n if check(q_tmp):\n for i, j in sorted(q_tmp):\n print((\".\" * j + \"Q\" + \".\" * (8 - j - 1)))\n break\n", "measured_fast_code_sha256": "31644107abdb229d82244a8597859d7d2c902d0dc996119e84797e16528bcaed", "measured_slow_code": "from functools import lru_cache\n\ncc = [[\".\" for i in range(8)] for j in range(8)]\n\n\ndef check(cc, a, b):\n ss = list(zip(*cc))\n if \"Q\" in cc[a]:\n return False\n if \"Q\" in ss[b]:\n return False\n d = []\n for i in range(8):\n for j in range(8):\n try:\n if j + (a - i) == b:\n d.append(cc[i][j])\n if j - (a - i) == b:\n d.append(cc[i][j])\n if j + (i - a) == b:\n d.append(cc[i][j])\n if j - (i - a) == b:\n d.append(cc[i][j])\n except IndexError:\n continue\n if \"Q\" in d:\n return False\n return True\n\n\ndef chess(s, queen):\n if queen == 8:\n return s\n for i in range(8):\n for j in range(8):\n if check(s, i, j):\n sol = s\n sol[i][j] = \"Q\"\n if chess(sol, queen + 1) != [[]]:\n return sol\n else:\n sol[i][j] = \".\"\n return [[]]\n\n\nk = int(eval(input()))\nfor i in range(k):\n a, b = input().split()\n cc[int(a)][int(b)] = \"Q\"\nans = chess(cc, k)\nprint((\"\\n\".join(list([\"\".join(x) for x in ans]))))\n", "measured_slow_code_sha256": "d7606248c1d90b41ff58d3b7f82b651f81a02736b3685ac0b544bff951669455", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.7494455840439116, "pair_id": "python_v2_af9445d04e886ec0cdd945ed", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02244", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02244_31644107abdb229d82244a8597859d7d2c902d0dc996119e84797e16528bcaed.jsonl.gz", "inputs": "reproduction/python/inputs/p02244.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02244_d7606248c1d90b41ff58d3b7f82b651f81a02736b3685ac0b544bff951669455.jsonl.gz"}, "slow_code": "from functools import lru_cache\n\ncc = [[\".\" for i in range(8)] for j in range(8)]\n\n\ndef check(cc, a, b):\n ss = list(zip(*cc))\n if \"Q\" in cc[a]:\n return False\n if \"Q\" in ss[b]:\n return False\n d = []\n for i in range(8):\n for j in range(8):\n try:\n if j + (a - i) == b:\n d.append(cc[i][j])\n if j - (a - i) == b:\n d.append(cc[i][j])\n if j + (i - a) == b:\n d.append(cc[i][j])\n if j - (i - a) == b:\n d.append(cc[i][j])\n except IndexError:\n continue\n if \"Q\" in d:\n return False\n return True\n\n\ndef chess(s, queen):\n if queen == 8:\n return s\n for i in range(8):\n for j in range(8):\n if check(s, i, j):\n sol = s\n sol[i][j] = \"Q\"\n if chess(sol, queen + 1) != [[]]:\n return sol\n else:\n sol[i][j] = \".\"\n return [[]]\n\n\nk = int(eval(input()))\nfor i in range(k):\n a, b = input().split()\n cc[int(a)][int(b)] = \"Q\"\nans = chess(cc, k)\nprint((\"\\n\".join(list([\"\".join(x) for x in ans]))))\n", "slow_code_sha256": "d7606248c1d90b41ff58d3b7f82b651f81a02736b3685ac0b544bff951669455", "slow_id": "p02244_d7606248c1d90b41ff58d3b7f82b651f81a02736b3685ac0b544bff951669455", "speedup": 4.389343187918475, "stratum": "4-8", "within_pair_jaccard": 0.3287671232876712, "workload": {"case_count": 100, "description": "Complete an 8-by-8 board to eight nonattacking queens while preserving k fixed placements. Queens must differ in row, column and diagonal; coordinates are 0-based. The saved input has exactly one completion. Output Q for queens and . for empty cells. Observed inputs: k=2..8 (median 4); row=0..7; column=0..7.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 34, "median": 18.0, "min": 10}, "input_format": ["k\nr_1 c_1\n...\nr_k c_k"], "input_format_status": "source_input_section", "input_lines": {"max": 9, "median": 5.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 17, "median": 9.0, "min": 5}}} -{"case_ids": ["p03331_case_000", "p03331_case_001", "p03331_case_002", "p03331_case_003", "p03331_case_004", "p03331_case_005", "p03331_case_006", "p03331_case_007", "p03331_case_008", "p03331_case_009", "p03331_case_010", "p03331_case_011", "p03331_case_012", "p03331_case_013", "p03331_case_014", "p03331_case_015", "p03331_case_016", "p03331_case_017", "p03331_case_018", "p03331_case_019", "p03331_case_020", "p03331_case_021", "p03331_case_022", "p03331_case_023", "p03331_case_024", "p03331_case_025", "p03331_case_026", "p03331_case_027", "p03331_case_028", "p03331_case_029", "p03331_case_030", "p03331_case_031", "p03331_case_032", "p03331_case_033", "p03331_case_034", "p03331_case_035", "p03331_case_036", "p03331_case_037", "p03331_case_038", "p03331_case_039", "p03331_case_040", "p03331_case_041", "p03331_case_042", "p03331_case_043", "p03331_case_044", "p03331_case_045", "p03331_case_046", "p03331_case_047", "p03331_case_048", "p03331_case_049", "p03331_case_050", "p03331_case_051", "p03331_case_052", "p03331_case_053", "p03331_case_054", "p03331_case_055", "p03331_case_056", "p03331_case_057", "p03331_case_058", "p03331_case_059", "p03331_case_060", "p03331_case_061", "p03331_case_062", "p03331_case_063", "p03331_case_064", "p03331_case_065", "p03331_case_066", "p03331_case_067", "p03331_case_068", "p03331_case_069", "p03331_case_070", "p03331_case_071", "p03331_case_072", "p03331_case_073", "p03331_case_074", "p03331_case_075", "p03331_case_076", "p03331_case_077", "p03331_case_078", "p03331_case_079", "p03331_case_080", "p03331_case_081", "p03331_case_082", "p03331_case_083", "p03331_case_084", "p03331_case_085", "p03331_case_086", "p03331_case_087", "p03331_case_088", "p03331_case_089", "p03331_case_090", "p03331_case_091", "p03331_case_092", "p03331_case_093", "p03331_case_094", "p03331_case_095", "p03331_case_096", "p03331_case_097", "p03331_case_098", "p03331_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\ns = 0\nwhile n > 0:\n s += n % 10\n n //= 10\nif s == 1:\n print((10))\nelse:\n print(s)\n", "fast_code_sha256": "2e5e82f5584cc030030e61d415776f7f201bf828e97195c468720bf1767a3207", "fast_id": "p03331_2e5e82f5584cc030030e61d415776f7f201bf828e97195c468720bf1767a3207", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\ns = 0\nwhile n > 0:\n s += n % 10\n n //= 10\nif s == 1:\n print((10))\nelse:\n print(s)\n", "measured_fast_code_sha256": "2e5e82f5584cc030030e61d415776f7f201bf828e97195c468720bf1767a3207", "measured_slow_code": "N = int(eval(input()))\nimport numpy as np\n\na = np.arange(N)\na = np.delete(a, 0)\nb = N - a\nnum_arr = []\nfor i in range(len(a)):\n factor_a = [int(x) for x in list(str(a[i]))]\n factor_b = [int(x) for x in list(str(b[i]))]\n num_arr.append(sum(factor_a) + sum(factor_b))\nprint((min(num_arr)))\n", "measured_slow_code_sha256": "153ddd3939958df9731f2cb6a9569dfdd13dde4cae47410105d9d1d355dcbd24", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 8082.520469261457, "pair_id": "python_v2_7cfbabeeafbbdb04af7090f7", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03331", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03331_2e5e82f5584cc030030e61d415776f7f201bf828e97195c468720bf1767a3207.jsonl.gz", "inputs": "reproduction/python/inputs/p03331.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03331_153ddd3939958df9731f2cb6a9569dfdd13dde4cae47410105d9d1d355dcbd24.jsonl.gz"}, "slow_code": "N = int(eval(input()))\nimport numpy as np\n\na = np.arange(N)\na = np.delete(a, 0)\nb = N - a\nnum_arr = []\nfor i in range(len(a)):\n factor_a = [int(x) for x in list(str(a[i]))]\n factor_b = [int(x) for x in list(str(b[i]))]\n num_arr.append(sum(factor_a) + sum(factor_b))\nprint((min(num_arr)))\n", "slow_code_sha256": "153ddd3939958df9731f2cb6a9569dfdd13dde4cae47410105d9d1d355dcbd24", "slow_id": "p03331_153ddd3939958df9731f2cb6a9569dfdd13dde4cae47410105d9d1d355dcbd24", "speedup": 6025.23560057091, "stratum": "8+", "within_pair_jaccard": 0.14285714285714285, "workload": {"case_count": 100, "description": "Split N into two positive integers A+B=N, minimizing the sum of their decimal digit sums. Observed inputs: N=2..100000 (median 58160.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 7, "median": 6.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p03713_case_000", "p03713_case_001", "p03713_case_002", "p03713_case_003", "p03713_case_004", "p03713_case_005", "p03713_case_006", "p03713_case_007", "p03713_case_008", "p03713_case_009", "p03713_case_010", "p03713_case_011", "p03713_case_012", "p03713_case_013", "p03713_case_014", "p03713_case_015", "p03713_case_016", "p03713_case_017", "p03713_case_018", "p03713_case_019", "p03713_case_020", "p03713_case_021", "p03713_case_022", "p03713_case_023", "p03713_case_024", "p03713_case_025", "p03713_case_026", "p03713_case_027", "p03713_case_028", "p03713_case_029", "p03713_case_030", "p03713_case_031", "p03713_case_032", "p03713_case_033", "p03713_case_034", "p03713_case_035", "p03713_case_036", "p03713_case_037", "p03713_case_038", "p03713_case_039", "p03713_case_040", "p03713_case_041", "p03713_case_042", "p03713_case_043", "p03713_case_044", "p03713_case_045", "p03713_case_046", "p03713_case_047", "p03713_case_048", "p03713_case_049", "p03713_case_050", "p03713_case_051", "p03713_case_052", "p03713_case_053", "p03713_case_054", "p03713_case_055", "p03713_case_056", "p03713_case_057", "p03713_case_058", "p03713_case_059", "p03713_case_060", "p03713_case_061", "p03713_case_062", "p03713_case_063", "p03713_case_064", "p03713_case_065", "p03713_case_066", "p03713_case_067", "p03713_case_068", "p03713_case_069", "p03713_case_070", "p03713_case_071", "p03713_case_072", "p03713_case_073", "p03713_case_074", "p03713_case_075", "p03713_case_076", "p03713_case_077", "p03713_case_078", "p03713_case_079", "p03713_case_080", "p03713_case_081", "p03713_case_082", "p03713_case_083", "p03713_case_084", "p03713_case_085", "p03713_case_086", "p03713_case_087", "p03713_case_088", "p03713_case_089", "p03713_case_090", "p03713_case_091", "p03713_case_092", "p03713_case_093", "p03713_case_094", "p03713_case_095", "p03713_case_096", "p03713_case_097", "p03713_case_098", "p03713_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "h, w = list(map(int, input().split()))\nans = float(\"Inf\")\nif h % 3 == 0 or w % 3 == 0:\n print((0))\n exit()\nfor i in range(1, h):\n a = (h - i) * (w // 2)\n b = (h - i) * -(-w // 2)\n ans = min(ans, abs(max(i * w, a, b) - min(i * w, a, b)))\nfor i in range(1, w):\n a = (w - i) * (h // 2)\n b = (w - i) * -(-h // 2)\n ans = min(ans, abs(max(i * h, a, b) - min(i * h, a, b)))\nprint((min(ans, h, w)))\n", "fast_code_sha256": "a9c37374f81204d4bfa0276115d13e5c0adca7fe6eb99f80ec27a41e8d33dc8e", "fast_id": "p03713_a9c37374f81204d4bfa0276115d13e5c0adca7fe6eb99f80ec27a41e8d33dc8e", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "h, w = list(map(int, input().split()))\nans = float(\"Inf\")\nif h % 3 == 0 or w % 3 == 0:\n print((0))\n exit()\nfor i in range(1, h):\n a = (h - i) * (w // 2)\n b = (h - i) * -(-w // 2)\n ans = min(ans, abs(max(i * w, a, b) - min(i * w, a, b)))\nfor i in range(1, w):\n a = (w - i) * (h // 2)\n b = (w - i) * -(-h // 2)\n ans = min(ans, abs(max(i * h, a, b) - min(i * h, a, b)))\nprint((min(ans, h, w)))\n", "measured_fast_code_sha256": "a9c37374f81204d4bfa0276115d13e5c0adca7fe6eb99f80ec27a41e8d33dc8e", "measured_slow_code": "def calc(H, W, ans):\n w0 = W // 2\n w1 = W - w0\n for h0 in range(1, H):\n Sa = h0 * W\n h1 = H - h0\n h2 = h1 // 2\n h3 = h1 - h2\n Sb1, Sc1 = h1 * w0, h1 * w1\n Sb2, Sc2 = h2 * W, h3 * W\n m1, _, M1 = sorted([Sa, Sb1, Sc1])\n m2, _, M2 = sorted([Sa, Sb2, Sc2])\n ans = min(ans, M1 - m1, M2 - m2)\n return ans\n\n\nH, W = list(map(int, input().split()))\nprint((calc(W, H, calc(H, W, H * W))))\n", "measured_slow_code_sha256": "0693797c39d60eb7350d694d73bb29b82143b0a89c4b2e8fa8b67145d95dc8d0", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 0.9249208819488528, "pair_id": "python_v2_68902345470de0316af3f3fb", "per_case_slow_code_faster_fraction": 0.65, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03713", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03713_a9c37374f81204d4bfa0276115d13e5c0adca7fe6eb99f80ec27a41e8d33dc8e.jsonl.gz", "inputs": "reproduction/python/inputs/p03713.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03713_0693797c39d60eb7350d694d73bb29b82143b0a89c4b2e8fa8b67145d95dc8d0.jsonl.gz"}, "slow_code": "def calc(H, W, ans):\n w0 = W // 2\n w1 = W - w0\n for h0 in range(1, H):\n Sa = h0 * W\n h1 = H - h0\n h2 = h1 // 2\n h3 = h1 - h2\n Sb1, Sc1 = h1 * w0, h1 * w1\n Sb2, Sc2 = h2 * W, h3 * W\n m1, _, M1 = sorted([Sa, Sb1, Sc1])\n m2, _, M2 = sorted([Sa, Sb2, Sc2])\n ans = min(ans, M1 - m1, M2 - m2)\n return ans\n\n\nH, W = list(map(int, input().split()))\nprint((calc(W, H, calc(H, W, H * W))))\n", "slow_code_sha256": "0693797c39d60eb7350d694d73bb29b82143b0a89c4b2e8fa8b67145d95dc8d0", "slow_id": "p03713_0693797c39d60eb7350d694d73bb29b82143b0a89c4b2e8fa8b67145d95dc8d0", "speedup": 7.784250698271554, "stratum": "4-8", "within_pair_jaccard": 0.25, "workload": {"case_count": 100, "description": "Divide an H-by-W grid-aligned rectangular bar into exactly three nonempty rectangular pieces along cell borders. Minimize the difference between the largest and smallest areas. The bar is implicit, not listed cell by cell. Observed inputs: H=2..100000 (median 54760.5); W=2..100000 (median 40128.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 14, "median": 11.5, "min": 4}, "input_format": ["H W"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p02603_case_000", "p02603_case_001", "p02603_case_002", "p02603_case_003", "p02603_case_004", "p02603_case_005", "p02603_case_006", "p02603_case_007", "p02603_case_008", "p02603_case_009", "p02603_case_010", "p02603_case_011", "p02603_case_012", "p02603_case_013", "p02603_case_014", "p02603_case_015", "p02603_case_016", "p02603_case_017", "p02603_case_018", "p02603_case_019", "p02603_case_020", "p02603_case_021", "p02603_case_022", "p02603_case_023", "p02603_case_024", "p02603_case_025", "p02603_case_026", "p02603_case_027", "p02603_case_028", "p02603_case_029", "p02603_case_030", "p02603_case_031", "p02603_case_032", "p02603_case_033", "p02603_case_034", "p02603_case_035", "p02603_case_036", "p02603_case_037", "p02603_case_038", "p02603_case_039", "p02603_case_040", "p02603_case_041", "p02603_case_042", "p02603_case_043", "p02603_case_044", "p02603_case_045", "p02603_case_046", "p02603_case_047", "p02603_case_048", "p02603_case_049", "p02603_case_050", "p02603_case_051", "p02603_case_052", "p02603_case_053", "p02603_case_054", "p02603_case_055", "p02603_case_056", "p02603_case_057", "p02603_case_058", "p02603_case_059", "p02603_case_060", "p02603_case_061", "p02603_case_062", "p02603_case_063", "p02603_case_064", "p02603_case_065", "p02603_case_066", "p02603_case_067", "p02603_case_068", "p02603_case_069", "p02603_case_070", "p02603_case_071", "p02603_case_072", "p02603_case_073", "p02603_case_074", "p02603_case_075", "p02603_case_076", "p02603_case_077", "p02603_case_078", "p02603_case_079", "p02603_case_080", "p02603_case_081", "p02603_case_082", "p02603_case_083", "p02603_case_084", "p02603_case_085", "p02603_case_086", "p02603_case_087", "p02603_case_088", "p02603_case_089", "p02603_case_090", "p02603_case_091", "p02603_case_092", "p02603_case_093", "p02603_case_094", "p02603_case_095", "p02603_case_096", "p02603_case_097", "p02603_case_098", "p02603_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N = int(eval(input()))\nA = [0] + list(map(int, input().split()))\ndp = [0] * (N + 1)\ndp[1] = 1000\nfor i in range(2, N + 1):\n dp[i] = dp[i - 1]\n for j in range(1, i):\n stock = dp[j] // A[j]\n momey = dp[j] + (A[i] - A[j]) * stock\n dp[i] = max(dp[i], momey)\nprint((dp[N]))\n", "fast_code_sha256": "25faafb2b0ca16cedbeb669295357df971e7c7a40120b3549a7cc9eefa9e9f0e", "fast_id": "p02603_25faafb2b0ca16cedbeb669295357df971e7c7a40120b3549a7cc9eefa9e9f0e", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N = int(eval(input()))\nA = [0] + list(map(int, input().split()))\ndp = [0] * (N + 1)\ndp[1] = 1000\nfor i in range(2, N + 1):\n dp[i] = dp[i - 1]\n for j in range(1, i):\n stock = dp[j] // A[j]\n momey = dp[j] + (A[i] - A[j]) * stock\n dp[i] = max(dp[i], momey)\nprint((dp[N]))\n", "measured_fast_code_sha256": "25faafb2b0ca16cedbeb669295357df971e7c7a40120b3549a7cc9eefa9e9f0e", "measured_slow_code": "import math\nimport collections\nimport fractions\nimport itertools\nimport functools\nimport operator\n\n\ndef divis(l):\n seq = []\n beg, end = 0, 0\n le = len(l)\n for i in range(1, le):\n end = i\n if l[i] < l[i - 1]:\n seq.append(l[beg:end])\n beg = i\n seq.append(l[beg : end + 1])\n return seq\n\n\ndef solve():\n n = int(eval(input()))\n a = list(map(int, input().split()))\n a = divis(a)\n yosan = 1000\n for i in a:\n yosan += (i[-1] - i[0]) * (yosan // i[0])\n print(yosan)\n return 0\n\n\nif __name__ == \"__main__\":\n solve()\n", "measured_slow_code_sha256": "96546192f6afbe684cb2275aae99976f706f42bd34306642da1e146a05f2b13e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 10.721118592186095, "pair_id": "python_v2_b917ea11835ad8d0da119584", "per_case_slow_code_faster_fraction": 0.25, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02603", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02603_25faafb2b0ca16cedbeb669295357df971e7c7a40120b3549a7cc9eefa9e9f0e.jsonl.gz", "inputs": "reproduction/python/inputs/p02603.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02603_96546192f6afbe684cb2275aae99976f706f42bd34306642da1e146a05f2b13e.jsonl.gz"}, "slow_code": "import math\nimport collections\nimport fractions\nimport itertools\nimport functools\nimport operator\n\n\ndef divis(l):\n seq = []\n beg, end = 0, 0\n le = len(l)\n for i in range(1, le):\n end = i\n if l[i] < l[i - 1]:\n seq.append(l[beg:end])\n beg = i\n seq.append(l[beg : end + 1])\n return seq\n\n\ndef solve():\n n = int(eval(input()))\n a = list(map(int, input().split()))\n a = divis(a)\n yosan = 1000\n for i in a:\n yosan += (i[-1] - i[0]) * (yosan // i[0])\n print(yosan)\n return 0\n\n\nif __name__ == \"__main__\":\n solve()\n", "slow_code_sha256": "96546192f6afbe684cb2275aae99976f706f42bd34306642da1e146a05f2b13e", "slow_id": "p02603_96546192f6afbe684cb2275aae99976f706f42bd34306642da1e146a05f2b13e", "speedup": 4.546397594098915, "stratum": "4-8", "within_pair_jaccard": 0.30434782608695654, "workload": {"case_count": 100, "description": "Given N daily prices a_i for one stock, maximize final cash starting with 1000 and no shares. Buy or sell whole shares any number of times daily, without borrowing cash or shares. Observed inputs: N=2..80 (median 10); a_i=100..200.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 323, "median": 43.0, "min": 10}, "input_format": ["N\na_1 ... a_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 81, "median": 11.0, "min": 3}}} -{"case_ids": ["p03018_case_000", "p03018_case_001", "p03018_case_002", "p03018_case_003", "p03018_case_004", "p03018_case_005", "p03018_case_006", "p03018_case_007", "p03018_case_008", "p03018_case_009", "p03018_case_010", "p03018_case_011", "p03018_case_012", "p03018_case_013", "p03018_case_014", "p03018_case_015", "p03018_case_016", "p03018_case_017", "p03018_case_018", "p03018_case_019", "p03018_case_020", "p03018_case_021", "p03018_case_022", "p03018_case_023", "p03018_case_024", "p03018_case_025", "p03018_case_026", "p03018_case_027", "p03018_case_028", "p03018_case_029", "p03018_case_030", "p03018_case_031", "p03018_case_032", "p03018_case_033", "p03018_case_034", "p03018_case_035", "p03018_case_036", "p03018_case_037", "p03018_case_038", "p03018_case_039", "p03018_case_040", "p03018_case_041", "p03018_case_042", "p03018_case_043", "p03018_case_044", "p03018_case_045", "p03018_case_046", "p03018_case_047", "p03018_case_048", "p03018_case_049", "p03018_case_050", "p03018_case_051", "p03018_case_052", "p03018_case_053", "p03018_case_054", "p03018_case_055", "p03018_case_056", "p03018_case_057", "p03018_case_058", "p03018_case_059", "p03018_case_060", "p03018_case_061", "p03018_case_062", "p03018_case_063", "p03018_case_064", "p03018_case_065", "p03018_case_066", "p03018_case_067", "p03018_case_068", "p03018_case_069", "p03018_case_070", "p03018_case_071", "p03018_case_072", "p03018_case_073", "p03018_case_074", "p03018_case_075", "p03018_case_076", "p03018_case_077", "p03018_case_078", "p03018_case_079", "p03018_case_080", "p03018_case_081", "p03018_case_082", "p03018_case_083", "p03018_case_084", "p03018_case_085", "p03018_case_086", "p03018_case_087", "p03018_case_088", "p03018_case_089", "p03018_case_090", "p03018_case_091", "p03018_case_092", "p03018_case_093", "p03018_case_094", "p03018_case_095", "p03018_case_096", "p03018_case_097", "p03018_case_098", "p03018_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\n\ndef main():\n input = sys.stdin.readline\n S = input().strip()\n S = S.replace(\"BC\", \"D\")\n ans = 0\n cnt = 0\n for c in S:\n if c == \"A\":\n cnt += 1\n elif c == \"D\":\n ans += cnt\n else:\n cnt = 0\n return ans\n\n\nif __name__ == \"__main__\":\n print((main()))\n", "fast_code_sha256": "0a79ea1289ea455ee2e87f5e23ce2c420aaa2e91faef82a25a595eb4a69155a5", "fast_id": "p03018_0a79ea1289ea455ee2e87f5e23ce2c420aaa2e91faef82a25a595eb4a69155a5", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\n\ndef main():\n input = sys.stdin.readline\n S = input().strip()\n S = S.replace(\"BC\", \"D\")\n ans = 0\n cnt = 0\n for c in S:\n if c == \"A\":\n cnt += 1\n elif c == \"D\":\n ans += cnt\n else:\n cnt = 0\n return ans\n\n\nif __name__ == \"__main__\":\n print((main()))\n", "measured_fast_code_sha256": "0a79ea1289ea455ee2e87f5e23ce2c420aaa2e91faef82a25a595eb4a69155a5", "measured_slow_code": "import sys\n\nstdin = sys.stdin\nri = lambda: int(rs())\nrl = lambda: list(map(int, stdin.readline().split()))\nrs = lambda: stdin.readline().rstrip() # ignore trailing spaces\nS = list(rs())\ncur = \"D\"\nanswer = 0\nA_cnt = 0\nfor s in S:\n if cur == \"A\":\n if s == \"A\":\n A_cnt += 1\n elif s == \"B\":\n cur = s\n else:\n cur = \"D\"\n A_cnt = 0\n elif cur == \"B\":\n if s == \"A\":\n A_cnt = 1\n cur = s\n elif s == \"B\":\n A_cnt = 0\n cur = \"D\"\n elif s == \"C\":\n answer += A_cnt\n cur = s\n else:\n cur = \"D\"\n A_cnt = 0\n elif cur == \"C\":\n if s == \"A\":\n A_cnt += 1\n cur = s\n elif s == \"B\":\n cur = s\n else:\n cur = \"D\"\n A_cnt = 0\n else:\n if s == \"A\":\n A_cnt += 1\n cur = s\n else:\n A_cnt = 0\n cur = \"D\"\nprint(answer)\n", "measured_slow_code_sha256": "34cfcb0cd806549d9de932b7805e60b0300ac48d582c70a3b82e9e63ed79dbe3", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.702114787428984, "pair_id": "python_v2_435b9203e82db65241116508", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03018", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03018_0a79ea1289ea455ee2e87f5e23ce2c420aaa2e91faef82a25a595eb4a69155a5.jsonl.gz", "inputs": "reproduction/python/inputs/p03018.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03018_34cfcb0cd806549d9de932b7805e60b0300ac48d582c70a3b82e9e63ed79dbe3.jsonl.gz"}, "slow_code": "import sys\n\nstdin = sys.stdin\nri = lambda: int(rs())\nrl = lambda: list(map(int, stdin.readline().split()))\nrs = lambda: stdin.readline().rstrip()\nS = list(rs())\ncur = \"D\"\nanswer = 0\nA_cnt = 0\nfor s in S:\n if cur == \"A\":\n if s == \"A\":\n A_cnt += 1\n elif s == \"B\":\n cur = s\n else:\n cur = \"D\"\n A_cnt = 0\n elif cur == \"B\":\n if s == \"A\":\n A_cnt = 1\n cur = s\n elif s == \"B\":\n A_cnt = 0\n cur = \"D\"\n elif s == \"C\":\n answer += A_cnt\n cur = s\n else:\n cur = \"D\"\n A_cnt = 0\n elif cur == \"C\":\n if s == \"A\":\n A_cnt += 1\n cur = s\n elif s == \"B\":\n cur = s\n else:\n cur = \"D\"\n A_cnt = 0\n else:\n if s == \"A\":\n A_cnt += 1\n cur = s\n else:\n A_cnt = 0\n cur = \"D\"\nprint(answer)\n", "slow_code_sha256": "2a81960ac1f47336dbb6ad3e8a3b063f1f7be21a97a77ab30f5ed64ce398f2f3", "slow_id": "p03018_34cfcb0cd806549d9de932b7805e60b0300ac48d582c70a3b82e9e63ed79dbe3", "speedup": 2.726204965809406, "stratum": "2-4", "within_pair_jaccard": 0.35714285714285715, "workload": {"case_count": 100, "description": "Given a string s over A,B,C, repeatedly replace any contiguous ABC by BCA. Find the maximum possible number of replacements. Observed inputs: s_length=1..200000 (median 1000); A_count=0..200000; B_count=0..200000; C_count=0..200000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 200001, "median": 1001.0, "min": 2}, "input_format": ["s"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p03150_case_000", "p03150_case_001", "p03150_case_002", "p03150_case_003", "p03150_case_004", "p03150_case_005", "p03150_case_006", "p03150_case_007", "p03150_case_008", "p03150_case_009", "p03150_case_010", "p03150_case_011", "p03150_case_012", "p03150_case_013", "p03150_case_014", "p03150_case_015", "p03150_case_016", "p03150_case_017", "p03150_case_018", "p03150_case_019", "p03150_case_020", "p03150_case_021", "p03150_case_022", "p03150_case_023", "p03150_case_024", "p03150_case_025", "p03150_case_026", "p03150_case_027", "p03150_case_028", "p03150_case_029", "p03150_case_030", "p03150_case_031", "p03150_case_032", "p03150_case_033", "p03150_case_034", "p03150_case_035", "p03150_case_036", "p03150_case_037", "p03150_case_038", "p03150_case_039", "p03150_case_040", "p03150_case_041", "p03150_case_042", "p03150_case_043", "p03150_case_044", "p03150_case_045", "p03150_case_046", "p03150_case_047", "p03150_case_048", "p03150_case_049", "p03150_case_050", "p03150_case_051", "p03150_case_052", "p03150_case_053", "p03150_case_054", "p03150_case_055", "p03150_case_056", "p03150_case_057", "p03150_case_058", "p03150_case_059", "p03150_case_060", "p03150_case_061", "p03150_case_062", "p03150_case_063", "p03150_case_064", "p03150_case_065", "p03150_case_066", "p03150_case_067", "p03150_case_068", "p03150_case_069", "p03150_case_070", "p03150_case_071", "p03150_case_072", "p03150_case_073", "p03150_case_074", "p03150_case_075", "p03150_case_076", "p03150_case_077", "p03150_case_078", "p03150_case_079", "p03150_case_080", "p03150_case_081", "p03150_case_082", "p03150_case_083", "p03150_case_084", "p03150_case_085", "p03150_case_086", "p03150_case_087", "p03150_case_088", "p03150_case_089", "p03150_case_090", "p03150_case_091", "p03150_case_092", "p03150_case_093", "p03150_case_094", "p03150_case_095", "p03150_case_096", "p03150_case_097", "p03150_case_098", "p03150_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def main():\n S = input()\n N = len(S)\n ans = \"keyence\"\n for i in range(N):\n for j in range(N + 1):\n T = S[:i] + S[i + j :]\n if T == ans:\n return print(\"YES\")\n print(\"NO\")\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "073ab830f67147319ed0d8289c5e16b8febb9e062a9c7a5a41bbef78afb629b6", "fast_id": "p03150_974ed8c013de7fa49f4174c0befd582bb06a2afc391fa3037fd7240987d13bcb", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def main():\n S = input()\n N = len(S)\n ans = \"keyence\"\n for i in range(N):\n for j in range(N + 1):\n T = S[:i] + S[i + j :] # S[i:i+j]を取り除く\n if T == ans:\n return print(\"YES\")\n print(\"NO\")\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "974ed8c013de7fa49f4174c0befd582bb06a2afc391fa3037fd7240987d13bcb", "measured_slow_code": "import re\nfrom sys import stdin\n\nN = stdin.readline().rstrip()\nfor i in range(7):\n mae = \"keyence\"[0 : i + 1]\n ato = \"keyence\"[i + 1 : 8]\n if re.search(\".*keyencekeyence\", N):\n if (re.sub(\".*keyencekeyence\", \"\", N) == \"\") == True:\n print(\"YES\")\n break\n if re.search(\"keyencekeyence.*\", N):\n if (re.sub(\"keyencekeyence.*\", \"\", N) == \"\") == True:\n print(\"YES\")\n break\n if (re.sub(\".*keyence\", \"\", N) == \"\") == True:\n print(\"YES\")\n break\n if (re.sub(\"keyence.*\", \"\", N) == \"\") == True:\n print(\"YES\")\n break\n if re.match(\"%s.*%s\" % (mae, ato), N):\n if (re.sub(\"%s.*%s\" % (mae, ato), \"\", N) == \"\") == True:\n print(\"YES\")\n break\nif i == 6:\n print(\"NO\")\n", "measured_slow_code_sha256": "331210cf6e543db86805dd436daba4fcc1285479f84eb62a4c37ec4561176613", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.2449093671843454, "pair_id": "python_v2_7d85ecc3b59caa99b56f58c8", "per_case_slow_code_faster_fraction": 0.2, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03150", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03150_974ed8c013de7fa49f4174c0befd582bb06a2afc391fa3037fd7240987d13bcb.jsonl.gz", "inputs": "reproduction/python/inputs/p03150.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03150_331210cf6e543db86805dd436daba4fcc1285479f84eb62a4c37ec4561176613.jsonl.gz"}, "slow_code": "import re\nfrom sys import stdin\n\nN = stdin.readline().rstrip()\nfor i in range(7):\n mae = \"keyence\"[0 : i + 1]\n ato = \"keyence\"[i + 1 : 8]\n if re.search(\".*keyencekeyence\", N):\n if (re.sub(\".*keyencekeyence\", \"\", N) == \"\") == True:\n print(\"YES\")\n break\n if re.search(\"keyencekeyence.*\", N):\n if (re.sub(\"keyencekeyence.*\", \"\", N) == \"\") == True:\n print(\"YES\")\n break\n if (re.sub(\".*keyence\", \"\", N) == \"\") == True:\n print(\"YES\")\n break\n if (re.sub(\"keyence.*\", \"\", N) == \"\") == True:\n print(\"YES\")\n break\n if re.match(\"%s.*%s\" % (mae, ato), N):\n if (re.sub(\"%s.*%s\" % (mae, ato), \"\", N) == \"\") == True:\n print(\"YES\")\n break\nif i == 6:\n print(\"NO\")\n", "slow_code_sha256": "331210cf6e543db86805dd436daba4fcc1285479f84eb62a4c37ec4561176613", "slow_id": "p03150_331210cf6e543db86805dd436daba4fcc1285479f84eb62a4c37ec4561176613", "speedup": 2.4979054656176425, "stratum": "2-4", "within_pair_jaccard": 0.2619047619047619, "workload": {"case_count": 100, "description": "Determine whether deleting exactly one contiguous substring, possibly empty, from lowercase S can leave the fixed seven-letter target word embedded in the program. Observed inputs: S_length=7..100 (median 25); distinct_characters=4..26.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 101, "median": 26.0, "min": 8}, "input_format": ["S"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p03502_case_000", "p03502_case_001", "p03502_case_002", "p03502_case_003", "p03502_case_004", "p03502_case_005", "p03502_case_006", "p03502_case_007", "p03502_case_008", "p03502_case_009", "p03502_case_010", "p03502_case_011", "p03502_case_012", "p03502_case_013", "p03502_case_014", "p03502_case_015", "p03502_case_016", "p03502_case_017", "p03502_case_018", "p03502_case_019", "p03502_case_020", "p03502_case_021", "p03502_case_022", "p03502_case_023", "p03502_case_024", "p03502_case_025", "p03502_case_026", "p03502_case_027", "p03502_case_028", "p03502_case_029", "p03502_case_030", "p03502_case_031", "p03502_case_032", "p03502_case_033", "p03502_case_034", "p03502_case_035", "p03502_case_036", "p03502_case_037", "p03502_case_038", "p03502_case_039", "p03502_case_040", "p03502_case_041", "p03502_case_042", "p03502_case_043", "p03502_case_044", "p03502_case_045", "p03502_case_046", "p03502_case_047", "p03502_case_048", "p03502_case_049", "p03502_case_050", "p03502_case_051", "p03502_case_052", "p03502_case_053", "p03502_case_054", "p03502_case_055", "p03502_case_056", "p03502_case_057", "p03502_case_058", "p03502_case_059", "p03502_case_060", "p03502_case_061", "p03502_case_062", "p03502_case_063", "p03502_case_064", "p03502_case_065", "p03502_case_066", "p03502_case_067", "p03502_case_068", "p03502_case_069", "p03502_case_070", "p03502_case_071", "p03502_case_072", "p03502_case_073", "p03502_case_074", "p03502_case_075", "p03502_case_076", "p03502_case_077", "p03502_case_078", "p03502_case_079", "p03502_case_080", "p03502_case_081", "p03502_case_082", "p03502_case_083", "p03502_case_084", "p03502_case_085", "p03502_case_086", "p03502_case_087", "p03502_case_088", "p03502_case_089", "p03502_case_090", "p03502_case_091", "p03502_case_092", "p03502_case_093", "p03502_case_094", "p03502_case_095", "p03502_case_096", "p03502_case_097", "p03502_case_098", "p03502_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\nn_l = list(map(int, str(n)))\nif n % sum(n_l) == 0:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "fast_code_sha256": "f05df739be0a2232526a990d2ca66e6bcaf8c3ff1beb496be5ffc643505ce7af", "fast_id": "p03502_f05df739be0a2232526a990d2ca66e6bcaf8c3ff1beb496be5ffc643505ce7af", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\nn_l = list(map(int, str(n)))\nif n % sum(n_l) == 0:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "measured_fast_code_sha256": "f05df739be0a2232526a990d2ca66e6bcaf8c3ff1beb496be5ffc643505ce7af", "measured_slow_code": "import sys\nimport math\nimport collections\nimport itertools\nimport array\nimport inspect\n\n# Set max recursion limit\nsys.setrecursionlimit(10000)\n# Debug output\ndef chkprint(*args):\n names = {id(v): k for k, v in list(inspect.currentframe().f_back.f_locals.items())}\n print((\", \".join(names.get(id(arg), \"???\") + \" = \" + repr(arg) for arg in args)))\n\n\n# Binary converter\ndef to_bin(x):\n return bin(x)[2:]\n\n\ndef li_input():\n return [int(_) for _ in input().split()]\n\n\n# --------------------------------------------\ndp = None\n\n\ndef main():\n X = int(eval(input()))\n if X % sum(list(map(int, list(str(X))))) == 0:\n print(\"Yes\")\n else:\n print(\"No\")\n\n\nmain()\n", "measured_slow_code_sha256": "9657e24fd296bdb183cb812efcaa41e0e4d09edff18e911040359edf4aba2689", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 48.62832620142549, "pair_id": "python_v2_9b9fe38f71027e409ca62bad", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03502", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03502_f05df739be0a2232526a990d2ca66e6bcaf8c3ff1beb496be5ffc643505ce7af.jsonl.gz", "inputs": "reproduction/python/inputs/p03502.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03502_9657e24fd296bdb183cb812efcaa41e0e4d09edff18e911040359edf4aba2689.jsonl.gz"}, "slow_code": "import sys\nimport math\nimport collections\nimport itertools\nimport array\nimport inspect\n\n\nsys.setrecursionlimit(10000)\n\n\ndef chkprint(*args):\n names = {id(v): k for k, v in list(inspect.currentframe().f_back.f_locals.items())}\n print((\", \".join(names.get(id(arg), \"???\") + \" = \" + repr(arg) for arg in args)))\n\n\ndef to_bin(x):\n return bin(x)[2:]\n\n\ndef li_input():\n return [int(_) for _ in input().split()]\n\n\ndp = None\n\n\ndef main():\n X = int(eval(input()))\n if X % sum(list(map(int, list(str(X))))) == 0:\n print(\"Yes\")\n else:\n print(\"No\")\n\n\nmain()\n", "slow_code_sha256": "04afcb0636d6758b9c1fd4024fff2537c6c73d327a7f8a692ef75cf80e1d3933", "slow_id": "p03502_9657e24fd296bdb183cb812efcaa41e0e4d09edff18e911040359edf4aba2689", "speedup": 48.79835577524155, "stratum": "8+", "within_pair_jaccard": 0.24528301886792453, "workload": {"case_count": 100, "description": "Determine whether positive integer N is divisible by the sum of its decimal digits. Observed inputs: N=1..100000000 (median 8425409).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 10, "median": 8.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p03251_case_000", "p03251_case_001", "p03251_case_002", "p03251_case_003", "p03251_case_004", "p03251_case_005", "p03251_case_006", "p03251_case_007", "p03251_case_008", "p03251_case_009", "p03251_case_010", "p03251_case_011", "p03251_case_012", "p03251_case_013", "p03251_case_014", "p03251_case_015", "p03251_case_016", "p03251_case_017", "p03251_case_018", "p03251_case_019", "p03251_case_020", "p03251_case_021", "p03251_case_022", "p03251_case_023", "p03251_case_024", "p03251_case_025", "p03251_case_026", "p03251_case_027", "p03251_case_028", "p03251_case_029", "p03251_case_030", "p03251_case_031", "p03251_case_032", "p03251_case_033", "p03251_case_034", "p03251_case_035", "p03251_case_036", "p03251_case_037", "p03251_case_038", "p03251_case_039", "p03251_case_040", "p03251_case_041", "p03251_case_042", "p03251_case_043", "p03251_case_044", "p03251_case_045", "p03251_case_046", "p03251_case_047", "p03251_case_048", "p03251_case_049", "p03251_case_050", "p03251_case_051", "p03251_case_052", "p03251_case_053", "p03251_case_054", "p03251_case_055", "p03251_case_056", "p03251_case_057", "p03251_case_058", "p03251_case_059", "p03251_case_060", "p03251_case_061", "p03251_case_062", "p03251_case_063", "p03251_case_064", "p03251_case_065", "p03251_case_066", "p03251_case_067", "p03251_case_068", "p03251_case_069", "p03251_case_070", "p03251_case_071", "p03251_case_072", "p03251_case_073", "p03251_case_074", "p03251_case_075", "p03251_case_076", "p03251_case_077", "p03251_case_078", "p03251_case_079", "p03251_case_080", "p03251_case_081", "p03251_case_082", "p03251_case_083", "p03251_case_084", "p03251_case_085", "p03251_case_086", "p03251_case_087", "p03251_case_088", "p03251_case_089", "p03251_case_090", "p03251_case_091", "p03251_case_092", "p03251_case_093", "p03251_case_094", "p03251_case_095", "p03251_case_096", "p03251_case_097", "p03251_case_098", "p03251_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N, M, X, Y = list(map(int, input().split()))\nx = list(map(int, input().split()))\ny = list(map(int, input().split()))\nans = \"War\"\nfor z in range(X + 1, Y + 1):\n if (\n len(list([x for x in x if x < z])) == N\n and len(list([x for x in y if x >= z])) == M\n ):\n ans = \"No War\"\n break\nprint(ans)\n", "fast_code_sha256": "e1fb9d1e4bb1587c2b88830cda6b89634d238311e4b158fd1044c6d44a2213eb", "fast_id": "p03251_e1fb9d1e4bb1587c2b88830cda6b89634d238311e4b158fd1044c6d44a2213eb", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N, M, X, Y = list(map(int, input().split()))\nx = list(map(int, input().split()))\ny = list(map(int, input().split()))\nans = \"War\"\nfor z in range(X + 1, Y + 1):\n if (\n len(list([x for x in x if x < z])) == N\n and len(list([x for x in y if x >= z])) == M\n ):\n ans = \"No War\"\n break\nprint(ans)\n", "measured_fast_code_sha256": "e1fb9d1e4bb1587c2b88830cda6b89634d238311e4b158fd1044c6d44a2213eb", "measured_slow_code": "import numpy as np\n\nn, m, x, y = list(map(int, input().split()))\nxl = [int(i) for i in input().split()]\nyl = [int(i) for i in input().split()]\nif x > y:\n print(\"War\")\nelse:\n zl = np.arange(x + 1, y + 1)\n for z in zl:\n if (max(xl) < z) & (z <= min(yl)):\n print(\"No War\")\n break\n else:\n print(\"War\")\n", "measured_slow_code_sha256": "a3fbc6c47b132b7bae66af85f9792255327ce8e3bf2b5b22873b7c8d59510fae", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 282.6975113749599, "pair_id": "python_v2_ebad865a08c3e695a1baf793", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03251", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03251_e1fb9d1e4bb1587c2b88830cda6b89634d238311e4b158fd1044c6d44a2213eb.jsonl.gz", "inputs": "reproduction/python/inputs/p03251.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03251_a3fbc6c47b132b7bae66af85f9792255327ce8e3bf2b5b22873b7c8d59510fae.jsonl.gz"}, "slow_code": "import numpy as np\n\nn, m, x, y = list(map(int, input().split()))\nxl = [int(i) for i in input().split()]\nyl = [int(i) for i in input().split()]\nif x > y:\n print(\"War\")\nelse:\n zl = np.arange(x + 1, y + 1)\n for z in zl:\n if (max(xl) < z) & (z <= min(yl)):\n print(\"No War\")\n break\n else:\n print(\"War\")\n", "slow_code_sha256": "a3fbc6c47b132b7bae66af85f9792255327ce8e3bf2b5b22873b7c8d59510fae", "slow_id": "p03251_a3fbc6c47b132b7bae66af85f9792255327ce8e3bf2b5b22873b7c8d59510fae", "speedup": 249.1788962392138, "stratum": "8+", "within_pair_jaccard": 0.42105263157894735, "workload": {"case_count": 100, "description": "Determine whether an integer Z satisfies X=Z. Each coordinate list is distinct internally and excludes its own capital X or Y. Lists are not necessarily sorted. Observed inputs: N=1..100 (median 50); M=1..100 (median 50); X=-100..99; Y=-99..100; x_i=-100..100; y_i=-100..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 706, "median": 356.0, "min": 20}, "input_format": ["N M X Y\nx_1 ... x_N\ny_1 ... y_M"], "input_format_status": "source_input_section", "input_lines": {"max": 3, "median": 3.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 204, "median": 104.0, "min": 6}}} -{"case_ids": ["p03575_case_000", "p03575_case_001", "p03575_case_002", "p03575_case_003", "p03575_case_004", "p03575_case_005", "p03575_case_006", "p03575_case_007", "p03575_case_008", "p03575_case_009", "p03575_case_010", "p03575_case_011", "p03575_case_012", "p03575_case_013", "p03575_case_014", "p03575_case_015", "p03575_case_016", "p03575_case_017", "p03575_case_018", "p03575_case_019", "p03575_case_020", "p03575_case_021", "p03575_case_022", "p03575_case_023", "p03575_case_024", "p03575_case_025", "p03575_case_026", "p03575_case_027", "p03575_case_028", "p03575_case_029", "p03575_case_030", "p03575_case_031", "p03575_case_032", "p03575_case_033", "p03575_case_034", "p03575_case_035", "p03575_case_036", "p03575_case_037", "p03575_case_038", "p03575_case_039", "p03575_case_040", "p03575_case_041", "p03575_case_042", "p03575_case_043", "p03575_case_044", "p03575_case_045", "p03575_case_046", "p03575_case_047", "p03575_case_048", "p03575_case_049", "p03575_case_050", "p03575_case_051", "p03575_case_052", "p03575_case_053", "p03575_case_054", "p03575_case_055", "p03575_case_056", "p03575_case_057", "p03575_case_058", "p03575_case_059", "p03575_case_060", "p03575_case_061", "p03575_case_062", "p03575_case_063", "p03575_case_064", "p03575_case_065", "p03575_case_066", "p03575_case_067", "p03575_case_068", "p03575_case_069", "p03575_case_070", "p03575_case_071", "p03575_case_072", "p03575_case_073", "p03575_case_074", "p03575_case_075", "p03575_case_076", "p03575_case_077", "p03575_case_078", "p03575_case_079", "p03575_case_080", "p03575_case_081", "p03575_case_082", "p03575_case_083", "p03575_case_084", "p03575_case_085", "p03575_case_086", "p03575_case_087", "p03575_case_088", "p03575_case_089", "p03575_case_090", "p03575_case_091", "p03575_case_092", "p03575_case_093", "p03575_case_094", "p03575_case_095", "p03575_case_096", "p03575_case_097", "p03575_case_098", "p03575_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from collections import deque\n\nN, M = list(map(int, input().split()))\n\nG = [[] for _ in range(N)]\nE = []\nfor _ in range(M):\n a, b = list(map(int, input().split()))\n\n a -= 1\n b -= 1\n E.append((a, b))\n G[a].append(b)\n G[b].append(a)\n\n\ncnt = 0\nfor edge_to_remove in E:\n\n i, j = edge_to_remove\n G[i].remove(j)\n G[j].remove(i)\n\n seen = [False] * N\n todo = deque()\n\n todo.append(0)\n seen[0] = True\n seen_nodes_num = 0\n while todo:\n here = todo.pop()\n seen_nodes_num += 1\n for neighbor in G[here]:\n if seen[neighbor] == False:\n seen[neighbor] = True\n todo.append(neighbor)\n\n if seen_nodes_num != N:\n cnt += 1\n\n G[i].append(j)\n G[j].append(i)\nprint(cnt)\n", "fast_code_sha256": "32784dbf176165a221699734d01c8ce01e72e2ebcf99f03853e3ccde36b51530", "fast_id": "p03575_ad2cf7a50d347a36b9769867ff1d007c85415b97019838c5369edf7fcf139717", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "# pythonでスタック、キューを実現するためにdequeをimport\nfrom collections import deque\n\nN, M = list(map(int, input().split()))\n# 辺集合EとグラフGの構築\nG = [[] for _ in range(N)]\nE = []\nfor _ in range(M):\n a, b = list(map(int, input().split()))\n # 入力は1-indexedだがこれを扱いやすいように0-indexedに変更\n a -= 1\n b -= 1\n E.append((a, b))\n G[a].append(b)\n G[b].append(a)\n# print(G)\n# 橋を数え���ための変数cntを用意\ncnt = 0\nfor edge_to_remove in E:\n # 橋であるか判定したい辺を取り除いてみる\n i, j = edge_to_remove\n G[i].remove(j)\n G[j].remove(i)\n # 深さ優先探索\n seen = [False] * N\n todo = deque()\n # 適当な頂点から深さ優先探索をスタート(ここでは頂点0をスタートに選んだ)\n todo.append(0)\n seen[0] = True\n seen_nodes_num = 0\n while todo:\n here = todo.pop()\n seen_nodes_num += 1\n for neighbor in G[here]:\n if seen[neighbor] == False:\n seen[neighbor] = True\n todo.append(neighbor)\n # print(seen)\n # もし訪問できていない頂点があれば連結でないというなので今着目している辺は橋であった!\n if seen_nodes_num != N:\n cnt += 1\n # 次の辺について調べるために今取り除いた辺を再びGに戻しておく\n G[i].append(j)\n G[j].append(i)\nprint(cnt)\n", "measured_fast_code_sha256": "ad2cf7a50d347a36b9769867ff1d007c85415b97019838c5369edf7fcf139717", "measured_slow_code": "N, M = list(map(int, input().split()))\nT = [[0 for i in range(N + 1)] for j in range(N + 1)]\nfor i in range(M):\n a, b = list(map(int, input().split()))\n T[a][b] = 1\n T[b][a] = 1\nans = 0\n\n\ndef f(v, x, y):\n global N, M, T, a\n a[v] = 1\n for i in range(N + 1):\n if (v == x and i == y) or (v == y and i == x):\n continue\n elif T[v][i] == 0 or a[i] == 1:\n continue\n f(i, x, y)\n\n\nfor i in range(1, N + 1):\n for j in range(i, N + 1):\n a = [0 for _ in range(N + 1)]\n f(1, i, j)\n if sum(a) != N:\n ans += 1\nprint(ans)\n", "measured_slow_code_sha256": "2b7c23b719bd5ccd195bdbfc609f9c66941f2fe28fa4d92335b08753cebac543", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4.914967397385512, "pair_id": "python_v2_25a5d992a5b01edb7f62c2e3", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03575", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03575_ad2cf7a50d347a36b9769867ff1d007c85415b97019838c5369edf7fcf139717.jsonl.gz", "inputs": "reproduction/python/inputs/p03575.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03575_2b7c23b719bd5ccd195bdbfc609f9c66941f2fe28fa4d92335b08753cebac543.jsonl.gz"}, "slow_code": "N, M = list(map(int, input().split()))\nT = [[0 for i in range(N + 1)] for j in range(N + 1)]\nfor i in range(M):\n a, b = list(map(int, input().split()))\n T[a][b] = 1\n T[b][a] = 1\nans = 0\n\n\ndef f(v, x, y):\n global N, M, T, a\n a[v] = 1\n for i in range(N + 1):\n if (v == x and i == y) or (v == y and i == x):\n continue\n elif T[v][i] == 0 or a[i] == 1:\n continue\n f(i, x, y)\n\n\nfor i in range(1, N + 1):\n for j in range(i, N + 1):\n a = [0 for _ in range(N + 1)]\n f(1, i, j)\n if sum(a) != N:\n ans += 1\nprint(ans)\n", "slow_code_sha256": "2b7c23b719bd5ccd195bdbfc609f9c66941f2fe28fa4d92335b08753cebac543", "slow_id": "p03575_2b7c23b719bd5ccd195bdbfc609f9c66941f2fe28fa4d92335b08753cebac543", "speedup": 7.583625488228938, "stratum": "4-8", "within_pair_jaccard": 0.37254901960784315, "workload": {"case_count": 100, "description": "Count bridges in a connected simple undirected graph: a bridge is an edge whose removal disconnects it. Vertices are numbered 1..N and each listed edge has a_i dist[a] + c:\n dist[b] = dist[a] + c\n update = False\n if update:\n break\n cnt += 1\n if cnt > 2 * N:\n flag = True\n break\nif flag:\n print(\"inf\")\nelif dist[N - 1] == float(\"inf\"):\n print(\"inf\")\nelse:\n print((-dist[N - 1]))\n", "fast_code_sha256": "889417474baadfa9b363430b098a8455a8cfa285e106d991961115f60ea60f80", "fast_id": "p03722_889417474baadfa9b363430b098a8455a8cfa285e106d991961115f60ea60f80", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from collections import defaultdict\n\nN, M, *L = list(map(int, open(0).read().split()))\ndic = defaultdict(list)\nrdic = defaultdict(list)\nnin = [0] * N\nEls = []\nfor a, b, c in zip(*[iter(L)] * 3):\n dic[a - 1] += [b - 1]\n rdic[b - 1] += [a - 1]\n nin[b - 1] += 1\n Els += [(a - 1, b - 1, -c)]\nTo = [False] * N\nFrom = [False] * N\nq = [0]\nTo[0] = True\nwhile q:\n p = q.pop()\n for e in dic[p]:\n if To[e] == False:\n To[e] = True\n q += [e]\nq = [N - 1]\nFrom[N - 1] = True\nwhile q:\n p = q.pop()\n for e in rdic[p]:\n if From[e] == False:\n From[e] = True\n q += [e]\nok = [False] * N\nfor i in range(N):\n ok[i] = To[i] & From[i]\ncnt = 0\ndist = [float(\"inf\")] * N\ndist[0] = 0\ncnt = 0\nflag = False\nwhile True:\n update = True\n for a, b, c in Els:\n if not (ok[a] and ok[b]):\n continue\n if dist[a] != float(\"inf\") and dist[b] > dist[a] + c:\n dist[b] = dist[a] + c\n update = False\n if update:\n break\n cnt += 1\n if cnt > 2 * N:\n flag = True\n break\nif flag:\n print(\"inf\")\nelif dist[N - 1] == float(\"inf\"):\n print(\"inf\")\nelse:\n print((-dist[N - 1]))\n", "measured_fast_code_sha256": "889417474baadfa9b363430b098a8455a8cfa285e106d991961115f60ea60f80", "measured_slow_code": "n, m = list(map(int, input().split()))\nA = [list(map(int, input().split())) for i in range(m)]\nfor i in range(m):\n A[i][2] = -A[i][2]\nP = [float(\"inf\")] * (n + 1)\nP[1] = 0\nF = [[0] * 2 for i in range(n + 1)]\nF[1][0] = 1\nF[n][1] = 1\nfor i in range(n):\n for j in range(m):\n if F[A[j][0]][0] == 1:\n F[A[j][1]][0] = 1\n if F[A[j][1]][1] == 1:\n F[A[j][0]][1] = 1\n P[A[j][1]] = min(P[A[j][1]], P[A[j][0]] + A[j][2])\nans0 = P[:]\nfor i in range(n):\n for j in range(m):\n if F[A[j][0]][0] == 1:\n F[A[j][1]][0] = 1\n if F[A[j][1]][1] == 1:\n F[A[j][0]][1] = 1\n P[A[j][1]] = min(P[A[j][1]], P[A[j][0]] + A[j][2])\nans1 = P[:]\n# print(F)\ndef d():\n for i in range(n + 1):\n if F[i] == [1, 1] and ans1[i] < ans0[i]:\n return \"inf\"\n return -ans0[n]\n\n\nprint((d()))\n", "measured_slow_code_sha256": "093486d8bf1bade74d0f7f3e71a354e24ef56e72b4374c89214f326ef468df33", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.6083371560581203, "pair_id": "python_v2_060ec2e6deb1f5813f3f5846", "per_case_slow_code_faster_fraction": 0.11, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03722", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03722_889417474baadfa9b363430b098a8455a8cfa285e106d991961115f60ea60f80.jsonl.gz", "inputs": "reproduction/python/inputs/p03722.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03722_093486d8bf1bade74d0f7f3e71a354e24ef56e72b4374c89214f326ef468df33.jsonl.gz"}, "slow_code": "n, m = list(map(int, input().split()))\nA = [list(map(int, input().split())) for i in range(m)]\nfor i in range(m):\n A[i][2] = -A[i][2]\nP = [float(\"inf\")] * (n + 1)\nP[1] = 0\nF = [[0] * 2 for i in range(n + 1)]\nF[1][0] = 1\nF[n][1] = 1\nfor i in range(n):\n for j in range(m):\n if F[A[j][0]][0] == 1:\n F[A[j][1]][0] = 1\n if F[A[j][1]][1] == 1:\n F[A[j][0]][1] = 1\n P[A[j][1]] = min(P[A[j][1]], P[A[j][0]] + A[j][2])\nans0 = P[:]\nfor i in range(n):\n for j in range(m):\n if F[A[j][0]][0] == 1:\n F[A[j][1]][0] = 1\n if F[A[j][1]][1] == 1:\n F[A[j][0]][1] = 1\n P[A[j][1]] = min(P[A[j][1]], P[A[j][0]] + A[j][2])\nans1 = P[:]\n\n\ndef d():\n for i in range(n + 1):\n if F[i] == [1, 1] and ans1[i] < ans0[i]:\n return \"inf\"\n return -ans0[n]\n\n\nprint((d()))\n", "slow_code_sha256": "92422ed6fb877fc678246d4b0dc0afea655ea5fbeb5e6aea37d1962e1b39f169", "slow_id": "p03722_093486d8bf1bade74d0f7f3e71a354e24ef56e72b4374c89214f326ef468df33", "speedup": 2.2401740877096272, "stratum": "2-4", "within_pair_jaccard": 0.23880597014925373, "workload": {"case_count": 100, "description": "Start at vertex 1 with score zero and traverse directed edges, adding weight c_i each time. End only at vertex N. Maximize score, or report inf if unbounded; reaching N is guaranteed. No self-loops or repeated directed edges. Observed inputs: N=2..1000 (median 100); M=1..2000 (median 999); c_i=-1000000000..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 36387, "median": 17847.0, "min": 18}, "input_format": ["N M\na_1 b_1 c_1\n...\na_M b_M c_M"], "input_format_status": "source_input_section", "input_lines": {"max": 2001, "median": 1000.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 6002, "median": 2999.0, "min": 5}}} -{"case_ids": ["p02922_case_000", "p02922_case_001", "p02922_case_002", "p02922_case_003", "p02922_case_004", "p02922_case_005", "p02922_case_006", "p02922_case_007", "p02922_case_008", "p02922_case_009", "p02922_case_010", "p02922_case_011", "p02922_case_012", "p02922_case_013", "p02922_case_014", "p02922_case_015", "p02922_case_016", "p02922_case_017", "p02922_case_018", "p02922_case_019", "p02922_case_020", "p02922_case_021", "p02922_case_022", "p02922_case_023", "p02922_case_024", "p02922_case_025", "p02922_case_026", "p02922_case_027", "p02922_case_028", "p02922_case_029", "p02922_case_030", "p02922_case_031", "p02922_case_032", "p02922_case_033", "p02922_case_034", "p02922_case_035", "p02922_case_036", "p02922_case_037", "p02922_case_038", "p02922_case_039", "p02922_case_040", "p02922_case_041", "p02922_case_042", "p02922_case_043", "p02922_case_044", "p02922_case_045", "p02922_case_046", "p02922_case_047", "p02922_case_048", "p02922_case_049", "p02922_case_050", "p02922_case_051", "p02922_case_052", "p02922_case_053", "p02922_case_054", "p02922_case_055", "p02922_case_056", "p02922_case_057", "p02922_case_058", "p02922_case_059", "p02922_case_060", "p02922_case_061", "p02922_case_062", "p02922_case_063", "p02922_case_064", "p02922_case_065", "p02922_case_066", "p02922_case_067", "p02922_case_068", "p02922_case_069", "p02922_case_070", "p02922_case_071", "p02922_case_072", "p02922_case_073", "p02922_case_074", "p02922_case_075", "p02922_case_076", "p02922_case_077", "p02922_case_078", "p02922_case_079", "p02922_case_080", "p02922_case_081", "p02922_case_082", "p02922_case_083", "p02922_case_084", "p02922_case_085", "p02922_case_086", "p02922_case_087", "p02922_case_088", "p02922_case_089", "p02922_case_090", "p02922_case_091", "p02922_case_092", "p02922_case_093", "p02922_case_094", "p02922_case_095", "p02922_case_096", "p02922_case_097", "p02922_case_098", "p02922_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\nsys.setrecursionlimit(10**6)\nA, B = list(map(int, input().split()))\ncnt = 0\ntmp = A\nwhile True:\n cnt += 1\n if tmp >= B:\n break\n else:\n tmp += A - 1\nif B == 1:\n print((0))\nelse:\n print(cnt)\n", "fast_code_sha256": "aea4722c0d554376063b268dde7a61fedc12d43bb51df28a7c04d2fa002501c9", "fast_id": "p02922_aea4722c0d554376063b268dde7a61fedc12d43bb51df28a7c04d2fa002501c9", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\nsys.setrecursionlimit(10**6)\nA, B = list(map(int, input().split()))\ncnt = 0\ntmp = A\nwhile True:\n cnt += 1\n if tmp >= B:\n break\n else:\n tmp += A - 1\nif B == 1:\n print((0))\nelse:\n print(cnt)\n", "measured_fast_code_sha256": "aea4722c0d554376063b268dde7a61fedc12d43bb51df28a7c04d2fa002501c9", "measured_slow_code": "from copy import deepcopy\nfrom math import ceil\n\nif __name__ == \"__main__\":\n a = list(map(int, input().split()))\n n = deepcopy(a[0])\n i = 1\n if a[0] == a[1]:\n print(i)\n elif a[1] == 1:\n print((0))\n elif a[0] >= a[1]:\n print(i)\n else:\n while True:\n i += 1\n n += a[0] - 1\n if n >= a[1]:\n print(i)\n break\n", "measured_slow_code_sha256": "00e867b7d2095675b21d44aa0203e42270e0c7d7b6d93feade6e801e5b2a696c", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 7.688006037690053, "pair_id": "python_v2_a1ed5a993b97344ec12ab0f4", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02922", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02922_aea4722c0d554376063b268dde7a61fedc12d43bb51df28a7c04d2fa002501c9.jsonl.gz", "inputs": "reproduction/python/inputs/p02922.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02922_00e867b7d2095675b21d44aa0203e42270e0c7d7b6d93feade6e801e5b2a696c.jsonl.gz"}, "slow_code": "from copy import deepcopy\nfrom math import ceil\n\nif __name__ == \"__main__\":\n a = list(map(int, input().split()))\n n = deepcopy(a[0])\n i = 1\n if a[0] == a[1]:\n print(i)\n elif a[1] == 1:\n print((0))\n elif a[0] >= a[1]:\n print(i)\n else:\n while True:\n i += 1\n n += a[0] - 1\n if n >= a[1]:\n print(i)\n break\n", "slow_code_sha256": "00e867b7d2095675b21d44aa0203e42270e0c7d7b6d93feade6e801e5b2a696c", "slow_id": "p02922_00e867b7d2095675b21d44aa0203e42270e0c7d7b6d93feade6e801e5b2a696c", "speedup": 7.66221407055997, "stratum": "4-8", "within_pair_jaccard": 0.42424242424242425, "workload": {"case_count": 100, "description": "Start with one empty electrical socket. Installing a strip consumes one socket and provides A empty sockets. Find the fewest strips needed to have at least B empty sockets. Observed inputs: A=2..20 (median 8); B=1..20 (median 7).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 6, "median": 4.5, "min": 4}, "input_format": ["A B"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p03502_case_000", "p03502_case_001", "p03502_case_002", "p03502_case_003", "p03502_case_004", "p03502_case_005", "p03502_case_006", "p03502_case_007", "p03502_case_008", "p03502_case_009", "p03502_case_010", "p03502_case_011", "p03502_case_012", "p03502_case_013", "p03502_case_014", "p03502_case_015", "p03502_case_016", "p03502_case_017", "p03502_case_018", "p03502_case_019", "p03502_case_020", "p03502_case_021", "p03502_case_022", "p03502_case_023", "p03502_case_024", "p03502_case_025", "p03502_case_026", "p03502_case_027", "p03502_case_028", "p03502_case_029", "p03502_case_030", "p03502_case_031", "p03502_case_032", "p03502_case_033", "p03502_case_034", "p03502_case_035", "p03502_case_036", "p03502_case_037", "p03502_case_038", "p03502_case_039", "p03502_case_040", "p03502_case_041", "p03502_case_042", "p03502_case_043", "p03502_case_044", "p03502_case_045", "p03502_case_046", "p03502_case_047", "p03502_case_048", "p03502_case_049", "p03502_case_050", "p03502_case_051", "p03502_case_052", "p03502_case_053", "p03502_case_054", "p03502_case_055", "p03502_case_056", "p03502_case_057", "p03502_case_058", "p03502_case_059", "p03502_case_060", "p03502_case_061", "p03502_case_062", "p03502_case_063", "p03502_case_064", "p03502_case_065", "p03502_case_066", "p03502_case_067", "p03502_case_068", "p03502_case_069", "p03502_case_070", "p03502_case_071", "p03502_case_072", "p03502_case_073", "p03502_case_074", "p03502_case_075", "p03502_case_076", "p03502_case_077", "p03502_case_078", "p03502_case_079", "p03502_case_080", "p03502_case_081", "p03502_case_082", "p03502_case_083", "p03502_case_084", "p03502_case_085", "p03502_case_086", "p03502_case_087", "p03502_case_088", "p03502_case_089", "p03502_case_090", "p03502_case_091", "p03502_case_092", "p03502_case_093", "p03502_case_094", "p03502_case_095", "p03502_case_096", "p03502_case_097", "p03502_case_098", "p03502_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\nread = sys.stdin.read\nreadlines = sys.stdin.readlines\n\n\ndef main():\n n = int(eval(input()))\n nc = n\n ncsum = 0\n while nc:\n ncsum += nc % 10\n nc = nc // 10\n if n % ncsum == 0:\n print(\"Yes\")\n else:\n print(\"No\")\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "f5a6f4a20bcb291d51ed4b41a259d1447b4dc28eed22e16561ebb79ad2c5b137", "fast_id": "p03502_f5a6f4a20bcb291d51ed4b41a259d1447b4dc28eed22e16561ebb79ad2c5b137", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\nread = sys.stdin.read\nreadlines = sys.stdin.readlines\n\n\ndef main():\n n = int(eval(input()))\n nc = n\n ncsum = 0\n while nc:\n ncsum += nc % 10\n nc = nc // 10\n if n % ncsum == 0:\n print(\"Yes\")\n else:\n print(\"No\")\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "f5a6f4a20bcb291d51ed4b41a259d1447b4dc28eed22e16561ebb79ad2c5b137", "measured_slow_code": "import sys\nimport math\nimport collections\nimport itertools\nimport array\nimport inspect\n\n# Set max recursion limit\nsys.setrecursionlimit(10000)\n# Debug output\ndef chkprint(*args):\n names = {id(v): k for k, v in list(inspect.currentframe().f_back.f_locals.items())}\n print((\", \".join(names.get(id(arg), \"???\") + \" = \" + repr(arg) for arg in args)))\n\n\n# Binary converter\ndef to_bin(x):\n return bin(x)[2:]\n\n\ndef li_input():\n return [int(_) for _ in input().split()]\n\n\n# --------------------------------------------\ndp = None\n\n\ndef main():\n X = int(eval(input()))\n if X % sum(list(map(int, list(str(X))))) == 0:\n print(\"Yes\")\n else:\n print(\"No\")\n\n\nmain()\n", "measured_slow_code_sha256": "9657e24fd296bdb183cb812efcaa41e0e4d09edff18e911040359edf4aba2689", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 30.266598288971153, "pair_id": "python_v2_141508992e0aaf5f237ea809", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03502", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03502_f5a6f4a20bcb291d51ed4b41a259d1447b4dc28eed22e16561ebb79ad2c5b137.jsonl.gz", "inputs": "reproduction/python/inputs/p03502.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03502_9657e24fd296bdb183cb812efcaa41e0e4d09edff18e911040359edf4aba2689.jsonl.gz"}, "slow_code": "import sys\nimport math\nimport collections\nimport itertools\nimport array\nimport inspect\n\n\nsys.setrecursionlimit(10000)\n\n\ndef chkprint(*args):\n names = {id(v): k for k, v in list(inspect.currentframe().f_back.f_locals.items())}\n print((\", \".join(names.get(id(arg), \"???\") + \" = \" + repr(arg) for arg in args)))\n\n\ndef to_bin(x):\n return bin(x)[2:]\n\n\ndef li_input():\n return [int(_) for _ in input().split()]\n\n\ndp = None\n\n\ndef main():\n X = int(eval(input()))\n if X % sum(list(map(int, list(str(X))))) == 0:\n print(\"Yes\")\n else:\n print(\"No\")\n\n\nmain()\n", "slow_code_sha256": "04afcb0636d6758b9c1fd4024fff2537c6c73d327a7f8a692ef75cf80e1d3933", "slow_id": "p03502_9657e24fd296bdb183cb812efcaa41e0e4d09edff18e911040359edf4aba2689", "speedup": 30.343855406270176, "stratum": "8+", "within_pair_jaccard": 0.21311475409836064, "workload": {"case_count": 100, "description": "Determine whether positive integer N is divisible by the sum of its decimal digits. Observed inputs: N=1..100000000 (median 8425409).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 10, "median": 8.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p03312_case_000", "p03312_case_001", "p03312_case_002", "p03312_case_003", "p03312_case_004", "p03312_case_005", "p03312_case_006", "p03312_case_007", "p03312_case_008", "p03312_case_009", "p03312_case_010", "p03312_case_011", "p03312_case_012", "p03312_case_013", "p03312_case_014", "p03312_case_015", "p03312_case_016", "p03312_case_017", "p03312_case_018", "p03312_case_019", "p03312_case_020", "p03312_case_021", "p03312_case_022", "p03312_case_023", "p03312_case_024", "p03312_case_025", "p03312_case_026", "p03312_case_027", "p03312_case_028", "p03312_case_029", "p03312_case_030", "p03312_case_031", "p03312_case_032", "p03312_case_033", "p03312_case_034", "p03312_case_035", "p03312_case_036", "p03312_case_037", "p03312_case_038", "p03312_case_039", "p03312_case_040", "p03312_case_041", "p03312_case_042", "p03312_case_043", "p03312_case_044", "p03312_case_045", "p03312_case_046", "p03312_case_047", "p03312_case_048", "p03312_case_049", "p03312_case_050", "p03312_case_051", "p03312_case_052", "p03312_case_053", "p03312_case_054", "p03312_case_055", "p03312_case_056", "p03312_case_057", "p03312_case_058", "p03312_case_059", "p03312_case_060", "p03312_case_061", "p03312_case_062", "p03312_case_063", "p03312_case_064", "p03312_case_065", "p03312_case_066", "p03312_case_067", "p03312_case_068", "p03312_case_069", "p03312_case_070", "p03312_case_071", "p03312_case_072", "p03312_case_073", "p03312_case_074", "p03312_case_075", "p03312_case_076", "p03312_case_077", "p03312_case_078", "p03312_case_079", "p03312_case_080", "p03312_case_081", "p03312_case_082", "p03312_case_083", "p03312_case_084", "p03312_case_085", "p03312_case_086", "p03312_case_087", "p03312_case_088", "p03312_case_089", "p03312_case_090", "p03312_case_091", "p03312_case_092", "p03312_case_093", "p03312_case_094", "p03312_case_095", "p03312_case_096", "p03312_case_097", "p03312_case_098", "p03312_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N = int(eval(input()))\nAs = list(map(int, input().split()))\nans = float(\"inf\")\niB, iD = 1, 3\n(P, Q, R), S = As[:3], sum(As[3:])\n\nfor iC in range(2, N - 1):\n while P < Q and As[iB] <= Q - P:\n P += As[iB]\n Q -= As[iB]\n iB += 1\n while R < S and As[iD] <= S - R:\n R += As[iD]\n S -= As[iD]\n iD += 1\n ans = min(ans, max(P, Q, R, S) - min(P, Q, R, S))\n Q += As[iC]\n R -= As[iC]\nprint(ans)\n", "fast_code_sha256": "edcc95617201d5626b449d1a7abf3100c52bfc6d5e1b34d56dd05ba872f655f1", "fast_id": "p03312_d384bba78aa3be094873144e7572be2fec2f5b51b3dabf911721719d39833e4d", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N = int(eval(input()))\nAs = list(map(int, input().split()))\nans = float(\"inf\")\niB, iD = 1, 3\n(P, Q, R), S = As[:3], sum(As[3:])\n# 真ん中の区切りを全通り試す\nfor iC in range(2, N - 1):\n while P < Q and As[iB] <= Q - P:\n P += As[iB]\n Q -= As[iB]\n iB += 1\n while R < S and As[iD] <= S - R:\n R += As[iD]\n S -= As[iD]\n iD += 1\n ans = min(ans, max(P, Q, R, S) - min(P, Q, R, S))\n Q += As[iC]\n R -= As[iC]\nprint(ans)\n", "measured_fast_code_sha256": "d384bba78aa3be094873144e7572be2fec2f5b51b3dabf911721719d39833e4d", "measured_slow_code": "# D\nN = int(eval(input()))\nA_list = list(map(int, input().split()))\n# cumsum from left\na = 0\nA_left = []\nfor i in range(N):\n a += A_list[i]\n A_left.append(a)\n# cumsum from right\na = 0\nA_right = []\nfor i in range(N):\n a += A_list[N - 1 - i]\n A_right.append(a)\n\n\ndef binary_search_left(s):\n m = 0\n l = 0\n r = N - 1\n if A_left[0] > s:\n return 0\n while True:\n m = (l + r) // 2\n if A_left[m] <= s and A_left[m + 1] > s:\n break\n elif A_left[m] <= s:\n l = m\n else:\n r = m\n if s - A_left[m] <= A_left[m + 1] - s:\n return m\n else:\n return m + 1\n\n\ndef binary_search_right(s):\n m = 0\n l = 0\n r = N - 1\n if A_right[0] > s:\n return 0\n while True:\n m = (l + r) // 2\n if A_right[m] <= s and A_right[m + 1] > s:\n break\n elif A_right[m] <= s:\n l = m\n else:\n r = m\n if s - A_right[m] <= A_right[m + 1] - s:\n return m\n else:\n return m + 1\n\n\n# B | C split\nres = A_left[N - 1]\nfor s in range(2, N - 1):\n m_l = binary_search_left(A_left[s - 1] / 2)\n a, b = A_left[m_l], A_left[s - 1] - A_left[m_l]\n r = N - s\n m_r = binary_search_right(A_right[r - 1] / 2)\n c, d = A_right[m_r], A_right[r - 1] - A_right[m_r]\n r = max([a, b, c, d]) - min([a, b, c, d])\n if r < res:\n res = r\nif N == 4:\n res = max(A_list) - min(A_list)\nprint(res)\n", "measured_slow_code_sha256": "e080e07d8424e073d5e98936947b26997efc5cec42a718a67ce6f5adfbb4164f", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.763236680037055, "pair_id": "python_v2_1da7170a9212895df6471aa2", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03312", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03312_d384bba78aa3be094873144e7572be2fec2f5b51b3dabf911721719d39833e4d.jsonl.gz", "inputs": "reproduction/python/inputs/p03312.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03312_e080e07d8424e073d5e98936947b26997efc5cec42a718a67ce6f5adfbb4164f.jsonl.gz"}, "slow_code": "N = int(eval(input()))\nA_list = list(map(int, input().split()))\n\na = 0\nA_left = []\nfor i in range(N):\n a += A_list[i]\n A_left.append(a)\n\na = 0\nA_right = []\nfor i in range(N):\n a += A_list[N - 1 - i]\n A_right.append(a)\n\n\ndef binary_search_left(s):\n m = 0\n l = 0\n r = N - 1\n if A_left[0] > s:\n return 0\n while True:\n m = (l + r) // 2\n if A_left[m] <= s and A_left[m + 1] > s:\n break\n elif A_left[m] <= s:\n l = m\n else:\n r = m\n if s - A_left[m] <= A_left[m + 1] - s:\n return m\n else:\n return m + 1\n\n\ndef binary_search_right(s):\n m = 0\n l = 0\n r = N - 1\n if A_right[0] > s:\n return 0\n while True:\n m = (l + r) // 2\n if A_right[m] <= s and A_right[m + 1] > s:\n break\n elif A_right[m] <= s:\n l = m\n else:\n r = m\n if s - A_right[m] <= A_right[m + 1] - s:\n return m\n else:\n return m + 1\n\n\nres = A_left[N - 1]\nfor s in range(2, N - 1):\n m_l = binary_search_left(A_left[s - 1] / 2)\n a, b = A_left[m_l], A_left[s - 1] - A_left[m_l]\n r = N - s\n m_r = binary_search_right(A_right[r - 1] / 2)\n c, d = A_right[m_r], A_right[r - 1] - A_right[m_r]\n r = max([a, b, c, d]) - min([a, b, c, d])\n if r < res:\n res = r\nif N == 4:\n res = max(A_list) - min(A_list)\nprint(res)\n", "slow_code_sha256": "16fb7a6a6fbb5a3605c73ff209ab7a3c5e631bdab9b5fdf86ce49a66abed34d7", "slow_id": "p03312_e080e07d8424e073d5e98936947b26997efc5cec42a718a67ce6f5adfbb4164f", "speedup": 3.563380120032856, "stratum": "2-4", "within_pair_jaccard": 0.2982456140350877, "workload": {"case_count": 100, "description": "Split a positive array into exactly four nonempty contiguous parts. Minimize the largest part sum minus the smallest part sum. Observed inputs: N=4..200000 (median 1000); A_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 2200007, "median": 2113.5, "min": 10}, "input_format": ["N\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200001, "median": 1001.0, "min": 5}}} -{"case_ids": ["p00789_case_000", "p00789_case_001", "p00789_case_002", "p00789_case_003", "p00789_case_004", "p00789_case_005", "p00789_case_006", "p00789_case_007", "p00789_case_008", "p00789_case_009", "p00789_case_010", "p00789_case_011", "p00789_case_012", "p00789_case_013", "p00789_case_014", "p00789_case_015", "p00789_case_016", "p00789_case_017", "p00789_case_018", "p00789_case_019", "p00789_case_020", "p00789_case_021", "p00789_case_022", "p00789_case_023", "p00789_case_024", "p00789_case_025", "p00789_case_026", "p00789_case_027", "p00789_case_028", "p00789_case_029", "p00789_case_030", "p00789_case_031", "p00789_case_032", "p00789_case_033", "p00789_case_034", "p00789_case_035", "p00789_case_036", "p00789_case_037", "p00789_case_038", "p00789_case_039", "p00789_case_040", "p00789_case_041", "p00789_case_042", "p00789_case_043", "p00789_case_044", "p00789_case_045", "p00789_case_046", "p00789_case_047", "p00789_case_048", "p00789_case_049", "p00789_case_050", "p00789_case_051", "p00789_case_052", "p00789_case_053", "p00789_case_054", "p00789_case_055", "p00789_case_056", "p00789_case_057", "p00789_case_058", "p00789_case_059", "p00789_case_060", "p00789_case_061", "p00789_case_062", "p00789_case_063", "p00789_case_064", "p00789_case_065", "p00789_case_066", "p00789_case_067", "p00789_case_068", "p00789_case_069", "p00789_case_070", "p00789_case_071", "p00789_case_072", "p00789_case_073", "p00789_case_074", "p00789_case_075", "p00789_case_076", "p00789_case_077", "p00789_case_078", "p00789_case_079", "p00789_case_080", "p00789_case_081", "p00789_case_082", "p00789_case_083", "p00789_case_084", "p00789_case_085", "p00789_case_086", "p00789_case_087", "p00789_case_088", "p00789_case_089", "p00789_case_090", "p00789_case_091", "p00789_case_092", "p00789_case_093", "p00789_case_094", "p00789_case_095", "p00789_case_096", "p00789_case_097", "p00789_case_098", "p00789_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "dp = [1] * 300\nfor i in range(2, 18):\n for j in range(i**2, 300):\n dp[j] += dp[j - i**2]\nwhile True:\n n = int(eval(input()))\n if n == 0:\n break\n print((dp[n]))\n", "fast_code_sha256": "64eb55694f5670d05a91fd627bb6417facdff1866aef7b2068e21a16c18e3bca", "fast_id": "p00789_9912b66d792cba389c745a8a828ab25cc7b036598591fecef8d3e39bf932a947", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "# AOJ 1209: Square Coins\n# Python3 2018.7.19 bal4u\ndp = [1] * 300\nfor i in range(2, 18):\n for j in range(i**2, 300):\n dp[j] += dp[j - i**2]\nwhile True:\n n = int(eval(input()))\n if n == 0:\n break\n print((dp[n]))\n", "measured_fast_code_sha256": "9912b66d792cba389c745a8a828ab25cc7b036598591fecef8d3e39bf932a947", "measured_slow_code": "# AOJ 1209: Square Coins\n# Python3 2018.7.19 bal4u\nN = 18\ntbl = [i**2 for i in range(0, N)]\ndp = [[0 for j in range(600)] for i in range(N)]\ndp[0][0] = 1\nfor i in range(1, N):\n for n in range(300):\n dp[i][n] += dp[i - 1][n]\n for j in range(tbl[i], 300, tbl[i]):\n dp[i][n + j] += dp[i - 1][n]\nwhile True:\n n = int(eval(input()))\n if n == 0:\n break\n print((dp[N - 1][n]))\n", "measured_slow_code_sha256": "0850c56dafb3d889e39fc16a9f006a78b345e6893de16a5d30d7df214a66f232", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 8.10908241855596, "pair_id": "python_v2_94869c9c0b6681a439ce4d02", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p00789", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p00789_9912b66d792cba389c745a8a828ab25cc7b036598591fecef8d3e39bf932a947.jsonl.gz", "inputs": "reproduction/python/inputs/p00789.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p00789_0850c56dafb3d889e39fc16a9f006a78b345e6893de16a5d30d7df214a66f232.jsonl.gz"}, "slow_code": "N = 18\ntbl = [i**2 for i in range(0, N)]\ndp = [[0 for j in range(600)] for i in range(N)]\ndp[0][0] = 1\nfor i in range(1, N):\n for n in range(300):\n dp[i][n] += dp[i - 1][n]\n for j in range(tbl[i], 300, tbl[i]):\n dp[i][n + j] += dp[i - 1][n]\nwhile True:\n n = int(eval(input()))\n if n == 0:\n break\n print((dp[N - 1][n]))\n", "slow_code_sha256": "4a08723f3736df446eee4d2df628596f65361d6f5b75220d3f6400dd22cdf8b6", "slow_id": "p00789_0850c56dafb3d889e39fc16a9f006a78b345e6893de16a5d30d7df214a66f232", "speedup": 6.699020214360208, "stratum": "4-8", "within_pair_jaccard": 0.8695652173913043, "workload": {"case_count": 100, "description": "For each positive amount, count unordered combinations of coins with denominations 1^2,2^2,...,17^2. Each denomination is available without limit. Amounts are supplied one per line; a final zero ends input. Observed inputs: datasets=1..99999 (median 1000); amount=1..299.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 364279, "median": 3639.5, "min": 4}, "input_format": ["amount_1\n...\namount_D\n0"], "input_format_status": "source_input_section", "input_lines": {"max": 100000, "median": 1001.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100000, "median": 1001.0, "min": 2}}} -{"case_ids": ["p02930_case_000", "p02930_case_001", "p02930_case_002", "p02930_case_003", "p02930_case_004", "p02930_case_005", "p02930_case_006", "p02930_case_007", "p02930_case_008", "p02930_case_009", "p02930_case_010", "p02930_case_011", "p02930_case_012", "p02930_case_013", "p02930_case_014", "p02930_case_015", "p02930_case_016", "p02930_case_017", "p02930_case_018", "p02930_case_019", "p02930_case_020", "p02930_case_021", "p02930_case_022", "p02930_case_023", "p02930_case_024", "p02930_case_025", "p02930_case_026", "p02930_case_027", "p02930_case_028", "p02930_case_029", "p02930_case_030", "p02930_case_031", "p02930_case_032", "p02930_case_033", "p02930_case_034", "p02930_case_035", "p02930_case_036", "p02930_case_037", "p02930_case_038", "p02930_case_039", "p02930_case_040", "p02930_case_041", "p02930_case_042", "p02930_case_043", "p02930_case_044", "p02930_case_045", "p02930_case_046", "p02930_case_047", "p02930_case_048", "p02930_case_049", "p02930_case_050", "p02930_case_051", "p02930_case_052", "p02930_case_053", "p02930_case_054", "p02930_case_055", "p02930_case_056", "p02930_case_057", "p02930_case_058", "p02930_case_059", "p02930_case_060", "p02930_case_061", "p02930_case_062", "p02930_case_063", "p02930_case_064", "p02930_case_065", "p02930_case_066", "p02930_case_067", "p02930_case_068", "p02930_case_069", "p02930_case_070", "p02930_case_071", "p02930_case_072", "p02930_case_073", "p02930_case_074", "p02930_case_075", "p02930_case_076", "p02930_case_077", "p02930_case_078", "p02930_case_079", "p02930_case_080", "p02930_case_081", "p02930_case_082", "p02930_case_083", "p02930_case_084", "p02930_case_085", "p02930_case_086", "p02930_case_087", "p02930_case_088", "p02930_case_089", "p02930_case_090", "p02930_case_091", "p02930_case_092", "p02930_case_093", "p02930_case_094", "p02930_case_095", "p02930_case_096", "p02930_case_097", "p02930_case_098", "p02930_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = eval(input())\nwhile n:\n n -= 1\n for j in range(n):\n print((j + 1 & ~j).bit_length())\n", "fast_code_sha256": "f3896361f060599c0132ae62a438ae715ac8888d947dfd3df4bf46e7b045d748", "fast_id": "p02930_f3896361f060599c0132ae62a438ae715ac8888d947dfd3df4bf46e7b045d748", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = eval(input())\nwhile n:\n n -= 1\n for j in range(n):\n print((j + 1 & ~j).bit_length())\n", "measured_fast_code_sha256": "f3896361f060599c0132ae62a438ae715ac8888d947dfd3df4bf46e7b045d748", "measured_slow_code": "N, j = int(eval(input())), 0\nexec(\"print(*[9-format(i+1,'09b').rfind('1')for i in range(N)][:N-j-1]);j+=1;\" * N)\n", "measured_slow_code_sha256": "e92d2c5b381e0dc13fec91e29d5b05e3c0b38db0ebb8a73555cd4f93676c88e6", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.772827828494917, "pair_id": "python_v2_50749482826d06ab3613e73f", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02930", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02930_f3896361f060599c0132ae62a438ae715ac8888d947dfd3df4bf46e7b045d748.jsonl.gz", "inputs": "reproduction/python/inputs/p02930.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02930_e92d2c5b381e0dc13fec91e29d5b05e3c0b38db0ebb8a73555cd4f93676c88e6.jsonl.gz"}, "slow_code": "N, j = int(eval(input())), 0\nexec(\"print(*[9-format(i+1,'09b').rfind('1')for i in range(N)][:N-j-1]);j+=1;\" * N)\n", "slow_code_sha256": "e92d2c5b381e0dc13fec91e29d5b05e3c0b38db0ebb8a73555cd4f93676c88e6", "slow_id": "p02930_e92d2c5b381e0dc13fec91e29d5b05e3c0b38db0ebb8a73555cd4f93676c88e6", "speedup": 3.0731807045003494, "stratum": "2-4", "within_pair_jaccard": 0.4, "workload": {"case_count": 100, "description": "Assign positive integer levels to edges of an implicit complete graph on N vertices. Every closed walk using only one level must have even length. Output a valid assignment minimizing the highest level. Observed inputs: N=2..500 (median 191); implicit_edges=1..124750.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 4, "median": 4.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p02760_case_000", "p02760_case_001", "p02760_case_002", "p02760_case_003", "p02760_case_004", "p02760_case_005", "p02760_case_006", "p02760_case_007", "p02760_case_008", "p02760_case_009", "p02760_case_010", "p02760_case_011", "p02760_case_012", "p02760_case_013", "p02760_case_014", "p02760_case_015", "p02760_case_016", "p02760_case_017", "p02760_case_018", "p02760_case_019", "p02760_case_020", "p02760_case_021", "p02760_case_022", "p02760_case_023", "p02760_case_024", "p02760_case_025", "p02760_case_026", "p02760_case_027", "p02760_case_028", "p02760_case_029", "p02760_case_030", "p02760_case_031", "p02760_case_032", "p02760_case_033", "p02760_case_034", "p02760_case_035", "p02760_case_036", "p02760_case_037", "p02760_case_038", "p02760_case_039", "p02760_case_040", "p02760_case_041", "p02760_case_042", "p02760_case_043", "p02760_case_044", "p02760_case_045", "p02760_case_046", "p02760_case_047", "p02760_case_048", "p02760_case_049", "p02760_case_050", "p02760_case_051", "p02760_case_052", "p02760_case_053", "p02760_case_054", "p02760_case_055", "p02760_case_056", "p02760_case_057", "p02760_case_058", "p02760_case_059", "p02760_case_060", "p02760_case_061", "p02760_case_062", "p02760_case_063", "p02760_case_064", "p02760_case_065", "p02760_case_066", "p02760_case_067", "p02760_case_068", "p02760_case_069", "p02760_case_070", "p02760_case_071", "p02760_case_072", "p02760_case_073", "p02760_case_074", "p02760_case_075", "p02760_case_076", "p02760_case_077", "p02760_case_078", "p02760_case_079", "p02760_case_080", "p02760_case_081", "p02760_case_082", "p02760_case_083", "p02760_case_084", "p02760_case_085", "p02760_case_086", "p02760_case_087", "p02760_case_088", "p02760_case_089", "p02760_case_090", "p02760_case_091", "p02760_case_092", "p02760_case_093", "p02760_case_094", "p02760_case_095", "p02760_case_096", "p02760_case_097", "p02760_case_098", "p02760_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "(*a,) = list(map(int, open(0).read().split()))\nprint(\n (\n \"NYoe s\"[\n any(\n t <= set(a.index(b) for b in a[10:])\n for t in (\n {0, 1, 2},\n {0, 3, 6},\n {0, 4, 8},\n {1, 4, 7},\n {2, 4, 6},\n {2, 5, 8},\n {3, 4, 5},\n {6, 7, 8},\n )\n ) :: 2\n ]\n )\n)\n", "fast_code_sha256": "37c64c843161b92469540d6a1ec2a29d2c5b7047a3f26ff46e602802a6763f12", "fast_id": "p02760_37c64c843161b92469540d6a1ec2a29d2c5b7047a3f26ff46e602802a6763f12", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "(*a,) = list(map(int, open(0).read().split()))\nprint(\n (\n \"NYoe s\"[\n any(\n t <= set(a.index(b) for b in a[10:])\n for t in (\n {0, 1, 2},\n {0, 3, 6},\n {0, 4, 8},\n {1, 4, 7},\n {2, 4, 6},\n {2, 5, 8},\n {3, 4, 5},\n {6, 7, 8},\n )\n ) :: 2\n ]\n )\n)\n", "measured_fast_code_sha256": "37c64c843161b92469540d6a1ec2a29d2c5b7047a3f26ff46e602802a6763f12", "measured_slow_code": "a = []\nfor i in range(3):\n a1, a2, a3 = list(map(int, input().split()))\n a.append(a1)\n a.append(a2)\n a.append(a3)\nl = [0] * 9\nn = int(eval(input()))\nfor i in range(n):\n b = int(eval(input()))\n if b in a:\n l[a.index(b)] += 1\nif l[0] == 1 and l[1] == 1 and l[2] == 1:\n print(\"Yes\")\nelif l[3] == 1 and l[4] == 1 and l[5] == 1:\n print(\"Yes\")\nelif l[6] == 1 and l[7] == 1 and l[8] == 1:\n print(\"Yes\")\nelif l[0] == 1 and l[3] == 1 and l[6] == 1:\n print(\"Yes\")\nelif l[1] == 1 and l[4] == 1 and l[7] == 1:\n print(\"Yes\")\nelif l[2] == 1 and l[5] == 1 and l[8] == 1:\n print(\"Yes\")\nelif l[0] == 1 and l[4] == 1 and l[8] == 1:\n print(\"Yes\")\nelif l[2] == 1 and l[4] == 1 and l[6] == 1:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "measured_slow_code_sha256": "d6a8397cfa0dcae5cf40d19cddae391fb4dc4dd7ea3a9ed406b5e5e123e4a476", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.1357850243930785, "pair_id": "python_v2_6280864594711d2c0139ed82", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02760", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02760_37c64c843161b92469540d6a1ec2a29d2c5b7047a3f26ff46e602802a6763f12.jsonl.gz", "inputs": "reproduction/python/inputs/p02760.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02760_d6a8397cfa0dcae5cf40d19cddae391fb4dc4dd7ea3a9ed406b5e5e123e4a476.jsonl.gz"}, "slow_code": "a = []\nfor i in range(3):\n a1, a2, a3 = list(map(int, input().split()))\n a.append(a1)\n a.append(a2)\n a.append(a3)\nl = [0] * 9\nn = int(eval(input()))\nfor i in range(n):\n b = int(eval(input()))\n if b in a:\n l[a.index(b)] += 1\nif l[0] == 1 and l[1] == 1 and l[2] == 1:\n print(\"Yes\")\nelif l[3] == 1 and l[4] == 1 and l[5] == 1:\n print(\"Yes\")\nelif l[6] == 1 and l[7] == 1 and l[8] == 1:\n print(\"Yes\")\nelif l[0] == 1 and l[3] == 1 and l[6] == 1:\n print(\"Yes\")\nelif l[1] == 1 and l[4] == 1 and l[7] == 1:\n print(\"Yes\")\nelif l[2] == 1 and l[5] == 1 and l[8] == 1:\n print(\"Yes\")\nelif l[0] == 1 and l[4] == 1 and l[8] == 1:\n print(\"Yes\")\nelif l[2] == 1 and l[4] == 1 and l[6] == 1:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "slow_code_sha256": "d6a8397cfa0dcae5cf40d19cddae391fb4dc4dd7ea3a9ed406b5e5e123e4a476", "slow_id": "p02760_d6a8397cfa0dcae5cf40d19cddae391fb4dc4dd7ea3a9ed406b5e5e123e4a476", "speedup": 2.194985179612643, "stratum": "2-4", "within_pair_jaccard": 0.4318181818181818, "workload": {"case_count": 100, "description": "A 3-by-3 bingo board contains distinct integers A_i,j. Mark numbers among N distinct called values b_i and determine whether any row, column or diagonal is fully marked. Observed inputs: N=1..10 (median 6); A_i_j=1..100; b_i=1..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 60, "median": 46.5, "min": 29}, "input_format": ["A_1,1 A_1,2 A_1,3\nA_2,1 A_2,2 A_2,3\nA_3,1 A_3,2 A_3,3\nN\nb_1\n...\nb_N"], "input_format_status": "source_input_section", "input_lines": {"max": 14, "median": 10.0, "min": 5}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 20, "median": 16.0, "min": 11}}} -{"case_ids": ["p02556_case_000", "p02556_case_001", "p02556_case_002", "p02556_case_003", "p02556_case_004", "p02556_case_005", "p02556_case_006", "p02556_case_007", "p02556_case_008", "p02556_case_009", "p02556_case_010", "p02556_case_011", "p02556_case_012", "p02556_case_013", "p02556_case_014", "p02556_case_015", "p02556_case_016", "p02556_case_017", "p02556_case_018", "p02556_case_019", "p02556_case_020", "p02556_case_021", "p02556_case_022", "p02556_case_023", "p02556_case_024", "p02556_case_025", "p02556_case_026", "p02556_case_027", "p02556_case_028", "p02556_case_029", "p02556_case_030", "p02556_case_031", "p02556_case_032", "p02556_case_033", "p02556_case_034", "p02556_case_035", "p02556_case_036", "p02556_case_037", "p02556_case_038", "p02556_case_039", "p02556_case_040", "p02556_case_041", "p02556_case_042", "p02556_case_043", "p02556_case_044", "p02556_case_045", "p02556_case_046", "p02556_case_047", "p02556_case_048", "p02556_case_049", "p02556_case_050", "p02556_case_051", "p02556_case_052", "p02556_case_053", "p02556_case_054", "p02556_case_055", "p02556_case_056", "p02556_case_057", "p02556_case_058", "p02556_case_059", "p02556_case_060", "p02556_case_061", "p02556_case_062", "p02556_case_063", "p02556_case_064", "p02556_case_065", "p02556_case_066", "p02556_case_067", "p02556_case_068", "p02556_case_069", "p02556_case_070", "p02556_case_071", "p02556_case_072", "p02556_case_073", "p02556_case_074", "p02556_case_075", "p02556_case_076", "p02556_case_077", "p02556_case_078", "p02556_case_079", "p02556_case_080", "p02556_case_081", "p02556_case_082", "p02556_case_083", "p02556_case_084", "p02556_case_085", "p02556_case_086", "p02556_case_087", "p02556_case_088", "p02556_case_089", "p02556_case_090", "p02556_case_091", "p02556_case_092", "p02556_case_093", "p02556_case_094", "p02556_case_095", "p02556_case_096", "p02556_case_097", "p02556_case_098", "p02556_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n, *XY = list(map(int, open(0).read().split()))\nX, Y = XY[::2], XY[1::2]\nA = [x + y for x, y in zip(X, Y)]\nB = [x - y for x, y in zip(X, Y)]\nprint((max(max(A) - min(A), max(B) - min(B))))\n", "fast_code_sha256": "fd949ab1cd967cee7273469c8fc8bd1605344b0dba5564378a7d7c8b2d514d3c", "fast_id": "p02556_fd949ab1cd967cee7273469c8fc8bd1605344b0dba5564378a7d7c8b2d514d3c", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n, *XY = list(map(int, open(0).read().split()))\nX, Y = XY[::2], XY[1::2]\nA = [x + y for x, y in zip(X, Y)]\nB = [x - y for x, y in zip(X, Y)]\nprint((max(max(A) - min(A), max(B) - min(B))))\n", "measured_fast_code_sha256": "fd949ab1cd967cee7273469c8fc8bd1605344b0dba5564378a7d7c8b2d514d3c", "measured_slow_code": "N = int(eval(input()))\n\n\ndef dist(A, B):\n return abs(A[0] - B[0]) + abs(A[1] - B[1])\n\n\nXY = [tuple(map(int, input().split())) for _ in range(N)]\nINF = -(10**10)\nans = 0\nfor O in [(INF, INF), (-INF, INF), (INF, -INF), (-INF, -INF)]:\n S = XY[0]\n for xy in XY:\n if dist(O, S) < dist(O, xy):\n S = xy\n O = S\n for xy in XY:\n if dist(O, S) < dist(O, xy):\n S = xy\n ans = max(ans, dist(O, S))\nprint(ans)\n", "measured_slow_code_sha256": "05dfc996f7e3842463d6cd57d02877a281066db95acd7311507e26b5daabff76", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 11.444143643139375, "pair_id": "python_v2_e875afbb94fc18a7c2aceb11", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02556", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02556_fd949ab1cd967cee7273469c8fc8bd1605344b0dba5564378a7d7c8b2d514d3c.jsonl.gz", "inputs": "reproduction/python/inputs/p02556.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02556_05dfc996f7e3842463d6cd57d02877a281066db95acd7311507e26b5daabff76.jsonl.gz"}, "slow_code": "N = int(eval(input()))\n\n\ndef dist(A, B):\n return abs(A[0] - B[0]) + abs(A[1] - B[1])\n\n\nXY = [tuple(map(int, input().split())) for _ in range(N)]\nINF = -(10**10)\nans = 0\nfor O in [(INF, INF), (-INF, INF), (INF, -INF), (-INF, -INF)]:\n S = XY[0]\n for xy in XY:\n if dist(O, S) < dist(O, xy):\n S = xy\n O = S\n for xy in XY:\n if dist(O, S) < dist(O, xy):\n S = xy\n ans = max(ans, dist(O, S))\nprint(ans)\n", "slow_code_sha256": "05dfc996f7e3842463d6cd57d02877a281066db95acd7311507e26b5daabff76", "slow_id": "p02556_05dfc996f7e3842463d6cd57d02877a281066db95acd7311507e26b5daabff76", "speedup": 5.483316517100695, "stratum": "4-8", "within_pair_jaccard": 0.3, "workload": {"case_count": 100, "description": "Find the maximum Manhattan distance |x_i-x_j|+|y_i-y_j| between two distinct indexed points among N. Repeated coordinates are allowed. Observed inputs: N=2..200000 (median 1000); x_i=1..1000000000; y_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 4000007, "median": 19715.0, "min": 28}, "input_format": ["N\nx_1 y_1\n...\nx_N y_N"], "input_format_status": "source_input_section", "input_lines": {"max": 200001, "median": 1001.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 400001, "median": 2001.0, "min": 5}}} -{"case_ids": ["p03212_case_000", "p03212_case_001", "p03212_case_002", "p03212_case_003", "p03212_case_004", "p03212_case_005", "p03212_case_006", "p03212_case_007", "p03212_case_008", "p03212_case_009", "p03212_case_010", "p03212_case_011", "p03212_case_012", "p03212_case_013", "p03212_case_014", "p03212_case_015", "p03212_case_016", "p03212_case_017", "p03212_case_018", "p03212_case_019", "p03212_case_020", "p03212_case_021", "p03212_case_022", "p03212_case_023", "p03212_case_024", "p03212_case_025", "p03212_case_026", "p03212_case_027", "p03212_case_028", "p03212_case_029", "p03212_case_030", "p03212_case_031", "p03212_case_032", "p03212_case_033", "p03212_case_034", "p03212_case_035", "p03212_case_036", "p03212_case_037", "p03212_case_038", "p03212_case_039", "p03212_case_040", "p03212_case_041", "p03212_case_042", "p03212_case_043", "p03212_case_044", "p03212_case_045", "p03212_case_046", "p03212_case_047", "p03212_case_048", "p03212_case_049", "p03212_case_050", "p03212_case_051", "p03212_case_052", "p03212_case_053", "p03212_case_054", "p03212_case_055", "p03212_case_056", "p03212_case_057", "p03212_case_058", "p03212_case_059", "p03212_case_060", "p03212_case_061", "p03212_case_062", "p03212_case_063", "p03212_case_064", "p03212_case_065", "p03212_case_066", "p03212_case_067", "p03212_case_068", "p03212_case_069", "p03212_case_070", "p03212_case_071", "p03212_case_072", "p03212_case_073", "p03212_case_074", "p03212_case_075", "p03212_case_076", "p03212_case_077", "p03212_case_078", "p03212_case_079", "p03212_case_080", "p03212_case_081", "p03212_case_082", "p03212_case_083", "p03212_case_084", "p03212_case_085", "p03212_case_086", "p03212_case_087", "p03212_case_088", "p03212_case_089", "p03212_case_090", "p03212_case_091", "p03212_case_092", "p03212_case_093", "p03212_case_094", "p03212_case_095", "p03212_case_096", "p03212_case_097", "p03212_case_098", "p03212_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def nexti(i):\n if i == 0:\n return 3\n elif i % 10 == 3:\n return i + 2\n elif i % 10 == 5:\n return i + 2\n elif i % 10 == 7:\n return nexti(i // 10) * 10 + 3\n\n\nn = int(eval(input()))\nnn = 0\ni = 357\nwhile i <= n:\n s = str(i)\n if \"3\" in s:\n if \"5\" in s:\n if \"7\" in s:\n\n nn += 1\n if i % 10 == 7:\n i = nexti(i)\n else:\n i += 2\nprint(nn)\n", "fast_code_sha256": "79fe0f196824bcee44081aebf70a0001d0504c38398f20702ec69028d1c401c9", "fast_id": "p03212_be64dc1a6b817ca0225bd6408a1c1bf8da94ae100cb8bfbf8b132c94236bc9b1", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def nexti(i):\n if i == 0:\n return 3\n elif i % 10 == 3:\n return i + 2\n elif i % 10 == 5:\n return i + 2\n elif i % 10 == 7:\n return nexti(i // 10) * 10 + 3\n\n\nn = int(eval(input()))\nnn = 0\ni = 357\nwhile i <= n:\n s = str(i)\n if \"3\" in s:\n if \"5\" in s:\n if \"7\" in s:\n # print(i)\n nn += 1\n if i % 10 == 7:\n i = nexti(i)\n else:\n i += 2\nprint(nn)\n", "measured_fast_code_sha256": "be64dc1a6b817ca0225bd6408a1c1bf8da94ae100cb8bfbf8b132c94236bc9b1", "measured_slow_code": "def DFS(n):\n if len(n) >= 3 and len(set(list(n)) & {\"3\", \"5\", \"7\"}) == 3:\n A.append(int(n))\n if len(n) < 10:\n for i in (\"3\", \"5\", \"7\"):\n DFS(n + i)\n\n\nn = int(eval(input()))\nA = []\nfor i in (\"3\", \"5\", \"7\"):\n DFS(i)\nA.sort()\ncnt = 0\nwhile 1:\n if A[cnt] <= n:\n cnt += 1\n else:\n break\nprint(cnt)\n", "measured_slow_code_sha256": "0673030745e51e0e71ea989ca56078e7009b913375c5bf3cc0e026cce49704f1", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 12.42867694285384, "pair_id": "python_v2_3f3ce41fa2e6cded278404cd", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03212", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03212_be64dc1a6b817ca0225bd6408a1c1bf8da94ae100cb8bfbf8b132c94236bc9b1.jsonl.gz", "inputs": "reproduction/python/inputs/p03212.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03212_0673030745e51e0e71ea989ca56078e7009b913375c5bf3cc0e026cce49704f1.jsonl.gz"}, "slow_code": "def DFS(n):\n if len(n) >= 3 and len(set(list(n)) & {\"3\", \"5\", \"7\"}) == 3:\n A.append(int(n))\n if len(n) < 10:\n for i in (\"3\", \"5\", \"7\"):\n DFS(n + i)\n\n\nn = int(eval(input()))\nA = []\nfor i in (\"3\", \"5\", \"7\"):\n DFS(i)\nA.sort()\ncnt = 0\nwhile 1:\n if A[cnt] <= n:\n cnt += 1\n else:\n break\nprint(cnt)\n", "slow_code_sha256": "0673030745e51e0e71ea989ca56078e7009b913375c5bf3cc0e026cce49704f1", "slow_id": "p03212_0673030745e51e0e71ea989ca56078e7009b913375c5bf3cc0e026cce49704f1", "speedup": 79.20603163852807, "stratum": "8+", "within_pair_jaccard": 0.4722222222222222, "workload": {"case_count": 100, "description": "Count positive integers at most N whose decimal digits use only 3,5,7 and contain each of those three digits at least once. Observed inputs: N=1..999999999 (median 133260161.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 10, "median": 10.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p03576_case_000", "p03576_case_001", "p03576_case_002", "p03576_case_003", "p03576_case_004", "p03576_case_005", "p03576_case_006", "p03576_case_007", "p03576_case_008", "p03576_case_009", "p03576_case_010", "p03576_case_011", "p03576_case_012", "p03576_case_013", "p03576_case_014", "p03576_case_015", "p03576_case_016", "p03576_case_017", "p03576_case_018", "p03576_case_019", "p03576_case_020", "p03576_case_021", "p03576_case_022", "p03576_case_023", "p03576_case_024", "p03576_case_025", "p03576_case_026", "p03576_case_027", "p03576_case_028", "p03576_case_029", "p03576_case_030", "p03576_case_031", "p03576_case_032", "p03576_case_033", "p03576_case_034", "p03576_case_035", "p03576_case_036", "p03576_case_037", "p03576_case_038", "p03576_case_039", "p03576_case_040", "p03576_case_041", "p03576_case_042", "p03576_case_043", "p03576_case_044", "p03576_case_045", "p03576_case_046", "p03576_case_047", "p03576_case_048", "p03576_case_049", "p03576_case_050", "p03576_case_051", "p03576_case_052", "p03576_case_053", "p03576_case_054", "p03576_case_055", "p03576_case_056", "p03576_case_057", "p03576_case_058", "p03576_case_059", "p03576_case_060", "p03576_case_061", "p03576_case_062", "p03576_case_063", "p03576_case_064", "p03576_case_065", "p03576_case_066", "p03576_case_067", "p03576_case_068", "p03576_case_069", "p03576_case_070", "p03576_case_071", "p03576_case_072", "p03576_case_073", "p03576_case_074", "p03576_case_075", "p03576_case_076", "p03576_case_077", "p03576_case_078", "p03576_case_079", "p03576_case_080", "p03576_case_081", "p03576_case_082", "p03576_case_083", "p03576_case_084", "p03576_case_085", "p03576_case_086", "p03576_case_087", "p03576_case_088", "p03576_case_089", "p03576_case_090", "p03576_case_091", "p03576_case_092", "p03576_case_093", "p03576_case_094", "p03576_case_095", "p03576_case_096", "p03576_case_097", "p03576_case_098", "p03576_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N, K = list(map(int, input().split()))\npts = []\nys = []\nfor _ in range(N):\n x, y = list(map(int, input().split()))\n pts.append((x, y))\n ys.append(y)\npts.sort()\nys.sort()\nans = 10**20\nfor i, y1 in enumerate(ys):\n for y2 in ys[i + 1 :]:\n for j, (x1, _) in enumerate(pts):\n num = 0\n for x, y in pts[j:]:\n if y1 <= y <= y2:\n num += 1\n if num >= K:\n area = (x - x1) * (y2 - y1)\n ans = min(ans, area)\n break\nprint(ans)\n", "fast_code_sha256": "01b94821fe448881b6015dfe0bec24928fa98d0c3fa2a71c256b49869d0beae8", "fast_id": "p03576_01b94821fe448881b6015dfe0bec24928fa98d0c3fa2a71c256b49869d0beae8", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N, K = list(map(int, input().split()))\npts = []\nys = []\nfor _ in range(N):\n x, y = list(map(int, input().split()))\n pts.append((x, y))\n ys.append(y)\npts.sort()\nys.sort()\nans = 10**20\nfor i, y1 in enumerate(ys):\n for y2 in ys[i + 1 :]:\n for j, (x1, _) in enumerate(pts):\n num = 0\n for x, y in pts[j:]:\n if y1 <= y <= y2:\n num += 1\n if num >= K:\n area = (x - x1) * (y2 - y1)\n ans = min(ans, area)\n break\nprint(ans)\n", "measured_fast_code_sha256": "01b94821fe448881b6015dfe0bec24928fa98d0c3fa2a71c256b49869d0beae8", "measured_slow_code": "# -*- coding: utf-8 -*-\nimport bisect\nimport heapq\nimport math\nimport random\nimport sys\nfrom collections import Counter, defaultdict, deque\nfrom decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal\nfrom functools import lru_cache, reduce\nfrom itertools import combinations, combinations_with_replacement, product, permutations\nfrom operator import add, mul\n\nsys.setrecursionlimit(10000)\n\n\ndef read_int():\n return int(input())\n\n\ndef read_int_n():\n return list(map(int, input().split()))\n\n\ndef read_float():\n return float(input())\n\n\ndef read_float_n():\n return list(map(float, input().split()))\n\n\ndef read_str():\n return input()\n\n\ndef read_str_n():\n return list(map(str, input().split()))\n\n\ndef error_print(*args):\n print(*args, file=sys.stderr)\n\n\ndef mt(f):\n import time\n\n def wrap(*args, **kwargs):\n s = time.time()\n ret = f(*args, **kwargs)\n e = time.time()\n error_print(e - s, \"sec\")\n return ret\n\n return wrap\n\n\n@mt\ndef slv(N, K, XY):\n X = sorted(map(lambda x: x[0], XY))\n RX = X[::-1]\n Y = sorted(map(lambda x: x[1], XY))\n RY = Y[::-1]\n ans = sys.maxsize\n for lx in X:\n for rx in RX:\n if lx > rx:\n break\n for by in Y:\n for ty in RY:\n if by > ty:\n break\n k = 0\n for x, y in XY:\n if lx <= x <= rx and by <= y <= ty:\n k += 1\n if k >= K:\n ans = min(ans, (rx - lx) * (ty - by))\n else:\n break\n return ans\n\n\ndef main():\n N, K = read_int_n()\n XY = [read_int_n() for _ in range(N)]\n print(slv(N, K, XY))\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "c37097573bea4b5c04237e886abdd4d37c3a8d3f4d01d08098cdf33003c8759c", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 5.074401702220888, "pair_id": "python_v2_a91f1f1d11d978be839e9536", "per_case_slow_code_faster_fraction": 0.12, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03576", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03576_01b94821fe448881b6015dfe0bec24928fa98d0c3fa2a71c256b49869d0beae8.jsonl.gz", "inputs": "reproduction/python/inputs/p03576.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03576_c37097573bea4b5c04237e886abdd4d37c3a8d3f4d01d08098cdf33003c8759c.jsonl.gz"}, "slow_code": "import bisect\nimport heapq\nimport math\nimport random\nimport sys\nfrom collections import Counter, defaultdict, deque\nfrom decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal\nfrom functools import lru_cache, reduce\nfrom itertools import combinations, combinations_with_replacement, product, permutations\nfrom operator import add, mul\n\nsys.setrecursionlimit(10000)\n\n\ndef read_int():\n return int(input())\n\n\ndef read_int_n():\n return list(map(int, input().split()))\n\n\ndef read_float():\n return float(input())\n\n\ndef read_float_n():\n return list(map(float, input().split()))\n\n\ndef read_str():\n return input()\n\n\ndef read_str_n():\n return list(map(str, input().split()))\n\n\ndef error_print(*args):\n print(*args, file=sys.stderr)\n\n\ndef mt(f):\n import time\n\n def wrap(*args, **kwargs):\n s = time.time()\n ret = f(*args, **kwargs)\n e = time.time()\n error_print(e - s, \"sec\")\n return ret\n\n return wrap\n\n\n@mt\ndef slv(N, K, XY):\n X = sorted(map(lambda x: x[0], XY))\n RX = X[::-1]\n Y = sorted(map(lambda x: x[1], XY))\n RY = Y[::-1]\n ans = sys.maxsize\n for lx in X:\n for rx in RX:\n if lx > rx:\n break\n for by in Y:\n for ty in RY:\n if by > ty:\n break\n k = 0\n for x, y in XY:\n if lx <= x <= rx and by <= y <= ty:\n k += 1\n if k >= K:\n ans = min(ans, (rx - lx) * (ty - by))\n else:\n break\n return ans\n\n\ndef main():\n N, K = read_int_n()\n XY = [read_int_n() for _ in range(N)]\n print(slv(N, K, XY))\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "d66d7b778a3e5a0e4007f965d5b8414a5d4b9692dfea5c8fc25daf95cdc66857", "slow_id": "p03576_c37097573bea4b5c04237e886abdd4d37c3a8d3f4d01d08098cdf33003c8759c", "speedup": 5.05805141030433, "stratum": "4-8", "within_pair_jaccard": 0.19230769230769232, "workload": {"case_count": 100, "description": "Find the minimum area of an axis-aligned rectangle containing at least K of N plane points, counting boundary points. All x coordinates are distinct, and all y coordinates are distinct. Observed inputs: N=2..50 (median 25); K=2..50 (median 2.5); x_i=-1000000000..997427460; y_i=-1000000000..997398050.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1106, "median": 524.0, "min": 40}, "input_format": ["N K\nx_1 y_1\n...\nx_N y_N"], "input_format_status": "source_input_section", "input_lines": {"max": 51, "median": 26.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 102, "median": 52.0, "min": 6}}} -{"case_ids": ["p02709_case_000", "p02709_case_001", "p02709_case_002", "p02709_case_003", "p02709_case_004", "p02709_case_005", "p02709_case_006", "p02709_case_007", "p02709_case_008", "p02709_case_009", "p02709_case_010", "p02709_case_011", "p02709_case_012", "p02709_case_013", "p02709_case_014", "p02709_case_015", "p02709_case_016", "p02709_case_017", "p02709_case_018", "p02709_case_019", "p02709_case_020", "p02709_case_021", "p02709_case_022", "p02709_case_023", "p02709_case_024", "p02709_case_025", "p02709_case_026", "p02709_case_027", "p02709_case_028", "p02709_case_029", "p02709_case_030", "p02709_case_031", "p02709_case_032", "p02709_case_033", "p02709_case_034", "p02709_case_035", "p02709_case_036", "p02709_case_037", "p02709_case_038", "p02709_case_039", "p02709_case_040", "p02709_case_041", "p02709_case_042", "p02709_case_043", "p02709_case_044", "p02709_case_045", "p02709_case_046", "p02709_case_047", "p02709_case_048", "p02709_case_049", "p02709_case_050", "p02709_case_051", "p02709_case_052", "p02709_case_053", "p02709_case_054", "p02709_case_055", "p02709_case_056", "p02709_case_057", "p02709_case_058", "p02709_case_059", "p02709_case_060", "p02709_case_061", "p02709_case_062", "p02709_case_063", "p02709_case_064", "p02709_case_065", "p02709_case_066", "p02709_case_067", "p02709_case_068", "p02709_case_069", "p02709_case_070", "p02709_case_071", "p02709_case_072", "p02709_case_073", "p02709_case_074", "p02709_case_075", "p02709_case_076", "p02709_case_077", "p02709_case_078", "p02709_case_079", "p02709_case_080", "p02709_case_081", "p02709_case_082", "p02709_case_083", "p02709_case_084", "p02709_case_085", "p02709_case_086", "p02709_case_087", "p02709_case_088", "p02709_case_089", "p02709_case_090", "p02709_case_091", "p02709_case_092", "p02709_case_093", "p02709_case_094", "p02709_case_095", "p02709_case_096", "p02709_case_097", "p02709_case_098", "p02709_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\na_ = list(map(int, input().split()))\na = [[i + 1, ai] for i, ai in enumerate(a_)]\na.sort(key=lambda x: x[1], reverse=True)\ndp = [[0] * (n + 1) for _ in range(n + 1)]\n\ndp[1][0] = a[0][1] * abs(a[0][0] - 1)\ndp[0][1] = a[0][1] * abs(a[0][0] - n)\nfor k in range(2, n + 1):\n for i in range(k + 1):\n j = k - i\n if j == 0:\n dp[i][j] = dp[i - 1][j] + a[i + j - 1][1] * abs(a[i + j - 1][0] - i)\n elif i == 0:\n dp[i][j] = dp[i][j - 1] + a[i + j - 1][1] * abs(n - a[i + j - 1][0] - j + 1)\n else:\n dp[i][j] = max(\n dp[i - 1][j] + a[i + j - 1][1] * abs(a[i + j - 1][0] - i),\n dp[i][j - 1] + a[i + j - 1][1] * abs(n - a[i + j - 1][0] - j + 1),\n )\nans = 0\nfor i in range(n + 1):\n ans = max(dp[i][n - i], ans)\nprint(ans)\n", "fast_code_sha256": "5e5d45c0337c73356db47f95f31dfd7bbd6720881381254dc15fe8aaba30aafa", "fast_id": "p02709_b6eb215539872bfb716d1e2bae3f194760f2526b7e15cf2967d55c38d6819dd3", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\na_ = list(map(int, input().split()))\na = [[i + 1, ai] for i, ai in enumerate(a_)]\na.sort(key=lambda x: x[1], reverse=True)\ndp = [[0] * (n + 1) for _ in range(n + 1)]\n# dp[i][j]:大きい順にi+j人のうち、i人を左に、j人を右に移した時の最大値。\ndp[1][0] = a[0][1] * abs(a[0][0] - 1)\ndp[0][1] = a[0][1] * abs(a[0][0] - n)\nfor k in range(2, n + 1):\n for i in range(k + 1):\n j = k - i\n if j == 0:\n dp[i][j] = dp[i - 1][j] + a[i + j - 1][1] * abs(a[i + j - 1][0] - i)\n elif i == 0:\n dp[i][j] = dp[i][j - 1] + a[i + j - 1][1] * abs(n - a[i + j - 1][0] - j + 1)\n else:\n dp[i][j] = max(\n dp[i - 1][j] + a[i + j - 1][1] * abs(a[i + j - 1][0] - i),\n dp[i][j - 1] + a[i + j - 1][1] * abs(n - a[i + j - 1][0] - j + 1),\n )\nans = 0\nfor i in range(n + 1):\n ans = max(dp[i][n - i], ans)\nprint(ans)\n", "measured_fast_code_sha256": "b6eb215539872bfb716d1e2bae3f194760f2526b7e15cf2967d55c38d6819dd3", "measured_slow_code": "import sys\nimport numpy as np\n\n\ndef f(n, a_):\n a = []\n for i, ai in enumerate(a_):\n a.append([1 + i, ai])\n a.sort(key=lambda x: x[1], reverse=True)\n dp = np.zeros(\n (n + 1, n + 1), np.int64\n ) # dp[i,j]:i人目までを配置し終えていて、そのうちj人を右に置いた時の最大値。j<=i\n dp[1, 1] = a[0][1] * (n - a[0][0])\n dp[1, 0] = a[0][1] * (a[0][0] - 1)\n for i in range(2, n + 1): # i人目の幼児。a[i-1]\n dp[i, 0] = dp[i - 1, 0] + a[i - 1][1] * abs(\n (a[i - 1][0] - 1 - (i - 1))\n ) # i人目を左にする。その時左に溜まっているのはi-1人\n dp[i, i] = dp[i - 1, i - 1] + a[i - 1][1] * abs(\n (n - a[i - 1][0] - (i - 1))\n ) # i人目を右にする。その時右に溜まっているのはi-1人\n # i人目を左に\n l = dp[i - 1, 1:i] + [\n a[i - 1][1] * abs((a[i - 1][0] - 1 - j)) for j in range(i - 2, -1, -1)\n ] # j:左に溜まっている人数\n # i人目を右に\n r = dp[i - 1, : i - 1] + [\n a[i - 1][1] * abs((n - a[i - 1][0] - j)) for j in range(i - 1)\n ] # j:右に溜まっている人数\n dp[i, 1:i] = np.maximum(l, r)\n return max(dp[n])\n\n\nif __name__ == \"__main__\":\n input = sys.stdin.readline\n n = int(eval(input()))\n a_ = list(map(int, input().split()))\n print((f(n, a_)))\n", "measured_slow_code_sha256": "3d838e07742b6038959605af2d3df1f36b7399126fc563b9a2c8f3bce236aaea", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 0.6160056282325332, "pair_id": "python_v2_6d24a0adfd3e798275bf8365", "per_case_slow_code_faster_fraction": 0.55, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02709", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02709_b6eb215539872bfb716d1e2bae3f194760f2526b7e15cf2967d55c38d6819dd3.jsonl.gz", "inputs": "reproduction/python/inputs/p02709.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02709_3d838e07742b6038959605af2d3df1f36b7399126fc563b9a2c8f3bce236aaea.jsonl.gz"}, "slow_code": "import sys\nimport numpy as np\n\n\ndef f(n, a_):\n a = []\n for i, ai in enumerate(a_):\n a.append([1 + i, ai])\n a.sort(key=lambda x: x[1], reverse=True)\n dp = np.zeros((n + 1, n + 1), np.int64)\n dp[1, 1] = a[0][1] * (n - a[0][0])\n dp[1, 0] = a[0][1] * (a[0][0] - 1)\n for i in range(2, n + 1):\n dp[i, 0] = dp[i - 1, 0] + a[i - 1][1] * abs((a[i - 1][0] - 1 - (i - 1)))\n dp[i, i] = dp[i - 1, i - 1] + a[i - 1][1] * abs((n - a[i - 1][0] - (i - 1)))\n\n l = dp[i - 1, 1:i] + [\n a[i - 1][1] * abs((a[i - 1][0] - 1 - j)) for j in range(i - 2, -1, -1)\n ]\n\n r = dp[i - 1, : i - 1] + [\n a[i - 1][1] * abs((n - a[i - 1][0] - j)) for j in range(i - 1)\n ]\n dp[i, 1:i] = np.maximum(l, r)\n return max(dp[n])\n\n\nif __name__ == \"__main__\":\n input = sys.stdin.readline\n n = int(eval(input()))\n a_ = list(map(int, input().split()))\n print((f(n, a_)))\n", "slow_code_sha256": "aa98af4784f39634c1b1369b22ff40f05d4ea9461af1aad5cd1db169f1d8c6f4", "slow_id": "p02709_3d838e07742b6038959605af2d3df1f36b7399126fc563b9a2c8f3bce236aaea", "speedup": 5.877460144985842, "stratum": "4-8", "within_pair_jaccard": 0.5660377358490566, "workload": {"case_count": 100, "description": "Rearrange N children arbitrarily. Moving the child originally at position x to position y earns A_x*|x-y| happiness. Maximize total happiness. Observed inputs: N=2..2000 (median 1000); A_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 22005, "median": 9885.5, "min": 6}, "input_format": ["N\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2001, "median": 1001.0, "min": 3}}} -{"case_ids": ["p02792_case_000", "p02792_case_001", "p02792_case_002", "p02792_case_003", "p02792_case_004", "p02792_case_005", "p02792_case_006", "p02792_case_007", "p02792_case_008", "p02792_case_009", "p02792_case_010", "p02792_case_011", "p02792_case_012", "p02792_case_013", "p02792_case_014", "p02792_case_015", "p02792_case_016", "p02792_case_017", "p02792_case_018", "p02792_case_019", "p02792_case_020", "p02792_case_021", "p02792_case_022", "p02792_case_023", "p02792_case_024", "p02792_case_025", "p02792_case_026", "p02792_case_027", "p02792_case_028", "p02792_case_029", "p02792_case_030", "p02792_case_031", "p02792_case_032", "p02792_case_033", "p02792_case_034", "p02792_case_035", "p02792_case_036", "p02792_case_037", "p02792_case_038", "p02792_case_039", "p02792_case_040", "p02792_case_041", "p02792_case_042", "p02792_case_043", "p02792_case_044", "p02792_case_045", "p02792_case_046", "p02792_case_047", "p02792_case_048", "p02792_case_049", "p02792_case_050", "p02792_case_051", "p02792_case_052", "p02792_case_053", "p02792_case_054", "p02792_case_055", "p02792_case_056", "p02792_case_057", "p02792_case_058", "p02792_case_059", "p02792_case_060", "p02792_case_061", "p02792_case_062", "p02792_case_063", "p02792_case_064", "p02792_case_065", "p02792_case_066", "p02792_case_067", "p02792_case_068", "p02792_case_069", "p02792_case_070", "p02792_case_071", "p02792_case_072", "p02792_case_073", "p02792_case_074", "p02792_case_075", "p02792_case_076", "p02792_case_077", "p02792_case_078", "p02792_case_079", "p02792_case_080", "p02792_case_081", "p02792_case_082", "p02792_case_083", "p02792_case_084", "p02792_case_085", "p02792_case_086", "p02792_case_087", "p02792_case_088", "p02792_case_089", "p02792_case_090", "p02792_case_091", "p02792_case_092", "p02792_case_093", "p02792_case_094", "p02792_case_095", "p02792_case_096", "p02792_case_097", "p02792_case_098", "p02792_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from itertools import product\n\n\ndef solve(string):\n d = len(string)\n if d == 1:\n return string\n s0, ss, sn = int(string[0]), int(string[1:-1] or 0), int(string[-1])\n t = [[0] * 10] + [[int(\"1\" * (d - 2) or 0)] * 10 for _ in range(9)]\n for i in range(1, 10):\n t[i][i] += 1\n for i, j in product(list(range(1, s0)), list(range(10))):\n t[i][j] += 10 ** (d - 2)\n for j in range(sn + 1):\n t[s0][j] += ss + 1\n for j in range(sn + 1, 10):\n t[s0][j] += ss\n return str(sum(t[i][j] * t[j][i] for i, j in product(list(range(1, 10)), repeat=2)))\n\n\nif __name__ == \"__main__\":\n import sys\n\n print((solve(sys.stdin.read().strip())))\n", "fast_code_sha256": "3cdff8e4175870a02e4061206fd8f6e8c2d7f81e837019cd00e38a6f5ab341db", "fast_id": "p02792_3cdff8e4175870a02e4061206fd8f6e8c2d7f81e837019cd00e38a6f5ab341db", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from itertools import product\n\n\ndef solve(string):\n d = len(string)\n if d == 1:\n return string\n s0, ss, sn = int(string[0]), int(string[1:-1] or 0), int(string[-1])\n t = [[0] * 10] + [[int(\"1\" * (d - 2) or 0)] * 10 for _ in range(9)]\n for i in range(1, 10):\n t[i][i] += 1\n for i, j in product(list(range(1, s0)), list(range(10))):\n t[i][j] += 10 ** (d - 2)\n for j in range(sn + 1):\n t[s0][j] += ss + 1\n for j in range(sn + 1, 10):\n t[s0][j] += ss\n return str(sum(t[i][j] * t[j][i] for i, j in product(list(range(1, 10)), repeat=2)))\n\n\nif __name__ == \"__main__\":\n import sys\n\n print((solve(sys.stdin.read().strip())))\n", "measured_fast_code_sha256": "3cdff8e4175870a02e4061206fd8f6e8c2d7f81e837019cd00e38a6f5ab341db", "measured_slow_code": "def main():\n N = int(eval(input()))\n dp = [[0] * 10 for _ in range(10)]\n for i in range(1, N + 1):\n tmp = str(i)\n left = int(tmp[0])\n right = int(tmp[-1])\n if left == 0 or right == 0:\n continue\n dp[left][right] += 1\n ans = 0\n for i in range(10):\n for j in range(10):\n ans += dp[i][j] * dp[j][i]\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "d3912821eabbc16806c982e0e9fc690609236b2378548143543fff61b3542a25", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.0133271473920533, "pair_id": "python_v2_95c538e1469f35203725e942", "per_case_slow_code_faster_fraction": 0.47, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02792", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02792_3cdff8e4175870a02e4061206fd8f6e8c2d7f81e837019cd00e38a6f5ab341db.jsonl.gz", "inputs": "reproduction/python/inputs/p02792.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02792_d3912821eabbc16806c982e0e9fc690609236b2378548143543fff61b3542a25.jsonl.gz"}, "slow_code": "def main():\n N = int(eval(input()))\n dp = [[0] * 10 for _ in range(10)]\n for i in range(1, N + 1):\n tmp = str(i)\n left = int(tmp[0])\n right = int(tmp[-1])\n if left == 0 or right == 0:\n continue\n dp[left][right] += 1\n ans = 0\n for i in range(10):\n for j in range(10):\n ans += dp[i][j] * dp[j][i]\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "d3912821eabbc16806c982e0e9fc690609236b2378548143543fff61b3542a25", "slow_id": "p02792_d3912821eabbc16806c982e0e9fc690609236b2378548143543fff61b3542a25", "speedup": 5.583113390264436, "stratum": "4-8", "within_pair_jaccard": 0.3469387755102041, "workload": {"case_count": 100, "description": "Count ordered pairs of positive integers (A,B), each at most N, whose decimal first and last digits are reversed between A and B. Leading zeros are not used. Observed inputs: N=1..200000 (median 106.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 7, "median": 4.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p02669_case_000", "p02669_case_001", "p02669_case_002", "p02669_case_003", "p02669_case_004", "p02669_case_005", "p02669_case_006", "p02669_case_007", "p02669_case_008", "p02669_case_009", "p02669_case_010", "p02669_case_011", "p02669_case_012", "p02669_case_013", "p02669_case_014", "p02669_case_015", "p02669_case_016", "p02669_case_017", "p02669_case_018", "p02669_case_019", "p02669_case_020", "p02669_case_021", "p02669_case_022", "p02669_case_023", "p02669_case_024", "p02669_case_025", "p02669_case_026", "p02669_case_027", "p02669_case_028", "p02669_case_029", "p02669_case_030", "p02669_case_031", "p02669_case_032", "p02669_case_033", "p02669_case_034", "p02669_case_035", "p02669_case_036", "p02669_case_037", "p02669_case_038", "p02669_case_039", "p02669_case_040", "p02669_case_041", "p02669_case_042", "p02669_case_043", "p02669_case_044", "p02669_case_045", "p02669_case_046", "p02669_case_047", "p02669_case_048", "p02669_case_049", "p02669_case_050", "p02669_case_051", "p02669_case_052", "p02669_case_054", "p02669_case_055", "p02669_case_056", "p02669_case_057", "p02669_case_058", "p02669_case_059", "p02669_case_060", "p02669_case_061", "p02669_case_062", "p02669_case_063", "p02669_case_064", "p02669_case_065", "p02669_case_066", "p02669_case_067", "p02669_case_068", "p02669_case_069", "p02669_case_070", "p02669_case_071", "p02669_case_072", "p02669_case_073", "p02669_case_074", "p02669_case_075", "p02669_case_076", "p02669_case_077", "p02669_case_078", "p02669_case_080", "p02669_case_081", "p02669_case_082", "p02669_case_083", "p02669_case_084", "p02669_case_085", "p02669_case_086", "p02669_case_087", "p02669_case_088", "p02669_case_089", "p02669_case_090", "p02669_case_091", "p02669_case_092", "p02669_case_093", "p02669_case_094", "p02669_case_095", "p02669_case_096", "p02669_case_097", "p02669_case_098", "p02669_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 98, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "T = int(eval(input()))\nwhile T > 0:\n N, A, B, C, D = list(map(int, input().split()))\n memo = {}\n\n def d(n):\n if n == 0:\n return 0\n if n == 1:\n return D\n if n in memo:\n return memo[n]\n ret = n * D\n if n % 2 == 0:\n ret = min(ret, A + d(n // 2))\n else:\n ret = min(\n ret,\n (n % 2) * D + A + d(n // 2),\n (2 - n % 2) * D + A + d((n + (2 - n % 2)) // 2),\n )\n if n % 3 == 0:\n ret = min(ret, B + d(n // 3))\n else:\n ret = min(\n ret,\n (n % 3) * D + B + d(n // 3),\n (3 - n % 3) * D + B + d((n + (3 - n % 3)) // 3),\n )\n if n % 5 == 0:\n ret = min(ret, C + d(n // 5))\n else:\n ret = min(\n ret,\n (n % 5) * D + C + d(n // 5),\n (5 - n % 5) * D + C + d((n + (5 - n % 5)) // 5),\n )\n memo[n] = ret\n return ret\n\n print((d(N)))\n T -= 1\n", "fast_code_sha256": "f72d95a065019e8608548b68b377164f983af5502448f6513f95b92a5d37b38b", "fast_id": "p02669_f72d95a065019e8608548b68b377164f983af5502448f6513f95b92a5d37b38b", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "T = int(eval(input()))\nwhile T > 0:\n N, A, B, C, D = list(map(int, input().split()))\n memo = {}\n\n def d(n):\n if n == 0:\n return 0\n if n == 1:\n return D\n if n in memo:\n return memo[n]\n ret = n * D\n if n % 2 == 0:\n ret = min(ret, A + d(n // 2))\n else:\n ret = min(\n ret,\n (n % 2) * D + A + d(n // 2),\n (2 - n % 2) * D + A + d((n + (2 - n % 2)) // 2),\n )\n if n % 3 == 0:\n ret = min(ret, B + d(n // 3))\n else:\n ret = min(\n ret,\n (n % 3) * D + B + d(n // 3),\n (3 - n % 3) * D + B + d((n + (3 - n % 3)) // 3),\n )\n if n % 5 == 0:\n ret = min(ret, C + d(n // 5))\n else:\n ret = min(\n ret,\n (n % 5) * D + C + d(n // 5),\n (5 - n % 5) * D + C + d((n + (5 - n % 5)) // 5),\n )\n memo[n] = ret\n return ret\n\n print((d(N)))\n T -= 1\n", "measured_fast_code_sha256": "f72d95a065019e8608548b68b377164f983af5502448f6513f95b92a5d37b38b", "measured_slow_code": "import sys\n\ndivs = [2, 3, 5]\nt = int(eval(input()))\nfor _ in range(t):\n n, a, b, c, d = list(map(int, input().split()))\n costs = [a, b, c]\n dp = {}\n\n def dfs(x):\n if x in dp:\n return dp[x]\n # print(x, file=sys.stderr)\n if x == 0:\n dp[x] = 0\n return dp[x]\n ret = x * d\n for i in range(-4, 5):\n if x - i < 0:\n continue\n nx = x - i\n for cost, div in zip(costs, divs):\n if nx % div != 0 or nx // div >= x:\n continue\n ret = min(ret, dfs(nx // div) + cost + abs(i) * d)\n dp[x] = ret\n return ret\n\n print((dfs(n)))\n", "measured_slow_code_sha256": "5dc16e69171829fb825a4382d7ae818d1f78cf50ef12255ba28fcf6c6591e0e1", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 12.160181515324354, "pair_id": "python_v2_ebe0490e0177801100d07d38", "per_case_slow_code_faster_fraction": 0.12244897959183673, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02669", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02669_f72d95a065019e8608548b68b377164f983af5502448f6513f95b92a5d37b38b.jsonl.gz", "inputs": "reproduction/python/inputs/p02669.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02669_5dc16e69171829fb825a4382d7ae818d1f78cf50ef12255ba28fcf6c6591e0e1.jsonl.gz"}, "slow_code": "import sys\n\ndivs = [2, 3, 5]\nt = int(eval(input()))\nfor _ in range(t):\n n, a, b, c, d = list(map(int, input().split()))\n costs = [a, b, c]\n dp = {}\n\n def dfs(x):\n if x in dp:\n return dp[x]\n\n if x == 0:\n dp[x] = 0\n return dp[x]\n ret = x * d\n for i in range(-4, 5):\n if x - i < 0:\n continue\n nx = x - i\n for cost, div in zip(costs, divs):\n if nx % div != 0 or nx // div >= x:\n continue\n ret = min(ret, dfs(nx // div) + cost + abs(i) * d)\n dp[x] = ret\n return ret\n\n print((dfs(n)))\n", "slow_code_sha256": "ca3505b4e5755f2e5a6dda25d2ba0ee1f8926fae7d5ee6e43c499cad98b2e89b", "slow_id": "p02669_5dc16e69171829fb825a4382d7ae818d1f78cf50ef12255ba28fcf6c6591e0e1", "speedup": 6.7563212566405015, "stratum": "4-8", "within_pair_jaccard": 0.37254901960784315, "workload": {"case_count": 98, "description": "For each of T cases, find the minimum cost to change 0 into N. Multiplication by 2, 3 or 5 costs A, B or C respectively; increasing or decreasing by 1 costs D. Operations may be repeated in any order. Observed inputs: T=1..10 (median 1); N=1..999999995042541824; A=1..1000000000; B=1..1000000000; C=1..1000000000; D=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 98, "input_bytes": {"max": 592, "median": 43.5, "min": 12}, "input_format": ["T\nN_1 A_1 B_1 C_1 D_1\n...\nN_T A_T B_T C_T D_T"], "input_format_status": "source_input_section", "input_lines": {"max": 11, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 51, "median": 6.0, "min": 6}}} -{"case_ids": ["p03806_case_000", "p03806_case_001", "p03806_case_002", "p03806_case_003", "p03806_case_004", "p03806_case_005", "p03806_case_006", "p03806_case_007", "p03806_case_008", "p03806_case_009", "p03806_case_010", "p03806_case_011", "p03806_case_012", "p03806_case_013", "p03806_case_014", "p03806_case_015", "p03806_case_016", "p03806_case_017", "p03806_case_018", "p03806_case_019", "p03806_case_020", "p03806_case_021", "p03806_case_022", "p03806_case_023", "p03806_case_024", "p03806_case_025", "p03806_case_026", "p03806_case_027", "p03806_case_028", "p03806_case_029", "p03806_case_030", "p03806_case_031", "p03806_case_032", "p03806_case_033", "p03806_case_034", "p03806_case_035", "p03806_case_036", "p03806_case_037", "p03806_case_038", "p03806_case_039", "p03806_case_040", "p03806_case_041", "p03806_case_042", "p03806_case_043", "p03806_case_044", "p03806_case_045", "p03806_case_046", "p03806_case_047", "p03806_case_048", "p03806_case_049", "p03806_case_050", "p03806_case_051", "p03806_case_052", "p03806_case_053", "p03806_case_054", "p03806_case_055", "p03806_case_056", "p03806_case_057", "p03806_case_058", "p03806_case_059", "p03806_case_060", "p03806_case_061", "p03806_case_062", "p03806_case_063", "p03806_case_064", "p03806_case_065", "p03806_case_066", "p03806_case_067", "p03806_case_068", "p03806_case_069", "p03806_case_070", "p03806_case_071", "p03806_case_072", "p03806_case_073", "p03806_case_074", "p03806_case_075", "p03806_case_076", "p03806_case_077", "p03806_case_078", "p03806_case_079", "p03806_case_080", "p03806_case_081", "p03806_case_082", "p03806_case_083", "p03806_case_084", "p03806_case_085", "p03806_case_086", "p03806_case_087", "p03806_case_088", "p03806_case_089", "p03806_case_090", "p03806_case_091", "p03806_case_092", "p03806_case_093", "p03806_case_094", "p03806_case_095", "p03806_case_096", "p03806_case_097", "p03806_case_098", "p03806_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\ninput = lambda: sys.stdin.readline().rstrip()\nsys.setrecursionlimit(max(1000, 10**9))\nwrite = lambda x: sys.stdout.write(x + \"\\n\")\nn, ma, mb = list(map(int, input().split()))\nabc = [None] * n\nfor i in range(n):\n a, b, c = tuple(map(int, input().split()))\n abc[i] = (a * mb - b * ma, c)\nabc.sort()\n\n\ndef halfcomb(l):\n n = len(l)\n n1 = n // 2\n n2 = (n + 1) // 2\n l1 = []\n l2 = []\n\n def sub(v1, v2, i, bound, ll, ind=0):\n if i == bound:\n ll.append((v1, v2))\n return\n sub(v1, v2, i + 1, bound, ll, ind)\n sub(v1 + l[ind + i][0], v2 + l[ind + i][1], i + 1, bound, ll, ind)\n\n sub(0, 0, 0, n1, l1)\n sub(0, 0, 0, n2, l2, ind=n1)\n return l1, l2\n\n\nl1, l2 = halfcomb(abc)\nd2 = {}\nfor v, c in l2:\n if v in d2:\n d2[v] = min(d2[v], c)\n else:\n d2[v] = c\nans = float(\"inf\")\nfor v, c in l1:\n if v == 0 and c > 0:\n ans = min(ans, c)\nfor v, c in l2:\n if v == 0 and c > 0:\n ans = min(ans, c)\nfor v, c in l1:\n if -v in d2 and c + d2[-v] > 0:\n ans = min(ans, c + d2[-v])\nif ans == float(\"inf\"):\n ans = -1\nprint(ans)\n", "fast_code_sha256": "bab9323cfeaa66336157fcfc351fa47a4d07aa183900fa44056dd2eea3a678e6", "fast_id": "p03806_bab9323cfeaa66336157fcfc351fa47a4d07aa183900fa44056dd2eea3a678e6", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\ninput = lambda: sys.stdin.readline().rstrip()\nsys.setrecursionlimit(max(1000, 10**9))\nwrite = lambda x: sys.stdout.write(x + \"\\n\")\nn, ma, mb = list(map(int, input().split()))\nabc = [None] * n\nfor i in range(n):\n a, b, c = tuple(map(int, input().split()))\n abc[i] = (a * mb - b * ma, c)\nabc.sort()\n\n\ndef halfcomb(l):\n n = len(l)\n n1 = n // 2\n n2 = (n + 1) // 2\n l1 = []\n l2 = []\n\n def sub(v1, v2, i, bound, ll, ind=0):\n if i == bound:\n ll.append((v1, v2))\n return\n sub(v1, v2, i + 1, bound, ll, ind)\n sub(v1 + l[ind + i][0], v2 + l[ind + i][1], i + 1, bound, ll, ind)\n\n sub(0, 0, 0, n1, l1)\n sub(0, 0, 0, n2, l2, ind=n1)\n return l1, l2\n\n\nl1, l2 = halfcomb(abc)\nd2 = {}\nfor v, c in l2:\n if v in d2:\n d2[v] = min(d2[v], c)\n else:\n d2[v] = c\nans = float(\"inf\")\nfor v, c in l1:\n if v == 0 and c > 0:\n ans = min(ans, c)\nfor v, c in l2:\n if v == 0 and c > 0:\n ans = min(ans, c)\nfor v, c in l1:\n if -v in d2 and c + d2[-v] > 0:\n ans = min(ans, c + d2[-v])\nif ans == float(\"inf\"):\n ans = -1\nprint(ans)\n", "measured_fast_code_sha256": "bab9323cfeaa66336157fcfc351fa47a4d07aa183900fa44056dd2eea3a678e6", "measured_slow_code": "N, Ma, Mb = list(map(int, input().split()))\n# 入力値の受け取り方を変える\narr = [list(map(int, input().split())) for _ in range(N)]\n# a = [0] * N\n# b = [0] * N\n# c = [0] * N\n# for i in range(N):\n# a[i], b[i], c[i] = map(int, input().split())\n# TLEになってしまうためinfを5000とかで設定する\nINF = 5000\n# さらに計算量を落とすため10 * N + 1などを定数で設定する → 関係なかったため戻す\n# 最小値を求める問題なのでinfで初期化\n# dp[i][sun_a][sum_b]で考えていく\ndp = [[[INF] * (10 * N + 1) for _ in range(10 * N + 1)] for _ in range(N + 1)]\n# 初期選択状態を0とする\ndp[0][0][0] = 0\nfor i in range(N):\n a, b, c = arr[i]\n for j in range(10 * N + 1):\n for k in range(10 * N + 1):\n if dp[i][j][k] == INF:\n continue\n # 選ばなかった場合\n dp[i + 1][j][k] = min(dp[i + 1][j][k], dp[i][j][k])\n # 選んだ場合\n dp[i + 1][j + a][k + b] = min(dp[i + 1][j + a][k + b], dp[i][j][k] + c)\nans = INF\n# 0スタートは何を選んでいない状態となり最小値が0になってしまうため1から開始する\n# TLEになったため変更\n# for i in range(1,10 * N + 1):\n# for j in range(1,10 * N + 1):\n# if i * Mb != j * Ma:\n# continue\n# ans = min(ans, dp[N][i][j])\n#\nfor i in range(1, 10 * N + 1):\n if i * Ma > 10 * N or i * Mb > 10 * N:\n break\n ans = min(ans, dp[N][i * Ma][i * Mb])\nif ans == INF:\n print((-1))\nelse:\n print(ans)\n", "measured_slow_code_sha256": "c05e31074808ad99de1edaa0cb451b5dae5bdb1dd544dea72248cb63ed956dad", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 10.32293328280638, "pair_id": "python_v2_5c0c6bdef0f22080bfc592eb", "per_case_slow_code_faster_fraction": 0.39, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03806", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03806_bab9323cfeaa66336157fcfc351fa47a4d07aa183900fa44056dd2eea3a678e6.jsonl.gz", "inputs": "reproduction/python/inputs/p03806.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03806_c05e31074808ad99de1edaa0cb451b5dae5bdb1dd544dea72248cb63ed956dad.jsonl.gz"}, "slow_code": "N, Ma, Mb = list(map(int, input().split()))\n\narr = [list(map(int, input().split())) for _ in range(N)]\n\n\nINF = 5000\n\n\ndp = [[[INF] * (10 * N + 1) for _ in range(10 * N + 1)] for _ in range(N + 1)]\n\ndp[0][0][0] = 0\nfor i in range(N):\n a, b, c = arr[i]\n for j in range(10 * N + 1):\n for k in range(10 * N + 1):\n if dp[i][j][k] == INF:\n continue\n\n dp[i + 1][j][k] = min(dp[i + 1][j][k], dp[i][j][k])\n\n dp[i + 1][j + a][k + b] = min(dp[i + 1][j + a][k + b], dp[i][j][k] + c)\nans = INF\n\n\nfor i in range(1, 10 * N + 1):\n if i * Ma > 10 * N or i * Mb > 10 * N:\n break\n ans = min(ans, dp[N][i * Ma][i * Mb])\nif ans == INF:\n print((-1))\nelse:\n print(ans)\n", "slow_code_sha256": "2e0411c6ced0edd7bd02dfae1556bd37b6ffc5230ba35b44b2155165ac5103d0", "slow_id": "p03806_c05e31074808ad99de1edaa0cb451b5dae5bdb1dd544dea72248cb63ed956dad", "speedup": 7.315066613011207, "stratum": "4-8", "within_pair_jaccard": 0.2702702702702703, "workload": {"case_count": 100, "description": "Choose a nonempty subset of N packages to obtain substances A and B in ratio M_a:M_b at minimum total cost. Package i supplies amounts a_i and b_i at cost c_i. Observed inputs: N=1..40 (median 20); M_a=1..10; M_b=1..10; a_i=1..10; b_i=1..10; c_i=1..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 298, "median": 150.0, "min": 13}, "input_format": ["N M_a M_b\na_1 b_1 c_1\n...\na_N b_N c_N"], "input_format_status": "source_input_section", "input_lines": {"max": 41, "median": 21.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 123, "median": 63.0, "min": 6}}} -{"case_ids": ["p02657_case_000", "p02657_case_001", "p02657_case_002", "p02657_case_003", "p02657_case_004", "p02657_case_005", "p02657_case_006", "p02657_case_007", "p02657_case_008", "p02657_case_009", "p02657_case_010", "p02657_case_011", "p02657_case_012", "p02657_case_013", "p02657_case_014", "p02657_case_015", "p02657_case_016", "p02657_case_017", "p02657_case_018", "p02657_case_019", "p02657_case_020", "p02657_case_021", "p02657_case_022", "p02657_case_023", "p02657_case_024", "p02657_case_025", "p02657_case_026", "p02657_case_027", "p02657_case_028", "p02657_case_029", "p02657_case_030", "p02657_case_031", "p02657_case_032", "p02657_case_033", "p02657_case_034", "p02657_case_035", "p02657_case_036", "p02657_case_037", "p02657_case_038", "p02657_case_039", "p02657_case_040", "p02657_case_041", "p02657_case_042", "p02657_case_043", "p02657_case_044", "p02657_case_045", "p02657_case_046", "p02657_case_047", "p02657_case_048", "p02657_case_049", "p02657_case_050", "p02657_case_051", "p02657_case_052", "p02657_case_053", "p02657_case_054", "p02657_case_055", "p02657_case_056", "p02657_case_057", "p02657_case_058", "p02657_case_059", "p02657_case_060", "p02657_case_061", "p02657_case_062", "p02657_case_063", "p02657_case_064", "p02657_case_065", "p02657_case_066", "p02657_case_067", "p02657_case_068", "p02657_case_069", "p02657_case_070", "p02657_case_071", "p02657_case_072", "p02657_case_073", "p02657_case_074", "p02657_case_075", "p02657_case_076", "p02657_case_077", "p02657_case_078", "p02657_case_079", "p02657_case_080", "p02657_case_081", "p02657_case_082", "p02657_case_083", "p02657_case_084", "p02657_case_085", "p02657_case_086", "p02657_case_087", "p02657_case_088", "p02657_case_089", "p02657_case_090", "p02657_case_091", "p02657_case_092", "p02657_case_093", "p02657_case_094", "p02657_case_095", "p02657_case_096", "p02657_case_097", "p02657_case_098", "p02657_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "print((eval(input().replace(\" \", \"*\"))))\n", "fast_code_sha256": "3110d842874c6046e398970dba4b72c45d15cd4aacc9697a99da0418434cc31f", "fast_id": "p02657_3110d842874c6046e398970dba4b72c45d15cd4aacc9697a99da0418434cc31f", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "print((eval(input().replace(\" \", \"*\"))))\n", "measured_fast_code_sha256": "3110d842874c6046e398970dba4b72c45d15cd4aacc9697a99da0418434cc31f", "measured_slow_code": "import math\n\na, b = [float(x) for x in input().split()]\na = int(a)\nb = int(b * 100)\nprint((int(math.floor(a * b) // 100)))\n", "measured_slow_code_sha256": "200b1c449f415dbd19883ab8d7d3fbd558bd29ecaa3e49199f40362ea5213e2b", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.1750304368332007, "pair_id": "python_v2_2b8518e6e4bba583265ce6e3", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02657", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02657_3110d842874c6046e398970dba4b72c45d15cd4aacc9697a99da0418434cc31f.jsonl.gz", "inputs": "reproduction/python/inputs/p02657.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02657_200b1c449f415dbd19883ab8d7d3fbd558bd29ecaa3e49199f40362ea5213e2b.jsonl.gz"}, "slow_code": "import math\n\na, b = [float(x) for x in input().split()]\na = int(a)\nb = int(b * 100)\nprint((int(math.floor(a * b) // 100)))\n", "slow_code_sha256": "200b1c449f415dbd19883ab8d7d3fbd558bd29ecaa3e49199f40362ea5213e2b", "slow_id": "p02657_200b1c449f415dbd19883ab8d7d3fbd558bd29ecaa3e49199f40362ea5213e2b", "speedup": 2.1695340049937935, "stratum": "2-4", "within_pair_jaccard": 0.125, "workload": {"case_count": 100, "description": "Compute the product of the two integer inputs A and B. Observed inputs: A=1..100 (median 34); B=1..100 (median 47.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 8, "median": 6.0, "min": 4}, "input_format": ["A B"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p02362_case_000", "p02362_case_001", "p02362_case_002", "p02362_case_003", "p02362_case_004", "p02362_case_005", "p02362_case_006", "p02362_case_007", "p02362_case_008", "p02362_case_009", "p02362_case_010", "p02362_case_011", "p02362_case_012", "p02362_case_013", "p02362_case_014", "p02362_case_015", "p02362_case_016", "p02362_case_017", "p02362_case_018", "p02362_case_019", "p02362_case_020", "p02362_case_021", "p02362_case_022", "p02362_case_023", "p02362_case_024", "p02362_case_025", "p02362_case_026", "p02362_case_027", "p02362_case_028", "p02362_case_029", "p02362_case_030", "p02362_case_031", "p02362_case_032", "p02362_case_033", "p02362_case_034", "p02362_case_035", "p02362_case_036", "p02362_case_037", "p02362_case_038", "p02362_case_039", "p02362_case_040", "p02362_case_041", "p02362_case_042", "p02362_case_043", "p02362_case_044", "p02362_case_045", "p02362_case_046", "p02362_case_047", "p02362_case_048", "p02362_case_049", "p02362_case_050", "p02362_case_051", "p02362_case_052", "p02362_case_053", "p02362_case_054", "p02362_case_055", "p02362_case_056", "p02362_case_057", "p02362_case_058", "p02362_case_059", "p02362_case_060", "p02362_case_061", "p02362_case_062", "p02362_case_063", "p02362_case_064", "p02362_case_065", "p02362_case_066", "p02362_case_067", "p02362_case_068", "p02362_case_069", "p02362_case_070", "p02362_case_071", "p02362_case_072", "p02362_case_073", "p02362_case_074", "p02362_case_075", "p02362_case_076", "p02362_case_077", "p02362_case_078", "p02362_case_079", "p02362_case_080", "p02362_case_081", "p02362_case_082", "p02362_case_083", "p02362_case_084", "p02362_case_085", "p02362_case_086", "p02362_case_087", "p02362_case_088", "p02362_case_089", "p02362_case_090", "p02362_case_091", "p02362_case_092", "p02362_case_093", "p02362_case_094", "p02362_case_095", "p02362_case_096", "p02362_case_097", "p02362_case_098", "p02362_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\nfile_input = sys.stdin\nV, E, r = map(int, file_input.readline().split())\nedges = []\nfor line in file_input:\n edges.append(tuple(map(int, line.split())))\n\ndistance = [float(\"inf\")] * V\ndistance[r] = 0\nnotUpdated = True\nfor i in range(V - 1):\n notUpdated = True\n for s, t, w in edges:\n temp_d = distance[s] + w\n if temp_d < distance[t]:\n distance[t] = temp_d\n notUpdated = False\n if notUpdated:\n break\n\nif notUpdated:\n print(*map(lambda x: str(x).upper(), distance), sep=\"\\n\")\nelse:\n flag = True\n for s, t, w in edges:\n temp_d = distance[s] + w\n if temp_d < distance[t]:\n print(\"NEGATIVE CYCLE\")\n flag = False\n break\n if flag:\n print(*map(lambda x: str(x).upper(), distance), sep=\"\\n\")\n", "fast_code_sha256": "3fe7b411ed933f44322c3ebc9db01922f20d7ad447ad58aa9934f7062ce01d40", "fast_id": "p02362_a876e50adb7fb20d6c6d462a1e2209a28830057167cd88325e76836aef56d5a3", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "# Input acceptance\nimport sys\n\nfile_input = sys.stdin\nV, E, r = map(int, file_input.readline().split())\nedges = []\nfor line in file_input:\n edges.append(tuple(map(int, line.split())))\n# Bellman???Ford algorithm\ndistance = [float(\"inf\")] * V\ndistance[r] = 0\nnotUpdated = True\nfor i in range(V - 1):\n notUpdated = True\n for s, t, w in edges:\n temp_d = distance[s] + w\n if temp_d < distance[t]:\n distance[t] = temp_d\n notUpdated = False\n if notUpdated:\n break\n# Output\nif notUpdated:\n print(*map(lambda x: str(x).upper(), distance), sep=\"\\n\")\nelse:\n flag = True\n for s, t, w in edges:\n temp_d = distance[s] + w\n if temp_d < distance[t]:\n print(\"NEGATIVE CYCLE\")\n flag = False\n break\n if flag:\n print(*map(lambda x: str(x).upper(), distance), sep=\"\\n\")\n", "measured_fast_code_sha256": "a876e50adb7fb20d6c6d462a1e2209a28830057167cd88325e76836aef56d5a3", "measured_slow_code": "from sys import stdin\nfrom collections import deque\n\nV, E, R = [int(x) for x in stdin.readline().split()]\nd = {}\ntick = False\nINF = float(\"inf\")\nfor i in range(V):\n d[i] = INF\nd[R] = 0\nweight = {}\nst = []\nfor i in range(1, V + 1):\n for j in range(E):\n if i == 1:\n s, t, w = [int(x) for x in stdin.readline().split()]\n weight[(s, t)] = w\n st.append((s, t))\n (s, t) = st[j]\n if d[t] > d[s] + weight[(s, t)]:\n d[t] = d[s] + weight[(s, t)]\n if i == V:\n print(\"NEGATIVE CYCLE\")\n quit()\nfor k in range(V):\n if d[k] == float(\"inf\"):\n print(\"INF\")\n else:\n print((d[k]))\n", "measured_slow_code_sha256": "ab12a803b6785f5f4ed17833763fd1aa5fdea2598bb998ef4d318a063084c6bb", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.7903031449997955, "pair_id": "python_v2_0b15ccdab80a1d3725c7b5e8", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02362", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02362_a876e50adb7fb20d6c6d462a1e2209a28830057167cd88325e76836aef56d5a3.jsonl.gz", "inputs": "reproduction/python/inputs/p02362.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02362_ab12a803b6785f5f4ed17833763fd1aa5fdea2598bb998ef4d318a063084c6bb.jsonl.gz"}, "slow_code": "from sys import stdin\nfrom collections import deque\n\nV, E, R = [int(x) for x in stdin.readline().split()]\nd = {}\ntick = False\nINF = float(\"inf\")\nfor i in range(V):\n d[i] = INF\nd[R] = 0\nweight = {}\nst = []\nfor i in range(1, V + 1):\n for j in range(E):\n if i == 1:\n s, t, w = [int(x) for x in stdin.readline().split()]\n weight[(s, t)] = w\n st.append((s, t))\n (s, t) = st[j]\n if d[t] > d[s] + weight[(s, t)]:\n d[t] = d[s] + weight[(s, t)]\n if i == V:\n print(\"NEGATIVE CYCLE\")\n quit()\nfor k in range(V):\n if d[k] == float(\"inf\"):\n print(\"INF\")\n else:\n print((d[k]))\n", "slow_code_sha256": "ab12a803b6785f5f4ed17833763fd1aa5fdea2598bb998ef4d318a063084c6bb", "slow_id": "p02362_ab12a803b6785f5f4ed17833763fd1aa5fdea2598bb998ef4d318a063084c6bb", "speedup": 3.6306089153419308, "stratum": "2-4", "within_pair_jaccard": 0.48214285714285715, "workload": {"case_count": 100, "description": "For a directed graph with signed edge weights, output NEGATIVE CYCLE if a negative cycle is reachable from source r. Otherwise output shortest-path costs from r, using INF for unreachable vertices. IDs are 0..V-1; no self-loops or parallel directed edges. Observed inputs: V=1..1000 (median 50); E=0..2000 (median 50); r=0..999; d_i=-10000..10000; negative_edges=0..1041 (median 25).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 26410, "median": 573.0, "min": 6}, "input_format": ["V E r\ns_1 t_1 d_1\n...\ns_E t_E d_E"], "input_format_status": "source_input_section", "input_lines": {"max": 2001, "median": 51.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 6003, "median": 153.0, "min": 3}}} -{"case_ids": ["p02551_case_000", "p02551_case_001", "p02551_case_002", "p02551_case_003", "p02551_case_004", "p02551_case_005", "p02551_case_006", "p02551_case_007", "p02551_case_008", "p02551_case_009", "p02551_case_010", "p02551_case_011", "p02551_case_012", "p02551_case_013", "p02551_case_014", "p02551_case_015", "p02551_case_016", "p02551_case_017", "p02551_case_018", "p02551_case_019", "p02551_case_020", "p02551_case_021", "p02551_case_022", "p02551_case_023", "p02551_case_024", "p02551_case_025", "p02551_case_026", "p02551_case_027", "p02551_case_028", "p02551_case_029", "p02551_case_030", "p02551_case_031", "p02551_case_032", "p02551_case_033", "p02551_case_034", "p02551_case_035", "p02551_case_036", "p02551_case_037", "p02551_case_038", "p02551_case_039", "p02551_case_040", "p02551_case_041", "p02551_case_042", "p02551_case_043", "p02551_case_044", "p02551_case_045", "p02551_case_046", "p02551_case_047", "p02551_case_048", "p02551_case_049", "p02551_case_050", "p02551_case_051", "p02551_case_052", "p02551_case_053", "p02551_case_054", "p02551_case_055", "p02551_case_056", "p02551_case_057", "p02551_case_058", "p02551_case_059", "p02551_case_060", "p02551_case_061", "p02551_case_062", "p02551_case_063", "p02551_case_064", "p02551_case_065", "p02551_case_066", "p02551_case_067", "p02551_case_068", "p02551_case_069", "p02551_case_070", "p02551_case_071", "p02551_case_072", "p02551_case_073", "p02551_case_074", "p02551_case_075", "p02551_case_076", "p02551_case_077", "p02551_case_078", "p02551_case_079", "p02551_case_080", "p02551_case_081", "p02551_case_082", "p02551_case_083", "p02551_case_084", "p02551_case_085", "p02551_case_086", "p02551_case_087", "p02551_case_088", "p02551_case_089", "p02551_case_090", "p02551_case_091", "p02551_case_092", "p02551_case_093", "p02551_case_094", "p02551_case_095", "p02551_case_096", "p02551_case_097", "p02551_case_098", "p02551_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\nread = sys.stdin.read\nreadline = sys.stdin.readline\nreadlines = sys.stdin.readlines\nsys.setrecursionlimit(10**9)\nINF = 1 << 60\nMOD = 1000000007\n\n\ndef main():\n N, Q, *query = list(map(int, read().split()))\n N -= 2\n row = [N] * N\n col = [N] * N\n R = C = N\n ans = N * N\n for q, x in zip(*[iter(query)] * 2):\n x -= 2\n if q == 1:\n if x < C:\n ans -= R\n for i in range(x + 1, C):\n col[i] = R\n C = x\n else:\n ans -= col[x]\n else:\n if x < R:\n ans -= C\n for i in range(x + 1, R):\n row[i] = C\n R = x\n else:\n ans -= row[x]\n print(ans)\n return\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "563884c909984690cb17a4a75e13aa643e22ac803dadb5d6eff6d3b364daf2a3", "fast_id": "p02551_563884c909984690cb17a4a75e13aa643e22ac803dadb5d6eff6d3b364daf2a3", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\nread = sys.stdin.read\nreadline = sys.stdin.readline\nreadlines = sys.stdin.readlines\nsys.setrecursionlimit(10**9)\nINF = 1 << 60\nMOD = 1000000007\n\n\ndef main():\n N, Q, *query = list(map(int, read().split()))\n N -= 2\n row = [N] * N\n col = [N] * N\n R = C = N\n ans = N * N\n for q, x in zip(*[iter(query)] * 2):\n x -= 2\n if q == 1:\n if x < C:\n ans -= R\n for i in range(x + 1, C):\n col[i] = R\n C = x\n else:\n ans -= col[x]\n else:\n if x < R:\n ans -= C\n for i in range(x + 1, R):\n row[i] = C\n R = x\n else:\n ans -= row[x]\n print(ans)\n return\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "563884c909984690cb17a4a75e13aa643e22ac803dadb5d6eff6d3b364daf2a3", "measured_slow_code": "import sys\nimport math\nfrom collections import defaultdict, deque, Counter\nfrom copy import deepcopy\nfrom bisect import bisect, bisect_right, bisect_left\nfrom heapq import heapify, heappop, heappush\n\ninput = sys.stdin.readline\n\n\ndef RD():\n return input().rstrip()\n\n\ndef F():\n return float(input().rstrip())\n\n\ndef I():\n return int(input().rstrip())\n\n\ndef MI():\n return list(map(int, input().split()))\n\n\ndef MF():\n return list(map(float, input().split()))\n\n\ndef LI():\n return list(map(int, input().split()))\n\n\ndef TI():\n return tuple(map(int, input().split()))\n\n\ndef LF():\n return list(map(float, input().split()))\n\n\ndef Init(H, W, num):\n return [[num for i in range(W)] for j in range(H)]\n\n\nclass BIT:\n # 作りたい要素数nで初期化, 1-index\n # 使用するインスタンス変数の初期化\n def __init__(self, n):\n self.n = n\n self.bit = [0] * (n + 1)\n\n # bit_indexにxをO(log(n))で加算する\n def add(self, i, x):\n # if(i<=0 or i>n):return iに\b0以下の数字は代入しない\n while i <= self.n:\n self.bit[i] += x\n i += i & -i\n\n # bit_1 + bit_2 + … + bit_n をO(log(n))で求める\n def sum(self, i):\n s = 0\n # iに0以下の数字は代入しない。\n while i > 0:\n s += self.bit[i]\n i -= i & -i\n return s\n\n def rangesum(self, i, k):\n return self.sum(k) - self.sum(i)\n\n # a_1 + a_2 + … + a_i >= x となるような最小のiを求める(a_k >= 0)\n # xが0以下の場合は該当するものなし→0を返す\n def lower_bound(self, x):\n if x <= 0:\n return 0\n else:\n i = 0\n r = 1\n # 最大としてありうる区間の長さを取得する\n # n以下の最小の二乗のべき(BITで管理する数列の区間で最大のもの)を求める\n while r < self.n:\n r = r << 1\n len = r\n while len > 0:\n if i + len < self.n and self.bit[i + len] < x:\n x -= self.bit[i + len]\n i += len\n len = len >> 1\n return i + 1\n\n\ndef main():\n N, Q = MI()\n X, Y = BIT(N), BIT(N)\n xmin = N - 2\n ymin = N - 2\n X.add(1, N - 2)\n X.add(N - 1, -(N - 2))\n Y.add(1, N - 2)\n Y.add(N - 1, -(N - 2))\n res = (N - 2) ** 2\n for i in range(Q):\n a, b = MI()\n if a == 1:\n x = X.sum(b - 1)\n if ymin > b - 2:\n temp = Y.sum(1)\n Y.add(1, b - 2 - temp)\n Y.add(xmin + 1, -(b - 2 - temp))\n ymin = b - 2\n res -= x\n else:\n y = Y.sum(b - 1)\n if xmin > b - 2:\n temp = X.sum(1)\n X.add(1, b - 2 - temp)\n X.add(ymin + 1, -(b - 2 - temp))\n xmin = b - 2\n res -= y\n print(res)\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "3fb4429ee888ddb8810abf6987aaa8ccbe9abde7bb58f869c67011fae847ac8b", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 5.190424726568189, "pair_id": "python_v2_6603cccaa5b24735cfaf2d30", "per_case_slow_code_faster_fraction": 0.01, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02551", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02551_563884c909984690cb17a4a75e13aa643e22ac803dadb5d6eff6d3b364daf2a3.jsonl.gz", "inputs": "reproduction/python/inputs/p02551.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02551_3fb4429ee888ddb8810abf6987aaa8ccbe9abde7bb58f869c67011fae847ac8b.jsonl.gz"}, "slow_code": "import sys\nimport math\nfrom collections import defaultdict, deque, Counter\nfrom copy import deepcopy\nfrom bisect import bisect, bisect_right, bisect_left\nfrom heapq import heapify, heappop, heappush\n\ninput = sys.stdin.readline\n\n\ndef RD():\n return input().rstrip()\n\n\ndef F():\n return float(input().rstrip())\n\n\ndef I():\n return int(input().rstrip())\n\n\ndef MI():\n return list(map(int, input().split()))\n\n\ndef MF():\n return list(map(float, input().split()))\n\n\ndef LI():\n return list(map(int, input().split()))\n\n\ndef TI():\n return tuple(map(int, input().split()))\n\n\ndef LF():\n return list(map(float, input().split()))\n\n\ndef Init(H, W, num):\n return [[num for i in range(W)] for j in range(H)]\n\n\nclass BIT:\n\n def __init__(self, n):\n self.n = n\n self.bit = [0] * (n + 1)\n\n def add(self, i, x):\n\n while i <= self.n:\n self.bit[i] += x\n i += i & -i\n\n def sum(self, i):\n s = 0\n\n while i > 0:\n s += self.bit[i]\n i -= i & -i\n return s\n\n def rangesum(self, i, k):\n return self.sum(k) - self.sum(i)\n\n def lower_bound(self, x):\n if x <= 0:\n return 0\n else:\n i = 0\n r = 1\n\n while r < self.n:\n r = r << 1\n len = r\n while len > 0:\n if i + len < self.n and self.bit[i + len] < x:\n x -= self.bit[i + len]\n i += len\n len = len >> 1\n return i + 1\n\n\ndef main():\n N, Q = MI()\n X, Y = BIT(N), BIT(N)\n xmin = N - 2\n ymin = N - 2\n X.add(1, N - 2)\n X.add(N - 1, -(N - 2))\n Y.add(1, N - 2)\n Y.add(N - 1, -(N - 2))\n res = (N - 2) ** 2\n for i in range(Q):\n a, b = MI()\n if a == 1:\n x = X.sum(b - 1)\n if ymin > b - 2:\n temp = Y.sum(1)\n Y.add(1, b - 2 - temp)\n Y.add(xmin + 1, -(b - 2 - temp))\n ymin = b - 2\n res -= x\n else:\n y = Y.sum(b - 1)\n if xmin > b - 2:\n temp = X.sum(1)\n X.add(1, b - 2 - temp)\n X.add(ymin + 1, -(b - 2 - temp))\n xmin = b - 2\n res -= y\n print(res)\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "e436c00a28b0ec58cc5ca5e93e0e4876df7a9883468a86ca2ef492100ee611a7", "slow_id": "p02551_3fb4429ee888ddb8810abf6987aaa8ccbe9abde7bb58f869c67011fae847ac8b", "speedup": 5.1012793276801744, "stratum": "4-8", "within_pair_jaccard": 0.24752475247524752, "workload": {"case_count": 100, "description": "An N-by-N grid starts with black inner cells and white bottom/right borders. Distinct queries 1 x or 2 x turn cells white downward from (1,x) or rightward from (x,1), stopping at the first white cell. Count remaining black cells. Observed inputs: N=3..200000 (median 100000); Q=0..200000 (median 199996); x=2..199999.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1689172, "median": 1577778.0, "min": 4}, "input_format": ["N Q\ntype_1 x_1\n...\ntype_Q x_Q"], "input_format_status": "source_input_section", "input_lines": {"max": 200001, "median": 199997.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 400002, "median": 399994.0, "min": 2}}} -{"case_ids": ["p02922_case_000", "p02922_case_001", "p02922_case_002", "p02922_case_003", "p02922_case_004", "p02922_case_005", "p02922_case_006", "p02922_case_007", "p02922_case_008", "p02922_case_009", "p02922_case_010", "p02922_case_011", "p02922_case_012", "p02922_case_013", "p02922_case_014", "p02922_case_015", "p02922_case_016", "p02922_case_017", "p02922_case_018", "p02922_case_019", "p02922_case_020", "p02922_case_021", "p02922_case_022", "p02922_case_023", "p02922_case_024", "p02922_case_025", "p02922_case_026", "p02922_case_027", "p02922_case_028", "p02922_case_029", "p02922_case_030", "p02922_case_031", "p02922_case_032", "p02922_case_033", "p02922_case_034", "p02922_case_035", "p02922_case_036", "p02922_case_037", "p02922_case_038", "p02922_case_039", "p02922_case_040", "p02922_case_041", "p02922_case_042", "p02922_case_043", "p02922_case_044", "p02922_case_045", "p02922_case_046", "p02922_case_047", "p02922_case_048", "p02922_case_049", "p02922_case_050", "p02922_case_051", "p02922_case_052", "p02922_case_053", "p02922_case_054", "p02922_case_055", "p02922_case_056", "p02922_case_057", "p02922_case_058", "p02922_case_059", "p02922_case_060", "p02922_case_061", "p02922_case_062", "p02922_case_063", "p02922_case_064", "p02922_case_065", "p02922_case_066", "p02922_case_067", "p02922_case_068", "p02922_case_069", "p02922_case_070", "p02922_case_071", "p02922_case_072", "p02922_case_073", "p02922_case_074", "p02922_case_075", "p02922_case_076", "p02922_case_077", "p02922_case_078", "p02922_case_079", "p02922_case_080", "p02922_case_081", "p02922_case_082", "p02922_case_083", "p02922_case_084", "p02922_case_085", "p02922_case_086", "p02922_case_087", "p02922_case_088", "p02922_case_089", "p02922_case_090", "p02922_case_091", "p02922_case_092", "p02922_case_093", "p02922_case_094", "p02922_case_095", "p02922_case_096", "p02922_case_097", "p02922_case_098", "p02922_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from copy import deepcopy\nfrom math import ceil\n\nif __name__ == \"__main__\":\n a = list(map(int, input().split()))\n n = deepcopy(a[0])\n i = 1\n if a[0] == a[1]:\n print(i)\n elif a[1] == 1:\n print((0))\n elif a[0] >= a[1]:\n print(i)\n else:\n while True:\n i += 1\n n += a[0] - 1\n if n >= a[1]:\n print(i)\n break\n", "fast_code_sha256": "00e867b7d2095675b21d44aa0203e42270e0c7d7b6d93feade6e801e5b2a696c", "fast_id": "p02922_00e867b7d2095675b21d44aa0203e42270e0c7d7b6d93feade6e801e5b2a696c", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from copy import deepcopy\nfrom math import ceil\n\nif __name__ == \"__main__\":\n a = list(map(int, input().split()))\n n = deepcopy(a[0])\n i = 1\n if a[0] == a[1]:\n print(i)\n elif a[1] == 1:\n print((0))\n elif a[0] >= a[1]:\n print(i)\n else:\n while True:\n i += 1\n n += a[0] - 1\n if n >= a[1]:\n print(i)\n break\n", "measured_fast_code_sha256": "00e867b7d2095675b21d44aa0203e42270e0c7d7b6d93feade6e801e5b2a696c", "measured_slow_code": "import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, queue, copy\n\nsys.setrecursionlimit(10**7)\ninf = 10**20\nmod = 10**9 + 7\ndd = [(-1, 0), (0, 1), (1, 0), (0, -1)]\nddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef LI_():\n return [int(x) - 1 for x in sys.stdin.readline().split()]\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LS():\n return sys.stdin.readline().split()\n\n\ndef S():\n return eval(input())\n\n\ndef main():\n a, b = LI()\n c = 1\n ans = 0\n while True:\n if c >= b:\n return ans\n ans += 1\n c -= 1\n c += a\n\n\n# main()\nprint((main()))\n", "measured_slow_code_sha256": "8b569fc1e16981f8320c705cea748e4c69f345af35a77c5db73eb42d1431aac6", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 5.863175997651743, "pair_id": "python_v2_d5936d65d45cc90724edd2f2", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02922", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02922_00e867b7d2095675b21d44aa0203e42270e0c7d7b6d93feade6e801e5b2a696c.jsonl.gz", "inputs": "reproduction/python/inputs/p02922.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02922_8b569fc1e16981f8320c705cea748e4c69f345af35a77c5db73eb42d1431aac6.jsonl.gz"}, "slow_code": "import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, queue, copy\n\nsys.setrecursionlimit(10**7)\ninf = 10**20\nmod = 10**9 + 7\ndd = [(-1, 0), (0, 1), (1, 0), (0, -1)]\nddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef LI_():\n return [int(x) - 1 for x in sys.stdin.readline().split()]\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LS():\n return sys.stdin.readline().split()\n\n\ndef S():\n return eval(input())\n\n\ndef main():\n a, b = LI()\n c = 1\n ans = 0\n while True:\n if c >= b:\n return ans\n ans += 1\n c -= 1\n c += a\n\n\nprint((main()))\n", "slow_code_sha256": "d125558241ae3c64a726d724586fb5061b0b0d9b36349b79174daa959a5a79c4", "slow_id": "p02922_8b569fc1e16981f8320c705cea748e4c69f345af35a77c5db73eb42d1431aac6", "speedup": 5.858304475029582, "stratum": "4-8", "within_pair_jaccard": 0.20634920634920634, "workload": {"case_count": 100, "description": "Start with one empty electrical socket. Installing a strip consumes one socket and provides A empty sockets. Find the fewest strips needed to have at least B empty sockets. Observed inputs: A=2..20 (median 8); B=1..20 (median 7).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 6, "median": 4.5, "min": 4}, "input_format": ["A B"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p02770_case_000", "p02770_case_001", "p02770_case_002", "p02770_case_003", "p02770_case_004", "p02770_case_005", "p02770_case_006", "p02770_case_007", "p02770_case_008", "p02770_case_009", "p02770_case_010", "p02770_case_011", "p02770_case_012", "p02770_case_013", "p02770_case_014", "p02770_case_015", "p02770_case_016", "p02770_case_017", "p02770_case_018", "p02770_case_019", "p02770_case_020", "p02770_case_021", "p02770_case_022", "p02770_case_023", "p02770_case_024", "p02770_case_025", "p02770_case_026", "p02770_case_027", "p02770_case_028", "p02770_case_029", "p02770_case_030", "p02770_case_031", "p02770_case_032", "p02770_case_033", "p02770_case_034", "p02770_case_035", "p02770_case_036", "p02770_case_037", "p02770_case_038", "p02770_case_039", "p02770_case_040", "p02770_case_041", "p02770_case_042", "p02770_case_043", "p02770_case_044", "p02770_case_045", "p02770_case_046", "p02770_case_047", "p02770_case_048", "p02770_case_049", "p02770_case_050", "p02770_case_051", "p02770_case_052", "p02770_case_053", "p02770_case_054", "p02770_case_055", "p02770_case_056", "p02770_case_057", "p02770_case_058", "p02770_case_059", "p02770_case_060", "p02770_case_061", "p02770_case_062", "p02770_case_063", "p02770_case_064", "p02770_case_065", "p02770_case_066", "p02770_case_067", "p02770_case_068", "p02770_case_069", "p02770_case_070", "p02770_case_071", "p02770_case_072", "p02770_case_073", "p02770_case_074", "p02770_case_075", "p02770_case_076", "p02770_case_077", "p02770_case_078", "p02770_case_079", "p02770_case_080", "p02770_case_081", "p02770_case_082", "p02770_case_083", "p02770_case_084", "p02770_case_085", "p02770_case_086", "p02770_case_087", "p02770_case_088", "p02770_case_089", "p02770_case_090", "p02770_case_091", "p02770_case_092", "p02770_case_093", "p02770_case_094", "p02770_case_095", "p02770_case_096", "p02770_case_097", "p02770_case_098", "p02770_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def main():\n k, q = list(map(int, input().split()))\n (*d,) = list(map(int, input().split()))\n for _ in range(q):\n n, x, m = list(map(int, input().split()))\n (*g,) = [x % m for x in d]\n rep, rest = divmod(n - 1, k)\n last = x + (sum(g) * rep) + sum(g[:rest])\n eq = sum(rep + (1 if i < rest else 0) for i, gg in enumerate(g) if gg == 0)\n ans = (n - 1) - eq - (last // m - x // m)\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "b08b63949d5a0d136cf4abbcf8d58f0dfce1c51147939885ca0da7ecb15e7dd4", "fast_id": "p02770_1d04958ffbdbddcd269fad8373f24a6d7b9d37ba405ef0ceba28eac485c84265", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "# 解説放送\n# tee, isliceをやめた\ndef main():\n k, q = list(map(int, input().split()))\n (*d,) = list(map(int, input().split()))\n for _ in range(q):\n n, x, m = list(map(int, input().split()))\n (*g,) = [x % m for x in d]\n rep, rest = divmod(n - 1, k)\n last = x + (sum(g) * rep) + sum(g[:rest])\n eq = sum(rep + (1 if i < rest else 0) for i, gg in enumerate(g) if gg == 0)\n ans = (n - 1) - eq - (last // m - x // m)\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "1d04958ffbdbddcd269fad8373f24a6d7b9d37ba405ef0ceba28eac485c84265", "measured_slow_code": "import numpy as np\n\nk, q = list(map(int, input().split()))\nd = np.array(list(map(int, input().split()))).astype(np.int64)\nqueries = [tuple(map(int, input().split())) for _ in range(q)]\nfor n, x, m in queries:\n d_mod = d % m\n quotient, rem = divmod(n - 1, k)\n rem_d_mod = d_mod[:rem]\n print(\n (\n n\n - 1\n - (x % m + quotient * np.sum(d_mod) + np.sum(rem_d_mod)) // m\n - quotient * np.count_nonzero(d_mod == 0)\n - np.count_nonzero(rem_d_mod == 0)\n )\n )\n", "measured_slow_code_sha256": "7f1c6212437f5dfde41ac56fb777a6413a36acf30f0fa1db841babde5bb8abca", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 0.4903164742087548, "pair_id": "python_v2_dc6aee1aefb7d0dc7e10161a", "per_case_slow_code_faster_fraction": 0.53, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02770", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02770_1d04958ffbdbddcd269fad8373f24a6d7b9d37ba405ef0ceba28eac485c84265.jsonl.gz", "inputs": "reproduction/python/inputs/p02770.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02770_7f1c6212437f5dfde41ac56fb777a6413a36acf30f0fa1db841babde5bb8abca.jsonl.gz"}, "slow_code": "import numpy as np\n\nk, q = list(map(int, input().split()))\nd = np.array(list(map(int, input().split()))).astype(np.int64)\nqueries = [tuple(map(int, input().split())) for _ in range(q)]\nfor n, x, m in queries:\n d_mod = d % m\n quotient, rem = divmod(n - 1, k)\n rem_d_mod = d_mod[:rem]\n print(\n (\n n\n - 1\n - (x % m + quotient * np.sum(d_mod) + np.sum(rem_d_mod)) // m\n - quotient * np.count_nonzero(d_mod == 0)\n - np.count_nonzero(rem_d_mod == 0)\n )\n )\n", "slow_code_sha256": "7f1c6212437f5dfde41ac56fb777a6413a36acf30f0fa1db841babde5bb8abca", "slow_id": "p02770_7f1c6212437f5dfde41ac56fb777a6413a36acf30f0fa1db841babde5bb8abca", "speedup": 3.2709923277014377, "stratum": "2-4", "within_pair_jaccard": 0.40816326530612246, "workload": {"case_count": 100, "description": "For each query (n,x,m), define a_0=x and a_j=a_(j-1)+d_((j-1) mod k). Count j in 0..n-2 with (a_j mod m)<(a_(j+1) mod m). Only k increments and q queries are listed; expanded sequences are implicit. Observed inputs: k=1..5000 (median 1000); q=1..5000 (median 1000); d_i=0..1000000000; n_i=2..1000000000; x_i=0..1000000000; m_i=2..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 215504, "median": 23899.5, "min": 12}, "input_format": ["k q\nd_0 ... d_(k-1)\nn_1 x_1 m_1\n...\nn_q x_q m_q"], "input_format_status": "source_input_section", "input_lines": {"max": 5002, "median": 1002.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 20002, "median": 4002.0, "min": 6}}} -{"case_ids": ["p02641_case_000", "p02641_case_001", "p02641_case_002", "p02641_case_003", "p02641_case_004", "p02641_case_005", "p02641_case_006", "p02641_case_007", "p02641_case_008", "p02641_case_009", "p02641_case_010", "p02641_case_011", "p02641_case_012", "p02641_case_013", "p02641_case_014", "p02641_case_015", "p02641_case_016", "p02641_case_017", "p02641_case_018", "p02641_case_019", "p02641_case_020", "p02641_case_021", "p02641_case_022", "p02641_case_023", "p02641_case_024", "p02641_case_025", "p02641_case_026", "p02641_case_027", "p02641_case_028", "p02641_case_029", "p02641_case_030", "p02641_case_031", "p02641_case_032", "p02641_case_033", "p02641_case_034", "p02641_case_035", "p02641_case_036", "p02641_case_037", "p02641_case_038", "p02641_case_039", "p02641_case_040", "p02641_case_041", "p02641_case_042", "p02641_case_043", "p02641_case_044", "p02641_case_045", "p02641_case_046", "p02641_case_047", "p02641_case_048", "p02641_case_049", "p02641_case_050", "p02641_case_051", "p02641_case_052", "p02641_case_053", "p02641_case_054", "p02641_case_055", "p02641_case_056", "p02641_case_057", "p02641_case_058", "p02641_case_059", "p02641_case_060", "p02641_case_061", "p02641_case_062", "p02641_case_063", "p02641_case_064", "p02641_case_065", "p02641_case_066", "p02641_case_067", "p02641_case_068", "p02641_case_069", "p02641_case_070", "p02641_case_071", "p02641_case_072", "p02641_case_073", "p02641_case_074", "p02641_case_075", "p02641_case_076", "p02641_case_077", "p02641_case_078", "p02641_case_079", "p02641_case_080", "p02641_case_081", "p02641_case_082", "p02641_case_083", "p02641_case_084", "p02641_case_085", "p02641_case_086", "p02641_case_087", "p02641_case_088", "p02641_case_089", "p02641_case_090", "p02641_case_091", "p02641_case_092", "p02641_case_093", "p02641_case_094", "p02641_case_095", "p02641_case_096", "p02641_case_097", "p02641_case_098", "p02641_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "x, n = list(map(int, input().split(\" \")))\ndiff = x\nresult = 0\nif n != 0:\n ls = list(map(int, input().split(\" \")))\n ls_remaind = []\n for i in range(1, 102):\n if i not in ls:\n ls_remaind.append(i)\n for j in ls_remaind:\n if abs(x - j) == diff:\n result = min(result, j)\n elif abs(x - j) < diff:\n diff = abs(x - j)\n result = j\nelse:\n result = x\nprint(result)\n", "fast_code_sha256": "4e8b27c908a06d77f811f3d9df5ae88d5e5e752bd4b576ed8b8896184adeda2d", "fast_id": "p02641_4e8b27c908a06d77f811f3d9df5ae88d5e5e752bd4b576ed8b8896184adeda2d", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "x, n = list(map(int, input().split(\" \")))\ndiff = x\nresult = 0\nif n != 0:\n ls = list(map(int, input().split(\" \")))\n ls_remaind = []\n for i in range(1, 102):\n if i not in ls:\n ls_remaind.append(i)\n for j in ls_remaind:\n if abs(x - j) == diff:\n result = min(result, j)\n elif abs(x - j) < diff:\n diff = abs(x - j)\n result = j\nelse:\n result = x\nprint(result)\n", "measured_fast_code_sha256": "4e8b27c908a06d77f811f3d9df5ae88d5e5e752bd4b576ed8b8896184adeda2d", "measured_slow_code": "x, n = list(map(int, input().split()))\nif n == 0:\n print(x)\n exit()\narr = list(map(int, input().split())) # p1 ... pn\narr2 = []\narr3 = []\nfor i in range(-50, 110):\n if not i in arr:\n arr2.append(i)\n arr3.append(abs(x - i))\nn2 = min([i for i, v in enumerate(arr3) if v == min(arr3)])\nprint((arr2[n2]))\n", "measured_slow_code_sha256": "56a803f01b0149391407a67301955076fc165a7ad3ad3f8f8a9f51ab5d8af60e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.9448860238688954, "pair_id": "python_v2_69ac5bfed071010088a37c33", "per_case_slow_code_faster_fraction": 0.03, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02641", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02641_4e8b27c908a06d77f811f3d9df5ae88d5e5e752bd4b576ed8b8896184adeda2d.jsonl.gz", "inputs": "reproduction/python/inputs/p02641.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02641_56a803f01b0149391407a67301955076fc165a7ad3ad3f8f8a9f51ab5d8af60e.jsonl.gz"}, "slow_code": "x, n = list(map(int, input().split()))\nif n == 0:\n print(x)\n exit()\narr = list(map(int, input().split()))\narr2 = []\narr3 = []\nfor i in range(-50, 110):\n if not i in arr:\n arr2.append(i)\n arr3.append(abs(x - i))\nn2 = min([i for i, v in enumerate(arr3) if v == min(arr3)])\nprint((arr2[n2]))\n", "slow_code_sha256": "85cbb5049fb6ba315c1cc49d08aa7371cf037161b52bac8a421580f3486b7f72", "slow_id": "p02641_56a803f01b0149391407a67301955076fc165a7ad3ad3f8f8a9f51ab5d8af60e", "speedup": 2.0406498541957063, "stratum": "2-4", "within_pair_jaccard": 0.5, "workload": {"case_count": 100, "description": "Find an integer not in the N distinct forbidden values p_i that is closest to X. Integers need not be positive; ties favor the smaller integer. Observed inputs: X=1..100 (median 50); N=0..100 (median 99); p_i=1..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 300, "median": 295.0, "min": 4}, "input_format": ["X N\np_1 ... p_N (line omitted if N=0)"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 102, "median": 101.0, "min": 2}}} -{"case_ids": ["p02640_case_000", "p02640_case_001", "p02640_case_002", "p02640_case_003", "p02640_case_004", "p02640_case_005", "p02640_case_006", "p02640_case_007", "p02640_case_008", "p02640_case_009", "p02640_case_010", "p02640_case_011", "p02640_case_012", "p02640_case_013", "p02640_case_014", "p02640_case_015", "p02640_case_016", "p02640_case_017", "p02640_case_018", "p02640_case_019", "p02640_case_020", "p02640_case_021", "p02640_case_022", "p02640_case_023", "p02640_case_024", "p02640_case_025", "p02640_case_026", "p02640_case_027", "p02640_case_028", "p02640_case_029", "p02640_case_030", "p02640_case_031", "p02640_case_032", "p02640_case_033", "p02640_case_034", "p02640_case_035", "p02640_case_036", "p02640_case_037", "p02640_case_038", "p02640_case_039", "p02640_case_040", "p02640_case_041", "p02640_case_042", "p02640_case_043", "p02640_case_044", "p02640_case_045", "p02640_case_046", "p02640_case_047", "p02640_case_048", "p02640_case_049", "p02640_case_050", "p02640_case_051", "p02640_case_052", "p02640_case_053", "p02640_case_054", "p02640_case_055", "p02640_case_056", "p02640_case_057", "p02640_case_058", "p02640_case_059", "p02640_case_060", "p02640_case_061", "p02640_case_062", "p02640_case_063", "p02640_case_064", "p02640_case_065", "p02640_case_066", "p02640_case_067", "p02640_case_068", "p02640_case_069", "p02640_case_070", "p02640_case_071", "p02640_case_072", "p02640_case_073", "p02640_case_074", "p02640_case_075", "p02640_case_076", "p02640_case_077", "p02640_case_078", "p02640_case_079", "p02640_case_080", "p02640_case_081", "p02640_case_082", "p02640_case_083", "p02640_case_084", "p02640_case_085", "p02640_case_086", "p02640_case_087", "p02640_case_088", "p02640_case_089", "p02640_case_090", "p02640_case_091", "p02640_case_092", "p02640_case_093", "p02640_case_094", "p02640_case_095", "p02640_case_096", "p02640_case_097", "p02640_case_098", "p02640_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\nimport time\n\nst = time.perf_counter()\n\nx, y = map(int, input().split())\nok = False\nfor i in range(x + 1):\n if i * 4 + (x - i) * 2 == y:\n ok = True\n break\nif ok:\n print(\"Yes\")\nelse:\n print(\"No\")\n\ned = time.perf_counter()\nprint(\"time:\", ed - st, file=sys.stderr)\n", "fast_code_sha256": "0197693866f6bd8642376e009ba7cfd94396278cad215fcd2af1b9c1eafda770", "fast_id": "p02640_dbed684e40b107b9d1d366d2d9edfa52c8c73818912b4d48c43cb74456f0cf5f", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\nimport time\n\nst = time.perf_counter()\n# ------------------------------\nx, y = map(int, input().split())\nok = False\nfor i in range(x + 1):\n if i * 4 + (x - i) * 2 == y:\n ok = True\n break\nif ok:\n print(\"Yes\")\nelse:\n print(\"No\")\n# ------------------------------\ned = time.perf_counter()\nprint(\"time:\", ed - st, file=sys.stderr)\n", "measured_fast_code_sha256": "dbed684e40b107b9d1d366d2d9edfa52c8c73818912b4d48c43cb74456f0cf5f", "measured_slow_code": "x, y = list(map(int, input().split()))\nfor i in range(0, 101):\n for j in range(0, 101):\n if i + j == x and i * 2 + j * 4 == y:\n print(\"Yes\")\n exit()\nprint(\"No\")\n# print('Yes' if y%2 == 0 and x >= y//2 and y // 4 - (y%4) //2 <= x else 'No')\n", "measured_slow_code_sha256": "b81aa7896b39a5e204fdfa9ca3f63685a6d18d86724afc22b841cf9b49e7766b", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 5.041035653635584, "pair_id": "python_v2_8247771a364a809c269b7f6c", "per_case_slow_code_faster_fraction": 0.18, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02640", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02640_dbed684e40b107b9d1d366d2d9edfa52c8c73818912b4d48c43cb74456f0cf5f.jsonl.gz", "inputs": "reproduction/python/inputs/p02640.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02640_b81aa7896b39a5e204fdfa9ca3f63685a6d18d86724afc22b841cf9b49e7766b.jsonl.gz"}, "slow_code": "x, y = list(map(int, input().split()))\nfor i in range(0, 101):\n for j in range(0, 101):\n if i + j == x and i * 2 + j * 4 == y:\n print(\"Yes\")\n exit()\nprint(\"No\")\n", "slow_code_sha256": "ac09bdaf0871ab87a33221ec8a163d2052febe18d868feae44e613cae3f3a95f", "slow_id": "p02640_b81aa7896b39a5e204fdfa9ca3f63685a6d18d86724afc22b841cf9b49e7766b", "speedup": 5.0826464585088615, "stratum": "4-8", "within_pair_jaccard": 0.4444444444444444, "workload": {"case_count": 100, "description": "Determine whether X animals can have Y legs in total when each animal is either a two-legged crane or a four-legged turtle. Observed inputs: X=1..100 (median 18); Y=1..100 (median 41).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 8, "median": 6.0, "min": 4}, "input_format": ["X Y"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p02930_case_000", "p02930_case_001", "p02930_case_002", "p02930_case_003", "p02930_case_004", "p02930_case_005", "p02930_case_006", "p02930_case_007", "p02930_case_008", "p02930_case_009", "p02930_case_010", "p02930_case_011", "p02930_case_012", "p02930_case_013", "p02930_case_014", "p02930_case_015", "p02930_case_016", "p02930_case_017", "p02930_case_018", "p02930_case_019", "p02930_case_020", "p02930_case_021", "p02930_case_022", "p02930_case_023", "p02930_case_024", "p02930_case_025", "p02930_case_026", "p02930_case_027", "p02930_case_028", "p02930_case_029", "p02930_case_030", "p02930_case_031", "p02930_case_032", "p02930_case_033", "p02930_case_034", "p02930_case_035", "p02930_case_036", "p02930_case_037", "p02930_case_038", "p02930_case_039", "p02930_case_040", "p02930_case_041", "p02930_case_042", "p02930_case_043", "p02930_case_044", "p02930_case_045", "p02930_case_046", "p02930_case_047", "p02930_case_048", "p02930_case_049", "p02930_case_050", "p02930_case_051", "p02930_case_052", "p02930_case_053", "p02930_case_054", "p02930_case_055", "p02930_case_056", "p02930_case_057", "p02930_case_058", "p02930_case_059", "p02930_case_060", "p02930_case_061", "p02930_case_062", "p02930_case_063", "p02930_case_064", "p02930_case_065", "p02930_case_066", "p02930_case_067", "p02930_case_068", "p02930_case_069", "p02930_case_070", "p02930_case_071", "p02930_case_072", "p02930_case_073", "p02930_case_074", "p02930_case_075", "p02930_case_076", "p02930_case_077", "p02930_case_078", "p02930_case_079", "p02930_case_080", "p02930_case_081", "p02930_case_082", "p02930_case_083", "p02930_case_084", "p02930_case_085", "p02930_case_086", "p02930_case_087", "p02930_case_088", "p02930_case_089", "p02930_case_090", "p02930_case_091", "p02930_case_092", "p02930_case_093", "p02930_case_094", "p02930_case_095", "p02930_case_096", "p02930_case_097", "p02930_case_098", "p02930_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(input())\nfor i in range(n):\n for j in range(i + 1, n):\n print((i ^ j & -(i ^ j)).bit_length(), end=\" \")\n print()\n", "fast_code_sha256": "c849486b5abf637af03fe7febf43bd7dd02b274707fda14923cc314878552577", "fast_id": "p02930_c849486b5abf637af03fe7febf43bd7dd02b274707fda14923cc314878552577", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(input())\nfor i in range(n):\n for j in range(i + 1, n):\n print((i ^ j & -(i ^ j)).bit_length(), end=\" \")\n print()\n", "measured_fast_code_sha256": "c849486b5abf637af03fe7febf43bd7dd02b274707fda14923cc314878552577", "measured_slow_code": "N, j = int(eval(input())), 0\nexec(\"print(*[9-format(i+1,'09b').rfind('1')for i in range(N)][:N-j-1]);j+=1;\" * N)\n", "measured_slow_code_sha256": "e92d2c5b381e0dc13fec91e29d5b05e3c0b38db0ebb8a73555cd4f93676c88e6", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.171715001788808, "pair_id": "python_v2_b0ee27583a4e7dfd448de2d5", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02930", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02930_c849486b5abf637af03fe7febf43bd7dd02b274707fda14923cc314878552577.jsonl.gz", "inputs": "reproduction/python/inputs/p02930.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02930_e92d2c5b381e0dc13fec91e29d5b05e3c0b38db0ebb8a73555cd4f93676c88e6.jsonl.gz"}, "slow_code": "N, j = int(eval(input())), 0\nexec(\"print(*[9-format(i+1,'09b').rfind('1')for i in range(N)][:N-j-1]);j+=1;\" * N)\n", "slow_code_sha256": "e92d2c5b381e0dc13fec91e29d5b05e3c0b38db0ebb8a73555cd4f93676c88e6", "slow_id": "p02930_e92d2c5b381e0dc13fec91e29d5b05e3c0b38db0ebb8a73555cd4f93676c88e6", "speedup": 2.4086434623468262, "stratum": "2-4", "within_pair_jaccard": 0.45, "workload": {"case_count": 100, "description": "Assign positive integer levels to edges of an implicit complete graph on N vertices. Every closed walk using only one level must have even length. Output a valid assignment minimizing the highest level. Observed inputs: N=2..500 (median 191); implicit_edges=1..124750.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 4, "median": 4.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p03608_case_000", "p03608_case_001", "p03608_case_002", "p03608_case_003", "p03608_case_004", "p03608_case_005", "p03608_case_006", "p03608_case_007", "p03608_case_008", "p03608_case_009", "p03608_case_010", "p03608_case_011", "p03608_case_012", "p03608_case_013", "p03608_case_014", "p03608_case_015", "p03608_case_016", "p03608_case_017", "p03608_case_018", "p03608_case_019", "p03608_case_020", "p03608_case_021", "p03608_case_022", "p03608_case_023", "p03608_case_024", "p03608_case_025", "p03608_case_026", "p03608_case_027", "p03608_case_028", "p03608_case_029", "p03608_case_030", "p03608_case_031", "p03608_case_032", "p03608_case_033", "p03608_case_034", "p03608_case_035", "p03608_case_036", "p03608_case_037", "p03608_case_038", "p03608_case_039", "p03608_case_040", "p03608_case_041", "p03608_case_042", "p03608_case_043", "p03608_case_044", "p03608_case_045", "p03608_case_046", "p03608_case_047", "p03608_case_048", "p03608_case_049", "p03608_case_050", "p03608_case_051", "p03608_case_052", "p03608_case_053", "p03608_case_054", "p03608_case_055", "p03608_case_056", "p03608_case_057", "p03608_case_058", "p03608_case_059", "p03608_case_060", "p03608_case_061", "p03608_case_062", "p03608_case_063", "p03608_case_064", "p03608_case_065", "p03608_case_066", "p03608_case_067", "p03608_case_068", "p03608_case_069", "p03608_case_070", "p03608_case_071", "p03608_case_072", "p03608_case_073", "p03608_case_074", "p03608_case_075", "p03608_case_076", "p03608_case_077", "p03608_case_078", "p03608_case_079", "p03608_case_080", "p03608_case_081", "p03608_case_082", "p03608_case_083", "p03608_case_084", "p03608_case_085", "p03608_case_086", "p03608_case_087", "p03608_case_088", "p03608_case_089", "p03608_case_090", "p03608_case_091", "p03608_case_092", "p03608_case_093", "p03608_case_094", "p03608_case_095", "p03608_case_096", "p03608_case_097", "p03608_case_098", "p03608_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import itertools\n\nINF = float(\"inf\")\n\n\ndef main():\n N, M, R = list(map(int, input().split()))\n r = list(map(int, input().split()))\n path = [[INF] * (N + 1) for _ in range(N + 1)]\n for _ in range(M):\n A, B, C = list(map(int, input().split()))\n path[A][B] = C\n path[B][A] = C\n for i in range(1, N + 1):\n path[i][i] = 0\n for i in range(1, N + 1):\n for j in range(1, N + 1):\n for k in range(1, N + 1):\n path[j][k] = min(path[j][k], path[j][i] + path[i][k])\n ans = INF\n for p in itertools.permutations(r):\n cost = 0\n for i in range(R - 1):\n cost += path[p[i]][p[i + 1]]\n ans = min(ans, cost)\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "e402cf8b709f4d4bd0675c325db77e47f7b2a6cb9e29edbcfebdf8e91b6449a7", "fast_id": "p03608_e402cf8b709f4d4bd0675c325db77e47f7b2a6cb9e29edbcfebdf8e91b6449a7", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import itertools\n\nINF = float(\"inf\")\n\n\ndef main():\n N, M, R = list(map(int, input().split()))\n r = list(map(int, input().split()))\n path = [[INF] * (N + 1) for _ in range(N + 1)]\n for _ in range(M):\n A, B, C = list(map(int, input().split()))\n path[A][B] = C\n path[B][A] = C\n for i in range(1, N + 1):\n path[i][i] = 0\n for i in range(1, N + 1):\n for j in range(1, N + 1):\n for k in range(1, N + 1):\n path[j][k] = min(path[j][k], path[j][i] + path[i][k])\n ans = INF\n for p in itertools.permutations(r):\n cost = 0\n for i in range(R - 1):\n cost += path[p[i]][p[i + 1]]\n ans = min(ans, cost)\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "e402cf8b709f4d4bd0675c325db77e47f7b2a6cb9e29edbcfebdf8e91b6449a7", "measured_slow_code": "n, m, r = list(map(int, input().split()))\nrs = list(map(int, input().split()))\n# construct map\nimport numpy as np\n\ndists = np.ones((n + 1, n + 1)) * float(\"inf\")\nfor _ in range(m):\n a, b, c = list(map(int, input().split()))\n dists[a, b] = dists[b, a] = c\nfor i in range(1, n + 1):\n dists[i, i] = 0\nfrom itertools import product, permutations\n\nfor i, j in product(list(range(1, 1 + n)), repeat=2):\n dists[j] = np.minimum(dists[j], dists[i] + dists[j, i])\nans = float(\"inf\")\nfor path in permutations(rs):\n val = sum(dists[i, j] for i, j in zip(path, path[1:]))\n val = int(val)\n if val < ans:\n ans = val\nprint(ans)\n", "measured_slow_code_sha256": "a6ba7a6e457f7223737377dc74c3739f39a6faf8bc7e129d3e4d82875673c6ae", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.0481363566226625, "pair_id": "python_v2_cfbdfd0208decd9fb275d33c", "per_case_slow_code_faster_fraction": 0.46, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03608", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03608_e402cf8b709f4d4bd0675c325db77e47f7b2a6cb9e29edbcfebdf8e91b6449a7.jsonl.gz", "inputs": "reproduction/python/inputs/p03608.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03608_a6ba7a6e457f7223737377dc74c3739f39a6faf8bc7e129d3e4d82875673c6ae.jsonl.gz"}, "slow_code": "n, m, r = list(map(int, input().split()))\nrs = list(map(int, input().split()))\n\nimport numpy as np\n\ndists = np.ones((n + 1, n + 1)) * float(\"inf\")\nfor _ in range(m):\n a, b, c = list(map(int, input().split()))\n dists[a, b] = dists[b, a] = c\nfor i in range(1, n + 1):\n dists[i, i] = 0\nfrom itertools import product, permutations\n\nfor i, j in product(list(range(1, 1 + n)), repeat=2):\n dists[j] = np.minimum(dists[j], dists[i] + dists[j, i])\nans = float(\"inf\")\nfor path in permutations(rs):\n val = sum(dists[i, j] for i, j in zip(path, path[1:]))\n val = int(val)\n if val < ans:\n ans = val\nprint(ans)\n", "slow_code_sha256": "f19f2c009c893dde042476371af37c34ea12cfaa23ea63baa86f7c5a07cc08fe", "slow_id": "p03608_a6ba7a6e457f7223737377dc74c3739f39a6faf8bc7e129d3e4d82875673c6ae", "speedup": 4.149568360815874, "stratum": "4-8", "within_pair_jaccard": 0.40350877192982454, "workload": {"case_count": 100, "description": "Find the minimum road distance needed to visit R distinct specified towns in any order in a connected simple undirected graph. Start and finish at any specified towns; other towns may be passed through. Edges have positive lengths C_i. Observed inputs: N=2..200 (median 50); M=1..19900 (median 199); R=2..8 (median 8); C_i=1..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 277050, "median": 2393.0, "min": 16}, "input_format": ["N M R\nr_1 ... r_R\nA_1 B_1 C_1\n...\nA_M B_M C_M"], "input_format_status": "source_input_section", "input_lines": {"max": 19902, "median": 201.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 59711, "median": 608.0, "min": 8}}} -{"case_ids": ["p02845_case_000", "p02845_case_001", "p02845_case_002", "p02845_case_003", "p02845_case_004", "p02845_case_005", "p02845_case_006", "p02845_case_007", "p02845_case_008", "p02845_case_009", "p02845_case_010", "p02845_case_011", "p02845_case_012", "p02845_case_013", "p02845_case_014", "p02845_case_015", "p02845_case_016", "p02845_case_017", "p02845_case_018", "p02845_case_019", "p02845_case_020", "p02845_case_021", "p02845_case_022", "p02845_case_023", "p02845_case_024", "p02845_case_025", "p02845_case_026", "p02845_case_027", "p02845_case_028", "p02845_case_029", "p02845_case_030", "p02845_case_031", "p02845_case_032", "p02845_case_033", "p02845_case_034", "p02845_case_035", "p02845_case_036", "p02845_case_037", "p02845_case_038", "p02845_case_039", "p02845_case_040", "p02845_case_041", "p02845_case_042", "p02845_case_043", "p02845_case_044", "p02845_case_045", "p02845_case_046", "p02845_case_047", "p02845_case_048", "p02845_case_049", "p02845_case_050", "p02845_case_051", "p02845_case_052", "p02845_case_053", "p02845_case_054", "p02845_case_055", "p02845_case_056", "p02845_case_057", "p02845_case_058", "p02845_case_059", "p02845_case_060", "p02845_case_061", "p02845_case_062", "p02845_case_063", "p02845_case_064", "p02845_case_065", "p02845_case_066", "p02845_case_067", "p02845_case_068", "p02845_case_069", "p02845_case_070", "p02845_case_071", "p02845_case_072", "p02845_case_073", "p02845_case_074", "p02845_case_075", "p02845_case_076", "p02845_case_077", "p02845_case_078", "p02845_case_079", "p02845_case_080", "p02845_case_081", "p02845_case_082", "p02845_case_083", "p02845_case_084", "p02845_case_085", "p02845_case_086", "p02845_case_087", "p02845_case_088", "p02845_case_089", "p02845_case_090", "p02845_case_091", "p02845_case_092", "p02845_case_093", "p02845_case_094", "p02845_case_095", "p02845_case_096", "p02845_case_097", "p02845_case_098", "p02845_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\ninput = sys.stdin.readline\n\n\ndef INT():\n return int(eval(input()))\n\n\ndef MAP():\n return list(map(int, input().split()))\n\n\ndef LI():\n return list(map(int, input().split()))\n\n\ndef main():\n N = INT()\n A = LI()\n RGB = [0, 0, 0]\n answer = 1\n MOD = 10**9 + 7\n for i in range(N):\n if RGB.count(A[i]) == 0:\n print((0))\n return\n answer *= RGB.count(A[i])\n answer %= MOD\n for j in range(3):\n if RGB[j] == A[i]:\n RGB[j] += 1\n break\n print(answer)\n return\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "6a673be8c03527e4a1ed9a0f8efb9ff36f0452259cbf4007bf34e814444acb12", "fast_id": "p02845_539c1c8885a18af708a52f7f76914910c17b99bc6395ef1790e97f0db2c5899c", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "#!/usr/bin/env python3\nimport sys\n\ninput = sys.stdin.readline\n\n\ndef INT():\n return int(eval(input()))\n\n\ndef MAP():\n return list(map(int, input().split()))\n\n\ndef LI():\n return list(map(int, input().split()))\n\n\ndef main():\n N = INT()\n A = LI()\n RGB = [0, 0, 0]\n answer = 1\n MOD = 10**9 + 7\n for i in range(N):\n if RGB.count(A[i]) == 0:\n print((0))\n return\n answer *= RGB.count(A[i])\n answer %= MOD\n for j in range(3):\n if RGB[j] == A[i]:\n RGB[j] += 1\n break\n print(answer)\n return\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "539c1c8885a18af708a52f7f76914910c17b99bc6395ef1790e97f0db2c5899c", "measured_slow_code": "_, a = open(0)\nc = 1\nd = [3] + [0] * 10**6\nfor a in map(int, a.split()):\n c = c * d[a] % (10**9 + 7)\n d[a] -= 1\n d[a + 1] += 1\nprint(c)\n", "measured_slow_code_sha256": "44f76311477519e453c1541c8cee2cad565caf5c7e854c8feade8f7c7a67fffd", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 14.089771193276693, "pair_id": "python_v2_39ae16a2a262057b1c91c05e", "per_case_slow_code_faster_fraction": 0.02, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02845", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02845_539c1c8885a18af708a52f7f76914910c17b99bc6395ef1790e97f0db2c5899c.jsonl.gz", "inputs": "reproduction/python/inputs/p02845.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02845_44f76311477519e453c1541c8cee2cad565caf5c7e854c8feade8f7c7a67fffd.jsonl.gz"}, "slow_code": "_, a = open(0)\nc = 1\nd = [3] + [0] * 10**6\nfor a in map(int, a.split()):\n c = c * d[a] % (10**9 + 7)\n d[a] -= 1\n d[a + 1] += 1\nprint(c)\n", "slow_code_sha256": "44f76311477519e453c1541c8cee2cad565caf5c7e854c8feade8f7c7a67fffd", "slow_id": "p02845_44f76311477519e453c1541c8cee2cad565caf5c7e854c8feade8f7c7a67fffd", "speedup": 10.201011112451203, "stratum": "8+", "within_pair_jaccard": 0.2727272727272727, "workload": {"case_count": 100, "description": "N people stand in order. Person i reports A_i earlier people wearing their own hat color. Count assignments of red, blue or green hats satisfying all reports, modulo 1000000007. Observed inputs: N=1..100000 (median 1000); A_i=0..99998.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 588893, "median": 3611.5, "min": 4}, "input_format": ["N\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100001, "median": 1001.0, "min": 2}}} -{"case_ids": ["p03649_case_000", "p03649_case_001", "p03649_case_002", "p03649_case_003", "p03649_case_004", "p03649_case_005", "p03649_case_006", "p03649_case_007", "p03649_case_008", "p03649_case_009", "p03649_case_010", "p03649_case_011", "p03649_case_012", "p03649_case_013", "p03649_case_014", "p03649_case_015", "p03649_case_016", "p03649_case_017", "p03649_case_018", "p03649_case_019", "p03649_case_020", "p03649_case_021", "p03649_case_022", "p03649_case_023", "p03649_case_024", "p03649_case_025", "p03649_case_026", "p03649_case_027", "p03649_case_028", "p03649_case_029", "p03649_case_030", "p03649_case_031", "p03649_case_032", "p03649_case_033", "p03649_case_034", "p03649_case_035", "p03649_case_036", "p03649_case_037", "p03649_case_038", "p03649_case_039", "p03649_case_040", "p03649_case_041", "p03649_case_042", "p03649_case_043", "p03649_case_044", "p03649_case_045", "p03649_case_046", "p03649_case_047", "p03649_case_048", "p03649_case_049", "p03649_case_050", "p03649_case_051", "p03649_case_052", "p03649_case_053", "p03649_case_054", "p03649_case_055", "p03649_case_056", "p03649_case_057", "p03649_case_058", "p03649_case_059", "p03649_case_060", "p03649_case_061", "p03649_case_062", "p03649_case_063", "p03649_case_064", "p03649_case_065", "p03649_case_066", "p03649_case_067", "p03649_case_068", "p03649_case_069", "p03649_case_070", "p03649_case_071", "p03649_case_072", "p03649_case_073", "p03649_case_074", "p03649_case_075", "p03649_case_076", "p03649_case_077", "p03649_case_078", "p03649_case_079", "p03649_case_080", "p03649_case_081", "p03649_case_082", "p03649_case_083", "p03649_case_084", "p03649_case_085", "p03649_case_086", "p03649_case_087", "p03649_case_088", "p03649_case_089", "p03649_case_090", "p03649_case_091", "p03649_case_092", "p03649_case_093", "p03649_case_094", "p03649_case_095", "p03649_case_096", "p03649_case_097", "p03649_case_098", "p03649_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\na = list(map(int, input().split()))\nans = 0\nwhile True:\n tmp = 0\n for i in range(n):\n k = -(-(a[i] + 1) // n) - 1\n tmp += k\n a[i] -= k * n\n a[i] -= k\n for i in range(n):\n a[i] += tmp\n if not tmp:\n break\n ans += tmp\nprint(ans)\n", "fast_code_sha256": "2890f8e8770efed4f9c4bcfae3a889c8fe41634ad1976e117b0b362228e642bd", "fast_id": "p03649_2890f8e8770efed4f9c4bcfae3a889c8fe41634ad1976e117b0b362228e642bd", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\na = list(map(int, input().split()))\nans = 0\nwhile True:\n tmp = 0\n for i in range(n):\n k = -(-(a[i] + 1) // n) - 1\n tmp += k\n a[i] -= k * n\n a[i] -= k\n for i in range(n):\n a[i] += tmp\n if not tmp:\n break\n ans += tmp\nprint(ans)\n", "measured_fast_code_sha256": "2890f8e8770efed4f9c4bcfae3a889c8fe41634ad1976e117b0b362228e642bd", "measured_slow_code": "n = int(eval(input()))\na = list(map(int, input().split()))\ni = 0\nans = 0\nwhile max(a) >= n:\n if a[i] >= n:\n cnt = a[i] // n\n ans += cnt\n a[i] -= n * cnt\n for j in range(n):\n if j == i:\n continue\n a[j] += cnt\n i = (i + 1) % n\nprint(ans)\n", "measured_slow_code_sha256": "be5e31e4c6feb72123adbbca7a7fea964a379f99b17930aa063ffddf54a34a24", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.0544473302426702, "pair_id": "python_v2_b3d9f7fc9408aa856846393d", "per_case_slow_code_faster_fraction": 0.2, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03649", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03649_2890f8e8770efed4f9c4bcfae3a889c8fe41634ad1976e117b0b362228e642bd.jsonl.gz", "inputs": "reproduction/python/inputs/p03649.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03649_be5e31e4c6feb72123adbbca7a7fea964a379f99b17930aa063ffddf54a34a24.jsonl.gz"}, "slow_code": "n = int(eval(input()))\na = list(map(int, input().split()))\ni = 0\nans = 0\nwhile max(a) >= n:\n if a[i] >= n:\n cnt = a[i] // n\n ans += cnt\n a[i] -= n * cnt\n for j in range(n):\n if j == i:\n continue\n a[j] += cnt\n i = (i + 1) % n\nprint(ans)\n", "slow_code_sha256": "be5e31e4c6feb72123adbbca7a7fea964a379f99b17930aa063ffddf54a34a24", "slow_id": "p03649_be5e31e4c6feb72123adbbca7a7fea964a379f99b17930aa063ffddf54a34a24", "speedup": 2.4972781417749514, "stratum": "2-4", "within_pair_jaccard": 0.6666666666666666, "workload": {"case_count": 100, "description": "While the largest array entry is at least N, choose one maximum entry, subtract N from it, and add 1 to every other entry. Count operations until all entries are below N. Initial values are nonnegative. Observed inputs: N=2..50 (median 20); a_i=0..10000000000001000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 903, "median": 147.5, "min": 6}, "input_format": ["N\na_1 ... a_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 51, "median": 21.0, "min": 3}}} -{"case_ids": ["p03816_case_000", "p03816_case_001", "p03816_case_002", "p03816_case_003", "p03816_case_004", "p03816_case_005", "p03816_case_006", "p03816_case_007", "p03816_case_008", "p03816_case_009", "p03816_case_010", "p03816_case_011", "p03816_case_012", "p03816_case_013", "p03816_case_014", "p03816_case_015", "p03816_case_016", "p03816_case_017", "p03816_case_018", "p03816_case_019", "p03816_case_020", "p03816_case_021", "p03816_case_022", "p03816_case_023", "p03816_case_024", "p03816_case_025", "p03816_case_026", "p03816_case_027", "p03816_case_028", "p03816_case_029", "p03816_case_030", "p03816_case_031", "p03816_case_032", "p03816_case_033", "p03816_case_034", "p03816_case_035", "p03816_case_036", "p03816_case_037", "p03816_case_038", "p03816_case_039", "p03816_case_040", "p03816_case_041", "p03816_case_042", "p03816_case_043", "p03816_case_044", "p03816_case_045", "p03816_case_046", "p03816_case_047", "p03816_case_048", "p03816_case_049", "p03816_case_050", "p03816_case_051", "p03816_case_052", "p03816_case_053", "p03816_case_054", "p03816_case_055", "p03816_case_056", "p03816_case_057", "p03816_case_058", "p03816_case_059", "p03816_case_060", "p03816_case_061", "p03816_case_062", "p03816_case_063", "p03816_case_064", "p03816_case_065", "p03816_case_066", "p03816_case_067", "p03816_case_068", "p03816_case_069", "p03816_case_070", "p03816_case_071", "p03816_case_072", "p03816_case_073", "p03816_case_074", "p03816_case_075", "p03816_case_076", "p03816_case_077", "p03816_case_078", "p03816_case_079", "p03816_case_080", "p03816_case_081", "p03816_case_082", "p03816_case_083", "p03816_case_084", "p03816_case_085", "p03816_case_086", "p03816_case_087", "p03816_case_088", "p03816_case_089", "p03816_case_090", "p03816_case_091", "p03816_case_092", "p03816_case_093", "p03816_case_094", "p03816_case_095", "p03816_case_096", "p03816_case_097", "p03816_case_098", "p03816_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from collections import Counter\n\nN = int(eval(input()))\na = list(map(int, input().split(\" \")))\nc = Counter(a)\nref = [v - 1 for k, v in list(c.items()) if v != 1]\nans = N - ((sum(ref) + 1) // 2) * 2\nprint(ans)\n", "fast_code_sha256": "6e83d4816cef74d527e6d07a4e5a3e127a37b50a90f7e25d633eb5dd28f4f004", "fast_id": "p03816_6e83d4816cef74d527e6d07a4e5a3e127a37b50a90f7e25d633eb5dd28f4f004", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from collections import Counter\n\nN = int(eval(input()))\na = list(map(int, input().split(\" \")))\nc = Counter(a)\nref = [v - 1 for k, v in list(c.items()) if v != 1]\nans = N - ((sum(ref) + 1) // 2) * 2\nprint(ans)\n", "measured_fast_code_sha256": "6e83d4816cef74d527e6d07a4e5a3e127a37b50a90f7e25d633eb5dd28f4f004", "measured_slow_code": "import functools\n\nN = int(eval(input()))\nA = list(map(int, input().split()))\nd = [0 for i in range(10**5 + 1)]\nfor a in A:\n d[a] = 1\ns = sum(d)\nprint((s - (0 if s % 2 else 1)))\n", "measured_slow_code_sha256": "d753095d0d960364791984f90dbd9b20563bbbee29b58abd2419ff94d69b471b", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.904334941342475, "pair_id": "python_v2_4cbb3951725e2d0a9e52b4d2", "per_case_slow_code_faster_fraction": 0.25, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03816", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03816_6e83d4816cef74d527e6d07a4e5a3e127a37b50a90f7e25d633eb5dd28f4f004.jsonl.gz", "inputs": "reproduction/python/inputs/p03816.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03816_d753095d0d960364791984f90dbd9b20563bbbee29b58abd2419ff94d69b471b.jsonl.gz"}, "slow_code": "import functools\n\nN = int(eval(input()))\nA = list(map(int, input().split()))\nd = [0 for i in range(10**5 + 1)]\nfor a in A:\n d[a] = 1\ns = sum(d)\nprint((s - (0 if s % 2 else 1)))\n", "slow_code_sha256": "d753095d0d960364791984f90dbd9b20563bbbee29b58abd2419ff94d69b471b", "slow_id": "p03816_d753095d0d960364791984f90dbd9b20563bbbee29b58abd2419ff94d69b471b", "speedup": 7.189825762382228, "stratum": "4-8", "within_pair_jaccard": 0.42857142857142855, "workload": {"case_count": 100, "description": "From an odd-sized deck, repeatedly choose three arbitrary cards, discard a largest and a smallest, and return the remaining card. Maximize the number left with all values pairwise distinct. Zero operations are allowed. Observed inputs: N=3..99999 (median 12345); A_i=1..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 600000, "median": 72946.5, "min": 17}, "input_format": ["N\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100000, "median": 12346.0, "min": 4}}} -{"case_ids": ["p02804_case_000", "p02804_case_001", "p02804_case_002", "p02804_case_003", "p02804_case_004", "p02804_case_005", "p02804_case_006", "p02804_case_007", "p02804_case_008", "p02804_case_009", "p02804_case_010", "p02804_case_011", "p02804_case_012", "p02804_case_013", "p02804_case_014", "p02804_case_015", "p02804_case_016", "p02804_case_017", "p02804_case_018", "p02804_case_019", "p02804_case_020", "p02804_case_021", "p02804_case_022", "p02804_case_023", "p02804_case_024", "p02804_case_025", "p02804_case_026", "p02804_case_027", "p02804_case_028", "p02804_case_029", "p02804_case_030", "p02804_case_031", "p02804_case_032", "p02804_case_033", "p02804_case_034", "p02804_case_035", "p02804_case_036", "p02804_case_037", "p02804_case_038", "p02804_case_039", "p02804_case_040", "p02804_case_041", "p02804_case_042", "p02804_case_043", "p02804_case_044", "p02804_case_045", "p02804_case_046", "p02804_case_047", "p02804_case_048", "p02804_case_049", "p02804_case_050", "p02804_case_051", "p02804_case_052", "p02804_case_053", "p02804_case_054", "p02804_case_055", "p02804_case_056", "p02804_case_057", "p02804_case_058", "p02804_case_059", "p02804_case_060", "p02804_case_061", "p02804_case_062", "p02804_case_063", "p02804_case_064", "p02804_case_065", "p02804_case_066", "p02804_case_067", "p02804_case_068", "p02804_case_069", "p02804_case_070", "p02804_case_071", "p02804_case_072", "p02804_case_073", "p02804_case_074", "p02804_case_075", "p02804_case_076", "p02804_case_077", "p02804_case_078", "p02804_case_079", "p02804_case_080", "p02804_case_081", "p02804_case_082", "p02804_case_083", "p02804_case_084", "p02804_case_085", "p02804_case_086", "p02804_case_087", "p02804_case_088", "p02804_case_089", "p02804_case_090", "p02804_case_091", "p02804_case_092", "p02804_case_093", "p02804_case_094", "p02804_case_095", "p02804_case_096", "p02804_case_097", "p02804_case_098", "p02804_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n, k = list(map(int, input().split()))\nA = list(map(int, input().split()))\nmod = 10**9 + 7\nN = 10**5 + 50\nfac = [1] * (N + 1)\nfinv = [1] * (N + 1)\nfor i in range(N):\n fac[i + 1] = fac[i] * (i + 1) % mod\nfinv[-1] = pow(fac[-1], mod - 2, mod)\nfor i in reversed(list(range(N))):\n finv[i] = finv[i + 1] * (i + 1) % mod\n\n\ndef cmb1(n, r, mod):\n if r < 0 or r > n:\n return 0\n r = min(r, n - r)\n return fac[n] * finv[r] * finv[n - r] % mod\n\n\nA.sort()\nans = 0\nfor i, a in enumerate(A):\n M = n - 1 - i\n m = i\n if m >= 0:\n ans += a * cmb1(m, k - 1, mod)\n if M >= 0:\n ans -= a * cmb1(M, k - 1, mod)\nans %= mod\nprint(ans)\n", "fast_code_sha256": "28fd6b5b96432fbebbbf8df390d378ed81b231b8e2ec65a8cc6786f802c9c09e", "fast_id": "p02804_28fd6b5b96432fbebbbf8df390d378ed81b231b8e2ec65a8cc6786f802c9c09e", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n, k = list(map(int, input().split()))\nA = list(map(int, input().split()))\nmod = 10**9 + 7\nN = 10**5 + 50\nfac = [1] * (N + 1)\nfinv = [1] * (N + 1)\nfor i in range(N):\n fac[i + 1] = fac[i] * (i + 1) % mod\nfinv[-1] = pow(fac[-1], mod - 2, mod)\nfor i in reversed(list(range(N))):\n finv[i] = finv[i + 1] * (i + 1) % mod\n\n\ndef cmb1(n, r, mod):\n if r < 0 or r > n:\n return 0\n r = min(r, n - r)\n return fac[n] * finv[r] * finv[n - r] % mod\n\n\nA.sort()\nans = 0\nfor i, a in enumerate(A):\n M = n - 1 - i\n m = i\n if m >= 0:\n ans += a * cmb1(m, k - 1, mod)\n if M >= 0:\n ans -= a * cmb1(M, k - 1, mod)\nans %= mod\nprint(ans)\n", "measured_fast_code_sha256": "28fd6b5b96432fbebbbf8df390d378ed81b231b8e2ec65a8cc6786f802c9c09e", "measured_slow_code": "N_MAX = 10**6\nMOD = 10**9 + 7\nfac, finv, inv = [0] * N_MAX, [0] * N_MAX, [0] * N_MAX\n\n\ndef com_init():\n fac[0], fac[1] = 1, 1\n finv[0], finv[1] = 1, 1\n inv[1] = 1\n for i in range(2, N_MAX):\n fac[i] = fac[i - 1] * i % MOD\n inv[i] = MOD - inv[MOD % i] * (MOD // i) % MOD\n finv[i] = finv[i - 1] * inv[i] % MOD\n\n\ndef com(n, k):\n if n < k:\n return 0\n if n < 0 or k < 0:\n return 0\n return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD\n\n\nn, k = list(map(int, input().split()))\nal = list(map(int, input().split()))\ncom_init()\nal.sort()\nans_max = 0\nans_min = 0\nfor i, a in enumerate(al):\n ans_max += a * com(i, k - 1)\n ans_max %= MOD\n ans_min += a * com(n - 1 - i, k - 1)\n ans_min %= MOD\nprint(((ans_max - ans_min) % MOD))\n", "measured_slow_code_sha256": "7a118ce2764a5719ed366c9c22ffc653766a914f4a46e16d4f0cdc6623af51e1", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 10.985694749045042, "pair_id": "python_v2_6fbca4b7422d8464f8471018", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02804", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02804_28fd6b5b96432fbebbbf8df390d378ed81b231b8e2ec65a8cc6786f802c9c09e.jsonl.gz", "inputs": "reproduction/python/inputs/p02804.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02804_7a118ce2764a5719ed366c9c22ffc653766a914f4a46e16d4f0cdc6623af51e1.jsonl.gz"}, "slow_code": "N_MAX = 10**6\nMOD = 10**9 + 7\nfac, finv, inv = [0] * N_MAX, [0] * N_MAX, [0] * N_MAX\n\n\ndef com_init():\n fac[0], fac[1] = 1, 1\n finv[0], finv[1] = 1, 1\n inv[1] = 1\n for i in range(2, N_MAX):\n fac[i] = fac[i - 1] * i % MOD\n inv[i] = MOD - inv[MOD % i] * (MOD // i) % MOD\n finv[i] = finv[i - 1] * inv[i] % MOD\n\n\ndef com(n, k):\n if n < k:\n return 0\n if n < 0 or k < 0:\n return 0\n return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD\n\n\nn, k = list(map(int, input().split()))\nal = list(map(int, input().split()))\ncom_init()\nal.sort()\nans_max = 0\nans_min = 0\nfor i, a in enumerate(al):\n ans_max += a * com(i, k - 1)\n ans_max %= MOD\n ans_min += a * com(n - 1 - i, k - 1)\n ans_min %= MOD\nprint(((ans_max - ans_min) % MOD))\n", "slow_code_sha256": "7a118ce2764a5719ed366c9c22ffc653766a914f4a46e16d4f0cdc6623af51e1", "slow_id": "p02804_7a118ce2764a5719ed366c9c22ffc653766a914f4a46e16d4f0cdc6623af51e1", "speedup": 7.58208278260213, "stratum": "4-8", "within_pair_jaccard": 0.5510204081632653, "workload": {"case_count": 100, "description": "For every choice of K distinct indices among N array positions, take the largest selected value minus the smallest. Sum these differences modulo 1000000007. Equal values at different indices are distinct choices. Observed inputs: N=1..100000 (median 100); K=1..100000 (median 5); A_i=-1000000000..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1200009, "median": 1046.0, "min": 10}, "input_format": ["N K\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100002, "median": 102.0, "min": 3}}} -{"case_ids": ["p03598_case_000", "p03598_case_001", "p03598_case_002", "p03598_case_003", "p03598_case_004", "p03598_case_005", "p03598_case_006", "p03598_case_007", "p03598_case_008", "p03598_case_009", "p03598_case_010", "p03598_case_011", "p03598_case_012", "p03598_case_013", "p03598_case_014", "p03598_case_015", "p03598_case_016", "p03598_case_017", "p03598_case_018", "p03598_case_019", "p03598_case_020", "p03598_case_021", "p03598_case_022", "p03598_case_023", "p03598_case_024", "p03598_case_025", "p03598_case_026", "p03598_case_027", "p03598_case_028", "p03598_case_029", "p03598_case_030", "p03598_case_031", "p03598_case_032", "p03598_case_033", "p03598_case_034", "p03598_case_035", "p03598_case_036", "p03598_case_037", "p03598_case_038", "p03598_case_039", "p03598_case_040", "p03598_case_041", "p03598_case_042", "p03598_case_043", "p03598_case_044", "p03598_case_045", "p03598_case_046", "p03598_case_047", "p03598_case_048", "p03598_case_049", "p03598_case_050", "p03598_case_051", "p03598_case_052", "p03598_case_053", "p03598_case_054", "p03598_case_055", "p03598_case_056", "p03598_case_057", "p03598_case_058", "p03598_case_059", "p03598_case_060", "p03598_case_061", "p03598_case_062", "p03598_case_063", "p03598_case_064", "p03598_case_065", "p03598_case_066", "p03598_case_067", "p03598_case_068", "p03598_case_069", "p03598_case_070", "p03598_case_071", "p03598_case_072", "p03598_case_073", "p03598_case_074", "p03598_case_075", "p03598_case_076", "p03598_case_077", "p03598_case_078", "p03598_case_079", "p03598_case_080", "p03598_case_081", "p03598_case_082", "p03598_case_083", "p03598_case_084", "p03598_case_085", "p03598_case_086", "p03598_case_087", "p03598_case_088", "p03598_case_089", "p03598_case_090", "p03598_case_091", "p03598_case_092", "p03598_case_093", "p03598_case_094", "p03598_case_095", "p03598_case_096", "p03598_case_097", "p03598_case_098", "p03598_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "_, k, t = open(0)\nprint((sum(min(x, int(k) - x) * 2 for x in map(int, t.split()))))\n", "fast_code_sha256": "84ef7cbc87bcf5fe8188260d7b059ec3fa8009bce6b870d7fabc70f1bbd82067", "fast_id": "p03598_84ef7cbc87bcf5fe8188260d7b059ec3fa8009bce6b870d7fabc70f1bbd82067", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "_, k, t = open(0)\nprint((sum(min(x, int(k) - x) * 2 for x in map(int, t.split()))))\n", "measured_fast_code_sha256": "84ef7cbc87bcf5fe8188260d7b059ec3fa8009bce6b870d7fabc70f1bbd82067", "measured_slow_code": "# Author: cr4zjh0bp\n# Created: Sat Mar 14 11:48:11 UTC 2020\nimport sys\n\nstdin = sys.stdin\ninf = 1 << 60\nmod = 1000000007\nni = lambda: int(ns())\nnin = lambda y: [ni() for _ in range(y)]\nna = lambda: list(map(int, stdin.readline().split()))\nnan = lambda y: [na() for _ in range(y)]\nnf = lambda: float(ns())\nnfn = lambda y: [nf() for _ in range(y)]\nnfa = lambda: list(map(float, stdin.readline().split()))\nnfan = lambda y: [nfa() for _ in range(y)]\nns = lambda: stdin.readline().rstrip()\nnsn = lambda y: [ns() for _ in range(y)]\nncl = lambda y: [list(ns()) for _ in range(y)]\nnas = lambda: stdin.readline().split()\nn, k = nin(2)\nx = na()\nans = 0\nfor i in range(n):\n ans += min(abs(x[i] - k) * 2, abs(x[i]) * 2)\nprint(ans)\n", "measured_slow_code_sha256": "4242b0111d34ac29f247349e2dd3df5bbea3d003d38a638f0ec7f046c27e0435", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.997858031570261, "pair_id": "python_v2_0ac80d56fd8b4a1d0d546c9d", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03598", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03598_84ef7cbc87bcf5fe8188260d7b059ec3fa8009bce6b870d7fabc70f1bbd82067.jsonl.gz", "inputs": "reproduction/python/inputs/p03598.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03598_4242b0111d34ac29f247349e2dd3df5bbea3d003d38a638f0ec7f046c27e0435.jsonl.gz"}, "slow_code": "import sys\n\nstdin = sys.stdin\ninf = 1 << 60\nmod = 1000000007\nni = lambda: int(ns())\nnin = lambda y: [ni() for _ in range(y)]\nna = lambda: list(map(int, stdin.readline().split()))\nnan = lambda y: [na() for _ in range(y)]\nnf = lambda: float(ns())\nnfn = lambda y: [nf() for _ in range(y)]\nnfa = lambda: list(map(float, stdin.readline().split()))\nnfan = lambda y: [nfa() for _ in range(y)]\nns = lambda: stdin.readline().rstrip()\nnsn = lambda y: [ns() for _ in range(y)]\nncl = lambda y: [list(ns()) for _ in range(y)]\nnas = lambda: stdin.readline().split()\nn, k = nin(2)\nx = na()\nans = 0\nfor i in range(n):\n ans += min(abs(x[i] - k) * 2, abs(x[i]) * 2)\nprint(ans)\n", "slow_code_sha256": "b56139331cede5dfee10d7e57ba4d3e5fe70d638b0a7d7343d69614e13c21b14", "slow_id": "p03598_4242b0111d34ac29f247349e2dd3df5bbea3d003d38a638f0ec7f046c27e0435", "speedup": 3.5462696661729467, "stratum": "2-4", "within_pair_jaccard": 0.2608695652173913, "workload": {"case_count": 100, "description": "For each ball at (x_i,i), choose a robot from (0,i) or (K,i) to collect it and return to that endpoint. Minimize total travel distance over all N balls; every x_i lies strictly between 0 and K. Observed inputs: N=1..100 (median 89); K=2..100 (median 73); x_i=1..99.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 308, "median": 206.0, "min": 6}, "input_format": ["N\nK\nx_1 ... x_N"], "input_format_status": "source_input_section", "input_lines": {"max": 3, "median": 3.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 102, "median": 91.0, "min": 3}}} -{"case_ids": ["p03288_case_000", "p03288_case_001", "p03288_case_002", "p03288_case_003", "p03288_case_004", "p03288_case_005", "p03288_case_006", "p03288_case_007", "p03288_case_008", "p03288_case_009", "p03288_case_010", "p03288_case_011", "p03288_case_012", "p03288_case_013", "p03288_case_014", "p03288_case_015", "p03288_case_016", "p03288_case_017", "p03288_case_018", "p03288_case_019", "p03288_case_020", "p03288_case_021", "p03288_case_022", "p03288_case_023", "p03288_case_024", "p03288_case_025", "p03288_case_026", "p03288_case_027", "p03288_case_028", "p03288_case_029", "p03288_case_030", "p03288_case_031", "p03288_case_032", "p03288_case_033", "p03288_case_034", "p03288_case_035", "p03288_case_036", "p03288_case_037", "p03288_case_038", "p03288_case_039", "p03288_case_040", "p03288_case_041", "p03288_case_042", "p03288_case_043", "p03288_case_044", "p03288_case_045", "p03288_case_046", "p03288_case_047", "p03288_case_048", "p03288_case_049", "p03288_case_050", "p03288_case_051", "p03288_case_052", "p03288_case_053", "p03288_case_054", "p03288_case_055", "p03288_case_056", "p03288_case_057", "p03288_case_058", "p03288_case_059", "p03288_case_060", "p03288_case_061", "p03288_case_062", "p03288_case_063", "p03288_case_064", "p03288_case_065", "p03288_case_066", "p03288_case_067", "p03288_case_068", "p03288_case_069", "p03288_case_070", "p03288_case_071", "p03288_case_072", "p03288_case_073", "p03288_case_074", "p03288_case_075", "p03288_case_076", "p03288_case_077", "p03288_case_078", "p03288_case_079", "p03288_case_080", "p03288_case_081", "p03288_case_082", "p03288_case_083", "p03288_case_084", "p03288_case_085", "p03288_case_086", "p03288_case_087", "p03288_case_088", "p03288_case_089", "p03288_case_090", "p03288_case_091", "p03288_case_092", "p03288_case_093", "p03288_case_094", "p03288_case_095", "p03288_case_096", "p03288_case_097", "p03288_case_098", "p03288_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "rating = int(eval(input()))\nif rating < 1200:\n print(\"ABC\")\nelif 1200 <= rating < 2800:\n print(\"ARC\")\nelif rating >= 2800:\n print(\"AGC\")\n", "fast_code_sha256": "12f19819dd3968ad623af74c832313adcd7db9626d7b7db6084c3833342f54a5", "fast_id": "p03288_12f19819dd3968ad623af74c832313adcd7db9626d7b7db6084c3833342f54a5", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "rating = int(eval(input()))\nif rating < 1200:\n print(\"ABC\")\nelif 1200 <= rating < 2800:\n print(\"ARC\")\nelif rating >= 2800:\n print(\"AGC\")\n", "measured_fast_code_sha256": "12f19819dd3968ad623af74c832313adcd7db9626d7b7db6084c3833342f54a5", "measured_slow_code": "import bisect, collections, copy, heapq, itertools, math, string\nimport sys\n\n\ndef S():\n return sys.stdin.readline().rstrip()\n\n\ndef M():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef LS():\n return list(sys.stdin.readline().rstrip().split())\n\n\nR = I()\nif R < 1200:\n print(\"ABC\")\nelif R < 2800:\n print(\"ARC\")\nelse:\n print(\"AGC\")\n", "measured_slow_code_sha256": "4b19a6c66c6b24c9d371f629b6a683da99f61809c1d26fcff1386ca6548060d5", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 24.589999961227484, "pair_id": "python_v2_9fbcf3aab15354622900702c", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03288", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03288_12f19819dd3968ad623af74c832313adcd7db9626d7b7db6084c3833342f54a5.jsonl.gz", "inputs": "reproduction/python/inputs/p03288.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03288_4b19a6c66c6b24c9d371f629b6a683da99f61809c1d26fcff1386ca6548060d5.jsonl.gz"}, "slow_code": "import bisect, collections, copy, heapq, itertools, math, string\nimport sys\n\n\ndef S():\n return sys.stdin.readline().rstrip()\n\n\ndef M():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef LS():\n return list(sys.stdin.readline().rstrip().split())\n\n\nR = I()\nif R < 1200:\n print(\"ABC\")\nelif R < 2800:\n print(\"ARC\")\nelse:\n print(\"AGC\")\n", "slow_code_sha256": "4b19a6c66c6b24c9d371f629b6a683da99f61809c1d26fcff1386ca6548060d5", "slow_id": "p03288_4b19a6c66c6b24c9d371f629b6a683da99f61809c1d26fcff1386ca6548060d5", "speedup": 24.59709070647773, "stratum": "8+", "within_pair_jaccard": 0.25, "workload": {"case_count": 100, "description": "Choose the next eligible category from three ordered categories: the first requires rating below 1200, the second below 2800, and the third accepts every rating. Observed inputs: R=0..4208 (median 1199.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 5, "median": 5.0, "min": 2}, "input_format": ["R"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p02681_case_000", "p02681_case_001", "p02681_case_002", "p02681_case_003", "p02681_case_004", "p02681_case_005", "p02681_case_006", "p02681_case_007", "p02681_case_008", "p02681_case_009", "p02681_case_010", "p02681_case_011", "p02681_case_012", "p02681_case_013", "p02681_case_014", "p02681_case_015", "p02681_case_016", "p02681_case_017", "p02681_case_018", "p02681_case_019", "p02681_case_020", "p02681_case_021", "p02681_case_022", "p02681_case_023", "p02681_case_024", "p02681_case_025", "p02681_case_026", "p02681_case_027", "p02681_case_028", "p02681_case_029", "p02681_case_030", "p02681_case_031", "p02681_case_032", "p02681_case_033", "p02681_case_034", "p02681_case_035", "p02681_case_036", "p02681_case_037", "p02681_case_038", "p02681_case_039", "p02681_case_040", "p02681_case_041", "p02681_case_042", "p02681_case_043", "p02681_case_044", "p02681_case_045", "p02681_case_046", "p02681_case_047", "p02681_case_048", "p02681_case_049", "p02681_case_050", "p02681_case_051", "p02681_case_052", "p02681_case_053", "p02681_case_054", "p02681_case_055", "p02681_case_056", "p02681_case_057", "p02681_case_058", "p02681_case_059", "p02681_case_060", "p02681_case_061", "p02681_case_062", "p02681_case_063", "p02681_case_064", "p02681_case_065", "p02681_case_066", "p02681_case_067", "p02681_case_068", "p02681_case_069", "p02681_case_070", "p02681_case_071", "p02681_case_072", "p02681_case_073", "p02681_case_074", "p02681_case_075", "p02681_case_076", "p02681_case_077", "p02681_case_078", "p02681_case_079", "p02681_case_080", "p02681_case_081", "p02681_case_082", "p02681_case_083", "p02681_case_084", "p02681_case_085", "p02681_case_086", "p02681_case_087", "p02681_case_088", "p02681_case_089", "p02681_case_090", "p02681_case_091", "p02681_case_092", "p02681_case_093", "p02681_case_094", "p02681_case_095", "p02681_case_096", "p02681_case_097", "p02681_case_098", "p02681_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "s = input()\nt = input()\nprint(\"Yes\") if t == s + t[-1] else print(\"No\")\n", "fast_code_sha256": "65656aa9840feee1b9dbc9331beceb30a0d208678996748f9638072a52c69443", "fast_id": "p02681_65656aa9840feee1b9dbc9331beceb30a0d208678996748f9638072a52c69443", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "s = input()\nt = input()\nprint(\"Yes\") if t == s + t[-1] else print(\"No\")\n", "measured_fast_code_sha256": "65656aa9840feee1b9dbc9331beceb30a0d208678996748f9638072a52c69443", "measured_slow_code": "#!/usr/bin/env python3\n# Generated by https://github.com/kyuridenamida/atcoder-tools\nfrom typing import *\nimport itertools\nimport math\nimport sys\n\nINF = float(\"inf\")\nYES = \"Yes\" # type: str\nNO = \"No\" # type: str\n\n\ndef solve(S: str, T: str):\n return [NO, YES][S == T[:-1]]\n\n\ndef main():\n sys.setrecursionlimit(10**6)\n\n def iterate_tokens():\n for line in sys.stdin:\n for word in line.split():\n yield word\n\n tokens = iterate_tokens()\n S = next(tokens) # type: str\n T = next(tokens) # type: str\n print((solve(S, T)))\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "e11f3e444910fe42a6baf012b95849e72747767315b4086506c83bd0c43f1245", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 44.20155705054849, "pair_id": "python_v2_4544929e0ba40a2e3b8a7b74", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02681", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02681_65656aa9840feee1b9dbc9331beceb30a0d208678996748f9638072a52c69443.jsonl.gz", "inputs": "reproduction/python/inputs/p02681.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02681_e11f3e444910fe42a6baf012b95849e72747767315b4086506c83bd0c43f1245.jsonl.gz"}, "slow_code": "from typing import *\nimport itertools\nimport math\nimport sys\n\nINF = float(\"inf\")\nYES = \"Yes\"\nNO = \"No\"\n\n\ndef solve(S: str, T: str):\n return [NO, YES][S == T[:-1]]\n\n\ndef main():\n sys.setrecursionlimit(10**6)\n\n def iterate_tokens():\n for line in sys.stdin:\n for word in line.split():\n yield word\n\n tokens = iterate_tokens()\n S = next(tokens)\n T = next(tokens)\n print((solve(S, T)))\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "aead1926afd539d76d7800cd27f3761ad24e19df52b7dacf9e4a54d6feb221d2", "slow_id": "p02681_e11f3e444910fe42a6baf012b95849e72747767315b4086506c83bd0c43f1245", "speedup": 44.18652873902622, "stratum": "8+", "within_pair_jaccard": 0.11904761904761904, "workload": {"case_count": 100, "description": "Determine whether lowercase string T can be obtained by appending exactly one lowercase letter to the end of S. T is guaranteed to have length |S|+1. Observed inputs: S_length=1..10 (median 5); T_length=2..11 (median 6).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 23, "median": 13.0, "min": 5}, "input_format": ["S\nT"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p04006_case_000", "p04006_case_001", "p04006_case_002", "p04006_case_003", "p04006_case_004", "p04006_case_005", "p04006_case_006", "p04006_case_007", "p04006_case_008", "p04006_case_009", "p04006_case_010", "p04006_case_011", "p04006_case_012", "p04006_case_013", "p04006_case_014", "p04006_case_015", "p04006_case_016", "p04006_case_017", "p04006_case_018", "p04006_case_019", "p04006_case_020", "p04006_case_021", "p04006_case_022", "p04006_case_023", "p04006_case_024", "p04006_case_025", "p04006_case_026", "p04006_case_027", "p04006_case_028", "p04006_case_029", "p04006_case_030", "p04006_case_031", "p04006_case_032", "p04006_case_033", "p04006_case_034", "p04006_case_035", "p04006_case_036", "p04006_case_037", "p04006_case_038", "p04006_case_039", "p04006_case_040", "p04006_case_041", "p04006_case_042", "p04006_case_043", "p04006_case_044", "p04006_case_045", "p04006_case_046", "p04006_case_047", "p04006_case_048", "p04006_case_049", "p04006_case_050", "p04006_case_051", "p04006_case_052", "p04006_case_053", "p04006_case_054", "p04006_case_055", "p04006_case_056", "p04006_case_057", "p04006_case_058", "p04006_case_059", "p04006_case_060", "p04006_case_061", "p04006_case_062", "p04006_case_063", "p04006_case_064", "p04006_case_065", "p04006_case_066", "p04006_case_067", "p04006_case_068", "p04006_case_069", "p04006_case_070", "p04006_case_071", "p04006_case_072", "p04006_case_073", "p04006_case_074", "p04006_case_075", "p04006_case_076", "p04006_case_077", "p04006_case_078", "p04006_case_079", "p04006_case_080", "p04006_case_081", "p04006_case_082", "p04006_case_083", "p04006_case_084", "p04006_case_085", "p04006_case_086", "p04006_case_087", "p04006_case_088", "p04006_case_089", "p04006_case_090", "p04006_case_091", "p04006_case_092", "p04006_case_093", "p04006_case_094", "p04006_case_095", "p04006_case_096", "p04006_case_097", "p04006_case_098"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 99, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n, x = [int(i) for i in input().split()]\nA = [int(i) for i in input().split()]\nB = A[:]\nans = sum(A)\nfor i in range(1, n):\n for j in range(n):\n B[j] = min(B[j], A[j - i])\n ans = min(ans, sum(B) + i * x)\nprint(ans)\n", "fast_code_sha256": "66246b4e7ebc7638aa6316cd1d0d04c5f1b9ee22288c88f749f852eeca0f1e44", "fast_id": "p04006_66246b4e7ebc7638aa6316cd1d0d04c5f1b9ee22288c88f749f852eeca0f1e44", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n, x = [int(i) for i in input().split()]\nA = [int(i) for i in input().split()]\nB = A[:]\nans = sum(A)\nfor i in range(1, n):\n for j in range(n):\n B[j] = min(B[j], A[j - i])\n ans = min(ans, sum(B) + i * x)\nprint(ans)\n", "measured_fast_code_sha256": "66246b4e7ebc7638aa6316cd1d0d04c5f1b9ee22288c88f749f852eeca0f1e44", "measured_slow_code": "import numpy as np\nfrom copy import deepcopy\n\nN, x = list(map(int, input().split()))\nA = list(map(int, input().split()))\n\n\ndef myfunc(N, x, A):\n B = deepcopy(np.array(A))\n m = sum(B)\n\n def apppop(A):\n A.append(A[0])\n A.pop(0)\n\n for idx in range(1, N):\n apppop(A)\n np.fmin(B, A, out=B)\n m = min(np.sum(B) + idx * x, m)\n print(int(m))\n\n\nmyfunc(N, x, A)\n", "measured_slow_code_sha256": "91e1e2c740659f8110b6da7065d298174d653edb3135242031e3d37884d00c98", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 0.39581213994969033, "pair_id": "python_v2_766b620de62a9b43d54272f6", "per_case_slow_code_faster_fraction": 0.5555555555555556, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p04006", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p04006_66246b4e7ebc7638aa6316cd1d0d04c5f1b9ee22288c88f749f852eeca0f1e44.jsonl.gz", "inputs": "reproduction/python/inputs/p04006.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p04006_91e1e2c740659f8110b6da7065d298174d653edb3135242031e3d37884d00c98.jsonl.gz"}, "slow_code": "import numpy as np\nfrom copy import deepcopy\n\nN, x = list(map(int, input().split()))\nA = list(map(int, input().split()))\n\n\ndef myfunc(N, x, A):\n B = deepcopy(np.array(A))\n m = sum(B)\n\n def apppop(A):\n A.append(A[0])\n A.pop(0)\n\n for idx in range(1, N):\n apppop(A)\n np.fmin(B, A, out=B)\n m = min(np.sum(B) + idx * x, m)\n print(int(m))\n\n\nmyfunc(N, x, A)\n", "slow_code_sha256": "91e1e2c740659f8110b6da7065d298174d653edb3135242031e3d37884d00c98", "slow_id": "p04006_91e1e2c740659f8110b6da7065d298174d653edb3135242031e3d37884d00c98", "speedup": 4.567423219173453, "stratum": "4-8", "within_pair_jaccard": 0.34210526315789475, "workload": {"case_count": 99, "description": "Starting with no slimes, acquire all N colors. Catching a missing color i costs a_i time; a spell costs x and rotates every held color i to i+1, wrapping N to 1. Minimize total time. Observed inputs: N=2..2000 (median 1000); x=1..1000000000; a_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 99, "input_bytes": {"max": 20015, "median": 5795, "min": 10}, "input_format": ["N x\na_1 ... a_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2002, "median": 1002, "min": 4}}} -{"case_ids": ["p03576_case_000", "p03576_case_001", "p03576_case_002", "p03576_case_003", "p03576_case_004", "p03576_case_005", "p03576_case_006", "p03576_case_007", "p03576_case_008", "p03576_case_009", "p03576_case_010", "p03576_case_011", "p03576_case_012", "p03576_case_013", "p03576_case_014", "p03576_case_015", "p03576_case_016", "p03576_case_017", "p03576_case_018", "p03576_case_019", "p03576_case_020", "p03576_case_021", "p03576_case_022", "p03576_case_023", "p03576_case_024", "p03576_case_025", "p03576_case_026", "p03576_case_027", "p03576_case_028", "p03576_case_029", "p03576_case_030", "p03576_case_031", "p03576_case_032", "p03576_case_033", "p03576_case_034", "p03576_case_035", "p03576_case_036", "p03576_case_037", "p03576_case_038", "p03576_case_039", "p03576_case_040", "p03576_case_041", "p03576_case_042", "p03576_case_043", "p03576_case_044", "p03576_case_045", "p03576_case_046", "p03576_case_047", "p03576_case_048", "p03576_case_049", "p03576_case_050", "p03576_case_051", "p03576_case_052", "p03576_case_053", "p03576_case_054", "p03576_case_055", "p03576_case_056", "p03576_case_057", "p03576_case_058", "p03576_case_059", "p03576_case_060", "p03576_case_061", "p03576_case_062", "p03576_case_063", "p03576_case_064", "p03576_case_065", "p03576_case_066", "p03576_case_067", "p03576_case_068", "p03576_case_069", "p03576_case_070", "p03576_case_071", "p03576_case_072", "p03576_case_073", "p03576_case_074", "p03576_case_075", "p03576_case_076", "p03576_case_077", "p03576_case_078", "p03576_case_079", "p03576_case_080", "p03576_case_081", "p03576_case_082", "p03576_case_083", "p03576_case_084", "p03576_case_085", "p03576_case_086", "p03576_case_087", "p03576_case_088", "p03576_case_089", "p03576_case_090", "p03576_case_091", "p03576_case_092", "p03576_case_093", "p03576_case_094", "p03576_case_095", "p03576_case_096", "p03576_case_097", "p03576_case_098", "p03576_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N, K = list(map(int, input().split()))\nXY = [list(map(int, input().split())) for _ in [0] * N]\niX = sorted(x for x, y in XY)\niY = sorted(y for x, y in XY)\nX = {x: i for i, x in enumerate(iX)}\nY = {y: i for i, y in enumerate(iY)}\nc = [[0] * (N + 1) for i in [0] * (N + 1)]\nfor x, y in XY:\n c[Y[y] + 1][X[x] + 1] = 1\nfor i in range(N):\n for j in range(N):\n c[i + 1][j + 1] += c[i + 1][j]\nfor i in range(N):\n for j in range(N):\n c[i + 1][j + 1] += c[i][j + 1]\nans = 10**20\nfor l in range(N):\n for r in range(l + 1, N):\n u = 0\n d = 1\n dX = iX[r] - iX[l]\n while d < N:\n if c[d + 1][r + 1] + c[u][l] - c[u][r + 1] - c[d + 1][l] >= K:\n ans = min(ans, dX * (iY[d] - iY[u]))\n u += 1\n else:\n d += 1\nprint(ans)\n", "fast_code_sha256": "146890d7ea4c911960fefc2e44f08fc85d507e64dfaaafffaee3a881578f824a", "fast_id": "p03576_146890d7ea4c911960fefc2e44f08fc85d507e64dfaaafffaee3a881578f824a", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N, K = list(map(int, input().split()))\nXY = [list(map(int, input().split())) for _ in [0] * N]\niX = sorted(x for x, y in XY)\niY = sorted(y for x, y in XY)\nX = {x: i for i, x in enumerate(iX)}\nY = {y: i for i, y in enumerate(iY)}\nc = [[0] * (N + 1) for i in [0] * (N + 1)]\nfor x, y in XY:\n c[Y[y] + 1][X[x] + 1] = 1\nfor i in range(N):\n for j in range(N):\n c[i + 1][j + 1] += c[i + 1][j]\nfor i in range(N):\n for j in range(N):\n c[i + 1][j + 1] += c[i][j + 1]\nans = 10**20\nfor l in range(N):\n for r in range(l + 1, N):\n u = 0\n d = 1\n dX = iX[r] - iX[l]\n while d < N:\n if c[d + 1][r + 1] + c[u][l] - c[u][r + 1] - c[d + 1][l] >= K:\n ans = min(ans, dX * (iY[d] - iY[u]))\n u += 1\n else:\n d += 1\nprint(ans)\n", "measured_fast_code_sha256": "146890d7ea4c911960fefc2e44f08fc85d507e64dfaaafffaee3a881578f824a", "measured_slow_code": "def acc2(grid):\n H = len(grid)\n W = len(grid[0])\n for i in range(H):\n for j in range(W - 1):\n grid[i][j + 1] += grid[i][j]\n for j in range(W):\n for i in range(H - 1):\n grid[i + 1][j] += grid[i][j]\n ngrid = [[0] * (W + 1)]\n for i in range(H):\n line = [0] + grid[i]\n ngrid.append(line)\n return ngrid\n\n\nfrom bisect import bisect_left\n\nN, K = list(map(int, input().split()))\nX = []\nY = []\ninfo = []\nfor i in range(N):\n x, y = list(map(int, input().split()))\n X.append(x)\n Y.append(y)\n info.append([x, y])\nX.sort()\nY.sort()\nacc = [[0] * (N) for i in range(N)]\nfor x, y in info:\n j = bisect_left(X, x)\n i = bisect_left(Y, y)\n acc[i][j] += 1\nacc = acc2(acc)\nans = float(\"inf\")\nfor t in range(N - 1):\n for b in range(t + 1, N):\n for l in range(N - 1):\n for r in range(l + 1, N):\n num = acc[b + 1][r + 1] - acc[b + 1][l] - acc[t][r + 1] + acc[t][l]\n if num < K:\n continue\n S = (Y[b] - Y[t]) * (X[r] - X[l])\n if S < ans:\n ans = S\nprint(ans)\n", "measured_slow_code_sha256": "8a3677d33ef94aa20c0d8f63278dc74d3213d7364e3053bc4f7e4d032ec4bddd", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 8.777741942002084, "pair_id": "python_v2_c8899fd42420041fa7b272d8", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03576", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03576_146890d7ea4c911960fefc2e44f08fc85d507e64dfaaafffaee3a881578f824a.jsonl.gz", "inputs": "reproduction/python/inputs/p03576.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03576_8a3677d33ef94aa20c0d8f63278dc74d3213d7364e3053bc4f7e4d032ec4bddd.jsonl.gz"}, "slow_code": "def acc2(grid):\n H = len(grid)\n W = len(grid[0])\n for i in range(H):\n for j in range(W - 1):\n grid[i][j + 1] += grid[i][j]\n for j in range(W):\n for i in range(H - 1):\n grid[i + 1][j] += grid[i][j]\n ngrid = [[0] * (W + 1)]\n for i in range(H):\n line = [0] + grid[i]\n ngrid.append(line)\n return ngrid\n\n\nfrom bisect import bisect_left\n\nN, K = list(map(int, input().split()))\nX = []\nY = []\ninfo = []\nfor i in range(N):\n x, y = list(map(int, input().split()))\n X.append(x)\n Y.append(y)\n info.append([x, y])\nX.sort()\nY.sort()\nacc = [[0] * (N) for i in range(N)]\nfor x, y in info:\n j = bisect_left(X, x)\n i = bisect_left(Y, y)\n acc[i][j] += 1\nacc = acc2(acc)\nans = float(\"inf\")\nfor t in range(N - 1):\n for b in range(t + 1, N):\n for l in range(N - 1):\n for r in range(l + 1, N):\n num = acc[b + 1][r + 1] - acc[b + 1][l] - acc[t][r + 1] + acc[t][l]\n if num < K:\n continue\n S = (Y[b] - Y[t]) * (X[r] - X[l])\n if S < ans:\n ans = S\nprint(ans)\n", "slow_code_sha256": "8a3677d33ef94aa20c0d8f63278dc74d3213d7364e3053bc4f7e4d032ec4bddd", "slow_id": "p03576_8a3677d33ef94aa20c0d8f63278dc74d3213d7364e3053bc4f7e4d032ec4bddd", "speedup": 4.9239090466384035, "stratum": "4-8", "within_pair_jaccard": 0.3709677419354839, "workload": {"case_count": 100, "description": "Find the minimum area of an axis-aligned rectangle containing at least K of N plane points, counting boundary points. All x coordinates are distinct, and all y coordinates are distinct. Observed inputs: N=2..50 (median 25); K=2..50 (median 2.5); x_i=-1000000000..997427460; y_i=-1000000000..997398050.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1106, "median": 524.0, "min": 40}, "input_format": ["N K\nx_1 y_1\n...\nx_N y_N"], "input_format_status": "source_input_section", "input_lines": {"max": 51, "median": 26.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 102, "median": 52.0, "min": 6}}} -{"case_ids": ["p03721_case_000", "p03721_case_001", "p03721_case_002", "p03721_case_003", "p03721_case_004", "p03721_case_005", "p03721_case_006", "p03721_case_007", "p03721_case_008", "p03721_case_009", "p03721_case_010", "p03721_case_011", "p03721_case_012", "p03721_case_013", "p03721_case_014", "p03721_case_015", "p03721_case_016", "p03721_case_017", "p03721_case_018", "p03721_case_019", "p03721_case_020", "p03721_case_021", "p03721_case_022", "p03721_case_023", "p03721_case_024", "p03721_case_025", "p03721_case_026", "p03721_case_027", "p03721_case_028", "p03721_case_029", "p03721_case_030", "p03721_case_031", "p03721_case_032", "p03721_case_033", "p03721_case_034", "p03721_case_035", "p03721_case_036", "p03721_case_037", "p03721_case_038", "p03721_case_039", "p03721_case_040", "p03721_case_041", "p03721_case_042", "p03721_case_043", "p03721_case_044", "p03721_case_045", "p03721_case_046", "p03721_case_047", "p03721_case_048", "p03721_case_049", "p03721_case_050", "p03721_case_051", "p03721_case_052", "p03721_case_053", "p03721_case_054", "p03721_case_055", "p03721_case_056", "p03721_case_057", "p03721_case_058", "p03721_case_059", "p03721_case_060", "p03721_case_061", "p03721_case_062", "p03721_case_063", "p03721_case_064", "p03721_case_065", "p03721_case_067", "p03721_case_068", "p03721_case_069", "p03721_case_070", "p03721_case_071", "p03721_case_072", "p03721_case_073", "p03721_case_074", "p03721_case_075", "p03721_case_076", "p03721_case_077", "p03721_case_078", "p03721_case_079", "p03721_case_080", "p03721_case_081", "p03721_case_082", "p03721_case_083", "p03721_case_084", "p03721_case_085", "p03721_case_087", "p03721_case_088", "p03721_case_089", "p03721_case_090", "p03721_case_091", "p03721_case_092", "p03721_case_093", "p03721_case_094", "p03721_case_095", "p03721_case_096", "p03721_case_097", "p03721_case_098", "p03721_case_099", "p03721_v2_8dbaa32dabbc59559f15", "p03721_v2_b1687ced952bc758cf7f"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n, k, *l = list(map(int, open(0).read().split()))\nc = 0\nfor a, b in sorted(zip(l[::2], l[1::2])):\n c += b\n if c >= k:\n print(a)\n break\n", "fast_code_sha256": "3c08881b5b3729a613f8ec99a27b6ec76218ded85383ed0ac39d376f8a73893c", "fast_id": "p03721_3c08881b5b3729a613f8ec99a27b6ec76218ded85383ed0ac39d376f8a73893c", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n, k, *l = list(map(int, open(0).read().split()))\nc = 0\nfor a, b in sorted(zip(l[::2], l[1::2])):\n c += b\n if c >= k:\n print(a)\n break\n", "measured_fast_code_sha256": "3c08881b5b3729a613f8ec99a27b6ec76218ded85383ed0ac39d376f8a73893c", "measured_slow_code": "N, K = list(map(int, input().split()))\nli = [0] * 100001\nfor i in range(N):\n a, b = list(map(int, input().split()))\n li[a] += b\ntmp = 0\nfor i in range(100001):\n tmp += li[i]\n if tmp >= K:\n print(i)\n break\n", "measured_slow_code_sha256": "279050fc9c8196e79b3287160bf417ea1e2926855392ef8a058868e0c3b5c41d", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.8310620132807562, "pair_id": "python_v2_c900687109c99df157c68f55", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03721", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03721_3c08881b5b3729a613f8ec99a27b6ec76218ded85383ed0ac39d376f8a73893c.jsonl.gz", "inputs": "reproduction/python/inputs/p03721.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03721_279050fc9c8196e79b3287160bf417ea1e2926855392ef8a058868e0c3b5c41d.jsonl.gz"}, "slow_code": "N, K = list(map(int, input().split()))\nli = [0] * 100001\nfor i in range(N):\n a, b = list(map(int, input().split()))\n li[a] += b\ntmp = 0\nfor i in range(100001):\n tmp += li[i]\n if tmp >= K:\n print(i)\n break\n", "slow_code_sha256": "279050fc9c8196e79b3287160bf417ea1e2926855392ef8a058868e0c3b5c41d", "slow_id": "p03721_279050fc9c8196e79b3287160bf417ea1e2926855392ef8a058868e0c3b5c41d", "speedup": 4.712308498650585, "stratum": "4-8", "within_pair_jaccard": 0.4, "workload": {"case_count": 100, "description": "Operation i inserts b_i copies of integer a_i into an initially empty multiset. After N operations, find the 1-based K-th smallest element, counting multiplicity; the expanded multiset is not supplied. Observed inputs: N=1..100000 (median 100000); K=1..10000000000 (median 1154351153); a_i=1..100000; b_i=1..100000; total_elements=1..10000000000 (median 4995269195.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1289119, "median": 1177559.0, "min": 8}, "input_format": ["N K\na_1 b_1\n...\na_N b_N"], "input_format_status": "source_input_section", "input_lines": {"max": 100001, "median": 100001.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200002, "median": 200002.0, "min": 4}}} -{"case_ids": ["p03030_case_000", "p03030_case_001", "p03030_case_002", "p03030_case_003", "p03030_case_004", "p03030_case_005", "p03030_case_006", "p03030_case_007", "p03030_case_008", "p03030_case_009", "p03030_case_010", "p03030_case_011", "p03030_case_012", "p03030_case_013", "p03030_case_014", "p03030_case_015", "p03030_case_016", "p03030_case_017", "p03030_case_018", "p03030_case_019", "p03030_case_020", "p03030_case_021", "p03030_case_022", "p03030_case_023", "p03030_case_024", "p03030_case_025", "p03030_case_026", "p03030_case_027", "p03030_case_028", "p03030_case_029", "p03030_case_030", "p03030_case_031", "p03030_case_032", "p03030_case_033", "p03030_case_034", "p03030_case_035", "p03030_case_036", "p03030_case_037", "p03030_case_038", "p03030_case_039", "p03030_case_040", "p03030_case_041", "p03030_case_042", "p03030_case_043", "p03030_case_044", "p03030_case_045", "p03030_case_046", "p03030_case_047", "p03030_case_048", "p03030_case_049", "p03030_case_050", "p03030_case_051", "p03030_case_052", "p03030_case_053", "p03030_case_054", "p03030_case_055", "p03030_case_056", "p03030_case_057", "p03030_case_058", "p03030_case_059", "p03030_case_060", "p03030_case_061", "p03030_case_062", "p03030_case_063", "p03030_case_064", "p03030_case_065", "p03030_case_066", "p03030_case_067", "p03030_case_068", "p03030_case_069", "p03030_case_070", "p03030_case_071", "p03030_case_072", "p03030_case_073", "p03030_case_074", "p03030_case_075", "p03030_case_076", "p03030_case_077", "p03030_case_078", "p03030_case_079", "p03030_case_080", "p03030_case_081", "p03030_case_082", "p03030_case_083", "p03030_case_084", "p03030_case_085", "p03030_case_086", "p03030_case_087", "p03030_case_088", "p03030_case_089", "p03030_case_090", "p03030_case_091", "p03030_case_092", "p03030_case_093", "p03030_case_094", "p03030_case_095", "p03030_case_096", "p03030_case_097", "p03030_case_098", "p03030_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N = int(eval(input()))\nl = []\nfor i in range(N):\n s, p = input().split(\" \")\n l.append([s, -int(p), i + 1])\nl.sort()\nfor s, p, i in l:\n print(i)\n", "fast_code_sha256": "8f465dc84ab15b8aef381f4c98e2aba2570613e45cefdc8621ec0f0e3adbdb41", "fast_id": "p03030_8f465dc84ab15b8aef381f4c98e2aba2570613e45cefdc8621ec0f0e3adbdb41", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N = int(eval(input()))\nl = []\nfor i in range(N):\n s, p = input().split(\" \")\n l.append([s, -int(p), i + 1])\nl.sort()\nfor s, p, i in l:\n print(i)\n", "measured_fast_code_sha256": "8f465dc84ab15b8aef381f4c98e2aba2570613e45cefdc8621ec0f0e3adbdb41", "measured_slow_code": "N = int(eval(input()))\nMAIN = []\nfor i in range(N):\n S, P = list(map(str, input().split()))\n MAIN.append([i + 1, S, int(P)])\n\n\ndef swap(i, j):\n x = MAIN[i]\n MAIN[i] = MAIN[j]\n MAIN[j] = x\n\n\nupdate = True\nwhile update == True:\n update = False\n for i in range(1, N):\n if MAIN[i][1] > MAIN[i - 1][1]:\n continue\n elif MAIN[i][1] == MAIN[i - 1][1]:\n if MAIN[i][2] > MAIN[i - 1][2]:\n swap(i, i - 1)\n update = True\n else:\n swap(i, i - 1)\n update = True\nfor m in MAIN:\n print((m[0]))\n", "measured_slow_code_sha256": "dbe08050a0d6a77d36da9960a8e9921e8d48ac452d52421ae0919461f538c102", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 6.797381254569729, "pair_id": "python_v2_fd2eba2809015de76e11f8db", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03030", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03030_8f465dc84ab15b8aef381f4c98e2aba2570613e45cefdc8621ec0f0e3adbdb41.jsonl.gz", "inputs": "reproduction/python/inputs/p03030.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03030_dbe08050a0d6a77d36da9960a8e9921e8d48ac452d52421ae0919461f538c102.jsonl.gz"}, "slow_code": "N = int(eval(input()))\nMAIN = []\nfor i in range(N):\n S, P = list(map(str, input().split()))\n MAIN.append([i + 1, S, int(P)])\n\n\ndef swap(i, j):\n x = MAIN[i]\n MAIN[i] = MAIN[j]\n MAIN[j] = x\n\n\nupdate = True\nwhile update == True:\n update = False\n for i in range(1, N):\n if MAIN[i][1] > MAIN[i - 1][1]:\n continue\n elif MAIN[i][1] == MAIN[i - 1][1]:\n if MAIN[i][2] > MAIN[i - 1][2]:\n swap(i, i - 1)\n update = True\n else:\n swap(i, i - 1)\n update = True\nfor m in MAIN:\n print((m[0]))\n", "slow_code_sha256": "dbe08050a0d6a77d36da9960a8e9921e8d48ac452d52421ae0919461f538c102", "slow_id": "p03030_dbe08050a0d6a77d36da9960a8e9921e8d48ac452d52421ae0919461f538c102", "speedup": 6.127582894880668, "stratum": "4-8", "within_pair_jaccard": 0.32432432432432434, "workload": {"case_count": 100, "description": "Sort restaurants by lowercase city name lexicographically, breaking equal-city ties by decreasing score P_i, and output their original 1-based IDs. All scores are distinct. Observed inputs: N=1..100 (median 50); name_length=1..10; P_i=0..100; distinct_cities=1..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1395, "median": 463.0, "min": 7}, "input_format": ["N\nS_1 P_1\n...\nS_N P_N"], "input_format_status": "source_input_section", "input_lines": {"max": 101, "median": 51.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 201, "median": 101.0, "min": 3}}} -{"case_ids": ["p02714_case_000", "p02714_case_001", "p02714_case_002", "p02714_case_003", "p02714_case_004", "p02714_case_005", "p02714_case_006", "p02714_case_007", "p02714_case_008", "p02714_case_009", "p02714_case_010", "p02714_case_011", "p02714_case_012", "p02714_case_013", "p02714_case_014", "p02714_case_015", "p02714_case_016", "p02714_case_017", "p02714_case_018", "p02714_case_019", "p02714_case_020", "p02714_case_021", "p02714_case_022", "p02714_case_023", "p02714_case_024", "p02714_case_025", "p02714_case_026", "p02714_case_027", "p02714_case_028", "p02714_case_029", "p02714_case_030", "p02714_case_031", "p02714_case_032", "p02714_case_033", "p02714_case_034", "p02714_case_035", "p02714_case_036", "p02714_case_037", "p02714_case_038", "p02714_case_039", "p02714_case_040", "p02714_case_041", "p02714_case_042", "p02714_case_043", "p02714_case_044", "p02714_case_045", "p02714_case_046", "p02714_case_047", "p02714_case_048", "p02714_case_049", "p02714_case_050", "p02714_case_051", "p02714_case_052", "p02714_case_053", "p02714_case_054", "p02714_case_055", "p02714_case_056", "p02714_case_057", "p02714_case_058", "p02714_case_059", "p02714_case_060", "p02714_case_061", "p02714_case_062", "p02714_case_063", "p02714_case_064", "p02714_case_065", "p02714_case_066", "p02714_case_067", "p02714_case_068", "p02714_case_069", "p02714_case_070", "p02714_case_071", "p02714_case_072", "p02714_case_073", "p02714_case_074", "p02714_case_075", "p02714_case_076", "p02714_case_077", "p02714_case_078", "p02714_case_079", "p02714_case_080", "p02714_case_081", "p02714_case_082", "p02714_case_083", "p02714_case_084", "p02714_case_085", "p02714_case_086", "p02714_case_087", "p02714_case_088", "p02714_case_089", "p02714_case_090", "p02714_case_091", "p02714_case_092", "p02714_case_093", "p02714_case_094", "p02714_case_095", "p02714_case_096", "p02714_case_097", "p02714_case_098", "p02714_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from collections import defaultdict\n\n\ndef main():\n _ = int(eval(input()))\n S = input().rstrip()\n indices = defaultdict(set)\n for i, c in enumerate(S):\n indices[c].add(i)\n cnt = len(indices[\"R\"]) * len(indices[\"G\"]) * len(indices[\"B\"])\n for c1, c2, c3 in [\"RGB\", \"GBR\", \"BRG\"]:\n cnt -= sum(\n (i + j) % 2 == 0 and (i + j) // 2 in indices[c3]\n for i in indices[c1]\n for j in indices[c2]\n )\n print(cnt)\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "1acd7e8cc052d2c6b8f2adfe5f8999919939bdaf9300d0d26de99386fb0562e1", "fast_id": "p02714_75b425abff2053c8b035e761155e48bbad26cdb1cf611e1382fb5ba2d858a726", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "# D - RGB Triplets\nfrom collections import defaultdict\n\n\ndef main():\n _ = int(eval(input()))\n S = input().rstrip()\n indices = defaultdict(set)\n for i, c in enumerate(S):\n indices[c].add(i)\n cnt = len(indices[\"R\"]) * len(indices[\"G\"]) * len(indices[\"B\"])\n for c1, c2, c3 in [\"RGB\", \"GBR\", \"BRG\"]:\n cnt -= sum(\n (i + j) % 2 == 0 and (i + j) // 2 in indices[c3]\n for i in indices[c1]\n for j in indices[c2]\n )\n print(cnt)\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "75b425abff2053c8b035e761155e48bbad26cdb1cf611e1382fb5ba2d858a726", "measured_slow_code": "from sys import stdin\nimport bisect\n\n\ndef main():\n # 入力\n readline = stdin.readline\n N = int(readline())\n S = readline().strip()\n res = 0\n R = []\n G = []\n B = []\n flags = [\"\"] * N\n for i in range(N):\n if S[i] == \"R\":\n R.append(i)\n flags[i] = \"R\"\n elif S[i] == \"G\":\n G.append(i)\n flags[i] = \"G\"\n else:\n B.append(i)\n flags[i] = \"B\"\n # Bが最後\n for i in range(len(R)):\n for j in range(len(G)):\n n = max(R[i], G[j])\n k = bisect.bisect_left(B, n)\n res += len(B) - k\n if n + n - min(R[i], G[j]) < N:\n if flags[n + n - min(R[i], G[j])] == \"B\":\n res -= 1\n for i in range(len(R)):\n for j in range(len(B)):\n n = max(R[i], B[j])\n k = bisect.bisect_left(G, n)\n res += len(G) - k\n if n + n - min(R[i], B[j]) < N:\n if flags[n + n - min(R[i], B[j])] == \"G\":\n res -= 1\n for i in range(len(B)):\n for j in range(len(G)):\n n = max(B[i], G[j])\n k = bisect.bisect_left(R, n)\n res += len(R) - k\n if n + n - min(B[i], G[j]) < N:\n if flags[n + n - min(B[i], G[j])] == \"R\":\n res -= 1\n print(res)\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "329b15942111e48ba21aa4fa5898b0daadc6d2ead02a6a14ed26da0eb67b41ec", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4.383890814919324, "pair_id": "python_v2_ce6c08bc9f35cd9f60c986c7", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02714", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02714_75b425abff2053c8b035e761155e48bbad26cdb1cf611e1382fb5ba2d858a726.jsonl.gz", "inputs": "reproduction/python/inputs/p02714.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02714_329b15942111e48ba21aa4fa5898b0daadc6d2ead02a6a14ed26da0eb67b41ec.jsonl.gz"}, "slow_code": "from sys import stdin\nimport bisect\n\n\ndef main():\n\n readline = stdin.readline\n N = int(readline())\n S = readline().strip()\n res = 0\n R = []\n G = []\n B = []\n flags = [\"\"] * N\n for i in range(N):\n if S[i] == \"R\":\n R.append(i)\n flags[i] = \"R\"\n elif S[i] == \"G\":\n G.append(i)\n flags[i] = \"G\"\n else:\n B.append(i)\n flags[i] = \"B\"\n\n for i in range(len(R)):\n for j in range(len(G)):\n n = max(R[i], G[j])\n k = bisect.bisect_left(B, n)\n res += len(B) - k\n if n + n - min(R[i], G[j]) < N:\n if flags[n + n - min(R[i], G[j])] == \"B\":\n res -= 1\n for i in range(len(R)):\n for j in range(len(B)):\n n = max(R[i], B[j])\n k = bisect.bisect_left(G, n)\n res += len(G) - k\n if n + n - min(R[i], B[j]) < N:\n if flags[n + n - min(R[i], B[j])] == \"G\":\n res -= 1\n for i in range(len(B)):\n for j in range(len(G)):\n n = max(B[i], G[j])\n k = bisect.bisect_left(R, n)\n res += len(R) - k\n if n + n - min(B[i], G[j]) < N:\n if flags[n + n - min(B[i], G[j])] == \"R\":\n res -= 1\n print(res)\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "da713aaa394b9951921ebd958e2887baf9e88ebd0181739a1faba9c19b60964a", "slow_id": "p02714_329b15942111e48ba21aa4fa5898b0daadc6d2ead02a6a14ed26da0eb67b41ec", "speedup": 3.577822307977083, "stratum": "2-4", "within_pair_jaccard": 0.3275862068965517, "workload": {"case_count": 100, "description": "Count index triples i= r:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "fast_code_sha256": "72413e6af8b51441291a1bea2384cdc8afa9b2461321c9349dcffb4b86cd4b48", "fast_id": "p02394_72413e6af8b51441291a1bea2384cdc8afa9b2461321c9349dcffb4b86cd4b48", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "w, h, x, y, r = list(map(int, input().split()))\nif min([x, y, w - x, h - y]) >= r:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "measured_fast_code_sha256": "72413e6af8b51441291a1bea2384cdc8afa9b2461321c9349dcffb4b86cd4b48", "measured_slow_code": "# coding: utf-8\n# Here your code !\nimport math\n\n\ndef func():\n try:\n line = input().rstrip()\n numbers = line.split(\" \")\n width = float(numbers[0])\n height = float(numbers[1])\n x = float(numbers[2])\n y = float(numbers[3])\n r = abs(float(numbers[4]))\n except:\n print(\"input error\")\n return -1\n wsign = math.copysign(1, width)\n hsign = math.copysign(1, height)\n result = wsign * x + r <= wsign * width\n result = result and (wsign * x - r >= 0)\n result = result and (hsign * y + r <= hsign * height)\n result = result and (hsign * y - r >= 0)\n if result:\n print(\"Yes\")\n else:\n print(\"No\")\n\n\nfunc()\n", "measured_slow_code_sha256": "c88e86f1ad95ddc817ad7ba81628e2daf211ff2d39c36960f050623a40ae12a3", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.8583725737804992, "pair_id": "python_v2_dae14f68695e8da72900371c", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02394", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02394_72413e6af8b51441291a1bea2384cdc8afa9b2461321c9349dcffb4b86cd4b48.jsonl.gz", "inputs": "reproduction/python/inputs/p02394.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02394_c88e86f1ad95ddc817ad7ba81628e2daf211ff2d39c36960f050623a40ae12a3.jsonl.gz"}, "slow_code": "import math\n\n\ndef func():\n try:\n line = input().rstrip()\n numbers = line.split(\" \")\n width = float(numbers[0])\n height = float(numbers[1])\n x = float(numbers[2])\n y = float(numbers[3])\n r = abs(float(numbers[4]))\n except:\n print(\"input error\")\n return -1\n wsign = math.copysign(1, width)\n hsign = math.copysign(1, height)\n result = wsign * x + r <= wsign * width\n result = result and (wsign * x - r >= 0)\n result = result and (hsign * y + r <= hsign * height)\n result = result and (hsign * y - r >= 0)\n if result:\n print(\"Yes\")\n else:\n print(\"No\")\n\n\nfunc()\n", "slow_code_sha256": "b3a430d2365496f9f536fa4236fe45d9a45c9a6c0f910f1eae517487e3d1e97c", "slow_id": "p02394_c88e86f1ad95ddc817ad7ba81628e2daf211ff2d39c36960f050623a40ae12a3", "speedup": 2.8582706605394446, "stratum": "2-4", "within_pair_jaccard": 0.24390243902439024, "workload": {"case_count": 100, "description": "Decide whether the entire circle centered at (x,y) with radius r lies in the closed rectangle [0,W]x[0,H]. Touching the rectangle boundary is allowed. The five supplied values are integers. Observed inputs: W=1..100; H=1..100; x=-100..100; y=-100..100; r=1..96.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 19, "median": 15.5, "min": 10}, "input_format": ["W H x y r"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 5, "median": 5.0, "min": 5}}} -{"case_ids": ["p00053_case_000", "p00053_case_001", "p00053_case_002", "p00053_case_003", "p00053_case_004", "p00053_case_005", "p00053_case_006", "p00053_case_007", "p00053_case_008", "p00053_case_009", "p00053_case_010", "p00053_case_011", "p00053_case_012", "p00053_case_013", "p00053_case_014", "p00053_case_015", "p00053_case_016", "p00053_case_017", "p00053_case_018", "p00053_case_019", "p00053_case_020", "p00053_case_021", "p00053_case_022", "p00053_case_023", "p00053_case_024", "p00053_case_025", "p00053_case_026", "p00053_case_027", "p00053_case_028", "p00053_case_029", "p00053_case_030", "p00053_case_031", "p00053_case_032", "p00053_case_033", "p00053_case_034", "p00053_case_035", "p00053_case_036", "p00053_case_037", "p00053_case_038", "p00053_case_039", "p00053_case_040", "p00053_case_041", "p00053_case_042", "p00053_case_043", "p00053_case_044", "p00053_case_045", "p00053_case_046", "p00053_case_047", "p00053_case_048", "p00053_case_049", "p00053_case_050", "p00053_case_051", "p00053_case_052", "p00053_case_053", "p00053_case_054", "p00053_case_055", "p00053_case_056", "p00053_case_057", "p00053_case_058", "p00053_case_059", "p00053_case_060", "p00053_case_061", "p00053_case_062", "p00053_case_063", "p00053_case_064", "p00053_case_065", "p00053_case_066", "p00053_case_067", "p00053_case_068", "p00053_case_069", "p00053_case_070", "p00053_case_071", "p00053_case_072", "p00053_case_073", "p00053_case_074", "p00053_case_075", "p00053_case_076", "p00053_case_077", "p00053_case_078", "p00053_case_079", "p00053_case_080", "p00053_case_081", "p00053_case_082", "p00053_case_083", "p00053_case_084", "p00053_case_085", "p00053_case_086", "p00053_case_087", "p00053_case_088", "p00053_case_089", "p00053_case_090", "p00053_case_091", "p00053_case_092", "p00053_case_093", "p00053_case_094", "p00053_case_095", "p00053_case_096", "p00053_case_097", "p00053_case_098", "p00053_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "s = [0]\nM = 104850\np = [1] * M\nS = 0\nfor i in range(2, M):\n if p[i]:\n for j in range(i * i, M, i):\n p[j] = 0\n S += i\n s.append(S)\nwhile 1:\n n = eval(input())\n if n == 0:\n break\n print(s[n])\n", "fast_code_sha256": "09bf5d0d342feea8a2f21191badddda2ed0fca1f3c0b3c1083fafbad4af87956", "fast_id": "p00053_09bf5d0d342feea8a2f21191badddda2ed0fca1f3c0b3c1083fafbad4af87956", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "s = [0]\nM = 104850\np = [1] * M\nS = 0\nfor i in range(2, M):\n if p[i]:\n for j in range(i * i, M, i):\n p[j] = 0\n S += i\n s.append(S)\nwhile 1:\n n = eval(input())\n if n == 0:\n break\n print(s[n])\n", "measured_fast_code_sha256": "09bf5d0d342feea8a2f21191badddda2ed0fca1f3c0b3c1083fafbad4af87956", "measured_slow_code": "s = [0]\nM = 10**6\np = [1] * M\nS = 0\nfor i in range(2, M):\n if p[i]:\n for j in range(i * i, M, i):\n p[j] = 0\n S += i\n s.append(S)\nwhile 1:\n n = eval(input())\n if n == 0:\n break\n print(s[n])\n", "measured_slow_code_sha256": "7130bb62b43d2905d9cdb1190486ed076acf2c798a1bd9a7e922a3d44800a16f", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 8.818443995168117, "pair_id": "python_v2_eea57c37ebaea158f3fe0428", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p00053", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p00053_09bf5d0d342feea8a2f21191badddda2ed0fca1f3c0b3c1083fafbad4af87956.jsonl.gz", "inputs": "reproduction/python/inputs/p00053.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p00053_7130bb62b43d2905d9cdb1190486ed076acf2c798a1bd9a7e922a3d44800a16f.jsonl.gz"}, "slow_code": "s = [0]\nM = 10**6\np = [1] * M\nS = 0\nfor i in range(2, M):\n if p[i]:\n for j in range(i * i, M, i):\n p[j] = 0\n S += i\n s.append(S)\nwhile 1:\n n = eval(input())\n if n == 0:\n break\n print(s[n])\n", "slow_code_sha256": "7130bb62b43d2905d9cdb1190486ed076acf2c798a1bd9a7e922a3d44800a16f", "slow_id": "p00053_7130bb62b43d2905d9cdb1190486ed076acf2c798a1bd9a7e922a3d44800a16f", "speedup": 8.817223240116999, "stratum": "8+", "within_pair_jaccard": 0.8695652173913043, "workload": {"case_count": 100, "description": "For each n, compute the sum of the first n primes. Each line supplies one n; the final zero terminates input and is not a query. Observed inputs: datasets=1..50 (median 25); n=1..10000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 302, "median": 120.0, "min": 4}, "input_format": ["n_1\n...\nn_D\n0"], "input_format_status": "source_input_section", "input_lines": {"max": 51, "median": 26.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 51, "median": 26.0, "min": 2}}} -{"case_ids": ["p03801_case_000", "p03801_case_001", "p03801_case_002", "p03801_case_003", "p03801_case_004", "p03801_case_005", "p03801_case_006", "p03801_case_007", "p03801_case_008", "p03801_case_009", "p03801_case_010", "p03801_case_011", "p03801_case_012", "p03801_case_013", "p03801_case_014", "p03801_case_015", "p03801_case_016", "p03801_case_017", "p03801_case_018", "p03801_case_019", "p03801_case_020", "p03801_case_021", "p03801_case_022", "p03801_case_023", "p03801_case_024", "p03801_case_025", "p03801_case_026", "p03801_case_027", "p03801_case_028", "p03801_case_029", "p03801_case_030", "p03801_case_031", "p03801_case_032", "p03801_case_033", "p03801_case_034", "p03801_case_035", "p03801_case_036", "p03801_case_037", "p03801_case_038", "p03801_case_039", "p03801_case_040", "p03801_case_041", "p03801_case_042", "p03801_case_043", "p03801_case_044", "p03801_case_045", "p03801_case_046", "p03801_case_047", "p03801_case_048", "p03801_case_049", "p03801_case_050", "p03801_case_051", "p03801_case_052", "p03801_case_053", "p03801_case_054", "p03801_case_055", "p03801_case_056", "p03801_case_057", "p03801_case_058", "p03801_case_059", "p03801_case_060", "p03801_case_061", "p03801_case_062", "p03801_case_063", "p03801_case_064", "p03801_case_065", "p03801_case_066", "p03801_case_067", "p03801_case_068", "p03801_case_069", "p03801_case_070", "p03801_case_071", "p03801_case_072", "p03801_case_073", "p03801_case_074", "p03801_case_075", "p03801_case_076", "p03801_case_077", "p03801_case_078", "p03801_case_079", "p03801_case_080", "p03801_case_081", "p03801_case_082", "p03801_case_083", "p03801_case_084", "p03801_case_085", "p03801_case_086", "p03801_case_087", "p03801_case_088", "p03801_case_089", "p03801_case_090", "p03801_case_091", "p03801_case_092", "p03801_case_093", "p03801_case_094", "p03801_case_095", "p03801_case_096", "p03801_case_097", "p03801_case_098", "p03801_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N = int(eval(input()))\nA = [int(a) for a in input().split()]\nS = sum(A)\nfor i in range(N):\n A[i] = [A[i], i + 1]\nA.sort(reverse=True)\nans = [0] * (N + 1)\ni = 0\nnum = N + 1\nwhile i < N - 1:\n num = min(num, A[i][1])\n while i < N - 1 and A[i][0] == A[i + 1][0]:\n num = min(num, A[i + 1][1])\n i += 1\n if i == N - 1:\n break\n ans[num] += (i + 1) * (A[i][0] - A[i + 1][0])\n i += 1\nans[1] += S - sum(ans)\nfor i in range(1, N + 1):\n print((ans[i]))\n", "fast_code_sha256": "5dc42099153bb6da27156c18cc71f05f1a7cc7431449288818076ded87d105bd", "fast_id": "p03801_5dc42099153bb6da27156c18cc71f05f1a7cc7431449288818076ded87d105bd", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N = int(eval(input()))\nA = [int(a) for a in input().split()]\nS = sum(A)\nfor i in range(N):\n A[i] = [A[i], i + 1]\nA.sort(reverse=True)\nans = [0] * (N + 1)\ni = 0\nnum = N + 1\nwhile i < N - 1:\n num = min(num, A[i][1])\n while i < N - 1 and A[i][0] == A[i + 1][0]:\n num = min(num, A[i + 1][1])\n i += 1\n if i == N - 1:\n break\n ans[num] += (i + 1) * (A[i][0] - A[i + 1][0])\n i += 1\nans[1] += S - sum(ans)\nfor i in range(1, N + 1):\n print((ans[i]))\n", "measured_fast_code_sha256": "5dc42099153bb6da27156c18cc71f05f1a7cc7431449288818076ded87d105bd", "measured_slow_code": "from collections import defaultdict\nimport sys\n\n\nclass BIT:\n def __init__(self, number):\n self.n = number\n self.list = [0] * (number + 1)\n\n def add(self, i, x): # ith added x 1indexed\n while i <= self.n:\n self.list[i] += x\n i += i & -i\n\n def search(self, i): # 1-i sum\n s = 0\n while i > 0:\n s += self.list[i]\n i -= i & -i\n return s\n\n def suma(self, i, j): # i,i+1,..j sum\n return self.search(j) - self.search(i - 1)\n\n\nN = int(eval(input()))\nA = [int(i) for i in input().split()]\nC = sorted(set(A))\nndd = defaultdict(int)\nfor i in range(len(C)):\n ndd[i + 1] = C[i]\ndd = defaultdict(int)\nfor i in range(len(C)):\n dd[C[i]] = i + 1\n# print(ndd,dd)\nvisit = [0] * N\nvisit[0] = 1\ns = A[0]\nH = []\nH.append(s)\nfor i in range(1, N):\n if s < A[i]:\n s = A[i]\n H.append(s)\n visit[i] = 1\nBITI = BIT(N + 1)\nBITI2 = BIT(N + 1)\nj = len(H) - 1\nl = dd[H[j]]\nnum = sum(A)\nT = [0] * N\nans = 0\nfor i in range(N - 1, -1, -1):\n if l == dd[A[0]]:\n break\n BITI.add(dd[A[i]], A[i])\n BITI2.add(dd[A[i]], 1)\n if dd[A[i]] == l and visit[i] == 1:\n T[i] = (\n BITI.suma(dd[H[j - 1]], N + 1)\n - BITI2.suma(dd[H[j - 1]], N + 1) * H[j - 1]\n - ans\n )\n ans += T[i]\n # print(i,j,l,T[i],ans)\n j -= 1\n l = dd[H[j]]\nx = num - sum(T)\nT[0] = x\n# print(visit,T)\nfor t in T:\n print(t)\n", "measured_slow_code_sha256": "40cdb704510a327363c2183827f02e9385c4a8e8deb4ae92265564da9b8e0f50", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.362326825969039, "pair_id": "python_v2_eeef5213b4d68e37e5c76990", "per_case_slow_code_faster_fraction": 0.07, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03801", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03801_5dc42099153bb6da27156c18cc71f05f1a7cc7431449288818076ded87d105bd.jsonl.gz", "inputs": "reproduction/python/inputs/p03801.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03801_40cdb704510a327363c2183827f02e9385c4a8e8deb4ae92265564da9b8e0f50.jsonl.gz"}, "slow_code": "from collections import defaultdict\nimport sys\n\n\nclass BIT:\n def __init__(self, number):\n self.n = number\n self.list = [0] * (number + 1)\n\n def add(self, i, x):\n while i <= self.n:\n self.list[i] += x\n i += i & -i\n\n def search(self, i):\n s = 0\n while i > 0:\n s += self.list[i]\n i -= i & -i\n return s\n\n def suma(self, i, j):\n return self.search(j) - self.search(i - 1)\n\n\nN = int(eval(input()))\nA = [int(i) for i in input().split()]\nC = sorted(set(A))\nndd = defaultdict(int)\nfor i in range(len(C)):\n ndd[i + 1] = C[i]\ndd = defaultdict(int)\nfor i in range(len(C)):\n dd[C[i]] = i + 1\n\nvisit = [0] * N\nvisit[0] = 1\ns = A[0]\nH = []\nH.append(s)\nfor i in range(1, N):\n if s < A[i]:\n s = A[i]\n H.append(s)\n visit[i] = 1\nBITI = BIT(N + 1)\nBITI2 = BIT(N + 1)\nj = len(H) - 1\nl = dd[H[j]]\nnum = sum(A)\nT = [0] * N\nans = 0\nfor i in range(N - 1, -1, -1):\n if l == dd[A[0]]:\n break\n BITI.add(dd[A[i]], A[i])\n BITI2.add(dd[A[i]], 1)\n if dd[A[i]] == l and visit[i] == 1:\n T[i] = (\n BITI.suma(dd[H[j - 1]], N + 1)\n - BITI2.suma(dd[H[j - 1]], N + 1) * H[j - 1]\n - ans\n )\n ans += T[i]\n\n j -= 1\n l = dd[H[j]]\nx = num - sum(T)\nT[0] = x\n\nfor t in T:\n print(t)\n", "slow_code_sha256": "16fad88fa10618a2d3253fe477e8c221495b37e3b11f228319dc3cf0097c8388", "slow_id": "p03801_40cdb704510a327363c2183827f02e9385c4a8e8deb4ae92265564da9b8e0f50", "speedup": 2.1020322838847743, "stratum": "2-4", "within_pair_jaccard": 0.3333333333333333, "workload": {"case_count": 100, "description": "Repeat until N stone piles are empty: append the smallest index among current largest piles, then remove one stone from any nonempty pile. Among possible output sequences, choose the lexicographically smallest and report each index frequency. Observed inputs: N=1..100000 (median 1000); a_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1100007, "median": 9900.0, "min": 4}, "input_format": ["N\na_1 ... a_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100001, "median": 1001.0, "min": 2}}} -{"case_ids": ["p02628_case_000", "p02628_case_001", "p02628_case_002", "p02628_case_003", "p02628_case_004", "p02628_case_005", "p02628_case_006", "p02628_case_007", "p02628_case_008", "p02628_case_009", "p02628_case_010", "p02628_case_011", "p02628_case_012", "p02628_case_013", "p02628_case_014", "p02628_case_015", "p02628_case_016", "p02628_case_017", "p02628_case_018", "p02628_case_019", "p02628_case_020", "p02628_case_021", "p02628_case_022", "p02628_case_023", "p02628_case_024", "p02628_case_025", "p02628_case_026", "p02628_case_027", "p02628_case_028", "p02628_case_029", "p02628_case_030", "p02628_case_031", "p02628_case_032", "p02628_case_033", "p02628_case_034", "p02628_case_035", "p02628_case_036", "p02628_case_037", "p02628_case_038", "p02628_case_039", "p02628_case_040", "p02628_case_041", "p02628_case_042", "p02628_case_043", "p02628_case_044", "p02628_case_045", "p02628_case_046", "p02628_case_047", "p02628_case_048", "p02628_case_049", "p02628_case_050", "p02628_case_051", "p02628_case_052", "p02628_case_053", "p02628_case_054", "p02628_case_055", "p02628_case_056", "p02628_case_057", "p02628_case_058", "p02628_case_059", "p02628_case_060", "p02628_case_061", "p02628_case_062", "p02628_case_063", "p02628_case_064", "p02628_case_065", "p02628_case_066", "p02628_case_067", "p02628_case_068", "p02628_case_069", "p02628_case_070", "p02628_case_071", "p02628_case_072", "p02628_case_073", "p02628_case_074", "p02628_case_075", "p02628_case_076", "p02628_case_077", "p02628_case_078", "p02628_case_079", "p02628_case_080", "p02628_case_081", "p02628_case_082", "p02628_case_083", "p02628_case_084", "p02628_case_085", "p02628_case_086", "p02628_case_087", "p02628_case_088", "p02628_case_089", "p02628_case_090", "p02628_case_091", "p02628_case_092", "p02628_case_093", "p02628_case_094", "p02628_case_095", "p02628_case_096", "p02628_case_097", "p02628_case_098", "p02628_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n, k = list(map(int, input().split()))\np = list(map(int, input().split()))\np.sort()\nans = sum(p[:k])\nprint(ans)\n", "fast_code_sha256": "9e7eba1c890b6035fcaef03622b7f1416b8c1fa466ef824734e16a35ae5fc540", "fast_id": "p02628_9e7eba1c890b6035fcaef03622b7f1416b8c1fa466ef824734e16a35ae5fc540", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n, k = list(map(int, input().split()))\np = list(map(int, input().split()))\np.sort()\nans = sum(p[:k])\nprint(ans)\n", "measured_fast_code_sha256": "9e7eba1c890b6035fcaef03622b7f1416b8c1fa466ef824734e16a35ae5fc540", "measured_slow_code": "N, K = list(map(int, input().split()))\nP = list(map(int, input().split()))\n\n\ndef bubblesort(l):\n for index in range(len(l) - 1, 0, -1):\n for low in range(index):\n if l[low] > l[low + 1]:\n tmp = l[low + 1]\n l[low + 1] = l[low]\n l[low] = tmp\n return l\n\n\nbubblesort(P)\nsum = 0\nfor i in range(K):\n sum = sum + P[i]\nprint(sum)\n", "measured_slow_code_sha256": "12fc0a6880b1658c0eaeba3aa7dd7893393cf5c052e40105869e3784eb2f1caa", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 17.894332248657708, "pair_id": "python_v2_84f48e7e3414fbfa1482b6bb", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02628", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02628_9e7eba1c890b6035fcaef03622b7f1416b8c1fa466ef824734e16a35ae5fc540.jsonl.gz", "inputs": "reproduction/python/inputs/p02628.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02628_12fc0a6880b1658c0eaeba3aa7dd7893393cf5c052e40105869e3784eb2f1caa.jsonl.gz"}, "slow_code": "N, K = list(map(int, input().split()))\nP = list(map(int, input().split()))\n\n\ndef bubblesort(l):\n for index in range(len(l) - 1, 0, -1):\n for low in range(index):\n if l[low] > l[low + 1]:\n tmp = l[low + 1]\n l[low + 1] = l[low]\n l[low] = tmp\n return l\n\n\nbubblesort(P)\nsum = 0\nfor i in range(K):\n sum = sum + P[i]\nprint(sum)\n", "slow_code_sha256": "12fc0a6880b1658c0eaeba3aa7dd7893393cf5c052e40105869e3784eb2f1caa", "slow_id": "p02628_12fc0a6880b1658c0eaeba3aa7dd7893393cf5c052e40105869e3784eb2f1caa", "speedup": 43.73130910522339, "stratum": "8+", "within_pair_jaccard": 0.23333333333333334, "workload": {"case_count": 100, "description": "Choose K distinct kinds among N fruits, buying one item of each, to minimize the total price. Price p_i is the cost of one item of kind i. Observed inputs: N=1..1000 (median 100); K=1..1000 (median 99); p_i=1..1000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 5010, "median": 457.0, "min": 6}, "input_format": ["N K\np_1 ... p_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1002, "median": 102.0, "min": 3}}} -{"case_ids": ["p00263_case_000", "p00263_case_001", "p00263_case_002", "p00263_case_003", "p00263_case_004", "p00263_case_005", "p00263_case_006", "p00263_case_007", "p00263_case_008", "p00263_case_009", "p00263_case_010", "p00263_case_011", "p00263_case_012", "p00263_case_013", "p00263_case_014", "p00263_case_015", "p00263_case_016", "p00263_case_017", "p00263_case_018", "p00263_case_019", "p00263_case_020", "p00263_case_021", "p00263_case_022", "p00263_case_023", "p00263_case_024", "p00263_case_025", "p00263_case_026", "p00263_case_027", "p00263_case_028", "p00263_case_029", "p00263_case_030", "p00263_case_031", "p00263_case_032", "p00263_case_033", "p00263_case_034", "p00263_case_035", "p00263_case_036", "p00263_case_037", "p00263_case_038", "p00263_case_039", "p00263_case_040", "p00263_case_041", "p00263_case_042", "p00263_case_043", "p00263_case_044", "p00263_case_045", "p00263_case_046", "p00263_case_047", "p00263_case_048", "p00263_case_049", "p00263_case_050", "p00263_case_051", "p00263_case_052", "p00263_case_053", "p00263_case_054", "p00263_case_055", "p00263_case_056", "p00263_case_057", "p00263_case_058", "p00263_case_059", "p00263_case_060", "p00263_case_061", "p00263_case_062", "p00263_case_063", "p00263_case_064", "p00263_case_065", "p00263_case_066", "p00263_case_067", "p00263_case_068", "p00263_case_069", "p00263_case_070", "p00263_case_071", "p00263_case_072", "p00263_case_073", "p00263_case_074", "p00263_case_075", "p00263_case_076", "p00263_case_077", "p00263_case_078", "p00263_case_079", "p00263_case_080", "p00263_case_081", "p00263_case_082", "p00263_case_083", "p00263_case_084", "p00263_case_085", "p00263_case_086", "p00263_case_087", "p00263_case_088", "p00263_case_089", "p00263_case_090", "p00263_case_091", "p00263_case_092", "p00263_case_093", "p00263_case_094", "p00263_case_095", "p00263_case_096", "p00263_case_097", "p00263_case_098", "p00263_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "for i in range(eval(input())):\n b = int(input(), 16)\n s = 1 << 31\n p = \"\"\n if b & s != 0:\n b ^= s\n p = \"-\"\n a = int(b * 1.0 / (1 << 7))\n print(p + str(a) + str(abs(b * 1.0 / (1 << 7) - a))[1:])\n", "fast_code_sha256": "59b009c5f295f790892cf5fe9dd68d43352544426ae4ab638f77f5edd3158cdc", "fast_id": "p00263_59b009c5f295f790892cf5fe9dd68d43352544426ae4ab638f77f5edd3158cdc", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "for i in range(eval(input())):\n b = int(input(), 16)\n s = 1 << 31\n p = \"\"\n if b & s != 0:\n b ^= s\n p = \"-\"\n a = int(b * 1.0 / (1 << 7))\n print(p + str(a) + str(abs(b * 1.0 / (1 << 7) - a))[1:])\n", "measured_fast_code_sha256": "59b009c5f295f790892cf5fe9dd68d43352544426ae4ab638f77f5edd3158cdc", "measured_slow_code": "for i in range(eval(input())):\n b = format(int(input(), 16), \"b\").zfill(32)\n a1 = 0\n a2 = 0.0\n for i in range(1, 25):\n a1 += int(b[i]) * 2 ** (24 - i)\n for i in range(25, 32):\n a2 += int(b[i]) * 2 ** (24 - i)\n print(\"-\" * int(b[0]) + str(a1) + str(a2)[1:])\n", "measured_slow_code_sha256": "d0dfe2201444dca33b0e5be616f00e2983c025a640a772166a652b52efa0ed46", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 5.752061507182988, "pair_id": "python_v2_6779ff4f50f15e0fd3aa694d", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p00263", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p00263_59b009c5f295f790892cf5fe9dd68d43352544426ae4ab638f77f5edd3158cdc.jsonl.gz", "inputs": "reproduction/python/inputs/p00263.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p00263_d0dfe2201444dca33b0e5be616f00e2983c025a640a772166a652b52efa0ed46.jsonl.gz"}, "slow_code": "for i in range(eval(input())):\n b = format(int(input(), 16), \"b\").zfill(32)\n a1 = 0\n a2 = 0.0\n for i in range(1, 25):\n a1 += int(b[i]) * 2 ** (24 - i)\n for i in range(25, 32):\n a2 += int(b[i]) * 2 ** (24 - i)\n print(\"-\" * int(b[0]) + str(a1) + str(a2)[1:])\n", "slow_code_sha256": "d0dfe2201444dca33b0e5be616f00e2983c025a640a772166a652b52efa0ed46", "slow_id": "p00263_d0dfe2201444dca33b0e5be616f00e2983c025a640a772166a652b52efa0ed46", "speedup": 4.500389266848692, "stratum": "4-8", "within_pair_jaccard": 0.4642857142857143, "workload": {"case_count": 100, "description": "Convert Q 32-bit sign-magnitude fixed-point bit patterns to exact decimal values. Each pattern is eight lowercase hexadecimal digits: one sign bit, 24 integer bits and seven fractional bits. Preserve negative zero; trim trailing fractional zeros but retain at least one fractional digit. Observed inputs: Q=1..10000 (median 100); hex_digits=8.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 90006, "median": 904.0, "min": 11}, "input_format": ["Q\ns_1\n...\ns_Q (eight hexadecimal digits per line)"], "input_format_status": "source_input_section", "input_lines": {"max": 10001, "median": 101.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 10001, "median": 101.0, "min": 2}}} -{"case_ids": ["p03476_case_000", "p03476_case_001", "p03476_case_002", "p03476_case_003", "p03476_case_004", "p03476_case_005", "p03476_case_006", "p03476_case_007", "p03476_case_008", "p03476_case_009", "p03476_case_010", "p03476_case_011", "p03476_case_012", "p03476_case_013", "p03476_case_014", "p03476_case_015", "p03476_case_016", "p03476_case_017", "p03476_case_018", "p03476_case_019", "p03476_case_020", "p03476_case_021", "p03476_case_022", "p03476_case_023", "p03476_case_024", "p03476_case_025", "p03476_case_026", "p03476_case_027", "p03476_case_028", "p03476_case_029", "p03476_case_030", "p03476_case_031", "p03476_case_032", "p03476_case_033", "p03476_case_034", "p03476_case_035", "p03476_case_036", "p03476_case_037", "p03476_case_038", "p03476_case_039", "p03476_case_040", "p03476_case_041", "p03476_case_042", "p03476_case_043", "p03476_case_044", "p03476_case_045", "p03476_case_046", "p03476_case_047", "p03476_case_048", "p03476_case_049", "p03476_case_050", "p03476_case_051", "p03476_case_052", "p03476_case_053", "p03476_case_054", "p03476_case_055", "p03476_case_056", "p03476_case_057", "p03476_case_058", "p03476_case_059", "p03476_case_060", "p03476_case_061", "p03476_case_062", "p03476_case_063", "p03476_case_064", "p03476_case_065", "p03476_case_066", "p03476_case_067", "p03476_case_068", "p03476_case_069", "p03476_case_070", "p03476_case_071", "p03476_case_072", "p03476_case_073", "p03476_case_074", "p03476_case_075", "p03476_case_076", "p03476_case_077", "p03476_case_078", "p03476_case_079", "p03476_case_080", "p03476_case_081", "p03476_case_082", "p03476_case_083", "p03476_case_084", "p03476_case_085", "p03476_case_086", "p03476_case_087", "p03476_case_088", "p03476_case_089", "p03476_case_090", "p03476_case_091", "p03476_case_092", "p03476_case_093", "p03476_case_094", "p03476_case_095", "p03476_case_096", "p03476_case_097", "p03476_case_098", "p03476_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "executable_AST_equal_except_explicit_explanatory_string_removal_and_all_frozen_inputs_checker_pass", "fast_code": "from sys import stdin, setrecursionlimit\nfrom itertools import accumulate\n\nsetrecursionlimit(10**9)\nINF = 1 << 60\n\n\ndef input():\n return stdin.readline().strip()\n\n\ndef prime_numbers(n):\n if n < 2:\n return []\n m = (n + 1) // 2\n p = [True] * m\n for i in range(1, int((n**0.5 - 1) / 2) + 1):\n if p[i]:\n for j in range(2 * i * (i + 1), m, 2 * i + 1):\n p[j] = False\n a = [2 * i + 1 for i in range(m) if p[i]]\n a[0] = 2\n return a\n\n\nN = 10**5\nP = set(prime_numbers(N))\nP = [n for n in P if (n + 1) // 2 in P]\na = [0] * (N + 1)\nfor n in P:\n a[n] = 1\na = list(accumulate(a))\nQ, *LR = list(map(int, open(0).read().split()))\nfor l, r in zip(*[iter(LR)] * 2):\n print((a[r] - a[l - 1]))\n", "fast_code_sha256": "7e6b28ac3581f950e4523bab1c21d86a81f6f7768e5a20329f6e988118f19d41", "fast_id": "p03476_7e6b28ac3581f950e4523bab1c21d86a81f6f7768e5a20329f6e988118f19d41", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from sys import stdin, setrecursionlimit\nfrom itertools import accumulate\n\nsetrecursionlimit(10**9)\nINF = 1 << 60\n\n\ndef input():\n return stdin.readline().strip()\n\n\ndef prime_numbers(n):\n if n < 2:\n return []\n m = (n + 1) // 2\n p = [True] * m\n for i in range(1, int((n**0.5 - 1) / 2) + 1):\n if p[i]:\n for j in range(2 * i * (i + 1), m, 2 * i + 1):\n p[j] = False\n a = [2 * i + 1 for i in range(m) if p[i]]\n a[0] = 2\n return a\n\n\nN = 10**5\nP = set(prime_numbers(N))\nP = [n for n in P if (n + 1) // 2 in P]\na = [0] * (N + 1)\nfor n in P:\n a[n] = 1\na = list(accumulate(a))\nQ, *LR = list(map(int, open(0).read().split()))\nfor l, r in zip(*[iter(LR)] * 2):\n print((a[r] - a[l - 1]))\n", "measured_fast_code_sha256": "7e6b28ac3581f950e4523bab1c21d86a81f6f7768e5a20329f6e988118f19d41", "measured_slow_code": "def isprime(n):\n \"\"\"check if integer n is a prime\"\"\"\n # make sure n is a positive integer\n n = abs(int(n))\n # 0 and 1 are not primes\n if n < 2:\n return False\n # 2 is the only even prime number\n if n == 2:\n return True\n # all other even numbers are not primes\n if not n & 1:\n return False\n # range starts with 3 and only needs to go up\n # the square root of n for all odd numbers\n for x in range(3, int(n**0.5) + 1, 2):\n if n % x == 0:\n return False\n return True\n\n\ndef resolve():\n q = int(eval(input()))\n qs = [list(map(int, input().split())) for _ in range(q)]\n t = [0] * (10**5 + 1)\n for i in range(10**5):\n v = 1 if isprime(i + 1) and isprime((i + 2) / 2) else 0\n t[i + 1] = t[i] + v\n for l, r in qs:\n if l == r:\n print((1 if isprime(l) and isprime((l + 2) / 2) else 0))\n else:\n print((t[r] - t[l - 1]))\n\n\nresolve()\n", "measured_slow_code_sha256": "f983b4089c37289abbde2932a5be0f208d53db1149fb26d46fe7b6e95e35ee31", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 6.340431052606926, "pair_id": "python_v2_affb9b4b1c8936ed84d5abd7", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03476", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03476_7e6b28ac3581f950e4523bab1c21d86a81f6f7768e5a20329f6e988118f19d41.jsonl.gz", "inputs": "reproduction/python/inputs/p03476.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03476_f983b4089c37289abbde2932a5be0f208d53db1149fb26d46fe7b6e95e35ee31.jsonl.gz"}, "slow_code": "def isprime(n):\n\n n = abs(int(n))\n\n if n < 2:\n return False\n\n if n == 2:\n return True\n\n if not n & 1:\n return False\n\n for x in range(3, int(n**0.5) + 1, 2):\n if n % x == 0:\n return False\n return True\n\n\ndef resolve():\n q = int(eval(input()))\n qs = [list(map(int, input().split())) for _ in range(q)]\n t = [0] * (10**5 + 1)\n for i in range(10**5):\n v = 1 if isprime(i + 1) and isprime((i + 2) / 2) else 0\n t[i + 1] = t[i] + v\n for l, r in qs:\n if l == r:\n print((1 if isprime(l) and isprime((l + 2) / 2) else 0))\n else:\n print((t[r] - t[l - 1]))\n\n\nresolve()\n", "slow_code_sha256": "9175a6102e9f30bfa05e2b93d01b1f1c229b1972f3871522f495e1a5817d832f", "slow_id": "p03476_f983b4089c37289abbde2932a5be0f208d53db1149fb26d46fe7b6e95e35ee31", "speedup": 7.234781322316638, "stratum": "4-8", "within_pair_jaccard": 0.3582089552238806, "workload": {"case_count": 100, "description": "For each inclusive odd-endpoint interval [l_i,r_i], count odd integers x for which both x and (x+1)/2 are prime. Process Q independent queries. Observed inputs: Q=1..100000 (median 25000); l_i=1..99999; r_i=1..99999.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1189051, "median": 294556.5, "min": 6}, "input_format": ["Q\nl_1 r_1\n...\nl_Q r_Q"], "input_format_status": "source_input_section", "input_lines": {"max": 100001, "median": 25001.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200001, "median": 50001.0, "min": 3}}} -{"case_ids": ["p02244_case_000", "p02244_case_001", "p02244_case_002", "p02244_case_003", "p02244_case_004", "p02244_case_005", "p02244_case_006", "p02244_case_007", "p02244_case_008", "p02244_case_009", "p02244_case_010", "p02244_case_011", "p02244_case_012", "p02244_case_013", "p02244_case_014", "p02244_case_015", "p02244_case_016", "p02244_case_017", "p02244_case_018", "p02244_case_019", "p02244_case_020", "p02244_case_021", "p02244_case_022", "p02244_case_023", "p02244_case_024", "p02244_case_025", "p02244_case_026", "p02244_case_027", "p02244_case_028", "p02244_case_029", "p02244_case_030", "p02244_case_031", "p02244_case_032", "p02244_case_033", "p02244_case_034", "p02244_case_035", "p02244_case_036", "p02244_case_037", "p02244_case_038", "p02244_case_039", "p02244_case_040", "p02244_case_041", "p02244_case_042", "p02244_case_043", "p02244_case_044", "p02244_case_045", "p02244_case_046", "p02244_case_047", "p02244_case_048", "p02244_case_049", "p02244_case_050", "p02244_case_051", "p02244_case_052", "p02244_case_053", "p02244_case_054", "p02244_case_055", "p02244_case_056", "p02244_case_057", "p02244_case_058", "p02244_case_059", "p02244_case_060", "p02244_case_061", "p02244_case_062", "p02244_case_063", "p02244_case_064", "p02244_case_065", "p02244_case_066", "p02244_case_067", "p02244_case_068", "p02244_case_069", "p02244_case_070", "p02244_case_071", "p02244_case_072", "p02244_case_073", "p02244_case_074", "p02244_case_075", "p02244_case_076", "p02244_case_077", "p02244_case_078", "p02244_case_079", "p02244_case_080", "p02244_case_081", "p02244_case_082", "p02244_case_083", "p02244_case_084", "p02244_case_085", "p02244_case_086", "p02244_case_087", "p02244_case_088", "p02244_case_089", "p02244_case_090", "p02244_case_091", "p02244_case_092", "p02244_case_093", "p02244_case_094", "p02244_case_095", "p02244_case_096", "p02244_case_097", "p02244_case_098", "p02244_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from functools import lru_cache\n\ncc = [[\".\" for i in range(8)] for j in range(8)]\n\n\ndef check(cc, a, b):\n ss = list(zip(*cc))\n if \"Q\" in cc[a]:\n return False\n if \"Q\" in ss[b]:\n return False\n d = []\n for i in range(8):\n for j in range(8):\n try:\n if j + abs(a - i) == b:\n d.append(cc[i][j])\n if j - abs(a - i) == b:\n d.append(cc[i][j])\n except IndexError:\n continue\n if \"Q\" in d:\n return False\n return True\n\n\ndef chess(s, queen):\n if queen == 8:\n return s\n for i in range(8):\n for j in range(8):\n if check(s, i, j):\n sol = s\n sol[i][j] = \"Q\"\n if chess(sol, queen + 1) != [[]]:\n return sol\n else:\n sol[i][j] = \".\"\n return [[]]\n\n\nk = int(eval(input()))\nfor i in range(k):\n a, b = [int(x) for x in input().split()]\n cc[a][b] = \"Q\"\nans = chess(cc, k)\nprint((\"\\n\".join(list([\"\".join(x) for x in ans]))))\n", "fast_code_sha256": "94ec109ccd8bd9441b7a500ac9b67e1cafa7fd6c57f646835c6b0dc73a712deb", "fast_id": "p02244_94ec109ccd8bd9441b7a500ac9b67e1cafa7fd6c57f646835c6b0dc73a712deb", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from functools import lru_cache\n\ncc = [[\".\" for i in range(8)] for j in range(8)]\n\n\ndef check(cc, a, b):\n ss = list(zip(*cc))\n if \"Q\" in cc[a]:\n return False\n if \"Q\" in ss[b]:\n return False\n d = []\n for i in range(8):\n for j in range(8):\n try:\n if j + abs(a - i) == b:\n d.append(cc[i][j])\n if j - abs(a - i) == b:\n d.append(cc[i][j])\n except IndexError:\n continue\n if \"Q\" in d:\n return False\n return True\n\n\ndef chess(s, queen):\n if queen == 8:\n return s\n for i in range(8):\n for j in range(8):\n if check(s, i, j):\n sol = s\n sol[i][j] = \"Q\"\n if chess(sol, queen + 1) != [[]]:\n return sol\n else:\n sol[i][j] = \".\"\n return [[]]\n\n\nk = int(eval(input()))\nfor i in range(k):\n a, b = [int(x) for x in input().split()]\n cc[a][b] = \"Q\"\nans = chess(cc, k)\nprint((\"\\n\".join(list([\"\".join(x) for x in ans]))))\n", "measured_fast_code_sha256": "94ec109ccd8bd9441b7a500ac9b67e1cafa7fd6c57f646835c6b0dc73a712deb", "measured_slow_code": "from itertools import product\nfrom copy import deepcopy, copy\n\n\nclass QueenMAP:\n def __init__(self):\n self.yoko = set()\n self.tate = set()\n self.naname1 = set()\n self.naname2 = set()\n self.MAP = [[\".\"] * 8 for _ in range(8)]\n\n def add(self, y, x):\n self.MAP[y][x] = \"Q\"\n self.yoko.add(y)\n self.tate.add(x)\n self.naname1.add(y - x)\n self.naname2.add(x + y)\n\n def check(self, y, x):\n if (\n y in self.yoko\n or x in self.tate\n or (y - x) in self.naname1\n or (x + y) in self.naname2\n ):\n return False\n return True\n\n def allcheck(self):\n for i in range(8):\n if not \"Q\" in self.MAP[i]:\n return False\n return True\n\n\ndef nuri(m, a, b):\n for i in range(8):\n m[a][i] = \"1\"\n m[i][b] = \"1\"\n if a + b < 8:\n y = a + b\n x = 0\n l = a + b + 1\n else:\n y = 7\n x = a + b - 7\n l = 15 - a - b\n for i in range(l):\n m[y - i][x + i] = \"1\"\n if a <= b:\n ny = 0\n nx = b - a\n l = 8 - (b + a)\n else:\n ny = a - b\n nx = 0\n l = 8 - (a - b)\n for i in range(l):\n m[ny + i][nx + i] = \"1\"\n return m\n\n\ndef solve(MAP0, MAP, n):\n dp = [(deepcopy(MAP0), deepcopy(MAP), n)]\n while dp:\n m0, m, cnt = dp.pop()\n if cnt == 8:\n flg = True\n for r in range(8):\n if \"\".join(map(str, m0[r])).find(\"0\"):\n flg = False\n break\n if flg:\n return m\n for i in range(8):\n for j in range(8):\n if m0[i][j] == \"0\":\n dp.append((nuri(deepcopy(m0), i, j), deepcopy(m), cnt + 1))\n return m\n\n\ndef MAIN():\n f = lambda M: \"\\n\".join(\"\".join(map(str, m)) for m in M)\n QM = QueenMAP()\n n = int(eval(input()))\n for _ in range(n):\n a, b = list(map(int, input().split()))\n QM.add(a, b)\n dp = [(deepcopy(QM), n)]\n while dp:\n Q, cnt = dp.pop()\n if cnt == 8:\n if Q.allcheck():\n print((f(Q.MAP)))\n break\n continue\n cnt += 1\n for i in range(8):\n for j in range(8):\n if Q.check(i, j):\n CQ = deepcopy(Q)\n CQ.add(i, j)\n dp.append((CQ, cnt))\n\n\nMAIN()\n", "measured_slow_code_sha256": "948cc92d89bed81c02042017d831a1b4230626416de2f1f0f39fed2233e48434", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.1597975510672116, "pair_id": "python_v2_090dec55b0c130c7a5116077", "per_case_slow_code_faster_fraction": 0.1, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02244", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02244_94ec109ccd8bd9441b7a500ac9b67e1cafa7fd6c57f646835c6b0dc73a712deb.jsonl.gz", "inputs": "reproduction/python/inputs/p02244.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02244_948cc92d89bed81c02042017d831a1b4230626416de2f1f0f39fed2233e48434.jsonl.gz"}, "slow_code": "from itertools import product\nfrom copy import deepcopy, copy\n\n\nclass QueenMAP:\n def __init__(self):\n self.yoko = set()\n self.tate = set()\n self.naname1 = set()\n self.naname2 = set()\n self.MAP = [[\".\"] * 8 for _ in range(8)]\n\n def add(self, y, x):\n self.MAP[y][x] = \"Q\"\n self.yoko.add(y)\n self.tate.add(x)\n self.naname1.add(y - x)\n self.naname2.add(x + y)\n\n def check(self, y, x):\n if (\n y in self.yoko\n or x in self.tate\n or (y - x) in self.naname1\n or (x + y) in self.naname2\n ):\n return False\n return True\n\n def allcheck(self):\n for i in range(8):\n if not \"Q\" in self.MAP[i]:\n return False\n return True\n\n\ndef nuri(m, a, b):\n for i in range(8):\n m[a][i] = \"1\"\n m[i][b] = \"1\"\n if a + b < 8:\n y = a + b\n x = 0\n l = a + b + 1\n else:\n y = 7\n x = a + b - 7\n l = 15 - a - b\n for i in range(l):\n m[y - i][x + i] = \"1\"\n if a <= b:\n ny = 0\n nx = b - a\n l = 8 - (b + a)\n else:\n ny = a - b\n nx = 0\n l = 8 - (a - b)\n for i in range(l):\n m[ny + i][nx + i] = \"1\"\n return m\n\n\ndef solve(MAP0, MAP, n):\n dp = [(deepcopy(MAP0), deepcopy(MAP), n)]\n while dp:\n m0, m, cnt = dp.pop()\n if cnt == 8:\n flg = True\n for r in range(8):\n if \"\".join(map(str, m0[r])).find(\"0\"):\n flg = False\n break\n if flg:\n return m\n for i in range(8):\n for j in range(8):\n if m0[i][j] == \"0\":\n dp.append((nuri(deepcopy(m0), i, j), deepcopy(m), cnt + 1))\n return m\n\n\ndef MAIN():\n f = lambda M: \"\\n\".join(\"\".join(map(str, m)) for m in M)\n QM = QueenMAP()\n n = int(eval(input()))\n for _ in range(n):\n a, b = list(map(int, input().split()))\n QM.add(a, b)\n dp = [(deepcopy(QM), n)]\n while dp:\n Q, cnt = dp.pop()\n if cnt == 8:\n if Q.allcheck():\n print((f(Q.MAP)))\n break\n continue\n cnt += 1\n for i in range(8):\n for j in range(8):\n if Q.check(i, j):\n CQ = deepcopy(Q)\n CQ.add(i, j)\n dp.append((CQ, cnt))\n\n\nMAIN()\n", "slow_code_sha256": "948cc92d89bed81c02042017d831a1b4230626416de2f1f0f39fed2233e48434", "slow_id": "p02244_948cc92d89bed81c02042017d831a1b4230626416de2f1f0f39fed2233e48434", "speedup": 2.662280402456435, "stratum": "2-4", "within_pair_jaccard": 0.3225806451612903, "workload": {"case_count": 100, "description": "Complete an 8-by-8 board to eight nonattacking queens while preserving k fixed placements. Queens must differ in row, column and diagonal; coordinates are 0-based. The saved input has exactly one completion. Output Q for queens and . for empty cells. Observed inputs: k=2..8 (median 4); row=0..7; column=0..7.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 34, "median": 18.0, "min": 10}, "input_format": ["k\nr_1 c_1\n...\nr_k c_k"], "input_format_status": "source_input_section", "input_lines": {"max": 9, "median": 5.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 17, "median": 9.0, "min": 5}}} -{"case_ids": ["p02418_case_000", "p02418_case_001", "p02418_case_002", "p02418_case_003", "p02418_case_004", "p02418_case_005", "p02418_case_006", "p02418_case_007", "p02418_case_008", "p02418_case_009", "p02418_case_010", "p02418_case_011", "p02418_case_012", "p02418_case_013", "p02418_case_014", "p02418_case_015", "p02418_case_016", "p02418_case_017", "p02418_case_018", "p02418_case_019", "p02418_case_020", "p02418_case_021", "p02418_case_022", "p02418_case_023", "p02418_case_024", "p02418_case_025", "p02418_case_026", "p02418_case_027", "p02418_case_028", "p02418_case_029", "p02418_case_030", "p02418_case_031", "p02418_case_032", "p02418_case_033", "p02418_case_034", "p02418_case_035", "p02418_case_036", "p02418_case_037", "p02418_case_038", "p02418_case_039", "p02418_case_040", "p02418_case_041", "p02418_case_042", "p02418_case_043", "p02418_case_044", "p02418_case_045", "p02418_case_046", "p02418_case_047", "p02418_case_048", "p02418_case_049", "p02418_case_050", "p02418_case_051", "p02418_case_052", "p02418_case_053", "p02418_case_054", "p02418_case_055", "p02418_case_056", "p02418_case_057", "p02418_case_058", "p02418_case_059", "p02418_case_060", "p02418_case_061", "p02418_case_062", "p02418_case_063", "p02418_case_064", "p02418_case_065", "p02418_case_066", "p02418_case_067", "p02418_case_068", "p02418_case_069", "p02418_case_070", "p02418_case_071", "p02418_case_072", "p02418_case_073", "p02418_case_074", "p02418_case_075", "p02418_case_076", "p02418_case_077", "p02418_case_078", "p02418_case_079", "p02418_case_080", "p02418_case_081", "p02418_case_082", "p02418_case_083", "p02418_case_084", "p02418_case_085", "p02418_case_086", "p02418_case_087", "p02418_case_088", "p02418_case_089", "p02418_case_090", "p02418_case_091", "p02418_case_092", "p02418_case_093", "p02418_case_094", "p02418_case_095", "p02418_case_096", "p02418_case_097", "p02418_case_098", "p02418_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "ring = input() * 2\nword = input()\nif word in ring:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "fast_code_sha256": "3ed535ed0bc6c202b0386a960b00e5549d575062c87ec6b3d7cedb112a9c2f5e", "fast_id": "p02418_3ed535ed0bc6c202b0386a960b00e5549d575062c87ec6b3d7cedb112a9c2f5e", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "ring = input() * 2\nword = input()\nif word in ring:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "measured_fast_code_sha256": "3ed535ed0bc6c202b0386a960b00e5549d575062c87ec6b3d7cedb112a9c2f5e", "measured_slow_code": "s = input()\ntarget = input()\nring = s * 2\nf = 0\nfor i in range(len(s)):\n if ring[i : i + len(target)] == target:\n f = 1\n break\nif f == 1:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "measured_slow_code_sha256": "cef61ea324de806594aef8e5b25dea0c55fe9633d20e9e7f7cc94749726f1030", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.111112548356645, "pair_id": "python_v2_d6968041adae024bc8b17db3", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02418", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02418_3ed535ed0bc6c202b0386a960b00e5549d575062c87ec6b3d7cedb112a9c2f5e.jsonl.gz", "inputs": "reproduction/python/inputs/p02418.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02418_cef61ea324de806594aef8e5b25dea0c55fe9633d20e9e7f7cc94749726f1030.jsonl.gz"}, "slow_code": "s = input()\ntarget = input()\nring = s * 2\nf = 0\nfor i in range(len(s)):\n if ring[i : i + len(target)] == target:\n f = 1\n break\nif f == 1:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "slow_code_sha256": "cef61ea324de806594aef8e5b25dea0c55fe9633d20e9e7f7cc94749726f1030", "slow_id": "p02418_cef61ea324de806594aef8e5b25dea0c55fe9633d20e9e7f7cc94749726f1030", "speedup": 2.3317256052251314, "stratum": "2-4", "within_pair_jaccard": 0.45, "workload": {"case_count": 100, "description": "Decide whether lowercase pattern p appears contiguously in circular text s, allowing a match to cross the end-to-start boundary. The pattern is nonempty and no longer than the ring text. Observed inputs: s_length=1..100 (median 50); p_length=1..100 (median 15).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 202, "median": 89.5, "min": 4}, "input_format": ["s\np"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p02554_case_000", "p02554_case_001", "p02554_case_002", "p02554_case_003", "p02554_case_004", "p02554_case_005", "p02554_case_006", "p02554_case_007", "p02554_case_008", "p02554_case_009", "p02554_case_010", "p02554_case_011", "p02554_case_012", "p02554_case_013", "p02554_case_014", "p02554_case_015", "p02554_case_016", "p02554_case_017", "p02554_case_018", "p02554_case_019", "p02554_case_020", "p02554_case_021", "p02554_case_022", "p02554_case_023", "p02554_case_024", "p02554_case_025", "p02554_case_026", "p02554_case_027", "p02554_case_028", "p02554_case_029", "p02554_case_030", "p02554_case_031", "p02554_case_032", "p02554_case_033", "p02554_case_034", "p02554_case_035", "p02554_case_036", "p02554_case_037", "p02554_case_038", "p02554_case_039", "p02554_case_040", "p02554_case_041", "p02554_case_042", "p02554_case_043", "p02554_case_044", "p02554_case_045", "p02554_case_046", "p02554_case_047", "p02554_case_048", "p02554_case_049", "p02554_case_050", "p02554_case_051", "p02554_case_052", "p02554_case_053", "p02554_case_054", "p02554_case_055", "p02554_case_056", "p02554_case_057", "p02554_case_058", "p02554_case_059", "p02554_case_060", "p02554_case_061", "p02554_case_062", "p02554_case_063", "p02554_case_064", "p02554_case_065", "p02554_case_066", "p02554_case_067", "p02554_case_068", "p02554_case_069", "p02554_case_070", "p02554_case_071", "p02554_case_072", "p02554_case_073", "p02554_case_074", "p02554_case_075", "p02554_case_076", "p02554_case_077", "p02554_case_078", "p02554_case_079", "p02554_case_080", "p02554_case_081", "p02554_case_082", "p02554_case_083", "p02554_case_084", "p02554_case_085", "p02554_case_086", "p02554_case_087", "p02554_case_088", "p02554_case_089", "p02554_case_090", "p02554_case_091", "p02554_case_092", "p02554_case_093", "p02554_case_094", "p02554_case_095", "p02554_case_096", "p02554_case_097", "p02554_case_098", "p02554_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "executable_AST_equal_except_explicit_explanatory_string_removal_and_all_frozen_inputs_checker_pass", "fast_code": "N = int(eval(input()))\nM = 10**9 + 7\nans = (pow(10, N, M) - 2 * pow(9, N, M) + pow(8, N, M)) % M\nprint(ans)\n", "fast_code_sha256": "65b52025f80ff7e8400929d26a7fa9ea5d5b2cb924509eccf9c8d4dc0fdbc45f", "fast_id": "p02554_65b52025f80ff7e8400929d26a7fa9ea5d5b2cb924509eccf9c8d4dc0fdbc45f", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N = int(eval(input()))\nM = 10**9 + 7\nans = (pow(10, N, M) - 2 * pow(9, N, M) + pow(8, N, M)) % M\nprint(ans)\n", "measured_fast_code_sha256": "65b52025f80ff7e8400929d26a7fa9ea5d5b2cb924509eccf9c8d4dc0fdbc45f", "measured_slow_code": "MOD = 10**9 + 7\n\n\ndef solve(n):\n \"\"\"\n 0: {}\n 1: {0}\n 2: {9}\n 3: {0,9}\n \"\"\"\n dp = [[0] * 4 for i in range(n + 1)]\n dp[0][0] = 1\n for i in range(n):\n dp[i + 1][3] = (10 * dp[i][3] + dp[i][2] + dp[i][1]) % MOD\n dp[i + 1][2] = (9 * dp[i][2] + dp[i][0]) % MOD\n dp[i + 1][1] = (9 * dp[i][1] + dp[i][0]) % MOD\n dp[i + 1][0] = (8 * dp[i][0]) % MOD\n return dp[n][3]\n\n\nn = int(eval(input()))\nprint((solve(n)))\n", "measured_slow_code_sha256": "1216aa013ca95268c8cea10ef1956fc82ecf53c33048dc021f31f4ae82487ba4", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 10705.77610969109, "pair_id": "python_v2_525d5ebed7f54af45437eb3a", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02554", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02554_65b52025f80ff7e8400929d26a7fa9ea5d5b2cb924509eccf9c8d4dc0fdbc45f.jsonl.gz", "inputs": "reproduction/python/inputs/p02554.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02554_1216aa013ca95268c8cea10ef1956fc82ecf53c33048dc021f31f4ae82487ba4.jsonl.gz"}, "slow_code": "MOD = 10**9 + 7\n\n\ndef solve(n):\n dp = [[0] * 4 for i in range(n + 1)]\n dp[0][0] = 1\n for i in range(n):\n dp[i + 1][3] = (10 * dp[i][3] + dp[i][2] + dp[i][1]) % MOD\n dp[i + 1][2] = (9 * dp[i][2] + dp[i][0]) % MOD\n dp[i + 1][1] = (9 * dp[i][1] + dp[i][0]) % MOD\n dp[i + 1][0] = (8 * dp[i][0]) % MOD\n return dp[n][3]\n\n\nn = int(eval(input()))\nprint((solve(n)))\n", "slow_code_sha256": "d34cbcef17a1809eb9aaea9acac748f4f348edb348ac1a61f3b30198ffe07352", "slow_id": "p02554_1216aa013ca95268c8cea10ef1956fc82ecf53c33048dc021f31f4ae82487ba4", "speedup": 2040.3178291513238, "stratum": "8+", "within_pair_jaccard": 0.3333333333333333, "workload": {"case_count": 100, "description": "Count length-N sequences over digits 0..9 containing both 0 and 9, modulo 1000000007. Observed inputs: N=1..1000000 (median 299407).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 8, "median": 7.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p03006_case_000", "p03006_case_001", "p03006_case_002", "p03006_case_003", "p03006_case_004", "p03006_case_005", "p03006_case_006", "p03006_case_007", "p03006_case_008", "p03006_case_009", "p03006_case_010", "p03006_case_011", "p03006_case_012", "p03006_case_013", "p03006_case_014", "p03006_case_015", "p03006_case_016", "p03006_case_017", "p03006_case_018", "p03006_case_019", "p03006_case_020", "p03006_case_021", "p03006_case_022", "p03006_case_023", "p03006_case_024", "p03006_case_025", "p03006_case_026", "p03006_case_027", "p03006_case_028", "p03006_case_029", "p03006_case_030", "p03006_case_031", "p03006_case_032", "p03006_case_033", "p03006_case_034", "p03006_case_035", "p03006_case_036", "p03006_case_037", "p03006_case_038", "p03006_case_039", "p03006_case_040", "p03006_case_041", "p03006_case_042", "p03006_case_043", "p03006_case_044", "p03006_case_045", "p03006_case_046", "p03006_case_047", "p03006_case_048", "p03006_case_049", "p03006_case_050", "p03006_case_051", "p03006_case_052", "p03006_case_053", "p03006_case_054", "p03006_case_055", "p03006_case_056", "p03006_case_057", "p03006_case_058", "p03006_case_059", "p03006_case_060", "p03006_case_061", "p03006_case_062", "p03006_case_063", "p03006_case_064", "p03006_case_065", "p03006_case_066", "p03006_case_067", "p03006_case_068", "p03006_case_069", "p03006_case_070", "p03006_case_071", "p03006_case_072", "p03006_case_073", "p03006_case_074", "p03006_case_075", "p03006_case_076", "p03006_case_077", "p03006_case_078", "p03006_case_079", "p03006_case_080", "p03006_case_081", "p03006_case_082", "p03006_case_083", "p03006_case_084", "p03006_case_085", "p03006_case_086", "p03006_case_087", "p03006_case_088", "p03006_case_089", "p03006_case_090", "p03006_case_091", "p03006_case_092", "p03006_case_093", "p03006_case_094", "p03006_case_095", "p03006_case_096", "p03006_case_097", "p03006_case_098", "p03006_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from collections import Counter\nfrom itertools import permutations\n\nN = int(eval(input()))\nx, y = (\n list(zip(*(list(map(int, input().split())) for _ in range(N)))) if N else ((), ())\n)\n\n\nans = (\n 1\n if N == 1\n else N\n - max(\n Counter(\n (x[i] - x[j], y[i] - y[j]) for i, j in permutations(list(range(N)), 2)\n ).values()\n )\n)\nprint(ans)\n", "fast_code_sha256": "85679f394ae60f0654dd4c5fdf85f7fe679bd09ea1804d5f6793f7346926ffc0", "fast_id": "p03006_1dd09cfba1bcd070711ca68e65bd6d6b6113a1826d178b576ecd39bb89d46b12", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from collections import Counter\nfrom itertools import permutations\n\nN = int(eval(input()))\nx, y = (\n list(zip(*(list(map(int, input().split())) for _ in range(N)))) if N else ((), ())\n)\n# (p, q) = (x_i - x_j, y_i - y_j) を満たす組(i, j)の個数が最大となるように\n# p, qを定めればよい\nans = (\n 1\n if N == 1\n else N\n - max(\n Counter(\n (x[i] - x[j], y[i] - y[j]) for i, j in permutations(list(range(N)), 2)\n ).values()\n )\n)\nprint(ans)\n", "measured_fast_code_sha256": "1dd09cfba1bcd070711ca68e65bd6d6b6113a1826d178b576ecd39bb89d46b12", "measured_slow_code": "from math import (\n ceil,\n floor,\n factorial,\n gcd,\n sqrt,\n log2,\n cos,\n sin,\n tan,\n acos,\n asin,\n atan,\n degrees,\n radians,\n pi,\n inf,\n)\nfrom itertools import (\n accumulate,\n groupby,\n permutations,\n combinations,\n product,\n combinations_with_replacement,\n)\nfrom collections import deque, defaultdict, Counter\nfrom bisect import bisect_left, bisect_right\nfrom operator import itemgetter\nfrom heapq import heapify, heappop, heappush\nfrom queue import Queue, LifoQueue, PriorityQueue\nfrom copy import deepcopy\nfrom time import time\nimport string\nimport sys\n\nsys.setrecursionlimit(10**7)\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef INT():\n return int(eval(input()))\n\n\ndef MAP():\n return list(map(int, input().split()))\n\n\ndef LIST():\n return list(MAP())\n\n\nn = INT()\nx = [LIST() for i in range(n)]\na = []\nfor i in range(n):\n for j in range(n):\n if i != j:\n a.append((x[j][0] - x[i][0], x[j][1] - x[i][1]))\na.sort()\ncount = 1\nreg = 1\nfor i in range(1, len(a)):\n if a[i][:] == a[i - 1][:]:\n count += 1\n reg = max(reg, count)\n else:\n count = 1\nif n == 1:\n ans = n\nelse:\n ans = n - reg\nprint(ans)\n", "measured_slow_code_sha256": "df539d82cce0b66ac388cb7626c1915f078dadd19fd45e23838905782b69fa8f", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 5.600678919841587, "pair_id": "python_v2_cc1eff05c333c51185e1e634", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03006", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03006_1dd09cfba1bcd070711ca68e65bd6d6b6113a1826d178b576ecd39bb89d46b12.jsonl.gz", "inputs": "reproduction/python/inputs/p03006.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03006_df539d82cce0b66ac388cb7626c1915f078dadd19fd45e23838905782b69fa8f.jsonl.gz"}, "slow_code": "from math import (\n ceil,\n floor,\n factorial,\n gcd,\n sqrt,\n log2,\n cos,\n sin,\n tan,\n acos,\n asin,\n atan,\n degrees,\n radians,\n pi,\n inf,\n)\nfrom itertools import (\n accumulate,\n groupby,\n permutations,\n combinations,\n product,\n combinations_with_replacement,\n)\nfrom collections import deque, defaultdict, Counter\nfrom bisect import bisect_left, bisect_right\nfrom operator import itemgetter\nfrom heapq import heapify, heappop, heappush\nfrom queue import Queue, LifoQueue, PriorityQueue\nfrom copy import deepcopy\nfrom time import time\nimport string\nimport sys\n\nsys.setrecursionlimit(10**7)\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef INT():\n return int(eval(input()))\n\n\ndef MAP():\n return list(map(int, input().split()))\n\n\ndef LIST():\n return list(MAP())\n\n\nn = INT()\nx = [LIST() for i in range(n)]\na = []\nfor i in range(n):\n for j in range(n):\n if i != j:\n a.append((x[j][0] - x[i][0], x[j][1] - x[i][1]))\na.sort()\ncount = 1\nreg = 1\nfor i in range(1, len(a)):\n if a[i][:] == a[i - 1][:]:\n count += 1\n reg = max(reg, count)\n else:\n count = 1\nif n == 1:\n ans = n\nelse:\n ans = n - reg\nprint(ans)\n", "slow_code_sha256": "df539d82cce0b66ac388cb7626c1915f078dadd19fd45e23838905782b69fa8f", "slow_id": "p03006_df539d82cce0b66ac388cb7626c1915f078dadd19fd45e23838905782b69fa8f", "speedup": 6.175254457005445, "stratum": "4-8", "within_pair_jaccard": 0.26373626373626374, "workload": {"case_count": 100, "description": "Collect N distinct plane points in any order, choosing one fixed nonzero integer displacement (p,q). A collection costs 0 if its point equals the previously collected point plus (p,q), otherwise 1, including the first. Minimize total cost. Observed inputs: N=1..50 (median 20); x_i=-999595444..998135854; y_i=-998893103..992792936.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1075, "median": 402.5, "min": 23}, "input_format": ["N\nx_1 y_1\n...\nx_N y_N"], "input_format_status": "source_input_section", "input_lines": {"max": 51, "median": 21.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 101, "median": 41.0, "min": 3}}} -{"case_ids": ["p03796_case_000", "p03796_case_001", "p03796_case_002", "p03796_case_003", "p03796_case_004", "p03796_case_005", "p03796_case_006", "p03796_case_007", "p03796_case_008", "p03796_case_009", "p03796_case_010", "p03796_case_011", "p03796_case_012", "p03796_case_013", "p03796_case_014", "p03796_case_015", "p03796_case_016", "p03796_case_017", "p03796_case_018", "p03796_case_019", "p03796_case_020", "p03796_case_021", "p03796_case_022", "p03796_case_023", "p03796_case_024", "p03796_case_025", "p03796_case_026", "p03796_case_027", "p03796_case_028", "p03796_case_029", "p03796_case_030", "p03796_case_031", "p03796_case_032", "p03796_case_033", "p03796_case_034", "p03796_case_035", "p03796_case_036", "p03796_case_037", "p03796_case_038", "p03796_case_039", "p03796_case_040", "p03796_case_041", "p03796_case_042", "p03796_case_043", "p03796_case_044", "p03796_case_045", "p03796_case_046", "p03796_case_047", "p03796_case_048", "p03796_case_049", "p03796_case_050", "p03796_case_051", "p03796_case_052", "p03796_case_053", "p03796_case_054", "p03796_case_055", "p03796_case_056", "p03796_case_057", "p03796_case_058", "p03796_case_059", "p03796_case_060", "p03796_case_061", "p03796_case_062", "p03796_case_063", "p03796_case_064", "p03796_case_065", "p03796_case_066", "p03796_case_067", "p03796_case_068", "p03796_case_069", "p03796_case_070", "p03796_case_071", "p03796_case_072", "p03796_case_073", "p03796_case_074", "p03796_case_075", "p03796_case_076", "p03796_case_077", "p03796_case_078", "p03796_case_079", "p03796_case_080", "p03796_case_081", "p03796_case_082", "p03796_case_083", "p03796_case_084", "p03796_case_085", "p03796_case_086", "p03796_case_087", "p03796_case_088", "p03796_case_089", "p03796_case_090", "p03796_case_091", "p03796_case_092", "p03796_case_093", "p03796_case_094", "p03796_case_095", "p03796_case_096", "p03796_case_097", "p03796_case_098", "p03796_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\n\n\ndef a(x):\n if x == 1:\n return 1\n else:\n d = 1\n for i in range(x + 1)[1:]:\n d *= i\n d %= 10**9 + 7\n return d\n\n\nprint((a(n)))\n", "fast_code_sha256": "03aa5f664ead8651e440f412429a1149561123cd4c6e6a5a427aa6c8f0bc4aae", "fast_id": "p03796_03aa5f664ead8651e440f412429a1149561123cd4c6e6a5a427aa6c8f0bc4aae", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\n\n\ndef a(x):\n if x == 1:\n return 1\n else:\n d = 1\n for i in range(x + 1)[1:]:\n d *= i\n d %= 10**9 + 7\n return d\n\n\nprint((a(n)))\n", "measured_fast_code_sha256": "03aa5f664ead8651e440f412429a1149561123cd4c6e6a5a427aa6c8f0bc4aae", "measured_slow_code": "import sys\nimport os\nimport math\n\nMOD = 1000000007\n\n\ndef main():\n if os.getenv(\"LOCAL\"):\n sys.stdin = open(\"input.txt\", \"r\")\n N = int(sys.stdin.readline().rstrip())\n print((math.factorial(N) % MOD))\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "95063337f9fc361b9b14d99b5c0d5d9f7a1898eff61239e227f8e13abc528c4c", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 6.097878417857267, "pair_id": "python_v2_4550b5cdd5dc439bcd5b1e6d", "per_case_slow_code_faster_fraction": 0.24, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03796", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03796_03aa5f664ead8651e440f412429a1149561123cd4c6e6a5a427aa6c8f0bc4aae.jsonl.gz", "inputs": "reproduction/python/inputs/p03796.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03796_95063337f9fc361b9b14d99b5c0d5d9f7a1898eff61239e227f8e13abc528c4c.jsonl.gz"}, "slow_code": "import sys\nimport os\nimport math\n\nMOD = 1000000007\n\n\ndef main():\n if os.getenv(\"LOCAL\"):\n sys.stdin = open(\"input.txt\", \"r\")\n N = int(sys.stdin.readline().rstrip())\n print((math.factorial(N) % MOD))\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "95063337f9fc361b9b14d99b5c0d5d9f7a1898eff61239e227f8e13abc528c4c", "slow_id": "p03796_95063337f9fc361b9b14d99b5c0d5d9f7a1898eff61239e227f8e13abc528c4c", "speedup": 3.7464893910356185, "stratum": "2-4", "within_pair_jaccard": 0.1282051282051282, "workload": {"case_count": 100, "description": "Starting with power 1, multiply it by i for i=1..N in order. Output the final power modulo 1000000007. Observed inputs: N=1..100000 (median 31648.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 7, "median": 6.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p04000_case_000", "p04000_case_001", "p04000_case_002", "p04000_case_003", "p04000_case_004", "p04000_case_005", "p04000_case_006", "p04000_case_007", "p04000_case_008", "p04000_case_009", "p04000_case_010", "p04000_case_011", "p04000_case_012", "p04000_case_013", "p04000_case_014", "p04000_case_015", "p04000_case_016", "p04000_case_017", "p04000_case_018", "p04000_case_019", "p04000_case_020", "p04000_case_021", "p04000_case_022", "p04000_case_023", "p04000_case_024", "p04000_case_025", "p04000_case_026", "p04000_case_027", "p04000_case_028", "p04000_case_029", "p04000_case_030", "p04000_case_031", "p04000_case_032", "p04000_case_033", "p04000_case_034", "p04000_case_035", "p04000_case_036", "p04000_case_037", "p04000_case_038", "p04000_case_039", "p04000_case_040", "p04000_case_041", "p04000_case_042", "p04000_case_043", "p04000_case_044", "p04000_case_045", "p04000_case_046", "p04000_case_047", "p04000_case_048", "p04000_case_049", "p04000_case_050", "p04000_case_051", "p04000_case_052", "p04000_case_053", "p04000_case_054", "p04000_case_055", "p04000_case_056", "p04000_case_057", "p04000_case_058", "p04000_case_059", "p04000_case_060", "p04000_case_061", "p04000_case_062", "p04000_case_063", "p04000_case_064", "p04000_case_065", "p04000_case_066", "p04000_case_067", "p04000_case_068", "p04000_case_069", "p04000_case_070", "p04000_case_071", "p04000_case_072", "p04000_case_073", "p04000_case_074", "p04000_case_075", "p04000_case_076", "p04000_case_077", "p04000_case_078", "p04000_case_079", "p04000_case_080", "p04000_case_081", "p04000_case_082", "p04000_case_083", "p04000_case_084", "p04000_case_085", "p04000_case_086", "p04000_case_087", "p04000_case_088", "p04000_case_089", "p04000_case_090", "p04000_case_091", "p04000_case_092", "p04000_case_093", "p04000_case_094", "p04000_case_095", "p04000_case_096", "p04000_case_097", "p04000_case_098", "p04000_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from collections import defaultdict\n\nH, W, N = map(int, input().split())\nD = defaultdict(int)\nfor i in range(N):\n h, w = map(int, input().split())\n h, w = h - 1, w - 1\n for dh in range(-1, 2):\n for dw in range(-1, 2):\n if not ((1 <= h + dh < H - 1) and (1 <= w + dw < W - 1)):\n continue\n D[(h + dh, w + dw)] += 1\nans = [0] * 10\nfor v in D.values():\n ans[v] += 1\nans[0] = (H - 2) * (W - 2) - sum(ans[1:])\nprint(*ans, sep=\"\\n\")\n", "fast_code_sha256": "786f1f0911f3736533e58815057474b28bac58c983968ff4827f978075d801f1", "fast_id": "p04000_786f1f0911f3736533e58815057474b28bac58c983968ff4827f978075d801f1", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from collections import defaultdict\n\nH, W, N = map(int, input().split())\nD = defaultdict(int)\nfor i in range(N):\n h, w = map(int, input().split())\n h, w = h - 1, w - 1\n for dh in range(-1, 2):\n for dw in range(-1, 2):\n if not ((1 <= h + dh < H - 1) and (1 <= w + dw < W - 1)):\n continue\n D[(h + dh, w + dw)] += 1\nans = [0] * 10\nfor v in D.values():\n ans[v] += 1\nans[0] = (H - 2) * (W - 2) - sum(ans[1:])\nprint(*ans, sep=\"\\n\")\n", "measured_fast_code_sha256": "786f1f0911f3736533e58815057474b28bac58c983968ff4827f978075d801f1", "measured_slow_code": "H, W, N = list(map(int, input().split()))\nB = set([])\nfor i in range(N):\n a, b = list(map(int, input().split()))\n a -= 1\n b -= 1\n B.add((a, b))\n# print(B)\nBB = list(B)\nans = [0 for _ in range(10)]\nfor i in range(N):\n cnt = 0\n temp = 0\n x, y = BB[i]\n # print(x,y)\n for sx in range(max(0, x - 2), min(x, H - 3) + 1):\n for sy in range(max(0, y - 2), min(y, W - 3) + 1):\n temp = 0\n for p in range(3):\n for q in range(3):\n if (sx + p, sy + q) in B:\n temp += 1\n # print(sx,sy,temp)\n ans[temp] += 1\nfor i in range(1, 10):\n ans[i] = ans[i] // i\nans[0] = (H - 2) * (W - 2) - sum(ans[1:])\nfor t in ans:\n print(t)\n", "measured_slow_code_sha256": "a36bab8f921599e4ca7482c881bfcc39764a8e5acc14a246031adfce3dcc98b4", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.272013090740507, "pair_id": "python_v2_3d788230bfebbe018039ae86", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p04000", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p04000_786f1f0911f3736533e58815057474b28bac58c983968ff4827f978075d801f1.jsonl.gz", "inputs": "reproduction/python/inputs/p04000.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p04000_a36bab8f921599e4ca7482c881bfcc39764a8e5acc14a246031adfce3dcc98b4.jsonl.gz"}, "slow_code": "H, W, N = list(map(int, input().split()))\nB = set([])\nfor i in range(N):\n a, b = list(map(int, input().split()))\n a -= 1\n b -= 1\n B.add((a, b))\n\nBB = list(B)\nans = [0 for _ in range(10)]\nfor i in range(N):\n cnt = 0\n temp = 0\n x, y = BB[i]\n\n for sx in range(max(0, x - 2), min(x, H - 3) + 1):\n for sy in range(max(0, y - 2), min(y, W - 3) + 1):\n temp = 0\n for p in range(3):\n for q in range(3):\n if (sx + p, sy + q) in B:\n temp += 1\n\n ans[temp] += 1\nfor i in range(1, 10):\n ans[i] = ans[i] // i\nans[0] = (H - 2) * (W - 2) - sum(ans[1:])\nfor t in ans:\n print(t)\n", "slow_code_sha256": "12645471e5b932b71064020cd96552bd93299a86ffda13a17e3ba1b8f76a6c83", "slow_id": "p04000_a36bab8f921599e4ca7482c881bfcc39764a8e5acc14a246031adfce3dcc98b4", "speedup": 2.37695089609917, "stratum": "2-4", "within_pair_jaccard": 0.34545454545454546, "workload": {"case_count": 100, "description": "An H-by-W grid starts white; N distinct listed cells become black. For each j=0..9, count 3-by-3 subrectangles containing exactly j black cells. Only black coordinates are supplied, not the full grid. Observed inputs: H=3..1000000000; W=3..1000000000; N=0..100000 (median 1000); a_i=1..1000000000; b_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1978094, "median": 7447.0, "min": 6}, "input_format": ["H W N\na_1 b_1\n...\na_N b_N"], "input_format_status": "source_input_section", "input_lines": {"max": 100001, "median": 1001.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200003, "median": 2003.0, "min": 3}}} -{"case_ids": ["p03312_case_000", "p03312_case_001", "p03312_case_002", "p03312_case_003", "p03312_case_004", "p03312_case_005", "p03312_case_006", "p03312_case_007", "p03312_case_008", "p03312_case_009", "p03312_case_010", "p03312_case_011", "p03312_case_012", "p03312_case_013", "p03312_case_014", "p03312_case_015", "p03312_case_016", "p03312_case_017", "p03312_case_018", "p03312_case_019", "p03312_case_020", "p03312_case_021", "p03312_case_022", "p03312_case_023", "p03312_case_024", "p03312_case_025", "p03312_case_026", "p03312_case_027", "p03312_case_028", "p03312_case_029", "p03312_case_030", "p03312_case_031", "p03312_case_032", "p03312_case_033", "p03312_case_034", "p03312_case_035", "p03312_case_036", "p03312_case_037", "p03312_case_038", "p03312_case_039", "p03312_case_040", "p03312_case_041", "p03312_case_042", "p03312_case_043", "p03312_case_044", "p03312_case_045", "p03312_case_046", "p03312_case_047", "p03312_case_048", "p03312_case_049", "p03312_case_050", "p03312_case_051", "p03312_case_052", "p03312_case_053", "p03312_case_054", "p03312_case_055", "p03312_case_056", "p03312_case_057", "p03312_case_058", "p03312_case_059", "p03312_case_060", "p03312_case_061", "p03312_case_062", "p03312_case_063", "p03312_case_064", "p03312_case_065", "p03312_case_066", "p03312_case_067", "p03312_case_068", "p03312_case_069", "p03312_case_070", "p03312_case_071", "p03312_case_072", "p03312_case_073", "p03312_case_074", "p03312_case_075", "p03312_case_076", "p03312_case_077", "p03312_case_078", "p03312_case_079", "p03312_case_080", "p03312_case_081", "p03312_case_082", "p03312_case_083", "p03312_case_084", "p03312_case_085", "p03312_case_086", "p03312_case_087", "p03312_case_088", "p03312_case_089", "p03312_case_090", "p03312_case_091", "p03312_case_092", "p03312_case_093", "p03312_case_094", "p03312_case_095", "p03312_case_096", "p03312_case_097", "p03312_case_098", "p03312_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\na = list(map(int, input().split()))\n\n\ndef f(a):\n l, r = a[:2]\n m = 1\n b = [(l, r)]\n for i in range(2, n - 2):\n r += a[i]\n while m < i and abs(l - r) > abs(l - r + a[m] * 2):\n l, r = l + a[m], r - a[m]\n m += 1\n b.append((l, r))\n return b\n\n\nprint(\n (\n min(\n max(p, q, r, s) - min(p, q, r, s)\n for ((p, q), (r, s)) in zip(f(a), f(a[::-1])[::-1])\n )\n )\n)\n", "fast_code_sha256": "135e4bd26ba1d3fae326e995137a8a8c419b22ccdcea9d3240ec1886b5a4f161", "fast_id": "p03312_135e4bd26ba1d3fae326e995137a8a8c419b22ccdcea9d3240ec1886b5a4f161", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\na = list(map(int, input().split()))\n\n\ndef f(a):\n l, r = a[:2]\n m = 1\n b = [(l, r)]\n for i in range(2, n - 2):\n r += a[i]\n while m < i and abs(l - r) > abs(l - r + a[m] * 2):\n l, r = l + a[m], r - a[m]\n m += 1\n b.append((l, r))\n return b\n\n\nprint(\n (\n min(\n max(p, q, r, s) - min(p, q, r, s)\n for ((p, q), (r, s)) in zip(f(a), f(a[::-1])[::-1])\n )\n )\n)\n", "measured_fast_code_sha256": "135e4bd26ba1d3fae326e995137a8a8c419b22ccdcea9d3240ec1886b5a4f161", "measured_slow_code": "# D\nN = int(eval(input()))\nA_list = list(map(int, input().split()))\n# cumsum from left\na = 0\nA_left = []\nfor i in range(N):\n a += A_list[i]\n A_left.append(a)\n# cumsum from right\na = 0\nA_right = []\nfor i in range(N):\n a += A_list[N - 1 - i]\n A_right.append(a)\n\n\ndef binary_search_left(s):\n m = 0\n l = 0\n r = N - 1\n if A_left[0] > s:\n return 0\n while True:\n m = (l + r) // 2\n if A_left[m] <= s and A_left[m + 1] > s:\n break\n elif A_left[m] <= s:\n l = m\n else:\n r = m\n if s - A_left[m] <= A_left[m + 1] - s:\n return m\n else:\n return m + 1\n\n\ndef binary_search_right(s):\n m = 0\n l = 0\n r = N - 1\n if A_right[0] > s:\n return 0\n while True:\n m = (l + r) // 2\n if A_right[m] <= s and A_right[m + 1] > s:\n break\n elif A_right[m] <= s:\n l = m\n else:\n r = m\n if s - A_right[m] <= A_right[m + 1] - s:\n return m\n else:\n return m + 1\n\n\n# B | C split\nres = A_left[N - 1]\nfor s in range(2, N - 1):\n m_l = binary_search_left(A_left[s - 1] / 2)\n a, b = A_left[m_l], A_left[s - 1] - A_left[m_l]\n r = N - s\n m_r = binary_search_right(A_right[r - 1] / 2)\n c, d = A_right[m_r], A_right[r - 1] - A_right[m_r]\n r = max([a, b, c, d]) - min([a, b, c, d])\n if r < res:\n res = r\nif N == 4:\n res = max(A_list) - min(A_list)\nprint(res)\n", "measured_slow_code_sha256": "e080e07d8424e073d5e98936947b26997efc5cec42a718a67ce6f5adfbb4164f", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.528215543371781, "pair_id": "python_v2_90bf176302675e50bbe59eff", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03312", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03312_135e4bd26ba1d3fae326e995137a8a8c419b22ccdcea9d3240ec1886b5a4f161.jsonl.gz", "inputs": "reproduction/python/inputs/p03312.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03312_e080e07d8424e073d5e98936947b26997efc5cec42a718a67ce6f5adfbb4164f.jsonl.gz"}, "slow_code": "N = int(eval(input()))\nA_list = list(map(int, input().split()))\n\na = 0\nA_left = []\nfor i in range(N):\n a += A_list[i]\n A_left.append(a)\n\na = 0\nA_right = []\nfor i in range(N):\n a += A_list[N - 1 - i]\n A_right.append(a)\n\n\ndef binary_search_left(s):\n m = 0\n l = 0\n r = N - 1\n if A_left[0] > s:\n return 0\n while True:\n m = (l + r) // 2\n if A_left[m] <= s and A_left[m + 1] > s:\n break\n elif A_left[m] <= s:\n l = m\n else:\n r = m\n if s - A_left[m] <= A_left[m + 1] - s:\n return m\n else:\n return m + 1\n\n\ndef binary_search_right(s):\n m = 0\n l = 0\n r = N - 1\n if A_right[0] > s:\n return 0\n while True:\n m = (l + r) // 2\n if A_right[m] <= s and A_right[m + 1] > s:\n break\n elif A_right[m] <= s:\n l = m\n else:\n r = m\n if s - A_right[m] <= A_right[m + 1] - s:\n return m\n else:\n return m + 1\n\n\nres = A_left[N - 1]\nfor s in range(2, N - 1):\n m_l = binary_search_left(A_left[s - 1] / 2)\n a, b = A_left[m_l], A_left[s - 1] - A_left[m_l]\n r = N - s\n m_r = binary_search_right(A_right[r - 1] / 2)\n c, d = A_right[m_r], A_right[r - 1] - A_right[m_r]\n r = max([a, b, c, d]) - min([a, b, c, d])\n if r < res:\n res = r\nif N == 4:\n res = max(A_list) - min(A_list)\nprint(res)\n", "slow_code_sha256": "16fb7a6a6fbb5a3605c73ff209ab7a3c5e631bdab9b5fdf86ce49a66abed34d7", "slow_id": "p03312_e080e07d8424e073d5e98936947b26997efc5cec42a718a67ce6f5adfbb4164f", "speedup": 3.3950705997600417, "stratum": "2-4", "within_pair_jaccard": 0.52, "workload": {"case_count": 100, "description": "Split a positive array into exactly four nonempty contiguous parts. Minimize the largest part sum minus the smallest part sum. Observed inputs: N=4..200000 (median 1000); A_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 2200007, "median": 2113.5, "min": 10}, "input_format": ["N\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200001, "median": 1001.0, "min": 5}}} -{"case_ids": ["p00053_case_000", "p00053_case_001", "p00053_case_002", "p00053_case_003", "p00053_case_004", "p00053_case_005", "p00053_case_006", "p00053_case_007", "p00053_case_008", "p00053_case_009", "p00053_case_010", "p00053_case_011", "p00053_case_012", "p00053_case_013", "p00053_case_014", "p00053_case_015", "p00053_case_016", "p00053_case_017", "p00053_case_018", "p00053_case_019", "p00053_case_020", "p00053_case_021", "p00053_case_022", "p00053_case_023", "p00053_case_024", "p00053_case_025", "p00053_case_026", "p00053_case_027", "p00053_case_028", "p00053_case_029", "p00053_case_030", "p00053_case_031", "p00053_case_032", "p00053_case_033", "p00053_case_034", "p00053_case_035", "p00053_case_036", "p00053_case_037", "p00053_case_038", "p00053_case_039", "p00053_case_040", "p00053_case_041", "p00053_case_042", "p00053_case_043", "p00053_case_044", "p00053_case_045", "p00053_case_046", "p00053_case_047", "p00053_case_048", "p00053_case_049", "p00053_case_050", "p00053_case_051", "p00053_case_052", "p00053_case_053", "p00053_case_054", "p00053_case_055", "p00053_case_056", "p00053_case_057", "p00053_case_058", "p00053_case_059", "p00053_case_060", "p00053_case_061", "p00053_case_062", "p00053_case_063", "p00053_case_064", "p00053_case_065", "p00053_case_066", "p00053_case_067", "p00053_case_068", "p00053_case_069", "p00053_case_070", "p00053_case_071", "p00053_case_072", "p00053_case_073", "p00053_case_074", "p00053_case_075", "p00053_case_076", "p00053_case_077", "p00053_case_078", "p00053_case_079", "p00053_case_080", "p00053_case_081", "p00053_case_082", "p00053_case_083", "p00053_case_084", "p00053_case_085", "p00053_case_086", "p00053_case_087", "p00053_case_088", "p00053_case_089", "p00053_case_090", "p00053_case_091", "p00053_case_092", "p00053_case_093", "p00053_case_094", "p00053_case_095", "p00053_case_096", "p00053_case_097", "p00053_case_098", "p00053_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import math\n\nr = 105000\nsqrt = int(math.sqrt(r))\np = [1] * r\np[0] = 0\nfor i in range(1, sqrt):\n if p[i]:\n for j in range(2 * i + 1, r, i + 1):\n p[j] = 0\ns = [0 for i in range(11000)]\ns[0] = 2\nk = 1\nfor i in range(2, r):\n if p[i]:\n s[k] = i + 1 + s[k - 1]\n k += 1\nwhile True:\n n = int(input())\n if not n:\n break\n print(s[n - 1])\n", "fast_code_sha256": "4d0e6081db0eaa338bf0e0a03ab2f2ca6b400e1a4a9944d75e24b9cf6c217b62", "fast_id": "p00053_4d0e6081db0eaa338bf0e0a03ab2f2ca6b400e1a4a9944d75e24b9cf6c217b62", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import math\n\nr = 105000\nsqrt = int(math.sqrt(r))\np = [1] * r\np[0] = 0\nfor i in range(1, sqrt):\n if p[i]:\n for j in range(2 * i + 1, r, i + 1):\n p[j] = 0\ns = [0 for i in range(11000)]\ns[0] = 2\nk = 1\nfor i in range(2, r):\n if p[i]:\n s[k] = i + 1 + s[k - 1]\n k += 1\nwhile True:\n n = int(input())\n if not n:\n break\n print(s[n - 1])\n", "measured_fast_code_sha256": "4d0e6081db0eaa338bf0e0a03ab2f2ca6b400e1a4a9944d75e24b9cf6c217b62", "measured_slow_code": "import math\n\nr = 105000\nsqrt = int(math.sqrt(r))\np = [1] * r\np[0] = 0\nfor i in range(1, sqrt):\n if p[i]:\n for j in range(2 * i + 1, r, i + 1):\n p[j] = 0\nwhile True:\n n = int(input())\n if not n:\n break\n i, num, sum = 0, 0, 0\n while num < n:\n if p[i] == 1:\n num += 1\n sum += i + 1\n i += 1\n print(sum)\n", "measured_slow_code_sha256": "8cca1698214485b76a9b0e12f8e91dd9d3daa2c366ec968e4e5180fe1f6d3e7b", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 5.226415381070826, "pair_id": "python_v2_d73d83110d80265fb6d6176f", "per_case_slow_code_faster_fraction": 0.18, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p00053", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p00053_4d0e6081db0eaa338bf0e0a03ab2f2ca6b400e1a4a9944d75e24b9cf6c217b62.jsonl.gz", "inputs": "reproduction/python/inputs/p00053.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p00053_8cca1698214485b76a9b0e12f8e91dd9d3daa2c366ec968e4e5180fe1f6d3e7b.jsonl.gz"}, "slow_code": "import math\n\nr = 105000\nsqrt = int(math.sqrt(r))\np = [1] * r\np[0] = 0\nfor i in range(1, sqrt):\n if p[i]:\n for j in range(2 * i + 1, r, i + 1):\n p[j] = 0\nwhile True:\n n = int(input())\n if not n:\n break\n i, num, sum = 0, 0, 0\n while num < n:\n if p[i] == 1:\n num += 1\n sum += i + 1\n i += 1\n print(sum)\n", "slow_code_sha256": "8cca1698214485b76a9b0e12f8e91dd9d3daa2c366ec968e4e5180fe1f6d3e7b", "slow_id": "p00053_8cca1698214485b76a9b0e12f8e91dd9d3daa2c366ec968e4e5180fe1f6d3e7b", "speedup": 4.586143714756156, "stratum": "4-8", "within_pair_jaccard": 0.8214285714285714, "workload": {"case_count": 100, "description": "For each n, compute the sum of the first n primes. Each line supplies one n; the final zero terminates input and is not a query. Observed inputs: datasets=1..50 (median 25); n=1..10000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 302, "median": 120.0, "min": 4}, "input_format": ["n_1\n...\nn_D\n0"], "input_format_status": "source_input_section", "input_lines": {"max": 51, "median": 26.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 51, "median": 26.0, "min": 2}}} -{"case_ids": ["p03762_case_000", "p03762_case_001", "p03762_case_002", "p03762_case_003", "p03762_case_004", "p03762_case_005", "p03762_case_006", "p03762_case_007", "p03762_case_008", "p03762_case_009", "p03762_case_010", "p03762_case_011", "p03762_case_012", "p03762_case_013", "p03762_case_014", "p03762_case_015", "p03762_case_016", "p03762_case_017", "p03762_case_018", "p03762_case_019", "p03762_case_020", "p03762_case_021", "p03762_case_022", "p03762_case_023", "p03762_case_024", "p03762_case_025", "p03762_case_026", "p03762_case_027", "p03762_case_028", "p03762_case_029", "p03762_case_030", "p03762_case_031", "p03762_case_032", "p03762_case_033", "p03762_case_034", "p03762_case_035", "p03762_case_036", "p03762_case_037", "p03762_case_038", "p03762_case_039", "p03762_case_040", "p03762_case_041", "p03762_case_042", "p03762_case_043", "p03762_case_044", "p03762_case_045", "p03762_case_046", "p03762_case_047", "p03762_case_048", "p03762_case_049", "p03762_case_050", "p03762_case_051", "p03762_case_052", "p03762_case_053", "p03762_case_054", "p03762_case_055", "p03762_case_056", "p03762_case_057", "p03762_case_058", "p03762_case_059", "p03762_case_060", "p03762_case_061", "p03762_case_062", "p03762_case_063", "p03762_case_064", "p03762_case_065", "p03762_case_066", "p03762_case_067", "p03762_case_068", "p03762_case_069", "p03762_case_070", "p03762_case_071", "p03762_case_072", "p03762_case_073", "p03762_case_074", "p03762_case_075", "p03762_case_076", "p03762_case_077", "p03762_case_078", "p03762_case_079", "p03762_case_080", "p03762_case_081", "p03762_case_082", "p03762_case_083", "p03762_case_084", "p03762_case_085", "p03762_case_086", "p03762_case_087", "p03762_case_088", "p03762_case_089", "p03762_case_090", "p03762_case_091", "p03762_case_092", "p03762_case_093", "p03762_case_094", "p03762_case_095", "p03762_case_096", "p03762_case_097", "p03762_case_098", "p03762_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N, M = list(map(int, input().split()))\nX = list(map(int, input().split()))\nY = list(map(int, input().split()))\nmod = 10**9 + 7\nXS = 0\nfor i, x in enumerate(X, start=1):\n XS += (x * ((i - 1) - (N - i))) % mod\nYS = 0\nfor i, y in enumerate(Y, start=1):\n YS += (y * ((i - 1) - (M - i))) % mod\nprint((XS * YS % mod))\n", "fast_code_sha256": "9f2794678edcb482f2a345f41ff4534b9cf223243bff764df9519fb0f0170b40", "fast_id": "p03762_9f2794678edcb482f2a345f41ff4534b9cf223243bff764df9519fb0f0170b40", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N, M = list(map(int, input().split()))\nX = list(map(int, input().split()))\nY = list(map(int, input().split()))\nmod = 10**9 + 7\nXS = 0\nfor i, x in enumerate(X, start=1):\n XS += (x * ((i - 1) - (N - i))) % mod\nYS = 0\nfor i, y in enumerate(Y, start=1):\n YS += (y * ((i - 1) - (M - i))) % mod\nprint((XS * YS % mod))\n", "measured_fast_code_sha256": "9f2794678edcb482f2a345f41ff4534b9cf223243bff764df9519fb0f0170b40", "measured_slow_code": "import sys\nimport numpy as np\n\nMOD = 10**9 + 7\nI = np.array(sys.stdin.read().split(), dtype=np.int64)\nn, m = I[:2]\nx = I[2 : 2 + n]\ny = I[2 + n :]\n\n\ndef main():\n sx = np.cumsum(x) % MOD\n sy = np.cumsum(y) % MOD\n sdx = (\n np.sum((sx[n - 1] - sx[: n - 1]) - x[: n - 1] * ((n - 1) - np.arange(n - 1)))\n % MOD\n )\n sdy = (\n np.sum((sy[m - 1] - sy[: m - 1]) - y[: m - 1] * ((m - 1) - np.arange(m - 1)))\n % MOD\n )\n ans = sdx * sdy % MOD\n return ans\n\n\nif __name__ == \"__main__\":\n ans = main()\n print(ans)\n", "measured_slow_code_sha256": "982e2a132ff9a9ee086902a77e4d38984ae35b417d1949db3c426a0eec331800", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.2941806050360332, "pair_id": "python_v2_96bbcdf65d9d33b03ea6268d", "per_case_slow_code_faster_fraction": 0.34, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03762", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03762_9f2794678edcb482f2a345f41ff4534b9cf223243bff764df9519fb0f0170b40.jsonl.gz", "inputs": "reproduction/python/inputs/p03762.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03762_982e2a132ff9a9ee086902a77e4d38984ae35b417d1949db3c426a0eec331800.jsonl.gz"}, "slow_code": "import sys\nimport numpy as np\n\nMOD = 10**9 + 7\nI = np.array(sys.stdin.read().split(), dtype=np.int64)\nn, m = I[:2]\nx = I[2 : 2 + n]\ny = I[2 + n :]\n\n\ndef main():\n sx = np.cumsum(x) % MOD\n sy = np.cumsum(y) % MOD\n sdx = (\n np.sum((sx[n - 1] - sx[: n - 1]) - x[: n - 1] * ((n - 1) - np.arange(n - 1)))\n % MOD\n )\n sdy = (\n np.sum((sy[m - 1] - sy[: m - 1]) - y[: m - 1] * ((m - 1) - np.arange(m - 1)))\n % MOD\n )\n ans = sdx * sdy % MOD\n return ans\n\n\nif __name__ == \"__main__\":\n ans = main()\n print(ans)\n", "slow_code_sha256": "982e2a132ff9a9ee086902a77e4d38984ae35b417d1949db3c426a0eec331800", "slow_id": "p03762_982e2a132ff9a9ee086902a77e4d38984ae35b417d1949db3c426a0eec331800", "speedup": 7.929939357197119, "stratum": "4-8", "within_pair_jaccard": 0.14814814814814814, "workload": {"case_count": 100, "description": "Vertical lines x=x_i and horizontal lines y=y_i have strictly increasing coordinate lists. Sum areas of all rectangles formed by choosing two lines of each orientation, modulo 1000000007. Observed inputs: n=2..100000 (median 50000); m=2..100000 (median 50000); x_i=-1000000000..1000000000; y_i=-1000000000..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 2200016, "median": 1038968.5, "min": 44}, "input_format": ["n m\nx_1 ... x_n\ny_1 ... y_m"], "input_format_status": "source_input_section", "input_lines": {"max": 3, "median": 3.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200002, "median": 100003.0, "min": 6}}} -{"case_ids": ["p02729_case_000", "p02729_case_001", "p02729_case_002", "p02729_case_003", "p02729_case_004", "p02729_case_005", "p02729_case_006", "p02729_case_007", "p02729_case_008", "p02729_case_009", "p02729_case_010", "p02729_case_011", "p02729_case_012", "p02729_case_013", "p02729_case_014", "p02729_case_015", "p02729_case_016", "p02729_case_017", "p02729_case_018", "p02729_case_019", "p02729_case_020", "p02729_case_021", "p02729_case_022", "p02729_case_023", "p02729_case_024", "p02729_case_025", "p02729_case_026", "p02729_case_027", "p02729_case_028", "p02729_case_029", "p02729_case_030", "p02729_case_031", "p02729_case_032", "p02729_case_033", "p02729_case_034", "p02729_case_035", "p02729_case_036", "p02729_case_037", "p02729_case_038", "p02729_case_039", "p02729_case_040", "p02729_case_041", "p02729_case_042", "p02729_case_043", "p02729_case_044", "p02729_case_045", "p02729_case_046", "p02729_case_047", "p02729_case_048", "p02729_case_049", "p02729_case_050", "p02729_case_051", "p02729_case_052", "p02729_case_053", "p02729_case_054", "p02729_case_055", "p02729_case_056", "p02729_case_057", "p02729_case_058", "p02729_case_059", "p02729_case_060", "p02729_case_061", "p02729_case_062", "p02729_case_063", "p02729_case_064", "p02729_case_065", "p02729_case_066", "p02729_case_067", "p02729_case_068", "p02729_case_069", "p02729_case_070", "p02729_case_071", "p02729_case_072", "p02729_case_073", "p02729_case_074", "p02729_case_075", "p02729_case_076", "p02729_case_077", "p02729_case_078", "p02729_case_079", "p02729_case_080", "p02729_case_081", "p02729_case_082", "p02729_case_083", "p02729_case_084", "p02729_case_085", "p02729_case_086", "p02729_case_087", "p02729_case_088", "p02729_case_089", "p02729_case_090", "p02729_case_091", "p02729_case_092", "p02729_case_093", "p02729_case_094", "p02729_case_095", "p02729_case_096", "p02729_case_097", "p02729_case_098", "p02729_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N, M = list(map(int, input().split()))\n\na = N * (N - 1) // 2\nb = M * (M - 1) // 2\nprint((a + b))\n", "fast_code_sha256": "7f8243f8e48dedae472e9b0406c498b4b1db22948300b9da922fddb1419eaa90", "fast_id": "p02729_b9f5593b2d9a7b996707ac35d5498b0a7fa4149fa8dcc6c910b9db00058d7e53", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N, M = list(map(int, input().split()))\n# 下の式はN=0,1(M=0,1)の場合も成り立つ\na = N * (N - 1) // 2\nb = M * (M - 1) // 2\nprint((a + b))\n", "measured_fast_code_sha256": "b9f5593b2d9a7b996707ac35d5498b0a7fa4149fa8dcc6c910b9db00058d7e53", "measured_slow_code": "a, b = list(map(int, input().split()))\nimport itertools\n\na1 = len(list(itertools.combinations(list(range(a)), 2)))\nb1 = len(list(itertools.combinations(list(range(b)), 2)))\nprint((a1 + b1))\n", "measured_slow_code_sha256": "cceb77711a14726b9b2382bddd14ea9448a327cbb9328832bc3b11455366cb07", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 6.109236059279928, "pair_id": "python_v2_8a660a3a1b574c3e098d7702", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02729", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02729_b9f5593b2d9a7b996707ac35d5498b0a7fa4149fa8dcc6c910b9db00058d7e53.jsonl.gz", "inputs": "reproduction/python/inputs/p02729.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02729_cceb77711a14726b9b2382bddd14ea9448a327cbb9328832bc3b11455366cb07.jsonl.gz"}, "slow_code": "a, b = list(map(int, input().split()))\nimport itertools\n\na1 = len(list(itertools.combinations(list(range(a)), 2)))\nb1 = len(list(itertools.combinations(list(range(b)), 2)))\nprint((a1 + b1))\n", "slow_code_sha256": "cceb77711a14726b9b2382bddd14ea9448a327cbb9328832bc3b11455366cb07", "slow_id": "p02729_cceb77711a14726b9b2382bddd14ea9448a327cbb9328832bc3b11455366cb07", "speedup": 7.203681289679995, "stratum": "4-8", "within_pair_jaccard": 0.42105263157894735, "workload": {"case_count": 100, "description": "There are N individually distinct balls with even values and M with odd values. Count unordered pairs of different balls whose values sum to an even number. Observed inputs: N=0..100 (median 34.5); M=0..100 (median 31.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 8, "median": 5.0, "min": 4}, "input_format": ["N M"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p03025_case_000", "p03025_case_001", "p03025_case_002", "p03025_case_003", "p03025_case_004", "p03025_case_005", "p03025_case_006", "p03025_case_007", "p03025_case_008", "p03025_case_009", "p03025_case_010", "p03025_case_011", "p03025_case_012", "p03025_case_013", "p03025_case_014", "p03025_case_015", "p03025_case_016", "p03025_case_017", "p03025_case_018", "p03025_case_019", "p03025_case_020", "p03025_case_021", "p03025_case_022", "p03025_case_023", "p03025_case_024", "p03025_case_025", "p03025_case_026", "p03025_case_027", "p03025_case_028", "p03025_case_029", "p03025_case_030", "p03025_case_031", "p03025_case_032", "p03025_case_033", "p03025_case_034", "p03025_case_035", "p03025_case_036", "p03025_case_037", "p03025_case_038", "p03025_case_039", "p03025_case_040", "p03025_case_041", "p03025_case_042", "p03025_case_043", "p03025_case_044", "p03025_case_045", "p03025_case_046", "p03025_case_047", "p03025_case_048", "p03025_case_049", "p03025_case_050", "p03025_case_051", "p03025_case_052", "p03025_case_053", "p03025_case_054", "p03025_case_055", "p03025_case_056", "p03025_case_057", "p03025_case_058", "p03025_case_059", "p03025_case_060", "p03025_case_061", "p03025_case_062", "p03025_case_063", "p03025_case_064", "p03025_case_065", "p03025_case_066", "p03025_case_067", "p03025_case_068", "p03025_case_069", "p03025_case_070", "p03025_case_071", "p03025_case_072", "p03025_case_073", "p03025_case_074", "p03025_case_075", "p03025_case_076", "p03025_case_077", "p03025_case_078", "p03025_case_079", "p03025_case_080", "p03025_case_081", "p03025_case_082", "p03025_case_083", "p03025_case_084", "p03025_case_085", "p03025_case_086", "p03025_case_087", "p03025_case_088", "p03025_case_089", "p03025_case_090", "p03025_case_091", "p03025_case_092", "p03025_case_093", "p03025_case_094", "p03025_case_095", "p03025_case_096", "p03025_case_097", "p03025_case_098", "p03025_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "executable_AST_equal_except_explicit_explanatory_string_removal_and_all_frozen_inputs_checker_pass", "fast_code": "class Combination:\n\n def __init__(self, n, MOD):\n self.fact = [1]\n for i in range(1, n + 1):\n self.fact.append(self.fact[-1] * i % MOD)\n self.inv_fact = [pow(self.fact[i], MOD - 2, MOD) for i in range(n + 1)]\n self.MOD = MOD\n\n def factorial(self, k):\n return self.fact[k]\n\n def inverse_factorial(self, k):\n return self.inv_fact[k]\n\n def combination(self, k, r):\n return (self.fact[k] * self.inv_fact[k - r] * self.inv_fact[r]) % self.MOD\n\n\nfrom fractions import Fraction\n\nMOD = 10**9 + 7\nn, a, b, c = list(map(int, input().split()))\n\ncomb = Combination(2 * n, MOD)\nmod_li = [1]\nfor i in range(1, 2 * n + 1):\n mod_li.append(mod_li[-1] * (a + b) % MOD)\np1 = [1]\np2 = [1]\nfor i in range(1, n + 1):\n p1.append((p1[-1] * a) % MOD)\n p2.append((p2[-1] * b) % MOD)\nq = mod_li[2 * n - 1]\np = 0\nfor i in range(n):\n tmp_bunshi = (\n (n + i) * (mod_li[n - i - 1]) * p1[n] * p2[i] * comb.combination(n - 1 + i, i)\n )\n tmp_bunshi += (\n (n + i) * (mod_li[n - i - 1]) * p2[n] * p1[i] * comb.combination(n - 1 + i, i)\n )\n p += tmp_bunshi\n p %= MOD\np *= 100\nq *= a + b\nans = Fraction(p, q)\np = ans.numerator\nq = ans.denominator\nprint(((pow(q, MOD - 2, MOD) * p) % MOD))\n", "fast_code_sha256": "70ddd5f840b4cf045630f383c5a4dc0b67936d1255ea8e844b2833042d45ffc1", "fast_id": "p03025_afdc02d7fb2abeb1970c2a5c2791e7792fd3f3e6fc1ceb09e19fccefdfb05385", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "# Combinationクラス\nclass Combination:\n \"\"\"\n 計算量:階乗・逆元テーブルの作成O(N)\n nCkを求めるO(1)\n \"\"\"\n\n def __init__(self, n, MOD):\n self.fact = [1]\n for i in range(1, n + 1):\n self.fact.append(self.fact[-1] * i % MOD)\n self.inv_fact = [pow(self.fact[i], MOD - 2, MOD) for i in range(n + 1)]\n self.MOD = MOD\n\n def factorial(self, k):\n \"\"\"k!を求��る\"\"\"\n return self.fact[k]\n\n def inverse_factorial(self, k):\n \"\"\"k!の逆元を求める\"\"\"\n return self.inv_fact[k]\n\n def combination(self, k, r):\n \"\"\"kCrを求める\"\"\"\n return (self.fact[k] * self.inv_fact[k - r] * self.inv_fact[r]) % self.MOD\n\n\nfrom fractions import Fraction\n\nMOD = 10**9 + 7\nn, a, b, c = list(map(int, input().split()))\n# n-1から2n-2まで\ncomb = Combination(2 * n, MOD)\nmod_li = [1]\nfor i in range(1, 2 * n + 1):\n mod_li.append(mod_li[-1] * (a + b) % MOD)\np1 = [1]\np2 = [1]\nfor i in range(1, n + 1):\n p1.append((p1[-1] * a) % MOD)\n p2.append((p2[-1] * b) % MOD)\nq = mod_li[2 * n - 1]\np = 0\nfor i in range(n):\n tmp_bunshi = (\n (n + i) * (mod_li[n - i - 1]) * p1[n] * p2[i] * comb.combination(n - 1 + i, i)\n )\n tmp_bunshi += (\n (n + i) * (mod_li[n - i - 1]) * p2[n] * p1[i] * comb.combination(n - 1 + i, i)\n )\n p += tmp_bunshi\n p %= MOD\np *= 100\nq *= a + b\nans = Fraction(p, q)\np = ans.numerator\nq = ans.denominator\nprint(((pow(q, MOD - 2, MOD) * p) % MOD))\n", "measured_fast_code_sha256": "afdc02d7fb2abeb1970c2a5c2791e7792fd3f3e6fc1ceb09e19fccefdfb05385", "measured_slow_code": "N, A, B, C = list(map(int, input().split()))\nmod = 10**9 + 7\n# factorial,facotiralの逆数を事前計算.\n# N=10**5あたりまで有効\nFACT = [1, 1]\nFACT_INV = [1, 1]\nfor i in range(2, 2 * 10**5 + 1):\n FACT.append(FACT[-1] * i % mod)\n FACT_INV.append(FACT_INV[-1] * pow(i, mod - 2, mod) % mod)\n\n\ndef Combi(N, K):\n return FACT[N] * FACT_INV[N - K] * FACT_INV[K] % mod\n\n\n# Aが勝つ場合\nANS = 0\nSUM = A + B\nA_n = pow(A, N, mod) * pow(pow(SUM, mod - 2, mod), N, mod) % mod\nB_n = pow(B, N, mod) * pow(pow(SUM, mod - 2, mod), N, mod) % mod\nSUMINV = pow(SUM, mod - 2, mod)\nfor i in range(N):\n ANS = (\n ANS\n + (A_n * pow(B, i, mod) + B_n * pow(A, i, mod))\n * Combi(N - 1 + i, i)\n * pow(SUMINV, i, mod)\n * (N + i)\n ) % mod\nprint((ANS * 100 * pow(100 - C, mod - 2, mod) % mod))\n", "measured_slow_code_sha256": "7e48e149e0a88356f55ffb6f171c7d7feede92e147ae91dd3c8c063e96af86ff", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.9566800042983314, "pair_id": "python_v2_78a695150b29f96e933370c5", "per_case_slow_code_faster_fraction": 0.01, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03025", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03025_afdc02d7fb2abeb1970c2a5c2791e7792fd3f3e6fc1ceb09e19fccefdfb05385.jsonl.gz", "inputs": "reproduction/python/inputs/p03025.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03025_7e48e149e0a88356f55ffb6f171c7d7feede92e147ae91dd3c8c063e96af86ff.jsonl.gz"}, "slow_code": "N, A, B, C = list(map(int, input().split()))\nmod = 10**9 + 7\n\n\nFACT = [1, 1]\nFACT_INV = [1, 1]\nfor i in range(2, 2 * 10**5 + 1):\n FACT.append(FACT[-1] * i % mod)\n FACT_INV.append(FACT_INV[-1] * pow(i, mod - 2, mod) % mod)\n\n\ndef Combi(N, K):\n return FACT[N] * FACT_INV[N - K] * FACT_INV[K] % mod\n\n\nANS = 0\nSUM = A + B\nA_n = pow(A, N, mod) * pow(pow(SUM, mod - 2, mod), N, mod) % mod\nB_n = pow(B, N, mod) * pow(pow(SUM, mod - 2, mod), N, mod) % mod\nSUMINV = pow(SUM, mod - 2, mod)\nfor i in range(N):\n ANS = (\n ANS\n + (A_n * pow(B, i, mod) + B_n * pow(A, i, mod))\n * Combi(N - 1 + i, i)\n * pow(SUMINV, i, mod)\n * (N + i)\n ) % mod\nprint((ANS * 100 * pow(100 - C, mod - 2, mod) % mod))\n", "slow_code_sha256": "b2e0449d7a2944f7ba4d2cde9547b576cefa6b07e19d4a824aebb0b7d058a68c", "slow_id": "p03025_7e48e149e0a88356f55ffb6f171c7d7feede92e147ae91dd3c8c063e96af86ff", "speedup": 7.0684479937373474, "stratum": "4-8", "within_pair_jaccard": 0.3013698630136986, "workload": {"case_count": 100, "description": "Repeat games until either player has N wins. Per-game outcomes are first-player win with probability A percent, second-player win B percent, or draw C percent; A+B+C=100 and A+B>0. Output the expected game count modulo 1000000007 as P*Q^(-1). Observed inputs: N=1..100000 (median 42922); A=0..100; B=0..100; C=0..99.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 16, "median": 13.0, "min": 9}, "input_format": ["N A B C"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 4, "median": 4.0, "min": 4}}} -{"case_ids": ["p02724_case_000", "p02724_case_001", "p02724_case_002", "p02724_case_003", "p02724_case_004", "p02724_case_005", "p02724_case_006", "p02724_case_007", "p02724_case_008", "p02724_case_009", "p02724_case_010", "p02724_case_011", "p02724_case_012", "p02724_case_013", "p02724_case_014", "p02724_case_015", "p02724_case_016", "p02724_case_017", "p02724_case_018", "p02724_case_019", "p02724_case_020", "p02724_case_021", "p02724_case_022", "p02724_case_023", "p02724_case_024", "p02724_case_025", "p02724_case_026", "p02724_case_027", "p02724_case_028", "p02724_case_029", "p02724_case_030", "p02724_case_031", "p02724_case_032", "p02724_case_033", "p02724_case_034", "p02724_case_035", "p02724_case_036", "p02724_case_037", "p02724_case_038", "p02724_case_039", "p02724_case_040", "p02724_case_041", "p02724_case_042", "p02724_case_043", "p02724_case_044", "p02724_case_045", "p02724_case_046", "p02724_case_047", "p02724_case_048", "p02724_case_049", "p02724_case_050", "p02724_case_051", "p02724_case_052", "p02724_case_053", "p02724_case_054", "p02724_case_055", "p02724_case_056", "p02724_case_057", "p02724_case_058", "p02724_case_059", "p02724_case_060", "p02724_case_061", "p02724_case_062", "p02724_case_063", "p02724_case_064", "p02724_case_065", "p02724_case_066", "p02724_case_067", "p02724_case_068", "p02724_case_069", "p02724_case_070", "p02724_case_071", "p02724_case_072", "p02724_case_073", "p02724_case_074", "p02724_case_075", "p02724_case_076", "p02724_case_077", "p02724_case_078", "p02724_case_079", "p02724_case_080", "p02724_case_081", "p02724_case_082", "p02724_case_083", "p02724_case_084", "p02724_case_085", "p02724_case_086", "p02724_case_087", "p02724_case_088", "p02724_case_089", "p02724_case_090", "p02724_case_091", "p02724_case_092", "p02724_case_093", "p02724_case_094", "p02724_case_095", "p02724_case_096", "p02724_case_097", "p02724_case_098", "p02724_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\ngg = 0\ngg += (n // 500) * 1000\nn = n - (n // 500) * 500\ngg += (n // 5) * 5\nprint(gg)\n", "fast_code_sha256": "19fd1e448348c447fd2ac56d3303ce5bd225f65c9ba7896e4a6dbd81b312bc50", "fast_id": "p02724_19fd1e448348c447fd2ac56d3303ce5bd225f65c9ba7896e4a6dbd81b312bc50", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\ngg = 0\ngg += (n // 500) * 1000\nn = n - (n // 500) * 500\ngg += (n // 5) * 5\nprint(gg)\n", "measured_fast_code_sha256": "19fd1e448348c447fd2ac56d3303ce5bd225f65c9ba7896e4a6dbd81b312bc50", "measured_slow_code": "def main():\n x = int(eval(input()))\n ans = 0\n while x >= 500:\n x -= 500\n ans += 1000\n while x >= 5:\n x -= 5\n ans += 5\n print(ans)\n\n\nmain()\n", "measured_slow_code_sha256": "07c5a845a98dce83f42c711c0408dc4dad947c9351918518d0af13bec53b52eb", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2583.603578096397, "pair_id": "python_v2_f8c0720417e054321c665239", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02724", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02724_19fd1e448348c447fd2ac56d3303ce5bd225f65c9ba7896e4a6dbd81b312bc50.jsonl.gz", "inputs": "reproduction/python/inputs/p02724.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02724_07c5a845a98dce83f42c711c0408dc4dad947c9351918518d0af13bec53b52eb.jsonl.gz"}, "slow_code": "def main():\n x = int(eval(input()))\n ans = 0\n while x >= 500:\n x -= 500\n ans += 1000\n while x >= 5:\n x -= 5\n ans += 5\n print(ans)\n\n\nmain()\n", "slow_code_sha256": "07c5a845a98dce83f42c711c0408dc4dad947c9351918518d0af13bec53b52eb", "slow_id": "p02724_07c5a845a98dce83f42c711c0408dc4dad947c9351918518d0af13bec53b52eb", "speedup": 728.9863793228742, "stratum": "8+", "within_pair_jaccard": 0.3333333333333333, "workload": {"case_count": 100, "description": "Exchange amount X into coins of values 500,100,50,10,5,1. Maximize happiness: each 500-value coin earns 1000 points and each 5-value coin earns 5; other coins earn none. Observed inputs: X=0..1000000000 (median 393604620).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 11, "median": 10.0, "min": 2}, "input_format": ["X"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p03018_case_000", "p03018_case_001", "p03018_case_002", "p03018_case_003", "p03018_case_004", "p03018_case_005", "p03018_case_006", "p03018_case_007", "p03018_case_008", "p03018_case_009", "p03018_case_010", "p03018_case_011", "p03018_case_012", "p03018_case_013", "p03018_case_014", "p03018_case_015", "p03018_case_016", "p03018_case_017", "p03018_case_018", "p03018_case_019", "p03018_case_020", "p03018_case_021", "p03018_case_022", "p03018_case_023", "p03018_case_024", "p03018_case_025", "p03018_case_026", "p03018_case_027", "p03018_case_028", "p03018_case_029", "p03018_case_030", "p03018_case_031", "p03018_case_032", "p03018_case_033", "p03018_case_034", "p03018_case_035", "p03018_case_036", "p03018_case_037", "p03018_case_038", "p03018_case_039", "p03018_case_040", "p03018_case_041", "p03018_case_042", "p03018_case_043", "p03018_case_044", "p03018_case_045", "p03018_case_046", "p03018_case_047", "p03018_case_048", "p03018_case_049", "p03018_case_050", "p03018_case_051", "p03018_case_052", "p03018_case_053", "p03018_case_054", "p03018_case_055", "p03018_case_056", "p03018_case_057", "p03018_case_058", "p03018_case_059", "p03018_case_060", "p03018_case_061", "p03018_case_062", "p03018_case_063", "p03018_case_064", "p03018_case_065", "p03018_case_066", "p03018_case_067", "p03018_case_068", "p03018_case_069", "p03018_case_070", "p03018_case_071", "p03018_case_072", "p03018_case_073", "p03018_case_074", "p03018_case_075", "p03018_case_076", "p03018_case_077", "p03018_case_078", "p03018_case_079", "p03018_case_080", "p03018_case_081", "p03018_case_082", "p03018_case_083", "p03018_case_084", "p03018_case_085", "p03018_case_086", "p03018_case_087", "p03018_case_088", "p03018_case_089", "p03018_case_090", "p03018_case_091", "p03018_case_092", "p03018_case_093", "p03018_case_094", "p03018_case_095", "p03018_case_096", "p03018_case_097", "p03018_case_098", "p03018_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def main():\n S = input().replace(\"BC\", \"1\")\n ans = 0\n a = 0\n for s in S:\n if s == \"A\":\n a += 1\n elif s == \"1\":\n ans += a\n else:\n a = 0\n print(ans)\n\n\nmain()\n", "fast_code_sha256": "8eee5876adb81ae42ad96b3317874379ed91dc38265c72d607658861316866dc", "fast_id": "p03018_8eee5876adb81ae42ad96b3317874379ed91dc38265c72d607658861316866dc", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def main():\n S = input().replace(\"BC\", \"1\")\n ans = 0\n a = 0\n for s in S:\n if s == \"A\":\n a += 1\n elif s == \"1\":\n ans += a\n else:\n a = 0\n print(ans)\n\n\nmain()\n", "measured_fast_code_sha256": "8eee5876adb81ae42ad96b3317874379ed91dc38265c72d607658861316866dc", "measured_slow_code": "s = input().replace(\"BC\", \"D\")\na = []\nb = \"\"\nfor c in s:\n if c == \"B\" or c == \"C\":\n a.append(b)\n b = \"\"\n else:\n b += c\na.append(b)\nans = 0\nfor i in a:\n ac = 0\n for j in i:\n if j == \"A\":\n ac += 1\n else:\n ans += ac\nprint(ans)\n", "measured_slow_code_sha256": "fd183fde5f0186430550c6be0aa80d56ff2f1f20b47f308b4adea537159d9065", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.8013586256190584, "pair_id": "python_v2_f91cc419b3530932360a8e4b", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03018", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03018_8eee5876adb81ae42ad96b3317874379ed91dc38265c72d607658861316866dc.jsonl.gz", "inputs": "reproduction/python/inputs/p03018.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03018_fd183fde5f0186430550c6be0aa80d56ff2f1f20b47f308b4adea537159d9065.jsonl.gz"}, "slow_code": "s = input().replace(\"BC\", \"D\")\na = []\nb = \"\"\nfor c in s:\n if c == \"B\" or c == \"C\":\n a.append(b)\n b = \"\"\n else:\n b += c\na.append(b)\nans = 0\nfor i in a:\n ac = 0\n for j in i:\n if j == \"A\":\n ac += 1\n else:\n ans += ac\nprint(ans)\n", "slow_code_sha256": "fd183fde5f0186430550c6be0aa80d56ff2f1f20b47f308b4adea537159d9065", "slow_id": "p03018_fd183fde5f0186430550c6be0aa80d56ff2f1f20b47f308b4adea537159d9065", "speedup": 2.2906747312389135, "stratum": "2-4", "within_pair_jaccard": 0.5, "workload": {"case_count": 100, "description": "Given a string s over A,B,C, repeatedly replace any contiguous ABC by BCA. Find the maximum possible number of replacements. Observed inputs: s_length=1..200000 (median 1000); A_count=0..200000; B_count=0..200000; C_count=0..200000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 200001, "median": 1001.0, "min": 2}, "input_format": ["s"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p02641_case_000", "p02641_case_001", "p02641_case_002", "p02641_case_003", "p02641_case_004", "p02641_case_005", "p02641_case_006", "p02641_case_007", "p02641_case_008", "p02641_case_009", "p02641_case_010", "p02641_case_011", "p02641_case_012", "p02641_case_013", "p02641_case_014", "p02641_case_015", "p02641_case_016", "p02641_case_017", "p02641_case_018", "p02641_case_019", "p02641_case_020", "p02641_case_021", "p02641_case_022", "p02641_case_023", "p02641_case_024", "p02641_case_025", "p02641_case_026", "p02641_case_027", "p02641_case_028", "p02641_case_029", "p02641_case_030", "p02641_case_031", "p02641_case_032", "p02641_case_033", "p02641_case_034", "p02641_case_035", "p02641_case_036", "p02641_case_037", "p02641_case_038", "p02641_case_039", "p02641_case_040", "p02641_case_041", "p02641_case_042", "p02641_case_043", "p02641_case_044", "p02641_case_045", "p02641_case_046", "p02641_case_047", "p02641_case_048", "p02641_case_049", "p02641_case_050", "p02641_case_051", "p02641_case_052", "p02641_case_053", "p02641_case_054", "p02641_case_055", "p02641_case_056", "p02641_case_057", "p02641_case_058", "p02641_case_059", "p02641_case_060", "p02641_case_061", "p02641_case_062", "p02641_case_063", "p02641_case_064", "p02641_case_065", "p02641_case_066", "p02641_case_067", "p02641_case_068", "p02641_case_069", "p02641_case_070", "p02641_case_071", "p02641_case_072", "p02641_case_073", "p02641_case_074", "p02641_case_075", "p02641_case_076", "p02641_case_077", "p02641_case_078", "p02641_case_079", "p02641_case_080", "p02641_case_081", "p02641_case_082", "p02641_case_083", "p02641_case_084", "p02641_case_085", "p02641_case_086", "p02641_case_087", "p02641_case_088", "p02641_case_089", "p02641_case_090", "p02641_case_091", "p02641_case_092", "p02641_case_093", "p02641_case_094", "p02641_case_095", "p02641_case_096", "p02641_case_097", "p02641_case_098", "p02641_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\nX, N = list(map(int, input().split()))\nif N == 0:\n print(X)\n sys.exit()\np = list(map(int, input().split()))\nforbid = [True] * 102\nfor i in range(len(p)):\n if forbid[p[i]]:\n forbid[p[i]] = False\npp = []\nfor i in range(len(forbid)):\n if forbid[i]:\n pp.append(i - X)\nnum = pp[len(pp) - 1]\nfor i in range(len(pp) - 1, -1, -1):\n if abs(num) >= abs(pp[i]):\n num = pp[i]\nprint((num + X))\n", "fast_code_sha256": "d6bd4f9fde0638feb3929a007d29acb633d9ad11ec4ca371f0db57db447c69bf", "fast_id": "p02641_d6bd4f9fde0638feb3929a007d29acb633d9ad11ec4ca371f0db57db447c69bf", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\nX, N = list(map(int, input().split()))\nif N == 0:\n print(X)\n sys.exit()\np = list(map(int, input().split()))\nforbid = [True] * 102\nfor i in range(len(p)):\n if forbid[p[i]]:\n forbid[p[i]] = False\npp = []\nfor i in range(len(forbid)):\n if forbid[i]:\n pp.append(i - X)\nnum = pp[len(pp) - 1]\nfor i in range(len(pp) - 1, -1, -1):\n if abs(num) >= abs(pp[i]):\n num = pp[i]\nprint((num + X))\n", "measured_fast_code_sha256": "d6bd4f9fde0638feb3929a007d29acb633d9ad11ec4ca371f0db57db447c69bf", "measured_slow_code": "x, n = list(map(int, input().split()))\nif n == 0:\n print(x)\n exit()\narr = list(map(int, input().split())) # p1 ... pn\narr2 = []\narr3 = []\nfor i in range(-50, 110):\n if not i in arr:\n arr2.append(i)\n arr3.append(abs(x - i))\nn2 = min([i for i, v in enumerate(arr3) if v == min(arr3)])\nprint((arr2[n2]))\n", "measured_slow_code_sha256": "56a803f01b0149391407a67301955076fc165a7ad3ad3f8f8a9f51ab5d8af60e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.344925435948754, "pair_id": "python_v2_f6819ca1416ef73c043e27d0", "per_case_slow_code_faster_fraction": 0.03, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02641", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02641_d6bd4f9fde0638feb3929a007d29acb633d9ad11ec4ca371f0db57db447c69bf.jsonl.gz", "inputs": "reproduction/python/inputs/p02641.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02641_56a803f01b0149391407a67301955076fc165a7ad3ad3f8f8a9f51ab5d8af60e.jsonl.gz"}, "slow_code": "x, n = list(map(int, input().split()))\nif n == 0:\n print(x)\n exit()\narr = list(map(int, input().split()))\narr2 = []\narr3 = []\nfor i in range(-50, 110):\n if not i in arr:\n arr2.append(i)\n arr3.append(abs(x - i))\nn2 = min([i for i, v in enumerate(arr3) if v == min(arr3)])\nprint((arr2[n2]))\n", "slow_code_sha256": "85cbb5049fb6ba315c1cc49d08aa7371cf037161b52bac8a421580f3486b7f72", "slow_id": "p02641_56a803f01b0149391407a67301955076fc165a7ad3ad3f8f8a9f51ab5d8af60e", "speedup": 2.397854756583817, "stratum": "2-4", "within_pair_jaccard": 0.375, "workload": {"case_count": 100, "description": "Find an integer not in the N distinct forbidden values p_i that is closest to X. Integers need not be positive; ties favor the smaller integer. Observed inputs: X=1..100 (median 50); N=0..100 (median 99); p_i=1..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 300, "median": 295.0, "min": 4}, "input_format": ["X N\np_1 ... p_N (line omitted if N=0)"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 102, "median": 101.0, "min": 2}}} -{"case_ids": ["p02688_case_000", "p02688_case_001", "p02688_case_002", "p02688_case_003", "p02688_case_004", "p02688_case_005", "p02688_case_006", "p02688_case_007", "p02688_case_008", "p02688_case_009", "p02688_case_010", "p02688_case_011", "p02688_case_012", "p02688_case_013", "p02688_case_014", "p02688_case_015", "p02688_case_016", "p02688_case_017", "p02688_case_018", "p02688_case_019", "p02688_case_020", "p02688_case_021", "p02688_case_022", "p02688_case_023", "p02688_case_024", "p02688_case_025", "p02688_case_026", "p02688_case_027", "p02688_case_028", "p02688_case_029", "p02688_case_030", "p02688_case_031", "p02688_case_032", "p02688_case_033", "p02688_case_034", "p02688_case_035", "p02688_case_036", "p02688_case_037", "p02688_case_038", "p02688_case_039", "p02688_case_040", "p02688_case_041", "p02688_case_042", "p02688_case_043", "p02688_case_044", "p02688_case_045", "p02688_case_046", "p02688_case_047", "p02688_case_048", "p02688_case_049", "p02688_case_050", "p02688_case_051", "p02688_case_052", "p02688_case_053", "p02688_case_054", "p02688_case_055", "p02688_case_056", "p02688_case_057", "p02688_case_058", "p02688_case_059", "p02688_case_060", "p02688_case_061", "p02688_case_062", "p02688_case_063", "p02688_case_064", "p02688_case_065", "p02688_case_066", "p02688_case_067", "p02688_case_068", "p02688_case_069", "p02688_case_070", "p02688_case_071", "p02688_case_072", "p02688_case_073", "p02688_case_074", "p02688_case_075", "p02688_case_076", "p02688_case_077", "p02688_case_078", "p02688_case_079", "p02688_case_080", "p02688_case_081", "p02688_case_082", "p02688_case_083", "p02688_case_084", "p02688_case_085", "p02688_case_086", "p02688_case_087", "p02688_case_088", "p02688_case_089", "p02688_case_090", "p02688_case_091", "p02688_case_092", "p02688_case_093", "p02688_case_094", "p02688_case_095", "p02688_case_096", "p02688_case_097", "p02688_case_098", "p02688_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "R = lambda: list(map(int, input().split()))\nn, k = R()\ns = set()\nfor _ in range(k):\n R()\n s.update(R())\nprint((n - len(s)))\n", "fast_code_sha256": "3e6d626ab547675c3b341d29edcadee93969941923bd6eda1ba7144ea2b5a1d3", "fast_id": "p02688_3e6d626ab547675c3b341d29edcadee93969941923bd6eda1ba7144ea2b5a1d3", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "R = lambda: list(map(int, input().split()))\nn, k = R()\ns = set()\nfor _ in range(k):\n R()\n s.update(R())\nprint((n - len(s)))\n", "measured_fast_code_sha256": "3e6d626ab547675c3b341d29edcadee93969941923bd6eda1ba7144ea2b5a1d3", "measured_slow_code": "N, K = list(map(int, input().split()))\nd = []\nA = []\nfor _ in range(K):\n d.append(int(eval(input())))\n A.append(list(map(int, input().split())))\ncnt = {}\nfor i in range(N):\n cnt.setdefault(str(i + 1), 0)\nfor Ai in A:\n for Aij in Ai:\n cnt[str(Aij)] += 1\nans = 0\nfor key, val in list(cnt.items()):\n if val == 0:\n ans += 1\nprint(ans)\n", "measured_slow_code_sha256": "ee132a61c85b4e63a0153747cf5ebdecf3c684ad39621a40abb5c6d7e02f1c89", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.891100061705346, "pair_id": "python_v2_99040ea3997db2e3d313ead6", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02688", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02688_3e6d626ab547675c3b341d29edcadee93969941923bd6eda1ba7144ea2b5a1d3.jsonl.gz", "inputs": "reproduction/python/inputs/p02688.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02688_ee132a61c85b4e63a0153747cf5ebdecf3c684ad39621a40abb5c6d7e02f1c89.jsonl.gz"}, "slow_code": "N, K = list(map(int, input().split()))\nd = []\nA = []\nfor _ in range(K):\n d.append(int(eval(input())))\n A.append(list(map(int, input().split())))\ncnt = {}\nfor i in range(N):\n cnt.setdefault(str(i + 1), 0)\nfor Ai in A:\n for Aij in Ai:\n cnt[str(Aij)] += 1\nans = 0\nfor key, val in list(cnt.items()):\n if val == 0:\n ans += 1\nprint(ans)\n", "slow_code_sha256": "ee132a61c85b4e63a0153747cf5ebdecf3c684ad39621a40abb5c6d7e02f1c89", "slow_id": "p02688_ee132a61c85b4e63a0153747cf5ebdecf3c684ad39621a40abb5c6d7e02f1c89", "speedup": 2.6843284831410497, "stratum": "2-4", "within_pair_jaccard": 0.2702702702702703, "workload": {"case_count": 100, "description": "Among N people, count those owning no snack. For each of K snack kinds, d_i and a strictly increasing list of owner IDs A_i,j are supplied; one person may own several kinds. Observed inputs: N=1..100 (median 50); K=1..100 (median 50); d_i=1..100; total_owner_records=1..10000 (median 916).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 29608, "median": 2615.5, "min": 8}, "input_format": ["N K\nd_1\nA_1,1 ... A_1,d_1\n...\nd_K\nA_K,1 ... A_K,d_K"], "input_format_status": "source_input_section", "input_lines": {"max": 201, "median": 101.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 10102, "median": 988.0, "min": 4}}} -{"case_ids": ["p03331_case_000", "p03331_case_001", "p03331_case_002", "p03331_case_003", "p03331_case_004", "p03331_case_005", "p03331_case_006", "p03331_case_007", "p03331_case_008", "p03331_case_009", "p03331_case_010", "p03331_case_011", "p03331_case_012", "p03331_case_013", "p03331_case_014", "p03331_case_015", "p03331_case_016", "p03331_case_017", "p03331_case_018", "p03331_case_019", "p03331_case_020", "p03331_case_021", "p03331_case_022", "p03331_case_023", "p03331_case_024", "p03331_case_025", "p03331_case_026", "p03331_case_027", "p03331_case_028", "p03331_case_029", "p03331_case_030", "p03331_case_031", "p03331_case_032", "p03331_case_033", "p03331_case_034", "p03331_case_035", "p03331_case_036", "p03331_case_037", "p03331_case_038", "p03331_case_039", "p03331_case_040", "p03331_case_041", "p03331_case_042", "p03331_case_043", "p03331_case_044", "p03331_case_045", "p03331_case_046", "p03331_case_047", "p03331_case_048", "p03331_case_049", "p03331_case_050", "p03331_case_051", "p03331_case_052", "p03331_case_053", "p03331_case_054", "p03331_case_055", "p03331_case_056", "p03331_case_057", "p03331_case_058", "p03331_case_059", "p03331_case_060", "p03331_case_061", "p03331_case_062", "p03331_case_063", "p03331_case_064", "p03331_case_065", "p03331_case_066", "p03331_case_067", "p03331_case_068", "p03331_case_069", "p03331_case_070", "p03331_case_071", "p03331_case_072", "p03331_case_073", "p03331_case_074", "p03331_case_075", "p03331_case_076", "p03331_case_077", "p03331_case_078", "p03331_case_079", "p03331_case_080", "p03331_case_081", "p03331_case_082", "p03331_case_083", "p03331_case_084", "p03331_case_085", "p03331_case_086", "p03331_case_087", "p03331_case_088", "p03331_case_089", "p03331_case_090", "p03331_case_091", "p03331_case_092", "p03331_case_093", "p03331_case_094", "p03331_case_095", "p03331_case_096", "p03331_case_097", "p03331_case_098", "p03331_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\nprint((10 if n in [10**x for x in range(6)] else sum(map(int, str(n)))))\n", "fast_code_sha256": "8565b06f6410e66d6e76e13081e06ba2f1602221ce9032d31cf918be1e146cd2", "fast_id": "p03331_8565b06f6410e66d6e76e13081e06ba2f1602221ce9032d31cf918be1e146cd2", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\nprint((10 if n in [10**x for x in range(6)] else sum(map(int, str(n)))))\n", "measured_fast_code_sha256": "8565b06f6410e66d6e76e13081e06ba2f1602221ce9032d31cf918be1e146cd2", "measured_slow_code": "N = int(eval(input()))\nimport numpy as np\n\na = np.arange(N)\na = np.delete(a, 0)\nb = N - a\nnum_arr = []\nfor i in range(len(a)):\n factor_a = [int(x) for x in list(str(a[i]))]\n factor_b = [int(x) for x in list(str(b[i]))]\n num_arr.append(sum(factor_a) + sum(factor_b))\nprint((min(num_arr)))\n", "measured_slow_code_sha256": "153ddd3939958df9731f2cb6a9569dfdd13dde4cae47410105d9d1d355dcbd24", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 7379.109068152994, "pair_id": "python_v2_91929548376e1d1da7419e73", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03331", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03331_8565b06f6410e66d6e76e13081e06ba2f1602221ce9032d31cf918be1e146cd2.jsonl.gz", "inputs": "reproduction/python/inputs/p03331.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03331_153ddd3939958df9731f2cb6a9569dfdd13dde4cae47410105d9d1d355dcbd24.jsonl.gz"}, "slow_code": "N = int(eval(input()))\nimport numpy as np\n\na = np.arange(N)\na = np.delete(a, 0)\nb = N - a\nnum_arr = []\nfor i in range(len(a)):\n factor_a = [int(x) for x in list(str(a[i]))]\n factor_b = [int(x) for x in list(str(b[i]))]\n num_arr.append(sum(factor_a) + sum(factor_b))\nprint((min(num_arr)))\n", "slow_code_sha256": "153ddd3939958df9731f2cb6a9569dfdd13dde4cae47410105d9d1d355dcbd24", "slow_id": "p03331_153ddd3939958df9731f2cb6a9569dfdd13dde4cae47410105d9d1d355dcbd24", "speedup": 5500.519666696292, "stratum": "8+", "within_pair_jaccard": 0.29411764705882354, "workload": {"case_count": 100, "description": "Split N into two positive integers A+B=N, minimizing the sum of their decimal digit sums. Observed inputs: N=2..100000 (median 58160.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 7, "median": 6.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p03183_case_000", "p03183_case_001", "p03183_case_002", "p03183_case_003", "p03183_case_004", "p03183_case_005", "p03183_case_006", "p03183_case_007", "p03183_case_008", "p03183_case_009", "p03183_case_010", "p03183_case_011", "p03183_case_012", "p03183_case_013", "p03183_case_014", "p03183_case_015", "p03183_case_016", "p03183_case_017", "p03183_case_018", "p03183_case_019", "p03183_case_020", "p03183_case_021", "p03183_case_022", "p03183_case_023", "p03183_case_024", "p03183_case_025", "p03183_case_026", "p03183_case_027", "p03183_case_028", "p03183_case_029", "p03183_case_030", "p03183_case_031", "p03183_case_032", "p03183_case_033", "p03183_case_034", "p03183_case_035", "p03183_case_036", "p03183_case_037", "p03183_case_038", "p03183_case_039", "p03183_case_040", "p03183_case_041", "p03183_case_042", "p03183_case_043", "p03183_case_044", "p03183_case_045", "p03183_case_046", "p03183_case_047", "p03183_case_048", "p03183_case_049", "p03183_case_050", "p03183_case_051", "p03183_case_052", "p03183_case_053", "p03183_case_054", "p03183_case_055", "p03183_case_056", "p03183_case_057", "p03183_case_058", "p03183_case_059", "p03183_case_060", "p03183_case_061", "p03183_case_062", "p03183_case_063", "p03183_case_064", "p03183_case_065", "p03183_case_066", "p03183_case_067", "p03183_case_068", "p03183_case_069", "p03183_case_070", "p03183_case_071", "p03183_case_072", "p03183_case_073", "p03183_case_074", "p03183_case_075", "p03183_case_076", "p03183_case_077", "p03183_case_078", "p03183_case_079", "p03183_case_080", "p03183_case_081", "p03183_case_082", "p03183_case_083", "p03183_case_084", "p03183_case_085", "p03183_case_086", "p03183_case_087", "p03183_case_088", "p03183_case_089", "p03183_case_090", "p03183_case_091", "p03183_case_092", "p03183_case_093", "p03183_case_094", "p03183_case_095", "p03183_case_096", "p03183_case_097", "p03183_case_098", "p03183_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\nn = int(eval(input()))\nblocks = []\nfor line in sys.stdin.readlines():\n w, s, v = list(map(int, line.split()))\n blocks.append((w + s, w, s, v))\nblocks.sort()\ndp = [-1] * 20001\ndp[0] = 0\nfor _, w, s, v in blocks:\n for i in range(min(s, 20000 - w), -1, -1):\n dp[i + w] = max(dp[i + w], dp[i] + v)\nprint((max(dp)))\n", "fast_code_sha256": "a6f05f6814aaa0e64e66c755f9624bcbdfa7a7a1ce27b874109a71ffed4e3de3", "fast_id": "p03183_a6f05f6814aaa0e64e66c755f9624bcbdfa7a7a1ce27b874109a71ffed4e3de3", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\nn = int(eval(input()))\nblocks = []\nfor line in sys.stdin.readlines():\n w, s, v = list(map(int, line.split()))\n blocks.append((w + s, w, s, v))\nblocks.sort()\ndp = [-1] * 20001\ndp[0] = 0\nfor _, w, s, v in blocks:\n for i in range(min(s, 20000 - w), -1, -1):\n dp[i + w] = max(dp[i + w], dp[i] + v)\nprint((max(dp)))\n", "measured_fast_code_sha256": "a6f05f6814aaa0e64e66c755f9624bcbdfa7a7a1ce27b874109a71ffed4e3de3", "measured_slow_code": "import sys\n\nsys.setrecursionlimit(2147483647)\nINF = float(\"inf\")\nMOD = 10**9 + 7\ninput = lambda: sys.stdin.readline().rstrip()\n\n\ndef resolve():\n from functools import cmp_to_key\n\n n = int(eval(input()))\n B = [list(map(int, input().split())) for _ in range(n)]\n\n def cmp(a, b):\n va = min(a[1], b[1] - a[0])\n vb = min(b[1], a[1] - b[0])\n if va == vb:\n return 0\n return -1 if (va > vb) else 1\n\n B.sort(key=cmp_to_key(cmp))\n maxS = 20000\n dp = [-INF] * (maxS + 1)\n dp[0] = 0\n for i in range(n):\n w, s, v = B[i]\n ndp = dp[:]\n for total in range(maxS + 1):\n if total <= s and total + s <= maxS:\n ndp[total + w] = max(ndp[total + w], dp[total] + v)\n dp = ndp[:]\n print((max(dp)))\n\n\nresolve()\n", "measured_slow_code_sha256": "961ff7e33dcf41c91be9ccd5c27fe0c80e6fd0d2467fec260e8393b575caab59", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.3582082660444685, "pair_id": "python_v2_d9225abf3d7add939e946692", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03183", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03183_a6f05f6814aaa0e64e66c755f9624bcbdfa7a7a1ce27b874109a71ffed4e3de3.jsonl.gz", "inputs": "reproduction/python/inputs/p03183.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03183_961ff7e33dcf41c91be9ccd5c27fe0c80e6fd0d2467fec260e8393b575caab59.jsonl.gz"}, "slow_code": "import sys\n\nsys.setrecursionlimit(2147483647)\nINF = float(\"inf\")\nMOD = 10**9 + 7\ninput = lambda: sys.stdin.readline().rstrip()\n\n\ndef resolve():\n from functools import cmp_to_key\n\n n = int(eval(input()))\n B = [list(map(int, input().split())) for _ in range(n)]\n\n def cmp(a, b):\n va = min(a[1], b[1] - a[0])\n vb = min(b[1], a[1] - b[0])\n if va == vb:\n return 0\n return -1 if (va > vb) else 1\n\n B.sort(key=cmp_to_key(cmp))\n maxS = 20000\n dp = [-INF] * (maxS + 1)\n dp[0] = 0\n for i in range(n):\n w, s, v = B[i]\n ndp = dp[:]\n for total in range(maxS + 1):\n if total <= s and total + s <= maxS:\n ndp[total + w] = max(ndp[total + w], dp[total] + v)\n dp = ndp[:]\n print((max(dp)))\n\n\nresolve()\n", "slow_code_sha256": "961ff7e33dcf41c91be9ccd5c27fe0c80e6fd0d2467fec260e8393b575caab59", "slow_id": "p03183_961ff7e33dcf41c91be9ccd5c27fe0c80e6fd0d2467fec260e8393b575caab59", "speedup": 2.7910649414785964, "stratum": "2-4", "within_pair_jaccard": 0.41935483870967744, "workload": {"case_count": 100, "description": "Choose and order some of N blocks into a tower to maximize total value v_i. Block i has weight w_i and can support total weight at most s_i strictly above it. Each block can be used at most once. Observed inputs: N=10..1000 (median 100); w_i=1..10000; s_i=1..10000; v_i=69804..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 21928, "median": 2196.5, "min": 139}, "input_format": ["N\nw_1 s_1 v_1\n...\nw_N s_N v_N"], "input_format_status": "source_input_section", "input_lines": {"max": 1001, "median": 101.0, "min": 11}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3001, "median": 301.0, "min": 31}}} -{"case_ids": ["p04006_case_000", "p04006_case_001", "p04006_case_002", "p04006_case_003", "p04006_case_004", "p04006_case_005", "p04006_case_006", "p04006_case_007", "p04006_case_008", "p04006_case_009", "p04006_case_010", "p04006_case_011", "p04006_case_012", "p04006_case_013", "p04006_case_014", "p04006_case_015", "p04006_case_016", "p04006_case_017", "p04006_case_018", "p04006_case_019", "p04006_case_020", "p04006_case_021", "p04006_case_022", "p04006_case_023", "p04006_case_024", "p04006_case_025", "p04006_case_026", "p04006_case_027", "p04006_case_028", "p04006_case_029", "p04006_case_030", "p04006_case_031", "p04006_case_032", "p04006_case_033", "p04006_case_034", "p04006_case_035", "p04006_case_036", "p04006_case_037", "p04006_case_038", "p04006_case_039", "p04006_case_040", "p04006_case_041", "p04006_case_042", "p04006_case_043", "p04006_case_044", "p04006_case_045", "p04006_case_046", "p04006_case_047", "p04006_case_048", "p04006_case_049", "p04006_case_050", "p04006_case_051", "p04006_case_052", "p04006_case_053", "p04006_case_054", "p04006_case_055", "p04006_case_056", "p04006_case_057", "p04006_case_058", "p04006_case_059", "p04006_case_060", "p04006_case_061", "p04006_case_062", "p04006_case_063", "p04006_case_064", "p04006_case_065", "p04006_case_066", "p04006_case_067", "p04006_case_068", "p04006_case_069", "p04006_case_070", "p04006_case_071", "p04006_case_072", "p04006_case_073", "p04006_case_074", "p04006_case_075", "p04006_case_076", "p04006_case_077", "p04006_case_078", "p04006_case_079", "p04006_case_080", "p04006_case_081", "p04006_case_082", "p04006_case_083", "p04006_case_084", "p04006_case_085", "p04006_case_086", "p04006_case_087", "p04006_case_088", "p04006_case_089", "p04006_case_090", "p04006_case_091", "p04006_case_092", "p04006_case_093", "p04006_case_094", "p04006_case_095", "p04006_case_096", "p04006_case_097", "p04006_case_098"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 99, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n, x = [int(i) for i in input().split()]\nA = [int(i) for i in input().split()]\nB = A[:]\nans = sum(A)\nfor i in range(1, n):\n for j in range(n):\n B[j] = min(B[j], A[j - i])\n ans = min(ans, sum(B) + i * x)\nprint(ans)\n", "fast_code_sha256": "66246b4e7ebc7638aa6316cd1d0d04c5f1b9ee22288c88f749f852eeca0f1e44", "fast_id": "p04006_66246b4e7ebc7638aa6316cd1d0d04c5f1b9ee22288c88f749f852eeca0f1e44", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n, x = [int(i) for i in input().split()]\nA = [int(i) for i in input().split()]\nB = A[:]\nans = sum(A)\nfor i in range(1, n):\n for j in range(n):\n B[j] = min(B[j], A[j - i])\n ans = min(ans, sum(B) + i * x)\nprint(ans)\n", "measured_fast_code_sha256": "66246b4e7ebc7638aa6316cd1d0d04c5f1b9ee22288c88f749f852eeca0f1e44", "measured_slow_code": "import sys\nimport numpy as np\n\ninput = sys.stdin.readline\n\n\ndef main():\n N, x = list(map(int, input().split()))\n a = list(map(int, input().split()))\n min_ = np.array(a)\n ans = sum(min_)\n # 魔法を唱える回数 k\n for k in range(1, N):\n min_ = np.minimum(min_, np.roll(min_, 1))\n ans = min(ans, k * x + sum(min_))\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "7c9ffa5f21aea1508d9fdaeb3beea6752b613b3dad204c9c8f0124a3104b75b0", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 0.7434127667225167, "pair_id": "python_v2_0e12911d6d117c5efcb29f2a", "per_case_slow_code_faster_fraction": 0.5555555555555556, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p04006", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p04006_66246b4e7ebc7638aa6316cd1d0d04c5f1b9ee22288c88f749f852eeca0f1e44.jsonl.gz", "inputs": "reproduction/python/inputs/p04006.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p04006_7c9ffa5f21aea1508d9fdaeb3beea6752b613b3dad204c9c8f0124a3104b75b0.jsonl.gz"}, "slow_code": "import sys\nimport numpy as np\n\ninput = sys.stdin.readline\n\n\ndef main():\n N, x = list(map(int, input().split()))\n a = list(map(int, input().split()))\n min_ = np.array(a)\n ans = sum(min_)\n\n for k in range(1, N):\n min_ = np.minimum(min_, np.roll(min_, 1))\n ans = min(ans, k * x + sum(min_))\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "030bee4d3adf4f546019c3108859e78c291877e9a42103460f74527af78af871", "slow_id": "p04006_7c9ffa5f21aea1508d9fdaeb3beea6752b613b3dad204c9c8f0124a3104b75b0", "speedup": 6.872168925010549, "stratum": "4-8", "within_pair_jaccard": 0.3157894736842105, "workload": {"case_count": 99, "description": "Starting with no slimes, acquire all N colors. Catching a missing color i costs a_i time; a spell costs x and rotates every held color i to i+1, wrapping N to 1. Minimize total time. Observed inputs: N=2..2000 (median 1000); x=1..1000000000; a_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 99, "input_bytes": {"max": 20015, "median": 5795, "min": 10}, "input_format": ["N x\na_1 ... a_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2002, "median": 1002, "min": 4}}} -{"case_ids": ["p00100_case_000", "p00100_case_001", "p00100_case_002", "p00100_case_003", "p00100_case_004", "p00100_case_005", "p00100_case_006", "p00100_case_007", "p00100_case_008", "p00100_case_009", "p00100_case_010", "p00100_case_011", "p00100_case_012", "p00100_case_013", "p00100_case_014", "p00100_case_015", "p00100_case_016", "p00100_case_017", "p00100_case_018", "p00100_case_019", "p00100_case_020", "p00100_case_021", "p00100_case_022", "p00100_case_023", "p00100_case_024", "p00100_case_025", "p00100_case_026", "p00100_case_027", "p00100_case_028", "p00100_case_029", "p00100_case_030", "p00100_case_031", "p00100_case_032", "p00100_case_033", "p00100_case_034", "p00100_case_035", "p00100_case_036", "p00100_case_037", "p00100_case_038", "p00100_case_039", "p00100_case_040", "p00100_case_041", "p00100_case_042", "p00100_case_043", "p00100_case_044", "p00100_case_045", "p00100_case_046", "p00100_case_047", "p00100_case_048", "p00100_case_049", "p00100_case_050", "p00100_case_051", "p00100_case_052", "p00100_case_053", "p00100_case_054", "p00100_case_055", "p00100_case_056", "p00100_case_057", "p00100_case_058", "p00100_case_059", "p00100_case_060", "p00100_case_061", "p00100_case_062", "p00100_case_063", "p00100_case_064", "p00100_case_065", "p00100_case_066", "p00100_case_067", "p00100_case_068", "p00100_case_069", "p00100_case_070", "p00100_case_071", "p00100_case_072", "p00100_case_073", "p00100_case_074", "p00100_case_075", "p00100_case_076", "p00100_case_077", "p00100_case_078", "p00100_case_079", "p00100_case_080", "p00100_case_081", "p00100_case_082", "p00100_case_083", "p00100_case_084", "p00100_case_085", "p00100_case_086", "p00100_case_087", "p00100_case_088", "p00100_case_089", "p00100_case_090", "p00100_case_091", "p00100_case_092", "p00100_case_093", "p00100_case_094", "p00100_case_095", "p00100_case_096", "p00100_case_097", "p00100_case_098", "p00100_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "executable_AST_equal_except_explicit_explanatory_string_removal_and_all_frozen_inputs_checker_pass", "fast_code": "import sys\nfrom collections import OrderedDict\n\n\ndef solve(data):\n\n sums = OrderedDict()\n for id, p, q in data:\n if id in sums:\n sums[id] += p * q\n else:\n sums[id] = p * q\n result = [key for key, value in list(sums.items()) if value >= 1000000]\n return result\n\n\ndef main(args):\n\n while True:\n num = int(eval(input()))\n if num == 0:\n break\n data = []\n for _ in range(num):\n data.append([int(x) for x in input().split(\" \")])\n result = solve(data)\n if result:\n for ele in result:\n print(ele)\n else:\n print(\"NA\")\n\n\nif __name__ == \"__main__\":\n main(sys.argv[1:])\n", "fast_code_sha256": "a4eba5c9d642b103b8b4f0414c710b0072c94b849e28bedb019ea97f6dc9bd14", "fast_id": "p00100_c650910a23f4c80cdec40d71f55f58b53ce601c16cbff163efc652624012aa46", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "# -*- coding: utf-8 -*-\n\"\"\"\nhttp://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0100&lang=jp\n\"\"\"\nimport sys\nfrom collections import OrderedDict\n\n\ndef solve(data):\n # ?£???????1,000,000??\\????????????ID?????????\n # ??????????????????????????°????????´??????????????????ID?????\\??????????????????????????????????????????\n sums = OrderedDict()\n for id, p, q in data:\n if id in sums:\n sums[id] += p * q\n else:\n sums[id] = p * q\n result = [key for key, value in list(sums.items()) if value >= 1000000]\n return result\n\n\ndef main(args):\n # data = []\n # data.append([1001, 2000, 520])\n # data.append([1002, 1800, 450])\n # data.append([1003, 1600, 625])\n # data.append([1001, 200, 1220])\n while True:\n num = int(eval(input()))\n if num == 0:\n break\n data = []\n for _ in range(num):\n data.append([int(x) for x in input().split(\" \")])\n result = solve(data)\n if result:\n for ele in result:\n print(ele)\n else:\n print(\"NA\")\n\n\nif __name__ == \"__main__\":\n main(sys.argv[1:])\n", "measured_fast_code_sha256": "c650910a23f4c80cdec40d71f55f58b53ce601c16cbff163efc652624012aa46", "measured_slow_code": "# coding: utf-8\n# Here your code !\nemployeeSalesList = []\n\n\ndef resetDataset():\n del employeeSalesList[0 : len(employeeSalesList) + 1]\n\n\ndef readDataCount():\n return int(eval(input()))\n\n\ndef searchEmployeeSales(employeeId):\n for data in employeeSalesList:\n if data[0] == employeeId:\n return data\n newData = [employeeId, 0]\n employeeSalesList.append(newData)\n return newData\n\n\nanswerList = []\n\n\ndef printEmployeeOfDataset():\n found = False\n for data in employeeSalesList:\n if data[1] >= 1000000:\n answerList.append(data[0])\n found = True\n if not found:\n answerList.append(\"NA\")\n\n\nresetDataset()\ndataCount = readDataCount()\nwhile dataCount > 0:\n for _ in range(dataCount):\n employeeId, price, volume = list(map(int, input().split(\" \")))\n employeeSales = searchEmployeeSales(employeeId)\n employeeSales[1] += price * volume\n printEmployeeOfDataset()\n resetDataset()\n dataCount = readDataCount()\nfor row in answerList:\n print(row)\n", "measured_slow_code_sha256": "cef1778ac31a96be11bbaf1627cf2c94f88d5ea9907d28e19f44f8b7a1d378a1", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.9577442529577787, "pair_id": "python_v2_17fa6594f2ffa18c057abdf4", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p00100", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p00100_c650910a23f4c80cdec40d71f55f58b53ce601c16cbff163efc652624012aa46.jsonl.gz", "inputs": "reproduction/python/inputs/p00100.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p00100_cef1778ac31a96be11bbaf1627cf2c94f88d5ea9907d28e19f44f8b7a1d378a1.jsonl.gz"}, "slow_code": "employeeSalesList = []\n\n\ndef resetDataset():\n del employeeSalesList[0 : len(employeeSalesList) + 1]\n\n\ndef readDataCount():\n return int(eval(input()))\n\n\ndef searchEmployeeSales(employeeId):\n for data in employeeSalesList:\n if data[0] == employeeId:\n return data\n newData = [employeeId, 0]\n employeeSalesList.append(newData)\n return newData\n\n\nanswerList = []\n\n\ndef printEmployeeOfDataset():\n found = False\n for data in employeeSalesList:\n if data[1] >= 1000000:\n answerList.append(data[0])\n found = True\n if not found:\n answerList.append(\"NA\")\n\n\nresetDataset()\ndataCount = readDataCount()\nwhile dataCount > 0:\n for _ in range(dataCount):\n employeeId, price, volume = list(map(int, input().split(\" \")))\n employeeSales = searchEmployeeSales(employeeId)\n employeeSales[1] += price * volume\n printEmployeeOfDataset()\n resetDataset()\n dataCount = readDataCount()\nfor row in answerList:\n print(row)\n", "slow_code_sha256": "90eeb5d17013d087aa6085c705f90d8dd3710ca805802ad063fb9a202bdd752c", "slow_id": "p00100_cef1778ac31a96be11bbaf1627cf2c94f88d5ea9907d28e19f44f8b7a1d378a1", "speedup": 3.205806785365859, "stratum": "2-4", "within_pair_jaccard": 0.3230769230769231, "workload": {"case_count": 100, "description": "For each sales dataset, sum price p times quantity q per employee ID. Output IDs with total proceeds at least 1000000 in first-appearance order, or NA if none qualify. IDs may repeat across records; a final zero ends input. Observed inputs: datasets=1; n=5..3999; total_records=5..3999 (median 400); p=1..999957; q=1..99998.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 71109, "median": 7115.5, "min": 65}, "input_format": ["n_1\nid_1 p_1 q_1\n...\nid_(n_1) p_(n_1) q_(n_1)\n[next datasets]\n0"], "input_format_status": "source_input_section", "input_lines": {"max": 4001, "median": 402.0, "min": 7}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 11999, "median": 1202.0, "min": 17}}} -{"case_ids": ["p02394_case_000", "p02394_case_001", "p02394_case_002", "p02394_case_003", "p02394_case_004", "p02394_case_005", "p02394_case_006", "p02394_case_007", "p02394_case_008", "p02394_case_009", "p02394_case_010", "p02394_case_011", "p02394_case_012", "p02394_case_013", "p02394_case_014", "p02394_case_015", "p02394_case_016", "p02394_case_017", "p02394_case_018", "p02394_case_019", "p02394_case_020", "p02394_case_021", "p02394_case_022", "p02394_case_023", "p02394_case_024", "p02394_case_025", "p02394_case_026", "p02394_case_027", "p02394_case_028", "p02394_case_029", "p02394_case_030", "p02394_case_031", "p02394_case_032", "p02394_case_033", "p02394_case_034", "p02394_case_035", "p02394_case_036", "p02394_case_037", "p02394_case_038", "p02394_case_039", "p02394_case_040", "p02394_case_041", "p02394_case_042", "p02394_case_043", "p02394_case_044", "p02394_case_045", "p02394_case_046", "p02394_case_047", "p02394_case_048", "p02394_case_049", "p02394_case_050", "p02394_case_051", "p02394_case_052", "p02394_case_053", "p02394_case_054", "p02394_case_055", "p02394_case_056", "p02394_case_057", "p02394_case_058", "p02394_case_059", "p02394_case_060", "p02394_case_061", "p02394_case_062", "p02394_case_063", "p02394_case_064", "p02394_case_065", "p02394_case_066", "p02394_case_067", "p02394_case_068", "p02394_case_069", "p02394_case_070", "p02394_case_071", "p02394_case_072", "p02394_case_073", "p02394_case_074", "p02394_case_075", "p02394_case_076", "p02394_case_077", "p02394_case_078", "p02394_case_079", "p02394_case_080", "p02394_case_081", "p02394_case_082", "p02394_case_083", "p02394_case_084", "p02394_case_085", "p02394_case_086", "p02394_case_087", "p02394_case_088", "p02394_case_089", "p02394_case_090", "p02394_case_091", "p02394_case_092", "p02394_case_093", "p02394_case_094", "p02394_case_095", "p02394_case_096", "p02394_case_097", "p02394_case_098", "p02394_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "W, H, x, y, r = list(map(int, input().split()))\nchk1 = r <= x <= W - r\nchk2 = r <= y <= H - r\nchk0 = \"Yes\" if (chk1 == True and chk2 == True) else \"No\"\nprint(chk0)\n", "fast_code_sha256": "30b1727de6191944f11396782aa7c3484a2702c3cf9a380afbc33543d3c00c18", "fast_id": "p02394_30b1727de6191944f11396782aa7c3484a2702c3cf9a380afbc33543d3c00c18", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "W, H, x, y, r = list(map(int, input().split()))\nchk1 = r <= x <= W - r\nchk2 = r <= y <= H - r\nchk0 = \"Yes\" if (chk1 == True and chk2 == True) else \"No\"\nprint(chk0)\n", "measured_fast_code_sha256": "30b1727de6191944f11396782aa7c3484a2702c3cf9a380afbc33543d3c00c18", "measured_slow_code": "# coding: utf-8\n# Here your code !\nimport math\n\n\ndef func():\n try:\n line = input().rstrip()\n numbers = line.split(\" \")\n width = float(numbers[0])\n height = float(numbers[1])\n x = float(numbers[2])\n y = float(numbers[3])\n r = abs(float(numbers[4]))\n except:\n print(\"input error\")\n return -1\n wsign = math.copysign(1, width)\n hsign = math.copysign(1, height)\n result = \"No\"\n if wsign * x + r <= wsign * width:\n if wsign * x - r >= 0:\n if hsign * y + r <= hsign * height:\n if hsign * y - r >= 0:\n result = \"Yes\"\n print(result)\n\n\nfunc()\n", "measured_slow_code_sha256": "ceb52516da2a20f5a81680adb3804de11c080bcf9d7959090981292e324bd192", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.211431690795184, "pair_id": "python_v2_c271bdf6875829280c2326b7", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02394", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02394_30b1727de6191944f11396782aa7c3484a2702c3cf9a380afbc33543d3c00c18.jsonl.gz", "inputs": "reproduction/python/inputs/p02394.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02394_ceb52516da2a20f5a81680adb3804de11c080bcf9d7959090981292e324bd192.jsonl.gz"}, "slow_code": "import math\n\n\ndef func():\n try:\n line = input().rstrip()\n numbers = line.split(\" \")\n width = float(numbers[0])\n height = float(numbers[1])\n x = float(numbers[2])\n y = float(numbers[3])\n r = abs(float(numbers[4]))\n except:\n print(\"input error\")\n return -1\n wsign = math.copysign(1, width)\n hsign = math.copysign(1, height)\n result = \"No\"\n if wsign * x + r <= wsign * width:\n if wsign * x - r >= 0:\n if hsign * y + r <= hsign * height:\n if hsign * y - r >= 0:\n result = \"Yes\"\n print(result)\n\n\nfunc()\n", "slow_code_sha256": "e4c0f03d295e5c61a184396615a9d70d363a9daccbdc76c7d869931546d3a965", "slow_id": "p02394_ceb52516da2a20f5a81680adb3804de11c080bcf9d7959090981292e324bd192", "speedup": 2.2118003585402772, "stratum": "2-4", "within_pair_jaccard": 0.20454545454545456, "workload": {"case_count": 100, "description": "Decide whether the entire circle centered at (x,y) with radius r lies in the closed rectangle [0,W]x[0,H]. Touching the rectangle boundary is allowed. The five supplied values are integers. Observed inputs: W=1..100; H=1..100; x=-100..100; y=-100..100; r=1..96.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 19, "median": 15.5, "min": 10}, "input_format": ["W H x y r"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 5, "median": 5.0, "min": 5}}} -{"case_ids": ["p02890_case_000", "p02890_case_001", "p02890_case_002", "p02890_case_003", "p02890_case_004", "p02890_case_005", "p02890_case_006", "p02890_case_007", "p02890_case_008", "p02890_case_009", "p02890_case_010", "p02890_case_011", "p02890_case_012", "p02890_case_013", "p02890_case_014", "p02890_case_015", "p02890_case_016", "p02890_case_017", "p02890_case_018", "p02890_case_019", "p02890_case_020", "p02890_case_021", "p02890_case_022", "p02890_case_023", "p02890_case_024", "p02890_case_025", "p02890_case_026", "p02890_case_027", "p02890_case_028", "p02890_case_029", "p02890_case_030", "p02890_case_031", "p02890_case_032", "p02890_case_033", "p02890_case_034", "p02890_case_035", "p02890_case_036", "p02890_case_037", "p02890_case_038", "p02890_case_039", "p02890_case_040", "p02890_case_041", "p02890_case_042", "p02890_case_043", "p02890_case_044", "p02890_case_045", "p02890_case_046", "p02890_case_047", "p02890_case_048", "p02890_case_049", "p02890_case_050", "p02890_case_051", "p02890_case_052", "p02890_case_053", "p02890_case_054", "p02890_case_055", "p02890_case_056", "p02890_case_057", "p02890_case_058", "p02890_case_059", "p02890_case_060", "p02890_case_061", "p02890_case_062", "p02890_case_063", "p02890_case_064", "p02890_case_065", "p02890_case_066", "p02890_case_067", "p02890_case_068", "p02890_case_069", "p02890_case_070", "p02890_case_071", "p02890_case_072", "p02890_case_073", "p02890_case_074", "p02890_case_075", "p02890_case_076", "p02890_case_077", "p02890_case_078", "p02890_case_079", "p02890_case_080", "p02890_case_081", "p02890_case_082", "p02890_case_083", "p02890_case_084", "p02890_case_085", "p02890_case_086", "p02890_case_087", "p02890_case_088", "p02890_case_089", "p02890_case_090", "p02890_case_091", "p02890_case_092", "p02890_case_093", "p02890_case_094", "p02890_case_095", "p02890_case_096", "p02890_case_097", "p02890_case_098", "p02890_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "executable_AST_equal_except_explicit_explanatory_string_removal_and_all_frozen_inputs_checker_pass", "fast_code": "I = int(eval(input()))\nfrom collections import Counter\nfrom itertools import accumulate\n\nAs = list(map(int, input().split()))\nxs = sorted([x for x in list(Counter(As).values())]) + [10**18]\nXs = accumulate(xs)\n\n\ndef bsearch(target, min_i, max_i, func):\n\n if func(max_i) <= target:\n return max_i\n if target < func(min_i):\n return min_i - 1\n index = (max_i + min_i) // 2\n while True:\n if func(index) <= target:\n if target < func(index + 1):\n return index\n index, min_i = (index + 1 + max_i) // 2, index + 1\n continue\n index, max_i = (index - 1 + min_i) // 2, index - 1\n\n\nN = len(xs) - 1\nrs = [0] * I\nmny = N + 1\nfor l, (x, X) in enumerate(zip(xs[1:], Xs)):\n l += 2\n y = bsearch(0, N - l + 2, N + 1, lambda k: x > X // (k - (N - l + 1)))\n y += 1\n\n for i in range(y, mny):\n rs[i - 1] = X // (i - (N - l + 1))\n mny = min(y, mny)\nfor r in rs:\n print(r)\n", "fast_code_sha256": "19f1599ea6de8a19aebe50bded1ee2ed845af9656bed1eb7c085e4fdfef53406", "fast_id": "p02890_b135861f34453e9187acbc7ee07a7460d65ffea8f893fea0d5bb0c85c3aefb28", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "I = int(eval(input()))\nfrom collections import Counter\nfrom itertools import accumulate\n\nAs = list(map(int, input().split()))\nxs = sorted([x for x in list(Counter(As).values())]) + [10**18]\nXs = accumulate(xs)\n\n\ndef bsearch(target, min_i, max_i, func):\n # func(index) <= target < func(index+1) となるindexを返す\n if func(max_i) <= target:\n return max_i\n if target < func(min_i):\n return min_i - 1\n index = (max_i + min_i) // 2\n while True:\n if func(index) <= target:\n if target < func(index + 1):\n return index\n index, min_i = (index + 1 + max_i) // 2, index + 1\n continue\n index, max_i = (index - 1 + min_i) // 2, index - 1\n\n\n# for x in xs:\nN = len(xs) - 1\nrs = [0] * I\nmny = N + 1\nfor l, (x, X) in enumerate(zip(xs[1:], Xs)):\n l += 2\n y = bsearch(0, N - l + 2, N + 1, lambda k: x > X // (k - (N - l + 1)))\n y += 1\n # print(l, y, X//(y-(N-l+1)))\n for i in range(y, mny):\n rs[i - 1] = X // (i - (N - l + 1))\n mny = min(y, mny)\nfor r in rs:\n print(r)\n", "measured_fast_code_sha256": "b135861f34453e9187acbc7ee07a7460d65ffea8f893fea0d5bb0c85c3aefb28", "measured_slow_code": "#!/usr/bin/env python3\nimport sys\nimport math\nfrom bisect import bisect_right as br\nfrom bisect import bisect_left as bl\n\nsys.setrecursionlimit(2147483647)\nfrom heapq import heappush, heappop, heappushpop\nfrom collections import defaultdict\nfrom itertools import accumulate\nfrom collections import Counter\nfrom collections import deque\nfrom operator import itemgetter\nfrom itertools import permutations\n\nmod = 10**9 + 7\ninf = float(\"inf\")\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\n\"\"\"\n.2分探索を考える\n.各kに対してx回以上抜き出せるかという問いを考える\n.各数の個数を数えて数iの個数をCiとする\n.各数iを抜き出せるのはCiまで\n ⇒各数を抜き出す回数min(Ci,x)\n.Σmin(Ci,x)はkx以上でなければいけない(k個x回抜き出すため)\n.これを満たすときx回抜き出せる\n.このままではO(n^2(logn))なので工夫する\n.Σ(min(Ci,x))はk依存でないのでここを工夫する(Σ(min(Ci,x))をSxとする)\n.SxはSx-1と比べてx以上のCiの数だけ増える(x以上のCiの数をDxとする)\n.Sx := Sx-1 + Dx\n.Dxを求める時はCのリストについてbisectを行う。\n.Sx >= k*xとなるxの最大値を2分探索で求める。(O(nlogn))\n\"\"\"\nn = I()\na = LI()\ncnt = list(Counter(a).values())\ncnt.sort()\nm = len(cnt)\nS = [0] * (n + 1)\nfor x in range(1, n + 1):\n l = bl(cnt, x)\n S[x] = S[x - 1] + (m - l)\nfor k in range(1, n + 1):\n high, low = n + 1, 0\n while high - low > 1:\n mid = (high + low) // 2\n if S[mid] >= k * mid:\n low = mid\n else:\n high = mid\n print(low)\n", "measured_slow_code_sha256": "683b16708a4919fe826584e325a20783d2265d979233683a19a27263211ea906", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 5.869772817397944, "pair_id": "python_v2_e73053648f11ae73865ac2ef", "per_case_slow_code_faster_fraction": 0.31, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02890", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02890_b135861f34453e9187acbc7ee07a7460d65ffea8f893fea0d5bb0c85c3aefb28.jsonl.gz", "inputs": "reproduction/python/inputs/p02890.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02890_683b16708a4919fe826584e325a20783d2265d979233683a19a27263211ea906.jsonl.gz"}, "slow_code": "import sys\nimport math\nfrom bisect import bisect_right as br\nfrom bisect import bisect_left as bl\n\nsys.setrecursionlimit(2147483647)\nfrom heapq import heappush, heappop, heappushpop\nfrom collections import defaultdict\nfrom itertools import accumulate\nfrom collections import Counter\nfrom collections import deque\nfrom operator import itemgetter\nfrom itertools import permutations\n\nmod = 10**9 + 7\ninf = float(\"inf\")\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\nn = I()\na = LI()\ncnt = list(Counter(a).values())\ncnt.sort()\nm = len(cnt)\nS = [0] * (n + 1)\nfor x in range(1, n + 1):\n l = bl(cnt, x)\n S[x] = S[x - 1] + (m - l)\nfor k in range(1, n + 1):\n high, low = n + 1, 0\n while high - low > 1:\n mid = (high + low) // 2\n if S[mid] >= k * mid:\n low = mid\n else:\n high = mid\n print(low)\n", "slow_code_sha256": "2c57f5c3d6e04ae779c203c63a7a33316889e85db23460b3b699e27933e99fbd", "slow_id": "p02890_683b16708a4919fe826584e325a20783d2265d979233683a19a27263211ea906", "speedup": 3.3523371199322556, "stratum": "2-4", "within_pair_jaccard": 0.25, "workload": {"case_count": 100, "description": "For each K=1..N, find the maximum number of disjoint groups of exactly K cards that can be removed, requiring all values within each group to differ. The same N-card multiset is considered independently for every K. Observed inputs: N=1..300000 (median 100000); A_i=1..300000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 2100007, "median": 238900.5, "min": 4}, "input_format": ["N\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 300001, "median": 100001.0, "min": 2}}} -{"case_ids": ["p02619_case_012", "p02619_case_013", "p02619_case_025", "p02619_case_026", "p02619_case_043", "p02619_case_044", "p02619_case_052", "p02619_case_053", "p02619_case_054", "p02619_case_073", "p02619_case_082", "p02619_case_083", "p02619_case_084", "p02619_case_092", "p02619_case_093", "p02619_v2_a2beef34f549391bcfab", "p02619_v2_d53b9ea5c5792673310a", "p02619_v2_75570918b98373695774", "p02619_v2_381934e3c9fc81ea5d4c", "p02619_v2_3225c49e05d4c20437e8", "p02619_v2_9f23fee4b2e5100bc2a2", "p02619_v2_3800a1516910270b469a", "p02619_v2_d9fa0876b5c6fdeae69e", "p02619_v2_b68f2c1e092b62c538a2", "p02619_v2_73760848946232a8e083", "p02619_v2_d3e4441b330d8b6e7455", "p02619_v2_76ead5910dcc4e2ba1f8", "p02619_v2_2029613353251ee9b7b2", "p02619_v2_2cb134243aa86388d6ba", "p02619_v2_30836e495158435b7b7c", "p02619_v2_339d84622dee7fdc1293", "p02619_v2_d3d5077e7c93e478e065", "p02619_v2_8253b2db731014b88083", "p02619_v2_2177c78f8621448ff155", "p02619_v2_d013df1aba56dc1d54ec", "p02619_v2_64826e27e1f5562b535a", "p02619_v2_9a891e42e9c46b5f3297", "p02619_v2_f1c00f7e95d622403758", "p02619_v2_710d4c5a4c95dcb68dec", "p02619_v2_439934a48b010195dbcd", "p02619_v2_4c37cf7a7dffe9b33f12", "p02619_v2_c8fad05224bc16a1b361", "p02619_v2_94bb7ae7786707cb4819", "p02619_v2_b3aaed51d4273a3ddba7", "p02619_v2_923e8744ad333f07cb64", "p02619_v2_3366f1adb54ecf21860c", "p02619_v2_0b51cc642981f62d0357", "p02619_v2_8e243df56a059b7ad743", "p02619_v2_0a8cb716b509085fe4b0", "p02619_v2_3b76655f387f7cb6d2ab", "p02619_v2_20299f78a75b5a756735", "p02619_v2_35258a2e89d62fc747b7", "p02619_v2_c94c4b9b4349ad6555bc", "p02619_v2_82d82c4a4a2d2183a610", "p02619_v2_d65957a2498629e788ad", "p02619_v2_cd61595422151a528aa5", "p02619_v2_d520c6f8f3f4d009c27c", "p02619_v2_4942ad457c0812fc3998", "p02619_v2_592ad6d8afe1f286b012", "p02619_v2_88f615fd6f0c7cd063e8", "p02619_v2_6679f24e3b7857ca6d32", "p02619_v2_11435a6bd84618d89bc3", "p02619_v2_857222b39e874dca5a4b", "p02619_v2_82dfd729740a78ac73c6", "p02619_v2_d87a4f20bb0c6931f905", "p02619_v2_6a64dbf42d62a65fcc1d", "p02619_v2_babacbd289499ec0ef4d", "p02619_v2_9c068c7f4ca10041380f", "p02619_v2_5532e28a006d07cf62cf", "p02619_v2_e76e422d063bddc50a1f", "p02619_v2_28584da94df0912874ff", "p02619_v2_6ebe44795b5ec9b8e21d", "p02619_v2_c14cae75992aa93e75b8", "p02619_v2_bdce12ee0a07d9d30b58", "p02619_v2_9d1eceea3701f7462f2b", "p02619_v2_97eb955edc648882b88c", "p02619_v2_d105efd93f9223472ed6", "p02619_v2_4348b0c773fc04fab240", "p02619_v2_3a716d97d5adc38425d1", "p02619_v2_ce64eae3a4c1a2d7cc27", "p02619_v2_f9e870aa23e988febc60", "p02619_v2_94937661fb4430a22568", "p02619_v2_557ae170292f4ec040cc", "p02619_v2_8814fdf99bc803fc8e0c", "p02619_v2_9188b3f61f9e38da6bb2", "p02619_v2_746658d85cc29634ceaa", "p02619_v2_f4db407594deac9161c4", "p02619_v2_7202c8c24a6735e3305a", "p02619_v2_87e6dc866c355591194f", "p02619_v2_90793b392e65559b556d", "p02619_v2_8c53e7c0e7cd81f14876", "p02619_v2_ce531317332dfe8af29d", "p02619_v2_54d30225714f808b8394", "p02619_v2_d7591d957a11b4b18a7f", "p02619_v2_753bfc942a0618ae1f4e", "p02619_v2_7da054c5c0df8db3a7fa", "p02619_v2_a96f964491ca5e8c9c0c", "p02619_v2_e5201f8fcebe77f9e4d2", "p02619_v2_ca2955dbd7b011893c5e", "p02619_v2_b271f7c12ae1b71c0287"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def func(s, x):\n last = [0] * 26\n score = 0\n for i, v in enumerate(x, 1):\n last[v] = i\n c = 0\n for j in range(26):\n c += s[j] * (i - last[j])\n score = score + s[i * 26 + v] - c\n print(score)\n return score\n\n\ndef main():\n d, *s = list(map(int, open(0).read().split()))\n func(s, [t - 1 for t in s[-d:]])\n\n\nmain()\n", "fast_code_sha256": "141901d594e0ce249719b3f9906054176749f703a292069b6c8e36e149a97cb9", "fast_id": "p02619_141901d594e0ce249719b3f9906054176749f703a292069b6c8e36e149a97cb9", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def func(s, x):\n last = [0] * 26\n score = 0\n for i, v in enumerate(x, 1):\n last[v] = i\n c = 0\n for j in range(26):\n c += s[j] * (i - last[j])\n score = score + s[i * 26 + v] - c\n print(score)\n return score\n\n\ndef main():\n d, *s = list(map(int, open(0).read().split()))\n func(s, [t - 1 for t in s[-d:]])\n\n\nmain()\n", "measured_fast_code_sha256": "141901d594e0ce249719b3f9906054176749f703a292069b6c8e36e149a97cb9", "measured_slow_code": "def read_input():\n D = int(eval(input()))\n C = input().split()\n C = [int(i) for i in C]\n S = [list(map(int, input().split())) for _ in range(D)]\n T = [int(eval(input())) for _ in range(D)]\n return D, C, S, T\n\n\ndef scoring(S, D, T, C):\n res = []\n last = [0 for _ in range(26)]\n final = 0\n for i in range(D):\n dec = 0\n for j in range(26):\n for loc, val in enumerate(T[: i + 1]):\n if val == j + 1:\n last[j] = loc + 1\n dec += C[j] * (i - last[j] + 1)\n final += S[i][T[i] - 1] - dec\n res.append(final)\n return res\n\n\nD, C, S, T = read_input()\nres = scoring(S, D, T, C)\nfor x in res:\n print(x)\n", "measured_slow_code_sha256": "d03c5b8a0cfad256289a0238b96e85a9483f201802ae221a6fa72a78e056a6e7", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 51.42106158332551, "pair_id": "python_v2_31d6b73993a4f7f75dcd2866", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02619", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02619_141901d594e0ce249719b3f9906054176749f703a292069b6c8e36e149a97cb9.jsonl.gz", "inputs": "reproduction/python/inputs/p02619.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02619_d03c5b8a0cfad256289a0238b96e85a9483f201802ae221a6fa72a78e056a6e7.jsonl.gz"}, "slow_code": "def read_input():\n D = int(eval(input()))\n C = input().split()\n C = [int(i) for i in C]\n S = [list(map(int, input().split())) for _ in range(D)]\n T = [int(eval(input())) for _ in range(D)]\n return D, C, S, T\n\n\ndef scoring(S, D, T, C):\n res = []\n last = [0 for _ in range(26)]\n final = 0\n for i in range(D):\n dec = 0\n for j in range(26):\n for loc, val in enumerate(T[: i + 1]):\n if val == j + 1:\n last[j] = loc + 1\n dec += C[j] * (i - last[j] + 1)\n final += S[i][T[i] - 1] - dec\n res.append(final)\n return res\n\n\nD, C, S, T = read_input()\nres = scoring(S, D, T, C)\nfor x in res:\n print(x)\n", "slow_code_sha256": "d03c5b8a0cfad256289a0238b96e85a9483f201802ae221a6fa72a78e056a6e7", "slow_id": "p02619_d03c5b8a0cfad256289a0238b96e85a9483f201802ae221a6fa72a78e056a6e7", "speedup": 50.52813958181327, "stratum": "8+", "within_pair_jaccard": 0.4090909090909091, "workload": {"case_count": 100, "description": "For a fixed schedule t_d of 26 contest types, output daily cumulative satisfaction, initially zero. On day d add s_d,t_d, then subtract sum_i c_i*(d-last_i), where last_i is the latest day of type i, or 0 if never held. Observed inputs: D=365; c_i=0..100; s_d_i=0..20000; t_d=1..26.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 57778, "median": 20062.0, "min": 19985}, "input_format": ["D\nc_1 ... c_26\ns_1,1 ... s_1,26\n...\ns_D,1 ... s_D,26\nt_1\n...\nt_D"], "input_format_status": "source_input_section", "input_lines": {"max": 732, "median": 732.0, "min": 732}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 9882, "median": 9882.0, "min": 9882}}} -{"case_ids": ["p00028_case_000", "p00028_case_001", "p00028_case_002", "p00028_case_003", "p00028_case_004", "p00028_case_005", "p00028_case_006", "p00028_case_007", "p00028_case_008", "p00028_case_009", "p00028_case_010", "p00028_case_011", "p00028_case_012", "p00028_case_013", "p00028_case_014", "p00028_case_015", "p00028_case_016", "p00028_case_017", "p00028_case_018", "p00028_case_019", "p00028_case_020", "p00028_case_021", "p00028_case_022", "p00028_case_023", "p00028_case_024", "p00028_case_025", "p00028_case_026", "p00028_case_027", "p00028_case_028", "p00028_case_029", "p00028_case_030", "p00028_case_031", "p00028_case_032", "p00028_case_033", "p00028_case_034", "p00028_case_035", "p00028_case_036", "p00028_case_037", "p00028_case_038", "p00028_case_039", "p00028_case_040", "p00028_case_041", "p00028_case_042", "p00028_case_043", "p00028_case_044", "p00028_case_045", "p00028_case_046", "p00028_case_047", "p00028_case_048", "p00028_case_049", "p00028_case_050", "p00028_case_051", "p00028_case_052", "p00028_case_053", "p00028_case_054", "p00028_case_055", "p00028_case_056", "p00028_case_057", "p00028_case_058", "p00028_case_059", "p00028_case_060", "p00028_case_061", "p00028_case_062", "p00028_case_063", "p00028_case_064", "p00028_case_065", "p00028_case_066", "p00028_case_067", "p00028_case_068", "p00028_case_069", "p00028_case_070", "p00028_case_071", "p00028_case_072", "p00028_case_073", "p00028_case_074", "p00028_case_075", "p00028_case_076", "p00028_case_077", "p00028_case_078", "p00028_case_079", "p00028_case_080", "p00028_case_081", "p00028_case_082", "p00028_case_083", "p00028_case_084", "p00028_case_085", "p00028_case_086", "p00028_case_087", "p00028_case_088", "p00028_case_089", "p00028_case_090", "p00028_case_091", "p00028_case_092", "p00028_case_093", "p00028_case_094", "p00028_case_095", "p00028_case_096", "p00028_case_097", "p00028_case_098", "p00028_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "d = {}\ntry:\n while True:\n n = int(input())\n if n in d:\n d[n] += 1\n else:\n d[n] = 1\nexcept EOFError:\n pass\na = []\nm = max(d.values())\nfor key, value in list(d.items()):\n if value == m:\n a.append(key)\na.sort()\nfor i in a:\n print(i)\n", "fast_code_sha256": "36efa31a817599454e47c950d8405cd8170cd3f67b1b12f911d115f29e6e8467", "fast_id": "p00028_36efa31a817599454e47c950d8405cd8170cd3f67b1b12f911d115f29e6e8467", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "d = {}\ntry:\n while True:\n n = int(input())\n if n in d:\n d[n] += 1\n else:\n d[n] = 1\nexcept EOFError:\n pass\na = []\nm = max(d.values())\nfor key, value in list(d.items()):\n if value == m:\n a.append(key)\na.sort()\nfor i in a:\n print(i)\n", "measured_fast_code_sha256": "36efa31a817599454e47c950d8405cd8170cd3f67b1b12f911d115f29e6e8467", "measured_slow_code": "a = [0] * 101\nwhile True:\n try:\n a[int(eval(input()))] += 1\n except:\n break\nmaxv = max(a)\nfor i, v in enumerate(a):\n if maxv == v:\n print(i)\n", "measured_slow_code_sha256": "f8f979c6405ba37e225e78c555331069ae77d0fb63a50898920f1d1419bec35e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.530121969200477, "pair_id": "python_v2_1b9292ffeef543e595c75ee2", "per_case_slow_code_faster_fraction": 0.15, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p00028", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p00028_36efa31a817599454e47c950d8405cd8170cd3f67b1b12f911d115f29e6e8467.jsonl.gz", "inputs": "reproduction/python/inputs/p00028.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p00028_f8f979c6405ba37e225e78c555331069ae77d0fb63a50898920f1d1419bec35e.jsonl.gz"}, "slow_code": "a = [0] * 101\nwhile True:\n try:\n a[int(eval(input()))] += 1\n except:\n break\nmaxv = max(a)\nfor i, v in enumerate(a):\n if maxv == v:\n print(i)\n", "slow_code_sha256": "f8f979c6405ba37e225e78c555331069ae77d0fb63a50898920f1d1419bec35e", "slow_id": "p00028_f8f979c6405ba37e225e78c555331069ae77d0fb63a50898920f1d1419bec35e", "speedup": 2.15113168970238, "stratum": "2-4", "within_pair_jaccard": 0.4117647058823529, "workload": {"case_count": 100, "description": "Find all most frequent values in the supplied integer sequence and output them in ascending order. Values are supplied one per line until end of input, with no leading count. Observed inputs: elements=1..100 (median 100); a_i=1..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 400, "median": 288.0, "min": 2}, "input_format": ["a_1\n...\na_L (until EOF)"], "input_format_status": "source_input_section", "input_lines": {"max": 100, "median": 100.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100, "median": 100.0, "min": 1}}} -{"case_ids": ["p00100_case_000", "p00100_case_001", "p00100_case_002", "p00100_case_003", "p00100_case_004", "p00100_case_005", "p00100_case_006", "p00100_case_007", "p00100_case_008", "p00100_case_009", "p00100_case_010", "p00100_case_011", "p00100_case_012", "p00100_case_013", "p00100_case_014", "p00100_case_015", "p00100_case_016", "p00100_case_017", "p00100_case_018", "p00100_case_019", "p00100_case_020", "p00100_case_021", "p00100_case_022", "p00100_case_023", "p00100_case_024", "p00100_case_025", "p00100_case_026", "p00100_case_027", "p00100_case_028", "p00100_case_029", "p00100_case_030", "p00100_case_031", "p00100_case_032", "p00100_case_033", "p00100_case_034", "p00100_case_035", "p00100_case_036", "p00100_case_037", "p00100_case_038", "p00100_case_039", "p00100_case_040", "p00100_case_041", "p00100_case_042", "p00100_case_043", "p00100_case_044", "p00100_case_045", "p00100_case_046", "p00100_case_047", "p00100_case_048", "p00100_case_049", "p00100_case_050", "p00100_case_051", "p00100_case_052", "p00100_case_053", "p00100_case_054", "p00100_case_055", "p00100_case_056", "p00100_case_057", "p00100_case_058", "p00100_case_059", "p00100_case_060", "p00100_case_061", "p00100_case_062", "p00100_case_063", "p00100_case_064", "p00100_case_065", "p00100_case_066", "p00100_case_067", "p00100_case_068", "p00100_case_069", "p00100_case_070", "p00100_case_071", "p00100_case_072", "p00100_case_073", "p00100_case_074", "p00100_case_075", "p00100_case_076", "p00100_case_077", "p00100_case_078", "p00100_case_079", "p00100_case_080", "p00100_case_081", "p00100_case_082", "p00100_case_083", "p00100_case_084", "p00100_case_085", "p00100_case_086", "p00100_case_087", "p00100_case_088", "p00100_case_089", "p00100_case_090", "p00100_case_091", "p00100_case_092", "p00100_case_093", "p00100_case_094", "p00100_case_095", "p00100_case_096", "p00100_case_097", "p00100_case_098", "p00100_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "while True:\n n = int(eval(input()))\n if n == 0:\n break\n d = dict()\n order = []\n for _ in range(n):\n i, p, q = list(map(int, input().split()))\n d[i] = d[i] + p * q if i in d else p * q\n if i not in order:\n order.append(i)\n b = True\n for o in order:\n if d[o] > 999999:\n print(o)\n b = False\n if b:\n print(\"NA\")\n", "fast_code_sha256": "18ab0f57ffc88d30ce1f6ad03c10f99c80b2d7e308d1ee1f9b34e793e161f768", "fast_id": "p00100_18ab0f57ffc88d30ce1f6ad03c10f99c80b2d7e308d1ee1f9b34e793e161f768", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "while True:\n n = int(eval(input()))\n if n == 0:\n break\n d = dict()\n order = []\n for _ in range(n):\n i, p, q = list(map(int, input().split()))\n d[i] = d[i] + p * q if i in d else p * q\n if i not in order:\n order.append(i)\n b = True\n for o in order:\n if d[o] > 999999:\n print(o)\n b = False\n if b:\n print(\"NA\")\n", "measured_fast_code_sha256": "18ab0f57ffc88d30ce1f6ad03c10f99c80b2d7e308d1ee1f9b34e793e161f768", "measured_slow_code": "# coding: utf-8\n# Here your code !\nemployeeSalesList = []\n\n\ndef resetDataset():\n del employeeSalesList[0 : len(employeeSalesList) + 1]\n\n\ndef readDataCount():\n return int(eval(input()))\n\n\ndef searchEmployeeSales(employeeId):\n for data in employeeSalesList:\n if data[0] == employeeId:\n return data\n newData = [employeeId, 0]\n employeeSalesList.append(newData)\n return newData\n\n\nanswerList = []\n\n\ndef printEmployeeOfDataset():\n found = False\n for data in employeeSalesList:\n if data[1] >= 1000000:\n answerList.append(data[0])\n found = True\n if not found:\n answerList.append(\"NA\")\n\n\nresetDataset()\ndataCount = readDataCount()\nwhile dataCount > 0:\n for _ in range(dataCount):\n employeeId, price, volume = list(map(int, input().split(\" \")))\n employeeSales = searchEmployeeSales(employeeId)\n employeeSales[1] += price * volume\n printEmployeeOfDataset()\n resetDataset()\n dataCount = readDataCount()\nfor row in answerList:\n print(row)\n", "measured_slow_code_sha256": "cef1778ac31a96be11bbaf1627cf2c94f88d5ea9907d28e19f44f8b7a1d378a1", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.0330730606662626, "pair_id": "python_v2_4d6f02e70cf01b3a29812cc3", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p00100", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p00100_18ab0f57ffc88d30ce1f6ad03c10f99c80b2d7e308d1ee1f9b34e793e161f768.jsonl.gz", "inputs": "reproduction/python/inputs/p00100.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p00100_cef1778ac31a96be11bbaf1627cf2c94f88d5ea9907d28e19f44f8b7a1d378a1.jsonl.gz"}, "slow_code": "employeeSalesList = []\n\n\ndef resetDataset():\n del employeeSalesList[0 : len(employeeSalesList) + 1]\n\n\ndef readDataCount():\n return int(eval(input()))\n\n\ndef searchEmployeeSales(employeeId):\n for data in employeeSalesList:\n if data[0] == employeeId:\n return data\n newData = [employeeId, 0]\n employeeSalesList.append(newData)\n return newData\n\n\nanswerList = []\n\n\ndef printEmployeeOfDataset():\n found = False\n for data in employeeSalesList:\n if data[1] >= 1000000:\n answerList.append(data[0])\n found = True\n if not found:\n answerList.append(\"NA\")\n\n\nresetDataset()\ndataCount = readDataCount()\nwhile dataCount > 0:\n for _ in range(dataCount):\n employeeId, price, volume = list(map(int, input().split(\" \")))\n employeeSales = searchEmployeeSales(employeeId)\n employeeSales[1] += price * volume\n printEmployeeOfDataset()\n resetDataset()\n dataCount = readDataCount()\nfor row in answerList:\n print(row)\n", "slow_code_sha256": "90eeb5d17013d087aa6085c705f90d8dd3710ca805802ad063fb9a202bdd752c", "slow_id": "p00100_cef1778ac31a96be11bbaf1627cf2c94f88d5ea9907d28e19f44f8b7a1d378a1", "speedup": 2.0848922555889735, "stratum": "2-4", "within_pair_jaccard": 0.36538461538461536, "workload": {"case_count": 100, "description": "For each sales dataset, sum price p times quantity q per employee ID. Output IDs with total proceeds at least 1000000 in first-appearance order, or NA if none qualify. IDs may repeat across records; a final zero ends input. Observed inputs: datasets=1; n=5..3999; total_records=5..3999 (median 400); p=1..999957; q=1..99998.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 71109, "median": 7115.5, "min": 65}, "input_format": ["n_1\nid_1 p_1 q_1\n...\nid_(n_1) p_(n_1) q_(n_1)\n[next datasets]\n0"], "input_format_status": "source_input_section", "input_lines": {"max": 4001, "median": 402.0, "min": 7}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 11999, "median": 1202.0, "min": 17}}} -{"case_ids": ["p03183_case_000", "p03183_case_001", "p03183_case_002", "p03183_case_003", "p03183_case_004", "p03183_case_005", "p03183_case_006", "p03183_case_007", "p03183_case_008", "p03183_case_009", "p03183_case_010", "p03183_case_011", "p03183_case_012", "p03183_case_013", "p03183_case_014", "p03183_case_015", "p03183_case_016", "p03183_case_017", "p03183_case_018", "p03183_case_019", "p03183_case_020", "p03183_case_021", "p03183_case_022", "p03183_case_023", "p03183_case_024", "p03183_case_025", "p03183_case_026", "p03183_case_027", "p03183_case_028", "p03183_case_029", "p03183_case_030", "p03183_case_031", "p03183_case_032", "p03183_case_033", "p03183_case_034", "p03183_case_035", "p03183_case_036", "p03183_case_037", "p03183_case_038", "p03183_case_039", "p03183_case_040", "p03183_case_041", "p03183_case_042", "p03183_case_043", "p03183_case_044", "p03183_case_045", "p03183_case_046", "p03183_case_047", "p03183_case_048", "p03183_case_049", "p03183_case_050", "p03183_case_051", "p03183_case_052", "p03183_case_053", "p03183_case_054", "p03183_case_055", "p03183_case_056", "p03183_case_057", "p03183_case_058", "p03183_case_059", "p03183_case_060", "p03183_case_061", "p03183_case_062", "p03183_case_063", "p03183_case_064", "p03183_case_065", "p03183_case_066", "p03183_case_067", "p03183_case_068", "p03183_case_069", "p03183_case_070", "p03183_case_071", "p03183_case_072", "p03183_case_073", "p03183_case_074", "p03183_case_075", "p03183_case_076", "p03183_case_077", "p03183_case_078", "p03183_case_079", "p03183_case_080", "p03183_case_081", "p03183_case_082", "p03183_case_083", "p03183_case_084", "p03183_case_085", "p03183_case_086", "p03183_case_087", "p03183_case_088", "p03183_case_089", "p03183_case_090", "p03183_case_091", "p03183_case_092", "p03183_case_093", "p03183_case_094", "p03183_case_095", "p03183_case_096", "p03183_case_097", "p03183_case_098", "p03183_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def f(n):\n dp = [0] * (n * 10**4 + 1)\n bs = [list(map(int, input().split())) for _ in range(n)]\n bs.sort(key=lambda x: x[0] + x[1])\n for w, s, v in bs:\n for i in range(w + s, w - 1, -1):\n dpw = dp[i - w] + v\n if dpw > dp[i]:\n dp[i] = dpw\n print((max(dp)))\n\n\nn = int(eval(input()))\nf(n)\n", "fast_code_sha256": "87326582573696ec94eadc988d1378c44f931bc8451abc2e74270dd3af96435c", "fast_id": "p03183_87326582573696ec94eadc988d1378c44f931bc8451abc2e74270dd3af96435c", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def f(n):\n dp = [0] * (n * 10**4 + 1)\n bs = [list(map(int, input().split())) for _ in range(n)]\n bs.sort(key=lambda x: x[0] + x[1])\n for w, s, v in bs:\n for i in range(w + s, w - 1, -1):\n dpw = dp[i - w] + v\n if dpw > dp[i]:\n dp[i] = dpw\n print((max(dp)))\n\n\nn = int(eval(input()))\nf(n)\n", "measured_fast_code_sha256": "87326582573696ec94eadc988d1378c44f931bc8451abc2e74270dd3af96435c", "measured_slow_code": "import sys\n\nsys.setrecursionlimit(2147483647)\nINF = float(\"inf\")\nMOD = 10**9 + 7\ninput = lambda: sys.stdin.readline().rstrip()\n\n\ndef resolve():\n from functools import cmp_to_key\n\n n = int(eval(input()))\n B = [list(map(int, input().split())) for _ in range(n)]\n\n def cmp(a, b):\n va = min(a[1], b[1] - a[0])\n vb = min(b[1], a[1] - b[0])\n if va == vb:\n return 0\n return -1 if (va > vb) else 1\n\n B.sort(key=cmp_to_key(cmp))\n maxS = 20000\n dp = [-INF] * (maxS + 1)\n dp[0] = 0\n for i in range(n):\n w, s, v = B[i]\n ndp = dp[:]\n for total in range(maxS + 1):\n if total <= s and total + s <= maxS:\n ndp[total + w] = max(ndp[total + w], dp[total] + v)\n dp = ndp[:]\n print((max(dp)))\n\n\nresolve()\n", "measured_slow_code_sha256": "961ff7e33dcf41c91be9ccd5c27fe0c80e6fd0d2467fec260e8393b575caab59", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.9359044196846877, "pair_id": "python_v2_76abeee129b0d05beea315b3", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03183", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03183_87326582573696ec94eadc988d1378c44f931bc8451abc2e74270dd3af96435c.jsonl.gz", "inputs": "reproduction/python/inputs/p03183.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03183_961ff7e33dcf41c91be9ccd5c27fe0c80e6fd0d2467fec260e8393b575caab59.jsonl.gz"}, "slow_code": "import sys\n\nsys.setrecursionlimit(2147483647)\nINF = float(\"inf\")\nMOD = 10**9 + 7\ninput = lambda: sys.stdin.readline().rstrip()\n\n\ndef resolve():\n from functools import cmp_to_key\n\n n = int(eval(input()))\n B = [list(map(int, input().split())) for _ in range(n)]\n\n def cmp(a, b):\n va = min(a[1], b[1] - a[0])\n vb = min(b[1], a[1] - b[0])\n if va == vb:\n return 0\n return -1 if (va > vb) else 1\n\n B.sort(key=cmp_to_key(cmp))\n maxS = 20000\n dp = [-INF] * (maxS + 1)\n dp[0] = 0\n for i in range(n):\n w, s, v = B[i]\n ndp = dp[:]\n for total in range(maxS + 1):\n if total <= s and total + s <= maxS:\n ndp[total + w] = max(ndp[total + w], dp[total] + v)\n dp = ndp[:]\n print((max(dp)))\n\n\nresolve()\n", "slow_code_sha256": "961ff7e33dcf41c91be9ccd5c27fe0c80e6fd0d2467fec260e8393b575caab59", "slow_id": "p03183_961ff7e33dcf41c91be9ccd5c27fe0c80e6fd0d2467fec260e8393b575caab59", "speedup": 3.2598300262328697, "stratum": "2-4", "within_pair_jaccard": 0.41935483870967744, "workload": {"case_count": 100, "description": "Choose and order some of N blocks into a tower to maximize total value v_i. Block i has weight w_i and can support total weight at most s_i strictly above it. Each block can be used at most once. Observed inputs: N=10..1000 (median 100); w_i=1..10000; s_i=1..10000; v_i=69804..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 21928, "median": 2196.5, "min": 139}, "input_format": ["N\nw_1 s_1 v_1\n...\nw_N s_N v_N"], "input_format_status": "source_input_section", "input_lines": {"max": 1001, "median": 101.0, "min": 11}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3001, "median": 301.0, "min": 31}}} -{"case_ids": ["p02793_case_000", "p02793_case_001", "p02793_case_002", "p02793_case_003", "p02793_case_004", "p02793_case_005", "p02793_case_006", "p02793_case_007", "p02793_case_008", "p02793_case_009", "p02793_case_010", "p02793_case_011", "p02793_case_012", "p02793_case_013", "p02793_case_014", "p02793_case_015", "p02793_case_016", "p02793_case_017", "p02793_case_018", "p02793_case_019", "p02793_case_020", "p02793_case_021", "p02793_case_022", "p02793_case_023", "p02793_case_024", "p02793_case_025", "p02793_case_026", "p02793_case_027", "p02793_case_028", "p02793_case_029", "p02793_case_030", "p02793_case_031", "p02793_case_032", "p02793_case_033", "p02793_case_034", "p02793_case_035", "p02793_case_036", "p02793_case_037", "p02793_case_038", "p02793_case_039", "p02793_case_040", "p02793_case_041", "p02793_case_042", "p02793_case_043", "p02793_case_044", "p02793_case_045", "p02793_case_046", "p02793_case_047", "p02793_case_048", "p02793_case_049", "p02793_case_050", "p02793_case_051", "p02793_case_052", "p02793_case_053", "p02793_case_054", "p02793_case_055", "p02793_case_056", "p02793_case_057", "p02793_case_058", "p02793_case_059", "p02793_case_060", "p02793_case_061", "p02793_case_062", "p02793_case_063", "p02793_case_064", "p02793_case_065", "p02793_case_066", "p02793_case_067", "p02793_case_068", "p02793_case_069", "p02793_case_070", "p02793_case_071", "p02793_case_072", "p02793_case_073", "p02793_case_074", "p02793_case_075", "p02793_case_076", "p02793_case_077", "p02793_case_078", "p02793_case_079", "p02793_case_080", "p02793_case_081", "p02793_case_082", "p02793_case_083", "p02793_case_084", "p02793_case_085", "p02793_case_086", "p02793_case_087", "p02793_case_088", "p02793_case_089", "p02793_case_090", "p02793_case_091", "p02793_case_092", "p02793_case_093", "p02793_case_094", "p02793_case_095", "p02793_case_096", "p02793_case_097", "p02793_case_098", "p02793_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "class PrimeOptimizer:\n def __init__(self, MAX_NUM=10**3):\n is_prime = [True] * MAX_NUM\n is_prime[0] = False\n is_prime[1] = False\n primes = []\n for i in range(MAX_NUM):\n if is_prime[i]:\n primes.append(i)\n for j in range(2 * i, MAX_NUM, i):\n is_prime[j] = False\n self.primes = primes\n\n def prime_factorization(self, x):\n res = {}\n for prime in self.primes:\n while x % prime == 0:\n if not prime in res:\n res[prime] = 0\n res[prime] += 1\n x //= prime\n if x > 1:\n res[x] = 1\n return res\n\n\nMOD = 10**9 + 7\n\n\ndef mod_pow(p, q):\n res = 1\n while q:\n if q & 1:\n res = (res * p) % MOD\n p = (p * p) % MOD\n q //= 2\n return res\n\n\ndef mod_inv(p):\n return mod_pow(p, MOD - 2)\n\n\ndef solve(n, a):\n primeOpt = PrimeOptimizer()\n D = {}\n for i in range(n):\n prime_num_mapping = primeOpt.prime_factorization(a[i])\n for prime, num in list(prime_num_mapping.items()):\n if not prime in D:\n D[prime] = 0\n D[prime] = max(D[prime], num)\n L = 1\n for prime, num in list(D.items()):\n L = (L * mod_pow(prime, num)) % MOD\n res = sum([L * mod_inv(x) % MOD for x in a])\n return res % MOD\n\n\nN = int(eval(input()))\nA = list(map(int, input().split()))\nprint((solve(N, A)))\n", "fast_code_sha256": "66d145443a372a5a43407dc9cf71d71447bec89f203c9422197e66c8dd97343d", "fast_id": "p02793_66d145443a372a5a43407dc9cf71d71447bec89f203c9422197e66c8dd97343d", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "class PrimeOptimizer:\n def __init__(self, MAX_NUM=10**3):\n is_prime = [True] * MAX_NUM\n is_prime[0] = False\n is_prime[1] = False\n primes = []\n for i in range(MAX_NUM):\n if is_prime[i]:\n primes.append(i)\n for j in range(2 * i, MAX_NUM, i):\n is_prime[j] = False\n self.primes = primes\n\n def prime_factorization(self, x):\n res = {}\n for prime in self.primes:\n while x % prime == 0:\n if not prime in res:\n res[prime] = 0\n res[prime] += 1\n x //= prime\n if x > 1:\n res[x] = 1\n return res\n\n\nMOD = 10**9 + 7\n\n\ndef mod_pow(p, q):\n res = 1\n while q:\n if q & 1:\n res = (res * p) % MOD\n p = (p * p) % MOD\n q //= 2\n return res\n\n\ndef mod_inv(p):\n return mod_pow(p, MOD - 2)\n\n\ndef solve(n, a):\n primeOpt = PrimeOptimizer()\n D = {}\n for i in range(n):\n prime_num_mapping = primeOpt.prime_factorization(a[i])\n for prime, num in list(prime_num_mapping.items()):\n if not prime in D:\n D[prime] = 0\n D[prime] = max(D[prime], num)\n L = 1\n for prime, num in list(D.items()):\n L = (L * mod_pow(prime, num)) % MOD\n res = sum([L * mod_inv(x) % MOD for x in a])\n return res % MOD\n\n\nN = int(eval(input()))\nA = list(map(int, input().split()))\nprint((solve(N, A)))\n", "measured_fast_code_sha256": "66d145443a372a5a43407dc9cf71d71447bec89f203c9422197e66c8dd97343d", "measured_slow_code": "from heapq import heappush, heappop, heapify\nfrom collections import deque, defaultdict, Counter\nimport itertools\nfrom itertools import permutations, combinations, groupby\nimport sys\nimport bisect\nimport string\nimport math\nimport time\nimport random\n\n\ndef S_():\n return input()\n\n\ndef LS():\n return [i for i in input().split()]\n\n\ndef I():\n return int(input())\n\n\ndef MI():\n return map(int, input().split())\n\n\ndef LI():\n return [int(i) for i in input().split()]\n\n\ndef LI_():\n return [int(i) - 1 for i in input().split()]\n\n\ndef NI(n):\n return [int(input()) for i in range(n)]\n\n\ndef NI_(n):\n return [int(input()) - 1 for i in range(n)]\n\n\ndef StoI():\n return [ord(i) - 97 for i in input()]\n\n\ndef ItoS(nn):\n return chr(nn + 97)\n\n\ndef LtoS(ls):\n return \"\".join([chr(i + 97) for i in ls])\n\n\ndef GI(V, E, Directed=False, index=0):\n org_inp = []\n g = [[] for i in range(n)]\n for i in range(E):\n inp = LI()\n org_inp.append(inp)\n if index == 0:\n inp[0] -= 1\n inp[1] -= 1\n if len(inp) == 2:\n a, b = inp\n g[a].append(b)\n if not Directed:\n g[b].append(a)\n elif len(inp) == 3:\n a, b, c = inp\n aa = (inp[0], inp[2])\n bb = (inp[1], inp[2])\n g[a].append(bb)\n if not Directed:\n g[b].append(aa)\n return g, org_inp\n\n\ndef bit_combination(k, n=2):\n rt = []\n for tb in range(n**k):\n s = [tb // (n**bt) % n for bt in range(k)]\n rt += [s]\n return rt\n\n\ndef show(*inp, end=\"\\n\"):\n if show_flg:\n print(*inp, end=end)\n\n\nYN = [\"Yes\", \"No\"]\nmo = 10**9 + 7\ninf = float(\"inf\")\nl_alp = string.ascii_lowercase\nu_alp = string.ascii_uppercase\nts = time.time()\nsys.setrecursionlimit(10**5)\ninput = lambda: sys.stdin.readline().rstrip()\n\n\ndef ran_input():\n import random\n\n n = random.randint(4, 16)\n rmin, rmax = 1, 10\n a = [random.randint(rmin, rmax) for _ in range(n)]\n return n, a\n\n\ndef primeFactor(N): # return prime factors of N as dictionary {prime p:power of p}\n i, n = 2, N\n ret = {}\n d, sq = 2, 99\n while i <= sq:\n k = 0\n while n % i == 0:\n n, k, ret[i] = n // i, k + 1, k + 1\n if k > 0 or i == 97:\n sq = int(n ** (1 / 2) + 0.5)\n if i < 4:\n i = i * 2 - 1\n else:\n i, d = i + d, d ^ 6\n if n > 1:\n ret[n] = 1\n return ret\n\n\ndef PrimeNumSet(\n N,\n): # return the list of prime numbers in [2,N], using eratosthenes sieve\n Max = int(N**0.5)\n seachList = [i for i in range(2, N + 1)]\n primeNum = []\n while seachList:\n if seachList[0] <= Max:\n break\n primeNum.append(seachList[0])\n tmp = seachList[0]\n seachList = [i for i in seachList if i % tmp != 0]\n primeNum.extend(seachList)\n return primeNum\n\n\ndef LCM(b, mo=10**9 + 7): # retrun LCM of numbers in list b\n prs = PrimeNumSet(max(b))\n M = dict(zip(prs, [0] * len(prs)))\n for i in b:\n dc = primeFactor(i)\n for j, k in dc.items():\n M[j] = max(M[j], k)\n r = 1\n for j, k in M.items():\n if k != 0:\n r *= pow(j, k, mo)\n r %= mo\n return r\n\n\nshow_flg = False\nshow_flg = True\nans = 0\nn = I()\na = LI()\nm = LCM(a)\nx = 0\nfor i in a:\n x += m * pow(i, mo - 2, mo)\n x %= mo\nprint(x)\n", "measured_slow_code_sha256": "6f8ccaaad47c82c2a507b64b1c4a22faf69b14d3f86470cd28dd50aae2dfa154", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.295756351853218, "pair_id": "python_v2_352d20f476060d1dd98eb3f5", "per_case_slow_code_faster_fraction": 0.18, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02793", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02793_66d145443a372a5a43407dc9cf71d71447bec89f203c9422197e66c8dd97343d.jsonl.gz", "inputs": "reproduction/python/inputs/p02793.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02793_6f8ccaaad47c82c2a507b64b1c4a22faf69b14d3f86470cd28dd50aae2dfa154.jsonl.gz"}, "slow_code": "from heapq import heappush, heappop, heapify\nfrom collections import deque, defaultdict, Counter\nimport itertools\nfrom itertools import permutations, combinations, groupby\nimport sys\nimport bisect\nimport string\nimport math\nimport time\nimport random\n\n\ndef S_():\n return input()\n\n\ndef LS():\n return [i for i in input().split()]\n\n\ndef I():\n return int(input())\n\n\ndef MI():\n return map(int, input().split())\n\n\ndef LI():\n return [int(i) for i in input().split()]\n\n\ndef LI_():\n return [int(i) - 1 for i in input().split()]\n\n\ndef NI(n):\n return [int(input()) for i in range(n)]\n\n\ndef NI_(n):\n return [int(input()) - 1 for i in range(n)]\n\n\ndef StoI():\n return [ord(i) - 97 for i in input()]\n\n\ndef ItoS(nn):\n return chr(nn + 97)\n\n\ndef LtoS(ls):\n return \"\".join([chr(i + 97) for i in ls])\n\n\ndef GI(V, E, Directed=False, index=0):\n org_inp = []\n g = [[] for i in range(n)]\n for i in range(E):\n inp = LI()\n org_inp.append(inp)\n if index == 0:\n inp[0] -= 1\n inp[1] -= 1\n if len(inp) == 2:\n a, b = inp\n g[a].append(b)\n if not Directed:\n g[b].append(a)\n elif len(inp) == 3:\n a, b, c = inp\n aa = (inp[0], inp[2])\n bb = (inp[1], inp[2])\n g[a].append(bb)\n if not Directed:\n g[b].append(aa)\n return g, org_inp\n\n\ndef bit_combination(k, n=2):\n rt = []\n for tb in range(n**k):\n s = [tb // (n**bt) % n for bt in range(k)]\n rt += [s]\n return rt\n\n\ndef show(*inp, end=\"\\n\"):\n if show_flg:\n print(*inp, end=end)\n\n\nYN = [\"Yes\", \"No\"]\nmo = 10**9 + 7\ninf = float(\"inf\")\nl_alp = string.ascii_lowercase\nu_alp = string.ascii_uppercase\nts = time.time()\nsys.setrecursionlimit(10**5)\ninput = lambda: sys.stdin.readline().rstrip()\n\n\ndef ran_input():\n import random\n\n n = random.randint(4, 16)\n rmin, rmax = 1, 10\n a = [random.randint(rmin, rmax) for _ in range(n)]\n return n, a\n\n\ndef primeFactor(N):\n i, n = 2, N\n ret = {}\n d, sq = 2, 99\n while i <= sq:\n k = 0\n while n % i == 0:\n n, k, ret[i] = n // i, k + 1, k + 1\n if k > 0 or i == 97:\n sq = int(n ** (1 / 2) + 0.5)\n if i < 4:\n i = i * 2 - 1\n else:\n i, d = i + d, d ^ 6\n if n > 1:\n ret[n] = 1\n return ret\n\n\ndef PrimeNumSet(\n N,\n):\n Max = int(N**0.5)\n seachList = [i for i in range(2, N + 1)]\n primeNum = []\n while seachList:\n if seachList[0] <= Max:\n break\n primeNum.append(seachList[0])\n tmp = seachList[0]\n seachList = [i for i in seachList if i % tmp != 0]\n primeNum.extend(seachList)\n return primeNum\n\n\ndef LCM(b, mo=10**9 + 7):\n prs = PrimeNumSet(max(b))\n M = dict(zip(prs, [0] * len(prs)))\n for i in b:\n dc = primeFactor(i)\n for j, k in dc.items():\n M[j] = max(M[j], k)\n r = 1\n for j, k in M.items():\n if k != 0:\n r *= pow(j, k, mo)\n r %= mo\n return r\n\n\nshow_flg = False\nshow_flg = True\nans = 0\nn = I()\na = LI()\nm = LCM(a)\nx = 0\nfor i in a:\n x += m * pow(i, mo - 2, mo)\n x %= mo\nprint(x)\n", "slow_code_sha256": "ac86d1455d8341da4b55c8ff29601b7cda05971a29f7b8cb02115dfc602c8bdd", "slow_id": "p02793_6f8ccaaad47c82c2a507b64b1c4a22faf69b14d3f86470cd28dd50aae2dfa154", "speedup": 7.039004586678128, "stratum": "4-8", "within_pair_jaccard": 0.18902439024390244, "workload": {"case_count": 100, "description": "Choose positive integers B_i so that every A_i*B_i has the same value, minimizing sum B_i. Output that minimum modulo 1000000007. Observed inputs: N=1..10000 (median 1000); A_i=1..1000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 70006, "median": 6279.5, "min": 4}, "input_format": ["N\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 10001, "median": 1001.0, "min": 2}}} -{"case_ids": ["p04019_case_000", "p04019_case_001", "p04019_case_002", "p04019_case_003", "p04019_case_004", "p04019_case_005", "p04019_case_006", "p04019_case_007", "p04019_case_008", "p04019_case_009", "p04019_case_010", "p04019_case_011", "p04019_case_012", "p04019_case_013", "p04019_case_014", "p04019_case_015", "p04019_case_016", "p04019_case_017", "p04019_case_018", "p04019_case_019", "p04019_case_020", "p04019_case_021", "p04019_case_022", "p04019_case_023", "p04019_case_024", "p04019_case_025", "p04019_case_026", "p04019_case_027", "p04019_case_028", "p04019_case_029", "p04019_case_030", "p04019_case_031", "p04019_case_032", "p04019_case_033", "p04019_case_034", "p04019_case_035", "p04019_case_036", "p04019_case_037", "p04019_case_038", "p04019_case_039", "p04019_case_040", "p04019_case_041", "p04019_case_042", "p04019_case_043", "p04019_case_044", "p04019_case_045", "p04019_case_046", "p04019_case_047", "p04019_case_048", "p04019_case_049", "p04019_case_050", "p04019_case_051", "p04019_case_052", "p04019_case_053", "p04019_case_054", "p04019_case_055", "p04019_case_056", "p04019_case_057", "p04019_case_058", "p04019_case_059", "p04019_case_060", "p04019_case_061", "p04019_case_062", "p04019_case_063", "p04019_case_064", "p04019_case_065", "p04019_case_066", "p04019_case_067", "p04019_case_068", "p04019_case_069", "p04019_case_070", "p04019_case_071", "p04019_case_072", "p04019_case_073", "p04019_case_074", "p04019_case_075", "p04019_case_076", "p04019_case_077", "p04019_case_078", "p04019_case_079", "p04019_case_080", "p04019_case_081", "p04019_case_082", "p04019_case_083", "p04019_case_084", "p04019_case_085", "p04019_case_086", "p04019_case_087", "p04019_case_088", "p04019_case_089", "p04019_case_090", "p04019_case_091", "p04019_case_092", "p04019_case_093", "p04019_case_094", "p04019_case_095", "p04019_case_096", "p04019_case_097", "p04019_case_098", "p04019_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def main():\n S = input().rstrip()\n flg = ((\"N\" in S) ^ (\"S\" in S) ^ 1) & ((\"E\" in S) ^ (\"W\" in S) ^ 1)\n print((\"Yes\" if flg else \"No\"))\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "2819d7c8cc00872606043ee4fddb28de6790a7f383b7df0acb3abd65bc17e61a", "fast_id": "p04019_13aaad38fd67705d7e42e1b96c63f107570c0e957db5018cd448de424e044d69", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "# AGC003A - Wanna go back home\ndef main():\n S = input().rstrip()\n flg = ((\"N\" in S) ^ (\"S\" in S) ^ 1) & ((\"E\" in S) ^ (\"W\" in S) ^ 1)\n print((\"Yes\" if flg else \"No\"))\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "13aaad38fd67705d7e42e1b96c63f107570c0e957db5018cd448de424e044d69", "measured_slow_code": "S = input().strip()\nC = {\"N\": 0, \"S\": 0, \"E\": 0, \"W\": 0}\nfor i in range(len(S)):\n C[S[i]] += 1\nif C[\"N\"] > 0 and C[\"S\"] > 0:\n if (C[\"E\"] > 0 and C[\"W\"] > 0) or (C[\"E\"] == 0 and C[\"W\"] == 0):\n print(\"Yes\")\n else:\n print(\"No\")\nelif C[\"N\"] == 0 and C[\"S\"] == 0:\n if (C[\"E\"] > 0 and C[\"W\"] > 0) or (C[\"E\"] == 0 and C[\"W\"] == 0):\n print(\"Yes\")\n else:\n print(\"No\")\nelse:\n print(\"No\")\n", "measured_slow_code_sha256": "948826aa95725a2d7b656cdcdf166ae16f7a6d2351882b45f31328741761d57a", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.666925200977868, "pair_id": "python_v2_684cbd9d7550d343822776fd", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p04019", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p04019_13aaad38fd67705d7e42e1b96c63f107570c0e957db5018cd448de424e044d69.jsonl.gz", "inputs": "reproduction/python/inputs/p04019.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p04019_948826aa95725a2d7b656cdcdf166ae16f7a6d2351882b45f31328741761d57a.jsonl.gz"}, "slow_code": "S = input().strip()\nC = {\"N\": 0, \"S\": 0, \"E\": 0, \"W\": 0}\nfor i in range(len(S)):\n C[S[i]] += 1\nif C[\"N\"] > 0 and C[\"S\"] > 0:\n if (C[\"E\"] > 0 and C[\"W\"] > 0) or (C[\"E\"] == 0 and C[\"W\"] == 0):\n print(\"Yes\")\n else:\n print(\"No\")\nelif C[\"N\"] == 0 and C[\"S\"] == 0:\n if (C[\"E\"] > 0 and C[\"W\"] > 0) or (C[\"E\"] == 0 and C[\"W\"] == 0):\n print(\"Yes\")\n else:\n print(\"No\")\nelse:\n print(\"No\")\n", "slow_code_sha256": "948826aa95725a2d7b656cdcdf166ae16f7a6d2351882b45f31328741761d57a", "slow_id": "p04019_948826aa95725a2d7b656cdcdf166ae16f7a6d2351882b45f31328741761d57a", "speedup": 3.795283678671744, "stratum": "2-4", "within_pair_jaccard": 0.42857142857142855, "workload": {"case_count": 100, "description": "For each character of S, travel a strictly positive distance north, west, south or east as specified by N,W,S,E. Determine whether some choices of distances can return to the starting point after all moves. Observed inputs: S_length=1..1000 (median 100); distinct_characters=1..4.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1001, "median": 101.0, "min": 2}, "input_format": ["S"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p02551_case_000", "p02551_case_001", "p02551_case_002", "p02551_case_003", "p02551_case_004", "p02551_case_005", "p02551_case_006", "p02551_case_007", "p02551_case_008", "p02551_case_009", "p02551_case_010", "p02551_case_011", "p02551_case_012", "p02551_case_013", "p02551_case_014", "p02551_case_015", "p02551_case_016", "p02551_case_017", "p02551_case_018", "p02551_case_019", "p02551_case_020", "p02551_case_021", "p02551_case_022", "p02551_case_023", "p02551_case_024", "p02551_case_025", "p02551_case_026", "p02551_case_027", "p02551_case_028", "p02551_case_029", "p02551_case_030", "p02551_case_031", "p02551_case_032", "p02551_case_033", "p02551_case_034", "p02551_case_035", "p02551_case_036", "p02551_case_037", "p02551_case_038", "p02551_case_039", "p02551_case_040", "p02551_case_041", "p02551_case_042", "p02551_case_043", "p02551_case_044", "p02551_case_045", "p02551_case_046", "p02551_case_047", "p02551_case_048", "p02551_case_049", "p02551_case_050", "p02551_case_051", "p02551_case_052", "p02551_case_053", "p02551_case_054", "p02551_case_055", "p02551_case_056", "p02551_case_057", "p02551_case_058", "p02551_case_059", "p02551_case_060", "p02551_case_061", "p02551_case_062", "p02551_case_063", "p02551_case_064", "p02551_case_065", "p02551_case_066", "p02551_case_067", "p02551_case_068", "p02551_case_069", "p02551_case_070", "p02551_case_071", "p02551_case_072", "p02551_case_073", "p02551_case_074", "p02551_case_075", "p02551_case_076", "p02551_case_077", "p02551_case_078", "p02551_case_079", "p02551_case_080", "p02551_case_081", "p02551_case_082", "p02551_case_083", "p02551_case_084", "p02551_case_085", "p02551_case_086", "p02551_case_087", "p02551_case_088", "p02551_case_089", "p02551_case_090", "p02551_case_091", "p02551_case_092", "p02551_case_093", "p02551_case_094", "p02551_case_095", "p02551_case_096", "p02551_case_097", "p02551_case_098", "p02551_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N, Q = list(map(int, input().split()))\nN -= 2\nBIT = [[0 for i in range(N + 1)] for _ in range(2)]\nn = N\n\n\ndef BIT_query(idx, BIT):\n res_sum = 0\n while idx > 0:\n res_sum += BIT[idx]\n idx -= idx & (-idx)\n return res_sum\n\n\ndef BIT_update(idx, x, BIT):\n while idx <= n:\n BIT[idx] += x\n idx += idx & (-idx)\n return\n\n\nnow = N * N\nmax_x = [0, 0]\nfor _ in range(Q):\n s, x = list(map(int, input().split()))\n s -= 1\n x -= 1\n x = N + 1 - x\n\n depth = N + BIT_query(x, BIT[s])\n now -= depth\n\n if x > max_x[s]:\n BIT_update(N - depth + 1, max_x[s] - x, BIT[1 - s])\n max_x[s] = x\nprint(now)\n", "fast_code_sha256": "1e37aee9f317eebea2fe8d1391e12085393da9ef9c63fb93f618c2441803a41b", "fast_id": "p02551_8ab14e215af72b3cb6d01cf7ba8a327d19a391a1d1021af8d966ef63acf544dd", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N, Q = list(map(int, input().split()))\nN -= 2\nBIT = [[0 for i in range(N + 1)] for _ in range(2)]\nn = N\n\n\ndef BIT_query(idx, BIT):\n res_sum = 0\n while idx > 0:\n res_sum += BIT[idx]\n idx -= idx & (-idx)\n return res_sum\n\n\ndef BIT_update(idx, x, BIT):\n while idx <= n:\n BIT[idx] += x\n idx += idx & (-idx)\n return\n\n\nnow = N * N\nmax_x = [0, 0]\nfor _ in range(Q):\n s, x = list(map(int, input().split()))\n s -= 1\n x -= 1\n x = N + 1 - x\n # print()\n depth = N + BIT_query(x, BIT[s])\n now -= depth\n # print(x, s, depth, now, BIT_query(x, BIT[s]), max_x[s])\n if x > max_x[s]:\n BIT_update(N - depth + 1, max_x[s] - x, BIT[1 - s])\n max_x[s] = x\nprint(now)\n", "measured_fast_code_sha256": "8ab14e215af72b3cb6d01cf7ba8a327d19a391a1d1021af8d966ef63acf544dd", "measured_slow_code": "class LazySegmentTree:\n def __init__(self, init_val, segfunc, ide_ele):\n n = len(init_val)\n self.segfunc = segfunc\n self.ide_ele = ide_ele\n self.num = 1 << (n - 1).bit_length()\n self.data = [ide_ele] * 2 * self.num\n self.lazy = [None] * 2 * self.num\n for i in range(n):\n self.data[self.num + i] = init_val[i]\n for i in range(self.num - 1, 0, -1):\n self.data[i] = self.segfunc(self.data[2 * i], self.data[2 * i + 1])\n\n def gindex(self, l, r):\n l += self.num\n r += self.num\n lm = l >> (l & -l).bit_length()\n rm = r >> (r & -r).bit_length()\n while r > l:\n if l <= lm:\n yield l\n if r <= rm:\n yield r\n r >>= 1\n l >>= 1\n while l:\n yield l\n l >>= 1\n\n def propagates(self, *ids):\n for i in reversed(ids):\n v = self.lazy[i]\n if v is None:\n continue\n self.lazy[2 * i] = v\n self.lazy[2 * i + 1] = v\n self.data[2 * i] = v\n self.data[2 * i + 1] = v\n self.lazy[i] = None\n\n def update(self, l, r, x):\n (*ids,) = self.gindex(l, r)\n self.propagates(*ids)\n l += self.num\n r += self.num\n while l < r:\n if l & 1:\n self.lazy[l] = x\n self.data[l] = x\n l += 1\n if r & 1:\n self.lazy[r - 1] = x\n self.data[r - 1] = x\n r >>= 1\n l >>= 1\n for i in ids:\n self.data[i] = self.segfunc(self.data[2 * i], self.data[2 * i + 1])\n\n def query(self, l, r):\n (*ids,) = self.gindex(l, r)\n self.propagates(*ids)\n res = self.ide_ele\n l += self.num\n r += self.num\n while l < r:\n if l & 1:\n res = self.segfunc(res, self.data[l])\n l += 1\n if r & 1:\n res = self.segfunc(res, self.data[r - 1])\n l >>= 1\n r >>= 1\n return res\n\n\ndef segfunc(x, y):\n return min(x, y)\n\n\nide_ele = 10**9\nN, Q = list(map(int, input().split()))\nans = (N - 2) * (N - 2)\nR = [N] * (N + 1)\nW = [N] * (N + 1)\nseg_r = LazySegmentTree(R, segfunc, ide_ele)\nseg_w = LazySegmentTree(W, segfunc, ide_ele)\nfor i in range(Q):\n a, b = list(map(int, input().split()))\n if a == 1:\n t = seg_r.query(b, b + 1)\n ans -= max(0, t - 2)\n if b <= seg_w.query(1, 2):\n seg_w.update(1, t + 1, b)\n else:\n t = seg_w.query(b, b + 1)\n ans -= max(0, t - 2)\n if b <= seg_r.query(1, 2):\n seg_r.update(1, t + 1, b)\nprint(ans)\n", "measured_slow_code_sha256": "b6d8d02e6cf1c2cdae11c71a6f58f4cedbd533f79dc49244a4531d1545967d6e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.7624425853838988, "pair_id": "python_v2_612b9b5886a3a6eaf0c6d0d5", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02551", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02551_8ab14e215af72b3cb6d01cf7ba8a327d19a391a1d1021af8d966ef63acf544dd.jsonl.gz", "inputs": "reproduction/python/inputs/p02551.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02551_b6d8d02e6cf1c2cdae11c71a6f58f4cedbd533f79dc49244a4531d1545967d6e.jsonl.gz"}, "slow_code": "class LazySegmentTree:\n def __init__(self, init_val, segfunc, ide_ele):\n n = len(init_val)\n self.segfunc = segfunc\n self.ide_ele = ide_ele\n self.num = 1 << (n - 1).bit_length()\n self.data = [ide_ele] * 2 * self.num\n self.lazy = [None] * 2 * self.num\n for i in range(n):\n self.data[self.num + i] = init_val[i]\n for i in range(self.num - 1, 0, -1):\n self.data[i] = self.segfunc(self.data[2 * i], self.data[2 * i + 1])\n\n def gindex(self, l, r):\n l += self.num\n r += self.num\n lm = l >> (l & -l).bit_length()\n rm = r >> (r & -r).bit_length()\n while r > l:\n if l <= lm:\n yield l\n if r <= rm:\n yield r\n r >>= 1\n l >>= 1\n while l:\n yield l\n l >>= 1\n\n def propagates(self, *ids):\n for i in reversed(ids):\n v = self.lazy[i]\n if v is None:\n continue\n self.lazy[2 * i] = v\n self.lazy[2 * i + 1] = v\n self.data[2 * i] = v\n self.data[2 * i + 1] = v\n self.lazy[i] = None\n\n def update(self, l, r, x):\n (*ids,) = self.gindex(l, r)\n self.propagates(*ids)\n l += self.num\n r += self.num\n while l < r:\n if l & 1:\n self.lazy[l] = x\n self.data[l] = x\n l += 1\n if r & 1:\n self.lazy[r - 1] = x\n self.data[r - 1] = x\n r >>= 1\n l >>= 1\n for i in ids:\n self.data[i] = self.segfunc(self.data[2 * i], self.data[2 * i + 1])\n\n def query(self, l, r):\n (*ids,) = self.gindex(l, r)\n self.propagates(*ids)\n res = self.ide_ele\n l += self.num\n r += self.num\n while l < r:\n if l & 1:\n res = self.segfunc(res, self.data[l])\n l += 1\n if r & 1:\n res = self.segfunc(res, self.data[r - 1])\n l >>= 1\n r >>= 1\n return res\n\n\ndef segfunc(x, y):\n return min(x, y)\n\n\nide_ele = 10**9\nN, Q = list(map(int, input().split()))\nans = (N - 2) * (N - 2)\nR = [N] * (N + 1)\nW = [N] * (N + 1)\nseg_r = LazySegmentTree(R, segfunc, ide_ele)\nseg_w = LazySegmentTree(W, segfunc, ide_ele)\nfor i in range(Q):\n a, b = list(map(int, input().split()))\n if a == 1:\n t = seg_r.query(b, b + 1)\n ans -= max(0, t - 2)\n if b <= seg_w.query(1, 2):\n seg_w.update(1, t + 1, b)\n else:\n t = seg_w.query(b, b + 1)\n ans -= max(0, t - 2)\n if b <= seg_r.query(1, 2):\n seg_r.update(1, t + 1, b)\nprint(ans)\n", "slow_code_sha256": "b6d8d02e6cf1c2cdae11c71a6f58f4cedbd533f79dc49244a4531d1545967d6e", "slow_id": "p02551_b6d8d02e6cf1c2cdae11c71a6f58f4cedbd533f79dc49244a4531d1545967d6e", "speedup": 3.871824049036156, "stratum": "2-4", "within_pair_jaccard": 0.2876712328767123, "workload": {"case_count": 100, "description": "An N-by-N grid starts with black inner cells and white bottom/right borders. Distinct queries 1 x or 2 x turn cells white downward from (1,x) or rightward from (x,1), stopping at the first white cell. Count remaining black cells. Observed inputs: N=3..200000 (median 100000); Q=0..200000 (median 199996); x=2..199999.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1689172, "median": 1577778.0, "min": 4}, "input_format": ["N Q\ntype_1 x_1\n...\ntype_Q x_Q"], "input_format_status": "source_input_section", "input_lines": {"max": 200001, "median": 199997.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 400002, "median": 399994.0, "min": 2}}} -{"case_ids": ["p03486_case_000", "p03486_case_001", "p03486_case_002", "p03486_case_003", "p03486_case_004", "p03486_case_005", "p03486_case_006", "p03486_case_007", "p03486_case_008", "p03486_case_009", "p03486_case_010", "p03486_case_011", "p03486_case_012", "p03486_case_013", "p03486_case_014", "p03486_case_015", "p03486_case_016", "p03486_case_017", "p03486_case_018", "p03486_case_019", "p03486_case_020", "p03486_case_021", "p03486_case_022", "p03486_case_023", "p03486_case_024", "p03486_case_025", "p03486_case_026", "p03486_case_027", "p03486_case_028", "p03486_case_029", "p03486_case_030", "p03486_case_031", "p03486_case_032", "p03486_case_033", "p03486_case_034", "p03486_case_035", "p03486_case_036", "p03486_case_037", "p03486_case_038", "p03486_case_039", "p03486_case_040", "p03486_case_041", "p03486_case_042", "p03486_case_043", "p03486_case_044", "p03486_case_045", "p03486_case_046", "p03486_case_047", "p03486_case_048", "p03486_case_049", "p03486_case_050", "p03486_case_051", "p03486_case_052", "p03486_case_053", "p03486_case_054", "p03486_case_055", "p03486_case_056", "p03486_case_057", "p03486_case_058", "p03486_case_059", "p03486_case_060", "p03486_case_061", "p03486_case_062", "p03486_case_063", "p03486_case_064", "p03486_case_065", "p03486_case_066", "p03486_case_067", "p03486_case_068", "p03486_case_069", "p03486_case_070", "p03486_case_071", "p03486_case_072", "p03486_case_073", "p03486_case_074", "p03486_case_075", "p03486_case_076", "p03486_case_077", "p03486_case_078", "p03486_case_079", "p03486_case_080", "p03486_case_081", "p03486_case_082", "p03486_case_083", "p03486_case_084", "p03486_case_085", "p03486_case_086", "p03486_case_087", "p03486_case_088", "p03486_case_089", "p03486_case_090", "p03486_case_091", "p03486_case_092", "p03486_case_093", "p03486_case_094", "p03486_case_095", "p03486_case_096", "p03486_case_097", "p03486_case_098", "p03486_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "s = sorted(list(input().strip()))\nt = sorted(list(input().strip()), reverse=True)\nif s < t:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "fast_code_sha256": "053e2cef6d2b126f51a668e5b1be024e3c54bfe23aa85674a248c6509ae6b46f", "fast_id": "p03486_053e2cef6d2b126f51a668e5b1be024e3c54bfe23aa85674a248c6509ae6b46f", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "s = sorted(list(input().strip()))\nt = sorted(list(input().strip()), reverse=True)\nif s < t:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "measured_fast_code_sha256": "053e2cef6d2b126f51a668e5b1be024e3c54bfe23aa85674a248c6509ae6b46f", "measured_slow_code": "import sys\n\n# import collections\n# import math\n# import string\n# import bisect\n# import re\n# import itertools\n# import statistics\ndef main():\n s, t = sys.stdin.read().split()\n n, m = len(s), len(t)\n s = sorted(s)\n t = list(reversed(sorted(t)))\n if n < m:\n for i in range(n):\n if s[i] < t[i]:\n ans = \"Yes\"\n break\n elif s[i] > t[i]:\n ans = \"No\"\n break\n else:\n ans = \"Yes\"\n else:\n for i in range(m):\n if s[i] < t[i]:\n ans = \"Yes\"\n break\n elif s[i] > t[i]:\n ans = \"No\"\n break\n else:\n ans = \"No\"\n print(ans)\n\n\nif __name__ == \"__main__\":\n # execute only if run as a script\n main()\n", "measured_slow_code_sha256": "ae2b702653d7f7343a504deb1d82130c75439f406e3e68078bdb6fe733a50939", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.04716903897062, "pair_id": "python_v2_f8965ea9de56c2e51ac658f4", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03486", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03486_053e2cef6d2b126f51a668e5b1be024e3c54bfe23aa85674a248c6509ae6b46f.jsonl.gz", "inputs": "reproduction/python/inputs/p03486.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03486_ae2b702653d7f7343a504deb1d82130c75439f406e3e68078bdb6fe733a50939.jsonl.gz"}, "slow_code": "import sys\n\n\ndef main():\n s, t = sys.stdin.read().split()\n n, m = len(s), len(t)\n s = sorted(s)\n t = list(reversed(sorted(t)))\n if n < m:\n for i in range(n):\n if s[i] < t[i]:\n ans = \"Yes\"\n break\n elif s[i] > t[i]:\n ans = \"No\"\n break\n else:\n ans = \"Yes\"\n else:\n for i in range(m):\n if s[i] < t[i]:\n ans = \"Yes\"\n break\n elif s[i] > t[i]:\n ans = \"No\"\n break\n else:\n ans = \"No\"\n print(ans)\n\n\nif __name__ == \"__main__\":\n\n main()\n", "slow_code_sha256": "12de6db88ad79471a6d47d200ef0cf1d590ca1eac8ef874b69a66f9eb314da4e", "slow_id": "p03486_ae2b702653d7f7343a504deb1d82130c75439f406e3e68078bdb6fe733a50939", "speedup": 2.9548633725403137, "stratum": "2-4", "within_pair_jaccard": 0.2727272727272727, "workload": {"case_count": 100, "description": "Rearrange the characters of each lowercase string s and t independently. Determine whether some rearrangements satisfy strict lexicographic order s_prime>= 1\n R >>= 1\n\n # a_iの現在の値を取得\n def _query(k, data):\n k += N0 - 1\n s = INF\n while k >= 0:\n if data[k]:\n s = max(s, data[k])\n k = (k - 1) // 2\n return s\n\n # これを呼び出す\n def query(k, data):\n return _query(k, data)[1]\n\n update(0, N, (0, N), data1)\n update(0, N, (0, N), data2)\n min1 = min2 = N + 10\n ans = N * N\n for i, (q, x) in enumerate(queries, 1):\n x -= 2\n if q == 1:\n data = data1\n this_min = min1\n else:\n data = data2\n this_min = min2\n n = query(x, data)\n ans -= n\n if x > this_min:\n continue\n if q == 1:\n min1 = x\n update(0, n, (i, x), data2)\n else:\n min2 = x\n update(0, n, (i, x), data1)\n print(ans)\n return\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "4a16bff7c31cffdfdbe77a06643bb78fef98086e135ad4345038314f484d3403", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 5.9279228339579415, "pair_id": "python_v2_a8595ea89cb441e6e7350f78", "per_case_slow_code_faster_fraction": 0.01, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02551", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02551_563884c909984690cb17a4a75e13aa643e22ac803dadb5d6eff6d3b364daf2a3.jsonl.gz", "inputs": "reproduction/python/inputs/p02551.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02551_4a16bff7c31cffdfdbe77a06643bb78fef98086e135ad4345038314f484d3403.jsonl.gz"}, "slow_code": "import sys\n\nread = sys.stdin.read\nreadline = sys.stdin.readline\nreadlines = sys.stdin.readlines\nsys.setrecursionlimit(10**9)\nMOD = 1000000007\n\n\ndef main():\n N, Q, *queries = list(map(int, read().split()))\n queries = [(q, x) for q, x in zip(*[iter(queries)] * 2)]\n N -= 2\n\n N0 = 2 ** (N - 1).bit_length()\n data1 = [None] * (2 * N0)\n data2 = [None] * (2 * N0)\n INF = (-1, 2**31 - 1)\n\n def update(l, r, v, data):\n L = l + N0\n R = r + N0\n while L < R:\n if R & 1:\n R -= 1\n data[R - 1] = v\n if L & 1:\n data[L - 1] = v\n L += 1\n L >>= 1\n R >>= 1\n\n def _query(k, data):\n k += N0 - 1\n s = INF\n while k >= 0:\n if data[k]:\n s = max(s, data[k])\n k = (k - 1) // 2\n return s\n\n def query(k, data):\n return _query(k, data)[1]\n\n update(0, N, (0, N), data1)\n update(0, N, (0, N), data2)\n min1 = min2 = N + 10\n ans = N * N\n for i, (q, x) in enumerate(queries, 1):\n x -= 2\n if q == 1:\n data = data1\n this_min = min1\n else:\n data = data2\n this_min = min2\n n = query(x, data)\n ans -= n\n if x > this_min:\n continue\n if q == 1:\n min1 = x\n update(0, n, (i, x), data2)\n else:\n min2 = x\n update(0, n, (i, x), data1)\n print(ans)\n return\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "c5b27d123eb4be603fe8509dc52f382f0edbaa108b801cde25d5e3518e703c95", "slow_id": "p02551_4a16bff7c31cffdfdbe77a06643bb78fef98086e135ad4345038314f484d3403", "speedup": 4.5648680088437965, "stratum": "4-8", "within_pair_jaccard": 0.5588235294117647, "workload": {"case_count": 100, "description": "An N-by-N grid starts with black inner cells and white bottom/right borders. Distinct queries 1 x or 2 x turn cells white downward from (1,x) or rightward from (x,1), stopping at the first white cell. Count remaining black cells. Observed inputs: N=3..200000 (median 100000); Q=0..200000 (median 199996); x=2..199999.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1689172, "median": 1577778.0, "min": 4}, "input_format": ["N Q\ntype_1 x_1\n...\ntype_Q x_Q"], "input_format_status": "source_input_section", "input_lines": {"max": 200001, "median": 199997.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 400002, "median": 399994.0, "min": 2}}} -{"case_ids": ["p00028_case_000", "p00028_case_001", "p00028_case_002", "p00028_case_003", "p00028_case_004", "p00028_case_005", "p00028_case_006", "p00028_case_007", "p00028_case_008", "p00028_case_009", "p00028_case_010", "p00028_case_011", "p00028_case_012", "p00028_case_013", "p00028_case_014", "p00028_case_015", "p00028_case_016", "p00028_case_017", "p00028_case_018", "p00028_case_019", "p00028_case_020", "p00028_case_021", "p00028_case_022", "p00028_case_023", "p00028_case_024", "p00028_case_025", "p00028_case_026", "p00028_case_027", "p00028_case_028", "p00028_case_029", "p00028_case_030", "p00028_case_031", "p00028_case_032", "p00028_case_033", "p00028_case_034", "p00028_case_035", "p00028_case_036", "p00028_case_037", "p00028_case_038", "p00028_case_039", "p00028_case_040", "p00028_case_041", "p00028_case_042", "p00028_case_043", "p00028_case_044", "p00028_case_045", "p00028_case_046", "p00028_case_047", "p00028_case_048", "p00028_case_049", "p00028_case_050", "p00028_case_051", "p00028_case_052", "p00028_case_053", "p00028_case_054", "p00028_case_055", "p00028_case_056", "p00028_case_057", "p00028_case_058", "p00028_case_059", "p00028_case_060", "p00028_case_061", "p00028_case_062", "p00028_case_063", "p00028_case_064", "p00028_case_065", "p00028_case_066", "p00028_case_067", "p00028_case_068", "p00028_case_069", "p00028_case_070", "p00028_case_071", "p00028_case_072", "p00028_case_073", "p00028_case_074", "p00028_case_075", "p00028_case_076", "p00028_case_077", "p00028_case_078", "p00028_case_079", "p00028_case_080", "p00028_case_081", "p00028_case_082", "p00028_case_083", "p00028_case_084", "p00028_case_085", "p00028_case_086", "p00028_case_087", "p00028_case_088", "p00028_case_089", "p00028_case_090", "p00028_case_091", "p00028_case_092", "p00028_case_093", "p00028_case_094", "p00028_case_095", "p00028_case_096", "p00028_case_097", "p00028_case_098", "p00028_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "d = {}\ntry:\n while True:\n n = int(input())\n if n in d:\n d[n] += 1\n else:\n d[n] = 1\nexcept EOFError:\n pass\na = []\nm = max(d.values())\nfor key, value in list(d.items()):\n if value == m:\n a.append(key)\na.sort()\nfor i in a:\n print(i)\n", "fast_code_sha256": "36efa31a817599454e47c950d8405cd8170cd3f67b1b12f911d115f29e6e8467", "fast_id": "p00028_36efa31a817599454e47c950d8405cd8170cd3f67b1b12f911d115f29e6e8467", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "d = {}\ntry:\n while True:\n n = int(input())\n if n in d:\n d[n] += 1\n else:\n d[n] = 1\nexcept EOFError:\n pass\na = []\nm = max(d.values())\nfor key, value in list(d.items()):\n if value == m:\n a.append(key)\na.sort()\nfor i in a:\n print(i)\n", "measured_fast_code_sha256": "36efa31a817599454e47c950d8405cd8170cd3f67b1b12f911d115f29e6e8467", "measured_slow_code": "# 0028\narray = []\nwhile True:\n try:\n a = eval(input())\n array.append(int(a))\n except EOFError:\n break\ns = set(array)\nmx = array.count(max(s, key=array.count))\nfor a in sorted(s):\n if array.count(a) == mx:\n print(a)\n", "measured_slow_code_sha256": "a2c56599755a6522068b6dd4785e9872f8a6e6f4d7081a31ccc870bdefdc31dd", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.0023173522020294, "pair_id": "python_v2_28d6fcfc3bc3b700d8cb1499", "per_case_slow_code_faster_fraction": 0.15, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p00028", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p00028_36efa31a817599454e47c950d8405cd8170cd3f67b1b12f911d115f29e6e8467.jsonl.gz", "inputs": "reproduction/python/inputs/p00028.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p00028_a2c56599755a6522068b6dd4785e9872f8a6e6f4d7081a31ccc870bdefdc31dd.jsonl.gz"}, "slow_code": "array = []\nwhile True:\n try:\n a = eval(input())\n array.append(int(a))\n except EOFError:\n break\ns = set(array)\nmx = array.count(max(s, key=array.count))\nfor a in sorted(s):\n if array.count(a) == mx:\n print(a)\n", "slow_code_sha256": "ef44995e2e7b1383b510cc6925ff4e89435c4f6e99f81948a44fdef927e4dd00", "slow_id": "p00028_a2c56599755a6522068b6dd4785e9872f8a6e6f4d7081a31ccc870bdefdc31dd", "speedup": 2.517398840737766, "stratum": "2-4", "within_pair_jaccard": 0.42857142857142855, "workload": {"case_count": 100, "description": "Find all most frequent values in the supplied integer sequence and output them in ascending order. Values are supplied one per line until end of input, with no leading count. Observed inputs: elements=1..100 (median 100); a_i=1..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 400, "median": 288.0, "min": 2}, "input_format": ["a_1\n...\na_L (until EOF)"], "input_format_status": "source_input_section", "input_lines": {"max": 100, "median": 100.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100, "median": 100.0, "min": 1}}} -{"case_ids": ["p02700_case_000", "p02700_case_001", "p02700_case_002", "p02700_case_003", "p02700_case_004", "p02700_case_005", "p02700_case_006", "p02700_case_007", "p02700_case_008", "p02700_case_009", "p02700_case_010", "p02700_case_011", "p02700_case_012", "p02700_case_013", "p02700_case_014", "p02700_case_015", "p02700_case_016", "p02700_case_017", "p02700_case_018", "p02700_case_019", "p02700_case_020", "p02700_case_021", "p02700_case_022", "p02700_case_023", "p02700_case_024", "p02700_case_025", "p02700_case_026", "p02700_case_027", "p02700_case_028", "p02700_case_029", "p02700_case_030", "p02700_case_031", "p02700_case_032", "p02700_case_033", "p02700_case_034", "p02700_case_035", "p02700_case_036", "p02700_case_037", "p02700_case_038", "p02700_case_039", "p02700_case_040", "p02700_case_041", "p02700_case_042", "p02700_case_043", "p02700_case_044", "p02700_case_045", "p02700_case_046", "p02700_case_047", "p02700_case_048", "p02700_case_049", "p02700_case_050", "p02700_case_051", "p02700_case_052", "p02700_case_053", "p02700_case_054", "p02700_case_055", "p02700_case_056", "p02700_case_057", "p02700_case_058", "p02700_case_059", "p02700_case_060", "p02700_case_061", "p02700_case_062", "p02700_case_063", "p02700_case_064", "p02700_case_065", "p02700_case_066", "p02700_case_067", "p02700_case_068", "p02700_case_069", "p02700_case_070", "p02700_case_071", "p02700_case_072", "p02700_case_073", "p02700_case_074", "p02700_case_075", "p02700_case_076", "p02700_case_077", "p02700_case_078", "p02700_case_079", "p02700_case_080", "p02700_case_081", "p02700_case_082", "p02700_case_083", "p02700_case_084", "p02700_case_085", "p02700_case_086", "p02700_case_087", "p02700_case_088", "p02700_case_089", "p02700_case_090", "p02700_case_091", "p02700_case_092", "p02700_case_093", "p02700_case_094", "p02700_case_095", "p02700_case_096", "p02700_case_097", "p02700_case_098", "p02700_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "A, B, C, D = list(map(int, input().split()))\nT_time = C // B if C % B == 0 else C // B + 1\nA_time = A // D if A % D == 0 else A // D + 1\nif T_time <= A_time:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "fast_code_sha256": "79ba1f6460345ea02653f0a79993615ab3c1f26419ad99ddd40e82506c2902de", "fast_id": "p02700_79ba1f6460345ea02653f0a79993615ab3c1f26419ad99ddd40e82506c2902de", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "A, B, C, D = list(map(int, input().split()))\nT_time = C // B if C % B == 0 else C // B + 1\nA_time = A // D if A % D == 0 else A // D + 1\nif T_time <= A_time:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "measured_fast_code_sha256": "79ba1f6460345ea02653f0a79993615ab3c1f26419ad99ddd40e82506c2902de", "measured_slow_code": "from math import floor, ceil, sqrt, factorial, log\nfrom collections import Counter, deque\nfrom functools import reduce\n\n# import numpy as np\ndef S():\n return eval(input())\n\n\ndef I():\n return int(eval(input()))\n\n\ndef MS():\n return list(map(str, input().split()))\n\n\ndef MI():\n return list(map(int, input().split()))\n\n\ndef FLI():\n return [int(i) for i in input().split()]\n\n\ndef LS():\n return list(MS())\n\n\ndef LI():\n return list(MI())\n\n\ndef LLS():\n return [list(map(str, l.split())) for l in eval(input())]\n\n\ndef LLI():\n return [list(map(int, l.split())) for l in eval(input())]\n\n\ndef LLSN(n: int):\n return [LS() for _ in range(n)]\n\n\ndef LLIN(n: int):\n return [LI() for _ in range(n)]\n\n\nA, B, C, D = MI()\nx = -(-A // D)\ny = -(-C // B)\nif x >= y:\n print(\"Yes\")\nelse:\n print(\"No\")\n# for i in range(100):\n# a -= B\n# if a <= 0:\n# print(\"Yes\")\n# exit()\n# t -= D\n# if t <= 0:\n# print(\"No\")\n# exit()\n", "measured_slow_code_sha256": "0800076b3be1d259d89fb0c2c371b4341f1c7fc8f7058a2f3f090ffddebf2dcb", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4.344134973478882, "pair_id": "python_v2_5e19696354b9c8ae490a9be2", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02700", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02700_79ba1f6460345ea02653f0a79993615ab3c1f26419ad99ddd40e82506c2902de.jsonl.gz", "inputs": "reproduction/python/inputs/p02700.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02700_0800076b3be1d259d89fb0c2c371b4341f1c7fc8f7058a2f3f090ffddebf2dcb.jsonl.gz"}, "slow_code": "from math import floor, ceil, sqrt, factorial, log\nfrom collections import Counter, deque\nfrom functools import reduce\n\n\ndef S():\n return eval(input())\n\n\ndef I():\n return int(eval(input()))\n\n\ndef MS():\n return list(map(str, input().split()))\n\n\ndef MI():\n return list(map(int, input().split()))\n\n\ndef FLI():\n return [int(i) for i in input().split()]\n\n\ndef LS():\n return list(MS())\n\n\ndef LI():\n return list(MI())\n\n\ndef LLS():\n return [list(map(str, l.split())) for l in eval(input())]\n\n\ndef LLI():\n return [list(map(int, l.split())) for l in eval(input())]\n\n\ndef LLSN(n: int):\n return [LS() for _ in range(n)]\n\n\ndef LLIN(n: int):\n return [LI() for _ in range(n)]\n\n\nA, B, C, D = MI()\nx = -(-A // D)\ny = -(-C // B)\nif x >= y:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "slow_code_sha256": "7feb6456d377ecdd9b0dcbfc30f9b0e6286836e7cba34a2d795c5cf979e98297", "slow_id": "p02700_0800076b3be1d259d89fb0c2c371b4341f1c7fc8f7058a2f3f090ffddebf2dcb", "speedup": 4.34240393605635, "stratum": "4-8", "within_pair_jaccard": 0.2641509433962264, "workload": {"case_count": 100, "description": "Two monsters have health/attack (A,B) and (C,D). Starting with the first monster, they attack alternately, subtracting their attack value from the opponent health. Determine whether the first wins by reducing opposing health to at most zero. Observed inputs: A=1..100 (median 73); B=1..100 (median 48.5); C=1..100 (median 80.5); D=1..100 (median 55).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 16, "median": 12.0, "min": 8}, "input_format": ["A B C D"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 4, "median": 4.0, "min": 4}}} -{"case_ids": ["p02289_case_000", "p02289_case_001", "p02289_case_002", "p02289_case_003", "p02289_case_004", "p02289_case_005", "p02289_case_006", "p02289_case_007", "p02289_case_008", "p02289_case_009", "p02289_case_010", "p02289_case_011", "p02289_case_012", "p02289_case_013", "p02289_case_014", "p02289_case_015", "p02289_case_016", "p02289_case_017", "p02289_case_018", "p02289_case_019", "p02289_case_020", "p02289_case_021", "p02289_case_022", "p02289_case_023", "p02289_case_024", "p02289_case_025", "p02289_case_026", "p02289_case_027", "p02289_case_028", "p02289_case_029", "p02289_case_030", "p02289_case_031", "p02289_case_032", "p02289_case_033", "p02289_case_034", "p02289_case_035", "p02289_case_036", "p02289_case_037", "p02289_case_038", "p02289_case_039", "p02289_case_040", "p02289_case_041", "p02289_case_042", "p02289_case_043", "p02289_case_044", "p02289_case_045", "p02289_case_046", "p02289_case_047", "p02289_case_048", "p02289_case_049", "p02289_case_050", "p02289_case_051", "p02289_case_052", "p02289_case_053", "p02289_case_054", "p02289_case_055", "p02289_case_056", "p02289_case_057", "p02289_case_058", "p02289_case_059", "p02289_case_060", "p02289_case_061", "p02289_case_062", "p02289_case_063", "p02289_case_064", "p02289_case_065", "p02289_case_066", "p02289_case_067", "p02289_case_068", "p02289_case_069", "p02289_case_070", "p02289_case_071", "p02289_case_072", "p02289_case_073", "p02289_case_074", "p02289_case_075", "p02289_case_076", "p02289_case_077", "p02289_case_078", "p02289_case_079", "p02289_case_080", "p02289_case_081", "p02289_case_082", "p02289_case_083", "p02289_case_084", "p02289_case_085", "p02289_case_086", "p02289_case_087", "p02289_case_088", "p02289_case_089", "p02289_case_090", "p02289_case_091", "p02289_case_092", "p02289_case_093", "p02289_case_094", "p02289_case_095", "p02289_case_096", "p02289_case_097", "p02289_case_098", "p02289_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from sys import stdin\nfrom heapq import heappop, heappush\n\nreadline = stdin.readline\nheap = []\nwhile True:\n line = readline()\n if line[1] == \"x\":\n print((-heappop(heap)))\n elif line[0] == \"i\":\n heappush(heap, -int(line.split()[1]))\n else:\n break\n", "fast_code_sha256": "2d3037cf2557e1076db36a151c25eb5936b98bbc795347177923cafa6dbc82c4", "fast_id": "p02289_2d3037cf2557e1076db36a151c25eb5936b98bbc795347177923cafa6dbc82c4", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from sys import stdin\nfrom heapq import heappop, heappush\n\nreadline = stdin.readline\nheap = []\nwhile True:\n line = readline()\n if line[1] == \"x\":\n print((-heappop(heap)))\n elif line[0] == \"i\":\n heappush(heap, -int(line.split()[1]))\n else:\n break\n", "measured_fast_code_sha256": "2d3037cf2557e1076db36a151c25eb5936b98bbc795347177923cafa6dbc82c4", "measured_slow_code": "import sys\n\n\ndef maxHeapify(A, i):\n l = i * 2 + 1\n r = i * 2 + 2\n if l < n:\n largest = l\n if r < n and A[r] > A[l]:\n largest = r\n if A[largest] > A[i]:\n A[i], A[largest] = A[largest], A[i]\n maxHeapify(A, largest)\n\n\ndef insert(S, k):\n global n\n S[n] = k\n n += 1\n i = n - 1\n p = (i - 1) // 2\n while i > 0 and S[i] > S[p]:\n S[i], S[p] = S[p], S[i]\n i = p\n p = (i - 1) // 2\n\n\ndef extractMax(S):\n global n\n if n == 1:\n n -= 1\n return S[0]\n ans = S[0]\n n -= 1\n S[0] = S[n]\n i = 0\n while True:\n l = i * 2 + 1\n r = i * 2 + 2\n if l >= n:\n break\n largest = l\n if r < n and A[r] > A[l]:\n largest = r\n if A[largest] > A[i]:\n A[i], A[largest] = A[largest], A[i]\n i = largest\n else:\n break\n return ans\n\n\nA = [0] * 2000000\nS = []\nn = 0\nfor s in sys.stdin:\n if s[2] == \"s\":\n insert(A, int(s[7:]))\n elif s[2] == \"t\":\n S.append(extractMax(A))\n else:\n break\nprint((\"\\n\".join(map(str, S))))\n", "measured_slow_code_sha256": "14b4ad282f61dc3f0baedf2eb80026c759f35dd9b34a29e093c21234282f17e7", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.3248445925657375, "pair_id": "python_v2_e168fe67183488db5e211f8f", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02289", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02289_2d3037cf2557e1076db36a151c25eb5936b98bbc795347177923cafa6dbc82c4.jsonl.gz", "inputs": "reproduction/python/inputs/p02289.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02289_14b4ad282f61dc3f0baedf2eb80026c759f35dd9b34a29e093c21234282f17e7.jsonl.gz"}, "slow_code": "import sys\n\n\ndef maxHeapify(A, i):\n l = i * 2 + 1\n r = i * 2 + 2\n if l < n:\n largest = l\n if r < n and A[r] > A[l]:\n largest = r\n if A[largest] > A[i]:\n A[i], A[largest] = A[largest], A[i]\n maxHeapify(A, largest)\n\n\ndef insert(S, k):\n global n\n S[n] = k\n n += 1\n i = n - 1\n p = (i - 1) // 2\n while i > 0 and S[i] > S[p]:\n S[i], S[p] = S[p], S[i]\n i = p\n p = (i - 1) // 2\n\n\ndef extractMax(S):\n global n\n if n == 1:\n n -= 1\n return S[0]\n ans = S[0]\n n -= 1\n S[0] = S[n]\n i = 0\n while True:\n l = i * 2 + 1\n r = i * 2 + 2\n if l >= n:\n break\n largest = l\n if r < n and A[r] > A[l]:\n largest = r\n if A[largest] > A[i]:\n A[i], A[largest] = A[largest], A[i]\n i = largest\n else:\n break\n return ans\n\n\nA = [0] * 2000000\nS = []\nn = 0\nfor s in sys.stdin:\n if s[2] == \"s\":\n insert(A, int(s[7:]))\n elif s[2] == \"t\":\n S.append(extractMax(A))\n else:\n break\nprint((\"\\n\".join(map(str, S))))\n", "slow_code_sha256": "14b4ad282f61dc3f0baedf2eb80026c759f35dd9b34a29e093c21234282f17e7", "slow_id": "p02289_14b4ad282f61dc3f0baedf2eb80026c759f35dd9b34a29e093c21234282f17e7", "speedup": 3.419932552983897, "stratum": "2-4", "within_pair_jaccard": 0.28, "workload": {"case_count": 100, "description": "Maintain an initially empty max-priority queue. Each insert k adds one integer; each extract removes and prints the current maximum. Commands occur one per line and end terminates input. Duplicate keys are allowed. Observed inputs: operations=10..500000 (median 1000); insertions=5..250192 (median 508); extractions=3..249991 (median 495.5); maximum_queue_size=1..50000 (median 30.5); k=0..2000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 6501924, "median": 12912.5, "min": 130}, "input_format": ["insert k\nextract\n...\nend"], "input_format_status": "source_input_section", "input_lines": {"max": 500001, "median": 1001.0, "min": 11}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 750193, "median": 1509.0, "min": 16}}} -{"case_ids": ["p02406_case_000", "p02406_case_001", "p02406_case_002", "p02406_case_003", "p02406_case_004", "p02406_case_005", "p02406_case_006", "p02406_case_007", "p02406_case_008", "p02406_case_009", "p02406_case_010", "p02406_case_011", "p02406_case_012", "p02406_case_013", "p02406_case_014", "p02406_case_015", "p02406_case_016", "p02406_case_017", "p02406_case_018", "p02406_case_019", "p02406_case_020", "p02406_case_021", "p02406_case_022", "p02406_case_023", "p02406_case_024", "p02406_case_025", "p02406_case_026", "p02406_case_027", "p02406_case_028", "p02406_case_029", "p02406_case_030", "p02406_case_031", "p02406_case_032", "p02406_case_033", "p02406_case_034", "p02406_case_035", "p02406_case_036", "p02406_case_037", "p02406_case_038", "p02406_case_039", "p02406_case_040", "p02406_case_041", "p02406_case_042", "p02406_case_043", "p02406_case_044", "p02406_case_045", "p02406_case_046", "p02406_case_047", "p02406_case_048", "p02406_case_049", "p02406_case_050", "p02406_case_051", "p02406_case_052", "p02406_case_053", "p02406_case_054", "p02406_case_055", "p02406_case_056", "p02406_case_057", "p02406_case_058", "p02406_case_059", "p02406_case_060", "p02406_case_061", "p02406_case_062", "p02406_case_063", "p02406_case_064", "p02406_case_065", "p02406_case_066", "p02406_case_067", "p02406_case_068", "p02406_case_069", "p02406_case_070", "p02406_case_071", "p02406_case_072", "p02406_case_073", "p02406_case_074", "p02406_case_075", "p02406_case_076", "p02406_case_077", "p02406_case_078", "p02406_case_079", "p02406_case_080", "p02406_case_081", "p02406_case_082", "p02406_case_083", "p02406_case_084", "p02406_case_085", "p02406_case_086", "p02406_case_087", "p02406_case_088", "p02406_case_089", "p02406_case_090", "p02406_case_091", "p02406_case_092", "p02406_case_093", "p02406_case_094", "p02406_case_095", "p02406_case_096", "p02406_case_097", "p02406_case_098", "p02406_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "print(\n \"\".join(\n \" \" + str(i) for i in range(1, eval(input()) + 1) if i % 3 == 0 or \"3\" in str(i)\n )\n)\n", "fast_code_sha256": "44ab35a9714ea188a11aedb20f3ea7103bd930af4ad186337881b8ed88a0b55b", "fast_id": "p02406_44ab35a9714ea188a11aedb20f3ea7103bd930af4ad186337881b8ed88a0b55b", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "print(\n \"\".join(\n \" \" + str(i) for i in range(1, eval(input()) + 1) if i % 3 == 0 or \"3\" in str(i)\n )\n)\n", "measured_fast_code_sha256": "44ab35a9714ea188a11aedb20f3ea7103bd930af4ad186337881b8ed88a0b55b", "measured_slow_code": "n = int(eval(input()))\nlist_a = [i for i in range(1, n + 1) if i % 3 == 0]\nlist_b = []\nfor i in range(1, n + 1):\n j = i\n while True:\n if j == 0:\n break\n elif j % 10 == 3:\n list_b.append(i)\n break\n j = j // 10\na = set(list_a)\nb = set(list_b)\nc = list(a | b)\nc.sort()\nprint((\" \" + \" \".join(map(str, c))))\n", "measured_slow_code_sha256": "410f0e096d34371faf9e22953fd00a2c72291f9635dec5b6ea34eed2092f1fb5", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.4626715779859625, "pair_id": "python_v2_7f649fd9da40903231d780c3", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02406", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02406_44ab35a9714ea188a11aedb20f3ea7103bd930af4ad186337881b8ed88a0b55b.jsonl.gz", "inputs": "reproduction/python/inputs/p02406.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02406_410f0e096d34371faf9e22953fd00a2c72291f9635dec5b6ea34eed2092f1fb5.jsonl.gz"}, "slow_code": "n = int(eval(input()))\nlist_a = [i for i in range(1, n + 1) if i % 3 == 0]\nlist_b = []\nfor i in range(1, n + 1):\n j = i\n while True:\n if j == 0:\n break\n elif j % 10 == 3:\n list_b.append(i)\n break\n j = j // 10\na = set(list_a)\nb = set(list_b)\nc = list(a | b)\nc.sort()\nprint((\" \" + \" \".join(map(str, c))))\n", "slow_code_sha256": "410f0e096d34371faf9e22953fd00a2c72291f9635dec5b6ea34eed2092f1fb5", "slow_id": "p02406_410f0e096d34371faf9e22953fd00a2c72291f9635dec5b6ea34eed2092f1fb5", "speedup": 2.4399977764758285, "stratum": "2-4", "within_pair_jaccard": 0.40625, "workload": {"case_count": 100, "description": "Print in ascending order the integers from 1 through n that are divisible by 3 or have a decimal digit 3. A qualifying integer is printed once even if both conditions hold. Observed inputs: n=3..10000 (median 5211).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 6, "median": 5.0, "min": 2}, "input_format": ["n"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p03312_case_000", "p03312_case_001", "p03312_case_002", "p03312_case_003", "p03312_case_004", "p03312_case_005", "p03312_case_006", "p03312_case_007", "p03312_case_008", "p03312_case_009", "p03312_case_010", "p03312_case_011", "p03312_case_012", "p03312_case_013", "p03312_case_014", "p03312_case_015", "p03312_case_016", "p03312_case_017", "p03312_case_018", "p03312_case_019", "p03312_case_020", "p03312_case_021", "p03312_case_022", "p03312_case_023", "p03312_case_024", "p03312_case_025", "p03312_case_026", "p03312_case_027", "p03312_case_028", "p03312_case_029", "p03312_case_030", "p03312_case_031", "p03312_case_032", "p03312_case_033", "p03312_case_034", "p03312_case_035", "p03312_case_036", "p03312_case_037", "p03312_case_038", "p03312_case_039", "p03312_case_040", "p03312_case_041", "p03312_case_042", "p03312_case_043", "p03312_case_044", "p03312_case_045", "p03312_case_046", "p03312_case_047", "p03312_case_048", "p03312_case_049", "p03312_case_050", "p03312_case_051", "p03312_case_052", "p03312_case_053", "p03312_case_054", "p03312_case_055", "p03312_case_056", "p03312_case_057", "p03312_case_058", "p03312_case_059", "p03312_case_060", "p03312_case_061", "p03312_case_062", "p03312_case_063", "p03312_case_064", "p03312_case_065", "p03312_case_066", "p03312_case_067", "p03312_case_068", "p03312_case_069", "p03312_case_070", "p03312_case_071", "p03312_case_072", "p03312_case_073", "p03312_case_074", "p03312_case_075", "p03312_case_076", "p03312_case_077", "p03312_case_078", "p03312_case_079", "p03312_case_080", "p03312_case_081", "p03312_case_082", "p03312_case_083", "p03312_case_084", "p03312_case_085", "p03312_case_086", "p03312_case_087", "p03312_case_088", "p03312_case_089", "p03312_case_090", "p03312_case_091", "p03312_case_092", "p03312_case_093", "p03312_case_094", "p03312_case_095", "p03312_case_096", "p03312_case_097", "p03312_case_098", "p03312_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N = int(eval(input()))\nAs = list(map(int, input().split()))\nans = float(\"inf\")\niB, iD = 1, 3\n(P, Q, R), S = As[:3], sum(As[3:])\n\nfor iC in range(2, N - 1):\n while P < Q and As[iB] <= Q - P:\n P += As[iB]\n Q -= As[iB]\n iB += 1\n while R < S and As[iD] <= S - R:\n R += As[iD]\n S -= As[iD]\n iD += 1\n ans = min(ans, max(P, Q, R, S) - min(P, Q, R, S))\n Q += As[iC]\n R -= As[iC]\nprint(ans)\n", "fast_code_sha256": "edcc95617201d5626b449d1a7abf3100c52bfc6d5e1b34d56dd05ba872f655f1", "fast_id": "p03312_d384bba78aa3be094873144e7572be2fec2f5b51b3dabf911721719d39833e4d", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N = int(eval(input()))\nAs = list(map(int, input().split()))\nans = float(\"inf\")\niB, iD = 1, 3\n(P, Q, R), S = As[:3], sum(As[3:])\n# 真ん中の区切りを全通り試す\nfor iC in range(2, N - 1):\n while P < Q and As[iB] <= Q - P:\n P += As[iB]\n Q -= As[iB]\n iB += 1\n while R < S and As[iD] <= S - R:\n R += As[iD]\n S -= As[iD]\n iD += 1\n ans = min(ans, max(P, Q, R, S) - min(P, Q, R, S))\n Q += As[iC]\n R -= As[iC]\nprint(ans)\n", "measured_fast_code_sha256": "d384bba78aa3be094873144e7572be2fec2f5b51b3dabf911721719d39833e4d", "measured_slow_code": "# ARC100D\nimport sys\n\ninput = lambda: sys.stdin.readline().rstrip()\nsys.setrecursionlimit(max(1000, 10**9))\nn = int(eval(input()))\na = list(map(int, input().split()))\nca = [None] * n # ca[i] = a0~aiの和\ns = 0\nfor i, num in enumerate(a):\n s += a[i]\n ca[i] = s\ndiff = [None] * n\ns = 0\nt = 1\nv1 = 0 # a[:s]\nv2 = a[0] # sum(a[s:t])\ndiff[t - 1] = (v1, v2)\nwhile t < n:\n # print(t, v1-v2)\n t += 1\n v2 += a[t - 1]\n while v1 < v2 and s < t:\n if diff[t - 1] is None or abs(v1 - v2) < abs(diff[t - 1][0] - diff[t - 1][1]):\n diff[t - 1] = (v1, v2)\n s += 1\n v1 += a[s - 1]\n v2 -= a[s - 1]\n if diff[t - 1] is None or abs(v1 - v2) < abs(diff[t - 1][0] - diff[t - 1][1]):\n diff[t - 1] = (v1, v2)\n if v1 > v2 and s >= 1:\n v1 -= a[s - 1]\n v2 += a[s - 1]\n s -= 1\ndiff2 = [None] * n\ns = n\nt = n - 1\nv1 = 0 # sum(a[s:])\nv2 = a[-1] # sum(a[t:s])\ndiff2[t] = (v1, v2)\nwhile t >= 1:\n # print(t, v1, v2)\n t -= 1\n v2 += a[t]\n while v1 < v2 and s > t:\n if diff2[t] is None or abs(v1 - v2) < abs(diff2[t][0] - diff2[t][1]):\n diff2[t] = (v1, v2)\n s -= 1\n v1 += a[s]\n v2 -= a[s]\n if diff2[t] is None or abs(v1 - v2) < abs(diff2[t][0] - diff2[t][1]):\n diff2[t] = (v1, v2)\n if v1 > v2 and s <= n - 2:\n v1 -= a[s]\n v2 += a[s]\n s += 1\nprint(\n (\n min(\n (\n max(diff[i][0], diff[i][1], diff2[i + 1][0], diff2[i + 1][1])\n - min(diff[i][0], diff[i][1], diff2[i + 1][0], diff2[i + 1][1])\n )\n for i in range(n - 1)\n )\n )\n)\n", "measured_slow_code_sha256": "923136bcc3ca1993d7b5b5155c0211bba6ed078795c208a1a3875d6dd7aa6d3a", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.9435394439817313, "pair_id": "python_v2_022a06bdad00161e5e772024", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03312", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03312_d384bba78aa3be094873144e7572be2fec2f5b51b3dabf911721719d39833e4d.jsonl.gz", "inputs": "reproduction/python/inputs/p03312.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03312_923136bcc3ca1993d7b5b5155c0211bba6ed078795c208a1a3875d6dd7aa6d3a.jsonl.gz"}, "slow_code": "import sys\n\ninput = lambda: sys.stdin.readline().rstrip()\nsys.setrecursionlimit(max(1000, 10**9))\nn = int(eval(input()))\na = list(map(int, input().split()))\nca = [None] * n\ns = 0\nfor i, num in enumerate(a):\n s += a[i]\n ca[i] = s\ndiff = [None] * n\ns = 0\nt = 1\nv1 = 0\nv2 = a[0]\ndiff[t - 1] = (v1, v2)\nwhile t < n:\n\n t += 1\n v2 += a[t - 1]\n while v1 < v2 and s < t:\n if diff[t - 1] is None or abs(v1 - v2) < abs(diff[t - 1][0] - diff[t - 1][1]):\n diff[t - 1] = (v1, v2)\n s += 1\n v1 += a[s - 1]\n v2 -= a[s - 1]\n if diff[t - 1] is None or abs(v1 - v2) < abs(diff[t - 1][0] - diff[t - 1][1]):\n diff[t - 1] = (v1, v2)\n if v1 > v2 and s >= 1:\n v1 -= a[s - 1]\n v2 += a[s - 1]\n s -= 1\ndiff2 = [None] * n\ns = n\nt = n - 1\nv1 = 0\nv2 = a[-1]\ndiff2[t] = (v1, v2)\nwhile t >= 1:\n\n t -= 1\n v2 += a[t]\n while v1 < v2 and s > t:\n if diff2[t] is None or abs(v1 - v2) < abs(diff2[t][0] - diff2[t][1]):\n diff2[t] = (v1, v2)\n s -= 1\n v1 += a[s]\n v2 -= a[s]\n if diff2[t] is None or abs(v1 - v2) < abs(diff2[t][0] - diff2[t][1]):\n diff2[t] = (v1, v2)\n if v1 > v2 and s <= n - 2:\n v1 -= a[s]\n v2 += a[s]\n s += 1\nprint(\n (\n min(\n (\n max(diff[i][0], diff[i][1], diff2[i + 1][0], diff2[i + 1][1])\n - min(diff[i][0], diff[i][1], diff2[i + 1][0], diff2[i + 1][1])\n )\n for i in range(n - 1)\n )\n )\n)\n", "slow_code_sha256": "8f562a68154a7b683e51bbc10e45ae21454de6b7bc88fac021784e92ca0d322a", "slow_id": "p03312_923136bcc3ca1993d7b5b5155c0211bba6ed078795c208a1a3875d6dd7aa6d3a", "speedup": 2.9174278303920156, "stratum": "2-4", "within_pair_jaccard": 0.27586206896551724, "workload": {"case_count": 100, "description": "Split a positive array into exactly four nonempty contiguous parts. Minimize the largest part sum minus the smallest part sum. Observed inputs: N=4..200000 (median 1000); A_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 2200007, "median": 2113.5, "min": 10}, "input_format": ["N\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200001, "median": 1001.0, "min": 5}}} -{"case_ids": ["p03722_case_000", "p03722_case_001", "p03722_case_002", "p03722_case_003", "p03722_case_004", "p03722_case_005", "p03722_case_006", "p03722_case_007", "p03722_case_008", "p03722_case_009", "p03722_case_010", "p03722_case_011", "p03722_case_012", "p03722_case_013", "p03722_case_014", "p03722_case_015", "p03722_case_016", "p03722_case_017", "p03722_case_018", "p03722_case_019", "p03722_case_020", "p03722_case_021", "p03722_case_022", "p03722_case_023", "p03722_case_024", "p03722_case_025", "p03722_case_026", "p03722_case_027", "p03722_case_028", "p03722_case_029", "p03722_case_030", "p03722_case_031", "p03722_case_032", "p03722_case_033", "p03722_case_034", "p03722_case_035", "p03722_case_036", "p03722_case_037", "p03722_case_038", "p03722_case_039", "p03722_case_040", "p03722_case_041", "p03722_case_042", "p03722_case_043", "p03722_case_044", "p03722_case_045", "p03722_case_046", "p03722_case_047", "p03722_case_048", "p03722_case_049", "p03722_case_050", "p03722_case_051", "p03722_case_052", "p03722_case_053", "p03722_case_054", "p03722_case_055", "p03722_case_056", "p03722_case_057", "p03722_case_058", "p03722_case_059", "p03722_case_060", "p03722_case_061", "p03722_case_062", "p03722_case_063", "p03722_case_064", "p03722_case_065", "p03722_case_066", "p03722_case_067", "p03722_case_068", "p03722_case_069", "p03722_case_070", "p03722_case_071", "p03722_case_072", "p03722_case_073", "p03722_case_074", "p03722_case_075", "p03722_case_076", "p03722_case_077", "p03722_case_078", "p03722_case_079", "p03722_case_080", "p03722_case_081", "p03722_case_082", "p03722_case_083", "p03722_case_084", "p03722_case_085", "p03722_case_086", "p03722_case_087", "p03722_case_088", "p03722_case_089", "p03722_case_090", "p03722_case_091", "p03722_case_092", "p03722_case_093", "p03722_case_094", "p03722_case_095", "p03722_case_096", "p03722_case_097", "p03722_case_098", "p03722_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n, m = list(map(int, input().split()))\ne = []\nfor i in range(m):\n a, b, c = list(map(int, input().split()))\n e.append((a - 1, b - 1, c))\nmaxdis = [-float(\"inf\") for i in range(n)]\nmaxdis[0] = 0\nmugen = False\nfor i in range(n):\n for j in e:\n st, gl, cost = j\n if maxdis[gl] < maxdis[st] + cost:\n maxdis[gl] = maxdis[st] + cost\n if i >= n - 1 and (gl == n - 1):\n mugen = True\n break\nif mugen:\n print(\"inf\")\nelse:\n print((maxdis[n - 1]))\n", "fast_code_sha256": "fa13dedae158b2b6ed6527a3e086a5df2ac5d3c6d9471a8e82f2aaa8f7aeef2c", "fast_id": "p03722_fa13dedae158b2b6ed6527a3e086a5df2ac5d3c6d9471a8e82f2aaa8f7aeef2c", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n, m = list(map(int, input().split()))\ne = []\nfor i in range(m):\n a, b, c = list(map(int, input().split()))\n e.append((a - 1, b - 1, c))\nmaxdis = [-float(\"inf\") for i in range(n)]\nmaxdis[0] = 0\nmugen = False\nfor i in range(n):\n for j in e:\n st, gl, cost = j\n if maxdis[gl] < maxdis[st] + cost:\n maxdis[gl] = maxdis[st] + cost\n if i >= n - 1 and (gl == n - 1):\n mugen = True\n break\nif mugen:\n print(\"inf\")\nelse:\n print((maxdis[n - 1]))\n", "measured_fast_code_sha256": "fa13dedae158b2b6ed6527a3e086a5df2ac5d3c6d9471a8e82f2aaa8f7aeef2c", "measured_slow_code": "inf = float(\"inf\")\nV, E = list(map(int, input().split()))\nedge = []\nedge_rev = []\nfor i in range(E):\n A, B, C = list(map(int, input().split()))\n edge_rev.append([B - 1, A - 1, -C])\n edge.append([A - 1, B - 1, -C])\nd = [inf] * V\nd[0] = 0\nfor i in range(V):\n update = False\n for j in range(E):\n From, To, cost = edge[j]\n if d[From] != inf and d[To] > d[From] + cost:\n d[To] = d[From] + cost\n update = True\n if not update:\n break\nd_rev = [inf] * V\nd_rev[V - 1] = 0\nfor i in range(V):\n update = False\n for j in range(E):\n From, To, cost = edge_rev[j]\n if d_rev[From] != inf and d_rev[To] > d_rev[From] + cost:\n d_rev[To] = d_rev[From] + cost\n update = True\n if not update:\n break\nd_ = [x for x in d]\nd_rev_ = [x for x in d_rev]\nfor j in range(E):\n From, To, cost = edge[j]\n if d[From] != inf and d_rev[From] != inf and d[To] > d[From] + cost:\n d[To] = d[From] + cost\nfor j in range(E):\n From, To, cost = edge_rev[j]\n if d[From] != inf and d_rev[From] != inf and d_rev[To] > d_rev[From] + cost:\n d_rev[To] = d_rev[From] + cost\nloop = False\nfor i in range(V):\n if d[i] != 0 and d_rev[i] != 0:\n loop = (d[i] + d_rev[i] != d_[i] + d_rev_[i]) or loop\nif loop:\n print(\"inf\")\nelse:\n ans = -d[-1]\n print(ans)\n", "measured_slow_code_sha256": "4fb38b2eae99e24369d07fbc9a23feb6a7609a61834c9f3f5a065cd73cb2c2ec", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.5575895413342016, "pair_id": "python_v2_035125e71a78270b949a4708", "per_case_slow_code_faster_fraction": 0.01, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03722", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03722_fa13dedae158b2b6ed6527a3e086a5df2ac5d3c6d9471a8e82f2aaa8f7aeef2c.jsonl.gz", "inputs": "reproduction/python/inputs/p03722.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03722_4fb38b2eae99e24369d07fbc9a23feb6a7609a61834c9f3f5a065cd73cb2c2ec.jsonl.gz"}, "slow_code": "inf = float(\"inf\")\nV, E = list(map(int, input().split()))\nedge = []\nedge_rev = []\nfor i in range(E):\n A, B, C = list(map(int, input().split()))\n edge_rev.append([B - 1, A - 1, -C])\n edge.append([A - 1, B - 1, -C])\nd = [inf] * V\nd[0] = 0\nfor i in range(V):\n update = False\n for j in range(E):\n From, To, cost = edge[j]\n if d[From] != inf and d[To] > d[From] + cost:\n d[To] = d[From] + cost\n update = True\n if not update:\n break\nd_rev = [inf] * V\nd_rev[V - 1] = 0\nfor i in range(V):\n update = False\n for j in range(E):\n From, To, cost = edge_rev[j]\n if d_rev[From] != inf and d_rev[To] > d_rev[From] + cost:\n d_rev[To] = d_rev[From] + cost\n update = True\n if not update:\n break\nd_ = [x for x in d]\nd_rev_ = [x for x in d_rev]\nfor j in range(E):\n From, To, cost = edge[j]\n if d[From] != inf and d_rev[From] != inf and d[To] > d[From] + cost:\n d[To] = d[From] + cost\nfor j in range(E):\n From, To, cost = edge_rev[j]\n if d[From] != inf and d_rev[From] != inf and d_rev[To] > d_rev[From] + cost:\n d_rev[To] = d_rev[From] + cost\nloop = False\nfor i in range(V):\n if d[i] != 0 and d_rev[i] != 0:\n loop = (d[i] + d_rev[i] != d_[i] + d_rev_[i]) or loop\nif loop:\n print(\"inf\")\nelse:\n ans = -d[-1]\n print(ans)\n", "slow_code_sha256": "4fb38b2eae99e24369d07fbc9a23feb6a7609a61834c9f3f5a065cd73cb2c2ec", "slow_id": "p03722_4fb38b2eae99e24369d07fbc9a23feb6a7609a61834c9f3f5a065cd73cb2c2ec", "speedup": 2.4085313089817424, "stratum": "2-4", "within_pair_jaccard": 0.4423076923076923, "workload": {"case_count": 100, "description": "Start at vertex 1 with score zero and traverse directed edges, adding weight c_i each time. End only at vertex N. Maximize score, or report inf if unbounded; reaching N is guaranteed. No self-loops or repeated directed edges. Observed inputs: N=2..1000 (median 100); M=1..2000 (median 999); c_i=-1000000000..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 36387, "median": 17847.0, "min": 18}, "input_format": ["N M\na_1 b_1 c_1\n...\na_M b_M c_M"], "input_format_status": "source_input_section", "input_lines": {"max": 2001, "median": 1000.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 6002, "median": 2999.0, "min": 5}}} -{"case_ids": ["p02703_case_000", "p02703_case_001", "p02703_case_002", "p02703_case_003", "p02703_case_004", "p02703_case_005", "p02703_case_006", "p02703_case_007", "p02703_case_008", "p02703_case_009", "p02703_case_010", "p02703_case_011", "p02703_case_012", "p02703_case_013", "p02703_case_014", "p02703_case_015", "p02703_case_016", "p02703_case_017", "p02703_case_018", "p02703_case_019", "p02703_case_020", "p02703_case_021", "p02703_case_022", "p02703_case_023", "p02703_case_024", "p02703_case_025", "p02703_case_026", "p02703_case_027", "p02703_case_028", "p02703_case_029", "p02703_case_030", "p02703_case_031", "p02703_case_032", "p02703_case_033", "p02703_case_034", "p02703_case_035", "p02703_case_036", "p02703_case_037", "p02703_case_038", "p02703_case_039", "p02703_case_040", "p02703_case_041", "p02703_case_042", "p02703_case_043", "p02703_case_044", "p02703_case_045", "p02703_case_046", "p02703_case_047", "p02703_case_048", "p02703_case_049", "p02703_case_050", "p02703_case_051", "p02703_case_052", "p02703_case_053", "p02703_case_054", "p02703_case_055", "p02703_case_056", "p02703_case_057", "p02703_case_058", "p02703_case_059", "p02703_case_060", "p02703_case_061", "p02703_case_062", "p02703_case_063", "p02703_case_064", "p02703_case_065", "p02703_case_066", "p02703_case_067", "p02703_case_068", "p02703_case_069", "p02703_case_070", "p02703_case_071", "p02703_case_072", "p02703_case_073", "p02703_case_074", "p02703_case_075", "p02703_case_076", "p02703_case_077", "p02703_case_078", "p02703_case_079", "p02703_case_080", "p02703_case_081", "p02703_case_082", "p02703_case_083", "p02703_case_084", "p02703_case_085", "p02703_case_086", "p02703_case_087", "p02703_case_088", "p02703_case_089", "p02703_case_090", "p02703_case_091", "p02703_case_092", "p02703_case_093", "p02703_case_094", "p02703_case_095", "p02703_case_096", "p02703_case_097", "p02703_case_098", "p02703_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from heapq import heappop, heappush\nimport sys\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef main():\n N, M, S = list(map(int, input().split()))\n to = [{} for _ in range(N)]\n for _ in range(M):\n u, v, a, b = list(map(int, input().split()))\n u -= 1\n v -= 1\n to[u][v] = (a, b)\n to[v][u] = (a, b)\n info = tuple(tuple(map(int, input().split())) for _ in range(N))\n MAX_SILVER = 50 * (N - 1)\n INF = 10**18\n\n visited = [[False] * (MAX_SILVER + 1) for _ in range(N)]\n cost = [[INF] * (MAX_SILVER + 1) for _ in range(N)]\n q = []\n S = min(S, MAX_SILVER)\n heappush(q, (0, 0, S))\n while q:\n t, now, s = heappop(q)\n if visited[now][s]:\n continue\n visited[now][s] = True\n cost[now][s] = t\n\n for nv, (a, b) in list(to[now].items()):\n nt = t + b\n rest = s - a\n if rest >= 0:\n if cost[nv][rest] <= nt:\n continue\n heappush(q, (nt, nv, rest))\n\n rate, time = info[now]\n nt = t + time\n ns = min(s + rate, MAX_SILVER)\n heappush(q, (nt, now, ns))\n for i in range(1, N):\n print((min(cost[i])))\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "e69dd2401cca04a6dde89a0cc59e0dcc02ccaf633182fe544b7863e3073adfa3", "fast_id": "p02703_379a4c1de4a9c109be72d7339673b53f08eed339f0c694afe1877bc501dc7d81", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from heapq import heappop, heappush\nimport sys\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef main():\n N, M, S = list(map(int, input().split()))\n to = [{} for _ in range(N)]\n for _ in range(M):\n u, v, a, b = list(map(int, input().split()))\n u -= 1\n v -= 1\n to[u][v] = (a, b)\n to[v][u] = (a, b)\n info = tuple(tuple(map(int, input().split())) for _ in range(N))\n MAX_SILVER = 50 * (N - 1)\n INF = 10**18\n # dijkstra (time, vertex, money)\n visited = [[False] * (MAX_SILVER + 1) for _ in range(N)]\n cost = [[INF] * (MAX_SILVER + 1) for _ in range(N)]\n q = []\n S = min(S, MAX_SILVER)\n heappush(q, (0, 0, S)) # (time, vertex, silver)\n while q:\n t, now, s = heappop(q)\n if visited[now][s]:\n continue\n visited[now][s] = True\n cost[now][s] = t\n # next node\n for nv, (a, b) in list(to[now].items()):\n nt = t + b\n rest = s - a\n if rest >= 0:\n if cost[nv][rest] <= nt:\n continue\n heappush(q, (nt, nv, rest))\n # exchange gold with silver\n rate, time = info[now]\n nt = t + time\n ns = min(s + rate, MAX_SILVER)\n heappush(q, (nt, now, ns))\n for i in range(1, N):\n print((min(cost[i])))\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "379a4c1de4a9c109be72d7339673b53f08eed339f0c694afe1877bc501dc7d81", "measured_slow_code": "import sys\nfrom heapq import heappush, heappop\nimport numpy as np\n\n\ndef input():\n return sys.stdin.readline().rstrip()\n\n\ndef ii():\n return int(input())\n\n\ndef mi():\n return map(int, input().split())\n\n\ndef li():\n return list(mi())\n\n\ndef main():\n def dijkstra(s):\n def push(v, s, x):\n if s < 0:\n return\n if dist[v, s] <= x:\n return\n dist[v, s] = x\n heappush(que, (x, v, s))\n\n inf = 10**18\n dist = np.full((n, MAX_S + 1), inf, dtype=int)\n # time, remain, node\n que = []\n push(0, s, 0)\n while que:\n x, v, s = heappop(que)\n if dist[v, s] < x:\n continue\n ns = min(s + c[v], MAX_S)\n push(v, ns, x + d[v])\n for nv, a, b in adj[v]:\n push(nv, s - a, x + b)\n return np.min(dist, axis=1)\n\n n, m, s = mi()\n adj = [[] for i in range(n)]\n MAX_S = 0\n for i in range(m):\n u, v, a, b = mi()\n u -= 1\n v -= 1\n adj[u].append((v, a, b))\n adj[v].append((u, a, b))\n MAX_S = max(MAX_S, a)\n MAX_S *= n - 1\n s = min(s, MAX_S)\n c, d = [0] * n, [0] * n\n for i in range(n):\n c[i], d[i] = mi()\n ans = dijkstra(s)\n print(*ans[1:], sep=\"\\n\")\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "13ddc35e7eb74d73b0b3c8f42eca38b92bc94e091a7090e12213a091ef6feb16", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.1886371912676084, "pair_id": "python_v2_d3c92685aae4a550856f2927", "per_case_slow_code_faster_fraction": 0.09, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02703", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02703_379a4c1de4a9c109be72d7339673b53f08eed339f0c694afe1877bc501dc7d81.jsonl.gz", "inputs": "reproduction/python/inputs/p02703.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02703_13ddc35e7eb74d73b0b3c8f42eca38b92bc94e091a7090e12213a091ef6feb16.jsonl.gz"}, "slow_code": "import sys\nfrom heapq import heappush, heappop\nimport numpy as np\n\n\ndef input():\n return sys.stdin.readline().rstrip()\n\n\ndef ii():\n return int(input())\n\n\ndef mi():\n return map(int, input().split())\n\n\ndef li():\n return list(mi())\n\n\ndef main():\n def dijkstra(s):\n def push(v, s, x):\n if s < 0:\n return\n if dist[v, s] <= x:\n return\n dist[v, s] = x\n heappush(que, (x, v, s))\n\n inf = 10**18\n dist = np.full((n, MAX_S + 1), inf, dtype=int)\n\n que = []\n push(0, s, 0)\n while que:\n x, v, s = heappop(que)\n if dist[v, s] < x:\n continue\n ns = min(s + c[v], MAX_S)\n push(v, ns, x + d[v])\n for nv, a, b in adj[v]:\n push(nv, s - a, x + b)\n return np.min(dist, axis=1)\n\n n, m, s = mi()\n adj = [[] for i in range(n)]\n MAX_S = 0\n for i in range(m):\n u, v, a, b = mi()\n u -= 1\n v -= 1\n adj[u].append((v, a, b))\n adj[v].append((u, a, b))\n MAX_S = max(MAX_S, a)\n MAX_S *= n - 1\n s = min(s, MAX_S)\n c, d = [0] * n, [0] * n\n for i in range(n):\n c[i], d[i] = mi()\n ans = dijkstra(s)\n print(*ans[1:], sep=\"\\n\")\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "8367a3613f4d9a1208ac0ab45c2708eb9c7ae580813c618185432ad6e30b1042", "slow_id": "p02703_13ddc35e7eb74d73b0b3c8f42eca38b92bc94e091a7090e12213a091ef6feb16", "speedup": 3.1080924315644824, "stratum": "2-4", "within_pair_jaccard": 0.4367816091954023, "workload": {"case_count": 100, "description": "Find minimum travel time from city 1 to every other city in a connected undirected graph. Start with S silver and 10^100 gold coins. Edge i costs A_i silver and B_i minutes; in city i, each gold exchanges for C_i silver in D_i minutes. Observed inputs: N=2..50 (median 50); M=1..100 (median 100); S=0..1000000000 (median 0); A_i=1..50; B_i=1..1000000000; C_i=1..1000000000; D_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 2839, "median": 1347.5, "min": 31}, "input_format": ["N M S\nU_1 V_1 A_1 B_1\n...\nU_M V_M A_M B_M\nC_1 D_1\n...\nC_N D_N"], "input_format_status": "source_input_section", "input_lines": {"max": 151, "median": 151.0, "min": 4}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 503, "median": 503.0, "min": 11}}} -{"case_ids": ["p02669_case_000", "p02669_case_001", "p02669_case_002", "p02669_case_003", "p02669_case_004", "p02669_case_005", "p02669_case_006", "p02669_case_007", "p02669_case_008", "p02669_case_009", "p02669_case_010", "p02669_case_011", "p02669_case_012", "p02669_case_013", "p02669_case_014", "p02669_case_015", "p02669_case_016", "p02669_case_017", "p02669_case_018", "p02669_case_019", "p02669_case_020", "p02669_case_021", "p02669_case_022", "p02669_case_023", "p02669_case_024", "p02669_case_025", "p02669_case_026", "p02669_case_027", "p02669_case_028", "p02669_case_029", "p02669_case_030", "p02669_case_031", "p02669_case_032", "p02669_case_033", "p02669_case_034", "p02669_case_035", "p02669_case_036", "p02669_case_037", "p02669_case_038", "p02669_case_039", "p02669_case_040", "p02669_case_041", "p02669_case_042", "p02669_case_043", "p02669_case_044", "p02669_case_045", "p02669_case_046", "p02669_case_047", "p02669_case_048", "p02669_case_049", "p02669_case_050", "p02669_case_051", "p02669_case_052", "p02669_case_054", "p02669_case_055", "p02669_case_056", "p02669_case_057", "p02669_case_058", "p02669_case_059", "p02669_case_060", "p02669_case_061", "p02669_case_062", "p02669_case_063", "p02669_case_064", "p02669_case_065", "p02669_case_066", "p02669_case_067", "p02669_case_068", "p02669_case_069", "p02669_case_070", "p02669_case_071", "p02669_case_072", "p02669_case_073", "p02669_case_074", "p02669_case_075", "p02669_case_076", "p02669_case_077", "p02669_case_078", "p02669_case_080", "p02669_case_081", "p02669_case_082", "p02669_case_083", "p02669_case_084", "p02669_case_085", "p02669_case_086", "p02669_case_087", "p02669_case_088", "p02669_case_089", "p02669_case_090", "p02669_case_091", "p02669_case_092", "p02669_case_093", "p02669_case_094", "p02669_case_095", "p02669_case_096", "p02669_case_097", "p02669_case_098", "p02669_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 98, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "t = int(eval(input()))\n\n\ndef calc(x):\n if x not in dp:\n divs = [5, 3, 2]\n costs = [c, b, a]\n values = lambda div, cost: [\n calc(x // div) + cost + x % div * d,\n calc((x + div - 1) // div) + cost + (-x) % div * d,\n ]\n dp[x] = min(\n x * d,\n *[value for div, cost in zip(divs, costs) for value in values(div, cost)]\n )\n return dp[x]\n\n\nfor _ in range(t):\n n, a, b, c, d = list(map(int, input().split()))\n dp = {0: 0, 1: d}\n print((calc(n)))\n", "fast_code_sha256": "18c18135db2503f2edca924f4277d57f3bd3bdba8bbc33c1bb2bc48452d7159a", "fast_id": "p02669_18c18135db2503f2edca924f4277d57f3bd3bdba8bbc33c1bb2bc48452d7159a", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "t = int(eval(input()))\n\n\ndef calc(x):\n if x not in dp:\n divs = [5, 3, 2]\n costs = [c, b, a]\n values = lambda div, cost: [\n calc(x // div) + cost + x % div * d,\n calc((x + div - 1) // div) + cost + (-x) % div * d,\n ]\n dp[x] = min(\n x * d,\n *[value for div, cost in zip(divs, costs) for value in values(div, cost)]\n )\n return dp[x]\n\n\nfor _ in range(t):\n n, a, b, c, d = list(map(int, input().split()))\n dp = {0: 0, 1: d}\n print((calc(n)))\n", "measured_fast_code_sha256": "18c18135db2503f2edca924f4277d57f3bd3bdba8bbc33c1bb2bc48452d7159a", "measured_slow_code": "import sys\n\ndivs = [2, 3, 5]\nt = int(eval(input()))\nfor _ in range(t):\n n, a, b, c, d = list(map(int, input().split()))\n costs = [a, b, c]\n dp = {}\n\n def dfs(x):\n if x in dp:\n return dp[x]\n # print(x, file=sys.stderr)\n if x == 0:\n dp[x] = 0\n return dp[x]\n ret = x * d\n for i in range(-4, 5):\n if x - i < 0:\n continue\n nx = x - i\n for cost, div in zip(costs, divs):\n if nx % div != 0 or nx // div >= x:\n continue\n ret = min(ret, dfs(nx // div) + cost + abs(i) * d)\n dp[x] = ret\n return ret\n\n print((dfs(n)))\n", "measured_slow_code_sha256": "5dc16e69171829fb825a4382d7ae818d1f78cf50ef12255ba28fcf6c6591e0e1", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 7.577368338902865, "pair_id": "python_v2_63cc7513e2b47aa54cd439bf", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02669", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02669_18c18135db2503f2edca924f4277d57f3bd3bdba8bbc33c1bb2bc48452d7159a.jsonl.gz", "inputs": "reproduction/python/inputs/p02669.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02669_5dc16e69171829fb825a4382d7ae818d1f78cf50ef12255ba28fcf6c6591e0e1.jsonl.gz"}, "slow_code": "import sys\n\ndivs = [2, 3, 5]\nt = int(eval(input()))\nfor _ in range(t):\n n, a, b, c, d = list(map(int, input().split()))\n costs = [a, b, c]\n dp = {}\n\n def dfs(x):\n if x in dp:\n return dp[x]\n\n if x == 0:\n dp[x] = 0\n return dp[x]\n ret = x * d\n for i in range(-4, 5):\n if x - i < 0:\n continue\n nx = x - i\n for cost, div in zip(costs, divs):\n if nx % div != 0 or nx // div >= x:\n continue\n ret = min(ret, dfs(nx // div) + cost + abs(i) * d)\n dp[x] = ret\n return ret\n\n print((dfs(n)))\n", "slow_code_sha256": "ca3505b4e5755f2e5a6dda25d2ba0ee1f8926fae7d5ee6e43c499cad98b2e89b", "slow_id": "p02669_5dc16e69171829fb825a4382d7ae818d1f78cf50ef12255ba28fcf6c6591e0e1", "speedup": 5.070286747399016, "stratum": "4-8", "within_pair_jaccard": 0.6808510638297872, "workload": {"case_count": 98, "description": "For each of T cases, find the minimum cost to change 0 into N. Multiplication by 2, 3 or 5 costs A, B or C respectively; increasing or decreasing by 1 costs D. Operations may be repeated in any order. Observed inputs: T=1..10 (median 1); N=1..999999995042541824; A=1..1000000000; B=1..1000000000; C=1..1000000000; D=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 98, "input_bytes": {"max": 592, "median": 43.5, "min": 12}, "input_format": ["T\nN_1 A_1 B_1 C_1 D_1\n...\nN_T A_T B_T C_T D_T"], "input_format_status": "source_input_section", "input_lines": {"max": 11, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 51, "median": 6.0, "min": 6}}} -{"case_ids": ["p03472_case_000", "p03472_case_001", "p03472_case_002", "p03472_case_003", "p03472_case_004", "p03472_case_005", "p03472_case_006", "p03472_case_007", "p03472_case_008", "p03472_case_009", "p03472_case_010", "p03472_case_011", "p03472_case_012", "p03472_case_013", "p03472_case_014", "p03472_case_015", "p03472_case_016", "p03472_case_017", "p03472_case_018", "p03472_case_019", "p03472_case_020", "p03472_case_021", "p03472_case_022", "p03472_case_023", "p03472_case_024", "p03472_case_025", "p03472_case_026", "p03472_case_027", "p03472_case_028", "p03472_case_029", "p03472_case_030", "p03472_case_031", "p03472_case_032", "p03472_case_033", "p03472_case_034", "p03472_case_035", "p03472_case_036", "p03472_case_037", "p03472_case_038", "p03472_case_039", "p03472_case_040", "p03472_case_041", "p03472_case_042", "p03472_case_043", "p03472_case_044", "p03472_case_045", "p03472_case_046", "p03472_case_047", "p03472_case_048", "p03472_case_049", "p03472_case_050", "p03472_case_051", "p03472_case_052", "p03472_case_053", "p03472_case_054", "p03472_case_055", "p03472_case_056", "p03472_case_057", "p03472_case_058", "p03472_case_059", "p03472_case_060", "p03472_case_061", "p03472_case_062", "p03472_case_063", "p03472_case_064", "p03472_case_065", "p03472_case_066", "p03472_case_068", "p03472_case_069", "p03472_case_070", "p03472_case_071", "p03472_case_072", "p03472_case_073", "p03472_case_075", "p03472_case_076", "p03472_case_077", "p03472_case_078", "p03472_case_079", "p03472_case_080", "p03472_case_081", "p03472_case_082", "p03472_case_083", "p03472_case_084", "p03472_case_085", "p03472_case_086", "p03472_case_087", "p03472_case_088", "p03472_case_089", "p03472_case_090", "p03472_case_091", "p03472_case_092", "p03472_case_093", "p03472_case_094", "p03472_case_095", "p03472_case_096", "p03472_case_097", "p03472_case_098", "p03472_case_099", "p03472_v2_152723b81f3e452934a4", "p03472_v2_8069c44687919d0f2aed"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n, h, *t = list(map(int, open(0).read().split()))\nb = sorted(t[1::2])\na = max(t[::2])\nc = 0\nwhile h > 0 and b and b[-1] > a:\n h -= b.pop()\n c += 1\nif h > 0:\n c -= -h // a\nprint(c)\n", "fast_code_sha256": "02952b5343791f7e9cbf755ebc67676afbd1a59fb0391b64459cf3edf5653a17", "fast_id": "p03472_02952b5343791f7e9cbf755ebc67676afbd1a59fb0391b64459cf3edf5653a17", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n, h, *t = list(map(int, open(0).read().split()))\nb = sorted(t[1::2])\na = max(t[::2])\nc = 0\nwhile h > 0 and b and b[-1] > a:\n h -= b.pop()\n c += 1\nif h > 0:\n c -= -h // a\nprint(c)\n", "measured_fast_code_sha256": "02952b5343791f7e9cbf755ebc67676afbd1a59fb0391b64459cf3edf5653a17", "measured_slow_code": "#!/usr/bin/env python3\n# coding=utf-8\nimport sys\nimport math\nimport numpy as np\n\nn, h = list(map(int, sys.stdin.readline().strip().split(\" \")))\na = []\nb = []\nfor _ in range(n):\n _a, _b = list(map(int, sys.stdin.readline().strip().split(\" \")))\n a.append(_a)\n b.append(_b)\nmax_a = max(a)\ncnt = 0\nb = np.asarray(sorted(b))\nb = b[b > max_a]\nwhile h > 0 and len(b) > 0:\n cnt += 1\n h -= b[-1]\n b = b[:-1]\nif h > 0:\n cnt += math.ceil(h / max_a)\nprint(cnt)\n", "measured_slow_code_sha256": "0789ae9ad831ab5813576bdfc89180cd38032d647a484b2243690be0a9591bf1", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 107.85771743180453, "pair_id": "python_v2_fae4ddc59f5643e48168d08d", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03472", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03472_02952b5343791f7e9cbf755ebc67676afbd1a59fb0391b64459cf3edf5653a17.jsonl.gz", "inputs": "reproduction/python/inputs/p03472.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03472_0789ae9ad831ab5813576bdfc89180cd38032d647a484b2243690be0a9591bf1.jsonl.gz"}, "slow_code": "import sys\nimport math\nimport numpy as np\n\nn, h = list(map(int, sys.stdin.readline().strip().split(\" \")))\na = []\nb = []\nfor _ in range(n):\n _a, _b = list(map(int, sys.stdin.readline().strip().split(\" \")))\n a.append(_a)\n b.append(_b)\nmax_a = max(a)\ncnt = 0\nb = np.asarray(sorted(b))\nb = b[b > max_a]\nwhile h > 0 and len(b) > 0:\n cnt += 1\n h -= b[-1]\n b = b[:-1]\nif h > 0:\n cnt += math.ceil(h / max_a)\nprint(cnt)\n", "slow_code_sha256": "58ca7d2969e78880fa1ce15e0d4bb73469edf3592d83f87bf58a9e602bb788dc", "slow_id": "p03472_0789ae9ad831ab5813576bdfc89180cd38032d647a484b2243690be0a9591bf1", "speedup": 52.281151685858305, "stratum": "8+", "within_pair_jaccard": 0.37209302325581395, "workload": {"case_count": 100, "description": "Defeat health H using N swords. Wield sword i repeatedly for a_i damage, or throw it once for b_i damage and lose it permanently. Each attack counts once; a_i<=b_i. Minimize attacks to deal at least H total damage. Observed inputs: N=1..100000 (median 1000); H=1..1000000000 (median 500000000); a_i=1..1000000000; b_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 2200018, "median": 19446.5, "min": 8}, "input_format": ["N H\na_1 b_1\n...\na_N b_N"], "input_format_status": "source_input_section", "input_lines": {"max": 100001, "median": 1001.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200002, "median": 2002.0, "min": 4}}} -{"case_ids": ["p03160_case_000", "p03160_case_001", "p03160_case_002", "p03160_case_003", "p03160_case_004", "p03160_case_005", "p03160_case_006", "p03160_case_007", "p03160_case_008", "p03160_case_009", "p03160_case_010", "p03160_case_011", "p03160_case_012", "p03160_case_013", "p03160_case_014", "p03160_case_015", "p03160_case_016", "p03160_case_017", "p03160_case_018", "p03160_case_019", "p03160_case_020", "p03160_case_021", "p03160_case_022", "p03160_case_023", "p03160_case_024", "p03160_case_025", "p03160_case_026", "p03160_case_027", "p03160_case_028", "p03160_case_029", "p03160_case_030", "p03160_case_031", "p03160_case_032", "p03160_case_033", "p03160_case_034", "p03160_case_035", "p03160_case_036", "p03160_case_037", "p03160_case_038", "p03160_case_039", "p03160_case_040", "p03160_case_041", "p03160_case_042", "p03160_case_043", "p03160_case_044", "p03160_case_045", "p03160_case_046", "p03160_case_047", "p03160_case_048", "p03160_case_049", "p03160_case_050", "p03160_case_051", "p03160_case_052", "p03160_case_053", "p03160_case_054", "p03160_case_055", "p03160_case_056", "p03160_case_057", "p03160_case_058", "p03160_case_059", "p03160_case_060", "p03160_case_061", "p03160_case_062", "p03160_case_063", "p03160_case_064", "p03160_case_065", "p03160_case_066", "p03160_case_067", "p03160_case_068", "p03160_case_069", "p03160_case_070", "p03160_case_071", "p03160_case_072", "p03160_case_073", "p03160_case_074", "p03160_case_075", "p03160_case_076", "p03160_case_077", "p03160_case_078", "p03160_case_079", "p03160_case_080", "p03160_case_081", "p03160_case_082", "p03160_case_083", "p03160_case_084", "p03160_case_085", "p03160_case_086", "p03160_case_087", "p03160_case_088", "p03160_case_089", "p03160_case_090", "p03160_case_091", "p03160_case_092", "p03160_case_093", "p03160_case_094", "p03160_case_095", "p03160_case_096", "p03160_case_097", "p03160_case_098", "p03160_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "executable_AST_equal_except_explicit_explanatory_string_removal_and_all_frozen_inputs_checker_pass", "fast_code": "def main():\n n = int(eval(input()))\n A = tuple(map(int, input().split()))\n x, y = 0, abs(A[1] - A[0])\n for i in range(2, n):\n dif1 = x + abs(A[i] - A[i - 2])\n dif2 = y + abs(A[i] - A[i - 1])\n x = y\n y = dif1 if dif1 <= dif2 else dif2\n print(y)\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "b1d4ca44d471cc0663c3729a8a82c7bacf4191740b09cce08fe8c313887dc71c", "fast_id": "p03160_e2eeece981d6ed2a05961cbe8cb29c863773b6e30257c7bb82d36e26974465a8", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "# dpA - Frog 1\n\"\"\"\nExample:\nx y\n x y\n x y ...\n x y (y: answer)\n\"\"\"\n\n\ndef main():\n n = int(eval(input()))\n A = tuple(map(int, input().split()))\n x, y = 0, abs(A[1] - A[0])\n for i in range(2, n):\n dif1 = x + abs(A[i] - A[i - 2])\n dif2 = y + abs(A[i] - A[i - 1])\n x = y\n y = dif1 if dif1 <= dif2 else dif2\n print(y)\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "e2eeece981d6ed2a05961cbe8cb29c863773b6e30257c7bb82d36e26974465a8", "measured_slow_code": "#!/usr/bin/env python\nimport string\nimport sys\nfrom itertools import chain, dropwhile, takewhile\n\n\ndef read(\n f, *shape, it=chain.from_iterable(sys.stdin), whitespaces=set(string.whitespace)\n):\n def read_word():\n w = lambda c: c in whitespaces\n nw = lambda c: c not in whitespaces\n return f(\"\".join(takewhile(nw, dropwhile(w, it))))\n\n if not shape:\n return read_word()\n elif len(shape) == 1:\n return [read_word() for _ in range(shape[0])]\n elif len(shape) == 2:\n return [[read_word() for _ in range(shape[1])] for _ in range(shape[0])]\n\n\ndef arr(*shape, fill_value=0):\n if len(shape) == 1:\n return [fill_value] * shape[fill_value]\n elif len(shape) == 2:\n return [[fill_value] * shape[1] for _ in range(shape[0])]\n\n\ndef dbg(**kwargs):\n print(\n \", \".join(\"{} = {}\".format(k, repr(v)) for k, v in kwargs.items()),\n file=sys.stderr,\n )\n\n\ndef main():\n n = read(int)\n hs = read(int, n)\n dp = arr(n)\n dp[1] = abs(hs[1] - hs[0])\n for i in range(2, n):\n dp[i] = min(\n dp[i - 1] + abs(hs[i] - hs[i - 1]), dp[i - 2] + abs(hs[i] - hs[i - 2])\n )\n print(dp[-1])\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "7f209d5d7b0d2bc72ab55ef9c34db57933ddfc0a346f408e2afc1f88416cf97f", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.940326700690001, "pair_id": "python_v2_5e228e18408ff23f96a881c8", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03160", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03160_e2eeece981d6ed2a05961cbe8cb29c863773b6e30257c7bb82d36e26974465a8.jsonl.gz", "inputs": "reproduction/python/inputs/p03160.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03160_7f209d5d7b0d2bc72ab55ef9c34db57933ddfc0a346f408e2afc1f88416cf97f.jsonl.gz"}, "slow_code": "import string\nimport sys\nfrom itertools import chain, dropwhile, takewhile\n\n\ndef read(\n f, *shape, it=chain.from_iterable(sys.stdin), whitespaces=set(string.whitespace)\n):\n def read_word():\n w = lambda c: c in whitespaces\n nw = lambda c: c not in whitespaces\n return f(\"\".join(takewhile(nw, dropwhile(w, it))))\n\n if not shape:\n return read_word()\n elif len(shape) == 1:\n return [read_word() for _ in range(shape[0])]\n elif len(shape) == 2:\n return [[read_word() for _ in range(shape[1])] for _ in range(shape[0])]\n\n\ndef arr(*shape, fill_value=0):\n if len(shape) == 1:\n return [fill_value] * shape[fill_value]\n elif len(shape) == 2:\n return [[fill_value] * shape[1] for _ in range(shape[0])]\n\n\ndef dbg(**kwargs):\n print(\n \", \".join(\"{} = {}\".format(k, repr(v)) for k, v in kwargs.items()),\n file=sys.stderr,\n )\n\n\ndef main():\n n = read(int)\n hs = read(int, n)\n dp = arr(n)\n dp[1] = abs(hs[1] - hs[0])\n for i in range(2, n):\n dp[i] = min(\n dp[i - 1] + abs(hs[i] - hs[i - 1]), dp[i - 2] + abs(hs[i] - hs[i - 2])\n )\n print(dp[-1])\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "54f397f881a6ae2f88872fe4373ebc15e4056c4fdf6ac63236a75aa3443cd3c5", "slow_id": "p03160_7f209d5d7b0d2bc72ab55ef9c34db57933ddfc0a346f408e2afc1f88416cf97f", "speedup": 5.3026988446628165, "stratum": "4-8", "within_pair_jaccard": 0.22535211267605634, "workload": {"case_count": 100, "description": "A frog starts at stone 1 and jumps ahead by 1 or 2 stones. A jump from i to j costs |h_i-h_j|. Find the minimum total cost to reach stone N. Observed inputs: N=2..100000 (median 1000); h_i=1..10000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 600007, "median": 4888.5, "min": 6}, "input_format": ["N\nh_1 ... h_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100001, "median": 1001.0, "min": 3}}} -{"case_ids": ["p03698_case_000", "p03698_case_001", "p03698_case_002", "p03698_case_003", "p03698_case_004", "p03698_case_005", "p03698_case_006", "p03698_case_007", "p03698_case_008", "p03698_case_009", "p03698_case_010", "p03698_case_011", "p03698_case_012", "p03698_case_013", "p03698_case_014", "p03698_case_015", "p03698_case_016", "p03698_case_017", "p03698_case_018", "p03698_case_019", "p03698_case_020", "p03698_case_021", "p03698_case_022", "p03698_case_023", "p03698_case_024", "p03698_case_025", "p03698_case_026", "p03698_case_027", "p03698_case_028", "p03698_case_029", "p03698_case_030", "p03698_case_031", "p03698_case_032", "p03698_case_033", "p03698_case_034", "p03698_case_035", "p03698_case_036", "p03698_case_037", "p03698_case_038", "p03698_case_039", "p03698_case_040", "p03698_case_041", "p03698_case_042", "p03698_case_043", "p03698_case_044", "p03698_case_045", "p03698_case_046", "p03698_case_047", "p03698_case_048", "p03698_case_049", "p03698_case_050", "p03698_case_051", "p03698_case_052", "p03698_case_053", "p03698_case_054", "p03698_case_055", "p03698_case_056", "p03698_case_057", "p03698_case_058", "p03698_case_059", "p03698_case_060", "p03698_case_061", "p03698_case_062", "p03698_case_063", "p03698_case_064", "p03698_case_065", "p03698_case_066", "p03698_case_067", "p03698_case_068", "p03698_case_069", "p03698_case_070", "p03698_case_071", "p03698_case_072", "p03698_case_073", "p03698_case_074", "p03698_case_075", "p03698_case_076", "p03698_case_077", "p03698_case_078", "p03698_case_079", "p03698_case_080", "p03698_case_081", "p03698_case_082", "p03698_case_083", "p03698_case_084", "p03698_case_085", "p03698_case_086", "p03698_case_087", "p03698_case_088", "p03698_case_089", "p03698_case_090", "p03698_case_091", "p03698_case_092", "p03698_case_093", "p03698_case_094", "p03698_case_095", "p03698_case_096", "p03698_case_097", "p03698_case_098", "p03698_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "a = list(input())\nb = set(a)\nprint(\"yes\") if (len(a) == len(b)) else print(\"no\")\n", "fast_code_sha256": "e5b2e399a03a3f8e8d296f2c196051328bc34d20b308d0640a69b1e958432119", "fast_id": "p03698_e5b2e399a03a3f8e8d296f2c196051328bc34d20b308d0640a69b1e958432119", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "a = list(input())\nb = set(a)\nprint(\"yes\") if (len(a) == len(b)) else print(\"no\")\n", "measured_fast_code_sha256": "e5b2e399a03a3f8e8d296f2c196051328bc34d20b308d0640a69b1e958432119", "measured_slow_code": "# Author: cr4zjh0bp\n# Created: Sun Mar 22 23:25:40 UTC 2020\nimport sys\n\nstdin = sys.stdin\ninf = 1 << 60\nmod = 1000000007\nni = lambda: int(ns())\nnin = lambda y: [ni() for _ in range(y)]\nna = lambda: list(map(int, stdin.readline().split()))\nnan = lambda y: [na() for _ in range(y)]\nnf = lambda: float(ns())\nnfn = lambda y: [nf() for _ in range(y)]\nnfa = lambda: list(map(float, stdin.readline().split()))\nnfan = lambda y: [nfa() for _ in range(y)]\nns = lambda: stdin.readline().rstrip()\nnsn = lambda y: [ns() for _ in range(y)]\nncl = lambda y: [list(ns()) for _ in range(y)]\nnas = lambda: stdin.readline().split()\ns = ns()\nprint((\"yes\" if len(s) == len(set(s)) else \"no\"))\n", "measured_slow_code_sha256": "a376ffe929edf06b724e30b2a2aa18092b8bf70564466dfec6fa169764c5e067", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 6.97380834982181, "pair_id": "python_v2_3f4e7e3e20e3ab10e022b296", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03698", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03698_e5b2e399a03a3f8e8d296f2c196051328bc34d20b308d0640a69b1e958432119.jsonl.gz", "inputs": "reproduction/python/inputs/p03698.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03698_a376ffe929edf06b724e30b2a2aa18092b8bf70564466dfec6fa169764c5e067.jsonl.gz"}, "slow_code": "import sys\n\nstdin = sys.stdin\ninf = 1 << 60\nmod = 1000000007\nni = lambda: int(ns())\nnin = lambda y: [ni() for _ in range(y)]\nna = lambda: list(map(int, stdin.readline().split()))\nnan = lambda y: [na() for _ in range(y)]\nnf = lambda: float(ns())\nnfn = lambda y: [nf() for _ in range(y)]\nnfa = lambda: list(map(float, stdin.readline().split()))\nnfan = lambda y: [nfa() for _ in range(y)]\nns = lambda: stdin.readline().rstrip()\nnsn = lambda y: [ns() for _ in range(y)]\nncl = lambda y: [list(ns()) for _ in range(y)]\nnas = lambda: stdin.readline().split()\ns = ns()\nprint((\"yes\" if len(s) == len(set(s)) else \"no\"))\n", "slow_code_sha256": "03a45d604c638a812e6d78b441dcfe3d80c575bed1318c5bae6f1933757136b9", "slow_id": "p03698_a376ffe929edf06b724e30b2a2aa18092b8bf70564466dfec6fa169764c5e067", "speedup": 6.957312599648917, "stratum": "4-8", "within_pair_jaccard": 0.18181818181818182, "workload": {"case_count": 100, "description": "Determine whether all characters in the supplied lowercase string S are pairwise different. Observed inputs: input_length=2..26 (median 10).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 27, "median": 11.0, "min": 3}, "input_format": ["S"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p02817_case_000", "p02817_case_001", "p02817_case_002", "p02817_case_003", "p02817_case_004", "p02817_case_005", "p02817_case_006", "p02817_case_007", "p02817_case_008", "p02817_case_009", "p02817_case_010", "p02817_case_011", "p02817_case_012", "p02817_case_013", "p02817_case_014", "p02817_case_015", "p02817_case_016", "p02817_case_017", "p02817_case_018", "p02817_case_019", "p02817_case_020", "p02817_case_021", "p02817_case_022", "p02817_case_023", "p02817_case_024", "p02817_case_025", "p02817_case_026", "p02817_case_027", "p02817_case_028", "p02817_case_029", "p02817_case_030", "p02817_case_031", "p02817_case_032", "p02817_case_033", "p02817_case_034", "p02817_case_035", "p02817_case_036", "p02817_case_037", "p02817_case_038", "p02817_case_039", "p02817_case_040", "p02817_case_041", "p02817_case_042", "p02817_case_043", "p02817_case_044", "p02817_case_045", "p02817_case_046", "p02817_case_047", "p02817_case_048", "p02817_case_049", "p02817_case_050", "p02817_case_051", "p02817_case_052", "p02817_case_053", "p02817_case_054", "p02817_case_055", "p02817_case_056", "p02817_case_057", "p02817_case_058", "p02817_case_059", "p02817_case_060", "p02817_case_061", "p02817_case_062", "p02817_case_063", "p02817_case_064", "p02817_case_065", "p02817_case_066", "p02817_case_067", "p02817_case_068", "p02817_case_069", "p02817_case_070", "p02817_case_071", "p02817_case_072", "p02817_case_073", "p02817_case_074", "p02817_case_075", "p02817_case_076", "p02817_case_077", "p02817_case_078", "p02817_case_079", "p02817_case_080", "p02817_case_081", "p02817_case_082", "p02817_case_083", "p02817_case_084", "p02817_case_085", "p02817_case_086", "p02817_case_087", "p02817_case_088", "p02817_case_089", "p02817_case_090", "p02817_case_091", "p02817_case_092", "p02817_case_093", "p02817_case_094", "p02817_case_095", "p02817_case_096", "p02817_case_097", "p02817_case_098", "p02817_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "S = list(input().split())\na = S[1] + S[0]\nprint(a)\n", "fast_code_sha256": "fd9e83fdfd4de907b804096b04de5edad0bd647fba7b121d75e6c0627bd86b79", "fast_id": "p02817_fd9e83fdfd4de907b804096b04de5edad0bd647fba7b121d75e6c0627bd86b79", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "S = list(input().split())\na = S[1] + S[0]\nprint(a)\n", "measured_fast_code_sha256": "fd9e83fdfd4de907b804096b04de5edad0bd647fba7b121d75e6c0627bd86b79", "measured_slow_code": "import sys\n\nS, T = input().split()\nif not (S.islower() and T.islower()):\n sys.exit()\nif not (1 <= len(S) <= 100 and 1 <= len(S) <= 100):\n sys.exit()\nprint(T, end=\"\")\nprint(S)\n", "measured_slow_code_sha256": "d366b3197c2b1cc652bdfaecd153a16660977c2f3b6e7187f2d74bc9cc3d8847", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.168434717391162, "pair_id": "python_v2_28a7ab8a7251ac1a7d87ff0f", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02817", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02817_fd9e83fdfd4de907b804096b04de5edad0bd647fba7b121d75e6c0627bd86b79.jsonl.gz", "inputs": "reproduction/python/inputs/p02817.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02817_d366b3197c2b1cc652bdfaecd153a16660977c2f3b6e7187f2d74bc9cc3d8847.jsonl.gz"}, "slow_code": "import sys\n\nS, T = input().split()\nif not (S.islower() and T.islower()):\n sys.exit()\nif not (1 <= len(S) <= 100 and 1 <= len(S) <= 100):\n sys.exit()\nprint(T, end=\"\")\nprint(S)\n", "slow_code_sha256": "d366b3197c2b1cc652bdfaecd153a16660977c2f3b6e7187f2d74bc9cc3d8847", "slow_id": "p02817_d366b3197c2b1cc652bdfaecd153a16660977c2f3b6e7187f2d74bc9cc3d8847", "speedup": 2.167277980125643, "stratum": "2-4", "within_pair_jaccard": 0.2631578947368421, "workload": {"case_count": 100, "description": "Given lowercase strings S and T, output their concatenation in the order T then S, with no separating space. Observed inputs: S_length=1..100 (median 50); T_length=1..100 (median 50).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 202, "median": 102.0, "min": 4}, "input_format": ["S T"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p02572_case_000", "p02572_case_001", "p02572_case_002", "p02572_case_003", "p02572_case_004", "p02572_case_005", "p02572_case_006", "p02572_case_007", "p02572_case_008", "p02572_case_009", "p02572_case_010", "p02572_case_011", "p02572_case_012", "p02572_case_013", "p02572_case_014", "p02572_case_015", "p02572_case_016", "p02572_case_017", "p02572_case_018", "p02572_case_019", "p02572_case_020", "p02572_case_021", "p02572_case_022", "p02572_case_023", "p02572_case_024", "p02572_case_025", "p02572_case_026", "p02572_case_027", "p02572_case_028", "p02572_case_029", "p02572_case_030", "p02572_case_031", "p02572_case_032", "p02572_case_033", "p02572_case_034", "p02572_case_035", "p02572_case_036", "p02572_case_037", "p02572_case_038", "p02572_case_039", "p02572_case_040", "p02572_case_041", "p02572_case_042", "p02572_case_043", "p02572_case_044", "p02572_case_045", "p02572_case_046", "p02572_case_047", "p02572_case_048", "p02572_case_049", "p02572_case_050", "p02572_case_051", "p02572_case_052", "p02572_case_053", "p02572_case_054", "p02572_case_055", "p02572_case_056", "p02572_case_057", "p02572_case_058", "p02572_case_059", "p02572_case_060", "p02572_case_061", "p02572_case_062", "p02572_case_063", "p02572_case_064", "p02572_case_065", "p02572_case_066", "p02572_case_067", "p02572_case_068", "p02572_case_069", "p02572_case_070", "p02572_case_071", "p02572_case_072", "p02572_case_073", "p02572_case_074", "p02572_case_075", "p02572_case_076", "p02572_case_077", "p02572_case_078", "p02572_case_079", "p02572_case_080", "p02572_case_081", "p02572_case_082", "p02572_case_083", "p02572_case_084", "p02572_case_085", "p02572_case_086", "p02572_case_087", "p02572_case_088", "p02572_case_089", "p02572_case_090", "p02572_case_091", "p02572_case_092", "p02572_case_093", "p02572_case_094", "p02572_case_095", "p02572_case_096", "p02572_case_097", "p02572_case_098", "p02572_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N = int(eval(input()))\nA = [int(x) for x in input().split()]\npartial_sum = A.copy()\nsum_now = A[N - 1]\nfor j in range(N - 2, -1, -1):\n sum_now = int((sum_now + A[j]) % (10**9 + 7))\n partial_sum[j] = sum_now\nres = 0\nfor i in range(N - 1):\n res = (res + (A[i] * partial_sum[i + 1]) % (10**9 + 7)) % (10**9 + 7)\nprint((int(res)))\n", "fast_code_sha256": "9cb137938948881342dc5efe6ec26da288b1b508cc8c2a22b7679988c47257d8", "fast_id": "p02572_9cb137938948881342dc5efe6ec26da288b1b508cc8c2a22b7679988c47257d8", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N = int(eval(input()))\nA = [int(x) for x in input().split()]\npartial_sum = A.copy()\nsum_now = A[N - 1]\nfor j in range(N - 2, -1, -1):\n sum_now = int((sum_now + A[j]) % (10**9 + 7))\n partial_sum[j] = sum_now\nres = 0\nfor i in range(N - 1):\n res = (res + (A[i] * partial_sum[i + 1]) % (10**9 + 7)) % (10**9 + 7)\nprint((int(res)))\n", "measured_fast_code_sha256": "9cb137938948881342dc5efe6ec26da288b1b508cc8c2a22b7679988c47257d8", "measured_slow_code": "import copy\n\nN = int(eval(input()))\nA = list(map(int, input().split()))\nmod = 10**9 + 7\npartial_sum = copy.deepcopy(A)\nsum_now = A[N - 1]\nfor j in range(N - 2, -1, -1):\n sum_now = int((sum_now + A[j]) % mod)\n partial_sum[j] = sum_now\nres = 0\nfor i in range(N - 1):\n res = (res + (A[i] * partial_sum[i + 1]) % mod) % mod\nprint((int(res)))\n", "measured_slow_code_sha256": "9a9a8c4412436852a66bfa0067b57c544f3aec7f532b2c46c6eaa958a2513451", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.552612991358313, "pair_id": "python_v2_ed4ada67ac5e33859dac31cc", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02572", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02572_9cb137938948881342dc5efe6ec26da288b1b508cc8c2a22b7679988c47257d8.jsonl.gz", "inputs": "reproduction/python/inputs/p02572.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02572_9a9a8c4412436852a66bfa0067b57c544f3aec7f532b2c46c6eaa958a2513451.jsonl.gz"}, "slow_code": "import copy\n\nN = int(eval(input()))\nA = list(map(int, input().split()))\nmod = 10**9 + 7\npartial_sum = copy.deepcopy(A)\nsum_now = A[N - 1]\nfor j in range(N - 2, -1, -1):\n sum_now = int((sum_now + A[j]) % mod)\n partial_sum[j] = sum_now\nres = 0\nfor i in range(N - 1):\n res = (res + (A[i] * partial_sum[i + 1]) % mod) % mod\nprint((int(res)))\n", "slow_code_sha256": "9a9a8c4412436852a66bfa0067b57c544f3aec7f532b2c46c6eaa958a2513451", "slow_id": "p02572_9a9a8c4412436852a66bfa0067b57c544f3aec7f532b2c46c6eaa958a2513451", "speedup": 2.2398967052720176, "stratum": "2-4", "within_pair_jaccard": 0.7857142857142857, "workload": {"case_count": 100, "description": "For an array of N integers, sum a_i*a_j over all index pairs i= e:\n ans += 1\n counter[key] -= e\n e += 1\nprint(ans)\n", "fast_code_sha256": "8a8bdddfe02190fdf8e6428fc6719226bc848180e6fba39f8f49823897ffd42d", "fast_id": "p02660_8a8bdddfe02190fdf8e6428fc6719226bc848180e6fba39f8f49823897ffd42d", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from collections import Counter\n\nN = int(eval(input()))\nn = N\ncounter = Counter()\nwhile n % 2 == 0:\n counter[2] += 1\n n //= 2\np = 3\nwhile p**2 <= N:\n if n % p == 0:\n counter[p] += 1\n n //= p\n else:\n p += 2\nif n != 1:\n counter[N] += 1\nans = 0\nfor key in list(counter.keys()):\n e = 1\n while counter[key] >= e:\n ans += 1\n counter[key] -= e\n e += 1\nprint(ans)\n", "measured_fast_code_sha256": "8a8bdddfe02190fdf8e6428fc6719226bc848180e6fba39f8f49823897ffd42d", "measured_slow_code": "n = int(eval(input()))\na = p = 1\nwhile p < 6**8:\n c = t = 0\n p += 1\n while n % p < 1:\n n //= p\n x = c == t\n t += x\n c += 1 - t * x\n a += x\nprint((a - (n < 2)))\n", "measured_slow_code_sha256": "8301217799053ca8035ba7e5e9be7529b06a7e4ccf5a0cb39174661c0dc1c031", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 85.04073089304998, "pair_id": "python_v2_4e4695a27a7414cb09ba5cc3", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02660", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02660_8a8bdddfe02190fdf8e6428fc6719226bc848180e6fba39f8f49823897ffd42d.jsonl.gz", "inputs": "reproduction/python/inputs/p02660.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02660_8301217799053ca8035ba7e5e9be7529b06a7e4ccf5a0cb39174661c0dc1c031.jsonl.gz"}, "slow_code": "n = int(eval(input()))\na = p = 1\nwhile p < 6**8:\n c = t = 0\n p += 1\n while n % p < 1:\n n //= p\n x = c == t\n t += x\n c += 1 - t * x\n a += x\nprint((a - (n < 2)))\n", "slow_code_sha256": "8301217799053ca8035ba7e5e9be7529b06a7e4ccf5a0cb39174661c0dc1c031", "slow_id": "p02660_8301217799053ca8035ba7e5e9be7529b06a7e4ccf5a0cb39174661c0dc1c031", "speedup": 111.28135687606037, "stratum": "8+", "within_pair_jaccard": 0.3125, "workload": {"case_count": 100, "description": "Starting with integer N, repeatedly divide by a prime power p^e with e>=1 that divides the current value and has never been chosen before. Maximize the number of divisions. Observed inputs: N=1..992540114224 (median 452657355.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 13, "median": 10.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p03860_case_000", "p03860_case_001", "p03860_case_002", "p03860_case_003", "p03860_case_004", "p03860_case_005", "p03860_case_006", "p03860_case_007", "p03860_case_008", "p03860_case_009", "p03860_case_010", "p03860_case_011", "p03860_case_012", "p03860_case_013", "p03860_case_014", "p03860_case_015", "p03860_case_016", "p03860_case_017", "p03860_case_018", "p03860_case_019", "p03860_case_020", "p03860_case_021", "p03860_case_022", "p03860_case_023", "p03860_case_024", "p03860_case_025", "p03860_case_026", "p03860_case_027", "p03860_case_028", "p03860_case_029", "p03860_case_030", "p03860_case_031", "p03860_case_032", "p03860_case_033", "p03860_case_034", "p03860_case_035", "p03860_case_036", "p03860_case_037", "p03860_case_038", "p03860_case_039", "p03860_case_040", "p03860_case_041", "p03860_case_042", "p03860_case_043", "p03860_case_044", "p03860_case_045", "p03860_case_046", "p03860_case_047", "p03860_case_048", "p03860_case_049", "p03860_case_050", "p03860_case_051", "p03860_case_052", "p03860_case_053", "p03860_case_054", "p03860_case_055", "p03860_case_056", "p03860_case_057", "p03860_case_058", "p03860_case_059", "p03860_case_060", "p03860_case_061", "p03860_case_062", "p03860_case_063", "p03860_case_064", "p03860_case_065", "p03860_case_066", "p03860_case_067", "p03860_case_068", "p03860_case_069", "p03860_case_070", "p03860_case_071", "p03860_case_072", "p03860_case_073", "p03860_case_074", "p03860_case_075", "p03860_case_076", "p03860_case_077", "p03860_case_078", "p03860_case_079", "p03860_case_080", "p03860_case_081", "p03860_case_082", "p03860_case_083", "p03860_case_084", "p03860_case_085", "p03860_case_086", "p03860_case_087", "p03860_case_088", "p03860_case_089", "p03860_case_090", "p03860_case_091", "p03860_case_092", "p03860_case_093", "p03860_case_094", "p03860_case_095", "p03860_case_096", "p03860_case_097", "p03860_case_098", "p03860_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "print((\"A\" + input()[8] + \"C\"))\n", "fast_code_sha256": "863c2470b06494c112d6c3fa44195775baeb436d4cf6f6d238bac30e98dbba5a", "fast_id": "p03860_863c2470b06494c112d6c3fa44195775baeb436d4cf6f6d238bac30e98dbba5a", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "print((\"A\" + input()[8] + \"C\"))\n", "measured_fast_code_sha256": "863c2470b06494c112d6c3fa44195775baeb436d4cf6f6d238bac30e98dbba5a", "measured_slow_code": "def main():\n a = [i for i in input().split()]\n print(a[0][0], a[1][0], a[2][0], sep=\"\")\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "16c04da53c87dd70aea34a80cdf31648a18441ddbc2063772c983e2bf082c565", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.4117230457499943, "pair_id": "python_v2_7d42518a3504beab341a904b", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03860", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03860_863c2470b06494c112d6c3fa44195775baeb436d4cf6f6d238bac30e98dbba5a.jsonl.gz", "inputs": "reproduction/python/inputs/p03860.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03860_16c04da53c87dd70aea34a80cdf31648a18441ddbc2063772c983e2bf082c565.jsonl.gz"}, "slow_code": "def main():\n a = [i for i in input().split()]\n print(a[0][0], a[1][0], a[2][0], sep=\"\")\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "16c04da53c87dd70aea34a80cdf31648a18441ddbc2063772c983e2bf082c565", "slow_id": "p03860_16c04da53c87dd70aea34a80cdf31648a18441ddbc2063772c983e2bf082c565", "speedup": 3.407932866611146, "stratum": "2-4", "within_pair_jaccard": 0.10526315789473684, "workload": {"case_count": 100, "description": "Form a three-letter abbreviation from initials of a fixed prefix, title s, and fixed suffix. Prefix/suffix initials are A and C. The title begins with one uppercase letter followed by lowercase letters; both fixed words have 7 letters. Observed inputs: title_length=1..100 (median 50); fixed_word_length=7.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 117, "median": 67.0, "min": 18}, "input_format": ["prefix s suffix"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3, "median": 3.0, "min": 3}}} -{"case_ids": ["p03801_case_000", "p03801_case_001", "p03801_case_002", "p03801_case_003", "p03801_case_004", "p03801_case_005", "p03801_case_006", "p03801_case_007", "p03801_case_008", "p03801_case_009", "p03801_case_010", "p03801_case_011", "p03801_case_012", "p03801_case_013", "p03801_case_014", "p03801_case_015", "p03801_case_016", "p03801_case_017", "p03801_case_018", "p03801_case_019", "p03801_case_020", "p03801_case_021", "p03801_case_022", "p03801_case_023", "p03801_case_024", "p03801_case_025", "p03801_case_026", "p03801_case_027", "p03801_case_028", "p03801_case_029", "p03801_case_030", "p03801_case_031", "p03801_case_032", "p03801_case_033", "p03801_case_034", "p03801_case_035", "p03801_case_036", "p03801_case_037", "p03801_case_038", "p03801_case_039", "p03801_case_040", "p03801_case_041", "p03801_case_042", "p03801_case_043", "p03801_case_044", "p03801_case_045", "p03801_case_046", "p03801_case_047", "p03801_case_048", "p03801_case_049", "p03801_case_050", "p03801_case_051", "p03801_case_052", "p03801_case_053", "p03801_case_054", "p03801_case_055", "p03801_case_056", "p03801_case_057", "p03801_case_058", "p03801_case_059", "p03801_case_060", "p03801_case_061", "p03801_case_062", "p03801_case_063", "p03801_case_064", "p03801_case_065", "p03801_case_066", "p03801_case_067", "p03801_case_068", "p03801_case_069", "p03801_case_070", "p03801_case_071", "p03801_case_072", "p03801_case_073", "p03801_case_074", "p03801_case_075", "p03801_case_076", "p03801_case_077", "p03801_case_078", "p03801_case_079", "p03801_case_080", "p03801_case_081", "p03801_case_082", "p03801_case_083", "p03801_case_084", "p03801_case_085", "p03801_case_086", "p03801_case_087", "p03801_case_088", "p03801_case_089", "p03801_case_090", "p03801_case_091", "p03801_case_092", "p03801_case_093", "p03801_case_094", "p03801_case_095", "p03801_case_096", "p03801_case_097", "p03801_case_098", "p03801_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from operator import itemgetter\nimport sys\n\nN = int(eval(input()))\nA = [int(i) for i in input().split()]\nB = [(A[i], i) for i in range(N)]\nB = sorted(B, key=itemgetter(1))\nB = sorted(B, key=itemgetter(0))\nT = [0] * N\ncos, pt = B.pop()\nfor i in range(1, N):\n cos2, pt2 = B.pop()\n T[pt] += (cos - cos2) * i\n pt = min(pt, pt2)\n cos = cos2\nT[pt] += cos * N\nfor i in T:\n print(i)\n", "fast_code_sha256": "20c189f8687808a8f39bdc27c4d23e2df133376460bbab2cfedbfc5f2a303dd1", "fast_id": "p03801_20c189f8687808a8f39bdc27c4d23e2df133376460bbab2cfedbfc5f2a303dd1", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from operator import itemgetter\nimport sys\n\nN = int(eval(input()))\nA = [int(i) for i in input().split()]\nB = [(A[i], i) for i in range(N)]\nB = sorted(B, key=itemgetter(1))\nB = sorted(B, key=itemgetter(0))\nT = [0] * N\ncos, pt = B.pop()\nfor i in range(1, N):\n cos2, pt2 = B.pop()\n T[pt] += (cos - cos2) * i\n pt = min(pt, pt2)\n cos = cos2\nT[pt] += cos * N\nfor i in T:\n print(i)\n", "measured_fast_code_sha256": "20c189f8687808a8f39bdc27c4d23e2df133376460bbab2cfedbfc5f2a303dd1", "measured_slow_code": "from collections import defaultdict\nimport sys\n\n\nclass BIT:\n def __init__(self, number):\n self.n = number\n self.list = [0] * (number + 1)\n\n def add(self, i, x): # ith added x 1indexed\n while i <= self.n:\n self.list[i] += x\n i += i & -i\n\n def search(self, i): # 1-i sum\n s = 0\n while i > 0:\n s += self.list[i]\n i -= i & -i\n return s\n\n def suma(self, i, j): # i,i+1,..j sum\n return self.search(j) - self.search(i - 1)\n\n\nN = int(eval(input()))\nA = [int(i) for i in input().split()]\nC = sorted(set(A))\nndd = defaultdict(int)\nfor i in range(len(C)):\n ndd[i + 1] = C[i]\ndd = defaultdict(int)\nfor i in range(len(C)):\n dd[C[i]] = i + 1\n# print(ndd,dd)\nvisit = [0] * N\nvisit[0] = 1\ns = A[0]\nH = []\nH.append(s)\nfor i in range(1, N):\n if s < A[i]:\n s = A[i]\n H.append(s)\n visit[i] = 1\nBITI = BIT(N + 1)\nBITI2 = BIT(N + 1)\nj = len(H) - 1\nl = dd[H[j]]\nnum = sum(A)\nT = [0] * N\nans = 0\nfor i in range(N - 1, -1, -1):\n if l == dd[A[0]]:\n break\n BITI.add(dd[A[i]], A[i])\n BITI2.add(dd[A[i]], 1)\n if dd[A[i]] == l and visit[i] == 1:\n T[i] = (\n BITI.suma(dd[H[j - 1]], N + 1)\n - BITI2.suma(dd[H[j - 1]], N + 1) * H[j - 1]\n - ans\n )\n ans += T[i]\n # print(i,j,l,T[i],ans)\n j -= 1\n l = dd[H[j]]\nx = num - sum(T)\nT[0] = x\n# print(visit,T)\nfor t in T:\n print(t)\n", "measured_slow_code_sha256": "40cdb704510a327363c2183827f02e9385c4a8e8deb4ae92265564da9b8e0f50", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.9693249868331444, "pair_id": "python_v2_42141fe4f76091cc5a359b2f", "per_case_slow_code_faster_fraction": 0.07, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03801", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03801_20c189f8687808a8f39bdc27c4d23e2df133376460bbab2cfedbfc5f2a303dd1.jsonl.gz", "inputs": "reproduction/python/inputs/p03801.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03801_40cdb704510a327363c2183827f02e9385c4a8e8deb4ae92265564da9b8e0f50.jsonl.gz"}, "slow_code": "from collections import defaultdict\nimport sys\n\n\nclass BIT:\n def __init__(self, number):\n self.n = number\n self.list = [0] * (number + 1)\n\n def add(self, i, x):\n while i <= self.n:\n self.list[i] += x\n i += i & -i\n\n def search(self, i):\n s = 0\n while i > 0:\n s += self.list[i]\n i -= i & -i\n return s\n\n def suma(self, i, j):\n return self.search(j) - self.search(i - 1)\n\n\nN = int(eval(input()))\nA = [int(i) for i in input().split()]\nC = sorted(set(A))\nndd = defaultdict(int)\nfor i in range(len(C)):\n ndd[i + 1] = C[i]\ndd = defaultdict(int)\nfor i in range(len(C)):\n dd[C[i]] = i + 1\n\nvisit = [0] * N\nvisit[0] = 1\ns = A[0]\nH = []\nH.append(s)\nfor i in range(1, N):\n if s < A[i]:\n s = A[i]\n H.append(s)\n visit[i] = 1\nBITI = BIT(N + 1)\nBITI2 = BIT(N + 1)\nj = len(H) - 1\nl = dd[H[j]]\nnum = sum(A)\nT = [0] * N\nans = 0\nfor i in range(N - 1, -1, -1):\n if l == dd[A[0]]:\n break\n BITI.add(dd[A[i]], A[i])\n BITI2.add(dd[A[i]], 1)\n if dd[A[i]] == l and visit[i] == 1:\n T[i] = (\n BITI.suma(dd[H[j - 1]], N + 1)\n - BITI2.suma(dd[H[j - 1]], N + 1) * H[j - 1]\n - ans\n )\n ans += T[i]\n\n j -= 1\n l = dd[H[j]]\nx = num - sum(T)\nT[0] = x\n\nfor t in T:\n print(t)\n", "slow_code_sha256": "16fad88fa10618a2d3253fe477e8c221495b37e3b11f228319dc3cf0097c8388", "slow_id": "p03801_40cdb704510a327363c2183827f02e9385c4a8e8deb4ae92265564da9b8e0f50", "speedup": 2.986908325232993, "stratum": "2-4", "within_pair_jaccard": 0.28125, "workload": {"case_count": 100, "description": "Repeat until N stone piles are empty: append the smallest index among current largest piles, then remove one stone from any nonempty pile. Among possible output sequences, choose the lexicographically smallest and report each index frequency. Observed inputs: N=1..100000 (median 1000); a_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1100007, "median": 9900.0, "min": 4}, "input_format": ["N\na_1 ... a_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100001, "median": 1001.0, "min": 2}}} -{"case_ids": ["p02695_case_000", "p02695_case_001", "p02695_case_002", "p02695_case_003", "p02695_case_004", "p02695_case_005", "p02695_case_006", "p02695_case_007", "p02695_case_008", "p02695_case_009", "p02695_case_010", "p02695_case_011", "p02695_case_012", "p02695_case_013", "p02695_case_014", "p02695_case_015", "p02695_case_016", "p02695_case_017", "p02695_case_018", "p02695_case_019", "p02695_case_020", "p02695_case_021", "p02695_case_022", "p02695_case_023", "p02695_case_024", "p02695_case_025", "p02695_case_026", "p02695_case_027", "p02695_case_028", "p02695_case_029", "p02695_case_030", "p02695_case_031", "p02695_case_032", "p02695_case_033", "p02695_case_034", "p02695_case_035", "p02695_case_036", "p02695_case_037", "p02695_case_038", "p02695_case_039", "p02695_case_040", "p02695_case_041", "p02695_case_042", "p02695_case_043", "p02695_case_044", "p02695_case_045", "p02695_case_046", "p02695_case_047", "p02695_case_048", "p02695_case_049", "p02695_case_050", "p02695_case_051", "p02695_case_052", "p02695_case_053", "p02695_case_054", "p02695_case_055", "p02695_case_056", "p02695_case_057", "p02695_case_058", "p02695_case_059", "p02695_case_060", "p02695_case_061", "p02695_case_062", "p02695_case_063", "p02695_case_064", "p02695_case_065", "p02695_case_066", "p02695_case_067", "p02695_case_068", "p02695_case_069", "p02695_case_070", "p02695_case_071", "p02695_case_072", "p02695_case_073", "p02695_case_074", "p02695_case_075", "p02695_case_076", "p02695_case_077", "p02695_case_078", "p02695_case_079", "p02695_case_080", "p02695_case_081", "p02695_case_082", "p02695_case_083", "p02695_case_084", "p02695_case_085", "p02695_case_086", "p02695_case_087", "p02695_case_088", "p02695_case_089", "p02695_case_090", "p02695_case_091", "p02695_case_092", "p02695_case_093", "p02695_case_094", "p02695_case_095", "p02695_case_096", "p02695_case_097", "p02695_case_098", "p02695_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def resolve():\n import itertools\n\n n, m, q = list(map(int, input().split()))\n cond = [list(map(int, input().split())) for _ in range(q)]\n ans = 0\n for i in list(itertools.combinations_with_replacement(list(range(1, m + 1)), n)):\n point = 0\n for j in range(q):\n if i[cond[j][1] - 1] - i[cond[j][0] - 1] == cond[j][2]:\n point += cond[j][3]\n ans = max(ans, point)\n print(ans)\n\n\nresolve()\n", "fast_code_sha256": "6ab406159b06b4769539391971513611e79bee09dae7cc1993ecf9956d9a30cc", "fast_id": "p02695_6ab406159b06b4769539391971513611e79bee09dae7cc1993ecf9956d9a30cc", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def resolve():\n import itertools\n\n n, m, q = list(map(int, input().split()))\n cond = [list(map(int, input().split())) for _ in range(q)]\n ans = 0\n for i in list(itertools.combinations_with_replacement(list(range(1, m + 1)), n)):\n point = 0\n for j in range(q):\n if i[cond[j][1] - 1] - i[cond[j][0] - 1] == cond[j][2]:\n point += cond[j][3]\n ans = max(ans, point)\n print(ans)\n\n\nresolve()\n", "measured_fast_code_sha256": "6ab406159b06b4769539391971513611e79bee09dae7cc1993ecf9956d9a30cc", "measured_slow_code": "n, m, q = list(map(int, input().split()))\nl = []\nfor i in range(q):\n l1, l2, l3, l4 = list(map(int, input().split()))\n l.append([l1, l2, l3, l4])\nB = []\nfor a in range(1, m + 1):\n for b in range(a, m + 1):\n for c in range(b, m + 1):\n for d in range(c, m + 1):\n for e in range(d, m + 1):\n for f in range(e, m + 1):\n for g in range(f, m + 1):\n for h in range(g, m + 1):\n for i in range(h, m + 1):\n for j in range(i, m + 1):\n L = [a, b, c, d, e, f, g, h, i, j]\n A = []\n for I in range(n):\n A.append(L[I])\n C = 0\n for k in range(q):\n if (\n A[l[k][1] - 1] - A[l[k][0] - 1]\n == l[k][2]\n ):\n C += l[k][3]\n B.append(C)\nprint((max(B)))\n", "measured_slow_code_sha256": "4876c20eabffbc9ea2c633c2d996da20261178a9a9451926be7fe13405bb8582", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.8446902124975728, "pair_id": "python_v2_a8f4436738d6008d1a7bc614", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02695", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02695_6ab406159b06b4769539391971513611e79bee09dae7cc1993ecf9956d9a30cc.jsonl.gz", "inputs": "reproduction/python/inputs/p02695.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02695_4876c20eabffbc9ea2c633c2d996da20261178a9a9451926be7fe13405bb8582.jsonl.gz"}, "slow_code": "n, m, q = list(map(int, input().split()))\nl = []\nfor i in range(q):\n l1, l2, l3, l4 = list(map(int, input().split()))\n l.append([l1, l2, l3, l4])\nB = []\nfor a in range(1, m + 1):\n for b in range(a, m + 1):\n for c in range(b, m + 1):\n for d in range(c, m + 1):\n for e in range(d, m + 1):\n for f in range(e, m + 1):\n for g in range(f, m + 1):\n for h in range(g, m + 1):\n for i in range(h, m + 1):\n for j in range(i, m + 1):\n L = [a, b, c, d, e, f, g, h, i, j]\n A = []\n for I in range(n):\n A.append(L[I])\n C = 0\n for k in range(q):\n if (\n A[l[k][1] - 1] - A[l[k][0] - 1]\n == l[k][2]\n ):\n C += l[k][3]\n B.append(C)\nprint((max(B)))\n", "slow_code_sha256": "4876c20eabffbc9ea2c633c2d996da20261178a9a9451926be7fe13405bb8582", "slow_id": "p02695_4876c20eabffbc9ea2c633c2d996da20261178a9a9451926be7fe13405bb8582", "speedup": 7.271736987774568, "stratum": "4-8", "within_pair_jaccard": 0.40816326530612246, "workload": {"case_count": 100, "description": "Choose integers 1<=A_1<=...<=A_N<=M to maximize score. Each of Q distinct conditions (a_i,b_i,c_i) awards d_i when A_b_i-A_a_i=c_i. Observed inputs: N=2..10 (median 5); M=1..10 (median 5); Q=1..50 (median 10); c_i=0..9; d_i=1..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 676, "median": 132.0, "min": 14}, "input_format": ["N M Q\na_1 b_1 c_1 d_1\n...\na_Q b_Q c_Q d_Q"], "input_format_status": "source_input_section", "input_lines": {"max": 51, "median": 11.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 203, "median": 43.0, "min": 7}}} -{"case_ids": ["p02939_case_000", "p02939_case_001", "p02939_case_002", "p02939_case_003", "p02939_case_004", "p02939_case_005", "p02939_case_006", "p02939_case_007", "p02939_case_008", "p02939_case_009", "p02939_case_010", "p02939_case_011", "p02939_case_012", "p02939_case_013", "p02939_case_014", "p02939_case_015", "p02939_case_016", "p02939_case_017", "p02939_case_018", "p02939_case_019", "p02939_case_020", "p02939_case_021", "p02939_case_022", "p02939_case_023", "p02939_case_024", "p02939_case_025", "p02939_case_026", "p02939_case_027", "p02939_case_028", "p02939_case_029", "p02939_case_030", "p02939_case_031", "p02939_case_032", "p02939_case_033", "p02939_case_034", "p02939_case_035", "p02939_case_036", "p02939_case_037", "p02939_case_038", "p02939_case_039", "p02939_case_040", "p02939_case_041", "p02939_case_042", "p02939_case_043", "p02939_case_044", "p02939_case_045", "p02939_case_046", "p02939_case_047", "p02939_case_048", "p02939_case_049", "p02939_case_050", "p02939_case_051", "p02939_case_052", "p02939_case_053", "p02939_case_054", "p02939_case_055", "p02939_case_056", "p02939_case_057", "p02939_case_058", "p02939_case_059", "p02939_case_060", "p02939_case_061", "p02939_case_062", "p02939_case_063", "p02939_case_064", "p02939_case_065", "p02939_case_066", "p02939_case_067", "p02939_case_068", "p02939_case_069", "p02939_case_070", "p02939_case_071", "p02939_case_072", "p02939_case_073", "p02939_case_074", "p02939_case_075", "p02939_case_076", "p02939_case_077", "p02939_case_078", "p02939_case_079", "p02939_case_080", "p02939_case_081", "p02939_case_082", "p02939_case_083", "p02939_case_084", "p02939_case_085", "p02939_case_086", "p02939_case_087", "p02939_case_088", "p02939_case_089", "p02939_case_090", "p02939_case_091", "p02939_case_092", "p02939_case_093", "p02939_case_094", "p02939_case_095", "p02939_case_096", "p02939_case_097", "p02939_case_098", "p02939_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\nsys.setrecursionlimit(10**8)\ninput = sys.stdin.readline\n\n\ndef main():\n S = input().strip()\n i = 1\n prev = S[0]\n cnt = 1\n while i < len(S):\n if S[i] == prev:\n prev = prev + S[i]\n if i + 1 < len(S):\n prev = S[i] + S[i + 1]\n cnt += 1\n i += 2\n else:\n i += 1\n else:\n prev = S[i]\n cnt += 1\n i += 1\n print(cnt)\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "964e554a32b3bd8e20a5996984501317bd6da8420e4c9a7d8c6cc002ccea685a", "fast_id": "p02939_964e554a32b3bd8e20a5996984501317bd6da8420e4c9a7d8c6cc002ccea685a", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\nsys.setrecursionlimit(10**8)\ninput = sys.stdin.readline\n\n\ndef main():\n S = input().strip()\n i = 1\n prev = S[0]\n cnt = 1\n while i < len(S):\n if S[i] == prev:\n prev = prev + S[i]\n if i + 1 < len(S):\n prev = S[i] + S[i + 1]\n cnt += 1\n i += 2\n else:\n i += 1\n else:\n prev = S[i]\n cnt += 1\n i += 1\n print(cnt)\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "964e554a32b3bd8e20a5996984501317bd6da8420e4c9a7d8c6cc002ccea685a", "measured_slow_code": "import sys\n\nstdin = sys.stdin\nni = lambda: int(ns)\nns = lambda: stdin.readline().rstrip()\nna = lambda: map(int, stdin.readline().split())\nfrom itertools import groupby\n\n\ndef f(x):\n groups = []\n for _, g in groupby(x):\n groups += [list(g)]\n ans = 0\n flag = False\n for group in groups:\n n = len(group)\n if flag:\n n -= 1\n flag = False\n if n == 0:\n print(group, file=sys.stderr)\n continue\n c = (n - 1) // 3 * 2\n o = n % 3\n if o == 0:\n d = 2\n elif o == 1:\n d = 1\n elif o == 2:\n d = 2\n flag = True\n print(group, c, d, file=sys.stderr)\n ans += c + d\n if flag:\n ans -= 1\n print(ans, file=sys.stderr)\n return ans\n\n\ndef solve():\n s = ns()\n print(max(f(s), f(s[::-1])))\n\n\nif __name__ == \"__main__\":\n solve()\n", "measured_slow_code_sha256": "37db42fbefdb0dbbda44774e52a453296698a7c0ff2fd87fa533a64afe79be91", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.8436103209398826, "pair_id": "python_v2_3e5e331271d45ce1f3c5b18a", "per_case_slow_code_faster_fraction": 0.06, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02939", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02939_964e554a32b3bd8e20a5996984501317bd6da8420e4c9a7d8c6cc002ccea685a.jsonl.gz", "inputs": "reproduction/python/inputs/p02939.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02939_37db42fbefdb0dbbda44774e52a453296698a7c0ff2fd87fa533a64afe79be91.jsonl.gz"}, "slow_code": "import sys\n\nstdin = sys.stdin\nni = lambda: int(ns)\nns = lambda: stdin.readline().rstrip()\nna = lambda: map(int, stdin.readline().split())\nfrom itertools import groupby\n\n\ndef f(x):\n groups = []\n for _, g in groupby(x):\n groups += [list(g)]\n ans = 0\n flag = False\n for group in groups:\n n = len(group)\n if flag:\n n -= 1\n flag = False\n if n == 0:\n print(group, file=sys.stderr)\n continue\n c = (n - 1) // 3 * 2\n o = n % 3\n if o == 0:\n d = 2\n elif o == 1:\n d = 1\n elif o == 2:\n d = 2\n flag = True\n print(group, c, d, file=sys.stderr)\n ans += c + d\n if flag:\n ans -= 1\n print(ans, file=sys.stderr)\n return ans\n\n\ndef solve():\n s = ns()\n print(max(f(s), f(s[::-1])))\n\n\nif __name__ == \"__main__\":\n solve()\n", "slow_code_sha256": "37db42fbefdb0dbbda44774e52a453296698a7c0ff2fd87fa533a64afe79be91", "slow_id": "p02939_37db42fbefdb0dbbda44774e52a453296698a7c0ff2fd87fa533a64afe79be91", "speedup": 3.8166180766532882, "stratum": "2-4", "within_pair_jaccard": 0.20967741935483872, "workload": {"case_count": 100, "description": "Partition lowercase string S into the maximum possible number of nonempty contiguous pieces, requiring each piece to differ as a whole string from its immediate neighbors. Observed inputs: input_length=1..200000 (median 100).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 200001, "median": 101.0, "min": 2}, "input_format": ["S"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p03807_case_000", "p03807_case_001", "p03807_case_002", "p03807_case_003", "p03807_case_004", "p03807_case_005", "p03807_case_006", "p03807_case_007", "p03807_case_008", "p03807_case_009", "p03807_case_010", "p03807_case_011", "p03807_case_012", "p03807_case_013", "p03807_case_014", "p03807_case_015", "p03807_case_016", "p03807_case_017", "p03807_case_018", "p03807_case_019", "p03807_case_020", "p03807_case_021", "p03807_case_022", "p03807_case_023", "p03807_case_024", "p03807_case_025", "p03807_case_026", "p03807_case_027", "p03807_case_028", "p03807_case_029", "p03807_case_030", "p03807_case_031", "p03807_case_032", "p03807_case_033", "p03807_case_034", "p03807_case_035", "p03807_case_036", "p03807_case_037", "p03807_case_038", "p03807_case_039", "p03807_case_040", "p03807_case_041", "p03807_case_042", "p03807_case_043", "p03807_case_044", "p03807_case_045", "p03807_case_046", "p03807_case_047", "p03807_case_048", "p03807_case_049", "p03807_case_050", "p03807_case_051", "p03807_case_052", "p03807_case_053", "p03807_case_054", "p03807_case_055", "p03807_case_056", "p03807_case_057", "p03807_case_058", "p03807_case_059", "p03807_case_060", "p03807_case_061", "p03807_case_062", "p03807_case_063", "p03807_case_064", "p03807_case_065", "p03807_case_066", "p03807_case_067", "p03807_case_068", "p03807_case_069", "p03807_case_070", "p03807_case_071", "p03807_case_072", "p03807_case_073", "p03807_case_074", "p03807_case_075", "p03807_case_076", "p03807_case_077", "p03807_case_078", "p03807_case_079", "p03807_case_080", "p03807_case_081", "p03807_case_082", "p03807_case_083", "p03807_case_084", "p03807_case_085", "p03807_case_086", "p03807_case_087", "p03807_case_088", "p03807_case_089", "p03807_case_090", "p03807_case_091", "p03807_case_092", "p03807_case_093", "p03807_case_094", "p03807_case_095", "p03807_case_096", "p03807_case_097", "p03807_case_098", "p03807_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def resolve():\n n = int(eval(input()))\n l = list(map(int, input().split()))\n if sum(l) % 2 == 0:\n print(\"YES\")\n else:\n print(\"NO\")\n\n\nresolve()\n", "fast_code_sha256": "4c89857e58e59cd5f35d76dad586a7f5f4bf79af3f4e62ebf7194c6d02e7f668", "fast_id": "p03807_4c89857e58e59cd5f35d76dad586a7f5f4bf79af3f4e62ebf7194c6d02e7f668", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def resolve():\n n = int(eval(input()))\n l = list(map(int, input().split()))\n if sum(l) % 2 == 0:\n print(\"YES\")\n else:\n print(\"NO\")\n\n\nresolve()\n", "measured_fast_code_sha256": "4c89857e58e59cd5f35d76dad586a7f5f4bf79af3f4e62ebf7194c6d02e7f668", "measured_slow_code": "import sys\nimport bisect\nimport collections\nimport fractions\nimport heapq\n\n\ndef slove():\n input = sys.stdin.readline\n n = int(input().rstrip(\"\\n\"))\n a = list(map(int, input().rstrip(\"\\n\").split()))\n cnt = 0\n for i in range(n):\n if a[i] % 2 != 0:\n cnt += 1\n if cnt % 2 == 0:\n print(\"YES\")\n else:\n print(\"NO\")\n\n\nif __name__ == \"__main__\":\n slove()\n", "measured_slow_code_sha256": "8baca45625cd0c593d3689761edf66d3fece4f44f81b27a47e938cff4b898bb0", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.9442868335476002, "pair_id": "python_v2_03f642082deef9b63fb0e9f9", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03807", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03807_4c89857e58e59cd5f35d76dad586a7f5f4bf79af3f4e62ebf7194c6d02e7f668.jsonl.gz", "inputs": "reproduction/python/inputs/p03807.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03807_8baca45625cd0c593d3689761edf66d3fece4f44f81b27a47e938cff4b898bb0.jsonl.gz"}, "slow_code": "import sys\nimport bisect\nimport collections\nimport fractions\nimport heapq\n\n\ndef slove():\n input = sys.stdin.readline\n n = int(input().rstrip(\"\\n\"))\n a = list(map(int, input().rstrip(\"\\n\").split()))\n cnt = 0\n for i in range(n):\n if a[i] % 2 != 0:\n cnt += 1\n if cnt % 2 == 0:\n print(\"YES\")\n else:\n print(\"NO\")\n\n\nif __name__ == \"__main__\":\n slove()\n", "slow_code_sha256": "8baca45625cd0c593d3689761edf66d3fece4f44f81b27a47e938cff4b898bb0", "slow_id": "p03807_8baca45625cd0c593d3689761edf66d3fece4f44f81b27a47e938cff4b898bb0", "speedup": 6.006829250264732, "stratum": "4-8", "within_pair_jaccard": 0.3783783783783784, "workload": {"case_count": 100, "description": "Repeatedly replace two integers of the same parity by their sum. Determine whether an N-element positive integer multiset can be reduced to exactly one integer. Observed inputs: N=2..100000 (median 99999); a_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1049995, "median": 200007.0, "min": 6}, "input_format": ["N\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100001, "median": 100000.0, "min": 3}}} -{"case_ids": ["p02848_case_000", "p02848_case_001", "p02848_case_002", "p02848_case_003", "p02848_case_004", "p02848_case_005", "p02848_case_006", "p02848_case_007", "p02848_case_008", "p02848_case_009", "p02848_case_010", "p02848_case_011", "p02848_case_012", "p02848_case_013", "p02848_case_014", "p02848_case_015", "p02848_case_016", "p02848_case_017", "p02848_case_018", "p02848_case_019", "p02848_case_020", "p02848_case_021", "p02848_case_022", "p02848_case_023", "p02848_case_024", "p02848_case_025", "p02848_case_026", "p02848_case_027", "p02848_case_028", "p02848_case_029", "p02848_case_030", "p02848_case_031", "p02848_case_032", "p02848_case_033", "p02848_case_034", "p02848_case_035", "p02848_case_036", "p02848_case_037", "p02848_case_038", "p02848_case_039", "p02848_case_040", "p02848_case_041", "p02848_case_042", "p02848_case_043", "p02848_case_044", "p02848_case_045", "p02848_case_046", "p02848_case_047", "p02848_case_048", "p02848_case_049", "p02848_case_050", "p02848_case_051", "p02848_case_052", "p02848_case_053", "p02848_case_054", "p02848_case_055", "p02848_case_056", "p02848_case_057", "p02848_case_058", "p02848_case_059", "p02848_case_060", "p02848_case_061", "p02848_case_062", "p02848_case_063", "p02848_case_064", "p02848_case_065", "p02848_case_066", "p02848_case_067", "p02848_case_068", "p02848_case_069", "p02848_case_070", "p02848_case_071", "p02848_case_072", "p02848_case_073", "p02848_case_074", "p02848_case_075", "p02848_case_076", "p02848_case_077", "p02848_case_078", "p02848_case_079", "p02848_case_080", "p02848_case_081", "p02848_case_082", "p02848_case_083", "p02848_case_084", "p02848_case_085", "p02848_case_086", "p02848_case_087", "p02848_case_088", "p02848_case_089", "p02848_case_090", "p02848_case_091", "p02848_case_092", "p02848_case_093", "p02848_case_094", "p02848_case_095", "p02848_case_096", "p02848_case_097", "p02848_case_098", "p02848_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "s = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\nn = int(input())\nx = input()\na = ord(\"A\")\nprint(\"\".join([s[(ord(c) - a + n) % 26] for c in x]))\n", "fast_code_sha256": "b9b377895112e4c99f6470ef8bdf76c96f8f88338618602457f984055da5d8d7", "fast_id": "p02848_b9b377895112e4c99f6470ef8bdf76c96f8f88338618602457f984055da5d8d7", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "s = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\nn = int(input())\nx = input()\na = ord(\"A\")\nprint(\"\".join([s[(ord(c) - a + n) % 26] for c in x]))\n", "measured_fast_code_sha256": "b9b377895112e4c99f6470ef8bdf76c96f8f88338618602457f984055da5d8d7", "measured_slow_code": "# coding: utf-8\nimport sys\nimport math\nimport collections\nimport itertools\nfrom inspect import currentframe\n\nINF = 10**10\nMOD = 10**9 + 7\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef gcd(x, y):\n return y if x % y == 0 else gcd(y, x % y)\n\n\ndef lcm(x, y):\n return (x * y) // gcd(x, y)\n\n\ndef I():\n return int(input())\n\n\ndef MI():\n return map(int, input().split())\n\n\ndef LI():\n return [int(x) for x in input().split()]\n\n\ndef RI(N):\n return [int(input()) for _ in range(N)]\n\n\ndef LRI(N):\n return [[int(x) for x in input().split()] for _ in range(N)]\n\n\ndef chkprint(*args):\n names = {id(v): k for k, v in currentframe().f_back.f_locals.items()}\n print(\", \".join(names.get(id(arg), \"???\") + \" = \" + repr(arg) for arg in args))\n\n\nN = I()\nS = input()\nalp = [\n \"A\",\n \"B\",\n \"C\",\n \"D\",\n \"E\",\n \"F\",\n \"G\",\n \"H\",\n \"I\",\n \"J\",\n \"K\",\n \"L\",\n \"M\",\n \"N\",\n \"O\",\n \"P\",\n \"Q\",\n \"R\",\n \"S\",\n \"T\",\n \"U\",\n \"V\",\n \"W\",\n \"X\",\n \"Y\",\n \"Z\",\n]\nfor s in S:\n print(alp[(alp.index(s) + N) % 26], end=\"\")\n", "measured_slow_code_sha256": "28ec796f8eb56af2fabfccd11148299be75fe687af7fbeca1341511e952857a1", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4.732633727677456, "pair_id": "python_v2_058c833aa22670ca94573273", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02848", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02848_b9b377895112e4c99f6470ef8bdf76c96f8f88338618602457f984055da5d8d7.jsonl.gz", "inputs": "reproduction/python/inputs/p02848.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02848_28ec796f8eb56af2fabfccd11148299be75fe687af7fbeca1341511e952857a1.jsonl.gz"}, "slow_code": "import sys\nimport math\nimport collections\nimport itertools\nfrom inspect import currentframe\n\nINF = 10**10\nMOD = 10**9 + 7\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef gcd(x, y):\n return y if x % y == 0 else gcd(y, x % y)\n\n\ndef lcm(x, y):\n return (x * y) // gcd(x, y)\n\n\ndef I():\n return int(input())\n\n\ndef MI():\n return map(int, input().split())\n\n\ndef LI():\n return [int(x) for x in input().split()]\n\n\ndef RI(N):\n return [int(input()) for _ in range(N)]\n\n\ndef LRI(N):\n return [[int(x) for x in input().split()] for _ in range(N)]\n\n\ndef chkprint(*args):\n names = {id(v): k for k, v in currentframe().f_back.f_locals.items()}\n print(\", \".join(names.get(id(arg), \"???\") + \" = \" + repr(arg) for arg in args))\n\n\nN = I()\nS = input()\nalp = [\n \"A\",\n \"B\",\n \"C\",\n \"D\",\n \"E\",\n \"F\",\n \"G\",\n \"H\",\n \"I\",\n \"J\",\n \"K\",\n \"L\",\n \"M\",\n \"N\",\n \"O\",\n \"P\",\n \"Q\",\n \"R\",\n \"S\",\n \"T\",\n \"U\",\n \"V\",\n \"W\",\n \"X\",\n \"Y\",\n \"Z\",\n]\nfor s in S:\n print(alp[(alp.index(s) + N) % 26], end=\"\")\n", "slow_code_sha256": "4e03a4428b1aa0327e66a8cb999ff15a637eaad3acbd2fd2d565e47714f697dd", "slow_id": "p02848_28ec796f8eb56af2fabfccd11148299be75fe687af7fbeca1341511e952857a1", "speedup": 7.212410780018643, "stratum": "4-8", "within_pair_jaccard": 0.11494252873563218, "workload": {"case_count": 100, "description": "Shift every uppercase letter of S forward by N alphabetical positions, wrapping from Z to A, and output the resulting string. Observed inputs: N=0..26 (median 13); S_length=1..10000 (median 10000).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 10004, "median": 10004.0, "min": 4}, "input_format": ["N\nS"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p03035_case_000", "p03035_case_001", "p03035_case_002", "p03035_case_003", "p03035_case_004", "p03035_case_005", "p03035_case_006", "p03035_case_007", "p03035_case_008", "p03035_case_009", "p03035_case_010", "p03035_case_011", "p03035_case_012", "p03035_case_013", "p03035_case_014", "p03035_case_015", "p03035_case_016", "p03035_case_017", "p03035_case_018", "p03035_case_019", "p03035_case_020", "p03035_case_021", "p03035_case_022", "p03035_case_023", "p03035_case_024", "p03035_case_025", "p03035_case_026", "p03035_case_027", "p03035_case_028", "p03035_case_029", "p03035_case_030", "p03035_case_031", "p03035_case_032", "p03035_case_033", "p03035_case_034", "p03035_case_035", "p03035_case_036", "p03035_case_037", "p03035_case_038", "p03035_case_039", "p03035_case_040", "p03035_case_041", "p03035_case_042", "p03035_case_043", "p03035_case_044", "p03035_case_045", "p03035_case_046", "p03035_case_047", "p03035_case_048", "p03035_case_049", "p03035_case_050", "p03035_case_051", "p03035_case_052", "p03035_case_053", "p03035_case_054", "p03035_case_055", "p03035_case_056", "p03035_case_057", "p03035_case_058", "p03035_case_059", "p03035_case_060", "p03035_case_061", "p03035_case_062", "p03035_case_063", "p03035_case_064", "p03035_case_065", "p03035_case_066", "p03035_case_067", "p03035_case_068", "p03035_case_069", "p03035_case_070", "p03035_case_071", "p03035_case_072", "p03035_case_073", "p03035_case_074", "p03035_case_075", "p03035_case_076", "p03035_case_077", "p03035_case_078", "p03035_case_079", "p03035_case_080", "p03035_case_081", "p03035_case_082", "p03035_case_083", "p03035_case_084", "p03035_case_085", "p03035_case_086", "p03035_case_087", "p03035_case_088", "p03035_case_089", "p03035_case_090", "p03035_case_091", "p03035_case_092", "p03035_case_093", "p03035_case_094", "p03035_case_095", "p03035_case_096", "p03035_case_097", "p03035_case_098", "p03035_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "a, b = list(map(int, input().split()))\nprint(((b >> (a < 13)) * (a > 5)))\n", "fast_code_sha256": "f8e20667eb59e2008a82e70c5f95b0003cf9900e3389ec5e527c150421bf8791", "fast_id": "p03035_f8e20667eb59e2008a82e70c5f95b0003cf9900e3389ec5e527c150421bf8791", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "a, b = list(map(int, input().split()))\nprint(((b >> (a < 13)) * (a > 5)))\n", "measured_fast_code_sha256": "f8e20667eb59e2008a82e70c5f95b0003cf9900e3389ec5e527c150421bf8791", "measured_slow_code": "import sys, math, collections, heapq, itertools\n\nF = sys.stdin\n\n\ndef single_input():\n return F.readline().strip(\"\\n\")\n\n\ndef line_input():\n return F.readline().strip(\"\\n\").split()\n\n\ndef gcd(a, b):\n a, b = max(a, b), min(a, b)\n while a % b > 0:\n a, b = b, a % b\n return b\n\n\ndef solve():\n A, B = list(map(int, line_input()))\n if A >= 13:\n print(B)\n elif A >= 6:\n print((B // 2))\n else:\n print((0))\n return 0\n\n\nif __name__ == \"__main__\":\n solve()\n", "measured_slow_code_sha256": "a03feaf840d71ae8aa582d21d70bb7cc8063992d1b30834ae4cabc43c65fc6f6", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.8336561378492258, "pair_id": "python_v2_973e529948c60694a54f1616", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03035", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03035_f8e20667eb59e2008a82e70c5f95b0003cf9900e3389ec5e527c150421bf8791.jsonl.gz", "inputs": "reproduction/python/inputs/p03035.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03035_a03feaf840d71ae8aa582d21d70bb7cc8063992d1b30834ae4cabc43c65fc6f6.jsonl.gz"}, "slow_code": "import sys, math, collections, heapq, itertools\n\nF = sys.stdin\n\n\ndef single_input():\n return F.readline().strip(\"\\n\")\n\n\ndef line_input():\n return F.readline().strip(\"\\n\").split()\n\n\ndef gcd(a, b):\n a, b = max(a, b), min(a, b)\n while a % b > 0:\n a, b = b, a % b\n return b\n\n\ndef solve():\n A, B = list(map(int, line_input()))\n if A >= 13:\n print(B)\n elif A >= 6:\n print((B // 2))\n else:\n print((0))\n return 0\n\n\nif __name__ == \"__main__\":\n solve()\n", "slow_code_sha256": "a03feaf840d71ae8aa582d21d70bb7cc8063992d1b30834ae4cabc43c65fc6f6", "slow_id": "p03035_a03feaf840d71ae8aa582d21d70bb7cc8063992d1b30834ae4cabc43c65fc6f6", "speedup": 3.830539206888149, "stratum": "2-4", "within_pair_jaccard": 0.20512820512820512, "workload": {"case_count": 100, "description": "Find a ticket price for age A: full even price B at age >=13, half price at ages 6..12, and free at ages 0..5. Observed inputs: A=0..100 (median 21); B=2..1000 (median 183).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 9, "median": 6.0, "min": 4}, "input_format": ["A B"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p02716_case_000", "p02716_case_001", "p02716_case_002", "p02716_case_003", "p02716_case_004", "p02716_case_005", "p02716_case_006", "p02716_case_007", "p02716_case_008", "p02716_case_009", "p02716_case_010", "p02716_case_011", "p02716_case_012", "p02716_case_013", "p02716_case_014", "p02716_case_015", "p02716_case_016", "p02716_case_017", "p02716_case_018", "p02716_case_019", "p02716_case_020", "p02716_case_021", "p02716_case_022", "p02716_case_023", "p02716_case_024", "p02716_case_025", "p02716_case_026", "p02716_case_027", "p02716_case_028", "p02716_case_029", "p02716_case_030", "p02716_case_031", "p02716_case_032", "p02716_case_033", "p02716_case_034", "p02716_case_035", "p02716_case_036", "p02716_case_037", "p02716_case_038", "p02716_case_039", "p02716_case_040", "p02716_case_041", "p02716_case_042", "p02716_case_043", "p02716_case_044", "p02716_case_045", "p02716_case_046", "p02716_case_047", "p02716_case_048", "p02716_case_049", "p02716_case_050", "p02716_case_051", "p02716_case_052", "p02716_case_053", "p02716_case_054", "p02716_case_055", "p02716_case_056", "p02716_case_057", "p02716_case_058", "p02716_case_059", "p02716_case_060", "p02716_case_061", "p02716_case_062", "p02716_case_063", "p02716_case_064", "p02716_case_065", "p02716_case_066", "p02716_case_067", "p02716_case_068", "p02716_case_069", "p02716_case_070", "p02716_case_071", "p02716_case_072", "p02716_case_073", "p02716_case_074", "p02716_case_075", "p02716_case_076", "p02716_case_077", "p02716_case_078", "p02716_case_079", "p02716_case_080", "p02716_case_081", "p02716_case_082", "p02716_case_083", "p02716_case_084", "p02716_case_085", "p02716_case_086", "p02716_case_087", "p02716_case_088", "p02716_case_089", "p02716_case_090", "p02716_case_091", "p02716_case_092", "p02716_case_093", "p02716_case_094", "p02716_case_095", "p02716_case_096", "p02716_case_097", "p02716_case_098", "p02716_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N = int(eval(input()))\nA = list(map(int, input().split()))\nINF = 10**18\ndp0 = 0\ndp1 = -INF\ndp2 = -INF\nfor i, a in enumerate(A):\n if i % 2 == 0:\n dp1 = max(dp1, dp0)\n dp0 += a\n dp2 += a\n else:\n dp2 = max(dp2, dp1)\n dp1 += a\nif N % 2 == 1:\n print((max(dp1, dp2)))\nelse:\n print((max(dp0, dp1)))\n", "fast_code_sha256": "86e96830fc5785e6231809b417688f2422bc4ebfdd6ffbf2a570a42e6ac2c182", "fast_id": "p02716_86e96830fc5785e6231809b417688f2422bc4ebfdd6ffbf2a570a42e6ac2c182", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N = int(eval(input()))\nA = list(map(int, input().split()))\nINF = 10**18\ndp0 = 0\ndp1 = -INF\ndp2 = -INF\nfor i, a in enumerate(A):\n if i % 2 == 0:\n dp1 = max(dp1, dp0)\n dp0 += a\n dp2 += a\n else:\n dp2 = max(dp2, dp1)\n dp1 += a\nif N % 2 == 1:\n print((max(dp1, dp2)))\nelse:\n print((max(dp0, dp1)))\n", "measured_fast_code_sha256": "86e96830fc5785e6231809b417688f2422bc4ebfdd6ffbf2a570a42e6ac2c182", "measured_slow_code": "#!/usr/bin/env python3\n# coding: utf-8\nimport collections\nimport math\n\n\ndef debug(arg):\n if __debug__:\n pass\n else:\n import sys\n\n print(arg, file=sys.stderr)\n\n\nN, *A = map(int, open(0).read().split())\na = dict(enumerate(A, 1))\n# dp = collections.defaultdict(int)\ndp = collections.defaultdict(lambda: -float(\"inf\"))\ndp[0, 0] = 0\ndp[1, 0] = 0\ndp[1, 1] = a[1]\nfor i in range(2, N + 1):\n jj = range(max(math.floor(i // 2 - 1), 1), math.ceil((i + 1) // 2) + 1)\n debug(jj)\n for j in jj:\n x = dp[i - 2, j - 1] + a[i]\n y = dp[i - 1, j]\n dp[i, j] = max(x, y)\n debug([i - 2, j - 1])\n debug([i - 1, j])\n debug([i, j])\n debug(dp[i, j])\nprint(dp[N, N // 2])\n", "measured_slow_code_sha256": "a89763baebb62faa9e91260c8c3e1ee7019eee2c1555e7f04ebc26cc682a0f4c", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4.6827640266049295, "pair_id": "python_v2_75cef6d2f301cab9197d25ca", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02716", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02716_86e96830fc5785e6231809b417688f2422bc4ebfdd6ffbf2a570a42e6ac2c182.jsonl.gz", "inputs": "reproduction/python/inputs/p02716.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02716_a89763baebb62faa9e91260c8c3e1ee7019eee2c1555e7f04ebc26cc682a0f4c.jsonl.gz"}, "slow_code": "import collections\nimport math\n\n\ndef debug(arg):\n if __debug__:\n pass\n else:\n import sys\n\n print(arg, file=sys.stderr)\n\n\nN, *A = map(int, open(0).read().split())\na = dict(enumerate(A, 1))\n\ndp = collections.defaultdict(lambda: -float(\"inf\"))\ndp[0, 0] = 0\ndp[1, 0] = 0\ndp[1, 1] = a[1]\nfor i in range(2, N + 1):\n jj = range(max(math.floor(i // 2 - 1), 1), math.ceil((i + 1) // 2) + 1)\n debug(jj)\n for j in jj:\n x = dp[i - 2, j - 1] + a[i]\n y = dp[i - 1, j]\n dp[i, j] = max(x, y)\n debug([i - 2, j - 1])\n debug([i - 1, j])\n debug([i, j])\n debug(dp[i, j])\nprint(dp[N, N // 2])\n", "slow_code_sha256": "1b52723f96906a024d2c78dcc137c18ca86b83d53af7d5cc47b6642d214503ba", "slow_id": "p02716_a89763baebb62faa9e91260c8c3e1ee7019eee2c1555e7f04ebc26cc682a0f4c", "speedup": 4.34639521084182, "stratum": "4-8", "within_pair_jaccard": 0.3333333333333333, "workload": {"case_count": 100, "description": "Choose exactly floor(N/2) entries from an integer array, with no two chosen positions adjacent, to maximize their sum. Values may be negative. Observed inputs: N=2..200000 (median 100); A_i=-1000000000..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 2400007, "median": 1046.5, "min": 10}, "input_format": ["N\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200001, "median": 101.0, "min": 3}}} -{"case_ids": ["p02619_case_012", "p02619_case_013", "p02619_case_025", "p02619_case_026", "p02619_case_043", "p02619_case_044", "p02619_case_052", "p02619_case_053", "p02619_case_054", "p02619_case_073", "p02619_case_082", "p02619_case_083", "p02619_case_084", "p02619_case_092", "p02619_case_093", "p02619_v2_a2beef34f549391bcfab", "p02619_v2_d53b9ea5c5792673310a", "p02619_v2_75570918b98373695774", "p02619_v2_381934e3c9fc81ea5d4c", "p02619_v2_3225c49e05d4c20437e8", "p02619_v2_9f23fee4b2e5100bc2a2", "p02619_v2_3800a1516910270b469a", "p02619_v2_d9fa0876b5c6fdeae69e", "p02619_v2_b68f2c1e092b62c538a2", "p02619_v2_73760848946232a8e083", "p02619_v2_d3e4441b330d8b6e7455", "p02619_v2_76ead5910dcc4e2ba1f8", "p02619_v2_2029613353251ee9b7b2", "p02619_v2_2cb134243aa86388d6ba", "p02619_v2_30836e495158435b7b7c", "p02619_v2_339d84622dee7fdc1293", "p02619_v2_d3d5077e7c93e478e065", "p02619_v2_8253b2db731014b88083", "p02619_v2_2177c78f8621448ff155", "p02619_v2_d013df1aba56dc1d54ec", "p02619_v2_64826e27e1f5562b535a", "p02619_v2_9a891e42e9c46b5f3297", "p02619_v2_f1c00f7e95d622403758", "p02619_v2_710d4c5a4c95dcb68dec", "p02619_v2_439934a48b010195dbcd", "p02619_v2_4c37cf7a7dffe9b33f12", "p02619_v2_c8fad05224bc16a1b361", "p02619_v2_94bb7ae7786707cb4819", "p02619_v2_b3aaed51d4273a3ddba7", "p02619_v2_923e8744ad333f07cb64", "p02619_v2_3366f1adb54ecf21860c", "p02619_v2_0b51cc642981f62d0357", "p02619_v2_8e243df56a059b7ad743", "p02619_v2_0a8cb716b509085fe4b0", "p02619_v2_3b76655f387f7cb6d2ab", "p02619_v2_20299f78a75b5a756735", "p02619_v2_35258a2e89d62fc747b7", "p02619_v2_c94c4b9b4349ad6555bc", "p02619_v2_82d82c4a4a2d2183a610", "p02619_v2_d65957a2498629e788ad", "p02619_v2_cd61595422151a528aa5", "p02619_v2_d520c6f8f3f4d009c27c", "p02619_v2_4942ad457c0812fc3998", "p02619_v2_592ad6d8afe1f286b012", "p02619_v2_88f615fd6f0c7cd063e8", "p02619_v2_6679f24e3b7857ca6d32", "p02619_v2_11435a6bd84618d89bc3", "p02619_v2_857222b39e874dca5a4b", "p02619_v2_82dfd729740a78ac73c6", "p02619_v2_d87a4f20bb0c6931f905", "p02619_v2_6a64dbf42d62a65fcc1d", "p02619_v2_babacbd289499ec0ef4d", "p02619_v2_9c068c7f4ca10041380f", "p02619_v2_5532e28a006d07cf62cf", "p02619_v2_e76e422d063bddc50a1f", "p02619_v2_28584da94df0912874ff", "p02619_v2_6ebe44795b5ec9b8e21d", "p02619_v2_c14cae75992aa93e75b8", "p02619_v2_bdce12ee0a07d9d30b58", "p02619_v2_9d1eceea3701f7462f2b", "p02619_v2_97eb955edc648882b88c", "p02619_v2_d105efd93f9223472ed6", "p02619_v2_4348b0c773fc04fab240", "p02619_v2_3a716d97d5adc38425d1", "p02619_v2_ce64eae3a4c1a2d7cc27", "p02619_v2_f9e870aa23e988febc60", "p02619_v2_94937661fb4430a22568", "p02619_v2_557ae170292f4ec040cc", "p02619_v2_8814fdf99bc803fc8e0c", "p02619_v2_9188b3f61f9e38da6bb2", "p02619_v2_746658d85cc29634ceaa", "p02619_v2_f4db407594deac9161c4", "p02619_v2_7202c8c24a6735e3305a", "p02619_v2_87e6dc866c355591194f", "p02619_v2_90793b392e65559b556d", "p02619_v2_8c53e7c0e7cd81f14876", "p02619_v2_ce531317332dfe8af29d", "p02619_v2_54d30225714f808b8394", "p02619_v2_d7591d957a11b4b18a7f", "p02619_v2_753bfc942a0618ae1f4e", "p02619_v2_7da054c5c0df8db3a7fa", "p02619_v2_a96f964491ca5e8c9c0c", "p02619_v2_e5201f8fcebe77f9e4d2", "p02619_v2_ca2955dbd7b011893c5e", "p02619_v2_b271f7c12ae1b71c0287"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "(\n d,\n *s,\n) = list(map(int, open(i := 0).read().split()))\nc, *l = [0] * 27\nfor v in s[-d:]:\n i += 1\n l[v - 1] = i\n print((c := c + s[i * 26 + v - 1] - sum(x * (i - y) for x, y in zip(s, l))))\n", "fast_code_sha256": "561e88c3bd1767dce128cfcce7ed569655c49a394129b24ee2a5ef31a23618fd", "fast_id": "p02619_561e88c3bd1767dce128cfcce7ed569655c49a394129b24ee2a5ef31a23618fd", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "(\n d,\n *s,\n) = list(map(int, open(i := 0).read().split()))\nc, *l = [0] * 27\nfor v in s[-d:]:\n i += 1\n l[v - 1] = i\n print((c := c + s[i * 26 + v - 1] - sum(x * (i - y) for x, y in zip(s, l))))\n", "measured_fast_code_sha256": "561e88c3bd1767dce128cfcce7ed569655c49a394129b24ee2a5ef31a23618fd", "measured_slow_code": "def read_input():\n D = int(eval(input()))\n C = input().split()\n C = [int(i) for i in C]\n S = [list(map(int, input().split())) for _ in range(D)]\n T = [int(eval(input())) for _ in range(D)]\n return D, C, S, T\n\n\ndef scoring(S, D, T, C):\n res = []\n last = [0 for _ in range(26)]\n final = 0\n for i in range(D):\n dec = 0\n for j in range(26):\n for loc, val in enumerate(T[: i + 1]):\n if val == j + 1:\n last[j] = loc + 1\n dec += C[j] * (i - last[j] + 1)\n final += S[i][T[i] - 1] - dec\n res.append(final)\n return res\n\n\nD, C, S, T = read_input()\nres = scoring(S, D, T, C)\nfor x in res:\n print(x)\n", "measured_slow_code_sha256": "d03c5b8a0cfad256289a0238b96e85a9483f201802ae221a6fa72a78e056a6e7", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 51.24487923359961, "pair_id": "python_v2_20632970ac8a09666b19229c", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02619", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02619_561e88c3bd1767dce128cfcce7ed569655c49a394129b24ee2a5ef31a23618fd.jsonl.gz", "inputs": "reproduction/python/inputs/p02619.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02619_d03c5b8a0cfad256289a0238b96e85a9483f201802ae221a6fa72a78e056a6e7.jsonl.gz"}, "slow_code": "def read_input():\n D = int(eval(input()))\n C = input().split()\n C = [int(i) for i in C]\n S = [list(map(int, input().split())) for _ in range(D)]\n T = [int(eval(input())) for _ in range(D)]\n return D, C, S, T\n\n\ndef scoring(S, D, T, C):\n res = []\n last = [0 for _ in range(26)]\n final = 0\n for i in range(D):\n dec = 0\n for j in range(26):\n for loc, val in enumerate(T[: i + 1]):\n if val == j + 1:\n last[j] = loc + 1\n dec += C[j] * (i - last[j] + 1)\n final += S[i][T[i] - 1] - dec\n res.append(final)\n return res\n\n\nD, C, S, T = read_input()\nres = scoring(S, D, T, C)\nfor x in res:\n print(x)\n", "slow_code_sha256": "d03c5b8a0cfad256289a0238b96e85a9483f201802ae221a6fa72a78e056a6e7", "slow_id": "p02619_d03c5b8a0cfad256289a0238b96e85a9483f201802ae221a6fa72a78e056a6e7", "speedup": 49.772358755899, "stratum": "8+", "within_pair_jaccard": 0.26666666666666666, "workload": {"case_count": 100, "description": "For a fixed schedule t_d of 26 contest types, output daily cumulative satisfaction, initially zero. On day d add s_d,t_d, then subtract sum_i c_i*(d-last_i), where last_i is the latest day of type i, or 0 if never held. Observed inputs: D=365; c_i=0..100; s_d_i=0..20000; t_d=1..26.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 57778, "median": 20062.0, "min": 19985}, "input_format": ["D\nc_1 ... c_26\ns_1,1 ... s_1,26\n...\ns_D,1 ... s_D,26\nt_1\n...\nt_D"], "input_format_status": "source_input_section", "input_lines": {"max": 732, "median": 732.0, "min": 732}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 9882, "median": 9882.0, "min": 9882}}} -{"case_ids": ["p02695_case_000", "p02695_case_001", "p02695_case_002", "p02695_case_003", "p02695_case_004", "p02695_case_005", "p02695_case_006", "p02695_case_007", "p02695_case_008", "p02695_case_009", "p02695_case_010", "p02695_case_011", "p02695_case_012", "p02695_case_013", "p02695_case_014", "p02695_case_015", "p02695_case_016", "p02695_case_017", "p02695_case_018", "p02695_case_019", "p02695_case_020", "p02695_case_021", "p02695_case_022", "p02695_case_023", "p02695_case_024", "p02695_case_025", "p02695_case_026", "p02695_case_027", "p02695_case_028", "p02695_case_029", "p02695_case_030", "p02695_case_031", "p02695_case_032", "p02695_case_033", "p02695_case_034", "p02695_case_035", "p02695_case_036", "p02695_case_037", "p02695_case_038", "p02695_case_039", "p02695_case_040", "p02695_case_041", "p02695_case_042", "p02695_case_043", "p02695_case_044", "p02695_case_045", "p02695_case_046", "p02695_case_047", "p02695_case_048", "p02695_case_049", "p02695_case_050", "p02695_case_051", "p02695_case_052", "p02695_case_053", "p02695_case_054", "p02695_case_055", "p02695_case_056", "p02695_case_057", "p02695_case_058", "p02695_case_059", "p02695_case_060", "p02695_case_061", "p02695_case_062", "p02695_case_063", "p02695_case_064", "p02695_case_065", "p02695_case_066", "p02695_case_067", "p02695_case_068", "p02695_case_069", "p02695_case_070", "p02695_case_071", "p02695_case_072", "p02695_case_073", "p02695_case_074", "p02695_case_075", "p02695_case_076", "p02695_case_077", "p02695_case_078", "p02695_case_079", "p02695_case_080", "p02695_case_081", "p02695_case_082", "p02695_case_083", "p02695_case_084", "p02695_case_085", "p02695_case_086", "p02695_case_087", "p02695_case_088", "p02695_case_089", "p02695_case_090", "p02695_case_091", "p02695_case_092", "p02695_case_093", "p02695_case_094", "p02695_case_095", "p02695_case_096", "p02695_case_097", "p02695_case_098", "p02695_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n, m, q = 0, 0, 0\nABCD = []\nans = 0\n\n\ndef dfs(ns):\n global ans\n A = [int(c) for c in ns.split()]\n if len(A) == n:\n s = 0\n for qi in range(q):\n a, b, c, d = ABCD[qi]\n if A[b - 1] - A[a - 1] == c:\n s += d\n ans = max(s, ans)\n return\n for i in range(A[-1], m + 1):\n dfs(\"{} {}\".format(ns, str(i)))\n\n\ndef main():\n global n, m, q, ABCD\n n, m, q = [int(e) for e in input().split()]\n ABCD = [[int(e) for e in input().split()] for i in range(q)]\n for mi in range(1, m + 1):\n dfs(str(mi))\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "7554bc3cb140323248a87ad408e68e2c799d4b9f01eafcc1c50d26273d0dfa92", "fast_id": "p02695_7554bc3cb140323248a87ad408e68e2c799d4b9f01eafcc1c50d26273d0dfa92", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n, m, q = 0, 0, 0\nABCD = []\nans = 0\n\n\ndef dfs(ns):\n global ans\n A = [int(c) for c in ns.split()]\n if len(A) == n:\n s = 0\n for qi in range(q):\n a, b, c, d = ABCD[qi]\n if A[b - 1] - A[a - 1] == c:\n s += d\n ans = max(s, ans)\n return\n for i in range(A[-1], m + 1):\n dfs(\"{} {}\".format(ns, str(i)))\n\n\ndef main():\n global n, m, q, ABCD\n n, m, q = [int(e) for e in input().split()]\n ABCD = [[int(e) for e in input().split()] for i in range(q)]\n for mi in range(1, m + 1):\n dfs(str(mi))\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "7554bc3cb140323248a87ad408e68e2c799d4b9f01eafcc1c50d26273d0dfa92", "measured_slow_code": "n, m, q = list(map(int, input().split()))\nl = []\nfor i in range(q):\n l1, l2, l3, l4 = list(map(int, input().split()))\n l.append([l1, l2, l3, l4])\nB = []\nfor a in range(1, m + 1):\n for b in range(a, m + 1):\n for c in range(b, m + 1):\n for d in range(c, m + 1):\n for e in range(d, m + 1):\n for f in range(e, m + 1):\n for g in range(f, m + 1):\n for h in range(g, m + 1):\n for i in range(h, m + 1):\n for j in range(i, m + 1):\n L = [a, b, c, d, e, f, g, h, i, j]\n A = []\n for I in range(n):\n A.append(L[I])\n C = 0\n for k in range(q):\n if (\n A[l[k][1] - 1] - A[l[k][0] - 1]\n == l[k][2]\n ):\n C += l[k][3]\n B.append(C)\nprint((max(B)))\n", "measured_slow_code_sha256": "4876c20eabffbc9ea2c633c2d996da20261178a9a9451926be7fe13405bb8582", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.5292726714254787, "pair_id": "python_v2_e00ab6a4c7eddfb0f4b15021", "per_case_slow_code_faster_fraction": 0.04, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02695", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02695_7554bc3cb140323248a87ad408e68e2c799d4b9f01eafcc1c50d26273d0dfa92.jsonl.gz", "inputs": "reproduction/python/inputs/p02695.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02695_4876c20eabffbc9ea2c633c2d996da20261178a9a9451926be7fe13405bb8582.jsonl.gz"}, "slow_code": "n, m, q = list(map(int, input().split()))\nl = []\nfor i in range(q):\n l1, l2, l3, l4 = list(map(int, input().split()))\n l.append([l1, l2, l3, l4])\nB = []\nfor a in range(1, m + 1):\n for b in range(a, m + 1):\n for c in range(b, m + 1):\n for d in range(c, m + 1):\n for e in range(d, m + 1):\n for f in range(e, m + 1):\n for g in range(f, m + 1):\n for h in range(g, m + 1):\n for i in range(h, m + 1):\n for j in range(i, m + 1):\n L = [a, b, c, d, e, f, g, h, i, j]\n A = []\n for I in range(n):\n A.append(L[I])\n C = 0\n for k in range(q):\n if (\n A[l[k][1] - 1] - A[l[k][0] - 1]\n == l[k][2]\n ):\n C += l[k][3]\n B.append(C)\nprint((max(B)))\n", "slow_code_sha256": "4876c20eabffbc9ea2c633c2d996da20261178a9a9451926be7fe13405bb8582", "slow_id": "p02695_4876c20eabffbc9ea2c633c2d996da20261178a9a9451926be7fe13405bb8582", "speedup": 4.638584975248677, "stratum": "4-8", "within_pair_jaccard": 0.375, "workload": {"case_count": 100, "description": "Choose integers 1<=A_1<=...<=A_N<=M to maximize score. Each of Q distinct conditions (a_i,b_i,c_i) awards d_i when A_b_i-A_a_i=c_i. Observed inputs: N=2..10 (median 5); M=1..10 (median 5); Q=1..50 (median 10); c_i=0..9; d_i=1..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 676, "median": 132.0, "min": 14}, "input_format": ["N M Q\na_1 b_1 c_1 d_1\n...\na_Q b_Q c_Q d_Q"], "input_format_status": "source_input_section", "input_lines": {"max": 51, "median": 11.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 203, "median": 43.0, "min": 7}}} -{"case_ids": ["p02707_case_000", "p02707_case_001", "p02707_case_002", "p02707_case_003", "p02707_case_004", "p02707_case_005", "p02707_case_006", "p02707_case_007", "p02707_case_008", "p02707_case_009", "p02707_case_010", "p02707_case_011", "p02707_case_012", "p02707_case_013", "p02707_case_014", "p02707_case_015", "p02707_case_016", "p02707_case_017", "p02707_case_018", "p02707_case_019", "p02707_case_020", "p02707_case_021", "p02707_case_022", "p02707_case_023", "p02707_case_024", "p02707_case_025", "p02707_case_026", "p02707_case_027", "p02707_case_028", "p02707_case_029", "p02707_case_030", "p02707_case_031", "p02707_case_032", "p02707_case_033", "p02707_case_034", "p02707_case_035", "p02707_case_036", "p02707_case_037", "p02707_case_038", "p02707_case_039", "p02707_case_040", "p02707_case_041", "p02707_case_042", "p02707_case_043", "p02707_case_044", "p02707_case_045", "p02707_case_046", "p02707_case_047", "p02707_case_048", "p02707_case_049", "p02707_case_050", "p02707_case_051", "p02707_case_052", "p02707_case_053", "p02707_case_054", "p02707_case_055", "p02707_case_056", "p02707_case_057", "p02707_case_058", "p02707_case_059", "p02707_case_060", "p02707_case_061", "p02707_case_062", "p02707_case_063", "p02707_case_064", "p02707_case_065", "p02707_case_066", "p02707_case_067", "p02707_case_068", "p02707_case_069", "p02707_case_070", "p02707_case_071", "p02707_case_072", "p02707_case_073", "p02707_case_074", "p02707_case_075", "p02707_case_076", "p02707_case_077", "p02707_case_078", "p02707_case_079", "p02707_case_080", "p02707_case_081", "p02707_case_082", "p02707_case_083", "p02707_case_084", "p02707_case_085", "p02707_case_086", "p02707_case_087", "p02707_case_088", "p02707_case_089", "p02707_case_090", "p02707_case_091", "p02707_case_092", "p02707_case_093", "p02707_case_094", "p02707_case_095", "p02707_case_096", "p02707_case_097", "p02707_case_098", "p02707_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "a = int(eval(input()))\nb = [0] * a\nfor c in map(int, input().split()):\n b[c - 1] = b[c - 1] + 1\nprint((\"\\n\".join(map(str, b))))\n", "fast_code_sha256": "77f76a38867beb641e47757dba2bd5b430b6e0e083272ea4226efd20efb0d38e", "fast_id": "p02707_77f76a38867beb641e47757dba2bd5b430b6e0e083272ea4226efd20efb0d38e", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "a = int(eval(input()))\nb = [0] * a\nfor c in map(int, input().split()):\n b[c - 1] = b[c - 1] + 1\nprint((\"\\n\".join(map(str, b))))\n", "measured_fast_code_sha256": "77f76a38867beb641e47757dba2bd5b430b6e0e083272ea4226efd20efb0d38e", "measured_slow_code": "import sys\nfrom collections import *\nimport heapq\nimport math\nfrom math import gcd\nimport bisect\nimport copy\nfrom itertools import permutations, accumulate, combinations, product\n\n\ndef input():\n return sys.stdin.readline()[:-1]\n\n\ndef ruiseki(lst):\n return [0] + list(accumulate(lst))\n\n\nmod = pow(10, 9) + 7\nal = [chr(ord(\"a\") + i) for i in range(26)]\ndirection = [[1, 0], [0, 1], [-1, 0], [0, -1]]\nn = int(eval(input()))\na = list(map(int, input().split()))\nlst = [0] * n\nfor i in range(n - 1):\n lst[a[i] - 1] += 1\n# print(lst)\nfor i in range(n):\n print((lst[i]))\n", "measured_slow_code_sha256": "3be6889cc1da356348ac3376a8ed377db1511d6ce756e917ddc4f3cacad06f9f", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.5803932115008386, "pair_id": "python_v2_6096ead9cbae6b6de1f4280c", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02707", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02707_77f76a38867beb641e47757dba2bd5b430b6e0e083272ea4226efd20efb0d38e.jsonl.gz", "inputs": "reproduction/python/inputs/p02707.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02707_3be6889cc1da356348ac3376a8ed377db1511d6ce756e917ddc4f3cacad06f9f.jsonl.gz"}, "slow_code": "import sys\nfrom collections import *\nimport heapq\nimport math\nfrom math import gcd\nimport bisect\nimport copy\nfrom itertools import permutations, accumulate, combinations, product\n\n\ndef input():\n return sys.stdin.readline()[:-1]\n\n\ndef ruiseki(lst):\n return [0] + list(accumulate(lst))\n\n\nmod = pow(10, 9) + 7\nal = [chr(ord(\"a\") + i) for i in range(26)]\ndirection = [[1, 0], [0, 1], [-1, 0], [0, -1]]\nn = int(eval(input()))\na = list(map(int, input().split()))\nlst = [0] * n\nfor i in range(n - 1):\n lst[a[i] - 1] += 1\n\nfor i in range(n):\n print((lst[i]))\n", "slow_code_sha256": "87d845843925bd36d2bcc668988b66897308640bf2bd99fe70876b0c70842fff", "slow_id": "p02707_3be6889cc1da356348ac3376a8ed377db1511d6ce756e917ddc4f3cacad06f9f", "speedup": 2.6483423128265673, "stratum": "2-4", "within_pair_jaccard": 0.24489795918367346, "workload": {"case_count": 100, "description": "A company has N numbered members. For member i=2..N, A_i= 1:\n flag = False\n d[W[i]] += 1\nprint((\"Yes\" if flag else \"No\"))\n", "measured_slow_code_sha256": "b8edf8bfe255e97eaa522659a47a80fed76af05861a73db78ecf2fbd1a8cfe7e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.28906185096785, "pair_id": "python_v2_3939c5d4197a717415e211a2", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03261", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03261_99938145e05c0376cad61014c8a3b1feb7f67f3925290a03f59f3deb571e152a.jsonl.gz", "inputs": "reproduction/python/inputs/p03261.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03261_b8edf8bfe255e97eaa522659a47a80fed76af05861a73db78ecf2fbd1a8cfe7e.jsonl.gz"}, "slow_code": "import sys\n\nstdin = sys.stdin\ninf = 1 << 60\nmod = 1000000007\nni = lambda: int(ns())\nnin = lambda y: [ni() for _ in range(y)]\nna = lambda: list(map(int, stdin.readline().split()))\nnan = lambda y: [na() for _ in range(y)]\nns = lambda: stdin.readline().rstrip()\nnsn = lambda y: [ns() for _ in range(y)]\nncl = lambda y: [list(ns()) for _ in range(y)]\nnas = lambda: stdin.readline().split()\nfrom collections import defaultdict\n\nN = ni()\nW = nsn(N)\nd = defaultdict(int)\nflag = True\nfor i in range(N):\n if i and W[i - 1][-1] != W[i][0]:\n flag = False\n if d[W[i]] >= 1:\n flag = False\n d[W[i]] += 1\nprint((\"Yes\" if flag else \"No\"))\n", "slow_code_sha256": "b8edf8bfe255e97eaa522659a47a80fed76af05861a73db78ecf2fbd1a8cfe7e", "slow_id": "p03261_b8edf8bfe255e97eaa522659a47a80fed76af05861a73db78ecf2fbd1a8cfe7e", "speedup": 2.0434916376008183, "stratum": "2-4", "within_pair_jaccard": 0.2777777777777778, "workload": {"case_count": 100, "description": "Check whether N lowercase words form a valid word-chain history: each word after the first starts with the preceding word last letter, and no whole word is repeated. Invalid histories are legal inputs. Observed inputs: N=2..100 (median 10); word_length=1..10.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1104, "median": 113.0, "min": 6}, "input_format": ["N\nW_1\n...\nW_N"], "input_format_status": "source_input_section", "input_lines": {"max": 101, "median": 11.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 101, "median": 11.0, "min": 3}}} -{"case_ids": ["p02700_case_000", "p02700_case_001", "p02700_case_002", "p02700_case_003", "p02700_case_004", "p02700_case_005", "p02700_case_006", "p02700_case_007", "p02700_case_008", "p02700_case_009", "p02700_case_010", "p02700_case_011", "p02700_case_012", "p02700_case_013", "p02700_case_014", "p02700_case_015", "p02700_case_016", "p02700_case_017", "p02700_case_018", "p02700_case_019", "p02700_case_020", "p02700_case_021", "p02700_case_022", "p02700_case_023", "p02700_case_024", "p02700_case_025", "p02700_case_026", "p02700_case_027", "p02700_case_028", "p02700_case_029", "p02700_case_030", "p02700_case_031", "p02700_case_032", "p02700_case_033", "p02700_case_034", "p02700_case_035", "p02700_case_036", "p02700_case_037", "p02700_case_038", "p02700_case_039", "p02700_case_040", "p02700_case_041", "p02700_case_042", "p02700_case_043", "p02700_case_044", "p02700_case_045", "p02700_case_046", "p02700_case_047", "p02700_case_048", "p02700_case_049", "p02700_case_050", "p02700_case_051", "p02700_case_052", "p02700_case_053", "p02700_case_054", "p02700_case_055", "p02700_case_056", "p02700_case_057", "p02700_case_058", "p02700_case_059", "p02700_case_060", "p02700_case_061", "p02700_case_062", "p02700_case_063", "p02700_case_064", "p02700_case_065", "p02700_case_066", "p02700_case_067", "p02700_case_068", "p02700_case_069", "p02700_case_070", "p02700_case_071", "p02700_case_072", "p02700_case_073", "p02700_case_074", "p02700_case_075", "p02700_case_076", "p02700_case_077", "p02700_case_078", "p02700_case_079", "p02700_case_080", "p02700_case_081", "p02700_case_082", "p02700_case_083", "p02700_case_084", "p02700_case_085", "p02700_case_086", "p02700_case_087", "p02700_case_088", "p02700_case_089", "p02700_case_090", "p02700_case_091", "p02700_case_092", "p02700_case_093", "p02700_case_094", "p02700_case_095", "p02700_case_096", "p02700_case_097", "p02700_case_098", "p02700_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "nums = [int(e) for e in input().split()]\nif nums[2] % nums[1] == 0:\n A = nums[2] // nums[1]\nelse:\n A = nums[2] // nums[1] + 1\nif nums[0] % nums[3] == 0:\n T = nums[0] // nums[3]\nelse:\n T = nums[0] // nums[3] + 1\nif A <= T:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "fast_code_sha256": "5ed51c5591fb6d78749d63d02ede62c1930e40cf42990c8a1a3e4ad39cac9c2e", "fast_id": "p02700_5ed51c5591fb6d78749d63d02ede62c1930e40cf42990c8a1a3e4ad39cac9c2e", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "nums = [int(e) for e in input().split()]\nif nums[2] % nums[1] == 0:\n A = nums[2] // nums[1]\nelse:\n A = nums[2] // nums[1] + 1\nif nums[0] % nums[3] == 0:\n T = nums[0] // nums[3]\nelse:\n T = nums[0] // nums[3] + 1\nif A <= T:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "measured_fast_code_sha256": "5ed51c5591fb6d78749d63d02ede62c1930e40cf42990c8a1a3e4ad39cac9c2e", "measured_slow_code": "from math import floor, ceil, sqrt, factorial, log\nfrom collections import Counter, deque\nfrom functools import reduce\n\n# import numpy as np\ndef S():\n return eval(input())\n\n\ndef I():\n return int(eval(input()))\n\n\ndef MS():\n return list(map(str, input().split()))\n\n\ndef MI():\n return list(map(int, input().split()))\n\n\ndef FLI():\n return [int(i) for i in input().split()]\n\n\ndef LS():\n return list(MS())\n\n\ndef LI():\n return list(MI())\n\n\ndef LLS():\n return [list(map(str, l.split())) for l in eval(input())]\n\n\ndef LLI():\n return [list(map(int, l.split())) for l in eval(input())]\n\n\ndef LLSN(n: int):\n return [LS() for _ in range(n)]\n\n\ndef LLIN(n: int):\n return [LI() for _ in range(n)]\n\n\nA, B, C, D = MI()\nx = -(-A // D)\ny = -(-C // B)\nif x >= y:\n print(\"Yes\")\nelse:\n print(\"No\")\n# for i in range(100):\n# a -= B\n# if a <= 0:\n# print(\"Yes\")\n# exit()\n# t -= D\n# if t <= 0:\n# print(\"No\")\n# exit()\n", "measured_slow_code_sha256": "0800076b3be1d259d89fb0c2c371b4341f1c7fc8f7058a2f3f090ffddebf2dcb", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.051700964060956, "pair_id": "python_v2_a321a36f3c710967e82a700a", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02700", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02700_5ed51c5591fb6d78749d63d02ede62c1930e40cf42990c8a1a3e4ad39cac9c2e.jsonl.gz", "inputs": "reproduction/python/inputs/p02700.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02700_0800076b3be1d259d89fb0c2c371b4341f1c7fc8f7058a2f3f090ffddebf2dcb.jsonl.gz"}, "slow_code": "from math import floor, ceil, sqrt, factorial, log\nfrom collections import Counter, deque\nfrom functools import reduce\n\n\ndef S():\n return eval(input())\n\n\ndef I():\n return int(eval(input()))\n\n\ndef MS():\n return list(map(str, input().split()))\n\n\ndef MI():\n return list(map(int, input().split()))\n\n\ndef FLI():\n return [int(i) for i in input().split()]\n\n\ndef LS():\n return list(MS())\n\n\ndef LI():\n return list(MI())\n\n\ndef LLS():\n return [list(map(str, l.split())) for l in eval(input())]\n\n\ndef LLI():\n return [list(map(int, l.split())) for l in eval(input())]\n\n\ndef LLSN(n: int):\n return [LS() for _ in range(n)]\n\n\ndef LLIN(n: int):\n return [LI() for _ in range(n)]\n\n\nA, B, C, D = MI()\nx = -(-A // D)\ny = -(-C // B)\nif x >= y:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "slow_code_sha256": "7feb6456d377ecdd9b0dcbfc30f9b0e6286836e7cba34a2d795c5cf979e98297", "slow_id": "p02700_0800076b3be1d259d89fb0c2c371b4341f1c7fc8f7058a2f3f090ffddebf2dcb", "speedup": 3.0511366785680796, "stratum": "2-4", "within_pair_jaccard": 0.1896551724137931, "workload": {"case_count": 100, "description": "Two monsters have health/attack (A,B) and (C,D). Starting with the first monster, they attack alternately, subtracting their attack value from the opponent health. Determine whether the first wins by reducing opposing health to at most zero. Observed inputs: A=1..100 (median 73); B=1..100 (median 48.5); C=1..100 (median 80.5); D=1..100 (median 55).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 16, "median": 12.0, "min": 8}, "input_format": ["A B C D"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 4, "median": 4.0, "min": 4}}} -{"case_ids": ["p02641_case_000", "p02641_case_001", "p02641_case_002", "p02641_case_003", "p02641_case_004", "p02641_case_005", "p02641_case_006", "p02641_case_007", "p02641_case_008", "p02641_case_009", "p02641_case_010", "p02641_case_011", "p02641_case_012", "p02641_case_013", "p02641_case_014", "p02641_case_015", "p02641_case_016", "p02641_case_017", "p02641_case_018", "p02641_case_019", "p02641_case_020", "p02641_case_021", "p02641_case_022", "p02641_case_023", "p02641_case_024", "p02641_case_025", "p02641_case_026", "p02641_case_027", "p02641_case_028", "p02641_case_029", "p02641_case_030", "p02641_case_031", "p02641_case_032", "p02641_case_033", "p02641_case_034", "p02641_case_035", "p02641_case_036", "p02641_case_037", "p02641_case_038", "p02641_case_039", "p02641_case_040", "p02641_case_041", "p02641_case_042", "p02641_case_043", "p02641_case_044", "p02641_case_045", "p02641_case_046", "p02641_case_047", "p02641_case_048", "p02641_case_049", "p02641_case_050", "p02641_case_051", "p02641_case_052", "p02641_case_053", "p02641_case_054", "p02641_case_055", "p02641_case_056", "p02641_case_057", "p02641_case_058", "p02641_case_059", "p02641_case_060", "p02641_case_061", "p02641_case_062", "p02641_case_063", "p02641_case_064", "p02641_case_065", "p02641_case_066", "p02641_case_067", "p02641_case_068", "p02641_case_069", "p02641_case_070", "p02641_case_071", "p02641_case_072", "p02641_case_073", "p02641_case_074", "p02641_case_075", "p02641_case_076", "p02641_case_077", "p02641_case_078", "p02641_case_079", "p02641_case_080", "p02641_case_081", "p02641_case_082", "p02641_case_083", "p02641_case_084", "p02641_case_085", "p02641_case_086", "p02641_case_087", "p02641_case_088", "p02641_case_089", "p02641_case_090", "p02641_case_091", "p02641_case_092", "p02641_case_093", "p02641_case_094", "p02641_case_095", "p02641_case_096", "p02641_case_097", "p02641_case_098", "p02641_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "X, N = list(map(int, input().split(\" \")))\nif N == 0:\n print(X)\nelse:\n ls = list(map(int, input().split(\" \")))\n diff, rst = -1, 0\n for i in range(101, -1, -1):\n if i not in ls:\n if diff == -1:\n diff = abs(X - i)\n rst = i\n else:\n diff = min(diff, abs(X - i))\n if diff == abs(X - i):\n rst = i\n print(rst)\n", "fast_code_sha256": "73f81bfe3cb241240b7ea9c5a7ec2fd84bd8cb3a3a87d58f323808d83634787e", "fast_id": "p02641_73f81bfe3cb241240b7ea9c5a7ec2fd84bd8cb3a3a87d58f323808d83634787e", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "X, N = list(map(int, input().split(\" \")))\nif N == 0:\n print(X)\nelse:\n ls = list(map(int, input().split(\" \")))\n diff, rst = -1, 0\n for i in range(101, -1, -1):\n if i not in ls:\n if diff == -1:\n diff = abs(X - i)\n rst = i\n else:\n diff = min(diff, abs(X - i))\n if diff == abs(X - i):\n rst = i\n print(rst)\n", "measured_fast_code_sha256": "73f81bfe3cb241240b7ea9c5a7ec2fd84bd8cb3a3a87d58f323808d83634787e", "measured_slow_code": "x, n = list(map(int, input().split()))\nif n == 0:\n print(x)\n exit()\narr = list(map(int, input().split())) # p1 ... pn\narr2 = []\narr3 = []\nfor i in range(-50, 110):\n if not i in arr:\n arr2.append(i)\n arr3.append(abs(x - i))\nn2 = min([i for i, v in enumerate(arr3) if v == min(arr3)])\nprint((arr2[n2]))\n", "measured_slow_code_sha256": "56a803f01b0149391407a67301955076fc165a7ad3ad3f8f8a9f51ab5d8af60e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.9592176543743771, "pair_id": "python_v2_3aa54dee91a5930298851651", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02641", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02641_73f81bfe3cb241240b7ea9c5a7ec2fd84bd8cb3a3a87d58f323808d83634787e.jsonl.gz", "inputs": "reproduction/python/inputs/p02641.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02641_56a803f01b0149391407a67301955076fc165a7ad3ad3f8f8a9f51ab5d8af60e.jsonl.gz"}, "slow_code": "x, n = list(map(int, input().split()))\nif n == 0:\n print(x)\n exit()\narr = list(map(int, input().split()))\narr2 = []\narr3 = []\nfor i in range(-50, 110):\n if not i in arr:\n arr2.append(i)\n arr3.append(abs(x - i))\nn2 = min([i for i, v in enumerate(arr3) if v == min(arr3)])\nprint((arr2[n2]))\n", "slow_code_sha256": "85cbb5049fb6ba315c1cc49d08aa7371cf037161b52bac8a421580f3486b7f72", "slow_id": "p02641_56a803f01b0149391407a67301955076fc165a7ad3ad3f8f8a9f51ab5d8af60e", "speedup": 2.048270642276373, "stratum": "2-4", "within_pair_jaccard": 0.42857142857142855, "workload": {"case_count": 100, "description": "Find an integer not in the N distinct forbidden values p_i that is closest to X. Integers need not be positive; ties favor the smaller integer. Observed inputs: X=1..100 (median 50); N=0..100 (median 99); p_i=1..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 300, "median": 295.0, "min": 4}, "input_format": ["X N\np_1 ... p_N (line omitted if N=0)"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 102, "median": 101.0, "min": 2}}} -{"case_ids": ["p03037_case_000", "p03037_case_001", "p03037_case_002", "p03037_case_003", "p03037_case_004", "p03037_case_005", "p03037_case_006", "p03037_case_007", "p03037_case_008", "p03037_case_009", "p03037_case_010", "p03037_case_011", "p03037_case_012", "p03037_case_013", "p03037_case_014", "p03037_case_015", "p03037_case_016", "p03037_case_017", "p03037_case_018", "p03037_case_019", "p03037_case_020", "p03037_case_021", "p03037_case_022", "p03037_case_023", "p03037_case_024", "p03037_case_025", "p03037_case_026", "p03037_case_027", "p03037_case_028", "p03037_case_029", "p03037_case_030", "p03037_case_031", "p03037_case_032", "p03037_case_033", "p03037_case_034", "p03037_case_035", "p03037_case_036", "p03037_case_037", "p03037_case_038", "p03037_case_039", "p03037_case_040", "p03037_case_041", "p03037_case_042", "p03037_case_043", "p03037_case_044", "p03037_case_045", "p03037_case_046", "p03037_case_047", "p03037_case_048", "p03037_case_049", "p03037_case_050", "p03037_case_051", "p03037_case_052", "p03037_case_053", "p03037_case_054", "p03037_case_055", "p03037_case_056", "p03037_case_057", "p03037_case_058", "p03037_case_059", "p03037_case_060", "p03037_case_061", "p03037_case_062", "p03037_case_063", "p03037_case_064", "p03037_case_065", "p03037_case_066", "p03037_case_067", "p03037_case_068", "p03037_case_069", "p03037_case_070", "p03037_case_071", "p03037_case_072", "p03037_case_073", "p03037_case_074", "p03037_case_075", "p03037_case_076", "p03037_case_077", "p03037_case_078", "p03037_case_079", "p03037_case_080", "p03037_case_081", "p03037_case_082", "p03037_case_083", "p03037_case_084", "p03037_case_085", "p03037_case_086", "p03037_case_087", "p03037_case_088", "p03037_case_089", "p03037_case_090", "p03037_case_091", "p03037_case_092", "p03037_case_093", "p03037_case_094", "p03037_case_095", "p03037_case_096", "p03037_case_097", "p03037_case_098", "p03037_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n, m = list(map(int, input().split()))\nml = 0\nmr = 100000\nfor i in range(m):\n l, r = list(map(int, input().split()))\n ml = max(ml, l)\n mr = min(mr, r)\n if ml > mr:\n break\nif ml <= mr:\n print((mr - ml + 1))\nelse:\n print((0))\n", "fast_code_sha256": "f3575c8caba839cd5c99e68ff2a16b8d1073b901acb6bf3a93309e7bf2c60891", "fast_id": "p03037_f3575c8caba839cd5c99e68ff2a16b8d1073b901acb6bf3a93309e7bf2c60891", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n, m = list(map(int, input().split()))\nml = 0\nmr = 100000\nfor i in range(m):\n l, r = list(map(int, input().split()))\n ml = max(ml, l)\n mr = min(mr, r)\n if ml > mr:\n break\nif ml <= mr:\n print((mr - ml + 1))\nelse:\n print((0))\n", "measured_fast_code_sha256": "f3575c8caba839cd5c99e68ff2a16b8d1073b901acb6bf3a93309e7bf2c60891", "measured_slow_code": "import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, queue, copy\n\nsys.setrecursionlimit(10**7)\ninf = 10**20\nmod = 10**9 + 7\ndd = [(-1, 0), (0, 1), (1, 0), (0, -1)]\nddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef LI_():\n return [int(x) - 1 for x in sys.stdin.readline().split()]\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LS():\n return sys.stdin.readline().split()\n\n\ndef S():\n return eval(input())\n\n\ndef main():\n n, k = LI()\n l = [0] * (n + 1)\n for _ in range(k):\n a, b = LI()\n l[a - 1] += 1\n l[b] -= 1\n for i in range(n - 1):\n l[i + 1] += l[i]\n ans = 0\n for x in l[:-1]:\n if x == k:\n ans += 1\n return ans\n\n\nprint((main()))\n", "measured_slow_code_sha256": "603682b2a1acebd824f0081d6dbfdc82575d41c2aa8f541e6ca8387c5cde8833", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 34.91736745232568, "pair_id": "python_v2_1e63e8db3b3b2308d7e7106f", "per_case_slow_code_faster_fraction": 0.2, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03037", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03037_f3575c8caba839cd5c99e68ff2a16b8d1073b901acb6bf3a93309e7bf2c60891.jsonl.gz", "inputs": "reproduction/python/inputs/p03037.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03037_603682b2a1acebd824f0081d6dbfdc82575d41c2aa8f541e6ca8387c5cde8833.jsonl.gz"}, "slow_code": "import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, queue, copy\n\nsys.setrecursionlimit(10**7)\ninf = 10**20\nmod = 10**9 + 7\ndd = [(-1, 0), (0, 1), (1, 0), (0, -1)]\nddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef LI_():\n return [int(x) - 1 for x in sys.stdin.readline().split()]\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LS():\n return sys.stdin.readline().split()\n\n\ndef S():\n return eval(input())\n\n\ndef main():\n n, k = LI()\n l = [0] * (n + 1)\n for _ in range(k):\n a, b = LI()\n l[a - 1] += 1\n l[b] -= 1\n for i in range(n - 1):\n l[i + 1] += l[i]\n ans = 0\n for x in l[:-1]:\n if x == k:\n ans += 1\n return ans\n\n\nprint((main()))\n", "slow_code_sha256": "603682b2a1acebd824f0081d6dbfdc82575d41c2aa8f541e6ca8387c5cde8833", "slow_id": "p03037_603682b2a1acebd824f0081d6dbfdc82575d41c2aa8f541e6ca8387c5cde8833", "speedup": 38.91631952347901, "stratum": "8+", "within_pair_jaccard": 0.2, "workload": {"case_count": 100, "description": "There are N numbered access cards and M gates. Gate i accepts card IDs in inclusive interval [L_i,R_i]. Count individual cards that each permit passage through every gate. Observed inputs: N=1..100000 (median 99999); M=1..100000 (median 1000); L_i=1..100000; R_i=1..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1200014, "median": 7912.0, "min": 8}, "input_format": ["N M\nL_1 R_1\n...\nL_M R_M"], "input_format_status": "source_input_section", "input_lines": {"max": 100001, "median": 1001.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200002, "median": 2002.0, "min": 4}}} -{"case_ids": ["p02883_case_000", "p02883_case_001", "p02883_case_002", "p02883_case_003", "p02883_case_004", "p02883_case_005", "p02883_case_006", "p02883_case_007", "p02883_case_008", "p02883_case_009", "p02883_case_010", "p02883_case_011", "p02883_case_012", "p02883_case_013", "p02883_case_014", "p02883_case_015", "p02883_case_016", "p02883_case_017", "p02883_case_018", "p02883_case_019", "p02883_case_020", "p02883_case_021", "p02883_case_022", "p02883_case_023", "p02883_case_024", "p02883_case_025", "p02883_case_026", "p02883_case_027", "p02883_case_028", "p02883_case_029", "p02883_case_030", "p02883_case_031", "p02883_case_032", "p02883_case_033", "p02883_case_034", "p02883_case_035", "p02883_case_036", "p02883_case_037", "p02883_case_038", "p02883_case_039", "p02883_case_040", "p02883_case_041", "p02883_case_042", "p02883_case_043", "p02883_case_044", "p02883_case_045", "p02883_case_046", "p02883_case_047", "p02883_case_048", "p02883_case_049", "p02883_case_050", "p02883_case_051", "p02883_case_052", "p02883_case_053", "p02883_case_054", "p02883_case_055", "p02883_case_056", "p02883_case_057", "p02883_case_058", "p02883_case_059", "p02883_case_060", "p02883_case_061", "p02883_case_062", "p02883_case_063", "p02883_case_064", "p02883_case_065", "p02883_case_066", "p02883_case_067", "p02883_case_068", "p02883_case_069", "p02883_case_070", "p02883_case_071", "p02883_case_072", "p02883_case_073", "p02883_case_074", "p02883_case_075", "p02883_case_076", "p02883_case_077", "p02883_case_078", "p02883_case_079", "p02883_case_080", "p02883_case_081", "p02883_case_082", "p02883_case_083", "p02883_case_084", "p02883_case_085", "p02883_case_086", "p02883_case_087", "p02883_case_088", "p02883_case_089", "p02883_case_090", "p02883_case_091", "p02883_case_092", "p02883_case_093", "p02883_case_094", "p02883_case_095", "p02883_case_096", "p02883_case_097", "p02883_case_098", "p02883_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\nread = sys.stdin.read\nreadline = sys.stdin.readline\nreadlines = sys.stdin.readlines\nsys.setrecursionlimit(10**9)\nINF = 1 << 60\nMOD = 1000000007\n\n\ndef main():\n N, K, *AF = list(map(int, read().split()))\n A = AF[:N]\n F = AF[N:]\n A.sort()\n F.sort(reverse=True)\n C = [a * f for a, f in zip(A, F)]\n\n def is_ok(cost):\n k = 0\n for c, f in zip(C, F):\n if c > cost:\n k += (c - cost + f - 1) // f\n return k <= K\n\n ok = max(C)\n ng = -1\n while ok - ng > 1:\n mid = (ok + ng) // 2\n if is_ok(mid):\n ok = mid\n else:\n ng = mid\n print(ok)\n return\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "78e07429bd6b18a24bb9452bffb214fae3238ca75d7395c732e7197d41429249", "fast_id": "p02883_78e07429bd6b18a24bb9452bffb214fae3238ca75d7395c732e7197d41429249", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\nread = sys.stdin.read\nreadline = sys.stdin.readline\nreadlines = sys.stdin.readlines\nsys.setrecursionlimit(10**9)\nINF = 1 << 60\nMOD = 1000000007\n\n\ndef main():\n N, K, *AF = list(map(int, read().split()))\n A = AF[:N]\n F = AF[N:]\n A.sort()\n F.sort(reverse=True)\n C = [a * f for a, f in zip(A, F)]\n\n def is_ok(cost):\n k = 0\n for c, f in zip(C, F):\n if c > cost:\n k += (c - cost + f - 1) // f\n return k <= K\n\n ok = max(C)\n ng = -1\n while ok - ng > 1:\n mid = (ok + ng) // 2\n if is_ok(mid):\n ok = mid\n else:\n ng = mid\n print(ok)\n return\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "78e07429bd6b18a24bb9452bffb214fae3238ca75d7395c732e7197d41429249", "measured_slow_code": "import math\n\nN, K = list(map(int, input().split()))\nX = [\n (b, a * b)\n for a, b in zip(\n sorted(list(map(int, input().split()))),\n sorted(list(map(int, input().split())))[::-1],\n )\n]\nm, M, i = 0, 10**12, 1\nexec(\n \"i,M,m=((i+m)//2,i,m) if sum(math.ceil(max(0,c-i)/b)for b, c in X)<=K else((i+M)//2,M,i);\"\n * 50\n)\nprint(M)\n", "measured_slow_code_sha256": "89d6694c33292de91a1011c40ba1f43b8a55e43ab7d13d625a0ff741f7a3effc", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 9.835964321256514, "pair_id": "python_v2_e88a5a053c8c90af0ad13711", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02883", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02883_78e07429bd6b18a24bb9452bffb214fae3238ca75d7395c732e7197d41429249.jsonl.gz", "inputs": "reproduction/python/inputs/p02883.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02883_89d6694c33292de91a1011c40ba1f43b8a55e43ab7d13d625a0ff741f7a3effc.jsonl.gz"}, "slow_code": "import math\n\nN, K = list(map(int, input().split()))\nX = [\n (b, a * b)\n for a, b in zip(\n sorted(list(map(int, input().split()))),\n sorted(list(map(int, input().split())))[::-1],\n )\n]\nm, M, i = 0, 10**12, 1\nexec(\n \"i,M,m=((i+m)//2,i,m) if sum(math.ceil(max(0,c-i)/b)for b, c in X)<=K else((i+M)//2,M,i);\"\n * 50\n)\nprint(M)\n", "slow_code_sha256": "89d6694c33292de91a1011c40ba1f43b8a55e43ab7d13d625a0ff741f7a3effc", "slow_id": "p02883_89d6694c33292de91a1011c40ba1f43b8a55e43ab7d13d625a0ff741f7a3effc", "speedup": 7.112534443362789, "stratum": "4-8", "within_pair_jaccard": 0.2459016393442623, "workload": {"case_count": 100, "description": "Assign N people bijectively to N foods to minimize the longest finishing time. Person i has coefficient A_i; food j takes A_i*F_j time. At most K training steps may each reduce a coefficient by 1, never below zero. Observed inputs: N=1..200000 (median 10); K=0..1000000000000000000; A_i=1..1000000; F_i=1..1000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 3200027, "median": 147.0, "min": 8}, "input_format": ["N K\nA_1 ... A_N\nF_1 ... F_N"], "input_format_status": "source_input_section", "input_lines": {"max": 3, "median": 3.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 400002, "median": 22.0, "min": 4}}} -{"case_ids": ["p03013_case_000", "p03013_case_001", "p03013_case_002", "p03013_case_003", "p03013_case_004", "p03013_case_005", "p03013_case_006", "p03013_case_007", "p03013_case_008", "p03013_case_009", "p03013_case_010", "p03013_case_011", "p03013_case_012", "p03013_case_013", "p03013_case_014", "p03013_case_015", "p03013_case_016", "p03013_case_017", "p03013_case_018", "p03013_case_019", "p03013_case_020", "p03013_case_021", "p03013_case_022", "p03013_case_023", "p03013_case_024", "p03013_case_025", "p03013_case_026", "p03013_case_027", "p03013_case_028", "p03013_case_029", "p03013_case_030", "p03013_case_031", "p03013_case_032", "p03013_case_033", "p03013_case_034", "p03013_case_035", "p03013_case_036", "p03013_case_037", "p03013_case_038", "p03013_case_039", "p03013_case_040", "p03013_case_041", "p03013_case_042", "p03013_case_043", "p03013_case_044", "p03013_case_045", "p03013_case_046", "p03013_case_047", "p03013_case_048", "p03013_case_049", "p03013_case_050", "p03013_case_051", "p03013_case_052", "p03013_case_053", "p03013_case_054", "p03013_case_055", "p03013_case_056", "p03013_case_057", "p03013_case_058", "p03013_case_059", "p03013_case_060", "p03013_case_061", "p03013_case_062", "p03013_case_063", "p03013_case_064", "p03013_case_065", "p03013_case_066", "p03013_case_067", "p03013_case_068", "p03013_case_069", "p03013_case_070", "p03013_case_071", "p03013_case_072", "p03013_case_073", "p03013_case_074", "p03013_case_075", "p03013_case_076", "p03013_case_077", "p03013_case_078", "p03013_case_079", "p03013_case_080", "p03013_case_081", "p03013_case_082", "p03013_case_083", "p03013_case_084", "p03013_case_085", "p03013_case_086", "p03013_case_087", "p03013_case_088", "p03013_case_089", "p03013_case_090", "p03013_case_091", "p03013_case_092", "p03013_case_093", "p03013_case_094", "p03013_case_095", "p03013_case_096", "p03013_case_097", "p03013_case_098", "p03013_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\nINPUT = sys.stdin.readline\nMOD = 10**9 + 7\n\n\ndef SINGLE_INT():\n return int(INPUT())\n\n\ndef MULTIPLE_INT_LIST():\n return list(map(int, INPUT().split()))\n\n\ndef MULTIPLE_INT_MAP():\n return list(map(int, INPUT().split()))\n\n\ndef SINGLE_STRING():\n return INPUT()\n\n\ndef MULTIPLE_STRING():\n return INPUT().split()\n\n\ndef solve(n, m):\n floors = [0] * (n + 1)\n floors[0] = 1\n floors[1] = 1\n last, current = 0, 0\n for i in range(m):\n if i == 0:\n current = SINGLE_INT()\n floors[current] = -1\n else:\n last = current\n current = SINGLE_INT()\n floors[current] = -1\n if current == last + 1:\n return 0\n for i in range(2, n + 1):\n if floors[i] == -1:\n continue\n else:\n if floors[i - 2] > 0:\n floors[i] += floors[i - 2]\n if floors[i - 1] > 0:\n floors[i] += floors[i - 1]\n floors[i] %= MOD\n return floors[-1]\n\n\nN, M = MULTIPLE_INT_MAP()\nif N == 1:\n print((1))\nelif N > 1:\n print((solve(N, M)))\n", "fast_code_sha256": "9ccc4f84b612a449d06d33c245092ec7a2bd3fa56cb11b5d55ba1d885d147ef6", "fast_id": "p03013_9ccc4f84b612a449d06d33c245092ec7a2bd3fa56cb11b5d55ba1d885d147ef6", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\nINPUT = sys.stdin.readline\nMOD = 10**9 + 7\n\n\ndef SINGLE_INT():\n return int(INPUT())\n\n\ndef MULTIPLE_INT_LIST():\n return list(map(int, INPUT().split()))\n\n\ndef MULTIPLE_INT_MAP():\n return list(map(int, INPUT().split()))\n\n\ndef SINGLE_STRING():\n return INPUT()\n\n\ndef MULTIPLE_STRING():\n return INPUT().split()\n\n\ndef solve(n, m):\n floors = [0] * (n + 1)\n floors[0] = 1\n floors[1] = 1\n last, current = 0, 0\n for i in range(m):\n if i == 0:\n current = SINGLE_INT()\n floors[current] = -1\n else:\n last = current\n current = SINGLE_INT()\n floors[current] = -1\n if current == last + 1:\n return 0\n for i in range(2, n + 1):\n if floors[i] == -1:\n continue\n else:\n if floors[i - 2] > 0:\n floors[i] += floors[i - 2]\n if floors[i - 1] > 0:\n floors[i] += floors[i - 1]\n floors[i] %= MOD\n return floors[-1]\n\n\nN, M = MULTIPLE_INT_MAP()\nif N == 1:\n print((1))\nelif N > 1:\n print((solve(N, M)))\n", "measured_fast_code_sha256": "9ccc4f84b612a449d06d33c245092ec7a2bd3fa56cb11b5d55ba1d885d147ef6", "measured_slow_code": "import sys\n\ninput = sys.stdin.readline\n\n\ndef I():\n return int(eval(input()))\n\n\ndef MI():\n return list(map(int, input().split()))\n\n\ndef LI():\n return list(map(int, input().split()))\n\n\ndef main():\n mod = 10**9 + 7\n N, M = MI()\n dp = [0] * (N + 1)\n dp[0] = 1\n a = [0] * M\n for i in range(M):\n a[i] = I()\n a.append(10**6)\n cur = 0 # aの場所\n for i in range(1, N + 1):\n if i == a[cur]:\n cur += 1\n else:\n dp[i] = (dp[i - 1] + dp[i - 2]) % mod\n print((dp[-1]))\n\n\nmain()\n", "measured_slow_code_sha256": "c749817b5904b891039b2b5e1b3da9cd0148137970d974b7121be27928f9e942", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 227.13812005439934, "pair_id": "python_v2_3a1830b6e44a0a09789f4dd6", "per_case_slow_code_faster_fraction": 0.37, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03013", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03013_9ccc4f84b612a449d06d33c245092ec7a2bd3fa56cb11b5d55ba1d885d147ef6.jsonl.gz", "inputs": "reproduction/python/inputs/p03013.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03013_c749817b5904b891039b2b5e1b3da9cd0148137970d974b7121be27928f9e942.jsonl.gz"}, "slow_code": "import sys\n\ninput = sys.stdin.readline\n\n\ndef I():\n return int(eval(input()))\n\n\ndef MI():\n return list(map(int, input().split()))\n\n\ndef LI():\n return list(map(int, input().split()))\n\n\ndef main():\n mod = 10**9 + 7\n N, M = MI()\n dp = [0] * (N + 1)\n dp[0] = 1\n a = [0] * M\n for i in range(M):\n a[i] = I()\n a.append(10**6)\n cur = 0\n for i in range(1, N + 1):\n if i == a[cur]:\n cur += 1\n else:\n dp[i] = (dp[i - 1] + dp[i - 2]) % mod\n print((dp[-1]))\n\n\nmain()\n", "slow_code_sha256": "bb7f7d9a15a94f857cd828da8e4b3080a790d7fc7d0b53571905f5757d0710a6", "slow_id": "p03013_c749817b5904b891039b2b5e1b3da9cd0148137970d974b7121be27928f9e942", "speedup": 35.06676226535057, "stratum": "8+", "within_pair_jaccard": 0.4807692307692308, "workload": {"case_count": 100, "description": "Count ways to climb from step 0 to N using jumps of 1 or 2, never landing on the M listed broken steps. Broken indices are strictly increasing and lie in 1..N-1. Output modulo 1000000007. Observed inputs: N=1..100000 (median 100000); M=0..99999 (median 12345); a_i=1..99999.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 588901, "median": 72724.0, "min": 4}, "input_format": ["N M\na_1\n...\na_M"], "input_format_status": "source_input_section", "input_lines": {"max": 100000, "median": 12346.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100001, "median": 12347.0, "min": 2}}} -{"case_ids": ["p03296_case_000", "p03296_case_001", "p03296_case_002", "p03296_case_003", "p03296_case_004", "p03296_case_005", "p03296_case_006", "p03296_case_007", "p03296_case_008", "p03296_case_009", "p03296_case_010", "p03296_case_011", "p03296_case_012", "p03296_case_013", "p03296_case_014", "p03296_case_015", "p03296_case_016", "p03296_case_017", "p03296_case_018", "p03296_case_019", "p03296_case_020", "p03296_case_021", "p03296_case_022", "p03296_case_023", "p03296_case_024", "p03296_case_025", "p03296_case_026", "p03296_case_027", "p03296_case_028", "p03296_case_029", "p03296_case_030", "p03296_case_031", "p03296_case_032", "p03296_case_033", "p03296_case_034", "p03296_case_035", "p03296_case_036", "p03296_case_037", "p03296_case_038", "p03296_case_039", "p03296_case_040", "p03296_case_041", "p03296_case_042", "p03296_case_043", "p03296_case_044", "p03296_case_045", "p03296_case_046", "p03296_case_047", "p03296_case_048", "p03296_case_049", "p03296_case_050", "p03296_case_051", "p03296_case_052", "p03296_case_053", "p03296_case_054", "p03296_case_055", "p03296_case_056", "p03296_case_057", "p03296_case_058", "p03296_case_059", "p03296_case_060", "p03296_case_061", "p03296_case_062", "p03296_case_063", "p03296_case_064", "p03296_case_065", "p03296_case_066", "p03296_case_067", "p03296_case_068", "p03296_case_069", "p03296_case_070", "p03296_case_071", "p03296_case_072", "p03296_case_073", "p03296_case_074", "p03296_case_075", "p03296_case_076", "p03296_case_077", "p03296_case_078", "p03296_case_079", "p03296_case_080", "p03296_case_081", "p03296_case_082", "p03296_case_083", "p03296_case_084", "p03296_case_085", "p03296_case_086", "p03296_case_087", "p03296_case_088", "p03296_case_089", "p03296_case_090", "p03296_case_091", "p03296_case_092", "p03296_case_093", "p03296_case_094", "p03296_case_095", "p03296_case_096", "p03296_case_097", "p03296_case_098", "p03296_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "eval(input())\nans = x = 0\nfor a in input().split():\n ans += a == x\n x = a * (a != x)\nprint(ans)\n", "fast_code_sha256": "6c99a67195f81cef355f29849420942ef7cda33fe7cf1151f8ae3adddedfbfc9", "fast_id": "p03296_6c99a67195f81cef355f29849420942ef7cda33fe7cf1151f8ae3adddedfbfc9", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "eval(input())\nans = x = 0\nfor a in input().split():\n ans += a == x\n x = a * (a != x)\nprint(ans)\n", "measured_fast_code_sha256": "6c99a67195f81cef355f29849420942ef7cda33fe7cf1151f8ae3adddedfbfc9", "measured_slow_code": "# coding:utf-8\nimport sys\n\nINF = float(\"inf\")\nMOD = 10**9 + 7\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef LI_():\n return [int(x) - 1 for x in sys.stdin.readline().split()]\n\n\ndef LF():\n return [float(x) for x in sys.stdin.readline().split()]\n\n\ndef LS():\n return sys.stdin.readline().split()\n\n\ndef II():\n return int(sys.stdin.readline())\n\n\ndef SI():\n return eval(input())\n\n\ndef main():\n n = II()\n A = LI()\n res = 0\n for i in range(1, n):\n if A[i] == A[i - 1]:\n A[i] = 0\n res += 1\n return res\n\n\nprint((main()))\n", "measured_slow_code_sha256": "a260e38fd68198bd3b846ed815f9f7842be8a43a1a00830ef94d4cac2df063d2", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.1149925464578065, "pair_id": "python_v2_9e51c9a7c6305987d1a2278c", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03296", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03296_6c99a67195f81cef355f29849420942ef7cda33fe7cf1151f8ae3adddedfbfc9.jsonl.gz", "inputs": "reproduction/python/inputs/p03296.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03296_a260e38fd68198bd3b846ed815f9f7842be8a43a1a00830ef94d4cac2df063d2.jsonl.gz"}, "slow_code": "import sys\n\nINF = float(\"inf\")\nMOD = 10**9 + 7\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef LI_():\n return [int(x) - 1 for x in sys.stdin.readline().split()]\n\n\ndef LF():\n return [float(x) for x in sys.stdin.readline().split()]\n\n\ndef LS():\n return sys.stdin.readline().split()\n\n\ndef II():\n return int(sys.stdin.readline())\n\n\ndef SI():\n return eval(input())\n\n\ndef main():\n n = II()\n A = LI()\n res = 0\n for i in range(1, n):\n if A[i] == A[i - 1]:\n A[i] = 0\n res += 1\n return res\n\n\nprint((main()))\n", "slow_code_sha256": "98718a5692a33a090df0421f7d48f7b20be3a15dafddd3f88613c957f01f774b", "slow_id": "p03296_a260e38fd68198bd3b846ed815f9f7842be8a43a1a00830ef94d4cac2df063d2", "speedup": 3.2563051937347436, "stratum": "2-4", "within_pair_jaccard": 0.21052631578947367, "workload": {"case_count": 100, "description": "Change the colors of as few entries as possible so no adjacent pair has equal colors. Each change replaces one color by any of 10000 available colors. Observed inputs: N=2..100 (median 50); A_i=1..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 304, "median": 143.5, "min": 6}, "input_format": ["N\na_1 ... a_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 101, "median": 51.0, "min": 3}}} -{"case_ids": ["p02712_case_000", "p02712_case_001", "p02712_case_002", "p02712_case_003", "p02712_case_004", "p02712_case_005", "p02712_case_006", "p02712_case_007", "p02712_case_008", "p02712_case_009", "p02712_case_010", "p02712_case_011", "p02712_case_012", "p02712_case_013", "p02712_case_014", "p02712_case_015", "p02712_case_016", "p02712_case_017", "p02712_case_018", "p02712_case_019", "p02712_case_020", "p02712_case_021", "p02712_case_022", "p02712_case_023", "p02712_case_024", "p02712_case_025", "p02712_case_026", "p02712_case_027", "p02712_case_028", "p02712_case_029", "p02712_case_030", "p02712_case_031", "p02712_case_032", "p02712_case_033", "p02712_case_034", "p02712_case_035", "p02712_case_036", "p02712_case_037", "p02712_case_038", "p02712_case_039", "p02712_case_040", "p02712_case_041", "p02712_case_042", "p02712_case_043", "p02712_case_044", "p02712_case_045", "p02712_case_046", "p02712_case_047", "p02712_case_048", "p02712_case_049", "p02712_case_050", "p02712_case_051", "p02712_case_052", "p02712_case_053", "p02712_case_054", "p02712_case_055", "p02712_case_056", "p02712_case_057", "p02712_case_058", "p02712_case_059", "p02712_case_060", "p02712_case_061", "p02712_case_062", "p02712_case_063", "p02712_case_064", "p02712_case_065", "p02712_case_066", "p02712_case_067", "p02712_case_068", "p02712_case_069", "p02712_case_070", "p02712_case_071", "p02712_case_072", "p02712_case_073", "p02712_case_074", "p02712_case_075", "p02712_case_076", "p02712_case_077", "p02712_case_078", "p02712_case_079", "p02712_case_080", "p02712_case_081", "p02712_case_082", "p02712_case_083", "p02712_case_084", "p02712_case_085", "p02712_case_086", "p02712_case_087", "p02712_case_088", "p02712_case_089", "p02712_case_090", "p02712_case_091", "p02712_case_092", "p02712_case_093", "p02712_case_094", "p02712_case_095", "p02712_case_096", "p02712_case_097", "p02712_case_098", "p02712_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def sum(N):\n return N * (N + 1) // 2\n\n\nN = int(eval(input()))\nprint((sum(N) - sum(N // 3) * 3 - sum(N // 5) * 5 + sum(N // 15) * 15))\n", "fast_code_sha256": "04b85ed12ccbd7000774636b207f3beb25882226515e7db43fed49073b7935a0", "fast_id": "p02712_04b85ed12ccbd7000774636b207f3beb25882226515e7db43fed49073b7935a0", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def sum(N):\n return N * (N + 1) // 2\n\n\nN = int(eval(input()))\nprint((sum(N) - sum(N // 3) * 3 - sum(N // 5) * 5 + sum(N // 15) * 15))\n", "measured_fast_code_sha256": "04b85ed12ccbd7000774636b207f3beb25882226515e7db43fed49073b7935a0", "measured_slow_code": "n = int(eval(input()))\na = [0 for i in range(n)]\ncount = 0\nfor i in range(n):\n if (i + 1) % 3 == 0 or (i + 1) % 5 == 0:\n continue\n else:\n a[i] = i + 1\n count += i + 1\nprint(count)\n", "measured_slow_code_sha256": "cc3f9e0e6116014af910f8b40835b1f31de095fd1860f0d0844bf40df1c5751a", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3304.5685695820816, "pair_id": "python_v2_b416601925c4179d4b0e0e66", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02712", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02712_04b85ed12ccbd7000774636b207f3beb25882226515e7db43fed49073b7935a0.jsonl.gz", "inputs": "reproduction/python/inputs/p02712.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02712_cc3f9e0e6116014af910f8b40835b1f31de095fd1860f0d0844bf40df1c5751a.jsonl.gz"}, "slow_code": "n = int(eval(input()))\na = [0 for i in range(n)]\ncount = 0\nfor i in range(n):\n if (i + 1) % 3 == 0 or (i + 1) % 5 == 0:\n continue\n else:\n a[i] = i + 1\n count += i + 1\nprint(count)\n", "slow_code_sha256": "cc3f9e0e6116014af910f8b40835b1f31de095fd1860f0d0844bf40df1c5751a", "slow_id": "p02712_cc3f9e0e6116014af910f8b40835b1f31de095fd1860f0d0844bf40df1c5751a", "speedup": 910.8976786375522, "stratum": "8+", "within_pair_jaccard": 0.21739130434782608, "workload": {"case_count": 100, "description": "Sum numeric terms among the first N FizzBuzz terms: multiples of 3 or 5 are words, and every other term i is the number i. Observed inputs: N=1..1000000 (median 360236).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 8, "median": 7.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p02264_case_000", "p02264_case_001", "p02264_case_002", "p02264_case_003", "p02264_case_004", "p02264_case_005", "p02264_case_006", "p02264_case_007", "p02264_case_008", "p02264_case_009", "p02264_case_010", "p02264_case_011", "p02264_case_012", "p02264_case_013", "p02264_case_014", "p02264_case_015", "p02264_case_016", "p02264_case_017", "p02264_case_018", "p02264_case_019", "p02264_case_020", "p02264_case_021", "p02264_case_022", "p02264_case_023", "p02264_case_024", "p02264_case_025", "p02264_case_026", "p02264_case_027", "p02264_case_028", "p02264_case_029", "p02264_case_030", "p02264_case_031", "p02264_case_032", "p02264_case_033", "p02264_case_034", "p02264_case_035", "p02264_case_036", "p02264_case_037", "p02264_case_038", "p02264_case_039", "p02264_case_040", "p02264_case_041", "p02264_case_042", "p02264_case_043", "p02264_case_044", "p02264_case_045", "p02264_case_046", "p02264_case_047", "p02264_case_048", "p02264_case_049", "p02264_case_050", "p02264_case_051", "p02264_case_052", "p02264_case_053", "p02264_case_054", "p02264_case_055", "p02264_case_056", "p02264_case_057", "p02264_case_058", "p02264_case_059", "p02264_case_060", "p02264_case_061", "p02264_case_062", "p02264_case_063", "p02264_case_064", "p02264_case_065", "p02264_case_066", "p02264_case_067", "p02264_case_068", "p02264_case_069", "p02264_case_070", "p02264_case_071", "p02264_case_072", "p02264_case_073", "p02264_case_074", "p02264_case_075", "p02264_case_076", "p02264_case_077", "p02264_case_078", "p02264_case_079", "p02264_case_080", "p02264_case_081", "p02264_case_082", "p02264_case_083", "p02264_case_084", "p02264_case_085", "p02264_case_086", "p02264_case_087", "p02264_case_088", "p02264_case_089", "p02264_case_090", "p02264_case_091", "p02264_case_092", "p02264_case_093", "p02264_case_094", "p02264_case_095", "p02264_case_096", "p02264_case_097", "p02264_case_098", "p02264_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from collections import deque\n\nn, q = map(int, input().split())\nf = lambda a, b: (a, int(b))\ndq = deque(f(*input().split()) for _ in range(n))\ncnt = 0\nans = []\nwhile dq:\n s, t = dq.popleft()\n if t <= q:\n cnt += t\n ans.append(f\"{s} {cnt}\")\n else:\n cnt += q\n dq.append((s, t - q))\nprint(*ans, sep=\"\\n\")\n", "fast_code_sha256": "e92009d8908cb72c0df058417869fe81199b8d2607e4de16cc6ce07b4bff470f", "fast_id": "p02264_e92009d8908cb72c0df058417869fe81199b8d2607e4de16cc6ce07b4bff470f", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from collections import deque\n\nn, q = map(int, input().split())\nf = lambda a, b: (a, int(b))\ndq = deque(f(*input().split()) for _ in range(n))\ncnt = 0\nans = []\nwhile dq:\n s, t = dq.popleft()\n if t <= q:\n cnt += t\n ans.append(f\"{s} {cnt}\")\n else:\n cnt += q\n dq.append((s, t - q))\nprint(*ans, sep=\"\\n\")\n", "measured_fast_code_sha256": "e92009d8908cb72c0df058417869fe81199b8d2607e4de16cc6ce07b4bff470f", "measured_slow_code": "class Queue:\n def __init__(self, n):\n self.values = [None] * n\n self.n = n\n self.s = 0\n self.t = 0\n\n def next(self, p):\n ret = p + 1\n if ret >= self.n:\n ret = 0\n return ret\n\n def enqueue(self, x):\n if self.next(self.s) == self.t:\n raise Exception(\"Overflow\")\n self.values[self.s] = x\n self.s = self.next(self.s)\n\n def dequeue(self):\n if self.s == self.t:\n raise Exception(\"Underflow\")\n ret = self.values[self.t]\n self.t = self.next(self.t)\n return ret\n\n\nn, q = list(map(int, input().split(\" \")))\nqueue = Queue(n + 1)\nfor _ in range(n):\n name, time = input().split(\" \")\n time = int(time)\n queue.enqueue((name, time))\ncompleted = []\ncur = 0\nwhile len(completed) < n:\n name, time = queue.dequeue()\n res = time - q\n if res <= 0:\n cur += time\n completed.append((name, cur))\n else:\n cur += q\n queue.enqueue((name, res))\nfor name, time in completed:\n print(name, time)\n", "measured_slow_code_sha256": "a1340768971238fb58507a0f8ca6f200e92420bac7eb4c6dd5fbd6b4ec30302d", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.188876271167535, "pair_id": "python_v2_fedce34c262a9cf1113421bb", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02264", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02264_e92009d8908cb72c0df058417869fe81199b8d2607e4de16cc6ce07b4bff470f.jsonl.gz", "inputs": "reproduction/python/inputs/p02264.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02264_a1340768971238fb58507a0f8ca6f200e92420bac7eb4c6dd5fbd6b4ec30302d.jsonl.gz"}, "slow_code": "class Queue:\n def __init__(self, n):\n self.values = [None] * n\n self.n = n\n self.s = 0\n self.t = 0\n\n def next(self, p):\n ret = p + 1\n if ret >= self.n:\n ret = 0\n return ret\n\n def enqueue(self, x):\n if self.next(self.s) == self.t:\n raise Exception(\"Overflow\")\n self.values[self.s] = x\n self.s = self.next(self.s)\n\n def dequeue(self):\n if self.s == self.t:\n raise Exception(\"Underflow\")\n ret = self.values[self.t]\n self.t = self.next(self.t)\n return ret\n\n\nn, q = list(map(int, input().split(\" \")))\nqueue = Queue(n + 1)\nfor _ in range(n):\n name, time = input().split(\" \")\n time = int(time)\n queue.enqueue((name, time))\ncompleted = []\ncur = 0\nwhile len(completed) < n:\n name, time = queue.dequeue()\n res = time - q\n if res <= 0:\n cur += time\n completed.append((name, cur))\n else:\n cur += q\n queue.enqueue((name, res))\nfor name, time in completed:\n print(name, time)\n", "slow_code_sha256": "a1340768971238fb58507a0f8ca6f200e92420bac7eb4c6dd5fbd6b4ec30302d", "slow_id": "p02264_a1340768971238fb58507a0f8ca6f200e92420bac7eb4c6dd5fbd6b4ec30302d", "speedup": 2.6230767415352694, "stratum": "2-4", "within_pair_jaccard": 0.3103448275862069, "workload": {"case_count": 100, "description": "Simulate round-robin scheduling for n processes initially queued in input order. Each has a name and required service duration time_i. Give each up to quantum q; requeue unfinished processes at the back. Output names and completion times in completion order. Observed inputs: n=1..100000 (median 30000); q=1..1000; time_i=1..50000; total_service=1..1000000 (median 1000000).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1300168, "median": 254526.5, "min": 11}, "input_format": ["n q\nname_1 time_1\n...\nname_n time_n"], "input_format_status": "source_input_section", "input_lines": {"max": 100001, "median": 30001.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200002, "median": 60002.0, "min": 4}}} -{"case_ids": ["p03608_case_000", "p03608_case_001", "p03608_case_002", "p03608_case_003", "p03608_case_004", "p03608_case_005", "p03608_case_006", "p03608_case_007", "p03608_case_008", "p03608_case_009", "p03608_case_010", "p03608_case_011", "p03608_case_012", "p03608_case_013", "p03608_case_014", "p03608_case_015", "p03608_case_016", "p03608_case_017", "p03608_case_018", "p03608_case_019", "p03608_case_020", "p03608_case_021", "p03608_case_022", "p03608_case_023", "p03608_case_024", "p03608_case_025", "p03608_case_026", "p03608_case_027", "p03608_case_028", "p03608_case_029", "p03608_case_030", "p03608_case_031", "p03608_case_032", "p03608_case_033", "p03608_case_034", "p03608_case_035", "p03608_case_036", "p03608_case_037", "p03608_case_038", "p03608_case_039", "p03608_case_040", "p03608_case_041", "p03608_case_042", "p03608_case_043", "p03608_case_044", "p03608_case_045", "p03608_case_046", "p03608_case_047", "p03608_case_048", "p03608_case_049", "p03608_case_050", "p03608_case_051", "p03608_case_052", "p03608_case_053", "p03608_case_054", "p03608_case_055", "p03608_case_056", "p03608_case_057", "p03608_case_058", "p03608_case_059", "p03608_case_060", "p03608_case_061", "p03608_case_062", "p03608_case_063", "p03608_case_064", "p03608_case_065", "p03608_case_066", "p03608_case_067", "p03608_case_068", "p03608_case_069", "p03608_case_070", "p03608_case_071", "p03608_case_072", "p03608_case_073", "p03608_case_074", "p03608_case_075", "p03608_case_076", "p03608_case_077", "p03608_case_078", "p03608_case_079", "p03608_case_080", "p03608_case_081", "p03608_case_082", "p03608_case_083", "p03608_case_084", "p03608_case_085", "p03608_case_086", "p03608_case_087", "p03608_case_088", "p03608_case_089", "p03608_case_090", "p03608_case_091", "p03608_case_092", "p03608_case_093", "p03608_case_094", "p03608_case_095", "p03608_case_096", "p03608_case_097", "p03608_case_098", "p03608_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys, queue, math, copy, itertools, bisect, collections\nfrom heapq import *\n\n\ndef main():\n sys.setrecursionlimit(10**7)\n INF = 10**8\n MOD = 10**9 + 7\n LI = lambda: [int(x) for x in sys.stdin.readline().split()]\n _LI = lambda: [int(x) - 1 for x in sys.stdin.readline().split()]\n NI = lambda: int(sys.stdin.readline())\n N, M, R = LI()\n r = _LI()\n root = [[] for _ in range(N)]\n for _ in range(M):\n a, b, c = LI()\n root[a - 1].append((b - 1, c))\n root[b - 1].append((a - 1, c))\n memo = [[0] * N for _ in range(N)]\n min_r = INF\n for x in itertools.permutations(r):\n it = 0\n s = x[0]\n for t in x[1:]:\n if memo[s][t]:\n it += memo[s][t]\n else:\n node = [INF] * N\n q = []\n heapify(q)\n heappush(q, (0, s))\n while q:\n l, u = heappop(q)\n if l >= node[u]:\n continue\n node[u] = l\n for v, m in root[u]:\n if node[v] > l + m:\n heappush(q, (l + m, v))\n memo[s][t] = node[t]\n memo[t][s] = node[t]\n it += node[t]\n s = t\n min_r = min(min_r, it)\n print(min_r)\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "0dce2c547d143e925c6530eca112bbdcf0cb4862950c8b11f8424683071149f7", "fast_id": "p03608_0dce2c547d143e925c6530eca112bbdcf0cb4862950c8b11f8424683071149f7", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys, queue, math, copy, itertools, bisect, collections\nfrom heapq import *\n\n\ndef main():\n sys.setrecursionlimit(10**7)\n INF = 10**8\n MOD = 10**9 + 7\n LI = lambda: [int(x) for x in sys.stdin.readline().split()]\n _LI = lambda: [int(x) - 1 for x in sys.stdin.readline().split()]\n NI = lambda: int(sys.stdin.readline())\n N, M, R = LI()\n r = _LI()\n root = [[] for _ in range(N)]\n for _ in range(M):\n a, b, c = LI()\n root[a - 1].append((b - 1, c))\n root[b - 1].append((a - 1, c))\n memo = [[0] * N for _ in range(N)]\n min_r = INF\n for x in itertools.permutations(r):\n it = 0\n s = x[0]\n for t in x[1:]:\n if memo[s][t]:\n it += memo[s][t]\n else:\n node = [INF] * N\n q = []\n heapify(q)\n heappush(q, (0, s))\n while q:\n l, u = heappop(q)\n if l >= node[u]:\n continue\n node[u] = l\n for v, m in root[u]:\n if node[v] > l + m:\n heappush(q, (l + m, v))\n memo[s][t] = node[t]\n memo[t][s] = node[t]\n it += node[t]\n s = t\n min_r = min(min_r, it)\n print(min_r)\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "0dce2c547d143e925c6530eca112bbdcf0cb4862950c8b11f8424683071149f7", "measured_slow_code": "n, m, r = list(map(int, input().split()))\nrs = list(map(int, input().split()))\n# construct map\nimport numpy as np\n\ndists = np.ones((n + 1, n + 1)) * float(\"inf\")\nfor _ in range(m):\n a, b, c = list(map(int, input().split()))\n dists[a, b] = dists[b, a] = c\nfor i in range(1, n + 1):\n dists[i, i] = 0\nfrom itertools import product, permutations\n\nfor i, j in product(list(range(1, 1 + n)), repeat=2):\n dists[j] = np.minimum(dists[j], dists[i] + dists[j, i])\nans = float(\"inf\")\nfor path in permutations(rs):\n val = sum(dists[i, j] for i, j in zip(path, path[1:]))\n val = int(val)\n if val < ans:\n ans = val\nprint(ans)\n", "measured_slow_code_sha256": "a6ba7a6e457f7223737377dc74c3739f39a6faf8bc7e129d3e4d82875673c6ae", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 5.354643498785581, "pair_id": "python_v2_c9ce682afd6bf4284b0a297b", "per_case_slow_code_faster_fraction": 0.16, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03608", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03608_0dce2c547d143e925c6530eca112bbdcf0cb4862950c8b11f8424683071149f7.jsonl.gz", "inputs": "reproduction/python/inputs/p03608.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03608_a6ba7a6e457f7223737377dc74c3739f39a6faf8bc7e129d3e4d82875673c6ae.jsonl.gz"}, "slow_code": "n, m, r = list(map(int, input().split()))\nrs = list(map(int, input().split()))\n\nimport numpy as np\n\ndists = np.ones((n + 1, n + 1)) * float(\"inf\")\nfor _ in range(m):\n a, b, c = list(map(int, input().split()))\n dists[a, b] = dists[b, a] = c\nfor i in range(1, n + 1):\n dists[i, i] = 0\nfrom itertools import product, permutations\n\nfor i, j in product(list(range(1, 1 + n)), repeat=2):\n dists[j] = np.minimum(dists[j], dists[i] + dists[j, i])\nans = float(\"inf\")\nfor path in permutations(rs):\n val = sum(dists[i, j] for i, j in zip(path, path[1:]))\n val = int(val)\n if val < ans:\n ans = val\nprint(ans)\n", "slow_code_sha256": "f19f2c009c893dde042476371af37c34ea12cfaa23ea63baa86f7c5a07cc08fe", "slow_id": "p03608_a6ba7a6e457f7223737377dc74c3739f39a6faf8bc7e129d3e4d82875673c6ae", "speedup": 7.789150742332422, "stratum": "4-8", "within_pair_jaccard": 0.21348314606741572, "workload": {"case_count": 100, "description": "Find the minimum road distance needed to visit R distinct specified towns in any order in a connected simple undirected graph. Start and finish at any specified towns; other towns may be passed through. Edges have positive lengths C_i. Observed inputs: N=2..200 (median 50); M=1..19900 (median 199); R=2..8 (median 8); C_i=1..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 277050, "median": 2393.0, "min": 16}, "input_format": ["N M R\nr_1 ... r_R\nA_1 B_1 C_1\n...\nA_M B_M C_M"], "input_format_status": "source_input_section", "input_lines": {"max": 19902, "median": 201.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 59711, "median": 608.0, "min": 8}}} -{"case_ids": ["p03556_case_000", "p03556_case_001", "p03556_case_002", "p03556_case_003", "p03556_case_004", "p03556_case_005", "p03556_case_006", "p03556_case_007", "p03556_case_008", "p03556_case_009", "p03556_case_010", "p03556_case_011", "p03556_case_012", "p03556_case_013", "p03556_case_014", "p03556_case_015", "p03556_case_016", "p03556_case_017", "p03556_case_018", "p03556_case_019", "p03556_case_020", "p03556_case_021", "p03556_case_022", "p03556_case_023", "p03556_case_024", "p03556_case_025", "p03556_case_026", "p03556_case_027", "p03556_case_028", "p03556_case_029", "p03556_case_030", "p03556_case_031", "p03556_case_032", "p03556_case_033", "p03556_case_034", "p03556_case_035", "p03556_case_036", "p03556_case_037", "p03556_case_038", "p03556_case_039", "p03556_case_040", "p03556_case_041", "p03556_case_042", "p03556_case_043", "p03556_case_044", "p03556_case_045", "p03556_case_046", "p03556_case_047", "p03556_case_048", "p03556_case_049", "p03556_case_050", "p03556_case_051", "p03556_case_052", "p03556_case_053", "p03556_case_054", "p03556_case_055", "p03556_case_056", "p03556_case_057", "p03556_case_058", "p03556_case_059", "p03556_case_060", "p03556_case_061", "p03556_case_062", "p03556_case_063", "p03556_case_064", "p03556_case_065", "p03556_case_066", "p03556_case_067", "p03556_case_068", "p03556_case_069", "p03556_case_070", "p03556_case_071", "p03556_case_072", "p03556_case_073", "p03556_case_074", "p03556_case_075", "p03556_case_076", "p03556_case_077", "p03556_case_078", "p03556_case_079", "p03556_case_080", "p03556_case_081", "p03556_case_082", "p03556_case_083", "p03556_case_084", "p03556_case_085", "p03556_case_086", "p03556_case_087", "p03556_case_088", "p03556_case_089", "p03556_case_090", "p03556_case_091", "p03556_case_092", "p03556_case_093", "p03556_case_094", "p03556_case_095", "p03556_case_096", "p03556_case_097", "p03556_case_098", "p03556_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N = int(eval(input()))\nN = int(N**0.5)\nprint((N * N))\n", "fast_code_sha256": "9bd99fec9e6ec4fee9368ad961d397fb9380f635a86a7ba86920d6bcf2974eb8", "fast_id": "p03556_9bd99fec9e6ec4fee9368ad961d397fb9380f635a86a7ba86920d6bcf2974eb8", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N = int(eval(input()))\nN = int(N**0.5)\nprint((N * N))\n", "measured_fast_code_sha256": "9bd99fec9e6ec4fee9368ad961d397fb9380f635a86a7ba86920d6bcf2974eb8", "measured_slow_code": "import numpy as np\n\nN = int(eval(input()))\nmp = int(np.sqrt(N))\nprint((mp**2))\n", "measured_slow_code_sha256": "0a7e4d0d2a2f952e55fd143eaac4cee93ae161ecb36118d4ab495d4a4bf6dac9", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2238.1842083430483, "pair_id": "python_v2_28cd10419bb88818e3bbe69f", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03556", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03556_9bd99fec9e6ec4fee9368ad961d397fb9380f635a86a7ba86920d6bcf2974eb8.jsonl.gz", "inputs": "reproduction/python/inputs/p03556.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03556_0a7e4d0d2a2f952e55fd143eaac4cee93ae161ecb36118d4ab495d4a4bf6dac9.jsonl.gz"}, "slow_code": "import numpy as np\n\nN = int(eval(input()))\nmp = int(np.sqrt(N))\nprint((mp**2))\n", "slow_code_sha256": "0a7e4d0d2a2f952e55fd143eaac4cee93ae161ecb36118d4ab495d4a4bf6dac9", "slow_id": "p03556_0a7e4d0d2a2f952e55fd143eaac4cee93ae161ecb36118d4ab495d4a4bf6dac9", "speedup": 2233.764091998628, "stratum": "8+", "within_pair_jaccard": 0.35714285714285715, "workload": {"case_count": 100, "description": "Find the largest integer square not exceeding positive input N. Observed inputs: N=1..1000000000 (median 266490422).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 11, "median": 10.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p03294_case_000", "p03294_case_001", "p03294_case_002", "p03294_case_003", "p03294_case_004", "p03294_case_005", "p03294_case_006", "p03294_case_007", "p03294_case_008", "p03294_case_009", "p03294_case_010", "p03294_case_011", "p03294_case_012", "p03294_case_013", "p03294_case_014", "p03294_case_015", "p03294_case_016", "p03294_case_017", "p03294_case_018", "p03294_case_019", "p03294_case_020", "p03294_case_021", "p03294_case_022", "p03294_case_023", "p03294_case_024", "p03294_case_025", "p03294_case_026", "p03294_case_027", "p03294_case_028", "p03294_case_029", "p03294_case_030", "p03294_case_031", "p03294_case_032", "p03294_case_033", "p03294_case_034", "p03294_case_035", "p03294_case_036", "p03294_case_037", "p03294_case_038", "p03294_case_039", "p03294_case_040", "p03294_case_041", "p03294_case_042", "p03294_case_043", "p03294_case_044", "p03294_case_045", "p03294_case_046", "p03294_case_047", "p03294_case_048", "p03294_case_049", "p03294_case_050", "p03294_case_051", "p03294_case_052", "p03294_case_053", "p03294_case_054", "p03294_case_055", "p03294_case_056", "p03294_case_057", "p03294_case_058", "p03294_case_059", "p03294_case_060", "p03294_case_061", "p03294_case_062", "p03294_case_063", "p03294_case_064", "p03294_case_065", "p03294_case_066", "p03294_case_067", "p03294_case_068", "p03294_case_069", "p03294_case_070", "p03294_case_071", "p03294_case_072", "p03294_case_073", "p03294_case_074", "p03294_case_075", "p03294_case_076", "p03294_case_077", "p03294_case_078", "p03294_case_079", "p03294_case_080", "p03294_case_081", "p03294_case_082", "p03294_case_083", "p03294_case_084", "p03294_case_085", "p03294_case_086", "p03294_case_087", "p03294_case_088", "p03294_case_089", "p03294_case_090", "p03294_case_091", "p03294_case_092", "p03294_case_093", "p03294_case_094", "p03294_case_095", "p03294_case_096", "p03294_case_097", "p03294_case_098", "p03294_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N = eval(input())\nA = [int(x) for x in input().split()]\nprint((sum(x - 1 for x in A)))\n", "fast_code_sha256": "8f42b4872f98eb3f3385abb48480c50477cdfbff1392ba31280beb5eb0cc1a8e", "fast_id": "p03294_31ce07bfd4545257089cf13ed9b634ee501559f8aec3bb9ed83c434ac8b87f36", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "# coding: utf-8\nN = eval(input())\nA = [int(x) for x in input().split()]\nprint((sum(x - 1 for x in A)))\n", "measured_fast_code_sha256": "31ce07bfd4545257089cf13ed9b634ee501559f8aec3bb9ed83c434ac8b87f36", "measured_slow_code": "import math\n\nn = int(eval(input()))\na = list(map(int, input().split()))\ncommon_num = 1\nfor num in a:\n common_num = (common_num * num) // math.gcd(common_num, num)\ntotal = 0\nfor num in a:\n total += (common_num - 1) % num\nprint(total)\n", "measured_slow_code_sha256": "13a0acff6be960ac2d9102d9dbcb9b4a40285e0396d51e99ee1149098593acf0", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.816965182056027, "pair_id": "python_v2_78f872e8ebf189d0e6393aed", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03294", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03294_31ce07bfd4545257089cf13ed9b634ee501559f8aec3bb9ed83c434ac8b87f36.jsonl.gz", "inputs": "reproduction/python/inputs/p03294.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03294_13a0acff6be960ac2d9102d9dbcb9b4a40285e0396d51e99ee1149098593acf0.jsonl.gz"}, "slow_code": "import math\n\nn = int(eval(input()))\na = list(map(int, input().split()))\ncommon_num = 1\nfor num in a:\n common_num = (common_num * num) // math.gcd(common_num, num)\ntotal = 0\nfor num in a:\n total += (common_num - 1) % num\nprint(total)\n", "slow_code_sha256": "13a0acff6be960ac2d9102d9dbcb9b4a40285e0396d51e99ee1149098593acf0", "slow_id": "p03294_13a0acff6be960ac2d9102d9dbcb9b4a40285e0396d51e99ee1149098593acf0", "speedup": 4.3114766284156465, "stratum": "4-8", "within_pair_jaccard": 0.36363636363636365, "workload": {"case_count": 100, "description": "For N positive integers a_i, maximize sum_i (m mod a_i) over all nonnegative integers m. Observed inputs: N=2..3000 (median 3000); a_i=2..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 21005, "median": 13229.0, "min": 6}, "input_format": ["N\na_1 ... a_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3001, "median": 3001.0, "min": 3}}} -{"case_ids": ["p02845_case_000", "p02845_case_001", "p02845_case_002", "p02845_case_003", "p02845_case_004", "p02845_case_005", "p02845_case_006", "p02845_case_007", "p02845_case_008", "p02845_case_009", "p02845_case_010", "p02845_case_011", "p02845_case_012", "p02845_case_013", "p02845_case_014", "p02845_case_015", "p02845_case_016", "p02845_case_017", "p02845_case_018", "p02845_case_019", "p02845_case_020", "p02845_case_021", "p02845_case_022", "p02845_case_023", "p02845_case_024", "p02845_case_025", "p02845_case_026", "p02845_case_027", "p02845_case_028", "p02845_case_029", "p02845_case_030", "p02845_case_031", "p02845_case_032", "p02845_case_033", "p02845_case_034", "p02845_case_035", "p02845_case_036", "p02845_case_037", "p02845_case_038", "p02845_case_039", "p02845_case_040", "p02845_case_041", "p02845_case_042", "p02845_case_043", "p02845_case_044", "p02845_case_045", "p02845_case_046", "p02845_case_047", "p02845_case_048", "p02845_case_049", "p02845_case_050", "p02845_case_051", "p02845_case_052", "p02845_case_053", "p02845_case_054", "p02845_case_055", "p02845_case_056", "p02845_case_057", "p02845_case_058", "p02845_case_059", "p02845_case_060", "p02845_case_061", "p02845_case_062", "p02845_case_063", "p02845_case_064", "p02845_case_065", "p02845_case_066", "p02845_case_067", "p02845_case_068", "p02845_case_069", "p02845_case_070", "p02845_case_071", "p02845_case_072", "p02845_case_073", "p02845_case_074", "p02845_case_075", "p02845_case_076", "p02845_case_077", "p02845_case_078", "p02845_case_079", "p02845_case_080", "p02845_case_081", "p02845_case_082", "p02845_case_083", "p02845_case_084", "p02845_case_085", "p02845_case_086", "p02845_case_087", "p02845_case_088", "p02845_case_089", "p02845_case_090", "p02845_case_091", "p02845_case_092", "p02845_case_093", "p02845_case_094", "p02845_case_095", "p02845_case_096", "p02845_case_097", "p02845_case_098", "p02845_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\nread = sys.stdin.read\nreadline = sys.stdin.readline\nreadlines = sys.stdin.readlines\nsys.setrecursionlimit(10**9)\nINF = 1 << 60\n\n\ndef main():\n MOD = 1000000007\n N, *A = list(map(int, read().split()))\n C = [0] * (N + 1)\n C[0] = 3\n ans = 1\n for a in A:\n ans = ans * C[a] % MOD\n if ans == 0:\n print((0))\n return\n C[a] -= 1\n C[a + 1] += 1\n print(ans)\n return\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "b6834044bcbc77eb8a44d485655e938ae1a4127b00d69345cf12935172ed1f49", "fast_id": "p02845_b6834044bcbc77eb8a44d485655e938ae1a4127b00d69345cf12935172ed1f49", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\nread = sys.stdin.read\nreadline = sys.stdin.readline\nreadlines = sys.stdin.readlines\nsys.setrecursionlimit(10**9)\nINF = 1 << 60\n\n\ndef main():\n MOD = 1000000007\n N, *A = list(map(int, read().split()))\n C = [0] * (N + 1)\n C[0] = 3\n ans = 1\n for a in A:\n ans = ans * C[a] % MOD\n if ans == 0:\n print((0))\n return\n C[a] -= 1\n C[a + 1] += 1\n print(ans)\n return\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "b6834044bcbc77eb8a44d485655e938ae1a4127b00d69345cf12935172ed1f49", "measured_slow_code": "_, a = open(0)\nc = 1\nd = [3] + [0] * 10**6\nfor a in map(int, a.split()):\n c = c * d[a] % (10**9 + 7)\n d[a] -= 1\n d[a + 1] += 1\nprint(c)\n", "measured_slow_code_sha256": "44f76311477519e453c1541c8cee2cad565caf5c7e854c8feade8f7c7a67fffd", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 15.592103486892142, "pair_id": "python_v2_9fca5dad3e49b7fa52b451fb", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02845", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02845_b6834044bcbc77eb8a44d485655e938ae1a4127b00d69345cf12935172ed1f49.jsonl.gz", "inputs": "reproduction/python/inputs/p02845.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02845_44f76311477519e453c1541c8cee2cad565caf5c7e854c8feade8f7c7a67fffd.jsonl.gz"}, "slow_code": "_, a = open(0)\nc = 1\nd = [3] + [0] * 10**6\nfor a in map(int, a.split()):\n c = c * d[a] % (10**9 + 7)\n d[a] -= 1\n d[a + 1] += 1\nprint(c)\n", "slow_code_sha256": "44f76311477519e453c1541c8cee2cad565caf5c7e854c8feade8f7c7a67fffd", "slow_id": "p02845_44f76311477519e453c1541c8cee2cad565caf5c7e854c8feade8f7c7a67fffd", "speedup": 11.683342960153691, "stratum": "8+", "within_pair_jaccard": 0.3, "workload": {"case_count": 100, "description": "N people stand in order. Person i reports A_i earlier people wearing their own hat color. Count assignments of red, blue or green hats satisfying all reports, modulo 1000000007. Observed inputs: N=1..100000 (median 1000); A_i=0..99998.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 588893, "median": 3611.5, "min": 4}, "input_format": ["N\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100001, "median": 1001.0, "min": 2}}} -{"case_ids": ["p02760_case_000", "p02760_case_001", "p02760_case_002", "p02760_case_003", "p02760_case_004", "p02760_case_005", "p02760_case_006", "p02760_case_007", "p02760_case_008", "p02760_case_009", "p02760_case_010", "p02760_case_011", "p02760_case_012", "p02760_case_013", "p02760_case_014", "p02760_case_015", "p02760_case_016", "p02760_case_017", "p02760_case_018", "p02760_case_019", "p02760_case_020", "p02760_case_021", "p02760_case_022", "p02760_case_023", "p02760_case_024", "p02760_case_025", "p02760_case_026", "p02760_case_027", "p02760_case_028", "p02760_case_029", "p02760_case_030", "p02760_case_031", "p02760_case_032", "p02760_case_033", "p02760_case_034", "p02760_case_035", "p02760_case_036", "p02760_case_037", "p02760_case_038", "p02760_case_039", "p02760_case_040", "p02760_case_041", "p02760_case_042", "p02760_case_043", "p02760_case_044", "p02760_case_045", "p02760_case_046", "p02760_case_047", "p02760_case_048", "p02760_case_049", "p02760_case_050", "p02760_case_051", "p02760_case_052", "p02760_case_053", "p02760_case_054", "p02760_case_055", "p02760_case_056", "p02760_case_057", "p02760_case_058", "p02760_case_059", "p02760_case_060", "p02760_case_061", "p02760_case_062", "p02760_case_063", "p02760_case_064", "p02760_case_065", "p02760_case_066", "p02760_case_067", "p02760_case_068", "p02760_case_069", "p02760_case_070", "p02760_case_071", "p02760_case_072", "p02760_case_073", "p02760_case_074", "p02760_case_075", "p02760_case_076", "p02760_case_077", "p02760_case_078", "p02760_case_079", "p02760_case_080", "p02760_case_081", "p02760_case_082", "p02760_case_083", "p02760_case_084", "p02760_case_085", "p02760_case_086", "p02760_case_087", "p02760_case_088", "p02760_case_089", "p02760_case_090", "p02760_case_091", "p02760_case_092", "p02760_case_093", "p02760_case_094", "p02760_case_095", "p02760_case_096", "p02760_case_097", "p02760_case_098", "p02760_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "(*a,) = list(map(int, open(0).read().split()))\nprint(\n (\n \"NYoe s\"[\n any(\n t <= set(a.index(b) for b in a[10:])\n for t in (\n {0, 1, 2},\n {0, 3, 6},\n {0, 4, 8},\n {1, 4, 7},\n {2, 4, 6},\n {2, 5, 8},\n {3, 4, 5},\n {6, 7, 8},\n )\n ) :: 2\n ]\n )\n)\n", "fast_code_sha256": "37c64c843161b92469540d6a1ec2a29d2c5b7047a3f26ff46e602802a6763f12", "fast_id": "p02760_37c64c843161b92469540d6a1ec2a29d2c5b7047a3f26ff46e602802a6763f12", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "(*a,) = list(map(int, open(0).read().split()))\nprint(\n (\n \"NYoe s\"[\n any(\n t <= set(a.index(b) for b in a[10:])\n for t in (\n {0, 1, 2},\n {0, 3, 6},\n {0, 4, 8},\n {1, 4, 7},\n {2, 4, 6},\n {2, 5, 8},\n {3, 4, 5},\n {6, 7, 8},\n )\n ) :: 2\n ]\n )\n)\n", "measured_fast_code_sha256": "37c64c843161b92469540d6a1ec2a29d2c5b7047a3f26ff46e602802a6763f12", "measured_slow_code": "f = lambda a: any(all(b) for b in a) | all(a[i][i] for i in (0, 1, 2))\na = eval(\"list(map(int,input().split())),\" * 3)\nexec(\"b=int(input());a=[[u*(u!=b)for u in t]for t in a];\" * int(eval(input())))\na = [[not u for u in t] for t in a]\nprint((\"NYoe s\"[f(a) | f([t[::-1] for t in zip(*a)]) :: 2]))\n", "measured_slow_code_sha256": "3154046e3b0b642e21542a63081b5e907301002ff4b0c284741cdd49a042b9c6", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.879322991628692, "pair_id": "python_v2_a79148d8cc48910c3cf05d42", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02760", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02760_37c64c843161b92469540d6a1ec2a29d2c5b7047a3f26ff46e602802a6763f12.jsonl.gz", "inputs": "reproduction/python/inputs/p02760.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02760_3154046e3b0b642e21542a63081b5e907301002ff4b0c284741cdd49a042b9c6.jsonl.gz"}, "slow_code": "f = lambda a: any(all(b) for b in a) | all(a[i][i] for i in (0, 1, 2))\na = eval(\"list(map(int,input().split())),\" * 3)\nexec(\"b=int(input());a=[[u*(u!=b)for u in t]for t in a];\" * int(eval(input())))\na = [[not u for u in t] for t in a]\nprint((\"NYoe s\"[f(a) | f([t[::-1] for t in zip(*a)]) :: 2]))\n", "slow_code_sha256": "3154046e3b0b642e21542a63081b5e907301002ff4b0c284741cdd49a042b9c6", "slow_id": "p02760_3154046e3b0b642e21542a63081b5e907301002ff4b0c284741cdd49a042b9c6", "speedup": 2.796009888142488, "stratum": "2-4", "within_pair_jaccard": 0.4594594594594595, "workload": {"case_count": 100, "description": "A 3-by-3 bingo board contains distinct integers A_i,j. Mark numbers among N distinct called values b_i and determine whether any row, column or diagonal is fully marked. Observed inputs: N=1..10 (median 6); A_i_j=1..100; b_i=1..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 60, "median": 46.5, "min": 29}, "input_format": ["A_1,1 A_1,2 A_1,3\nA_2,1 A_2,2 A_2,3\nA_3,1 A_3,2 A_3,3\nN\nb_1\n...\nb_N"], "input_format_status": "source_input_section", "input_lines": {"max": 14, "median": 10.0, "min": 5}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 20, "median": 16.0, "min": 11}}} -{"case_ids": ["p03018_case_000", "p03018_case_001", "p03018_case_002", "p03018_case_003", "p03018_case_004", "p03018_case_005", "p03018_case_006", "p03018_case_007", "p03018_case_008", "p03018_case_009", "p03018_case_010", "p03018_case_011", "p03018_case_012", "p03018_case_013", "p03018_case_014", "p03018_case_015", "p03018_case_016", "p03018_case_017", "p03018_case_018", "p03018_case_019", "p03018_case_020", "p03018_case_021", "p03018_case_022", "p03018_case_023", "p03018_case_024", "p03018_case_025", "p03018_case_026", "p03018_case_027", "p03018_case_028", "p03018_case_029", "p03018_case_030", "p03018_case_031", "p03018_case_032", "p03018_case_033", "p03018_case_034", "p03018_case_035", "p03018_case_036", "p03018_case_037", "p03018_case_038", "p03018_case_039", "p03018_case_040", "p03018_case_041", "p03018_case_042", "p03018_case_043", "p03018_case_044", "p03018_case_045", "p03018_case_046", "p03018_case_047", "p03018_case_048", "p03018_case_049", "p03018_case_050", "p03018_case_051", "p03018_case_052", "p03018_case_053", "p03018_case_054", "p03018_case_055", "p03018_case_056", "p03018_case_057", "p03018_case_058", "p03018_case_059", "p03018_case_060", "p03018_case_061", "p03018_case_062", "p03018_case_063", "p03018_case_064", "p03018_case_065", "p03018_case_066", "p03018_case_067", "p03018_case_068", "p03018_case_069", "p03018_case_070", "p03018_case_071", "p03018_case_072", "p03018_case_073", "p03018_case_074", "p03018_case_075", "p03018_case_076", "p03018_case_077", "p03018_case_078", "p03018_case_079", "p03018_case_080", "p03018_case_081", "p03018_case_082", "p03018_case_083", "p03018_case_084", "p03018_case_085", "p03018_case_086", "p03018_case_087", "p03018_case_088", "p03018_case_089", "p03018_case_090", "p03018_case_091", "p03018_case_092", "p03018_case_093", "p03018_case_094", "p03018_case_095", "p03018_case_096", "p03018_case_097", "p03018_case_098", "p03018_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "s = input().replace(\"BC\", \"D\")\nans = 0\nc = 0\nfor e in s:\n if e == \"A\":\n c += 1\n elif e == \"D\":\n ans += c\n else:\n c = 0\nprint(ans)\n", "fast_code_sha256": "2a17951a8ecf02da756ffb9edb72b8340c15583689fba5758559e6dd69bff804", "fast_id": "p03018_2a17951a8ecf02da756ffb9edb72b8340c15583689fba5758559e6dd69bff804", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "s = input().replace(\"BC\", \"D\")\nans = 0\nc = 0\nfor e in s:\n if e == \"A\":\n c += 1\n elif e == \"D\":\n ans += c\n else:\n c = 0\nprint(ans)\n", "measured_fast_code_sha256": "2a17951a8ecf02da756ffb9edb72b8340c15583689fba5758559e6dd69bff804", "measured_slow_code": "import sys\n\nstdin = sys.stdin\nri = lambda: int(rs())\nrl = lambda: list(map(int, stdin.readline().split()))\nrs = lambda: stdin.readline().rstrip() # ignore trailing spaces\nS = list(rs())\ncur = \"D\"\nanswer = 0\nA_cnt = 0\nfor s in S:\n if cur == \"A\":\n if s == \"A\":\n A_cnt += 1\n elif s == \"B\":\n cur = s\n else:\n cur = \"D\"\n A_cnt = 0\n elif cur == \"B\":\n if s == \"A\":\n A_cnt = 1\n cur = s\n elif s == \"B\":\n A_cnt = 0\n cur = \"D\"\n elif s == \"C\":\n answer += A_cnt\n cur = s\n else:\n cur = \"D\"\n A_cnt = 0\n elif cur == \"C\":\n if s == \"A\":\n A_cnt += 1\n cur = s\n elif s == \"B\":\n cur = s\n else:\n cur = \"D\"\n A_cnt = 0\n else:\n if s == \"A\":\n A_cnt += 1\n cur = s\n else:\n A_cnt = 0\n cur = \"D\"\nprint(answer)\n", "measured_slow_code_sha256": "34cfcb0cd806549d9de932b7805e60b0300ac48d582c70a3b82e9e63ed79dbe3", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.3265202162935754, "pair_id": "python_v2_b41047124a103d8785ba1618", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03018", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03018_2a17951a8ecf02da756ffb9edb72b8340c15583689fba5758559e6dd69bff804.jsonl.gz", "inputs": "reproduction/python/inputs/p03018.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03018_34cfcb0cd806549d9de932b7805e60b0300ac48d582c70a3b82e9e63ed79dbe3.jsonl.gz"}, "slow_code": "import sys\n\nstdin = sys.stdin\nri = lambda: int(rs())\nrl = lambda: list(map(int, stdin.readline().split()))\nrs = lambda: stdin.readline().rstrip()\nS = list(rs())\ncur = \"D\"\nanswer = 0\nA_cnt = 0\nfor s in S:\n if cur == \"A\":\n if s == \"A\":\n A_cnt += 1\n elif s == \"B\":\n cur = s\n else:\n cur = \"D\"\n A_cnt = 0\n elif cur == \"B\":\n if s == \"A\":\n A_cnt = 1\n cur = s\n elif s == \"B\":\n A_cnt = 0\n cur = \"D\"\n elif s == \"C\":\n answer += A_cnt\n cur = s\n else:\n cur = \"D\"\n A_cnt = 0\n elif cur == \"C\":\n if s == \"A\":\n A_cnt += 1\n cur = s\n elif s == \"B\":\n cur = s\n else:\n cur = \"D\"\n A_cnt = 0\n else:\n if s == \"A\":\n A_cnt += 1\n cur = s\n else:\n A_cnt = 0\n cur = \"D\"\nprint(answer)\n", "slow_code_sha256": "2a81960ac1f47336dbb6ad3e8a3b063f1f7be21a97a77ab30f5ed64ce398f2f3", "slow_id": "p03018_34cfcb0cd806549d9de932b7805e60b0300ac48d582c70a3b82e9e63ed79dbe3", "speedup": 2.643489914350368, "stratum": "2-4", "within_pair_jaccard": 0.3055555555555556, "workload": {"case_count": 100, "description": "Given a string s over A,B,C, repeatedly replace any contiguous ABC by BCA. Find the maximum possible number of replacements. Observed inputs: s_length=1..200000 (median 1000); A_count=0..200000; B_count=0..200000; C_count=0..200000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 200001, "median": 1001.0, "min": 2}, "input_format": ["s"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p02641_case_000", "p02641_case_001", "p02641_case_002", "p02641_case_003", "p02641_case_004", "p02641_case_005", "p02641_case_006", "p02641_case_007", "p02641_case_008", "p02641_case_009", "p02641_case_010", "p02641_case_011", "p02641_case_012", "p02641_case_013", "p02641_case_014", "p02641_case_015", "p02641_case_016", "p02641_case_017", "p02641_case_018", "p02641_case_019", "p02641_case_020", "p02641_case_021", "p02641_case_022", "p02641_case_023", "p02641_case_024", "p02641_case_025", "p02641_case_026", "p02641_case_027", "p02641_case_028", "p02641_case_029", "p02641_case_030", "p02641_case_031", "p02641_case_032", "p02641_case_033", "p02641_case_034", "p02641_case_035", "p02641_case_036", "p02641_case_037", "p02641_case_038", "p02641_case_039", "p02641_case_040", "p02641_case_041", "p02641_case_042", "p02641_case_043", "p02641_case_044", "p02641_case_045", "p02641_case_046", "p02641_case_047", "p02641_case_048", "p02641_case_049", "p02641_case_050", "p02641_case_051", "p02641_case_052", "p02641_case_053", "p02641_case_054", "p02641_case_055", "p02641_case_056", "p02641_case_057", "p02641_case_058", "p02641_case_059", "p02641_case_060", "p02641_case_061", "p02641_case_062", "p02641_case_063", "p02641_case_064", "p02641_case_065", "p02641_case_066", "p02641_case_067", "p02641_case_068", "p02641_case_069", "p02641_case_070", "p02641_case_071", "p02641_case_072", "p02641_case_073", "p02641_case_074", "p02641_case_075", "p02641_case_076", "p02641_case_077", "p02641_case_078", "p02641_case_079", "p02641_case_080", "p02641_case_081", "p02641_case_082", "p02641_case_083", "p02641_case_084", "p02641_case_085", "p02641_case_086", "p02641_case_087", "p02641_case_088", "p02641_case_089", "p02641_case_090", "p02641_case_091", "p02641_case_092", "p02641_case_093", "p02641_case_094", "p02641_case_095", "p02641_case_096", "p02641_case_097", "p02641_case_098", "p02641_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "x, n = list(map(int, input().split()))\nif n == 0:\n print(x)\nelse:\n p = list(map(int, input().split()))\n dic = {}\n for i in p:\n d = abs(i - x)\n if d in dic:\n dic[d].append(i)\n else:\n dic[d] = [i]\n sortdic = sorted(list(dic.items()), key=lambda x: x[0])\n chk = 0\n ans = -1\n for k, v in sortdic:\n if chk == k:\n if chk != 0 and len(v) != 2:\n if v[0] > x:\n ans = x - k\n else:\n ans = x + k\n break\n else:\n ans = x - chk\n break\n chk += 1\n if ans == -1:\n ans = x - chk\n print(ans)\n", "fast_code_sha256": "57e83f49b70d738c7e3d0a2aaef4ec00f58ec1eaf55df7a36c0506962c4397b4", "fast_id": "p02641_57e83f49b70d738c7e3d0a2aaef4ec00f58ec1eaf55df7a36c0506962c4397b4", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "x, n = list(map(int, input().split()))\nif n == 0:\n print(x)\nelse:\n p = list(map(int, input().split()))\n dic = {}\n for i in p:\n d = abs(i - x)\n if d in dic:\n dic[d].append(i)\n else:\n dic[d] = [i]\n sortdic = sorted(list(dic.items()), key=lambda x: x[0])\n chk = 0\n ans = -1\n for k, v in sortdic:\n if chk == k:\n if chk != 0 and len(v) != 2:\n if v[0] > x:\n ans = x - k\n else:\n ans = x + k\n break\n else:\n ans = x - chk\n break\n chk += 1\n if ans == -1:\n ans = x - chk\n print(ans)\n", "measured_fast_code_sha256": "57e83f49b70d738c7e3d0a2aaef4ec00f58ec1eaf55df7a36c0506962c4397b4", "measured_slow_code": "x, n = list(map(int, input().split()))\nif n == 0:\n print(x)\n exit()\narr = list(map(int, input().split())) # p1 ... pn\narr2 = []\narr3 = []\nfor i in range(-50, 110):\n if not i in arr:\n arr2.append(i)\n arr3.append(abs(x - i))\nn2 = min([i for i, v in enumerate(arr3) if v == min(arr3)])\nprint((arr2[n2]))\n", "measured_slow_code_sha256": "56a803f01b0149391407a67301955076fc165a7ad3ad3f8f8a9f51ab5d8af60e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.8940472893019147, "pair_id": "python_v2_743748f95531885afda5e10b", "per_case_slow_code_faster_fraction": 0.03, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02641", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02641_57e83f49b70d738c7e3d0a2aaef4ec00f58ec1eaf55df7a36c0506962c4397b4.jsonl.gz", "inputs": "reproduction/python/inputs/p02641.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02641_56a803f01b0149391407a67301955076fc165a7ad3ad3f8f8a9f51ab5d8af60e.jsonl.gz"}, "slow_code": "x, n = list(map(int, input().split()))\nif n == 0:\n print(x)\n exit()\narr = list(map(int, input().split()))\narr2 = []\narr3 = []\nfor i in range(-50, 110):\n if not i in arr:\n arr2.append(i)\n arr3.append(abs(x - i))\nn2 = min([i for i, v in enumerate(arr3) if v == min(arr3)])\nprint((arr2[n2]))\n", "slow_code_sha256": "85cbb5049fb6ba315c1cc49d08aa7371cf037161b52bac8a421580f3486b7f72", "slow_id": "p02641_56a803f01b0149391407a67301955076fc165a7ad3ad3f8f8a9f51ab5d8af60e", "speedup": 2.036326558563158, "stratum": "2-4", "within_pair_jaccard": 0.36363636363636365, "workload": {"case_count": 100, "description": "Find an integer not in the N distinct forbidden values p_i that is closest to X. Integers need not be positive; ties favor the smaller integer. Observed inputs: X=1..100 (median 50); N=0..100 (median 99); p_i=1..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 300, "median": 295.0, "min": 4}, "input_format": ["X N\np_1 ... p_N (line omitted if N=0)"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 102, "median": 101.0, "min": 2}}} -{"case_ids": ["p03419_case_000", "p03419_case_001", "p03419_case_002", "p03419_case_003", "p03419_case_004", "p03419_case_005", "p03419_case_006", "p03419_case_007", "p03419_case_008", "p03419_case_009", "p03419_case_010", "p03419_case_011", "p03419_case_012", "p03419_case_013", "p03419_case_014", "p03419_case_015", "p03419_case_016", "p03419_case_017", "p03419_case_018", "p03419_case_019", "p03419_case_020", "p03419_case_021", "p03419_case_022", "p03419_case_023", "p03419_case_024", "p03419_case_025", "p03419_case_026", "p03419_case_027", "p03419_case_028", "p03419_case_029", "p03419_case_030", "p03419_case_031", "p03419_case_032", "p03419_case_033", "p03419_case_034", "p03419_case_035", "p03419_case_036", "p03419_case_037", "p03419_case_038", "p03419_case_039", "p03419_case_040", "p03419_case_041", "p03419_case_042", "p03419_case_043", "p03419_case_044", "p03419_case_045", "p03419_case_046", "p03419_case_047", "p03419_case_048", "p03419_case_049", "p03419_case_050", "p03419_case_051", "p03419_case_052", "p03419_case_053", "p03419_case_054", "p03419_case_055", "p03419_case_056", "p03419_case_057", "p03419_case_058", "p03419_case_059", "p03419_case_060", "p03419_case_061", "p03419_case_062", "p03419_case_063", "p03419_case_064", "p03419_case_065", "p03419_case_066", "p03419_case_067", "p03419_case_068", "p03419_case_069", "p03419_case_070", "p03419_case_071", "p03419_case_072", "p03419_case_073", "p03419_case_074", "p03419_case_075", "p03419_case_076", "p03419_case_077", "p03419_case_078", "p03419_case_079", "p03419_case_080", "p03419_case_081", "p03419_case_082", "p03419_case_083", "p03419_case_084", "p03419_case_085", "p03419_case_086", "p03419_case_087", "p03419_case_088", "p03419_case_089", "p03419_case_090", "p03419_case_091", "p03419_case_092", "p03419_case_093", "p03419_case_094", "p03419_case_095", "p03419_case_096", "p03419_case_097", "p03419_case_098", "p03419_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N, M = list(map(int, input().split()))\nif N == 2 or M == 2:\n print((0))\nelse:\n print((abs((N - 2) * (M - 2))))\n", "fast_code_sha256": "da805f3ee6670fdaae81ebd05aeff08dd0f062768069de7b6d7cdfd6a806264d", "fast_id": "p03419_da805f3ee6670fdaae81ebd05aeff08dd0f062768069de7b6d7cdfd6a806264d", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N, M = list(map(int, input().split()))\nif N == 2 or M == 2:\n print((0))\nelse:\n print((abs((N - 2) * (M - 2))))\n", "measured_fast_code_sha256": "da805f3ee6670fdaae81ebd05aeff08dd0f062768069de7b6d7cdfd6a806264d", "measured_slow_code": "def calc0(N, M):\n cell = [[0 for i in range(M)] for j in range(N)]\n for i in range(M):\n for j in range(N):\n for y in range(-1, 2):\n for x in range(-1, 2):\n xx = i + x\n yy = j + y\n if 0 <= xx < M and 0 <= yy < N:\n cell[yy][xx] ^= 1\n r = 0\n for i in range(M):\n for j in range(N):\n if cell[j][i]:\n r += 1\n return r\n\n\ndef calc(N, M):\n if N == 1 and M == 1:\n return 1\n if N >= 2 and M >= 2:\n return (N - 2) * (M - 2)\n if N == 1:\n return M - 2\n return N - 2\n\n\nN, M = [int(_) for _ in input().split()]\nprint((calc(N, M)))\n", "measured_slow_code_sha256": "03759bbd848f3c06ca221a2e3cc07d0592161ce2c92214006d02107382720a3e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4.177779399649925, "pair_id": "python_v2_f14d5671a2fa232e0250d295", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03419", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03419_da805f3ee6670fdaae81ebd05aeff08dd0f062768069de7b6d7cdfd6a806264d.jsonl.gz", "inputs": "reproduction/python/inputs/p03419.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03419_03759bbd848f3c06ca221a2e3cc07d0592161ce2c92214006d02107382720a3e.jsonl.gz"}, "slow_code": "def calc0(N, M):\n cell = [[0 for i in range(M)] for j in range(N)]\n for i in range(M):\n for j in range(N):\n for y in range(-1, 2):\n for x in range(-1, 2):\n xx = i + x\n yy = j + y\n if 0 <= xx < M and 0 <= yy < N:\n cell[yy][xx] ^= 1\n r = 0\n for i in range(M):\n for j in range(N):\n if cell[j][i]:\n r += 1\n return r\n\n\ndef calc(N, M):\n if N == 1 and M == 1:\n return 1\n if N >= 2 and M >= 2:\n return (N - 2) * (M - 2)\n if N == 1:\n return M - 2\n return N - 2\n\n\nN, M = [int(_) for _ in input().split()]\nprint((calc(N, M)))\n", "slow_code_sha256": "03759bbd848f3c06ca221a2e3cc07d0592161ce2c92214006d02107382720a3e", "slow_id": "p03419_03759bbd848f3c06ca221a2e3cc07d0592161ce2c92214006d02107382720a3e", "speedup": 4.179492381067723, "stratum": "4-8", "within_pair_jaccard": 0.28125, "workload": {"case_count": 100, "description": "An implicit N-by-M rectangle has one face-up card per cell. Once per cell, flip its own card and each of its eight neighboring cards that exists. Count face-down cards after all operations. Observed inputs: N=1..1000000000 (median 411600306.5); M=1..1000000000 (median 380900118.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 22, "median": 18.5, "min": 4}, "input_format": ["N M"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p02362_case_000", "p02362_case_001", "p02362_case_002", "p02362_case_003", "p02362_case_004", "p02362_case_005", "p02362_case_006", "p02362_case_007", "p02362_case_008", "p02362_case_009", "p02362_case_010", "p02362_case_011", "p02362_case_012", "p02362_case_013", "p02362_case_014", "p02362_case_015", "p02362_case_016", "p02362_case_017", "p02362_case_018", "p02362_case_019", "p02362_case_020", "p02362_case_021", "p02362_case_022", "p02362_case_023", "p02362_case_024", "p02362_case_025", "p02362_case_026", "p02362_case_027", "p02362_case_028", "p02362_case_029", "p02362_case_030", "p02362_case_031", "p02362_case_032", "p02362_case_033", "p02362_case_034", "p02362_case_035", "p02362_case_036", "p02362_case_037", "p02362_case_038", "p02362_case_039", "p02362_case_040", "p02362_case_041", "p02362_case_042", "p02362_case_043", "p02362_case_044", "p02362_case_045", "p02362_case_046", "p02362_case_047", "p02362_case_048", "p02362_case_049", "p02362_case_050", "p02362_case_051", "p02362_case_052", "p02362_case_053", "p02362_case_054", "p02362_case_055", "p02362_case_056", "p02362_case_057", "p02362_case_058", "p02362_case_059", "p02362_case_060", "p02362_case_061", "p02362_case_062", "p02362_case_063", "p02362_case_064", "p02362_case_065", "p02362_case_066", "p02362_case_067", "p02362_case_068", "p02362_case_069", "p02362_case_070", "p02362_case_071", "p02362_case_072", "p02362_case_073", "p02362_case_074", "p02362_case_075", "p02362_case_076", "p02362_case_077", "p02362_case_078", "p02362_case_079", "p02362_case_080", "p02362_case_081", "p02362_case_082", "p02362_case_083", "p02362_case_084", "p02362_case_085", "p02362_case_086", "p02362_case_087", "p02362_case_088", "p02362_case_089", "p02362_case_090", "p02362_case_091", "p02362_case_092", "p02362_case_093", "p02362_case_094", "p02362_case_095", "p02362_case_096", "p02362_case_097", "p02362_case_098", "p02362_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "executable_AST_equal_except_explicit_explanatory_string_removal_and_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\nreadline = sys.stdin.readline\nV, E, r = list(map(int, readline().split()))\ninf = 10**10\nedges = [[] for _ in [None] * V]\nfor _ in [None] * E:\n s, t, d = list(map(int, readline().split()))\n edges[s].append((t, d))\n\n\ndef bellman_ford(n, edges, start):\n vertices = [inf] * n\n vertices[start] = 0\n reached = {start}\n for i in range(n):\n flag = 0\n for v in reached.copy():\n cost = vertices[v]\n for dist, _cost in edges[v]:\n newcost = cost + _cost\n if vertices[dist] > newcost:\n vertices[dist] = newcost\n reached.add(dist)\n flag = 1\n if flag == 0:\n return vertices\n else:\n return None\n\n\nresult = bellman_ford(V, edges, r)\nif result:\n print((\"\\n\".join([str(n) if n != inf else \"INF\" for n in result])))\nelse:\n print(\"NEGATIVE CYCLE\")\n", "fast_code_sha256": "0a4b743931f51015a53a8b68212086bf81fdde0f3ffc6ca14185f8e4075397cc", "fast_id": "p02362_0a4b743931f51015a53a8b68212086bf81fdde0f3ffc6ca14185f8e4075397cc", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\nreadline = sys.stdin.readline\nV, E, r = list(map(int, readline().split()))\ninf = 10**10\nedges = [[] for _ in [None] * V]\nfor _ in [None] * E:\n s, t, d = list(map(int, readline().split()))\n edges[s].append((t, d))\n\n\ndef bellman_ford(n, edges, start):\n vertices = [inf] * n\n vertices[start] = 0\n reached = {start}\n for i in range(n):\n flag = 0\n for v in reached.copy():\n cost = vertices[v]\n for dist, _cost in edges[v]:\n newcost = cost + _cost\n if vertices[dist] > newcost:\n vertices[dist] = newcost\n reached.add(dist)\n flag = 1\n if flag == 0:\n return vertices\n else:\n return None\n\n\nresult = bellman_ford(V, edges, r)\nif result:\n print((\"\\n\".join([str(n) if n != inf else \"INF\" for n in result])))\nelse:\n print(\"NEGATIVE CYCLE\")\n", "measured_fast_code_sha256": "0a4b743931f51015a53a8b68212086bf81fdde0f3ffc6ca14185f8e4075397cc", "measured_slow_code": "from collections import defaultdict, deque\nfrom heapq import heappush, heappop\nfrom sys import stdin\n\n\nclass UnionFindSet:\n def __init__(self, nodes):\n self.fa = {}\n for n in nodes:\n self.fa[n] = n\n\n def find(self, x):\n if self.fa[x] == x:\n return x\n else:\n self.fa[x] = self.find(self.fa[x])\n return self.fa[x]\n\n def union(self, x, y):\n fx = self.find(x)\n fy = self.find(y)\n if fx == fy:\n return fx\n else:\n self.fa[fx] = fy\n return fy\n\n\n\"\"\"\ngraph is a hash\ngraph[\"nodes\"] is a list of all nodes in the graph\ngraph[\"edges\"] is a list of all edges in the graph in (x, y, w) form\n - x is the first nodes\n - y is the second nodes\n - w is the weight of the edges\ngraph[\"relation\"] is the graph relation of the graph\n\"\"\"\n\n\ndef kruscal(graph):\n \"kruscal minimum spanning tree algorithm\"\n ufset = UnionFindSet(graph[\"nodes\"])\n ret = 0\n for (x, y, w) in sorted(graph[\"edges\"], key=lambda x: x[-1]):\n fx = ufset.find(x)\n fy = ufset.find(y)\n if fx != fy:\n ret += w\n ufset.union(fx, fy)\n else:\n pass\n return ret\n\n\ndef dijkstra(graph, root):\n \"dijkstra algorithm for single source shortest algorithm\"\n dis, vis = {}, {}\n for n in graph[\"nodes\"]:\n dis[n] = 10**9\n vis[n] = False\n heap = []\n dis[root] = 0\n heappush(heap, (0, root))\n while heap:\n _, n = heappop(heap)\n vis[n] = True\n for (y, w) in graph[\"adj\"][n]:\n if not vis[y] and dis[n] + w < dis[y]:\n dis[y] = dis[n] + w\n heappush(heap, (dis[y], y))\n return dis\n\n\ndef belmanFord(graph, root):\n dis = {}\n for n in graph[\"nodes\"]:\n dis[n] = 10**9\n dis[root] = 0\n # update for n - 1 times\n for _ in range(len(graph[\"nodes\"]) - 1):\n for (x, y, w) in graph[\"edges\"]:\n if dis[x] + w < dis[y]:\n dis[y] = dis[x] + w\n connect = set([root])\n que = deque([root])\n while que:\n n = que.popleft()\n for (y, _) in graph[\"adj\"][n]:\n if not y in connect:\n connect.add(y)\n que.append(y)\n dis[\"negcicle\"] = False\n for (x, y, w) in graph[\"edges\"]:\n if dis[x] + w < dis[y] and x in connect:\n dis[\"negcicle\"] = True\n dis[\"con\"] = connect\n return dis\n\n\nif __name__ == \"__main__\":\n V, E, root = list(map(int, stdin.readline().strip().split()))\n graph = {}\n graph[\"nodes\"] = [i for i in range(V)]\n graph[\"edges\"] = []\n graph[\"adj\"] = defaultdict(list)\n for _ in range(E):\n x, y, w = list(map(int, stdin.readline().strip().split()))\n graph[\"edges\"].append((x, y, w))\n graph[\"adj\"][x].append((y, w))\n dis = belmanFord(graph, root)\n if dis[\"negcicle\"]:\n print(\"NEGATIVE CYCLE\")\n else:\n for n in graph[\"nodes\"]:\n print(dis[n] if dis[n] < 10**9 and n in dis[\"con\"] else \"INF\")\n", "measured_slow_code_sha256": "d6cb17a39e8d47e829780362674fb799a70c7ec0318e8f73c0bd0b98feeddcea", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.9450422058323786, "pair_id": "python_v2_ce30aea968a50b1d044db145", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02362", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02362_0a4b743931f51015a53a8b68212086bf81fdde0f3ffc6ca14185f8e4075397cc.jsonl.gz", "inputs": "reproduction/python/inputs/p02362.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02362_d6cb17a39e8d47e829780362674fb799a70c7ec0318e8f73c0bd0b98feeddcea.jsonl.gz"}, "slow_code": "from collections import defaultdict, deque\nfrom heapq import heappush, heappop\nfrom sys import stdin\n\n\nclass UnionFindSet:\n def __init__(self, nodes):\n self.fa = {}\n for n in nodes:\n self.fa[n] = n\n\n def find(self, x):\n if self.fa[x] == x:\n return x\n else:\n self.fa[x] = self.find(self.fa[x])\n return self.fa[x]\n\n def union(self, x, y):\n fx = self.find(x)\n fy = self.find(y)\n if fx == fy:\n return fx\n else:\n self.fa[fx] = fy\n return fy\n\n\ndef kruscal(graph):\n ufset = UnionFindSet(graph[\"nodes\"])\n ret = 0\n for x, y, w in sorted(graph[\"edges\"], key=lambda x: x[-1]):\n fx = ufset.find(x)\n fy = ufset.find(y)\n if fx != fy:\n ret += w\n ufset.union(fx, fy)\n else:\n pass\n return ret\n\n\ndef dijkstra(graph, root):\n dis, vis = {}, {}\n for n in graph[\"nodes\"]:\n dis[n] = 10**9\n vis[n] = False\n heap = []\n dis[root] = 0\n heappush(heap, (0, root))\n while heap:\n _, n = heappop(heap)\n vis[n] = True\n for y, w in graph[\"adj\"][n]:\n if not vis[y] and dis[n] + w < dis[y]:\n dis[y] = dis[n] + w\n heappush(heap, (dis[y], y))\n return dis\n\n\ndef belmanFord(graph, root):\n dis = {}\n for n in graph[\"nodes\"]:\n dis[n] = 10**9\n dis[root] = 0\n\n for _ in range(len(graph[\"nodes\"]) - 1):\n for x, y, w in graph[\"edges\"]:\n if dis[x] + w < dis[y]:\n dis[y] = dis[x] + w\n connect = set([root])\n que = deque([root])\n while que:\n n = que.popleft()\n for y, _ in graph[\"adj\"][n]:\n if not y in connect:\n connect.add(y)\n que.append(y)\n dis[\"negcicle\"] = False\n for x, y, w in graph[\"edges\"]:\n if dis[x] + w < dis[y] and x in connect:\n dis[\"negcicle\"] = True\n dis[\"con\"] = connect\n return dis\n\n\nif __name__ == \"__main__\":\n V, E, root = list(map(int, stdin.readline().strip().split()))\n graph = {}\n graph[\"nodes\"] = [i for i in range(V)]\n graph[\"edges\"] = []\n graph[\"adj\"] = defaultdict(list)\n for _ in range(E):\n x, y, w = list(map(int, stdin.readline().strip().split()))\n graph[\"edges\"].append((x, y, w))\n graph[\"adj\"][x].append((y, w))\n dis = belmanFord(graph, root)\n if dis[\"negcicle\"]:\n print(\"NEGATIVE CYCLE\")\n else:\n for n in graph[\"nodes\"]:\n print(dis[n] if dis[n] < 10**9 and n in dis[\"con\"] else \"INF\")\n", "slow_code_sha256": "cdd2579d3060a2f75d6de6488415a4ad2843746f1234a7ee49a668cc4c29847e", "slow_id": "p02362_d6cb17a39e8d47e829780362674fb799a70c7ec0318e8f73c0bd0b98feeddcea", "speedup": 4.282977320921786, "stratum": "4-8", "within_pair_jaccard": 0.25210084033613445, "workload": {"case_count": 100, "description": "For a directed graph with signed edge weights, output NEGATIVE CYCLE if a negative cycle is reachable from source r. Otherwise output shortest-path costs from r, using INF for unreachable vertices. IDs are 0..V-1; no self-loops or parallel directed edges. Observed inputs: V=1..1000 (median 50); E=0..2000 (median 50); r=0..999; d_i=-10000..10000; negative_edges=0..1041 (median 25).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 26410, "median": 573.0, "min": 6}, "input_format": ["V E r\ns_1 t_1 d_1\n...\ns_E t_E d_E"], "input_format_status": "source_input_section", "input_lines": {"max": 2001, "median": 51.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 6003, "median": 153.0, "min": 3}}} -{"case_ids": ["p02675_case_000", "p02675_case_001", "p02675_case_002", "p02675_case_003", "p02675_case_004", "p02675_case_005", "p02675_case_006", "p02675_case_007", "p02675_case_008", "p02675_case_009", "p02675_case_010", "p02675_case_011", "p02675_case_012", "p02675_case_013", "p02675_case_014", "p02675_case_015", "p02675_case_016", "p02675_case_017", "p02675_case_018", "p02675_case_019", "p02675_case_020", "p02675_case_021", "p02675_case_022", "p02675_case_023", "p02675_case_024", "p02675_case_025", "p02675_case_026", "p02675_case_027", "p02675_case_028", "p02675_case_029", "p02675_case_030", "p02675_case_031", "p02675_case_032", "p02675_case_033", "p02675_case_034", "p02675_case_035", "p02675_case_036", "p02675_case_037", "p02675_case_038", "p02675_case_039", "p02675_case_040", "p02675_case_041", "p02675_case_042", "p02675_case_043", "p02675_case_044", "p02675_case_045", "p02675_case_046", "p02675_case_047", "p02675_case_048", "p02675_case_049", "p02675_case_050", "p02675_case_051", "p02675_case_052", "p02675_case_053", "p02675_case_054", "p02675_case_055", "p02675_case_056", "p02675_case_057", "p02675_case_058", "p02675_case_059", "p02675_case_060", "p02675_case_061", "p02675_case_062", "p02675_case_063", "p02675_case_064", "p02675_case_065", "p02675_case_066", "p02675_case_067", "p02675_case_068", "p02675_case_069", "p02675_case_070", "p02675_case_071", "p02675_case_072", "p02675_case_073", "p02675_case_074", "p02675_case_075", "p02675_case_076", "p02675_case_077", "p02675_case_078", "p02675_case_079", "p02675_case_080", "p02675_case_081", "p02675_case_082", "p02675_case_083", "p02675_case_084", "p02675_case_085", "p02675_case_086", "p02675_case_087", "p02675_case_088", "p02675_case_089", "p02675_case_090", "p02675_case_091", "p02675_case_092", "p02675_case_093", "p02675_case_094", "p02675_case_095", "p02675_case_096", "p02675_case_097", "p02675_case_098", "p02675_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\nsr = lambda: sys.stdin.readline().rstrip()\nir = lambda: int(sr())\nlr = lambda: list(map(int, sr().split()))\nN = sr()[-1]\nif N == \"3\":\n answer = \"bon\"\nelif N in \"0168\":\n answer = \"pon\"\nelse:\n answer = \"hon\"\nprint(answer)\n", "fast_code_sha256": "a0bd71321fa65881ecea10a3368dec692ada88087b2a39a7deb6a5615c3add72", "fast_id": "p02675_13457c06fb1915b6e1b2ef3a05933c1ba76d50ea4b5111261e17f0d1dbb6f6ce", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "# coding: utf-8\nimport sys\n\nsr = lambda: sys.stdin.readline().rstrip()\nir = lambda: int(sr())\nlr = lambda: list(map(int, sr().split()))\nN = sr()[-1]\nif N == \"3\":\n answer = \"bon\"\nelif N in \"0168\":\n answer = \"pon\"\nelse:\n answer = \"hon\"\nprint(answer)\n", "measured_fast_code_sha256": "13457c06fb1915b6e1b2ef3a05933c1ba76d50ea4b5111261e17f0d1dbb6f6ce", "measured_slow_code": "# coding: utf-8\nimport sys\nimport math\nimport collections\nimport itertools\n\nINF = 10**13\nMOD = 10**9 + 7\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef lcm(x, y):\n return (x * y) // math.gcd(x, y)\n\n\ndef I():\n return int(input())\n\n\ndef LI():\n return [int(x) for x in input().split()]\n\n\ndef RI(N):\n return [int(input()) for _ in range(N)]\n\n\ndef LRI(N):\n return [[int(x) for x in input().split()] for _ in range(N)]\n\n\ndef LS():\n return input().split()\n\n\ndef RS(N):\n return [input() for _ in range(N)]\n\n\ndef LRS(N):\n return [input().split() for _ in range(N)]\n\n\ndef PL(L):\n print(*L, sep=\"\\n\")\n\n\ndef YesNo(B):\n print(\"Yes\" if B else \"No\")\n\n\ndef YESNO(B):\n print(\"YES\" if B else \"NO\")\n\n\nN = input()\nn = int(N[-1])\nif n in [2, 4, 5, 7, 9]:\n print(\"hon\")\nelif n in [0, 1, 6, 8]:\n print(\"pon\")\nelse:\n print(\"bon\")\n", "measured_slow_code_sha256": "bcce039052b5a9d508977350d4acfbd9fe58862ea34a03a2bcd6716f9ff97915", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.832169073012956, "pair_id": "python_v2_e5cb1e81b85daff864fea3a7", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02675", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02675_13457c06fb1915b6e1b2ef3a05933c1ba76d50ea4b5111261e17f0d1dbb6f6ce.jsonl.gz", "inputs": "reproduction/python/inputs/p02675.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02675_bcce039052b5a9d508977350d4acfbd9fe58862ea34a03a2bcd6716f9ff97915.jsonl.gz"}, "slow_code": "import sys\nimport math\nimport collections\nimport itertools\n\nINF = 10**13\nMOD = 10**9 + 7\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef lcm(x, y):\n return (x * y) // math.gcd(x, y)\n\n\ndef I():\n return int(input())\n\n\ndef LI():\n return [int(x) for x in input().split()]\n\n\ndef RI(N):\n return [int(input()) for _ in range(N)]\n\n\ndef LRI(N):\n return [[int(x) for x in input().split()] for _ in range(N)]\n\n\ndef LS():\n return input().split()\n\n\ndef RS(N):\n return [input() for _ in range(N)]\n\n\ndef LRS(N):\n return [input().split() for _ in range(N)]\n\n\ndef PL(L):\n print(*L, sep=\"\\n\")\n\n\ndef YesNo(B):\n print(\"Yes\" if B else \"No\")\n\n\ndef YESNO(B):\n print(\"YES\" if B else \"NO\")\n\n\nN = input()\nn = int(N[-1])\nif n in [2, 4, 5, 7, 9]:\n print(\"hon\")\nelif n in [0, 1, 6, 8]:\n print(\"pon\")\nelse:\n print(\"bon\")\n", "slow_code_sha256": "a356f7da63a7609258cca42cfa76beeb6639c9b361627aee5fe4197d7e864b71", "slow_id": "p02675_bcce039052b5a9d508977350d4acfbd9fe58862ea34a03a2bcd6716f9ff97915", "speedup": 3.8324351546892412, "stratum": "2-4", "within_pair_jaccard": 0.2318840579710145, "workload": {"case_count": 100, "description": "Output a counter pronunciation determined by the last decimal digit of N: hon for 2,4,5,7,9; pon for 0,1,6,8; bon for 3. Observed inputs: N=1..999 (median 404).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 4, "median": 4.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p03160_case_000", "p03160_case_001", "p03160_case_002", "p03160_case_003", "p03160_case_004", "p03160_case_005", "p03160_case_006", "p03160_case_007", "p03160_case_008", "p03160_case_009", "p03160_case_010", "p03160_case_011", "p03160_case_012", "p03160_case_013", "p03160_case_014", "p03160_case_015", "p03160_case_016", "p03160_case_017", "p03160_case_018", "p03160_case_019", "p03160_case_020", "p03160_case_021", "p03160_case_022", "p03160_case_023", "p03160_case_024", "p03160_case_025", "p03160_case_026", "p03160_case_027", "p03160_case_028", "p03160_case_029", "p03160_case_030", "p03160_case_031", "p03160_case_032", "p03160_case_033", "p03160_case_034", "p03160_case_035", "p03160_case_036", "p03160_case_037", "p03160_case_038", "p03160_case_039", "p03160_case_040", "p03160_case_041", "p03160_case_042", "p03160_case_043", "p03160_case_044", "p03160_case_045", "p03160_case_046", "p03160_case_047", "p03160_case_048", "p03160_case_049", "p03160_case_050", "p03160_case_051", "p03160_case_052", "p03160_case_053", "p03160_case_054", "p03160_case_055", "p03160_case_056", "p03160_case_057", "p03160_case_058", "p03160_case_059", "p03160_case_060", "p03160_case_061", "p03160_case_062", "p03160_case_063", "p03160_case_064", "p03160_case_065", "p03160_case_066", "p03160_case_067", "p03160_case_068", "p03160_case_069", "p03160_case_070", "p03160_case_071", "p03160_case_072", "p03160_case_073", "p03160_case_074", "p03160_case_075", "p03160_case_076", "p03160_case_077", "p03160_case_078", "p03160_case_079", "p03160_case_080", "p03160_case_081", "p03160_case_082", "p03160_case_083", "p03160_case_084", "p03160_case_085", "p03160_case_086", "p03160_case_087", "p03160_case_088", "p03160_case_089", "p03160_case_090", "p03160_case_091", "p03160_case_092", "p03160_case_093", "p03160_case_094", "p03160_case_095", "p03160_case_096", "p03160_case_097", "p03160_case_098", "p03160_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def chmin(a, b):\n return b if a > b else a\n\n\ndef chmax(a, b):\n return b if a < b else a\n\n\ndef main(N, h):\n INF = 10**9\n dp = [INF] * (10**5 + 10)\n dp[0] = 0\n dp[1] = abs(h[1] - h[0])\n for i in range(2, N):\n dp[i] = chmin(dp[i], dp[i - 1] + abs(h[i] - h[i - 1]))\n dp[i] = chmin(dp[i], dp[i - 2] + abs(h[i] - h[i - 2]))\n return dp[N - 1]\n\n\nif __name__ == \"__main__\":\n N = int(eval(input()))\n h = list(map(int, input().split()))\n print((main(N, h)))\n", "fast_code_sha256": "8185ff30e0c9c996858e3d16d93a81081069df94e4bf04533622db94259f80af", "fast_id": "p03160_02dc5e8a92b36c65414027f95dabbd6bae3c37ac8542ade78d85c49d788d67e4", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "#!/usr/bin/env python\ndef chmin(a, b):\n return b if a > b else a\n\n\ndef chmax(a, b):\n return b if a < b else a\n\n\ndef main(N, h):\n INF = 10**9\n dp = [INF] * (10**5 + 10)\n dp[0] = 0\n dp[1] = abs(h[1] - h[0])\n for i in range(2, N):\n dp[i] = chmin(dp[i], dp[i - 1] + abs(h[i] - h[i - 1]))\n dp[i] = chmin(dp[i], dp[i - 2] + abs(h[i] - h[i - 2]))\n return dp[N - 1]\n\n\nif __name__ == \"__main__\":\n N = int(eval(input()))\n h = list(map(int, input().split()))\n print((main(N, h)))\n", "measured_fast_code_sha256": "02dc5e8a92b36c65414027f95dabbd6bae3c37ac8542ade78d85c49d788d67e4", "measured_slow_code": "import numpy as np\n\nN = int(eval(input()))\nhs = [int(i) for i in input().split()]\ndp = np.zeros(N)\nfor i, h in enumerate(hs):\n if i == 0:\n # 0は初期化されている\n dp[i] = 0\n continue\n elif i == 1:\n # 1は1通りしか無い\n dp[i] = dp[i - 1] + abs(hs[i - 1] - h)\n else:\n # 1個前か2個前で、コストが最小になるやつ\n dp[i] = min(dp[i - 1] + abs(hs[i - 1] - h), dp[i - 2] + abs(hs[i - 2] - h))\n# print(dp)\nprint((int(dp[-1])))\n", "measured_slow_code_sha256": "934f379e0e5300fe0fee5440b2de9ab7f1cfdccbfbc9686e36dc49ab293c868e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 47.31352781168614, "pair_id": "python_v2_53e9873577feed10bee116ef", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03160", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03160_02dc5e8a92b36c65414027f95dabbd6bae3c37ac8542ade78d85c49d788d67e4.jsonl.gz", "inputs": "reproduction/python/inputs/p03160.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03160_934f379e0e5300fe0fee5440b2de9ab7f1cfdccbfbc9686e36dc49ab293c868e.jsonl.gz"}, "slow_code": "import numpy as np\n\nN = int(eval(input()))\nhs = [int(i) for i in input().split()]\ndp = np.zeros(N)\nfor i, h in enumerate(hs):\n if i == 0:\n\n dp[i] = 0\n continue\n elif i == 1:\n\n dp[i] = dp[i - 1] + abs(hs[i - 1] - h)\n else:\n\n dp[i] = min(dp[i - 1] + abs(hs[i - 1] - h), dp[i - 2] + abs(hs[i - 2] - h))\n\nprint((int(dp[-1])))\n", "slow_code_sha256": "3c2eb6d041b194aca6e618ed722e1b9ae4cb2dfbc9ca12487589612e2e637390", "slow_id": "p03160_934f379e0e5300fe0fee5440b2de9ab7f1cfdccbfbc9686e36dc49ab293c868e", "speedup": 32.229120262452156, "stratum": "8+", "within_pair_jaccard": 0.3953488372093023, "workload": {"case_count": 100, "description": "A frog starts at stone 1 and jumps ahead by 1 or 2 stones. A jump from i to j costs |h_i-h_j|. Find the minimum total cost to reach stone N. Observed inputs: N=2..100000 (median 1000); h_i=1..10000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 600007, "median": 4888.5, "min": 6}, "input_format": ["N\nh_1 ... h_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100001, "median": 1001.0, "min": 3}}} -{"case_ids": ["p02362_case_000", "p02362_case_001", "p02362_case_002", "p02362_case_003", "p02362_case_004", "p02362_case_005", "p02362_case_006", "p02362_case_007", "p02362_case_008", "p02362_case_009", "p02362_case_010", "p02362_case_011", "p02362_case_012", "p02362_case_013", "p02362_case_014", "p02362_case_015", "p02362_case_016", "p02362_case_017", "p02362_case_018", "p02362_case_019", "p02362_case_020", "p02362_case_021", "p02362_case_022", "p02362_case_023", "p02362_case_024", "p02362_case_025", "p02362_case_026", "p02362_case_027", "p02362_case_028", "p02362_case_029", "p02362_case_030", "p02362_case_031", "p02362_case_032", "p02362_case_033", "p02362_case_034", "p02362_case_035", "p02362_case_036", "p02362_case_037", "p02362_case_038", "p02362_case_039", "p02362_case_040", "p02362_case_041", "p02362_case_042", "p02362_case_043", "p02362_case_044", "p02362_case_045", "p02362_case_046", "p02362_case_047", "p02362_case_048", "p02362_case_049", "p02362_case_050", "p02362_case_051", "p02362_case_052", "p02362_case_053", "p02362_case_054", "p02362_case_055", "p02362_case_056", "p02362_case_057", "p02362_case_058", "p02362_case_059", "p02362_case_060", "p02362_case_061", "p02362_case_062", "p02362_case_063", "p02362_case_064", "p02362_case_065", "p02362_case_066", "p02362_case_067", "p02362_case_068", "p02362_case_069", "p02362_case_070", "p02362_case_071", "p02362_case_072", "p02362_case_073", "p02362_case_074", "p02362_case_075", "p02362_case_076", "p02362_case_077", "p02362_case_078", "p02362_case_079", "p02362_case_080", "p02362_case_081", "p02362_case_082", "p02362_case_083", "p02362_case_084", "p02362_case_085", "p02362_case_086", "p02362_case_087", "p02362_case_088", "p02362_case_089", "p02362_case_090", "p02362_case_091", "p02362_case_092", "p02362_case_093", "p02362_case_094", "p02362_case_095", "p02362_case_096", "p02362_case_097", "p02362_case_098", "p02362_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\nreadline = sys.stdin.readline\nV, E, r = list(map(int, readline().split()))\ninf = 10**10\nedges = [[] for _ in [None] * V]\nfor _ in [None] * E:\n s, t, d = list(map(int, readline().split()))\n edges[s].append((t, d))\n\n\ndef bellman_ford(n, edges, start):\n vertices = [inf] * n\n vertices[start] = 0\n reached = {start}\n for i in range(n):\n flag = 0\n for v in reached.copy():\n cost = vertices[v]\n for dist, _cost in edges[v]:\n newcost = cost + _cost\n if vertices[dist] > newcost:\n vertices[dist] = newcost\n reached.add(dist)\n flag = 1\n if flag == 0:\n return vertices\n else:\n return None\n\n\nresult = bellman_ford(V, edges, r)\nif result:\n print((\"\\n\".join([str(n) if n != inf else \"INF\" for n in result])))\nelse:\n print(\"NEGATIVE CYCLE\")\n", "fast_code_sha256": "0a4b743931f51015a53a8b68212086bf81fdde0f3ffc6ca14185f8e4075397cc", "fast_id": "p02362_0a4b743931f51015a53a8b68212086bf81fdde0f3ffc6ca14185f8e4075397cc", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\nreadline = sys.stdin.readline\nV, E, r = list(map(int, readline().split()))\ninf = 10**10\nedges = [[] for _ in [None] * V]\nfor _ in [None] * E:\n s, t, d = list(map(int, readline().split()))\n edges[s].append((t, d))\n\n\ndef bellman_ford(n, edges, start):\n vertices = [inf] * n\n vertices[start] = 0\n reached = {start}\n for i in range(n):\n flag = 0\n for v in reached.copy():\n cost = vertices[v]\n for dist, _cost in edges[v]:\n newcost = cost + _cost\n if vertices[dist] > newcost:\n vertices[dist] = newcost\n reached.add(dist)\n flag = 1\n if flag == 0:\n return vertices\n else:\n return None\n\n\nresult = bellman_ford(V, edges, r)\nif result:\n print((\"\\n\".join([str(n) if n != inf else \"INF\" for n in result])))\nelse:\n print(\"NEGATIVE CYCLE\")\n", "measured_fast_code_sha256": "0a4b743931f51015a53a8b68212086bf81fdde0f3ffc6ca14185f8e4075397cc", "measured_slow_code": "from sys import stdin\nfrom collections import deque\n\nV, E, R = [int(x) for x in stdin.readline().split()]\nd = {}\ntick = False\nINF = float(\"inf\")\nfor i in range(V):\n d[i] = INF\nd[R] = 0\nweight = {}\nst = []\nfor i in range(1, V + 1):\n for j in range(E):\n if i == 1:\n s, t, w = [int(x) for x in stdin.readline().split()]\n weight[(s, t)] = w\n st.append((s, t))\n (s, t) = st[j]\n if d[t] > d[s] + weight[(s, t)]:\n d[t] = d[s] + weight[(s, t)]\n if i == V:\n print(\"NEGATIVE CYCLE\")\n quit()\nfor k in range(V):\n if d[k] == float(\"inf\"):\n print(\"INF\")\n else:\n print((d[k]))\n", "measured_slow_code_sha256": "ab12a803b6785f5f4ed17833763fd1aa5fdea2598bb998ef4d318a063084c6bb", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.9691391419567417, "pair_id": "python_v2_bec112d041557e78cbd88540", "per_case_slow_code_faster_fraction": 0.08, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02362", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02362_0a4b743931f51015a53a8b68212086bf81fdde0f3ffc6ca14185f8e4075397cc.jsonl.gz", "inputs": "reproduction/python/inputs/p02362.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02362_ab12a803b6785f5f4ed17833763fd1aa5fdea2598bb998ef4d318a063084c6bb.jsonl.gz"}, "slow_code": "from sys import stdin\nfrom collections import deque\n\nV, E, R = [int(x) for x in stdin.readline().split()]\nd = {}\ntick = False\nINF = float(\"inf\")\nfor i in range(V):\n d[i] = INF\nd[R] = 0\nweight = {}\nst = []\nfor i in range(1, V + 1):\n for j in range(E):\n if i == 1:\n s, t, w = [int(x) for x in stdin.readline().split()]\n weight[(s, t)] = w\n st.append((s, t))\n (s, t) = st[j]\n if d[t] > d[s] + weight[(s, t)]:\n d[t] = d[s] + weight[(s, t)]\n if i == V:\n print(\"NEGATIVE CYCLE\")\n quit()\nfor k in range(V):\n if d[k] == float(\"inf\"):\n print(\"INF\")\n else:\n print((d[k]))\n", "slow_code_sha256": "ab12a803b6785f5f4ed17833763fd1aa5fdea2598bb998ef4d318a063084c6bb", "slow_id": "p02362_ab12a803b6785f5f4ed17833763fd1aa5fdea2598bb998ef4d318a063084c6bb", "speedup": 4.791159183768857, "stratum": "4-8", "within_pair_jaccard": 0.390625, "workload": {"case_count": 100, "description": "For a directed graph with signed edge weights, output NEGATIVE CYCLE if a negative cycle is reachable from source r. Otherwise output shortest-path costs from r, using INF for unreachable vertices. IDs are 0..V-1; no self-loops or parallel directed edges. Observed inputs: V=1..1000 (median 50); E=0..2000 (median 50); r=0..999; d_i=-10000..10000; negative_edges=0..1041 (median 25).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 26410, "median": 573.0, "min": 6}, "input_format": ["V E r\ns_1 t_1 d_1\n...\ns_E t_E d_E"], "input_format_status": "source_input_section", "input_lines": {"max": 2001, "median": 51.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 6003, "median": 153.0, "min": 3}}} -{"case_ids": ["p03455_case_000", "p03455_case_001", "p03455_case_002", "p03455_case_003", "p03455_case_004", "p03455_case_005", "p03455_case_006", "p03455_case_007", "p03455_case_008", "p03455_case_009", "p03455_case_010", "p03455_case_011", "p03455_case_012", "p03455_case_013", "p03455_case_014", "p03455_case_015", "p03455_case_016", "p03455_case_017", "p03455_case_018", "p03455_case_019", "p03455_case_020", "p03455_case_021", "p03455_case_022", "p03455_case_023", "p03455_case_024", "p03455_case_025", "p03455_case_026", "p03455_case_027", "p03455_case_028", "p03455_case_029", "p03455_case_030", "p03455_case_031", "p03455_case_032", "p03455_case_033", "p03455_case_034", "p03455_case_035", "p03455_case_036", "p03455_case_037", "p03455_case_038", "p03455_case_039", "p03455_case_040", "p03455_case_041", "p03455_case_042", "p03455_case_043", "p03455_case_044", "p03455_case_045", "p03455_case_046", "p03455_case_047", "p03455_case_048", "p03455_case_049", "p03455_case_050", "p03455_case_051", "p03455_case_052", "p03455_case_053", "p03455_case_054", "p03455_case_055", "p03455_case_056", "p03455_case_057", "p03455_case_058", "p03455_case_059", "p03455_case_060", "p03455_case_061", "p03455_case_062", "p03455_case_063", "p03455_case_064", "p03455_case_065", "p03455_case_066", "p03455_case_067", "p03455_case_068", "p03455_case_069", "p03455_case_070", "p03455_case_071", "p03455_case_072", "p03455_case_073", "p03455_case_074", "p03455_case_075", "p03455_case_076", "p03455_case_077", "p03455_case_078", "p03455_case_079", "p03455_case_080", "p03455_case_081", "p03455_case_082", "p03455_case_083", "p03455_case_084", "p03455_case_085", "p03455_case_086", "p03455_case_087", "p03455_case_088", "p03455_case_089", "p03455_case_090", "p03455_case_091", "p03455_case_092", "p03455_case_093", "p03455_case_094", "p03455_case_095", "p03455_case_096", "p03455_case_097", "p03455_case_098", "p03455_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "print((\"EOvdedn\"[eval(input().replace(\" \", \"*\")) % 2 :: 2]))\n", "fast_code_sha256": "577b4ea967359c1669928f248bb452ad9c2b25326a52b9d964878a21cdf42c4d", "fast_id": "p03455_577b4ea967359c1669928f248bb452ad9c2b25326a52b9d964878a21cdf42c4d", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "print((\"EOvdedn\"[eval(input().replace(\" \", \"*\")) % 2 :: 2]))\n", "measured_fast_code_sha256": "577b4ea967359c1669928f248bb452ad9c2b25326a52b9d964878a21cdf42c4d", "measured_slow_code": "def ketanowa(p):\n ans = 0\n p = str(p)\n for i in p:\n ans += int(i)\n return ans\n\n\ndef main():\n temp = input().split(\" \")\n n = int(temp[0])\n a = int(temp[1])\n if n * a % 2 == 0:\n print(\"Even\")\n else:\n print(\"Odd\")\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "1e58957cce6049d366f3189df1c6244aa3226734d9f71da11d6221cbf487aae2", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.9122092476590407, "pair_id": "python_v2_98e8b1b2dda9e56591fce0a5", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03455", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03455_577b4ea967359c1669928f248bb452ad9c2b25326a52b9d964878a21cdf42c4d.jsonl.gz", "inputs": "reproduction/python/inputs/p03455.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03455_1e58957cce6049d366f3189df1c6244aa3226734d9f71da11d6221cbf487aae2.jsonl.gz"}, "slow_code": "def ketanowa(p):\n ans = 0\n p = str(p)\n for i in p:\n ans += int(i)\n return ans\n\n\ndef main():\n temp = input().split(\" \")\n n = int(temp[0])\n a = int(temp[1])\n if n * a % 2 == 0:\n print(\"Even\")\n else:\n print(\"Odd\")\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "1e58957cce6049d366f3189df1c6244aa3226734d9f71da11d6221cbf487aae2", "slow_id": "p03455_1e58957cce6049d366f3189df1c6244aa3226734d9f71da11d6221cbf487aae2", "speedup": 2.905216221786339, "stratum": "2-4", "within_pair_jaccard": 0.10344827586206896, "workload": {"case_count": 100, "description": "Determine whether the product of two supplied positive integers a and b is odd or even. Observed inputs: a=1..10000 (median 7119); b=1..10000 (median 5506.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 12, "median": 10.0, "min": 4}, "input_format": ["a b"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p03274_case_000", "p03274_case_001", "p03274_case_002", "p03274_case_003", "p03274_case_004", "p03274_case_005", "p03274_case_006", "p03274_case_007", "p03274_case_008", "p03274_case_009", "p03274_case_010", "p03274_case_011", "p03274_case_012", "p03274_case_013", "p03274_case_014", "p03274_case_015", "p03274_case_016", "p03274_case_017", "p03274_case_018", "p03274_case_019", "p03274_case_020", "p03274_case_021", "p03274_case_022", "p03274_case_023", "p03274_case_024", "p03274_case_025", "p03274_case_026", "p03274_case_027", "p03274_case_028", "p03274_case_029", "p03274_case_030", "p03274_case_031", "p03274_case_032", "p03274_case_033", "p03274_case_034", "p03274_case_035", "p03274_case_036", "p03274_case_037", "p03274_case_038", "p03274_case_039", "p03274_case_040", "p03274_case_041", "p03274_case_042", "p03274_case_043", "p03274_case_044", "p03274_case_045", "p03274_case_046", "p03274_case_047", "p03274_case_048", "p03274_case_049", "p03274_case_050", "p03274_case_051", "p03274_case_052", "p03274_case_053", "p03274_case_054", "p03274_case_055", "p03274_case_056", "p03274_case_057", "p03274_case_058", "p03274_case_059", "p03274_case_060", "p03274_case_061", "p03274_case_062", "p03274_case_063", "p03274_case_064", "p03274_case_065", "p03274_case_066", "p03274_case_067", "p03274_case_068", "p03274_case_069", "p03274_case_070", "p03274_case_071", "p03274_case_072", "p03274_case_073", "p03274_case_074", "p03274_case_075", "p03274_case_076", "p03274_case_077", "p03274_case_078", "p03274_case_079", "p03274_case_080", "p03274_case_081", "p03274_case_082", "p03274_case_083", "p03274_case_084", "p03274_case_085", "p03274_case_086", "p03274_case_087", "p03274_case_088", "p03274_case_089", "p03274_case_090", "p03274_case_091", "p03274_case_092", "p03274_case_093", "p03274_case_094", "p03274_case_095", "p03274_case_096", "p03274_case_097", "p03274_case_098", "p03274_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n, k = list(map(int, input().split()))\nx = list(map(int, input().split()))\nans = []\nfor i in range(n - k + 1):\n left = x[i]\n right = x[i + k - 1]\n ans.append(min(abs(left) + abs(right - left), abs(right) + abs(left - right)))\nprint((min(ans)))\n", "fast_code_sha256": "ee788620a526aa607e4ae96784ce1c061a1220a5076476586dd1c067846bce28", "fast_id": "p03274_ee788620a526aa607e4ae96784ce1c061a1220a5076476586dd1c067846bce28", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n, k = list(map(int, input().split()))\nx = list(map(int, input().split()))\nans = []\nfor i in range(n - k + 1):\n left = x[i]\n right = x[i + k - 1]\n ans.append(min(abs(left) + abs(right - left), abs(right) + abs(left - right)))\nprint((min(ans)))\n", "measured_fast_code_sha256": "ee788620a526aa607e4ae96784ce1c061a1220a5076476586dd1c067846bce28", "measured_slow_code": "import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time\n\nsys.setrecursionlimit(10**7)\ninf = 10**20\nmod = 10**9 + 7\n\n\ndef LI():\n return list(map(int, input().split()))\n\n\ndef I():\n return int(eval(input()))\n\n\ndef LS():\n return input().split()\n\n\ndef S():\n return eval(input())\n\n\ndef main():\n n, k = LI()\n l = LI()\n mn = inf\n for i in range(n - k + 1):\n a = l[i]\n b = l[i + k - 1]\n if a < 0 and b > 0:\n mn = min([mn, abs(a) + abs(b) * 2, abs(a) * 2 + abs(b)])\n else:\n mn = min(mn, max(abs(a), abs(b)))\n return mn\n\n\nprint((main()))\n", "measured_slow_code_sha256": "15cce6db7bc6d79dcd48950e05503001080b8e54791a05cbcc84aecc1f823153", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.0065036793590503, "pair_id": "python_v2_d1ff623b237e881798faeb0e", "per_case_slow_code_faster_fraction": 0.3, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03274", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03274_ee788620a526aa607e4ae96784ce1c061a1220a5076476586dd1c067846bce28.jsonl.gz", "inputs": "reproduction/python/inputs/p03274.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03274_15cce6db7bc6d79dcd48950e05503001080b8e54791a05cbcc84aecc1f823153.jsonl.gz"}, "slow_code": "import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time\n\nsys.setrecursionlimit(10**7)\ninf = 10**20\nmod = 10**9 + 7\n\n\ndef LI():\n return list(map(int, input().split()))\n\n\ndef I():\n return int(eval(input()))\n\n\ndef LS():\n return input().split()\n\n\ndef S():\n return eval(input())\n\n\ndef main():\n n, k = LI()\n l = LI()\n mn = inf\n for i in range(n - k + 1):\n a = l[i]\n b = l[i + k - 1]\n if a < 0 and b > 0:\n mn = min([mn, abs(a) + abs(b) * 2, abs(a) * 2 + abs(b)])\n else:\n mn = min(mn, max(abs(a), abs(b)))\n return mn\n\n\nprint((main()))\n", "slow_code_sha256": "15cce6db7bc6d79dcd48950e05503001080b8e54791a05cbcc84aecc1f823153", "slow_id": "p03274_15cce6db7bc6d79dcd48950e05503001080b8e54791a05cbcc84aecc1f823153", "speedup": 3.82118352570988, "stratum": "2-4", "within_pair_jaccard": 0.25862068965517243, "workload": {"case_count": 100, "description": "Start at coordinate 0 and travel along a line at unit speed to light K of N candles at strictly increasing positions x_i. Lighting takes negligible time. Minimize elapsed time; return to 0 is not required. Observed inputs: N=1..100000 (median 10000); K=1..100000 (median 75); x_i=-100000000..100000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1000015, "median": 53814.0, "min": 14}, "input_format": ["N K\nx_1 ... x_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100002, "median": 10002.0, "min": 3}}} -{"case_ids": ["p02881_case_000", "p02881_case_001", "p02881_case_002", "p02881_case_003", "p02881_case_004", "p02881_case_005", "p02881_case_006", "p02881_case_007", "p02881_case_008", "p02881_case_009", "p02881_case_010", "p02881_case_011", "p02881_case_012", "p02881_case_013", "p02881_case_014", "p02881_case_015", "p02881_case_016", "p02881_case_017", "p02881_case_018", "p02881_case_019", "p02881_case_020", "p02881_case_021", "p02881_case_022", "p02881_case_023", "p02881_case_024", "p02881_case_025", "p02881_case_026", "p02881_case_027", "p02881_case_028", "p02881_case_029", "p02881_case_030", "p02881_case_031", "p02881_case_032", "p02881_case_033", "p02881_case_034", "p02881_case_035", "p02881_case_036", "p02881_case_037", "p02881_case_038", "p02881_case_039", "p02881_case_040", "p02881_case_041", "p02881_case_042", "p02881_case_043", "p02881_case_044", "p02881_case_045", "p02881_case_046", "p02881_case_047", "p02881_case_048", "p02881_case_049", "p02881_case_050", "p02881_case_051", "p02881_case_052", "p02881_case_053", "p02881_case_054", "p02881_case_055", "p02881_case_056", "p02881_case_057", "p02881_case_058", "p02881_case_059", "p02881_case_060", "p02881_case_061", "p02881_case_062", "p02881_case_063", "p02881_case_064", "p02881_case_065", "p02881_case_066", "p02881_case_067", "p02881_case_068", "p02881_case_069", "p02881_case_070", "p02881_case_071", "p02881_case_072", "p02881_case_073", "p02881_case_074", "p02881_case_075", "p02881_case_076", "p02881_case_077", "p02881_case_078", "p02881_case_079", "p02881_case_080", "p02881_case_081", "p02881_case_082", "p02881_case_083", "p02881_case_084", "p02881_case_085", "p02881_case_086", "p02881_case_087", "p02881_case_088", "p02881_case_089", "p02881_case_090", "p02881_case_091", "p02881_case_092", "p02881_case_093", "p02881_case_094", "p02881_case_095", "p02881_case_096", "p02881_case_097", "p02881_case_098", "p02881_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N = int(eval(input()))\nx = int(N**0.5)\nfor i in range(x, 0, -1):\n if N % i == 0:\n y = N // i\n break\nans = N // y + y - 2\nprint(ans)\n", "fast_code_sha256": "385f918e70558d30ce24cedf0de5f4a96a7aad60475bd5eec62a4ce0ebe4edee", "fast_id": "p02881_385f918e70558d30ce24cedf0de5f4a96a7aad60475bd5eec62a4ce0ebe4edee", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N = int(eval(input()))\nx = int(N**0.5)\nfor i in range(x, 0, -1):\n if N % i == 0:\n y = N // i\n break\nans = N // y + y - 2\nprint(ans)\n", "measured_fast_code_sha256": "385f918e70558d30ce24cedf0de5f4a96a7aad60475bd5eec62a4ce0ebe4edee", "measured_slow_code": "import sys\n\nsys.setrecursionlimit(10**7)\nf_inf = float(\"inf\")\nmod = 10**9 + 7\n# nの約数を列挙列挙する\ndef make_divisors(n):\n divisors = []\n for i in range(1, int(pow(n, 0.5)) + 1):\n if n % i == 0:\n divisors.append(i)\n if i != n // i:\n divisors.append(n // i)\n divisors.sort()\n return divisors\n\n\ndef resolve():\n n = int(eval(input()))\n div = make_divisors(n)\n res = f_inf\n for i in div:\n cost = i + n // i - 2\n res = min(res, cost)\n print(res)\n\n\nif __name__ == \"__main__\":\n resolve()\n", "measured_slow_code_sha256": "ad00789e3ab1c0171663b647d60fcdd74ea599f9c2e60c34e58bfd4b7e51ca2d", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.415694424964544, "pair_id": "python_v2_fd501d0df27f3b6984142963", "per_case_slow_code_faster_fraction": 0.25, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02881", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02881_385f918e70558d30ce24cedf0de5f4a96a7aad60475bd5eec62a4ce0ebe4edee.jsonl.gz", "inputs": "reproduction/python/inputs/p02881.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02881_ad00789e3ab1c0171663b647d60fcdd74ea599f9c2e60c34e58bfd4b7e51ca2d.jsonl.gz"}, "slow_code": "import sys\n\nsys.setrecursionlimit(10**7)\nf_inf = float(\"inf\")\nmod = 10**9 + 7\n\n\ndef make_divisors(n):\n divisors = []\n for i in range(1, int(pow(n, 0.5)) + 1):\n if n % i == 0:\n divisors.append(i)\n if i != n // i:\n divisors.append(n // i)\n divisors.sort()\n return divisors\n\n\ndef resolve():\n n = int(eval(input()))\n div = make_divisors(n)\n res = f_inf\n for i in div:\n cost = i + n // i - 2\n res = min(res, cost)\n print(res)\n\n\nif __name__ == \"__main__\":\n resolve()\n", "slow_code_sha256": "b7459fe662666f4f818a58ffdb7be6fbc3203ac3a68cd69948b5c91f1dd6d73e", "slow_id": "p02881_ad00789e3ab1c0171663b647d60fcdd74ea599f9c2e60c34e58bfd4b7e51ca2d", "speedup": 7.449160294929298, "stratum": "4-8", "within_pair_jaccard": 0.2857142857142857, "workload": {"case_count": 100, "description": "On an infinite grid with value i*j at cell (i,j), start at (1,1). Each move increases exactly one coordinate by 1. Minimize moves to reach any cell of value N. Observed inputs: N=2..1000000000000 (median 260337887119.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 14, "median": 13.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p02725_case_000", "p02725_case_001", "p02725_case_002", "p02725_case_003", "p02725_case_004", "p02725_case_005", "p02725_case_006", "p02725_case_007", "p02725_case_008", "p02725_case_009", "p02725_case_010", "p02725_case_011", "p02725_case_012", "p02725_case_013", "p02725_case_014", "p02725_case_015", "p02725_case_016", "p02725_case_017", "p02725_case_018", "p02725_case_019", "p02725_case_020", "p02725_case_021", "p02725_case_022", "p02725_case_023", "p02725_case_024", "p02725_case_025", "p02725_case_026", "p02725_case_027", "p02725_case_028", "p02725_case_029", "p02725_case_030", "p02725_case_031", "p02725_case_032", "p02725_case_033", "p02725_case_034", "p02725_case_035", "p02725_case_036", "p02725_case_037", "p02725_case_038", "p02725_case_039", "p02725_case_040", "p02725_case_041", "p02725_case_042", "p02725_case_043", "p02725_case_044", "p02725_case_045", "p02725_case_046", "p02725_case_047", "p02725_case_048", "p02725_case_049", "p02725_case_050", "p02725_case_051", "p02725_case_052", "p02725_case_053", "p02725_case_054", "p02725_case_055", "p02725_case_056", "p02725_case_057", "p02725_case_058", "p02725_case_059", "p02725_case_060", "p02725_case_061", "p02725_case_062", "p02725_case_063", "p02725_case_064", "p02725_case_065", "p02725_case_066", "p02725_case_067", "p02725_case_068", "p02725_case_069", "p02725_case_070", "p02725_case_071", "p02725_case_072", "p02725_case_073", "p02725_case_074", "p02725_case_075", "p02725_case_076", "p02725_case_077", "p02725_case_078", "p02725_case_079", "p02725_case_080", "p02725_case_081", "p02725_case_082", "p02725_case_083", "p02725_case_084", "p02725_case_085", "p02725_case_086", "p02725_case_087", "p02725_case_088", "p02725_case_089", "p02725_case_090", "p02725_case_091", "p02725_case_092", "p02725_case_093", "p02725_case_094", "p02725_case_095", "p02725_case_096", "p02725_case_097", "p02725_case_098", "p02725_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from sys import stdin\n\ninp = stdin.readline\nn, k = [int(x) for x in inp().strip().split()]\narray = [int(x) for x in inp().strip().split()]\ndistance = [0] * (k * 2)\nfor i in range(k - 1):\n distance[i] = array[i + 1] - array[i]\ndistance[k - 1] = n - array[k - 1] + array[0]\ndistance[2 * k - 1] = n - array[k - 1] + array[0]\nfor i in range(k - 1):\n distance[k + i] = array[i + 1] - array[i]\nminimum = 999999999\ncount = 0\ntotal = 0\ncountLimit = k - 1\nfor i in range(k * 2):\n if count < countLimit:\n total += distance[i]\n count += 1\n else:\n if minimum > total:\n minimum = total\n total += distance[i]\n total -= distance[i - countLimit]\nprint(minimum)\n", "fast_code_sha256": "9164aae6c8839a29a40c85ad8ba3bfc05c8440fc08a285145380122a94d7f972", "fast_id": "p02725_9164aae6c8839a29a40c85ad8ba3bfc05c8440fc08a285145380122a94d7f972", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from sys import stdin\n\ninp = stdin.readline\nn, k = [int(x) for x in inp().strip().split()]\narray = [int(x) for x in inp().strip().split()]\ndistance = [0] * (k * 2)\nfor i in range(k - 1):\n distance[i] = array[i + 1] - array[i]\ndistance[k - 1] = n - array[k - 1] + array[0]\ndistance[2 * k - 1] = n - array[k - 1] + array[0]\nfor i in range(k - 1):\n distance[k + i] = array[i + 1] - array[i]\nminimum = 999999999\ncount = 0\ntotal = 0\ncountLimit = k - 1\nfor i in range(k * 2):\n if count < countLimit:\n total += distance[i]\n count += 1\n else:\n if minimum > total:\n minimum = total\n total += distance[i]\n total -= distance[i - countLimit]\nprint(minimum)\n", "measured_fast_code_sha256": "9164aae6c8839a29a40c85ad8ba3bfc05c8440fc08a285145380122a94d7f972", "measured_slow_code": "import numpy as np\n\nK, N = list(map(int, input().split()))\nA = list(map(int, input().split()))\nA.append(K + A[0])\nD = np.diff(A)\nprint((int(K) - np.max(D)))\n", "measured_slow_code_sha256": "91accdad635aaade3cd21a1cbe15f0f073859089779275b1b10043afbdc41816", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 270.4924114619577, "pair_id": "python_v2_fafc219138bfce2ee998a63b", "per_case_slow_code_faster_fraction": 0.49, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02725", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02725_9164aae6c8839a29a40c85ad8ba3bfc05c8440fc08a285145380122a94d7f972.jsonl.gz", "inputs": "reproduction/python/inputs/p02725.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02725_91accdad635aaade3cd21a1cbe15f0f073859089779275b1b10043afbdc41816.jsonl.gz"}, "slow_code": "import numpy as np\n\nK, N = list(map(int, input().split()))\nA = list(map(int, input().split()))\nA.append(K + A[0])\nD = np.diff(A)\nprint((int(K) - np.max(D)))\n", "slow_code_sha256": "91accdad635aaade3cd21a1cbe15f0f073859089779275b1b10043afbdc41816", "slow_id": "p02725_91accdad635aaade3cd21a1cbe15f0f073859089779275b1b10043afbdc41816", "speedup": 12.657527348126896, "stratum": "8+", "within_pair_jaccard": 0.11904761904761904, "workload": {"case_count": 100, "description": "On a circular path of circumference K, houses have strictly increasing clockwise positions A_i. Starting at any house, find the minimum distance along the circle needed to visit all N houses; return to the start is not required. Observed inputs: K=2..1000000 (median 100); N=2..200000 (median 50); A_i=0..999999.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1399579, "median": 156.0, "min": 8}, "input_format": ["K N\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200002, "median": 52.0, "min": 4}}} -{"case_ids": ["p02681_case_000", "p02681_case_001", "p02681_case_002", "p02681_case_003", "p02681_case_004", "p02681_case_005", "p02681_case_006", "p02681_case_007", "p02681_case_008", "p02681_case_009", "p02681_case_010", "p02681_case_011", "p02681_case_012", "p02681_case_013", "p02681_case_014", "p02681_case_015", "p02681_case_016", "p02681_case_017", "p02681_case_018", "p02681_case_019", "p02681_case_020", "p02681_case_021", "p02681_case_022", "p02681_case_023", "p02681_case_024", "p02681_case_025", "p02681_case_026", "p02681_case_027", "p02681_case_028", "p02681_case_029", "p02681_case_030", "p02681_case_031", "p02681_case_032", "p02681_case_033", "p02681_case_034", "p02681_case_035", "p02681_case_036", "p02681_case_037", "p02681_case_038", "p02681_case_039", "p02681_case_040", "p02681_case_041", "p02681_case_042", "p02681_case_043", "p02681_case_044", "p02681_case_045", "p02681_case_046", "p02681_case_047", "p02681_case_048", "p02681_case_049", "p02681_case_050", "p02681_case_051", "p02681_case_052", "p02681_case_053", "p02681_case_054", "p02681_case_055", "p02681_case_056", "p02681_case_057", "p02681_case_058", "p02681_case_059", "p02681_case_060", "p02681_case_061", "p02681_case_062", "p02681_case_063", "p02681_case_064", "p02681_case_065", "p02681_case_066", "p02681_case_067", "p02681_case_068", "p02681_case_069", "p02681_case_070", "p02681_case_071", "p02681_case_072", "p02681_case_073", "p02681_case_074", "p02681_case_075", "p02681_case_076", "p02681_case_077", "p02681_case_078", "p02681_case_079", "p02681_case_080", "p02681_case_081", "p02681_case_082", "p02681_case_083", "p02681_case_084", "p02681_case_085", "p02681_case_086", "p02681_case_087", "p02681_case_088", "p02681_case_089", "p02681_case_090", "p02681_case_091", "p02681_case_092", "p02681_case_093", "p02681_case_094", "p02681_case_095", "p02681_case_096", "p02681_case_097", "p02681_case_098", "p02681_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\ninput = lambda: sys.stdin.readline().rstrip()\naint = lambda: int(input())\nints = lambda: list(map(int, input().split()))\nimport math\n\nfloor, ceil = lambda x: int(math.floor(x)), lambda x: int(math.ceil(x))\nfrom functools import reduce\n\ngcd = lambda *x: reduce(math.gcd, x)\nlcm = lambda *x: reduce(lambda x, y: (x * y) // gcd(x, y), x, 1)\nfrom collections import deque\n\nYes = lambda b: print(\"Yes\" if b else \"No\")\nYES = lambda b: print(\"YES\" if b else \"NO\")\nis_even = lambda x: True if x % 2 == 0 else False\n\n\ndef main():\n s = input()\n t = input()\n n = len(s)\n flg = 0\n for i in range(n):\n if s[i] != t[i]:\n flg = 1\n Yes(flg == 0)\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "f4400189ff3db203f96723d5aee262e6d415108f8067f12bc82d5f8b60b24440", "fast_id": "p02681_f4400189ff3db203f96723d5aee262e6d415108f8067f12bc82d5f8b60b24440", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\ninput = lambda: sys.stdin.readline().rstrip()\naint = lambda: int(input())\nints = lambda: list(map(int, input().split()))\nimport math\n\nfloor, ceil = lambda x: int(math.floor(x)), lambda x: int(math.ceil(x))\nfrom functools import reduce\n\ngcd = lambda *x: reduce(math.gcd, x)\nlcm = lambda *x: reduce(lambda x, y: (x * y) // gcd(x, y), x, 1)\nfrom collections import deque\n\nYes = lambda b: print(\"Yes\" if b else \"No\")\nYES = lambda b: print(\"YES\" if b else \"NO\")\nis_even = lambda x: True if x % 2 == 0 else False\n\n\ndef main():\n s = input()\n t = input()\n n = len(s)\n flg = 0\n for i in range(n):\n if s[i] != t[i]:\n flg = 1\n Yes(flg == 0)\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "f4400189ff3db203f96723d5aee262e6d415108f8067f12bc82d5f8b60b24440", "measured_slow_code": "#!/usr/bin/env python3\n# Generated by https://github.com/kyuridenamida/atcoder-tools\nfrom typing import *\nimport itertools\nimport math\nimport sys\n\nINF = float(\"inf\")\nYES = \"Yes\" # type: str\nNO = \"No\" # type: str\n\n\ndef solve(S: str, T: str):\n return [NO, YES][S == T[:-1]]\n\n\ndef main():\n sys.setrecursionlimit(10**6)\n\n def iterate_tokens():\n for line in sys.stdin:\n for word in line.split():\n yield word\n\n tokens = iterate_tokens()\n S = next(tokens) # type: str\n T = next(tokens) # type: str\n print((solve(S, T)))\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "e11f3e444910fe42a6baf012b95849e72747767315b4086506c83bd0c43f1245", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 5.888689184333199, "pair_id": "python_v2_092b4d649f9e8698d8879721", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02681", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02681_f4400189ff3db203f96723d5aee262e6d415108f8067f12bc82d5f8b60b24440.jsonl.gz", "inputs": "reproduction/python/inputs/p02681.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02681_e11f3e444910fe42a6baf012b95849e72747767315b4086506c83bd0c43f1245.jsonl.gz"}, "slow_code": "from typing import *\nimport itertools\nimport math\nimport sys\n\nINF = float(\"inf\")\nYES = \"Yes\"\nNO = \"No\"\n\n\ndef solve(S: str, T: str):\n return [NO, YES][S == T[:-1]]\n\n\ndef main():\n sys.setrecursionlimit(10**6)\n\n def iterate_tokens():\n for line in sys.stdin:\n for word in line.split():\n yield word\n\n tokens = iterate_tokens()\n S = next(tokens)\n T = next(tokens)\n print((solve(S, T)))\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "aead1926afd539d76d7800cd27f3761ad24e19df52b7dacf9e4a54d6feb221d2", "slow_id": "p02681_e11f3e444910fe42a6baf012b95849e72747767315b4086506c83bd0c43f1245", "speedup": 5.889634255384855, "stratum": "4-8", "within_pair_jaccard": 0.2676056338028169, "workload": {"case_count": 100, "description": "Determine whether lowercase string T can be obtained by appending exactly one lowercase letter to the end of S. T is guaranteed to have length |S|+1. Observed inputs: S_length=1..10 (median 5); T_length=2..11 (median 6).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 23, "median": 13.0, "min": 5}, "input_format": ["S\nT"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p03244_case_000", "p03244_case_001", "p03244_case_002", "p03244_case_003", "p03244_case_004", "p03244_case_005", "p03244_case_006", "p03244_case_007", "p03244_case_008", "p03244_case_009", "p03244_case_010", "p03244_case_011", "p03244_case_012", "p03244_case_013", "p03244_case_014", "p03244_case_015", "p03244_case_016", "p03244_case_017", "p03244_case_018", "p03244_case_019", "p03244_case_020", "p03244_case_021", "p03244_case_022", "p03244_case_023", "p03244_case_024", "p03244_case_025", "p03244_case_026", "p03244_case_027", "p03244_case_028", "p03244_case_029", "p03244_case_030", "p03244_case_031", "p03244_case_032", "p03244_case_033", "p03244_case_034", "p03244_case_035", "p03244_case_036", "p03244_case_037", "p03244_case_038", "p03244_case_039", "p03244_case_040", "p03244_case_041", "p03244_case_042", "p03244_case_043", "p03244_case_044", "p03244_case_045", "p03244_case_046", "p03244_case_047", "p03244_case_048", "p03244_case_049", "p03244_case_050", "p03244_case_051", "p03244_case_052", "p03244_case_053", "p03244_case_054", "p03244_case_055", "p03244_case_056", "p03244_case_057", "p03244_case_058", "p03244_case_059", "p03244_case_060", "p03244_case_061", "p03244_case_062", "p03244_case_063", "p03244_case_064", "p03244_case_065", "p03244_case_066", "p03244_case_067", "p03244_case_068", "p03244_case_069", "p03244_case_070", "p03244_case_071", "p03244_case_072", "p03244_case_073", "p03244_case_074", "p03244_case_075", "p03244_case_076", "p03244_case_077", "p03244_case_078", "p03244_case_079", "p03244_case_080", "p03244_case_081", "p03244_case_082", "p03244_case_083", "p03244_case_084", "p03244_case_085", "p03244_case_086", "p03244_case_087", "p03244_case_088", "p03244_case_089", "p03244_case_090", "p03244_case_091", "p03244_case_092", "p03244_case_093", "p03244_case_094", "p03244_case_095", "p03244_case_096", "p03244_case_097", "p03244_case_098", "p03244_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def main():\n n, *v = list(map(int, open(0).read().split()))\n be = [0] * int(1e5)\n bo = [0] * int(1e5)\n for e, o in zip(*[iter(v)] * 2):\n be[e - 1] += 1\n bo[o - 1] += 1\n if be.index(max(be)) == bo.index(max(bo)):\n ve = max(be)\n vo = max(bo)\n be[be.index(ve)] = 0\n bo[bo.index(vo)] = 0\n print((min(n - ve - max(bo), n - vo - max(be))))\n else:\n print((n - max(be) - max(bo)))\n return\n\n\nmain()\n", "fast_code_sha256": "5310d966b2517660fc3b88ec1d0b8849b9bec037248efb2abc816aaed876d848", "fast_id": "p03244_5310d966b2517660fc3b88ec1d0b8849b9bec037248efb2abc816aaed876d848", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def main():\n n, *v = list(map(int, open(0).read().split()))\n be = [0] * int(1e5)\n bo = [0] * int(1e5)\n for e, o in zip(*[iter(v)] * 2):\n be[e - 1] += 1\n bo[o - 1] += 1\n if be.index(max(be)) == bo.index(max(bo)):\n ve = max(be)\n vo = max(bo)\n be[be.index(ve)] = 0\n bo[bo.index(vo)] = 0\n print((min(n - ve - max(bo), n - vo - max(be))))\n else:\n print((n - max(be) - max(bo)))\n return\n\n\nmain()\n", "measured_fast_code_sha256": "5310d966b2517660fc3b88ec1d0b8849b9bec037248efb2abc816aaed876d848", "measured_slow_code": "import numpy as np\n\neven = np.zeros(100001, dtype=int)\nodd = np.zeros(100001, dtype=int)\nn = int(eval(input()))\nv = list(map(int, input().split()))\nfor i in range(n):\n if i % 2 == 0:\n even[v[i]] += 1\n else:\n odd[v[i]] += 1\ne1 = even.argmax()\ne1n = even.max()\no1 = odd.argmax()\no1n = odd.max()\n# print(e1, e1n, o1, o1n)\nif e1 == o1:\n e2n = np.sort(even)[-2]\n o2n = np.sort(odd)[-2]\n # print(e2n, o2n)\n print((min(n - e1n - o2n, n - e2n - o1n)))\nelse:\n print((n - e1n - o1n))\n", "measured_slow_code_sha256": "100838eb35611188aaa0e6508544517c0abf47ad6e005b321a85725c0e9840dd", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 6.093468321238918, "pair_id": "python_v2_2e49ec1ff1e78579e15b326d", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03244", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03244_5310d966b2517660fc3b88ec1d0b8849b9bec037248efb2abc816aaed876d848.jsonl.gz", "inputs": "reproduction/python/inputs/p03244.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03244_100838eb35611188aaa0e6508544517c0abf47ad6e005b321a85725c0e9840dd.jsonl.gz"}, "slow_code": "import numpy as np\n\neven = np.zeros(100001, dtype=int)\nodd = np.zeros(100001, dtype=int)\nn = int(eval(input()))\nv = list(map(int, input().split()))\nfor i in range(n):\n if i % 2 == 0:\n even[v[i]] += 1\n else:\n odd[v[i]] += 1\ne1 = even.argmax()\ne1n = even.max()\no1 = odd.argmax()\no1n = odd.max()\n\nif e1 == o1:\n e2n = np.sort(even)[-2]\n o2n = np.sort(odd)[-2]\n\n print((min(n - e1n - o2n, n - e2n - o1n)))\nelse:\n print((n - e1n - o1n))\n", "slow_code_sha256": "a39b059af4b03221115ad0dd54a76e5f423fd6c8173a18ffdbed4e08ab13360c", "slow_id": "p03244_100838eb35611188aaa0e6508544517c0abf47ad6e005b321a85725c0e9840dd", "speedup": 5.814095772802665, "stratum": "4-8", "within_pair_jaccard": 0.3076923076923077, "workload": {"case_count": 100, "description": "Replace as few entries of an even-length sequence as possible so values repeat with period 2 and exactly two distinct values occur. Equal adjacent parity classes are not permitted in the result. Observed inputs: N=2..100000 (median 100); v_i=1..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 600007, "median": 598.5, "min": 12}, "input_format": ["n\nv_1 ... v_n"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100001, "median": 101.0, "min": 3}}} -{"case_ids": ["p02780_case_000", "p02780_case_001", "p02780_case_002", "p02780_case_003", "p02780_case_004", "p02780_case_005", "p02780_case_006", "p02780_case_007", "p02780_case_008", "p02780_case_009", "p02780_case_010", "p02780_case_011", "p02780_case_012", "p02780_case_013", "p02780_case_014", "p02780_case_015", "p02780_case_016", "p02780_case_017", "p02780_case_018", "p02780_case_019", "p02780_case_020", "p02780_case_021", "p02780_case_022", "p02780_case_023", "p02780_case_024", "p02780_case_025", "p02780_case_026", "p02780_case_027", "p02780_case_028", "p02780_case_029", "p02780_case_030", "p02780_case_031", "p02780_case_032", "p02780_case_033", "p02780_case_034", "p02780_case_035", "p02780_case_036", "p02780_case_037", "p02780_case_038", "p02780_case_039", "p02780_case_040", "p02780_case_041", "p02780_case_042", "p02780_case_043", "p02780_case_044", "p02780_case_045", "p02780_case_046", "p02780_case_047", "p02780_case_048", "p02780_case_049", "p02780_case_050", "p02780_case_051", "p02780_case_052", "p02780_case_053", "p02780_case_054", "p02780_case_055", "p02780_case_056", "p02780_case_057", "p02780_case_058", "p02780_case_059", "p02780_case_060", "p02780_case_061", "p02780_case_062", "p02780_case_063", "p02780_case_064", "p02780_case_065", "p02780_case_066", "p02780_case_067", "p02780_case_068", "p02780_case_069", "p02780_case_070", "p02780_case_071", "p02780_case_072", "p02780_case_073", "p02780_case_074", "p02780_case_075", "p02780_case_076", "p02780_case_077", "p02780_case_078", "p02780_case_079", "p02780_case_080", "p02780_case_081", "p02780_case_082", "p02780_case_083", "p02780_case_084", "p02780_case_085", "p02780_case_086", "p02780_case_087", "p02780_case_088", "p02780_case_089", "p02780_case_090", "p02780_case_091", "p02780_case_092", "p02780_case_093", "p02780_case_094", "p02780_case_095", "p02780_case_096", "p02780_case_097", "p02780_case_098", "p02780_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N, K = list(map(int, input().split()))\nP = list(map(int, input().split()))\nfrom itertools import accumulate\n\nacc = [0]\nacc.extend(accumulate(P))\nans = 0\nfor i in range(N - K + 1):\n exp = (acc[K + i] - acc[i] + K) / 2\n ans = max(exp, ans)\nprint(ans)\n", "fast_code_sha256": "f4115d423fcff42ce325ac00a8e4b76da24d8b743514f1eb1f635c77c66da87b", "fast_id": "p02780_f4115d423fcff42ce325ac00a8e4b76da24d8b743514f1eb1f635c77c66da87b", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N, K = list(map(int, input().split()))\nP = list(map(int, input().split()))\nfrom itertools import accumulate\n\nacc = [0]\nacc.extend(accumulate(P))\nans = 0\nfor i in range(N - K + 1):\n exp = (acc[K + i] - acc[i] + K) / 2\n ans = max(exp, ans)\nprint(ans)\n", "measured_fast_code_sha256": "f4115d423fcff42ce325ac00a8e4b76da24d8b743514f1eb1f635c77c66da87b", "measured_slow_code": "class BIT:\n def __init__(self, n):\n self.node = [0 for _ in range(n + 1)]\n\n def add(self, idx, w):\n i = idx\n while i < len(self.node) - 1:\n self.node[i] += w\n i |= i + 1\n\n def sum_(self, idx):\n ret, i = 0, idx - 1\n while i >= 0:\n ret += self.node[i]\n i = (i & (i + 1)) - 1\n return ret\n\n def sum(self, l, r):\n return self.sum_(r) - self.sum_(l)\n\n\nn, k = list(map(int, input().split()))\ntree = BIT(n)\np = [int(x) for x in input().split()]\nfor i in range(n):\n tree.add(i, (1 + p[i]) / 2)\nans = 0\nfor i in range(n - k + 1):\n ans = max(ans, tree.sum(i, i + k))\nprint(ans)\n", "measured_slow_code_sha256": "f0e0a2a27a21da5cf3bfa118c0651e9d7851f3f79494b7c4374dbb95d552c6f4", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 7.47643926344422, "pair_id": "python_v2_dcee554e4c866b0ae61f5890", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02780", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02780_f4115d423fcff42ce325ac00a8e4b76da24d8b743514f1eb1f635c77c66da87b.jsonl.gz", "inputs": "reproduction/python/inputs/p02780.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02780_f0e0a2a27a21da5cf3bfa118c0651e9d7851f3f79494b7c4374dbb95d552c6f4.jsonl.gz"}, "slow_code": "class BIT:\n def __init__(self, n):\n self.node = [0 for _ in range(n + 1)]\n\n def add(self, idx, w):\n i = idx\n while i < len(self.node) - 1:\n self.node[i] += w\n i |= i + 1\n\n def sum_(self, idx):\n ret, i = 0, idx - 1\n while i >= 0:\n ret += self.node[i]\n i = (i & (i + 1)) - 1\n return ret\n\n def sum(self, l, r):\n return self.sum_(r) - self.sum_(l)\n\n\nn, k = list(map(int, input().split()))\ntree = BIT(n)\np = [int(x) for x in input().split()]\nfor i in range(n):\n tree.add(i, (1 + p[i]) / 2)\nans = 0\nfor i in range(n - k + 1):\n ans = max(ans, tree.sum(i, i + k))\nprint(ans)\n", "slow_code_sha256": "f0e0a2a27a21da5cf3bfa118c0651e9d7851f3f79494b7c4374dbb95d552c6f4", "slow_id": "p02780_f0e0a2a27a21da5cf3bfa118c0651e9d7851f3f79494b7c4374dbb95d552c6f4", "speedup": 6.010114923877441, "stratum": "4-8", "within_pair_jaccard": 0.3125, "workload": {"case_count": 100, "description": "Die i independently yields an integer uniformly from 1 to p_i. Choose K consecutive dice among N to maximize the expected sum of the rolls. Observed inputs: N=1..200000 (median 1000); K=1..200000 (median 5); p_i=1..1000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1000014, "median": 3877.5, "min": 8}, "input_format": ["N K\np_1 ... p_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200002, "median": 1002.0, "min": 3}}} -{"case_ids": ["p03762_case_000", "p03762_case_001", "p03762_case_002", "p03762_case_003", "p03762_case_004", "p03762_case_005", "p03762_case_006", "p03762_case_007", "p03762_case_008", "p03762_case_009", "p03762_case_010", "p03762_case_011", "p03762_case_012", "p03762_case_013", "p03762_case_014", "p03762_case_015", "p03762_case_016", "p03762_case_017", "p03762_case_018", "p03762_case_019", "p03762_case_020", "p03762_case_021", "p03762_case_022", "p03762_case_023", "p03762_case_024", "p03762_case_025", "p03762_case_026", "p03762_case_027", "p03762_case_028", "p03762_case_029", "p03762_case_030", "p03762_case_031", "p03762_case_032", "p03762_case_033", "p03762_case_034", "p03762_case_035", "p03762_case_036", "p03762_case_037", "p03762_case_038", "p03762_case_039", "p03762_case_040", "p03762_case_041", "p03762_case_042", "p03762_case_043", "p03762_case_044", "p03762_case_045", "p03762_case_046", "p03762_case_047", "p03762_case_048", "p03762_case_049", "p03762_case_050", "p03762_case_051", "p03762_case_052", "p03762_case_053", "p03762_case_054", "p03762_case_055", "p03762_case_056", "p03762_case_057", "p03762_case_058", "p03762_case_059", "p03762_case_060", "p03762_case_061", "p03762_case_062", "p03762_case_063", "p03762_case_064", "p03762_case_065", "p03762_case_066", "p03762_case_067", "p03762_case_068", "p03762_case_069", "p03762_case_070", "p03762_case_071", "p03762_case_072", "p03762_case_073", "p03762_case_074", "p03762_case_075", "p03762_case_076", "p03762_case_077", "p03762_case_078", "p03762_case_079", "p03762_case_080", "p03762_case_081", "p03762_case_082", "p03762_case_083", "p03762_case_084", "p03762_case_085", "p03762_case_086", "p03762_case_087", "p03762_case_088", "p03762_case_089", "p03762_case_090", "p03762_case_091", "p03762_case_092", "p03762_case_093", "p03762_case_094", "p03762_case_095", "p03762_case_096", "p03762_case_097", "p03762_case_098", "p03762_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "MOD = 10**9 + 7\nn, m = list(map(int, input().split()))\nx = list(map(int, input().split()))\ny = list(map(int, input().split()))\n\nfor i in range(n - 1):\n x[i] = x[i + 1] - x[i]\nfor i in range(m - 1):\n y[i] = y[i + 1] - y[i]\nN = [n - 1]\nfor i in range(n - 3, 0, -2):\n N.append(N[-1] + i)\n\nM = [m - 1]\nfor i in range(m - 3, 0, -2):\n M.append(M[-1] + i)\n\nif N[0] % 2 == 0:\n N += N[::-1]\nelif N[0] != 1:\n N += N[-2::-1]\nif M[0] % 2 == 0:\n M += M[::-1]\nelif M[0] != 1:\n M += M[-2::-1]\n\n\nif len(x) - 1 > len(N):\n while True:\n pass\nif len(y) - 1 > len(M):\n while True:\n pass\nX_sum = 0\nfor i in range(n - 1):\n X_sum += x[i] * N[i]\n X_sum %= MOD\nY_sum = 0\nfor i in range(m - 1):\n Y_sum += y[i] * M[i]\n Y_sum %= MOD\nprint(((X_sum * Y_sum) % MOD))\n", "fast_code_sha256": "11a6f70bcd146baeffd880a2c686c3f4ab034b7c05f1cefaf0d09531c8a16f4a", "fast_id": "p03762_350b256adfffe27e9bf3710fa7ba307f5bce2aefd03843c333650875679a2c38", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "MOD = 10**9 + 7\nn, m = list(map(int, input().split()))\nx = list(map(int, input().split()))\ny = list(map(int, input().split()))\n# 前計算\nfor i in range(n - 1):\n x[i] = x[i + 1] - x[i]\nfor i in range(m - 1):\n y[i] = y[i + 1] - y[i]\nN = [n - 1]\nfor i in range(n - 3, 0, -2):\n N.append(N[-1] + i)\n # N.append((N[i] + (n - 1 - 2 * (i + 1))) % MOD)\nM = [m - 1]\nfor i in range(m - 3, 0, -2):\n M.append(M[-1] + i)\n # M.append((M[i] + (m - 1- 2 * (i + 1))) % MOD)\nif N[0] % 2 == 0:\n N += N[::-1]\nelif N[0] != 1:\n N += N[-2::-1]\nif M[0] % 2 == 0:\n M += M[::-1]\nelif M[0] != 1:\n M += M[-2::-1]\n# print (x)\n# print (y)\n# print (N)\n# print (M)\nif len(x) - 1 > len(N):\n while True:\n pass\nif len(y) - 1 > len(M):\n while True:\n pass\nX_sum = 0\nfor i in range(n - 1):\n X_sum += x[i] * N[i]\n X_sum %= MOD\nY_sum = 0\nfor i in range(m - 1):\n Y_sum += y[i] * M[i]\n Y_sum %= MOD\nprint(((X_sum * Y_sum) % MOD))\n", "measured_fast_code_sha256": "350b256adfffe27e9bf3710fa7ba307f5bce2aefd03843c333650875679a2c38", "measured_slow_code": "import sys\nimport numpy as np\n\nMOD = 10**9 + 7\nI = np.array(sys.stdin.read().split(), dtype=np.int64)\nn, m = I[:2]\nx = I[2 : 2 + n]\ny = I[2 + n :]\n\n\ndef main():\n sx = np.cumsum(x) % MOD\n sy = np.cumsum(y) % MOD\n sdx = (\n np.sum((sx[n - 1] - sx[: n - 1]) - x[: n - 1] * ((n - 1) - np.arange(n - 1)))\n % MOD\n )\n sdy = (\n np.sum((sy[m - 1] - sy[: m - 1]) - y[: m - 1] * ((m - 1) - np.arange(m - 1)))\n % MOD\n )\n ans = sdx * sdy % MOD\n return ans\n\n\nif __name__ == \"__main__\":\n ans = main()\n print(ans)\n", "measured_slow_code_sha256": "982e2a132ff9a9ee086902a77e4d38984ae35b417d1949db3c426a0eec331800", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 0.8495792027841125, "pair_id": "python_v2_53291d37021811938889fd4b", "per_case_slow_code_faster_fraction": 0.68, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03762", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03762_350b256adfffe27e9bf3710fa7ba307f5bce2aefd03843c333650875679a2c38.jsonl.gz", "inputs": "reproduction/python/inputs/p03762.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03762_982e2a132ff9a9ee086902a77e4d38984ae35b417d1949db3c426a0eec331800.jsonl.gz"}, "slow_code": "import sys\nimport numpy as np\n\nMOD = 10**9 + 7\nI = np.array(sys.stdin.read().split(), dtype=np.int64)\nn, m = I[:2]\nx = I[2 : 2 + n]\ny = I[2 + n :]\n\n\ndef main():\n sx = np.cumsum(x) % MOD\n sy = np.cumsum(y) % MOD\n sdx = (\n np.sum((sx[n - 1] - sx[: n - 1]) - x[: n - 1] * ((n - 1) - np.arange(n - 1)))\n % MOD\n )\n sdy = (\n np.sum((sy[m - 1] - sy[: m - 1]) - y[: m - 1] * ((m - 1) - np.arange(m - 1)))\n % MOD\n )\n ans = sdx * sdy % MOD\n return ans\n\n\nif __name__ == \"__main__\":\n ans = main()\n print(ans)\n", "slow_code_sha256": "982e2a132ff9a9ee086902a77e4d38984ae35b417d1949db3c426a0eec331800", "slow_id": "p03762_982e2a132ff9a9ee086902a77e4d38984ae35b417d1949db3c426a0eec331800", "speedup": 4.631295069336506, "stratum": "4-8", "within_pair_jaccard": 0.22807017543859648, "workload": {"case_count": 100, "description": "Vertical lines x=x_i and horizontal lines y=y_i have strictly increasing coordinate lists. Sum areas of all rectangles formed by choosing two lines of each orientation, modulo 1000000007. Observed inputs: n=2..100000 (median 50000); m=2..100000 (median 50000); x_i=-1000000000..1000000000; y_i=-1000000000..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 2200016, "median": 1038968.5, "min": 44}, "input_format": ["n m\nx_1 ... x_n\ny_1 ... y_m"], "input_format_status": "source_input_section", "input_lines": {"max": 3, "median": 3.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200002, "median": 100003.0, "min": 6}}} -{"case_ids": ["p02959_case_000", "p02959_case_001", "p02959_case_002", "p02959_case_003", "p02959_case_004", "p02959_case_005", "p02959_case_006", "p02959_case_007", "p02959_case_008", "p02959_case_009", "p02959_case_010", "p02959_case_011", "p02959_case_012", "p02959_case_013", "p02959_case_014", "p02959_case_015", "p02959_case_016", "p02959_case_017", "p02959_case_018", "p02959_case_019", "p02959_case_020", "p02959_case_021", "p02959_case_022", "p02959_case_023", "p02959_case_024", "p02959_case_025", "p02959_case_026", "p02959_case_027", "p02959_case_028", "p02959_case_029", "p02959_case_030", "p02959_case_031", "p02959_case_032", "p02959_case_033", "p02959_case_034", "p02959_case_035", "p02959_case_036", "p02959_case_037", "p02959_case_038", "p02959_case_039", "p02959_case_040", "p02959_case_041", "p02959_case_042", "p02959_case_043", "p02959_case_044", "p02959_case_045", "p02959_case_046", "p02959_case_047", "p02959_case_048", "p02959_case_049", "p02959_case_050", "p02959_case_051", "p02959_case_052", "p02959_case_053", "p02959_case_054", "p02959_case_055", "p02959_case_056", "p02959_case_057", "p02959_case_058", "p02959_case_059", "p02959_case_060", "p02959_case_061", "p02959_case_062", "p02959_case_063", "p02959_case_064", "p02959_case_065", "p02959_case_066", "p02959_case_067", "p02959_case_068", "p02959_case_069", "p02959_case_070", "p02959_case_071", "p02959_case_072", "p02959_case_073", "p02959_case_074", "p02959_case_075", "p02959_case_076", "p02959_case_077", "p02959_case_078", "p02959_case_079", "p02959_case_080", "p02959_case_081", "p02959_case_082", "p02959_case_083", "p02959_case_084", "p02959_case_085", "p02959_case_086", "p02959_case_087", "p02959_case_088", "p02959_case_089", "p02959_case_090", "p02959_case_091", "p02959_case_092", "p02959_case_093", "p02959_case_094", "p02959_case_095", "p02959_case_096", "p02959_case_097", "p02959_case_098", "p02959_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N = int(eval(input()))\nA = list(map(int, input().split()))\nB = list(map(int, input().split()))\nans = 0\nfor i in range(N):\n if i % 2 == 0:\n if A[i // 2] >= B[i // 2]:\n A[i // 2] -= B[i // 2]\n ans += B[i // 2]\n B[i // 2] = 0\n else:\n B[i // 2] -= A[i // 2]\n ans += A[i // 2]\n A[i // 2] = 0\n if A[i // 2 + 1] >= B[i // 2]:\n A[i // 2 + 1] -= B[i // 2]\n ans += B[i // 2]\n B[i // 2] = 0\n else:\n B[i // 2] -= A[i // 2 + 1]\n ans += A[i // 2 + 1]\n A[i // 2 + 1] = 0\n else:\n if A[N - i // 2] >= B[N - i // 2 - 1]:\n A[N - i // 2] -= B[N - i // 2 - 1]\n ans += B[N - i // 2 - 1]\n B[N - i // 2 - 1] = 0\n else:\n B[N - i // 2 - 1] -= A[N - i // 2]\n ans += A[N - i // 2]\n A[N - i // 2] = 0\n if A[N - i // 2 - 1] >= B[N - i // 2 - 1]:\n A[N - i // 2 - 1] -= B[N - i // 2 - 1]\n ans += B[N - i // 2 - 1]\n B[N - i // 2 - 1] = 0\n else:\n B[N - i // 2 - 1] -= A[N - i // 2 - 1]\n ans += A[N - i // 2 - 1]\n A[N - i // 2 - 1] = 0\nprint(ans)\n", "fast_code_sha256": "f0395674e51675bd438b96a7f18fa9739566f756efa1ea79ea087d0b83a10e1f", "fast_id": "p02959_f0395674e51675bd438b96a7f18fa9739566f756efa1ea79ea087d0b83a10e1f", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N = int(eval(input()))\nA = list(map(int, input().split()))\nB = list(map(int, input().split()))\nans = 0\nfor i in range(N):\n if i % 2 == 0:\n if A[i // 2] >= B[i // 2]:\n A[i // 2] -= B[i // 2]\n ans += B[i // 2]\n B[i // 2] = 0\n else:\n B[i // 2] -= A[i // 2]\n ans += A[i // 2]\n A[i // 2] = 0\n if A[i // 2 + 1] >= B[i // 2]:\n A[i // 2 + 1] -= B[i // 2]\n ans += B[i // 2]\n B[i // 2] = 0\n else:\n B[i // 2] -= A[i // 2 + 1]\n ans += A[i // 2 + 1]\n A[i // 2 + 1] = 0\n else:\n if A[N - i // 2] >= B[N - i // 2 - 1]:\n A[N - i // 2] -= B[N - i // 2 - 1]\n ans += B[N - i // 2 - 1]\n B[N - i // 2 - 1] = 0\n else:\n B[N - i // 2 - 1] -= A[N - i // 2]\n ans += A[N - i // 2]\n A[N - i // 2] = 0\n if A[N - i // 2 - 1] >= B[N - i // 2 - 1]:\n A[N - i // 2 - 1] -= B[N - i // 2 - 1]\n ans += B[N - i // 2 - 1]\n B[N - i // 2 - 1] = 0\n else:\n B[N - i // 2 - 1] -= A[N - i // 2 - 1]\n ans += A[N - i // 2 - 1]\n A[N - i // 2 - 1] = 0\nprint(ans)\n", "measured_fast_code_sha256": "f0395674e51675bd438b96a7f18fa9739566f756efa1ea79ea087d0b83a10e1f", "measured_slow_code": "# -*-coding:utf-8-*-\nimport sys\n\ninput = sys.stdin.readline\nimport numpy as np\n\n\ndef main():\n n = int(eval(input()))\n mob = np.array(list(map(int, input().split())), dtype=int)\n bra = np.array(list(map(int, input().split())), dtype=int)\n ans = 0\n for i in range(n):\n tmp1 = min(mob[i], bra[i])\n ans += tmp1\n tmp2 = min(mob[i + 1], bra[i] - tmp1)\n ans += tmp2\n mob[i + 1] -= tmp2\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "bbec5135de8ae25a58f3728f93973966763aa68a02b38478ffe3b521ca53b35a", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 14.084964000080841, "pair_id": "python_v2_703c31beaa8e25096b51c8a3", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02959", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02959_f0395674e51675bd438b96a7f18fa9739566f756efa1ea79ea087d0b83a10e1f.jsonl.gz", "inputs": "reproduction/python/inputs/p02959.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02959_bbec5135de8ae25a58f3728f93973966763aa68a02b38478ffe3b521ca53b35a.jsonl.gz"}, "slow_code": "import sys\n\ninput = sys.stdin.readline\nimport numpy as np\n\n\ndef main():\n n = int(eval(input()))\n mob = np.array(list(map(int, input().split())), dtype=int)\n bra = np.array(list(map(int, input().split())), dtype=int)\n ans = 0\n for i in range(n):\n tmp1 = min(mob[i], bra[i])\n ans += tmp1\n tmp2 = min(mob[i + 1], bra[i] - tmp1)\n ans += tmp2\n mob[i + 1] -= tmp2\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "965de35434130d5fc575218190a738f566bab157fb864eeaa9ad161ab765410e", "slow_id": "p02959_bbec5135de8ae25a58f3728f93973966763aa68a02b38478ffe3b521ca53b35a", "speedup": 13.2003395806158, "stratum": "8+", "within_pair_jaccard": 0.358974358974359, "workload": {"case_count": 100, "description": "N+1 towns hold A_i monsters. Hero i may defeat at most B_i monsters in total, split between towns i and i+1. Maximize the number defeated by all N cooperating heroes. Observed inputs: N=1..100000 (median 5500); A_i=1..1000000000; B_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 2200018, "median": 70232.0, "min": 8}, "input_format": ["N\nA_1 ... A_(N+1)\nB_1 ... B_N"], "input_format_status": "source_input_section", "input_lines": {"max": 3, "median": 3.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200002, "median": 11002.0, "min": 4}}} -{"case_ids": ["p04014_case_000", "p04014_case_001", "p04014_case_002", "p04014_case_003", "p04014_case_004", "p04014_case_005", "p04014_case_006", "p04014_case_007", "p04014_case_008", "p04014_case_009", "p04014_case_010", "p04014_case_011", "p04014_case_012", "p04014_case_013", "p04014_case_014", "p04014_case_015", "p04014_case_016", "p04014_case_017", "p04014_case_018", "p04014_case_019", "p04014_case_020", "p04014_case_021", "p04014_case_022", "p04014_case_023", "p04014_case_024", "p04014_case_025", "p04014_case_026", "p04014_case_027", "p04014_case_028", "p04014_case_029", "p04014_case_030", "p04014_case_031", "p04014_case_032", "p04014_case_033", "p04014_case_034", "p04014_case_035", "p04014_case_036", "p04014_case_037", "p04014_case_038", "p04014_case_039", "p04014_case_040", "p04014_case_041", "p04014_case_042", "p04014_case_043", "p04014_case_044", "p04014_case_045", "p04014_case_046", "p04014_case_047", "p04014_case_048", "p04014_case_049", "p04014_case_050", "p04014_case_051", "p04014_case_052", "p04014_case_053", "p04014_case_054", "p04014_case_055", "p04014_case_056", "p04014_case_057", "p04014_case_058", "p04014_case_059", "p04014_case_060", "p04014_case_061", "p04014_case_062", "p04014_case_063", "p04014_case_064", "p04014_case_065", "p04014_case_066", "p04014_case_067", "p04014_case_068", "p04014_case_069", "p04014_case_070", "p04014_case_071", "p04014_case_072", "p04014_case_073", "p04014_case_074", "p04014_case_075", "p04014_case_076", "p04014_case_077", "p04014_case_078", "p04014_case_079", "p04014_case_080", "p04014_case_081", "p04014_case_082", "p04014_case_083", "p04014_case_084", "p04014_case_085", "p04014_case_086", "p04014_case_087", "p04014_case_088", "p04014_case_089", "p04014_case_090", "p04014_case_091", "p04014_case_092", "p04014_case_093", "p04014_case_094", "p04014_case_095", "p04014_case_096", "p04014_case_097", "p04014_case_098", "p04014_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def primeFactor(N):\n i = 2\n ret = {}\n n = N\n mrFlg = 0\n while i**2 <= n:\n k = 0\n while n % i == 0:\n n //= i\n k += 1\n ret[i] = k\n i += 1\n if i == 101 and n >= (2**20):\n\n def findFactorRho(N):\n def gcd(a, b):\n while b:\n a, b = b, a % b\n return abs(a)\n\n def f(x, c):\n return ((x**2) + c) % N\n\n semi = [N]\n for c in range(1, 99):\n x, y, d = 2, 2, 1\n while d == 1:\n x = f(x, c)\n y = f(f(y, c), c)\n d = gcd(abs(x - y), N)\n if d != N:\n if isPrimeMR(d):\n return d\n elif isPrimeMR(N // d):\n return N // d\n else:\n semi.append(d)\n\n while True:\n if isPrimeMR(n):\n ret[n], n = 1, 1\n break\n else:\n mrFlg = 1\n j = findFactorRho(n)\n k = 0\n while n % j == 0:\n n //= j\n k += 1\n ret[j] = k\n if n == 1:\n break\n if n > 1:\n ret[n] = 1\n if mrFlg > 0:\n\n def dict_sort(X):\n Y = {}\n for x in sorted(X.keys()):\n Y[x] = X[x]\n return Y\n\n ret = dict_sort(ret)\n return ret\n\n\ndef isPrimeMR(n):\n if n == 2:\n return True\n if n == 1 or n & 1 == 0:\n return False\n d = (n - 1) >> 1\n while d & 1 == 0:\n d >>= 1\n for a in [2, 3, 5, 7, 11, 13, 17, 19, 23]:\n t = d\n y = pow(a, t, n)\n while t != n - 1 and y != 1 and y != n - 1:\n y = (y * y) % n\n t <<= 1\n if y != n - 1 and t & 1 == 0:\n return False\n return True\n\n\ndef divisors(N):\n pf = primeFactor(N)\n ret = [1]\n for p in pf:\n ret_prev = ret\n ret = []\n for i in range(pf[p] + 1):\n for r in ret_prev:\n ret.append(r * (p**i))\n return sorted(ret)\n\n\ndef f(b, n):\n re = 0\n while n:\n re += n % b\n n //= b\n return re\n\n\nN = int(eval(input()))\nS = int(eval(input()))\nif N < S:\n print((-1))\nelif N == S:\n print((N + 1))\nelse:\n for b in divisors(N - S):\n b += 1\n if f(b, N) == S:\n print(b)\n break\n else:\n print((-1))\n", "fast_code_sha256": "93b64a608c9c235279e7e8cc26d6514c31baa97a5b938987666ead006620ab9f", "fast_id": "p04014_e319f8790b7bb1feb9470e8cf607d5e00cb6ae43af2b120fc923c489db2ef8ef", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def primeFactor(N):\n i = 2\n ret = {}\n n = N\n mrFlg = 0\n while i**2 <= n:\n k = 0\n while n % i == 0:\n n //= i\n k += 1\n ret[i] = k\n i += 1\n if i == 101 and n >= (2**20):\n\n def findFactorRho(N): # Primeでないことを確認したものを引数とする。\n def gcd(a, b):\n while b:\n a, b = b, a % b\n return abs(a)\n\n def f(x, c):\n return ((x**2) + c) % N\n\n semi = [N]\n for c in range(1, 99):\n x, y, d = 2, 2, 1\n while d == 1:\n x = f(x, c)\n y = f(f(y, c), c)\n d = gcd(abs(x - y), N)\n if d != N:\n if isPrimeMR(d):\n return d\n elif isPrimeMR(N // d):\n return N // d\n else:\n semi.append(d)\n\n while True:\n if isPrimeMR(n):\n ret[n], n = 1, 1\n break\n else:\n mrFlg = 1\n j = findFactorRho(n)\n k = 0\n while n % j == 0:\n n //= j\n k += 1\n ret[j] = k\n if n == 1:\n break\n if n > 1:\n ret[n] = 1\n if mrFlg > 0:\n\n def dict_sort(X):\n Y = {}\n for x in sorted(X.keys()):\n Y[x] = X[x]\n return Y\n\n ret = dict_sort(ret)\n return ret\n\n\ndef isPrimeMR(n):\n if n == 2:\n return True\n if n == 1 or n & 1 == 0:\n return False\n d = (n - 1) >> 1\n while d & 1 == 0:\n d >>= 1\n for a in [2, 3, 5, 7, 11, 13, 17, 19, 23]:\n t = d\n y = pow(a, t, n)\n while t != n - 1 and y != 1 and y != n - 1:\n y = (y * y) % n\n t <<= 1\n if y != n - 1 and t & 1 == 0:\n return False\n return True\n\n\ndef divisors(N):\n pf = primeFactor(N)\n ret = [1]\n for p in pf:\n ret_prev = ret\n ret = []\n for i in range(pf[p] + 1):\n for r in ret_prev:\n ret.append(r * (p**i))\n return sorted(ret)\n\n\ndef f(b, n):\n re = 0\n while n:\n re += n % b\n n //= b\n return re\n\n\nN = int(eval(input()))\nS = int(eval(input()))\nif N < S:\n print((-1))\nelif N == S:\n print((N + 1))\nelse:\n for b in divisors(N - S):\n b += 1\n if f(b, N) == S:\n print(b)\n break\n else:\n print((-1))\n", "measured_fast_code_sha256": "e319f8790b7bb1feb9470e8cf607d5e00cb6ae43af2b120fc923c489db2ef8ef", "measured_slow_code": "from math import floor, sqrt\n\nINF = 10**20\n\n\ndef f(b, n):\n if n < b:\n return n\n else:\n return f(b, n // b) + (n % b)\n\n\ndef main():\n n = int(eval(input()))\n s = int(eval(input()))\n ans = INF\n # 1桁\n if n == s:\n ans = min(ans, n + 1)\n # 2桁\n for p in range(1, int(sqrt(n)) + 1):\n q = s - p\n b = (n - q) // p\n if 2 <= b and f(b, n) == s:\n ans = min(ans, b)\n # 3桁以上\n for b in range(2, int(sqrt(n)) + 1):\n if f(b, n) == s:\n ans = min(ans, b)\n print((-1 if ans == INF else ans))\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "c95ad2a8dc940041977600eb1078f63d16cb258708724f5b3b59e88e5ff612b9", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 0.9867658683971348, "pair_id": "python_v2_31b632de1e59e860ddb6609a", "per_case_slow_code_faster_fraction": 0.51, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p04014", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p04014_e319f8790b7bb1feb9470e8cf607d5e00cb6ae43af2b120fc923c489db2ef8ef.jsonl.gz", "inputs": "reproduction/python/inputs/p04014.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p04014_c95ad2a8dc940041977600eb1078f63d16cb258708724f5b3b59e88e5ff612b9.jsonl.gz"}, "slow_code": "from math import floor, sqrt\n\nINF = 10**20\n\n\ndef f(b, n):\n if n < b:\n return n\n else:\n return f(b, n // b) + (n % b)\n\n\ndef main():\n n = int(eval(input()))\n s = int(eval(input()))\n ans = INF\n\n if n == s:\n ans = min(ans, n + 1)\n\n for p in range(1, int(sqrt(n)) + 1):\n q = s - p\n b = (n - q) // p\n if 2 <= b and f(b, n) == s:\n ans = min(ans, b)\n\n for b in range(2, int(sqrt(n)) + 1):\n if f(b, n) == s:\n ans = min(ans, b)\n print((-1 if ans == INF else ans))\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "29cce6a043e57af2f8084b7594ae7495531a30dede09cf51b56088a83bb9cffb", "slow_id": "p04014_c95ad2a8dc940041977600eb1078f63d16cb258708724f5b3b59e88e5ff612b9", "speedup": 3.519202941046083, "stratum": "2-4", "within_pair_jaccard": 0.2345679012345679, "workload": {"case_count": 100, "description": "Find the smallest integer base b>=2 in which positive integer n has digit sum s, or report -1 if no such base exists. Observed inputs: n=1..99999999999; s=1..99999999999.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 24, "median": 14.0, "min": 4}, "input_format": ["n\ns"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p03173_case_000", "p03173_case_001", "p03173_case_002", "p03173_case_003", "p03173_case_004", "p03173_case_005", "p03173_case_006", "p03173_case_007", "p03173_case_008", "p03173_case_009", "p03173_case_010", "p03173_case_011", "p03173_case_012", "p03173_case_013", "p03173_case_014", "p03173_case_015", "p03173_case_016", "p03173_case_017", "p03173_case_018", "p03173_case_019", "p03173_case_020", "p03173_case_021", "p03173_case_022", "p03173_case_023", "p03173_case_024", "p03173_case_025", "p03173_case_026", "p03173_case_027", "p03173_case_028", "p03173_case_029", "p03173_case_030", "p03173_case_031", "p03173_case_032", "p03173_case_033", "p03173_case_034", "p03173_case_035", "p03173_case_036", "p03173_case_037", "p03173_case_038", "p03173_case_039", "p03173_case_040", "p03173_case_041", "p03173_case_042", "p03173_case_043", "p03173_case_044", "p03173_case_045", "p03173_case_046", "p03173_case_047", "p03173_case_048", "p03173_case_049", "p03173_case_050", "p03173_case_051", "p03173_case_052", "p03173_case_053", "p03173_case_054", "p03173_case_055", "p03173_case_056", "p03173_case_057", "p03173_case_058", "p03173_case_059", "p03173_case_060", "p03173_case_061", "p03173_case_062", "p03173_case_063", "p03173_case_064", "p03173_case_065", "p03173_case_066", "p03173_case_067", "p03173_case_068", "p03173_case_069", "p03173_case_070", "p03173_case_071", "p03173_case_072", "p03173_case_073", "p03173_case_074", "p03173_case_075", "p03173_case_076", "p03173_case_077", "p03173_case_078", "p03173_case_079", "p03173_case_080", "p03173_case_081", "p03173_case_082", "p03173_case_083", "p03173_case_084", "p03173_case_085", "p03173_case_086", "p03173_case_087", "p03173_case_088", "p03173_case_089", "p03173_case_090", "p03173_case_091", "p03173_case_092", "p03173_case_093", "p03173_case_094", "p03173_case_095", "p03173_case_096", "p03173_case_097", "p03173_case_098", "p03173_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "executable_AST_equal_except_explicit_explanatory_string_removal_and_all_frozen_inputs_checker_pass", "fast_code": "def resolve():\n N = int(eval(input()))\n a = list(map(int, input().split()))\n DP = [[2**63 - 1 for _ in range(N + 1)] for _ in range(N)]\n SUM = [[0 for _ in range(N + 1)] for _ in range(N + 1)]\n RANGE = [[0 for _ in range(N + 1)] for _ in range(N + 1)]\n SUM[0][0] = 0\n for i in range(N):\n for j in range(i, N):\n SUM[i][j + 1] = SUM[i][j] + a[j]\n if i < j:\n SUM[i + 1][j] = SUM[i][j] - a[i]\n for i in range(N):\n j = i + 1\n DP[i][j] = 0\n RANGE[i][j] = i\n for w in range(2, N + 1):\n for i in range(N + 1 - w):\n j = i + w\n for k in range(RANGE[i][j - 1], RANGE[i + 1][j] + 1):\n s = DP[i][k] + DP[k][j] + SUM[i][j]\n if DP[i][j] > s:\n DP[i][j] = s\n RANGE[i][j] = k\n print((DP[0][N]))\n\n\nresolve()\n", "fast_code_sha256": "48ff09bc20e8f8798770efd549a5ac6494d01b7553d3e063e63a4ebd4e5dd723", "fast_id": "p03173_48ff09bc20e8f8798770efd549a5ac6494d01b7553d3e063e63a4ebd4e5dd723", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def resolve():\n N = int(eval(input()))\n a = list(map(int, input().split()))\n DP = [[2**63 - 1 for _ in range(N + 1)] for _ in range(N)]\n SUM = [[0 for _ in range(N + 1)] for _ in range(N + 1)]\n RANGE = [[0 for _ in range(N + 1)] for _ in range(N + 1)]\n SUM[0][0] = 0\n for i in range(N):\n for j in range(i, N):\n SUM[i][j + 1] = SUM[i][j] + a[j]\n if i < j:\n SUM[i + 1][j] = SUM[i][j] - a[i]\n for i in range(N):\n j = i + 1\n DP[i][j] = 0\n RANGE[i][j] = i\n for w in range(2, N + 1):\n for i in range(N + 1 - w):\n j = i + w\n for k in range(RANGE[i][j - 1], RANGE[i + 1][j] + 1):\n s = DP[i][k] + DP[k][j] + SUM[i][j]\n if DP[i][j] > s:\n DP[i][j] = s\n RANGE[i][j] = k\n print((DP[0][N]))\n\n\nresolve()\n", "measured_fast_code_sha256": "48ff09bc20e8f8798770efd549a5ac6494d01b7553d3e063e63a4ebd4e5dd723", "measured_slow_code": "import sys\n\ninput = sys.stdin.readline\nsys.setrecursionlimit(10**7)\nimport numpy as np\n\n\"\"\"\n最後の2つを決める:[0,x) [x,N)\n小問題2つに分割できる。\n全ての連続区間を計算すればよい\n\"\"\"\nN = int(eval(input()))\nA = np.array(input().split(), np.int64)\n# Acum[L,R] = A[L:R].sum()\nAcum = np.zeros((N, N + 1), dtype=np.int64)\nfor L in range(N):\n Acum[L, L + 1 :] = A[L:].cumsum()\ndp = np.zeros((N, N + 1), dtype=np.int64)\nfor size in range(2, N + 1):\n for L in range(N - size + 1):\n R = L + size\n dp[L, R] = (dp[L, L + 1 : R] + dp[L + 1 : R, R]).min() + Acum[L, R]\nanswer = dp[0, N]\nprint(answer)\n", "measured_slow_code_sha256": "c255c26162db7be87fcb99a8e38eebab71be1bb028e9bf3b89e968fa40bae364", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 8.624899465171213, "pair_id": "python_v2_f4d47269efa3f8601fe67346", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03173", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03173_48ff09bc20e8f8798770efd549a5ac6494d01b7553d3e063e63a4ebd4e5dd723.jsonl.gz", "inputs": "reproduction/python/inputs/p03173.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03173_c255c26162db7be87fcb99a8e38eebab71be1bb028e9bf3b89e968fa40bae364.jsonl.gz"}, "slow_code": "import sys\n\ninput = sys.stdin.readline\nsys.setrecursionlimit(10**7)\nimport numpy as np\n\nN = int(eval(input()))\nA = np.array(input().split(), np.int64)\n\nAcum = np.zeros((N, N + 1), dtype=np.int64)\nfor L in range(N):\n Acum[L, L + 1 :] = A[L:].cumsum()\ndp = np.zeros((N, N + 1), dtype=np.int64)\nfor size in range(2, N + 1):\n for L in range(N - size + 1):\n R = L + size\n dp[L, R] = (dp[L, L + 1 : R] + dp[L + 1 : R, R]).min() + Acum[L, R]\nanswer = dp[0, N]\nprint(answer)\n", "slow_code_sha256": "b0014f456b10184da17fe5e7ffee658b30463d99f0f01edb81ca15194ffc08ae", "slow_id": "p03173_c255c26162db7be87fcb99a8e38eebab71be1bb028e9bf3b89e968fa40bae364", "speedup": 20.500120309068045, "stratum": "8+", "within_pair_jaccard": 0.21818181818181817, "workload": {"case_count": 100, "description": "Repeatedly merge two adjacent slimes of sizes x and y into one of size x+y, paying x+y. Preserve the relative order of remaining slimes and minimize total cost to merge all N. Observed inputs: N=2..400 (median 100); a_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 4404, "median": 404.0, "min": 6}, "input_format": ["N\na_1 ... a_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 401, "median": 101.0, "min": 3}}} -{"case_ids": ["p03455_case_000", "p03455_case_001", "p03455_case_002", "p03455_case_003", "p03455_case_004", "p03455_case_005", "p03455_case_006", "p03455_case_007", "p03455_case_008", "p03455_case_009", "p03455_case_010", "p03455_case_011", "p03455_case_012", "p03455_case_013", "p03455_case_014", "p03455_case_015", "p03455_case_016", "p03455_case_017", "p03455_case_018", "p03455_case_019", "p03455_case_020", "p03455_case_021", "p03455_case_022", "p03455_case_023", "p03455_case_024", "p03455_case_025", "p03455_case_026", "p03455_case_027", "p03455_case_028", "p03455_case_029", "p03455_case_030", "p03455_case_031", "p03455_case_032", "p03455_case_033", "p03455_case_034", "p03455_case_035", "p03455_case_036", "p03455_case_037", "p03455_case_038", "p03455_case_039", "p03455_case_040", "p03455_case_041", "p03455_case_042", "p03455_case_043", "p03455_case_044", "p03455_case_045", "p03455_case_046", "p03455_case_047", "p03455_case_048", "p03455_case_049", "p03455_case_050", "p03455_case_051", "p03455_case_052", "p03455_case_053", "p03455_case_054", "p03455_case_055", "p03455_case_056", "p03455_case_057", "p03455_case_058", "p03455_case_059", "p03455_case_060", "p03455_case_061", "p03455_case_062", "p03455_case_063", "p03455_case_064", "p03455_case_065", "p03455_case_066", "p03455_case_067", "p03455_case_068", "p03455_case_069", "p03455_case_070", "p03455_case_071", "p03455_case_072", "p03455_case_073", "p03455_case_074", "p03455_case_075", "p03455_case_076", "p03455_case_077", "p03455_case_078", "p03455_case_079", "p03455_case_080", "p03455_case_081", "p03455_case_082", "p03455_case_083", "p03455_case_084", "p03455_case_085", "p03455_case_086", "p03455_case_087", "p03455_case_088", "p03455_case_089", "p03455_case_090", "p03455_case_091", "p03455_case_092", "p03455_case_093", "p03455_case_094", "p03455_case_095", "p03455_case_096", "p03455_case_097", "p03455_case_098", "p03455_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "a, b = map(int, input().split())\nprint(\"Even\") if a * b % 2 == 0 else print(\"Odd\")\n", "fast_code_sha256": "5351cd983ed99e51c701293a9a6ee5a995fff1e1e2d615fa1a70bea7c1aac6ca", "fast_id": "p03455_5351cd983ed99e51c701293a9a6ee5a995fff1e1e2d615fa1a70bea7c1aac6ca", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "a, b = map(int, input().split())\nprint(\"Even\") if a * b % 2 == 0 else print(\"Odd\")\n", "measured_fast_code_sha256": "5351cd983ed99e51c701293a9a6ee5a995fff1e1e2d615fa1a70bea7c1aac6ca", "measured_slow_code": "def ketanowa(p):\n ans = 0\n p = str(p)\n for i in p:\n ans += int(i)\n return ans\n\n\ndef main():\n temp = input().split(\" \")\n n = int(temp[0])\n a = int(temp[1])\n if n * a % 2 == 0:\n print(\"Even\")\n else:\n print(\"Odd\")\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "1e58957cce6049d366f3189df1c6244aa3226734d9f71da11d6221cbf487aae2", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.653137923303651, "pair_id": "python_v2_80151b584c3de2cdae5fdcad", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03455", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03455_5351cd983ed99e51c701293a9a6ee5a995fff1e1e2d615fa1a70bea7c1aac6ca.jsonl.gz", "inputs": "reproduction/python/inputs/p03455.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03455_1e58957cce6049d366f3189df1c6244aa3226734d9f71da11d6221cbf487aae2.jsonl.gz"}, "slow_code": "def ketanowa(p):\n ans = 0\n p = str(p)\n for i in p:\n ans += int(i)\n return ans\n\n\ndef main():\n temp = input().split(\" \")\n n = int(temp[0])\n a = int(temp[1])\n if n * a % 2 == 0:\n print(\"Even\")\n else:\n print(\"Odd\")\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "1e58957cce6049d366f3189df1c6244aa3226734d9f71da11d6221cbf487aae2", "slow_id": "p03455_1e58957cce6049d366f3189df1c6244aa3226734d9f71da11d6221cbf487aae2", "speedup": 2.6512406554462924, "stratum": "2-4", "within_pair_jaccard": 0.39285714285714285, "workload": {"case_count": 100, "description": "Determine whether the product of two supplied positive integers a and b is odd or even. Observed inputs: a=1..10000 (median 7119); b=1..10000 (median 5506.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 12, "median": 10.0, "min": 4}, "input_format": ["a b"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p03329_case_000", "p03329_case_001", "p03329_case_002", "p03329_case_003", "p03329_case_004", "p03329_case_005", "p03329_case_006", "p03329_case_007", "p03329_case_008", "p03329_case_009", "p03329_case_010", "p03329_case_011", "p03329_case_012", "p03329_case_013", "p03329_case_014", "p03329_case_015", "p03329_case_016", "p03329_case_017", "p03329_case_018", "p03329_case_019", "p03329_case_020", "p03329_case_021", "p03329_case_022", "p03329_case_023", "p03329_case_024", "p03329_case_025", "p03329_case_026", "p03329_case_027", "p03329_case_028", "p03329_case_029", "p03329_case_030", "p03329_case_031", "p03329_case_032", "p03329_case_033", "p03329_case_034", "p03329_case_035", "p03329_case_036", "p03329_case_037", "p03329_case_038", "p03329_case_039", "p03329_case_040", "p03329_case_041", "p03329_case_042", "p03329_case_043", "p03329_case_044", "p03329_case_045", "p03329_case_046", "p03329_case_047", "p03329_case_048", "p03329_case_049", "p03329_case_050", "p03329_case_051", "p03329_case_052", "p03329_case_053", "p03329_case_054", "p03329_case_055", "p03329_case_056", "p03329_case_057", "p03329_case_058", "p03329_case_059", "p03329_case_060", "p03329_case_061", "p03329_case_062", "p03329_case_063", "p03329_case_064", "p03329_case_065", "p03329_case_066", "p03329_case_067", "p03329_case_068", "p03329_case_069", "p03329_case_070", "p03329_case_071", "p03329_case_072", "p03329_case_073", "p03329_case_074", "p03329_case_075", "p03329_case_076", "p03329_case_077", "p03329_case_078", "p03329_case_079", "p03329_case_080", "p03329_case_081", "p03329_case_082", "p03329_case_083", "p03329_case_084", "p03329_case_085", "p03329_case_086", "p03329_case_087", "p03329_case_088", "p03329_case_089", "p03329_case_090", "p03329_case_091", "p03329_case_092", "p03329_case_093", "p03329_case_094", "p03329_case_095", "p03329_case_096", "p03329_case_097", "p03329_case_098", "p03329_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import bisect as bi\n\nli6 = [6**i for i in range(7)]\nli9 = [9**i for i in range(6)]\n\n\ndef s69(n):\n if n < 6:\n return n\n else:\n s6 = li6[bi.bisect(li6, n) - 1]\n s9 = li9[bi.bisect(li9, n) - 1]\n return min(n // s6 + s69(n % s6), 1 + s69(n - s9))\n\n\nprint((s69(int(eval(input())))))\n", "fast_code_sha256": "35fa299e74352ed9cb15d8a289a67b234b5ab81395b2110d1943cb2ac24e7bdc", "fast_id": "p03329_35fa299e74352ed9cb15d8a289a67b234b5ab81395b2110d1943cb2ac24e7bdc", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import bisect as bi\n\nli6 = [6**i for i in range(7)]\nli9 = [9**i for i in range(6)]\n\n\ndef s69(n):\n if n < 6:\n return n\n else:\n s6 = li6[bi.bisect(li6, n) - 1]\n s9 = li9[bi.bisect(li9, n) - 1]\n return min(n // s6 + s69(n % s6), 1 + s69(n - s9))\n\n\nprint((s69(int(eval(input())))))\n", "measured_fast_code_sha256": "35fa299e74352ed9cb15d8a289a67b234b5ab81395b2110d1943cb2ac24e7bdc", "measured_slow_code": "n = int(eval(input()))\ndp = [float(\"inf\")] * 100010\ndp[0] = 0\nfor i in range(1, 100000 + 1):\n power = 1\n while power <= i:\n dp[i] = min(dp[i], dp[i - power] + 1)\n power *= 6\n power = 1\n while power <= i:\n dp[i] = min(dp[i], dp[i - power] + 1)\n power *= 9\nprint((dp[n]))\n", "measured_slow_code_sha256": "d420a4a47c3d63ccc8bf0d67f00fb6eac614ba4a541aaa7d9741e0a6de148e33", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4496.348567992258, "pair_id": "python_v2_9a9effb3a259c8f9cd35a7c4", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03329", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03329_35fa299e74352ed9cb15d8a289a67b234b5ab81395b2110d1943cb2ac24e7bdc.jsonl.gz", "inputs": "reproduction/python/inputs/p03329.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03329_d420a4a47c3d63ccc8bf0d67f00fb6eac614ba4a541aaa7d9741e0a6de148e33.jsonl.gz"}, "slow_code": "n = int(eval(input()))\ndp = [float(\"inf\")] * 100010\ndp[0] = 0\nfor i in range(1, 100000 + 1):\n power = 1\n while power <= i:\n dp[i] = min(dp[i], dp[i - power] + 1)\n power *= 6\n power = 1\n while power <= i:\n dp[i] = min(dp[i], dp[i - power] + 1)\n power *= 9\nprint((dp[n]))\n", "slow_code_sha256": "d420a4a47c3d63ccc8bf0d67f00fb6eac614ba4a541aaa7d9741e0a6de148e33", "slow_id": "p03329_d420a4a47c3d63ccc8bf0d67f00fb6eac614ba4a541aaa7d9741e0a6de148e33", "speedup": 2622.7371724806967, "stratum": "8+", "within_pair_jaccard": 0.37142857142857144, "workload": {"case_count": 100, "description": "Withdraw exactly N units with minimum operations. Each operation withdraws 1, a positive integer power of 6, or a positive integer power of 9. Withdrawn money cannot be redeposited. Observed inputs: N=1..100000 (median 5282.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 7, "median": 5.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p03552_case_000", "p03552_case_001", "p03552_case_002", "p03552_case_003", "p03552_case_004", "p03552_case_005", "p03552_case_006", "p03552_case_007", "p03552_case_008", "p03552_case_009", "p03552_case_010", "p03552_case_011", "p03552_case_012", "p03552_case_013", "p03552_case_014", "p03552_case_015", "p03552_case_016", "p03552_case_017", "p03552_case_018", "p03552_case_019", "p03552_case_020", "p03552_case_021", "p03552_case_022", "p03552_case_023", "p03552_case_024", "p03552_case_025", "p03552_case_026", "p03552_case_027", "p03552_case_028", "p03552_case_029", "p03552_case_030", "p03552_case_031", "p03552_case_032", "p03552_case_033", "p03552_case_034", "p03552_case_035", "p03552_case_036", "p03552_case_037", "p03552_case_038", "p03552_case_039", "p03552_case_040", "p03552_case_041", "p03552_case_042", "p03552_case_043", "p03552_case_044", "p03552_case_045", "p03552_case_046", "p03552_case_047", "p03552_case_048", "p03552_case_049", "p03552_case_050", "p03552_case_051", "p03552_case_052", "p03552_case_053", "p03552_case_054", "p03552_case_055", "p03552_case_056", "p03552_case_057", "p03552_case_058", "p03552_case_059", "p03552_case_060", "p03552_case_061", "p03552_case_062", "p03552_case_063", "p03552_case_064", "p03552_case_065", "p03552_case_066", "p03552_case_067", "p03552_case_068", "p03552_case_069", "p03552_case_070", "p03552_case_071", "p03552_case_072", "p03552_case_073", "p03552_case_074", "p03552_case_075", "p03552_case_076", "p03552_case_077", "p03552_case_078", "p03552_case_079", "p03552_case_080", "p03552_case_081", "p03552_case_082", "p03552_case_083", "p03552_case_084", "p03552_case_085", "p03552_case_086", "p03552_case_087", "p03552_case_088", "p03552_case_089", "p03552_case_090", "p03552_case_091", "p03552_case_092", "p03552_case_093", "p03552_case_094", "p03552_case_095", "p03552_case_096", "p03552_case_097", "p03552_case_098", "p03552_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N, Z, W = list(map(int, input().split()))\n(*A,) = list(map(int, input().split()))\nif N == 1:\n print((abs(A[0] - W)))\nelse:\n print((max(abs(A[-1] - W), abs(A[-2] - A[-1]))))\n", "fast_code_sha256": "1019ea94675af27c3bd59e5a2839688ec4fe5a3fcf6b258662583310efacb659", "fast_id": "p03552_1019ea94675af27c3bd59e5a2839688ec4fe5a3fcf6b258662583310efacb659", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N, Z, W = list(map(int, input().split()))\n(*A,) = list(map(int, input().split()))\nif N == 1:\n print((abs(A[0] - W)))\nelse:\n print((max(abs(A[-1] - W), abs(A[-2] - A[-1]))))\n", "measured_fast_code_sha256": "1019ea94675af27c3bd59e5a2839688ec4fe5a3fcf6b258662583310efacb659", "measured_slow_code": "N, Z, W = list(map(int, input().split()))\n(*A,) = list(map(int, input().split()))\nimport sys\n\nsys.setrecursionlimit(10**6)\nmemo = {}\n\n\ndef dfs(i, turn):\n if (i, turn) in memo:\n return memo[i, turn]\n if turn == 0:\n # X\n if i == 0:\n res = abs(W - A[-1])\n else:\n res = abs(A[i - 1] - A[-1])\n for j in range(i + 1, N):\n res = max(res, dfs(j, 1))\n else:\n # Y\n if i == 0:\n res = abs(Z - A[-1])\n else:\n res = abs(A[i - 1] - A[-1])\n for j in range(i + 1, N):\n res = min(res, dfs(j, 0))\n memo[i, turn] = res\n return res\n\n\nprint((dfs(0, 0)))\n", "measured_slow_code_sha256": "fca975e3d0d30bc1896e9ad592f49b6dc13f1bf8eab5f47b11e27deeb6020eb5", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1914.6512397421493, "pair_id": "python_v2_1915a1b9b64b776f8bb3825d", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03552", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03552_1019ea94675af27c3bd59e5a2839688ec4fe5a3fcf6b258662583310efacb659.jsonl.gz", "inputs": "reproduction/python/inputs/p03552.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03552_fca975e3d0d30bc1896e9ad592f49b6dc13f1bf8eab5f47b11e27deeb6020eb5.jsonl.gz"}, "slow_code": "N, Z, W = list(map(int, input().split()))\n(*A,) = list(map(int, input().split()))\nimport sys\n\nsys.setrecursionlimit(10**6)\nmemo = {}\n\n\ndef dfs(i, turn):\n if (i, turn) in memo:\n return memo[i, turn]\n if turn == 0:\n\n if i == 0:\n res = abs(W - A[-1])\n else:\n res = abs(A[i - 1] - A[-1])\n for j in range(i + 1, N):\n res = max(res, dfs(j, 1))\n else:\n\n if i == 0:\n res = abs(Z - A[-1])\n else:\n res = abs(A[i - 1] - A[-1])\n for j in range(i + 1, N):\n res = min(res, dfs(j, 0))\n memo[i, turn] = res\n return res\n\n\nprint((dfs(0, 0)))\n", "slow_code_sha256": "6b9cbbfcecc117653d684424a9e23874286eb0f6303a58ba8707b6dc55523b37", "slow_id": "p03552_fca975e3d0d30bc1896e9ad592f49b6dc13f1bf8eab5f47b11e27deeb6020eb5", "speedup": 262.883012143208, "stratum": "8+", "within_pair_jaccard": 0.47058823529411764, "workload": {"case_count": 100, "description": "Two players initially hold Z and W. Alternating from the first, each draws at least one top card of an N-card deck, discards their hand and keeps the last drawn. At deck exhaustion the score is the absolute hand-value difference; first maximizes, second minimizes. Observed inputs: N=1..2000 (median 1000); Z=1..1000000000; W=1..1000000000; a_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 20027, "median": 10018.0, "min": 15}, "input_format": ["N Z W\na_1 ... a_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2003, "median": 1003.0, "min": 4}}} -{"case_ids": ["p03112_case_000", "p03112_case_001", "p03112_case_002", "p03112_case_003", "p03112_case_004", "p03112_case_005", "p03112_case_006", "p03112_case_007", "p03112_case_008", "p03112_case_009", "p03112_case_010", "p03112_case_011", "p03112_case_012", "p03112_case_013", "p03112_case_014", "p03112_case_015", "p03112_case_016", "p03112_case_017", "p03112_case_018", "p03112_case_019", "p03112_case_020", "p03112_case_021", "p03112_case_022", "p03112_case_023", "p03112_case_024", "p03112_case_025", "p03112_case_026", "p03112_case_027", "p03112_case_028", "p03112_case_029", "p03112_case_030", "p03112_case_031", "p03112_case_032", "p03112_case_033", "p03112_case_034", "p03112_case_035", "p03112_case_036", "p03112_case_037", "p03112_case_038", "p03112_case_039", "p03112_case_040", "p03112_case_041", "p03112_case_042", "p03112_case_043", "p03112_case_044", "p03112_case_045", "p03112_case_046", "p03112_case_047", "p03112_case_048", "p03112_case_049", "p03112_case_050", "p03112_case_051", "p03112_case_052", "p03112_case_053", "p03112_case_054", "p03112_case_055", "p03112_case_056", "p03112_case_057", "p03112_case_058", "p03112_case_059", "p03112_case_060", "p03112_case_061", "p03112_case_062", "p03112_case_063", "p03112_case_064", "p03112_case_065", "p03112_case_066", "p03112_case_067", "p03112_case_068", "p03112_case_069", "p03112_case_070", "p03112_case_071", "p03112_case_072", "p03112_case_073", "p03112_case_074", "p03112_case_075", "p03112_case_076", "p03112_case_077", "p03112_case_078", "p03112_case_079", "p03112_case_080", "p03112_case_081", "p03112_case_082", "p03112_case_083", "p03112_case_084", "p03112_case_085", "p03112_case_086", "p03112_case_087", "p03112_case_088", "p03112_case_089", "p03112_case_090", "p03112_case_091", "p03112_case_092", "p03112_case_093", "p03112_case_094", "p03112_case_095", "p03112_case_096", "p03112_case_097", "p03112_case_098", "p03112_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "executable_AST_equal_except_explicit_explanatory_string_removal_and_all_frozen_inputs_checker_pass", "fast_code": "from bisect import bisect\n\n\ndef main():\n a, b, q, *stx = list(map(int, open(0).read().split()))\n s = [-1e10] + stx[:a] + [2 * 1e10]\n t = [-1e10] + stx[a : a + b] + [2 * 1e10]\n x = stx[a + b : a + b + q]\n for i in x:\n pos_s = bisect(s, i)\n pos_t = bisect(t, i)\n sl = s[pos_s - 1]\n sr = s[pos_s]\n tl = t[pos_t - 1]\n tr = t[pos_t]\n ans = min(\n i - min(sl, tl),\n max(sr, tr) - i,\n (sr - i) + (sr - tl),\n (tr - i) + (tr - sl),\n (i - sl) + (tr - sl),\n (i - tl) + (sr - tl),\n )\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "4090583f6aa869d802e0b783200dcb36cadfe644c804cfc2fc81125201e61d62", "fast_id": "p03112_4090583f6aa869d802e0b783200dcb36cadfe644c804cfc2fc81125201e61d62", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from bisect import bisect\n\n\ndef main():\n a, b, q, *stx = list(map(int, open(0).read().split()))\n s = [-1e10] + stx[:a] + [2 * 1e10]\n t = [-1e10] + stx[a : a + b] + [2 * 1e10]\n x = stx[a + b : a + b + q]\n for i in x:\n pos_s = bisect(s, i)\n pos_t = bisect(t, i)\n sl = s[pos_s - 1]\n sr = s[pos_s]\n tl = t[pos_t - 1]\n tr = t[pos_t]\n ans = min(\n i - min(sl, tl),\n max(sr, tr) - i,\n (sr - i) + (sr - tl),\n (tr - i) + (tr - sl),\n (i - sl) + (tr - sl),\n (i - tl) + (sr - tl),\n )\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "4090583f6aa869d802e0b783200dcb36cadfe644c804cfc2fc81125201e61d62", "measured_slow_code": "# -*- coding: utf-8 -*-\n\"\"\"\n参考:https://img.atcoder.jp/abc119/editorial.pdf\n・前計算しないで直接やる版\n・INFがfloat('inf')だとダメで10**18にしたらいけた。INF-INFがnanになるからだった。\n・上記を考慮して修正版\n\"\"\"\nimport sys, re\nfrom collections import deque, defaultdict, Counter\nfrom math import sqrt, hypot, factorial, pi, sin, cos, radians, log10\n\nif sys.version_info.minor >= 5:\n from math import gcd\nelse:\n from fractions import gcd\nfrom heapq import heappop, heappush, heapify, heappushpop\nfrom bisect import bisect_left, bisect_right\nfrom itertools import permutations, combinations, product, accumulate\nfrom operator import itemgetter, mul, xor\nfrom copy import copy, deepcopy\nfrom functools import reduce, partial\nfrom fractions import Fraction\nfrom string import ascii_lowercase, ascii_uppercase, digits\nfrom datetime import date\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef list2d(a, b, c):\n return [[c] * b for i in range(a)]\n\n\ndef list3d(a, b, c, d):\n return [[[d] * c for j in range(b)] for i in range(a)]\n\n\ndef ceil(x, y=1):\n return int(-(-x // y))\n\n\ndef round(x):\n return int((x * 2 + 1) // 2)\n\n\ndef fermat(x, y, MOD):\n return x * pow(y, MOD - 2, MOD) % MOD\n\n\ndef lcm(x, y):\n return (x * y) // gcd(x, y)\n\n\ndef lcm_list(nums):\n return reduce(lcm, nums, 1)\n\n\ndef gcd_list(nums):\n return reduce(gcd, nums, nums[0])\n\n\ndef INT():\n return int(eval(input()))\n\n\ndef MAP():\n return list(map(int, input().split()))\n\n\ndef LIST():\n return list(map(int, input().split()))\n\n\ndef Yes():\n print(\"Yes\")\n\n\ndef No():\n print(\"No\")\n\n\ndef YES():\n print(\"YES\")\n\n\ndef NO():\n print(\"NO\")\n\n\nsys.setrecursionlimit(10**9)\nINF = float(\"inf\")\nMOD = 10**9 + 7\nA, B, Q = MAP()\nS = [-INF] * (A + 2)\nfor i in range(A):\n S[i + 1] = INT()\nT = [-INF] * (B + 2)\nfor i in range(B):\n T[i + 1] = INT()\nS[-1] = T[-1] = INF\nfor i in range(Q):\n dist1 = dist2 = dist3 = dist4 = INF\n x = INT()\n # 地点xから左に一番近い神社\n idx1 = bisect_right(S, x) - 1\n # 右に一番近い神社\n idx2 = bisect_left(S, x)\n idx3 = bisect_right(T, x) - 1\n idx4 = bisect_left(T, x)\n # idx1番目の神社に行く\n dist1 = x - S[idx1]\n # idx1番目の神社から、xから右か左に一番近かった寺に行く\n if dist1 != INF:\n dist1 += min(abs(S[idx1] - T[idx3]), abs(S[idx1] - T[idx4]))\n dist2 = S[idx2] - x\n if dist2 != INF:\n dist2 += min(abs(S[idx2] - T[idx3]), abs(S[idx2] - T[idx4]))\n dist3 = x - T[idx3]\n if dist3 != INF:\n dist3 += min(abs(T[idx3] - S[idx1]), abs(T[idx3] - S[idx2]))\n dist4 = T[idx4] - x\n if dist4 != INF:\n dist4 += min(abs(T[idx4] - S[idx1]), abs(T[idx4] - S[idx2]))\n print((min(dist1, dist2, dist3, dist4)))\n", "measured_slow_code_sha256": "075f3d0646b6b85cb5ae32f4ea2d0d59acf39147bd9650aafe37dade27ea98fa", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 6.960589636670257, "pair_id": "python_v2_b171fc63e11a993159dd3a8e", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03112", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03112_4090583f6aa869d802e0b783200dcb36cadfe644c804cfc2fc81125201e61d62.jsonl.gz", "inputs": "reproduction/python/inputs/p03112.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03112_075f3d0646b6b85cb5ae32f4ea2d0d59acf39147bd9650aafe37dade27ea98fa.jsonl.gz"}, "slow_code": "import sys, re\nfrom collections import deque, defaultdict, Counter\nfrom math import sqrt, hypot, factorial, pi, sin, cos, radians, log10\n\nif sys.version_info.minor >= 5:\n from math import gcd\nelse:\n from fractions import gcd\nfrom heapq import heappop, heappush, heapify, heappushpop\nfrom bisect import bisect_left, bisect_right\nfrom itertools import permutations, combinations, product, accumulate\nfrom operator import itemgetter, mul, xor\nfrom copy import copy, deepcopy\nfrom functools import reduce, partial\nfrom fractions import Fraction\nfrom string import ascii_lowercase, ascii_uppercase, digits\nfrom datetime import date\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef list2d(a, b, c):\n return [[c] * b for i in range(a)]\n\n\ndef list3d(a, b, c, d):\n return [[[d] * c for j in range(b)] for i in range(a)]\n\n\ndef ceil(x, y=1):\n return int(-(-x // y))\n\n\ndef round(x):\n return int((x * 2 + 1) // 2)\n\n\ndef fermat(x, y, MOD):\n return x * pow(y, MOD - 2, MOD) % MOD\n\n\ndef lcm(x, y):\n return (x * y) // gcd(x, y)\n\n\ndef lcm_list(nums):\n return reduce(lcm, nums, 1)\n\n\ndef gcd_list(nums):\n return reduce(gcd, nums, nums[0])\n\n\ndef INT():\n return int(eval(input()))\n\n\ndef MAP():\n return list(map(int, input().split()))\n\n\ndef LIST():\n return list(map(int, input().split()))\n\n\ndef Yes():\n print(\"Yes\")\n\n\ndef No():\n print(\"No\")\n\n\ndef YES():\n print(\"YES\")\n\n\ndef NO():\n print(\"NO\")\n\n\nsys.setrecursionlimit(10**9)\nINF = float(\"inf\")\nMOD = 10**9 + 7\nA, B, Q = MAP()\nS = [-INF] * (A + 2)\nfor i in range(A):\n S[i + 1] = INT()\nT = [-INF] * (B + 2)\nfor i in range(B):\n T[i + 1] = INT()\nS[-1] = T[-1] = INF\nfor i in range(Q):\n dist1 = dist2 = dist3 = dist4 = INF\n x = INT()\n\n idx1 = bisect_right(S, x) - 1\n\n idx2 = bisect_left(S, x)\n idx3 = bisect_right(T, x) - 1\n idx4 = bisect_left(T, x)\n\n dist1 = x - S[idx1]\n\n if dist1 != INF:\n dist1 += min(abs(S[idx1] - T[idx3]), abs(S[idx1] - T[idx4]))\n dist2 = S[idx2] - x\n if dist2 != INF:\n dist2 += min(abs(S[idx2] - T[idx3]), abs(S[idx2] - T[idx4]))\n dist3 = x - T[idx3]\n if dist3 != INF:\n dist3 += min(abs(T[idx3] - S[idx1]), abs(T[idx3] - S[idx2]))\n dist4 = T[idx4] - x\n if dist4 != INF:\n dist4 += min(abs(T[idx4] - S[idx1]), abs(T[idx4] - S[idx2]))\n print((min(dist1, dist2, dist3, dist4)))\n", "slow_code_sha256": "77daaa725f47eb183a0e25b50b7e6255b814e50d5067b476fe004c62248fd0dc", "slow_id": "p03112_075f3d0646b6b85cb5ae32f4ea2d0d59acf39147bd9650aafe37dade27ea98fa", "speedup": 9.137565998684941, "stratum": "8+", "within_pair_jaccard": 0.13793103448275862, "workload": {"case_count": 100, "description": "For each starting coordinate x_i on a line, minimize travel distance needed to visit at least one shrine s_j and one temple t_j in any order. Shrine and temple lists are strictly increasing; all shrine, temple and query coordinates are distinct. Observed inputs: A=1..100000 (median 1000); B=1..100000 (median 1000); Q=1..100000 (median 1000); s_i=1..9999998614; t_i=10814..10000000000; x_i=1631..9999995619.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 3267071, "median": 267821.5, "min": 31}, "input_format": ["A B Q\ns_1\n...\ns_A\nt_1\n...\nt_B\nx_1\n...\nx_Q"], "input_format_status": "source_input_section", "input_lines": {"max": 300001, "median": 30001.0, "min": 4}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 300003, "median": 30003.0, "min": 6}}} -{"case_ids": ["p03291_case_000", "p03291_case_001", "p03291_case_002", "p03291_case_003", "p03291_case_004", "p03291_case_005", "p03291_case_006", "p03291_case_007", "p03291_case_008", "p03291_case_009", "p03291_case_010", "p03291_case_011", "p03291_case_012", "p03291_case_013", "p03291_case_014", "p03291_case_015", "p03291_case_016", "p03291_case_017", "p03291_case_018", "p03291_case_019", "p03291_case_020", "p03291_case_021", "p03291_case_022", "p03291_case_023", "p03291_case_024", "p03291_case_025", "p03291_case_026", "p03291_case_027", "p03291_case_028", "p03291_case_029", "p03291_case_030", "p03291_case_031", "p03291_case_032", "p03291_case_033", "p03291_case_034", "p03291_case_035", "p03291_case_036", "p03291_case_037", "p03291_case_038", "p03291_case_039", "p03291_case_040", "p03291_case_041", "p03291_case_042", "p03291_case_043", "p03291_case_044", "p03291_case_045", "p03291_case_046", "p03291_case_047", "p03291_case_048", "p03291_case_049", "p03291_case_050", "p03291_case_051", "p03291_case_052", "p03291_case_053", "p03291_case_054", "p03291_case_055", "p03291_case_056", "p03291_case_057", "p03291_case_058", "p03291_case_059", "p03291_case_060", "p03291_case_061", "p03291_case_062", "p03291_case_063", "p03291_case_064", "p03291_case_065", "p03291_case_066", "p03291_case_067", "p03291_case_068", "p03291_case_069", "p03291_case_070", "p03291_case_071", "p03291_case_072", "p03291_case_073", "p03291_case_074", "p03291_case_075", "p03291_case_076", "p03291_case_077", "p03291_case_078", "p03291_case_079", "p03291_case_080", "p03291_case_081", "p03291_case_082", "p03291_case_083", "p03291_case_084", "p03291_case_085", "p03291_case_086", "p03291_case_087", "p03291_case_088", "p03291_case_089", "p03291_case_090", "p03291_case_091", "p03291_case_092", "p03291_case_093", "p03291_case_094", "p03291_case_095", "p03291_case_096", "p03291_case_097", "p03291_case_098", "p03291_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "S = input().strip()\nmod = 10**9 + 7\ndp = [1] + [0] * 3\nfor s in S:\n dp1 = dp[:]\n if s == \"A\":\n dp1[1] += dp[0]\n elif s == \"B\":\n dp1[2] += dp[1]\n elif s == \"C\":\n dp1[3] += dp[2]\n else:\n dp1[1] += dp[0]\n dp1[2] += dp[1]\n dp1[3] += dp[2]\n dp1[0] += 2 * dp[0]\n dp1[1] += 2 * dp[1]\n dp1[2] += 2 * dp[2]\n dp1[3] += 2 * dp[3]\n dp = [d % mod for d in dp1]\nprint((dp[-1]))\n", "fast_code_sha256": "fa4e89df610f6b68dc0a1b671138724e22469c009af7af8893a340d0b7f8c7d7", "fast_id": "p03291_fa4e89df610f6b68dc0a1b671138724e22469c009af7af8893a340d0b7f8c7d7", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "S = input().strip()\nmod = 10**9 + 7\ndp = [1] + [0] * 3\nfor s in S:\n dp1 = dp[:]\n if s == \"A\":\n dp1[1] += dp[0]\n elif s == \"B\":\n dp1[2] += dp[1]\n elif s == \"C\":\n dp1[3] += dp[2]\n else:\n dp1[1] += dp[0]\n dp1[2] += dp[1]\n dp1[3] += dp[2]\n dp1[0] += 2 * dp[0]\n dp1[1] += 2 * dp[1]\n dp1[2] += 2 * dp[2]\n dp1[3] += 2 * dp[3]\n dp = [d % mod for d in dp1]\nprint((dp[-1]))\n", "measured_fast_code_sha256": "fa4e89df610f6b68dc0a1b671138724e22469c009af7af8893a340d0b7f8c7d7", "measured_slow_code": "# -*- coding: utf-8 -*-\nimport sys\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef list2d(a, b, c):\n return [[c] * b for i in range(a)]\n\n\ndef list3d(a, b, c, d):\n return [[[d] * c for j in range(b)] for i in range(a)]\n\n\ndef list4d(a, b, c, d, e):\n return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]\n\n\ndef ceil(x, y=1):\n return int(-(-x // y))\n\n\ndef INT():\n return int(input())\n\n\ndef MAP():\n return map(int, input().split())\n\n\ndef LIST(N=None):\n return list(MAP()) if N is None else [INT() for i in range(N)]\n\n\ndef Yes():\n print(\"Yes\")\n\n\ndef No():\n print(\"No\")\n\n\ndef YES():\n print(\"YES\")\n\n\ndef NO():\n print(\"NO\")\n\n\nsys.setrecursionlimit(10**9)\nINF = 10**18\nMOD = 10**9 + 7\nS = input()\nN = len(S)\n# dp[i][j] := i文字目まで見て、ABCのうちj文字目まで選んだ状態の通り数\ndp = list2d(N + 1, 4, 0)\ndp[0][0] = 1\nfor i in range(N):\n s = S[i]\n for j in range(4):\n # 今回の文字を選ばない\n if s == \"?\":\n # ?は3通り遷移させる\n dp[i + 1][j] += dp[i][j] * 3\n dp[i + 1][j] %= MOD\n else:\n dp[i + 1][j] += dp[i][j]\n dp[i + 1][j] %= MOD\n # 今回の文字を選ぶ\n if j < 3:\n # 条件に合わせて次の文字へ進む\n if (\n s == \"?\"\n or s == \"A\"\n and j == 0\n or s == \"B\"\n and j == 1\n or s == \"C\"\n and j == 2\n ):\n dp[i + 1][j + 1] += dp[i][j]\n dp[i + 1][j + 1] %= MOD\n# N文字目まで見て、3文字選び終わっている通り数\nprint(dp[N][3])\n", "measured_slow_code_sha256": "d64c264e5368f29c687af8158e3b733bec94dc390763e9ea00c167fb81f53e6e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.1194058377613425, "pair_id": "python_v2_1771da6d0ae942026cfeb312", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03291", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03291_fa4e89df610f6b68dc0a1b671138724e22469c009af7af8893a340d0b7f8c7d7.jsonl.gz", "inputs": "reproduction/python/inputs/p03291.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03291_d64c264e5368f29c687af8158e3b733bec94dc390763e9ea00c167fb81f53e6e.jsonl.gz"}, "slow_code": "import sys\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef list2d(a, b, c):\n return [[c] * b for i in range(a)]\n\n\ndef list3d(a, b, c, d):\n return [[[d] * c for j in range(b)] for i in range(a)]\n\n\ndef list4d(a, b, c, d, e):\n return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]\n\n\ndef ceil(x, y=1):\n return int(-(-x // y))\n\n\ndef INT():\n return int(input())\n\n\ndef MAP():\n return map(int, input().split())\n\n\ndef LIST(N=None):\n return list(MAP()) if N is None else [INT() for i in range(N)]\n\n\ndef Yes():\n print(\"Yes\")\n\n\ndef No():\n print(\"No\")\n\n\ndef YES():\n print(\"YES\")\n\n\ndef NO():\n print(\"NO\")\n\n\nsys.setrecursionlimit(10**9)\nINF = 10**18\nMOD = 10**9 + 7\nS = input()\nN = len(S)\n\ndp = list2d(N + 1, 4, 0)\ndp[0][0] = 1\nfor i in range(N):\n s = S[i]\n for j in range(4):\n\n if s == \"?\":\n\n dp[i + 1][j] += dp[i][j] * 3\n dp[i + 1][j] %= MOD\n else:\n dp[i + 1][j] += dp[i][j]\n dp[i + 1][j] %= MOD\n\n if j < 3:\n\n if (\n s == \"?\"\n or s == \"A\"\n and j == 0\n or s == \"B\"\n and j == 1\n or s == \"C\"\n and j == 2\n ):\n dp[i + 1][j + 1] += dp[i][j]\n dp[i + 1][j + 1] %= MOD\n\nprint(dp[N][3])\n", "slow_code_sha256": "893aa769d75c0f68c1d1f6bae5efa68305f4fe10177fa385d3123d97c041f274", "slow_id": "p03291_d64c264e5368f29c687af8158e3b733bec94dc390763e9ea00c167fb81f53e6e", "speedup": 3.2658204875232064, "stratum": "2-4", "within_pair_jaccard": 0.3230769230769231, "workload": {"case_count": 100, "description": "For each replacement of every ? in S by A,B or C, count triples i d:\n print(\"No\")\n continue\n if c >= b:\n print(\"Yes\")\n continue\n g = gcd(b, d)\n r = a % g\n # FYI: https://stackoverflow.com/questions/2795946/getting-ceil-of-decimal-in-python\n _max = (\n (\n int(\n (\n (decimal.Decimal(b, context=ctx) - decimal.Decimal(r, context=ctx))\n / decimal.Decimal(g, context=ctx)\n ).to_integral_exact(context=ctx)\n )\n * g\n )\n + r\n - g\n )\n # math.ceilは精度不足でエラーになる: https://cocoinit23.com/math-floor-ceil-error/\n # _max = ((math.ceil((b - r) / g)) * g) + r - g\n # OK: (a + b - 1) // b: https://nariagari-igakusei.com/cpp-division-round-up/\n # _max = ((b - r + g - 1)//g) * g + r - g\n if c < _max:\n print(\"No\")\n else:\n print(\"Yes\")\n", "measured_slow_code_sha256": "c62d289c9b502fe7f9c4c3989d4872b95b65f1878e4174ba62c7367a7ee17035", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 8.13288591400612, "pair_id": "python_v2_965685579e6a3043be321295", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03297", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03297_df3abf6f0bfda3c53a4dae9b9f7ae38fc9c8a22d5a19699503d33d0fec89549c.jsonl.gz", "inputs": "reproduction/python/inputs/p03297.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03297_c62d289c9b502fe7f9c4c3989d4872b95b65f1878e4174ba62c7367a7ee17035.jsonl.gz"}, "slow_code": "import sys\n\ninput = sys.stdin.readline\nsys.setrecursionlimit(10**7)\n\n\ndef gcd(a, b):\n if b == 0:\n return a\n else:\n return gcd(b, a % b)\n\n\nimport math\nimport decimal\n\nctx = decimal.Context(prec=1, rounding=decimal.ROUND_CEILING)\nfor i in range(int(eval(input()))):\n a, b, c, d = list(map(int, input().split()))\n if a < b:\n print(\"No\")\n continue\n if b > d:\n print(\"No\")\n continue\n if c >= b:\n print(\"Yes\")\n continue\n g = gcd(b, d)\n r = a % g\n\n _max = (\n (\n int(\n (\n (decimal.Decimal(b, context=ctx) - decimal.Decimal(r, context=ctx))\n / decimal.Decimal(g, context=ctx)\n ).to_integral_exact(context=ctx)\n )\n * g\n )\n + r\n - g\n )\n\n if c < _max:\n print(\"No\")\n else:\n print(\"Yes\")\n", "slow_code_sha256": "16caa5a428bccd19d9ed72bef4b8aa4ade86e5338a70bd4f7c2fc3002293282c", "slow_id": "p03297_c62d289c9b502fe7f9c4c3989d4872b95b65f1878e4174ba62c7367a7ee17035", "speedup": 5.887511920220108, "stratum": "4-8", "within_pair_jaccard": 0.46808510638297873, "workload": {"case_count": 100, "description": "For each query, a shop starts with A units. Each day a buyer needs B units; after purchase, if remaining stock is <=C, add D units before next morning. Determine whether purchases can continue indefinitely without shortage. Observed inputs: T=5..300 (median 10); A=1..1000000000000000000; B=1..1000000000000000000; C=1..1000000000000000000; D=1..1000000000000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 24004, "median": 759.0, "min": 83}, "input_format": ["T\nA_1 B_1 C_1 D_1\n...\nA_T B_T C_T D_T"], "input_format_status": "source_input_section", "input_lines": {"max": 301, "median": 11.0, "min": 6}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1201, "median": 41.0, "min": 21}}} -{"case_ids": ["p03721_case_000", "p03721_case_001", "p03721_case_002", "p03721_case_003", "p03721_case_004", "p03721_case_005", "p03721_case_006", "p03721_case_007", "p03721_case_008", "p03721_case_009", "p03721_case_010", "p03721_case_011", "p03721_case_012", "p03721_case_013", "p03721_case_014", "p03721_case_015", "p03721_case_016", "p03721_case_017", "p03721_case_018", "p03721_case_019", "p03721_case_020", "p03721_case_021", "p03721_case_022", "p03721_case_023", "p03721_case_024", "p03721_case_025", "p03721_case_026", "p03721_case_027", "p03721_case_028", "p03721_case_029", "p03721_case_030", "p03721_case_031", "p03721_case_032", "p03721_case_033", "p03721_case_034", "p03721_case_035", "p03721_case_036", "p03721_case_037", "p03721_case_038", "p03721_case_039", "p03721_case_040", "p03721_case_041", "p03721_case_042", "p03721_case_043", "p03721_case_044", "p03721_case_045", "p03721_case_046", "p03721_case_047", "p03721_case_048", "p03721_case_049", "p03721_case_050", "p03721_case_051", "p03721_case_052", "p03721_case_053", "p03721_case_054", "p03721_case_055", "p03721_case_056", "p03721_case_057", "p03721_case_058", "p03721_case_059", "p03721_case_060", "p03721_case_061", "p03721_case_062", "p03721_case_063", "p03721_case_064", "p03721_case_065", "p03721_case_067", "p03721_case_068", "p03721_case_069", "p03721_case_070", "p03721_case_071", "p03721_case_072", "p03721_case_073", "p03721_case_074", "p03721_case_075", "p03721_case_076", "p03721_case_077", "p03721_case_078", "p03721_case_079", "p03721_case_080", "p03721_case_081", "p03721_case_082", "p03721_case_083", "p03721_case_084", "p03721_case_085", "p03721_case_087", "p03721_case_088", "p03721_case_089", "p03721_case_090", "p03721_case_091", "p03721_case_092", "p03721_case_093", "p03721_case_094", "p03721_case_095", "p03721_case_096", "p03721_case_097", "p03721_case_098", "p03721_case_099", "p03721_v2_8dbaa32dabbc59559f15", "p03721_v2_b1687ced952bc758cf7f"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N, K = list(map(int, input().split()))\nS = [list(map(int, input().split())) for _ in range(N)]\nfrom operator import itemgetter\n\nS.sort(key=itemgetter(0))\n\ntimes = 0\n\nindex = 0\nwhile True:\n hoge = times + S[index][1]\n if hoge < K:\n times += S[index][1]\n else:\n re = S[index][0]\n break\n index += 1\nprint(re)\n", "fast_code_sha256": "60774fe21ca597c35812d74624719a4bfa498a05eec19e67db1a9e88616d9992", "fast_id": "p03721_08babfd402c1a81890d7df8e3f80094a0aad918f88f47ccf882c7e032849217a", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N, K = list(map(int, input().split()))\nS = [list(map(int, input().split())) for _ in range(N)]\nfrom operator import itemgetter\n\nS.sort(key=itemgetter(0))\n# timesは今何番目に大きいものを表しているか\ntimes = 0\n# indexは今のインデックス\nindex = 0\nwhile True:\n hoge = times + S[index][1]\n if hoge < K:\n times += S[index][1]\n else:\n re = S[index][0]\n break\n index += 1\nprint(re)\n", "measured_fast_code_sha256": "08babfd402c1a81890d7df8e3f80094a0aad918f88f47ccf882c7e032849217a", "measured_slow_code": "import sys\nimport numpy as np\nimport collections\n\nn, k = [int(x) for x in sys.stdin.readline().split()]\nr = collections.defaultdict(int)\nfor i in range(n):\n a, b = [int(x) for x in sys.stdin.readline().split()]\n r[a] += b\nd = sorted(r.items())\nc = 0\nfor i, j in enumerate(d):\n c += j[1]\n if c >= k:\n print((int(j[0])))\n break\n", "measured_slow_code_sha256": "75d5b758a5047678745153d41c380f660afa7f9d4f81ada1ef8c3eb0b4fb4d9c", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.1441230905370294, "pair_id": "python_v2_87e9d9214ba283c4f28964a8", "per_case_slow_code_faster_fraction": 0.09, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03721", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03721_08babfd402c1a81890d7df8e3f80094a0aad918f88f47ccf882c7e032849217a.jsonl.gz", "inputs": "reproduction/python/inputs/p03721.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03721_75d5b758a5047678745153d41c380f660afa7f9d4f81ada1ef8c3eb0b4fb4d9c.jsonl.gz"}, "slow_code": "import sys\nimport numpy as np\nimport collections\n\nn, k = [int(x) for x in sys.stdin.readline().split()]\nr = collections.defaultdict(int)\nfor i in range(n):\n a, b = [int(x) for x in sys.stdin.readline().split()]\n r[a] += b\nd = sorted(r.items())\nc = 0\nfor i, j in enumerate(d):\n c += j[1]\n if c >= k:\n print((int(j[0])))\n break\n", "slow_code_sha256": "75d5b758a5047678745153d41c380f660afa7f9d4f81ada1ef8c3eb0b4fb4d9c", "slow_id": "p03721_75d5b758a5047678745153d41c380f660afa7f9d4f81ada1ef8c3eb0b4fb4d9c", "speedup": 4.614180725337706, "stratum": "4-8", "within_pair_jaccard": 0.21568627450980393, "workload": {"case_count": 100, "description": "Operation i inserts b_i copies of integer a_i into an initially empty multiset. After N operations, find the 1-based K-th smallest element, counting multiplicity; the expanded multiset is not supplied. Observed inputs: N=1..100000 (median 100000); K=1..10000000000 (median 1154351153); a_i=1..100000; b_i=1..100000; total_elements=1..10000000000 (median 4995269195.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1289119, "median": 1177559.0, "min": 8}, "input_format": ["N K\na_1 b_1\n...\na_N b_N"], "input_format_status": "source_input_section", "input_lines": {"max": 100001, "median": 100001.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200002, "median": 200002.0, "min": 4}}} -{"case_ids": ["p02804_case_000", "p02804_case_001", "p02804_case_002", "p02804_case_003", "p02804_case_004", "p02804_case_005", "p02804_case_006", "p02804_case_007", "p02804_case_008", "p02804_case_009", "p02804_case_010", "p02804_case_011", "p02804_case_012", "p02804_case_013", "p02804_case_014", "p02804_case_015", "p02804_case_016", "p02804_case_017", "p02804_case_018", "p02804_case_019", "p02804_case_020", "p02804_case_021", "p02804_case_022", "p02804_case_023", "p02804_case_024", "p02804_case_025", "p02804_case_026", "p02804_case_027", "p02804_case_028", "p02804_case_029", "p02804_case_030", "p02804_case_031", "p02804_case_032", "p02804_case_033", "p02804_case_034", "p02804_case_035", "p02804_case_036", "p02804_case_037", "p02804_case_038", "p02804_case_039", "p02804_case_040", "p02804_case_041", "p02804_case_042", "p02804_case_043", "p02804_case_044", "p02804_case_045", "p02804_case_046", "p02804_case_047", "p02804_case_048", "p02804_case_049", "p02804_case_050", "p02804_case_051", "p02804_case_052", "p02804_case_053", "p02804_case_054", "p02804_case_055", "p02804_case_056", "p02804_case_057", "p02804_case_058", "p02804_case_059", "p02804_case_060", "p02804_case_061", "p02804_case_062", "p02804_case_063", "p02804_case_064", "p02804_case_065", "p02804_case_066", "p02804_case_067", "p02804_case_068", "p02804_case_069", "p02804_case_070", "p02804_case_071", "p02804_case_072", "p02804_case_073", "p02804_case_074", "p02804_case_075", "p02804_case_076", "p02804_case_077", "p02804_case_078", "p02804_case_079", "p02804_case_080", "p02804_case_081", "p02804_case_082", "p02804_case_083", "p02804_case_084", "p02804_case_085", "p02804_case_086", "p02804_case_087", "p02804_case_088", "p02804_case_089", "p02804_case_090", "p02804_case_091", "p02804_case_092", "p02804_case_093", "p02804_case_094", "p02804_case_095", "p02804_case_096", "p02804_case_097", "p02804_case_098", "p02804_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "executable_AST_equal_except_explicit_explanatory_string_removal_and_all_frozen_inputs_checker_pass", "fast_code": "P = 10**9 + 7\nN = 100001\ninv = [0] + [1]\nfinv = [1] + [1]\nfac = [1] + [1]\nfor i in range(2, N):\n inv += [inv[P % i] * (P - int(P / i)) % P]\n fac += [(fac[i - 1] * i) % P]\n finv += [(finv[i - 1] * inv[i]) % P]\n\n\ndef comb(a, b):\n if a < b:\n return -1\n return (fac[a] * ((finv[b] * finv[a - b]) % P)) % P\n\n\nn, k = list(map(int, input().split()))\na = list(map(int, input().split()))\na = sorted(a, key=lambda x: x, reverse=False)\nans = 0\n\nfor i in range(len(a)):\n tmp = comb(n - 1 - i, k - 1)\n if tmp < 0:\n continue\n if a[i] < 0:\n ans = (ans + (abs(a[i]) * tmp) % P) % P\n else:\n ans = (ans - (abs(a[i]) * tmp) % P + P) % P\n\nfor i in range(len(a)):\n tmp = comb(n - 1 - i, k - 1)\n if tmp < 0:\n continue\n if a[n - 1 - i] < 0:\n ans = (ans - (abs(a[n - 1 - i]) * tmp) % P + P) % P\n else:\n ans = (ans + (abs(a[n - 1 - i]) * tmp) % P) % P\nprint(ans)\n", "fast_code_sha256": "057b5c4ca38651f0d59193224fa4007257013a8667a6bd7769d56ab6e24fd082", "fast_id": "p02804_5fdac6057a326b38b11255f68f1f1d43ee0b748068832d5e767720e4ed292059", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "# ----------------------------------------------------------\nP = 10**9 + 7\nN = 100001 # 使う最大値+1以上にする、値に注意3*10^5とかにしとくと安心\ninv = [0] + [1] # 1/x\nfinv = [1] + [1] # 1/x!\nfac = [1] + [1] # x!\nfor i in range(2, N):\n inv += [inv[P % i] * (P - int(P / i)) % P]\n fac += [(fac[i - 1] * i) % P]\n finv += [(finv[i - 1] * inv[i]) % P]\n\n\ndef comb(a, b):\n if a < b:\n return -1 # error\n return (fac[a] * ((finv[b] * finv[a - b]) % P)) % P\n\n\n# ----------------------------------------------------------\nn, k = list(map(int, input().split()))\na = list(map(int, input().split()))\na = sorted(a, key=lambda x: x, reverse=False)\nans = 0\n# a[i]が最小値になる場合の数\nfor i in range(len(a)):\n tmp = comb(n - 1 - i, k - 1)\n if tmp < 0:\n continue\n if a[i] < 0:\n ans = (ans + (abs(a[i]) * tmp) % P) % P\n else:\n ans = (ans - (abs(a[i]) * tmp) % P + P) % P\n# a[i]が最大値になる場合の数\nfor i in range(len(a)):\n tmp = comb(n - 1 - i, k - 1)\n if tmp < 0:\n continue\n if a[n - 1 - i] < 0:\n ans = (ans - (abs(a[n - 1 - i]) * tmp) % P + P) % P\n else:\n ans = (ans + (abs(a[n - 1 - i]) * tmp) % P) % P\nprint(ans)\n", "measured_fast_code_sha256": "5fdac6057a326b38b11255f68f1f1d43ee0b748068832d5e767720e4ed292059", "measured_slow_code": "from collections import defaultdict\n\n\nclass Combination:\n \"\"\"\n O(n)の前計算を1回行うことで,O(1)でnCr mod mを求められる\n n_max = 10**6のとき前処理は約950ms (PyPyなら約340ms, 10**7で約1800ms)\n 使用例:\n comb = Combination(1000000)\n print(comb(5, 3)) # 10\n \"\"\"\n\n def __init__(self, n_max, mod=10**9 + 7):\n self.mod = mod\n self.modinv = self.make_modinv_list(n_max)\n self.fac, self.facinv = self.make_factorial_list(n_max)\n\n def __call__(self, n, r):\n return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n - r] % self.mod\n\n def make_factorial_list(self, n):\n # 階乗のリストと階乗のmod逆元のリストを返す O(n)\n # self.make_modinv_list()が先に実行されている必要がある\n fac = [1]\n facinv = [1]\n for i in range(1, n + 1):\n fac.append(fac[i - 1] * i % self.mod)\n facinv.append(facinv[i - 1] * self.modinv[i] % self.mod)\n return fac, facinv\n\n def make_modinv_list(self, n):\n # 0からnまでのmod逆元のリストを返す O(n)\n modinv = [0] * (n + 1)\n modinv[1] = 1\n for i in range(2, n + 1):\n modinv[i] = self.mod - self.mod // i * modinv[self.mod % i] % self.mod\n return modinv\n\n\ndef main():\n # def cmb(n, r, mod):\n # if ( r<0 or r>n ):\n # return 0\n # r = min(r, n-r)\n # return g1[n] * g2[r] * g2[n-r] % mod\n #\n # mod = 10**9+7 #出力の制限\n # N = 10**4\n # g1 = [1, 1] # 元テーブル\n # g2 = [1, 1] #逆元テーブル\n # inverse = [0, 1] #逆元テーブル計算用テーブル\n #\n # for i in range( 2, N + 1 ):\n # g1.append( ( g1[-1] * i ) % mod )\n # inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )\n # g2.append( (g2[-1] * inverse[-1]) % mod )\n N, K = list(map(int, input().split()))\n A = list(map(int, input().split()))\n A.sort()\n ans = 0\n mod = 10**9 + 7\n comb = Combination(1000000)\n # 最小になる数を求める\n for i, a in enumerate(A):\n if (N - 1 - i) >= K - 1:\n # tmp = cmb(N-1-i,K-1,mod)\n tmp = comb(N - 1 - i, K - 1)\n ans -= a * tmp\n ans %= mod\n else:\n break\n A.sort(reverse=True)\n for i, a in enumerate(A):\n if (N - 1 - i) >= K - 1:\n # tmp = cmb(N-1-i,K-1,mod)\n tmp = comb(N - 1 - i, K - 1)\n ans += a * tmp\n ans %= mod\n else:\n break\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "52e56efda7e8ad6e4fdc8f09b72891b75e6a9de56b6e71746fa44cb90b571757", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 7.65471046063473, "pair_id": "python_v2_ee47403cafdd2b706658b6ff", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02804", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02804_5fdac6057a326b38b11255f68f1f1d43ee0b748068832d5e767720e4ed292059.jsonl.gz", "inputs": "reproduction/python/inputs/p02804.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02804_52e56efda7e8ad6e4fdc8f09b72891b75e6a9de56b6e71746fa44cb90b571757.jsonl.gz"}, "slow_code": "from collections import defaultdict\n\n\nclass Combination:\n\n def __init__(self, n_max, mod=10**9 + 7):\n self.mod = mod\n self.modinv = self.make_modinv_list(n_max)\n self.fac, self.facinv = self.make_factorial_list(n_max)\n\n def __call__(self, n, r):\n return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n - r] % self.mod\n\n def make_factorial_list(self, n):\n\n fac = [1]\n facinv = [1]\n for i in range(1, n + 1):\n fac.append(fac[i - 1] * i % self.mod)\n facinv.append(facinv[i - 1] * self.modinv[i] % self.mod)\n return fac, facinv\n\n def make_modinv_list(self, n):\n\n modinv = [0] * (n + 1)\n modinv[1] = 1\n for i in range(2, n + 1):\n modinv[i] = self.mod - self.mod // i * modinv[self.mod % i] % self.mod\n return modinv\n\n\ndef main():\n\n N, K = list(map(int, input().split()))\n A = list(map(int, input().split()))\n A.sort()\n ans = 0\n mod = 10**9 + 7\n comb = Combination(1000000)\n\n for i, a in enumerate(A):\n if (N - 1 - i) >= K - 1:\n\n tmp = comb(N - 1 - i, K - 1)\n ans -= a * tmp\n ans %= mod\n else:\n break\n A.sort(reverse=True)\n for i, a in enumerate(A):\n if (N - 1 - i) >= K - 1:\n\n tmp = comb(N - 1 - i, K - 1)\n ans += a * tmp\n ans %= mod\n else:\n break\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "c994ccc5a265f81602ec3599210c2d88b03e4417d6b99505fd51e34598f98009", "slow_id": "p02804_52e56efda7e8ad6e4fdc8f09b72891b75e6a9de56b6e71746fa44cb90b571757", "speedup": 5.7681891374643905, "stratum": "4-8", "within_pair_jaccard": 0.35443037974683544, "workload": {"case_count": 100, "description": "For every choice of K distinct indices among N array positions, take the largest selected value minus the smallest. Sum these differences modulo 1000000007. Equal values at different indices are distinct choices. Observed inputs: N=1..100000 (median 100); K=1..100000 (median 5); A_i=-1000000000..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1200009, "median": 1046.0, "min": 10}, "input_format": ["N K\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100002, "median": 102.0, "min": 3}}} -{"case_ids": ["p02761_case_000", "p02761_case_001", "p02761_case_002", "p02761_case_003", "p02761_case_004", "p02761_case_005", "p02761_case_006", "p02761_case_007", "p02761_case_008", "p02761_case_009", "p02761_case_010", "p02761_case_011", "p02761_case_012", "p02761_case_013", "p02761_case_014", "p02761_case_015", "p02761_case_016", "p02761_case_017", "p02761_case_018", "p02761_case_019", "p02761_case_020", "p02761_case_021", "p02761_case_022", "p02761_case_023", "p02761_case_024", "p02761_case_025", "p02761_case_026", "p02761_case_027", "p02761_case_028", "p02761_case_029", "p02761_case_030", "p02761_case_031", "p02761_case_032", "p02761_case_033", "p02761_case_034", "p02761_case_035", "p02761_case_036", "p02761_case_037", "p02761_case_038", "p02761_case_039", "p02761_case_040", "p02761_case_041", "p02761_case_042", "p02761_case_043", "p02761_case_044", "p02761_case_045", "p02761_case_046", "p02761_case_047", "p02761_case_048", "p02761_case_049", "p02761_case_050", "p02761_case_051", "p02761_case_052", "p02761_case_053", "p02761_case_054", "p02761_case_055", "p02761_case_056", "p02761_case_057", "p02761_case_058", "p02761_case_059", "p02761_case_060", "p02761_case_061", "p02761_case_062", "p02761_case_063", "p02761_case_064", "p02761_case_065", "p02761_case_066", "p02761_case_067", "p02761_case_068", "p02761_case_069", "p02761_case_070", "p02761_case_071", "p02761_case_072", "p02761_case_073", "p02761_case_074", "p02761_case_075", "p02761_case_076", "p02761_case_077", "p02761_case_078", "p02761_case_079", "p02761_case_080", "p02761_case_081", "p02761_case_082", "p02761_case_083", "p02761_case_084", "p02761_case_085", "p02761_case_086", "p02761_case_087", "p02761_case_088", "p02761_case_089", "p02761_case_090", "p02761_case_091", "p02761_case_092", "p02761_case_093", "p02761_case_094", "p02761_case_095", "p02761_case_096", "p02761_case_097", "p02761_case_098", "p02761_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n, m = map(int, input().split())\nans = [-1] * n\nfor i in range(m):\n s, c = map(int, input().split())\n if s == 1 and c == 0 and n != 1:\n print(-1)\n exit()\n if ans[s - 1] == -1 or ans[s - 1] == c:\n ans[s - 1] = c\n else:\n print(-1)\n exit()\nif ans[0] == -1 and n != 1:\n ans[0] = 1\nfor i in range(n):\n if ans[i] == -1:\n ans[i] = 0\nprint(*ans, sep=\"\")\n", "fast_code_sha256": "d9bd6d9c1673d5c7b03cbce9087eef16e0dc78bd73d6675ec1264bc9b15400ab", "fast_id": "p02761_d9bd6d9c1673d5c7b03cbce9087eef16e0dc78bd73d6675ec1264bc9b15400ab", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n, m = map(int, input().split())\nans = [-1] * n\nfor i in range(m):\n s, c = map(int, input().split())\n if s == 1 and c == 0 and n != 1:\n print(-1)\n exit()\n if ans[s - 1] == -1 or ans[s - 1] == c:\n ans[s - 1] = c\n else:\n print(-1)\n exit()\nif ans[0] == -1 and n != 1:\n ans[0] = 1\nfor i in range(n):\n if ans[i] == -1:\n ans[i] = 0\nprint(*ans, sep=\"\")\n", "measured_fast_code_sha256": "d9bd6d9c1673d5c7b03cbce9087eef16e0dc78bd73d6675ec1264bc9b15400ab", "measured_slow_code": "import bisect\nimport copy\nimport heapq\nimport math\nimport sys\nfrom collections import *\nfrom functools import lru_cache\nfrom itertools import accumulate, combinations, permutations, product\n\n\ndef input():\n return sys.stdin.readline()[:-1]\n\n\ndef ruiseki(lst):\n return [0] + list(accumulate(lst))\n\n\nsys.setrecursionlimit(500000)\nmod = pow(10, 9) + 7\nal = [chr(ord(\"a\") + i) for i in range(26)]\ndirection = [[1, 0], [0, 1], [-1, 0], [0, -1]]\nn, m = list(map(int, input().split()))\nsc = [list(map(int, input().split())) for i in range(m)]\nlst = [-1] * n\nfor i in range(m):\n s, c = sc[i]\n if lst[s - 1] == -1 or lst[s - 1] == c:\n lst[s - 1] = c\n else:\n print((-1))\n quit()\n# print(lst)\nfor i in range(n):\n if i == 0:\n if lst[i] == 0 and n != 1:\n print((-1))\n quit()\n elif lst[i] == -1:\n if n == 1:\n lst[i] = 0\n else:\n lst[i] = 1\n elif lst[i] == -1:\n lst[i] = 0\nprint((\"\".join(map(str, lst))))\n", "measured_slow_code_sha256": "514a6c3c1deb62b4937706f57e0f85699ef2003303440ed0e6219c2b9994802b", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 5.563251875246552, "pair_id": "python_v2_9e2ca220554a107f46b1ae53", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02761", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02761_d9bd6d9c1673d5c7b03cbce9087eef16e0dc78bd73d6675ec1264bc9b15400ab.jsonl.gz", "inputs": "reproduction/python/inputs/p02761.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02761_514a6c3c1deb62b4937706f57e0f85699ef2003303440ed0e6219c2b9994802b.jsonl.gz"}, "slow_code": "import bisect\nimport copy\nimport heapq\nimport math\nimport sys\nfrom collections import *\nfrom functools import lru_cache\nfrom itertools import accumulate, combinations, permutations, product\n\n\ndef input():\n return sys.stdin.readline()[:-1]\n\n\ndef ruiseki(lst):\n return [0] + list(accumulate(lst))\n\n\nsys.setrecursionlimit(500000)\nmod = pow(10, 9) + 7\nal = [chr(ord(\"a\") + i) for i in range(26)]\ndirection = [[1, 0], [0, 1], [-1, 0], [0, -1]]\nn, m = list(map(int, input().split()))\nsc = [list(map(int, input().split())) for i in range(m)]\nlst = [-1] * n\nfor i in range(m):\n s, c = sc[i]\n if lst[s - 1] == -1 or lst[s - 1] == c:\n lst[s - 1] = c\n else:\n print((-1))\n quit()\n\nfor i in range(n):\n if i == 0:\n if lst[i] == 0 and n != 1:\n print((-1))\n quit()\n elif lst[i] == -1:\n if n == 1:\n lst[i] = 0\n else:\n lst[i] = 1\n elif lst[i] == -1:\n lst[i] = 0\nprint((\"\".join(map(str, lst))))\n", "slow_code_sha256": "e9b53459684e8277fdb7764bbe44f20f3c2bffff9a6ad1a47a2a6552aa7f5635", "slow_id": "p02761_514a6c3c1deb62b4937706f57e0f85699ef2003303440ed0e6219c2b9994802b", "speedup": 5.556680743932017, "stratum": "4-8", "within_pair_jaccard": 0.3064516129032258, "workload": {"case_count": 100, "description": "Find the smallest nonnegative N-digit decimal integer satisfying M stated digit constraints (1-based position s_i from the left, digit c_i), or -1. Leading zeros are forbidden except that 0 is one digit. Repeated or contradictory constraints are allowed. Observed inputs: N=1..3 (median 3); M=0..5 (median 2); s_i=1..3; c_i=0..9.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 24, "median": 12.0, "min": 4}, "input_format": ["N M\ns_1 c_1\n...\ns_M c_M"], "input_format_status": "source_input_section", "input_lines": {"max": 6, "median": 3.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 12, "median": 6.0, "min": 2}}} -{"case_ids": ["p02883_case_000", "p02883_case_001", "p02883_case_002", "p02883_case_003", "p02883_case_004", "p02883_case_005", "p02883_case_006", "p02883_case_007", "p02883_case_008", "p02883_case_009", "p02883_case_010", "p02883_case_011", "p02883_case_012", "p02883_case_013", "p02883_case_014", "p02883_case_015", "p02883_case_016", "p02883_case_017", "p02883_case_018", "p02883_case_019", "p02883_case_020", "p02883_case_021", "p02883_case_022", "p02883_case_023", "p02883_case_024", "p02883_case_025", "p02883_case_026", "p02883_case_027", "p02883_case_028", "p02883_case_029", "p02883_case_030", "p02883_case_031", "p02883_case_032", "p02883_case_033", "p02883_case_034", "p02883_case_035", "p02883_case_036", "p02883_case_037", "p02883_case_038", "p02883_case_039", "p02883_case_040", "p02883_case_041", "p02883_case_042", "p02883_case_043", "p02883_case_044", "p02883_case_045", "p02883_case_046", "p02883_case_047", "p02883_case_048", "p02883_case_049", "p02883_case_050", "p02883_case_051", "p02883_case_052", "p02883_case_053", "p02883_case_054", "p02883_case_055", "p02883_case_056", "p02883_case_057", "p02883_case_058", "p02883_case_059", "p02883_case_060", "p02883_case_061", "p02883_case_062", "p02883_case_063", "p02883_case_064", "p02883_case_065", "p02883_case_066", "p02883_case_067", "p02883_case_068", "p02883_case_069", "p02883_case_070", "p02883_case_071", "p02883_case_072", "p02883_case_073", "p02883_case_074", "p02883_case_075", "p02883_case_076", "p02883_case_077", "p02883_case_078", "p02883_case_079", "p02883_case_080", "p02883_case_081", "p02883_case_082", "p02883_case_083", "p02883_case_084", "p02883_case_085", "p02883_case_086", "p02883_case_087", "p02883_case_088", "p02883_case_089", "p02883_case_090", "p02883_case_091", "p02883_case_092", "p02883_case_093", "p02883_case_094", "p02883_case_095", "p02883_case_096", "p02883_case_097", "p02883_case_098", "p02883_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "executable_AST_equal_except_explicit_explanatory_string_removal_and_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\ninput = sys.stdin.readline\n\n\ndef I():\n return int(eval(input()))\n\n\ndef MI():\n return list(map(int, input().split()))\n\n\ndef LI():\n return list(map(int, input().split()))\n\n\ndef main():\n mod = 10**9 + 7\n N, K = MI()\n A = LI()\n F = LI()\n F.sort()\n A.sort(reverse=True)\n if K >= sum(A):\n print((0))\n exit()\n\n def ch(x):\n\n temp = 0\n for i in range(N):\n af = A[i] * F[i]\n if af > x:\n add = (af - x + F[i] - 1) // F[i]\n temp += add\n return temp <= K\n\n ok = 10**12\n ng = 0\n while ok - ng > 1:\n med = (ok + ng) // 2\n if ch(med):\n ok = med\n else:\n ng = med\n print(ok)\n\n\nmain()\n", "fast_code_sha256": "b6ef0b4604691e506db0263a534aed0aee728f0b806494e1127922e5714da424", "fast_id": "p02883_51bcece72f749af885eefd7d6bbc0126e5766afde8b11e999dc261b6cf0e6b89", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\ninput = sys.stdin.readline\n\n\ndef I():\n return int(eval(input()))\n\n\ndef MI():\n return list(map(int, input().split()))\n\n\ndef LI():\n return list(map(int, input().split()))\n\n\n\"\"\"\nコストが低い人が食べにくいものを食べる.\nコストが低い人を追い抜かすことはない,(追い抜かすなら入れ替えて良いから)\n\"\"\"\n\n\ndef main():\n mod = 10**9 + 7\n N, K = MI()\n A = LI()\n F = LI()\n F.sort()\n A.sort(reverse=True)\n if K >= sum(A):\n print((0))\n exit()\n\n def ch(x):\n # x秒でクリアできるか\n temp = 0 #  必要修行回数\n for i in range(N):\n af = A[i] * F[i]\n if af > x:\n add = (af - x + F[i] - 1) // F[i]\n temp += add\n return temp <= K\n\n ok = 10**12\n ng = 0\n while ok - ng > 1:\n med = (ok + ng) // 2\n if ch(med):\n ok = med\n else:\n ng = med\n print(ok)\n\n\nmain()\n", "measured_fast_code_sha256": "51bcece72f749af885eefd7d6bbc0126e5766afde8b11e999dc261b6cf0e6b89", "measured_slow_code": "# -*- coding: utf-8 -*-\nimport sys\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef list2d(a, b, c):\n return [[c] * b for i in range(a)]\n\n\ndef list3d(a, b, c, d):\n return [[[d] * c for j in range(b)] for i in range(a)]\n\n\ndef list4d(a, b, c, d, e):\n return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]\n\n\ndef ceil(x, y=1):\n return int(-(-x // y))\n\n\ndef INT():\n return int(eval(input()))\n\n\ndef MAP():\n return list(map(int, input().split()))\n\n\ndef LIST(N=None):\n return list(MAP()) if N is None else [INT() for i in range(N)]\n\n\ndef Yes():\n print(\"Yes\")\n\n\ndef No():\n print(\"No\")\n\n\ndef YES():\n print(\"YES\")\n\n\ndef NO():\n print(\"NO\")\n\n\nsys.setrecursionlimit(10**7)\nINF = 10**18\nMOD = 10**9 + 7\n\n\ndef bisearch_min(mn, mx, func):\n \"\"\"条件を満たす最小値を見つける二分探索\"\"\"\n ok = mx\n ng = mn\n while ng + 1 < ok:\n mid = (ok + ng) // 2\n if func(mid):\n # 下を探しに行く\n ok = mid\n else:\n # 上を探しに行く\n ng = mid\n return ok\n\n\nN, K = MAP()\nA = LIST()\nB = LIST()\nA.sort(reverse=True)\nB.sort()\n\n\ndef check(m):\n k = 0\n for i, a in enumerate(A):\n b = B[i]\n k += max(ceil(a - m / b), 0)\n if k > K:\n return False\n return True\n\n\nprint((bisearch_min(-1, 10**12, check)))\n", "measured_slow_code_sha256": "4f4a13e5333f347bf2d2991652e312f399d355fb41776c7913ab6a96ff5161f3", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.482998922215207, "pair_id": "python_v2_c3c27166223223a6b6071a06", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02883", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02883_51bcece72f749af885eefd7d6bbc0126e5766afde8b11e999dc261b6cf0e6b89.jsonl.gz", "inputs": "reproduction/python/inputs/p02883.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02883_4f4a13e5333f347bf2d2991652e312f399d355fb41776c7913ab6a96ff5161f3.jsonl.gz"}, "slow_code": "import sys\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef list2d(a, b, c):\n return [[c] * b for i in range(a)]\n\n\ndef list3d(a, b, c, d):\n return [[[d] * c for j in range(b)] for i in range(a)]\n\n\ndef list4d(a, b, c, d, e):\n return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]\n\n\ndef ceil(x, y=1):\n return int(-(-x // y))\n\n\ndef INT():\n return int(eval(input()))\n\n\ndef MAP():\n return list(map(int, input().split()))\n\n\ndef LIST(N=None):\n return list(MAP()) if N is None else [INT() for i in range(N)]\n\n\ndef Yes():\n print(\"Yes\")\n\n\ndef No():\n print(\"No\")\n\n\ndef YES():\n print(\"YES\")\n\n\ndef NO():\n print(\"NO\")\n\n\nsys.setrecursionlimit(10**7)\nINF = 10**18\nMOD = 10**9 + 7\n\n\ndef bisearch_min(mn, mx, func):\n ok = mx\n ng = mn\n while ng + 1 < ok:\n mid = (ok + ng) // 2\n if func(mid):\n\n ok = mid\n else:\n\n ng = mid\n return ok\n\n\nN, K = MAP()\nA = LIST()\nB = LIST()\nA.sort(reverse=True)\nB.sort()\n\n\ndef check(m):\n k = 0\n for i, a in enumerate(A):\n b = B[i]\n k += max(ceil(a - m / b), 0)\n if k > K:\n return False\n return True\n\n\nprint((bisearch_min(-1, 10**12, check)))\n", "slow_code_sha256": "3224e00a1ef11e1951254ca5848501fa156f61f500db82b6b9576730d7e3e2af", "slow_id": "p02883_4f4a13e5333f347bf2d2991652e312f399d355fb41776c7913ab6a96ff5161f3", "speedup": 3.8759325784899907, "stratum": "2-4", "within_pair_jaccard": 0.39325842696629215, "workload": {"case_count": 100, "description": "Assign N people bijectively to N foods to minimize the longest finishing time. Person i has coefficient A_i; food j takes A_i*F_j time. At most K training steps may each reduce a coefficient by 1, never below zero. Observed inputs: N=1..200000 (median 10); K=0..1000000000000000000; A_i=1..1000000; F_i=1..1000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 3200027, "median": 147.0, "min": 8}, "input_format": ["N K\nA_1 ... A_N\nF_1 ... F_N"], "input_format_status": "source_input_section", "input_lines": {"max": 3, "median": 3.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 400002, "median": 22.0, "min": 4}}} -{"case_ids": ["p02703_case_000", "p02703_case_001", "p02703_case_002", "p02703_case_003", "p02703_case_004", "p02703_case_005", "p02703_case_006", "p02703_case_007", "p02703_case_008", "p02703_case_009", "p02703_case_010", "p02703_case_011", "p02703_case_012", "p02703_case_013", "p02703_case_014", "p02703_case_015", "p02703_case_016", "p02703_case_017", "p02703_case_018", "p02703_case_019", "p02703_case_020", "p02703_case_021", "p02703_case_022", "p02703_case_023", "p02703_case_024", "p02703_case_025", "p02703_case_026", "p02703_case_027", "p02703_case_028", "p02703_case_029", "p02703_case_030", "p02703_case_031", "p02703_case_032", "p02703_case_033", "p02703_case_034", "p02703_case_035", "p02703_case_036", "p02703_case_037", "p02703_case_038", "p02703_case_039", "p02703_case_040", "p02703_case_041", "p02703_case_042", "p02703_case_043", "p02703_case_044", "p02703_case_045", "p02703_case_046", "p02703_case_047", "p02703_case_048", "p02703_case_049", "p02703_case_050", "p02703_case_051", "p02703_case_052", "p02703_case_053", "p02703_case_054", "p02703_case_055", "p02703_case_056", "p02703_case_057", "p02703_case_058", "p02703_case_059", "p02703_case_060", "p02703_case_061", "p02703_case_062", "p02703_case_063", "p02703_case_064", "p02703_case_065", "p02703_case_066", "p02703_case_067", "p02703_case_068", "p02703_case_069", "p02703_case_070", "p02703_case_071", "p02703_case_072", "p02703_case_073", "p02703_case_074", "p02703_case_075", "p02703_case_076", "p02703_case_077", "p02703_case_078", "p02703_case_079", "p02703_case_080", "p02703_case_081", "p02703_case_082", "p02703_case_083", "p02703_case_084", "p02703_case_085", "p02703_case_086", "p02703_case_087", "p02703_case_088", "p02703_case_089", "p02703_case_090", "p02703_case_091", "p02703_case_092", "p02703_case_093", "p02703_case_094", "p02703_case_095", "p02703_case_096", "p02703_case_097", "p02703_case_098", "p02703_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "executable_AST_equal_except_explicit_explanatory_string_removal_and_all_frozen_inputs_checker_pass", "fast_code": "from heapq import heappush, heappop\n\nN, M, S = list(map(int, input().split()))\nmxCost = 0\nedges = [[] for _ in range(N)]\nfor _ in range(M):\n fr, to, cost, dist = list(map(int, input().split()))\n mxCost = max(mxCost, cost)\n fr -= 1\n to -= 1\n edges[fr].append((to, dist, cost))\n edges[to].append((fr, dist, cost))\nfor i in range(N):\n C, D = list(map(int, input().split()))\n edges[i].append((i, D, -C))\nque = [(0, S, 0)]\nmxCost *= N - 1\nminDsit = [[10**18] * (mxCost + 1) for _ in range(N)]\nminDsit[0][0] = 0\nwhile que:\n dist, s, now = heappop(que)\n for to, d, c in edges[now]:\n cost = min(mxCost, s - c)\n if cost < 0 or minDsit[to][cost] <= dist + d:\n continue\n minDsit[to][cost] = dist + d\n heappush(que, (dist + d, cost, to))\nfor dist in minDsit[1:]:\n print((min(dist)))\n", "fast_code_sha256": "2ce60f1a1408c3c92e7f5201027a60a54ca6f2defd056d05b14b5e80301f91f7", "fast_id": "p02703_2ce60f1a1408c3c92e7f5201027a60a54ca6f2defd056d05b14b5e80301f91f7", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from heapq import heappush, heappop\n\nN, M, S = list(map(int, input().split()))\nmxCost = 0\nedges = [[] for _ in range(N)]\nfor _ in range(M):\n fr, to, cost, dist = list(map(int, input().split()))\n mxCost = max(mxCost, cost)\n fr -= 1\n to -= 1\n edges[fr].append((to, dist, cost))\n edges[to].append((fr, dist, cost))\nfor i in range(N):\n C, D = list(map(int, input().split()))\n edges[i].append((i, D, -C))\nque = [(0, S, 0)]\nmxCost *= N - 1\nminDsit = [[10**18] * (mxCost + 1) for _ in range(N)]\nminDsit[0][0] = 0\nwhile que:\n dist, s, now = heappop(que)\n for to, d, c in edges[now]:\n cost = min(mxCost, s - c)\n if cost < 0 or minDsit[to][cost] <= dist + d:\n continue\n minDsit[to][cost] = dist + d\n heappush(que, (dist + d, cost, to))\nfor dist in minDsit[1:]:\n print((min(dist)))\n", "measured_fast_code_sha256": "2ce60f1a1408c3c92e7f5201027a60a54ca6f2defd056d05b14b5e80301f91f7", "measured_slow_code": "class Dijkstra:\n \"\"\"ダイクストラ法\n 重み付きグラフにおける単一始点最短路アルゴリズム\n * 使用条件\n - 負のコストがないこと\n - 有向グラフ、無向グラフともにOK\n * 計算量はO(E*log(V))\n * ベルマンフォード法より高速なので、負のコストがないならばこちらを使うとよい\n \"\"\"\n\n class Edge:\n \"\"\"重み付き有向辺\"\"\"\n\n def __init__(self, _to, _cost):\n self.to = _to\n self.cost = _cost\n\n def __init__(self, V):\n \"\"\"重み付き有向辺\n 無向辺を表現したいときは、_fromと_toを逆にした有向辺を加えればよい\n Args:\n V(int): 頂点の数\n \"\"\"\n self.G = [[] for i in range(V)] # 隣接リストG[u][i] := 頂点uのi個目の隣接辺\n self._E = 0 # 辺の数\n self._V = V # 頂点の数\n\n @property\n def E(self):\n \"\"\"辺数\n 無向グラフのときは、辺数は有向グラフの倍になる\n \"\"\"\n return self._E\n\n @property\n def V(self):\n \"\"\"頂点数\"\"\"\n return self._V\n\n def add(self, _from, _to, _cost):\n \"\"\"2頂点と、辺のコストを追加する\"\"\"\n self.G[_from].append(self.Edge(_to, _cost))\n self._E += 1\n\n def shortest_path(self, s):\n \"\"\"始点sから頂点iまでの最短路を格納したリストを返す\n Args:\n s(int): 始点s\n Returns:\n d(list): d[i] := 始点sから頂点iまでの最短コストを格納したリスト。\n 到達不可の場合、値はfloat(\"inf\")\n \"\"\"\n import heapq\n\n que = [] # プライオリティキュー(ヒープ木)\n d = [float(\"inf\")] * self.V\n d[s] = 0\n heapq.heappush(que, (0, s)) # 始点の(最短距離, 頂点番号)をヒープに追加する\n while len(que) != 0:\n cost, v = heapq.heappop(que)\n # キューに格納されている最短経路の候補がdの距離よりも大きければ、他の経路で最短経路が存在するので、処理をスキップ\n if d[v] < cost:\n continue\n for i in range(len(self.G[v])):\n # 頂点vに隣接する各頂点に関して、頂点vを経由した場合の距離を計算し、今までの距離(d)よりも小さければ更新する\n e = self.G[v][i] # vのi個目の隣接辺e\n if d[e.to] > d[v] + e.cost:\n d[e.to] = d[v] + e.cost # dの更新\n heapq.heappush(\n que, (d[e.to], e.to)\n ) # キューに新たな最短経路の候補(最短距離, 頂点番号)の情報をpush\n return d\n\n\nN, M, S = list(map(int, input().split()))\npro = Dijkstra(N * (50 * (N - 1) + 1))\nfor i in range(0, M):\n u, v, a, b = list(map(int, input().split()))\n for j in range(a, 50 * (N - 1) + 1):\n pro.add(N * j + u - 1, N * (j - a) + v - 1, b)\n pro.add(N * j + v - 1, N * (j - a) + u - 1, b)\nfor i in range(0, N):\n c, d = list(map(int, input().split()))\n for j in range(0, 50 * (N - 1)):\n to = min(50 * (N - 1), j + c)\n pro.add(N * j + i, N * to + i, d)\nS = min(50 * (N - 1), S)\nans = pro.shortest_path(N * S)\nfor i in range(1, N):\n p = float(\"inf\")\n for j in range(0, 50 * (N - 1) + 1):\n p = min(p, ans[N * j + i])\n print(p)\n", "measured_slow_code_sha256": "90be895b60848d0137d21c0628afac2da1af1edd13c122290ee2e39bc535083d", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.1546207763254537, "pair_id": "python_v2_673e2bb78de77d67b153ebfc", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02703", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02703_2ce60f1a1408c3c92e7f5201027a60a54ca6f2defd056d05b14b5e80301f91f7.jsonl.gz", "inputs": "reproduction/python/inputs/p02703.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02703_90be895b60848d0137d21c0628afac2da1af1edd13c122290ee2e39bc535083d.jsonl.gz"}, "slow_code": "class Dijkstra:\n\n class Edge:\n\n def __init__(self, _to, _cost):\n self.to = _to\n self.cost = _cost\n\n def __init__(self, V):\n self.G = [[] for i in range(V)]\n self._E = 0\n self._V = V\n\n @property\n def E(self):\n return self._E\n\n @property\n def V(self):\n return self._V\n\n def add(self, _from, _to, _cost):\n self.G[_from].append(self.Edge(_to, _cost))\n self._E += 1\n\n def shortest_path(self, s):\n import heapq\n\n que = []\n d = [float(\"inf\")] * self.V\n d[s] = 0\n heapq.heappush(que, (0, s))\n while len(que) != 0:\n cost, v = heapq.heappop(que)\n\n if d[v] < cost:\n continue\n for i in range(len(self.G[v])):\n\n e = self.G[v][i]\n if d[e.to] > d[v] + e.cost:\n d[e.to] = d[v] + e.cost\n heapq.heappush(que, (d[e.to], e.to))\n return d\n\n\nN, M, S = list(map(int, input().split()))\npro = Dijkstra(N * (50 * (N - 1) + 1))\nfor i in range(0, M):\n u, v, a, b = list(map(int, input().split()))\n for j in range(a, 50 * (N - 1) + 1):\n pro.add(N * j + u - 1, N * (j - a) + v - 1, b)\n pro.add(N * j + v - 1, N * (j - a) + u - 1, b)\nfor i in range(0, N):\n c, d = list(map(int, input().split()))\n for j in range(0, 50 * (N - 1)):\n to = min(50 * (N - 1), j + c)\n pro.add(N * j + i, N * to + i, d)\nS = min(50 * (N - 1), S)\nans = pro.shortest_path(N * S)\nfor i in range(1, N):\n p = float(\"inf\")\n for j in range(0, 50 * (N - 1) + 1):\n p = min(p, ans[N * j + i])\n print(p)\n", "slow_code_sha256": "37319076c3b5100beb96d2f9c428eac7654c186db18fd46b9d512ca816af7955", "slow_id": "p02703_90be895b60848d0137d21c0628afac2da1af1edd13c122290ee2e39bc535083d", "speedup": 3.774432304322024, "stratum": "2-4", "within_pair_jaccard": 0.29411764705882354, "workload": {"case_count": 100, "description": "Find minimum travel time from city 1 to every other city in a connected undirected graph. Start with S silver and 10^100 gold coins. Edge i costs A_i silver and B_i minutes; in city i, each gold exchanges for C_i silver in D_i minutes. Observed inputs: N=2..50 (median 50); M=1..100 (median 100); S=0..1000000000 (median 0); A_i=1..50; B_i=1..1000000000; C_i=1..1000000000; D_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 2839, "median": 1347.5, "min": 31}, "input_format": ["N M S\nU_1 V_1 A_1 B_1\n...\nU_M V_M A_M B_M\nC_1 D_1\n...\nC_N D_N"], "input_format_status": "source_input_section", "input_lines": {"max": 151, "median": 151.0, "min": 4}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 503, "median": 503.0, "min": 11}}} -{"case_ids": ["p03338_case_000", "p03338_case_001", "p03338_case_002", "p03338_case_003", "p03338_case_004", "p03338_case_005", "p03338_case_006", "p03338_case_007", "p03338_case_008", "p03338_case_009", "p03338_case_010", "p03338_case_011", "p03338_case_012", "p03338_case_013", "p03338_case_014", "p03338_case_015", "p03338_case_016", "p03338_case_017", "p03338_case_018", "p03338_case_019", "p03338_case_020", "p03338_case_021", "p03338_case_022", "p03338_case_023", "p03338_case_024", "p03338_case_025", "p03338_case_026", "p03338_case_027", "p03338_case_028", "p03338_case_029", "p03338_case_030", "p03338_case_031", "p03338_case_032", "p03338_case_033", "p03338_case_034", "p03338_case_035", "p03338_case_036", "p03338_case_037", "p03338_case_038", "p03338_case_039", "p03338_case_040", "p03338_case_041", "p03338_case_042", "p03338_case_043", "p03338_case_044", "p03338_case_045", "p03338_case_046", "p03338_case_047", "p03338_case_048", "p03338_case_049", "p03338_case_050", "p03338_case_051", "p03338_case_052", "p03338_case_053", "p03338_case_054", "p03338_case_055", "p03338_case_056", "p03338_case_057", "p03338_case_058", "p03338_case_059", "p03338_case_060", "p03338_case_061", "p03338_case_062", "p03338_case_063", "p03338_case_064", "p03338_case_065", "p03338_case_066", "p03338_case_067", "p03338_case_068", "p03338_case_069", "p03338_case_070", "p03338_case_071", "p03338_case_072", "p03338_case_073", "p03338_case_074", "p03338_case_075", "p03338_case_076", "p03338_case_077", "p03338_case_078", "p03338_case_079", "p03338_case_080", "p03338_case_081", "p03338_case_082", "p03338_case_083", "p03338_case_084", "p03338_case_085", "p03338_case_086", "p03338_case_087", "p03338_case_088", "p03338_case_089", "p03338_case_090", "p03338_case_091", "p03338_case_092", "p03338_case_093", "p03338_case_094", "p03338_case_095", "p03338_case_096", "p03338_case_097", "p03338_case_098", "p03338_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\n\ndef S():\n return sys.stdin.readline().rstrip()\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\nN = I()\nS = S()\nans = 0\nfor i in range(N):\n ans = max(ans, len(set(S[:i]) & set(S[i:])))\nprint(ans)\n", "fast_code_sha256": "382ed3d45f12465a007213238f4c0fff50ec69c1a79c165d4d981342f3cd87cf", "fast_id": "p03338_382ed3d45f12465a007213238f4c0fff50ec69c1a79c165d4d981342f3cd87cf", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\n\ndef S():\n return sys.stdin.readline().rstrip()\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\nN = I()\nS = S()\nans = 0\nfor i in range(N):\n ans = max(ans, len(set(S[:i]) & set(S[i:])))\nprint(ans)\n", "measured_fast_code_sha256": "382ed3d45f12465a007213238f4c0fff50ec69c1a79c165d4d981342f3cd87cf", "measured_slow_code": "import collections, sys\n\n\ndef S():\n return sys.stdin.readline().rstrip()\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\nN = I()\nS = S()\nans = 0\nfor i in range(N):\n set_top = set()\n set_bottom = set()\n for s in collections.Counter(S[:i]):\n set_top.add(s)\n for s in collections.Counter(S[i:]):\n set_bottom.add(s)\n ans = max(ans, len(set_top & set_bottom))\nprint(ans)\n", "measured_slow_code_sha256": "b26d7b127a5d896b500dc03a2fa751edc6fb5a11d0b4f6e5d93621ef3ac81957", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.9881131536569039, "pair_id": "python_v2_335ee76dfadbb653cc1f919a", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03338", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03338_382ed3d45f12465a007213238f4c0fff50ec69c1a79c165d4d981342f3cd87cf.jsonl.gz", "inputs": "reproduction/python/inputs/p03338.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03338_b26d7b127a5d896b500dc03a2fa751edc6fb5a11d0b4f6e5d93621ef3ac81957.jsonl.gz"}, "slow_code": "import collections, sys\n\n\ndef S():\n return sys.stdin.readline().rstrip()\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\nN = I()\nS = S()\nans = 0\nfor i in range(N):\n set_top = set()\n set_bottom = set()\n for s in collections.Counter(S[:i]):\n set_top.add(s)\n for s in collections.Counter(S[i:]):\n set_bottom.add(s)\n ans = max(ans, len(set_top & set_bottom))\nprint(ans)\n", "slow_code_sha256": "b26d7b127a5d896b500dc03a2fa751edc6fb5a11d0b4f6e5d93621ef3ac81957", "slow_id": "p03338_b26d7b127a5d896b500dc03a2fa751edc6fb5a11d0b4f6e5d93621ef3ac81957", "speedup": 2.387966204869661, "stratum": "2-4", "within_pair_jaccard": 0.7777777777777778, "workload": {"case_count": 100, "description": "Cut lowercase string S into two nonempty contiguous parts. Maximize the number of distinct letters occurring in both parts. Observed inputs: N=2..100 (median 10); distinct_characters=1..26.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 105, "median": 14.0, "min": 5}, "input_format": ["N\nS"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p04006_case_000", "p04006_case_001", "p04006_case_002", "p04006_case_003", "p04006_case_004", "p04006_case_005", "p04006_case_006", "p04006_case_007", "p04006_case_008", "p04006_case_009", "p04006_case_010", "p04006_case_011", "p04006_case_012", "p04006_case_013", "p04006_case_014", "p04006_case_015", "p04006_case_016", "p04006_case_017", "p04006_case_018", "p04006_case_019", "p04006_case_020", "p04006_case_021", "p04006_case_022", "p04006_case_023", "p04006_case_024", "p04006_case_025", "p04006_case_026", "p04006_case_027", "p04006_case_028", "p04006_case_029", "p04006_case_030", "p04006_case_031", "p04006_case_032", "p04006_case_033", "p04006_case_034", "p04006_case_035", "p04006_case_036", "p04006_case_037", "p04006_case_038", "p04006_case_039", "p04006_case_040", "p04006_case_041", "p04006_case_042", "p04006_case_043", "p04006_case_044", "p04006_case_045", "p04006_case_046", "p04006_case_047", "p04006_case_048", "p04006_case_049", "p04006_case_050", "p04006_case_051", "p04006_case_052", "p04006_case_053", "p04006_case_054", "p04006_case_055", "p04006_case_056", "p04006_case_057", "p04006_case_058", "p04006_case_059", "p04006_case_060", "p04006_case_061", "p04006_case_062", "p04006_case_063", "p04006_case_064", "p04006_case_065", "p04006_case_066", "p04006_case_067", "p04006_case_068", "p04006_case_069", "p04006_case_070", "p04006_case_071", "p04006_case_072", "p04006_case_073", "p04006_case_074", "p04006_case_075", "p04006_case_076", "p04006_case_077", "p04006_case_078", "p04006_case_079", "p04006_case_080", "p04006_case_081", "p04006_case_082", "p04006_case_083", "p04006_case_084", "p04006_case_085", "p04006_case_086", "p04006_case_087", "p04006_case_088", "p04006_case_089", "p04006_case_090", "p04006_case_091", "p04006_case_092", "p04006_case_093", "p04006_case_094", "p04006_case_095", "p04006_case_096", "p04006_case_097", "p04006_case_098"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 99, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "INF = float(\"inf\")\n\n\ndef inpl():\n return list(map(int, input().split()))\n\n\nN, x = inpl()\nA = inpl()\nmin_index = A.index(min(A))\nB = A[min_index:] + A[:min_index]\ncost = [B[i] for i in range(N)]\nans = INF\nfor magic in range(N):\n for i in range(N):\n if i - magic >= 0:\n cost[i] = min(cost[i], B[i - magic])\n ans = min(ans, sum(cost) + x * magic)\nprint(ans)\n", "fast_code_sha256": "4a798b567cb7464d18e631b741220f560396034578eb820d867a055704647824", "fast_id": "p04006_e55d9b31eb97cbd03a1ce62e98c25c8d9371a9879b0875d685634b1c273bc7bf", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "# coding:utf-8\nINF = float(\"inf\")\n\n\ndef inpl():\n return list(map(int, input().split()))\n\n\nN, x = inpl()\nA = inpl()\nmin_index = A.index(min(A))\nB = A[min_index:] + A[:min_index]\ncost = [B[i] for i in range(N)]\nans = INF\nfor magic in range(N):\n for i in range(N):\n if i - magic >= 0:\n cost[i] = min(cost[i], B[i - magic])\n ans = min(ans, sum(cost) + x * magic)\nprint(ans)\n", "measured_fast_code_sha256": "e55d9b31eb97cbd03a1ce62e98c25c8d9371a9879b0875d685634b1c273bc7bf", "measured_slow_code": "import numpy as np\nfrom copy import deepcopy\n\nN, x = list(map(int, input().split()))\nA = list(map(int, input().split()))\n\n\ndef myfunc(N, x, A):\n B = deepcopy(np.array(A))\n m = sum(B)\n\n def apppop(A):\n A.append(A[0])\n A.pop(0)\n\n for idx in range(1, N):\n apppop(A)\n np.fmin(B, A, out=B)\n m = min(np.sum(B) + idx * x, m)\n print(int(m))\n\n\nmyfunc(N, x, A)\n", "measured_slow_code_sha256": "91e1e2c740659f8110b6da7065d298174d653edb3135242031e3d37884d00c98", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 0.4962138942169415, "pair_id": "python_v2_646c16b9f6b2138a1482bfd6", "per_case_slow_code_faster_fraction": 0.5555555555555556, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p04006", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p04006_e55d9b31eb97cbd03a1ce62e98c25c8d9371a9879b0875d685634b1c273bc7bf.jsonl.gz", "inputs": "reproduction/python/inputs/p04006.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p04006_91e1e2c740659f8110b6da7065d298174d653edb3135242031e3d37884d00c98.jsonl.gz"}, "slow_code": "import numpy as np\nfrom copy import deepcopy\n\nN, x = list(map(int, input().split()))\nA = list(map(int, input().split()))\n\n\ndef myfunc(N, x, A):\n B = deepcopy(np.array(A))\n m = sum(B)\n\n def apppop(A):\n A.append(A[0])\n A.pop(0)\n\n for idx in range(1, N):\n apppop(A)\n np.fmin(B, A, out=B)\n m = min(np.sum(B) + idx * x, m)\n print(int(m))\n\n\nmyfunc(N, x, A)\n", "slow_code_sha256": "91e1e2c740659f8110b6da7065d298174d653edb3135242031e3d37884d00c98", "slow_id": "p04006_91e1e2c740659f8110b6da7065d298174d653edb3135242031e3d37884d00c98", "speedup": 5.044347033393569, "stratum": "4-8", "within_pair_jaccard": 0.3695652173913043, "workload": {"case_count": 99, "description": "Starting with no slimes, acquire all N colors. Catching a missing color i costs a_i time; a spell costs x and rotates every held color i to i+1, wrapping N to 1. Minimize total time. Observed inputs: N=2..2000 (median 1000); x=1..1000000000; a_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 99, "input_bytes": {"max": 20015, "median": 5795, "min": 10}, "input_format": ["N x\na_1 ... a_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2002, "median": 1002, "min": 4}}} -{"case_ids": ["p04015_case_000", "p04015_case_001", "p04015_case_002", "p04015_case_003", "p04015_case_004", "p04015_case_005", "p04015_case_006", "p04015_case_007", "p04015_case_008", "p04015_case_009", "p04015_case_010", "p04015_case_011", "p04015_case_012", "p04015_case_013", "p04015_case_014", "p04015_case_015", "p04015_case_016", "p04015_case_017", "p04015_case_018", "p04015_case_019", "p04015_case_020", "p04015_case_021", "p04015_case_022", "p04015_case_023", "p04015_case_024", "p04015_case_025", "p04015_case_026", "p04015_case_028", "p04015_case_029", "p04015_case_030", "p04015_case_031", "p04015_case_032", "p04015_case_033", "p04015_case_034", "p04015_case_035", "p04015_case_036", "p04015_case_037", "p04015_case_038", "p04015_case_039", "p04015_case_040", "p04015_case_041", "p04015_case_042", "p04015_case_043", "p04015_case_044", "p04015_case_045", "p04015_case_046", "p04015_case_047", "p04015_case_048", "p04015_case_049", "p04015_case_050", "p04015_case_051", "p04015_case_052", "p04015_case_053", "p04015_case_054", "p04015_case_055", "p04015_case_056", "p04015_case_057", "p04015_case_058", "p04015_case_059", "p04015_case_060", "p04015_case_061", "p04015_case_062", "p04015_case_063", "p04015_case_064", "p04015_case_065", "p04015_case_067", "p04015_case_068", "p04015_case_069", "p04015_case_070", "p04015_case_071", "p04015_case_072", "p04015_case_073", "p04015_case_074", "p04015_case_075", "p04015_case_077", "p04015_case_078", "p04015_case_079", "p04015_case_080", "p04015_case_081", "p04015_case_082", "p04015_case_083", "p04015_case_086", "p04015_case_087", "p04015_case_088", "p04015_case_089", "p04015_case_090", "p04015_case_091", "p04015_case_092", "p04015_case_093", "p04015_case_094", "p04015_case_095", "p04015_case_096", "p04015_case_097", "p04015_case_098", "p04015_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 95, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def main():\n n, a = list(map(int, input().split()))\n y = [a - int(x) for x in input().split()]\n dp = {0: 1}\n for i in y:\n for k, v in list(dp.items()):\n dp[i + k] = dp.get(i + k, 0) + v\n print((dp[0] - 1))\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "fc52a2e3dfa07f962b0b70fd8e131d966dd451761f03ab67cc8681ac9693ce11", "fast_id": "p04015_fc52a2e3dfa07f962b0b70fd8e131d966dd451761f03ab67cc8681ac9693ce11", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def main():\n n, a = list(map(int, input().split()))\n y = [a - int(x) for x in input().split()]\n dp = {0: 1}\n for i in y:\n for k, v in list(dp.items()):\n dp[i + k] = dp.get(i + k, 0) + v\n print((dp[0] - 1))\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "fc52a2e3dfa07f962b0b70fd8e131d966dd451761f03ab67cc8681ac9693ce11", "measured_slow_code": "#!usr/bin/env python3\nfrom collections import defaultdict, deque, Counter, OrderedDict\nfrom bisect import bisect_left, bisect_right\nfrom functools import reduce, lru_cache\nfrom heapq import heappush, heappop, heapify\nimport itertools\nimport math, fractions\nimport sys, copy\n\n\ndef L():\n return sys.stdin.readline().split()\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\ndef SL():\n return list(sys.stdin.readline().rstrip())\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef LI1():\n return [int(x) - 1 for x in sys.stdin.readline().split()]\n\n\ndef LS():\n return [list(x) for x in sys.stdin.readline().split()]\n\n\ndef R(n):\n return [sys.stdin.readline().strip() for _ in range(n)]\n\n\ndef LR(n):\n return [L() for _ in range(n)]\n\n\ndef IR(n):\n return [I() for _ in range(n)]\n\n\ndef LIR(n):\n return [LI() for _ in range(n)]\n\n\ndef LIR1(n):\n return [LI1() for _ in range(n)]\n\n\ndef SLR(n):\n return [SL() for _ in range(n)]\n\n\ndef LSR(n):\n return [LS() for _ in range(n)]\n\n\ndef perm(n, r):\n return math.factorial(n) // math.factorial(r)\n\n\ndef comb(n, r):\n return math.factorial(n) // (math.factorial(r) * math.factorial(n - r))\n\n\ndef make_list(n, *args, default=0):\n return (\n [make_list(*args, default=default) for _ in range(n)]\n if args\n else [default for _ in range(n)]\n )\n\n\ndire = [[1, 0], [0, 1], [-1, 0], [0, -1]]\ndire8 = [[1, 0], [1, 1], [0, 1], [-1, 1], [-1, 0], [-1, -1], [0, -1], [1, -1]]\nalphabets = \"abcdefghijklmnopqrstuvwxyz\"\nALPHABETS = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\nMOD = 1000000007\nINF = float(\"inf\")\nsys.setrecursionlimit(1000000)\n\n\ndef main():\n N, A = LI()\n X = LI()\n dp = make_list(N + 1, N + 1, 2501)\n dp[0][0][0] = 1\n for i in range(1, N + 1):\n for k in range(i + 1):\n for s in range(2501):\n if X[i - 1] > s:\n dp[i][k][s] = dp[i - 1][k][s]\n else:\n dp[i][k][s] = dp[i - 1][k][s] + dp[i - 1][k - 1][s - X[i - 1]]\n print((sum(dp[N][k][k * A] for k in range(1, N + 1))))\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "8b45717994a5fb48dc2b76199b10d5e4e202c9ce5463bf7869f8add9172f6ff7", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 363.2498379627075, "pair_id": "python_v2_64f6abcdbb1ce73a8d92b659", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p04015", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p04015_fc52a2e3dfa07f962b0b70fd8e131d966dd451761f03ab67cc8681ac9693ce11.jsonl.gz", "inputs": "reproduction/python/inputs/p04015.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p04015_8b45717994a5fb48dc2b76199b10d5e4e202c9ce5463bf7869f8add9172f6ff7.jsonl.gz"}, "slow_code": "from collections import defaultdict, deque, Counter, OrderedDict\nfrom bisect import bisect_left, bisect_right\nfrom functools import reduce, lru_cache\nfrom heapq import heappush, heappop, heapify\nimport itertools\nimport math, fractions\nimport sys, copy\n\n\ndef L():\n return sys.stdin.readline().split()\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\ndef SL():\n return list(sys.stdin.readline().rstrip())\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef LI1():\n return [int(x) - 1 for x in sys.stdin.readline().split()]\n\n\ndef LS():\n return [list(x) for x in sys.stdin.readline().split()]\n\n\ndef R(n):\n return [sys.stdin.readline().strip() for _ in range(n)]\n\n\ndef LR(n):\n return [L() for _ in range(n)]\n\n\ndef IR(n):\n return [I() for _ in range(n)]\n\n\ndef LIR(n):\n return [LI() for _ in range(n)]\n\n\ndef LIR1(n):\n return [LI1() for _ in range(n)]\n\n\ndef SLR(n):\n return [SL() for _ in range(n)]\n\n\ndef LSR(n):\n return [LS() for _ in range(n)]\n\n\ndef perm(n, r):\n return math.factorial(n) // math.factorial(r)\n\n\ndef comb(n, r):\n return math.factorial(n) // (math.factorial(r) * math.factorial(n - r))\n\n\ndef make_list(n, *args, default=0):\n return (\n [make_list(*args, default=default) for _ in range(n)]\n if args\n else [default for _ in range(n)]\n )\n\n\ndire = [[1, 0], [0, 1], [-1, 0], [0, -1]]\ndire8 = [[1, 0], [1, 1], [0, 1], [-1, 1], [-1, 0], [-1, -1], [0, -1], [1, -1]]\nalphabets = \"abcdefghijklmnopqrstuvwxyz\"\nALPHABETS = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\nMOD = 1000000007\nINF = float(\"inf\")\nsys.setrecursionlimit(1000000)\n\n\ndef main():\n N, A = LI()\n X = LI()\n dp = make_list(N + 1, N + 1, 2501)\n dp[0][0][0] = 1\n for i in range(1, N + 1):\n for k in range(i + 1):\n for s in range(2501):\n if X[i - 1] > s:\n dp[i][k][s] = dp[i - 1][k][s]\n else:\n dp[i][k][s] = dp[i - 1][k][s] + dp[i - 1][k - 1][s - X[i - 1]]\n print((sum(dp[N][k][k * A] for k in range(1, N + 1))))\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "22f4d78fa24186375c05f8fb9209c535a507fc44a1c54caed7cae5ab1b3bfa98", "slow_id": "p04015_8b45717994a5fb48dc2b76199b10d5e4e202c9ce5463bf7869f8add9172f6ff7", "speedup": 585.377074728542, "stratum": "8+", "within_pair_jaccard": 0.19148936170212766, "workload": {"case_count": 95, "description": "Count nonempty subsets of N indexed cards whose values x_i have arithmetic mean exactly A. Cards with equal values but different indices are distinct choices. Observed inputs: N=1..50 (median 50); A=1..50 (median 25); x_i=1..50.", "description_revision": "semantic-review-20261020", "distinct_input_count": 95, "input_bytes": {"max": 156, "median": 105, "min": 6}, "input_format": ["N A\nx_1 ... x_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 52, "median": 52, "min": 3}}} -{"case_ids": ["p03738_case_000", "p03738_case_001", "p03738_case_002", "p03738_case_003", "p03738_case_004", "p03738_case_005", "p03738_case_006", "p03738_case_007", "p03738_case_008", "p03738_case_009", "p03738_case_010", "p03738_case_011", "p03738_case_012", "p03738_case_013", "p03738_case_014", "p03738_case_015", "p03738_case_016", "p03738_case_017", "p03738_case_018", "p03738_case_019", "p03738_case_020", "p03738_case_021", "p03738_case_022", "p03738_case_023", "p03738_case_024", "p03738_case_025", "p03738_case_026", "p03738_case_027", "p03738_case_028", "p03738_case_029", "p03738_case_030", "p03738_case_031", "p03738_case_032", "p03738_case_033", "p03738_case_034", "p03738_case_035", "p03738_case_036", "p03738_case_037", "p03738_case_038", "p03738_case_039", "p03738_case_040", "p03738_case_041", "p03738_case_042", "p03738_case_043", "p03738_case_044", "p03738_case_045", "p03738_case_046", "p03738_case_047", "p03738_case_048", "p03738_case_049", "p03738_case_050", "p03738_case_051", "p03738_case_052", "p03738_case_053", "p03738_case_054", "p03738_case_055", "p03738_case_056", "p03738_case_057", "p03738_case_058", "p03738_case_059", "p03738_case_060", "p03738_case_061", "p03738_case_062", "p03738_case_063", "p03738_case_064", "p03738_case_065", "p03738_case_066", "p03738_case_067", "p03738_case_068", "p03738_case_069", "p03738_case_070", "p03738_case_071", "p03738_case_072", "p03738_case_073", "p03738_case_074", "p03738_case_075", "p03738_case_076", "p03738_case_077", "p03738_case_078", "p03738_case_079", "p03738_case_080", "p03738_case_081", "p03738_case_082", "p03738_case_083", "p03738_case_084", "p03738_case_085", "p03738_case_086", "p03738_case_087", "p03738_case_088", "p03738_case_089", "p03738_case_090", "p03738_case_091", "p03738_case_092", "p03738_case_093", "p03738_case_094", "p03738_case_095", "p03738_case_096", "p03738_case_097", "p03738_case_098", "p03738_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "a = int(eval(input())) - int(eval(input()))\nprint((a > 0 and \"GREATER\" or a < 0 and \"LESS\" or \"EQUAL\"))\n", "fast_code_sha256": "55544230816fd7d657cc5324cb41e22f86528020642dc127eaa0dd214065aa0b", "fast_id": "p03738_55544230816fd7d657cc5324cb41e22f86528020642dc127eaa0dd214065aa0b", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "a = int(eval(input())) - int(eval(input()))\nprint((a > 0 and \"GREATER\" or a < 0 and \"LESS\" or \"EQUAL\"))\n", "measured_fast_code_sha256": "55544230816fd7d657cc5324cb41e22f86528020642dc127eaa0dd214065aa0b", "measured_slow_code": "# coding:utf-8\nimport math\n\nif __name__ == \"__main__\":\n a = input()\n b = input()\n if len(a) > len(b):\n print(\"GREATER\")\n elif len(a) < len(b):\n print(\"LESS\")\n elif len(a) == len(b):\n for i in range(len(a)):\n if a[i] > b[i]:\n print(\"GREATER\")\n break\n elif a[i] < b[i]:\n print(\"LESS\")\n break\n elif a[i] == b[i] and i == len(a) - 1:\n print(\"EQUAL\")\n", "measured_slow_code_sha256": "d5baa6a15a1c4a76633ab38a051360a64a827577b6553480f73b85ef4ead3a15", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.3052169579544532, "pair_id": "python_v2_9d613de72341dc3fbf6b5531", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03738", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03738_55544230816fd7d657cc5324cb41e22f86528020642dc127eaa0dd214065aa0b.jsonl.gz", "inputs": "reproduction/python/inputs/p03738.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03738_d5baa6a15a1c4a76633ab38a051360a64a827577b6553480f73b85ef4ead3a15.jsonl.gz"}, "slow_code": "import math\n\nif __name__ == \"__main__\":\n a = input()\n b = input()\n if len(a) > len(b):\n print(\"GREATER\")\n elif len(a) < len(b):\n print(\"LESS\")\n elif len(a) == len(b):\n for i in range(len(a)):\n if a[i] > b[i]:\n print(\"GREATER\")\n break\n elif a[i] < b[i]:\n print(\"LESS\")\n break\n elif a[i] == b[i] and i == len(a) - 1:\n print(\"EQUAL\")\n", "slow_code_sha256": "51f72b7576f2a6693b915f49f43199e2cd6155a4ebab55cc493d3b8dd74e88d8", "slow_id": "p03738_d5baa6a15a1c4a76633ab38a051360a64a827577b6553480f73b85ef4ead3a15", "speedup": 2.3538042671304136, "stratum": "2-4", "within_pair_jaccard": 0.28, "workload": {"case_count": 100, "description": "Compare positive decimal integers A and B and report greater, less, or equal. Neither representation has leading zeros; numbers may exceed machine integer sizes. Observed inputs: A_digits=1..100 (median 7); B_digits=1..100 (median 7).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 202, "median": 18.0, "min": 4}, "input_format": ["A\nB"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p02724_case_000", "p02724_case_001", "p02724_case_002", "p02724_case_003", "p02724_case_004", "p02724_case_005", "p02724_case_006", "p02724_case_007", "p02724_case_008", "p02724_case_009", "p02724_case_010", "p02724_case_011", "p02724_case_012", "p02724_case_013", "p02724_case_014", "p02724_case_015", "p02724_case_016", "p02724_case_017", "p02724_case_018", "p02724_case_019", "p02724_case_020", "p02724_case_021", "p02724_case_022", "p02724_case_023", "p02724_case_024", "p02724_case_025", "p02724_case_026", "p02724_case_027", "p02724_case_028", "p02724_case_029", "p02724_case_030", "p02724_case_031", "p02724_case_032", "p02724_case_033", "p02724_case_034", "p02724_case_035", "p02724_case_036", "p02724_case_037", "p02724_case_038", "p02724_case_039", "p02724_case_040", "p02724_case_041", "p02724_case_042", "p02724_case_043", "p02724_case_044", "p02724_case_045", "p02724_case_046", "p02724_case_047", "p02724_case_048", "p02724_case_049", "p02724_case_050", "p02724_case_051", "p02724_case_052", "p02724_case_053", "p02724_case_054", "p02724_case_055", "p02724_case_056", "p02724_case_057", "p02724_case_058", "p02724_case_059", "p02724_case_060", "p02724_case_061", "p02724_case_062", "p02724_case_063", "p02724_case_064", "p02724_case_065", "p02724_case_066", "p02724_case_067", "p02724_case_068", "p02724_case_069", "p02724_case_070", "p02724_case_071", "p02724_case_072", "p02724_case_073", "p02724_case_074", "p02724_case_075", "p02724_case_076", "p02724_case_077", "p02724_case_078", "p02724_case_079", "p02724_case_080", "p02724_case_081", "p02724_case_082", "p02724_case_083", "p02724_case_084", "p02724_case_085", "p02724_case_086", "p02724_case_087", "p02724_case_088", "p02724_case_089", "p02724_case_090", "p02724_case_091", "p02724_case_092", "p02724_case_093", "p02724_case_094", "p02724_case_095", "p02724_case_096", "p02724_case_097", "p02724_case_098", "p02724_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "x = int(eval(input()))\nprint((1000 * (x // 500) + 5 * ((x // 5) % 100)))\n", "fast_code_sha256": "12a73a8acfa07f30639f186d47d681f3412c7c6de111ff783aa0e2c3ad3f87eb", "fast_id": "p02724_12a73a8acfa07f30639f186d47d681f3412c7c6de111ff783aa0e2c3ad3f87eb", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "x = int(eval(input()))\nprint((1000 * (x // 500) + 5 * ((x // 5) % 100)))\n", "measured_fast_code_sha256": "12a73a8acfa07f30639f186d47d681f3412c7c6de111ff783aa0e2c3ad3f87eb", "measured_slow_code": "def main():\n X = int(eval(input()))\n # 500円をp個、5円をq個とすると。500p+5q=Xが成り立ち、ansは1000p+5qになる\n pmax = int(X / 500)\n ans = 0\n tmp = 0\n for p in range(pmax + 1):\n q = int((X - 500 * p) / 5)\n tmp = 1000 * p + 5 * q\n ans = max(ans, tmp)\n print(ans)\n\n\nmain()\n", "measured_slow_code_sha256": "8e66543c4bfccd29b9635f672d4f7cfeb7472d55523631a6fef9ea761e351dd5", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 15551.054425384882, "pair_id": "python_v2_14ca53ef996580ee3f957327", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02724", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02724_12a73a8acfa07f30639f186d47d681f3412c7c6de111ff783aa0e2c3ad3f87eb.jsonl.gz", "inputs": "reproduction/python/inputs/p02724.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02724_8e66543c4bfccd29b9635f672d4f7cfeb7472d55523631a6fef9ea761e351dd5.jsonl.gz"}, "slow_code": "def main():\n X = int(eval(input()))\n\n pmax = int(X / 500)\n ans = 0\n tmp = 0\n for p in range(pmax + 1):\n q = int((X - 500 * p) / 5)\n tmp = 1000 * p + 5 * q\n ans = max(ans, tmp)\n print(ans)\n\n\nmain()\n", "slow_code_sha256": "ce23ce9602140709d4fba80da208b63c8ba5d91a22dfdb9a0bca025c1f37682a", "slow_id": "p02724_8e66543c4bfccd29b9635f672d4f7cfeb7472d55523631a6fef9ea761e351dd5", "speedup": 3648.306602545967, "stratum": "8+", "within_pair_jaccard": 0.22727272727272727, "workload": {"case_count": 100, "description": "Exchange amount X into coins of values 500,100,50,10,5,1. Maximize happiness: each 500-value coin earns 1000 points and each 5-value coin earns 5; other coins earn none. Observed inputs: X=0..1000000000 (median 393604620).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 11, "median": 10.0, "min": 2}, "input_format": ["X"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p02763_case_000", "p02763_case_001", "p02763_case_002", "p02763_case_003", "p02763_case_004", "p02763_case_005", "p02763_case_006", "p02763_case_007", "p02763_case_008", "p02763_case_009", "p02763_case_010", "p02763_case_011", "p02763_case_012", "p02763_case_013", "p02763_case_014", "p02763_case_015", "p02763_case_016", "p02763_case_017", "p02763_case_018", "p02763_case_019", "p02763_case_020", "p02763_case_021", "p02763_case_022", "p02763_case_023", "p02763_case_024", "p02763_case_025", "p02763_case_026", "p02763_case_027", "p02763_case_028", "p02763_case_029", "p02763_case_030", "p02763_case_031", "p02763_case_032", "p02763_case_033", "p02763_case_034", "p02763_case_035", "p02763_case_036", "p02763_case_037", "p02763_case_038", "p02763_case_039", "p02763_case_040", "p02763_case_041", "p02763_case_042", "p02763_case_043", "p02763_case_044", "p02763_case_045", "p02763_case_046", "p02763_case_047", "p02763_case_048", "p02763_case_049", "p02763_case_050", "p02763_case_051", "p02763_case_052", "p02763_case_053", "p02763_case_054", "p02763_case_055", "p02763_case_056", "p02763_case_057", "p02763_case_058", "p02763_case_059", "p02763_case_060", "p02763_case_061", "p02763_case_062", "p02763_case_063", "p02763_case_064", "p02763_case_065", "p02763_case_066", "p02763_case_067", "p02763_case_068", "p02763_case_069", "p02763_case_070", "p02763_case_071", "p02763_case_072", "p02763_case_073", "p02763_case_074", "p02763_case_075", "p02763_case_076", "p02763_case_077", "p02763_case_078", "p02763_case_079", "p02763_case_080", "p02763_case_081", "p02763_case_082", "p02763_case_083", "p02763_case_084", "p02763_case_085", "p02763_case_086", "p02763_case_087", "p02763_case_088", "p02763_case_089", "p02763_case_090", "p02763_case_091", "p02763_case_092", "p02763_case_093", "p02763_case_094", "p02763_case_095", "p02763_case_096", "p02763_case_097", "p02763_case_098", "p02763_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "executable_AST_equal_except_explicit_explanatory_string_removal_and_all_frozen_inputs_checker_pass", "fast_code": "import sys\nfrom bisect import bisect, insort_left\n\niim = lambda: map(int, input().rstrip().split())\n\n\ndef resolve():\n N = int(input())\n S = list(input())\n Q = int(input())\n c0 = ord(\"a\")\n S1 = [[] for i in range(26)]\n for i, c1 in enumerate(S):\n ci = ord(c1) - c0\n S1[ci].append(i)\n ans = []\n for cmd, i, j in (line.split() for line in sys.stdin):\n i = int(i) - 1\n if cmd == \"1\":\n if S[i] == j:\n continue\n c1 = ord(S[i]) - c0\n s1 = S1[c1]\n s1.pop(bisect(s1, i) - 1)\n S[i] = j\n c1 = ord(j) - c0\n insort_left(S1[c1], i)\n elif cmd == \"2\":\n j = int(j) - 1\n num = 0\n for s1 in S1:\n ls = len(s1)\n k = bisect(s1, i - 1, 0, ls)\n if k == ls:\n continue\n if i <= s1[k] <= j:\n num += 1\n ans.append(num)\n print(*ans, sep=\"\\n\")\n\n\nif __name__ == \"__main__\":\n resolve()\n", "fast_code_sha256": "adae48fe55effa8cdd6a315e90f7e6e7504ad3afb14202e2c2b32aa2bd81be75", "fast_id": "p02763_e84631fc29be2baae93a961e1dedc6fa9fd2dfe58a7aa5989ca607d0cd0affbf", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "#!python3\nimport sys\nfrom bisect import bisect, insort_left\n\niim = lambda: map(int, input().rstrip().split())\n\n\ndef resolve():\n N = int(input())\n S = list(input())\n Q = int(input())\n c0 = ord(\"a\")\n S1 = [[] for i in range(26)]\n for i, c1 in enumerate(S):\n ci = ord(c1) - c0\n S1[ci].append(i)\n ans = []\n for cmd, i, j in (line.split() for line in sys.stdin):\n i = int(i) - 1\n if cmd == \"1\":\n if S[i] == j:\n continue\n c1 = ord(S[i]) - c0\n s1 = S1[c1]\n s1.pop(bisect(s1, i) - 1)\n S[i] = j\n c1 = ord(j) - c0\n insort_left(S1[c1], i)\n elif cmd == \"2\":\n j = int(j) - 1\n num = 0\n for s1 in S1:\n ls = len(s1)\n k = bisect(s1, i - 1, 0, ls)\n if k == ls:\n continue\n if i <= s1[k] <= j:\n num += 1\n ans.append(num)\n print(*ans, sep=\"\\n\")\n\n\nif __name__ == \"__main__\":\n resolve()\n", "measured_fast_code_sha256": "e84631fc29be2baae93a961e1dedc6fa9fd2dfe58a7aa5989ca607d0cd0affbf", "measured_slow_code": "import sys\n\ninput = sys.stdin.readline\n\n\nclass Bit:\n def __init__(self, n):\n self.n = n\n self.tree = [0] * (n + 1)\n self.el = [0] * (n + 1)\n self.depth = n.bit_length() - 1\n\n def sum(self, i):\n \"\"\"区間[0,i) の総和を求める\"\"\"\n s = 0\n i -= 1\n while i >= 0:\n s += self.tree[i]\n i = (i & (i + 1)) - 1\n return s\n\n def add(self, i, x):\n \"\"\"i 番目の要素に x を足す\"\"\"\n self.el[i] += x\n while i < self.n:\n self.tree[i] += x\n i |= i + 1\n\n def get(self, i, j=None):\n \"\"\"部分区間和 [i, j)\"\"\"\n if j is None:\n return self.el[i]\n if i == 0:\n return self.sum(j)\n return self.sum(j) - self.sum(i)\n\n def lower_bound(self, x, equal=False):\n \"\"\"(a0+a1+...+ai < x となる最大の i, その時の a0+a1+...+ai )\n a0+a1+...+ai <= x としたい場合は equal = True\n 二分探索であるため、ai>=0 を満たす必要がある\"\"\"\n sum_ = 0\n pos = -1 # 1-indexed の時は pos = 0\n if not equal:\n for i in range(self.depth, -1, -1):\n k = pos + (1 << i)\n if k < self.n and sum_ + self.tree[k] < x: # 1-indexed の時は k <= self.n\n sum_ += self.tree[k]\n pos += 1 << i\n if equal:\n for i in range(self.depth, -1, -1):\n k = pos + (1 << i)\n if k < self.n and sum_ + self.tree[k] <= x: # 1-indexed の時は k <= self.n\n sum_ += self.tree[k]\n pos += 1 << i\n return pos, sum_\n\n def __getitem__(self, s):\n \"\"\"[a0, a1, a2, ...]\"\"\"\n return self.el[s]\n\n def __iter__(self):\n \"\"\"[a0, a1, a2, ...]\"\"\"\n for s in self.el[: self.n]:\n yield s\n\n def __str__(self):\n text1 = \" \".join([\"element: \"] + list(map(str, self)))\n text2 = \" \".join(\n [\"cumsum(1-indexed): \"]\n + list(str(self.sum(i)) for i in range(1, self.n + 1))\n )\n return \"\\n\".join((text1, text2))\n\n\n####################################################################################################\nimport string\n\nN = int(eval(input()))\nS = input().strip()\nQ = int(eval(input()))\nB = [Bit(N) for _ in range(26)]\nabc = string.ascii_lowercase # [a-z] をロード\nabc2 = dict()\nfor i, s in enumerate(abc):\n abc2[s] = i\nfor i, s in enumerate(S):\n B[abc2[s]].add(i, 1)\nfor _ in range(Q):\n q = list(input().split())\n if q[0] == \"1\":\n a = int(q[1]) - 1\n b = q[2]\n for i in range(26):\n if B[i].el[a] == 1:\n B[i].add(a, -1)\n B[abc2[b]].add(a, 1)\n if q[0] == \"2\":\n a = int(q[1]) - 1\n b = int(q[2]) - 1\n res = 0\n for i in range(26):\n res += B[i].get(a, b + 1) > 0\n print(res)\n", "measured_slow_code_sha256": "f48f6f3e37812c17b5337b9141da770a977eb3ae11af352f28286963282fd6ed", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 5.829333747313838, "pair_id": "python_v2_d53354f51a833382eefe330a", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02763", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02763_e84631fc29be2baae93a961e1dedc6fa9fd2dfe58a7aa5989ca607d0cd0affbf.jsonl.gz", "inputs": "reproduction/python/inputs/p02763.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02763_f48f6f3e37812c17b5337b9141da770a977eb3ae11af352f28286963282fd6ed.jsonl.gz"}, "slow_code": "import sys\n\ninput = sys.stdin.readline\n\n\nclass Bit:\n def __init__(self, n):\n self.n = n\n self.tree = [0] * (n + 1)\n self.el = [0] * (n + 1)\n self.depth = n.bit_length() - 1\n\n def sum(self, i):\n s = 0\n i -= 1\n while i >= 0:\n s += self.tree[i]\n i = (i & (i + 1)) - 1\n return s\n\n def add(self, i, x):\n self.el[i] += x\n while i < self.n:\n self.tree[i] += x\n i |= i + 1\n\n def get(self, i, j=None):\n if j is None:\n return self.el[i]\n if i == 0:\n return self.sum(j)\n return self.sum(j) - self.sum(i)\n\n def lower_bound(self, x, equal=False):\n sum_ = 0\n pos = -1\n if not equal:\n for i in range(self.depth, -1, -1):\n k = pos + (1 << i)\n if k < self.n and sum_ + self.tree[k] < x:\n sum_ += self.tree[k]\n pos += 1 << i\n if equal:\n for i in range(self.depth, -1, -1):\n k = pos + (1 << i)\n if k < self.n and sum_ + self.tree[k] <= x:\n sum_ += self.tree[k]\n pos += 1 << i\n return pos, sum_\n\n def __getitem__(self, s):\n return self.el[s]\n\n def __iter__(self):\n for s in self.el[: self.n]:\n yield s\n\n def __str__(self):\n text1 = \" \".join([\"element: \"] + list(map(str, self)))\n text2 = \" \".join(\n [\"cumsum(1-indexed): \"]\n + list(str(self.sum(i)) for i in range(1, self.n + 1))\n )\n return \"\\n\".join((text1, text2))\n\n\nimport string\n\nN = int(eval(input()))\nS = input().strip()\nQ = int(eval(input()))\nB = [Bit(N) for _ in range(26)]\nabc = string.ascii_lowercase\nabc2 = dict()\nfor i, s in enumerate(abc):\n abc2[s] = i\nfor i, s in enumerate(S):\n B[abc2[s]].add(i, 1)\nfor _ in range(Q):\n q = list(input().split())\n if q[0] == \"1\":\n a = int(q[1]) - 1\n b = q[2]\n for i in range(26):\n if B[i].el[a] == 1:\n B[i].add(a, -1)\n B[abc2[b]].add(a, 1)\n if q[0] == \"2\":\n a = int(q[1]) - 1\n b = int(q[2]) - 1\n res = 0\n for i in range(26):\n res += B[i].get(a, b + 1) > 0\n print(res)\n", "slow_code_sha256": "4fa4a65e4a0df3861053325cb01fa333b2482712b297bcf1214920d237936687", "slow_id": "p02763_f48f6f3e37812c17b5337b9141da770a977eb3ae11af352f28286963282fd6ed", "speedup": 6.006299546319336, "stratum": "4-8", "within_pair_jaccard": 0.23275862068965517, "workload": {"case_count": 100, "description": "Process Q ordered queries on a lowercase string S of length N. Query 1 i c replaces character i with c; query 2 l r reports the number of distinct letters in inclusive substring [l,r]. At least one type-2 query occurs. Observed inputs: N=1..500000 (median 500000); Q=1..20000 (median 20000); type1_count=0..19999; type2_count=1..20000; substring_length=1..500000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 815322, "median": 720014.0, "min": 12}, "input_format": ["N\nS\nQ\nQ query lines, each: 1 i c or 2 l r"], "input_format_status": "source_input_section", "input_lines": {"max": 20003, "median": 20003.0, "min": 4}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 60003, "median": 60003.0, "min": 6}}} -{"case_ids": ["p03762_case_000", "p03762_case_001", "p03762_case_002", "p03762_case_003", "p03762_case_004", "p03762_case_005", "p03762_case_006", "p03762_case_007", "p03762_case_008", "p03762_case_009", "p03762_case_010", "p03762_case_011", "p03762_case_012", "p03762_case_013", "p03762_case_014", "p03762_case_015", "p03762_case_016", "p03762_case_017", "p03762_case_018", "p03762_case_019", "p03762_case_020", "p03762_case_021", "p03762_case_022", "p03762_case_023", "p03762_case_024", "p03762_case_025", "p03762_case_026", "p03762_case_027", "p03762_case_028", "p03762_case_029", "p03762_case_030", "p03762_case_031", "p03762_case_032", "p03762_case_033", "p03762_case_034", "p03762_case_035", "p03762_case_036", "p03762_case_037", "p03762_case_038", "p03762_case_039", "p03762_case_040", "p03762_case_041", "p03762_case_042", "p03762_case_043", "p03762_case_044", "p03762_case_045", "p03762_case_046", "p03762_case_047", "p03762_case_048", "p03762_case_049", "p03762_case_050", "p03762_case_051", "p03762_case_052", "p03762_case_053", "p03762_case_054", "p03762_case_055", "p03762_case_056", "p03762_case_057", "p03762_case_058", "p03762_case_059", "p03762_case_060", "p03762_case_061", "p03762_case_062", "p03762_case_063", "p03762_case_064", "p03762_case_065", "p03762_case_066", "p03762_case_067", "p03762_case_068", "p03762_case_069", "p03762_case_070", "p03762_case_071", "p03762_case_072", "p03762_case_073", "p03762_case_074", "p03762_case_075", "p03762_case_076", "p03762_case_077", "p03762_case_078", "p03762_case_079", "p03762_case_080", "p03762_case_081", "p03762_case_082", "p03762_case_083", "p03762_case_084", "p03762_case_085", "p03762_case_086", "p03762_case_087", "p03762_case_088", "p03762_case_089", "p03762_case_090", "p03762_case_091", "p03762_case_092", "p03762_case_093", "p03762_case_094", "p03762_case_095", "p03762_case_096", "p03762_case_097", "p03762_case_098", "p03762_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\n\ndef MI():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\nn, m = MI()\nx, y = LI(), LI()\nmod = 10**9 + 7\nn, m = n - 1, m - 1\ndx = [x[i + 1] - x[i] for i in range(n)]\ndy = [y[i + 1] - y[i] for i in range(m)]\nif n % 2 == 0:\n rx = [i * (n + 1 - i) for i in range(1, n // 2 + 1)] + [\n i * (n + 1 - i) for i in range(n // 2, 0, -1)\n ]\nelse:\n rx = [i * (n + 1 - i) for i in range(1, n // 2 + 2)] + [\n i * (n + 1 - i) for i in range(n // 2, 0, -1)\n ]\nif m % 2 == 0:\n ry = [i * (m + 1 - i) for i in range(1, m // 2 + 1)] + [\n i * (m + 1 - i) for i in range(m // 2, 0, -1)\n ]\nelse:\n ry = [i * (m + 1 - i) for i in range(1, m // 2 + 2)] + [\n i * (m + 1 - i) for i in range(m // 2, 0, -1)\n ]\na = 0\nfor i, j in zip(dx, rx):\n a += i * j\n a %= mod\nb = 0\nfor i, j in zip(dy, ry):\n b += i * j\n b %= mod\nprint(((a * b) % mod))\n", "fast_code_sha256": "c83f5f098ab8d0cc6a50842b83864e96ec3fa4e9c6971d07a3acead1186e98ed", "fast_id": "p03762_517ab4861336162e327cb611a73cbb608c1cf52da44cf81e075e1e7054e6a8f1", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\n\ndef MI():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().rstrip().split())) # 空白あり\n\n\nn, m = MI()\nx, y = LI(), LI()\nmod = 10**9 + 7\nn, m = n - 1, m - 1\ndx = [x[i + 1] - x[i] for i in range(n)]\ndy = [y[i + 1] - y[i] for i in range(m)]\nif n % 2 == 0:\n rx = [i * (n + 1 - i) for i in range(1, n // 2 + 1)] + [\n i * (n + 1 - i) for i in range(n // 2, 0, -1)\n ]\nelse:\n rx = [i * (n + 1 - i) for i in range(1, n // 2 + 2)] + [\n i * (n + 1 - i) for i in range(n // 2, 0, -1)\n ]\nif m % 2 == 0:\n ry = [i * (m + 1 - i) for i in range(1, m // 2 + 1)] + [\n i * (m + 1 - i) for i in range(m // 2, 0, -1)\n ]\nelse:\n ry = [i * (m + 1 - i) for i in range(1, m // 2 + 2)] + [\n i * (m + 1 - i) for i in range(m // 2, 0, -1)\n ]\na = 0\nfor i, j in zip(dx, rx):\n a += i * j\n a %= mod\nb = 0\nfor i, j in zip(dy, ry):\n b += i * j\n b %= mod\nprint(((a * b) % mod))\n", "measured_fast_code_sha256": "517ab4861336162e327cb611a73cbb608c1cf52da44cf81e075e1e7054e6a8f1", "measured_slow_code": "import sys\nimport numpy as np\n\nMOD = 10**9 + 7\nI = np.array(sys.stdin.read().split(), dtype=np.int64)\nn, m = I[:2]\nx = I[2 : 2 + n]\ny = I[2 + n :]\n\n\ndef main():\n sx = np.cumsum(x) % MOD\n sy = np.cumsum(y) % MOD\n sdx = (\n np.sum((sx[n - 1] - sx[: n - 1]) - x[: n - 1] * ((n - 1) - np.arange(n - 1)))\n % MOD\n )\n sdy = (\n np.sum((sy[m - 1] - sy[: m - 1]) - y[: m - 1] * ((m - 1) - np.arange(m - 1)))\n % MOD\n )\n ans = sdx * sdy % MOD\n return ans\n\n\nif __name__ == \"__main__\":\n ans = main()\n print(ans)\n", "measured_slow_code_sha256": "982e2a132ff9a9ee086902a77e4d38984ae35b417d1949db3c426a0eec331800", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 0.9345089148218384, "pair_id": "python_v2_15a07e6ce36dade7f4fec74d", "per_case_slow_code_faster_fraction": 0.68, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03762", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03762_517ab4861336162e327cb611a73cbb608c1cf52da44cf81e075e1e7054e6a8f1.jsonl.gz", "inputs": "reproduction/python/inputs/p03762.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03762_982e2a132ff9a9ee086902a77e4d38984ae35b417d1949db3c426a0eec331800.jsonl.gz"}, "slow_code": "import sys\nimport numpy as np\n\nMOD = 10**9 + 7\nI = np.array(sys.stdin.read().split(), dtype=np.int64)\nn, m = I[:2]\nx = I[2 : 2 + n]\ny = I[2 + n :]\n\n\ndef main():\n sx = np.cumsum(x) % MOD\n sy = np.cumsum(y) % MOD\n sdx = (\n np.sum((sx[n - 1] - sx[: n - 1]) - x[: n - 1] * ((n - 1) - np.arange(n - 1)))\n % MOD\n )\n sdy = (\n np.sum((sy[m - 1] - sy[: m - 1]) - y[: m - 1] * ((m - 1) - np.arange(m - 1)))\n % MOD\n )\n ans = sdx * sdy % MOD\n return ans\n\n\nif __name__ == \"__main__\":\n ans = main()\n print(ans)\n", "slow_code_sha256": "982e2a132ff9a9ee086902a77e4d38984ae35b417d1949db3c426a0eec331800", "slow_id": "p03762_982e2a132ff9a9ee086902a77e4d38984ae35b417d1949db3c426a0eec331800", "speedup": 4.4822597668622155, "stratum": "4-8", "within_pair_jaccard": 0.288135593220339, "workload": {"case_count": 100, "description": "Vertical lines x=x_i and horizontal lines y=y_i have strictly increasing coordinate lists. Sum areas of all rectangles formed by choosing two lines of each orientation, modulo 1000000007. Observed inputs: n=2..100000 (median 50000); m=2..100000 (median 50000); x_i=-1000000000..1000000000; y_i=-1000000000..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 2200016, "median": 1038968.5, "min": 44}, "input_format": ["n m\nx_1 ... x_n\ny_1 ... y_m"], "input_format_status": "source_input_section", "input_lines": {"max": 3, "median": 3.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200002, "median": 100003.0, "min": 6}}} -{"case_ids": ["p03221_case_000", "p03221_case_001", "p03221_case_002", "p03221_case_003", "p03221_case_004", "p03221_case_005", "p03221_case_006", "p03221_case_007", "p03221_case_008", "p03221_case_009", "p03221_case_010", "p03221_case_011", "p03221_case_012", "p03221_case_013", "p03221_case_014", "p03221_case_015", "p03221_case_016", "p03221_case_017", "p03221_case_018", "p03221_case_019", "p03221_case_020", "p03221_case_021", "p03221_case_022", "p03221_case_023", "p03221_case_024", "p03221_case_025", "p03221_case_026", "p03221_case_027", "p03221_case_028", "p03221_case_029", "p03221_case_030", "p03221_case_031", "p03221_case_032", "p03221_case_033", "p03221_case_034", "p03221_case_035", "p03221_case_036", "p03221_case_037", "p03221_case_038", "p03221_case_039", "p03221_case_040", "p03221_case_041", "p03221_case_042", "p03221_case_043", "p03221_case_044", "p03221_case_045", "p03221_case_046", "p03221_case_047", "p03221_case_048", "p03221_case_049", "p03221_case_050", "p03221_case_051", "p03221_case_052", "p03221_case_053", "p03221_case_054", "p03221_case_055", "p03221_case_056", "p03221_case_057", "p03221_case_058", "p03221_case_059", "p03221_case_060", "p03221_case_061", "p03221_case_062", "p03221_case_063", "p03221_case_064", "p03221_case_065", "p03221_case_066", "p03221_case_067", "p03221_case_068", "p03221_case_069", "p03221_case_070", "p03221_case_071", "p03221_case_072", "p03221_case_073", "p03221_case_074", "p03221_case_075", "p03221_case_076", "p03221_case_077", "p03221_case_078", "p03221_case_079", "p03221_case_080", "p03221_case_081", "p03221_case_082", "p03221_case_083", "p03221_case_084", "p03221_case_085", "p03221_case_086", "p03221_case_087", "p03221_case_088", "p03221_case_089", "p03221_case_090", "p03221_case_091", "p03221_case_092", "p03221_case_093", "p03221_case_094", "p03221_case_095", "p03221_case_096", "p03221_case_097", "p03221_case_098", "p03221_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N, M = list(map(int, input().split()))\ndigit = \"zero padding: {:0=6}\"\ndic = [[] for _ in range(N + 1)]\nfor i in range(M):\n p, y = list(map(int, input().split()))\n dic[p].append((y, i))\nfor p in dic:\n p.sort()\nans = [None for _ in range(M)]\nfor k in range(1, N + 1):\n p = dic[k]\n for j in range(len(p)):\n i = p[j][1]\n ID = str(k).zfill(6) + str(j + 1).zfill(6)\n ans[i] = ID\nfor a in ans:\n print(a)\n", "fast_code_sha256": "a11be8363c56644e9c05ac4a48222a2312830ba797d2c147c788c4200ec4b9f1", "fast_id": "p03221_a11be8363c56644e9c05ac4a48222a2312830ba797d2c147c788c4200ec4b9f1", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N, M = list(map(int, input().split()))\ndigit = \"zero padding: {:0=6}\"\ndic = [[] for _ in range(N + 1)]\nfor i in range(M):\n p, y = list(map(int, input().split()))\n dic[p].append((y, i))\nfor p in dic:\n p.sort()\nans = [None for _ in range(M)]\nfor k in range(1, N + 1):\n p = dic[k]\n for j in range(len(p)):\n i = p[j][1]\n ID = str(k).zfill(6) + str(j + 1).zfill(6)\n ans[i] = ID\nfor a in ans:\n print(a)\n", "measured_fast_code_sha256": "a11be8363c56644e9c05ac4a48222a2312830ba797d2c147c788c4200ec4b9f1", "measured_slow_code": "N, M = list(map(int, input().split()))\nP = []\nY = []\narr = [[] for j in range(10**5 + 1)]\nfor i in range(M):\n listA = list(map(int, input().split()))\n P.append(listA[0])\n Y.append(listA[1])\n arr[listA[0]].append(listA[1])\nfor i in range(N + 1):\n arr[i].sort()\nfor i in range(M):\n # 二部探索\n left = 0\n right = len(arr[P[i]]) - 1\n while left <= right:\n mid = (left + right) // 2\n if arr[P[i]][mid] == Y[i]:\n k = mid\n break\n elif arr[P[i]][mid] > Y[i]:\n right = mid - 1\n else:\n left = mid + 1\n print((str(P[i]).rjust(6, \"0\") + str(k + 1).rjust(6, \"0\")))\n", "measured_slow_code_sha256": "bac932e565fc824f54938c4edcf17024edb8ebfd73deb80882c8006e56a416b6", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.670749460300144, "pair_id": "python_v2_ffd1490cae9008dc2acb07fb", "per_case_slow_code_faster_fraction": 0.07, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03221", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03221_a11be8363c56644e9c05ac4a48222a2312830ba797d2c147c788c4200ec4b9f1.jsonl.gz", "inputs": "reproduction/python/inputs/p03221.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03221_bac932e565fc824f54938c4edcf17024edb8ebfd73deb80882c8006e56a416b6.jsonl.gz"}, "slow_code": "N, M = list(map(int, input().split()))\nP = []\nY = []\narr = [[] for j in range(10**5 + 1)]\nfor i in range(M):\n listA = list(map(int, input().split()))\n P.append(listA[0])\n Y.append(listA[1])\n arr[listA[0]].append(listA[1])\nfor i in range(N + 1):\n arr[i].sort()\nfor i in range(M):\n\n left = 0\n right = len(arr[P[i]]) - 1\n while left <= right:\n mid = (left + right) // 2\n if arr[P[i]][mid] == Y[i]:\n k = mid\n break\n elif arr[P[i]][mid] > Y[i]:\n right = mid - 1\n else:\n left = mid + 1\n print((str(P[i]).rjust(6, \"0\") + str(k + 1).rjust(6, \"0\")))\n", "slow_code_sha256": "9a9b5b8d60f2f6a437fd75f31baba74dc5ed7ac13071d840e26b691e2ff91cac", "slow_id": "p03221_bac932e565fc824f54938c4edcf17024edb8ebfd73deb80882c8006e56a416b6", "speedup": 5.330323700524525, "stratum": "4-8", "within_pair_jaccard": 0.4375, "workload": {"case_count": 100, "description": "For each city, output a 12-digit ID formed from its prefecture P_i and its 1-based establishment rank within that prefecture, each zero-padded to six digits. Establishment years Y_i are globally distinct. Preserve input city order. Observed inputs: N=1..100000 (median 1000); M=1..100000 (median 1000); P_i=1..100000; Y_i=674542..991757127.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1600014, "median": 13905.0, "min": 16}, "input_format": ["N M\nP_1 Y_1\n...\nP_M Y_M"], "input_format_status": "source_input_section", "input_lines": {"max": 100001, "median": 1001.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200002, "median": 2002.0, "min": 4}}} -{"case_ids": ["p02995_case_000", "p02995_case_001", "p02995_case_002", "p02995_case_003", "p02995_case_004", "p02995_case_005", "p02995_case_006", "p02995_case_007", "p02995_case_008", "p02995_case_009", "p02995_case_010", "p02995_case_011", "p02995_case_012", "p02995_case_013", "p02995_case_014", "p02995_case_015", "p02995_case_016", "p02995_case_017", "p02995_case_018", "p02995_case_019", "p02995_case_020", "p02995_case_021", "p02995_case_022", "p02995_case_023", "p02995_case_024", "p02995_case_025", "p02995_case_026", "p02995_case_027", "p02995_case_028", "p02995_case_029", "p02995_case_030", "p02995_case_031", "p02995_case_032", "p02995_case_033", "p02995_case_034", "p02995_case_035", "p02995_case_036", "p02995_case_037", "p02995_case_038", "p02995_case_039", "p02995_case_040", "p02995_case_041", "p02995_case_042", "p02995_case_043", "p02995_case_044", "p02995_case_045", "p02995_case_046", "p02995_case_047", "p02995_case_048", "p02995_case_049", "p02995_case_050", "p02995_case_051", "p02995_case_052", "p02995_case_053", "p02995_case_054", "p02995_case_055", "p02995_case_056", "p02995_case_057", "p02995_case_058", "p02995_case_059", "p02995_case_060", "p02995_case_061", "p02995_case_062", "p02995_case_063", "p02995_case_064", "p02995_case_065", "p02995_case_066", "p02995_case_067", "p02995_case_068", "p02995_case_069", "p02995_case_070", "p02995_case_071", "p02995_case_072", "p02995_case_073", "p02995_case_074", "p02995_case_075", "p02995_case_076", "p02995_case_077", "p02995_case_078", "p02995_case_079", "p02995_case_080", "p02995_case_081", "p02995_case_082", "p02995_case_083", "p02995_case_084", "p02995_case_085", "p02995_case_086", "p02995_case_087", "p02995_case_088", "p02995_case_089", "p02995_case_090", "p02995_case_091", "p02995_case_092", "p02995_case_093", "p02995_case_094", "p02995_case_095", "p02995_case_096", "p02995_case_097", "p02995_case_098", "p02995_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\n\ndef S():\n return sys.stdin.readline().rstrip()\n\n\nA, B, C, D = list(map(int, S().split()))\nfrom math import gcd\n\n\ndef f(n):\n return n - n // C - n // D + n // (C * D // gcd(C, D))\n\n\nprint((f(B) - f(A - 1)))\n", "fast_code_sha256": "40c384de9916c20716412ceeb875503501d088f9314d691c5f81bc3c1cf9e892", "fast_id": "p02995_5956a1b2d912bfd23345c485f0ffc7b6e25d46613e1c4f11a08333a208413d78", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\n\ndef S():\n return sys.stdin.readline().rstrip()\n\n\nA, B, C, D = list(map(int, S().split()))\nfrom math import gcd\n\n\ndef f(n): # 1からnまでCでもDでも割り切れない自然数の個数\n return n - n // C - n // D + n // (C * D // gcd(C, D))\n\n\nprint((f(B) - f(A - 1)))\n", "measured_fast_code_sha256": "5956a1b2d912bfd23345c485f0ffc7b6e25d46613e1c4f11a08333a208413d78", "measured_slow_code": "import sys\n\nsys.setrecursionlimit(10**7)\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\ndef MI():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().rstrip().split())) # 空白あり\n\n\ndef LI2():\n return list(map(int, sys.stdin.readline().rstrip())) # 空白なし\n\n\ndef S():\n return sys.stdin.readline().rstrip()\n\n\ndef LS():\n return list(sys.stdin.readline().rstrip().split()) # 空白あり\n\n\ndef LS2():\n return list(sys.stdin.readline().rstrip()) # 空白なし\n\n\nA, B, C, D = MI()\nfrom math import gcd\n\n\ndef f(n):\n return n - n // C - n // D + n // ((C * D) // gcd(C, D))\n\n\nprint((f(B) - f(A - 1)))\n", "measured_slow_code_sha256": "c2f5bc360099cc643a35a40406bd46a274a8a5ff8b8696ae88a7e38cfd81242e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.2603203713990228, "pair_id": "python_v2_3d1823d7371311b68ebb7c4f", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02995", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02995_5956a1b2d912bfd23345c485f0ffc7b6e25d46613e1c4f11a08333a208413d78.jsonl.gz", "inputs": "reproduction/python/inputs/p02995.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02995_c2f5bc360099cc643a35a40406bd46a274a8a5ff8b8696ae88a7e38cfd81242e.jsonl.gz"}, "slow_code": "import sys\n\nsys.setrecursionlimit(10**7)\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\ndef MI():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef LI2():\n return list(map(int, sys.stdin.readline().rstrip()))\n\n\ndef S():\n return sys.stdin.readline().rstrip()\n\n\ndef LS():\n return list(sys.stdin.readline().rstrip().split())\n\n\ndef LS2():\n return list(sys.stdin.readline().rstrip())\n\n\nA, B, C, D = MI()\nfrom math import gcd\n\n\ndef f(n):\n return n - n // C - n // D + n // ((C * D) // gcd(C, D))\n\n\nprint((f(B) - f(A - 1)))\n", "slow_code_sha256": "13e5da75774e374f0ecc4a7f6f857dc7a5cfdcb8d1ce9b650399f2172f149df2", "slow_id": "p02995_c2f5bc360099cc643a35a40406bd46a274a8a5ff8b8696ae88a7e38cfd81242e", "speedup": 2.262061569418186, "stratum": "2-4", "within_pair_jaccard": 0.71875, "workload": {"case_count": 100, "description": "Count integers in inclusive interval [A,B] divisible by neither C nor D. The interval is given by endpoints, not by listing its members. Observed inputs: A=1..992930041683160624; B=1..1000000000000000000; C=1..1000000000; D=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 58, "median": 58.0, "min": 8}, "input_format": ["A B C D"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 4, "median": 4.0, "min": 4}}} -{"case_ids": ["p03221_case_000", "p03221_case_001", "p03221_case_002", "p03221_case_003", "p03221_case_004", "p03221_case_005", "p03221_case_006", "p03221_case_007", "p03221_case_008", "p03221_case_009", "p03221_case_010", "p03221_case_011", "p03221_case_012", "p03221_case_013", "p03221_case_014", "p03221_case_015", "p03221_case_016", "p03221_case_017", "p03221_case_018", "p03221_case_019", "p03221_case_020", "p03221_case_021", "p03221_case_022", "p03221_case_023", "p03221_case_024", "p03221_case_025", "p03221_case_026", "p03221_case_027", "p03221_case_028", "p03221_case_029", "p03221_case_030", "p03221_case_031", "p03221_case_032", "p03221_case_033", "p03221_case_034", "p03221_case_035", "p03221_case_036", "p03221_case_037", "p03221_case_038", "p03221_case_039", "p03221_case_040", "p03221_case_041", "p03221_case_042", "p03221_case_043", "p03221_case_044", "p03221_case_045", "p03221_case_046", "p03221_case_047", "p03221_case_048", "p03221_case_049", "p03221_case_050", "p03221_case_051", "p03221_case_052", "p03221_case_053", "p03221_case_054", "p03221_case_055", "p03221_case_056", "p03221_case_057", "p03221_case_058", "p03221_case_059", "p03221_case_060", "p03221_case_061", "p03221_case_062", "p03221_case_063", "p03221_case_064", "p03221_case_065", "p03221_case_066", "p03221_case_067", "p03221_case_068", "p03221_case_069", "p03221_case_070", "p03221_case_071", "p03221_case_072", "p03221_case_073", "p03221_case_074", "p03221_case_075", "p03221_case_076", "p03221_case_077", "p03221_case_078", "p03221_case_079", "p03221_case_080", "p03221_case_081", "p03221_case_082", "p03221_case_083", "p03221_case_084", "p03221_case_085", "p03221_case_086", "p03221_case_087", "p03221_case_088", "p03221_case_089", "p03221_case_090", "p03221_case_091", "p03221_case_092", "p03221_case_093", "p03221_case_094", "p03221_case_095", "p03221_case_096", "p03221_case_097", "p03221_case_098", "p03221_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def main():\n from collections import defaultdict\n\n dd = defaultdict(str)\n n, m = list(map(int, input().split()))\n keys = []\n atcoder = [[] for _ in range(n)]\n for i in range(m):\n p, y = list(map(int, input().split()))\n key_p = str(p).zfill(6)\n key_y = str(y).zfill(10)\n keys.append(key_p + key_y)\n p -= 1\n atcoder[p].append(y)\n for i in range(n):\n atcoder[i].sort()\n key_i = str(i + 1).zfill(6)\n for index, j in enumerate(atcoder[i]):\n key_index = str(index + 1).zfill(6)\n key_j = str(j).zfill(10)\n dd[key_i + key_j] = key_i + key_index\n for k in keys:\n print((dd[k]))\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "2db6114d8868543954780b0f30e058ad724a040726a8c570c9903718b31f8674", "fast_id": "p03221_2db6114d8868543954780b0f30e058ad724a040726a8c570c9903718b31f8674", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def main():\n from collections import defaultdict\n\n dd = defaultdict(str)\n n, m = list(map(int, input().split()))\n keys = []\n atcoder = [[] for _ in range(n)]\n for i in range(m):\n p, y = list(map(int, input().split()))\n key_p = str(p).zfill(6)\n key_y = str(y).zfill(10)\n keys.append(key_p + key_y)\n p -= 1\n atcoder[p].append(y)\n for i in range(n):\n atcoder[i].sort()\n key_i = str(i + 1).zfill(6)\n for index, j in enumerate(atcoder[i]):\n key_index = str(index + 1).zfill(6)\n key_j = str(j).zfill(10)\n dd[key_i + key_j] = key_i + key_index\n for k in keys:\n print((dd[k]))\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "2db6114d8868543954780b0f30e058ad724a040726a8c570c9903718b31f8674", "measured_slow_code": "N, M = list(map(int, input().split()))\nP = []\nY = []\narr = [[] for j in range(10**5 + 1)]\nfor i in range(M):\n listA = list(map(int, input().split()))\n P.append(listA[0])\n Y.append(listA[1])\n arr[listA[0]].append(listA[1])\nfor i in range(N + 1):\n arr[i].sort()\nfor i in range(M):\n # 二部探索\n left = 0\n right = len(arr[P[i]]) - 1\n while left <= right:\n mid = (left + right) // 2\n if arr[P[i]][mid] == Y[i]:\n k = mid\n break\n elif arr[P[i]][mid] > Y[i]:\n right = mid - 1\n else:\n left = mid + 1\n print((str(P[i]).rjust(6, \"0\") + str(k + 1).rjust(6, \"0\")))\n", "measured_slow_code_sha256": "bac932e565fc824f54938c4edcf17024edb8ebfd73deb80882c8006e56a416b6", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.4870718763822435, "pair_id": "python_v2_aa4ee2fbcd3db86a841918fd", "per_case_slow_code_faster_fraction": 0.23, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03221", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03221_2db6114d8868543954780b0f30e058ad724a040726a8c570c9903718b31f8674.jsonl.gz", "inputs": "reproduction/python/inputs/p03221.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03221_bac932e565fc824f54938c4edcf17024edb8ebfd73deb80882c8006e56a416b6.jsonl.gz"}, "slow_code": "N, M = list(map(int, input().split()))\nP = []\nY = []\narr = [[] for j in range(10**5 + 1)]\nfor i in range(M):\n listA = list(map(int, input().split()))\n P.append(listA[0])\n Y.append(listA[1])\n arr[listA[0]].append(listA[1])\nfor i in range(N + 1):\n arr[i].sort()\nfor i in range(M):\n\n left = 0\n right = len(arr[P[i]]) - 1\n while left <= right:\n mid = (left + right) // 2\n if arr[P[i]][mid] == Y[i]:\n k = mid\n break\n elif arr[P[i]][mid] > Y[i]:\n right = mid - 1\n else:\n left = mid + 1\n print((str(P[i]).rjust(6, \"0\") + str(k + 1).rjust(6, \"0\")))\n", "slow_code_sha256": "9a9b5b8d60f2f6a437fd75f31baba74dc5ed7ac13071d840e26b691e2ff91cac", "slow_id": "p03221_bac932e565fc824f54938c4edcf17024edb8ebfd73deb80882c8006e56a416b6", "speedup": 4.607568119699838, "stratum": "4-8", "within_pair_jaccard": 0.31666666666666665, "workload": {"case_count": 100, "description": "For each city, output a 12-digit ID formed from its prefecture P_i and its 1-based establishment rank within that prefecture, each zero-padded to six digits. Establishment years Y_i are globally distinct. Preserve input city order. Observed inputs: N=1..100000 (median 1000); M=1..100000 (median 1000); P_i=1..100000; Y_i=674542..991757127.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1600014, "median": 13905.0, "min": 16}, "input_format": ["N M\nP_1 Y_1\n...\nP_M Y_M"], "input_format_status": "source_input_section", "input_lines": {"max": 100001, "median": 1001.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200002, "median": 2002.0, "min": 4}}} -{"case_ids": ["p02780_case_000", "p02780_case_001", "p02780_case_002", "p02780_case_003", "p02780_case_004", "p02780_case_005", "p02780_case_006", "p02780_case_007", "p02780_case_008", "p02780_case_009", "p02780_case_010", "p02780_case_011", "p02780_case_012", "p02780_case_013", "p02780_case_014", "p02780_case_015", "p02780_case_016", "p02780_case_017", "p02780_case_018", "p02780_case_019", "p02780_case_020", "p02780_case_021", "p02780_case_022", "p02780_case_023", "p02780_case_024", "p02780_case_025", "p02780_case_026", "p02780_case_027", "p02780_case_028", "p02780_case_029", "p02780_case_030", "p02780_case_031", "p02780_case_032", "p02780_case_033", "p02780_case_034", "p02780_case_035", "p02780_case_036", "p02780_case_037", "p02780_case_038", "p02780_case_039", "p02780_case_040", "p02780_case_041", "p02780_case_042", "p02780_case_043", "p02780_case_044", "p02780_case_045", "p02780_case_046", "p02780_case_047", "p02780_case_048", "p02780_case_049", "p02780_case_050", "p02780_case_051", "p02780_case_052", "p02780_case_053", "p02780_case_054", "p02780_case_055", "p02780_case_056", "p02780_case_057", "p02780_case_058", "p02780_case_059", "p02780_case_060", "p02780_case_061", "p02780_case_062", "p02780_case_063", "p02780_case_064", "p02780_case_065", "p02780_case_066", "p02780_case_067", "p02780_case_068", "p02780_case_069", "p02780_case_070", "p02780_case_071", "p02780_case_072", "p02780_case_073", "p02780_case_074", "p02780_case_075", "p02780_case_076", "p02780_case_077", "p02780_case_078", "p02780_case_079", "p02780_case_080", "p02780_case_081", "p02780_case_082", "p02780_case_083", "p02780_case_084", "p02780_case_085", "p02780_case_086", "p02780_case_087", "p02780_case_088", "p02780_case_089", "p02780_case_090", "p02780_case_091", "p02780_case_092", "p02780_case_093", "p02780_case_094", "p02780_case_095", "p02780_case_096", "p02780_case_097", "p02780_case_098", "p02780_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n, k = list(map(int, input().split()))\np = list(map(int, input().split()))\nmax_sum_k = 0\ncum_sum = [0] * (n + 1)\ncum_sum[0] = 0\ncum_sum[1] = p[0]\nfor i in range(2, n + 1):\n cum_sum[i] = p[i - 1] + cum_sum[i - 1]\nfor i in range(k, n + 1):\n sum_p = cum_sum[i] - cum_sum[i - k]\n if sum_p > max_sum_k:\n max_sum_k = sum_p\nmax_ex = (k + max_sum_k) / 2\nprint(max_ex)\n", "fast_code_sha256": "a7875cc783abeff162489a124094f3312ace44ca124fe66b185816140973f5cc", "fast_id": "p02780_a7875cc783abeff162489a124094f3312ace44ca124fe66b185816140973f5cc", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n, k = list(map(int, input().split()))\np = list(map(int, input().split()))\nmax_sum_k = 0\ncum_sum = [0] * (n + 1)\ncum_sum[0] = 0\ncum_sum[1] = p[0]\nfor i in range(2, n + 1):\n cum_sum[i] = p[i - 1] + cum_sum[i - 1]\nfor i in range(k, n + 1):\n sum_p = cum_sum[i] - cum_sum[i - k]\n if sum_p > max_sum_k:\n max_sum_k = sum_p\nmax_ex = (k + max_sum_k) / 2\nprint(max_ex)\n", "measured_fast_code_sha256": "a7875cc783abeff162489a124094f3312ace44ca124fe66b185816140973f5cc", "measured_slow_code": "class BIT:\n def __init__(self, n):\n self.node = [0 for _ in range(n + 1)]\n\n def add(self, idx, w):\n i = idx\n while i < len(self.node) - 1:\n self.node[i] += w\n i |= i + 1\n\n def sum_(self, idx):\n ret, i = 0, idx - 1\n while i >= 0:\n ret += self.node[i]\n i = (i & (i + 1)) - 1\n return ret\n\n def sum(self, l, r):\n return self.sum_(r) - self.sum_(l)\n\n\nn, k = list(map(int, input().split()))\ntree = BIT(n)\np = [int(x) for x in input().split()]\nfor i in range(n):\n tree.add(i, (1 + p[i]) / 2)\nans = 0\nfor i in range(n - k + 1):\n ans = max(ans, tree.sum(i, i + k))\nprint(ans)\n", "measured_slow_code_sha256": "f0e0a2a27a21da5cf3bfa118c0651e9d7851f3f79494b7c4374dbb95d552c6f4", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 5.844945904553505, "pair_id": "python_v2_3adff1e1e5b66fc65c81524d", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02780", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02780_a7875cc783abeff162489a124094f3312ace44ca124fe66b185816140973f5cc.jsonl.gz", "inputs": "reproduction/python/inputs/p02780.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02780_f0e0a2a27a21da5cf3bfa118c0651e9d7851f3f79494b7c4374dbb95d552c6f4.jsonl.gz"}, "slow_code": "class BIT:\n def __init__(self, n):\n self.node = [0 for _ in range(n + 1)]\n\n def add(self, idx, w):\n i = idx\n while i < len(self.node) - 1:\n self.node[i] += w\n i |= i + 1\n\n def sum_(self, idx):\n ret, i = 0, idx - 1\n while i >= 0:\n ret += self.node[i]\n i = (i & (i + 1)) - 1\n return ret\n\n def sum(self, l, r):\n return self.sum_(r) - self.sum_(l)\n\n\nn, k = list(map(int, input().split()))\ntree = BIT(n)\np = [int(x) for x in input().split()]\nfor i in range(n):\n tree.add(i, (1 + p[i]) / 2)\nans = 0\nfor i in range(n - k + 1):\n ans = max(ans, tree.sum(i, i + k))\nprint(ans)\n", "slow_code_sha256": "f0e0a2a27a21da5cf3bfa118c0651e9d7851f3f79494b7c4374dbb95d552c6f4", "slow_id": "p02780_f0e0a2a27a21da5cf3bfa118c0651e9d7851f3f79494b7c4374dbb95d552c6f4", "speedup": 4.397955269788454, "stratum": "4-8", "within_pair_jaccard": 0.37209302325581395, "workload": {"case_count": 100, "description": "Die i independently yields an integer uniformly from 1 to p_i. Choose K consecutive dice among N to maximize the expected sum of the rolls. Observed inputs: N=1..200000 (median 1000); K=1..200000 (median 5); p_i=1..1000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1000014, "median": 3877.5, "min": 8}, "input_format": ["N K\np_1 ... p_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200002, "median": 1002.0, "min": 3}}} -{"case_ids": ["p02725_case_000", "p02725_case_001", "p02725_case_002", "p02725_case_003", "p02725_case_004", "p02725_case_005", "p02725_case_006", "p02725_case_007", "p02725_case_008", "p02725_case_009", "p02725_case_010", "p02725_case_011", "p02725_case_012", "p02725_case_013", "p02725_case_014", "p02725_case_015", "p02725_case_016", "p02725_case_017", "p02725_case_018", "p02725_case_019", "p02725_case_020", "p02725_case_021", "p02725_case_022", "p02725_case_023", "p02725_case_024", "p02725_case_025", "p02725_case_026", "p02725_case_027", "p02725_case_028", "p02725_case_029", "p02725_case_030", "p02725_case_031", "p02725_case_032", "p02725_case_033", "p02725_case_034", "p02725_case_035", "p02725_case_036", "p02725_case_037", "p02725_case_038", "p02725_case_039", "p02725_case_040", "p02725_case_041", "p02725_case_042", "p02725_case_043", "p02725_case_044", "p02725_case_045", "p02725_case_046", "p02725_case_047", "p02725_case_048", "p02725_case_049", "p02725_case_050", "p02725_case_051", "p02725_case_052", "p02725_case_053", "p02725_case_054", "p02725_case_055", "p02725_case_056", "p02725_case_057", "p02725_case_058", "p02725_case_059", "p02725_case_060", "p02725_case_061", "p02725_case_062", "p02725_case_063", "p02725_case_064", "p02725_case_065", "p02725_case_066", "p02725_case_067", "p02725_case_068", "p02725_case_069", "p02725_case_070", "p02725_case_071", "p02725_case_072", "p02725_case_073", "p02725_case_074", "p02725_case_075", "p02725_case_076", "p02725_case_077", "p02725_case_078", "p02725_case_079", "p02725_case_080", "p02725_case_081", "p02725_case_082", "p02725_case_083", "p02725_case_084", "p02725_case_085", "p02725_case_086", "p02725_case_087", "p02725_case_088", "p02725_case_089", "p02725_case_090", "p02725_case_091", "p02725_case_092", "p02725_case_093", "p02725_case_094", "p02725_case_095", "p02725_case_096", "p02725_case_097", "p02725_case_098", "p02725_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from itertools import *\n\nK, N = list(map(int, input().split()))\nA, B = tee(list(map(int, input().split())), 2)\nfirst = next(B)\nM = max(b - a for a, b in zip_longest(A, B, fillvalue=first + K))\nprint((K - M))\n", "fast_code_sha256": "19a036b3c40e7de8df4659f8dbc703a5a670dbc9cc2d70bef057f513e55523e4", "fast_id": "p02725_19a036b3c40e7de8df4659f8dbc703a5a670dbc9cc2d70bef057f513e55523e4", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from itertools import *\n\nK, N = list(map(int, input().split()))\nA, B = tee(list(map(int, input().split())), 2)\nfirst = next(B)\nM = max(b - a for a, b in zip_longest(A, B, fillvalue=first + K))\nprint((K - M))\n", "measured_fast_code_sha256": "19a036b3c40e7de8df4659f8dbc703a5a670dbc9cc2d70bef057f513e55523e4", "measured_slow_code": "from sys import stdin\n\ninp = stdin.readline\nn, k = [int(x) for x in inp().strip().split()]\narray = [int(x) for x in inp().strip().split()]\ndistance = [0] * (k * 2)\nfor i in range(k - 1):\n distance[i] = array[i + 1] - array[i]\ndistance[k - 1] = n - array[k - 1] + array[0]\ndistance[2 * k - 1] = n - array[k - 1] + array[0]\nfor i in range(k - 1):\n distance[k + i] = array[i + 1] - array[i]\nminimum = 999999999\ncount = 0\ntotal = 0\ncountLimit = k - 1\nfor i in range(k * 2):\n if count < countLimit:\n total += distance[i]\n count += 1\n else:\n if minimum > total:\n minimum = total\n total += distance[i]\n total -= distance[i - countLimit]\nprint(minimum)\n", "measured_slow_code_sha256": "9164aae6c8839a29a40c85ad8ba3bfc05c8440fc08a285145380122a94d7f972", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.6751210621268284, "pair_id": "python_v2_5f2993f8c92fc65e881e64fe", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02725", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02725_19a036b3c40e7de8df4659f8dbc703a5a670dbc9cc2d70bef057f513e55523e4.jsonl.gz", "inputs": "reproduction/python/inputs/p02725.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02725_9164aae6c8839a29a40c85ad8ba3bfc05c8440fc08a285145380122a94d7f972.jsonl.gz"}, "slow_code": "from sys import stdin\n\ninp = stdin.readline\nn, k = [int(x) for x in inp().strip().split()]\narray = [int(x) for x in inp().strip().split()]\ndistance = [0] * (k * 2)\nfor i in range(k - 1):\n distance[i] = array[i + 1] - array[i]\ndistance[k - 1] = n - array[k - 1] + array[0]\ndistance[2 * k - 1] = n - array[k - 1] + array[0]\nfor i in range(k - 1):\n distance[k + i] = array[i + 1] - array[i]\nminimum = 999999999\ncount = 0\ntotal = 0\ncountLimit = k - 1\nfor i in range(k * 2):\n if count < countLimit:\n total += distance[i]\n count += 1\n else:\n if minimum > total:\n minimum = total\n total += distance[i]\n total -= distance[i - countLimit]\nprint(minimum)\n", "slow_code_sha256": "9164aae6c8839a29a40c85ad8ba3bfc05c8440fc08a285145380122a94d7f972", "slow_id": "p02725_9164aae6c8839a29a40c85ad8ba3bfc05c8440fc08a285145380122a94d7f972", "speedup": 3.467481815354475, "stratum": "2-4", "within_pair_jaccard": 0.17391304347826086, "workload": {"case_count": 100, "description": "On a circular path of circumference K, houses have strictly increasing clockwise positions A_i. Starting at any house, find the minimum distance along the circle needed to visit all N houses; return to the start is not required. Observed inputs: K=2..1000000 (median 100); N=2..200000 (median 50); A_i=0..999999.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1399579, "median": 156.0, "min": 8}, "input_format": ["K N\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200002, "median": 52.0, "min": 4}}} -{"case_ids": ["p02556_case_000", "p02556_case_001", "p02556_case_002", "p02556_case_003", "p02556_case_004", "p02556_case_005", "p02556_case_006", "p02556_case_007", "p02556_case_008", "p02556_case_009", "p02556_case_010", "p02556_case_011", "p02556_case_012", "p02556_case_013", "p02556_case_014", "p02556_case_015", "p02556_case_016", "p02556_case_017", "p02556_case_018", "p02556_case_019", "p02556_case_020", "p02556_case_021", "p02556_case_022", "p02556_case_023", "p02556_case_024", "p02556_case_025", "p02556_case_026", "p02556_case_027", "p02556_case_028", "p02556_case_029", "p02556_case_030", "p02556_case_031", "p02556_case_032", "p02556_case_033", "p02556_case_034", "p02556_case_035", "p02556_case_036", "p02556_case_037", "p02556_case_038", "p02556_case_039", "p02556_case_040", "p02556_case_041", "p02556_case_042", "p02556_case_043", "p02556_case_044", "p02556_case_045", "p02556_case_046", "p02556_case_047", "p02556_case_048", "p02556_case_049", "p02556_case_050", "p02556_case_051", "p02556_case_052", "p02556_case_053", "p02556_case_054", "p02556_case_055", "p02556_case_056", "p02556_case_057", "p02556_case_058", "p02556_case_059", "p02556_case_060", "p02556_case_061", "p02556_case_062", "p02556_case_063", "p02556_case_064", "p02556_case_065", "p02556_case_066", "p02556_case_067", "p02556_case_068", "p02556_case_069", "p02556_case_070", "p02556_case_071", "p02556_case_072", "p02556_case_073", "p02556_case_074", "p02556_case_075", "p02556_case_076", "p02556_case_077", "p02556_case_078", "p02556_case_079", "p02556_case_080", "p02556_case_081", "p02556_case_082", "p02556_case_083", "p02556_case_084", "p02556_case_085", "p02556_case_086", "p02556_case_087", "p02556_case_088", "p02556_case_089", "p02556_case_090", "p02556_case_091", "p02556_case_092", "p02556_case_093", "p02556_case_094", "p02556_case_095", "p02556_case_096", "p02556_case_097", "p02556_case_098", "p02556_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n, *XY = list(map(int, open(0).read().split()))\nX, Y = XY[::2], XY[1::2]\nA = [x + y for x, y in zip(X, Y)]\nB = [x - y for x, y in zip(X, Y)]\nprint((max(max(A) - min(A), max(B) - min(B))))\n", "fast_code_sha256": "fd949ab1cd967cee7273469c8fc8bd1605344b0dba5564378a7d7c8b2d514d3c", "fast_id": "p02556_fd949ab1cd967cee7273469c8fc8bd1605344b0dba5564378a7d7c8b2d514d3c", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n, *XY = list(map(int, open(0).read().split()))\nX, Y = XY[::2], XY[1::2]\nA = [x + y for x, y in zip(X, Y)]\nB = [x - y for x, y in zip(X, Y)]\nprint((max(max(A) - min(A), max(B) - min(B))))\n", "measured_fast_code_sha256": "fd949ab1cd967cee7273469c8fc8bd1605344b0dba5564378a7d7c8b2d514d3c", "measured_slow_code": "input = __import__(\"sys\").stdin.readline\n\n\ndef getdist(a, b):\n return abs(a[0] - b[0]) + abs(a[1] - b[1])\n\n\nn = int(eval(input()))\ns = []\nfor _ in range(n):\n s.append([*list(map(int, input().split()))])\nans = 0\nsx = sorted(s)\nsy = sorted(s, key=lambda x: x[1])\nans = max(ans, getdist(sx[-1], sx[-2]))\nans = max(ans, getdist(sx[0], sx[1]))\nans = max(ans, getdist(sy[-1], sy[-2]))\nans = max(ans, getdist(sy[0], sy[1]))\n\n\ndef ff1(x):\n return x[0] + x[1]\n\n\ndef ff2(x):\n return x[0] - x[1]\n\n\nf1 = sorted(s, key=ff1)\nf2 = sorted(s, key=ff2)\nans = max(ans, getdist(f1[0], f1[-1]))\nans = max(ans, getdist(f1[0], f1[1]))\nans = max(ans, getdist(f1[-1], f1[-2]))\nans = max(ans, getdist(f2[0], f2[-1]))\nans = max(ans, getdist(f2[0], f2[1]))\nans = max(ans, getdist(f2[-1], f2[-2]))\n\n\ndef ff1(x):\n return abs(x[0] + x[1])\n\n\ndef ff2(x):\n return abs(x[0] - x[1])\n\n\nf1 = sorted(s, key=ff1)\nf2 = sorted(s, key=ff2)\nans = max(ans, getdist(f1[0], f1[-1]))\nans = max(ans, getdist(f1[0], f1[1]))\nans = max(ans, getdist(f1[-1], f1[-2]))\nans = max(ans, getdist(f2[0], f2[-1]))\nans = max(ans, getdist(f2[0], f2[1]))\nans = max(ans, getdist(f2[-1], f2[-2]))\nprint(ans)\n", "measured_slow_code_sha256": "c67db545e03815f18cc607c747105c6530daf1f7a0583db740cf0e580c68ee61", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4.158647882761626, "pair_id": "python_v2_f7ed062d693aff6a8a9ea939", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02556", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02556_fd949ab1cd967cee7273469c8fc8bd1605344b0dba5564378a7d7c8b2d514d3c.jsonl.gz", "inputs": "reproduction/python/inputs/p02556.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02556_c67db545e03815f18cc607c747105c6530daf1f7a0583db740cf0e580c68ee61.jsonl.gz"}, "slow_code": "input = __import__(\"sys\").stdin.readline\n\n\ndef getdist(a, b):\n return abs(a[0] - b[0]) + abs(a[1] - b[1])\n\n\nn = int(eval(input()))\ns = []\nfor _ in range(n):\n s.append([*list(map(int, input().split()))])\nans = 0\nsx = sorted(s)\nsy = sorted(s, key=lambda x: x[1])\nans = max(ans, getdist(sx[-1], sx[-2]))\nans = max(ans, getdist(sx[0], sx[1]))\nans = max(ans, getdist(sy[-1], sy[-2]))\nans = max(ans, getdist(sy[0], sy[1]))\n\n\ndef ff1(x):\n return x[0] + x[1]\n\n\ndef ff2(x):\n return x[0] - x[1]\n\n\nf1 = sorted(s, key=ff1)\nf2 = sorted(s, key=ff2)\nans = max(ans, getdist(f1[0], f1[-1]))\nans = max(ans, getdist(f1[0], f1[1]))\nans = max(ans, getdist(f1[-1], f1[-2]))\nans = max(ans, getdist(f2[0], f2[-1]))\nans = max(ans, getdist(f2[0], f2[1]))\nans = max(ans, getdist(f2[-1], f2[-2]))\n\n\ndef ff1(x):\n return abs(x[0] + x[1])\n\n\ndef ff2(x):\n return abs(x[0] - x[1])\n\n\nf1 = sorted(s, key=ff1)\nf2 = sorted(s, key=ff2)\nans = max(ans, getdist(f1[0], f1[-1]))\nans = max(ans, getdist(f1[0], f1[1]))\nans = max(ans, getdist(f1[-1], f1[-2]))\nans = max(ans, getdist(f2[0], f2[-1]))\nans = max(ans, getdist(f2[0], f2[1]))\nans = max(ans, getdist(f2[-1], f2[-2]))\nprint(ans)\n", "slow_code_sha256": "c67db545e03815f18cc607c747105c6530daf1f7a0583db740cf0e580c68ee61", "slow_id": "p02556_c67db545e03815f18cc607c747105c6530daf1f7a0583db740cf0e580c68ee61", "speedup": 4.334296648063026, "stratum": "4-8", "within_pair_jaccard": 0.2653061224489796, "workload": {"case_count": 100, "description": "Find the maximum Manhattan distance |x_i-x_j|+|y_i-y_j| between two distinct indexed points among N. Repeated coordinates are allowed. Observed inputs: N=2..200000 (median 1000); x_i=1..1000000000; y_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 4000007, "median": 19715.0, "min": 28}, "input_format": ["N\nx_1 y_1\n...\nx_N y_N"], "input_format_status": "source_input_section", "input_lines": {"max": 200001, "median": 1001.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 400001, "median": 2001.0, "min": 5}}} -{"case_ids": ["p03762_case_000", "p03762_case_001", "p03762_case_002", "p03762_case_003", "p03762_case_004", "p03762_case_005", "p03762_case_006", "p03762_case_007", "p03762_case_008", "p03762_case_009", "p03762_case_010", "p03762_case_011", "p03762_case_012", "p03762_case_013", "p03762_case_014", "p03762_case_015", "p03762_case_016", "p03762_case_017", "p03762_case_018", "p03762_case_019", "p03762_case_020", "p03762_case_021", "p03762_case_022", "p03762_case_023", "p03762_case_024", "p03762_case_025", "p03762_case_026", "p03762_case_027", "p03762_case_028", "p03762_case_029", "p03762_case_030", "p03762_case_031", "p03762_case_032", "p03762_case_033", "p03762_case_034", "p03762_case_035", "p03762_case_036", "p03762_case_037", "p03762_case_038", "p03762_case_039", "p03762_case_040", "p03762_case_041", "p03762_case_042", "p03762_case_043", "p03762_case_044", "p03762_case_045", "p03762_case_046", "p03762_case_047", "p03762_case_048", "p03762_case_049", "p03762_case_050", "p03762_case_051", "p03762_case_052", "p03762_case_053", "p03762_case_054", "p03762_case_055", "p03762_case_056", "p03762_case_057", "p03762_case_058", "p03762_case_059", "p03762_case_060", "p03762_case_061", "p03762_case_062", "p03762_case_063", "p03762_case_064", "p03762_case_065", "p03762_case_066", "p03762_case_067", "p03762_case_068", "p03762_case_069", "p03762_case_070", "p03762_case_071", "p03762_case_072", "p03762_case_073", "p03762_case_074", "p03762_case_075", "p03762_case_076", "p03762_case_077", "p03762_case_078", "p03762_case_079", "p03762_case_080", "p03762_case_081", "p03762_case_082", "p03762_case_083", "p03762_case_084", "p03762_case_085", "p03762_case_086", "p03762_case_087", "p03762_case_088", "p03762_case_089", "p03762_case_090", "p03762_case_091", "p03762_case_092", "p03762_case_093", "p03762_case_094", "p03762_case_095", "p03762_case_096", "p03762_case_097", "p03762_case_098", "p03762_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N, M = list(map(int, input().split()))\nxs = list(map(int, input().split()))\nys = list(map(int, input().split()))\nMOD = 10**9 + 7\ntotal_w = total_h = 0\nfor n in range(1, N):\n w = xs[n] - xs[n - 1]\n w = (w * n * (N - n)) % MOD\n total_w = (total_w + w) % MOD\nfor n in range(1, M):\n h = ys[n] - ys[n - 1]\n h = (h * n * (M - n)) % MOD\n total_h = (total_h + h) % MOD\nans = (total_w * total_h) % MOD\nprint(ans)\n", "fast_code_sha256": "0dcf2892c6a9c0e921954d31e1616d691c28ba6c91ee7f77510e39a15e8a6e45", "fast_id": "p03762_0dcf2892c6a9c0e921954d31e1616d691c28ba6c91ee7f77510e39a15e8a6e45", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N, M = list(map(int, input().split()))\nxs = list(map(int, input().split()))\nys = list(map(int, input().split()))\nMOD = 10**9 + 7\ntotal_w = total_h = 0\nfor n in range(1, N):\n w = xs[n] - xs[n - 1]\n w = (w * n * (N - n)) % MOD\n total_w = (total_w + w) % MOD\nfor n in range(1, M):\n h = ys[n] - ys[n - 1]\n h = (h * n * (M - n)) % MOD\n total_h = (total_h + h) % MOD\nans = (total_w * total_h) % MOD\nprint(ans)\n", "measured_fast_code_sha256": "0dcf2892c6a9c0e921954d31e1616d691c28ba6c91ee7f77510e39a15e8a6e45", "measured_slow_code": "import sys\nimport numpy as np\n\nMOD = 10**9 + 7\nI = np.array(sys.stdin.read().split(), dtype=np.int64)\nn, m = I[:2]\nx = I[2 : 2 + n]\ny = I[2 + n :]\n\n\ndef main():\n sx = np.cumsum(x) % MOD\n sy = np.cumsum(y) % MOD\n sdx = (\n np.sum((sx[n - 1] - sx[: n - 1]) - x[: n - 1] * ((n - 1) - np.arange(n - 1)))\n % MOD\n )\n sdy = (\n np.sum((sy[m - 1] - sy[: m - 1]) - y[: m - 1] * ((m - 1) - np.arange(m - 1)))\n % MOD\n )\n ans = sdx * sdy % MOD\n return ans\n\n\nif __name__ == \"__main__\":\n ans = main()\n print(ans)\n", "measured_slow_code_sha256": "982e2a132ff9a9ee086902a77e4d38984ae35b417d1949db3c426a0eec331800", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 0.9608206287004952, "pair_id": "python_v2_918087c142d59995ea12c14b", "per_case_slow_code_faster_fraction": 0.68, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03762", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03762_0dcf2892c6a9c0e921954d31e1616d691c28ba6c91ee7f77510e39a15e8a6e45.jsonl.gz", "inputs": "reproduction/python/inputs/p03762.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03762_982e2a132ff9a9ee086902a77e4d38984ae35b417d1949db3c426a0eec331800.jsonl.gz"}, "slow_code": "import sys\nimport numpy as np\n\nMOD = 10**9 + 7\nI = np.array(sys.stdin.read().split(), dtype=np.int64)\nn, m = I[:2]\nx = I[2 : 2 + n]\ny = I[2 + n :]\n\n\ndef main():\n sx = np.cumsum(x) % MOD\n sy = np.cumsum(y) % MOD\n sdx = (\n np.sum((sx[n - 1] - sx[: n - 1]) - x[: n - 1] * ((n - 1) - np.arange(n - 1)))\n % MOD\n )\n sdy = (\n np.sum((sy[m - 1] - sy[: m - 1]) - y[: m - 1] * ((m - 1) - np.arange(m - 1)))\n % MOD\n )\n ans = sdx * sdy % MOD\n return ans\n\n\nif __name__ == \"__main__\":\n ans = main()\n print(ans)\n", "slow_code_sha256": "982e2a132ff9a9ee086902a77e4d38984ae35b417d1949db3c426a0eec331800", "slow_id": "p03762_982e2a132ff9a9ee086902a77e4d38984ae35b417d1949db3c426a0eec331800", "speedup": 6.1846355055681315, "stratum": "4-8", "within_pair_jaccard": 0.16981132075471697, "workload": {"case_count": 100, "description": "Vertical lines x=x_i and horizontal lines y=y_i have strictly increasing coordinate lists. Sum areas of all rectangles formed by choosing two lines of each orientation, modulo 1000000007. Observed inputs: n=2..100000 (median 50000); m=2..100000 (median 50000); x_i=-1000000000..1000000000; y_i=-1000000000..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 2200016, "median": 1038968.5, "min": 44}, "input_format": ["n m\nx_1 ... x_n\ny_1 ... y_m"], "input_format_status": "source_input_section", "input_lines": {"max": 3, "median": 3.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200002, "median": 100003.0, "min": 6}}} -{"case_ids": ["p02760_case_000", "p02760_case_001", "p02760_case_002", "p02760_case_003", "p02760_case_004", "p02760_case_005", "p02760_case_006", "p02760_case_007", "p02760_case_008", "p02760_case_009", "p02760_case_010", "p02760_case_011", "p02760_case_012", "p02760_case_013", "p02760_case_014", "p02760_case_015", "p02760_case_016", "p02760_case_017", "p02760_case_018", "p02760_case_019", "p02760_case_020", "p02760_case_021", "p02760_case_022", "p02760_case_023", "p02760_case_024", "p02760_case_025", "p02760_case_026", "p02760_case_027", "p02760_case_028", "p02760_case_029", "p02760_case_030", "p02760_case_031", "p02760_case_032", "p02760_case_033", "p02760_case_034", "p02760_case_035", "p02760_case_036", "p02760_case_037", "p02760_case_038", "p02760_case_039", "p02760_case_040", "p02760_case_041", "p02760_case_042", "p02760_case_043", "p02760_case_044", "p02760_case_045", "p02760_case_046", "p02760_case_047", "p02760_case_048", "p02760_case_049", "p02760_case_050", "p02760_case_051", "p02760_case_052", "p02760_case_053", "p02760_case_054", "p02760_case_055", "p02760_case_056", "p02760_case_057", "p02760_case_058", "p02760_case_059", "p02760_case_060", "p02760_case_061", "p02760_case_062", "p02760_case_063", "p02760_case_064", "p02760_case_065", "p02760_case_066", "p02760_case_067", "p02760_case_068", "p02760_case_069", "p02760_case_070", "p02760_case_071", "p02760_case_072", "p02760_case_073", "p02760_case_074", "p02760_case_075", "p02760_case_076", "p02760_case_077", "p02760_case_078", "p02760_case_079", "p02760_case_080", "p02760_case_081", "p02760_case_082", "p02760_case_083", "p02760_case_084", "p02760_case_085", "p02760_case_086", "p02760_case_087", "p02760_case_088", "p02760_case_089", "p02760_case_090", "p02760_case_091", "p02760_case_092", "p02760_case_093", "p02760_case_094", "p02760_case_095", "p02760_case_096", "p02760_case_097", "p02760_case_098", "p02760_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "(*a,) = list(map(int, open(0).read().split()))\nprint(\n (\n \"NYoe s\"[\n any(\n t <= set(a.index(b) for b in a[10:])\n for t in (\n {0, 1, 2},\n {0, 3, 6},\n {0, 4, 8},\n {1, 4, 7},\n {2, 4, 6},\n {2, 5, 8},\n {3, 4, 5},\n {6, 7, 8},\n )\n ) :: 2\n ]\n )\n)\n", "fast_code_sha256": "37c64c843161b92469540d6a1ec2a29d2c5b7047a3f26ff46e602802a6763f12", "fast_id": "p02760_37c64c843161b92469540d6a1ec2a29d2c5b7047a3f26ff46e602802a6763f12", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "(*a,) = list(map(int, open(0).read().split()))\nprint(\n (\n \"NYoe s\"[\n any(\n t <= set(a.index(b) for b in a[10:])\n for t in (\n {0, 1, 2},\n {0, 3, 6},\n {0, 4, 8},\n {1, 4, 7},\n {2, 4, 6},\n {2, 5, 8},\n {3, 4, 5},\n {6, 7, 8},\n )\n ) :: 2\n ]\n )\n)\n", "measured_fast_code_sha256": "37c64c843161b92469540d6a1ec2a29d2c5b7047a3f26ff46e602802a6763f12", "measured_slow_code": "def bingo(C):\n if C[0] == C[1] == C[2] and C[0] == 1:\n return True\n elif C[3] == C[4] == C[5] and C[3] == 1:\n return True\n elif C[6] == C[7] == C[8] and C[6] == 1:\n return True\n elif C[0] == C[3] == C[6] and C[0] == 1:\n return True\n elif C[1] == C[4] == C[7] and C[1] == 1:\n return True\n elif C[2] == C[5] == C[8] and C[2] == 1:\n return True\n elif C[0] == C[4] == C[8] and C[0] == 1:\n return True\n elif C[2] == C[4] == C[6] and C[2] == 1:\n return True\n else:\n return False\n\n\nA = []\nfor _ in range(3):\n x1, x2, x3 = list(map(int, input().split()))\n A.append(x1)\n A.append(x2)\n A.append(x3)\nB = [0 for _ in range(9)]\nN = eval(input())\nfor _ in range(N):\n b = eval(input())\n for i, x in enumerate(A):\n if b == x:\n B[i] = 1\nif bingo(B):\n print(\"Yes\")\nelse:\n print(\"No\")\n", "measured_slow_code_sha256": "f38299ae69e3df91aef33ae3aceb49dbec3b74f7b7de24a65da774120e57c8d7", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.3674189642024217, "pair_id": "python_v2_8b298fb8dfe60a7ae1c2c7d2", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02760", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02760_37c64c843161b92469540d6a1ec2a29d2c5b7047a3f26ff46e602802a6763f12.jsonl.gz", "inputs": "reproduction/python/inputs/p02760.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02760_f38299ae69e3df91aef33ae3aceb49dbec3b74f7b7de24a65da774120e57c8d7.jsonl.gz"}, "slow_code": "def bingo(C):\n if C[0] == C[1] == C[2] and C[0] == 1:\n return True\n elif C[3] == C[4] == C[5] and C[3] == 1:\n return True\n elif C[6] == C[7] == C[8] and C[6] == 1:\n return True\n elif C[0] == C[3] == C[6] and C[0] == 1:\n return True\n elif C[1] == C[4] == C[7] and C[1] == 1:\n return True\n elif C[2] == C[5] == C[8] and C[2] == 1:\n return True\n elif C[0] == C[4] == C[8] and C[0] == 1:\n return True\n elif C[2] == C[4] == C[6] and C[2] == 1:\n return True\n else:\n return False\n\n\nA = []\nfor _ in range(3):\n x1, x2, x3 = list(map(int, input().split()))\n A.append(x1)\n A.append(x2)\n A.append(x3)\nB = [0 for _ in range(9)]\nN = eval(input())\nfor _ in range(N):\n b = eval(input())\n for i, x in enumerate(A):\n if b == x:\n B[i] = 1\nif bingo(B):\n print(\"Yes\")\nelse:\n print(\"No\")\n", "slow_code_sha256": "f38299ae69e3df91aef33ae3aceb49dbec3b74f7b7de24a65da774120e57c8d7", "slow_id": "p02760_f38299ae69e3df91aef33ae3aceb49dbec3b74f7b7de24a65da774120e57c8d7", "speedup": 2.4417803791430805, "stratum": "2-4", "within_pair_jaccard": 0.3148148148148148, "workload": {"case_count": 100, "description": "A 3-by-3 bingo board contains distinct integers A_i,j. Mark numbers among N distinct called values b_i and determine whether any row, column or diagonal is fully marked. Observed inputs: N=1..10 (median 6); A_i_j=1..100; b_i=1..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 60, "median": 46.5, "min": 29}, "input_format": ["A_1,1 A_1,2 A_1,3\nA_2,1 A_2,2 A_2,3\nA_3,1 A_3,2 A_3,3\nN\nb_1\n...\nb_N"], "input_format_status": "source_input_section", "input_lines": {"max": 14, "median": 10.0, "min": 5}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 20, "median": 16.0, "min": 11}}} -{"case_ids": ["p00100_case_000", "p00100_case_001", "p00100_case_002", "p00100_case_003", "p00100_case_004", "p00100_case_005", "p00100_case_006", "p00100_case_007", "p00100_case_008", "p00100_case_009", "p00100_case_010", "p00100_case_011", "p00100_case_012", "p00100_case_013", "p00100_case_014", "p00100_case_015", "p00100_case_016", "p00100_case_017", "p00100_case_018", "p00100_case_019", "p00100_case_020", "p00100_case_021", "p00100_case_022", "p00100_case_023", "p00100_case_024", "p00100_case_025", "p00100_case_026", "p00100_case_027", "p00100_case_028", "p00100_case_029", "p00100_case_030", "p00100_case_031", "p00100_case_032", "p00100_case_033", "p00100_case_034", "p00100_case_035", "p00100_case_036", "p00100_case_037", "p00100_case_038", "p00100_case_039", "p00100_case_040", "p00100_case_041", "p00100_case_042", "p00100_case_043", "p00100_case_044", "p00100_case_045", "p00100_case_046", "p00100_case_047", "p00100_case_048", "p00100_case_049", "p00100_case_050", "p00100_case_051", "p00100_case_052", "p00100_case_053", "p00100_case_054", "p00100_case_055", "p00100_case_056", "p00100_case_057", "p00100_case_058", "p00100_case_059", "p00100_case_060", "p00100_case_061", "p00100_case_062", "p00100_case_063", "p00100_case_064", "p00100_case_065", "p00100_case_066", "p00100_case_067", "p00100_case_068", "p00100_case_069", "p00100_case_070", "p00100_case_071", "p00100_case_072", "p00100_case_073", "p00100_case_074", "p00100_case_075", "p00100_case_076", "p00100_case_077", "p00100_case_078", "p00100_case_079", "p00100_case_080", "p00100_case_081", "p00100_case_082", "p00100_case_083", "p00100_case_084", "p00100_case_085", "p00100_case_086", "p00100_case_087", "p00100_case_088", "p00100_case_089", "p00100_case_090", "p00100_case_091", "p00100_case_092", "p00100_case_093", "p00100_case_094", "p00100_case_095", "p00100_case_096", "p00100_case_097", "p00100_case_098", "p00100_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "executable_AST_equal_except_explicit_explanatory_string_removal_and_all_frozen_inputs_checker_pass", "fast_code": "import sys\nfrom collections import OrderedDict\n\n\ndef solve(data):\n\n sums = OrderedDict()\n for id, p, q in data:\n if id in sums:\n sums[id] += p * q\n else:\n sums[id] = p * q\n result = [key for key, value in list(sums.items()) if value >= 1000000]\n return result\n\n\ndef main(args):\n\n while True:\n num = int(eval(input()))\n if num == 0:\n break\n data = []\n for _ in range(num):\n data.append([int(x) for x in input().split(\" \")])\n result = solve(data)\n if result:\n for ele in result:\n print(ele)\n else:\n print(\"NA\")\n\n\nif __name__ == \"__main__\":\n main(sys.argv[1:])\n", "fast_code_sha256": "a4eba5c9d642b103b8b4f0414c710b0072c94b849e28bedb019ea97f6dc9bd14", "fast_id": "p00100_c650910a23f4c80cdec40d71f55f58b53ce601c16cbff163efc652624012aa46", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "# -*- coding: utf-8 -*-\n\"\"\"\nhttp://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0100&lang=jp\n\"\"\"\nimport sys\nfrom collections import OrderedDict\n\n\ndef solve(data):\n # ?£???????1,000,000??\\????????????ID?????????\n # ??????????????????????????°????????´??????????????????ID?????\\??????????????????????????????????????????\n sums = OrderedDict()\n for id, p, q in data:\n if id in sums:\n sums[id] += p * q\n else:\n sums[id] = p * q\n result = [key for key, value in list(sums.items()) if value >= 1000000]\n return result\n\n\ndef main(args):\n # data = []\n # data.append([1001, 2000, 520])\n # data.append([1002, 1800, 450])\n # data.append([1003, 1600, 625])\n # data.append([1001, 200, 1220])\n while True:\n num = int(eval(input()))\n if num == 0:\n break\n data = []\n for _ in range(num):\n data.append([int(x) for x in input().split(\" \")])\n result = solve(data)\n if result:\n for ele in result:\n print(ele)\n else:\n print(\"NA\")\n\n\nif __name__ == \"__main__\":\n main(sys.argv[1:])\n", "measured_fast_code_sha256": "c650910a23f4c80cdec40d71f55f58b53ce601c16cbff163efc652624012aa46", "measured_slow_code": "# coding: utf-8\n# Here your code !\nemployeeSalesList = []\n\n\ndef resetDataset():\n del employeeSalesList[0 : len(employeeSalesList) + 1]\n\n\ndef readDataCount():\n return int(eval(input()))\n\n\ndef searchEmployeeSales(employeeId):\n for data in employeeSalesList:\n if data[0] == employeeId:\n return data\n newData = [employeeId, 0]\n employeeSalesList.append(newData)\n return newData\n\n\ndef printEmployeeOfDataset():\n answerList = [data[0] for data in employeeSalesList if data[1] >= 1000000]\n if len(answerList) == 0:\n print(\"NA\")\n else:\n print((\"\\n\".join(map(str, answerList))))\n\n\nresetDataset()\ndataCount = readDataCount()\nwhile dataCount > 0:\n for _ in range(dataCount):\n employeeId, price, volume = list(map(int, input().split(\" \")))\n employeeSales = searchEmployeeSales(employeeId)\n employeeSales[1] += price * volume\n printEmployeeOfDataset()\n resetDataset()\n dataCount = readDataCount()\n", "measured_slow_code_sha256": "5d1f4cb08fbc43299784771f17b3646fe4993e8fd866609d48d2ebc0e737a39c", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.9411531367689197, "pair_id": "python_v2_2011cef032dcbfc52bf24bf0", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p00100", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p00100_c650910a23f4c80cdec40d71f55f58b53ce601c16cbff163efc652624012aa46.jsonl.gz", "inputs": "reproduction/python/inputs/p00100.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p00100_5d1f4cb08fbc43299784771f17b3646fe4993e8fd866609d48d2ebc0e737a39c.jsonl.gz"}, "slow_code": "employeeSalesList = []\n\n\ndef resetDataset():\n del employeeSalesList[0 : len(employeeSalesList) + 1]\n\n\ndef readDataCount():\n return int(eval(input()))\n\n\ndef searchEmployeeSales(employeeId):\n for data in employeeSalesList:\n if data[0] == employeeId:\n return data\n newData = [employeeId, 0]\n employeeSalesList.append(newData)\n return newData\n\n\ndef printEmployeeOfDataset():\n answerList = [data[0] for data in employeeSalesList if data[1] >= 1000000]\n if len(answerList) == 0:\n print(\"NA\")\n else:\n print((\"\\n\".join(map(str, answerList))))\n\n\nresetDataset()\ndataCount = readDataCount()\nwhile dataCount > 0:\n for _ in range(dataCount):\n employeeId, price, volume = list(map(int, input().split(\" \")))\n employeeSales = searchEmployeeSales(employeeId)\n employeeSales[1] += price * volume\n printEmployeeOfDataset()\n resetDataset()\n dataCount = readDataCount()\n", "slow_code_sha256": "d4669c36b7d92dd1908cad9300dbbe214938350a72f54c414f63ae0b2ccb8749", "slow_id": "p00100_5d1f4cb08fbc43299784771f17b3646fe4993e8fd866609d48d2ebc0e737a39c", "speedup": 3.1919536449247827, "stratum": "2-4", "within_pair_jaccard": 0.328125, "workload": {"case_count": 100, "description": "For each sales dataset, sum price p times quantity q per employee ID. Output IDs with total proceeds at least 1000000 in first-appearance order, or NA if none qualify. IDs may repeat across records; a final zero ends input. Observed inputs: datasets=1; n=5..3999; total_records=5..3999 (median 400); p=1..999957; q=1..99998.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 71109, "median": 7115.5, "min": 65}, "input_format": ["n_1\nid_1 p_1 q_1\n...\nid_(n_1) p_(n_1) q_(n_1)\n[next datasets]\n0"], "input_format_status": "source_input_section", "input_lines": {"max": 4001, "median": 402.0, "min": 7}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 11999, "median": 1202.0, "min": 17}}} -{"case_ids": ["p03078_case_000", "p03078_case_001", "p03078_case_002", "p03078_case_003", "p03078_case_004", "p03078_case_005", "p03078_case_006", "p03078_case_007", "p03078_case_008", "p03078_case_009", "p03078_case_010", "p03078_case_011", "p03078_case_012", "p03078_case_013", "p03078_case_014", "p03078_case_015", "p03078_case_016", "p03078_case_017", "p03078_case_018", "p03078_case_019", "p03078_case_020", "p03078_case_021", "p03078_case_022", "p03078_case_023", "p03078_case_024", "p03078_case_025", "p03078_case_026", "p03078_case_027", "p03078_case_028", "p03078_case_029", "p03078_case_030", "p03078_case_031", "p03078_case_032", "p03078_case_033", "p03078_case_034", "p03078_case_035", "p03078_case_036", "p03078_case_037", "p03078_case_038", "p03078_case_039", "p03078_case_040", "p03078_case_041", "p03078_case_042", "p03078_case_043", "p03078_case_044", "p03078_case_045", "p03078_case_046", "p03078_case_047", "p03078_case_048", "p03078_case_049", "p03078_case_050", "p03078_case_051", "p03078_case_052", "p03078_case_053", "p03078_case_054", "p03078_case_055", "p03078_case_056", "p03078_case_057", "p03078_case_059", "p03078_case_060", "p03078_case_061", "p03078_case_062", "p03078_case_063", "p03078_case_064", "p03078_case_065", "p03078_case_066", "p03078_case_067", "p03078_case_069", "p03078_case_070", "p03078_case_071", "p03078_case_072", "p03078_case_073", "p03078_case_074", "p03078_case_075", "p03078_case_076", "p03078_case_077", "p03078_case_078", "p03078_case_079", "p03078_case_080", "p03078_case_081", "p03078_case_082", "p03078_case_083", "p03078_case_084", "p03078_case_085", "p03078_case_086", "p03078_case_087", "p03078_case_088", "p03078_case_089", "p03078_case_090", "p03078_case_091", "p03078_case_092", "p03078_case_093", "p03078_case_094", "p03078_case_095", "p03078_case_096", "p03078_case_097", "p03078_case_098", "p03078_case_099", "p03078_v2_67e3066218a5a534bee9", "p03078_v2_bf0d7ab34a53dfd7f197"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "X, Y, Z, K = map(int, input().split())\nA = sorted(list(map(int, input().split())), reverse=True)\nB = sorted(list(map(int, input().split())), reverse=True)\nC = sorted(list(map(int, input().split())), reverse=True)\ncomb = []\nfor a in range(X):\n b_max = K // (a + 1)\n for b in range(min(Y, b_max)):\n c_max = K // ((a + 1) * (b + 1))\n for c in range(min(Z, c_max)):\n comb.append(sum([A[a], B[b], C[c]]))\ncomb.sort(reverse=True)\nprint(*comb[:K], sep=\"\\n\")\n", "fast_code_sha256": "683edb5387a0ab080181d9c6ffee63f5a436b05168e99054881c1ca28904e345", "fast_id": "p03078_683edb5387a0ab080181d9c6ffee63f5a436b05168e99054881c1ca28904e345", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "X, Y, Z, K = map(int, input().split())\nA = sorted(list(map(int, input().split())), reverse=True)\nB = sorted(list(map(int, input().split())), reverse=True)\nC = sorted(list(map(int, input().split())), reverse=True)\ncomb = []\nfor a in range(X):\n b_max = K // (a + 1)\n for b in range(min(Y, b_max)):\n c_max = K // ((a + 1) * (b + 1))\n for c in range(min(Z, c_max)):\n comb.append(sum([A[a], B[b], C[c]]))\ncomb.sort(reverse=True)\nprint(*comb[:K], sep=\"\\n\")\n", "measured_fast_code_sha256": "683edb5387a0ab080181d9c6ffee63f5a436b05168e99054881c1ca28904e345", "measured_slow_code": "X, Y, Z, K = map(int, input().split())\nA = list(map(int, input().split()))\nB = list(map(int, input().split()))\nC = list(map(int, input().split()))\nans1 = []\nfor i in range(X):\n for j in range(Y):\n ans1.append(A[i] + B[j])\nans1 = sorted(ans1, reverse=True)[:K]\nans = []\nfor i in range(len(ans1)):\n for j in range(Z):\n ans.append(ans1[i] + C[j])\nprint(*sorted(ans, reverse=True)[:K], sep=\"\\n\")\n", "measured_slow_code_sha256": "fe6f251f7a2a781a4ba8d63d7bc1018c45f2fffcbd5accc0f89b5cd38b02444f", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 16.32382706253857, "pair_id": "python_v2_ee51f9c643da8af49609fa98", "per_case_slow_code_faster_fraction": 0.29, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03078", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03078_683edb5387a0ab080181d9c6ffee63f5a436b05168e99054881c1ca28904e345.jsonl.gz", "inputs": "reproduction/python/inputs/p03078.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03078_fe6f251f7a2a781a4ba8d63d7bc1018c45f2fffcbd5accc0f89b5cd38b02444f.jsonl.gz"}, "slow_code": "X, Y, Z, K = map(int, input().split())\nA = list(map(int, input().split()))\nB = list(map(int, input().split()))\nC = list(map(int, input().split()))\nans1 = []\nfor i in range(X):\n for j in range(Y):\n ans1.append(A[i] + B[j])\nans1 = sorted(ans1, reverse=True)[:K]\nans = []\nfor i in range(len(ans1)):\n for j in range(Z):\n ans.append(ans1[i] + C[j])\nprint(*sorted(ans, reverse=True)[:K], sep=\"\\n\")\n", "slow_code_sha256": "fe6f251f7a2a781a4ba8d63d7bc1018c45f2fffcbd5accc0f89b5cd38b02444f", "slow_id": "p03078_fe6f251f7a2a781a4ba8d63d7bc1018c45f2fffcbd5accc0f89b5cd38b02444f", "speedup": 6.595132364359101, "stratum": "4-8", "within_pair_jaccard": 0.6111111111111112, "workload": {"case_count": 100, "description": "Choose one entry from each of arrays A,B,C of lengths X,Y,Z. Print the K largest resulting sums, retaining multiplicities of different index triples. Observed inputs: X=1..1000 (median 100); Y=1..1000 (median 100); Z=1..1000 (median 400); K=1..3000 (median 3000); A_i=1..10000000000; B_i=1..10000000000; C_i=1..10000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 36020, "median": 6015.5, "min": 14}, "input_format": ["X Y Z K\nA_1 ... A_X\nB_1 ... B_Y\nC_1 ... C_Z"], "input_format_status": "source_input_section", "input_lines": {"max": 4, "median": 4.0, "min": 4}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3004, "median": 1804.0, "min": 7}}} -{"case_ids": ["p03296_case_000", "p03296_case_001", "p03296_case_002", "p03296_case_003", "p03296_case_004", "p03296_case_005", "p03296_case_006", "p03296_case_007", "p03296_case_008", "p03296_case_009", "p03296_case_010", "p03296_case_011", "p03296_case_012", "p03296_case_013", "p03296_case_014", "p03296_case_015", "p03296_case_016", "p03296_case_017", "p03296_case_018", "p03296_case_019", "p03296_case_020", "p03296_case_021", "p03296_case_022", "p03296_case_023", "p03296_case_024", "p03296_case_025", "p03296_case_026", "p03296_case_027", "p03296_case_028", "p03296_case_029", "p03296_case_030", "p03296_case_031", "p03296_case_032", "p03296_case_033", "p03296_case_034", "p03296_case_035", "p03296_case_036", "p03296_case_037", "p03296_case_038", "p03296_case_039", "p03296_case_040", "p03296_case_041", "p03296_case_042", "p03296_case_043", "p03296_case_044", "p03296_case_045", "p03296_case_046", "p03296_case_047", "p03296_case_048", "p03296_case_049", "p03296_case_050", "p03296_case_051", "p03296_case_052", "p03296_case_053", "p03296_case_054", "p03296_case_055", "p03296_case_056", "p03296_case_057", "p03296_case_058", "p03296_case_059", "p03296_case_060", "p03296_case_061", "p03296_case_062", "p03296_case_063", "p03296_case_064", "p03296_case_065", "p03296_case_066", "p03296_case_067", "p03296_case_068", "p03296_case_069", "p03296_case_070", "p03296_case_071", "p03296_case_072", "p03296_case_073", "p03296_case_074", "p03296_case_075", "p03296_case_076", "p03296_case_077", "p03296_case_078", "p03296_case_079", "p03296_case_080", "p03296_case_081", "p03296_case_082", "p03296_case_083", "p03296_case_084", "p03296_case_085", "p03296_case_086", "p03296_case_087", "p03296_case_088", "p03296_case_089", "p03296_case_090", "p03296_case_091", "p03296_case_092", "p03296_case_093", "p03296_case_094", "p03296_case_095", "p03296_case_096", "p03296_case_097", "p03296_case_098", "p03296_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "eval(input())\ncnt = 0\nnow = 0\nres = 0\nfor a in map(int, input().split()):\n if a == now:\n cnt += 1\n else:\n res += cnt // 2\n cnt = 1\n now = a\nprint((res + cnt // 2))\n", "fast_code_sha256": "81f055c5e4fb1ed8650598806dc37db4c6c26cc7a009dbc796162065540cf8cd", "fast_id": "p03296_81f055c5e4fb1ed8650598806dc37db4c6c26cc7a009dbc796162065540cf8cd", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "eval(input())\ncnt = 0\nnow = 0\nres = 0\nfor a in map(int, input().split()):\n if a == now:\n cnt += 1\n else:\n res += cnt // 2\n cnt = 1\n now = a\nprint((res + cnt // 2))\n", "measured_fast_code_sha256": "81f055c5e4fb1ed8650598806dc37db4c6c26cc7a009dbc796162065540cf8cd", "measured_slow_code": "# coding:utf-8\nimport sys\n\nINF = float(\"inf\")\nMOD = 10**9 + 7\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef LI_():\n return [int(x) - 1 for x in sys.stdin.readline().split()]\n\n\ndef LF():\n return [float(x) for x in sys.stdin.readline().split()]\n\n\ndef LS():\n return sys.stdin.readline().split()\n\n\ndef II():\n return int(sys.stdin.readline())\n\n\ndef SI():\n return eval(input())\n\n\ndef main():\n n = II()\n A = LI()\n res = 0\n for i in range(1, n):\n if A[i] == A[i - 1]:\n A[i] = 0\n res += 1\n return res\n\n\nprint((main()))\n", "measured_slow_code_sha256": "a260e38fd68198bd3b846ed815f9f7842be8a43a1a00830ef94d4cac2df063d2", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.325262007769512, "pair_id": "python_v2_3c525262b6fa5c76ba628871", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03296", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03296_81f055c5e4fb1ed8650598806dc37db4c6c26cc7a009dbc796162065540cf8cd.jsonl.gz", "inputs": "reproduction/python/inputs/p03296.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03296_a260e38fd68198bd3b846ed815f9f7842be8a43a1a00830ef94d4cac2df063d2.jsonl.gz"}, "slow_code": "import sys\n\nINF = float(\"inf\")\nMOD = 10**9 + 7\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef LI_():\n return [int(x) - 1 for x in sys.stdin.readline().split()]\n\n\ndef LF():\n return [float(x) for x in sys.stdin.readline().split()]\n\n\ndef LS():\n return sys.stdin.readline().split()\n\n\ndef II():\n return int(sys.stdin.readline())\n\n\ndef SI():\n return eval(input())\n\n\ndef main():\n n = II()\n A = LI()\n res = 0\n for i in range(1, n):\n if A[i] == A[i - 1]:\n A[i] = 0\n res += 1\n return res\n\n\nprint((main()))\n", "slow_code_sha256": "98718a5692a33a090df0421f7d48f7b20be3a15dafddd3f88613c957f01f774b", "slow_id": "p03296_a260e38fd68198bd3b846ed815f9f7842be8a43a1a00830ef94d4cac2df063d2", "speedup": 2.3462734327270764, "stratum": "2-4", "within_pair_jaccard": 0.2682926829268293, "workload": {"case_count": 100, "description": "Change the colors of as few entries as possible so no adjacent pair has equal colors. Each change replaces one color by any of 10000 available colors. Observed inputs: N=2..100 (median 50); A_i=1..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 304, "median": 143.5, "min": 6}, "input_format": ["N\na_1 ... a_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 101, "median": 51.0, "min": 3}}} -{"case_ids": ["p02603_case_000", "p02603_case_001", "p02603_case_002", "p02603_case_003", "p02603_case_004", "p02603_case_005", "p02603_case_006", "p02603_case_007", "p02603_case_008", "p02603_case_009", "p02603_case_010", "p02603_case_011", "p02603_case_012", "p02603_case_013", "p02603_case_014", "p02603_case_015", "p02603_case_016", "p02603_case_017", "p02603_case_018", "p02603_case_019", "p02603_case_020", "p02603_case_021", "p02603_case_022", "p02603_case_023", "p02603_case_024", "p02603_case_025", "p02603_case_026", "p02603_case_027", "p02603_case_028", "p02603_case_029", "p02603_case_030", "p02603_case_031", "p02603_case_032", "p02603_case_033", "p02603_case_034", "p02603_case_035", "p02603_case_036", "p02603_case_037", "p02603_case_038", "p02603_case_039", "p02603_case_040", "p02603_case_041", "p02603_case_042", "p02603_case_043", "p02603_case_044", "p02603_case_045", "p02603_case_046", "p02603_case_047", "p02603_case_048", "p02603_case_049", "p02603_case_050", "p02603_case_051", "p02603_case_052", "p02603_case_053", "p02603_case_054", "p02603_case_055", "p02603_case_056", "p02603_case_057", "p02603_case_058", "p02603_case_059", "p02603_case_060", "p02603_case_061", "p02603_case_062", "p02603_case_063", "p02603_case_064", "p02603_case_065", "p02603_case_066", "p02603_case_067", "p02603_case_068", "p02603_case_069", "p02603_case_070", "p02603_case_071", "p02603_case_072", "p02603_case_073", "p02603_case_074", "p02603_case_075", "p02603_case_076", "p02603_case_077", "p02603_case_078", "p02603_case_079", "p02603_case_080", "p02603_case_081", "p02603_case_082", "p02603_case_083", "p02603_case_084", "p02603_case_085", "p02603_case_086", "p02603_case_087", "p02603_case_088", "p02603_case_089", "p02603_case_090", "p02603_case_091", "p02603_case_092", "p02603_case_093", "p02603_case_094", "p02603_case_095", "p02603_case_096", "p02603_case_097", "p02603_case_098", "p02603_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N = int(eval(input()))\nX = list(map(int, input().split()))\ncur = 1000\nfor i in range(N - 1):\n if X[i] < X[i + 1]:\n stocks = cur // X[i]\n else:\n stocks = 0\n cur += (X[i + 1] - X[i]) * stocks\n\nprint(cur)\n", "fast_code_sha256": "7b08c1fc8b1fd5133260c08b0fffc2b39e9d584ee42aeb17a8af04d879ff4fdf", "fast_id": "p02603_f9dd3a5741f0ff56af92eaec9086e8c584b7108b701aa484054ae549dc542e8b", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N = int(eval(input()))\nX = list(map(int, input().split()))\ncur = 1000\nfor i in range(N - 1):\n if X[i] < X[i + 1]:\n stocks = cur // X[i]\n else:\n stocks = 0\n cur += (X[i + 1] - X[i]) * stocks\n# Last\nprint(cur)\n", "measured_fast_code_sha256": "f9dd3a5741f0ff56af92eaec9086e8c584b7108b701aa484054ae549dc542e8b", "measured_slow_code": "N = int(eval(input()))\nA = [0] + list(map(int, input().split()))\ndp = [0] * (N + 1)\ndp[1] = 1000\nfor i in range(2, N + 1):\n dp[i] = dp[i - 1]\n for j in range(1, i):\n stock = dp[j] // A[j]\n momey = dp[j] + (A[i] - A[j]) * stock\n dp[i] = max(dp[i], momey)\nprint((dp[N]))\n", "measured_slow_code_sha256": "25faafb2b0ca16cedbeb669295357df971e7c7a40120b3549a7cc9eefa9e9f0e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.8717341570938313, "pair_id": "python_v2_3b658f4978dd58754cc8466c", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02603", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02603_f9dd3a5741f0ff56af92eaec9086e8c584b7108b701aa484054ae549dc542e8b.jsonl.gz", "inputs": "reproduction/python/inputs/p02603.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02603_25faafb2b0ca16cedbeb669295357df971e7c7a40120b3549a7cc9eefa9e9f0e.jsonl.gz"}, "slow_code": "N = int(eval(input()))\nA = [0] + list(map(int, input().split()))\ndp = [0] * (N + 1)\ndp[1] = 1000\nfor i in range(2, N + 1):\n dp[i] = dp[i - 1]\n for j in range(1, i):\n stock = dp[j] // A[j]\n momey = dp[j] + (A[i] - A[j]) * stock\n dp[i] = max(dp[i], momey)\nprint((dp[N]))\n", "slow_code_sha256": "25faafb2b0ca16cedbeb669295357df971e7c7a40120b3549a7cc9eefa9e9f0e", "slow_id": "p02603_25faafb2b0ca16cedbeb669295357df971e7c7a40120b3549a7cc9eefa9e9f0e", "speedup": 3.8742265405378413, "stratum": "2-4", "within_pair_jaccard": 0.5555555555555556, "workload": {"case_count": 100, "description": "Given N daily prices a_i for one stock, maximize final cash starting with 1000 and no shares. Buy or sell whole shares any number of times daily, without borrowing cash or shares. Observed inputs: N=2..80 (median 10); a_i=100..200.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 323, "median": 43.0, "min": 10}, "input_format": ["N\na_1 ... a_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 81, "median": 11.0, "min": 3}}} -{"case_ids": ["p00033_case_000", "p00033_case_001", "p00033_case_002", "p00033_case_003", "p00033_case_004", "p00033_case_005", "p00033_case_006", "p00033_case_007", "p00033_case_008", "p00033_case_009", "p00033_case_010", "p00033_case_011", "p00033_case_012", "p00033_case_013", "p00033_case_014", "p00033_case_015", "p00033_case_016", "p00033_case_017", "p00033_case_018", "p00033_case_019", "p00033_case_020", "p00033_case_021", "p00033_case_022", "p00033_case_023", "p00033_case_024", "p00033_case_025", "p00033_case_026", "p00033_case_027", "p00033_case_028", "p00033_case_029", "p00033_case_030", "p00033_case_031", "p00033_case_032", "p00033_case_033", "p00033_case_034", "p00033_case_035", "p00033_case_036", "p00033_case_037", "p00033_case_038", "p00033_case_039", "p00033_case_040", "p00033_case_041", "p00033_case_042", "p00033_case_043", "p00033_case_044", "p00033_case_045", "p00033_case_046", "p00033_case_047", "p00033_case_048", "p00033_case_049", "p00033_case_050", "p00033_case_051", "p00033_case_052", "p00033_case_053", "p00033_case_054", "p00033_case_055", "p00033_case_056", "p00033_case_057", "p00033_case_058", "p00033_case_059", "p00033_case_060", "p00033_case_061", "p00033_case_062", "p00033_case_063", "p00033_case_064", "p00033_case_065", "p00033_case_066", "p00033_case_067", "p00033_case_068", "p00033_case_069", "p00033_case_070", "p00033_case_071", "p00033_case_072", "p00033_case_073", "p00033_case_074", "p00033_case_075", "p00033_case_076", "p00033_case_077", "p00033_case_078", "p00033_case_079", "p00033_case_080", "p00033_case_081", "p00033_case_082", "p00033_case_083", "p00033_case_084", "p00033_case_085", "p00033_case_086", "p00033_case_087", "p00033_case_088", "p00033_case_089", "p00033_case_090", "p00033_case_091", "p00033_case_092", "p00033_case_093", "p00033_case_094", "p00033_case_095", "p00033_case_096", "p00033_case_097", "p00033_case_098", "p00033_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = eval(input())\nfor i in range(n):\n dt = list(map(int, input().split()))\n a1 = 0\n a2 = 0\n for e in dt:\n if e > a1:\n a1 = e\n elif e > a2:\n a2 = e\n else:\n print(\"NO\")\n break\n else:\n print(\"YES\")\n", "fast_code_sha256": "0e5acd07e9302d505debdade53d70f7ad2ff451ebb45e710a9abe8bea9bc151e", "fast_id": "p00033_0e5acd07e9302d505debdade53d70f7ad2ff451ebb45e710a9abe8bea9bc151e", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = eval(input())\nfor i in range(n):\n dt = list(map(int, input().split()))\n a1 = 0\n a2 = 0\n for e in dt:\n if e > a1:\n a1 = e\n elif e > a2:\n a2 = e\n else:\n print(\"NO\")\n break\n else:\n print(\"YES\")\n", "measured_fast_code_sha256": "0e5acd07e9302d505debdade53d70f7ad2ff451ebb45e710a9abe8bea9bc151e", "measured_slow_code": "N = int(input())\nfor c in range(N):\n B = [0]\n C = [0]\n\n def dfs(depth):\n if depth == 10:\n return True\n res = False\n if B[-1] < A[depth]:\n B.append(A[depth])\n res |= dfs(depth + 1)\n del B[-1]\n if C[-1] < A[depth]:\n C.append(A[depth])\n res |= dfs(depth + 1)\n del C[-1]\n return res\n\n A = list(map(int, input().split(\" \")))\n print(\"YES\" if dfs(0) else \"NO\")\n", "measured_slow_code_sha256": "cceb1f2e2d09140b45c7d16169008011222b0bc177f58ecd4909af55948b3e6a", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.8049087370961145, "pair_id": "python_v2_e8c8101531c8d604b3b47a81", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p00033", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p00033_0e5acd07e9302d505debdade53d70f7ad2ff451ebb45e710a9abe8bea9bc151e.jsonl.gz", "inputs": "reproduction/python/inputs/p00033.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p00033_cceb1f2e2d09140b45c7d16169008011222b0bc177f58ecd4909af55948b3e6a.jsonl.gz"}, "slow_code": "N = int(input())\nfor c in range(N):\n B = [0]\n C = [0]\n\n def dfs(depth):\n if depth == 10:\n return True\n res = False\n if B[-1] < A[depth]:\n B.append(A[depth])\n res |= dfs(depth + 1)\n del B[-1]\n if C[-1] < A[depth]:\n C.append(A[depth])\n res |= dfs(depth + 1)\n del C[-1]\n return res\n\n A = list(map(int, input().split(\" \")))\n print(\"YES\" if dfs(0) else \"NO\")\n", "slow_code_sha256": "cceb1f2e2d09140b45c7d16169008011222b0bc177f58ecd4909af55948b3e6a", "slow_id": "p00033_cceb1f2e2d09140b45c7d16169008011222b0bc177f58ecd4909af55948b3e6a", "speedup": 3.252580965006128, "stratum": "2-4", "within_pair_jaccard": 0.358974358974359, "workload": {"case_count": 100, "description": "For each permutation of 1..10, decide whether it can be assigned in arrival order to two stacks so that values increase from bottom to top in each stack. The first integer gives the number of datasets. Observed inputs: datasets=1..10 (median 7); permutation_length=10.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 213, "median": 149.0, "min": 23}, "input_format": ["N\n[permutation of 1..10]\n... (N permutation lines)"], "input_format_status": "source_input_section", "input_lines": {"max": 11, "median": 8.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 101, "median": 71.0, "min": 11}}} -{"case_ids": ["p03008_case_000", "p03008_case_001", "p03008_case_002", "p03008_case_003", "p03008_case_004", "p03008_case_005", "p03008_case_006", "p03008_case_007", "p03008_case_008", "p03008_case_009", "p03008_case_010", "p03008_case_011", "p03008_case_012", "p03008_case_013", "p03008_case_014", "p03008_case_015", "p03008_case_016", "p03008_case_017", "p03008_case_018", "p03008_case_019", "p03008_case_020", "p03008_case_021", "p03008_case_022", "p03008_case_023", "p03008_case_024", "p03008_case_025", "p03008_case_026", "p03008_case_027", "p03008_case_028", "p03008_case_029", "p03008_case_030", "p03008_case_031", "p03008_case_032", "p03008_case_033", "p03008_case_034", "p03008_case_035", "p03008_case_036", "p03008_case_037", "p03008_case_038", "p03008_case_039", "p03008_case_040", "p03008_case_041", "p03008_case_042", "p03008_case_043", "p03008_case_044", "p03008_case_045", "p03008_case_046", "p03008_case_047", "p03008_case_048", "p03008_case_049", "p03008_case_050", "p03008_case_051", "p03008_case_052", "p03008_case_053", "p03008_case_054", "p03008_case_055", "p03008_case_056", "p03008_case_057", "p03008_case_058", "p03008_case_059", "p03008_case_060", "p03008_case_061", "p03008_case_062", "p03008_case_063", "p03008_case_064", "p03008_case_065", "p03008_case_066", "p03008_case_067", "p03008_case_068", "p03008_case_069", "p03008_case_070", "p03008_case_071", "p03008_case_072", "p03008_case_073", "p03008_case_074", "p03008_case_075", "p03008_case_076", "p03008_case_077", "p03008_case_078", "p03008_case_079", "p03008_case_080", "p03008_case_081", "p03008_case_082", "p03008_case_083", "p03008_case_084", "p03008_case_085", "p03008_case_086", "p03008_case_087", "p03008_case_088", "p03008_case_089", "p03008_case_090", "p03008_case_091", "p03008_case_092", "p03008_case_093", "p03008_case_094", "p03008_case_095", "p03008_case_096", "p03008_case_097", "p03008_case_098", "p03008_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\ninput = sys.stdin.readline\nn = int(eval(input()))\nA = tuple(map(int, input().split()))\nB = tuple(map(int, input().split()))\n\n\ndef f(n):\n dp = list(range(n + 1))\n for a, b in zip(A, B):\n if b <= a:\n continue\n for i in range(n + 1):\n if i - a >= 0:\n dp[i] = max(dp[i], dp[i - a] + b)\n return max(dp)\n\n\nm = f(n)\nA, B = B, A\nans = f(m)\nprint(ans)\n", "fast_code_sha256": "5a0fe098f035b1b005f8664b59af24664cf22f7c23e93946bb030597232294e0", "fast_id": "p03008_5a0fe098f035b1b005f8664b59af24664cf22f7c23e93946bb030597232294e0", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\ninput = sys.stdin.readline\nn = int(eval(input()))\nA = tuple(map(int, input().split()))\nB = tuple(map(int, input().split()))\n\n\ndef f(n):\n dp = list(range(n + 1))\n for a, b in zip(A, B):\n if b <= a:\n continue\n for i in range(n + 1):\n if i - a >= 0:\n dp[i] = max(dp[i], dp[i - a] + b)\n return max(dp)\n\n\nm = f(n)\nA, B = B, A\nans = f(m)\nprint(ans)\n", "measured_fast_code_sha256": "5a0fe098f035b1b005f8664b59af24664cf22f7c23e93946bb030597232294e0", "measured_slow_code": "# -*- coding: utf-8 -*-\nimport bisect\nimport heapq\nimport math\nimport random\nimport sys\nfrom collections import Counter, defaultdict, deque\nfrom decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal\nfrom functools import lru_cache, reduce\nfrom itertools import combinations, combinations_with_replacement, product, permutations\nfrom operator import add, mul, sub\n\nsys.setrecursionlimit(100000)\ninput = sys.stdin.readline\n\n\ndef read_int():\n return int(input())\n\n\ndef read_int_n():\n return list(map(int, input().split()))\n\n\ndef read_float():\n return float(input())\n\n\ndef read_float_n():\n return list(map(float, input().split()))\n\n\ndef read_str():\n return input().strip()\n\n\ndef read_str_n():\n return list(map(str, input().split()))\n\n\ndef error_print(*args):\n print(*args, file=sys.stderr)\n\n\ndef mt(f):\n import time\n\n def wrap(*args, **kwargs):\n s = time.time()\n ret = f(*args, **kwargs)\n e = time.time()\n error_print(e - s, \"sec\")\n return ret\n\n return wrap\n\n\n@mt\ndef slv(N, GSB):\n def f(N, gsb):\n dp = [[0] * (N + 1) for _ in range(4)]\n for i in range(3):\n v = gsb[1][i] - gsb[0][i]\n a = gsb[0][i]\n if v > 0:\n for w in range(N + 1):\n dp[i + 1][w] = dp[i][w]\n if w >= a:\n dp[i + 1][w] = max(dp[i][w], dp[i + 1][w - a] + v)\n else:\n dp[i + 1] = dp[i]\n return dp[3][N] + N\n\n tmp = f(N, GSB)\n # print(tmp)\n GSB[0], GSB[1] = GSB[1], GSB[0]\n return f(tmp, GSB)\n\n\ndef main():\n N = read_int()\n GSB = [read_int_n() for _ in range(2)]\n print(slv(N, GSB))\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "9e05cceed4b5188c120d5117ec4afb904f5f5362c84c2aaee500513cc032b2e6", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.332530621560618, "pair_id": "python_v2_e1162ce98fbbb67ea2f3b775", "per_case_slow_code_faster_fraction": 0.02, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03008", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03008_5a0fe098f035b1b005f8664b59af24664cf22f7c23e93946bb030597232294e0.jsonl.gz", "inputs": "reproduction/python/inputs/p03008.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03008_9e05cceed4b5188c120d5117ec4afb904f5f5362c84c2aaee500513cc032b2e6.jsonl.gz"}, "slow_code": "import bisect\nimport heapq\nimport math\nimport random\nimport sys\nfrom collections import Counter, defaultdict, deque\nfrom decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal\nfrom functools import lru_cache, reduce\nfrom itertools import combinations, combinations_with_replacement, product, permutations\nfrom operator import add, mul, sub\n\nsys.setrecursionlimit(100000)\ninput = sys.stdin.readline\n\n\ndef read_int():\n return int(input())\n\n\ndef read_int_n():\n return list(map(int, input().split()))\n\n\ndef read_float():\n return float(input())\n\n\ndef read_float_n():\n return list(map(float, input().split()))\n\n\ndef read_str():\n return input().strip()\n\n\ndef read_str_n():\n return list(map(str, input().split()))\n\n\ndef error_print(*args):\n print(*args, file=sys.stderr)\n\n\ndef mt(f):\n import time\n\n def wrap(*args, **kwargs):\n s = time.time()\n ret = f(*args, **kwargs)\n e = time.time()\n error_print(e - s, \"sec\")\n return ret\n\n return wrap\n\n\n@mt\ndef slv(N, GSB):\n def f(N, gsb):\n dp = [[0] * (N + 1) for _ in range(4)]\n for i in range(3):\n v = gsb[1][i] - gsb[0][i]\n a = gsb[0][i]\n if v > 0:\n for w in range(N + 1):\n dp[i + 1][w] = dp[i][w]\n if w >= a:\n dp[i + 1][w] = max(dp[i][w], dp[i + 1][w - a] + v)\n else:\n dp[i + 1] = dp[i]\n return dp[3][N] + N\n\n tmp = f(N, GSB)\n\n GSB[0], GSB[1] = GSB[1], GSB[0]\n return f(tmp, GSB)\n\n\ndef main():\n N = read_int()\n GSB = [read_int_n() for _ in range(2)]\n print(slv(N, GSB))\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "d268eadad155768f567c1be8a82a20923e759ff7bb21b320758e708fbdea0f6f", "slow_id": "p03008_9e05cceed4b5188c120d5117ec4afb904f5f5362c84c2aaee500513cc032b2e6", "speedup": 2.517111395229704, "stratum": "2-4", "within_pair_jaccard": 0.23958333333333334, "workload": {"case_count": 100, "description": "Start with N currency units and no metals; visit exchanges A,B,A in that order. At exchange X, one gram of each of three metals can be bought or sold for its listed price. Holdings cannot become negative. Maximize final currency, with leftover metals worthless. Observed inputs: N=1..5000 (median 2500); exchange_A_price=1..5000; exchange_B_price=1..5000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 35, "median": 33.0, "min": 14}, "input_format": ["N\ng_A s_A b_A\ng_B s_B b_B"], "input_format_status": "source_input_section", "input_lines": {"max": 3, "median": 3.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 7, "median": 7.0, "min": 7}}} -{"case_ids": ["p03147_case_000", "p03147_case_001", "p03147_case_002", "p03147_case_003", "p03147_case_004", "p03147_case_005", "p03147_case_006", "p03147_case_007", "p03147_case_008", "p03147_case_009", "p03147_case_010", "p03147_case_011", "p03147_case_012", "p03147_case_013", "p03147_case_014", "p03147_case_015", "p03147_case_016", "p03147_case_017", "p03147_case_018", "p03147_case_019", "p03147_case_020", "p03147_case_021", "p03147_case_022", "p03147_case_023", "p03147_case_024", "p03147_case_025", "p03147_case_026", "p03147_case_027", "p03147_case_028", "p03147_case_029", "p03147_case_030", "p03147_case_031", "p03147_case_032", "p03147_case_033", "p03147_case_034", "p03147_case_035", "p03147_case_036", "p03147_case_037", "p03147_case_038", "p03147_case_039", "p03147_case_040", "p03147_case_041", "p03147_case_042", "p03147_case_043", "p03147_case_044", "p03147_case_045", "p03147_case_046", "p03147_case_047", "p03147_case_048", "p03147_case_049", "p03147_case_050", "p03147_case_051", "p03147_case_052", "p03147_case_053", "p03147_case_054", "p03147_case_055", "p03147_case_056", "p03147_case_057", "p03147_case_058", "p03147_case_059", "p03147_case_060", "p03147_case_061", "p03147_case_062", "p03147_case_063", "p03147_case_064", "p03147_case_065", "p03147_case_066", "p03147_case_067", "p03147_case_068", "p03147_case_069", "p03147_case_070", "p03147_case_071", "p03147_case_072", "p03147_case_073", "p03147_case_074", "p03147_case_075", "p03147_case_076", "p03147_case_077", "p03147_case_078", "p03147_case_079", "p03147_case_080", "p03147_case_081", "p03147_case_082", "p03147_case_083", "p03147_case_084", "p03147_case_085", "p03147_case_086", "p03147_case_087", "p03147_case_088", "p03147_case_089", "p03147_case_090", "p03147_case_091", "p03147_case_092", "p03147_case_093", "p03147_case_094", "p03147_case_095", "p03147_case_096", "p03147_case_097", "p03147_case_098", "p03147_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef resolve():\n n = int(eval(input()))\n l = list(map(int, input().split()))\n ans = l[0]\n\n for i in range(len(l) - 1):\n ans += max(l[i + 1] - l[i], 0)\n print(ans)\n\n\nresolve()\n", "fast_code_sha256": "6cf0fbae01df2d11f5ea1421c4f7d2610272c73db432d3cccb91a30ba12264af", "fast_id": "p03147_7e8bf1c73619f52a92f199219e4ce04b3d4dd877ffbb5a7d41f0473776c1a7ae", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef resolve():\n n = int(eval(input()))\n l = list(map(int, input().split()))\n ans = l[0]\n # 数列の値が増えてたらその分を追加で足す必要がある\n # 減ってたら前の花を育ててる途中で水やり完了してる\n for i in range(len(l) - 1):\n ans += max(l[i + 1] - l[i], 0)\n print(ans)\n\n\nresolve()\n", "measured_fast_code_sha256": "7e8bf1c73619f52a92f199219e4ce04b3d4dd877ffbb5a7d41f0473776c1a7ae", "measured_slow_code": "import numpy as np\n\nn = int(eval(input()))\nh = np.array([0] + list(map(int, input().split())))\nr = 0\nwhile np.any(h > 0):\n r += np.sum(np.logical_and(h[1:] > 0, h[:-1] <= 0))\n h -= 1\nprint(r)\n", "measured_slow_code_sha256": "232a30a45b9984917ad37bb950a7a870c82450918c11dc8b73764555b059b604", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 632.067925462139, "pair_id": "python_v2_68bd28566ef22dd53544674f", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03147", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03147_7e8bf1c73619f52a92f199219e4ce04b3d4dd877ffbb5a7d41f0473776c1a7ae.jsonl.gz", "inputs": "reproduction/python/inputs/p03147.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03147_232a30a45b9984917ad37bb950a7a870c82450918c11dc8b73764555b059b604.jsonl.gz"}, "slow_code": "import numpy as np\n\nn = int(eval(input()))\nh = np.array([0] + list(map(int, input().split())))\nr = 0\nwhile np.any(h > 0):\n r += np.sum(np.logical_and(h[1:] > 0, h[:-1] <= 0))\n h -= 1\nprint(r)\n", "slow_code_sha256": "232a30a45b9984917ad37bb950a7a870c82450918c11dc8b73764555b059b604", "slow_id": "p03147_232a30a45b9984917ad37bb950a7a870c82450918c11dc8b73764555b059b604", "speedup": 641.5920771450382, "stratum": "8+", "within_pair_jaccard": 0.3055555555555556, "workload": {"case_count": 100, "description": "N flower heights start at zero. One operation increments every height in a chosen contiguous interval by 1. Minimize operations to obtain exactly the target heights h_i. Observed inputs: N=1..100 (median 50); h_i=0..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 404, "median": 137.0, "min": 4}, "input_format": ["N\nh_1 ... h_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 101, "median": 51.0, "min": 2}}} -{"case_ids": ["p02786_case_000", "p02786_case_001", "p02786_case_002", "p02786_case_003", "p02786_case_004", "p02786_case_005", "p02786_case_006", "p02786_case_007", "p02786_case_008", "p02786_case_009", "p02786_case_010", "p02786_case_011", "p02786_case_012", "p02786_case_013", "p02786_case_014", "p02786_case_015", "p02786_case_016", "p02786_case_017", "p02786_case_018", "p02786_case_019", "p02786_case_020", "p02786_case_021", "p02786_case_022", "p02786_case_023", "p02786_case_024", "p02786_case_025", "p02786_case_026", "p02786_case_027", "p02786_case_028", "p02786_case_029", "p02786_case_030", "p02786_case_031", "p02786_case_032", "p02786_case_033", "p02786_case_034", "p02786_case_035", "p02786_case_036", "p02786_case_037", "p02786_case_038", "p02786_case_039", "p02786_case_040", "p02786_case_041", "p02786_case_042", "p02786_case_043", "p02786_case_044", "p02786_case_045", "p02786_case_046", "p02786_case_047", "p02786_case_048", "p02786_case_049", "p02786_case_050", "p02786_case_051", "p02786_case_052", "p02786_case_053", "p02786_case_054", "p02786_case_055", "p02786_case_056", "p02786_case_057", "p02786_case_058", "p02786_case_059", "p02786_case_060", "p02786_case_061", "p02786_case_062", "p02786_case_063", "p02786_case_064", "p02786_case_065", "p02786_case_066", "p02786_case_067", "p02786_case_068", "p02786_case_069", "p02786_case_070", "p02786_case_071", "p02786_case_072", "p02786_case_073", "p02786_case_074", "p02786_case_075", "p02786_case_076", "p02786_case_077", "p02786_case_078", "p02786_case_079", "p02786_case_080", "p02786_case_081", "p02786_case_082", "p02786_case_083", "p02786_case_084", "p02786_case_085", "p02786_case_086", "p02786_case_087", "p02786_case_088", "p02786_case_089", "p02786_case_090", "p02786_case_091", "p02786_case_092", "p02786_case_093", "p02786_case_094", "p02786_case_095", "p02786_case_096", "p02786_case_097", "p02786_case_098", "p02786_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "N = int(eval(input()))\nNB = format(N, \"0b\")\nK = len(NB)\nprint((2**K - 1))\n", "fast_code_sha256": "c0774071116f1d410c4ba2ff6c10b276620a469926c6fd1b4b8475910d060334", "fast_id": "p02786_c0774071116f1d410c4ba2ff6c10b276620a469926c6fd1b4b8475910d060334", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "N = int(eval(input()))\nNB = format(N, \"0b\")\nK = len(NB)\nprint((2**K - 1))\n", "measured_fast_code_sha256": "c0774071116f1d410c4ba2ff6c10b276620a469926c6fd1b4b8475910d060334", "measured_slow_code": "import numpy as np\n\nH = eval(input())\nH = int(H)\n\n\ndef count(H):\n count = 1\n while True:\n if int(H / 2) == 0:\n break\n else:\n H = int(H / 2)\n count += 1\n continue\n return count\n\n\nA = 0\nfor i in range(int(count(H))):\n A += 2**i\nprint(A)\n", "measured_slow_code_sha256": "09a65063dc765e4cefad5eee9e2b182a86482cf81649dc4a8e732b6ba516a72e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1779.5015178180213, "pair_id": "python_v2_c95ae4ff945c2749863e35fc", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02786", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02786_c0774071116f1d410c4ba2ff6c10b276620a469926c6fd1b4b8475910d060334.jsonl.gz", "inputs": "reproduction/python/inputs/p02786.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02786_09a65063dc765e4cefad5eee9e2b182a86482cf81649dc4a8e732b6ba516a72e.jsonl.gz"}, "slow_code": "import numpy as np\n\nH = eval(input())\nH = int(H)\n\n\ndef count(H):\n count = 1\n while True:\n if int(H / 2) == 0:\n break\n else:\n H = int(H / 2)\n count += 1\n continue\n return count\n\n\nA = 0\nfor i in range(int(count(H))):\n A += 2**i\nprint(A)\n", "slow_code_sha256": "09a65063dc765e4cefad5eee9e2b182a86482cf81649dc4a8e732b6ba516a72e", "slow_id": "p02786_09a65063dc765e4cefad5eee9e2b182a86482cf81649dc4a8e732b6ba516a72e", "speedup": 1781.2920533367517, "stratum": "8+", "within_pair_jaccard": 0.1875, "workload": {"case_count": 100, "description": "One monster initially has health H. An attack kills a health-1 monster; a monster of health X>1 instead becomes two monsters of health floor(X/2). Find the minimum attacks to eliminate all monsters. Observed inputs: H=1..1000000000000 (median 9236181246).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 14, "median": 11.5, "min": 2}, "input_format": ["H"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p00444_case_000", "p00444_case_001", "p00444_case_002", "p00444_case_003", "p00444_case_004", "p00444_case_005", "p00444_case_006", "p00444_case_007", "p00444_case_008", "p00444_case_009", "p00444_case_010", "p00444_case_011", "p00444_case_012", "p00444_case_013", "p00444_case_014", "p00444_case_015", "p00444_case_016", "p00444_case_017", "p00444_case_018", "p00444_case_019", "p00444_case_020", "p00444_case_021", "p00444_case_022", "p00444_case_023", "p00444_case_024", "p00444_case_025", "p00444_case_026", "p00444_case_027", "p00444_case_028", "p00444_case_029", "p00444_case_030", "p00444_case_031", "p00444_case_032", "p00444_case_033", "p00444_case_034", "p00444_case_035", "p00444_case_036", "p00444_case_037", "p00444_case_038", "p00444_case_039", "p00444_case_040", "p00444_case_041", "p00444_case_042", "p00444_case_043", "p00444_case_044", "p00444_case_045", "p00444_case_046", "p00444_case_047", "p00444_case_048", "p00444_case_049", "p00444_case_050", "p00444_case_051", "p00444_case_052", "p00444_case_053", "p00444_case_054", "p00444_case_055", "p00444_case_056", "p00444_case_057", "p00444_case_058", "p00444_case_059", "p00444_case_060", "p00444_case_061", "p00444_case_062", "p00444_case_063", "p00444_case_064", "p00444_case_065", "p00444_case_066", "p00444_case_067", "p00444_case_068", "p00444_case_069", "p00444_case_070", "p00444_case_071", "p00444_case_072", "p00444_case_073", "p00444_case_074", "p00444_case_075", "p00444_case_076", "p00444_case_077", "p00444_case_078", "p00444_case_079", "p00444_case_080", "p00444_case_081", "p00444_case_082", "p00444_case_083", "p00444_case_084", "p00444_case_085", "p00444_case_086", "p00444_case_087", "p00444_case_088", "p00444_case_089", "p00444_case_090", "p00444_case_091", "p00444_case_092", "p00444_case_093", "p00444_case_094", "p00444_case_095", "p00444_case_096", "p00444_case_097", "p00444_case_098", "p00444_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\ncoins = [500, 100, 50, 10, 5, 1]\nfor i in sys.stdin:\n if int(i) == 0:\n break\n n = 1000 - int(i)\n cnt = 0\n while n != 0:\n for i in range(len(coins)):\n if n >= coins[i]:\n n = n - coins[i]\n break\n cnt += 1\n print(cnt)\n", "fast_code_sha256": "8f1cd4d9dbdebf4a15ca40a783ca096b7f26f983da6029d528782b1c2d86cabe", "fast_id": "p00444_8f1cd4d9dbdebf4a15ca40a783ca096b7f26f983da6029d528782b1c2d86cabe", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\ncoins = [500, 100, 50, 10, 5, 1]\nfor i in sys.stdin:\n if int(i) == 0:\n break\n n = 1000 - int(i)\n cnt = 0\n while n != 0:\n for i in range(len(coins)):\n if n >= coins[i]:\n n = n - coins[i]\n break\n cnt += 1\n print(cnt)\n", "measured_fast_code_sha256": "8f1cd4d9dbdebf4a15ca40a783ca096b7f26f983da6029d528782b1c2d86cabe", "measured_slow_code": "import sys\n\ncoins = [1, 5, 10, 50, 100, 500]\nfor i in sys.stdin:\n if int(i) == 0:\n break\n n = 1000 - int(i)\n c = [i for i in range(n + 1)]\n for i in range(len(coins)):\n coin = coins[i]\n if coin <= n:\n c[coin] = 1\n coins.append(coin)\n for coin in coins:\n for p in range(coin + 1, n + 1):\n minc = c[p]\n if minc == 1:\n continue\n c[p] = c[p - coin] + 1 if minc > c[p - coin] + 1 else minc\n print((c[n]))\n", "measured_slow_code_sha256": "5a173aee84cd29871418ac625950658539fc65bec5b272557e76f7056cd3e13a", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 56.17170771397301, "pair_id": "python_v2_4f9206c9276bd49274c6e1da", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p00444", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p00444_8f1cd4d9dbdebf4a15ca40a783ca096b7f26f983da6029d528782b1c2d86cabe.jsonl.gz", "inputs": "reproduction/python/inputs/p00444.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p00444_5a173aee84cd29871418ac625950658539fc65bec5b272557e76f7056cd3e13a.jsonl.gz"}, "slow_code": "import sys\n\ncoins = [1, 5, 10, 50, 100, 500]\nfor i in sys.stdin:\n if int(i) == 0:\n break\n n = 1000 - int(i)\n c = [i for i in range(n + 1)]\n for i in range(len(coins)):\n coin = coins[i]\n if coin <= n:\n c[coin] = 1\n coins.append(coin)\n for coin in coins:\n for p in range(coin + 1, n + 1):\n minc = c[p]\n if minc == 1:\n continue\n c[p] = c[p - coin] + 1 if minc > c[p - coin] + 1 else minc\n print((c[n]))\n", "slow_code_sha256": "5a173aee84cd29871418ac625950658539fc65bec5b272557e76f7056cd3e13a", "slow_id": "p00444_5a173aee84cd29871418ac625950658539fc65bec5b272557e76f7056cd3e13a", "speedup": 29.413145379090334, "stratum": "8+", "within_pair_jaccard": 0.7096774193548387, "workload": {"case_count": 100, "description": "For each price amount, find the minimum number of coins in change from a payment of 1000, using unlimited denominations 500,100,50,10,5,1. Each line supplies one price; a final zero terminates input. Observed inputs: datasets=1..5 (median 3); amount=1..999.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 22, "median": 14.0, "min": 4}, "input_format": ["amount_1\n...\namount_D\n0"], "input_format_status": "source_input_section", "input_lines": {"max": 6, "median": 4.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 6, "median": 4.0, "min": 2}}} -{"case_ids": ["p03556_case_000", "p03556_case_001", "p03556_case_002", "p03556_case_003", "p03556_case_004", "p03556_case_005", "p03556_case_006", "p03556_case_007", "p03556_case_008", "p03556_case_009", "p03556_case_010", "p03556_case_011", "p03556_case_012", "p03556_case_013", "p03556_case_014", "p03556_case_015", "p03556_case_016", "p03556_case_017", "p03556_case_018", "p03556_case_019", "p03556_case_020", "p03556_case_021", "p03556_case_022", "p03556_case_023", "p03556_case_024", "p03556_case_025", "p03556_case_026", "p03556_case_027", "p03556_case_028", "p03556_case_029", "p03556_case_030", "p03556_case_031", "p03556_case_032", "p03556_case_033", "p03556_case_034", "p03556_case_035", "p03556_case_036", "p03556_case_037", "p03556_case_038", "p03556_case_039", "p03556_case_040", "p03556_case_041", "p03556_case_042", "p03556_case_043", "p03556_case_044", "p03556_case_045", "p03556_case_046", "p03556_case_047", "p03556_case_048", "p03556_case_049", "p03556_case_050", "p03556_case_051", "p03556_case_052", "p03556_case_053", "p03556_case_054", "p03556_case_055", "p03556_case_056", "p03556_case_057", "p03556_case_058", "p03556_case_059", "p03556_case_060", "p03556_case_061", "p03556_case_062", "p03556_case_063", "p03556_case_064", "p03556_case_065", "p03556_case_066", "p03556_case_067", "p03556_case_068", "p03556_case_069", "p03556_case_070", "p03556_case_071", "p03556_case_072", "p03556_case_073", "p03556_case_074", "p03556_case_075", "p03556_case_076", "p03556_case_077", "p03556_case_078", "p03556_case_079", "p03556_case_080", "p03556_case_081", "p03556_case_082", "p03556_case_083", "p03556_case_084", "p03556_case_085", "p03556_case_086", "p03556_case_087", "p03556_case_088", "p03556_case_089", "p03556_case_090", "p03556_case_091", "p03556_case_092", "p03556_case_093", "p03556_case_094", "p03556_case_095", "p03556_case_096", "p03556_case_097", "p03556_case_098", "p03556_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n = int(eval(input()))\nfor i in range(n, 0, -1):\n if float(i**0.5).is_integer():\n print(i)\n break\n", "fast_code_sha256": "88e1d1ce78f534e17892e05f61dec43efb221ccce7c17d153d55bb3f6dea1128", "fast_id": "p03556_88e1d1ce78f534e17892e05f61dec43efb221ccce7c17d153d55bb3f6dea1128", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n = int(eval(input()))\nfor i in range(n, 0, -1):\n if float(i**0.5).is_integer():\n print(i)\n break\n", "measured_fast_code_sha256": "88e1d1ce78f534e17892e05f61dec43efb221ccce7c17d153d55bb3f6dea1128", "measured_slow_code": "import numpy as np\n\nN = int(eval(input()))\nmp = int(np.sqrt(N))\nprint((mp**2))\n", "measured_slow_code_sha256": "0a7e4d0d2a2f952e55fd143eaac4cee93ae161ecb36118d4ab495d4a4bf6dac9", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1694.9858040928166, "pair_id": "python_v2_81b6ce83a49dfffc65d106e6", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03556", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03556_88e1d1ce78f534e17892e05f61dec43efb221ccce7c17d153d55bb3f6dea1128.jsonl.gz", "inputs": "reproduction/python/inputs/p03556.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03556_0a7e4d0d2a2f952e55fd143eaac4cee93ae161ecb36118d4ab495d4a4bf6dac9.jsonl.gz"}, "slow_code": "import numpy as np\n\nN = int(eval(input()))\nmp = int(np.sqrt(N))\nprint((mp**2))\n", "slow_code_sha256": "0a7e4d0d2a2f952e55fd143eaac4cee93ae161ecb36118d4ab495d4a4bf6dac9", "slow_id": "p03556_0a7e4d0d2a2f952e55fd143eaac4cee93ae161ecb36118d4ab495d4a4bf6dac9", "speedup": 147.24830045293822, "stratum": "8+", "within_pair_jaccard": 0.16666666666666666, "workload": {"case_count": 100, "description": "Find the largest integer square not exceeding positive input N. Observed inputs: N=1..1000000000 (median 266490422).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 11, "median": 10.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p03183_case_000", "p03183_case_001", "p03183_case_002", "p03183_case_003", "p03183_case_004", "p03183_case_005", "p03183_case_006", "p03183_case_007", "p03183_case_008", "p03183_case_009", "p03183_case_010", "p03183_case_011", "p03183_case_012", "p03183_case_013", "p03183_case_014", "p03183_case_015", "p03183_case_016", "p03183_case_017", "p03183_case_018", "p03183_case_019", "p03183_case_020", "p03183_case_021", "p03183_case_022", "p03183_case_023", "p03183_case_024", "p03183_case_025", "p03183_case_026", "p03183_case_027", "p03183_case_028", "p03183_case_029", "p03183_case_030", "p03183_case_031", "p03183_case_032", "p03183_case_033", "p03183_case_034", "p03183_case_035", "p03183_case_036", "p03183_case_037", "p03183_case_038", "p03183_case_039", "p03183_case_040", "p03183_case_041", "p03183_case_042", "p03183_case_043", "p03183_case_044", "p03183_case_045", "p03183_case_046", "p03183_case_047", "p03183_case_048", "p03183_case_049", "p03183_case_050", "p03183_case_051", "p03183_case_052", "p03183_case_053", "p03183_case_054", "p03183_case_055", "p03183_case_056", "p03183_case_057", "p03183_case_058", "p03183_case_059", "p03183_case_060", "p03183_case_061", "p03183_case_062", "p03183_case_063", "p03183_case_064", "p03183_case_065", "p03183_case_066", "p03183_case_067", "p03183_case_068", "p03183_case_069", "p03183_case_070", "p03183_case_071", "p03183_case_072", "p03183_case_073", "p03183_case_074", "p03183_case_075", "p03183_case_076", "p03183_case_077", "p03183_case_078", "p03183_case_079", "p03183_case_080", "p03183_case_081", "p03183_case_082", "p03183_case_083", "p03183_case_084", "p03183_case_085", "p03183_case_086", "p03183_case_087", "p03183_case_088", "p03183_case_089", "p03183_case_090", "p03183_case_091", "p03183_case_092", "p03183_case_093", "p03183_case_094", "p03183_case_095", "p03183_case_096", "p03183_case_097", "p03183_case_098", "p03183_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\nsys.setrecursionlimit(2147483647)\nINF = 1 << 60\nMOD = 10**9 + 7\ninput = lambda: sys.stdin.readline().rstrip()\n\n\ndef resolve():\n n = int(eval(input()))\n WSV = [tuple(map(int, input().split())) for _ in range(n)]\n WSV.sort(key=lambda tup: tup[0] + tup[1])\n\n res = 0\n solid_max = 10**4\n dp = [-1] * (solid_max + 1)\n dp[0] = 0\n for w0, s0, v in WSV:\n for w in range(solid_max, -1, -1):\n if dp[w] == -1:\n continue\n if w > s0:\n continue\n if w + w0 > solid_max:\n res = max(res, dp[w] + v)\n else:\n dp[w + w0] = max(dp[w + w0], dp[w] + v)\n res = max(res, max(dp))\n print(res)\n\n\nresolve()\n", "fast_code_sha256": "23ec83f55c7e4b6b8f407a26dff911ea30fc8cd13d3543c8d1958de155e3debc", "fast_id": "p03183_29bcc2a8e0525f89522e32d3e5a6be888b3863cd0cedb0f65a55127dba7825b9", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\nsys.setrecursionlimit(2147483647)\nINF = 1 << 60\nMOD = 10**9 + 7 # 998244353\ninput = lambda: sys.stdin.readline().rstrip()\n\n\ndef resolve():\n n = int(eval(input()))\n WSV = [tuple(map(int, input().split())) for _ in range(n)]\n WSV.sort(key=lambda tup: tup[0] + tup[1])\n # dp[i][w] : i 番目まで見て、total weight が w のときの max value\n # solid_max <= 10^4 なので、total weight > 10^4 は考えなくて良い\n res = 0\n solid_max = 10**4\n dp = [-1] * (solid_max + 1)\n dp[0] = 0\n for w0, s0, v in WSV:\n for w in range(solid_max, -1, -1):\n if dp[w] == -1:\n continue\n if w > s0: # w <= s0\n continue\n if w + w0 > solid_max:\n res = max(res, dp[w] + v)\n else:\n dp[w + w0] = max(dp[w + w0], dp[w] + v)\n res = max(res, max(dp))\n print(res)\n\n\nresolve()\n", "measured_fast_code_sha256": "29bcc2a8e0525f89522e32d3e5a6be888b3863cd0cedb0f65a55127dba7825b9", "measured_slow_code": "import sys\n\nsys.setrecursionlimit(2147483647)\nINF = float(\"inf\")\nMOD = 10**9 + 7\ninput = lambda: sys.stdin.readline().rstrip()\n\n\ndef resolve():\n from functools import cmp_to_key\n\n n = int(eval(input()))\n B = [list(map(int, input().split())) for _ in range(n)]\n\n def cmp(a, b):\n va = min(a[1], b[1] - a[0])\n vb = min(b[1], a[1] - b[0])\n if va == vb:\n return 0\n return -1 if (va > vb) else 1\n\n B.sort(key=cmp_to_key(cmp))\n maxS = 20000\n dp = [-INF] * (maxS + 1)\n dp[0] = 0\n for i in range(n):\n w, s, v = B[i]\n ndp = dp[:]\n for total in range(maxS + 1):\n if total <= s and total + s <= maxS:\n ndp[total + w] = max(ndp[total + w], dp[total] + v)\n dp = ndp[:]\n print((max(dp)))\n\n\nresolve()\n", "measured_slow_code_sha256": "961ff7e33dcf41c91be9ccd5c27fe0c80e6fd0d2467fec260e8393b575caab59", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.6688717472419312, "pair_id": "python_v2_44f2b88d52ce8e07b9b049b0", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03183", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03183_29bcc2a8e0525f89522e32d3e5a6be888b3863cd0cedb0f65a55127dba7825b9.jsonl.gz", "inputs": "reproduction/python/inputs/p03183.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03183_961ff7e33dcf41c91be9ccd5c27fe0c80e6fd0d2467fec260e8393b575caab59.jsonl.gz"}, "slow_code": "import sys\n\nsys.setrecursionlimit(2147483647)\nINF = float(\"inf\")\nMOD = 10**9 + 7\ninput = lambda: sys.stdin.readline().rstrip()\n\n\ndef resolve():\n from functools import cmp_to_key\n\n n = int(eval(input()))\n B = [list(map(int, input().split())) for _ in range(n)]\n\n def cmp(a, b):\n va = min(a[1], b[1] - a[0])\n vb = min(b[1], a[1] - b[0])\n if va == vb:\n return 0\n return -1 if (va > vb) else 1\n\n B.sort(key=cmp_to_key(cmp))\n maxS = 20000\n dp = [-INF] * (maxS + 1)\n dp[0] = 0\n for i in range(n):\n w, s, v = B[i]\n ndp = dp[:]\n for total in range(maxS + 1):\n if total <= s and total + s <= maxS:\n ndp[total + w] = max(ndp[total + w], dp[total] + v)\n dp = ndp[:]\n print((max(dp)))\n\n\nresolve()\n", "slow_code_sha256": "961ff7e33dcf41c91be9ccd5c27fe0c80e6fd0d2467fec260e8393b575caab59", "slow_id": "p03183_961ff7e33dcf41c91be9ccd5c27fe0c80e6fd0d2467fec260e8393b575caab59", "speedup": 2.298844935906171, "stratum": "2-4", "within_pair_jaccard": 0.5373134328358209, "workload": {"case_count": 100, "description": "Choose and order some of N blocks into a tower to maximize total value v_i. Block i has weight w_i and can support total weight at most s_i strictly above it. Each block can be used at most once. Observed inputs: N=10..1000 (median 100); w_i=1..10000; s_i=1..10000; v_i=69804..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 21928, "median": 2196.5, "min": 139}, "input_format": ["N\nw_1 s_1 v_1\n...\nw_N s_N v_N"], "input_format_status": "source_input_section", "input_lines": {"max": 1001, "median": 101.0, "min": 11}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3001, "median": 301.0, "min": 31}}} -{"case_ids": ["p03330_case_000", "p03330_case_001", "p03330_case_002", "p03330_case_003", "p03330_case_004", "p03330_case_005", "p03330_case_006", "p03330_case_007", "p03330_case_008", "p03330_case_009", "p03330_case_010", "p03330_case_011", "p03330_case_012", "p03330_case_013", "p03330_case_014", "p03330_case_015", "p03330_case_016", "p03330_case_017", "p03330_case_018", "p03330_case_019", "p03330_case_020", "p03330_case_021", "p03330_case_022", "p03330_case_023", "p03330_case_024", "p03330_case_025", "p03330_case_026", "p03330_case_027", "p03330_case_028", "p03330_case_029", "p03330_case_030", "p03330_case_031", "p03330_case_032", "p03330_case_033", "p03330_case_034", "p03330_case_035", "p03330_case_036", "p03330_case_037", "p03330_case_038", "p03330_case_039", "p03330_case_040", "p03330_case_041", "p03330_case_042", "p03330_case_043", "p03330_case_044", "p03330_case_045", "p03330_case_046", "p03330_case_047", "p03330_case_048", "p03330_case_049", "p03330_case_050", "p03330_case_051", "p03330_case_052", "p03330_case_053", "p03330_case_054", "p03330_case_055", "p03330_case_056", "p03330_case_057", "p03330_case_058", "p03330_case_059", "p03330_case_060", "p03330_case_061", "p03330_case_062", "p03330_case_063", "p03330_case_064", "p03330_case_065", "p03330_case_066", "p03330_case_067", "p03330_case_068", "p03330_case_069", "p03330_case_070", "p03330_case_071", "p03330_case_072", "p03330_case_073", "p03330_case_074", "p03330_case_075", "p03330_case_076", "p03330_case_077", "p03330_case_078", "p03330_case_079", "p03330_case_080", "p03330_case_081", "p03330_case_082", "p03330_case_083", "p03330_case_084", "p03330_case_085", "p03330_case_086", "p03330_case_087", "p03330_case_088", "p03330_case_089", "p03330_case_090", "p03330_case_091", "p03330_case_092", "p03330_case_093", "p03330_case_094", "p03330_case_095", "p03330_case_096", "p03330_case_097", "p03330_case_098", "p03330_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from collections import Counter, defaultdict, deque\nimport sys, heapq, bisect, math, itertools, string, queue\n\nsys.setrecursionlimit(10**8)\nmod = 10**9 + 7\n\n\ndef inp():\n return int(sys.stdin.readline())\n\n\ndef inpl():\n return list(map(int, sys.stdin.readline().split()))\n\n\ndef inpl_str():\n return list(sys.stdin.readline().split())\n\n\ndef inpln(n):\n return list(int(sys.stdin.readline()) for i in range(n))\n\n\nn, C = inpl()\nd = []\nc = []\nfor i in range(C):\n d.append(inpl())\nfor i in range(n):\n c.append(inpl())\nd0 = defaultdict(int)\nd1 = defaultdict(int)\nd2 = defaultdict(int)\ndd = [d0, d1, d2]\nfor y in range(n):\n for x in range(n):\n t = (x + y + 2) % 3\n dd[t][c[x][y]] += 1\n\nres = [[] for i in range(3)]\nfor i in range(C):\n for j in range(3):\n tmp = 0\n for key in list(dd[j].keys()):\n tmp += d[key - 1][i] * dd[j][key]\n res[j].append([i, tmp])\nfor i in range(3):\n res[i].sort(key=lambda x: x[1])\n\nans = mod\nfor i in range(3):\n for j in range(3):\n for k in range(3):\n if (\n res[0][i][0] == res[1][j][0]\n or res[0][i][0] == res[2][k][0]\n or res[2][k][0] == res[1][j][0]\n ):\n continue\n ans = min(res[0][i][1] + res[1][j][1] + res[2][k][1], ans)\nprint(ans)\n", "fast_code_sha256": "75037892fbe0d3f8ec2f6cad07c769abb92a7779fb94ebaf53c5f1ef1cf5a970", "fast_id": "p03330_2bf84a04b2c862b8fc6cada5361225248d707fa385c9679c1031ce69470c3f9c", "fine_bin": 3, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from collections import Counter, defaultdict, deque\nimport sys, heapq, bisect, math, itertools, string, queue\n\nsys.setrecursionlimit(10**8)\nmod = 10**9 + 7\n\n\ndef inp():\n return int(sys.stdin.readline())\n\n\ndef inpl():\n return list(map(int, sys.stdin.readline().split()))\n\n\ndef inpl_str():\n return list(sys.stdin.readline().split())\n\n\ndef inpln(n):\n return list(int(sys.stdin.readline()) for i in range(n))\n\n\nn, C = inpl()\nd = []\nc = []\nfor i in range(C):\n d.append(inpl())\nfor i in range(n):\n c.append(inpl())\nd0 = defaultdict(int)\nd1 = defaultdict(int)\nd2 = defaultdict(int)\ndd = [d0, d1, d2]\nfor y in range(n):\n for x in range(n):\n t = (x + y + 2) % 3\n dd[t][c[x][y]] += 1\n# print(dd)\nres = [[] for i in range(3)]\nfor i in range(C):\n for j in range(3):\n tmp = 0\n for key in list(dd[j].keys()):\n tmp += d[key - 1][i] * dd[j][key]\n res[j].append([i, tmp])\nfor i in range(3):\n res[i].sort(key=lambda x: x[1])\n# print(res)\nans = mod\nfor i in range(3):\n for j in range(3):\n for k in range(3):\n if (\n res[0][i][0] == res[1][j][0]\n or res[0][i][0] == res[2][k][0]\n or res[2][k][0] == res[1][j][0]\n ):\n continue\n ans = min(res[0][i][1] + res[1][j][1] + res[2][k][1], ans)\nprint(ans)\n", "measured_fast_code_sha256": "2bf84a04b2c862b8fc6cada5361225248d707fa385c9679c1031ce69470c3f9c", "measured_slow_code": "from itertools import *\n\nN, C = list(map(int, input().split()))\nD = [list(map(int, input().split())) for _ in [0] * C]\ntri = [[0] * C for _ in [0] * 3]\nfor i in range(N):\n for j, x in enumerate(map(int, input().split())):\n tri[(i + j) % 3][x - 1] += 1\nres = 1 << 30\nfor p in permutations(list(range(C)), 3):\n tt = sum(D[l][p[m]] * tri[m][l] for l in range(C) for m in range(3))\n if tt < res:\n res = tt\nprint(res)\n", "measured_slow_code_sha256": "b97bdcab53517dc8917d09f39912f401cd28969a8fb4fb761200b0bf70667016", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4.799377820924267, "pair_id": "python_v2_a833e9c6ff1b9e18d71c7f09", "per_case_slow_code_faster_fraction": 0.43, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03330", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03330_2bf84a04b2c862b8fc6cada5361225248d707fa385c9679c1031ce69470c3f9c.jsonl.gz", "inputs": "reproduction/python/inputs/p03330.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03330_b97bdcab53517dc8917d09f39912f401cd28969a8fb4fb761200b0bf70667016.jsonl.gz"}, "slow_code": "from itertools import *\n\nN, C = list(map(int, input().split()))\nD = [list(map(int, input().split())) for _ in [0] * C]\ntri = [[0] * C for _ in [0] * 3]\nfor i in range(N):\n for j, x in enumerate(map(int, input().split())):\n tri[(i + j) % 3][x - 1] += 1\nres = 1 << 30\nfor p in permutations(list(range(C)), 3):\n tt = sum(D[l][p[m]] * tri[m][l] for l in range(C) for m in range(3))\n if tt < res:\n res = tt\nprint(res)\n", "slow_code_sha256": "b97bdcab53517dc8917d09f39912f401cd28969a8fb4fb761200b0bf70667016", "slow_id": "p03330_b97bdcab53517dc8917d09f39912f401cd28969a8fb4fb761200b0bf70667016", "speedup": 2.6336808513927825, "stratum": "2-4", "within_pair_jaccard": 0.2564102564102564, "workload": {"case_count": 100, "description": "Repaint an N-by-N grid using C colors with cost D_X,Y for changing X to Y. All cells sharing (row+column) mod 3 must finish with one common color, and the three residue classes must use distinct colors. Minimize total cost. Observed inputs: N=1..500 (median 500); C=3..30 (median 30); grid_cells=1..250000; D_i_j=0..1000; color=1..30.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 753462, "median": 500951.5, "min": 24}, "input_format": ["N C\nD_1,1 ... D_1,C\n...\nD_C,1 ... D_C,C\nc_1,1 ... c_1,N\n...\nc_N,1 ... c_N,N"], "input_format_status": "source_input_section", "input_lines": {"max": 531, "median": 518.5, "min": 5}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 250902, "median": 250464.5, "min": 12}}} -{"case_ids": ["p02994_case_000", "p02994_case_001", "p02994_case_002", "p02994_case_003", "p02994_case_004", "p02994_case_005", "p02994_case_006", "p02994_case_007", "p02994_case_008", "p02994_case_009", "p02994_case_010", "p02994_case_011", "p02994_case_012", "p02994_case_013", "p02994_case_014", "p02994_case_015", "p02994_case_016", "p02994_case_017", "p02994_case_018", "p02994_case_019", "p02994_case_020", "p02994_case_021", "p02994_case_022", "p02994_case_023", "p02994_case_024", "p02994_case_025", "p02994_case_026", "p02994_case_027", "p02994_case_028", "p02994_case_029", "p02994_case_030", "p02994_case_031", "p02994_case_032", "p02994_case_033", "p02994_case_034", "p02994_case_035", "p02994_case_036", "p02994_case_037", "p02994_case_038", "p02994_case_039", "p02994_case_040", "p02994_case_041", "p02994_case_042", "p02994_case_043", "p02994_case_044", "p02994_case_045", "p02994_case_046", "p02994_case_047", "p02994_case_048", "p02994_case_049", "p02994_case_050", "p02994_case_051", "p02994_case_052", "p02994_case_053", "p02994_case_054", "p02994_case_055", "p02994_case_056", "p02994_case_057", "p02994_case_058", "p02994_case_059", "p02994_case_060", "p02994_case_061", "p02994_case_062", "p02994_case_063", "p02994_case_064", "p02994_case_065", "p02994_case_066", "p02994_case_067", "p02994_case_068", "p02994_case_069", "p02994_case_070", "p02994_case_071", "p02994_case_072", "p02994_case_073", "p02994_case_074", "p02994_case_075", "p02994_case_076", "p02994_case_077", "p02994_case_078", "p02994_case_079", "p02994_case_080", "p02994_case_081", "p02994_case_082", "p02994_case_083", "p02994_case_084", "p02994_case_085", "p02994_case_086", "p02994_case_087", "p02994_case_088", "p02994_case_089", "p02994_case_090", "p02994_case_091", "p02994_case_092", "p02994_case_093", "p02994_case_094", "p02994_case_095", "p02994_case_096", "p02994_case_097", "p02994_case_098", "p02994_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n, l = list(map(int, input().split()))\npi = 0\na = []\nabs_a = []\nfor i in range(1, n + 1):\n pi += l + i - 1\nfor i in range(1, n + 1):\n a.append(l + i - 1)\nfor i in range(n):\n abs_a.append(abs(a[i]))\nif max(a) < 0:\n p = pi + min(abs_a)\nelse:\n p = pi - min(abs_a)\nprint(p)\n", "fast_code_sha256": "cec14fadeb960da889ac6d8504f301209ff7dd15e0a289e10950ca76f7801062", "fast_id": "p02994_cec14fadeb960da889ac6d8504f301209ff7dd15e0a289e10950ca76f7801062", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n, l = list(map(int, input().split()))\npi = 0\na = []\nabs_a = []\nfor i in range(1, n + 1):\n pi += l + i - 1\nfor i in range(1, n + 1):\n a.append(l + i - 1)\nfor i in range(n):\n abs_a.append(abs(a[i]))\nif max(a) < 0:\n p = pi + min(abs_a)\nelse:\n p = pi - min(abs_a)\nprint(p)\n", "measured_fast_code_sha256": "cec14fadeb960da889ac6d8504f301209ff7dd15e0a289e10950ca76f7801062", "measured_slow_code": "import copy\n\nN, L = list(map(int, input().split()))\napple_taste = [L + i for i in range(N)]\npie_taste = sum(apple_taste)\nmin_diff = 100000\nfor i in range(N):\n ap = copy.deepcopy(apple_taste)\n ap[i] = 0\n pie_taste2 = sum(ap)\n diff = abs(pie_taste - pie_taste2)\n if diff < min_diff:\n min_diff = diff\n min_index = i\napple_taste[min_index] = 0\nprint((sum(apple_taste)))\n", "measured_slow_code_sha256": "d149410d46bed6b8690e0200021300cc5187b2715c0717e93e6c392866beb39e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 46.230475380039096, "pair_id": "python_v2_1280d34a556cbb4d2cbfce96", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02994", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02994_cec14fadeb960da889ac6d8504f301209ff7dd15e0a289e10950ca76f7801062.jsonl.gz", "inputs": "reproduction/python/inputs/p02994.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02994_d149410d46bed6b8690e0200021300cc5187b2715c0717e93e6c392866beb39e.jsonl.gz"}, "slow_code": "import copy\n\nN, L = list(map(int, input().split()))\napple_taste = [L + i for i in range(N)]\npie_taste = sum(apple_taste)\nmin_diff = 100000\nfor i in range(N):\n ap = copy.deepcopy(apple_taste)\n ap[i] = 0\n pie_taste2 = sum(ap)\n diff = abs(pie_taste - pie_taste2)\n if diff < min_diff:\n min_diff = diff\n min_index = i\napple_taste[min_index] = 0\nprint((sum(apple_taste)))\n", "slow_code_sha256": "d149410d46bed6b8690e0200021300cc5187b2715c0717e93e6c392866beb39e", "slow_id": "p02994_d149410d46bed6b8690e0200021300cc5187b2715c0717e93e6c392866beb39e", "speedup": 35.81370504369191, "stratum": "8+", "within_pair_jaccard": 0.34210526315789475, "workload": {"case_count": 100, "description": "N apples have flavors L,L+1,...,L+N-1, possibly negative. Remove one apple to minimize the absolute difference between the remaining flavor sum and the original total; output the remaining sum. Observed inputs: N=2..200 (median 100); L=-100..100 (median -14).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 9, "median": 7.0, "min": 4}, "input_format": ["N L"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p03212_case_000", "p03212_case_001", "p03212_case_002", "p03212_case_003", "p03212_case_004", "p03212_case_005", "p03212_case_006", "p03212_case_007", "p03212_case_008", "p03212_case_009", "p03212_case_010", "p03212_case_011", "p03212_case_012", "p03212_case_013", "p03212_case_014", "p03212_case_015", "p03212_case_016", "p03212_case_017", "p03212_case_018", "p03212_case_019", "p03212_case_020", "p03212_case_021", "p03212_case_022", "p03212_case_023", "p03212_case_024", "p03212_case_025", "p03212_case_026", "p03212_case_027", "p03212_case_028", "p03212_case_029", "p03212_case_030", "p03212_case_031", "p03212_case_032", "p03212_case_033", "p03212_case_034", "p03212_case_035", "p03212_case_036", "p03212_case_037", "p03212_case_038", "p03212_case_039", "p03212_case_040", "p03212_case_041", "p03212_case_042", "p03212_case_043", "p03212_case_044", "p03212_case_045", "p03212_case_046", "p03212_case_047", "p03212_case_048", "p03212_case_049", "p03212_case_050", "p03212_case_051", "p03212_case_052", "p03212_case_053", "p03212_case_054", "p03212_case_055", "p03212_case_056", "p03212_case_057", "p03212_case_058", "p03212_case_059", "p03212_case_060", "p03212_case_061", "p03212_case_062", "p03212_case_063", "p03212_case_064", "p03212_case_065", "p03212_case_066", "p03212_case_067", "p03212_case_068", "p03212_case_069", "p03212_case_070", "p03212_case_071", "p03212_case_072", "p03212_case_073", "p03212_case_074", "p03212_case_075", "p03212_case_076", "p03212_case_077", "p03212_case_078", "p03212_case_079", "p03212_case_080", "p03212_case_081", "p03212_case_082", "p03212_case_083", "p03212_case_084", "p03212_case_085", "p03212_case_086", "p03212_case_087", "p03212_case_088", "p03212_case_089", "p03212_case_090", "p03212_case_091", "p03212_case_092", "p03212_case_093", "p03212_case_094", "p03212_case_095", "p03212_case_096", "p03212_case_097", "p03212_case_098", "p03212_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import itertools\n\nn = int(eval(input()))\ndigits = [3, 5, 7]\n\n\ndef count(digits, n):\n A = []\n p = 3\n while True:\n for tup in itertools.product(digits, repeat=p):\n a = int(\"\".join(list(map(str, tup))))\n if a > n:\n break\n A.append(a)\n else:\n p += 1\n continue\n break\n return A\n\n\nlst = count(digits, n)\ncnt = 0\nfor v in lst:\n if all(str(v).count(c) > 0 for c in \"753\"):\n cnt += 1\nprint(cnt)\n", "fast_code_sha256": "5f22003ad9129e73631d6ea547af7cf898b1e7d148c95168a27f869fed543af2", "fast_id": "p03212_5f22003ad9129e73631d6ea547af7cf898b1e7d148c95168a27f869fed543af2", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import itertools\n\nn = int(eval(input()))\ndigits = [3, 5, 7]\n\n\ndef count(digits, n):\n A = []\n p = 3\n while True:\n for tup in itertools.product(digits, repeat=p):\n a = int(\"\".join(list(map(str, tup))))\n if a > n:\n break\n A.append(a)\n else:\n p += 1\n continue\n break\n return A\n\n\nlst = count(digits, n)\ncnt = 0\nfor v in lst:\n if all(str(v).count(c) > 0 for c in \"753\"):\n cnt += 1\nprint(cnt)\n", "measured_fast_code_sha256": "5f22003ad9129e73631d6ea547af7cf898b1e7d148c95168a27f869fed543af2", "measured_slow_code": "import copy\n\nword = \"753\"\n\n\ndef dfs(n):\n ret = 0\n num = 0 if not n else int(\"\".join(n))\n if N < num:\n return ret\n ret += 1 if len(set(\"\".join(n)) & set(word)) == len(word) else 0\n for c in word:\n tmp = copy.deepcopy(n)\n n.append(c)\n ret += dfs(n)\n n = tmp\n return ret\n\n\nN = int(eval(input()))\nprint((dfs([])))\n", "measured_slow_code_sha256": "9b823eea975a23a20587bc34ffa695ba9d6a5f099d4923f94ee756f58c3ecb65", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 5.653147620805186, "pair_id": "python_v2_a73465805fb1915d211a3171", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03212", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03212_5f22003ad9129e73631d6ea547af7cf898b1e7d148c95168a27f869fed543af2.jsonl.gz", "inputs": "reproduction/python/inputs/p03212.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03212_9b823eea975a23a20587bc34ffa695ba9d6a5f099d4923f94ee756f58c3ecb65.jsonl.gz"}, "slow_code": "import copy\n\nword = \"753\"\n\n\ndef dfs(n):\n ret = 0\n num = 0 if not n else int(\"\".join(n))\n if N < num:\n return ret\n ret += 1 if len(set(\"\".join(n)) & set(word)) == len(word) else 0\n for c in word:\n tmp = copy.deepcopy(n)\n n.append(c)\n ret += dfs(n)\n n = tmp\n return ret\n\n\nN = int(eval(input()))\nprint((dfs([])))\n", "slow_code_sha256": "9b823eea975a23a20587bc34ffa695ba9d6a5f099d4923f94ee756f58c3ecb65", "slow_id": "p03212_9b823eea975a23a20587bc34ffa695ba9d6a5f099d4923f94ee756f58c3ecb65", "speedup": 5.450261257036899, "stratum": "4-8", "within_pair_jaccard": 0.34615384615384615, "workload": {"case_count": 100, "description": "Count positive integers at most N whose decimal digits use only 3,5,7 and contain each of those three digits at least once. Observed inputs: N=1..999999999 (median 133260161.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 10, "median": 10.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p02971_case_000", "p02971_case_001", "p02971_case_002", "p02971_case_003", "p02971_case_004", "p02971_case_005", "p02971_case_006", "p02971_case_007", "p02971_case_008", "p02971_case_009", "p02971_case_010", "p02971_case_011", "p02971_case_012", "p02971_case_013", "p02971_case_014", "p02971_case_015", "p02971_case_016", "p02971_case_017", "p02971_case_018", "p02971_case_019", "p02971_case_020", "p02971_case_021", "p02971_case_022", "p02971_case_023", "p02971_case_024", "p02971_case_025", "p02971_case_026", "p02971_case_027", "p02971_case_028", "p02971_case_029", "p02971_case_030", "p02971_case_031", "p02971_case_032", "p02971_case_033", "p02971_case_034", "p02971_case_035", "p02971_case_036", "p02971_case_037", "p02971_case_038", "p02971_case_039", "p02971_case_040", "p02971_case_041", "p02971_case_042", "p02971_case_043", "p02971_case_044", "p02971_case_045", "p02971_case_046", "p02971_case_047", "p02971_case_048", "p02971_case_049", "p02971_case_050", "p02971_case_051", "p02971_case_052", "p02971_case_053", "p02971_case_054", "p02971_case_055", "p02971_case_056", "p02971_case_057", "p02971_case_058", "p02971_case_059", "p02971_case_060", "p02971_case_061", "p02971_case_062", "p02971_case_063", "p02971_case_064", "p02971_case_065", "p02971_case_066", "p02971_case_067", "p02971_case_068", "p02971_case_069", "p02971_case_070", "p02971_case_071", "p02971_case_072", "p02971_case_073", "p02971_case_074", "p02971_case_075", "p02971_case_076", "p02971_case_077", "p02971_case_078", "p02971_case_079", "p02971_case_080", "p02971_case_081", "p02971_case_082", "p02971_case_083", "p02971_case_084", "p02971_case_085", "p02971_case_086", "p02971_case_087", "p02971_case_088", "p02971_case_089", "p02971_case_090", "p02971_case_091", "p02971_case_092", "p02971_case_093", "p02971_case_094", "p02971_case_095", "p02971_case_096", "p02971_case_097", "p02971_case_098", "p02971_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from sys import stdin\n\nn = int(stdin.readline().rstrip())\nli = list(int(stdin.readline().rstrip()) for _ in range(n))\nli_to = sorted(li)\none = li_to[-1]\ntwo = li_to[-2]\nfor i in range(n):\n if one == li[i]:\n print(two)\n else:\n print(one)\n", "fast_code_sha256": "410642ef7e1a2dd48a9843ed5e1a9b68d0a1e61878a3f3464b7a63a9e7d8384e", "fast_id": "p02971_410642ef7e1a2dd48a9843ed5e1a9b68d0a1e61878a3f3464b7a63a9e7d8384e", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from sys import stdin\n\nn = int(stdin.readline().rstrip())\nli = list(int(stdin.readline().rstrip()) for _ in range(n))\nli_to = sorted(li)\none = li_to[-1]\ntwo = li_to[-2]\nfor i in range(n):\n if one == li[i]:\n print(two)\n else:\n print(one)\n", "measured_fast_code_sha256": "410642ef7e1a2dd48a9843ed5e1a9b68d0a1e61878a3f3464b7a63a9e7d8384e", "measured_slow_code": "n = int(eval(input()))\na = []\nfor i in range(n):\n a.append(int(eval(input())))\nb = sorted(a)\nm, M = b[-2:]\nfor i in range(n):\n print((m if a[i] == M else M))\n", "measured_slow_code_sha256": "c4ac5217179dc45950367c7eede5b37a5e88ab5e6987931ac99876dde4ea6d9c", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4.160777844158785, "pair_id": "python_v2_f6a89b36265e2e7e121914f4", "per_case_slow_code_faster_fraction": 0.03, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02971", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02971_410642ef7e1a2dd48a9843ed5e1a9b68d0a1e61878a3f3464b7a63a9e7d8384e.jsonl.gz", "inputs": "reproduction/python/inputs/p02971.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02971_c4ac5217179dc45950367c7eede5b37a5e88ab5e6987931ac99876dde4ea6d9c.jsonl.gz"}, "slow_code": "n = int(eval(input()))\na = []\nfor i in range(n):\n a.append(int(eval(input())))\nb = sorted(a)\nm, M = b[-2:]\nfor i in range(n):\n print((m if a[i] == M else M))\n", "slow_code_sha256": "c4ac5217179dc45950367c7eede5b37a5e88ab5e6987931ac99876dde4ea6d9c", "slow_id": "p02971_c4ac5217179dc45950367c7eede5b37a5e88ab5e6987931ac99876dde4ea6d9c", "speedup": 2.862939741775809, "stratum": "2-4", "within_pair_jaccard": 0.3548387096774194, "workload": {"case_count": 100, "description": "For each position i of an N-element integer sequence, output the maximum among all other N-1 entries. Equal values at different positions remain separate entries. Observed inputs: N=2..200000 (median 550); A_i=1..200000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1400007, "median": 2604.5, "min": 8}, "input_format": ["N\nA_1\n...\nA_N"], "input_format_status": "source_input_section", "input_lines": {"max": 200001, "median": 551.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200001, "median": 551.0, "min": 3}}} -{"case_ids": ["p02418_case_000", "p02418_case_001", "p02418_case_002", "p02418_case_003", "p02418_case_004", "p02418_case_005", "p02418_case_006", "p02418_case_007", "p02418_case_008", "p02418_case_009", "p02418_case_010", "p02418_case_011", "p02418_case_012", "p02418_case_013", "p02418_case_014", "p02418_case_015", "p02418_case_016", "p02418_case_017", "p02418_case_018", "p02418_case_019", "p02418_case_020", "p02418_case_021", "p02418_case_022", "p02418_case_023", "p02418_case_024", "p02418_case_025", "p02418_case_026", "p02418_case_027", "p02418_case_028", "p02418_case_029", "p02418_case_030", "p02418_case_031", "p02418_case_032", "p02418_case_033", "p02418_case_034", "p02418_case_035", "p02418_case_036", "p02418_case_037", "p02418_case_038", "p02418_case_039", "p02418_case_040", "p02418_case_041", "p02418_case_042", "p02418_case_043", "p02418_case_044", "p02418_case_045", "p02418_case_046", "p02418_case_047", "p02418_case_048", "p02418_case_049", "p02418_case_050", "p02418_case_051", "p02418_case_052", "p02418_case_053", "p02418_case_054", "p02418_case_055", "p02418_case_056", "p02418_case_057", "p02418_case_058", "p02418_case_059", "p02418_case_060", "p02418_case_061", "p02418_case_062", "p02418_case_063", "p02418_case_064", "p02418_case_065", "p02418_case_066", "p02418_case_067", "p02418_case_068", "p02418_case_069", "p02418_case_070", "p02418_case_071", "p02418_case_072", "p02418_case_073", "p02418_case_074", "p02418_case_075", "p02418_case_076", "p02418_case_077", "p02418_case_078", "p02418_case_079", "p02418_case_080", "p02418_case_081", "p02418_case_082", "p02418_case_083", "p02418_case_084", "p02418_case_085", "p02418_case_086", "p02418_case_087", "p02418_case_088", "p02418_case_089", "p02418_case_090", "p02418_case_091", "p02418_case_092", "p02418_case_093", "p02418_case_094", "p02418_case_095", "p02418_case_096", "p02418_case_097", "p02418_case_098", "p02418_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "executable_AST_equal_except_explicit_explanatory_string_removal_and_all_frozen_inputs_checker_pass", "fast_code": "ring = input() * 2\nword = input()\nif word in ring:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "fast_code_sha256": "3ed535ed0bc6c202b0386a960b00e5549d575062c87ec6b3d7cedb112a9c2f5e", "fast_id": "p02418_3ed535ed0bc6c202b0386a960b00e5549d575062c87ec6b3d7cedb112a9c2f5e", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "ring = input() * 2\nword = input()\nif word in ring:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "measured_fast_code_sha256": "3ed535ed0bc6c202b0386a960b00e5549d575062c87ec6b3d7cedb112a9c2f5e", "measured_slow_code": "# -*- coding: utf-8 -*-\n\"\"\"\nhttp://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_8_D&lang=jp\n\"\"\"\nimport sys\nfrom sys import stdin\n\ninput = stdin.readline\n\n\ndef main(args):\n s = input().strip()\n p = input().strip()\n s = s + s[:-1]\n if p in s:\n print(\"Yes\")\n else:\n print(\"No\")\n\n\nif __name__ == \"__main__\":\n main(sys.argv[1:])\n", "measured_slow_code_sha256": "4a465a7c40e8301396e930b29aaf192efcb0d409e3d2d3b58e59d606c0aba5fa", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.2805079950235214, "pair_id": "python_v2_a9163a8265683c075e567224", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02418", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02418_3ed535ed0bc6c202b0386a960b00e5549d575062c87ec6b3d7cedb112a9c2f5e.jsonl.gz", "inputs": "reproduction/python/inputs/p02418.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02418_4a465a7c40e8301396e930b29aaf192efcb0d409e3d2d3b58e59d606c0aba5fa.jsonl.gz"}, "slow_code": "import sys\nfrom sys import stdin\n\ninput = stdin.readline\n\n\ndef main(args):\n s = input().strip()\n p = input().strip()\n s = s + s[:-1]\n if p in s:\n print(\"Yes\")\n else:\n print(\"No\")\n\n\nif __name__ == \"__main__\":\n main(sys.argv[1:])\n", "slow_code_sha256": "a7502251daa34c9d1f4077de1ba0b7e4db196550bc7d1d061290578a54373e1c", "slow_id": "p02418_4a465a7c40e8301396e930b29aaf192efcb0d409e3d2d3b58e59d606c0aba5fa", "speedup": 2.2802308203008734, "stratum": "2-4", "within_pair_jaccard": 0.2692307692307692, "workload": {"case_count": 100, "description": "Decide whether lowercase pattern p appears contiguously in circular text s, allowing a match to cross the end-to-start boundary. The pattern is nonempty and no longer than the ring text. Observed inputs: s_length=1..100 (median 50); p_length=1..100 (median 15).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 202, "median": 89.5, "min": 4}, "input_format": ["s\np"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p02699_case_000", "p02699_case_001", "p02699_case_002", "p02699_case_003", "p02699_case_004", "p02699_case_005", "p02699_case_006", "p02699_case_007", "p02699_case_008", "p02699_case_009", "p02699_case_010", "p02699_case_011", "p02699_case_012", "p02699_case_013", "p02699_case_014", "p02699_case_015", "p02699_case_016", "p02699_case_017", "p02699_case_018", "p02699_case_019", "p02699_case_020", "p02699_case_021", "p02699_case_022", "p02699_case_023", "p02699_case_024", "p02699_case_025", "p02699_case_026", "p02699_case_027", "p02699_case_028", "p02699_case_029", "p02699_case_030", "p02699_case_031", "p02699_case_032", "p02699_case_033", "p02699_case_034", "p02699_case_035", "p02699_case_036", "p02699_case_037", "p02699_case_038", "p02699_case_039", "p02699_case_040", "p02699_case_041", "p02699_case_042", "p02699_case_043", "p02699_case_044", "p02699_case_045", "p02699_case_046", "p02699_case_047", "p02699_case_048", "p02699_case_049", "p02699_case_050", "p02699_case_051", "p02699_case_052", "p02699_case_053", "p02699_case_054", "p02699_case_055", "p02699_case_056", "p02699_case_057", "p02699_case_058", "p02699_case_059", "p02699_case_060", "p02699_case_061", "p02699_case_062", "p02699_case_063", "p02699_case_064", "p02699_case_065", "p02699_case_066", "p02699_case_067", "p02699_case_068", "p02699_case_069", "p02699_case_070", "p02699_case_071", "p02699_case_072", "p02699_case_073", "p02699_case_074", "p02699_case_075", "p02699_case_076", "p02699_case_077", "p02699_case_078", "p02699_case_079", "p02699_case_080", "p02699_case_081", "p02699_case_082", "p02699_case_083", "p02699_case_084", "p02699_case_085", "p02699_case_086", "p02699_case_087", "p02699_case_088", "p02699_case_089", "p02699_case_090", "p02699_case_091", "p02699_case_092", "p02699_case_093", "p02699_case_094", "p02699_case_095", "p02699_case_096", "p02699_case_097", "p02699_case_098", "p02699_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def issafe(S, W):\n if S > W:\n return \"safe\"\n return \"unsafe\"\n\n\nS, W = list(map(int, input().split()))\nprint((issafe(S, W)))\n", "fast_code_sha256": "925a90965952d07731bd01b01ce659b8f80e38b52ed1f2948136c1fb852a8ede", "fast_id": "p02699_925a90965952d07731bd01b01ce659b8f80e38b52ed1f2948136c1fb852a8ede", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def issafe(S, W):\n if S > W:\n return \"safe\"\n return \"unsafe\"\n\n\nS, W = list(map(int, input().split()))\nprint((issafe(S, W)))\n", "measured_fast_code_sha256": "925a90965952d07731bd01b01ce659b8f80e38b52ed1f2948136c1fb852a8ede", "measured_slow_code": "#!/usr/bin/env python3\nimport sys\nimport math\nfrom bisect import bisect_right as br\nfrom bisect import bisect_left as bl\n\nsys.setrecursionlimit(2147483647)\nfrom heapq import heappush, heappop, heappushpop\nfrom collections import defaultdict\nfrom itertools import accumulate\nfrom collections import Counter\nfrom collections import deque\nfrom operator import itemgetter\nfrom itertools import permutations\n\nmod = 10**9 + 7\ninf = float(\"inf\")\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\ns, w = LI()\nif s <= w:\n print(\"unsafe\")\nelse:\n print(\"safe\")\n", "measured_slow_code_sha256": "f2cc4bf0fe7fb5f3b139743ef8c168fecc1b7ec24219170b0370aa9ddc4eb707", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.6770801461282403, "pair_id": "python_v2_6b68b4d3faae34f2569a7654", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02699", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02699_925a90965952d07731bd01b01ce659b8f80e38b52ed1f2948136c1fb852a8ede.jsonl.gz", "inputs": "reproduction/python/inputs/p02699.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02699_f2cc4bf0fe7fb5f3b139743ef8c168fecc1b7ec24219170b0370aa9ddc4eb707.jsonl.gz"}, "slow_code": "import sys\nimport math\nfrom bisect import bisect_right as br\nfrom bisect import bisect_left as bl\n\nsys.setrecursionlimit(2147483647)\nfrom heapq import heappush, heappop, heappushpop\nfrom collections import defaultdict\nfrom itertools import accumulate\nfrom collections import Counter\nfrom collections import deque\nfrom operator import itemgetter\nfrom itertools import permutations\n\nmod = 10**9 + 7\ninf = float(\"inf\")\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\ns, w = LI()\nif s <= w:\n print(\"unsafe\")\nelse:\n print(\"safe\")\n", "slow_code_sha256": "bf5eea10074c63eaba5bcd155494237aaf0b2185b148b7614e311e92f7bef084", "slow_id": "p02699_f2cc4bf0fe7fb5f3b139743ef8c168fecc1b7ec24219170b0370aa9ddc4eb707", "speedup": 2.6761935764082745, "stratum": "2-4", "within_pair_jaccard": 0.19230769230769232, "workload": {"case_count": 100, "description": "Given S sheep and W wolves, report unsafe if wolves are at least as numerous as sheep, and safe otherwise. Observed inputs: S=1..100 (median 38); W=1..100 (median 49.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 8, "median": 6.0, "min": 4}, "input_format": ["S W"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p02831_case_000", "p02831_case_001", "p02831_case_002", "p02831_case_003", "p02831_case_004", "p02831_case_005", "p02831_case_006", "p02831_case_007", "p02831_case_008", "p02831_case_009", "p02831_case_010", "p02831_case_011", "p02831_case_012", "p02831_case_013", "p02831_case_014", "p02831_case_015", "p02831_case_016", "p02831_case_017", "p02831_case_018", "p02831_case_019", "p02831_case_020", "p02831_case_021", "p02831_case_022", "p02831_case_023", "p02831_case_024", "p02831_case_025", "p02831_case_026", "p02831_case_027", "p02831_case_028", "p02831_case_029", "p02831_case_030", "p02831_case_031", "p02831_case_032", "p02831_case_033", "p02831_case_034", "p02831_case_035", "p02831_case_036", "p02831_case_037", "p02831_case_038", "p02831_case_039", "p02831_case_040", "p02831_case_041", "p02831_case_042", "p02831_case_043", "p02831_case_044", "p02831_case_045", "p02831_case_046", "p02831_case_047", "p02831_case_048", "p02831_case_049", "p02831_case_050", "p02831_case_051", "p02831_case_052", "p02831_case_053", "p02831_case_054", "p02831_case_055", "p02831_case_056", "p02831_case_057", "p02831_case_058", "p02831_case_059", "p02831_case_060", "p02831_case_061", "p02831_case_062", "p02831_case_063", "p02831_case_064", "p02831_case_065", "p02831_case_066", "p02831_case_067", "p02831_case_068", "p02831_case_069", "p02831_case_070", "p02831_case_071", "p02831_case_072", "p02831_case_073", "p02831_case_074", "p02831_case_075", "p02831_case_076", "p02831_case_077", "p02831_case_078", "p02831_case_079", "p02831_case_080", "p02831_case_081", "p02831_case_082", "p02831_case_083", "p02831_case_084", "p02831_case_085", "p02831_case_086", "p02831_case_087", "p02831_case_088", "p02831_case_089", "p02831_case_090", "p02831_case_091", "p02831_case_092", "p02831_case_093", "p02831_case_094", "p02831_case_095", "p02831_case_096", "p02831_case_097", "p02831_case_098", "p02831_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\nstdin = sys.stdin\nsys.setrecursionlimit(10**7)\ni_i = lambda: int(i_s())\ni_l = lambda: list(map(int, stdin.readline().split()))\ni_s = lambda: stdin.readline().rstrip()\n\n\ndef gcd(a, b):\n while b:\n a, b = b, a % b\n return a\n\n\ndef lcm(a, b):\n return a * b // gcd(a, b)\n\n\nA, B = i_l()\nprint((lcm(A, B)))\n", "fast_code_sha256": "0f600cb454f18fd1122e8596a2c9934e5781c9199aed5d7169642828c56aa1a8", "fast_id": "p02831_0f600cb454f18fd1122e8596a2c9934e5781c9199aed5d7169642828c56aa1a8", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\nstdin = sys.stdin\nsys.setrecursionlimit(10**7)\ni_i = lambda: int(i_s())\ni_l = lambda: list(map(int, stdin.readline().split()))\ni_s = lambda: stdin.readline().rstrip()\n\n\ndef gcd(a, b):\n while b:\n a, b = b, a % b\n return a\n\n\ndef lcm(a, b):\n return a * b // gcd(a, b)\n\n\nA, B = i_l()\nprint((lcm(A, B)))\n", "measured_fast_code_sha256": "0f600cb454f18fd1122e8596a2c9934e5781c9199aed5d7169642828c56aa1a8", "measured_slow_code": "num1, num2 = list(map(int, input().split()))\nimport math\n\n\ndef gcd(num1, num2):\n for i in range(min(num1, num2), 0, -1):\n if num1 % i == 0 and num2 % i == 0:\n return i\n\n\nprint((int(num1 * num2 / gcd(num1, num2))))\n", "measured_slow_code_sha256": "9a1626365f94b8a7d0331e3eabf1740b93398b58e75f9e3e35d2d82ea57bb14e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 12.00329901509213, "pair_id": "python_v2_8ccfd80c58c40af833984819", "per_case_slow_code_faster_fraction": 0.42, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02831", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02831_0f600cb454f18fd1122e8596a2c9934e5781c9199aed5d7169642828c56aa1a8.jsonl.gz", "inputs": "reproduction/python/inputs/p02831.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02831_9a1626365f94b8a7d0331e3eabf1740b93398b58e75f9e3e35d2d82ea57bb14e.jsonl.gz"}, "slow_code": "num1, num2 = list(map(int, input().split()))\nimport math\n\n\ndef gcd(num1, num2):\n for i in range(min(num1, num2), 0, -1):\n if num1 % i == 0 and num2 % i == 0:\n return i\n\n\nprint((int(num1 * num2 / gcd(num1, num2))))\n", "slow_code_sha256": "9a1626365f94b8a7d0331e3eabf1740b93398b58e75f9e3e35d2d82ea57bb14e", "slow_id": "p02831_9a1626365f94b8a7d0331e3eabf1740b93398b58e75f9e3e35d2d82ea57bb14e", "speedup": 7.455201224200206, "stratum": "4-8", "within_pair_jaccard": 0.23076923076923078, "workload": {"case_count": 100, "description": "Find the minimum positive number of indivisible snack pieces that can be distributed equally either to A guests or to B guests, with each guest receiving at least one piece. A and B differ. Observed inputs: A=1..100000 (median 59009.5); B=1..99999 (median 42628).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 13, "median": 12.0, "min": 4}, "input_format": ["A B"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p02392_case_000", "p02392_case_001", "p02392_case_002", "p02392_case_003", "p02392_case_004", "p02392_case_005", "p02392_case_006", "p02392_case_007", "p02392_case_008", "p02392_case_009", "p02392_case_010", "p02392_case_011", "p02392_case_012", "p02392_case_013", "p02392_case_014", "p02392_case_015", "p02392_case_016", "p02392_case_017", "p02392_case_018", "p02392_case_019", "p02392_case_020", "p02392_case_021", "p02392_case_022", "p02392_case_023", "p02392_case_024", "p02392_case_025", "p02392_case_026", "p02392_case_027", "p02392_case_028", "p02392_case_029", "p02392_case_030", "p02392_case_031", "p02392_case_032", "p02392_case_033", "p02392_case_034", "p02392_case_035", "p02392_case_036", "p02392_case_037", "p02392_case_038", "p02392_case_039", "p02392_case_040", "p02392_case_041", "p02392_case_042", "p02392_case_043", "p02392_case_044", "p02392_case_045", "p02392_case_046", "p02392_case_047", "p02392_case_048", "p02392_case_049", "p02392_case_050", "p02392_case_051", "p02392_case_052", "p02392_case_053", "p02392_case_054", "p02392_case_055", "p02392_case_056", "p02392_case_057", "p02392_case_058", "p02392_case_059", "p02392_case_060", "p02392_case_061", "p02392_case_062", "p02392_case_063", "p02392_case_064", "p02392_case_065", "p02392_case_066", "p02392_case_067", "p02392_case_068", "p02392_case_069", "p02392_case_070", "p02392_case_071", "p02392_case_072", "p02392_case_073", "p02392_case_074", "p02392_case_075", "p02392_case_076", "p02392_case_077", "p02392_case_078", "p02392_case_079", "p02392_case_080", "p02392_case_081", "p02392_case_082", "p02392_case_083", "p02392_case_084", "p02392_case_085", "p02392_case_086", "p02392_case_087", "p02392_case_088", "p02392_case_089", "p02392_case_090", "p02392_case_091", "p02392_case_092", "p02392_case_093", "p02392_case_094", "p02392_case_095", "p02392_case_096", "p02392_case_097", "p02392_case_098", "p02392_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def judge(a, b, c):\n return \"Yes\" if a < b < c else \"No\"\n\n\nif __name__ == \"__main__\":\n a, b, c = list(map(int, input().split(\" \")))\n print((judge(a, b, c)))\n", "fast_code_sha256": "9a3084698419bdea0a9d57129dfe8175366f9a3f51be206d8033d649a001d16c", "fast_id": "p02392_9a3084698419bdea0a9d57129dfe8175366f9a3f51be206d8033d649a001d16c", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def judge(a, b, c):\n return \"Yes\" if a < b < c else \"No\"\n\n\nif __name__ == \"__main__\":\n a, b, c = list(map(int, input().split(\" \")))\n print((judge(a, b, c)))\n", "measured_fast_code_sha256": "9a3084698419bdea0a9d57129dfe8175366f9a3f51be206d8033d649a001d16c", "measured_slow_code": "# coding:UTF-8\nimport copy\n\nn = list(map(int, input().split()))\nif n[0] < n[1] < n[2]:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "measured_slow_code_sha256": "de04487b5a08627844d61298f885965ab158d25d2bda51807fc27addaf67096b", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 7.978007872371702, "pair_id": "python_v2_b93f25119235b50c13035c1a", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02392", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02392_9a3084698419bdea0a9d57129dfe8175366f9a3f51be206d8033d649a001d16c.jsonl.gz", "inputs": "reproduction/python/inputs/p02392.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02392_de04487b5a08627844d61298f885965ab158d25d2bda51807fc27addaf67096b.jsonl.gz"}, "slow_code": "import copy\n\nn = list(map(int, input().split()))\nif n[0] < n[1] < n[2]:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "slow_code_sha256": "c3d3757a61b38da19ec84678b61451515bf53604660861738644c471aeb44260", "slow_id": "p02392_de04487b5a08627844d61298f885965ab158d25d2bda51807fc27addaf67096b", "speedup": 7.979580134989992, "stratum": "4-8", "within_pair_jaccard": 0.4166666666666667, "workload": {"case_count": 100, "description": "Read three integers a,b,c and decide whether a k:\n low = test + 1\n break\n else:\n high = test\nprint(high)\n", "fast_code_sha256": "695e872e2723e61c1a46c4f7eb38df5eecce5419f2f80fc17142c3a3a95f31b3", "fast_id": "p02883_695e872e2723e61c1a46c4f7eb38df5eecce5419f2f80fc17142c3a3a95f31b3", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import math\n\n(n, k), a, f = [list(map(int, s.split())) for s in open(0)]\na.sort()\nf.sort(reverse=True)\nlow = 0\nhigh = 0\nfor x, y in zip(a, f):\n high = max(high, x * y)\nwhile high != low:\n test = int((high + low) // 2)\n tmp = 0\n for x, y in zip(a, f):\n tmp += max(0, x - math.floor(test / y))\n if tmp > k:\n low = test + 1\n break\n else:\n high = test\nprint(high)\n", "measured_fast_code_sha256": "695e872e2723e61c1a46c4f7eb38df5eecce5419f2f80fc17142c3a3a95f31b3", "measured_slow_code": "import math\n\nN, K = list(map(int, input().split()))\nX = [\n (b, a * b)\n for a, b in zip(\n sorted(list(map(int, input().split()))),\n sorted(list(map(int, input().split())))[::-1],\n )\n]\nm, M, i = 0, 10**12, 1\nexec(\n \"i,M,m=((i+m)//2,i,m) if sum(math.ceil(max(0,c-i)/b)for b, c in X)<=K else((i+M)//2,M,i);\"\n * 50\n)\nprint(M)\n", "measured_slow_code_sha256": "89d6694c33292de91a1011c40ba1f43b8a55e43ab7d13d625a0ff741f7a3effc", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 6.240559726078965, "pair_id": "python_v2_3af57281fc7333a6a078fc56", "per_case_slow_code_faster_fraction": 0.08, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02883", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02883_695e872e2723e61c1a46c4f7eb38df5eecce5419f2f80fc17142c3a3a95f31b3.jsonl.gz", "inputs": "reproduction/python/inputs/p02883.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02883_89d6694c33292de91a1011c40ba1f43b8a55e43ab7d13d625a0ff741f7a3effc.jsonl.gz"}, "slow_code": "import math\n\nN, K = list(map(int, input().split()))\nX = [\n (b, a * b)\n for a, b in zip(\n sorted(list(map(int, input().split()))),\n sorted(list(map(int, input().split())))[::-1],\n )\n]\nm, M, i = 0, 10**12, 1\nexec(\n \"i,M,m=((i+m)//2,i,m) if sum(math.ceil(max(0,c-i)/b)for b, c in X)<=K else((i+M)//2,M,i);\"\n * 50\n)\nprint(M)\n", "slow_code_sha256": "89d6694c33292de91a1011c40ba1f43b8a55e43ab7d13d625a0ff741f7a3effc", "slow_id": "p02883_89d6694c33292de91a1011c40ba1f43b8a55e43ab7d13d625a0ff741f7a3effc", "speedup": 4.0616419374680595, "stratum": "4-8", "within_pair_jaccard": 0.2826086956521739, "workload": {"case_count": 100, "description": "Assign N people bijectively to N foods to minimize the longest finishing time. Person i has coefficient A_i; food j takes A_i*F_j time. At most K training steps may each reduce a coefficient by 1, never below zero. Observed inputs: N=1..200000 (median 10); K=0..1000000000000000000; A_i=1..1000000; F_i=1..1000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 3200027, "median": 147.0, "min": 8}, "input_format": ["N K\nA_1 ... A_N\nF_1 ... F_N"], "input_format_status": "source_input_section", "input_lines": {"max": 3, "median": 3.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 400002, "median": 22.0, "min": 4}}} -{"case_ids": ["p04014_case_000", "p04014_case_001", "p04014_case_002", "p04014_case_003", "p04014_case_004", "p04014_case_005", "p04014_case_006", "p04014_case_007", "p04014_case_008", "p04014_case_009", "p04014_case_010", "p04014_case_011", "p04014_case_012", "p04014_case_013", "p04014_case_014", "p04014_case_015", "p04014_case_016", "p04014_case_017", "p04014_case_018", "p04014_case_019", "p04014_case_020", "p04014_case_021", "p04014_case_022", "p04014_case_023", "p04014_case_024", "p04014_case_025", "p04014_case_026", "p04014_case_027", "p04014_case_028", "p04014_case_029", "p04014_case_030", "p04014_case_031", "p04014_case_032", "p04014_case_033", "p04014_case_034", "p04014_case_035", "p04014_case_036", "p04014_case_037", "p04014_case_038", "p04014_case_039", "p04014_case_040", "p04014_case_041", "p04014_case_042", "p04014_case_043", "p04014_case_044", "p04014_case_045", "p04014_case_046", "p04014_case_047", "p04014_case_048", "p04014_case_049", "p04014_case_050", "p04014_case_051", "p04014_case_052", "p04014_case_053", "p04014_case_054", "p04014_case_055", "p04014_case_056", "p04014_case_057", "p04014_case_058", "p04014_case_059", "p04014_case_060", "p04014_case_061", "p04014_case_062", "p04014_case_063", "p04014_case_064", "p04014_case_065", "p04014_case_066", "p04014_case_067", "p04014_case_068", "p04014_case_069", "p04014_case_070", "p04014_case_071", "p04014_case_072", "p04014_case_073", "p04014_case_074", "p04014_case_075", "p04014_case_076", "p04014_case_077", "p04014_case_078", "p04014_case_079", "p04014_case_080", "p04014_case_081", "p04014_case_082", "p04014_case_083", "p04014_case_084", "p04014_case_085", "p04014_case_086", "p04014_case_087", "p04014_case_088", "p04014_case_089", "p04014_case_090", "p04014_case_091", "p04014_case_092", "p04014_case_093", "p04014_case_094", "p04014_case_095", "p04014_case_096", "p04014_case_097", "p04014_case_098", "p04014_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def primeFactor(N):\n i, n, ret, d, sq = 2, N, {}, 2, 99\n while i <= sq:\n k = 0\n while n % i == 0:\n n, k, ret[i] = n // i, k + 1, k + 1\n if k > 0 or i == 97:\n sq = int(n ** (1 / 2) + 0.5)\n if i < 4:\n i = i * 2 - 1\n else:\n i, d = i + d, d ^ 6\n if n > 1:\n ret[n] = 1\n return ret\n\n\ndef divisors(N):\n pf = primeFactor(N)\n ret = [1]\n for p in pf:\n ret_prev = ret\n ret = []\n for i in range(pf[p] + 1):\n for r in ret_prev:\n ret.append(r * (p**i))\n return sorted(ret)\n\n\ndef f(b, n):\n re = 0\n while n:\n re += n % b\n n //= b\n return re\n\n\nN = int(eval(input()))\nS = int(eval(input()))\nif N < S:\n print((-1))\nelif N == S:\n print((N + 1))\nelse:\n for b in divisors(N - S):\n b += 1\n if f(b, N) == S:\n print(b)\n break\n else:\n print((-1))\n", "fast_code_sha256": "f27a4bd27f5024506b396d9409e065240fe954af08177935ce3a61cc4ef59dd1", "fast_id": "p04014_f27a4bd27f5024506b396d9409e065240fe954af08177935ce3a61cc4ef59dd1", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def primeFactor(N):\n i, n, ret, d, sq = 2, N, {}, 2, 99\n while i <= sq:\n k = 0\n while n % i == 0:\n n, k, ret[i] = n // i, k + 1, k + 1\n if k > 0 or i == 97:\n sq = int(n ** (1 / 2) + 0.5)\n if i < 4:\n i = i * 2 - 1\n else:\n i, d = i + d, d ^ 6\n if n > 1:\n ret[n] = 1\n return ret\n\n\ndef divisors(N):\n pf = primeFactor(N)\n ret = [1]\n for p in pf:\n ret_prev = ret\n ret = []\n for i in range(pf[p] + 1):\n for r in ret_prev:\n ret.append(r * (p**i))\n return sorted(ret)\n\n\ndef f(b, n):\n re = 0\n while n:\n re += n % b\n n //= b\n return re\n\n\nN = int(eval(input()))\nS = int(eval(input()))\nif N < S:\n print((-1))\nelif N == S:\n print((N + 1))\nelse:\n for b in divisors(N - S):\n b += 1\n if f(b, N) == S:\n print(b)\n break\n else:\n print((-1))\n", "measured_fast_code_sha256": "f27a4bd27f5024506b396d9409e065240fe954af08177935ce3a61cc4ef59dd1", "measured_slow_code": "from collections import defaultdict, Counter\nfrom itertools import product, groupby, count, permutations, combinations\nfrom math import pi, sqrt, floor\nfrom collections import deque\nfrom bisect import bisect, bisect_left, bisect_right\nfrom string import ascii_lowercase\nfrom functools import lru_cache\nimport sys\n\nsys.setrecursionlimit(10000)\nINF = float(\"inf\")\nYES, Yes, yes, NO, No, no = \"YES\", \"Yes\", \"yes\", \"NO\", \"No\", \"no\"\ndy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]\ndy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]\n\n\ndef inside(y, x, H, W):\n return 0 <= y < H and 0 <= x < W\n\n\ndef ceil(a, b):\n return (a + b - 1) // b\n\n\ndef f(b, n):\n if n < b:\n return n\n return f(b, n // b) + n % b\n\n\ndef main():\n N = int(eval(input()))\n S = int(eval(input()))\n if N == S:\n print((N + 1))\n return\n if N < S:\n print((-1))\n return\n ans = INF\n for b in range(2, int(sqrt(N)) + 1):\n if f(b, N) == S:\n ans = min(ans, b)\n bs = set()\n t = N - S\n for i in range(1, int(sqrt(N)) + 1):\n if t % i == 0:\n bs.add(i + 1)\n bs.add((t // i) + 1)\n for b in bs:\n if b == 1:\n continue\n if f(b, N) == S:\n ans = min(ans, b)\n if ans == INF:\n print((-1))\n else:\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "38f05af6b73665280db9ec2a605f799d5a3a653696a22897da46868ca5707313", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.7114749659168504, "pair_id": "python_v2_7390f536d49400987a04bec4", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p04014", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p04014_f27a4bd27f5024506b396d9409e065240fe954af08177935ce3a61cc4ef59dd1.jsonl.gz", "inputs": "reproduction/python/inputs/p04014.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p04014_38f05af6b73665280db9ec2a605f799d5a3a653696a22897da46868ca5707313.jsonl.gz"}, "slow_code": "from collections import defaultdict, Counter\nfrom itertools import product, groupby, count, permutations, combinations\nfrom math import pi, sqrt, floor\nfrom collections import deque\nfrom bisect import bisect, bisect_left, bisect_right\nfrom string import ascii_lowercase\nfrom functools import lru_cache\nimport sys\n\nsys.setrecursionlimit(10000)\nINF = float(\"inf\")\nYES, Yes, yes, NO, No, no = \"YES\", \"Yes\", \"yes\", \"NO\", \"No\", \"no\"\ndy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]\ndy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]\n\n\ndef inside(y, x, H, W):\n return 0 <= y < H and 0 <= x < W\n\n\ndef ceil(a, b):\n return (a + b - 1) // b\n\n\ndef f(b, n):\n if n < b:\n return n\n return f(b, n // b) + n % b\n\n\ndef main():\n N = int(eval(input()))\n S = int(eval(input()))\n if N == S:\n print((N + 1))\n return\n if N < S:\n print((-1))\n return\n ans = INF\n for b in range(2, int(sqrt(N)) + 1):\n if f(b, N) == S:\n ans = min(ans, b)\n bs = set()\n t = N - S\n for i in range(1, int(sqrt(N)) + 1):\n if t % i == 0:\n bs.add(i + 1)\n bs.add((t // i) + 1)\n for b in bs:\n if b == 1:\n continue\n if f(b, N) == S:\n ans = min(ans, b)\n if ans == INF:\n print((-1))\n else:\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "38f05af6b73665280db9ec2a605f799d5a3a653696a22897da46868ca5707313", "slow_id": "p04014_38f05af6b73665280db9ec2a605f799d5a3a653696a22897da46868ca5707313", "speedup": 4.718676887779497, "stratum": "4-8", "within_pair_jaccard": 0.20202020202020202, "workload": {"case_count": 100, "description": "Find the smallest integer base b>=2 in which positive integer n has digit sum s, or report -1 if no such base exists. Observed inputs: n=1..99999999999; s=1..99999999999.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 24, "median": 14.0, "min": 4}, "input_format": ["n\ns"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p03803_case_000", "p03803_case_001", "p03803_case_002", "p03803_case_003", "p03803_case_004", "p03803_case_005", "p03803_case_006", "p03803_case_007", "p03803_case_008", "p03803_case_009", "p03803_case_010", "p03803_case_011", "p03803_case_012", "p03803_case_013", "p03803_case_014", "p03803_case_015", "p03803_case_016", "p03803_case_017", "p03803_case_018", "p03803_case_019", "p03803_case_020", "p03803_case_021", "p03803_case_022", "p03803_case_023", "p03803_case_024", "p03803_case_025", "p03803_case_026", "p03803_case_027", "p03803_case_028", "p03803_case_029", "p03803_case_030", "p03803_case_031", "p03803_case_032", "p03803_case_033", "p03803_case_034", "p03803_case_035", "p03803_case_036", "p03803_case_037", "p03803_case_038", "p03803_case_039", "p03803_case_040", "p03803_case_041", "p03803_case_042", "p03803_case_043", "p03803_case_044", "p03803_case_045", "p03803_case_046", "p03803_case_047", "p03803_case_048", "p03803_case_049", "p03803_case_050", "p03803_case_051", "p03803_case_052", "p03803_case_053", "p03803_case_054", "p03803_case_055", "p03803_case_056", "p03803_case_057", "p03803_case_058", "p03803_case_059", "p03803_case_060", "p03803_case_061", "p03803_case_062", "p03803_case_063", "p03803_case_064", "p03803_case_065", "p03803_case_066", "p03803_case_067", "p03803_case_068", "p03803_case_069", "p03803_case_070", "p03803_case_071", "p03803_case_072", "p03803_case_073", "p03803_case_074", "p03803_case_075", "p03803_case_076", "p03803_case_077", "p03803_case_078", "p03803_case_079", "p03803_case_080", "p03803_case_081", "p03803_case_082", "p03803_case_083", "p03803_case_084", "p03803_case_085", "p03803_case_086", "p03803_case_087", "p03803_case_088", "p03803_case_089", "p03803_case_090", "p03803_case_091", "p03803_case_092", "p03803_case_093", "p03803_case_094", "p03803_case_095", "p03803_case_096", "p03803_case_097", "p03803_case_098", "p03803_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "a, b = list(map(int, input().split()))\nprint(([\"ADlriacwe\"[a == b :: 2], \"Bob\"][(a - 2) % 13 < (b - 2) % 13]))\n", "fast_code_sha256": "49f3252eb08400b5df813fb5232a5021d63079ba5b8cdc64ab64ce10c9f94ff9", "fast_id": "p03803_49f3252eb08400b5df813fb5232a5021d63079ba5b8cdc64ab64ce10c9f94ff9", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "a, b = list(map(int, input().split()))\nprint(([\"ADlriacwe\"[a == b :: 2], \"Bob\"][(a - 2) % 13 < (b - 2) % 13]))\n", "measured_fast_code_sha256": "49f3252eb08400b5df813fb5232a5021d63079ba5b8cdc64ab64ce10c9f94ff9", "measured_slow_code": "import sys, math\nfrom functools import lru_cache\nfrom itertools import accumulate\n\nsys.setrecursionlimit(10**9)\nMOD = 10**9 + 7\n\n\ndef input():\n return sys.stdin.readline()[:-1]\n\n\ndef mi():\n return list(map(int, input().split()))\n\n\ndef ii():\n return int(eval(input()))\n\n\ndef i2(n):\n tmp = [list(mi()) for i in range(n)]\n return [list(i) for i in zip(*tmp)]\n\n\nA, B = mi()\nif A == B:\n print(\"Draw\")\nelif A == 1:\n print(\"Alice\")\nelif B == 1:\n print(\"Bob\")\nelse:\n if A > B:\n print(\"Alice\")\n else:\n print(\"Bob\")\n", "measured_slow_code_sha256": "0bd5df2a157ba82c7c25ec618ddd2b8ac3a7b93747b5c4b4114a2cd42e8e257e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.6242961234678184, "pair_id": "python_v2_7a021611d643779f89d58b16", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03803", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03803_49f3252eb08400b5df813fb5232a5021d63079ba5b8cdc64ab64ce10c9f94ff9.jsonl.gz", "inputs": "reproduction/python/inputs/p03803.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03803_0bd5df2a157ba82c7c25ec618ddd2b8ac3a7b93747b5c4b4114a2cd42e8e257e.jsonl.gz"}, "slow_code": "import sys, math\nfrom functools import lru_cache\nfrom itertools import accumulate\n\nsys.setrecursionlimit(10**9)\nMOD = 10**9 + 7\n\n\ndef input():\n return sys.stdin.readline()[:-1]\n\n\ndef mi():\n return list(map(int, input().split()))\n\n\ndef ii():\n return int(eval(input()))\n\n\ndef i2(n):\n tmp = [list(mi()) for i in range(n)]\n return [list(i) for i in zip(*tmp)]\n\n\nA, B = mi()\nif A == B:\n print(\"Draw\")\nelif A == 1:\n print(\"Alice\")\nelif B == 1:\n print(\"Bob\")\nelse:\n if A > B:\n print(\"Alice\")\n else:\n print(\"Bob\")\n", "slow_code_sha256": "0bd5df2a157ba82c7c25ec618ddd2b8ac3a7b93747b5c4b4114a2cd42e8e257e", "slow_id": "p03803_0bd5df2a157ba82c7c25ec618ddd2b8ac3a7b93747b5c4b4114a2cd42e8e257e", "speedup": 3.623428417272156, "stratum": "2-4", "within_pair_jaccard": 0.14583333333333334, "workload": {"case_count": 100, "description": "Compare two card ranks A,B from 1..13. Rank 1 is strongest; the other ranks increase in strength from 2 through 13. Report the first player, second player, or a draw. Observed inputs: A=1..13 (median 6); B=1..13 (median 6.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 6, "median": 4.0, "min": 4}, "input_format": ["A B"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p03061_case_000", "p03061_case_001", "p03061_case_002", "p03061_case_003", "p03061_case_004", "p03061_case_005", "p03061_case_006", "p03061_case_007", "p03061_case_008", "p03061_case_009", "p03061_case_010", "p03061_case_011", "p03061_case_012", "p03061_case_013", "p03061_case_014", "p03061_case_015", "p03061_case_016", "p03061_case_017", "p03061_case_018", "p03061_case_019", "p03061_case_020", "p03061_case_021", "p03061_case_022", "p03061_case_023", "p03061_case_024", "p03061_case_025", "p03061_case_026", "p03061_case_027", "p03061_case_028", "p03061_case_029", "p03061_case_030", "p03061_case_031", "p03061_case_032", "p03061_case_033", "p03061_case_034", "p03061_case_035", "p03061_case_036", "p03061_case_037", "p03061_case_038", "p03061_case_039", "p03061_case_040", "p03061_case_041", "p03061_case_042", "p03061_case_043", "p03061_case_044", "p03061_case_045", "p03061_case_046", "p03061_case_047", "p03061_case_048", "p03061_case_049", "p03061_case_050", "p03061_case_051", "p03061_case_052", "p03061_case_053", "p03061_case_054", "p03061_case_055", "p03061_case_056", "p03061_case_057", "p03061_case_058", "p03061_case_059", "p03061_case_060", "p03061_case_061", "p03061_case_062", "p03061_case_063", "p03061_case_064", "p03061_case_065", "p03061_case_066", "p03061_case_067", "p03061_case_068", "p03061_case_069", "p03061_case_070", "p03061_case_071", "p03061_case_072", "p03061_case_073", "p03061_case_074", "p03061_case_075", "p03061_case_076", "p03061_case_077", "p03061_case_078", "p03061_case_079", "p03061_case_080", "p03061_case_081", "p03061_case_082", "p03061_case_083", "p03061_case_084", "p03061_case_085", "p03061_case_086", "p03061_case_087", "p03061_case_088", "p03061_case_089", "p03061_case_090", "p03061_case_091", "p03061_case_092", "p03061_case_093", "p03061_case_094", "p03061_case_095", "p03061_case_096", "p03061_case_097", "p03061_case_098", "p03061_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from math import gcd\n\nn = int(eval(input()))\nA = [0] + list(map(int, input().split())) + [0]\nn += 2\nL, R = [0] * n, [0] * n\ngl, gr = 0, 0\nfor i in range(n):\n gl = gcd(gl, A[i])\n gr = gcd(gr, A[n - i - 1])\n L[i] = gl\n R[n - i - 1] = gr\nans = L[-1]\nfor i in range(n - 2):\n ans = max(ans, gcd(L[i], R[i + 2]))\nprint(ans)\n", "fast_code_sha256": "3f475ae9e7efd3a1ce8867f9c3841f1206e31cad4eec5c093b58fc0a3461d40a", "fast_id": "p03061_3f475ae9e7efd3a1ce8867f9c3841f1206e31cad4eec5c093b58fc0a3461d40a", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from math import gcd\n\nn = int(eval(input()))\nA = [0] + list(map(int, input().split())) + [0]\nn += 2\nL, R = [0] * n, [0] * n\ngl, gr = 0, 0\nfor i in range(n):\n gl = gcd(gl, A[i])\n gr = gcd(gr, A[n - i - 1])\n L[i] = gl\n R[n - i - 1] = gr\nans = L[-1]\nfor i in range(n - 2):\n ans = max(ans, gcd(L[i], R[i + 2]))\nprint(ans)\n", "measured_fast_code_sha256": "3f475ae9e7efd3a1ce8867f9c3841f1206e31cad4eec5c093b58fc0a3461d40a", "measured_slow_code": "n = int(eval(input()))\na = list(map(int, input().split()))\nans1 = a[1]\nfor i in range(1, n):\n big, sml = a[i], ans1\n while sml != 0:\n big, sml = sml, big % sml\n ans1 = big\nans2 = a[-2]\nfor i in range(n - 1):\n big, sml = a[i], ans2\n while sml != 0:\n big, sml = sml, big % sml\n ans2 = big\nl1 = [-1]\nnow = a[0]\nfor i in range(1, n):\n big, sml = now, a[i]\n while sml != 0:\n big, sml = sml, big % sml\n l1.append(now // big)\n now = big\nl2 = [-1]\nnow = a[-1]\nfor i in range(n - 2, -1, -1):\n big, sml = now, a[i]\n while sml != 0:\n big, sml = sml, big % sml\n l2.append(now // big)\n now = big\nl2.reverse()\nl3 = [-1]\nfor i in range(1, n - 1):\n big, sml = l1[i], l2[i]\n while sml != 0:\n big, sml = sml, big % sml\n l3.append(big)\nl3.append(-1)\nnow = a[0]\nfor i in range(n):\n big, sml = now, a[i]\n while sml != 0:\n big, sml = sml, big % sml\n now = big\nans3 = now * max(l3)\n# print(now)\n# print(l1)\n# print(l2)\n# print(l3)\n# print(ans1,ans2,ans3)\nprint((max(ans1, ans2, ans3)))\n", "measured_slow_code_sha256": "b4c55a42394031ccd6c09f4ee9bef1742473d70273644e9a5a1c23a69587b130", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.6002494402405394, "pair_id": "python_v2_7099e4f7d6387b42d6e2092b", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03061", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03061_3f475ae9e7efd3a1ce8867f9c3841f1206e31cad4eec5c093b58fc0a3461d40a.jsonl.gz", "inputs": "reproduction/python/inputs/p03061.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03061_b4c55a42394031ccd6c09f4ee9bef1742473d70273644e9a5a1c23a69587b130.jsonl.gz"}, "slow_code": "n = int(eval(input()))\na = list(map(int, input().split()))\nans1 = a[1]\nfor i in range(1, n):\n big, sml = a[i], ans1\n while sml != 0:\n big, sml = sml, big % sml\n ans1 = big\nans2 = a[-2]\nfor i in range(n - 1):\n big, sml = a[i], ans2\n while sml != 0:\n big, sml = sml, big % sml\n ans2 = big\nl1 = [-1]\nnow = a[0]\nfor i in range(1, n):\n big, sml = now, a[i]\n while sml != 0:\n big, sml = sml, big % sml\n l1.append(now // big)\n now = big\nl2 = [-1]\nnow = a[-1]\nfor i in range(n - 2, -1, -1):\n big, sml = now, a[i]\n while sml != 0:\n big, sml = sml, big % sml\n l2.append(now // big)\n now = big\nl2.reverse()\nl3 = [-1]\nfor i in range(1, n - 1):\n big, sml = l1[i], l2[i]\n while sml != 0:\n big, sml = sml, big % sml\n l3.append(big)\nl3.append(-1)\nnow = a[0]\nfor i in range(n):\n big, sml = now, a[i]\n while sml != 0:\n big, sml = sml, big % sml\n now = big\nans3 = now * max(l3)\n\n\nprint((max(ans1, ans2, ans3)))\n", "slow_code_sha256": "4e0914517e095a57aeb03e288c13fafa4d67f1ff2c200b738c113bf161a272d5", "slow_id": "p03061_b4c55a42394031ccd6c09f4ee9bef1742473d70273644e9a5a1c23a69587b130", "speedup": 2.6906851917457715, "stratum": "2-4", "within_pair_jaccard": 0.41025641025641024, "workload": {"case_count": 100, "description": "Replace exactly one of N positive array entries by any integer in 1..1000000000, possibly leaving it unchanged. Maximize the greatest common divisor of the resulting array. Observed inputs: N=2..100000 (median 1000); A_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1000007, "median": 10005.0, "min": 20}, "input_format": ["N\nA_1 ... A_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100001, "median": 1001.0, "min": 3}}} -{"case_ids": ["p03112_case_000", "p03112_case_001", "p03112_case_002", "p03112_case_003", "p03112_case_004", "p03112_case_005", "p03112_case_006", "p03112_case_007", "p03112_case_008", "p03112_case_009", "p03112_case_010", "p03112_case_011", "p03112_case_012", "p03112_case_013", "p03112_case_014", "p03112_case_015", "p03112_case_016", "p03112_case_017", "p03112_case_018", "p03112_case_019", "p03112_case_020", "p03112_case_021", "p03112_case_022", "p03112_case_023", "p03112_case_024", "p03112_case_025", "p03112_case_026", "p03112_case_027", "p03112_case_028", "p03112_case_029", "p03112_case_030", "p03112_case_031", "p03112_case_032", "p03112_case_033", "p03112_case_034", "p03112_case_035", "p03112_case_036", "p03112_case_037", "p03112_case_038", "p03112_case_039", "p03112_case_040", "p03112_case_041", "p03112_case_042", "p03112_case_043", "p03112_case_044", "p03112_case_045", "p03112_case_046", "p03112_case_047", "p03112_case_048", "p03112_case_049", "p03112_case_050", "p03112_case_051", "p03112_case_052", "p03112_case_053", "p03112_case_054", "p03112_case_055", "p03112_case_056", "p03112_case_057", "p03112_case_058", "p03112_case_059", "p03112_case_060", "p03112_case_061", "p03112_case_062", "p03112_case_063", "p03112_case_064", "p03112_case_065", "p03112_case_066", "p03112_case_067", "p03112_case_068", "p03112_case_069", "p03112_case_070", "p03112_case_071", "p03112_case_072", "p03112_case_073", "p03112_case_074", "p03112_case_075", "p03112_case_076", "p03112_case_077", "p03112_case_078", "p03112_case_079", "p03112_case_080", "p03112_case_081", "p03112_case_082", "p03112_case_083", "p03112_case_084", "p03112_case_085", "p03112_case_086", "p03112_case_087", "p03112_case_088", "p03112_case_089", "p03112_case_090", "p03112_case_091", "p03112_case_092", "p03112_case_093", "p03112_case_094", "p03112_case_095", "p03112_case_096", "p03112_case_097", "p03112_case_098", "p03112_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "executable_AST_equal_except_explicit_explanatory_string_removal_and_all_frozen_inputs_checker_pass", "fast_code": "import bisect\nimport sys\n\nSENTINEL = 10**12\na, b, q = list(map(int, input().split()))\nlines = sys.stdin.readlines()\nsss = [-SENTINEL] + list(map(int, lines[:a])) + [SENTINEL]\nttt = [-SENTINEL] + list(map(int, lines[a : a + b])) + [SENTINEL]\nxxx = list(map(int, lines[a + b :]))\nnearest_temples = [SENTINEL] + [0] * a + [SENTINEL]\nnearest_shrines = [SENTINEL] + [0] * b + [SENTINEL]\nfor i, s in enumerate(sss[1:-1], start=1):\n ti = bisect.bisect(ttt, s)\n nearest_temples[i] = min(ttt[ti] - s, s - ttt[ti - 1])\nfor i, t in enumerate(ttt[1:-1], start=1):\n si = bisect.bisect(sss, t)\n nearest_shrines[i] = min(sss[si] - t, t - sss[si - 1])\nbuf = []\nfor x in xxx:\n si = bisect.bisect(sss, x)\n ti = bisect.bisect(ttt, x)\n ans = min(\n x - sss[si - 1] + nearest_temples[si - 1],\n sss[si] - x + nearest_temples[si],\n x - ttt[ti - 1] + nearest_shrines[ti - 1],\n ttt[ti] - x + nearest_shrines[ti],\n )\n buf.append(ans)\nprint((\"\\n\".join(map(str, buf))))\n", "fast_code_sha256": "bcdd6c5a04ef827b58b6607368ffa34b279e2ae37471e8105f1a35498de66f88", "fast_id": "p03112_bcdd6c5a04ef827b58b6607368ffa34b279e2ae37471e8105f1a35498de66f88", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import bisect\nimport sys\n\nSENTINEL = 10**12\na, b, q = list(map(int, input().split()))\nlines = sys.stdin.readlines()\nsss = [-SENTINEL] + list(map(int, lines[:a])) + [SENTINEL]\nttt = [-SENTINEL] + list(map(int, lines[a : a + b])) + [SENTINEL]\nxxx = list(map(int, lines[a + b :]))\nnearest_temples = [SENTINEL] + [0] * a + [SENTINEL]\nnearest_shrines = [SENTINEL] + [0] * b + [SENTINEL]\nfor i, s in enumerate(sss[1:-1], start=1):\n ti = bisect.bisect(ttt, s)\n nearest_temples[i] = min(ttt[ti] - s, s - ttt[ti - 1])\nfor i, t in enumerate(ttt[1:-1], start=1):\n si = bisect.bisect(sss, t)\n nearest_shrines[i] = min(sss[si] - t, t - sss[si - 1])\nbuf = []\nfor x in xxx:\n si = bisect.bisect(sss, x)\n ti = bisect.bisect(ttt, x)\n ans = min(\n x - sss[si - 1] + nearest_temples[si - 1],\n sss[si] - x + nearest_temples[si],\n x - ttt[ti - 1] + nearest_shrines[ti - 1],\n ttt[ti] - x + nearest_shrines[ti],\n )\n buf.append(ans)\nprint((\"\\n\".join(map(str, buf))))\n", "measured_fast_code_sha256": "bcdd6c5a04ef827b58b6607368ffa34b279e2ae37471e8105f1a35498de66f88", "measured_slow_code": "# -*- coding: utf-8 -*-\n\"\"\"\n参考:https://img.atcoder.jp/abc119/editorial.pdf\n・前計算しないで直接やる版\n・INFがfloat('inf')だとダメで10**18にしたらいけた。INF-INFがnanになるからだった。\n・上記を考慮して修正版\n\"\"\"\nimport sys, re\nfrom collections import deque, defaultdict, Counter\nfrom math import sqrt, hypot, factorial, pi, sin, cos, radians, log10\n\nif sys.version_info.minor >= 5:\n from math import gcd\nelse:\n from fractions import gcd\nfrom heapq import heappop, heappush, heapify, heappushpop\nfrom bisect import bisect_left, bisect_right\nfrom itertools import permutations, combinations, product, accumulate\nfrom operator import itemgetter, mul, xor\nfrom copy import copy, deepcopy\nfrom functools import reduce, partial\nfrom fractions import Fraction\nfrom string import ascii_lowercase, ascii_uppercase, digits\nfrom datetime import date\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef list2d(a, b, c):\n return [[c] * b for i in range(a)]\n\n\ndef list3d(a, b, c, d):\n return [[[d] * c for j in range(b)] for i in range(a)]\n\n\ndef ceil(x, y=1):\n return int(-(-x // y))\n\n\ndef round(x):\n return int((x * 2 + 1) // 2)\n\n\ndef fermat(x, y, MOD):\n return x * pow(y, MOD - 2, MOD) % MOD\n\n\ndef lcm(x, y):\n return (x * y) // gcd(x, y)\n\n\ndef lcm_list(nums):\n return reduce(lcm, nums, 1)\n\n\ndef gcd_list(nums):\n return reduce(gcd, nums, nums[0])\n\n\ndef INT():\n return int(eval(input()))\n\n\ndef MAP():\n return list(map(int, input().split()))\n\n\ndef LIST():\n return list(map(int, input().split()))\n\n\ndef Yes():\n print(\"Yes\")\n\n\ndef No():\n print(\"No\")\n\n\ndef YES():\n print(\"YES\")\n\n\ndef NO():\n print(\"NO\")\n\n\nsys.setrecursionlimit(10**9)\nINF = float(\"inf\")\nMOD = 10**9 + 7\nA, B, Q = MAP()\nS = [-INF] * (A + 2)\nfor i in range(A):\n S[i + 1] = INT()\nT = [-INF] * (B + 2)\nfor i in range(B):\n T[i + 1] = INT()\nS[-1] = T[-1] = INF\nfor i in range(Q):\n dist1 = dist2 = dist3 = dist4 = INF\n x = INT()\n # 地点xから左に一番近い神社\n idx1 = bisect_right(S, x) - 1\n # 右に一番近い神社\n idx2 = bisect_left(S, x)\n idx3 = bisect_right(T, x) - 1\n idx4 = bisect_left(T, x)\n # idx1番目の神社に行く\n dist1 = x - S[idx1]\n # idx1番目の神社から、xから右か左に一番近かった寺に行く\n if dist1 != INF:\n dist1 += min(abs(S[idx1] - T[idx3]), abs(S[idx1] - T[idx4]))\n dist2 = S[idx2] - x\n if dist2 != INF:\n dist2 += min(abs(S[idx2] - T[idx3]), abs(S[idx2] - T[idx4]))\n dist3 = x - T[idx3]\n if dist3 != INF:\n dist3 += min(abs(T[idx3] - S[idx1]), abs(T[idx3] - S[idx2]))\n dist4 = T[idx4] - x\n if dist4 != INF:\n dist4 += min(abs(T[idx4] - S[idx1]), abs(T[idx4] - S[idx2]))\n print((min(dist1, dist2, dist3, dist4)))\n", "measured_slow_code_sha256": "075f3d0646b6b85cb5ae32f4ea2d0d59acf39147bd9650aafe37dade27ea98fa", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4.066208231342859, "pair_id": "python_v2_91a47e29e7a7dbcb74670f0c", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03112", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03112_bcdd6c5a04ef827b58b6607368ffa34b279e2ae37471e8105f1a35498de66f88.jsonl.gz", "inputs": "reproduction/python/inputs/p03112.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03112_075f3d0646b6b85cb5ae32f4ea2d0d59acf39147bd9650aafe37dade27ea98fa.jsonl.gz"}, "slow_code": "import sys, re\nfrom collections import deque, defaultdict, Counter\nfrom math import sqrt, hypot, factorial, pi, sin, cos, radians, log10\n\nif sys.version_info.minor >= 5:\n from math import gcd\nelse:\n from fractions import gcd\nfrom heapq import heappop, heappush, heapify, heappushpop\nfrom bisect import bisect_left, bisect_right\nfrom itertools import permutations, combinations, product, accumulate\nfrom operator import itemgetter, mul, xor\nfrom copy import copy, deepcopy\nfrom functools import reduce, partial\nfrom fractions import Fraction\nfrom string import ascii_lowercase, ascii_uppercase, digits\nfrom datetime import date\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef list2d(a, b, c):\n return [[c] * b for i in range(a)]\n\n\ndef list3d(a, b, c, d):\n return [[[d] * c for j in range(b)] for i in range(a)]\n\n\ndef ceil(x, y=1):\n return int(-(-x // y))\n\n\ndef round(x):\n return int((x * 2 + 1) // 2)\n\n\ndef fermat(x, y, MOD):\n return x * pow(y, MOD - 2, MOD) % MOD\n\n\ndef lcm(x, y):\n return (x * y) // gcd(x, y)\n\n\ndef lcm_list(nums):\n return reduce(lcm, nums, 1)\n\n\ndef gcd_list(nums):\n return reduce(gcd, nums, nums[0])\n\n\ndef INT():\n return int(eval(input()))\n\n\ndef MAP():\n return list(map(int, input().split()))\n\n\ndef LIST():\n return list(map(int, input().split()))\n\n\ndef Yes():\n print(\"Yes\")\n\n\ndef No():\n print(\"No\")\n\n\ndef YES():\n print(\"YES\")\n\n\ndef NO():\n print(\"NO\")\n\n\nsys.setrecursionlimit(10**9)\nINF = float(\"inf\")\nMOD = 10**9 + 7\nA, B, Q = MAP()\nS = [-INF] * (A + 2)\nfor i in range(A):\n S[i + 1] = INT()\nT = [-INF] * (B + 2)\nfor i in range(B):\n T[i + 1] = INT()\nS[-1] = T[-1] = INF\nfor i in range(Q):\n dist1 = dist2 = dist3 = dist4 = INF\n x = INT()\n\n idx1 = bisect_right(S, x) - 1\n\n idx2 = bisect_left(S, x)\n idx3 = bisect_right(T, x) - 1\n idx4 = bisect_left(T, x)\n\n dist1 = x - S[idx1]\n\n if dist1 != INF:\n dist1 += min(abs(S[idx1] - T[idx3]), abs(S[idx1] - T[idx4]))\n dist2 = S[idx2] - x\n if dist2 != INF:\n dist2 += min(abs(S[idx2] - T[idx3]), abs(S[idx2] - T[idx4]))\n dist3 = x - T[idx3]\n if dist3 != INF:\n dist3 += min(abs(T[idx3] - S[idx1]), abs(T[idx3] - S[idx2]))\n dist4 = T[idx4] - x\n if dist4 != INF:\n dist4 += min(abs(T[idx4] - S[idx1]), abs(T[idx4] - S[idx2]))\n print((min(dist1, dist2, dist3, dist4)))\n", "slow_code_sha256": "77daaa725f47eb183a0e25b50b7e6255b814e50d5067b476fe004c62248fd0dc", "slow_id": "p03112_075f3d0646b6b85cb5ae32f4ea2d0d59acf39147bd9650aafe37dade27ea98fa", "speedup": 5.463065077895204, "stratum": "4-8", "within_pair_jaccard": 0.1342281879194631, "workload": {"case_count": 100, "description": "For each starting coordinate x_i on a line, minimize travel distance needed to visit at least one shrine s_j and one temple t_j in any order. Shrine and temple lists are strictly increasing; all shrine, temple and query coordinates are distinct. Observed inputs: A=1..100000 (median 1000); B=1..100000 (median 1000); Q=1..100000 (median 1000); s_i=1..9999998614; t_i=10814..10000000000; x_i=1631..9999995619.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 3267071, "median": 267821.5, "min": 31}, "input_format": ["A B Q\ns_1\n...\ns_A\nt_1\n...\nt_B\nx_1\n...\nx_Q"], "input_format_status": "source_input_section", "input_lines": {"max": 300001, "median": 30001.0, "min": 4}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 300003, "median": 30003.0, "min": 6}}} -{"case_ids": ["p03801_case_000", "p03801_case_001", "p03801_case_002", "p03801_case_003", "p03801_case_004", "p03801_case_005", "p03801_case_006", "p03801_case_007", "p03801_case_008", "p03801_case_009", "p03801_case_010", "p03801_case_011", "p03801_case_012", "p03801_case_013", "p03801_case_014", "p03801_case_015", "p03801_case_016", "p03801_case_017", "p03801_case_018", "p03801_case_019", "p03801_case_020", "p03801_case_021", "p03801_case_022", "p03801_case_023", "p03801_case_024", "p03801_case_025", "p03801_case_026", "p03801_case_027", "p03801_case_028", "p03801_case_029", "p03801_case_030", "p03801_case_031", "p03801_case_032", "p03801_case_033", "p03801_case_034", "p03801_case_035", "p03801_case_036", "p03801_case_037", "p03801_case_038", "p03801_case_039", "p03801_case_040", "p03801_case_041", "p03801_case_042", "p03801_case_043", "p03801_case_044", "p03801_case_045", "p03801_case_046", "p03801_case_047", "p03801_case_048", "p03801_case_049", "p03801_case_050", "p03801_case_051", "p03801_case_052", "p03801_case_053", "p03801_case_054", "p03801_case_055", "p03801_case_056", "p03801_case_057", "p03801_case_058", "p03801_case_059", "p03801_case_060", "p03801_case_061", "p03801_case_062", "p03801_case_063", "p03801_case_064", "p03801_case_065", "p03801_case_066", "p03801_case_067", "p03801_case_068", "p03801_case_069", "p03801_case_070", "p03801_case_071", "p03801_case_072", "p03801_case_073", "p03801_case_074", "p03801_case_075", "p03801_case_076", "p03801_case_077", "p03801_case_078", "p03801_case_079", "p03801_case_080", "p03801_case_081", "p03801_case_082", "p03801_case_083", "p03801_case_084", "p03801_case_085", "p03801_case_086", "p03801_case_087", "p03801_case_088", "p03801_case_089", "p03801_case_090", "p03801_case_091", "p03801_case_092", "p03801_case_093", "p03801_case_094", "p03801_case_095", "p03801_case_096", "p03801_case_097", "p03801_case_098", "p03801_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import os\nimport sys\n\nif os.getenv(\"LOCAL\"):\n sys.stdin = open(\"_in.txt\", \"r\")\nsys.setrecursionlimit(2147483647)\nINF = float(\"inf\")\nIINF = 10**18\nMOD = 10**9 + 7\nN = int(sys.stdin.readline())\nA = list(map(int, sys.stdin.readline().split()))\nXY = [(a, i) for i, a in enumerate(A)]\nXY.sort(reverse=True)\n\nans = [0] * N\nmin_y = IINF\nfor i, (x, y) in enumerate(XY):\n min_y = min(min_y, y)\n x2 = XY[i + 1][0] if i + 1 < N else 0\n ans[min_y] += (x - x2) * (i + 1)\nprint(*ans, sep=\"\\n\")\n", "fast_code_sha256": "784d4028a68e7272fd2d8f73e184a7a02294bbd66c3b11825b9eef71dc6e61a4", "fast_id": "p03801_87e6edd80821ee298d94931e002157bd21ef5bd3bacd4b6f684c94b879d846c1", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import os\nimport sys\n\nif os.getenv(\"LOCAL\"):\n sys.stdin = open(\"_in.txt\", \"r\")\nsys.setrecursionlimit(2147483647)\nINF = float(\"inf\")\nIINF = 10**18\nMOD = 10**9 + 7\nN = int(sys.stdin.readline())\nA = list(map(int, sys.stdin.readline().split()))\nXY = [(a, i) for i, a in enumerate(A)]\nXY.sort(reverse=True)\n# 解説\nans = [0] * N\nmin_y = IINF\nfor i, (x, y) in enumerate(XY):\n min_y = min(min_y, y)\n x2 = XY[i + 1][0] if i + 1 < N else 0\n ans[min_y] += (x - x2) * (i + 1)\nprint(*ans, sep=\"\\n\")\n", "measured_fast_code_sha256": "87e6edd80821ee298d94931e002157bd21ef5bd3bacd4b6f684c94b879d846c1", "measured_slow_code": "from collections import defaultdict\nimport sys\n\n\nclass BIT:\n def __init__(self, number):\n self.n = number\n self.list = [0] * (number + 1)\n\n def add(self, i, x): # ith added x 1indexed\n while i <= self.n:\n self.list[i] += x\n i += i & -i\n\n def search(self, i): # 1-i sum\n s = 0\n while i > 0:\n s += self.list[i]\n i -= i & -i\n return s\n\n def suma(self, i, j): # i,i+1,..j sum\n return self.search(j) - self.search(i - 1)\n\n\nN = int(eval(input()))\nA = [int(i) for i in input().split()]\nC = sorted(set(A))\nndd = defaultdict(int)\nfor i in range(len(C)):\n ndd[i + 1] = C[i]\ndd = defaultdict(int)\nfor i in range(len(C)):\n dd[C[i]] = i + 1\n# print(ndd,dd)\nvisit = [0] * N\nvisit[0] = 1\ns = A[0]\nH = []\nH.append(s)\nfor i in range(1, N):\n if s < A[i]:\n s = A[i]\n H.append(s)\n visit[i] = 1\nBITI = BIT(N + 1)\nBITI2 = BIT(N + 1)\nj = len(H) - 1\nl = dd[H[j]]\nnum = sum(A)\nT = [0] * N\nans = 0\nfor i in range(N - 1, -1, -1):\n if l == dd[A[0]]:\n break\n BITI.add(dd[A[i]], A[i])\n BITI2.add(dd[A[i]], 1)\n if dd[A[i]] == l and visit[i] == 1:\n T[i] = (\n BITI.suma(dd[H[j - 1]], N + 1)\n - BITI2.suma(dd[H[j - 1]], N + 1) * H[j - 1]\n - ans\n )\n ans += T[i]\n # print(i,j,l,T[i],ans)\n j -= 1\n l = dd[H[j]]\nx = num - sum(T)\nT[0] = x\n# print(visit,T)\nfor t in T:\n print(t)\n", "measured_slow_code_sha256": "40cdb704510a327363c2183827f02e9385c4a8e8deb4ae92265564da9b8e0f50", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.9401770808225716, "pair_id": "python_v2_422514ef0e353521cacaef54", "per_case_slow_code_faster_fraction": 0.07, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03801", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03801_87e6edd80821ee298d94931e002157bd21ef5bd3bacd4b6f684c94b879d846c1.jsonl.gz", "inputs": "reproduction/python/inputs/p03801.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03801_40cdb704510a327363c2183827f02e9385c4a8e8deb4ae92265564da9b8e0f50.jsonl.gz"}, "slow_code": "from collections import defaultdict\nimport sys\n\n\nclass BIT:\n def __init__(self, number):\n self.n = number\n self.list = [0] * (number + 1)\n\n def add(self, i, x):\n while i <= self.n:\n self.list[i] += x\n i += i & -i\n\n def search(self, i):\n s = 0\n while i > 0:\n s += self.list[i]\n i -= i & -i\n return s\n\n def suma(self, i, j):\n return self.search(j) - self.search(i - 1)\n\n\nN = int(eval(input()))\nA = [int(i) for i in input().split()]\nC = sorted(set(A))\nndd = defaultdict(int)\nfor i in range(len(C)):\n ndd[i + 1] = C[i]\ndd = defaultdict(int)\nfor i in range(len(C)):\n dd[C[i]] = i + 1\n\nvisit = [0] * N\nvisit[0] = 1\ns = A[0]\nH = []\nH.append(s)\nfor i in range(1, N):\n if s < A[i]:\n s = A[i]\n H.append(s)\n visit[i] = 1\nBITI = BIT(N + 1)\nBITI2 = BIT(N + 1)\nj = len(H) - 1\nl = dd[H[j]]\nnum = sum(A)\nT = [0] * N\nans = 0\nfor i in range(N - 1, -1, -1):\n if l == dd[A[0]]:\n break\n BITI.add(dd[A[i]], A[i])\n BITI2.add(dd[A[i]], 1)\n if dd[A[i]] == l and visit[i] == 1:\n T[i] = (\n BITI.suma(dd[H[j - 1]], N + 1)\n - BITI2.suma(dd[H[j - 1]], N + 1) * H[j - 1]\n - ans\n )\n ans += T[i]\n\n j -= 1\n l = dd[H[j]]\nx = num - sum(T)\nT[0] = x\n\nfor t in T:\n print(t)\n", "slow_code_sha256": "16fad88fa10618a2d3253fe477e8c221495b37e3b11f228319dc3cf0097c8388", "slow_id": "p03801_40cdb704510a327363c2183827f02e9385c4a8e8deb4ae92265564da9b8e0f50", "speedup": 2.8653323206093, "stratum": "2-4", "within_pair_jaccard": 0.19540229885057472, "workload": {"case_count": 100, "description": "Repeat until N stone piles are empty: append the smallest index among current largest piles, then remove one stone from any nonempty pile. Among possible output sequences, choose the lexicographically smallest and report each index frequency. Observed inputs: N=1..100000 (median 1000); a_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1100007, "median": 9900.0, "min": 4}, "input_format": ["N\na_1 ... a_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100001, "median": 1001.0, "min": 2}}} -{"case_ids": ["p00033_case_000", "p00033_case_001", "p00033_case_002", "p00033_case_003", "p00033_case_004", "p00033_case_005", "p00033_case_006", "p00033_case_007", "p00033_case_008", "p00033_case_009", "p00033_case_010", "p00033_case_011", "p00033_case_012", "p00033_case_013", "p00033_case_014", "p00033_case_015", "p00033_case_016", "p00033_case_017", "p00033_case_018", "p00033_case_019", "p00033_case_020", "p00033_case_021", "p00033_case_022", "p00033_case_023", "p00033_case_024", "p00033_case_025", "p00033_case_026", "p00033_case_027", "p00033_case_028", "p00033_case_029", "p00033_case_030", "p00033_case_031", "p00033_case_032", "p00033_case_033", "p00033_case_034", "p00033_case_035", "p00033_case_036", "p00033_case_037", "p00033_case_038", "p00033_case_039", "p00033_case_040", "p00033_case_041", "p00033_case_042", "p00033_case_043", "p00033_case_044", "p00033_case_045", "p00033_case_046", "p00033_case_047", "p00033_case_048", "p00033_case_049", "p00033_case_050", "p00033_case_051", "p00033_case_052", "p00033_case_053", "p00033_case_054", "p00033_case_055", "p00033_case_056", "p00033_case_057", "p00033_case_058", "p00033_case_059", "p00033_case_060", "p00033_case_061", "p00033_case_062", "p00033_case_063", "p00033_case_064", "p00033_case_065", "p00033_case_066", "p00033_case_067", "p00033_case_068", "p00033_case_069", "p00033_case_070", "p00033_case_071", "p00033_case_072", "p00033_case_073", "p00033_case_074", "p00033_case_075", "p00033_case_076", "p00033_case_077", "p00033_case_078", "p00033_case_079", "p00033_case_080", "p00033_case_081", "p00033_case_082", "p00033_case_083", "p00033_case_084", "p00033_case_085", "p00033_case_086", "p00033_case_087", "p00033_case_088", "p00033_case_089", "p00033_case_090", "p00033_case_091", "p00033_case_092", "p00033_case_093", "p00033_case_094", "p00033_case_095", "p00033_case_096", "p00033_case_097", "p00033_case_098", "p00033_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def s(a):\n b = c = 0\n for i in a:\n if i > b:\n b = i\n elif i > c:\n c = i\n else:\n return False\n return True\n\n\nfor n in range(int(input())):\n print(\"YES\" if s(list(map(int, input().split()))) else \"NO\")\n", "fast_code_sha256": "97e7a463a7ae5a9432cd2c67f456ba04ff30cb7374fc001a0ff9009ec3d6048a", "fast_id": "p00033_97e7a463a7ae5a9432cd2c67f456ba04ff30cb7374fc001a0ff9009ec3d6048a", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def s(a):\n b = c = 0\n for i in a:\n if i > b:\n b = i\n elif i > c:\n c = i\n else:\n return False\n return True\n\n\nfor n in range(int(input())):\n print(\"YES\" if s(list(map(int, input().split()))) else \"NO\")\n", "measured_fast_code_sha256": "97e7a463a7ae5a9432cd2c67f456ba04ff30cb7374fc001a0ff9009ec3d6048a", "measured_slow_code": "N = int(input())\nfor c in range(N):\n B = [0]\n C = [0]\n\n def dfs(depth):\n if depth == 10:\n return True\n res = False\n if B[-1] < A[depth]:\n B.append(A[depth])\n res |= dfs(depth + 1)\n del B[-1]\n if C[-1] < A[depth]:\n C.append(A[depth])\n res |= dfs(depth + 1)\n del C[-1]\n return res\n\n A = list(map(int, input().split(\" \")))\n print(\"YES\" if dfs(0) else \"NO\")\n", "measured_slow_code_sha256": "cceb1f2e2d09140b45c7d16169008011222b0bc177f58ecd4909af55948b3e6a", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.10499994540425, "pair_id": "python_v2_ac6fbe66e15edb7f8a8f8041", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p00033", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p00033_97e7a463a7ae5a9432cd2c67f456ba04ff30cb7374fc001a0ff9009ec3d6048a.jsonl.gz", "inputs": "reproduction/python/inputs/p00033.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p00033_cceb1f2e2d09140b45c7d16169008011222b0bc177f58ecd4909af55948b3e6a.jsonl.gz"}, "slow_code": "N = int(input())\nfor c in range(N):\n B = [0]\n C = [0]\n\n def dfs(depth):\n if depth == 10:\n return True\n res = False\n if B[-1] < A[depth]:\n B.append(A[depth])\n res |= dfs(depth + 1)\n del B[-1]\n if C[-1] < A[depth]:\n C.append(A[depth])\n res |= dfs(depth + 1)\n del C[-1]\n return res\n\n A = list(map(int, input().split(\" \")))\n print(\"YES\" if dfs(0) else \"NO\")\n", "slow_code_sha256": "cceb1f2e2d09140b45c7d16169008011222b0bc177f58ecd4909af55948b3e6a", "slow_id": "p00033_cceb1f2e2d09140b45c7d16169008011222b0bc177f58ecd4909af55948b3e6a", "speedup": 3.572039221415526, "stratum": "2-4", "within_pair_jaccard": 0.5277777777777778, "workload": {"case_count": 100, "description": "For each permutation of 1..10, decide whether it can be assigned in arrival order to two stacks so that values increase from bottom to top in each stack. The first integer gives the number of datasets. Observed inputs: datasets=1..10 (median 7); permutation_length=10.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 213, "median": 149.0, "min": 23}, "input_format": ["N\n[permutation of 1..10]\n... (N permutation lines)"], "input_format_status": "source_input_section", "input_lines": {"max": 11, "median": 8.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 101, "median": 71.0, "min": 11}}} -{"case_ids": ["p03419_case_000", "p03419_case_001", "p03419_case_002", "p03419_case_003", "p03419_case_004", "p03419_case_005", "p03419_case_006", "p03419_case_007", "p03419_case_008", "p03419_case_009", "p03419_case_010", "p03419_case_011", "p03419_case_012", "p03419_case_013", "p03419_case_014", "p03419_case_015", "p03419_case_016", "p03419_case_017", "p03419_case_018", "p03419_case_019", "p03419_case_020", "p03419_case_021", "p03419_case_022", "p03419_case_023", "p03419_case_024", "p03419_case_025", "p03419_case_026", "p03419_case_027", "p03419_case_028", "p03419_case_029", "p03419_case_030", "p03419_case_031", "p03419_case_032", "p03419_case_033", "p03419_case_034", "p03419_case_035", "p03419_case_036", "p03419_case_037", "p03419_case_038", "p03419_case_039", "p03419_case_040", "p03419_case_041", "p03419_case_042", "p03419_case_043", "p03419_case_044", "p03419_case_045", "p03419_case_046", "p03419_case_047", "p03419_case_048", "p03419_case_049", "p03419_case_050", "p03419_case_051", "p03419_case_052", "p03419_case_053", "p03419_case_054", "p03419_case_055", "p03419_case_056", "p03419_case_057", "p03419_case_058", "p03419_case_059", "p03419_case_060", "p03419_case_061", "p03419_case_062", "p03419_case_063", "p03419_case_064", "p03419_case_065", "p03419_case_066", "p03419_case_067", "p03419_case_068", "p03419_case_069", "p03419_case_070", "p03419_case_071", "p03419_case_072", "p03419_case_073", "p03419_case_074", "p03419_case_075", "p03419_case_076", "p03419_case_077", "p03419_case_078", "p03419_case_079", "p03419_case_080", "p03419_case_081", "p03419_case_082", "p03419_case_083", "p03419_case_084", "p03419_case_085", "p03419_case_086", "p03419_case_087", "p03419_case_088", "p03419_case_089", "p03419_case_090", "p03419_case_091", "p03419_case_092", "p03419_case_093", "p03419_case_094", "p03419_case_095", "p03419_case_096", "p03419_case_097", "p03419_case_098", "p03419_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import math\nimport sys\nimport collections\nimport bisect\n\nreadline = sys.stdin.readline\n\n\ndef main():\n n, m = list(map(int, readline().rstrip().split()))\n print((abs((m - 2) * (n - 2))))\n\n\nif __name__ == \"__main__\":\n main()\n", "fast_code_sha256": "a09754325312e1df7322770a3cdfe2dba0c5ba1251b53934de3312ab935cea19", "fast_id": "p03419_a09754325312e1df7322770a3cdfe2dba0c5ba1251b53934de3312ab935cea19", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import math\nimport sys\nimport collections\nimport bisect\n\nreadline = sys.stdin.readline\n\n\ndef main():\n n, m = list(map(int, readline().rstrip().split()))\n print((abs((m - 2) * (n - 2))))\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_fast_code_sha256": "a09754325312e1df7322770a3cdfe2dba0c5ba1251b53934de3312ab935cea19", "measured_slow_code": "def calc0(N, M):\n cell = [[0 for i in range(M)] for j in range(N)]\n for i in range(M):\n for j in range(N):\n for y in range(-1, 2):\n for x in range(-1, 2):\n xx = i + x\n yy = j + y\n if 0 <= xx < M and 0 <= yy < N:\n cell[yy][xx] ^= 1\n r = 0\n for i in range(M):\n for j in range(N):\n if cell[j][i]:\n r += 1\n return r\n\n\ndef calc(N, M):\n if N == 1 and M == 1:\n return 1\n if N >= 2 and M >= 2:\n return (N - 2) * (M - 2)\n if N == 1:\n return M - 2\n return N - 2\n\n\nN, M = [int(_) for _ in input().split()]\nprint((calc(N, M)))\n", "measured_slow_code_sha256": "03759bbd848f3c06ca221a2e3cc07d0592161ce2c92214006d02107382720a3e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.0522888468634832, "pair_id": "python_v2_a67f40829b5a5f19cfb0a279", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03419", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03419_a09754325312e1df7322770a3cdfe2dba0c5ba1251b53934de3312ab935cea19.jsonl.gz", "inputs": "reproduction/python/inputs/p03419.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03419_03759bbd848f3c06ca221a2e3cc07d0592161ce2c92214006d02107382720a3e.jsonl.gz"}, "slow_code": "def calc0(N, M):\n cell = [[0 for i in range(M)] for j in range(N)]\n for i in range(M):\n for j in range(N):\n for y in range(-1, 2):\n for x in range(-1, 2):\n xx = i + x\n yy = j + y\n if 0 <= xx < M and 0 <= yy < N:\n cell[yy][xx] ^= 1\n r = 0\n for i in range(M):\n for j in range(N):\n if cell[j][i]:\n r += 1\n return r\n\n\ndef calc(N, M):\n if N == 1 and M == 1:\n return 1\n if N >= 2 and M >= 2:\n return (N - 2) * (M - 2)\n if N == 1:\n return M - 2\n return N - 2\n\n\nN, M = [int(_) for _ in input().split()]\nprint((calc(N, M)))\n", "slow_code_sha256": "03759bbd848f3c06ca221a2e3cc07d0592161ce2c92214006d02107382720a3e", "slow_id": "p03419_03759bbd848f3c06ca221a2e3cc07d0592161ce2c92214006d02107382720a3e", "speedup": 3.0530027234700916, "stratum": "2-4", "within_pair_jaccard": 0.13953488372093023, "workload": {"case_count": 100, "description": "An implicit N-by-M rectangle has one face-up card per cell. Once per cell, flip its own card and each of its eight neighboring cards that exists. Count face-down cards after all operations. Observed inputs: N=1..1000000000 (median 411600306.5); M=1..1000000000 (median 380900118.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 22, "median": 18.5, "min": 4}, "input_format": ["N M"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p02418_case_000", "p02418_case_001", "p02418_case_002", "p02418_case_003", "p02418_case_004", "p02418_case_005", "p02418_case_006", "p02418_case_007", "p02418_case_008", "p02418_case_009", "p02418_case_010", "p02418_case_011", "p02418_case_012", "p02418_case_013", "p02418_case_014", "p02418_case_015", "p02418_case_016", "p02418_case_017", "p02418_case_018", "p02418_case_019", "p02418_case_020", "p02418_case_021", "p02418_case_022", "p02418_case_023", "p02418_case_024", "p02418_case_025", "p02418_case_026", "p02418_case_027", "p02418_case_028", "p02418_case_029", "p02418_case_030", "p02418_case_031", "p02418_case_032", "p02418_case_033", "p02418_case_034", "p02418_case_035", "p02418_case_036", "p02418_case_037", "p02418_case_038", "p02418_case_039", "p02418_case_040", "p02418_case_041", "p02418_case_042", "p02418_case_043", "p02418_case_044", "p02418_case_045", "p02418_case_046", "p02418_case_047", "p02418_case_048", "p02418_case_049", "p02418_case_050", "p02418_case_051", "p02418_case_052", "p02418_case_053", "p02418_case_054", "p02418_case_055", "p02418_case_056", "p02418_case_057", "p02418_case_058", "p02418_case_059", "p02418_case_060", "p02418_case_061", "p02418_case_062", "p02418_case_063", "p02418_case_064", "p02418_case_065", "p02418_case_066", "p02418_case_067", "p02418_case_068", "p02418_case_069", "p02418_case_070", "p02418_case_071", "p02418_case_072", "p02418_case_073", "p02418_case_074", "p02418_case_075", "p02418_case_076", "p02418_case_077", "p02418_case_078", "p02418_case_079", "p02418_case_080", "p02418_case_081", "p02418_case_082", "p02418_case_083", "p02418_case_084", "p02418_case_085", "p02418_case_086", "p02418_case_087", "p02418_case_088", "p02418_case_089", "p02418_case_090", "p02418_case_091", "p02418_case_092", "p02418_case_093", "p02418_case_094", "p02418_case_095", "p02418_case_096", "p02418_case_097", "p02418_case_098", "p02418_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "ring = input() * 2\nword = input()\nif ring.find(word) != -1:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "fast_code_sha256": "4038bcef7f71e4bcbad1ce3a74a10cdc90a93fcdef292e18cbaf676738ce8578", "fast_id": "p02418_4038bcef7f71e4bcbad1ce3a74a10cdc90a93fcdef292e18cbaf676738ce8578", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "ring = input() * 2\nword = input()\nif ring.find(word) != -1:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "measured_fast_code_sha256": "4038bcef7f71e4bcbad1ce3a74a10cdc90a93fcdef292e18cbaf676738ce8578", "measured_slow_code": "s = input()\ntarget = input()\nring = s * 2\nf = 0\nfor i in range(len(s)):\n if ring[i : i + len(target)] == target:\n f = 1\n break\nif f == 1:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "measured_slow_code_sha256": "cef61ea324de806594aef8e5b25dea0c55fe9633d20e9e7f7cc94749726f1030", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.9296476581636368, "pair_id": "python_v2_74406490ce93622231624686", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02418", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02418_4038bcef7f71e4bcbad1ce3a74a10cdc90a93fcdef292e18cbaf676738ce8578.jsonl.gz", "inputs": "reproduction/python/inputs/p02418.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02418_cef61ea324de806594aef8e5b25dea0c55fe9633d20e9e7f7cc94749726f1030.jsonl.gz"}, "slow_code": "s = input()\ntarget = input()\nring = s * 2\nf = 0\nfor i in range(len(s)):\n if ring[i : i + len(target)] == target:\n f = 1\n break\nif f == 1:\n print(\"Yes\")\nelse:\n print(\"No\")\n", "slow_code_sha256": "cef61ea324de806594aef8e5b25dea0c55fe9633d20e9e7f7cc94749726f1030", "slow_id": "p02418_cef61ea324de806594aef8e5b25dea0c55fe9633d20e9e7f7cc94749726f1030", "speedup": 2.131165689291918, "stratum": "2-4", "within_pair_jaccard": 0.42857142857142855, "workload": {"case_count": 100, "description": "Decide whether lowercase pattern p appears contiguously in circular text s, allowing a match to cross the end-to-start boundary. The pattern is nonempty and no longer than the ring text. Observed inputs: s_length=1..100 (median 50); p_length=1..100 (median 15).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 202, "median": 89.5, "min": 4}, "input_format": ["s\np"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p03598_case_000", "p03598_case_001", "p03598_case_002", "p03598_case_003", "p03598_case_004", "p03598_case_005", "p03598_case_006", "p03598_case_007", "p03598_case_008", "p03598_case_009", "p03598_case_010", "p03598_case_011", "p03598_case_012", "p03598_case_013", "p03598_case_014", "p03598_case_015", "p03598_case_016", "p03598_case_017", "p03598_case_018", "p03598_case_019", "p03598_case_020", "p03598_case_021", "p03598_case_022", "p03598_case_023", "p03598_case_024", "p03598_case_025", "p03598_case_026", "p03598_case_027", "p03598_case_028", "p03598_case_029", "p03598_case_030", "p03598_case_031", "p03598_case_032", "p03598_case_033", "p03598_case_034", "p03598_case_035", "p03598_case_036", "p03598_case_037", "p03598_case_038", "p03598_case_039", "p03598_case_040", "p03598_case_041", "p03598_case_042", "p03598_case_043", "p03598_case_044", "p03598_case_045", "p03598_case_046", "p03598_case_047", "p03598_case_048", "p03598_case_049", "p03598_case_050", "p03598_case_051", "p03598_case_052", "p03598_case_053", "p03598_case_054", "p03598_case_055", "p03598_case_056", "p03598_case_057", "p03598_case_058", "p03598_case_059", "p03598_case_060", "p03598_case_061", "p03598_case_062", "p03598_case_063", "p03598_case_064", "p03598_case_065", "p03598_case_066", "p03598_case_067", "p03598_case_068", "p03598_case_069", "p03598_case_070", "p03598_case_071", "p03598_case_072", "p03598_case_073", "p03598_case_074", "p03598_case_075", "p03598_case_076", "p03598_case_077", "p03598_case_078", "p03598_case_079", "p03598_case_080", "p03598_case_081", "p03598_case_082", "p03598_case_083", "p03598_case_084", "p03598_case_085", "p03598_case_086", "p03598_case_087", "p03598_case_088", "p03598_case_089", "p03598_case_090", "p03598_case_091", "p03598_case_092", "p03598_case_093", "p03598_case_094", "p03598_case_095", "p03598_case_096", "p03598_case_097", "p03598_case_098", "p03598_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\nstdin = sys.stdin\ninf = 1 << 60\nmod = 1000000007\nni = lambda: int(ns())\nnin = lambda y: [ni() for _ in range(y)]\nna = lambda: list(map(int, stdin.readline().split()))\nnan = lambda y: [na() for _ in range(y)]\nnf = lambda: float(ns())\nnfn = lambda y: [nf() for _ in range(y)]\nnfa = lambda: list(map(float, stdin.readline().split()))\nnfan = lambda y: [nfa() for _ in range(y)]\nns = lambda: stdin.readline().rstrip()\nnsn = lambda y: [ns() for _ in range(y)]\nncl = lambda y: [list(ns()) for _ in range(y)]\nnas = lambda: stdin.readline().split()\nn, k = nin(2)\nx = na()\nans = 0\nfor i in range(n):\n ans += min(abs(x[i] - k) * 2, abs(x[i]) * 2)\nprint(ans)\n", "fast_code_sha256": "b56139331cede5dfee10d7e57ba4d3e5fe70d638b0a7d7343d69614e13c21b14", "fast_id": "p03598_4242b0111d34ac29f247349e2dd3df5bbea3d003d38a638f0ec7f046c27e0435", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "# Author: cr4zjh0bp\n# Created: Sat Mar 14 11:48:11 UTC 2020\nimport sys\n\nstdin = sys.stdin\ninf = 1 << 60\nmod = 1000000007\nni = lambda: int(ns())\nnin = lambda y: [ni() for _ in range(y)]\nna = lambda: list(map(int, stdin.readline().split()))\nnan = lambda y: [na() for _ in range(y)]\nnf = lambda: float(ns())\nnfn = lambda y: [nf() for _ in range(y)]\nnfa = lambda: list(map(float, stdin.readline().split()))\nnfan = lambda y: [nfa() for _ in range(y)]\nns = lambda: stdin.readline().rstrip()\nnsn = lambda y: [ns() for _ in range(y)]\nncl = lambda y: [list(ns()) for _ in range(y)]\nnas = lambda: stdin.readline().split()\nn, k = nin(2)\nx = na()\nans = 0\nfor i in range(n):\n ans += min(abs(x[i] - k) * 2, abs(x[i]) * 2)\nprint(ans)\n", "measured_fast_code_sha256": "4242b0111d34ac29f247349e2dd3df5bbea3d003d38a638f0ec7f046c27e0435", "measured_slow_code": "from collections import Counter, defaultdict, deque\nfrom heapq import heappop, heappush, heapify\nimport sys, bisect, math, itertools, fractions, pprint\n\nsys.setrecursionlimit(10**8)\nmod = 10**9 + 7\nINF = float(\"inf\")\n\n\ndef inp():\n return int(sys.stdin.readline())\n\n\ndef inpl():\n return list(map(int, sys.stdin.readline().split()))\n\n\nn = inp()\nk = inp()\na = inpl()\nres = 0\nfor i, x in enumerate(a):\n res += min(abs(k - x) * 2, x * 2)\nprint(res)\n", "measured_slow_code_sha256": "1b129bb8d189a1d33979630c69207f7fede842e1eae77ef97d34db407621cf30", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 5.4031696704597225, "pair_id": "python_v2_40f383b0ad2588b991293ceb", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03598", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03598_4242b0111d34ac29f247349e2dd3df5bbea3d003d38a638f0ec7f046c27e0435.jsonl.gz", "inputs": "reproduction/python/inputs/p03598.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03598_1b129bb8d189a1d33979630c69207f7fede842e1eae77ef97d34db407621cf30.jsonl.gz"}, "slow_code": "from collections import Counter, defaultdict, deque\nfrom heapq import heappop, heappush, heapify\nimport sys, bisect, math, itertools, fractions, pprint\n\nsys.setrecursionlimit(10**8)\nmod = 10**9 + 7\nINF = float(\"inf\")\n\n\ndef inp():\n return int(sys.stdin.readline())\n\n\ndef inpl():\n return list(map(int, sys.stdin.readline().split()))\n\n\nn = inp()\nk = inp()\na = inpl()\nres = 0\nfor i, x in enumerate(a):\n res += min(abs(k - x) * 2, x * 2)\nprint(res)\n", "slow_code_sha256": "1b129bb8d189a1d33979630c69207f7fede842e1eae77ef97d34db407621cf30", "slow_id": "p03598_1b129bb8d189a1d33979630c69207f7fede842e1eae77ef97d34db407621cf30", "speedup": 5.814804350555711, "stratum": "4-8", "within_pair_jaccard": 0.3142857142857143, "workload": {"case_count": 100, "description": "For each ball at (x_i,i), choose a robot from (0,i) or (K,i) to collect it and return to that endpoint. Minimize total travel distance over all N balls; every x_i lies strictly between 0 and K. Observed inputs: N=1..100 (median 89); K=2..100 (median 73); x_i=1..99.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 308, "median": 206.0, "min": 6}, "input_format": ["N\nK\nx_1 ... x_N"], "input_format_status": "source_input_section", "input_lines": {"max": 3, "median": 3.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 102, "median": 91.0, "min": 3}}} -{"case_ids": ["p02760_case_000", "p02760_case_001", "p02760_case_002", "p02760_case_003", "p02760_case_004", "p02760_case_005", "p02760_case_006", "p02760_case_007", "p02760_case_008", "p02760_case_009", "p02760_case_010", "p02760_case_011", "p02760_case_012", "p02760_case_013", "p02760_case_014", "p02760_case_015", "p02760_case_016", "p02760_case_017", "p02760_case_018", "p02760_case_019", "p02760_case_020", "p02760_case_021", "p02760_case_022", "p02760_case_023", "p02760_case_024", "p02760_case_025", "p02760_case_026", "p02760_case_027", "p02760_case_028", "p02760_case_029", "p02760_case_030", "p02760_case_031", "p02760_case_032", "p02760_case_033", "p02760_case_034", "p02760_case_035", "p02760_case_036", "p02760_case_037", "p02760_case_038", "p02760_case_039", "p02760_case_040", "p02760_case_041", "p02760_case_042", "p02760_case_043", "p02760_case_044", "p02760_case_045", "p02760_case_046", "p02760_case_047", "p02760_case_048", "p02760_case_049", "p02760_case_050", "p02760_case_051", "p02760_case_052", "p02760_case_053", "p02760_case_054", "p02760_case_055", "p02760_case_056", "p02760_case_057", "p02760_case_058", "p02760_case_059", "p02760_case_060", "p02760_case_061", "p02760_case_062", "p02760_case_063", "p02760_case_064", "p02760_case_065", "p02760_case_066", "p02760_case_067", "p02760_case_068", "p02760_case_069", "p02760_case_070", "p02760_case_071", "p02760_case_072", "p02760_case_073", "p02760_case_074", "p02760_case_075", "p02760_case_076", "p02760_case_077", "p02760_case_078", "p02760_case_079", "p02760_case_080", "p02760_case_081", "p02760_case_082", "p02760_case_083", "p02760_case_084", "p02760_case_085", "p02760_case_086", "p02760_case_087", "p02760_case_088", "p02760_case_089", "p02760_case_090", "p02760_case_091", "p02760_case_092", "p02760_case_093", "p02760_case_094", "p02760_case_095", "p02760_case_096", "p02760_case_097", "p02760_case_098", "p02760_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "(*A,) = list(map(int, open(0).read().split()))\nN = A[9]\nB = A[10:]\nA = A[:9]\nT = [False] * 9\nfor b in B:\n if b in A:\n T[A.index(b)] = True\nbingo = [\n (0, 1, 2),\n (3, 4, 5),\n (6, 7, 8),\n (0, 3, 6),\n (1, 4, 7),\n (2, 5, 8),\n (0, 4, 8),\n (2, 4, 6),\n]\nfor a, b, c in bingo:\n if T[a] and T[b] and T[c]:\n print(\"Yes\")\n break\nelse:\n print(\"No\")\n", "fast_code_sha256": "04988e9d8436cd8d1d33eb8fa46881b8ece01ad4252108eea2e8777b98c63472", "fast_id": "p02760_04988e9d8436cd8d1d33eb8fa46881b8ece01ad4252108eea2e8777b98c63472", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "(*A,) = list(map(int, open(0).read().split()))\nN = A[9]\nB = A[10:]\nA = A[:9]\nT = [False] * 9\nfor b in B:\n if b in A:\n T[A.index(b)] = True\nbingo = [\n (0, 1, 2),\n (3, 4, 5),\n (6, 7, 8),\n (0, 3, 6),\n (1, 4, 7),\n (2, 5, 8),\n (0, 4, 8),\n (2, 4, 6),\n]\nfor a, b, c in bingo:\n if T[a] and T[b] and T[c]:\n print(\"Yes\")\n break\nelse:\n print(\"No\")\n", "measured_fast_code_sha256": "04988e9d8436cd8d1d33eb8fa46881b8ece01ad4252108eea2e8777b98c63472", "measured_slow_code": "f = lambda a: any(all(b) for b in a) | all(a[i][i] for i in (0, 1, 2))\na = eval(\"list(map(int,input().split())),\" * 3)\nexec(\"b=int(input());a=[[u*(u!=b)for u in t]for t in a];\" * int(eval(input())))\na = [[not u for u in t] for t in a]\nprint((\"NYoe s\"[f(a) | f([t[::-1] for t in zip(*a)]) :: 2]))\n", "measured_slow_code_sha256": "3154046e3b0b642e21542a63081b5e907301002ff4b0c284741cdd49a042b9c6", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.508370680445852, "pair_id": "python_v2_5f96c30518b7f1f7a912a2c8", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02760", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02760_04988e9d8436cd8d1d33eb8fa46881b8ece01ad4252108eea2e8777b98c63472.jsonl.gz", "inputs": "reproduction/python/inputs/p02760.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02760_3154046e3b0b642e21542a63081b5e907301002ff4b0c284741cdd49a042b9c6.jsonl.gz"}, "slow_code": "f = lambda a: any(all(b) for b in a) | all(a[i][i] for i in (0, 1, 2))\na = eval(\"list(map(int,input().split())),\" * 3)\nexec(\"b=int(input());a=[[u*(u!=b)for u in t]for t in a];\" * int(eval(input())))\na = [[not u for u in t] for t in a]\nprint((\"NYoe s\"[f(a) | f([t[::-1] for t in zip(*a)]) :: 2]))\n", "slow_code_sha256": "3154046e3b0b642e21542a63081b5e907301002ff4b0c284741cdd49a042b9c6", "slow_id": "p02760_3154046e3b0b642e21542a63081b5e907301002ff4b0c284741cdd49a042b9c6", "speedup": 2.426049986918101, "stratum": "2-4", "within_pair_jaccard": 0.2549019607843137, "workload": {"case_count": 100, "description": "A 3-by-3 bingo board contains distinct integers A_i,j. Mark numbers among N distinct called values b_i and determine whether any row, column or diagonal is fully marked. Observed inputs: N=1..10 (median 6); A_i_j=1..100; b_i=1..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 60, "median": 46.5, "min": 29}, "input_format": ["A_1,1 A_1,2 A_1,3\nA_2,1 A_2,2 A_2,3\nA_3,1 A_3,2 A_3,3\nN\nb_1\n...\nb_N"], "input_format_status": "source_input_section", "input_lines": {"max": 14, "median": 10.0, "min": 5}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 20, "median": 16.0, "min": 11}}} -{"case_ids": ["p03806_case_000", "p03806_case_001", "p03806_case_002", "p03806_case_003", "p03806_case_004", "p03806_case_005", "p03806_case_006", "p03806_case_007", "p03806_case_008", "p03806_case_009", "p03806_case_010", "p03806_case_011", "p03806_case_012", "p03806_case_013", "p03806_case_014", "p03806_case_015", "p03806_case_016", "p03806_case_017", "p03806_case_018", "p03806_case_019", "p03806_case_020", "p03806_case_021", "p03806_case_022", "p03806_case_023", "p03806_case_024", "p03806_case_025", "p03806_case_026", "p03806_case_027", "p03806_case_028", "p03806_case_029", "p03806_case_030", "p03806_case_031", "p03806_case_032", "p03806_case_033", "p03806_case_034", "p03806_case_035", "p03806_case_036", "p03806_case_037", "p03806_case_038", "p03806_case_039", "p03806_case_040", "p03806_case_041", "p03806_case_042", "p03806_case_043", "p03806_case_044", "p03806_case_045", "p03806_case_046", "p03806_case_047", "p03806_case_048", "p03806_case_049", "p03806_case_050", "p03806_case_051", "p03806_case_052", "p03806_case_053", "p03806_case_054", "p03806_case_055", "p03806_case_056", "p03806_case_057", "p03806_case_058", "p03806_case_059", "p03806_case_060", "p03806_case_061", "p03806_case_062", "p03806_case_063", "p03806_case_064", "p03806_case_065", "p03806_case_066", "p03806_case_067", "p03806_case_068", "p03806_case_069", "p03806_case_070", "p03806_case_071", "p03806_case_072", "p03806_case_073", "p03806_case_074", "p03806_case_075", "p03806_case_076", "p03806_case_077", "p03806_case_078", "p03806_case_079", "p03806_case_080", "p03806_case_081", "p03806_case_082", "p03806_case_083", "p03806_case_084", "p03806_case_085", "p03806_case_086", "p03806_case_087", "p03806_case_088", "p03806_case_089", "p03806_case_090", "p03806_case_091", "p03806_case_092", "p03806_case_093", "p03806_case_094", "p03806_case_095", "p03806_case_096", "p03806_case_097", "p03806_case_098", "p03806_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\ninput = lambda: sys.stdin.readline().rstrip()\nsys.setrecursionlimit(max(1000, 10**9))\nwrite = lambda x: sys.stdout.write(x + \"\\n\")\nn, ma, mb = list(map(int, input().split()))\nabc = [None] * n\nfor i in range(n):\n a, b, c = tuple(map(int, input().split()))\n abc[i] = (a * mb - b * ma, c)\nabc.sort()\n\n\ndef halfcomb(l):\n n = len(l)\n n1 = n // 2\n n2 = (n + 1) // 2\n l1 = []\n l2 = []\n\n def sub(v1, v2, i, bound, ll, ind=0):\n if i == bound:\n ll.append((v1, v2))\n return\n sub(v1, v2, i + 1, bound, ll, ind)\n sub(v1 + l[ind + i][0], v2 + l[ind + i][1], i + 1, bound, ll, ind)\n\n sub(0, 0, 0, n1, l1)\n sub(0, 0, 0, n2, l2, ind=n1)\n return l1, l2\n\n\nl1, l2 = halfcomb(abc)\nd2 = {}\nfor v, c in l2:\n if v in d2:\n d2[v] = min(d2[v], c)\n else:\n d2[v] = c\nans = float(\"inf\")\nfor v, c in l1:\n if v == 0 and c > 0:\n ans = min(ans, c)\nfor v, c in l2:\n if v == 0 and c > 0:\n ans = min(ans, c)\nfor v, c in l1:\n if -v in d2 and c + d2[-v] > 0:\n ans = min(ans, c + d2[-v])\nif ans == float(\"inf\"):\n ans = -1\nprint(ans)\n", "fast_code_sha256": "bab9323cfeaa66336157fcfc351fa47a4d07aa183900fa44056dd2eea3a678e6", "fast_id": "p03806_bab9323cfeaa66336157fcfc351fa47a4d07aa183900fa44056dd2eea3a678e6", "fine_bin": 4, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import sys\n\ninput = lambda: sys.stdin.readline().rstrip()\nsys.setrecursionlimit(max(1000, 10**9))\nwrite = lambda x: sys.stdout.write(x + \"\\n\")\nn, ma, mb = list(map(int, input().split()))\nabc = [None] * n\nfor i in range(n):\n a, b, c = tuple(map(int, input().split()))\n abc[i] = (a * mb - b * ma, c)\nabc.sort()\n\n\ndef halfcomb(l):\n n = len(l)\n n1 = n // 2\n n2 = (n + 1) // 2\n l1 = []\n l2 = []\n\n def sub(v1, v2, i, bound, ll, ind=0):\n if i == bound:\n ll.append((v1, v2))\n return\n sub(v1, v2, i + 1, bound, ll, ind)\n sub(v1 + l[ind + i][0], v2 + l[ind + i][1], i + 1, bound, ll, ind)\n\n sub(0, 0, 0, n1, l1)\n sub(0, 0, 0, n2, l2, ind=n1)\n return l1, l2\n\n\nl1, l2 = halfcomb(abc)\nd2 = {}\nfor v, c in l2:\n if v in d2:\n d2[v] = min(d2[v], c)\n else:\n d2[v] = c\nans = float(\"inf\")\nfor v, c in l1:\n if v == 0 and c > 0:\n ans = min(ans, c)\nfor v, c in l2:\n if v == 0 and c > 0:\n ans = min(ans, c)\nfor v, c in l1:\n if -v in d2 and c + d2[-v] > 0:\n ans = min(ans, c + d2[-v])\nif ans == float(\"inf\"):\n ans = -1\nprint(ans)\n", "measured_fast_code_sha256": "bab9323cfeaa66336157fcfc351fa47a4d07aa183900fa44056dd2eea3a678e6", "measured_slow_code": "N, Ma, Mb = list(map(int, input().split()))\nINF = 40 * 100 + 1\ndp = [[INF for i in range(10 * N + 1)] for j in range(10 * N + 1)]\ndp[0][0] = 0\nans = INF\nfor p in range(N):\n a, b, c = list(map(int, input().split()))\n for i in range(len(dp) - 1, -1, -1):\n for j in range(len(dp[i]) - 1, -1, -1):\n if dp[i][j] != INF:\n dp[i + a][j + b] = min(dp[i + a][j + b], dp[i][j] + c)\n if (i + a) / (j + b) == Ma / Mb:\n ans = min(ans, dp[i + a][j + b])\nif ans == INF:\n print((-1))\nelse:\n print(ans)\n", "measured_slow_code_sha256": "de0bea56638775d452fc7d2a830b57a068d994b2ada267241a06da1ea8817a52", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 8.21188043814578, "pair_id": "python_v2_e93695485a9eda76bcf3492b", "per_case_slow_code_faster_fraction": 0.39, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03806", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03806_bab9323cfeaa66336157fcfc351fa47a4d07aa183900fa44056dd2eea3a678e6.jsonl.gz", "inputs": "reproduction/python/inputs/p03806.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03806_de0bea56638775d452fc7d2a830b57a068d994b2ada267241a06da1ea8817a52.jsonl.gz"}, "slow_code": "N, Ma, Mb = list(map(int, input().split()))\nINF = 40 * 100 + 1\ndp = [[INF for i in range(10 * N + 1)] for j in range(10 * N + 1)]\ndp[0][0] = 0\nans = INF\nfor p in range(N):\n a, b, c = list(map(int, input().split()))\n for i in range(len(dp) - 1, -1, -1):\n for j in range(len(dp[i]) - 1, -1, -1):\n if dp[i][j] != INF:\n dp[i + a][j + b] = min(dp[i + a][j + b], dp[i][j] + c)\n if (i + a) / (j + b) == Ma / Mb:\n ans = min(ans, dp[i + a][j + b])\nif ans == INF:\n print((-1))\nelse:\n print(ans)\n", "slow_code_sha256": "de0bea56638775d452fc7d2a830b57a068d994b2ada267241a06da1ea8817a52", "slow_id": "p03806_de0bea56638775d452fc7d2a830b57a068d994b2ada267241a06da1ea8817a52", "speedup": 5.54175862790411, "stratum": "4-8", "within_pair_jaccard": 0.3, "workload": {"case_count": 100, "description": "Choose a nonempty subset of N packages to obtain substances A and B in ratio M_a:M_b at minimum total cost. Package i supplies amounts a_i and b_i at cost c_i. Observed inputs: N=1..40 (median 20); M_a=1..10; M_b=1..10; a_i=1..10; b_i=1..10; c_i=1..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 298, "median": 150.0, "min": 13}, "input_format": ["N M_a M_b\na_1 b_1 c_1\n...\na_N b_N c_N"], "input_format_status": "source_input_section", "input_lines": {"max": 41, "median": 21.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 123, "median": 63.0, "min": 6}}} -{"case_ids": ["p02763_case_000", "p02763_case_001", "p02763_case_002", "p02763_case_003", "p02763_case_004", "p02763_case_005", "p02763_case_006", "p02763_case_007", "p02763_case_008", "p02763_case_009", "p02763_case_010", "p02763_case_011", "p02763_case_012", "p02763_case_013", "p02763_case_014", "p02763_case_015", "p02763_case_016", "p02763_case_017", "p02763_case_018", "p02763_case_019", "p02763_case_020", "p02763_case_021", "p02763_case_022", "p02763_case_023", "p02763_case_024", "p02763_case_025", "p02763_case_026", "p02763_case_027", "p02763_case_028", "p02763_case_029", "p02763_case_030", "p02763_case_031", "p02763_case_032", "p02763_case_033", "p02763_case_034", "p02763_case_035", "p02763_case_036", "p02763_case_037", "p02763_case_038", "p02763_case_039", "p02763_case_040", "p02763_case_041", "p02763_case_042", "p02763_case_043", "p02763_case_044", "p02763_case_045", "p02763_case_046", "p02763_case_047", "p02763_case_048", "p02763_case_049", "p02763_case_050", "p02763_case_051", "p02763_case_052", "p02763_case_053", "p02763_case_054", "p02763_case_055", "p02763_case_056", "p02763_case_057", "p02763_case_058", "p02763_case_059", "p02763_case_060", "p02763_case_061", "p02763_case_062", "p02763_case_063", "p02763_case_064", "p02763_case_065", "p02763_case_066", "p02763_case_067", "p02763_case_068", "p02763_case_069", "p02763_case_070", "p02763_case_071", "p02763_case_072", "p02763_case_073", "p02763_case_074", "p02763_case_075", "p02763_case_076", "p02763_case_077", "p02763_case_078", "p02763_case_079", "p02763_case_080", "p02763_case_081", "p02763_case_082", "p02763_case_083", "p02763_case_084", "p02763_case_085", "p02763_case_086", "p02763_case_087", "p02763_case_088", "p02763_case_089", "p02763_case_090", "p02763_case_091", "p02763_case_092", "p02763_case_093", "p02763_case_094", "p02763_case_095", "p02763_case_096", "p02763_case_097", "p02763_case_098", "p02763_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "executable_AST_equal_except_explicit_explanatory_string_removal_and_all_frozen_inputs_checker_pass", "fast_code": "import sys\n\niim = lambda: map(int, input().rstrip().split())\n\n\ndef popcnt2(n):\n a = (\n 0,\n 1,\n 1,\n 2,\n 1,\n 2,\n 2,\n 3,\n 1,\n 2,\n 2,\n 3,\n 2,\n 3,\n 3,\n 4,\n 1,\n 2,\n 2,\n 3,\n 2,\n 3,\n 3,\n 4,\n 2,\n 3,\n 3,\n 4,\n 3,\n 4,\n 4,\n 5,\n 1,\n 2,\n 2,\n 3,\n 2,\n 3,\n 3,\n 4,\n 2,\n 3,\n 3,\n 4,\n 3,\n 4,\n 4,\n 5,\n 2,\n 3,\n 3,\n 4,\n 3,\n 4,\n 4,\n 5,\n 3,\n 4,\n 4,\n 5,\n 4,\n 5,\n 5,\n 6,\n 1,\n 2,\n 2,\n 3,\n 2,\n 3,\n 3,\n 4,\n 2,\n 3,\n 3,\n 4,\n 3,\n 4,\n 4,\n 5,\n 2,\n 3,\n 3,\n 4,\n 3,\n 4,\n 4,\n 5,\n 3,\n 4,\n 4,\n 5,\n 4,\n 5,\n 5,\n 6,\n 2,\n 3,\n 3,\n 4,\n 3,\n 4,\n 4,\n 5,\n 3,\n 4,\n 4,\n 5,\n 4,\n 5,\n 5,\n 6,\n 3,\n 4,\n 4,\n 5,\n 4,\n 5,\n 5,\n 6,\n 4,\n 5,\n 5,\n 6,\n 5,\n 6,\n 6,\n 7,\n 1,\n 2,\n 2,\n 3,\n 2,\n 3,\n 3,\n 4,\n 2,\n 3,\n 3,\n 4,\n 3,\n 4,\n 4,\n 5,\n 2,\n 3,\n 3,\n 4,\n 3,\n 4,\n 4,\n 5,\n 3,\n 4,\n 4,\n 5,\n 4,\n 5,\n 5,\n 6,\n 2,\n 3,\n 3,\n 4,\n 3,\n 4,\n 4,\n 5,\n 3,\n 4,\n 4,\n 5,\n 4,\n 5,\n 5,\n 6,\n 3,\n 4,\n 4,\n 5,\n 4,\n 5,\n 5,\n 6,\n 4,\n 5,\n 5,\n 6,\n 5,\n 6,\n 6,\n 7,\n 2,\n 3,\n 3,\n 4,\n 3,\n 4,\n 4,\n 5,\n 3,\n 4,\n 4,\n 5,\n 4,\n 5,\n 5,\n 6,\n 3,\n 4,\n 4,\n 5,\n 4,\n 5,\n 5,\n 6,\n 4,\n 5,\n 5,\n 6,\n 5,\n 6,\n 6,\n 7,\n 3,\n 4,\n 4,\n 5,\n 4,\n 5,\n 5,\n 6,\n 4,\n 5,\n 5,\n 6,\n 5,\n 6,\n 6,\n 7,\n 4,\n 5,\n 5,\n 6,\n 5,\n 6,\n 6,\n 7,\n 5,\n 6,\n 6,\n 7,\n 6,\n 7,\n 7,\n 8,\n )\n ans = 0\n while n:\n ans += a[n & 0xFF]\n n >>= 8\n return ans\n\n\ndef resolve():\n N = int(input())\n S = list(input())\n Q = int(input())\n ln = N.bit_length() + 1\n c0 = ord(\"a\")\n smap = [1 << (i - c0) for i in range(c0, ord(\"z\") + 1)]\n T = [None] * ln\n T[0] = [smap[ord(S[i]) - c0] for i in range(N)]\n if N & 1:\n T[0].append(0)\n N += 1\n t0, n2 = T[0], N\n for i in range(1, ln):\n n1 = n2 = n2 >> 1\n if n2 & 1:\n n2 += 1\n ti = T[i] = [0] * n2\n for j in range(n1):\n j2 = j << 1\n d1, d2 = t0[j2], t0[j2 + 1]\n ti[j] = d1 | d2\n t0 = ti\n\n ans = []\n for cmd, i, j in (line.split() for line in sys.stdin):\n i = int(i) - 1\n if cmd == \"1\":\n if S[i] == j:\n continue\n S[i] = j\n t0 = T[0]\n t0[i] = smap[ord(j) - c0]\n for i1 in range(1, ln):\n ti = T[i1]\n j1 = i >> 1\n ti[j1] = t0[i] | t0[i ^ 1]\n i, t0 = j1, ti\n\n elif cmd == \"2\":\n j = int(j) - 1\n d1 = 0\n for i1 in range(ln):\n ti = T[i1]\n if not i < j:\n if i == j:\n d1 |= ti[i]\n break\n if i & 1:\n d1 |= ti[i]\n i += 1\n if j & 1 == 0:\n d1 |= ti[j]\n j -= 1\n i >>= 1\n j >>= 1\n ans.append(popcnt2(d1))\n print(*ans, sep=\"\\n\")\n\n\nif __name__ == \"__main__\":\n resolve()\n", "fast_code_sha256": "d67346144063c9953ad7327a7dfaf60402f48a7da255ded5c6f0b445f7367bb1", "fast_id": "p02763_1e6d65d067e83926ee7675a54e4d88003ee8389df73ca8f9b388e5a0712825ce", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "#!python3\nimport sys\n\niim = lambda: map(int, input().rstrip().split())\n\n\ndef popcnt2(n):\n a = (\n 0,\n 1,\n 1,\n 2,\n 1,\n 2,\n 2,\n 3,\n 1,\n 2,\n 2,\n 3,\n 2,\n 3,\n 3,\n 4,\n 1,\n 2,\n 2,\n 3,\n 2,\n 3,\n 3,\n 4,\n 2,\n 3,\n 3,\n 4,\n 3,\n 4,\n 4,\n 5,\n 1,\n 2,\n 2,\n 3,\n 2,\n 3,\n 3,\n 4,\n 2,\n 3,\n 3,\n 4,\n 3,\n 4,\n 4,\n 5,\n 2,\n 3,\n 3,\n 4,\n 3,\n 4,\n 4,\n 5,\n 3,\n 4,\n 4,\n 5,\n 4,\n 5,\n 5,\n 6,\n 1,\n 2,\n 2,\n 3,\n 2,\n 3,\n 3,\n 4,\n 2,\n 3,\n 3,\n 4,\n 3,\n 4,\n 4,\n 5,\n 2,\n 3,\n 3,\n 4,\n 3,\n 4,\n 4,\n 5,\n 3,\n 4,\n 4,\n 5,\n 4,\n 5,\n 5,\n 6,\n 2,\n 3,\n 3,\n 4,\n 3,\n 4,\n 4,\n 5,\n 3,\n 4,\n 4,\n 5,\n 4,\n 5,\n 5,\n 6,\n 3,\n 4,\n 4,\n 5,\n 4,\n 5,\n 5,\n 6,\n 4,\n 5,\n 5,\n 6,\n 5,\n 6,\n 6,\n 7,\n 1,\n 2,\n 2,\n 3,\n 2,\n 3,\n 3,\n 4,\n 2,\n 3,\n 3,\n 4,\n 3,\n 4,\n 4,\n 5,\n 2,\n 3,\n 3,\n 4,\n 3,\n 4,\n 4,\n 5,\n 3,\n 4,\n 4,\n 5,\n 4,\n 5,\n 5,\n 6,\n 2,\n 3,\n 3,\n 4,\n 3,\n 4,\n 4,\n 5,\n 3,\n 4,\n 4,\n 5,\n 4,\n 5,\n 5,\n 6,\n 3,\n 4,\n 4,\n 5,\n 4,\n 5,\n 5,\n 6,\n 4,\n 5,\n 5,\n 6,\n 5,\n 6,\n 6,\n 7,\n 2,\n 3,\n 3,\n 4,\n 3,\n 4,\n 4,\n 5,\n 3,\n 4,\n 4,\n 5,\n 4,\n 5,\n 5,\n 6,\n 3,\n 4,\n 4,\n 5,\n 4,\n 5,\n 5,\n 6,\n 4,\n 5,\n 5,\n 6,\n 5,\n 6,\n 6,\n 7,\n 3,\n 4,\n 4,\n 5,\n 4,\n 5,\n 5,\n 6,\n 4,\n 5,\n 5,\n 6,\n 5,\n 6,\n 6,\n 7,\n 4,\n 5,\n 5,\n 6,\n 5,\n 6,\n 6,\n 7,\n 5,\n 6,\n 6,\n 7,\n 6,\n 7,\n 7,\n 8,\n )\n ans = 0\n while n:\n ans += a[n & 0xFF]\n n >>= 8\n return ans\n\n\ndef resolve():\n N = int(input())\n S = list(input())\n Q = int(input())\n ln = N.bit_length() + 1\n c0 = ord(\"a\")\n smap = [1 << (i - c0) for i in range(c0, ord(\"z\") + 1)]\n T = [None] * ln\n T[0] = [smap[ord(S[i]) - c0] for i in range(N)]\n if N & 1:\n T[0].append(0)\n N += 1\n t0, n2 = T[0], N\n for i in range(1, ln):\n n1 = n2 = n2 >> 1\n if n2 & 1:\n n2 += 1\n ti = T[i] = [0] * n2\n for j in range(n1):\n j2 = j << 1\n d1, d2 = t0[j2], t0[j2 + 1]\n ti[j] = d1 | d2\n t0 = ti\n # for ti in T:\n # print(len(ti), ti)\n ans = []\n for cmd, i, j in (line.split() for line in sys.stdin):\n i = int(i) - 1\n if cmd == \"1\":\n if S[i] == j:\n continue\n S[i] = j\n t0 = T[0]\n t0[i] = smap[ord(j) - c0]\n for i1 in range(1, ln):\n ti = T[i1]\n j1 = i >> 1\n ti[j1] = t0[i] | t0[i ^ 1]\n i, t0 = j1, ti\n # for ti in T:\n # print(len(ti), ti)\n elif cmd == \"2\":\n j = int(j) - 1\n d1 = 0\n for i1 in range(ln):\n ti = T[i1]\n if not i < j:\n if i == j:\n d1 |= ti[i]\n break\n if i & 1:\n d1 |= ti[i]\n i += 1\n if j & 1 == 0:\n d1 |= ti[j]\n j -= 1\n i >>= 1\n j >>= 1\n ans.append(popcnt2(d1))\n print(*ans, sep=\"\\n\")\n\n\nif __name__ == \"__main__\":\n resolve()\n", "measured_fast_code_sha256": "1e6d65d067e83926ee7675a54e4d88003ee8389df73ca8f9b388e5a0712825ce", "measured_slow_code": "import sys\n\ninput = sys.stdin.readline\n\n\nclass Bit:\n def __init__(self, n):\n self.n = n\n self.tree = [0] * (n + 1)\n self.el = [0] * (n + 1)\n self.depth = n.bit_length() - 1\n\n def sum(self, i):\n \"\"\"区間[0,i) の総和を求める\"\"\"\n s = 0\n i -= 1\n while i >= 0:\n s += self.tree[i]\n i = (i & (i + 1)) - 1\n return s\n\n def add(self, i, x):\n \"\"\"i 番目の要素に x を足す\"\"\"\n self.el[i] += x\n while i < self.n:\n self.tree[i] += x\n i |= i + 1\n\n def get(self, i, j=None):\n \"\"\"部分区間和 [i, j)\"\"\"\n if j is None:\n return self.el[i]\n if i == 0:\n return self.sum(j)\n return self.sum(j) - self.sum(i)\n\n def lower_bound(self, x, equal=False):\n \"\"\"(a0+a1+...+ai < x となる最大の i, その時の a0+a1+...+ai )\n a0+a1+...+ai <= x としたい場合は equal = True\n 二分探索であるため、ai>=0 を満たす必要がある\"\"\"\n sum_ = 0\n pos = -1 # 1-indexed の時は pos = 0\n if not equal:\n for i in range(self.depth, -1, -1):\n k = pos + (1 << i)\n if k < self.n and sum_ + self.tree[k] < x: # 1-indexed の時は k <= self.n\n sum_ += self.tree[k]\n pos += 1 << i\n if equal:\n for i in range(self.depth, -1, -1):\n k = pos + (1 << i)\n if k < self.n and sum_ + self.tree[k] <= x: # 1-indexed の時は k <= self.n\n sum_ += self.tree[k]\n pos += 1 << i\n return pos, sum_\n\n def __getitem__(self, s):\n \"\"\"[a0, a1, a2, ...]\"\"\"\n return self.el[s]\n\n def __iter__(self):\n \"\"\"[a0, a1, a2, ...]\"\"\"\n for s in self.el[: self.n]:\n yield s\n\n def __str__(self):\n text1 = \" \".join([\"element: \"] + list(map(str, self)))\n text2 = \" \".join(\n [\"cumsum(1-indexed): \"]\n + list(str(self.sum(i)) for i in range(1, self.n + 1))\n )\n return \"\\n\".join((text1, text2))\n\n\n####################################################################################################\nimport string\n\nN = int(eval(input()))\nS = input().strip()\nQ = int(eval(input()))\nB = [Bit(N) for _ in range(26)]\nabc = string.ascii_lowercase # [a-z] をロード\nabc2 = dict()\nfor i, s in enumerate(abc):\n abc2[s] = i\nfor i, s in enumerate(S):\n B[abc2[s]].add(i, 1)\nfor _ in range(Q):\n q = list(input().split())\n if q[0] == \"1\":\n a = int(q[1]) - 1\n b = q[2]\n for i in range(26):\n if B[i].el[a] == 1:\n B[i].add(a, -1)\n B[abc2[b]].add(a, 1)\n if q[0] == \"2\":\n a = int(q[1]) - 1\n b = int(q[2]) - 1\n res = 0\n for i in range(26):\n res += B[i].get(a, b + 1) > 0\n print(res)\n", "measured_slow_code_sha256": "f48f6f3e37812c17b5337b9141da770a977eb3ae11af352f28286963282fd6ed", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 7.090160384625091, "pair_id": "python_v2_f99ee7e0a6ee24af38e890a2", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02763", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02763_1e6d65d067e83926ee7675a54e4d88003ee8389df73ca8f9b388e5a0712825ce.jsonl.gz", "inputs": "reproduction/python/inputs/p02763.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02763_f48f6f3e37812c17b5337b9141da770a977eb3ae11af352f28286963282fd6ed.jsonl.gz"}, "slow_code": "import sys\n\ninput = sys.stdin.readline\n\n\nclass Bit:\n def __init__(self, n):\n self.n = n\n self.tree = [0] * (n + 1)\n self.el = [0] * (n + 1)\n self.depth = n.bit_length() - 1\n\n def sum(self, i):\n s = 0\n i -= 1\n while i >= 0:\n s += self.tree[i]\n i = (i & (i + 1)) - 1\n return s\n\n def add(self, i, x):\n self.el[i] += x\n while i < self.n:\n self.tree[i] += x\n i |= i + 1\n\n def get(self, i, j=None):\n if j is None:\n return self.el[i]\n if i == 0:\n return self.sum(j)\n return self.sum(j) - self.sum(i)\n\n def lower_bound(self, x, equal=False):\n sum_ = 0\n pos = -1\n if not equal:\n for i in range(self.depth, -1, -1):\n k = pos + (1 << i)\n if k < self.n and sum_ + self.tree[k] < x:\n sum_ += self.tree[k]\n pos += 1 << i\n if equal:\n for i in range(self.depth, -1, -1):\n k = pos + (1 << i)\n if k < self.n and sum_ + self.tree[k] <= x:\n sum_ += self.tree[k]\n pos += 1 << i\n return pos, sum_\n\n def __getitem__(self, s):\n return self.el[s]\n\n def __iter__(self):\n for s in self.el[: self.n]:\n yield s\n\n def __str__(self):\n text1 = \" \".join([\"element: \"] + list(map(str, self)))\n text2 = \" \".join(\n [\"cumsum(1-indexed): \"]\n + list(str(self.sum(i)) for i in range(1, self.n + 1))\n )\n return \"\\n\".join((text1, text2))\n\n\nimport string\n\nN = int(eval(input()))\nS = input().strip()\nQ = int(eval(input()))\nB = [Bit(N) for _ in range(26)]\nabc = string.ascii_lowercase\nabc2 = dict()\nfor i, s in enumerate(abc):\n abc2[s] = i\nfor i, s in enumerate(S):\n B[abc2[s]].add(i, 1)\nfor _ in range(Q):\n q = list(input().split())\n if q[0] == \"1\":\n a = int(q[1]) - 1\n b = q[2]\n for i in range(26):\n if B[i].el[a] == 1:\n B[i].add(a, -1)\n B[abc2[b]].add(a, 1)\n if q[0] == \"2\":\n a = int(q[1]) - 1\n b = int(q[2]) - 1\n res = 0\n for i in range(26):\n res += B[i].get(a, b + 1) > 0\n print(res)\n", "slow_code_sha256": "4fa4a65e4a0df3861053325cb01fa333b2482712b297bcf1214920d237936687", "slow_id": "p02763_f48f6f3e37812c17b5337b9141da770a977eb3ae11af352f28286963282fd6ed", "speedup": 5.99764071296696, "stratum": "4-8", "within_pair_jaccard": 0.2283464566929134, "workload": {"case_count": 100, "description": "Process Q ordered queries on a lowercase string S of length N. Query 1 i c replaces character i with c; query 2 l r reports the number of distinct letters in inclusive substring [l,r]. At least one type-2 query occurs. Observed inputs: N=1..500000 (median 500000); Q=1..20000 (median 20000); type1_count=0..19999; type2_count=1..20000; substring_length=1..500000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 815322, "median": 720014.0, "min": 12}, "input_format": ["N\nS\nQ\nQ query lines, each: 1 i c or 2 l r"], "input_format_status": "source_input_section", "input_lines": {"max": 20003, "median": 20003.0, "min": 4}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 60003, "median": 60003.0, "min": 6}}} -{"case_ids": ["p01268_case_000", "p01268_case_001", "p01268_case_002", "p01268_case_003", "p01268_case_004", "p01268_case_005", "p01268_case_006", "p01268_case_007", "p01268_case_008", "p01268_case_009", "p01268_case_010", "p01268_case_011", "p01268_case_012", "p01268_case_013", "p01268_case_014", "p01268_case_015", "p01268_case_016", "p01268_case_017", "p01268_case_018", "p01268_case_019", "p01268_case_020", "p01268_case_021", "p01268_case_022", "p01268_case_023", "p01268_case_024", "p01268_case_025", "p01268_case_026", "p01268_case_027", "p01268_case_028", "p01268_case_029", "p01268_case_030", "p01268_case_031", "p01268_case_032", "p01268_case_033", "p01268_case_034", "p01268_case_035", "p01268_case_036", "p01268_case_037", "p01268_case_038", "p01268_case_039", "p01268_case_040", "p01268_case_041", "p01268_case_042", "p01268_case_043", "p01268_case_044", "p01268_case_045", "p01268_case_046", "p01268_case_047", "p01268_case_048", "p01268_case_049", "p01268_case_050", "p01268_case_051", "p01268_case_052", "p01268_case_053", "p01268_case_054", "p01268_case_055", "p01268_case_056", "p01268_case_057", "p01268_case_058", "p01268_case_059", "p01268_case_060", "p01268_case_061", "p01268_case_062", "p01268_case_063", "p01268_case_064", "p01268_case_065", "p01268_case_066", "p01268_case_067", "p01268_case_068", "p01268_case_069", "p01268_case_070", "p01268_case_071", "p01268_case_072", "p01268_case_073", "p01268_case_074", "p01268_case_075", "p01268_case_076", "p01268_case_077", "p01268_case_078", "p01268_case_079", "p01268_case_080", "p01268_case_081", "p01268_case_082", "p01268_case_083", "p01268_case_084", "p01268_case_085", "p01268_case_086", "p01268_case_087", "p01268_case_088", "p01268_case_089", "p01268_case_090", "p01268_case_091", "p01268_case_092", "p01268_case_093", "p01268_case_094", "p01268_case_095", "p01268_case_096", "p01268_case_097", "p01268_case_098", "p01268_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import itertools\n\nr = 110000\ns = int(r * 0.5)\np = [1] * r\np[0] = 0\nfor i in range(1, s):\n if p[i]:\n p[2 * i + 1 :: i + 1] = [0 for x in range(2 * i + 1, r, i + 1)]\nwhile 1:\n N, P = list(map(int, input().split()))\n if N == -1:\n break\n i = N + 1\n prime = []\n while len(prime) < 30:\n if p[i - 1] == 1:\n prime.append(i)\n i += 1\n wa = sorted(\n [sum(comb) for comb in itertools.combinations(prime, 2)]\n + [2 * a for a in prime]\n )\n print(wa[P - 1])\n", "fast_code_sha256": "a8cec5eb14a763a440273fe3ce5cac605f04d24d8fd299b243bb4b7cc1f372e0", "fast_id": "p01268_a8cec5eb14a763a440273fe3ce5cac605f04d24d8fd299b243bb4b7cc1f372e0", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import itertools\n\nr = 110000\ns = int(r * 0.5)\np = [1] * r\np[0] = 0\nfor i in range(1, s):\n if p[i]:\n p[2 * i + 1 :: i + 1] = [0 for x in range(2 * i + 1, r, i + 1)]\nwhile 1:\n N, P = list(map(int, input().split()))\n if N == -1:\n break\n i = N + 1\n prime = []\n while len(prime) < 30:\n if p[i - 1] == 1:\n prime.append(i)\n i += 1\n wa = sorted(\n [sum(comb) for comb in itertools.combinations(prime, 2)]\n + [2 * a for a in prime]\n )\n print(wa[P - 1])\n", "measured_fast_code_sha256": "a8cec5eb14a763a440273fe3ce5cac605f04d24d8fd299b243bb4b7cc1f372e0", "measured_slow_code": "from bisect import bisect_right as br\nfrom itertools import combinations_with_replacement as cwr\n\nMAX = 110000\nROOT = 340\ntf = [True] * MAX\ntf[0] = tf[1] = False\nfor i in range(2, ROOT + 1):\n if tf[i]:\n for j in range(i * i, MAX, i):\n tf[j] = False\nprimes = [i for i in range(MAX) if tf[i]]\nwhile True:\n n, p = list(map(int, input().split()))\n if n == -1:\n break\n init = br(primes, n)\n choice = primes[init : init + 100]\n lst = []\n for i, j in cwr(choice, 2):\n lst.append(i + j)\n lst.sort()\n print((lst[p - 1]))\n", "measured_slow_code_sha256": "0a932eb6633858ba78c6cf0f7f33ce8a7678b6c98d01696a6e1a5b5d1b92803d", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.995320579611026, "pair_id": "python_v2_100cd547ab9c232e8504bb67", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p01268", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p01268_a8cec5eb14a763a440273fe3ce5cac605f04d24d8fd299b243bb4b7cc1f372e0.jsonl.gz", "inputs": "reproduction/python/inputs/p01268.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p01268_0a932eb6633858ba78c6cf0f7f33ce8a7678b6c98d01696a6e1a5b5d1b92803d.jsonl.gz"}, "slow_code": "from bisect import bisect_right as br\nfrom itertools import combinations_with_replacement as cwr\n\nMAX = 110000\nROOT = 340\ntf = [True] * MAX\ntf[0] = tf[1] = False\nfor i in range(2, ROOT + 1):\n if tf[i]:\n for j in range(i * i, MAX, i):\n tf[j] = False\nprimes = [i for i in range(MAX) if tf[i]]\nwhile True:\n n, p = list(map(int, input().split()))\n if n == -1:\n break\n init = br(primes, n)\n choice = primes[init : init + 100]\n lst = []\n for i, j in cwr(choice, 2):\n lst.append(i + j)\n lst.sort()\n print((lst[p - 1]))\n", "slow_code_sha256": "0a932eb6633858ba78c6cf0f7f33ce8a7678b6c98d01696a6e1a5b5d1b92803d", "slow_id": "p01268_0a932eb6633858ba78c6cf0f7f33ce8a7678b6c98d01696a6e1a5b5d1b92803d", "speedup": 2.060256639206451, "stratum": "2-4", "within_pair_jaccard": 0.3684210526315789, "workload": {"case_count": 100, "description": "For each N,P, consider unordered pairs of primes strictly greater than N, allowing equal primes. Sort their sums with multiplicity and output the P-th smallest sum, with P indexed from 1. A final -1 -1 ends input. Observed inputs: datasets=1..100 (median 20); N=0..100000; P=1..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 891, "median": 182.5, "min": 14}, "input_format": ["N_1 P_1\n...\nN_D P_D\n-1 -1"], "input_format_status": "source_input_section", "input_lines": {"max": 101, "median": 21.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 202, "median": 42.0, "min": 4}}} -{"case_ids": ["p03419_case_000", "p03419_case_001", "p03419_case_002", "p03419_case_003", "p03419_case_004", "p03419_case_005", "p03419_case_006", "p03419_case_007", "p03419_case_008", "p03419_case_009", "p03419_case_010", "p03419_case_011", "p03419_case_012", "p03419_case_013", "p03419_case_014", "p03419_case_015", "p03419_case_016", "p03419_case_017", "p03419_case_018", "p03419_case_019", "p03419_case_020", "p03419_case_021", "p03419_case_022", "p03419_case_023", "p03419_case_024", "p03419_case_025", "p03419_case_026", "p03419_case_027", "p03419_case_028", "p03419_case_029", "p03419_case_030", "p03419_case_031", "p03419_case_032", "p03419_case_033", "p03419_case_034", "p03419_case_035", "p03419_case_036", "p03419_case_037", "p03419_case_038", "p03419_case_039", "p03419_case_040", "p03419_case_041", "p03419_case_042", "p03419_case_043", "p03419_case_044", "p03419_case_045", "p03419_case_046", "p03419_case_047", "p03419_case_048", "p03419_case_049", "p03419_case_050", "p03419_case_051", "p03419_case_052", "p03419_case_053", "p03419_case_054", "p03419_case_055", "p03419_case_056", "p03419_case_057", "p03419_case_058", "p03419_case_059", "p03419_case_060", "p03419_case_061", "p03419_case_062", "p03419_case_063", "p03419_case_064", "p03419_case_065", "p03419_case_066", "p03419_case_067", "p03419_case_068", "p03419_case_069", "p03419_case_070", "p03419_case_071", "p03419_case_072", "p03419_case_073", "p03419_case_074", "p03419_case_075", "p03419_case_076", "p03419_case_077", "p03419_case_078", "p03419_case_079", "p03419_case_080", "p03419_case_081", "p03419_case_082", "p03419_case_083", "p03419_case_084", "p03419_case_085", "p03419_case_086", "p03419_case_087", "p03419_case_088", "p03419_case_089", "p03419_case_090", "p03419_case_091", "p03419_case_092", "p03419_case_093", "p03419_case_094", "p03419_case_095", "p03419_case_096", "p03419_case_097", "p03419_case_098", "p03419_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "n, m = list(map(int, input().split()))\nif 2 <= n:\n n -= 2\nif 2 <= m:\n m -= 2\nprint((n * m))\n", "fast_code_sha256": "fc5cece971c7f110c9fde09096bfcd4145848aff8a71c1ff5b48404aade567d2", "fast_id": "p03419_fc5cece971c7f110c9fde09096bfcd4145848aff8a71c1ff5b48404aade567d2", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "n, m = list(map(int, input().split()))\nif 2 <= n:\n n -= 2\nif 2 <= m:\n m -= 2\nprint((n * m))\n", "measured_fast_code_sha256": "fc5cece971c7f110c9fde09096bfcd4145848aff8a71c1ff5b48404aade567d2", "measured_slow_code": "def calc0(N, M):\n cell = [[0 for i in range(M)] for j in range(N)]\n for i in range(M):\n for j in range(N):\n for y in range(-1, 2):\n for x in range(-1, 2):\n xx = i + x\n yy = j + y\n if 0 <= xx < M and 0 <= yy < N:\n cell[yy][xx] ^= 1\n r = 0\n for i in range(M):\n for j in range(N):\n if cell[j][i]:\n r += 1\n return r\n\n\ndef calc(N, M):\n if N == 1 and M == 1:\n return 1\n if N >= 2 and M >= 2:\n return (N - 2) * (M - 2)\n if N == 1:\n return M - 2\n return N - 2\n\n\nN, M = [int(_) for _ in input().split()]\nprint((calc(N, M)))\n", "measured_slow_code_sha256": "03759bbd848f3c06ca221a2e3cc07d0592161ce2c92214006d02107382720a3e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 4.626122910421139, "pair_id": "python_v2_f7cfbe29dfce6edad61e95e8", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03419", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03419_fc5cece971c7f110c9fde09096bfcd4145848aff8a71c1ff5b48404aade567d2.jsonl.gz", "inputs": "reproduction/python/inputs/p03419.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03419_03759bbd848f3c06ca221a2e3cc07d0592161ce2c92214006d02107382720a3e.jsonl.gz"}, "slow_code": "def calc0(N, M):\n cell = [[0 for i in range(M)] for j in range(N)]\n for i in range(M):\n for j in range(N):\n for y in range(-1, 2):\n for x in range(-1, 2):\n xx = i + x\n yy = j + y\n if 0 <= xx < M and 0 <= yy < N:\n cell[yy][xx] ^= 1\n r = 0\n for i in range(M):\n for j in range(N):\n if cell[j][i]:\n r += 1\n return r\n\n\ndef calc(N, M):\n if N == 1 and M == 1:\n return 1\n if N >= 2 and M >= 2:\n return (N - 2) * (M - 2)\n if N == 1:\n return M - 2\n return N - 2\n\n\nN, M = [int(_) for _ in input().split()]\nprint((calc(N, M)))\n", "slow_code_sha256": "03759bbd848f3c06ca221a2e3cc07d0592161ce2c92214006d02107382720a3e", "slow_id": "p03419_03759bbd848f3c06ca221a2e3cc07d0592161ce2c92214006d02107382720a3e", "speedup": 4.630424162400763, "stratum": "4-8", "within_pair_jaccard": 0.1935483870967742, "workload": {"case_count": 100, "description": "An implicit N-by-M rectangle has one face-up card per cell. Once per cell, flip its own card and each of its eight neighboring cards that exists. Count face-down cards after all operations. Observed inputs: N=1..1000000000 (median 411600306.5); M=1..1000000000 (median 380900118.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 22, "median": 18.5, "min": 4}, "input_format": ["N M"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p00028_case_000", "p00028_case_001", "p00028_case_002", "p00028_case_003", "p00028_case_004", "p00028_case_005", "p00028_case_006", "p00028_case_007", "p00028_case_008", "p00028_case_009", "p00028_case_010", "p00028_case_011", "p00028_case_012", "p00028_case_013", "p00028_case_014", "p00028_case_015", "p00028_case_016", "p00028_case_017", "p00028_case_018", "p00028_case_019", "p00028_case_020", "p00028_case_021", "p00028_case_022", "p00028_case_023", "p00028_case_024", "p00028_case_025", "p00028_case_026", "p00028_case_027", "p00028_case_028", "p00028_case_029", "p00028_case_030", "p00028_case_031", "p00028_case_032", "p00028_case_033", "p00028_case_034", "p00028_case_035", "p00028_case_036", "p00028_case_037", "p00028_case_038", "p00028_case_039", "p00028_case_040", "p00028_case_041", "p00028_case_042", "p00028_case_043", "p00028_case_044", "p00028_case_045", "p00028_case_046", "p00028_case_047", "p00028_case_048", "p00028_case_049", "p00028_case_050", "p00028_case_051", "p00028_case_052", "p00028_case_053", "p00028_case_054", "p00028_case_055", "p00028_case_056", "p00028_case_057", "p00028_case_058", "p00028_case_059", "p00028_case_060", "p00028_case_061", "p00028_case_062", "p00028_case_063", "p00028_case_064", "p00028_case_065", "p00028_case_066", "p00028_case_067", "p00028_case_068", "p00028_case_069", "p00028_case_070", "p00028_case_071", "p00028_case_072", "p00028_case_073", "p00028_case_074", "p00028_case_075", "p00028_case_076", "p00028_case_077", "p00028_case_078", "p00028_case_079", "p00028_case_080", "p00028_case_081", "p00028_case_082", "p00028_case_083", "p00028_case_084", "p00028_case_085", "p00028_case_086", "p00028_case_087", "p00028_case_088", "p00028_case_089", "p00028_case_090", "p00028_case_091", "p00028_case_092", "p00028_case_093", "p00028_case_094", "p00028_case_095", "p00028_case_096", "p00028_case_097", "p00028_case_098", "p00028_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "d = {}\ntry:\n while True:\n n = int(input())\n if n in d:\n d[n] += 1\n else:\n d[n] = 1\nexcept EOFError:\n pass\na = []\nm = max(d.values())\nfor key, value in list(d.items()):\n if value == m:\n a.append(key)\na.sort()\nfor i in a:\n print(i)\n", "fast_code_sha256": "36efa31a817599454e47c950d8405cd8170cd3f67b1b12f911d115f29e6e8467", "fast_id": "p00028_36efa31a817599454e47c950d8405cd8170cd3f67b1b12f911d115f29e6e8467", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "d = {}\ntry:\n while True:\n n = int(input())\n if n in d:\n d[n] += 1\n else:\n d[n] = 1\nexcept EOFError:\n pass\na = []\nm = max(d.values())\nfor key, value in list(d.items()):\n if value == m:\n a.append(key)\na.sort()\nfor i in a:\n print(i)\n", "measured_fast_code_sha256": "36efa31a817599454e47c950d8405cd8170cd3f67b1b12f911d115f29e6e8467", "measured_slow_code": "a = [0] * 100\nwhile 1:\n try:\n n = int(eval(input()))\n a[n - 1] += 1\n except:\n for i in range(100):\n if a[i] == max(a):\n print((i + 1))\n break\n", "measured_slow_code_sha256": "4fbfbfa3bae80164cb84ea06f8fba0f419684493b80b546f778ef4c616e812e2", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.802641537561921, "pair_id": "python_v2_1881dd19e3ce9367d82153a1", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p00028", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p00028_36efa31a817599454e47c950d8405cd8170cd3f67b1b12f911d115f29e6e8467.jsonl.gz", "inputs": "reproduction/python/inputs/p00028.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p00028_4fbfbfa3bae80164cb84ea06f8fba0f419684493b80b546f778ef4c616e812e2.jsonl.gz"}, "slow_code": "a = [0] * 100\nwhile 1:\n try:\n n = int(eval(input()))\n a[n - 1] += 1\n except:\n for i in range(100):\n if a[i] == max(a):\n print((i + 1))\n break\n", "slow_code_sha256": "4fbfbfa3bae80164cb84ea06f8fba0f419684493b80b546f778ef4c616e812e2", "slow_id": "p00028_4fbfbfa3bae80164cb84ea06f8fba0f419684493b80b546f778ef4c616e812e2", "speedup": 3.6284794452856626, "stratum": "2-4", "within_pair_jaccard": 0.4375, "workload": {"case_count": 100, "description": "Find all most frequent values in the supplied integer sequence and output them in ascending order. Values are supplied one per line until end of input, with no leading count. Observed inputs: elements=1..100 (median 100); a_i=1..100.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 400, "median": 288.0, "min": 2}, "input_format": ["a_1\n...\na_L (until EOF)"], "input_format_status": "source_input_section", "input_lines": {"max": 100, "median": 100.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100, "median": 100.0, "min": 1}}} -{"case_ids": ["p03006_case_000", "p03006_case_001", "p03006_case_002", "p03006_case_003", "p03006_case_004", "p03006_case_005", "p03006_case_006", "p03006_case_007", "p03006_case_008", "p03006_case_009", "p03006_case_010", "p03006_case_011", "p03006_case_012", "p03006_case_013", "p03006_case_014", "p03006_case_015", "p03006_case_016", "p03006_case_017", "p03006_case_018", "p03006_case_019", "p03006_case_020", "p03006_case_021", "p03006_case_022", "p03006_case_023", "p03006_case_024", "p03006_case_025", "p03006_case_026", "p03006_case_027", "p03006_case_028", "p03006_case_029", "p03006_case_030", "p03006_case_031", "p03006_case_032", "p03006_case_033", "p03006_case_034", "p03006_case_035", "p03006_case_036", "p03006_case_037", "p03006_case_038", "p03006_case_039", "p03006_case_040", "p03006_case_041", "p03006_case_042", "p03006_case_043", "p03006_case_044", "p03006_case_045", "p03006_case_046", "p03006_case_047", "p03006_case_048", "p03006_case_049", "p03006_case_050", "p03006_case_051", "p03006_case_052", "p03006_case_053", "p03006_case_054", "p03006_case_055", "p03006_case_056", "p03006_case_057", "p03006_case_058", "p03006_case_059", "p03006_case_060", "p03006_case_061", "p03006_case_062", "p03006_case_063", "p03006_case_064", "p03006_case_065", "p03006_case_066", "p03006_case_067", "p03006_case_068", "p03006_case_069", "p03006_case_070", "p03006_case_071", "p03006_case_072", "p03006_case_073", "p03006_case_074", "p03006_case_075", "p03006_case_076", "p03006_case_077", "p03006_case_078", "p03006_case_079", "p03006_case_080", "p03006_case_081", "p03006_case_082", "p03006_case_083", "p03006_case_084", "p03006_case_085", "p03006_case_086", "p03006_case_087", "p03006_case_088", "p03006_case_089", "p03006_case_090", "p03006_case_091", "p03006_case_092", "p03006_case_093", "p03006_case_094", "p03006_case_095", "p03006_case_096", "p03006_case_097", "p03006_case_098", "p03006_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import itertools\n\nn = int(eval(input()))\nxy = []\nfor i in range(n):\n x, y = list(map(int, input().split()))\n xy.append([x, y])\na, b = [], []\nfor v in itertools.combinations(xy, 2):\n z = list(v)\n z.sort()\n x = z[1][0] - z[0][0]\n y = z[1][1] - z[0][1]\n a.append([x, y])\n if [x, y] in b:\n continue\n b.append([x, y])\nc = 0\nfor i in b:\n c = max(c, a.count(i))\nprint((n - c))\n", "fast_code_sha256": "8255152298f2af1d0c139a9953eddb5b41064a4c639271d3c0b3be7adef75af3", "fast_id": "p03006_8255152298f2af1d0c139a9953eddb5b41064a4c639271d3c0b3be7adef75af3", "fine_bin": 5, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import itertools\n\nn = int(eval(input()))\nxy = []\nfor i in range(n):\n x, y = list(map(int, input().split()))\n xy.append([x, y])\na, b = [], []\nfor v in itertools.combinations(xy, 2):\n z = list(v)\n z.sort()\n x = z[1][0] - z[0][0]\n y = z[1][1] - z[0][1]\n a.append([x, y])\n if [x, y] in b:\n continue\n b.append([x, y])\nc = 0\nfor i in b:\n c = max(c, a.count(i))\nprint((n - c))\n", "measured_fast_code_sha256": "8255152298f2af1d0c139a9953eddb5b41064a4c639271d3c0b3be7adef75af3", "measured_slow_code": "n = int(eval(input()))\narr = [list(map(int, input().split())) for _ in range(n)]\narr = sorted(arr, key=lambda x: x[1])\narr = sorted(arr, key=lambda x: x[0])\nans = n\nfor i in range(n):\n for j in range(i + 1, n):\n p, q = arr[j][0] - arr[i][0], arr[j][1] - arr[i][1]\n cnt = 0\n flag = [0] * n\n for k in range(n):\n if flag[k] == 1:\n continue\n flag[k] = 1\n a, b = arr[k][0], arr[k][1]\n while 1:\n for l in range(n):\n if flag[l] == 1:\n continue\n if a + p == arr[l][0] and b + q == arr[l][1]:\n flag[l] = 1\n a = arr[l][0]\n b = arr[l][1]\n break\n else:\n break\n cnt += 1\n ans = min(ans, cnt)\nprint(ans)\n", "measured_slow_code_sha256": "80bd8fe5a1d57ee25fca567eef9b37cd0fc4680570648f6b89f79bd2df57d3ee", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 7.387433891952357, "pair_id": "python_v2_ab9fe722fa5976ddd577f0a2", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03006", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03006_8255152298f2af1d0c139a9953eddb5b41064a4c639271d3c0b3be7adef75af3.jsonl.gz", "inputs": "reproduction/python/inputs/p03006.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03006_80bd8fe5a1d57ee25fca567eef9b37cd0fc4680570648f6b89f79bd2df57d3ee.jsonl.gz"}, "slow_code": "n = int(eval(input()))\narr = [list(map(int, input().split())) for _ in range(n)]\narr = sorted(arr, key=lambda x: x[1])\narr = sorted(arr, key=lambda x: x[0])\nans = n\nfor i in range(n):\n for j in range(i + 1, n):\n p, q = arr[j][0] - arr[i][0], arr[j][1] - arr[i][1]\n cnt = 0\n flag = [0] * n\n for k in range(n):\n if flag[k] == 1:\n continue\n flag[k] = 1\n a, b = arr[k][0], arr[k][1]\n while 1:\n for l in range(n):\n if flag[l] == 1:\n continue\n if a + p == arr[l][0] and b + q == arr[l][1]:\n flag[l] = 1\n a = arr[l][0]\n b = arr[l][1]\n break\n else:\n break\n cnt += 1\n ans = min(ans, cnt)\nprint(ans)\n", "slow_code_sha256": "80bd8fe5a1d57ee25fca567eef9b37cd0fc4680570648f6b89f79bd2df57d3ee", "slow_id": "p03006_80bd8fe5a1d57ee25fca567eef9b37cd0fc4680570648f6b89f79bd2df57d3ee", "speedup": 5.86117862031984, "stratum": "4-8", "within_pair_jaccard": 0.38, "workload": {"case_count": 100, "description": "Collect N distinct plane points in any order, choosing one fixed nonzero integer displacement (p,q). A collection costs 0 if its point equals the previously collected point plus (p,q), otherwise 1, including the first. Minimize total cost. Observed inputs: N=1..50 (median 20); x_i=-999595444..998135854; y_i=-998893103..992792936.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1075, "median": 402.5, "min": 23}, "input_format": ["N\nx_1 y_1\n...\nx_N y_N"], "input_format_status": "source_input_section", "input_lines": {"max": 51, "median": 21.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 101, "median": 41.0, "min": 3}}} -{"case_ids": ["p03737_case_000", "p03737_case_001", "p03737_case_002", "p03737_case_003", "p03737_case_004", "p03737_case_005", "p03737_case_006", "p03737_case_007", "p03737_case_008", "p03737_case_009", "p03737_case_010", "p03737_case_011", "p03737_case_012", "p03737_case_013", "p03737_case_014", "p03737_case_015", "p03737_case_016", "p03737_case_017", "p03737_case_018", "p03737_case_019", "p03737_case_020", "p03737_case_021", "p03737_case_022", "p03737_case_023", "p03737_case_024", "p03737_case_025", "p03737_case_026", "p03737_case_027", "p03737_case_028", "p03737_case_029", "p03737_case_030", "p03737_case_031", "p03737_case_032", "p03737_case_033", "p03737_case_034", "p03737_case_035", "p03737_case_036", "p03737_case_037", "p03737_case_038", "p03737_case_039", "p03737_case_040", "p03737_case_041", "p03737_case_042", "p03737_case_043", "p03737_case_044", "p03737_case_045", "p03737_case_046", "p03737_case_047", "p03737_case_048", "p03737_case_049", "p03737_case_050", "p03737_case_051", "p03737_case_052", "p03737_case_053", "p03737_case_054", "p03737_case_055", "p03737_case_056", "p03737_case_057", "p03737_case_058", "p03737_case_059", "p03737_case_060", "p03737_case_061", "p03737_case_062", "p03737_case_063", "p03737_case_064", "p03737_case_065", "p03737_case_066", "p03737_case_067", "p03737_case_068", "p03737_case_069", "p03737_case_070", "p03737_case_071", "p03737_case_072", "p03737_case_073", "p03737_case_074", "p03737_case_075", "p03737_case_076", "p03737_case_077", "p03737_case_078", "p03737_case_079", "p03737_case_080", "p03737_case_081", "p03737_case_082", "p03737_case_083", "p03737_case_084", "p03737_case_085", "p03737_case_086", "p03737_case_087", "p03737_case_088", "p03737_case_089", "p03737_case_090", "p03737_case_091", "p03737_case_092", "p03737_case_093", "p03737_case_094", "p03737_case_095", "p03737_case_096", "p03737_case_097", "p03737_case_098", "p03737_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "def generate_acronym(l1: list) -> str:\n answer = \"\"\n for word in l1:\n\n answer += word[0].upper()\n return answer\n\n\nlists = list(map(str, input().split()))\nprint((generate_acronym(lists)))\n", "fast_code_sha256": "6326b7c3339323630b0538ff8f4fab80e04370ee9d232e29cb5f8496bef98f44", "fast_id": "p03737_692117a18a72b75a697df974f895fee5b723b707c01de769bc8fc16aec3f8110", "fine_bin": 6, "identifiers_renamed": false, "language": "python", "measured_fast_code": "def generate_acronym(l1: list) -> str:\n answer = \"\"\n for word in l1:\n # answer.append(word[0].upper())\n answer += word[0].upper()\n return answer\n\n\nlists = list(map(str, input().split()))\nprint((generate_acronym(lists)))\n", "measured_fast_code_sha256": "692117a18a72b75a697df974f895fee5b723b707c01de769bc8fc16aec3f8110", "measured_slow_code": "import numpy as np\nimport math\n\ns = \" \" + input()\nfor i in range(len(s)):\n if s[i] == \" \":\n print(chr(ord(s[i + 1]) - 32), end=\"\")\nprint()\n", "measured_slow_code_sha256": "c5a6a790bfe3c359c7ab2698d0f376a617bb650fa938bf64d595d41523985f6d", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1314.409648713763, "pair_id": "python_v2_843174440aa7e3699ab1c2cc", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03737", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03737_692117a18a72b75a697df974f895fee5b723b707c01de769bc8fc16aec3f8110.jsonl.gz", "inputs": "reproduction/python/inputs/p03737.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03737_c5a6a790bfe3c359c7ab2698d0f376a617bb650fa938bf64d595d41523985f6d.jsonl.gz"}, "slow_code": "import numpy as np\nimport math\n\ns = \" \" + input()\nfor i in range(len(s)):\n if s[i] == \" \":\n print(chr(ord(s[i + 1]) - 32), end=\"\")\nprint()\n", "slow_code_sha256": "c5a6a790bfe3c359c7ab2698d0f376a617bb650fa938bf64d595d41523985f6d", "slow_id": "p03737_c5a6a790bfe3c359c7ab2698d0f376a617bb650fa938bf64d595d41523985f6d", "speedup": 1313.1575741754473, "stratum": "8+", "within_pair_jaccard": 0.125, "workload": {"case_count": 100, "description": "Form an acronym from the uppercase first letters of three supplied lowercase words, in their given order. Observed inputs: word_length=1..10.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 33, "median": 18.0, "min": 6}, "input_format": ["s_1 s_2 s_3"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 3, "median": 3.0, "min": 3}}} -{"case_ids": ["p03599_case_000", "p03599_case_001", "p03599_case_002", "p03599_case_003", "p03599_case_004", "p03599_case_005", "p03599_case_006", "p03599_case_007", "p03599_case_008", "p03599_case_009", "p03599_case_010", "p03599_case_011", "p03599_case_012", "p03599_case_013", "p03599_case_014", "p03599_case_015", "p03599_case_016", "p03599_case_017", "p03599_case_018", "p03599_case_019", "p03599_case_020", "p03599_case_021", "p03599_case_022", "p03599_case_023", "p03599_case_024", "p03599_case_025", "p03599_case_026", "p03599_case_027", "p03599_case_028", "p03599_case_029", "p03599_case_030", "p03599_case_031", "p03599_case_032", "p03599_case_033", "p03599_case_034", "p03599_case_035", "p03599_case_036", "p03599_case_037", "p03599_case_038", "p03599_case_039", "p03599_case_040", "p03599_case_041", "p03599_case_042", "p03599_case_043", "p03599_case_044", "p03599_case_045", "p03599_case_046", "p03599_case_047", "p03599_case_048", "p03599_case_049", "p03599_case_050", "p03599_case_051", "p03599_case_052", "p03599_case_053", "p03599_case_054", "p03599_case_055", "p03599_case_056", "p03599_case_057", "p03599_case_058", "p03599_case_059", "p03599_case_060", "p03599_case_061", "p03599_case_062", "p03599_case_063", "p03599_case_064", "p03599_case_065", "p03599_case_066", "p03599_case_067", "p03599_case_068", "p03599_case_069", "p03599_case_070", "p03599_case_071", "p03599_case_072", "p03599_case_073", "p03599_case_074", "p03599_case_075", "p03599_case_076", "p03599_case_077", "p03599_case_078", "p03599_case_079", "p03599_case_080", "p03599_case_081", "p03599_case_082", "p03599_case_083", "p03599_case_084", "p03599_case_085", "p03599_case_086", "p03599_case_087", "p03599_case_088", "p03599_case_089", "p03599_case_090", "p03599_case_091", "p03599_case_092", "p03599_case_093", "p03599_case_094", "p03599_case_095", "p03599_case_096", "p03599_case_097", "p03599_case_098", "p03599_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "A, B, C, D, E, F = list(map(int, input().split()))\namax = F // (100 * A)\nbmax = F // (100 * B)\nconcmx = 0\nwholemx = 0\nsugarmx = 0\nfor a in range(amax, -1, -1):\n for b in range(bmax, -1, -1):\n cmax = (F - 100 * A * a - 100 * B * b) // C\n dmax = (F - 100 * A * a - 100 * B * b) // D\n for c in range(cmax, -1, -1):\n for d in range(dmax, -1, -1):\n sugar = C * c + D * d\n whole = 100 * A * a + 100 * B * b + sugar\n if whole == 0:\n break\n elif sugar / whole <= E / (100 + E) and whole <= F:\n if sugar / whole >= concmx:\n concmx = sugar / whole\n sugarmx = sugar\n wholemx = whole\nprint((str(wholemx) + \" \" + str(sugarmx)))\n", "fast_code_sha256": "2d3636092013d0ccdf74101e3c253423597051429154e6bf9b9524f3dc969a7a", "fast_id": "p03599_2d3636092013d0ccdf74101e3c253423597051429154e6bf9b9524f3dc969a7a", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "A, B, C, D, E, F = list(map(int, input().split()))\namax = F // (100 * A)\nbmax = F // (100 * B)\nconcmx = 0\nwholemx = 0\nsugarmx = 0\nfor a in range(amax, -1, -1):\n for b in range(bmax, -1, -1):\n cmax = (F - 100 * A * a - 100 * B * b) // C\n dmax = (F - 100 * A * a - 100 * B * b) // D\n for c in range(cmax, -1, -1):\n for d in range(dmax, -1, -1):\n sugar = C * c + D * d\n whole = 100 * A * a + 100 * B * b + sugar\n if whole == 0:\n break\n elif sugar / whole <= E / (100 + E) and whole <= F:\n if sugar / whole >= concmx:\n concmx = sugar / whole\n sugarmx = sugar\n wholemx = whole\nprint((str(wholemx) + \" \" + str(sugarmx)))\n", "measured_fast_code_sha256": "2d3636092013d0ccdf74101e3c253423597051429154e6bf9b9524f3dc969a7a", "measured_slow_code": "import math\nimport bisect\n\nA, B, C, D, E, F = list(map(int, input().split()))\nx = [A * a + B * b for b in range(31) for a in range(31)]\ny = [C * c + D * d for d in range(1501) for c in range(1501)]\nx.remove(0)\nx = list(set(x))\ny = list(set(y))\nx.sort()\ny.sort()\nx = x[: bisect.bisect_right(x, F // 100 + 1)]\ny = y[: bisect.bisect_left(y, F)]\nwater = A\nsuger = 0\nfor i in x:\n for j in y:\n if j <= i * E and i * 100 + j <= F:\n if j / (i * 100 + j) > suger / (water * 100 + suger):\n water = i\n suger = j\nprint((\"{} {}\".format(water * 100 + suger, suger)))\n", "measured_slow_code_sha256": "f6827545f2a7e02be9d072e224e499c3895b63a4819098a0f50fa7a964b98bc6", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 26.708997119465256, "pair_id": "python_v2_74bc503c3884696b635d3d19", "per_case_slow_code_faster_fraction": 0.03, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03599", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03599_2d3636092013d0ccdf74101e3c253423597051429154e6bf9b9524f3dc969a7a.jsonl.gz", "inputs": "reproduction/python/inputs/p03599.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03599_f6827545f2a7e02be9d072e224e499c3895b63a4819098a0f50fa7a964b98bc6.jsonl.gz"}, "slow_code": "import math\nimport bisect\n\nA, B, C, D, E, F = list(map(int, input().split()))\nx = [A * a + B * b for b in range(31) for a in range(31)]\ny = [C * c + D * d for d in range(1501) for c in range(1501)]\nx.remove(0)\nx = list(set(x))\ny = list(set(y))\nx.sort()\ny.sort()\nx = x[: bisect.bisect_right(x, F // 100 + 1)]\ny = y[: bisect.bisect_left(y, F)]\nwater = A\nsuger = 0\nfor i in x:\n for j in y:\n if j <= i * E and i * 100 + j <= F:\n if j / (i * 100 + j) > suger / (water * 100 + suger):\n water = i\n suger = j\nprint((\"{} {}\".format(water * 100 + suger, suger)))\n", "slow_code_sha256": "f6827545f2a7e02be9d072e224e499c3895b63a4819098a0f50fa7a964b98bc6", "slow_id": "p03599_f6827545f2a7e02be9d072e224e499c3895b63a4819098a0f50fa7a964b98bc6", "speedup": 22.99466150773006, "stratum": "8+", "within_pair_jaccard": 0.4339622641509434, "workload": {"case_count": 100, "description": "Into an empty beaker, add water in portions 100A or 100B and sugar in portions C or D, any number of times. Capacity is F total grams and at most E grams sugar dissolves per 100 grams water. Maximize sugar mass fraction without undissolved sugar; output total and sugar masses. Observed inputs: A=1..29; B=2..30; C=1..29; D=2..30; E=1..100; F=100..3000 (median 2455).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 21, "median": 19.0, "min": 14}, "input_format": ["A B C D E F"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 6, "median": 6.0, "min": 6}}} -{"case_ids": ["p00053_case_000", "p00053_case_001", "p00053_case_002", "p00053_case_003", "p00053_case_004", "p00053_case_005", "p00053_case_006", "p00053_case_007", "p00053_case_008", "p00053_case_009", "p00053_case_010", "p00053_case_011", "p00053_case_012", "p00053_case_013", "p00053_case_014", "p00053_case_015", "p00053_case_016", "p00053_case_017", "p00053_case_018", "p00053_case_019", "p00053_case_020", "p00053_case_021", "p00053_case_022", "p00053_case_023", "p00053_case_024", "p00053_case_025", "p00053_case_026", "p00053_case_027", "p00053_case_028", "p00053_case_029", "p00053_case_030", "p00053_case_031", "p00053_case_032", "p00053_case_033", "p00053_case_034", "p00053_case_035", "p00053_case_036", "p00053_case_037", "p00053_case_038", "p00053_case_039", "p00053_case_040", "p00053_case_041", "p00053_case_042", "p00053_case_043", "p00053_case_044", "p00053_case_045", "p00053_case_046", "p00053_case_047", "p00053_case_048", "p00053_case_049", "p00053_case_050", "p00053_case_051", "p00053_case_052", "p00053_case_053", "p00053_case_054", "p00053_case_055", "p00053_case_056", "p00053_case_057", "p00053_case_058", "p00053_case_059", "p00053_case_060", "p00053_case_061", "p00053_case_062", "p00053_case_063", "p00053_case_064", "p00053_case_065", "p00053_case_066", "p00053_case_067", "p00053_case_068", "p00053_case_069", "p00053_case_070", "p00053_case_071", "p00053_case_072", "p00053_case_073", "p00053_case_074", "p00053_case_075", "p00053_case_076", "p00053_case_077", "p00053_case_078", "p00053_case_079", "p00053_case_080", "p00053_case_081", "p00053_case_082", "p00053_case_083", "p00053_case_084", "p00053_case_085", "p00053_case_086", "p00053_case_087", "p00053_case_088", "p00053_case_089", "p00053_case_090", "p00053_case_091", "p00053_case_092", "p00053_case_093", "p00053_case_094", "p00053_case_095", "p00053_case_096", "p00053_case_097", "p00053_case_098", "p00053_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import math\n\nr = 105000\nsqrt = int(math.sqrt(r))\np = [1] * r\np[0] = 0\nfor i in range(1, sqrt):\n if p[i]:\n for j in range(2 * i + 1, r, i + 1):\n p[j] = 0\nprime = [0 for i in range(11000)]\nj = 0\nfor i in range(len(p)):\n if p[i]:\n prime[j] = i + 1\n j += 1\nwhile True:\n n = int(input())\n if not n:\n break\n print(sum(prime[:n]))\n", "fast_code_sha256": "0784c5ee3450e49b36420a34af5664a1f2ed0a6ee4b30bf0643486b763a832c4", "fast_id": "p00053_0784c5ee3450e49b36420a34af5664a1f2ed0a6ee4b30bf0643486b763a832c4", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "import math\n\nr = 105000\nsqrt = int(math.sqrt(r))\np = [1] * r\np[0] = 0\nfor i in range(1, sqrt):\n if p[i]:\n for j in range(2 * i + 1, r, i + 1):\n p[j] = 0\nprime = [0 for i in range(11000)]\nj = 0\nfor i in range(len(p)):\n if p[i]:\n prime[j] = i + 1\n j += 1\nwhile True:\n n = int(input())\n if not n:\n break\n print(sum(prime[:n]))\n", "measured_fast_code_sha256": "0784c5ee3450e49b36420a34af5664a1f2ed0a6ee4b30bf0643486b763a832c4", "measured_slow_code": "import math\n\nr = 105000\nsqrt = int(math.sqrt(r))\np = [1] * r\np[0] = 0\nfor i in range(1, sqrt):\n if p[i]:\n for j in range(2 * i + 1, r, i + 1):\n p[j] = 0\nwhile True:\n n = int(input())\n if not n:\n break\n i, num, sum = 0, 0, 0\n while num < n:\n if p[i] == 1:\n num += 1\n sum += i + 1\n i += 1\n print(sum)\n", "measured_slow_code_sha256": "8cca1698214485b76a9b0e12f8e91dd9d3daa2c366ec968e4e5180fe1f6d3e7b", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 5.3194093462383885, "pair_id": "python_v2_77ee1b1609f9d2689794b976", "per_case_slow_code_faster_fraction": 0.18, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p00053", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p00053_0784c5ee3450e49b36420a34af5664a1f2ed0a6ee4b30bf0643486b763a832c4.jsonl.gz", "inputs": "reproduction/python/inputs/p00053.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p00053_8cca1698214485b76a9b0e12f8e91dd9d3daa2c366ec968e4e5180fe1f6d3e7b.jsonl.gz"}, "slow_code": "import math\n\nr = 105000\nsqrt = int(math.sqrt(r))\np = [1] * r\np[0] = 0\nfor i in range(1, sqrt):\n if p[i]:\n for j in range(2 * i + 1, r, i + 1):\n p[j] = 0\nwhile True:\n n = int(input())\n if not n:\n break\n i, num, sum = 0, 0, 0\n while num < n:\n if p[i] == 1:\n num += 1\n sum += i + 1\n i += 1\n print(sum)\n", "slow_code_sha256": "8cca1698214485b76a9b0e12f8e91dd9d3daa2c366ec968e4e5180fe1f6d3e7b", "slow_id": "p00053_8cca1698214485b76a9b0e12f8e91dd9d3daa2c366ec968e4e5180fe1f6d3e7b", "speedup": 4.637180953256949, "stratum": "4-8", "within_pair_jaccard": 0.8571428571428571, "workload": {"case_count": 100, "description": "For each n, compute the sum of the first n primes. Each line supplies one n; the final zero terminates input and is not a query. Observed inputs: datasets=1..50 (median 25); n=1..10000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 302, "median": 120.0, "min": 4}, "input_format": ["n_1\n...\nn_D\n0"], "input_format_status": "source_input_section", "input_lines": {"max": 51, "median": 26.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 51, "median": 26.0, "min": 2}}} -{"case_ids": ["p02989_case_000", "p02989_case_001", "p02989_case_002", "p02989_case_003", "p02989_case_004", "p02989_case_005", "p02989_case_006", "p02989_case_007", "p02989_case_008", "p02989_case_009", "p02989_case_010", "p02989_case_011", "p02989_case_012", "p02989_case_013", "p02989_case_014", "p02989_case_015", "p02989_case_016", "p02989_case_017", "p02989_case_018", "p02989_case_019", "p02989_case_020", "p02989_case_021", "p02989_case_022", "p02989_case_023", "p02989_case_024", "p02989_case_025", "p02989_case_026", "p02989_case_027", "p02989_case_028", "p02989_case_029", "p02989_case_030", "p02989_case_031", "p02989_case_032", "p02989_case_033", "p02989_case_034", "p02989_case_035", "p02989_case_036", "p02989_case_037", "p02989_case_038", "p02989_case_039", "p02989_case_040", "p02989_case_041", "p02989_case_042", "p02989_case_043", "p02989_case_044", "p02989_case_045", "p02989_case_046", "p02989_case_047", "p02989_case_048", "p02989_case_049", "p02989_case_050", "p02989_case_051", "p02989_case_052", "p02989_case_053", "p02989_case_054", "p02989_case_055", "p02989_case_056", "p02989_case_057", "p02989_case_058", "p02989_case_059", "p02989_case_060", "p02989_case_061", "p02989_case_062", "p02989_case_063", "p02989_case_064", "p02989_case_065", "p02989_case_066", "p02989_case_067", "p02989_case_068", "p02989_case_069", "p02989_case_070", "p02989_case_071", "p02989_case_072", "p02989_case_073", "p02989_case_074", "p02989_case_075", "p02989_case_076", "p02989_case_077", "p02989_case_078", "p02989_case_079", "p02989_case_080", "p02989_case_081", "p02989_case_082", "p02989_case_083", "p02989_case_084", "p02989_case_085", "p02989_case_086", "p02989_case_087", "p02989_case_088", "p02989_case_089", "p02989_case_090", "p02989_case_091", "p02989_case_092", "p02989_case_093", "p02989_case_094", "p02989_case_095", "p02989_case_096", "p02989_case_097", "p02989_case_098", "p02989_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from bisect import bisect_left\n\nN = int(eval(input()))\nd = list(map(int, input().split()))\nd.sort()\nto_take = N // 2\ncnt = 0\nfor x in range(d[0], d[-1] + 1):\n idx = bisect_left(d, x)\n\n if idx == to_take:\n cnt += 1\nprint(cnt)\n", "fast_code_sha256": "3201853fc23fca3c0ef8a612c9c8c3c65d41a44d108928dd70d7afa5b139702f", "fast_id": "p02989_ea89f11dc11b95f6b4d47d4294c595dbbd77b5de19015b0460eeb188891e0b0b", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from bisect import bisect_left\n\nN = int(eval(input()))\nd = list(map(int, input().split()))\nd.sort()\nto_take = N // 2\ncnt = 0\nfor x in range(d[0], d[-1] + 1):\n idx = bisect_left(d, x)\n # ABC用の問題数\n if idx == to_take:\n cnt += 1\nprint(cnt)\n", "measured_fast_code_sha256": "ea89f11dc11b95f6b4d47d4294c595dbbd77b5de19015b0460eeb188891e0b0b", "measured_slow_code": "from bisect import bisect_left\n\nn = int(eval(input()))\nd = list(map(int, input().split()))\nd = sorted(d)\nans = 0\nfor i in range(1, 10**5 + 1):\n p = bisect_left(d, i)\n ans += 1 if p == (n - p) else 0\nprint(ans)\n", "measured_slow_code_sha256": "bee7326f5d65117847c8daffc9f8e9e9508be71f70ad2064bdf47643f0632c7e", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.6250654066555847, "pair_id": "python_v2_6c8e5e59ae56f17e85bdcbd6", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02989", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02989_ea89f11dc11b95f6b4d47d4294c595dbbd77b5de19015b0460eeb188891e0b0b.jsonl.gz", "inputs": "reproduction/python/inputs/p02989.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02989_bee7326f5d65117847c8daffc9f8e9e9508be71f70ad2064bdf47643f0632c7e.jsonl.gz"}, "slow_code": "from bisect import bisect_left\n\nn = int(eval(input()))\nd = list(map(int, input().split()))\nd = sorted(d)\nans = 0\nfor i in range(1, 10**5 + 1):\n p = bisect_left(d, i)\n ans += 1 if p == (n - p) else 0\nprint(ans)\n", "slow_code_sha256": "bee7326f5d65117847c8daffc9f8e9e9508be71f70ad2064bdf47643f0632c7e", "slow_id": "p02989_bee7326f5d65117847c8daffc9f8e9e9508be71f70ad2064bdf47643f0632c7e", "speedup": 7.1809535389374455, "stratum": "4-8", "within_pair_jaccard": 0.5625, "workload": {"case_count": 100, "description": "For an even number N of difficulties d_i, count integer thresholds K splitting the entries equally into values below K and values at least K. Observed inputs: N=2..100000 (median 100); d_i=1..100000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 600025, "median": 596.0, "min": 6}, "input_format": ["N\nd_1 ... d_N"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 100001, "median": 101.0, "min": 3}}} -{"case_ids": ["p03331_case_000", "p03331_case_001", "p03331_case_002", "p03331_case_003", "p03331_case_004", "p03331_case_005", "p03331_case_006", "p03331_case_007", "p03331_case_008", "p03331_case_009", "p03331_case_010", "p03331_case_011", "p03331_case_012", "p03331_case_013", "p03331_case_014", "p03331_case_015", "p03331_case_016", "p03331_case_017", "p03331_case_018", "p03331_case_019", "p03331_case_020", "p03331_case_021", "p03331_case_022", "p03331_case_023", "p03331_case_024", "p03331_case_025", "p03331_case_026", "p03331_case_027", "p03331_case_028", "p03331_case_029", "p03331_case_030", "p03331_case_031", "p03331_case_032", "p03331_case_033", "p03331_case_034", "p03331_case_035", "p03331_case_036", "p03331_case_037", "p03331_case_038", "p03331_case_039", "p03331_case_040", "p03331_case_041", "p03331_case_042", "p03331_case_043", "p03331_case_044", "p03331_case_045", "p03331_case_046", "p03331_case_047", "p03331_case_048", "p03331_case_049", "p03331_case_050", "p03331_case_051", "p03331_case_052", "p03331_case_053", "p03331_case_054", "p03331_case_055", "p03331_case_056", "p03331_case_057", "p03331_case_058", "p03331_case_059", "p03331_case_060", "p03331_case_061", "p03331_case_062", "p03331_case_063", "p03331_case_064", "p03331_case_065", "p03331_case_066", "p03331_case_067", "p03331_case_068", "p03331_case_069", "p03331_case_070", "p03331_case_071", "p03331_case_072", "p03331_case_073", "p03331_case_074", "p03331_case_075", "p03331_case_076", "p03331_case_077", "p03331_case_078", "p03331_case_079", "p03331_case_080", "p03331_case_081", "p03331_case_082", "p03331_case_083", "p03331_case_084", "p03331_case_085", "p03331_case_086", "p03331_case_087", "p03331_case_088", "p03331_case_089", "p03331_case_090", "p03331_case_091", "p03331_case_092", "p03331_case_093", "p03331_case_094", "p03331_case_095", "p03331_case_096", "p03331_case_097", "p03331_case_098", "p03331_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "import math\n\nn = int(eval(input()))\nm = math.log10(n)\nif int(m) == m:\n print((10))\n exit()\nans = sum(map(int, list(str(n))))\nprint(ans)\n", "fast_code_sha256": "284a8c35e2eafc9aefdfd8aea3724dceaddb6694fb0e85ae17f2e4abdc89ffd1", "fast_id": "p03331_8c8462ab78a9cd9c5b23cab4ea1172c4e2ca8e2ac0f69de77b0da618078d98d4", "fine_bin": 8, "identifiers_renamed": false, "language": "python", "measured_fast_code": "#!/usr/bin/env python\nimport math\n\nn = int(eval(input()))\nm = math.log10(n)\nif int(m) == m:\n print((10))\n exit()\nans = sum(map(int, list(str(n))))\nprint(ans)\n", "measured_fast_code_sha256": "8c8462ab78a9cd9c5b23cab4ea1172c4e2ca8e2ac0f69de77b0da618078d98d4", "measured_slow_code": "N = int(eval(input()))\nimport numpy as np\n\na = np.arange(N)\na = np.delete(a, 0)\nb = N - a\nnum_arr = []\nfor i in range(len(a)):\n factor_a = [int(x) for x in list(str(a[i]))]\n factor_b = [int(x) for x in list(str(b[i]))]\n num_arr.append(sum(factor_a) + sum(factor_b))\nprint((min(num_arr)))\n", "measured_slow_code_sha256": "153ddd3939958df9731f2cb6a9569dfdd13dde4cae47410105d9d1d355dcbd24", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 6373.584237059321, "pair_id": "python_v2_b4c4519aa13e0a33928f7e5d", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03331", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03331_8c8462ab78a9cd9c5b23cab4ea1172c4e2ca8e2ac0f69de77b0da618078d98d4.jsonl.gz", "inputs": "reproduction/python/inputs/p03331.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03331_153ddd3939958df9731f2cb6a9569dfdd13dde4cae47410105d9d1d355dcbd24.jsonl.gz"}, "slow_code": "N = int(eval(input()))\nimport numpy as np\n\na = np.arange(N)\na = np.delete(a, 0)\nb = N - a\nnum_arr = []\nfor i in range(len(a)):\n factor_a = [int(x) for x in list(str(a[i]))]\n factor_b = [int(x) for x in list(str(b[i]))]\n num_arr.append(sum(factor_a) + sum(factor_b))\nprint((min(num_arr)))\n", "slow_code_sha256": "153ddd3939958df9731f2cb6a9569dfdd13dde4cae47410105d9d1d355dcbd24", "slow_id": "p03331_153ddd3939958df9731f2cb6a9569dfdd13dde4cae47410105d9d1d355dcbd24", "speedup": 4743.489018950577, "stratum": "8+", "within_pair_jaccard": 0.21621621621621623, "workload": {"case_count": 100, "description": "Split N into two positive integers A+B=N, minimizing the sum of their decimal digit sums. Observed inputs: N=2..100000 (median 58160.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 7, "median": 6.0, "min": 2}, "input_format": ["N"], "input_format_status": "source_input_section", "input_lines": {"max": 1, "median": 1.0, "min": 1}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 1, "median": 1.0, "min": 1}}} -{"case_ids": ["p03330_case_000", "p03330_case_001", "p03330_case_002", "p03330_case_003", "p03330_case_004", "p03330_case_005", "p03330_case_006", "p03330_case_007", "p03330_case_008", "p03330_case_009", "p03330_case_010", "p03330_case_011", "p03330_case_012", "p03330_case_013", "p03330_case_014", "p03330_case_015", "p03330_case_016", "p03330_case_017", "p03330_case_018", "p03330_case_019", "p03330_case_020", "p03330_case_021", "p03330_case_022", "p03330_case_023", "p03330_case_024", "p03330_case_025", "p03330_case_026", "p03330_case_027", "p03330_case_028", "p03330_case_029", "p03330_case_030", "p03330_case_031", "p03330_case_032", "p03330_case_033", "p03330_case_034", "p03330_case_035", "p03330_case_036", "p03330_case_037", "p03330_case_038", "p03330_case_039", "p03330_case_040", "p03330_case_041", "p03330_case_042", "p03330_case_043", "p03330_case_044", "p03330_case_045", "p03330_case_046", "p03330_case_047", "p03330_case_048", "p03330_case_049", "p03330_case_050", "p03330_case_051", "p03330_case_052", "p03330_case_053", "p03330_case_054", "p03330_case_055", "p03330_case_056", "p03330_case_057", "p03330_case_058", "p03330_case_059", "p03330_case_060", "p03330_case_061", "p03330_case_062", "p03330_case_063", "p03330_case_064", "p03330_case_065", "p03330_case_066", "p03330_case_067", "p03330_case_068", "p03330_case_069", "p03330_case_070", "p03330_case_071", "p03330_case_072", "p03330_case_073", "p03330_case_074", "p03330_case_075", "p03330_case_076", "p03330_case_077", "p03330_case_078", "p03330_case_079", "p03330_case_080", "p03330_case_081", "p03330_case_082", "p03330_case_083", "p03330_case_084", "p03330_case_085", "p03330_case_086", "p03330_case_087", "p03330_case_088", "p03330_case_089", "p03330_case_090", "p03330_case_091", "p03330_case_092", "p03330_case_093", "p03330_case_094", "p03330_case_095", "p03330_case_096", "p03330_case_097", "p03330_case_098", "p03330_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from collections import Counter, defaultdict, deque\nimport sys, heapq, bisect, math, itertools, string, queue\n\nsys.setrecursionlimit(10**8)\nmod = 10**9 + 7\n\n\ndef inp():\n return int(sys.stdin.readline())\n\n\ndef inpl():\n return list(map(int, sys.stdin.readline().split()))\n\n\ndef inpl_str():\n return list(sys.stdin.readline().split())\n\n\ndef inpln(n):\n return list(int(sys.stdin.readline()) for i in range(n))\n\n\nn, C = inpl()\nd = []\nc = []\nfor i in range(C):\n d.append(inpl())\nfor i in range(n):\n c.append(inpl())\nd0 = defaultdict(int)\nd1 = defaultdict(int)\nd2 = defaultdict(int)\ndd = [d0, d1, d2]\nfor y in range(n):\n for x in range(n):\n t = (x + y + 2) % 3\n dd[t][c[x][y]] += 1\n\nres = [[] for i in range(3)]\nfor i in range(C):\n for j in range(3):\n tmp = 0\n for key in list(dd[j].keys()):\n tmp += d[key - 1][i] * dd[j][key]\n res[j].append([i, tmp])\nfor i in range(3):\n res[i].sort(key=lambda x: x[1])\n\nans = mod\nfor i in range(3):\n for j in range(3):\n for k in range(3):\n if (\n res[0][i][0] == res[1][j][0]\n or res[0][i][0] == res[2][k][0]\n or res[2][k][0] == res[1][j][0]\n ):\n continue\n ans = min(res[0][i][1] + res[1][j][1] + res[2][k][1], ans)\nprint(ans)\n", "fast_code_sha256": "75037892fbe0d3f8ec2f6cad07c769abb92a7779fb94ebaf53c5f1ef1cf5a970", "fast_id": "p03330_2bf84a04b2c862b8fc6cada5361225248d707fa385c9679c1031ce69470c3f9c", "fine_bin": 7, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from collections import Counter, defaultdict, deque\nimport sys, heapq, bisect, math, itertools, string, queue\n\nsys.setrecursionlimit(10**8)\nmod = 10**9 + 7\n\n\ndef inp():\n return int(sys.stdin.readline())\n\n\ndef inpl():\n return list(map(int, sys.stdin.readline().split()))\n\n\ndef inpl_str():\n return list(sys.stdin.readline().split())\n\n\ndef inpln(n):\n return list(int(sys.stdin.readline()) for i in range(n))\n\n\nn, C = inpl()\nd = []\nc = []\nfor i in range(C):\n d.append(inpl())\nfor i in range(n):\n c.append(inpl())\nd0 = defaultdict(int)\nd1 = defaultdict(int)\nd2 = defaultdict(int)\ndd = [d0, d1, d2]\nfor y in range(n):\n for x in range(n):\n t = (x + y + 2) % 3\n dd[t][c[x][y]] += 1\n# print(dd)\nres = [[] for i in range(3)]\nfor i in range(C):\n for j in range(3):\n tmp = 0\n for key in list(dd[j].keys()):\n tmp += d[key - 1][i] * dd[j][key]\n res[j].append([i, tmp])\nfor i in range(3):\n res[i].sort(key=lambda x: x[1])\n# print(res)\nans = mod\nfor i in range(3):\n for j in range(3):\n for k in range(3):\n if (\n res[0][i][0] == res[1][j][0]\n or res[0][i][0] == res[2][k][0]\n or res[2][k][0] == res[1][j][0]\n ):\n continue\n ans = min(res[0][i][1] + res[1][j][1] + res[2][k][1], ans)\nprint(ans)\n", "measured_fast_code_sha256": "2bf84a04b2c862b8fc6cada5361225248d707fa385c9679c1031ce69470c3f9c", "measured_slow_code": "from collections import defaultdict\n\nN, C = list(map(int, input().split()))\nD = [tuple(map(int, input().split())) for _ in range(C)]\nd = [defaultdict(int) for i in range(3)]\nfor i in range(N):\n c = [int(x) for x in input().split()]\n for j in range(N):\n for k in range(C):\n d[(i + j) % 3][k] += D[c[j] - 1][k]\n# print(d)\nans = 10**9\nfor i in range(C):\n for j in range(C):\n for k in range(C):\n if i != j and j != k and k != i:\n ans = min(ans, d[0][i] + d[1][j] + d[2][k])\nprint(ans)\n", "measured_slow_code_sha256": "c02a11b7b5b1b315914b965fdf3ecfb4358b57b2c3925ddf481c4eb6e9760d11", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 18.245017737316317, "pair_id": "python_v2_ccffa5936a40ba4e8ba0d0ba", "per_case_slow_code_faster_fraction": 0.09, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03330", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03330_2bf84a04b2c862b8fc6cada5361225248d707fa385c9679c1031ce69470c3f9c.jsonl.gz", "inputs": "reproduction/python/inputs/p03330.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03330_c02a11b7b5b1b315914b965fdf3ecfb4358b57b2c3925ddf481c4eb6e9760d11.jsonl.gz"}, "slow_code": "from collections import defaultdict\n\nN, C = list(map(int, input().split()))\nD = [tuple(map(int, input().split())) for _ in range(C)]\nd = [defaultdict(int) for i in range(3)]\nfor i in range(N):\n c = [int(x) for x in input().split()]\n for j in range(N):\n for k in range(C):\n d[(i + j) % 3][k] += D[c[j] - 1][k]\n\nans = 10**9\nfor i in range(C):\n for j in range(C):\n for k in range(C):\n if i != j and j != k and k != i:\n ans = min(ans, d[0][i] + d[1][j] + d[2][k])\nprint(ans)\n", "slow_code_sha256": "b26d76a0f9b29fa38bb4e81f3bd1f83b96fba757a97a758a390f98fa3fc78913", "slow_id": "p03330_c02a11b7b5b1b315914b965fdf3ecfb4358b57b2c3925ddf481c4eb6e9760d11", "speedup": 6.9334129564763405, "stratum": "4-8", "within_pair_jaccard": 0.39436619718309857, "workload": {"case_count": 100, "description": "Repaint an N-by-N grid using C colors with cost D_X,Y for changing X to Y. All cells sharing (row+column) mod 3 must finish with one common color, and the three residue classes must use distinct colors. Minimize total cost. Observed inputs: N=1..500 (median 500); C=3..30 (median 30); grid_cells=1..250000; D_i_j=0..1000; color=1..30.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 753462, "median": 500951.5, "min": 24}, "input_format": ["N C\nD_1,1 ... D_1,C\n...\nD_C,1 ... D_C,C\nc_1,1 ... c_1,N\n...\nc_N,1 ... c_N,N"], "input_format_status": "source_input_section", "input_lines": {"max": 531, "median": 518.5, "min": 5}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 250902, "median": 250464.5, "min": 12}}} -{"case_ids": ["p02703_case_000", "p02703_case_001", "p02703_case_002", "p02703_case_003", "p02703_case_004", "p02703_case_005", "p02703_case_006", "p02703_case_007", "p02703_case_008", "p02703_case_009", "p02703_case_010", "p02703_case_011", "p02703_case_012", "p02703_case_013", "p02703_case_014", "p02703_case_015", "p02703_case_016", "p02703_case_017", "p02703_case_018", "p02703_case_019", "p02703_case_020", "p02703_case_021", "p02703_case_022", "p02703_case_023", "p02703_case_024", "p02703_case_025", "p02703_case_026", "p02703_case_027", "p02703_case_028", "p02703_case_029", "p02703_case_030", "p02703_case_031", "p02703_case_032", "p02703_case_033", "p02703_case_034", "p02703_case_035", "p02703_case_036", "p02703_case_037", "p02703_case_038", "p02703_case_039", "p02703_case_040", "p02703_case_041", "p02703_case_042", "p02703_case_043", "p02703_case_044", "p02703_case_045", "p02703_case_046", "p02703_case_047", "p02703_case_048", "p02703_case_049", "p02703_case_050", "p02703_case_051", "p02703_case_052", "p02703_case_053", "p02703_case_054", "p02703_case_055", "p02703_case_056", "p02703_case_057", "p02703_case_058", "p02703_case_059", "p02703_case_060", "p02703_case_061", "p02703_case_062", "p02703_case_063", "p02703_case_064", "p02703_case_065", "p02703_case_066", "p02703_case_067", "p02703_case_068", "p02703_case_069", "p02703_case_070", "p02703_case_071", "p02703_case_072", "p02703_case_073", "p02703_case_074", "p02703_case_075", "p02703_case_076", "p02703_case_077", "p02703_case_078", "p02703_case_079", "p02703_case_080", "p02703_case_081", "p02703_case_082", "p02703_case_083", "p02703_case_084", "p02703_case_085", "p02703_case_086", "p02703_case_087", "p02703_case_088", "p02703_case_089", "p02703_case_090", "p02703_case_091", "p02703_case_092", "p02703_case_093", "p02703_case_094", "p02703_case_095", "p02703_case_096", "p02703_case_097", "p02703_case_098", "p02703_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from heapq import heappush, heappop\n\nN, M, S = list(map(int, input().split()))\nmxCost = 0\nedges = [[] for _ in range(N)]\nfor _ in range(M):\n fr, to, cost, dist = list(map(int, input().split()))\n mxCost = max(mxCost, cost)\n fr -= 1\n to -= 1\n edges[fr].append((to, dist, cost))\n edges[to].append((fr, dist, cost))\nfor i in range(N):\n C, D = list(map(int, input().split()))\n edges[i].append((i, D, -C))\nque = [(0, S, 0)]\nmxCost *= N - 1\nminDsit = [[10**18] * (mxCost + 1) for _ in range(N)]\nminDsit[0][0] = 0\nwhile que:\n dist, s, now = heappop(que)\n for to, d, c in edges[now]:\n cost = min(mxCost, s - c)\n if cost < 0 or minDsit[to][cost] <= dist + d:\n continue\n minDsit[to][cost] = dist + d\n heappush(que, (dist + d, cost, to))\nfor dist in minDsit[1:]:\n print((min(dist)))\n", "fast_code_sha256": "2ce60f1a1408c3c92e7f5201027a60a54ca6f2defd056d05b14b5e80301f91f7", "fast_id": "p02703_2ce60f1a1408c3c92e7f5201027a60a54ca6f2defd056d05b14b5e80301f91f7", "fine_bin": 2, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from heapq import heappush, heappop\n\nN, M, S = list(map(int, input().split()))\nmxCost = 0\nedges = [[] for _ in range(N)]\nfor _ in range(M):\n fr, to, cost, dist = list(map(int, input().split()))\n mxCost = max(mxCost, cost)\n fr -= 1\n to -= 1\n edges[fr].append((to, dist, cost))\n edges[to].append((fr, dist, cost))\nfor i in range(N):\n C, D = list(map(int, input().split()))\n edges[i].append((i, D, -C))\nque = [(0, S, 0)]\nmxCost *= N - 1\nminDsit = [[10**18] * (mxCost + 1) for _ in range(N)]\nminDsit[0][0] = 0\nwhile que:\n dist, s, now = heappop(que)\n for to, d, c in edges[now]:\n cost = min(mxCost, s - c)\n if cost < 0 or minDsit[to][cost] <= dist + d:\n continue\n minDsit[to][cost] = dist + d\n heappush(que, (dist + d, cost, to))\nfor dist in minDsit[1:]:\n print((min(dist)))\n", "measured_fast_code_sha256": "2ce60f1a1408c3c92e7f5201027a60a54ca6f2defd056d05b14b5e80301f91f7", "measured_slow_code": "import sys\nfrom heapq import heappush, heappop\nimport numpy as np\n\n\ndef input():\n return sys.stdin.readline().rstrip()\n\n\ndef ii():\n return int(input())\n\n\ndef mi():\n return map(int, input().split())\n\n\ndef li():\n return list(mi())\n\n\ndef main():\n def dijkstra(s):\n def push(v, s, x):\n if s < 0:\n return\n if dist[v, s] <= x:\n return\n dist[v, s] = x\n heappush(que, (x, v, s))\n\n inf = 10**18\n dist = np.full((n, MAX_S + 1), inf, dtype=int)\n # time, remain, node\n que = []\n push(0, s, 0)\n while que:\n x, v, s = heappop(que)\n if dist[v, s] < x:\n continue\n ns = min(s + c[v], MAX_S)\n push(v, ns, x + d[v])\n for nv, a, b in adj[v]:\n push(nv, s - a, x + b)\n return np.min(dist, axis=1)\n\n n, m, s = mi()\n adj = [[] for i in range(n)]\n MAX_S = 0\n for i in range(m):\n u, v, a, b = mi()\n u -= 1\n v -= 1\n adj[u].append((v, a, b))\n adj[v].append((u, a, b))\n MAX_S = max(MAX_S, a)\n MAX_S *= n - 1\n s = min(s, MAX_S)\n c, d = [0] * n, [0] * n\n for i in range(n):\n c[i], d[i] = mi()\n ans = dijkstra(s)\n print(*ans[1:], sep=\"\\n\")\n\n\nif __name__ == \"__main__\":\n main()\n", "measured_slow_code_sha256": "13ddc35e7eb74d73b0b3c8f42eca38b92bc94e091a7090e12213a091ef6feb16", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.3438023366814273, "pair_id": "python_v2_a5f8133381d2e24be256df5a", "per_case_slow_code_faster_fraction": 0.08, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02703", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02703_2ce60f1a1408c3c92e7f5201027a60a54ca6f2defd056d05b14b5e80301f91f7.jsonl.gz", "inputs": "reproduction/python/inputs/p02703.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02703_13ddc35e7eb74d73b0b3c8f42eca38b92bc94e091a7090e12213a091ef6feb16.jsonl.gz"}, "slow_code": "import sys\nfrom heapq import heappush, heappop\nimport numpy as np\n\n\ndef input():\n return sys.stdin.readline().rstrip()\n\n\ndef ii():\n return int(input())\n\n\ndef mi():\n return map(int, input().split())\n\n\ndef li():\n return list(mi())\n\n\ndef main():\n def dijkstra(s):\n def push(v, s, x):\n if s < 0:\n return\n if dist[v, s] <= x:\n return\n dist[v, s] = x\n heappush(que, (x, v, s))\n\n inf = 10**18\n dist = np.full((n, MAX_S + 1), inf, dtype=int)\n\n que = []\n push(0, s, 0)\n while que:\n x, v, s = heappop(que)\n if dist[v, s] < x:\n continue\n ns = min(s + c[v], MAX_S)\n push(v, ns, x + d[v])\n for nv, a, b in adj[v]:\n push(nv, s - a, x + b)\n return np.min(dist, axis=1)\n\n n, m, s = mi()\n adj = [[] for i in range(n)]\n MAX_S = 0\n for i in range(m):\n u, v, a, b = mi()\n u -= 1\n v -= 1\n adj[u].append((v, a, b))\n adj[v].append((u, a, b))\n MAX_S = max(MAX_S, a)\n MAX_S *= n - 1\n s = min(s, MAX_S)\n c, d = [0] * n, [0] * n\n for i in range(n):\n c[i], d[i] = mi()\n ans = dijkstra(s)\n print(*ans[1:], sep=\"\\n\")\n\n\nif __name__ == \"__main__\":\n main()\n", "slow_code_sha256": "8367a3613f4d9a1208ac0ab45c2708eb9c7ae580813c618185432ad6e30b1042", "slow_id": "p02703_13ddc35e7eb74d73b0b3c8f42eca38b92bc94e091a7090e12213a091ef6feb16", "speedup": 4.8521070024280775, "stratum": "4-8", "within_pair_jaccard": 0.38461538461538464, "workload": {"case_count": 100, "description": "Find minimum travel time from city 1 to every other city in a connected undirected graph. Start with S silver and 10^100 gold coins. Edge i costs A_i silver and B_i minutes; in city i, each gold exchanges for C_i silver in D_i minutes. Observed inputs: N=2..50 (median 50); M=1..100 (median 100); S=0..1000000000 (median 0); A_i=1..50; B_i=1..1000000000; C_i=1..1000000000; D_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 2839, "median": 1347.5, "min": 31}, "input_format": ["N M S\nU_1 V_1 A_1 B_1\n...\nU_M V_M A_M B_M\nC_1 D_1\n...\nC_N D_N"], "input_format_status": "source_input_section", "input_lines": {"max": 151, "median": 151.0, "min": 4}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 503, "median": 503.0, "min": 11}}} -{"case_ids": ["p03298_case_000", "p03298_case_001", "p03298_case_002", "p03298_case_003", "p03298_case_004", "p03298_case_005", "p03298_case_006", "p03298_case_007", "p03298_case_008", "p03298_case_009", "p03298_case_010", "p03298_case_011", "p03298_case_012", "p03298_case_013", "p03298_case_014", "p03298_case_015", "p03298_case_016", "p03298_case_017", "p03298_case_018", "p03298_case_019", "p03298_case_020", "p03298_case_021", "p03298_case_022", "p03298_case_023", "p03298_case_024", "p03298_case_025", "p03298_case_026", "p03298_case_027", "p03298_case_028", "p03298_case_029", "p03298_case_030", "p03298_case_031", "p03298_case_032", "p03298_case_033", "p03298_case_034", "p03298_case_035", "p03298_case_036", "p03298_case_037", "p03298_case_038", "p03298_case_039", "p03298_case_040", "p03298_case_041", "p03298_case_042", "p03298_case_043", "p03298_case_044", "p03298_case_045", "p03298_case_046", "p03298_case_047", "p03298_case_048", "p03298_case_049", "p03298_case_050", "p03298_case_051", "p03298_case_052", "p03298_case_053", "p03298_case_054", "p03298_case_055", "p03298_case_056", "p03298_case_057", "p03298_case_058", "p03298_case_059", "p03298_case_060", "p03298_case_061", "p03298_case_062", "p03298_case_063", "p03298_case_064", "p03298_case_065", "p03298_case_066", "p03298_case_067", "p03298_case_068", "p03298_case_069", "p03298_case_070", "p03298_case_071", "p03298_case_072", "p03298_case_073", "p03298_case_074", "p03298_case_075", "p03298_case_076", "p03298_case_077", "p03298_case_078", "p03298_case_081", "p03298_case_082", "p03298_case_083", "p03298_case_084", "p03298_case_085", "p03298_case_086", "p03298_case_087", "p03298_case_088", "p03298_case_089", "p03298_case_090", "p03298_case_091", "p03298_case_092", "p03298_case_093", "p03298_case_094", "p03298_case_095", "p03298_case_096", "p03298_case_097", "p03298_case_098", "p03298_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 98, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from collections import defaultdict, deque\nfrom heapq import heappush, heappop\nimport sys\nimport math\nimport bisect\nimport random\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LS():\n return [list(x) for x in sys.stdin.readline().split()]\n\n\ndef S():\n res = list(sys.stdin.readline())\n if res[-1] == \"\\n\":\n return res[:-1]\n return res\n\n\ndef IR(n):\n return [I() for i in range(n)]\n\n\ndef LIR(n):\n return [LI() for i in range(n)]\n\n\ndef SR(n):\n return [S() for i in range(n)]\n\n\ndef LSR(n):\n return [LS() for i in range(n)]\n\n\nsys.setrecursionlimit(1000000)\nmod = 1000000007\n\n\ndef A():\n return\n\n\ndef B():\n return\n\n\ndef C():\n n = I()\n s = S()\n for i in range(2 * n):\n s[i] = ord(s[i]) - 96\n k = 27\n m = 1 << n\n p = [1 << j for j in range(n)]\n d = defaultdict(lambda: 0)\n l = [(0, 0)]\n for i in s[:n][::-1]:\n l = [(x[0] * k + i, x[1]) for x in l] + [(x[0], x[1] * k + i) for x in l]\n for i in l:\n d[i] += 1\n ans = 0\n l = [(0, 0)]\n for i in s[n:]:\n l = [(x[0] * k + i, x[1]) for x in l] + [(x[0], x[1] * k + i) for x in l]\n for i in l:\n ans += d[i]\n print(ans)\n return\n\n\ndef D():\n return\n\n\ndef E():\n return\n\n\ndef F():\n return\n\n\nif __name__ == \"__main__\":\n C()\n", "fast_code_sha256": "051dd963702238662fe96a84ebc1ca74f3c157f8cf8eec6769e928924a370a63", "fast_id": "p03298_822b320890b4640a82e0d7980e120614b4f10c9398150508b25e66c5600d4e83", "fine_bin": 0, "identifiers_renamed": false, "language": "python", "measured_fast_code": "#!usr/bin/env python3\nfrom collections import defaultdict, deque\nfrom heapq import heappush, heappop\nimport sys\nimport math\nimport bisect\nimport random\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LS():\n return [list(x) for x in sys.stdin.readline().split()]\n\n\ndef S():\n res = list(sys.stdin.readline())\n if res[-1] == \"\\n\":\n return res[:-1]\n return res\n\n\ndef IR(n):\n return [I() for i in range(n)]\n\n\ndef LIR(n):\n return [LI() for i in range(n)]\n\n\ndef SR(n):\n return [S() for i in range(n)]\n\n\ndef LSR(n):\n return [LS() for i in range(n)]\n\n\nsys.setrecursionlimit(1000000)\nmod = 1000000007\n# A\ndef A():\n return\n\n\n# B\ndef B():\n return\n\n\n# C\ndef C():\n n = I()\n s = S()\n for i in range(2 * n):\n s[i] = ord(s[i]) - 96\n k = 27\n m = 1 << n\n p = [1 << j for j in range(n)]\n d = defaultdict(lambda: 0)\n l = [(0, 0)]\n for i in s[:n][::-1]:\n l = [(x[0] * k + i, x[1]) for x in l] + [(x[0], x[1] * k + i) for x in l]\n for i in l:\n d[i] += 1\n ans = 0\n l = [(0, 0)]\n for i in s[n:]:\n l = [(x[0] * k + i, x[1]) for x in l] + [(x[0], x[1] * k + i) for x in l]\n for i in l:\n ans += d[i]\n print(ans)\n return\n\n\n# D\ndef D():\n return\n\n\n# E\ndef E():\n return\n\n\n# F\ndef F():\n return\n\n\n# Solve\nif __name__ == \"__main__\":\n C()\n", "measured_fast_code_sha256": "822b320890b4640a82e0d7980e120614b4f10c9398150508b25e66c5600d4e83", "measured_slow_code": "import sys\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\ndef LS2():\n return list(sys.stdin.readline().rstrip()) # 空白なし\n\n\nN = I()\nS = LS2()\n# 左N個のマスをどう塗るかで半分全列挙\nans = 0\nleft = []\nright = []\nfor i in range(2**N):\n red = []\n blue = []\n for j in range(N):\n if (i >> j) & 1:\n red.append(S[j])\n else:\n blue.append(S[j])\n red = \"\".join(red)\n blue = \"\".join(blue)\n left.append((red, blue))\nfor i in range(2**N):\n red = []\n blue = []\n for j in range(N):\n if (i >> j) & 1:\n red.append(S[j + N])\n else:\n blue.append(S[j + N])\n red, blue = blue, red\n red.reverse()\n blue.reverse()\n red = \"\".join(red)\n blue = \"\".join(blue)\n right.append((red, blue))\nfrom operator import itemgetter\n\nright = sorted(right, key=itemgetter(0, 1))\nfrom bisect import bisect_left, bisect\n\nans = 0\nfor i in range(2**N):\n ans += bisect(right, left[i]) - bisect_left(right, left[i])\nprint(ans)\n", "measured_slow_code_sha256": "47babb9e01c38bdfaa49525bab51c30730074e0d2a2c3f9e0f69c5eefd476094", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 0.9341146552445929, "pair_id": "python_v2_f10d7648580ea6058030e858", "per_case_slow_code_faster_fraction": 0.5306122448979592, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03298", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03298_822b320890b4640a82e0d7980e120614b4f10c9398150508b25e66c5600d4e83.jsonl.gz", "inputs": "reproduction/python/inputs/p03298.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03298_47babb9e01c38bdfaa49525bab51c30730074e0d2a2c3f9e0f69c5eefd476094.jsonl.gz"}, "slow_code": "import sys\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\ndef LS2():\n return list(sys.stdin.readline().rstrip())\n\n\nN = I()\nS = LS2()\n\nans = 0\nleft = []\nright = []\nfor i in range(2**N):\n red = []\n blue = []\n for j in range(N):\n if (i >> j) & 1:\n red.append(S[j])\n else:\n blue.append(S[j])\n red = \"\".join(red)\n blue = \"\".join(blue)\n left.append((red, blue))\nfor i in range(2**N):\n red = []\n blue = []\n for j in range(N):\n if (i >> j) & 1:\n red.append(S[j + N])\n else:\n blue.append(S[j + N])\n red, blue = blue, red\n red.reverse()\n blue.reverse()\n red = \"\".join(red)\n blue = \"\".join(blue)\n right.append((red, blue))\nfrom operator import itemgetter\n\nright = sorted(right, key=itemgetter(0, 1))\nfrom bisect import bisect_left, bisect\n\nans = 0\nfor i in range(2**N):\n ans += bisect(right, left[i]) - bisect_left(right, left[i])\nprint(ans)\n", "slow_code_sha256": "6bef4b9e934fe1051f41330f714558355912f4b132983bfbb8d8ce7c9372c683", "slow_id": "p03298_47babb9e01c38bdfaa49525bab51c30730074e0d2a2c3f9e0f69c5eefd476094", "speedup": 2.096666440438303, "stratum": "2-4", "within_pair_jaccard": 0.2911392405063291, "workload": {"case_count": 98, "description": "Color each position of a lowercase string S red or blue. Count assignments where the red subsequence read left-to-right equals the blue subsequence read right-to-left. S has exactly 2N characters. Observed inputs: N=1..18 (median 5); S_length=2..36; distinct_characters=1..26.", "description_revision": "semantic-review-20261020", "distinct_input_count": 98, "input_bytes": {"max": 40, "median": 13.0, "min": 5}, "input_format": ["N\nS"], "input_format_status": "source_input_section", "input_lines": {"max": 2, "median": 2.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 2, "median": 2.0, "min": 2}}} -{"case_ids": ["p03721_case_000", "p03721_case_001", "p03721_case_002", "p03721_case_003", "p03721_case_004", "p03721_case_005", "p03721_case_006", "p03721_case_007", "p03721_case_008", "p03721_case_009", "p03721_case_010", "p03721_case_011", "p03721_case_012", "p03721_case_013", "p03721_case_014", "p03721_case_015", "p03721_case_016", "p03721_case_017", "p03721_case_018", "p03721_case_019", "p03721_case_020", "p03721_case_021", "p03721_case_022", "p03721_case_023", "p03721_case_024", "p03721_case_025", "p03721_case_026", "p03721_case_027", "p03721_case_028", "p03721_case_029", "p03721_case_030", "p03721_case_031", "p03721_case_032", "p03721_case_033", "p03721_case_034", "p03721_case_035", "p03721_case_036", "p03721_case_037", "p03721_case_038", "p03721_case_039", "p03721_case_040", "p03721_case_041", "p03721_case_042", "p03721_case_043", "p03721_case_044", "p03721_case_045", "p03721_case_046", "p03721_case_047", "p03721_case_048", "p03721_case_049", "p03721_case_050", "p03721_case_051", "p03721_case_052", "p03721_case_053", "p03721_case_054", "p03721_case_055", "p03721_case_056", "p03721_case_057", "p03721_case_058", "p03721_case_059", "p03721_case_060", "p03721_case_061", "p03721_case_062", "p03721_case_063", "p03721_case_064", "p03721_case_065", "p03721_case_067", "p03721_case_068", "p03721_case_069", "p03721_case_070", "p03721_case_071", "p03721_case_072", "p03721_case_073", "p03721_case_074", "p03721_case_075", "p03721_case_076", "p03721_case_077", "p03721_case_078", "p03721_case_079", "p03721_case_080", "p03721_case_081", "p03721_case_082", "p03721_case_083", "p03721_case_084", "p03721_case_085", "p03721_case_087", "p03721_case_088", "p03721_case_089", "p03721_case_090", "p03721_case_091", "p03721_case_092", "p03721_case_093", "p03721_case_094", "p03721_case_095", "p03721_case_096", "p03721_case_097", "p03721_case_098", "p03721_case_099", "p03721_v2_8dbaa32dabbc59559f15", "p03721_v2_b1687ced952bc758cf7f"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "from sys import stdin\nfrom operator import itemgetter\n\n\ndef main():\n lines = stdin.readlines()\n N, K = list(map(int, lines[0].split()))\n abn = [[int(abi) for abi in line.split()] for line in lines[1:]]\n abn.sort(key=itemgetter(0))\n cnt = 0\n for ai, bi in abn:\n cnt += bi\n if K <= cnt:\n print(ai)\n break\n return\n\n\nmain()\n", "fast_code_sha256": "9a2c7e9021c61fd0188b047d55a7a6bc111a05a6407ed323791b0539e23b402b", "fast_id": "p03721_9a2c7e9021c61fd0188b047d55a7a6bc111a05a6407ed323791b0539e23b402b", "fine_bin": 1, "identifiers_renamed": false, "language": "python", "measured_fast_code": "from sys import stdin\nfrom operator import itemgetter\n\n\ndef main():\n lines = stdin.readlines()\n N, K = list(map(int, lines[0].split()))\n abn = [[int(abi) for abi in line.split()] for line in lines[1:]]\n abn.sort(key=itemgetter(0))\n cnt = 0\n for ai, bi in abn:\n cnt += bi\n if K <= cnt:\n print(ai)\n break\n return\n\n\nmain()\n", "measured_fast_code_sha256": "9a2c7e9021c61fd0188b047d55a7a6bc111a05a6407ed323791b0539e23b402b", "measured_slow_code": "n, k = list(map(int, input().split()))\nd = [0 for i in range(100010)]\nfor i in range(n):\n a, b = list(map(int, input().split()))\n d[a] += b\nfor j, e in enumerate(d):\n k -= e\n if k <= 0:\n print(j)\n break\n", "measured_slow_code_sha256": "46865d20d9586f50a54d66ae37ab47cd1b4e8805e9aff92f20347ac075089307", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 1.6523791512000638, "pair_id": "python_v2_832cd8e2a20881c37358fc3d", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03721", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03721_9a2c7e9021c61fd0188b047d55a7a6bc111a05a6407ed323791b0539e23b402b.jsonl.gz", "inputs": "reproduction/python/inputs/p03721.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03721_46865d20d9586f50a54d66ae37ab47cd1b4e8805e9aff92f20347ac075089307.jsonl.gz"}, "slow_code": "n, k = list(map(int, input().split()))\nd = [0 for i in range(100010)]\nfor i in range(n):\n a, b = list(map(int, input().split()))\n d[a] += b\nfor j, e in enumerate(d):\n k -= e\n if k <= 0:\n print(j)\n break\n", "slow_code_sha256": "46865d20d9586f50a54d66ae37ab47cd1b4e8805e9aff92f20347ac075089307", "slow_id": "p03721_46865d20d9586f50a54d66ae37ab47cd1b4e8805e9aff92f20347ac075089307", "speedup": 4.5331735276476985, "stratum": "4-8", "within_pair_jaccard": 0.22727272727272727, "workload": {"case_count": 100, "description": "Operation i inserts b_i copies of integer a_i into an initially empty multiset. After N operations, find the 1-based K-th smallest element, counting multiplicity; the expanded multiset is not supplied. Observed inputs: N=1..100000 (median 100000); K=1..10000000000 (median 1154351153); a_i=1..100000; b_i=1..100000; total_elements=1..10000000000 (median 4995269195.5).", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 1289119, "median": 1177559.0, "min": 8}, "input_format": ["N K\na_1 b_1\n...\na_N b_N"], "input_format_status": "source_input_section", "input_lines": {"max": 100001, "median": 100001.0, "min": 2}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200002, "median": 200002.0, "min": 4}}} -{"case_ids": ["p03486_case_000", "p03486_case_001", "p03486_case_002", "p03486_case_003", "p03486_case_004", "p03486_case_005", "p03486_case_006", "p03486_case_007", "p03486_case_008", "p03486_case_009", "p03486_case_010", "p03486_case_011", "p03486_case_012", "p03486_case_013", "p03486_case_014", "p03486_case_015", "p03486_case_016", "p03486_case_017", "p03486_case_018", "p03486_case_019", "p03486_case_020", "p03486_case_021", "p03486_case_022", "p03486_case_023", "p03486_case_024", "p03486_case_025", "p03486_case_026", "p03486_case_027", "p03486_case_028", "p03486_case_029", "p03486_case_030", "p03486_case_031", "p03486_case_032", "p03486_case_033", "p03486_case_034", "p03486_case_035", "p03486_case_036", "p03486_case_037", "p03486_case_038", "p03486_case_039", "p03486_case_040", "p03486_case_041", "p03486_case_042", "p03486_case_043", "p03486_case_044", "p03486_case_045", "p03486_case_046", "p03486_case_047", "p03486_case_048", "p03486_case_049", "p03486_case_050", "p03486_case_051", "p03486_case_052", "p03486_case_053", "p03486_case_054", "p03486_case_055", "p03486_case_056", "p03486_case_057", "p03486_case_058", "p03486_case_059", "p03486_case_060", "p03486_case_061", "p03486_case_062", "p03486_case_063", "p03486_case_064", "p03486_case_065", "p03486_case_066", "p03486_case_067", "p03486_case_068", "p03486_case_069", "p03486_case_070", "p03486_case_071", "p03486_case_072", "p03486_case_073", "p03486_case_074", "p03486_case_075", "p03486_case_076", "p03486_case_077", "p03486_case_078", "p03486_case_079", "p03486_case_080", "p03486_case_081", "p03486_case_082", "p03486_case_083", "p03486_case_084", "p03486_case_085", "p03486_case_086", "p03486_case_087", "p03486_case_088", "p03486_case_089", "p03486_case_090", "p03486_case_091", "p03486_case_092", "p03486_case_093", "p03486_case_094", "p03486_case_095", "p03486_case_096", "p03486_case_097", "p03486_case_098", "p03486_case_099"], "code_role": "formatted_comment_and_explanatory_string_free_display", "common_case_count": 100, "display_validation": "structure_and_executable_equivalence_plus_all_frozen_inputs_checker_pass", "fast_code": "(\n print(\"Yes\")\n if \"\".join(sorted(input())) < \"\".join(sorted(input(), reverse=True))\n else print(\"No\")\n)\n", "fast_code_sha256": "9374be75a840a2c4b56e633814fcdd34842f67bc14b739401a131997d9f69910", "fast_id": "p03486_dfcb075d0773a0639a95a5d25040ac8581b9ade9ef96b0d84ab01fe3be33fd75", "fine_bin": 9, "identifiers_renamed": false, "language": "python", "measured_fast_code": "print(\"Yes\") if \"\".join(sorted(input())) < \"\".join(\n sorted(input(), reverse=True)\n) else print(\"No\")\n", "measured_fast_code_sha256": "dfcb075d0773a0639a95a5d25040ac8581b9ade9ef96b0d84ab01fe3be33fd75", "measured_slow_code": "import sys\n\n# import collections\n# import math\n# import string\n# import bisect\n# import re\n# import itertools\n# import statistics\ndef main():\n s, t = sys.stdin.read().split()\n n, m = len(s), len(t)\n s = sorted(s)\n t = list(reversed(sorted(t)))\n if n < m:\n for i in range(n):\n if s[i] < t[i]:\n ans = \"Yes\"\n break\n elif s[i] > t[i]:\n ans = \"No\"\n break\n else:\n ans = \"Yes\"\n else:\n for i in range(m):\n if s[i] < t[i]:\n ans = \"Yes\"\n break\n elif s[i] > t[i]:\n ans = \"No\"\n break\n else:\n ans = \"No\"\n print(ans)\n\n\nif __name__ == \"__main__\":\n # execute only if run as a script\n main()\n", "measured_slow_code_sha256": "ae2b702653d7f7343a504deb1d82130c75439f406e3e68078bdb6fe733a50939", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 3.9173885159591606, "pair_id": "python_v2_40e797568f1cbda3541e7598", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p03486", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p03486_dfcb075d0773a0639a95a5d25040ac8581b9ade9ef96b0d84ab01fe3be33fd75.jsonl.gz", "inputs": "reproduction/python/inputs/p03486.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p03486_ae2b702653d7f7343a504deb1d82130c75439f406e3e68078bdb6fe733a50939.jsonl.gz"}, "slow_code": "import sys\n\n\ndef main():\n s, t = sys.stdin.read().split()\n n, m = len(s), len(t)\n s = sorted(s)\n t = list(reversed(sorted(t)))\n if n < m:\n for i in range(n):\n if s[i] < t[i]:\n ans = \"Yes\"\n break\n elif s[i] > t[i]:\n ans = \"No\"\n break\n else:\n ans = \"Yes\"\n else:\n for i in range(m):\n if s[i] < t[i]:\n ans = \"Yes\"\n break\n elif s[i] > t[i]:\n ans = \"No\"\n break\n else:\n ans = \"No\"\n print(ans)\n\n\nif __name__ == \"__main__\":\n\n main()\n", "slow_code_sha256": "12de6db88ad79471a6d47d200ef0cf1d590ca1eac8ef874b69a66f9eb314da4e", "slow_id": "p03486_ae2b702653d7f7343a504deb1d82130c75439f406e3e68078bdb6fe733a50939", "speedup": 3.764529383820126, "stratum": "2-4", "within_pair_jaccard": 0.18181818181818182, "workload": {"case_count": 100, "description": "Rearrange the characters of each lowercase string s and t independently. Determine whether some rearrangements satisfy strict lexicographic order s_prime= B[i // 2]:\n A[i // 2] -= B[i // 2]\n ans += B[i // 2]\n B[i // 2] = 0\n else:\n B[i // 2] -= A[i // 2]\n ans += A[i // 2]\n A[i // 2] = 0\n if A[i // 2 + 1] >= B[i // 2]:\n A[i // 2 + 1] -= B[i // 2]\n ans += B[i // 2]\n B[i // 2] = 0\n else:\n B[i // 2] -= A[i // 2 + 1]\n ans += A[i // 2 + 1]\n A[i // 2 + 1] = 0\n else:\n if A[N - i // 2] >= B[N - i // 2 - 1]:\n A[N - i // 2] -= B[N - i // 2 - 1]\n ans += B[N - i // 2 - 1]\n B[N - i // 2 - 1] = 0\n else:\n B[N - i // 2 - 1] -= A[N - i // 2]\n ans += A[N - i // 2]\n A[N - i // 2] = 0\n if A[N - i // 2 - 1] >= B[N - i // 2 - 1]:\n A[N - i // 2 - 1] -= B[N - i // 2 - 1]\n ans += B[N - i // 2 - 1]\n B[N - i // 2 - 1] = 0\n else:\n B[N - i // 2 - 1] -= A[N - i // 2 - 1]\n ans += A[N - i // 2 - 1]\n A[N - i // 2 - 1] = 0\nprint(ans)\n", "measured_slow_code_sha256": "f0395674e51675bd438b96a7f18fa9739566f756efa1ea79ea087d0b83a10e1f", "measurement_metric": "cpu_instruction_count", "measurement_reference_root": "../test", "median_per_case_speedup": 2.464838357766453, "pair_id": "python_v2_452e202ca0c568308e48d796", "per_case_slow_code_faster_fraction": 0.0, "performance_label_scope": "original measured code, not a remeasurement of the display code", "problem_id": "p02959", "release_status": "frozen_verified", "reproduction": {"fast_measurements": "reproduction/python/measurements/p02959_e24d294375f12514a13c38eb72758e7692b14300c96474cb830c07fedda27351.jsonl.gz", "inputs": "reproduction/python/inputs/p02959.jsonl.gz", "slow_measurements": "reproduction/python/measurements/p02959_f0395674e51675bd438b96a7f18fa9739566f756efa1ea79ea087d0b83a10e1f.jsonl.gz"}, "slow_code": "N = int(eval(input()))\nA = list(map(int, input().split()))\nB = list(map(int, input().split()))\nans = 0\nfor i in range(N):\n if i % 2 == 0:\n if A[i // 2] >= B[i // 2]:\n A[i // 2] -= B[i // 2]\n ans += B[i // 2]\n B[i // 2] = 0\n else:\n B[i // 2] -= A[i // 2]\n ans += A[i // 2]\n A[i // 2] = 0\n if A[i // 2 + 1] >= B[i // 2]:\n A[i // 2 + 1] -= B[i // 2]\n ans += B[i // 2]\n B[i // 2] = 0\n else:\n B[i // 2] -= A[i // 2 + 1]\n ans += A[i // 2 + 1]\n A[i // 2 + 1] = 0\n else:\n if A[N - i // 2] >= B[N - i // 2 - 1]:\n A[N - i // 2] -= B[N - i // 2 - 1]\n ans += B[N - i // 2 - 1]\n B[N - i // 2 - 1] = 0\n else:\n B[N - i // 2 - 1] -= A[N - i // 2]\n ans += A[N - i // 2]\n A[N - i // 2] = 0\n if A[N - i // 2 - 1] >= B[N - i // 2 - 1]:\n A[N - i // 2 - 1] -= B[N - i // 2 - 1]\n ans += B[N - i // 2 - 1]\n B[N - i // 2 - 1] = 0\n else:\n B[N - i // 2 - 1] -= A[N - i // 2 - 1]\n ans += A[N - i // 2 - 1]\n A[N - i // 2 - 1] = 0\nprint(ans)\n", "slow_code_sha256": "f0395674e51675bd438b96a7f18fa9739566f756efa1ea79ea087d0b83a10e1f", "slow_id": "p02959_f0395674e51675bd438b96a7f18fa9739566f756efa1ea79ea087d0b83a10e1f", "speedup": 2.545570859035719, "stratum": "2-4", "within_pair_jaccard": 0.2972972972972973, "workload": {"case_count": 100, "description": "N+1 towns hold A_i monsters. Hero i may defeat at most B_i monsters in total, split between towns i and i+1. Maximize the number defeated by all N cooperating heroes. Observed inputs: N=1..100000 (median 5500); A_i=1..1000000000; B_i=1..1000000000.", "description_revision": "semantic-review-20261020", "distinct_input_count": 100, "input_bytes": {"max": 2200018, "median": 70232.0, "min": 8}, "input_format": ["N\nA_1 ... A_(N+1)\nB_1 ... B_N"], "input_format_status": "source_input_section", "input_lines": {"max": 3, "median": 3.0, "min": 3}, "metadata_used_for_label_construction": false, "model_input_fields": ["description", "input_format"], "model_input_policy": "workload-only-v1", "schema_version": 4, "statistics_scope": "exact_frozen_measured_common_inputs", "whitespace_tokens": {"max": 200002, "median": 11002.0, "min": 4}}} +{"fast_code_id":"503fb8c9629bd5073ecf61d35bcd5f5eac21a3dac16db660482ea529cc5f3939","fast_id":"p00219_503fb8c9629bd5073ecf61d35bcd5f5eac21a3dac16db660482ea529cc5f3939","language":"python","measured_fast_code_id":"503fb8c9629bd5073ecf61d35bcd5f5eac21a3dac16db660482ea529cc5f3939","measured_slow_code_id":"143e8c43a896e1cd454e24e862b4fba25064da9281531a010b06f570682abd99","measurement_metric":"cpu_instruction_count","pair_id":"python_00219ec9286301bad8e3661a","problem_id":"p00219","slow_code_id":"143e8c43a896e1cd454e24e862b4fba25064da9281531a010b06f570682abd99","slow_id":"p00219_143e8c43a896e1cd454e24e862b4fba25064da9281531a010b06f570682abd99","speedup":4.132000409024836,"stratum":"4-8","sampling_key":"12a33df269b21f0f946c7d468716b5356b238aa3d481b038f149ebf8915dfe72","slow_code":"while True:\n n = int(eval(input()))\n if n == 0:\n break\n ice = [int(eval(input())) for _ in range(n)]\n for i in range(10):\n print((\"*\" * ice.count(i) + \"-\" * (ice.count(i) == 0)))\n","fast_code":"while 1:\n n = eval(input())\n if n == 0:\n break\n h = [0] * 10\n for i in range(n):\n h[int(input())] += 1\n for i in h:\n print(\"*\" * i if i else \"-\")\n"} +{"fast_code_id":"67577897a73a4c730876a6907ec6fef270254d3ed2aa3fc2330dfddc791f582b","fast_id":"p03288_67577897a73a4c730876a6907ec6fef270254d3ed2aa3fc2330dfddc791f582b","language":"python","measured_fast_code_id":"67577897a73a4c730876a6907ec6fef270254d3ed2aa3fc2330dfddc791f582b","measured_slow_code_id":"4b19a6c66c6b24c9d371f629b6a683da99f61809c1d26fcff1386ca6548060d5","measurement_metric":"cpu_instruction_count","pair_id":"python_0108be2a44c95ba20014717e","problem_id":"p03288","slow_code_id":"4b19a6c66c6b24c9d371f629b6a683da99f61809c1d26fcff1386ca6548060d5","slow_id":"p03288_4b19a6c66c6b24c9d371f629b6a683da99f61809c1d26fcff1386ca6548060d5","speedup":30.99925203298274,"stratum":"8+","sampling_key":"21e0d2c78fda215214080d592f37584cd86727344dec012db37c859cb6d3315d","slow_code":"import bisect, collections, copy, heapq, itertools, math, string\nimport sys\n\n\ndef S():\n return sys.stdin.readline().rstrip()\n\n\ndef M():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef LS():\n return list(sys.stdin.readline().rstrip().split())\n\n\nR = I()\nif R < 1200:\n print(\"ABC\")\nelif R < 2800:\n print(\"ARC\")\nelse:\n print(\"AGC\")\n","fast_code":"R = int(eval(input()))\nprint((\"ABC\" if R < 1200 else \"ARC\" if 1200 <= R < 2800 else \"AGC\"))\n"} +{"fast_code_id":"d0049f943120d7271ad75201bb4f4041f116278d93954adfad2543cf4bc98d1f","fast_id":"p03837_80ecd7a533e7aade9fd037ac5793cdc66dad62fccbad95fa17c7543f12205caa","language":"python","measured_fast_code_id":"80ecd7a533e7aade9fd037ac5793cdc66dad62fccbad95fa17c7543f12205caa","measured_slow_code_id":"aef3a7d1505fcc4a9d9681d96c3dc6e6c95bb553e669bdf3f2274e3ffda2198b","measurement_metric":"cpu_instruction_count","pair_id":"python_0188af28be194e47c9ce30b9","problem_id":"p03837","slow_code_id":"aef3a7d1505fcc4a9d9681d96c3dc6e6c95bb553e669bdf3f2274e3ffda2198b","slow_id":"p03837_aef3a7d1505fcc4a9d9681d96c3dc6e6c95bb553e669bdf3f2274e3ffda2198b","speedup":4.098376470125324,"stratum":"4-8","sampling_key":"0546c800c3145d5727197e4261371aa322d7c91a6bd139f6d0cc71900dc8fbcf","slow_code":"N, M = list(map(int, input().split()))\na, b, c = 0, 0, 0\nE = []\nINF = 10**12\nD = [[INF] * N for i in range(N)]\nfor i in range(N):\n D[i][i] = 0\nfor i in range(M):\n a, b, c = list(map(int, input().split()))\n a, b = a - 1, b - 1\n D[a][b] = c\n D[b][a] = c\n E.append((a, b, c))\nfor k in range(N):\n for i in range(N):\n for j in range(N):\n D[i][j] = min(D[i][j], D[i][k] + D[k][j])\nP = 0\nfor i in range(M):\n if D[E[i][0]][E[i][1]] != E[i][2]:\n P += 1\nprint(P)\n","fast_code":"import heapq\n\nN, M = list(map(int, input().split()))\nes = [[] for _ in range(N)]\nfor i in range(M):\n a, b, c = list(map(int, input().split()))\n es[a - 1].append((c, b - 1))\n es[b - 1].append((c, a - 1))\nINF = float(\"inf\")\n\nd = [[INF for _ in range(N)] for _ in range(N)]\nfor i in range(N):\n q = []\n d[i][i] = 0\n heapq.heappush(q, (0, i))\n while q:\n cost, a = heapq.heappop(q)\n if d[i][a] < cost:\n continue\n for c, b in es[a]:\n if d[i][a] + c < d[i][b]:\n d[i][b] = d[i][a] + c\n heapq.heappush(q, (d[i][b], b))\n\n\ncnt = 0\nfor i in range(N):\n for c, b in es[i]:\n if d[i][b] != c:\n cnt += 1\n\nprint((cnt // 2))\n"} +{"fast_code_id":"d303e58edec6b24cc8e555d07dc9046ba2fd84035cc3ecb56ee6a7834b3d2d01","fast_id":"p03693_d303e58edec6b24cc8e555d07dc9046ba2fd84035cc3ecb56ee6a7834b3d2d01","language":"python","measured_fast_code_id":"d303e58edec6b24cc8e555d07dc9046ba2fd84035cc3ecb56ee6a7834b3d2d01","measured_slow_code_id":"a8d7956b0cbea162ca1db60ee520eccf4efc73cdccbed5370688af05e67aaca2","measurement_metric":"cpu_instruction_count","pair_id":"python_019805f60c6a5de3b3c5b3b2","problem_id":"p03693","slow_code_id":"a8d7956b0cbea162ca1db60ee520eccf4efc73cdccbed5370688af05e67aaca2","slow_id":"p03693_a8d7956b0cbea162ca1db60ee520eccf4efc73cdccbed5370688af05e67aaca2","speedup":1769.232511474867,"stratum":"8+","sampling_key":"0d97aa74be74f4b902a118e47b7f29de05e3c6722b0760775f8cff97f5342ac8","slow_code":"import numpy as np\n\nr, g, b = list(map(int, input().split()))\nif (100 * r + 10 * g + b) % 4 == 0:\n print(\"YES\")\nelse:\n print(\"NO\")\n","fast_code":"r, g, b = list(map(int, input().split()))\nrgb = 100 * r + 10 * g + b\nprint((\"YES\" if rgb % 4 == 0 else \"NO\"))\n"} +{"fast_code_id":"284a8c35e2eafc9aefdfd8aea3724dceaddb6694fb0e85ae17f2e4abdc89ffd1","fast_id":"p03331_8c8462ab78a9cd9c5b23cab4ea1172c4e2ca8e2ac0f69de77b0da618078d98d4","language":"python","measured_fast_code_id":"8c8462ab78a9cd9c5b23cab4ea1172c4e2ca8e2ac0f69de77b0da618078d98d4","measured_slow_code_id":"b6670f56c83800cdd6e6a56684f3be34fb1da4a6429d8c0f65a35c79c406bdf1","measurement_metric":"cpu_instruction_count","pair_id":"python_01ba697f145a234e618d9c3e","problem_id":"p03331","slow_code_id":"b6670f56c83800cdd6e6a56684f3be34fb1da4a6429d8c0f65a35c79c406bdf1","slow_id":"p03331_b6670f56c83800cdd6e6a56684f3be34fb1da4a6429d8c0f65a35c79c406bdf1","speedup":346.93838956251443,"stratum":"8+","sampling_key":"02125840a2d86e2b3805b4fa17c4691ce709194d472b972a46d757970c3c2ee3","slow_code":"N = int(eval(input()))\n\n\ndef sumof(N):\n sum = 0\n while N > 0:\n sum += N % 10\n N //= 10\n return sum\n\n\nminsum = 9 * 10\nfor i in range(1, N // 2 + 1):\n minsum = min(minsum, sumof(i) + sumof(N - i))\nprint(minsum)\n","fast_code":"import math\n\nn = int(eval(input()))\nm = math.log10(n)\nif int(m) == m:\n print((10))\n exit()\nans = sum(map(int, list(str(n))))\nprint(ans)\n"} +{"fast_code_id":"edcc95617201d5626b449d1a7abf3100c52bfc6d5e1b34d56dd05ba872f655f1","fast_id":"p03312_d384bba78aa3be094873144e7572be2fec2f5b51b3dabf911721719d39833e4d","language":"python","measured_fast_code_id":"d384bba78aa3be094873144e7572be2fec2f5b51b3dabf911721719d39833e4d","measured_slow_code_id":"923136bcc3ca1993d7b5b5155c0211bba6ed078795c208a1a3875d6dd7aa6d3a","measurement_metric":"cpu_instruction_count","pair_id":"python_022a06bdad00161e5e772024","problem_id":"p03312","slow_code_id":"8f562a68154a7b683e51bbc10e45ae21454de6b7bc88fac021784e92ca0d322a","slow_id":"p03312_923136bcc3ca1993d7b5b5155c0211bba6ed078795c208a1a3875d6dd7aa6d3a","speedup":2.9174278303920156,"stratum":"2-4","sampling_key":"b45ea68bdecd275b0d372f54b34ed8d93b3c254f7d9d5bab1174de499da511ef","slow_code":"import sys\n\ninput = lambda: sys.stdin.readline().rstrip()\nsys.setrecursionlimit(max(1000, 10**9))\nn = int(eval(input()))\na = list(map(int, input().split()))\nca = [None] * n\ns = 0\nfor i, num in enumerate(a):\n s += a[i]\n ca[i] = s\ndiff = [None] * n\ns = 0\nt = 1\nv1 = 0\nv2 = a[0]\ndiff[t - 1] = (v1, v2)\nwhile t < n:\n\n t += 1\n v2 += a[t - 1]\n while v1 < v2 and s < t:\n if diff[t - 1] is None or abs(v1 - v2) < abs(diff[t - 1][0] - diff[t - 1][1]):\n diff[t - 1] = (v1, v2)\n s += 1\n v1 += a[s - 1]\n v2 -= a[s - 1]\n if diff[t - 1] is None or abs(v1 - v2) < abs(diff[t - 1][0] - diff[t - 1][1]):\n diff[t - 1] = (v1, v2)\n if v1 > v2 and s >= 1:\n v1 -= a[s - 1]\n v2 += a[s - 1]\n s -= 1\ndiff2 = [None] * n\ns = n\nt = n - 1\nv1 = 0\nv2 = a[-1]\ndiff2[t] = (v1, v2)\nwhile t >= 1:\n\n t -= 1\n v2 += a[t]\n while v1 < v2 and s > t:\n if diff2[t] is None or abs(v1 - v2) < abs(diff2[t][0] - diff2[t][1]):\n diff2[t] = (v1, v2)\n s -= 1\n v1 += a[s]\n v2 -= a[s]\n if diff2[t] is None or abs(v1 - v2) < abs(diff2[t][0] - diff2[t][1]):\n diff2[t] = (v1, v2)\n if v1 > v2 and s <= n - 2:\n v1 -= a[s]\n v2 += a[s]\n s += 1\nprint(\n (\n min(\n (\n max(diff[i][0], diff[i][1], diff2[i + 1][0], diff2[i + 1][1])\n - min(diff[i][0], diff[i][1], diff2[i + 1][0], diff2[i + 1][1])\n )\n for i in range(n - 1)\n )\n )\n)\n","fast_code":"N = int(eval(input()))\nAs = list(map(int, input().split()))\nans = float(\"inf\")\niB, iD = 1, 3\n(P, Q, R), S = As[:3], sum(As[3:])\n\nfor iC in range(2, N - 1):\n while P < Q and As[iB] <= Q - P:\n P += As[iB]\n Q -= As[iB]\n iB += 1\n while R < S and As[iD] <= S - R:\n R += As[iD]\n S -= As[iD]\n iD += 1\n ans = min(ans, max(P, Q, R, S) - min(P, Q, R, S))\n Q += As[iC]\n R -= As[iC]\nprint(ans)\n"} +{"fast_code_id":"e71ff87ba6dca84fe3a97db8c3e9b502e0b0ae4a7787e5880b5247fcd12162f6","fast_id":"p02244_e71ff87ba6dca84fe3a97db8c3e9b502e0b0ae4a7787e5880b5247fcd12162f6","language":"python","measured_fast_code_id":"e71ff87ba6dca84fe3a97db8c3e9b502e0b0ae4a7787e5880b5247fcd12162f6","measured_slow_code_id":"94ec109ccd8bd9441b7a500ac9b67e1cafa7fd6c57f646835c6b0dc73a712deb","measurement_metric":"cpu_instruction_count","pair_id":"python_0282de8710beb74ce18078a8","problem_id":"p02244","slow_code_id":"94ec109ccd8bd9441b7a500ac9b67e1cafa7fd6c57f646835c6b0dc73a712deb","slow_id":"p02244_94ec109ccd8bd9441b7a500ac9b67e1cafa7fd6c57f646835c6b0dc73a712deb","speedup":3.5901314187637885,"stratum":"2-4","sampling_key":"5007df46f8d577375439387067d0755e0b4d6f01da595f29285c4a29e1386a9d","slow_code":"from functools import lru_cache\n\ncc = [[\".\" for i in range(8)] for j in range(8)]\n\n\ndef check(cc, a, b):\n ss = list(zip(*cc))\n if \"Q\" in cc[a]:\n return False\n if \"Q\" in ss[b]:\n return False\n d = []\n for i in range(8):\n for j in range(8):\n try:\n if j + abs(a - i) == b:\n d.append(cc[i][j])\n if j - abs(a - i) == b:\n d.append(cc[i][j])\n except IndexError:\n continue\n if \"Q\" in d:\n return False\n return True\n\n\ndef chess(s, queen):\n if queen == 8:\n return s\n for i in range(8):\n for j in range(8):\n if check(s, i, j):\n sol = s\n sol[i][j] = \"Q\"\n if chess(sol, queen + 1) != [[]]:\n return sol\n else:\n sol[i][j] = \".\"\n return [[]]\n\n\nk = int(eval(input()))\nfor i in range(k):\n a, b = [int(x) for x in input().split()]\n cc[a][b] = \"Q\"\nans = chess(cc, k)\nprint((\"\\n\".join(list([\"\".join(x) for x in ans]))))\n","fast_code":"import itertools\n\nN, Q, row, col = eval(input()), [], list(range(8)), list(range(8))\nfor _ in range(N):\n r, c = list(map(int, input().split()))\n Q.append((r, c))\n row.remove(r)\n col.remove(c)\nfor l in itertools.permutations(col):\n queen = Q + list(zip(row, l))\n if not any(\n any(\n (r1 != r2 or c1 != c2)\n and (r1 == r2 or c1 == c2 or r1 + c1 == r2 + c2 or r1 - c1 == r2 - c2)\n for r2, c2 in queen\n )\n for r1, c1 in queen\n ):\n print(\n \"\\n\".join(\n \"\".join(\"Q\" if (r, c) in queen else \".\" for c in range(8))\n for r in range(8)\n )\n )\n break\n"} +{"fast_code_id":"208dc3cecc011a1d6f1c280b0bd4e4eec20a113fb34fa0ea4cdd1ef8acb53ffa","fast_id":"p03078_af3938b5098d66dbd4cf352874439161a52856283bd75df5793b57e872c52749","language":"python","measured_fast_code_id":"af3938b5098d66dbd4cf352874439161a52856283bd75df5793b57e872c52749","measured_slow_code_id":"f692785f7a8045dd21b92d6003fee39b080fd64f8a8b9324756854b8f70f519a","measurement_metric":"cpu_instruction_count","pair_id":"python_034f459c2a012e26b7f6494c","problem_id":"p03078","slow_code_id":"f692785f7a8045dd21b92d6003fee39b080fd64f8a8b9324756854b8f70f519a","slow_id":"p03078_f692785f7a8045dd21b92d6003fee39b080fd64f8a8b9324756854b8f70f519a","speedup":6.143991797319184,"stratum":"4-8","sampling_key":"45025db9965ed3704bafa531e17e2c67a34062d6e7447097aa9b181c3a8ffe71","slow_code":"import heapq\n\nX, Y, Z, K = [int(i) for i in input().split(\" \")]\nA = [int(i) for i in input().split(\" \")]\nB = [int(i) for i in input().split(\" \")]\nC = [int(i) for i in input().split(\" \")]\nAB = []\nfor a in A:\n for b in B:\n AB.append(a + b)\nAB = heapq.nlargest(K, AB)\nABC = []\nfor ab in AB:\n for c in C:\n ABC.append(ab + c)\nfor cake in heapq.nlargest(K, ABC):\n print(cake)\n","fast_code":"import bisect\nimport heapq\nimport math\nimport random\nimport sys\nfrom collections import Counter, defaultdict, deque\nfrom decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal\nfrom functools import lru_cache, reduce\nfrom itertools import combinations, combinations_with_replacement, product, permutations\nfrom operator import add, mul, sub\n\nsys.setrecursionlimit(100000)\n\n\ndef read_int():\n return int(input())\n\n\ndef read_int_n():\n return list(map(int, input().split()))\n\n\ndef read_float():\n return float(input())\n\n\ndef read_float_n():\n return list(map(float, input().split()))\n\n\ndef read_str():\n return input().strip()\n\n\ndef read_str_n():\n return list(map(str, input().split()))\n\n\ndef error_print(*args):\n print(*args, file=sys.stderr)\n\n\ndef mt(f):\n import time\n\n def wrap(*args, **kwargs):\n s = time.time()\n ret = f(*args, **kwargs)\n e = time.time()\n error_print(e - s, \"sec\")\n return ret\n\n return wrap\n\n\n@mt\ndef slv(A, B, C, K):\n A.sort(reverse=True)\n B.sort(reverse=True)\n C.sort(reverse=True)\n\n def s(i, j, k):\n return A[i] + B[j] + C[k]\n\n used = set()\n cand = []\n if 1 < len(A):\n heapq.heappush(cand, (-s(1, 0, 0), (1, 0, 0)))\n used.add((1, 0, 0))\n if 1 < len(B):\n heapq.heappush(cand, (-s(0, 1, 0), (0, 1, 0)))\n used.add((0, 1, 0))\n if 1 < len(C):\n heapq.heappush(cand, (-s(0, 0, 1), (0, 0, 1)))\n used.add((0, 0, 1))\n print(s(0, 0, 0))\n for _ in range(K - 1):\n v, i = heapq.heappop(cand)\n print(-v)\n ti = (i[0] + 1, i[1], i[2])\n if ti[0] < len(A) and ti not in used:\n heapq.heappush(cand, (-s(*ti), ti))\n used.add(ti)\n ti = (i[0], i[1] + 1, i[2])\n if ti[1] < len(B) and ti not in used:\n heapq.heappush(cand, (-s(*ti), ti))\n used.add(ti)\n ti = (i[0], i[1], i[2] + 1)\n if ti[2] < len(C) and ti not in used:\n heapq.heappush(cand, (-s(*ti), ti))\n used.add(ti)\n\n\ndef main():\n\n X, Y, Z, K = read_int_n()\n A = read_int_n()\n B = read_int_n()\n C = read_int_n()\n (slv(A, B, C, K))\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"fa13dedae158b2b6ed6527a3e086a5df2ac5d3c6d9471a8e82f2aaa8f7aeef2c","fast_id":"p03722_fa13dedae158b2b6ed6527a3e086a5df2ac5d3c6d9471a8e82f2aaa8f7aeef2c","language":"python","measured_fast_code_id":"fa13dedae158b2b6ed6527a3e086a5df2ac5d3c6d9471a8e82f2aaa8f7aeef2c","measured_slow_code_id":"4fb38b2eae99e24369d07fbc9a23feb6a7609a61834c9f3f5a065cd73cb2c2ec","measurement_metric":"cpu_instruction_count","pair_id":"python_035125e71a78270b949a4708","problem_id":"p03722","slow_code_id":"4fb38b2eae99e24369d07fbc9a23feb6a7609a61834c9f3f5a065cd73cb2c2ec","slow_id":"p03722_4fb38b2eae99e24369d07fbc9a23feb6a7609a61834c9f3f5a065cd73cb2c2ec","speedup":2.4085313089817424,"stratum":"2-4","sampling_key":"b47e8cf5bf2aee166a26bf7682b4dfe7090fc9d0d6a1a0de3a48e35677980c68","slow_code":"inf = float(\"inf\")\nV, E = list(map(int, input().split()))\nedge = []\nedge_rev = []\nfor i in range(E):\n A, B, C = list(map(int, input().split()))\n edge_rev.append([B - 1, A - 1, -C])\n edge.append([A - 1, B - 1, -C])\nd = [inf] * V\nd[0] = 0\nfor i in range(V):\n update = False\n for j in range(E):\n From, To, cost = edge[j]\n if d[From] != inf and d[To] > d[From] + cost:\n d[To] = d[From] + cost\n update = True\n if not update:\n break\nd_rev = [inf] * V\nd_rev[V - 1] = 0\nfor i in range(V):\n update = False\n for j in range(E):\n From, To, cost = edge_rev[j]\n if d_rev[From] != inf and d_rev[To] > d_rev[From] + cost:\n d_rev[To] = d_rev[From] + cost\n update = True\n if not update:\n break\nd_ = [x for x in d]\nd_rev_ = [x for x in d_rev]\nfor j in range(E):\n From, To, cost = edge[j]\n if d[From] != inf and d_rev[From] != inf and d[To] > d[From] + cost:\n d[To] = d[From] + cost\nfor j in range(E):\n From, To, cost = edge_rev[j]\n if d[From] != inf and d_rev[From] != inf and d_rev[To] > d_rev[From] + cost:\n d_rev[To] = d_rev[From] + cost\nloop = False\nfor i in range(V):\n if d[i] != 0 and d_rev[i] != 0:\n loop = (d[i] + d_rev[i] != d_[i] + d_rev_[i]) or loop\nif loop:\n print(\"inf\")\nelse:\n ans = -d[-1]\n print(ans)\n","fast_code":"n, m = list(map(int, input().split()))\ne = []\nfor i in range(m):\n a, b, c = list(map(int, input().split()))\n e.append((a - 1, b - 1, c))\nmaxdis = [-float(\"inf\") for i in range(n)]\nmaxdis[0] = 0\nmugen = False\nfor i in range(n):\n for j in e:\n st, gl, cost = j\n if maxdis[gl] < maxdis[st] + cost:\n maxdis[gl] = maxdis[st] + cost\n if i >= n - 1 and (gl == n - 1):\n mugen = True\n break\nif mugen:\n print(\"inf\")\nelse:\n print((maxdis[n - 1]))\n"} +{"fast_code_id":"7a4da1a5e27719159d14135029d39a79cce2dfcc9c3b994ccca9098c6de06d1a","fast_id":"p02729_7a4da1a5e27719159d14135029d39a79cce2dfcc9c3b994ccca9098c6de06d1a","language":"python","measured_fast_code_id":"7a4da1a5e27719159d14135029d39a79cce2dfcc9c3b994ccca9098c6de06d1a","measured_slow_code_id":"d2ab7f8a064e554c2a10a6a0f691461f4c0930075a45c65fa3daeb66d602c476","measurement_metric":"cpu_instruction_count","pair_id":"python_0373176904b5e585ab2e6d0b","problem_id":"p02729","slow_code_id":"d2ab7f8a064e554c2a10a6a0f691461f4c0930075a45c65fa3daeb66d602c476","slow_id":"p02729_d2ab7f8a064e554c2a10a6a0f691461f4c0930075a45c65fa3daeb66d602c476","speedup":41.40727669190361,"stratum":"8+","sampling_key":"07db910368aaacf69f4c68606abbf6cf5d7811bc01b9fb9c90cc884a9dd85a38","slow_code":"N, M = list(map(int, input().split()))\nball_numbers = [2 * i for i in range(N)]\nball_numbers.extend([2 * i + 1 for i in range(M)])\ncount = 0\nfor i, num1 in enumerate(ball_numbers):\n for j, num2 in enumerate(ball_numbers):\n if i == j:\n continue\n if (num1 + num2) % 2 == 0:\n count += 1\nprint((count // 2))\n","fast_code":"n, m = list(map(int, input().split()))\nans = n * (n - 1) // 2 + m * (m - 1) // 2\nprint(ans)\n"} +{"fast_code_id":"7d255e94283c50458859cbe0a9333ffdc5a2133b710bbe01aba1a60e3e695ce4","fast_id":"p03448_7d255e94283c50458859cbe0a9333ffdc5a2133b710bbe01aba1a60e3e695ce4","language":"python","measured_fast_code_id":"7d255e94283c50458859cbe0a9333ffdc5a2133b710bbe01aba1a60e3e695ce4","measured_slow_code_id":"4993dfd09e6ff311b6c4ad0f7b90524cb212a96bfb4cd24c73347cba24c2f65e","measurement_metric":"cpu_instruction_count","pair_id":"python_0375919cb74781e1a183da3c","problem_id":"p03448","slow_code_id":"4993dfd09e6ff311b6c4ad0f7b90524cb212a96bfb4cd24c73347cba24c2f65e","slow_id":"p03448_4993dfd09e6ff311b6c4ad0f7b90524cb212a96bfb4cd24c73347cba24c2f65e","speedup":3.496947253137712,"stratum":"2-4","sampling_key":"0729368a7c66b1dfd78803247f91678e26c78bbe4c2f8f452c16fdc3766802bc","slow_code":"import sys\n\ninput = sys.stdin.readline\nfrom math import factorial\nfrom itertools import combinations\nfrom collections import Counter\nfrom copy import deepcopy\nfrom operator import mul\nfrom functools import reduce\n\n\ndef main():\n a = int(eval(input()))\n b = int(eval(input()))\n c = int(eval(input()))\n x = int(eval(input()))\n r = 0\n for ia in range(a + 1):\n for ib in range(min(b + 1, (x - ia * 500) // 100 + 1)):\n r += (x - ia * 500 - ib * 100) // 50 <= c\n print(r)\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"a = int(eval(input()))\nb = int(eval(input()))\nc = int(eval(input()))\nx = int(eval(input()))\nans = 0\nfor count500 in range(a + 1):\n for count100 in range(b + 1):\n value = 500 * count500 + 100 * count100\n delta = x - value\n if delta < 0:\n break\n if delta % 50 == 0 and delta // 50 <= c:\n ans += 1\nprint(ans)\n"} +{"fast_code_id":"4c89857e58e59cd5f35d76dad586a7f5f4bf79af3f4e62ebf7194c6d02e7f668","fast_id":"p03807_4c89857e58e59cd5f35d76dad586a7f5f4bf79af3f4e62ebf7194c6d02e7f668","language":"python","measured_fast_code_id":"4c89857e58e59cd5f35d76dad586a7f5f4bf79af3f4e62ebf7194c6d02e7f668","measured_slow_code_id":"8baca45625cd0c593d3689761edf66d3fece4f44f81b27a47e938cff4b898bb0","measurement_metric":"cpu_instruction_count","pair_id":"python_03f642082deef9b63fb0e9f9","problem_id":"p03807","slow_code_id":"8baca45625cd0c593d3689761edf66d3fece4f44f81b27a47e938cff4b898bb0","slow_id":"p03807_8baca45625cd0c593d3689761edf66d3fece4f44f81b27a47e938cff4b898bb0","speedup":6.006829250264732,"stratum":"4-8","sampling_key":"b9b9283117e283d7e9d8586e50c53c2a30b399a403a0f11a30cd8c54d518daf8","slow_code":"import sys\nimport bisect\nimport collections\nimport fractions\nimport heapq\n\n\ndef slove():\n input = sys.stdin.readline\n n = int(input().rstrip(\"\\n\"))\n a = list(map(int, input().rstrip(\"\\n\").split()))\n cnt = 0\n for i in range(n):\n if a[i] % 2 != 0:\n cnt += 1\n if cnt % 2 == 0:\n print(\"YES\")\n else:\n print(\"NO\")\n\n\nif __name__ == \"__main__\":\n slove()\n","fast_code":"def resolve():\n n = int(eval(input()))\n l = list(map(int, input().split()))\n if sum(l) % 2 == 0:\n print(\"YES\")\n else:\n print(\"NO\")\n\n\nresolve()\n"} +{"fast_code_id":"ddc904ed4f0cd4b39153ffc2495e7ff359f267ec09c6188344beefc9065e1ed3","fast_id":"p02406_ddc904ed4f0cd4b39153ffc2495e7ff359f267ec09c6188344beefc9065e1ed3","language":"python","measured_fast_code_id":"ddc904ed4f0cd4b39153ffc2495e7ff359f267ec09c6188344beefc9065e1ed3","measured_slow_code_id":"012cd4921cf72722b2a692888265294a12110e33c7925fc5b07a4e7cf1ad40df","measurement_metric":"cpu_instruction_count","pair_id":"python_040f72340064dc635f06ce93","problem_id":"p02406","slow_code_id":"012cd4921cf72722b2a692888265294a12110e33c7925fc5b07a4e7cf1ad40df","slow_id":"p02406_012cd4921cf72722b2a692888265294a12110e33c7925fc5b07a4e7cf1ad40df","speedup":2.208118302393059,"stratum":"2-4","sampling_key":"343ab069b17914ee3b9ff87c13861fce432b6262dfaa5295ce923885db390221","slow_code":"n = int(input())\nfor i in range(1, n + 1):\n if i % 3 == 0:\n print(\" {0}\".format(i), end=\"\")\n else:\n x = i\n while x != 0:\n if x % 10 == 3:\n print(\" {0}\".format(i), end=\"\")\n break\n x //= 10\nprint(\"\")\n","fast_code":"print(\n (\n \"\".join(\n [\n \" \" + str(i)\n for i in range(1, int(eval(input())) + 1)\n if i % 3 == 0 or \"3\" in str(i)\n ]\n )\n )\n)\n"} +{"fast_code_id":"dff44ce14f7d12b8f44c80ca5b40ce589b58599f08e672b9b8d0ee7c60c5afa0","fast_id":"p02570_dff44ce14f7d12b8f44c80ca5b40ce589b58599f08e672b9b8d0ee7c60c5afa0","language":"python","measured_fast_code_id":"dff44ce14f7d12b8f44c80ca5b40ce589b58599f08e672b9b8d0ee7c60c5afa0","measured_slow_code_id":"7df3ffb5a8416f2149c9ce5f388659f4fb80cc7488ec540c2ef41ccf0a9e9129","measurement_metric":"cpu_instruction_count","pair_id":"python_050ec8009666c4b37ba63327","problem_id":"p02570","slow_code_id":"09b0c0d43abbb6955208c35fb1cca343f1b4cbf34ced526e48c841c54fa3ed5f","slow_id":"p02570_7df3ffb5a8416f2149c9ce5f388659f4fb80cc7488ec540c2ef41ccf0a9e9129","speedup":12.396508833042345,"stratum":"8+","sampling_key":"03b46ddbcf4fdca86dc299be14b70f94c9581feb5d8365514f9ee657bc30cded","slow_code":"def LI():\n return list(map(int, input().split()))\n\n\ndef II():\n return int(input())\n\n\ndef yes():\n return print(\"Yes\")\n\n\ndef no():\n return print(\"No\")\n\n\nclass Combination:\n\n def __init__(self, n_max, mod=10**9 + 7):\n self.mod = mod\n self.modinv = self.make_modinv_list(n_max)\n self.fac, self.facinv = self.make_factorial_list(n_max)\n\n def __call__(self, n, r):\n return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n - r] % self.mod\n\n def make_factorial_list(self, n):\n\n fac = [1]\n facinv = [1]\n for i in range(1, n + 1):\n fac.append(fac[i - 1] * i % self.mod)\n facinv.append(facinv[i - 1] * self.modinv[i] % self.mod)\n return fac, facinv\n\n def make_modinv_list(self, n):\n\n modinv = [0] * (n + 1)\n modinv[1] = 1\n for i in range(2, n + 1):\n modinv[i] = self.mod - self.mod // i * modinv[self.mod % i] % self.mod\n return modinv\n\n\nclass Unionfind:\n def __init__(self, N):\n self.p = list(range(N))\n self.rank = [0] * N\n self.size = [1] * N\n\n def root(self, x):\n if self.p[x] != x:\n self.p[x] = self.root(self.p[x])\n return self.p[x]\n\n def same(self, x, y):\n return self.root(x) == self.root(y)\n\n def unite(self, x, y):\n u = self.root(x)\n v = self.root(y)\n if u == v:\n return\n if self.rank[u] < self.rank[v]:\n self.p[u] = v\n self.size[v] += self.size[u]\n self.size[u] = 0\n else:\n self.p[v] = u\n self.size[u] += self.size[v]\n self.size[v] = 0\n if self.rank[u] == self.rank[v]:\n self.rank[u] += 1\n\n def count(self, x):\n return self.size[self.root(x)]\n\n\nd, t, s = LI()\nif d <= t * s:\n yes()\nelse:\n no()\n","fast_code":"d, t, s = list(map(int, input().split()))\nif t - d / s >= 0:\n print(\"Yes\")\nelse:\n print(\"No\")\n"} +{"fast_code_id":"4707c919ec02af3dbc389bd90c0f4823687b18f28fa6bd8e7a1af1a5cf54468b","fast_id":"p02990_4707c919ec02af3dbc389bd90c0f4823687b18f28fa6bd8e7a1af1a5cf54468b","language":"python","measured_fast_code_id":"4707c919ec02af3dbc389bd90c0f4823687b18f28fa6bd8e7a1af1a5cf54468b","measured_slow_code_id":"7a2b64f231360106a08f636ee2208fefd03a0a70e2030ab961e1b329fc022332","measurement_metric":"cpu_instruction_count","pair_id":"python_050f2cec2405b52a56ef5a58","problem_id":"p02990","slow_code_id":"7a2b64f231360106a08f636ee2208fefd03a0a70e2030ab961e1b329fc022332","slow_id":"p02990_7a2b64f231360106a08f636ee2208fefd03a0a70e2030ab961e1b329fc022332","speedup":1058.0881722765237,"stratum":"8+","sampling_key":"4dacbdf4893c2f7ff2b16ed0e76a04df791f7ee6505868da6ca4f41217f94864","slow_code":"N_MAX = 10**6\nMOD = 10**9 + 7\nfac, finv, inv = [0] * N_MAX, [0] * N_MAX, [0] * N_MAX\n\n\ndef com_init():\n fac[0], fac[1] = 1, 1\n finv[0], finv[1] = 1, 1\n inv[1] = 1\n for i in range(2, N_MAX):\n fac[i] = fac[i - 1] * i % MOD\n inv[i] = MOD - inv[MOD % i] * (MOD // i) % MOD\n finv[i] = finv[i - 1] * inv[i] % MOD\n\n\ndef com(n, k):\n if n < k:\n return 0\n if n < 0 or k < 0:\n return 0\n return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD\n\n\nn, k = list(map(int, input().split()))\nr = n - k\ncom_init()\nfor i in range(1, k + 1):\n ans = 0\n bi = com(k + i - 1 - i, i - 1)\n if i == 1:\n if r == 0:\n ri_m1 = 1\n else:\n ri_m1 = 0\n else:\n ri_m1 = com(r + i - 2 - (i - 1), i - 2)\n ri = com(r + i - 1 - i, i - 1) if r >= i else 0\n ri_p1 = com(r + i - (i + 1), i) if r >= i + 1 else 0\n ans += bi * ri_m1\n ans += bi * ri * 2\n ans += bi * ri_p1\n ans %= MOD\n print(ans)\n","fast_code":"n, k = list(map(int, input().split()))\nm = 10**9 + 7\nb = 1\nr = n - k + 1\nprint((b * r % m))\nfor i in range(2, k + 1):\n b *= k - i + 1\n b //= i - 1\n r *= n - k - i + 2\n r //= i\n print((b * r % m))\n"} +{"fast_code_id":"fa7a1b916f20adbde0637ad94f0c364d62e556c10039f6a74be0259675794db4","fast_id":"p03767_fa7a1b916f20adbde0637ad94f0c364d62e556c10039f6a74be0259675794db4","language":"python","measured_fast_code_id":"fa7a1b916f20adbde0637ad94f0c364d62e556c10039f6a74be0259675794db4","measured_slow_code_id":"7693ad55686e6fd618fa19be5402464b2c1d8a6534c46b08c3072eed6c243853","measurement_metric":"cpu_instruction_count","pair_id":"python_0531df1894d11f4a5d5cc999","problem_id":"p03767","slow_code_id":"7693ad55686e6fd618fa19be5402464b2c1d8a6534c46b08c3072eed6c243853","slow_id":"p03767_7693ad55686e6fd618fa19be5402464b2c1d8a6534c46b08c3072eed6c243853","speedup":6.595913346447832,"stratum":"4-8","sampling_key":"64fbd75647df23da2fe44f5e21c140a416d1bb2e43307cb10ab7af527ea74d02","slow_code":"from collections import Counter, defaultdict, deque\nfrom heapq import heappop, heappush, heapify\nimport sys, bisect, math, itertools, fractions, pprint\n\nsys.setrecursionlimit(10**8)\nmod = 10**9 + 7\nINF = float(\"inf\")\n\n\ndef inp():\n return int(sys.stdin.readline())\n\n\ndef inpl():\n return list(map(int, sys.stdin.readline().split()))\n\n\nn = inp()\na = inpl()\na.sort(reverse=True)\ncnt = n\nind = 0\nres = 0\nwhile cnt:\n if ind % 2:\n res += a[ind]\n cnt -= 1\n ind += 1\nprint(res)\n","fast_code":"N = int(eval(input()))\nprint((sum(sorted(map(int, input().split()))[N : 3 * N : 2])))\n"} +{"fast_code_id":"b9b377895112e4c99f6470ef8bdf76c96f8f88338618602457f984055da5d8d7","fast_id":"p02848_b9b377895112e4c99f6470ef8bdf76c96f8f88338618602457f984055da5d8d7","language":"python","measured_fast_code_id":"b9b377895112e4c99f6470ef8bdf76c96f8f88338618602457f984055da5d8d7","measured_slow_code_id":"28ec796f8eb56af2fabfccd11148299be75fe687af7fbeca1341511e952857a1","measurement_metric":"cpu_instruction_count","pair_id":"python_058c833aa22670ca94573273","problem_id":"p02848","slow_code_id":"4e03a4428b1aa0327e66a8cb999ff15a637eaad3acbd2fd2d565e47714f697dd","slow_id":"p02848_28ec796f8eb56af2fabfccd11148299be75fe687af7fbeca1341511e952857a1","speedup":7.212410780018643,"stratum":"4-8","sampling_key":"b9d065a3c4caa8045a2d540aa32946d9001c61551d1e7150f85f2322c9f6a6bb","slow_code":"import sys\nimport math\nimport collections\nimport itertools\nfrom inspect import currentframe\n\nINF = 10**10\nMOD = 10**9 + 7\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef gcd(x, y):\n return y if x % y == 0 else gcd(y, x % y)\n\n\ndef lcm(x, y):\n return (x * y) // gcd(x, y)\n\n\ndef I():\n return int(input())\n\n\ndef MI():\n return map(int, input().split())\n\n\ndef LI():\n return [int(x) for x in input().split()]\n\n\ndef RI(N):\n return [int(input()) for _ in range(N)]\n\n\ndef LRI(N):\n return [[int(x) for x in input().split()] for _ in range(N)]\n\n\ndef chkprint(*args):\n names = {id(v): k for k, v in currentframe().f_back.f_locals.items()}\n print(\", \".join(names.get(id(arg), \"???\") + \" = \" + repr(arg) for arg in args))\n\n\nN = I()\nS = input()\nalp = [\n \"A\",\n \"B\",\n \"C\",\n \"D\",\n \"E\",\n \"F\",\n \"G\",\n \"H\",\n \"I\",\n \"J\",\n \"K\",\n \"L\",\n \"M\",\n \"N\",\n \"O\",\n \"P\",\n \"Q\",\n \"R\",\n \"S\",\n \"T\",\n \"U\",\n \"V\",\n \"W\",\n \"X\",\n \"Y\",\n \"Z\",\n]\nfor s in S:\n print(alp[(alp.index(s) + N) % 26], end=\"\")\n","fast_code":"s = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\nn = int(input())\nx = input()\na = ord(\"A\")\nprint(\"\".join([s[(ord(c) - a + n) % 26] for c in x]))\n"} +{"fast_code_id":"889417474baadfa9b363430b098a8455a8cfa285e106d991961115f60ea60f80","fast_id":"p03722_889417474baadfa9b363430b098a8455a8cfa285e106d991961115f60ea60f80","language":"python","measured_fast_code_id":"889417474baadfa9b363430b098a8455a8cfa285e106d991961115f60ea60f80","measured_slow_code_id":"093486d8bf1bade74d0f7f3e71a354e24ef56e72b4374c89214f326ef468df33","measurement_metric":"cpu_instruction_count","pair_id":"python_060ec2e6deb1f5813f3f5846","problem_id":"p03722","slow_code_id":"92422ed6fb877fc678246d4b0dc0afea655ea5fbeb5e6aea37d1962e1b39f169","slow_id":"p03722_093486d8bf1bade74d0f7f3e71a354e24ef56e72b4374c89214f326ef468df33","speedup":2.2401740877096272,"stratum":"2-4","sampling_key":"8d1a6f68da3e6219e7fab105e4942cd3bd642444f45539333c1fccc6a03ef5ce","slow_code":"n, m = list(map(int, input().split()))\nA = [list(map(int, input().split())) for i in range(m)]\nfor i in range(m):\n A[i][2] = -A[i][2]\nP = [float(\"inf\")] * (n + 1)\nP[1] = 0\nF = [[0] * 2 for i in range(n + 1)]\nF[1][0] = 1\nF[n][1] = 1\nfor i in range(n):\n for j in range(m):\n if F[A[j][0]][0] == 1:\n F[A[j][1]][0] = 1\n if F[A[j][1]][1] == 1:\n F[A[j][0]][1] = 1\n P[A[j][1]] = min(P[A[j][1]], P[A[j][0]] + A[j][2])\nans0 = P[:]\nfor i in range(n):\n for j in range(m):\n if F[A[j][0]][0] == 1:\n F[A[j][1]][0] = 1\n if F[A[j][1]][1] == 1:\n F[A[j][0]][1] = 1\n P[A[j][1]] = min(P[A[j][1]], P[A[j][0]] + A[j][2])\nans1 = P[:]\n\n\ndef d():\n for i in range(n + 1):\n if F[i] == [1, 1] and ans1[i] < ans0[i]:\n return \"inf\"\n return -ans0[n]\n\n\nprint((d()))\n","fast_code":"from collections import defaultdict\n\nN, M, *L = list(map(int, open(0).read().split()))\ndic = defaultdict(list)\nrdic = defaultdict(list)\nnin = [0] * N\nEls = []\nfor a, b, c in zip(*[iter(L)] * 3):\n dic[a - 1] += [b - 1]\n rdic[b - 1] += [a - 1]\n nin[b - 1] += 1\n Els += [(a - 1, b - 1, -c)]\nTo = [False] * N\nFrom = [False] * N\nq = [0]\nTo[0] = True\nwhile q:\n p = q.pop()\n for e in dic[p]:\n if To[e] == False:\n To[e] = True\n q += [e]\nq = [N - 1]\nFrom[N - 1] = True\nwhile q:\n p = q.pop()\n for e in rdic[p]:\n if From[e] == False:\n From[e] = True\n q += [e]\nok = [False] * N\nfor i in range(N):\n ok[i] = To[i] & From[i]\ncnt = 0\ndist = [float(\"inf\")] * N\ndist[0] = 0\ncnt = 0\nflag = False\nwhile True:\n update = True\n for a, b, c in Els:\n if not (ok[a] and ok[b]):\n continue\n if dist[a] != float(\"inf\") and dist[b] > dist[a] + c:\n dist[b] = dist[a] + c\n update = False\n if update:\n break\n cnt += 1\n if cnt > 2 * N:\n flag = True\n break\nif flag:\n print(\"inf\")\nelif dist[N - 1] == float(\"inf\"):\n print(\"inf\")\nelse:\n print((-dist[N - 1]))\n"} +{"fast_code_id":"811904fe07085f5240fa41ae878883738dacd02f328e19ebb95946927e9c2829","fast_id":"p03221_811904fe07085f5240fa41ae878883738dacd02f328e19ebb95946927e9c2829","language":"python","measured_fast_code_id":"811904fe07085f5240fa41ae878883738dacd02f328e19ebb95946927e9c2829","measured_slow_code_id":"bac932e565fc824f54938c4edcf17024edb8ebfd73deb80882c8006e56a416b6","measurement_metric":"cpu_instruction_count","pair_id":"python_063cd86c049ec3bce7600728","problem_id":"p03221","slow_code_id":"9a9b5b8d60f2f6a437fd75f31baba74dc5ed7ac13071d840e26b691e2ff91cac","slow_id":"p03221_bac932e565fc824f54938c4edcf17024edb8ebfd73deb80882c8006e56a416b6","speedup":6.748784949525597,"stratum":"4-8","sampling_key":"0618b97ca4d2ba411789883ed23fb95729ce7a26518b570feebef535aca32e95","slow_code":"N, M = list(map(int, input().split()))\nP = []\nY = []\narr = [[] for j in range(10**5 + 1)]\nfor i in range(M):\n listA = list(map(int, input().split()))\n P.append(listA[0])\n Y.append(listA[1])\n arr[listA[0]].append(listA[1])\nfor i in range(N + 1):\n arr[i].sort()\nfor i in range(M):\n\n left = 0\n right = len(arr[P[i]]) - 1\n while left <= right:\n mid = (left + right) // 2\n if arr[P[i]][mid] == Y[i]:\n k = mid\n break\n elif arr[P[i]][mid] > Y[i]:\n right = mid - 1\n else:\n left = mid + 1\n print((str(P[i]).rjust(6, \"0\") + str(k + 1).rjust(6, \"0\")))\n","fast_code":"N, M = list(map(int, input().split()))\npref = [[0] for i in range(N + 1)]\nq = []\nfor i in range(M):\n p, y = list(map(int, input().split()))\n pref[p].append(y)\n q.append([p, y])\nfor p in pref:\n p.sort()\nimport bisect\n\nfor p, y in q:\n print((\"%06d%06d\" % (p, bisect.bisect_left(pref[p], y))))\n"} +{"fast_code_id":"72619107eb329b54610e4085498f85cee6d80295e93784b7b4dded26629f06a8","fast_id":"p02712_72619107eb329b54610e4085498f85cee6d80295e93784b7b4dded26629f06a8","language":"python","measured_fast_code_id":"72619107eb329b54610e4085498f85cee6d80295e93784b7b4dded26629f06a8","measured_slow_code_id":"f910f1b85b0418dda3aa063e8ab589070f47ebfbee439171e431fb7188b5cd6d","measurement_metric":"cpu_instruction_count","pair_id":"python_07023f1e67cd9449866af500","problem_id":"p02712","slow_code_id":"f910f1b85b0418dda3aa063e8ab589070f47ebfbee439171e431fb7188b5cd6d","slow_id":"p02712_f910f1b85b0418dda3aa063e8ab589070f47ebfbee439171e431fb7188b5cd6d","speedup":393.31606115212577,"stratum":"8+","sampling_key":"075a020d7cda55e83849cfd98463a10f04c062ed3c99f399b94ed25c3cc2d156","slow_code":"N = int(eval(input()))\nsum = 0\nfor i in range(1, N + 1):\n if i % 3 == 0:\n continue\n elif i % 5 == 0:\n continue\n else:\n sum += i\nprint(sum)\n","fast_code":"N = int(eval(input()))\ntotal = int(1 / 2 * N * (N + 1))\nwa3 = (N // 3 * (N // 3 + 1)) // 2 * 3\nwa5 = (N // 5 * (N // 5 + 1)) // 2 * 5\nwa15 = (N // 15 * (N // 15 + 1)) // 2 * 15\nprint((total - wa3 - wa5 + wa15))\n"} +{"fast_code_id":"7036b1338b05c45feb569394cc5f3c4ece7b1ae9595ac7db105a43381e049624","fast_id":"p02709_7036b1338b05c45feb569394cc5f3c4ece7b1ae9595ac7db105a43381e049624","language":"python","measured_fast_code_id":"7036b1338b05c45feb569394cc5f3c4ece7b1ae9595ac7db105a43381e049624","measured_slow_code_id":"3d838e07742b6038959605af2d3df1f36b7399126fc563b9a2c8f3bce236aaea","measurement_metric":"cpu_instruction_count","pair_id":"python_071eb3bf37dcd3d563dde8e9","problem_id":"p02709","slow_code_id":"aa98af4784f39634c1b1369b22ff40f05d4ea9461af1aad5cd1db169f1d8c6f4","slow_id":"p02709_3d838e07742b6038959605af2d3df1f36b7399126fc563b9a2c8f3bce236aaea","speedup":9.807294863749936,"stratum":"8+","sampling_key":"15a5ec6591e267faaba409d7209a9ed8a7b28afb3821d6867ade995a70b03360","slow_code":"import sys\nimport numpy as np\n\n\ndef f(n, a_):\n a = []\n for i, ai in enumerate(a_):\n a.append([1 + i, ai])\n a.sort(key=lambda x: x[1], reverse=True)\n dp = np.zeros((n + 1, n + 1), np.int64)\n dp[1, 1] = a[0][1] * (n - a[0][0])\n dp[1, 0] = a[0][1] * (a[0][0] - 1)\n for i in range(2, n + 1):\n dp[i, 0] = dp[i - 1, 0] + a[i - 1][1] * abs((a[i - 1][0] - 1 - (i - 1)))\n dp[i, i] = dp[i - 1, i - 1] + a[i - 1][1] * abs((n - a[i - 1][0] - (i - 1)))\n\n l = dp[i - 1, 1:i] + [\n a[i - 1][1] * abs((a[i - 1][0] - 1 - j)) for j in range(i - 2, -1, -1)\n ]\n\n r = dp[i - 1, : i - 1] + [\n a[i - 1][1] * abs((n - a[i - 1][0] - j)) for j in range(i - 1)\n ]\n dp[i, 1:i] = np.maximum(l, r)\n return max(dp[n])\n\n\nif __name__ == \"__main__\":\n input = sys.stdin.readline\n n = int(eval(input()))\n a_ = list(map(int, input().split()))\n print((f(n, a_)))\n","fast_code":"N = int(eval(input()))\nD = []\nfor i, a in enumerate(map(int, input().split())):\n D.append((a << 11) + i)\nD.sort(reverse=True)\ndp = [0] * (N + 1)\nfor i, d in enumerate(D, start=1):\n x, a = d % (1 << 11), d >> 11\n for j in reversed(list(range(0, i + 1))):\n dp[j] = max(\n (dp[j - 1] + a * (x - (j - 1))) * (j - 1 >= 0),\n (dp[j] + a * (N - (i - j) - x)) * (j <= i - 1),\n )\nprint((max(dp)))\n"} +{"fast_code_id":"6074ba0c982fad312b2df046a843d0a175b8e58f995ed0ecc5dc4de0110c1ff0","fast_id":"p03997_6074ba0c982fad312b2df046a843d0a175b8e58f995ed0ecc5dc4de0110c1ff0","language":"python","measured_fast_code_id":"6074ba0c982fad312b2df046a843d0a175b8e58f995ed0ecc5dc4de0110c1ff0","measured_slow_code_id":"129dfa97cf673053bafcd5386b6c9bb8fa560bfcf12b57413a4401ec172217cc","measurement_metric":"cpu_instruction_count","pair_id":"python_073e0d81f8cbff26b6b82cfd","problem_id":"p03997","slow_code_id":"a0278d8d61cb13b55d2cf50ffbda8d5966ed6ff493506f6257fe60d5b1e9f259","slow_id":"p03997_129dfa97cf673053bafcd5386b6c9bb8fa560bfcf12b57413a4401ec172217cc","speedup":18.94824235989704,"stratum":"8+","sampling_key":"00d79da902d6d00a0884d0ae2dc98f93ea2f6d106aeabd751dcc6d6dc0fb5229","slow_code":"from collections import deque\nfrom heapq import heapify, heappop, heappush, heappushpop\nfrom copy import copy, deepcopy\nfrom itertools import product, permutations, combinations, combinations_with_replacement\nfrom collections import defaultdict, Counter\nfrom bisect import bisect_left, bisect_right\n\n\nfrom functools import reduce\nfrom pprint import pprint\n\nINF = float(\"inf\")\n\n\ndef myinput():\n return list(map(int, input().split()))\n\n\ndef mylistinput(n):\n return [list(myinput()) for _ in range(n)]\n\n\ndef mycol(data, col):\n return [row[col] for row in data]\n\n\ndef mysort(data, col, reverse_flag):\n data.sort(key=lambda x: x[col], reverse=reverse_flag)\n return data\n\n\ndef mymax(data):\n M = -1 * float(\"inf\")\n for i in range(len(data)):\n m = max(data[i])\n M = max(M, m)\n return M\n\n\ndef mymin(data):\n m = float(\"inf\")\n for i in range(len(data)):\n M = min(data[i])\n m = min(m, M)\n return m\n\n\ndef mycount(ls, x):\n\n l = bisect_left(ls, x)\n r = bisect_right(ls, x)\n return r - l\n\n\ndef myoutput(ls, space=True):\n if space:\n if len(ls) == 0:\n print(\" \")\n elif type(ls[0]) == str:\n print((\" \".join(ls)))\n elif type(ls[0]) == int:\n print((\" \".join(map(str, ls))))\n else:\n print(\"Output Error\")\n else:\n if len(ls) == 0:\n print(\"\")\n elif type(ls[0]) == str:\n print((\"\".join(ls)))\n elif type(ls[0]) == int:\n print((\"\".join(map(str, ls))))\n else:\n print(\"Output Error\")\n\n\ndef I():\n return int(eval(input()))\n\n\ndef MI():\n return list(map(int, input().split()))\n\n\ndef RI():\n return list(map(int, input().split()))\n\n\ndef CI(n):\n return [int(eval(input())) for _ in range(n)]\n\n\ndef LI(n):\n return [list(map(int, input().split())) for _ in range(n)]\n\n\ndef S():\n return eval(input())\n\n\ndef MS():\n return input().split()\n\n\ndef RS():\n return list(input().split())\n\n\ndef CS(n):\n return [eval(input()) for _ in range(n)]\n\n\ndef LS(n):\n return [list(input().split()) for _ in range(n)]\n\n\na = I()\nb = I()\nh = I()\nans = (a + b) * h // 2\nprint(ans)\n","fast_code":"a, b, h = list(map(int, [eval(input()) for i in range(3)]))\nprint((h * (a + b) // 2))\n"} +{"fast_code_id":"f12ae9ee0fe0a21a9752eb3c25a2c761603a290e082735bb14fdd097acf25026","fast_id":"p02792_f12ae9ee0fe0a21a9752eb3c25a2c761603a290e082735bb14fdd097acf25026","language":"python","measured_fast_code_id":"f12ae9ee0fe0a21a9752eb3c25a2c761603a290e082735bb14fdd097acf25026","measured_slow_code_id":"2e02d2845efb9f787514b31c173a608442fd55765532739847b63fd3580a333f","measurement_metric":"cpu_instruction_count","pair_id":"python_07771db843ac37acf004debb","problem_id":"p02792","slow_code_id":"2e02d2845efb9f787514b31c173a608442fd55765532739847b63fd3580a333f","slow_id":"p02792_2e02d2845efb9f787514b31c173a608442fd55765532739847b63fd3580a333f","speedup":4.435938492572608,"stratum":"4-8","sampling_key":"5317c5faca7418e62f5ef81cd9ec46ac319522cb251b1e8397f6babd6ef4773b","slow_code":"N = int(eval(input()))\ndigit = len(str(N))\nans = 0\nfor a in range(1, 10):\n for b in range(1, 10):\n x, y = 0, 0\n if a == b:\n if a <= N:\n x += 1\n y += 1\n if a * 10 + b <= N:\n x += 1\n if b * 10 + a <= N:\n y += 1\n if digit <= 2:\n ans += x * y\n continue\n d = 3\n while d < digit:\n x += 10 ** (d - 2)\n y += 10 ** (d - 2)\n d += 1\n for i in range(10 ** (digit - 2)):\n if int(str(a) + str(i).zfill(digit - 2) + str(b)) <= N:\n x += 1\n if int(str(b) + str(i).zfill(digit - 2) + str(a)) <= N:\n y += 1\n ans += x * y\nprint(ans)\n","fast_code":"n = int(eval(input()))\nC = [[0] * 10 for _ in range(10)]\nfor i in range(1, n + 1):\n C[int(str(i)[0])][i % 10] += 1\nans = 0\nfor i in range(10):\n for j in range(10):\n ans += C[i][j] * C[j][i]\nprint(ans)\n"} +{"fast_code_id":"36efa31a817599454e47c950d8405cd8170cd3f67b1b12f911d115f29e6e8467","fast_id":"p00028_36efa31a817599454e47c950d8405cd8170cd3f67b1b12f911d115f29e6e8467","language":"python","measured_fast_code_id":"36efa31a817599454e47c950d8405cd8170cd3f67b1b12f911d115f29e6e8467","measured_slow_code_id":"5902dceff8fd61e2ba9dfa4b6b3d678a880e0a0c266dff8f9d7965251806e14b","measurement_metric":"cpu_instruction_count","pair_id":"python_08059695714d471d8cdaefc3","problem_id":"p00028","slow_code_id":"5902dceff8fd61e2ba9dfa4b6b3d678a880e0a0c266dff8f9d7965251806e14b","slow_id":"p00028_5902dceff8fd61e2ba9dfa4b6b3d678a880e0a0c266dff8f9d7965251806e14b","speedup":3.689504258301959,"stratum":"2-4","sampling_key":"38bcb9719cec64d1565fcab30a751fb0b91cf5082a25f5476e225ad8b94e7393","slow_code":"d = [0 for i in range(101)]\nwhile True:\n try:\n n = eval(input())\n d[n] += 1\n except:\n break\nfor e in [i for i, e in enumerate(d) if e == max(d)]:\n print(e)\n","fast_code":"d = {}\ntry:\n while True:\n n = int(input())\n if n in d:\n d[n] += 1\n else:\n d[n] = 1\nexcept EOFError:\n pass\na = []\nm = max(d.values())\nfor key, value in list(d.items()):\n if value == m:\n a.append(key)\na.sort()\nfor i in a:\n print(i)\n"} +{"fast_code_id":"2d8057a8593c6890611cb12de17b230598b8581555985c155063c3a54394e014","fast_id":"p03593_c177b5b6b9f30c7fd56c170eb12163023c6db1c8a97b734e471c2fc91733f649","language":"python","measured_fast_code_id":"c177b5b6b9f30c7fd56c170eb12163023c6db1c8a97b734e471c2fc91733f649","measured_slow_code_id":"2669f1bac8b8659463194324a59012de5ef4bcedae5fa2d42d20fa1c7e412b52","measurement_metric":"cpu_instruction_count","pair_id":"python_088a6d0ecf0d2fa6e58c24a7","problem_id":"p03593","slow_code_id":"2669f1bac8b8659463194324a59012de5ef4bcedae5fa2d42d20fa1c7e412b52","slow_id":"p03593_2669f1bac8b8659463194324a59012de5ef4bcedae5fa2d42d20fa1c7e412b52","speedup":2.446522509489532,"stratum":"2-4","sampling_key":"5e25a6631282feaa8c7bde2ec6962b0a27dbd431382b0bfeffb2b6c1744d3e82","slow_code":"import sys\n\nstdin = sys.stdin\nsys.setrecursionlimit(10**7)\n\n\ndef li():\n return list(map(int, stdin.readline().split()))\n\n\ndef li_():\n return [int(x) - 1 for x in stdin.readline().split()]\n\n\ndef lf():\n return list(map(float, stdin.readline().split()))\n\n\ndef ls():\n return stdin.readline().split()\n\n\ndef ns():\n return stdin.readline().rstrip()\n\n\ndef lc():\n return list(ns())\n\n\ndef ni():\n return int(stdin.readline())\n\n\ndef nf():\n return float(stdin.readline())\n\n\nfrom collections import defaultdict\n\n\ndef judge(cnts, h, w):\n odd_cnt = 0\n mod4_2_cnt = 0\n mod4_0_cnt = 0\n for key, val in list(cnts.items()):\n if val % 2 == 1:\n odd_cnt += 1\n elif val % 4 == 2:\n mod4_2_cnt += 1\n else:\n mod4_0_cnt += 1\n if h == 1 and w == 1:\n return True\n elif h == 1:\n if w % 2 == 1:\n return True if odd_cnt == 1 else False\n else:\n return True if odd_cnt == 0 else False\n elif w == 1:\n if h % 2 == 1:\n return True if odd_cnt == 1 else False\n else:\n return True if odd_cnt == 0 else False\n elif h % 2 == 1 and w % 2 == 1:\n return True if mod4_2_cnt == (w // 2 + h // 2) and odd_cnt == 1 else False\n elif h % 2 == 1:\n return True if mod4_2_cnt == (w // 2) and odd_cnt == 0 else False\n elif w % 2 == 1:\n return True if mod4_2_cnt == (h // 2) and odd_cnt == 0 else False\n else:\n return True if mod4_2_cnt == 0 and odd_cnt == 0 else False\n\n\nh, w = li()\na = [ns() for _ in range(h)]\nchar_cnt = defaultdict(int)\nfor ai in a:\n for aij in ai:\n char_cnt[aij] += 1\nprint((\"Yes\" if judge(char_cnt, h, w) else \"No\"))\n","fast_code":"from collections import Counter\n\n\ndef main():\n H, W, *A = open(0).read().split()\n H, W, C = int(H), int(W), list(Counter(\"\".join(A)).values())\n single = H & W & 1\n double = (H >> 1 if W & 1 else 0) + (W >> 1 if H & 1 else 0)\n C_mod4, C_div4 = list(zip(*[(i % 4, i // 4) for i in C]))\n flg = C_mod4.count(1) + C_mod4.count(3) <= single and C_mod4.count(2) <= double\n print((\"Yes\" if flg else \"No\"))\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"eb1c7b97d9d3a8c9eca9b0830b135adad08e0a4fc9c6b9be9c34fae14d6187fb","fast_id":"p02821_eb1c7b97d9d3a8c9eca9b0830b135adad08e0a4fc9c6b9be9c34fae14d6187fb","language":"python","measured_fast_code_id":"eb1c7b97d9d3a8c9eca9b0830b135adad08e0a4fc9c6b9be9c34fae14d6187fb","measured_slow_code_id":"5ea8b03b7686b727a5ada84b1cdc937732e7bfa264aa07688bbf2a3aa7ffee27","measurement_metric":"cpu_instruction_count","pair_id":"python_08933a4186b7c1ba15331209","problem_id":"p02821","slow_code_id":"d9a82d12a17bf2dfec0ab63e3f7212411f504feff565579c06a101fde21c2576","slow_id":"p02821_5ea8b03b7686b727a5ada84b1cdc937732e7bfa264aa07688bbf2a3aa7ffee27","speedup":5.599020327612192,"stratum":"4-8","sampling_key":"3c5395bd064cfde6c55ddb3a196090c4dcb68222580a58b124c4f474359e51b6","slow_code":"N, M = list(map(int, input().split()))\nA = list(map(int, input().split()))\nA.sort(reverse=True)\nLB = A[-1] * 2\nUB = A[0] * 2\n\ncgs = [0] * (UB + 1)\nfor a in A:\n cgs[a] += 1\nfor i in range(UB, 0, -1):\n cgs[i - 1] += cgs[i]\n\n\ndef is_ok(n):\n m = 0\n for a in A:\n m += cgs[max(n - a, 0)]\n return m >= M\n\n\nok = LB\nng = UB + 1\nwhile ng - ok > 1:\n m = (ok + ng) // 2\n if is_ok(m):\n ok = m\n else:\n ng = m\n\ncps = A[:]\nfor i in range(1, N):\n cps[i] += cps[i - 1]\nresult = 0\nfor a in A:\n t = cgs[max(ok - a, 0)]\n if t != 0:\n result += a * t + cps[t - 1]\n M -= t\nresult += ok * M\nprint(result)\n","fast_code":"from bisect import bisect_left as bisect\n\nN, M = list(map(int, input().split()))\nA = list(map(int, input().split()))\nA.sort()\n\n\ndef combination(X):\n res = 0\n for i in range(N):\n j = bisect(A, X - A[i])\n res += N - j\n return res\n\n\nl = 0\nr = 2 * 10**5 + 1\nm = (l + r) // 2\nfor i in range(20):\n c = combination(m)\n if c < M:\n r = m\n else:\n l = m\n m = (l + r) // 2\nif combination(m) >= M:\n m += 1\nS = [0] * (N + 1)\nfor i in range(N):\n S[i] = S[i - 1] + A[i]\nans = 0\nfor i in range(N):\n j = bisect(A, m - A[i])\n ans += A[i] * (N - j)\n ans += S[N - 1] - S[j - 1]\nans += (M - combination(m)) * (m - 1)\nprint(ans)\n"} +{"fast_code_id":"5330746bf5083da4425395b0af3721b5134d290d8ab456ea3489eeb7c223264d","fast_id":"p03713_5330746bf5083da4425395b0af3721b5134d290d8ab456ea3489eeb7c223264d","language":"python","measured_fast_code_id":"5330746bf5083da4425395b0af3721b5134d290d8ab456ea3489eeb7c223264d","measured_slow_code_id":"486c400a4361520abbeb93fc3ee51b4996c6be1073529f0538f4921c991bd1de","measurement_metric":"cpu_instruction_count","pair_id":"python_08f5caa0530acc9eb32c1422","problem_id":"p03713","slow_code_id":"486c400a4361520abbeb93fc3ee51b4996c6be1073529f0538f4921c991bd1de","slow_id":"p03713_486c400a4361520abbeb93fc3ee51b4996c6be1073529f0538f4921c991bd1de","speedup":848.4628839949457,"stratum":"8+","sampling_key":"066469048abcdc9d48c89f00b06c39ad9400848e2709a9256546d205f5ad0f2b","slow_code":"def min_value(w, h):\n ans = float(\"inf\")\n for i in range(1, h):\n a = w * i\n v_t = (h - i) // 2 * w\n v_b = (h - i) * w - v_t\n v_re = max(a, v_t, v_b) - min(a, v_t, v_b)\n h_l = (h - i) * (w // 2)\n h_r = (h - i) * w - h_l\n h_re = max(a, h_l, h_r) - min(a, h_l, h_r)\n ans = min(ans, v_re, h_re)\n return ans\n\n\ndef resolve():\n h, w = list(map(int, input().split()))\n a = min_value(w, h)\n b = min_value(h, w)\n print((min(a, b)))\n\n\nresolve()\n","fast_code":"h, w = list(map(int, input().split()))\nif h % 3 == 0 or w % 3 == 0:\n print((0))\nelse:\n a = (h // 3 + 1) * w - (h - 1 - h // 3) * (w // 2)\n b = (h - h // 3) * (w - w // 2) - h // 3 * w\n c = min(h, w)\n h, w = w, h\n d = (h // 3 + 1) * w - (h - 1 - h // 3) * (w // 2)\n e = (h - h // 3) * (w - w // 2) - h // 3 * w\n print((min(a, b, c, d, e)))\n"} +{"fast_code_id":"94ec109ccd8bd9441b7a500ac9b67e1cafa7fd6c57f646835c6b0dc73a712deb","fast_id":"p02244_94ec109ccd8bd9441b7a500ac9b67e1cafa7fd6c57f646835c6b0dc73a712deb","language":"python","measured_fast_code_id":"94ec109ccd8bd9441b7a500ac9b67e1cafa7fd6c57f646835c6b0dc73a712deb","measured_slow_code_id":"948cc92d89bed81c02042017d831a1b4230626416de2f1f0f39fed2233e48434","measurement_metric":"cpu_instruction_count","pair_id":"python_090dec55b0c130c7a5116077","problem_id":"p02244","slow_code_id":"948cc92d89bed81c02042017d831a1b4230626416de2f1f0f39fed2233e48434","slow_id":"p02244_948cc92d89bed81c02042017d831a1b4230626416de2f1f0f39fed2233e48434","speedup":2.662280402456435,"stratum":"2-4","sampling_key":"9fe932a179d31984eaff650b066f7b8bb25d556d19930e30ed6309719a1ec021","slow_code":"from itertools import product\nfrom copy import deepcopy, copy\n\n\nclass QueenMAP:\n def __init__(self):\n self.yoko = set()\n self.tate = set()\n self.naname1 = set()\n self.naname2 = set()\n self.MAP = [[\".\"] * 8 for _ in range(8)]\n\n def add(self, y, x):\n self.MAP[y][x] = \"Q\"\n self.yoko.add(y)\n self.tate.add(x)\n self.naname1.add(y - x)\n self.naname2.add(x + y)\n\n def check(self, y, x):\n if (\n y in self.yoko\n or x in self.tate\n or (y - x) in self.naname1\n or (x + y) in self.naname2\n ):\n return False\n return True\n\n def allcheck(self):\n for i in range(8):\n if not \"Q\" in self.MAP[i]:\n return False\n return True\n\n\ndef nuri(m, a, b):\n for i in range(8):\n m[a][i] = \"1\"\n m[i][b] = \"1\"\n if a + b < 8:\n y = a + b\n x = 0\n l = a + b + 1\n else:\n y = 7\n x = a + b - 7\n l = 15 - a - b\n for i in range(l):\n m[y - i][x + i] = \"1\"\n if a <= b:\n ny = 0\n nx = b - a\n l = 8 - (b + a)\n else:\n ny = a - b\n nx = 0\n l = 8 - (a - b)\n for i in range(l):\n m[ny + i][nx + i] = \"1\"\n return m\n\n\ndef solve(MAP0, MAP, n):\n dp = [(deepcopy(MAP0), deepcopy(MAP), n)]\n while dp:\n m0, m, cnt = dp.pop()\n if cnt == 8:\n flg = True\n for r in range(8):\n if \"\".join(map(str, m0[r])).find(\"0\"):\n flg = False\n break\n if flg:\n return m\n for i in range(8):\n for j in range(8):\n if m0[i][j] == \"0\":\n dp.append((nuri(deepcopy(m0), i, j), deepcopy(m), cnt + 1))\n return m\n\n\ndef MAIN():\n f = lambda M: \"\\n\".join(\"\".join(map(str, m)) for m in M)\n QM = QueenMAP()\n n = int(eval(input()))\n for _ in range(n):\n a, b = list(map(int, input().split()))\n QM.add(a, b)\n dp = [(deepcopy(QM), n)]\n while dp:\n Q, cnt = dp.pop()\n if cnt == 8:\n if Q.allcheck():\n print((f(Q.MAP)))\n break\n continue\n cnt += 1\n for i in range(8):\n for j in range(8):\n if Q.check(i, j):\n CQ = deepcopy(Q)\n CQ.add(i, j)\n dp.append((CQ, cnt))\n\n\nMAIN()\n","fast_code":"from functools import lru_cache\n\ncc = [[\".\" for i in range(8)] for j in range(8)]\n\n\ndef check(cc, a, b):\n ss = list(zip(*cc))\n if \"Q\" in cc[a]:\n return False\n if \"Q\" in ss[b]:\n return False\n d = []\n for i in range(8):\n for j in range(8):\n try:\n if j + abs(a - i) == b:\n d.append(cc[i][j])\n if j - abs(a - i) == b:\n d.append(cc[i][j])\n except IndexError:\n continue\n if \"Q\" in d:\n return False\n return True\n\n\ndef chess(s, queen):\n if queen == 8:\n return s\n for i in range(8):\n for j in range(8):\n if check(s, i, j):\n sol = s\n sol[i][j] = \"Q\"\n if chess(sol, queen + 1) != [[]]:\n return sol\n else:\n sol[i][j] = \".\"\n return [[]]\n\n\nk = int(eval(input()))\nfor i in range(k):\n a, b = [int(x) for x in input().split()]\n cc[a][b] = \"Q\"\nans = chess(cc, k)\nprint((\"\\n\".join(list([\"\".join(x) for x in ans]))))\n"} +{"fast_code_id":"f4400189ff3db203f96723d5aee262e6d415108f8067f12bc82d5f8b60b24440","fast_id":"p02681_f4400189ff3db203f96723d5aee262e6d415108f8067f12bc82d5f8b60b24440","language":"python","measured_fast_code_id":"f4400189ff3db203f96723d5aee262e6d415108f8067f12bc82d5f8b60b24440","measured_slow_code_id":"e11f3e444910fe42a6baf012b95849e72747767315b4086506c83bd0c43f1245","measurement_metric":"cpu_instruction_count","pair_id":"python_092b4d649f9e8698d8879721","problem_id":"p02681","slow_code_id":"aead1926afd539d76d7800cd27f3761ad24e19df52b7dacf9e4a54d6feb221d2","slow_id":"p02681_e11f3e444910fe42a6baf012b95849e72747767315b4086506c83bd0c43f1245","speedup":5.889634255384855,"stratum":"4-8","sampling_key":"ccaebb10994076e421df430bb4a7805c8f54e40d74c19375060b5434cbf6e914","slow_code":"from typing import *\nimport itertools\nimport math\nimport sys\n\nINF = float(\"inf\")\nYES = \"Yes\"\nNO = \"No\"\n\n\ndef solve(S: str, T: str):\n return [NO, YES][S == T[:-1]]\n\n\ndef main():\n sys.setrecursionlimit(10**6)\n\n def iterate_tokens():\n for line in sys.stdin:\n for word in line.split():\n yield word\n\n tokens = iterate_tokens()\n S = next(tokens)\n T = next(tokens)\n print((solve(S, T)))\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"import sys\n\ninput = lambda: sys.stdin.readline().rstrip()\naint = lambda: int(input())\nints = lambda: list(map(int, input().split()))\nimport math\n\nfloor, ceil = lambda x: int(math.floor(x)), lambda x: int(math.ceil(x))\nfrom functools import reduce\n\ngcd = lambda *x: reduce(math.gcd, x)\nlcm = lambda *x: reduce(lambda x, y: (x * y) // gcd(x, y), x, 1)\nfrom collections import deque\n\nYes = lambda b: print(\"Yes\" if b else \"No\")\nYES = lambda b: print(\"YES\" if b else \"NO\")\nis_even = lambda x: True if x % 2 == 0 else False\n\n\ndef main():\n s = input()\n t = input()\n n = len(s)\n flg = 0\n for i in range(n):\n if s[i] != t[i]:\n flg = 1\n Yes(flg == 0)\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"77f76a38867beb641e47757dba2bd5b430b6e0e083272ea4226efd20efb0d38e","fast_id":"p02707_77f76a38867beb641e47757dba2bd5b430b6e0e083272ea4226efd20efb0d38e","language":"python","measured_fast_code_id":"77f76a38867beb641e47757dba2bd5b430b6e0e083272ea4226efd20efb0d38e","measured_slow_code_id":"b0bbbf8788e5f791d52ab03649f3b13292c89e5d624dcbdf5953421651272f86","measurement_metric":"cpu_instruction_count","pair_id":"python_09739e9a94c82bee72649de3","problem_id":"p02707","slow_code_id":"b0bbbf8788e5f791d52ab03649f3b13292c89e5d624dcbdf5953421651272f86","slow_id":"p02707_b0bbbf8788e5f791d52ab03649f3b13292c89e5d624dcbdf5953421651272f86","speedup":2.3083746201613176,"stratum":"2-4","sampling_key":"745e9e19be771026560f06ffcc00b5e91d99adc1130c6ef24c4b4a73c8c1440f","slow_code":"N = int(eval(input()))\n(*A,) = sorted(map(int, input().split()))\nimport bisect\n\nfor i in range(1, N + 1):\n print((bisect.bisect_right(A, i) - bisect.bisect_left(A, i)))\n","fast_code":"a = int(eval(input()))\nb = [0] * a\nfor c in map(int, input().split()):\n b[c - 1] = b[c - 1] + 1\nprint((\"\\n\".join(map(str, b))))\n"} +{"fast_code_id":"3cdff8e4175870a02e4061206fd8f6e8c2d7f81e837019cd00e38a6f5ab341db","fast_id":"p02792_3cdff8e4175870a02e4061206fd8f6e8c2d7f81e837019cd00e38a6f5ab341db","language":"python","measured_fast_code_id":"3cdff8e4175870a02e4061206fd8f6e8c2d7f81e837019cd00e38a6f5ab341db","measured_slow_code_id":"b3bc7702b06f82679063b3095f0a30e90403151c8f113bc72663aefe8ab77a82","measurement_metric":"cpu_instruction_count","pair_id":"python_0a0a723d0ab59ea1ef3d3873","problem_id":"p02792","slow_code_id":"b3bc7702b06f82679063b3095f0a30e90403151c8f113bc72663aefe8ab77a82","slow_id":"p02792_b3bc7702b06f82679063b3095f0a30e90403151c8f113bc72663aefe8ab77a82","speedup":6.304056671502351,"stratum":"4-8","sampling_key":"0d4956dcf423ed29e2e7ae5b8d343600bcf44592ecbbaf8c9287a3b36e14f812","slow_code":"import sys\n\nreadline = sys.stdin.readline\nN = int(readline())\nfrom collections import defaultdict\n\ndic = defaultdict(int)\nfor i in range(1, N + 1):\n s = str(i)\n dic[(int(s[0]), int(s[-1]))] += 1\nans = 0\nfor i in range(1, 10):\n for j in range(1, 10):\n ans += dic[(i, j)] * dic[(j, i)]\nprint(ans)\n","fast_code":"from itertools import product\n\n\ndef solve(string):\n d = len(string)\n if d == 1:\n return string\n s0, ss, sn = int(string[0]), int(string[1:-1] or 0), int(string[-1])\n t = [[0] * 10] + [[int(\"1\" * (d - 2) or 0)] * 10 for _ in range(9)]\n for i in range(1, 10):\n t[i][i] += 1\n for i, j in product(list(range(1, s0)), list(range(10))):\n t[i][j] += 10 ** (d - 2)\n for j in range(sn + 1):\n t[s0][j] += ss + 1\n for j in range(sn + 1, 10):\n t[s0][j] += ss\n return str(sum(t[i][j] * t[j][i] for i, j in product(list(range(1, 10)), repeat=2)))\n\n\nif __name__ == \"__main__\":\n import sys\n\n print((solve(sys.stdin.read().strip())))\n"} +{"fast_code_id":"84ef7cbc87bcf5fe8188260d7b059ec3fa8009bce6b870d7fabc70f1bbd82067","fast_id":"p03598_84ef7cbc87bcf5fe8188260d7b059ec3fa8009bce6b870d7fabc70f1bbd82067","language":"python","measured_fast_code_id":"84ef7cbc87bcf5fe8188260d7b059ec3fa8009bce6b870d7fabc70f1bbd82067","measured_slow_code_id":"4242b0111d34ac29f247349e2dd3df5bbea3d003d38a638f0ec7f046c27e0435","measurement_metric":"cpu_instruction_count","pair_id":"python_0ac80d56fd8b4a1d0d546c9d","problem_id":"p03598","slow_code_id":"b56139331cede5dfee10d7e57ba4d3e5fe70d638b0a7d7343d69614e13c21b14","slow_id":"p03598_4242b0111d34ac29f247349e2dd3df5bbea3d003d38a638f0ec7f046c27e0435","speedup":3.5462696661729467,"stratum":"2-4","sampling_key":"981656d6cb4da3cab5b3160873e5b2936ffeed38cc6a2931333842e2a5da9f00","slow_code":"import sys\n\nstdin = sys.stdin\ninf = 1 << 60\nmod = 1000000007\nni = lambda: int(ns())\nnin = lambda y: [ni() for _ in range(y)]\nna = lambda: list(map(int, stdin.readline().split()))\nnan = lambda y: [na() for _ in range(y)]\nnf = lambda: float(ns())\nnfn = lambda y: [nf() for _ in range(y)]\nnfa = lambda: list(map(float, stdin.readline().split()))\nnfan = lambda y: [nfa() for _ in range(y)]\nns = lambda: stdin.readline().rstrip()\nnsn = lambda y: [ns() for _ in range(y)]\nncl = lambda y: [list(ns()) for _ in range(y)]\nnas = lambda: stdin.readline().split()\nn, k = nin(2)\nx = na()\nans = 0\nfor i in range(n):\n ans += min(abs(x[i] - k) * 2, abs(x[i]) * 2)\nprint(ans)\n","fast_code":"_, k, t = open(0)\nprint((sum(min(x, int(k) - x) * 2 for x in map(int, t.split()))))\n"} +{"fast_code_id":"3fe7b411ed933f44322c3ebc9db01922f20d7ad447ad58aa9934f7062ce01d40","fast_id":"p02362_a876e50adb7fb20d6c6d462a1e2209a28830057167cd88325e76836aef56d5a3","language":"python","measured_fast_code_id":"a876e50adb7fb20d6c6d462a1e2209a28830057167cd88325e76836aef56d5a3","measured_slow_code_id":"ab12a803b6785f5f4ed17833763fd1aa5fdea2598bb998ef4d318a063084c6bb","measurement_metric":"cpu_instruction_count","pair_id":"python_0b15ccdab80a1d3725c7b5e8","problem_id":"p02362","slow_code_id":"ab12a803b6785f5f4ed17833763fd1aa5fdea2598bb998ef4d318a063084c6bb","slow_id":"p02362_ab12a803b6785f5f4ed17833763fd1aa5fdea2598bb998ef4d318a063084c6bb","speedup":3.6306089153419308,"stratum":"2-4","sampling_key":"920571e059d6eccbdd42a434eb08fc2d9b5c2682d6d6c65fc5b73bc419d380cc","slow_code":"from sys import stdin\nfrom collections import deque\n\nV, E, R = [int(x) for x in stdin.readline().split()]\nd = {}\ntick = False\nINF = float(\"inf\")\nfor i in range(V):\n d[i] = INF\nd[R] = 0\nweight = {}\nst = []\nfor i in range(1, V + 1):\n for j in range(E):\n if i == 1:\n s, t, w = [int(x) for x in stdin.readline().split()]\n weight[(s, t)] = w\n st.append((s, t))\n (s, t) = st[j]\n if d[t] > d[s] + weight[(s, t)]:\n d[t] = d[s] + weight[(s, t)]\n if i == V:\n print(\"NEGATIVE CYCLE\")\n quit()\nfor k in range(V):\n if d[k] == float(\"inf\"):\n print(\"INF\")\n else:\n print((d[k]))\n","fast_code":"import sys\n\nfile_input = sys.stdin\nV, E, r = map(int, file_input.readline().split())\nedges = []\nfor line in file_input:\n edges.append(tuple(map(int, line.split())))\n\ndistance = [float(\"inf\")] * V\ndistance[r] = 0\nnotUpdated = True\nfor i in range(V - 1):\n notUpdated = True\n for s, t, w in edges:\n temp_d = distance[s] + w\n if temp_d < distance[t]:\n distance[t] = temp_d\n notUpdated = False\n if notUpdated:\n break\n\nif notUpdated:\n print(*map(lambda x: str(x).upper(), distance), sep=\"\\n\")\nelse:\n flag = True\n for s, t, w in edges:\n temp_d = distance[s] + w\n if temp_d < distance[t]:\n print(\"NEGATIVE CYCLE\")\n flag = False\n break\n if flag:\n print(*map(lambda x: str(x).upper(), distance), sep=\"\\n\")\n"} +{"fast_code_id":"5685120b393a7f6971a97960cb4a2b0d1ec6b015a41cf8b0502742828261c1a1","fast_id":"p02573_9a9c87c112282f06d62730944c7a3d261454e6e09398f5e35b2946db630946a8","language":"python","measured_fast_code_id":"9a9c87c112282f06d62730944c7a3d261454e6e09398f5e35b2946db630946a8","measured_slow_code_id":"61baf93eb941c46a29ae15eea5da6ae278cbf5a1e1d3cae98504f09eefb23457","measurement_metric":"cpu_instruction_count","pair_id":"python_0b35a9235b576063ca151d47","problem_id":"p02573","slow_code_id":"8e42dd739f11f939e13d222704f39ba6136c1588861267c41088dccb0e91dc37","slow_id":"p02573_61baf93eb941c46a29ae15eea5da6ae278cbf5a1e1d3cae98504f09eefb23457","speedup":2.0229774316764484,"stratum":"2-4","sampling_key":"3840b7f3341bc4529a98e3f7a7ade0781e4cb8a8cc8b608eb91d2cd8878d5001","slow_code":"class UFTree:\n def __init__(self, N):\n self.nodes = [Node(i) for i in range(N)]\n self.N = N\n\n def find_max_child_num(self):\n result = 0\n for i in range(self.N):\n result = max(result, self.nodes[i].child_num)\n return result\n\n\nclass Node:\n def __init__(self, ID):\n self.ID = ID\n self.parent = None\n self.child_num = 0\n self.rank = 1\n\n def get_root(self):\n if self.parent is None:\n return self\n return self.parent.get_root()\n\n def is_in_same_tree(self, another):\n return self.get_root().ID == another.get_root().ID\n\n def concat(self, another):\n if self.is_in_same_tree(another):\n return\n sr = self.get_root()\n ar = another.get_root()\n if sr.rank > ar.rank:\n parent, child = sr, ar\n else:\n parent, child = ar, sr\n parent.child_num += child.child_num + 1\n parent.rank = max(parent.rank, child.rank + 1)\n child.parent = parent\n\n\nN, M = list(map(int, input().split()))\ntree = UFTree(N)\nAB = []\nfor i in range(M):\n l = list(map(int, input().split()))\n AB.append(l)\nfor i in range(M):\n a, b = AB[i][0], AB[i][1]\n a -= 1\n b -= 1\n tree.nodes[a].concat(tree.nodes[b])\n\n\nprint((tree.find_max_child_num() + 1))\n","fast_code":"def find(x):\n if par[x] < 0:\n return x\n else:\n par[x] = find(par[x])\n return par[x]\n\n\ndef unite(x, y):\n x = find(x)\n y = find(y)\n if x == y:\n return False\n else:\n if par[x] > par[y]:\n x, y = y, x\n par[x] += par[y]\n par[y] = x\n return True\n\n\nimport sys\n\ninput = sys.stdin.readline\nn, m = list(map(int, input().split()))\npar = [-1] * n\na = set()\nfor _ in range(m):\n ab = sorted(map(int, input().split()))\n a.add((ab[0], ab[1]))\nfor x, y in a:\n unite(x - 1, y - 1)\nprint((-min(par)))\n"} +{"fast_code_id":"2f872558e5927545ab1eb8cb8aa27f65b5fb5a3df11aade1137944ef12e27f50","fast_id":"p02549_2f872558e5927545ab1eb8cb8aa27f65b5fb5a3df11aade1137944ef12e27f50","language":"python","measured_fast_code_id":"2f872558e5927545ab1eb8cb8aa27f65b5fb5a3df11aade1137944ef12e27f50","measured_slow_code_id":"44c9516e92f38f09d76b47812276c2878e77eeefdb8dab9cc1137c27ddfc7b8e","measurement_metric":"cpu_instruction_count","pair_id":"python_0c2a34ebcc6c0fe7103b874f","problem_id":"p02549","slow_code_id":"44c9516e92f38f09d76b47812276c2878e77eeefdb8dab9cc1137c27ddfc7b8e","slow_id":"p02549_44c9516e92f38f09d76b47812276c2878e77eeefdb8dab9cc1137c27ddfc7b8e","speedup":3.2809239780295147,"stratum":"2-4","sampling_key":"4c472522de3761199907f343891697773c1905989d8107503b94fe06ee06efcb","slow_code":"mod = 998244353\nn, k = list(map(int, input().split()))\nK = [list(map(int, input().split())) for i in range(k)]\ndp = [0] * (n + 5)\ndp[1] = 1\ndp2 = [0] * (n + 5)\nfor i in range(1, n + 1):\n dp[i] = (dp[i] + dp2[i] + dp2[i - 1]) % mod\n dp2[i] = (dp2[i] + dp2[i - 1]) % mod\n for l, r in K:\n dp2[min(i + l, n + 2)] += dp[i]\n dp2[min(i + l, n + 2)] %= mod\n dp2[min(i + r + 1, n + 2)] -= dp[i]\n dp2[min(i + r + 1, n + 2)] %= mod\nprint((dp[n] % mod))\n","fast_code":"MOD = 998244353\n\n\ndef solve(lr, dp, n):\n acc_dp = [1] * n\n for i in range(1, n):\n val = 0\n for d in lr:\n a = i - d[0]\n if a < 0:\n continue\n b = i - d[1] - 1\n val += acc_dp[a] - (acc_dp[b] if b >= 0 else 0)\n dp[i] = val % MOD\n acc_dp[i] = (acc_dp[i - 1] + dp[i]) % MOD\n return dp[n - 1]\n\n\ndef main():\n f = open(0)\n n, k = [int(x) for x in f.readline().split()]\n lr = [[int(x) for x in f.readline().split()] for _ in range(k)]\n dp = [0] * n\n dp[0] = 1\n ans = solve(lr, dp, n)\n print(ans)\n\n\nmain()\n"} +{"fast_code_id":"8f20d49a25e29b9916e2295c2aad54b88f227ffe8f0e847faa1cf0ccac47ff69","fast_id":"p03737_8f20d49a25e29b9916e2295c2aad54b88f227ffe8f0e847faa1cf0ccac47ff69","language":"python","measured_fast_code_id":"8f20d49a25e29b9916e2295c2aad54b88f227ffe8f0e847faa1cf0ccac47ff69","measured_slow_code_id":"c5a6a790bfe3c359c7ab2698d0f376a617bb650fa938bf64d595d41523985f6d","measurement_metric":"cpu_instruction_count","pair_id":"python_0c64b352e2e99efc1740f535","problem_id":"p03737","slow_code_id":"c5a6a790bfe3c359c7ab2698d0f376a617bb650fa938bf64d595d41523985f6d","slow_id":"p03737_c5a6a790bfe3c359c7ab2698d0f376a617bb650fa938bf64d595d41523985f6d","speedup":2702.207287670808,"stratum":"8+","sampling_key":"5b8083cd34ac19a5be6de9f234ac50fb7c43866084047ec03a7c07edae7b1096","slow_code":"import numpy as np\nimport math\n\ns = \" \" + input()\nfor i in range(len(s)):\n if s[i] == \" \":\n print(chr(ord(s[i + 1]) - 32), end=\"\")\nprint()\n","fast_code":"a, *_ = zip(*input().upper().split())\nprint(*a, sep=\"\")\n"} +{"fast_code_id":"a2624425a9b93e6559ac62ba782b26bed674b805c5d6c4a13b00b3b9cc35d295","fast_id":"p03170_a2624425a9b93e6559ac62ba782b26bed674b805c5d6c4a13b00b3b9cc35d295","language":"python","measured_fast_code_id":"a2624425a9b93e6559ac62ba782b26bed674b805c5d6c4a13b00b3b9cc35d295","measured_slow_code_id":"8112cd387b0dc72e3c242f7bfd507977d7eda664d1c31dd3923eb0876c50cba5","measurement_metric":"cpu_instruction_count","pair_id":"python_0ce568ff434223749648b699","problem_id":"p03170","slow_code_id":"8112cd387b0dc72e3c242f7bfd507977d7eda664d1c31dd3923eb0876c50cba5","slow_id":"p03170_8112cd387b0dc72e3c242f7bfd507977d7eda664d1c31dd3923eb0876c50cba5","speedup":7.0233715669195815,"stratum":"4-8","sampling_key":"436f318627c7d7fc3c41a75d3331939be47222a6959fc81d3f3cfb646702e894","slow_code":"N, K = list(map(int, input().split()))\nA = list(map(int, input().split()))\ndp = [\"First\"] * (K + 1)\ndp[0] = \"Second\"\n\n\ndef solve(dp):\n for i in range(1, K + 1):\n for j in range(N):\n dp[i] = \"Second\"\n if dp[i - A[j]] == \"Second\":\n dp[i] = \"First\"\n break\n ans = dp[K]\n return ans\n\n\nprint((solve(dp)))\n","fast_code":"def main():\n N, K, *A = list(map(int, open(0).read().split()))\n dp = [0] * (K + 1)\n for i in range(K):\n if dp[i]:\n continue\n for a in A:\n if i + a > K:\n break\n dp[i + a] = 1\n print((\"First\" if dp[-1] else \"Second\"))\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"2613d9f8aca6f0a2ad5694268aadca2cf120425eb7f71a5017b90abe73680871","fast_id":"p02572_2613d9f8aca6f0a2ad5694268aadca2cf120425eb7f71a5017b90abe73680871","language":"python","measured_fast_code_id":"2613d9f8aca6f0a2ad5694268aadca2cf120425eb7f71a5017b90abe73680871","measured_slow_code_id":"bbd0765504a43af57f1013eba7a9f2f567f1ff7927a5e42c81e85596c0a9b856","measurement_metric":"cpu_instruction_count","pair_id":"python_0dadc9ca876a7d7f76114cf8","problem_id":"p02572","slow_code_id":"7f0c885ecc7c1eef39e171a852b966e4e09f436f2d91513c561c1cef1169003a","slow_id":"p02572_bbd0765504a43af57f1013eba7a9f2f567f1ff7927a5e42c81e85596c0a9b856","speedup":25.92575870254105,"stratum":"8+","sampling_key":"0274a3d86a3d97ec1adf9e9ca925e1fe160db21ff9c0e0d4605d55856bd0025d","slow_code":"import numpy as np\n\nN = int(eval(input()))\nA = np.array([int(i) for i in input().split()])\nsum = 0\n\nfor x in A:\n sum += x\n sum %= 10**9 + 7\n\nsum2 = 0\nfor x in A:\n sum2 += x * x\n sum2 %= 10**9 + 7\n\nans = (sum**2 - sum2) % (10**9 + 7)\nif ans < 0:\n ans += 10**9 + 7\nans *= int((10**9 + 7 + 1) / 2)\nans %= 10**9 + 7\nprint((int(ans)))\n","fast_code":"n = int(eval(input()))\na = list(map(int, input().split()))\nk = 0\nnum = sum(a)\nimport math\n\nfor i in range(n):\n reje = num - a[i]\n k += reje * a[i]\nx = k // 2\nt = 10**9 + 7\nans = x % t\nprint(ans)\n"} +{"fast_code_id":"4be88f64ca664c2eac79251ecb1a1e87d14707dab8d2ff3d5c3c0cfb067c5fc2","fast_id":"p03147_4be88f64ca664c2eac79251ecb1a1e87d14707dab8d2ff3d5c3c0cfb067c5fc2","language":"python","measured_fast_code_id":"4be88f64ca664c2eac79251ecb1a1e87d14707dab8d2ff3d5c3c0cfb067c5fc2","measured_slow_code_id":"47a3646cbef4cdc6d777ff253127885ae7b10f34cd8d4fef647dd4916f5b32c1","measurement_metric":"cpu_instruction_count","pair_id":"python_0df54c3d56d3ced32b3f2b30","problem_id":"p03147","slow_code_id":"2ca3826e95bb705eb346cc2325420f54f12d09da747118c657639adcec905d81","slow_id":"p03147_47a3646cbef4cdc6d777ff253127885ae7b10f34cd8d4fef647dd4916f5b32c1","speedup":817.1102356752353,"stratum":"8+","sampling_key":"3295396f818d3a7008899eda872cd7c07da6ac046b68208451ac93ea7b790cc9","slow_code":"import numpy as np\n\n\nN = int(eval(input()))\narrA = list(map(int, input().split()))\n\n\ndef split_list(lis, num=0):\n res = []\n tmp = []\n for i in lis:\n if i != num:\n tmp.append(i)\n elif i == num and len(tmp) > 0:\n res.append(tmp)\n tmp = []\n else:\n continue\n else:\n res.append(tmp)\n res = [l for l in res if len(l) != 0]\n return res\n\n\nstack = split_list(arrA)\nans = 0\n\nwhile len(stack) > 0:\n lis1 = stack.pop()\n arr = np.array(list(map(int, list(lis1))))\n\n nmin = min(arr)\n ans += nmin\n arr = arr - nmin\n s = list(arr)\n lis2 = split_list(s)\n stack = stack + lis2\nprint(ans)\n","fast_code":"n = int(eval(input()))\nh = list(map(int, input().split()))\nans = h[0]\nfor i in range(1, n):\n if h[i] > h[i - 1]:\n ans += h[i] - h[i - 1]\nprint(ans)\n"} +{"fast_code_id":"5a8587d9a775ddf801b6b25ab8a9f4895d5899c2a7b8332b712dab13293f721d","fast_id":"p02382_5a8587d9a775ddf801b6b25ab8a9f4895d5899c2a7b8332b712dab13293f721d","language":"python","measured_fast_code_id":"5a8587d9a775ddf801b6b25ab8a9f4895d5899c2a7b8332b712dab13293f721d","measured_slow_code_id":"c3f9eb019e3842f0a97bfd8fb04b18e6c2124bd7080dc365df4bf7ed45775194","measurement_metric":"cpu_instruction_count","pair_id":"python_0df848754fac30c443abddec","problem_id":"p02382","slow_code_id":"c3f9eb019e3842f0a97bfd8fb04b18e6c2124bd7080dc365df4bf7ed45775194","slow_id":"p02382_c3f9eb019e3842f0a97bfd8fb04b18e6c2124bd7080dc365df4bf7ed45775194","speedup":2.320438224488248,"stratum":"2-4","sampling_key":"0c963ff886aeea3225f6e8b372ce94c4ed1384551984734f1578a58b0509f2e7","slow_code":"n = int(eval(input()))\nx = list(map(int, input().split()))\ny = list(map(int, input().split()))\ntmp = [[0 for i in range(6)] for j in range(n + 1)]\nabsDiff = abs(x[0] - y[0])\ntmp[0][3] = tmp[0][0] = absDiff\ntmp[0][4] = tmp[0][1] = absDiff**2\ntmp[0][5] = tmp[0][2] = absDiff**3\nmax = absDiff\nfor i in range(1, n, 1):\n absDiff = abs(x[i] - y[i])\n tmp[i][0] = absDiff\n tmp[i][1] = absDiff**2\n tmp[i][2] = absDiff**3\n tmp[i][3] = tmp[i - 1][3] + tmp[i][0]\n tmp[i][4] = tmp[i - 1][4] + tmp[i][1]\n tmp[i][5] = tmp[i - 1][5] + tmp[i][2]\n if absDiff > max:\n max = absDiff\nprint((tmp[n - 1][3]))\nprint((tmp[n - 1][4] ** (1 / 2)))\nprint((tmp[n - 1][5] ** (1 / 3)))\nprint(max)\n","fast_code":"n = int(input())\nx = list(map(int, input().split()))\ny = list(map(int, input().split()))\nd = [abs(s - t) for s, t in zip(x, y)]\nf = lambda n: sum([s**n for s in d]) ** (1 / n)\nprint(f(1), f(2), f(3), max(d), sep=\"\\n\")\n"} +{"fast_code_id":"01a2b7b4dd2e51daaa5349fba4b4ff5f7a7392280b64a40b153e1bd226e5b503","fast_id":"p03774_01a2b7b4dd2e51daaa5349fba4b4ff5f7a7392280b64a40b153e1bd226e5b503","language":"python","measured_fast_code_id":"01a2b7b4dd2e51daaa5349fba4b4ff5f7a7392280b64a40b153e1bd226e5b503","measured_slow_code_id":"0efc73096e5c454dd629a78888b6096a291ff26f7924fd5a40dea1274e463422","measurement_metric":"cpu_instruction_count","pair_id":"python_0dfd9c0be4c0a212734a9717","problem_id":"p03774","slow_code_id":"0efc73096e5c454dd629a78888b6096a291ff26f7924fd5a40dea1274e463422","slow_id":"p03774_0efc73096e5c454dd629a78888b6096a291ff26f7924fd5a40dea1274e463422","speedup":148.2178930659851,"stratum":"8+","sampling_key":"0554af94112dce1618e64992826bd21f9b0326800b25fa567cb6e67abdac53a9","slow_code":"import numpy as np, sys\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\nN, M = LI()\nab = np.array([LI() for _ in range(N)], dtype=int)\ncd = np.array([LI() for _ in range(M)], dtype=int)\nfor x in ab:\n vector = np.sum(np.abs(cd - x), axis=1).tolist()\n print((vector.index(min(vector)) + 1))\n","fast_code":"n, m = list(map(int, input().split()))\na = [[int(j) for j in input().split()] for i in range(n)]\nc = [[int(j) for j in input().split()] for i in range(m)]\nfor i in range(n):\n d = 10e8\n b = 0\n for j in range(m):\n if abs(a[i][0] - c[j][0]) + abs(a[i][1] - c[j][1]) < d:\n d = abs(a[i][0] - c[j][0]) + abs(a[i][1] - c[j][1])\n b = j + 1\n print(b)\n"} +{"fast_code_id":"7a8dc9b2fbcba45893570fd93fea0015831e7ad0da2989ee7908b68f9ad3f97e","fast_id":"p02695_88e6e0b3d22f66f2f6f1f4326b17c1acff0238df6b51ea4289ef55937da164a9","language":"python","measured_fast_code_id":"88e6e0b3d22f66f2f6f1f4326b17c1acff0238df6b51ea4289ef55937da164a9","measured_slow_code_id":"4876c20eabffbc9ea2c633c2d996da20261178a9a9451926be7fe13405bb8582","measurement_metric":"cpu_instruction_count","pair_id":"python_0e0aaa992a8a6f48e2b91b65","problem_id":"p02695","slow_code_id":"4876c20eabffbc9ea2c633c2d996da20261178a9a9451926be7fe13405bb8582","slow_id":"p02695_4876c20eabffbc9ea2c633c2d996da20261178a9a9451926be7fe13405bb8582","speedup":5.699281821048583,"stratum":"4-8","sampling_key":"457c8520384dc5f60d9b4b7a3632fb802ce794364ae1bd731a5e101fe5c2aa74","slow_code":"n, m, q = list(map(int, input().split()))\nl = []\nfor i in range(q):\n l1, l2, l3, l4 = list(map(int, input().split()))\n l.append([l1, l2, l3, l4])\nB = []\nfor a in range(1, m + 1):\n for b in range(a, m + 1):\n for c in range(b, m + 1):\n for d in range(c, m + 1):\n for e in range(d, m + 1):\n for f in range(e, m + 1):\n for g in range(f, m + 1):\n for h in range(g, m + 1):\n for i in range(h, m + 1):\n for j in range(i, m + 1):\n L = [a, b, c, d, e, f, g, h, i, j]\n A = []\n for I in range(n):\n A.append(L[I])\n C = 0\n for k in range(q):\n if (\n A[l[k][1] - 1] - A[l[k][0] - 1]\n == l[k][2]\n ):\n C += l[k][3]\n B.append(C)\nprint((max(B)))\n","fast_code":"import sys\n\ninput = sys.stdin.readline\nsys.setrecursionlimit(10**7)\nINF = 10**10\nMOD = 10**9 + 7\nN, M, Q = list(map(int, input().split()))\nquery = []\nfor q in range(Q):\n a, b, c, d = list(map(int, input().split()))\n a -= 1\n b -= 1\n query.append((a, b, c, d))\nold = []\nfor i in range(1, M + 1):\n old.append([i])\nfor j in range(N - 1):\n new = []\n for e in old:\n for i in range(e[-1], M + 1):\n new.append(e + [i])\n old = new\n\nmx = 0\nfor n in new:\n score = 0\n for a, b, c, d in query:\n if n[b] - n[a] == c:\n score += d\n mx = max(score, mx)\nprint(mx)\n"} +{"fast_code_id":"66246b4e7ebc7638aa6316cd1d0d04c5f1b9ee22288c88f749f852eeca0f1e44","fast_id":"p04006_66246b4e7ebc7638aa6316cd1d0d04c5f1b9ee22288c88f749f852eeca0f1e44","language":"python","measured_fast_code_id":"66246b4e7ebc7638aa6316cd1d0d04c5f1b9ee22288c88f749f852eeca0f1e44","measured_slow_code_id":"7c9ffa5f21aea1508d9fdaeb3beea6752b613b3dad204c9c8f0124a3104b75b0","measurement_metric":"cpu_instruction_count","pair_id":"python_0e12911d6d117c5efcb29f2a","problem_id":"p04006","slow_code_id":"030bee4d3adf4f546019c3108859e78c291877e9a42103460f74527af78af871","slow_id":"p04006_7c9ffa5f21aea1508d9fdaeb3beea6752b613b3dad204c9c8f0124a3104b75b0","speedup":6.872168925010549,"stratum":"4-8","sampling_key":"aaf096c0e3ef109c91f1f1a1d5dcf597467c9b1002c2f8d68500b71bc9cc2aef","slow_code":"import sys\nimport numpy as np\n\ninput = sys.stdin.readline\n\n\ndef main():\n N, x = list(map(int, input().split()))\n a = list(map(int, input().split()))\n min_ = np.array(a)\n ans = sum(min_)\n\n for k in range(1, N):\n min_ = np.minimum(min_, np.roll(min_, 1))\n ans = min(ans, k * x + sum(min_))\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"n, x = [int(i) for i in input().split()]\nA = [int(i) for i in input().split()]\nB = A[:]\nans = sum(A)\nfor i in range(1, n):\n for j in range(n):\n B[j] = min(B[j], A[j - i])\n ans = min(ans, sum(B) + i * x)\nprint(ans)\n"} +{"fast_code_id":"4b653d1f388d5cadc773f4288d857efc885a0902797402d957c8f1d21136f39f","fast_id":"p03126_4b653d1f388d5cadc773f4288d857efc885a0902797402d957c8f1d21136f39f","language":"python","measured_fast_code_id":"4b653d1f388d5cadc773f4288d857efc885a0902797402d957c8f1d21136f39f","measured_slow_code_id":"cba8544a349f34548c0cfacd2e62b0d692bf5fdacfd135926ebf79dcf82a2da4","measurement_metric":"cpu_instruction_count","pair_id":"python_0e133ce96eb4751257c1b2c7","problem_id":"p03126","slow_code_id":"0dc68db287c1c51e9e3ae700494383cca10de9412a38ef778d71183366a2ba69","slow_id":"p03126_cba8544a349f34548c0cfacd2e62b0d692bf5fdacfd135926ebf79dcf82a2da4","speedup":6.029758311111632,"stratum":"4-8","sampling_key":"321eb6f606a8c60c4a1c0b4018e95b506a11db80f8071c4b0a2eddf3171abb3d","slow_code":"N, M = list(map(int, input().split()))\nlist = [list(map(int, input().split())) for x in range(N)]\n\nfor i in range(0, N):\n list[i].pop(0)\nstock = []\n\nfor i in range(0, N):\n for j in range(0, len(list[i])):\n cnt = 0\n for k in range(0, N):\n if list[i][j] in list[k]:\n cnt += 1\n if cnt == N:\n stock.append(list[i][j])\nif N == 1:\n stock = list[i]\nprint((len(set(stock))))\n","fast_code":"n, m = list(map(int, input().split()))\nS = set(range(1, m + 1))\nfor i in range(n):\n K, *A = list(map(int, input().split()))\n S &= set(A)\nprint((len(S)))\n"} +{"fast_code_id":"cf141fe4be37a735643ffdfdad9e379eeef8fe630c6da705b023ec631614c21e","fast_id":"p03762_cf141fe4be37a735643ffdfdad9e379eeef8fe630c6da705b023ec631614c21e","language":"python","measured_fast_code_id":"cf141fe4be37a735643ffdfdad9e379eeef8fe630c6da705b023ec631614c21e","measured_slow_code_id":"982e2a132ff9a9ee086902a77e4d38984ae35b417d1949db3c426a0eec331800","measurement_metric":"cpu_instruction_count","pair_id":"python_0e29d3bca22ccc9e8c2da979","problem_id":"p03762","slow_code_id":"982e2a132ff9a9ee086902a77e4d38984ae35b417d1949db3c426a0eec331800","slow_id":"p03762_982e2a132ff9a9ee086902a77e4d38984ae35b417d1949db3c426a0eec331800","speedup":7.441421262598347,"stratum":"4-8","sampling_key":"5ad517e9e47f48b04c52f592033fb4ac56ef1168a154cfbeb228e91d4eed74f1","slow_code":"import sys\nimport numpy as np\n\nMOD = 10**9 + 7\nI = np.array(sys.stdin.read().split(), dtype=np.int64)\nn, m = I[:2]\nx = I[2 : 2 + n]\ny = I[2 + n :]\n\n\ndef main():\n sx = np.cumsum(x) % MOD\n sy = np.cumsum(y) % MOD\n sdx = (\n np.sum((sx[n - 1] - sx[: n - 1]) - x[: n - 1] * ((n - 1) - np.arange(n - 1)))\n % MOD\n )\n sdy = (\n np.sum((sy[m - 1] - sy[: m - 1]) - y[: m - 1] * ((m - 1) - np.arange(m - 1)))\n % MOD\n )\n ans = sdx * sdy % MOD\n return ans\n\n\nif __name__ == \"__main__\":\n ans = main()\n print(ans)\n","fast_code":"n, m = list(map(int, input().split()))\nx = list(map(int, input().split()))\ny = list(map(int, input().split()))\nmod = 10**9 + 7\nx.sort()\ny.sort()\nsx, sy = 0, 0\nfor k in range(1, n + 1):\n sx += (2 * k - n - 1) * x[k - 1]\n sx %= mod\nfor k in range(1, m + 1):\n sy += (2 * k - m - 1) * y[k - 1]\n sy %= mod\nprint(((sx * sy) % mod))\n"} +{"fast_code_id":"f522ab1c5a929026d0db6ca658dc7a8ef822c62c3950374ddb1e286b2eb1b22f","fast_id":"p00022_f522ab1c5a929026d0db6ca658dc7a8ef822c62c3950374ddb1e286b2eb1b22f","language":"python","measured_fast_code_id":"f522ab1c5a929026d0db6ca658dc7a8ef822c62c3950374ddb1e286b2eb1b22f","measured_slow_code_id":"8e3689a917ad4c79c60c6adbb8d6688abf4bb0bce1a0c3468135f63f0c03ee05","measurement_metric":"cpu_instruction_count","pair_id":"python_0ea1f5700e8774c9484720e0","problem_id":"p00022","slow_code_id":"085372069d48219741fb186b9dbc003d015304dcc2c410ee58438bbaba3e6c7c","slow_id":"p00022_8e3689a917ad4c79c60c6adbb8d6688abf4bb0bce1a0c3468135f63f0c03ee05","speedup":2.6413018709872693,"stratum":"2-4","sampling_key":"0f513c0689c8c6142e62882b34119b26fd559370ccaec8d361fb9d7a859c9067","slow_code":"import sys\nimport os\n\n\ndef max_seq(A):\n s = []\n s.append(A[0])\n for i in range(1, len(A)):\n v = max(A[i], A[i] + s[i - 1])\n s.append(v)\n return max(s)\n\n\nwhile True:\n s = input().strip()\n if s == \"0\":\n break\n N = int(s)\n A = []\n for i in range(N):\n v = int(eval(input()))\n A.append(v)\n print((max_seq(A)))\n","fast_code":"while 1:\n n = eval(input())\n if n == 0:\n break\n r = [int(input()) for i in range(n)]\n for i in range(1, n):\n r[i] = max(r[i - 1] + r[i], r[i])\n print(max(r))\n"} +{"fast_code_id":"d62ebf3b8f05e6d97f62cf45f38ed9e52cb4fe00471ec51b16b69a651d6874ca","fast_id":"p02683_4a090b084527358267bcf9979fb612a50e796632edef635d6398486f11747180","language":"python","measured_fast_code_id":"4a090b084527358267bcf9979fb612a50e796632edef635d6398486f11747180","measured_slow_code_id":"6459d56d39987c764ab971f696c22809925ce5bc619058aa0c69424099f8ef7e","measurement_metric":"cpu_instruction_count","pair_id":"python_0ea331d8148930eb25a38c7e","problem_id":"p02683","slow_code_id":"923747067069348920bdd8026637f5d9fa012ed77d9c282d31be247214b03102","slow_id":"p02683_6459d56d39987c764ab971f696c22809925ce5bc619058aa0c69424099f8ef7e","speedup":36.33737599849862,"stratum":"8+","sampling_key":"38d699b7da6ecd396a95bfe0d2ef09955017ed2be0362529c52df5b73fe2f7ba","slow_code":"import numpy as np\n\nN, M, X = list(map(int, input().split()))\nC = []\nA = []\nfor i in range(N):\n c = 0\n a = []\n c, *a = list(map(int, input().split()))\n C.append(c)\n A.append(a)\nA = np.array(A)\ninf = float(\"inf\")\nres = inf\nfor bit in range(1 << N):\n Cost = 0\n Wise = np.zeros(M)\n for i in range(N):\n if (bit >> i) & 1:\n Cost += C[i]\n Wise += A[i]\n Wise = Wise.tolist()\n\n if min(Wise) >= X and Cost <= res:\n res = Cost\nif res == inf:\n print(\"-1\")\nelse:\n print(res)\n","fast_code":"import sys\nimport math\nimport decimal\nimport itertools\nfrom itertools import product\nfrom functools import reduce\n\n\ndef input():\n return sys.stdin.readline()[:-1]\n\n\ndef main():\n N, M, X = list(map(int, input().split()))\n A = [list(map(int, input().split())) for _ in range(N)]\n inf = 10**18\n\n ans = inf\n for i in product([0, 1], repeat=N):\n ok = True\n for m in range(1, M + 1):\n s = 0\n for n in range(N):\n if i[n] == 1:\n s += A[n][m]\n if s < X:\n ok = False\n break\n if ok:\n money = 0\n for n in range(N):\n if i[n] == 1:\n money += A[n][0]\n ans = min(ans, money)\n if ans == inf:\n print((-1))\n else:\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"799357d89f6b25d06561da5e9b99e0802a7c29f1da18e31bc96db0b597d10eff","fast_id":"p02795_799357d89f6b25d06561da5e9b99e0802a7c29f1da18e31bc96db0b597d10eff","language":"python","measured_fast_code_id":"799357d89f6b25d06561da5e9b99e0802a7c29f1da18e31bc96db0b597d10eff","measured_slow_code_id":"d022aa6ac902af8c6f29b3436e57b45e34d81f5307014236b2787c2022497c3f","measurement_metric":"cpu_instruction_count","pair_id":"python_0ef0b35367b7615a875a697c","problem_id":"p02795","slow_code_id":"d022aa6ac902af8c6f29b3436e57b45e34d81f5307014236b2787c2022497c3f","slow_id":"p02795_d022aa6ac902af8c6f29b3436e57b45e34d81f5307014236b2787c2022497c3f","speedup":18.860768264713265,"stratum":"8+","sampling_key":"75680654e91f881051cdc012150e4feb7dea6a5dca136b0fad26ce047ad72fe5","slow_code":"H = int(eval(input()))\nW = int(eval(input()))\nN = int(eval(input()))\nHW = H * W\nans = H + W\nfor h in range(0, H + 1):\n for w in range(0, W + 1):\n cntB = HW - (H - h) * (W - w)\n if cntB >= N:\n ans = min(ans, h + w)\nprint(ans)\n","fast_code":"h, w, n = int(eval(input())), int(eval(input())), int(eval(input()))\na = max(h, w)\nprint(((n + a - 1) // a))\n"} +{"fast_code_id":"3af56e6935ebf2403d8e7f22570874ba87558803c6a316375b5ec44f434713dc","fast_id":"p02793_3af56e6935ebf2403d8e7f22570874ba87558803c6a316375b5ec44f434713dc","language":"python","measured_fast_code_id":"3af56e6935ebf2403d8e7f22570874ba87558803c6a316375b5ec44f434713dc","measured_slow_code_id":"f88513118669d402af7378a034aabe8202ff8560f519ab66df19e762a530974c","measurement_metric":"cpu_instruction_count","pair_id":"python_0f03d4f6545928f1f14c41dd","problem_id":"p02793","slow_code_id":"ba27fc3e799b35a2da993d9e96b283294f1d1dcfd936e94e1a95db83c338ae65","slow_id":"p02793_f88513118669d402af7378a034aabe8202ff8560f519ab66df19e762a530974c","speedup":228.7756715085786,"stratum":"8+","sampling_key":"1206c877ed2d036fc3fea9332ad4fb32cd8a1132dd3708e7b473c8b617bec10d","slow_code":"def make_prime_table(N):\n sieve = [0] * (N + 1)\n sieve[0] = -1\n sieve[1] = -1\n for i in range(2, N + 1):\n if sieve[i] != 0:\n continue\n sieve[i] = i\n for j in range(i * i, N + 1, i):\n if sieve[j] == 0:\n sieve[j] = i\n return sieve\n\n\nN = int(eval(input()))\nA = list(map(int, input().split()))\nm = 1000000007\nsieve = make_prime_table(1000000)\nlcm_factors = {}\nfor i in range(N):\n t = []\n a = A[i]\n while a != 1:\n if len(t) != 0 and t[-1][0] == sieve[a]:\n t[-1][1] += 1\n else:\n t.append([sieve[a], 1])\n a //= sieve[a]\n for k, v in t:\n if k not in lcm_factors or lcm_factors[k] < v:\n lcm_factors[k] = v\nlcm = 1\nfor k in lcm_factors:\n for i in range(lcm_factors[k]):\n lcm *= k\n lcm %= m\nresult = 0\nfor i in range(N):\n result += lcm * pow(A[i], m - 2, m)\n result %= m\nprint(result)\n","fast_code":"from math import gcd\nfrom functools import reduce\n\nMOD = 10**9 + 7\n\n\ndef calc_lcm(x, y):\n return x * y // gcd(x, y)\n\n\ndef calc_lcm_list(numbers):\n return reduce(calc_lcm, numbers, 1)\n\n\nN, *A = list(map(int, open(0).read().split()))\nlcm = calc_lcm_list(A)\nprint((sum(lcm // v for v in A) % MOD))\n"} +{"fast_code_id":"48ff09bc20e8f8798770efd549a5ac6494d01b7553d3e063e63a4ebd4e5dd723","fast_id":"p03173_48ff09bc20e8f8798770efd549a5ac6494d01b7553d3e063e63a4ebd4e5dd723","language":"python","measured_fast_code_id":"48ff09bc20e8f8798770efd549a5ac6494d01b7553d3e063e63a4ebd4e5dd723","measured_slow_code_id":"bfaa89da3b2a7dfb7699a6e650ad26181e45afd981d8d5555f6631c8c9e83d02","measurement_metric":"cpu_instruction_count","pair_id":"python_0fc4307e787a6fd1c10abcda","problem_id":"p03173","slow_code_id":"bfaa89da3b2a7dfb7699a6e650ad26181e45afd981d8d5555f6631c8c9e83d02","slow_id":"p03173_bfaa89da3b2a7dfb7699a6e650ad26181e45afd981d8d5555f6631c8c9e83d02","speedup":15.739292352347357,"stratum":"8+","sampling_key":"0d3a62be6938472db355b6f9e482040bd7fa734fefc727819d8adbbd20ac8d5d","slow_code":"from numpy import *\n\nn, a = open(0)\nn = int(n)\na = cumsum(int64([0] + a.split()))\ndp = zeros((n, n + 1), \"i8\")\nfor k in range(1, n):\n l = arange(n - k)\n r = arange(k + 1, n + 1)\n m = (arange(1, k + 1) + l[:, newaxis]).T\n dp[l, r] = amin(dp[l, m] + dp[m, r], 0) + a[r] - a[l]\nprint((dp[0, n]))\n","fast_code":"def resolve():\n N = int(eval(input()))\n a = list(map(int, input().split()))\n DP = [[2**63 - 1 for _ in range(N + 1)] for _ in range(N)]\n SUM = [[0 for _ in range(N + 1)] for _ in range(N + 1)]\n RANGE = [[0 for _ in range(N + 1)] for _ in range(N + 1)]\n SUM[0][0] = 0\n for i in range(N):\n for j in range(i, N):\n SUM[i][j + 1] = SUM[i][j] + a[j]\n if i < j:\n SUM[i + 1][j] = SUM[i][j] - a[i]\n for i in range(N):\n j = i + 1\n DP[i][j] = 0\n RANGE[i][j] = i\n for w in range(2, N + 1):\n for i in range(N + 1 - w):\n j = i + w\n for k in range(RANGE[i][j - 1], RANGE[i + 1][j] + 1):\n s = DP[i][k] + DP[k][j] + SUM[i][j]\n if DP[i][j] > s:\n DP[i][j] = s\n RANGE[i][j] = k\n print((DP[0][N]))\n\n\nresolve()\n"} +{"fast_code_id":"a8cec5eb14a763a440273fe3ce5cac605f04d24d8fd299b243bb4b7cc1f372e0","fast_id":"p01268_a8cec5eb14a763a440273fe3ce5cac605f04d24d8fd299b243bb4b7cc1f372e0","language":"python","measured_fast_code_id":"a8cec5eb14a763a440273fe3ce5cac605f04d24d8fd299b243bb4b7cc1f372e0","measured_slow_code_id":"0a932eb6633858ba78c6cf0f7f33ce8a7678b6c98d01696a6e1a5b5d1b92803d","measurement_metric":"cpu_instruction_count","pair_id":"python_100cd547ab9c232e8504bb67","problem_id":"p01268","slow_code_id":"0a932eb6633858ba78c6cf0f7f33ce8a7678b6c98d01696a6e1a5b5d1b92803d","slow_id":"p01268_0a932eb6633858ba78c6cf0f7f33ce8a7678b6c98d01696a6e1a5b5d1b92803d","speedup":2.060256639206451,"stratum":"2-4","sampling_key":"f6e429e19c900e3b18746e843b48526d54f3d12262f9e1ea480171efd5b67a3a","slow_code":"from bisect import bisect_right as br\nfrom itertools import combinations_with_replacement as cwr\n\nMAX = 110000\nROOT = 340\ntf = [True] * MAX\ntf[0] = tf[1] = False\nfor i in range(2, ROOT + 1):\n if tf[i]:\n for j in range(i * i, MAX, i):\n tf[j] = False\nprimes = [i for i in range(MAX) if tf[i]]\nwhile True:\n n, p = list(map(int, input().split()))\n if n == -1:\n break\n init = br(primes, n)\n choice = primes[init : init + 100]\n lst = []\n for i, j in cwr(choice, 2):\n lst.append(i + j)\n lst.sort()\n print((lst[p - 1]))\n","fast_code":"import itertools\n\nr = 110000\ns = int(r * 0.5)\np = [1] * r\np[0] = 0\nfor i in range(1, s):\n if p[i]:\n p[2 * i + 1 :: i + 1] = [0 for x in range(2 * i + 1, r, i + 1)]\nwhile 1:\n N, P = list(map(int, input().split()))\n if N == -1:\n break\n i = N + 1\n prime = []\n while len(prime) < 30:\n if p[i - 1] == 1:\n prime.append(i)\n i += 1\n wa = sorted(\n [sum(comb) for comb in itertools.combinations(prime, 2)]\n + [2 * a for a in prime]\n )\n print(wa[P - 1])\n"} +{"fast_code_id":"bade334d850baa79c30c63b127211354a56f0a74387511e74bb04b26a2ac47b2","fast_id":"p03558_bade334d850baa79c30c63b127211354a56f0a74387511e74bb04b26a2ac47b2","language":"python","measured_fast_code_id":"bade334d850baa79c30c63b127211354a56f0a74387511e74bb04b26a2ac47b2","measured_slow_code_id":"5f35f96f280f319d024f2d3d07196cab1ceb7da585338fc01299f2b757443aa2","measurement_metric":"cpu_instruction_count","pair_id":"python_11197cdfa1372fe80205c405","problem_id":"p03558","slow_code_id":"f35f1eea5cd14a6f077768d39acd6576a774f6899093cc32001834bcc2a00d21","slow_id":"p03558_5f35f96f280f319d024f2d3d07196cab1ceb7da585338fc01299f2b757443aa2","speedup":4.146985602465169,"stratum":"4-8","sampling_key":"785a7ab2be02c8bf4a9bd8ac85eff18617b54d53d12a7cec90fa43b558e0e4f3","slow_code":"from collections import deque\n\n\ndef bfs01(g, start):\n n = len(g)\n res = [float(\"inf\")] * n\n res[start] = 0\n pending = n - 1\n q = deque([(0, start)])\n while q and pending:\n dv, v = q.popleft()\n if res[v] < dv:\n continue\n pending -= 1\n\n for to, cost in g[v]:\n if dv + cost < res[to]:\n res[to] = dv + cost\n if cost:\n q.append((res[to], to))\n else:\n q.appendleft((res[to], to))\n return res\n\n\nimport sys\n\nsys.setrecursionlimit(10**6)\nreadline = sys.stdin.readline\nk = int(eval(input()))\ng = [[] for _ in range(k)]\nfor i in range(k):\n g[i].append(((i + 1) % k, 1))\n g[i].append((10 * i % k, 0))\nres = bfs01(g, 1)\nprint((res[0] + 1))\n","fast_code":"from collections import deque\n\n\ndef solve(K):\n checked = [99999999999] * (K + 1)\n queue = deque()\n queue.append((1, 1))\n checked[1] = 1\n while queue:\n x, n = queue.popleft()\n if x == 0:\n return n\n _ = (x * 10) % K\n if n < checked[_]:\n queue.appendleft((_, n))\n checked[_] = n\n _ = (x + 1) % K\n if n + 1 < checked[_]:\n queue.append((_, n + 1))\n checked[_] = n + 1\n return None\n\n\nK = int(eval(input()))\nprint((solve(K)))\n"} +{"fast_code_id":"7faee451372f9fc5e2175ab9caa2f28e2b3b9a04388971bf9ee54fea56cd61f1","fast_id":"p03338_7faee451372f9fc5e2175ab9caa2f28e2b3b9a04388971bf9ee54fea56cd61f1","language":"python","measured_fast_code_id":"7faee451372f9fc5e2175ab9caa2f28e2b3b9a04388971bf9ee54fea56cd61f1","measured_slow_code_id":"b26d7b127a5d896b500dc03a2fa751edc6fb5a11d0b4f6e5d93621ef3ac81957","measurement_metric":"cpu_instruction_count","pair_id":"python_116225e1343d4862dafadfa7","problem_id":"p03338","slow_code_id":"b26d7b127a5d896b500dc03a2fa751edc6fb5a11d0b4f6e5d93621ef3ac81957","slow_id":"p03338_b26d7b127a5d896b500dc03a2fa751edc6fb5a11d0b4f6e5d93621ef3ac81957","speedup":2.627393584115718,"stratum":"2-4","sampling_key":"2b2bc2f376866a5768b31a6bd2bdd4c31a49a32a6bf9814d650755bd99f80425","slow_code":"import collections, sys\n\n\ndef S():\n return sys.stdin.readline().rstrip()\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\nN = I()\nS = S()\nans = 0\nfor i in range(N):\n set_top = set()\n set_bottom = set()\n for s in collections.Counter(S[:i]):\n set_top.add(s)\n for s in collections.Counter(S[i:]):\n set_bottom.add(s)\n ans = max(ans, len(set_top & set_bottom))\nprint(ans)\n","fast_code":"from sys import stdin\n\n\ndef main():\n N = int(stdin.readline().rstrip())\n S = stdin.readline().rstrip()\n print((max([len(set(S[:i]) & set(S[i:])) for i in range(1, N)])))\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"28e9f5b5de0ec96f669439e47f483ca1889df19afb3fbefdc72439020ef1b917","fast_id":"p02789_28e9f5b5de0ec96f669439e47f483ca1889df19afb3fbefdc72439020ef1b917","language":"python","measured_fast_code_id":"28e9f5b5de0ec96f669439e47f483ca1889df19afb3fbefdc72439020ef1b917","measured_slow_code_id":"3b3c9592d05d78419094081aeeb834d7351702df4b6152b2850a5ab58ae1e1e1","measurement_metric":"cpu_instruction_count","pair_id":"python_119113b5120d7d04f9573e1e","problem_id":"p02789","slow_code_id":"b67e95e628852cc5e8281d284b620a3652c42bb82548c79c6e24811247e94916","slow_id":"p02789_3b3c9592d05d78419094081aeeb834d7351702df4b6152b2850a5ab58ae1e1e1","speedup":2171.894796864675,"stratum":"8+","sampling_key":"088b05e6aa2307008b949640e7e8bbde95f26993887e9bbccfcdf677df0573fc","slow_code":"import math\nimport statistics\nimport numpy as np\nimport queue\nimport itertools\n\nn, m = list(map(int, input().split()))\nif n == m:\n print(\"Yes\")\nelse:\n print(\"No\")\n","fast_code":"n, m = list(map(int, input().split()))\nif m == n:\n print(\"Yes\")\nelse:\n print(\"No\")\n"} +{"fast_code_id":"abe6971250a5168c3345542dac01955d0a2ed379b32b6833136e34bfea5a962f","fast_id":"p02982_abe6971250a5168c3345542dac01955d0a2ed379b32b6833136e34bfea5a962f","language":"python","measured_fast_code_id":"abe6971250a5168c3345542dac01955d0a2ed379b32b6833136e34bfea5a962f","measured_slow_code_id":"a2fde493cc245e65f80a5e26468409d95eb61888a7f62c011c34b428b9e87b29","measurement_metric":"cpu_instruction_count","pair_id":"python_1258e3e1f1be2a89a617b66e","problem_id":"p02982","slow_code_id":"a2fde493cc245e65f80a5e26468409d95eb61888a7f62c011c34b428b9e87b29","slow_id":"p02982_a2fde493cc245e65f80a5e26468409d95eb61888a7f62c011c34b428b9e87b29","speedup":7.391713932905539,"stratum":"4-8","sampling_key":"1d6b04576f439623e3f3e65a05d15a31c3492ba7cab243b70af175febf05ec47","slow_code":"n, d = list(map(int, input().split()))\nX = [list(map(int, input().split())) for _ in range(n)]\n\n\ndef dist_squere(x, y):\n d = 0\n for i, j in zip(x, y):\n d += (i - j) ** 2\n return d\n\n\nsquares = set([i * i for i in range(10000)])\n\n\ndef is_square(x):\n return x in squares\n\n\nfrom itertools import combinations\n\nans = 0\nfor x, y in combinations(X, 2):\n if is_square(dist_squere(x, y)):\n ans += 1\nprint(ans)\n","fast_code":"n, d = list(map(int, input().split()))\nxd = [(list(int(_) for _ in input().split())) for i in range(n)]\nans = 0\nfor i in range(n):\n x1 = xd[i]\n for j in range(i + 1, n):\n x2 = xd[j]\n dis = 0\n for x, y in zip(x1, x2):\n dis += (y - x) ** 2\n k = dis**0.5\n if int(k) ** 2 == dis:\n ans += 1\nprint(ans)\n"} +{"fast_code_id":"2890f8e8770efed4f9c4bcfae3a889c8fe41634ad1976e117b0b362228e642bd","fast_id":"p03649_2890f8e8770efed4f9c4bcfae3a889c8fe41634ad1976e117b0b362228e642bd","language":"python","measured_fast_code_id":"2890f8e8770efed4f9c4bcfae3a889c8fe41634ad1976e117b0b362228e642bd","measured_slow_code_id":"78eea1ba264ee8d5c99555a655c3b4489083c9f42d3f79e95c6fb8bcd0af74fd","measurement_metric":"cpu_instruction_count","pair_id":"python_1264b1bf11cf61072c98973b","problem_id":"p03649","slow_code_id":"78eea1ba264ee8d5c99555a655c3b4489083c9f42d3f79e95c6fb8bcd0af74fd","slow_id":"p03649_78eea1ba264ee8d5c99555a655c3b4489083c9f42d3f79e95c6fb8bcd0af74fd","speedup":2.3736151482797436,"stratum":"2-4","sampling_key":"4cff9e795c405d6bc5e83d4f5a5b2317a5ea55057ff79a3f44c9930208486644","slow_code":"N = int(eval(input()))\nA = list(map(int, input().split()))\nans = 0\nwhile any([a > N - 1 for a in A]):\n for i in range(N):\n if A[i] <= N - 1:\n continue\n d = A[i] - (N - 1)\n k = -(-d // N)\n A[i] -= k * N\n ans += k\n for j in range(N):\n if j == i:\n continue\n A[j] += k\nprint(ans)\n","fast_code":"n = int(eval(input()))\na = list(map(int, input().split()))\nans = 0\nwhile True:\n tmp = 0\n for i in range(n):\n k = -(-(a[i] + 1) // n) - 1\n tmp += k\n a[i] -= k * n\n a[i] -= k\n for i in range(n):\n a[i] += tmp\n if not tmp:\n break\n ans += tmp\nprint(ans)\n"} +{"fast_code_id":"cec14fadeb960da889ac6d8504f301209ff7dd15e0a289e10950ca76f7801062","fast_id":"p02994_cec14fadeb960da889ac6d8504f301209ff7dd15e0a289e10950ca76f7801062","language":"python","measured_fast_code_id":"cec14fadeb960da889ac6d8504f301209ff7dd15e0a289e10950ca76f7801062","measured_slow_code_id":"d149410d46bed6b8690e0200021300cc5187b2715c0717e93e6c392866beb39e","measurement_metric":"cpu_instruction_count","pair_id":"python_1280d34a556cbb4d2cbfce96","problem_id":"p02994","slow_code_id":"d149410d46bed6b8690e0200021300cc5187b2715c0717e93e6c392866beb39e","slow_id":"p02994_d149410d46bed6b8690e0200021300cc5187b2715c0717e93e6c392866beb39e","speedup":35.81370504369191,"stratum":"8+","sampling_key":"e3b2847215f5a93ad8aa5fbd9d3aa8d864df4e9bf1bf4b8153185e2170ba1bfb","slow_code":"import copy\n\nN, L = list(map(int, input().split()))\napple_taste = [L + i for i in range(N)]\npie_taste = sum(apple_taste)\nmin_diff = 100000\nfor i in range(N):\n ap = copy.deepcopy(apple_taste)\n ap[i] = 0\n pie_taste2 = sum(ap)\n diff = abs(pie_taste - pie_taste2)\n if diff < min_diff:\n min_diff = diff\n min_index = i\napple_taste[min_index] = 0\nprint((sum(apple_taste)))\n","fast_code":"n, l = list(map(int, input().split()))\npi = 0\na = []\nabs_a = []\nfor i in range(1, n + 1):\n pi += l + i - 1\nfor i in range(1, n + 1):\n a.append(l + i - 1)\nfor i in range(n):\n abs_a.append(abs(a[i]))\nif max(a) < 0:\n p = pi + min(abs_a)\nelse:\n p = pi - min(abs_a)\nprint(p)\n"} +{"fast_code_id":"59a94b8cb65728097b93a688b3d7c6394cb5effac575c6c22c4819145671ca83","fast_id":"p01314_59a94b8cb65728097b93a688b3d7c6394cb5effac575c6c22c4819145671ca83","language":"python","measured_fast_code_id":"59a94b8cb65728097b93a688b3d7c6394cb5effac575c6c22c4819145671ca83","measured_slow_code_id":"8eb439b03ab1b781f0fa01d6e10a84c9c2fc68f2233f33f28717d014574ec791","measurement_metric":"cpu_instruction_count","pair_id":"python_1293235894ca0cf372a52039","problem_id":"p01314","slow_code_id":"8eb439b03ab1b781f0fa01d6e10a84c9c2fc68f2233f33f28717d014574ec791","slow_id":"p01314_8eb439b03ab1b781f0fa01d6e10a84c9c2fc68f2233f33f28717d014574ec791","speedup":76.8831951077933,"stratum":"8+","sampling_key":"200a3643025fa5f143b9176889b9d8407e04cf8a96df8c9c46239bc51cca845a","slow_code":"if __name__ == \"__main__\":\n while True:\n n = int(eval(input()))\n if n == 0:\n break\n count = 0\n for i in range(1, n):\n for j in range(i + 1, n):\n sum = (i + j) * (j - i + 1) / 2\n if sum > n:\n break\n if sum == n:\n count += 1\n print(count)\n","fast_code":"import math\n\nwhile 1:\n n = int(input())\n if not n:\n break\n ans = 0\n for p in range(1, int(math.sqrt(2 * n)) + 1):\n if 2 * n % p == 0:\n q = 2 * n / p\n if p > 1 and (p + q) % 2:\n ans += 1\n print(ans)\n"} +{"fast_code_id":"9be3e85bb4f73050fdc51c366f634f667cb8ba526fc7854a141593a5c71a9124","fast_id":"p03209_efce5c04d3f8c3b603a0f2d9c00b022768186d0b46c0f67e61e6cd9427e306b2","language":"python","measured_fast_code_id":"efce5c04d3f8c3b603a0f2d9c00b022768186d0b46c0f67e61e6cd9427e306b2","measured_slow_code_id":"d810806da4e3ff396dd2f9e6a8463b4981d8f62dd34c3ba133bb44352184e910","measurement_metric":"cpu_instruction_count","pair_id":"python_131850dfce6106959ac2ed3e","problem_id":"p03209","slow_code_id":"dbd3b0158d3748e0d99cec055f9e692949bfea6a1e16dd750ed0447f840bf070","slow_id":"p03209_d810806da4e3ff396dd2f9e6a8463b4981d8f62dd34c3ba133bb44352184e910","speedup":2.9820841177610258,"stratum":"2-4","sampling_key":"3d225bc162420999ef1452c24e061cc05bad95421118e733ffe25b482ecef184","slow_code":"N, X = list(map(int, input().split()))\n\nT = [1]\nfor i in range(1, 50 + 1):\n T.append(T[i - 1] * 2 + 3)\n\n\ndef hash(n, x):\n return \"{0:d},{1:d}\".format(n, x)\n\n\nmemo = dict()\n\n\ndef solve(n, x):\n global T, memo\n if hash(n, x) in memo:\n return memo[hash(n, x)]\n if n == 0 and x >= 1:\n memo[hash(n, x)] = 1\n return 1\n if x <= 1:\n memo[hash(n, x)] = 0\n return 0\n memo[hash(n, x)] = solve(n - 1, min(x - 1, T[n - 1]))\n if x >= T[n - 1] + 2:\n memo[hash(n, x)] += 1\n if x >= T[n - 1] + 3:\n memo[hash(n, x)] += solve(n - 1, min(x - 1 - T[n - 1] - 1, T[n - 1]))\n return memo[hash(n, x)]\n\n\nprint((solve(N, X)))\n","fast_code":"N, X = list(map(int, input().split()))\n\na, p = [1], [1]\nfor i in range(N):\n a.append(a[i] * 2 + 3)\n p.append(p[i] * 2 + 1)\n\n\ndef f(N, X):\n\n if N == 0:\n if X <= 0:\n return 0\n else:\n return 1\n elif X <= 1 + a[N - 1]:\n return f(N - 1, X - 1)\n else:\n return p[N - 1] + 1 + f(N - 1, X - 2 - a[N - 1])\n\n\nprint((f(N, X)))\n"} +{"fast_code_id":"ef1c28ef48931930eb7ce24038e625888f0f8676c6c52b301f6f650ffbd6b3a4","fast_id":"p03566_2872c8f1cd410c9c29ad2d7bf9df4f8977d8d4f7c0c79a70b6c8f20aa8f1d2de","language":"python","measured_fast_code_id":"2872c8f1cd410c9c29ad2d7bf9df4f8977d8d4f7c0c79a70b6c8f20aa8f1d2de","measured_slow_code_id":"e080acc822dc90b94acbd1874bafc617cc0405efef250948b23c795bba65bd1b","measurement_metric":"cpu_instruction_count","pair_id":"python_132662244e6738f2e2271006","problem_id":"p03566","slow_code_id":"e080acc822dc90b94acbd1874bafc617cc0405efef250948b23c795bba65bd1b","slow_id":"p03566_e080acc822dc90b94acbd1874bafc617cc0405efef250948b23c795bba65bd1b","speedup":6.102811661344091,"stratum":"4-8","sampling_key":"5d2a08db7c2b939cfba12955fe93b0bf33dbfbfe6e6590a48d0f98d5202f6ac7","slow_code":"import heapq\n\nn = int(eval(input()))\ninf = 10000000000000\nans = [[-1, -1] for i in range(n)]\nans[-1][1], ans[0][0] = 0, 0\nt = list(map(int, input().split()))\nv = list(map(int, input().split()))\nv2 = []\nfor i in range(n):\n heapq.heappush(v2, (v[i], i))\n\n\ndef next(y, wh):\n global ans, n\n ansi = inf\n if wh:\n r1, r2 = list(range(y[1] - 1, -1, -1)), list(range(y[1], n))\n else:\n r1, r2 = list(range(y[1], -1, -1)), list(range(y[1] + 1, n))\n now = 0\n for j in r1:\n if ans[j][1] != -1:\n ansi = min(ansi, ans[j][1] + now)\n now += t[j]\n if ans[j][0] != -1:\n ansi = min(ansi, ans[j][0] + now)\n now = 0\n for j in r2:\n if ans[j][0] != -1:\n ansi = min(ansi, ans[j][0] + now)\n now += t[j]\n if ans[j][1] != -1:\n ansi = min(ansi, ans[j][1] + now)\n if wh:\n ans[y[1]][0] = min(ansi, y[0])\n ans[y[1] - 1][1] = ans[y[1]][0]\n else:\n ans[y[1]][1] = min(ansi, y[0])\n ans[y[1] + 1][0] = ans[y[1]][1]\n\n\nfor i in range(n):\n y = heapq.heappop(v2)\n if ans[y[1]][0] == -1:\n next(y, True)\n if ans[y[1]][1] == -1:\n next(y, False)\nanswer = 0\nfor i in range(n):\n h = min((t[i] + sum(ans[i])) / 2, v[i])\n answer += (h**2 - ans[i][0] ** 2) / 2\n answer += (h**2 - ans[i][1] ** 2) / 2\n answer += h * (t[i] + sum(ans[i]) - 2 * h)\nprint(answer)\n","fast_code":"N = int(eval(input()))\nt = [0] + list(map(int, input().split()))\nv = [0] + list(map(int, input().split()))\nmax_speed_from_left = [0] * (N + 1)\nmax_speed_from_right = [0] * (N + 1)\nfor i in range(1, N):\n start = max_speed_from_left[i - 1]\n max_speed_from_left[i] = min(start + t[i], v[i], v[i + 1])\nfor i in range(N - 1, 0, -1):\n start = max_speed_from_right[i + 1]\n max_speed_from_right[i] = min(start + t[i + 1], v[i], v[i + 1])\nspeed = [min(x, y) for x, y in zip(max_speed_from_left, max_speed_from_right)]\n\n\ndef dist(left_speed, right_speed, t, v):\n x = (v - left_speed) + (v - right_speed)\n if x >= t:\n v = (left_speed + right_speed + t) / 2\n x = t\n\n d = (left_speed + v) * (v - left_speed) / 2\n d += v * (t - x)\n d += (right_speed + v) * (v - right_speed) / 2\n return d\n\n\nans = 0\nfor i in range(1, N + 1):\n ans += dist(speed[i - 1], speed[i], t[i], v[i])\nprint(ans)\n"} +{"fast_code_id":"385f918e70558d30ce24cedf0de5f4a96a7aad60475bd5eec62a4ce0ebe4edee","fast_id":"p02881_385f918e70558d30ce24cedf0de5f4a96a7aad60475bd5eec62a4ce0ebe4edee","language":"python","measured_fast_code_id":"385f918e70558d30ce24cedf0de5f4a96a7aad60475bd5eec62a4ce0ebe4edee","measured_slow_code_id":"59afd1990aed2abbcad83b7d4f6a1ac5d50dc6bca1f8640231c0a3d4aa8d5485","measurement_metric":"cpu_instruction_count","pair_id":"python_13d78436aa263b8f50dd9a6f","problem_id":"p02881","slow_code_id":"59afd1990aed2abbcad83b7d4f6a1ac5d50dc6bca1f8640231c0a3d4aa8d5485","slow_id":"p02881_59afd1990aed2abbcad83b7d4f6a1ac5d50dc6bca1f8640231c0a3d4aa8d5485","speedup":6.6469393325221935,"stratum":"4-8","sampling_key":"6791c8a811169c88729f9f2dfba63b86580a9b71065738965c533c83cfb004a5","slow_code":"def main():\n N = int(eval(input()))\n loop = int(N**0.5)\n ans = float(\"inf\")\n for i in range(1, loop + 1):\n if N % i == 0:\n j = N // i\n tmp = i + j - 2\n if tmp < ans:\n ans = tmp\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"N = int(eval(input()))\nx = int(N**0.5)\nfor i in range(x, 0, -1):\n if N % i == 0:\n y = N // i\n break\nans = N // y + y - 2\nprint(ans)\n"} +{"fast_code_id":"fd102ef97ba97e59a8cb9663116d750b8a6e9941777a02669909b41cee16cf37","fast_id":"p03449_fd102ef97ba97e59a8cb9663116d750b8a6e9941777a02669909b41cee16cf37","language":"python","measured_fast_code_id":"fd102ef97ba97e59a8cb9663116d750b8a6e9941777a02669909b41cee16cf37","measured_slow_code_id":"767d751ee2ecf877ec0fcce527cb6e9543e55168be5a140790386377376e0eb2","measurement_metric":"cpu_instruction_count","pair_id":"python_13f0713d04663de04fe64656","problem_id":"p03449","slow_code_id":"767d751ee2ecf877ec0fcce527cb6e9543e55168be5a140790386377376e0eb2","slow_id":"p03449_767d751ee2ecf877ec0fcce527cb6e9543e55168be5a140790386377376e0eb2","speedup":7.651259408904642,"stratum":"4-8","sampling_key":"192a09cad0493cab37df6a17fa1ba4db7c13d9c8e7101b48e5cb33c3bd4c619c","slow_code":"import sys\nfrom collections import deque\n\n\ndef solve():\n input = sys.stdin.readline\n N = int(eval(input()))\n A = [[int(a) for a in input().split()] for _ in range(2)]\n move = ((1, 0), (0, 1))\n maxN = [[0 for _ in range(N)] for i in range(2)]\n q = deque()\n q.append((0, 0, A[0][0]))\n while q:\n nx, ny, np = q.popleft()\n maxN[nx][ny] = max(maxN[nx][ny], np)\n for dx, dy in move:\n if 0 <= nx + dx < 2 and 0 <= ny + dy < N:\n q.append((nx + dx, ny + dy, maxN[nx][ny] + A[nx + dx][ny + dy]))\n print((maxN[1][N - 1]))\n return 0\n\n\nif __name__ == \"__main__\":\n solve()\n","fast_code":"N = int(eval(input()))\nnum_list = []\nwhile True:\n try:\n num_list.append(list(map(int, input().split())))\n except:\n break\nsum_list = []\nfor k in range(N):\n sum_list.append(sum(num_list[0][0 : k + 1]) + sum(num_list[1][k : N + 1]))\nprint((max(sum_list)))\n"} +{"fast_code_id":"f5a6f4a20bcb291d51ed4b41a259d1447b4dc28eed22e16561ebb79ad2c5b137","fast_id":"p03502_f5a6f4a20bcb291d51ed4b41a259d1447b4dc28eed22e16561ebb79ad2c5b137","language":"python","measured_fast_code_id":"f5a6f4a20bcb291d51ed4b41a259d1447b4dc28eed22e16561ebb79ad2c5b137","measured_slow_code_id":"9657e24fd296bdb183cb812efcaa41e0e4d09edff18e911040359edf4aba2689","measurement_metric":"cpu_instruction_count","pair_id":"python_141508992e0aaf5f237ea809","problem_id":"p03502","slow_code_id":"04afcb0636d6758b9c1fd4024fff2537c6c73d327a7f8a692ef75cf80e1d3933","slow_id":"p03502_9657e24fd296bdb183cb812efcaa41e0e4d09edff18e911040359edf4aba2689","speedup":30.343855406270176,"stratum":"8+","sampling_key":"8e0769b402486dd83aa0aea10acaf40f3cdaaa8074124314de23fb8a20433fee","slow_code":"import sys\nimport math\nimport collections\nimport itertools\nimport array\nimport inspect\n\n\nsys.setrecursionlimit(10000)\n\n\ndef chkprint(*args):\n names = {id(v): k for k, v in list(inspect.currentframe().f_back.f_locals.items())}\n print((\", \".join(names.get(id(arg), \"???\") + \" = \" + repr(arg) for arg in args)))\n\n\ndef to_bin(x):\n return bin(x)[2:]\n\n\ndef li_input():\n return [int(_) for _ in input().split()]\n\n\ndp = None\n\n\ndef main():\n X = int(eval(input()))\n if X % sum(list(map(int, list(str(X))))) == 0:\n print(\"Yes\")\n else:\n print(\"No\")\n\n\nmain()\n","fast_code":"import sys\n\nread = sys.stdin.read\nreadlines = sys.stdin.readlines\n\n\ndef main():\n n = int(eval(input()))\n nc = n\n ncsum = 0\n while nc:\n ncsum += nc % 10\n nc = nc // 10\n if n % ncsum == 0:\n print(\"Yes\")\n else:\n print(\"No\")\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"e0fa847e60d2870979ac5806f4074b1901b3baf745d74390f152cbba1ed85f05","fast_id":"p03807_e1aed6b1a3c14e7b530c910a8a0f3d560e1c98d418024108fd157091b21ca2fa","language":"python","measured_fast_code_id":"e1aed6b1a3c14e7b530c910a8a0f3d560e1c98d418024108fd157091b21ca2fa","measured_slow_code_id":"8baca45625cd0c593d3689761edf66d3fece4f44f81b27a47e938cff4b898bb0","measurement_metric":"cpu_instruction_count","pair_id":"python_1454f4fd51890242dcc9f49e","problem_id":"p03807","slow_code_id":"8baca45625cd0c593d3689761edf66d3fece4f44f81b27a47e938cff4b898bb0","slow_id":"p03807_8baca45625cd0c593d3689761edf66d3fece4f44f81b27a47e938cff4b898bb0","speedup":5.346525004697128,"stratum":"4-8","sampling_key":"ff3e426bc8cf41e94c2aff7c92cd1edda1f56d85acdafe4247748f5e406d9818","slow_code":"import sys\nimport bisect\nimport collections\nimport fractions\nimport heapq\n\n\ndef slove():\n input = sys.stdin.readline\n n = int(input().rstrip(\"\\n\"))\n a = list(map(int, input().rstrip(\"\\n\").split()))\n cnt = 0\n for i in range(n):\n if a[i] % 2 != 0:\n cnt += 1\n if cnt % 2 == 0:\n print(\"YES\")\n else:\n print(\"NO\")\n\n\nif __name__ == \"__main__\":\n slove()\n","fast_code":"import sys\n\nn = sys.stdin.readline().rstrip()\nnums = (int(i) for i in sys.stdin.readline().rstrip().split())\nif sum(nums) % 2 == 0:\n print(\"YES\")\nelse:\n print(\"NO\")\n"} +{"fast_code_id":"f7906a09151fab400b6547bf06f2749bfbc12740deab8aee67e2f15ffdabe2ee","fast_id":"p03835_f7906a09151fab400b6547bf06f2749bfbc12740deab8aee67e2f15ffdabe2ee","language":"python","measured_fast_code_id":"f7906a09151fab400b6547bf06f2749bfbc12740deab8aee67e2f15ffdabe2ee","measured_slow_code_id":"c91016cfb4e5e1b40a603c119f92818d382f3e7e9567a5a9fd48af9c96a44f4c","measurement_metric":"cpu_instruction_count","pair_id":"python_146d66684271e41bae2c24eb","problem_id":"p03835","slow_code_id":"c91016cfb4e5e1b40a603c119f92818d382f3e7e9567a5a9fd48af9c96a44f4c","slow_id":"p03835_c91016cfb4e5e1b40a603c119f92818d382f3e7e9567a5a9fd48af9c96a44f4c","speedup":861.9366177741206,"stratum":"8+","sampling_key":"0dae11906d6d243ee550a9b7c3ddbe9f1d96eb63537aadae94a33825336608dc","slow_code":"K, S = list(map(int, input().split()))\nans = 0\nfor x in range(K + 1):\n for y in range(K + 1):\n z = S - x - y\n if 0 <= z and z <= K:\n ans += 1\nprint(ans)\n","fast_code":"k, s = list(map(int, input().split()))\ncnt = 0\nminX = max(s - 2 * k, 0)\nmaxX = min(s, k)\nfor x in range(minX, maxX + 1):\n rest = s - x\n if k >= rest:\n cnt += rest + 1\n else:\n cnt += 2 * k - rest + 1\nprint(cnt)\n"} +{"fast_code_id":"051dd963702238662fe96a84ebc1ca74f3c157f8cf8eec6769e928924a370a63","fast_id":"p03298_822b320890b4640a82e0d7980e120614b4f10c9398150508b25e66c5600d4e83","language":"python","measured_fast_code_id":"822b320890b4640a82e0d7980e120614b4f10c9398150508b25e66c5600d4e83","measured_slow_code_id":"a60649ff5c12e1eab3299c9c7a6614aed032b82f524d1da40bab14de5370e42a","measurement_metric":"cpu_instruction_count","pair_id":"python_149da566ab804df502f693b3","problem_id":"p03298","slow_code_id":"002d9d5a9cdc2eed9fd14639fc4309e77e7ea367b7a6bf911a50251677db836f","slow_id":"p03298_a60649ff5c12e1eab3299c9c7a6614aed032b82f524d1da40bab14de5370e42a","speedup":2.182707748440734,"stratum":"2-4","sampling_key":"1fcfa77f89f71349d690c96fd12396a959854479fdd3c7f11d43987f946f9ea2","slow_code":"from collections import defaultdict, deque\nfrom heapq import heappush, heappop\nimport sys\nimport math\nimport bisect\nimport random\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LS():\n return [list(x) for x in sys.stdin.readline().split()]\n\n\ndef S():\n res = list(sys.stdin.readline())\n if res[-1] == \"\\n\":\n return res[:-1]\n return res\n\n\ndef IR(n):\n return [I() for i in range(n)]\n\n\ndef LIR(n):\n return [LI() for i in range(n)]\n\n\ndef SR(n):\n return [S() for i in range(n)]\n\n\ndef LSR(n):\n return [LS() for i in range(n)]\n\n\nsys.setrecursionlimit(1000000)\nmod = 1000000007\n\n\ndef A():\n return\n\n\ndef B():\n return\n\n\ndef C():\n n = I()\n s = S()\n d = defaultdict(lambda: 0)\n alp = list(\"abcdefghijklmnopqrstuvwxyz\")\n f = {}\n for i in range(26):\n f[alp[i]] = i + 1\n for i in range(2 * n):\n s[i] = f[s[i]]\n for i in range(n >> 1):\n s[i], s[n - i - 1] = s[n - i - 1], s[i]\n k = 27\n m = 1 << n\n p = [1 << j for j in range(n)]\n for i in range(m):\n r = 0\n b = 0\n for j in range(n):\n if i & p[j]:\n r *= k\n r += s[j]\n else:\n b *= k\n b += s[j]\n d[(r, b)] += 1\n ans = 0\n for i in range(m):\n r = 0\n b = 0\n for j in range(n):\n if i & p[j]:\n r *= k\n r += s[j + n]\n else:\n b *= k\n b += s[j + n]\n ans += d[(r, b)]\n print(ans)\n return\n\n\ndef D():\n return\n\n\ndef E():\n return\n\n\ndef F():\n return\n\n\nif __name__ == \"__main__\":\n C()\n","fast_code":"from collections import defaultdict, deque\nfrom heapq import heappush, heappop\nimport sys\nimport math\nimport bisect\nimport random\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LS():\n return [list(x) for x in sys.stdin.readline().split()]\n\n\ndef S():\n res = list(sys.stdin.readline())\n if res[-1] == \"\\n\":\n return res[:-1]\n return res\n\n\ndef IR(n):\n return [I() for i in range(n)]\n\n\ndef LIR(n):\n return [LI() for i in range(n)]\n\n\ndef SR(n):\n return [S() for i in range(n)]\n\n\ndef LSR(n):\n return [LS() for i in range(n)]\n\n\nsys.setrecursionlimit(1000000)\nmod = 1000000007\n\n\ndef A():\n return\n\n\ndef B():\n return\n\n\ndef C():\n n = I()\n s = S()\n for i in range(2 * n):\n s[i] = ord(s[i]) - 96\n k = 27\n m = 1 << n\n p = [1 << j for j in range(n)]\n d = defaultdict(lambda: 0)\n l = [(0, 0)]\n for i in s[:n][::-1]:\n l = [(x[0] * k + i, x[1]) for x in l] + [(x[0], x[1] * k + i) for x in l]\n for i in l:\n d[i] += 1\n ans = 0\n l = [(0, 0)]\n for i in s[n:]:\n l = [(x[0] * k + i, x[1]) for x in l] + [(x[0], x[1] * k + i) for x in l]\n for i in l:\n ans += d[i]\n print(ans)\n return\n\n\ndef D():\n return\n\n\ndef E():\n return\n\n\ndef F():\n return\n\n\nif __name__ == \"__main__\":\n C()\n"} +{"fast_code_id":"7b79d1abbb88b784494d168a1fc90bff32bf43f6e27b8ca8d46714b8572a4dbe","fast_id":"p02725_7b79d1abbb88b784494d168a1fc90bff32bf43f6e27b8ca8d46714b8572a4dbe","language":"python","measured_fast_code_id":"7b79d1abbb88b784494d168a1fc90bff32bf43f6e27b8ca8d46714b8572a4dbe","measured_slow_code_id":"91accdad635aaade3cd21a1cbe15f0f073859089779275b1b10043afbdc41816","measurement_metric":"cpu_instruction_count","pair_id":"python_14a10d7d9d16f58df5ae7cc5","problem_id":"p02725","slow_code_id":"91accdad635aaade3cd21a1cbe15f0f073859089779275b1b10043afbdc41816","slow_id":"p02725_91accdad635aaade3cd21a1cbe15f0f073859089779275b1b10043afbdc41816","speedup":32.90266341416066,"stratum":"8+","sampling_key":"05b2bdc5036ca39274ae3e3c4b87f47d43cd5f069660e2a28dcad83d10da111e","slow_code":"import numpy as np\n\nK, N = list(map(int, input().split()))\nA = list(map(int, input().split()))\nA.append(K + A[0])\nD = np.diff(A)\nprint((int(K) - np.max(D)))\n","fast_code":"k, n = list(map(int, input().split()))\na = list(map(int, input().rstrip().split()))\ntemp = a[0] + k - a[n - 1]\nfor i in range(n - 1):\n temp = max(temp, a[i + 1] - a[i])\nprint((k - temp))\n"} +{"fast_code_id":"12a73a8acfa07f30639f186d47d681f3412c7c6de111ff783aa0e2c3ad3f87eb","fast_id":"p02724_12a73a8acfa07f30639f186d47d681f3412c7c6de111ff783aa0e2c3ad3f87eb","language":"python","measured_fast_code_id":"12a73a8acfa07f30639f186d47d681f3412c7c6de111ff783aa0e2c3ad3f87eb","measured_slow_code_id":"8e66543c4bfccd29b9635f672d4f7cfeb7472d55523631a6fef9ea761e351dd5","measurement_metric":"cpu_instruction_count","pair_id":"python_14ca53ef996580ee3f957327","problem_id":"p02724","slow_code_id":"ce23ce9602140709d4fba80da208b63c8ba5d91a22dfdb9a0bca025c1f37682a","slow_id":"p02724_8e66543c4bfccd29b9635f672d4f7cfeb7472d55523631a6fef9ea761e351dd5","speedup":3648.306602545967,"stratum":"8+","sampling_key":"d75116e45422c80fc37b793ccbf9169b31699795c04f305a728bde6d301e0fed","slow_code":"def main():\n X = int(eval(input()))\n\n pmax = int(X / 500)\n ans = 0\n tmp = 0\n for p in range(pmax + 1):\n q = int((X - 500 * p) / 5)\n tmp = 1000 * p + 5 * q\n ans = max(ans, tmp)\n print(ans)\n\n\nmain()\n","fast_code":"x = int(eval(input()))\nprint((1000 * (x // 500) + 5 * ((x // 5) % 100)))\n"} +{"fast_code_id":"bd2f23791d3c2e6f8ca046d0d74149d26f8793e5e97d3905c1acd4d775938e74","fast_id":"p02780_bd2f23791d3c2e6f8ca046d0d74149d26f8793e5e97d3905c1acd4d775938e74","language":"python","measured_fast_code_id":"bd2f23791d3c2e6f8ca046d0d74149d26f8793e5e97d3905c1acd4d775938e74","measured_slow_code_id":"f0e0a2a27a21da5cf3bfa118c0651e9d7851f3f79494b7c4374dbb95d552c6f4","measurement_metric":"cpu_instruction_count","pair_id":"python_15757e254469b9b123225643","problem_id":"p02780","slow_code_id":"f0e0a2a27a21da5cf3bfa118c0651e9d7851f3f79494b7c4374dbb95d552c6f4","slow_id":"p02780_f0e0a2a27a21da5cf3bfa118c0651e9d7851f3f79494b7c4374dbb95d552c6f4","speedup":4.928358762587977,"stratum":"4-8","sampling_key":"6b8b6739b0062b784d1ff728336eee64e5f53ade0bc0bc1a1e6b65e5bb613610","slow_code":"class BIT:\n def __init__(self, n):\n self.node = [0 for _ in range(n + 1)]\n\n def add(self, idx, w):\n i = idx\n while i < len(self.node) - 1:\n self.node[i] += w\n i |= i + 1\n\n def sum_(self, idx):\n ret, i = 0, idx - 1\n while i >= 0:\n ret += self.node[i]\n i = (i & (i + 1)) - 1\n return ret\n\n def sum(self, l, r):\n return self.sum_(r) - self.sum_(l)\n\n\nn, k = list(map(int, input().split()))\ntree = BIT(n)\np = [int(x) for x in input().split()]\nfor i in range(n):\n tree.add(i, (1 + p[i]) / 2)\nans = 0\nfor i in range(n - k + 1):\n ans = max(ans, tree.sum(i, i + k))\nprint(ans)\n","fast_code":"N, K = list(map(int, input().split()))\np = list(map(int, input().split()))\nexp = [(1 + p[i]) / 2 for i in range(N)]\ns = sum(exp[:K])\nans = s\nfor i in range(K, N):\n s -= exp[i - K]\n s += exp[i]\n ans = max(ans, s)\nprint(ans)\n"} +{"fast_code_id":"f9cafd9d8dce68b230b9b99bbd992611304ab19e259b30cf8ca6a1c29fa0d18e","fast_id":"p02417_f9cafd9d8dce68b230b9b99bbd992611304ab19e259b30cf8ca6a1c29fa0d18e","language":"python","measured_fast_code_id":"f9cafd9d8dce68b230b9b99bbd992611304ab19e259b30cf8ca6a1c29fa0d18e","measured_slow_code_id":"aa76306aa0e70ffadb4879692847e221ecaf4844786582d5b3b47cf7bba7ed5d","measurement_metric":"cpu_instruction_count","pair_id":"python_1586804acf220f8a62e556da","problem_id":"p02417","slow_code_id":"aa76306aa0e70ffadb4879692847e221ecaf4844786582d5b3b47cf7bba7ed5d","slow_id":"p02417_aa76306aa0e70ffadb4879692847e221ecaf4844786582d5b3b47cf7bba7ed5d","speedup":65.53905998339458,"stratum":"8+","sampling_key":"3f307ae03a6bd81002ba9f740066c9d1ef4fdb5c76ca36ccefc4602b308cd510","slow_code":"import sys\n\naz = [\n \"a\",\n \"b\",\n \"c\",\n \"d\",\n \"e\",\n \"f\",\n \"g\",\n \"h\",\n \"i\",\n \"j\",\n \"k\",\n \"l\",\n \"m\",\n \"n\",\n \"o\",\n \"p\",\n \"q\",\n \"r\",\n \"s\",\n \"t\",\n \"u\",\n \"v\",\n \"w\",\n \"x\",\n \"y\",\n \"z\",\n]\nsum_az = [0 for x in range(26)]\nfor x in sys.stdin.read().lower():\n for i in range(26):\n for j in range(len(x)):\n if x[j] == az[i]:\n sum_az[i] += 1\nfor i in range(26):\n print((\"%s : %d\" % (az[i], sum_az[i])))\n","fast_code":"alpha = \"abcdefghijklmnopqrstuvwxyz\"\ntext = \"\"\nwhile True:\n try:\n text += input().lower()\n except:\n break\nfor key in alpha:\n print((\"{} : {}\".format(key, text.count(key))))\n"} +{"fast_code_id":"11386287f983ecaed199b45f8c45c3353a61aefe521f21479373527f68f13aa1","fast_id":"p03786_11386287f983ecaed199b45f8c45c3353a61aefe521f21479373527f68f13aa1","language":"python","measured_fast_code_id":"11386287f983ecaed199b45f8c45c3353a61aefe521f21479373527f68f13aa1","measured_slow_code_id":"01e4e104b8cffd408e37f15b9026d222331aea634f5f65862577d6e6a8a42837","measurement_metric":"cpu_instruction_count","pair_id":"python_1587fe670dd3fe7300a42967","problem_id":"p03786","slow_code_id":"01e4e104b8cffd408e37f15b9026d222331aea634f5f65862577d6e6a8a42837","slow_id":"p03786_01e4e104b8cffd408e37f15b9026d222331aea634f5f65862577d6e6a8a42837","speedup":143.04607166289418,"stratum":"8+","sampling_key":"0b15b446cb14c0cdeff68bda420be87eff8f96a889e765f33c511adf2beee248","slow_code":"import numpy as np\n\nN = int(eval(input()))\nA = list(map(int, input().split()))\nA = sorted(A)\nC = np.cumsum(A)\nans = 0\ncnt = 0\nfor i in range(N - 1):\n if C[i] * 2 >= A[i + 1]:\n cnt += 1\n else:\n cnt = 0\nans = cnt + 1\nprint(ans)\n","fast_code":"import sys\n\nreadline = sys.stdin.readline\nN = int(readline())\nA = list(map(int, readline().split()))\nA = sorted(A)\ncur = 0\nng = 0\nfor i in range(N):\n if A[i] > cur * 2:\n ng = i\n cur += A[i]\nprint((N - ng))\n"} +{"fast_code_id":"c83f5f098ab8d0cc6a50842b83864e96ec3fa4e9c6971d07a3acead1186e98ed","fast_id":"p03762_517ab4861336162e327cb611a73cbb608c1cf52da44cf81e075e1e7054e6a8f1","language":"python","measured_fast_code_id":"517ab4861336162e327cb611a73cbb608c1cf52da44cf81e075e1e7054e6a8f1","measured_slow_code_id":"982e2a132ff9a9ee086902a77e4d38984ae35b417d1949db3c426a0eec331800","measurement_metric":"cpu_instruction_count","pair_id":"python_15a07e6ce36dade7f4fec74d","problem_id":"p03762","slow_code_id":"982e2a132ff9a9ee086902a77e4d38984ae35b417d1949db3c426a0eec331800","slow_id":"p03762_982e2a132ff9a9ee086902a77e4d38984ae35b417d1949db3c426a0eec331800","speedup":4.4822597668622155,"stratum":"4-8","sampling_key":"d90a66bd326fef454afc0bd518bdf6312f02fe80f005ef1d945f6cfa5d475d62","slow_code":"import sys\nimport numpy as np\n\nMOD = 10**9 + 7\nI = np.array(sys.stdin.read().split(), dtype=np.int64)\nn, m = I[:2]\nx = I[2 : 2 + n]\ny = I[2 + n :]\n\n\ndef main():\n sx = np.cumsum(x) % MOD\n sy = np.cumsum(y) % MOD\n sdx = (\n np.sum((sx[n - 1] - sx[: n - 1]) - x[: n - 1] * ((n - 1) - np.arange(n - 1)))\n % MOD\n )\n sdy = (\n np.sum((sy[m - 1] - sy[: m - 1]) - y[: m - 1] * ((m - 1) - np.arange(m - 1)))\n % MOD\n )\n ans = sdx * sdy % MOD\n return ans\n\n\nif __name__ == \"__main__\":\n ans = main()\n print(ans)\n","fast_code":"import sys\n\n\ndef MI():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\nn, m = MI()\nx, y = LI(), LI()\nmod = 10**9 + 7\nn, m = n - 1, m - 1\ndx = [x[i + 1] - x[i] for i in range(n)]\ndy = [y[i + 1] - y[i] for i in range(m)]\nif n % 2 == 0:\n rx = [i * (n + 1 - i) for i in range(1, n // 2 + 1)] + [\n i * (n + 1 - i) for i in range(n // 2, 0, -1)\n ]\nelse:\n rx = [i * (n + 1 - i) for i in range(1, n // 2 + 2)] + [\n i * (n + 1 - i) for i in range(n // 2, 0, -1)\n ]\nif m % 2 == 0:\n ry = [i * (m + 1 - i) for i in range(1, m // 2 + 1)] + [\n i * (m + 1 - i) for i in range(m // 2, 0, -1)\n ]\nelse:\n ry = [i * (m + 1 - i) for i in range(1, m // 2 + 2)] + [\n i * (m + 1 - i) for i in range(m // 2, 0, -1)\n ]\na = 0\nfor i, j in zip(dx, rx):\n a += i * j\n a %= mod\nb = 0\nfor i, j in zip(dy, ry):\n b += i * j\n b %= mod\nprint(((a * b) % mod))\n"} +{"fast_code_id":"37c9fac7ead0f2b6da6ea26ddf52b35d4ead2ab1d3996a57bd40fb1183e5553a","fast_id":"p02555_37c9fac7ead0f2b6da6ea26ddf52b35d4ead2ab1d3996a57bd40fb1183e5553a","language":"python","measured_fast_code_id":"37c9fac7ead0f2b6da6ea26ddf52b35d4ead2ab1d3996a57bd40fb1183e5553a","measured_slow_code_id":"f3a9f382ebbb57dd2ccfef10f0dd3bab2793e452b41de4dce23dea9cead841b2","measurement_metric":"cpu_instruction_count","pair_id":"python_15dcfc2113d57ef13b52caf7","problem_id":"p02555","slow_code_id":"f3a9f382ebbb57dd2ccfef10f0dd3bab2793e452b41de4dce23dea9cead841b2","slow_id":"p02555_f3a9f382ebbb57dd2ccfef10f0dd3bab2793e452b41de4dce23dea9cead841b2","speedup":794.1365593641225,"stratum":"8+","sampling_key":"2f1664151f4357989f0c841fe8dd944e99066658f8beddc3cef8b14901ac37b1","slow_code":"S = int(eval(input()))\nM = 10**9 + 7\n\n\ndef mod_pow(a, b, mod):\n bin_b = []\n while b:\n bin_b.append(b % 2)\n b >>= 1\n ret = 1\n for j in reversed(bin_b):\n ret = (ret * ret) % mod\n if j == 1:\n ret = (ret * a) % mod\n return ret\n\n\ndef mod_comb(n, k, mod):\n ret = 1\n for i in range(1, k + 1):\n ret = (ret * (n + 1 - i)) % mod\n ret = (ret * mod_pow(i, mod - 2, mod)) % mod\n return ret\n\n\nans = 0\nfor K in range(1, S // 3 + 1):\n ans = (ans + mod_comb(S - 2 * K - 1, K - 1, M)) % M\nprint(ans)\n","fast_code":"s = int(eval(input()))\na = [0] * 2001\na[3] = 1\nfor i in range(4, s + 1):\n a[i] = a[i - 3] + a[i - 1]\nmod = 10**9 + 7\nprint((a[s] % mod))\n"} +{"fast_code_id":"34601d7d7dc7f83aef53e359ec2ed8a32edd50465c515fd44ebde89f61ae42bc","fast_id":"p02821_34601d7d7dc7f83aef53e359ec2ed8a32edd50465c515fd44ebde89f61ae42bc","language":"python","measured_fast_code_id":"34601d7d7dc7f83aef53e359ec2ed8a32edd50465c515fd44ebde89f61ae42bc","measured_slow_code_id":"fdc3796f3095f69c7c3457ec5786e03ef47ca806aaa691afbc3f4956f2a4fce5","measurement_metric":"cpu_instruction_count","pair_id":"python_1625ac6a078c4c92a0fde771","problem_id":"p02821","slow_code_id":"fdc3796f3095f69c7c3457ec5786e03ef47ca806aaa691afbc3f4956f2a4fce5","slow_id":"p02821_fdc3796f3095f69c7c3457ec5786e03ef47ca806aaa691afbc3f4956f2a4fce5","speedup":5.605299894160942,"stratum":"4-8","sampling_key":"10d5a6440e795e999fee2d563f08aa1944b27316609f17ae3547ba66ee4de033","slow_code":"def main():\n import bisect\n import numpy as np\n\n n, k = list(map(int, input().split()))\n l = list(map(int, input().split()))\n l.sort()\n l = np.array(l)\n\n def bise(x):\n y = np.searchsorted(l, x - l)\n return n * n - y.sum()\n\n left = -1\n right = l[-1] * 2 + 1\n while right > left + 1:\n mid = (right + left) // 2\n if bise(mid) >= k:\n left = mid\n else:\n right = mid\n ans = 0\n acc = np.zeros(n + 1, np.int64)\n acc[1:] = l.cumsum()\n x = np.searchsorted(l, right - l)\n count = n * n - x.sum()\n ans = (acc[-1] - acc[x]).sum() + (l * (n - x)).sum()\n print((ans - (count - k) * left))\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"import bisect\n\nN, M = list(map(int, input().split()))\nA = list(map(int, input().split()))\nA.sort()\nB = [0] * N\nB[-1] = A[-1]\nfor i in range(N - 2, -1, -1):\n B[i] = B[i + 1] + A[i]\n\n\ndef C(mid):\n tmp = 0\n for a in A:\n pos = bisect.bisect_right(A, mid - a)\n tmp += N - pos\n return tmp > M\n\n\nlb = 0\nrb = 10**6\nwhile rb - lb > 1:\n happy = (lb + rb) // 2\n if C(happy):\n lb = happy\n else:\n rb = happy\nans = 0\ncnt = 0\nfor a in A:\n pos = bisect.bisect_right(A, rb - a)\n if pos == N:\n continue\n ans += B[pos] + (N - pos) * a\n cnt += N - pos\nans += (M - cnt) * rb\nprint(ans)\n"} +{"fast_code_id":"e017ce0a742d01e8892c0abe2d44772f6ec0cff2cca270665ae25ecd66f25668","fast_id":"p03972_e017ce0a742d01e8892c0abe2d44772f6ec0cff2cca270665ae25ecd66f25668","language":"python","measured_fast_code_id":"e017ce0a742d01e8892c0abe2d44772f6ec0cff2cca270665ae25ecd66f25668","measured_slow_code_id":"13cb625d78acd745c6b507de0e8032c0bb09ea576635a23c07368c3938d7b12b","measurement_metric":"cpu_instruction_count","pair_id":"python_1635c0fcdbcc77b0e9a01f91","problem_id":"p03972","slow_code_id":"13cb625d78acd745c6b507de0e8032c0bb09ea576635a23c07368c3938d7b12b","slow_id":"p03972_13cb625d78acd745c6b507de0e8032c0bb09ea576635a23c07368c3938d7b12b","speedup":6.645748335324004,"stratum":"4-8","sampling_key":"7364a70c897b79f6e5a976d06cbc0e824ca36c42fd0d92a96b343b774e738a8f","slow_code":"W, H = list(map(int, input().split()))\nP = [(int(eval(input())), 0) for i in range(W)]\nQ = [(int(eval(input())), 1) for i in range(H)]\nE = sorted(P + Q)\nused = [W + 1, H + 1]\nans = 0\nfor e, f in E:\n ans += e * used[1 - f]\n used[f] -= 1\nprint(ans)\n","fast_code":"w, h, *L = list(map(int, open(0).read().split()))\nP = L[:w]\nQ = [-qj for qj in L[w:]]\nx, y, ans = w, h, 0\nfor c in sorted(P + Q, key=abs):\n if c > 0:\n if x:\n ans += c * (y + 1)\n x -= 1\n else:\n if y:\n ans -= c * (x + 1)\n y -= 1\nprint(ans)\n"} +{"fast_code_id":"a60519e763775a806ca7a816aafe8e45cefe3d6fbd682179badf9f9798007f29","fast_id":"p03796_a60519e763775a806ca7a816aafe8e45cefe3d6fbd682179badf9f9798007f29","language":"python","measured_fast_code_id":"a60519e763775a806ca7a816aafe8e45cefe3d6fbd682179badf9f9798007f29","measured_slow_code_id":"43b257e85e546d9470ced772c67918bde77d5626a2fd04dea2e6a84c615224a5","measurement_metric":"cpu_instruction_count","pair_id":"python_164e49d3ffe76708ad991e8c","problem_id":"p03796","slow_code_id":"5ff598b9800e1bd896356b079e05a6afa89737def3d95243ef8ae46ed85960b1","slow_id":"p03796_43b257e85e546d9470ced772c67918bde77d5626a2fd04dea2e6a84c615224a5","speedup":2.8873147431290827,"stratum":"2-4","sampling_key":"0cc4878d007fef6e80573a3666ce7defd3e4b09eaa586540f61272d006467e80","slow_code":"from math import factorial\n\nn = int(eval(input()))\nprint((factorial(n) % (10**9 + 7)))\n","fast_code":"N = int(eval(input()))\na = 1\nfor n in range(2, N + 1):\n a = a * n % (10**9 + 7)\nprint(a)\n"} +{"fast_code_id":"180cfaeb3024b07a03347373b5a4375a14383a3c63d95b5ddf25a877245fc491","fast_id":"p03713_230026fc092eb81d1f28ac162b7d87de026832e26c1b9ee04d7fe6109fd46cfb","language":"python","measured_fast_code_id":"230026fc092eb81d1f28ac162b7d87de026832e26c1b9ee04d7fe6109fd46cfb","measured_slow_code_id":"b6f55d32b2be7c1b48c7e6912b9a7bd32004560e6fca8e785937ccf5c07eff29","measurement_metric":"cpu_instruction_count","pair_id":"python_165b74720f1d8421cde46652","problem_id":"p03713","slow_code_id":"b6f55d32b2be7c1b48c7e6912b9a7bd32004560e6fca8e785937ccf5c07eff29","slow_id":"p03713_b6f55d32b2be7c1b48c7e6912b9a7bd32004560e6fca8e785937ccf5c07eff29","speedup":7.8296948242401605,"stratum":"4-8","sampling_key":"5148369e76b97a8068ac4713194765a0f4ea4d338c61694b9fc6d033a3c3d506","slow_code":"def answer(H, W, ans):\n for x in range(1, W):\n y1 = H // 2\n Sa1 = H * x\n Sb1 = (W - x) * y1\n Sc1 = (W - x) * (H - y1)\n M = max(Sa1, Sb1, Sc1)\n m = min(Sa1, Sb1, Sc1)\n y2 = (W - x) // 2\n Sa2 = H * x\n Sb2 = H * y2\n Sc2 = H * (W - x - y2)\n M2 = max(Sa2, Sb2, Sc2)\n m2 = min(Sa2, Sb2, Sc2)\n if ans > min(M - m, M2 - m2):\n ans = min(M - m, M2 - m2)\n return ans\n\n\nif __name__ == \"__main__\":\n H, W = [int(i) for i in input().split()]\n ans = H * W\n ans = answer(H, W, ans)\n H, W = W, H\n if answer(H, W, ans) < ans:\n ans = answer(H, W, ans)\n print(ans)\n","fast_code":"H, W = list(map(int, input().split()))\nif H % 3 == 0 or W % 3 == 0:\n print((0))\n exit()\nans = H * W\n\nfor h in range(1, H + 1):\n a = h * W\n\n b = ((H - h) // 2) * W\n c = H * W - a - b\n ans = min(ans, max([a, b, c]) - min([a, b, c]))\n\n b = (H - h) * (W // 2)\n c = H * W - a - b\n ans = min(ans, max([a, b, c]) - min([a, b, c]))\n\nfor w in range(1, W + 1):\n a = H * w\n\n b = (W - w) * (H // 2)\n c = H * W - a - b\n ans = min(ans, max([a, b, c]) - min([a, b, c]))\n\n b = ((W - w) // 2) * H\n c = H * W - a - b\n ans = min(ans, max([a, b, c]) - min([a, b, c]))\nprint(ans)\n"} +{"fast_code_id":"36da24ff50e818fe64ed4eba2d5468a0f22772e67949241ff0bd9289506350d5","fast_id":"p02417_36da24ff50e818fe64ed4eba2d5468a0f22772e67949241ff0bd9289506350d5","language":"python","measured_fast_code_id":"36da24ff50e818fe64ed4eba2d5468a0f22772e67949241ff0bd9289506350d5","measured_slow_code_id":"91fbc2a5db35b1941d183c86eb7016584b0dbbc404bd11d0ae21847b19ff61be","measurement_metric":"cpu_instruction_count","pair_id":"python_16ef8679a38a2b8ab690faf8","problem_id":"p02417","slow_code_id":"91fbc2a5db35b1941d183c86eb7016584b0dbbc404bd11d0ae21847b19ff61be","slow_id":"p02417_91fbc2a5db35b1941d183c86eb7016584b0dbbc404bd11d0ae21847b19ff61be","speedup":5.291224555834662,"stratum":"4-8","sampling_key":"6d86d818bac9542499dd95ea6cc0dcc2009ad05dc527e122d1fcc1f9b86da05a","slow_code":"import sys\n\naz = [\n \"a\",\n \"b\",\n \"c\",\n \"d\",\n \"e\",\n \"f\",\n \"g\",\n \"h\",\n \"i\",\n \"j\",\n \"k\",\n \"l\",\n \"m\",\n \"n\",\n \"o\",\n \"p\",\n \"q\",\n \"r\",\n \"s\",\n \"t\",\n \"u\",\n \"v\",\n \"w\",\n \"x\",\n \"y\",\n \"z\",\n]\nsum_az = [0 for x in range(26)]\nfor x in sys.stdin.read().lower():\n for i in range(26):\n if x == az[i]:\n sum_az[i] += 1\nfor i in range(26):\n print((\"%s : %d\" % (az[i], sum_az[i])))\n","fast_code":"import sys\n\nchash = {}\nfor i in range(ord(\"a\"), ord(\"z\") + 1):\n chash[chr(i)] = 0\nlines = sys.stdin.readlines()\nfor i in range(len(lines)):\n for j in range(len(lines[i])):\n if lines[i][j].isalpha():\n chash[lines[i][j].lower()] += 1\nfor i in range(ord(\"a\"), ord(\"z\") + 1):\n print((\"{:s} : {:d}\".format(chr(i), chash[chr(i)])))\n"} +{"fast_code_id":"1c19f1515eea6daf819ed6226e28c60674530dafb599e6ac4fdb3cde8f734647","fast_id":"p03598_1c19f1515eea6daf819ed6226e28c60674530dafb599e6ac4fdb3cde8f734647","language":"python","measured_fast_code_id":"1c19f1515eea6daf819ed6226e28c60674530dafb599e6ac4fdb3cde8f734647","measured_slow_code_id":"4242b0111d34ac29f247349e2dd3df5bbea3d003d38a638f0ec7f046c27e0435","measurement_metric":"cpu_instruction_count","pair_id":"python_16fd79cb3b1cb2eff3aba728","problem_id":"p03598","slow_code_id":"b56139331cede5dfee10d7e57ba4d3e5fe70d638b0a7d7343d69614e13c21b14","slow_id":"p03598_4242b0111d34ac29f247349e2dd3df5bbea3d003d38a638f0ec7f046c27e0435","speedup":2.9543340133611666,"stratum":"2-4","sampling_key":"240460b6cac75aa305d87ad9bd202d4d534488c2099ccc0ca58cb2900e842ba9","slow_code":"import sys\n\nstdin = sys.stdin\ninf = 1 << 60\nmod = 1000000007\nni = lambda: int(ns())\nnin = lambda y: [ni() for _ in range(y)]\nna = lambda: list(map(int, stdin.readline().split()))\nnan = lambda y: [na() for _ in range(y)]\nnf = lambda: float(ns())\nnfn = lambda y: [nf() for _ in range(y)]\nnfa = lambda: list(map(float, stdin.readline().split()))\nnfan = lambda y: [nfa() for _ in range(y)]\nns = lambda: stdin.readline().rstrip()\nnsn = lambda y: [ns() for _ in range(y)]\nncl = lambda y: [list(ns()) for _ in range(y)]\nnas = lambda: stdin.readline().split()\nn, k = nin(2)\nx = na()\nans = 0\nfor i in range(n):\n ans += min(abs(x[i] - k) * 2, abs(x[i]) * 2)\nprint(ans)\n","fast_code":"_ = eval(input())\nk = int(eval(input()))\nx = [int(x) for x in input().split()]\nans = 0\nfor i in x:\n ans += min(i, k - i)\nelse:\n print((ans * 2))\n"} +{"fast_code_id":"b57e83c6251a91cd14cc8a0ec267c4181918473e124f681fae786b1f47792bfc","fast_id":"p02725_b57e83c6251a91cd14cc8a0ec267c4181918473e124f681fae786b1f47792bfc","language":"python","measured_fast_code_id":"b57e83c6251a91cd14cc8a0ec267c4181918473e124f681fae786b1f47792bfc","measured_slow_code_id":"9164aae6c8839a29a40c85ad8ba3bfc05c8440fc08a285145380122a94d7f972","measurement_metric":"cpu_instruction_count","pair_id":"python_171adb17178daf29156abc35","problem_id":"p02725","slow_code_id":"9164aae6c8839a29a40c85ad8ba3bfc05c8440fc08a285145380122a94d7f972","slow_id":"p02725_9164aae6c8839a29a40c85ad8ba3bfc05c8440fc08a285145380122a94d7f972","speedup":3.2626160575863103,"stratum":"2-4","sampling_key":"8710f0f016055f349aa4957d3603eaca9084fb26d024e753d690cf17abff3e6d","slow_code":"from sys import stdin\n\ninp = stdin.readline\nn, k = [int(x) for x in inp().strip().split()]\narray = [int(x) for x in inp().strip().split()]\ndistance = [0] * (k * 2)\nfor i in range(k - 1):\n distance[i] = array[i + 1] - array[i]\ndistance[k - 1] = n - array[k - 1] + array[0]\ndistance[2 * k - 1] = n - array[k - 1] + array[0]\nfor i in range(k - 1):\n distance[k + i] = array[i + 1] - array[i]\nminimum = 999999999\ncount = 0\ntotal = 0\ncountLimit = k - 1\nfor i in range(k * 2):\n if count < countLimit:\n total += distance[i]\n count += 1\n else:\n if minimum > total:\n minimum = total\n total += distance[i]\n total -= distance[i - countLimit]\nprint(minimum)\n","fast_code":"K, N = list(map(int, input().split()))\nA = list(map(int, input().split()))\nA += [A[0] + K]\nprint((min(K - (A[i + 1] - A[i]) for i in range(N))))\n"} +{"fast_code_id":"f9578c0fb5e956297cd15169afe302f909b9a50050d5b4ef873208a33154e1b8","fast_id":"p03136_a0928ef73f64f1466965517f37d75deaa1adfa83984323ee0a56bce7df5edf3a","language":"python","measured_fast_code_id":"a0928ef73f64f1466965517f37d75deaa1adfa83984323ee0a56bce7df5edf3a","measured_slow_code_id":"c1d13b37a289cb233c6849d4a958851f4c3b4f284375eaec46ef2e5a34eb2366","measurement_metric":"cpu_instruction_count","pair_id":"python_176d22d0a3317a89f34fcdab","problem_id":"p03136","slow_code_id":"c1d13b37a289cb233c6849d4a958851f4c3b4f284375eaec46ef2e5a34eb2366","slow_id":"p03136_c1d13b37a289cb233c6849d4a958851f4c3b4f284375eaec46ef2e5a34eb2366","speedup":356.49775043067694,"stratum":"8+","sampling_key":"69eb2dc820a29288733924759706fa7a3b9cb1a53fda1a91c857d84bc64d809b","slow_code":"import numpy as np\n\nN = int(eval(input()))\nL = np.array(list(map(int, input().split())))\nL[::-1].sort()\nif L[0] < L[1:].sum():\n print(\"Yes\")\nelse:\n print(\"No\")\n","fast_code":"import sys\n\n\ns2nn = lambda s: [int(c) for c in s.split(\" \")]\nss2nn = lambda ss: [int(s) for s in ss]\nss2nnn = lambda ss: [s2nn(s) for s in ss]\ni2s = lambda: sys.stdin.readline().rstrip()\ni2n = lambda: int(i2s())\ni2nn = lambda: s2nn(i2s())\nii2ss = lambda n: [sys.stdin.readline().rstrip() for _ in range(n)]\nii2nn = lambda n: ss2nn(ii2ss(n))\nii2nnn = lambda n: ss2nnn(ii2ss(n))\n\n\ndef main():\n N = i2n()\n L = i2nn()\n L.sort()\n l1 = sum(L[:-1])\n l2 = L[-1]\n if l1 > l2:\n print(\"Yes\")\n else:\n print(\"No\")\n\n\nmain()\n"} +{"fast_code_id":"fa4e89df610f6b68dc0a1b671138724e22469c009af7af8893a340d0b7f8c7d7","fast_id":"p03291_fa4e89df610f6b68dc0a1b671138724e22469c009af7af8893a340d0b7f8c7d7","language":"python","measured_fast_code_id":"fa4e89df610f6b68dc0a1b671138724e22469c009af7af8893a340d0b7f8c7d7","measured_slow_code_id":"d64c264e5368f29c687af8158e3b733bec94dc390763e9ea00c167fb81f53e6e","measurement_metric":"cpu_instruction_count","pair_id":"python_1771da6d0ae942026cfeb312","problem_id":"p03291","slow_code_id":"893aa769d75c0f68c1d1f6bae5efa68305f4fe10177fa385d3123d97c041f274","slow_id":"p03291_d64c264e5368f29c687af8158e3b733bec94dc390763e9ea00c167fb81f53e6e","speedup":3.2658204875232064,"stratum":"2-4","sampling_key":"d07126697a6c3c6692670a1fc3d1259eeefe4299033a28a61925152db01acad5","slow_code":"import sys\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef list2d(a, b, c):\n return [[c] * b for i in range(a)]\n\n\ndef list3d(a, b, c, d):\n return [[[d] * c for j in range(b)] for i in range(a)]\n\n\ndef list4d(a, b, c, d, e):\n return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]\n\n\ndef ceil(x, y=1):\n return int(-(-x // y))\n\n\ndef INT():\n return int(input())\n\n\ndef MAP():\n return map(int, input().split())\n\n\ndef LIST(N=None):\n return list(MAP()) if N is None else [INT() for i in range(N)]\n\n\ndef Yes():\n print(\"Yes\")\n\n\ndef No():\n print(\"No\")\n\n\ndef YES():\n print(\"YES\")\n\n\ndef NO():\n print(\"NO\")\n\n\nsys.setrecursionlimit(10**9)\nINF = 10**18\nMOD = 10**9 + 7\nS = input()\nN = len(S)\n\ndp = list2d(N + 1, 4, 0)\ndp[0][0] = 1\nfor i in range(N):\n s = S[i]\n for j in range(4):\n\n if s == \"?\":\n\n dp[i + 1][j] += dp[i][j] * 3\n dp[i + 1][j] %= MOD\n else:\n dp[i + 1][j] += dp[i][j]\n dp[i + 1][j] %= MOD\n\n if j < 3:\n\n if (\n s == \"?\"\n or s == \"A\"\n and j == 0\n or s == \"B\"\n and j == 1\n or s == \"C\"\n and j == 2\n ):\n dp[i + 1][j + 1] += dp[i][j]\n dp[i + 1][j + 1] %= MOD\n\nprint(dp[N][3])\n","fast_code":"S = input().strip()\nmod = 10**9 + 7\ndp = [1] + [0] * 3\nfor s in S:\n dp1 = dp[:]\n if s == \"A\":\n dp1[1] += dp[0]\n elif s == \"B\":\n dp1[2] += dp[1]\n elif s == \"C\":\n dp1[3] += dp[2]\n else:\n dp1[1] += dp[0]\n dp1[2] += dp[1]\n dp1[3] += dp[2]\n dp1[0] += 2 * dp[0]\n dp1[1] += 2 * dp[1]\n dp1[2] += 2 * dp[2]\n dp1[3] += 2 * dp[3]\n dp = [d % mod for d in dp1]\nprint((dp[-1]))\n"} +{"fast_code_id":"a608c3ac8df5a73167a92a04c86f2fdb15d45e00c54253d6e68a9ff5e33ea86b","fast_id":"p03030_a608c3ac8df5a73167a92a04c86f2fdb15d45e00c54253d6e68a9ff5e33ea86b","language":"python","measured_fast_code_id":"a608c3ac8df5a73167a92a04c86f2fdb15d45e00c54253d6e68a9ff5e33ea86b","measured_slow_code_id":"a25145b5dc837356f86d086b296689b8dc43e00da1e20428c8c9aa47d606904a","measurement_metric":"cpu_instruction_count","pair_id":"python_17c0bb71b5253c71708efd08","problem_id":"p03030","slow_code_id":"1c8ba277370dec6948055508f046494819c5729144951826d127d44ed33b74ab","slow_id":"p03030_a25145b5dc837356f86d086b296689b8dc43e00da1e20428c8c9aa47d606904a","speedup":5.3634038621395055,"stratum":"4-8","sampling_key":"616bfecd0baaf76bd281b393102fa64d10664aa92955f37138ffa6e0d3854d40","slow_code":"import sys\n\ninput = sys.stdin.readline\n\n\ndef eprint(*args, **kwargs):\n print(*args, file=sys.stderr, **kwargs)\n\n\nfrom queue import PriorityQueue as pq\n\n\ndef main():\n n = int(eval(input()))\n dict = {}\n for i in range(1, n + 1):\n str_x, num = input().split()\n num = int(num)\n if str_x in dict:\n dict[str_x].put((-num, i))\n\n else:\n a = pq()\n dict[str_x] = a\n dict[str_x].put((-num, i))\n\n eprint(dict)\n ll = sorted(list(dict.items()))\n eprint(ll)\n\n for item in ll:\n while item[1].qsize():\n print((item[1].get())[1])\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"n = int(eval(input()))\nsp = [[input().split(), i + 1] for i in range(n)]\nsp = sorted(sp, key=lambda x: (x[0][0], -int(x[0][1])))\nfor i in range(n):\n print((sp[i][1]))\n"} +{"fast_code_id":"a4eba5c9d642b103b8b4f0414c710b0072c94b849e28bedb019ea97f6dc9bd14","fast_id":"p00100_c650910a23f4c80cdec40d71f55f58b53ce601c16cbff163efc652624012aa46","language":"python","measured_fast_code_id":"c650910a23f4c80cdec40d71f55f58b53ce601c16cbff163efc652624012aa46","measured_slow_code_id":"cef1778ac31a96be11bbaf1627cf2c94f88d5ea9907d28e19f44f8b7a1d378a1","measurement_metric":"cpu_instruction_count","pair_id":"python_17fa6594f2ffa18c057abdf4","problem_id":"p00100","slow_code_id":"90eeb5d17013d087aa6085c705f90d8dd3710ca805802ad063fb9a202bdd752c","slow_id":"p00100_cef1778ac31a96be11bbaf1627cf2c94f88d5ea9907d28e19f44f8b7a1d378a1","speedup":3.205806785365859,"stratum":"2-4","sampling_key":"ab3ae3d57154289e33557f11b8fc9fa3c5550da1299b87b8b7f03dda77c0eb1e","slow_code":"employeeSalesList = []\n\n\ndef resetDataset():\n del employeeSalesList[0 : len(employeeSalesList) + 1]\n\n\ndef readDataCount():\n return int(eval(input()))\n\n\ndef searchEmployeeSales(employeeId):\n for data in employeeSalesList:\n if data[0] == employeeId:\n return data\n newData = [employeeId, 0]\n employeeSalesList.append(newData)\n return newData\n\n\nanswerList = []\n\n\ndef printEmployeeOfDataset():\n found = False\n for data in employeeSalesList:\n if data[1] >= 1000000:\n answerList.append(data[0])\n found = True\n if not found:\n answerList.append(\"NA\")\n\n\nresetDataset()\ndataCount = readDataCount()\nwhile dataCount > 0:\n for _ in range(dataCount):\n employeeId, price, volume = list(map(int, input().split(\" \")))\n employeeSales = searchEmployeeSales(employeeId)\n employeeSales[1] += price * volume\n printEmployeeOfDataset()\n resetDataset()\n dataCount = readDataCount()\nfor row in answerList:\n print(row)\n","fast_code":"import sys\nfrom collections import OrderedDict\n\n\ndef solve(data):\n\n sums = OrderedDict()\n for id, p, q in data:\n if id in sums:\n sums[id] += p * q\n else:\n sums[id] = p * q\n result = [key for key, value in list(sums.items()) if value >= 1000000]\n return result\n\n\ndef main(args):\n\n while True:\n num = int(eval(input()))\n if num == 0:\n break\n data = []\n for _ in range(num):\n data.append([int(x) for x in input().split(\" \")])\n result = solve(data)\n if result:\n for ele in result:\n print(ele)\n else:\n print(\"NA\")\n\n\nif __name__ == \"__main__\":\n main(sys.argv[1:])\n"} +{"fast_code_id":"609aaacbc3ca3a070f6d10f1764a4fe238bfcc0848f58c3e30360e8ac581ed62","fast_id":"p03636_609aaacbc3ca3a070f6d10f1764a4fe238bfcc0848f58c3e30360e8ac581ed62","language":"python","measured_fast_code_id":"609aaacbc3ca3a070f6d10f1764a4fe238bfcc0848f58c3e30360e8ac581ed62","measured_slow_code_id":"d8a200333716652286e0767b3ceb6ced784b07df576eeb7cc77878fbcd3e057b","measurement_metric":"cpu_instruction_count","pair_id":"python_184e99c7f62018f50492f90a","problem_id":"p03636","slow_code_id":"d8a200333716652286e0767b3ceb6ced784b07df576eeb7cc77878fbcd3e057b","slow_id":"p03636_d8a200333716652286e0767b3ceb6ced784b07df576eeb7cc77878fbcd3e057b","speedup":2.6440989836386803,"stratum":"2-4","sampling_key":"5641ec7c32ff0d252f16f695349d056b0cff930e0416a9f4d452ba43673fcbfd","slow_code":"import sys\n\nstdin = sys.stdin\nsys.setrecursionlimit(10**7)\ni_i = lambda: int(i_s())\ni_l = lambda: list(map(int, stdin.readline().split()))\ni_s = lambda: stdin.readline().rstrip()\ns = i_s()\nprint((s[0] + str(len(s) - 2) + s[-1]))\n","fast_code":"a, *b, c = input()\nprint(a, len(b), c, sep=\"\")\n"} +{"fast_code_id":"a03425c6657bb779a3ac03139b0087ddc2a33f8be7110bc6cab8bc331b66a921","fast_id":"p02959_a7e135233c8fee88f261708718fc7f3df5ae20618002c01f2b5ed9b2cf19600d","language":"python","measured_fast_code_id":"a7e135233c8fee88f261708718fc7f3df5ae20618002c01f2b5ed9b2cf19600d","measured_slow_code_id":"f0395674e51675bd438b96a7f18fa9739566f756efa1ea79ea087d0b83a10e1f","measurement_metric":"cpu_instruction_count","pair_id":"python_1861beebb3778b8953057324","problem_id":"p02959","slow_code_id":"f0395674e51675bd438b96a7f18fa9739566f756efa1ea79ea087d0b83a10e1f","slow_id":"p02959_f0395674e51675bd438b96a7f18fa9739566f756efa1ea79ea087d0b83a10e1f","speedup":2.3829557320095733,"stratum":"2-4","sampling_key":"08968d008b30cdcc3d853d1c3626f2eb4785cef4e398ba2b5a413c9103d2a04b","slow_code":"N = int(eval(input()))\nA = list(map(int, input().split()))\nB = list(map(int, input().split()))\nans = 0\nfor i in range(N):\n if i % 2 == 0:\n if A[i // 2] >= B[i // 2]:\n A[i // 2] -= B[i // 2]\n ans += B[i // 2]\n B[i // 2] = 0\n else:\n B[i // 2] -= A[i // 2]\n ans += A[i // 2]\n A[i // 2] = 0\n if A[i // 2 + 1] >= B[i // 2]:\n A[i // 2 + 1] -= B[i // 2]\n ans += B[i // 2]\n B[i // 2] = 0\n else:\n B[i // 2] -= A[i // 2 + 1]\n ans += A[i // 2 + 1]\n A[i // 2 + 1] = 0\n else:\n if A[N - i // 2] >= B[N - i // 2 - 1]:\n A[N - i // 2] -= B[N - i // 2 - 1]\n ans += B[N - i // 2 - 1]\n B[N - i // 2 - 1] = 0\n else:\n B[N - i // 2 - 1] -= A[N - i // 2]\n ans += A[N - i // 2]\n A[N - i // 2] = 0\n if A[N - i // 2 - 1] >= B[N - i // 2 - 1]:\n A[N - i // 2 - 1] -= B[N - i // 2 - 1]\n ans += B[N - i // 2 - 1]\n B[N - i // 2 - 1] = 0\n else:\n B[N - i // 2 - 1] -= A[N - i // 2 - 1]\n ans += A[N - i // 2 - 1]\n A[N - i // 2 - 1] = 0\nprint(ans)\n","fast_code":"n = int(eval(input()))\na = list(map(int, input().split()))\nb = list(map(int, input().split()))\nb.append(0)\nnum = 0\nc = 0\nfor i in range(n):\n if a[i] <= c:\n num += a[i]\n c = b[i]\n else:\n a[i] -= c\n num += c\n if b[i] >= a[i]:\n num += a[i]\n c = b[i] - a[i]\n else:\n num += b[i]\n c = 0\nif b[n] + c >= a[n]:\n num += a[n]\nelse:\n num += b[n] + c\nprint(num)\n"} +{"fast_code_id":"36efa31a817599454e47c950d8405cd8170cd3f67b1b12f911d115f29e6e8467","fast_id":"p00028_36efa31a817599454e47c950d8405cd8170cd3f67b1b12f911d115f29e6e8467","language":"python","measured_fast_code_id":"36efa31a817599454e47c950d8405cd8170cd3f67b1b12f911d115f29e6e8467","measured_slow_code_id":"4fbfbfa3bae80164cb84ea06f8fba0f419684493b80b546f778ef4c616e812e2","measurement_metric":"cpu_instruction_count","pair_id":"python_1881dd19e3ce9367d82153a1","problem_id":"p00028","slow_code_id":"4fbfbfa3bae80164cb84ea06f8fba0f419684493b80b546f778ef4c616e812e2","slow_id":"p00028_4fbfbfa3bae80164cb84ea06f8fba0f419684493b80b546f778ef4c616e812e2","speedup":3.6284794452856626,"stratum":"2-4","sampling_key":"f7a1c3c4719d20a20858f9fb96e04feab58602e77c9fc69c689fe3f5e3516c17","slow_code":"a = [0] * 100\nwhile 1:\n try:\n n = int(eval(input()))\n a[n - 1] += 1\n except:\n for i in range(100):\n if a[i] == max(a):\n print((i + 1))\n break\n","fast_code":"d = {}\ntry:\n while True:\n n = int(input())\n if n in d:\n d[n] += 1\n else:\n d[n] = 1\nexcept EOFError:\n pass\na = []\nm = max(d.values())\nfor key, value in list(d.items()):\n if value == m:\n a.append(key)\na.sort()\nfor i in a:\n print(i)\n"} +{"fast_code_id":"c4d631bb5c78c10e90288d6aa19f918890282bdae31680faa88b6bf837857102","fast_id":"p03329_c4d631bb5c78c10e90288d6aa19f918890282bdae31680faa88b6bf837857102","language":"python","measured_fast_code_id":"c4d631bb5c78c10e90288d6aa19f918890282bdae31680faa88b6bf837857102","measured_slow_code_id":"d420a4a47c3d63ccc8bf0d67f00fb6eac614ba4a541aaa7d9741e0a6de148e33","measurement_metric":"cpu_instruction_count","pair_id":"python_189eff636711362ab16417a6","problem_id":"p03329","slow_code_id":"d420a4a47c3d63ccc8bf0d67f00fb6eac614ba4a541aaa7d9741e0a6de148e33","slow_id":"p03329_d420a4a47c3d63ccc8bf0d67f00fb6eac614ba4a541aaa7d9741e0a6de148e33","speedup":260.1456959017314,"stratum":"8+","sampling_key":"177fa3991dae7328580b8793e83dd67c8412683d704d57599c04190419888623","slow_code":"n = int(eval(input()))\ndp = [float(\"inf\")] * 100010\ndp[0] = 0\nfor i in range(1, 100000 + 1):\n power = 1\n while power <= i:\n dp[i] = min(dp[i], dp[i - power] + 1)\n power *= 6\n power = 1\n while power <= i:\n dp[i] = min(dp[i], dp[i - power] + 1)\n power *= 9\nprint((dp[n]))\n","fast_code":"import sys\n\nn = int(sys.stdin.readline().rstrip())\n\n\ndef main():\n bit6 = [0] * 8\n bit9 = [0] * 7\n b = n\n for i in range(5, -1, -1):\n q, r = divmod(b, 9**i)\n bit9[i] = q\n b = r\n res = sum(bit6) + sum(bit9)\n for _ in range(n):\n i = 0\n while True:\n bit6[i] += 1\n if bit6[i] == 6:\n bit6[i] = 0\n i += 1\n else:\n break\n i = 0\n while True:\n bit9[i] -= 1\n if bit9[i] == -1:\n bit9[i] = 8\n i += 1\n else:\n break\n res = min(res, sum(bit6) + sum(bit9))\n return res\n\n\nif __name__ == \"__main__\":\n ans = main()\n print(ans)\n"} +{"fast_code_id":"b2edb05d7c541afb6555136a699e7845cc68581fc25684f4f895e08611d62486","fast_id":"p03294_b2edb05d7c541afb6555136a699e7845cc68581fc25684f4f895e08611d62486","language":"python","measured_fast_code_id":"b2edb05d7c541afb6555136a699e7845cc68581fc25684f4f895e08611d62486","measured_slow_code_id":"f83e22904e6c5822a77418d395b643df90f45b5996bfb7366667792519f35be8","measurement_metric":"cpu_instruction_count","pair_id":"python_18c4d36eb732b1c02f560b58","problem_id":"p03294","slow_code_id":"f83e22904e6c5822a77418d395b643df90f45b5996bfb7366667792519f35be8","slow_id":"p03294_f83e22904e6c5822a77418d395b643df90f45b5996bfb7366667792519f35be8","speedup":7.389058026025614,"stratum":"4-8","sampling_key":"5f706c8c56e701c4a1f87221890eb8ef6fbdef6991e3bfb84d786f9ca35b6fa3","slow_code":"from functools import reduce\n\nn = (int)(eval(input()))\na = (list)(list(map(int, input().split())))\n\n\ndef calcMod(a, m):\n return sum([m % v for v in a])\n\n\ndef mul(a, b):\n return a * b\n\n\nprint((calcMod(a, reduce(mul, a) - 1)))\n","fast_code":"n = eval(input())\nA = list(map(int, input().split()))\nfor i in range(int(n)):\n A[i] -= 1\nprint((sum(A)))\n"} +{"fast_code_id":"cf5ec513ccd40bda2ee4fef5b71dbbed5c51cb14be7b8ee5383525a868af9741","fast_id":"p02703_1c37fb7d48386e9b262662027d58efebe6614c7758c45f81971d94d0dfd3df19","language":"python","measured_fast_code_id":"1c37fb7d48386e9b262662027d58efebe6614c7758c45f81971d94d0dfd3df19","measured_slow_code_id":"13ddc35e7eb74d73b0b3c8f42eca38b92bc94e091a7090e12213a091ef6feb16","measurement_metric":"cpu_instruction_count","pair_id":"python_18ff4bc978230d2d085a360f","problem_id":"p02703","slow_code_id":"8367a3613f4d9a1208ac0ab45c2708eb9c7ae580813c618185432ad6e30b1042","slow_id":"p02703_13ddc35e7eb74d73b0b3c8f42eca38b92bc94e091a7090e12213a091ef6feb16","speedup":6.504947108157921,"stratum":"4-8","sampling_key":"655d20ab0d6a02538e2aefe0b6574caa040b86c9015aee5e234889163c96a703","slow_code":"import sys\nfrom heapq import heappush, heappop\nimport numpy as np\n\n\ndef input():\n return sys.stdin.readline().rstrip()\n\n\ndef ii():\n return int(input())\n\n\ndef mi():\n return map(int, input().split())\n\n\ndef li():\n return list(mi())\n\n\ndef main():\n def dijkstra(s):\n def push(v, s, x):\n if s < 0:\n return\n if dist[v, s] <= x:\n return\n dist[v, s] = x\n heappush(que, (x, v, s))\n\n inf = 10**18\n dist = np.full((n, MAX_S + 1), inf, dtype=int)\n\n que = []\n push(0, s, 0)\n while que:\n x, v, s = heappop(que)\n if dist[v, s] < x:\n continue\n ns = min(s + c[v], MAX_S)\n push(v, ns, x + d[v])\n for nv, a, b in adj[v]:\n push(nv, s - a, x + b)\n return np.min(dist, axis=1)\n\n n, m, s = mi()\n adj = [[] for i in range(n)]\n MAX_S = 0\n for i in range(m):\n u, v, a, b = mi()\n u -= 1\n v -= 1\n adj[u].append((v, a, b))\n adj[v].append((u, a, b))\n MAX_S = max(MAX_S, a)\n MAX_S *= n - 1\n s = min(s, MAX_S)\n c, d = [0] * n, [0] * n\n for i in range(n):\n c[i], d[i] = mi()\n ans = dijkstra(s)\n print(*ans[1:], sep=\"\\n\")\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"import sys\nfrom heapq import heapify, heappop, heappush\n\nsr = lambda: sys.stdin.readline().rstrip()\nir = lambda: int(sr())\nlr = lambda: list(map(int, sr().split()))\n\nN, M, S = lr()\nUVAB = [lr() for _ in range(M)]\nCD = [lr() for _ in range(N)]\nAmax = 0\nfor i in range(M):\n a = UVAB[i][2]\n if a > Amax:\n Amax = a\nlimit = Amax * (N - 1)\nS = min(S, limit)\ngraph = [[] for _ in range(N + 1)]\nfor u, v, a, b in UVAB:\n graph[u].append((v, a, b))\n graph[v].append((u, a, b))\n\n\ndef dijkstra(start):\n\n INF = 10**15\n dist = [[INF for _ in range(limit + 1)] for _ in range(N + 1)]\n dist[1][S] = 0\n que = [(0, S, 1)]\n while que:\n time, silver, prev = heappop(que)\n if dist[prev][silver] < time:\n continue\n for next, a, b in graph[prev]:\n t = time + b\n si = silver - a\n if si < 0:\n continue\n if dist[next][si] > t:\n dist[next][si] = t\n heappush(que, (t, si, next))\n c, d = CD[prev - 1]\n si = min(limit, silver + c)\n while dist[prev][si] > time + d:\n dist[prev][si] = time + d\n heappush(que, (time + d, si, prev))\n si += c\n si = min(limit, si)\n time += d\n return dist\n\n\ndist = dijkstra(1)\nfor i in range(2, N + 1):\n d = dist[i]\n answer = min(d)\n print(answer)\n"} +{"fast_code_id":"1019ea94675af27c3bd59e5a2839688ec4fe5a3fcf6b258662583310efacb659","fast_id":"p03552_1019ea94675af27c3bd59e5a2839688ec4fe5a3fcf6b258662583310efacb659","language":"python","measured_fast_code_id":"1019ea94675af27c3bd59e5a2839688ec4fe5a3fcf6b258662583310efacb659","measured_slow_code_id":"fca975e3d0d30bc1896e9ad592f49b6dc13f1bf8eab5f47b11e27deeb6020eb5","measurement_metric":"cpu_instruction_count","pair_id":"python_1915a1b9b64b776f8bb3825d","problem_id":"p03552","slow_code_id":"6b9cbbfcecc117653d684424a9e23874286eb0f6303a58ba8707b6dc55523b37","slow_id":"p03552_fca975e3d0d30bc1896e9ad592f49b6dc13f1bf8eab5f47b11e27deeb6020eb5","speedup":262.883012143208,"stratum":"8+","sampling_key":"cee38b6ff37af6edd47e5fde5a3592ec496940d3c3190fd48a4c6051d7758cef","slow_code":"N, Z, W = list(map(int, input().split()))\n(*A,) = list(map(int, input().split()))\nimport sys\n\nsys.setrecursionlimit(10**6)\nmemo = {}\n\n\ndef dfs(i, turn):\n if (i, turn) in memo:\n return memo[i, turn]\n if turn == 0:\n\n if i == 0:\n res = abs(W - A[-1])\n else:\n res = abs(A[i - 1] - A[-1])\n for j in range(i + 1, N):\n res = max(res, dfs(j, 1))\n else:\n\n if i == 0:\n res = abs(Z - A[-1])\n else:\n res = abs(A[i - 1] - A[-1])\n for j in range(i + 1, N):\n res = min(res, dfs(j, 0))\n memo[i, turn] = res\n return res\n\n\nprint((dfs(0, 0)))\n","fast_code":"N, Z, W = list(map(int, input().split()))\n(*A,) = list(map(int, input().split()))\nif N == 1:\n print((abs(A[0] - W)))\nelse:\n print((max(abs(A[-1] - W), abs(A[-2] - A[-1]))))\n"} +{"fast_code_id":"507845f433863f847e02a6b3b8e7a862d616a4495992f9c0fa8bf62ca2f74894","fast_id":"p03997_507845f433863f847e02a6b3b8e7a862d616a4495992f9c0fa8bf62ca2f74894","language":"python","measured_fast_code_id":"507845f433863f847e02a6b3b8e7a862d616a4495992f9c0fa8bf62ca2f74894","measured_slow_code_id":"129dfa97cf673053bafcd5386b6c9bb8fa560bfcf12b57413a4401ec172217cc","measurement_metric":"cpu_instruction_count","pair_id":"python_19402716b40ab29f763d2298","problem_id":"p03997","slow_code_id":"a0278d8d61cb13b55d2cf50ffbda8d5966ed6ff493506f6257fe60d5b1e9f259","slow_id":"p03997_129dfa97cf673053bafcd5386b6c9bb8fa560bfcf12b57413a4401ec172217cc","speedup":19.46839568080414,"stratum":"8+","sampling_key":"0016c0e8e44c5d444e1983cc1bc778c1d689595b048dee376d3cea8a1c84c3fc","slow_code":"from collections import deque\nfrom heapq import heapify, heappop, heappush, heappushpop\nfrom copy import copy, deepcopy\nfrom itertools import product, permutations, combinations, combinations_with_replacement\nfrom collections import defaultdict, Counter\nfrom bisect import bisect_left, bisect_right\n\n\nfrom functools import reduce\nfrom pprint import pprint\n\nINF = float(\"inf\")\n\n\ndef myinput():\n return list(map(int, input().split()))\n\n\ndef mylistinput(n):\n return [list(myinput()) for _ in range(n)]\n\n\ndef mycol(data, col):\n return [row[col] for row in data]\n\n\ndef mysort(data, col, reverse_flag):\n data.sort(key=lambda x: x[col], reverse=reverse_flag)\n return data\n\n\ndef mymax(data):\n M = -1 * float(\"inf\")\n for i in range(len(data)):\n m = max(data[i])\n M = max(M, m)\n return M\n\n\ndef mymin(data):\n m = float(\"inf\")\n for i in range(len(data)):\n M = min(data[i])\n m = min(m, M)\n return m\n\n\ndef mycount(ls, x):\n\n l = bisect_left(ls, x)\n r = bisect_right(ls, x)\n return r - l\n\n\ndef myoutput(ls, space=True):\n if space:\n if len(ls) == 0:\n print(\" \")\n elif type(ls[0]) == str:\n print((\" \".join(ls)))\n elif type(ls[0]) == int:\n print((\" \".join(map(str, ls))))\n else:\n print(\"Output Error\")\n else:\n if len(ls) == 0:\n print(\"\")\n elif type(ls[0]) == str:\n print((\"\".join(ls)))\n elif type(ls[0]) == int:\n print((\"\".join(map(str, ls))))\n else:\n print(\"Output Error\")\n\n\ndef I():\n return int(eval(input()))\n\n\ndef MI():\n return list(map(int, input().split()))\n\n\ndef RI():\n return list(map(int, input().split()))\n\n\ndef CI(n):\n return [int(eval(input())) for _ in range(n)]\n\n\ndef LI(n):\n return [list(map(int, input().split())) for _ in range(n)]\n\n\ndef S():\n return eval(input())\n\n\ndef MS():\n return input().split()\n\n\ndef RS():\n return list(input().split())\n\n\ndef CS(n):\n return [eval(input()) for _ in range(n)]\n\n\ndef LS(n):\n return [list(input().split()) for _ in range(n)]\n\n\na = I()\nb = I()\nh = I()\nans = (a + b) * h // 2\nprint(ans)\n","fast_code":"a = int(eval(input()))\nb = int(eval(input()))\nh = int(eval(input()))\nS = (a + b) * h // 2\nprint(S)\n"} +{"fast_code_id":"2976d82837adaad46a6343a936d7192173f7d77383ba3da1e8bc63a620ee677b","fast_id":"p00008_2976d82837adaad46a6343a936d7192173f7d77383ba3da1e8bc63a620ee677b","language":"python","measured_fast_code_id":"2976d82837adaad46a6343a936d7192173f7d77383ba3da1e8bc63a620ee677b","measured_slow_code_id":"f78324b8c1f2014a7fb42b155a7df64e78b2806e6504b01d6dd4fa1d3a1e1f70","measurement_metric":"cpu_instruction_count","pair_id":"python_1956e5a037cecd6d339981d1","problem_id":"p00008","slow_code_id":"f78324b8c1f2014a7fb42b155a7df64e78b2806e6504b01d6dd4fa1d3a1e1f70","slow_id":"p00008_f78324b8c1f2014a7fb42b155a7df64e78b2806e6504b01d6dd4fa1d3a1e1f70","speedup":5822.92173591008,"stratum":"8+","sampling_key":"43e575f7f89716e790644c075ac13f3dacfcc06955f0fc3009a82f2ea7d2c819","slow_code":"import sys, itertools\n\nfor n in map(int, sys.stdin):\n x = 0\n for num in itertools.product(\"0123456789\", repeat=4):\n eq = \"{}+{}+{}+{}\".format(*(num))\n if eval(eq) == n:\n x += 1\n print(x)\n","fast_code":"import sys\n\na = [0] * 51\nfor i in range(19):\n a[i] = a[36 - i] = (i + 3) * (i + 2) * (i + 1) // 6 - max(\n 2 * (i - 9) * (i - 8) * (i - 7) // 3, 0\n )\nfor e in sys.stdin:\n print((a[int(e)]))\n"} +{"fast_code_id":"13649e760c62f105bbb58fd1fc2b2e21247c4f0cfb9b134a986ababf099202b9","fast_id":"p02264_13649e760c62f105bbb58fd1fc2b2e21247c4f0cfb9b134a986ababf099202b9","language":"python","measured_fast_code_id":"13649e760c62f105bbb58fd1fc2b2e21247c4f0cfb9b134a986ababf099202b9","measured_slow_code_id":"a1340768971238fb58507a0f8ca6f200e92420bac7eb4c6dd5fbd6b4ec30302d","measurement_metric":"cpu_instruction_count","pair_id":"python_1a85c593b2f4ad0a73e77ceb","problem_id":"p02264","slow_code_id":"a1340768971238fb58507a0f8ca6f200e92420bac7eb4c6dd5fbd6b4ec30302d","slow_id":"p02264_a1340768971238fb58507a0f8ca6f200e92420bac7eb4c6dd5fbd6b4ec30302d","speedup":2.3190928578597094,"stratum":"2-4","sampling_key":"85812d7f352394e1fd0b7c849ec746961651e3c185e9836aae6903b9523967c8","slow_code":"class Queue:\n def __init__(self, n):\n self.values = [None] * n\n self.n = n\n self.s = 0\n self.t = 0\n\n def next(self, p):\n ret = p + 1\n if ret >= self.n:\n ret = 0\n return ret\n\n def enqueue(self, x):\n if self.next(self.s) == self.t:\n raise Exception(\"Overflow\")\n self.values[self.s] = x\n self.s = self.next(self.s)\n\n def dequeue(self):\n if self.s == self.t:\n raise Exception(\"Underflow\")\n ret = self.values[self.t]\n self.t = self.next(self.t)\n return ret\n\n\nn, q = list(map(int, input().split(\" \")))\nqueue = Queue(n + 1)\nfor _ in range(n):\n name, time = input().split(\" \")\n time = int(time)\n queue.enqueue((name, time))\ncompleted = []\ncur = 0\nwhile len(completed) < n:\n name, time = queue.dequeue()\n res = time - q\n if res <= 0:\n cur += time\n completed.append((name, cur))\n else:\n cur += q\n queue.enqueue((name, res))\nfor name, time in completed:\n print(name, time)\n","fast_code":"from collections import deque\n\nn, q = [int(val) for val in input().split(\" \")]\nprocesses = deque()\nfor i in range(n):\n name, time = input().split(\" \")\n processes.append((name, int(time)))\nqsum = 0\noutput = []\nwhile len(processes):\n process = processes.popleft()\n if process[1] <= q:\n qsum += process[1]\n output.append(\"{:s} {:d}\".format(process[0], qsum))\n else:\n processes.append((process[0], process[1] - q))\n qsum += q\nprint((\"\\n\".join(output)))\n"} +{"fast_code_id":"5d9000f8a9f24f22bc737e06135f96775bfa608fba3993571b2765359c2a9263","fast_id":"p03767_5d9000f8a9f24f22bc737e06135f96775bfa608fba3993571b2765359c2a9263","language":"python","measured_fast_code_id":"5d9000f8a9f24f22bc737e06135f96775bfa608fba3993571b2765359c2a9263","measured_slow_code_id":"7693ad55686e6fd618fa19be5402464b2c1d8a6534c46b08c3072eed6c243853","measurement_metric":"cpu_instruction_count","pair_id":"python_1ab0d12c8203715290fffd32","problem_id":"p03767","slow_code_id":"7693ad55686e6fd618fa19be5402464b2c1d8a6534c46b08c3072eed6c243853","slow_id":"p03767_7693ad55686e6fd618fa19be5402464b2c1d8a6534c46b08c3072eed6c243853","speedup":5.4783550578834515,"stratum":"4-8","sampling_key":"49755487509fd9e48dce7338f1206feb612f441dc12c373a057a9785f6dde116","slow_code":"from collections import Counter, defaultdict, deque\nfrom heapq import heappop, heappush, heapify\nimport sys, bisect, math, itertools, fractions, pprint\n\nsys.setrecursionlimit(10**8)\nmod = 10**9 + 7\nINF = float(\"inf\")\n\n\ndef inp():\n return int(sys.stdin.readline())\n\n\ndef inpl():\n return list(map(int, sys.stdin.readline().split()))\n\n\nn = inp()\na = inpl()\na.sort(reverse=True)\ncnt = n\nind = 0\nres = 0\nwhile cnt:\n if ind % 2:\n res += a[ind]\n cnt -= 1\n ind += 1\nprint(res)\n","fast_code":"def slove():\n import sys\n\n input = sys.stdin.readline\n n = int(input().rstrip(\"\\n\"))\n a = list(map(int, input().rstrip(\"\\n\").split()))\n a.sort(reverse=True)\n print((sum(a[1 : n * 2 : 2])))\n\n\nif __name__ == \"__main__\":\n slove()\n"} +{"fast_code_id":"20fe085db322ba70d10e68f89404750173ced5521fd05b3ed343af82cc95a436","fast_id":"p02956_98847dc745804ffedc68345a7f72ee0f29ec77de07b77102351ea8d26538f18c","language":"python","measured_fast_code_id":"98847dc745804ffedc68345a7f72ee0f29ec77de07b77102351ea8d26538f18c","measured_slow_code_id":"8042986ea709f7be4a36940bb65dd281b3740a58e66e7c9edcc0eeee56205242","measurement_metric":"cpu_instruction_count","pair_id":"python_1ab932d60d001f2611c81278","problem_id":"p02956","slow_code_id":"e43f92f24f0e96eef9c4232af95007e4efdc9b0608e734256316ff5cc0636981","slow_id":"p02956_8042986ea709f7be4a36940bb65dd281b3740a58e66e7c9edcc0eeee56205242","speedup":78.17911442738466,"stratum":"8+","sampling_key":"3ecd33737085a5cd88b2e0f20f93d4f9d781c51c3fd76c8ad0e2ee64c59cde08","slow_code":"import sys\n\nreadline = sys.stdin.readline\n\n\nclass BIT:\n\n def __init__(self, n):\n self.size = n\n self.tree = [0] * (n + 1)\n self.p = 2 ** (n.bit_length() - 1)\n self.dep = n.bit_length()\n\n def get(self, i):\n s = 0\n while i > 0:\n s += self.tree[i]\n i -= i & -i\n return s\n\n def add(self, i, x):\n while i <= self.size:\n self.tree[i] += x\n i += i & -i\n\n def bl(self, v):\n if v <= 0:\n return -1\n s = 0\n k = self.p\n for _ in range(self.dep):\n if s + k <= self.size and self.tree[s + k] < v:\n s += k\n v -= self.tree[s + k]\n k //= 2\n return s + 1\n\n\ndef compress(L):\n L2 = list(set(L))\n L2.sort()\n C = {v: k for k, v in enumerate(L2)}\n return L2, C\n\n\nMOD = 998244353\nN = int(readline())\nXY = [list(map(int, readline().split())) for _ in range(N)]\nXY.sort()\nZ = [-(10**10)]\nfor x, y in XY:\n Z.append(y)\n_, CC = compress(Z)\nXY = [(x, CC[y]) for x, y in XY]\nSS, SB, BS, BB = [None] * N, [None] * N, [None] * N, [None] * N\nT = BIT(N)\nfor i in range(N):\n k = i\n y = XY[i][1]\n l = T.get(y)\n SS[i] = l\n SB[i] = k - l\n T.add(y, 1)\nT = BIT(N)\nfor i in range(N - 1, -1, -1):\n k = N - 1 - i\n y = XY[i][1]\n l = T.get(y)\n BS[i] = l\n BB[i] = k - l\n T.add(y, 1)\nP2 = [1] * 1341398\nfor i in range(1, len(P2)):\n P2[i] = P2[i - 1] * 2 % MOD\nans = 0\nfor i in range(N):\n ss = SS[i]\n sb = SB[i]\n bs = BS[i]\n bb = BB[i]\n ans = (ans + P2[N - 1]) % MOD\n ans = (ans + P2[N - 1 - ss - bb] * (P2[ss] - 1) * (P2[bb] - 1)) % MOD\n ans = (ans + P2[N - 1 - sb - bs] * (P2[sb] - 1) * (P2[bs] - 1)) % MOD\n ans = (ans - (P2[sb] - 1) * (P2[bs] - 1) * (P2[ss] - 1) * (P2[bb] - 1)) % MOD\nprint(ans)\n","fast_code":"import sys\n\ninput = sys.stdin.readline\nsys.setrecursionlimit(10**7)\nMOD = 998244353\nN = int(eval(input()))\nXY = [[int(x) for x in input().split()] for _ in range(N)]\nXY.sort()\nX, Y = list(zip(*XY))\nY_rank = {x: i for i, x in enumerate(sorted(Y), 1)}\n\n\ndef BIT_update(tree, x):\n while x <= N:\n tree[x] += 1\n x += x & (-x)\n\n\ndef BIT_sum(tree, x):\n ret = 0\n while x:\n ret += tree[x]\n x -= x & (-x)\n return ret\n\n\npow2 = [1]\nfor _ in range(N):\n pow2.append(pow2[-1] * 2 % MOD)\nanswer = 0\ntree = [0] * (N + 1)\nfor L, (x, y) in enumerate(XY):\n y = Y_rank[y]\n R = N - 1 - L\n D = y - 1\n U = N - 1 - D\n LD = BIT_sum(tree, y)\n BIT_update(tree, y)\n LU = L - LD\n RD = D - LD\n RU = R - RD\n\n cnt = pow2[N]\n cnt -= pow2[L]\n cnt -= pow2[R]\n cnt -= pow2[D]\n cnt -= pow2[U]\n cnt += pow2[LD]\n cnt += pow2[LU]\n cnt += pow2[RD]\n cnt += pow2[RU]\n cnt -= 1\n answer += cnt\nanswer %= MOD\nprint(answer)\n"} +{"fast_code_id":"8055a8166993e0d218b2760f0eca2255ebf5ef59a057bdd9b22159c4b26c14e6","fast_id":"p02793_96b6accdd2ff84453098d0dc3b1176cc08591c7f8921bb69f76b7a10c36966f2","language":"python","measured_fast_code_id":"96b6accdd2ff84453098d0dc3b1176cc08591c7f8921bb69f76b7a10c36966f2","measured_slow_code_id":"66d145443a372a5a43407dc9cf71d71447bec89f203c9422197e66c8dd97343d","measurement_metric":"cpu_instruction_count","pair_id":"python_1b65ca814dd9fcb4fa707849","problem_id":"p02793","slow_code_id":"66d145443a372a5a43407dc9cf71d71447bec89f203c9422197e66c8dd97343d","slow_id":"p02793_66d145443a372a5a43407dc9cf71d71447bec89f203c9422197e66c8dd97343d","speedup":6.031050257321945,"stratum":"4-8","sampling_key":"6694f491176752575651a4bef046bcd1ad066449bba2f420c300f8406d43e70e","slow_code":"class PrimeOptimizer:\n def __init__(self, MAX_NUM=10**3):\n is_prime = [True] * MAX_NUM\n is_prime[0] = False\n is_prime[1] = False\n primes = []\n for i in range(MAX_NUM):\n if is_prime[i]:\n primes.append(i)\n for j in range(2 * i, MAX_NUM, i):\n is_prime[j] = False\n self.primes = primes\n\n def prime_factorization(self, x):\n res = {}\n for prime in self.primes:\n while x % prime == 0:\n if not prime in res:\n res[prime] = 0\n res[prime] += 1\n x //= prime\n if x > 1:\n res[x] = 1\n return res\n\n\nMOD = 10**9 + 7\n\n\ndef mod_pow(p, q):\n res = 1\n while q:\n if q & 1:\n res = (res * p) % MOD\n p = (p * p) % MOD\n q //= 2\n return res\n\n\ndef mod_inv(p):\n return mod_pow(p, MOD - 2)\n\n\ndef solve(n, a):\n primeOpt = PrimeOptimizer()\n D = {}\n for i in range(n):\n prime_num_mapping = primeOpt.prime_factorization(a[i])\n for prime, num in list(prime_num_mapping.items()):\n if not prime in D:\n D[prime] = 0\n D[prime] = max(D[prime], num)\n L = 1\n for prime, num in list(D.items()):\n L = (L * mod_pow(prime, num)) % MOD\n res = sum([L * mod_inv(x) % MOD for x in a])\n return res % MOD\n\n\nN = int(eval(input()))\nA = list(map(int, input().split()))\nprint((solve(N, A)))\n","fast_code":"from functools import reduce\n\n\nMOD = 10**9 + 7\n\n\ndef gcd(a, b):\n while b:\n a, b = b, a % b\n return a\n\n\ndef lcm(x, y):\n return (x * y) // gcd(x, y)\n\n\ndef gcd_list(numbers):\n return reduce(gcd, numbers)\n\n\ndef lcm_list(numbers):\n return reduce(lcm, numbers)\n\n\nn = int(eval(input()))\na = list(map(int, input().split()))\nlcm_ = lcm_list(a)\nb = list([lcm_ // x for x in a])\nans = 0\nfor i in range(len(b)):\n ans += b[i]\nprint((ans % MOD))\n"} +{"fast_code_id":"36efa31a817599454e47c950d8405cd8170cd3f67b1b12f911d115f29e6e8467","fast_id":"p00028_36efa31a817599454e47c950d8405cd8170cd3f67b1b12f911d115f29e6e8467","language":"python","measured_fast_code_id":"36efa31a817599454e47c950d8405cd8170cd3f67b1b12f911d115f29e6e8467","measured_slow_code_id":"f8f979c6405ba37e225e78c555331069ae77d0fb63a50898920f1d1419bec35e","measurement_metric":"cpu_instruction_count","pair_id":"python_1b9292ffeef543e595c75ee2","problem_id":"p00028","slow_code_id":"f8f979c6405ba37e225e78c555331069ae77d0fb63a50898920f1d1419bec35e","slow_id":"p00028_f8f979c6405ba37e225e78c555331069ae77d0fb63a50898920f1d1419bec35e","speedup":2.15113168970238,"stratum":"2-4","sampling_key":"acfd6b8cd3bb09e098ac9e209d4355485e70f76a9ef4e14e6b710d931fbd47a1","slow_code":"a = [0] * 101\nwhile True:\n try:\n a[int(eval(input()))] += 1\n except:\n break\nmaxv = max(a)\nfor i, v in enumerate(a):\n if maxv == v:\n print(i)\n","fast_code":"d = {}\ntry:\n while True:\n n = int(input())\n if n in d:\n d[n] += 1\n else:\n d[n] = 1\nexcept EOFError:\n pass\na = []\nm = max(d.values())\nfor key, value in list(d.items()):\n if value == m:\n a.append(key)\na.sort()\nfor i in a:\n print(i)\n"} +{"fast_code_id":"15fd4d8ca310dfc18a7a7c742e8a0d16bf92b26a1f1d4e8293bd7cd5e3514bb3","fast_id":"p03476_15fd4d8ca310dfc18a7a7c742e8a0d16bf92b26a1f1d4e8293bd7cd5e3514bb3","language":"python","measured_fast_code_id":"15fd4d8ca310dfc18a7a7c742e8a0d16bf92b26a1f1d4e8293bd7cd5e3514bb3","measured_slow_code_id":"8aa7b666b84d39afd40676a7baf00d0d5305252089aa4d028b941a7f3531316e","measurement_metric":"cpu_instruction_count","pair_id":"python_1c09593f592e5c2b6fdea9bc","problem_id":"p03476","slow_code_id":"8aa7b666b84d39afd40676a7baf00d0d5305252089aa4d028b941a7f3531316e","slow_id":"p03476_8aa7b666b84d39afd40676a7baf00d0d5305252089aa4d028b941a7f3531316e","speedup":3.77069346791889,"stratum":"2-4","sampling_key":"0c77cd7fabd77475669997b11f9bc65571760df95836727295281231b2e88db9","slow_code":"import math\n\n\ndef is_prime(n):\n if n == 1:\n return False\n for k in range(2, int(math.sqrt(n)) + 1):\n if n % k == 0:\n return False\n return True\n\n\ncount = [0]\nbuf = 0\nfor i in range(1, 10**5 + 2):\n if i % 2 == 0:\n count.append(buf)\n continue\n hantei1 = is_prime(i)\n hantei2 = is_prime((i + 1) // 2)\n if hantei1 and hantei2:\n buf += 1\n count.append(buf)\nq = int(eval(input()))\nfor i in range(q):\n l, r = list(map(int, input().split()))\n print((count[r] - count[l - 1]))\n","fast_code":"Q = int(eval(input()))\nfact = [True] * (10**5 + 1)\nfact[0] = False\nfact[1] = False\nnum = [0] * (10**5 + 1)\ncur = 0\nfor i in range(len(fact)):\n if fact[i]:\n for j in range(i * 2, len(fact), i):\n fact[j] = False\n if fact[(i + 1) // 2]:\n cur += 1\n num[i] = cur\nfor i in range(Q):\n l, r = list(map(int, input().split()))\n print((num[r] - num[l - 1]))\n"} +{"fast_code_id":"b6ab03dfbca6f801ea2bd903c18a31dbd71e7ee0b74a39dccd56becec539a41e","fast_id":"p03251_b6ab03dfbca6f801ea2bd903c18a31dbd71e7ee0b74a39dccd56becec539a41e","language":"python","measured_fast_code_id":"b6ab03dfbca6f801ea2bd903c18a31dbd71e7ee0b74a39dccd56becec539a41e","measured_slow_code_id":"a3fbc6c47b132b7bae66af85f9792255327ce8e3bf2b5b22873b7c8d59510fae","measurement_metric":"cpu_instruction_count","pair_id":"python_1c460bfada3a5e5969742d5e","problem_id":"p03251","slow_code_id":"a3fbc6c47b132b7bae66af85f9792255327ce8e3bf2b5b22873b7c8d59510fae","slow_id":"p03251_a3fbc6c47b132b7bae66af85f9792255327ce8e3bf2b5b22873b7c8d59510fae","speedup":914.0274555744494,"stratum":"8+","sampling_key":"0feb051640fa3b0b403f94d2f30c9c54029d6eaf2a99964fe80a609e6ee5eb5b","slow_code":"import numpy as np\n\nn, m, x, y = list(map(int, input().split()))\nxl = [int(i) for i in input().split()]\nyl = [int(i) for i in input().split()]\nif x > y:\n print(\"War\")\nelse:\n zl = np.arange(x + 1, y + 1)\n for z in zl:\n if (max(xl) < z) & (z <= min(yl)):\n print(\"No War\")\n break\n else:\n print(\"War\")\n","fast_code":"i = lambda: list(map(int, input().split()))\nn, m, x, y = i()\nprint((\"No \" * (max(list(i()) + [x]) < min(list(i()) + [y])) + \"War\"))\n"} +{"fast_code_id":"4c6ef45179d2198271056f1187a876e01917846e39fdef81f076ed8950b753bd","fast_id":"p03803_a978406fdaa941ebe2e130dced2f5ebaa3d4cfaac09baba490095e47f06341c6","language":"python","measured_fast_code_id":"a978406fdaa941ebe2e130dced2f5ebaa3d4cfaac09baba490095e47f06341c6","measured_slow_code_id":"0bd5df2a157ba82c7c25ec618ddd2b8ac3a7b93747b5c4b4114a2cd42e8e257e","measurement_metric":"cpu_instruction_count","pair_id":"python_1d4f65011365065c28fef3ae","problem_id":"p03803","slow_code_id":"0bd5df2a157ba82c7c25ec618ddd2b8ac3a7b93747b5c4b4114a2cd42e8e257e","slow_id":"p03803_0bd5df2a157ba82c7c25ec618ddd2b8ac3a7b93747b5c4b4114a2cd42e8e257e","speedup":2.763969495713933,"stratum":"2-4","sampling_key":"2c719ce2075a37358a22ef5dd805489d8f3e16e53d59ea947deefefe3143f2a3","slow_code":"import sys, math\nfrom functools import lru_cache\nfrom itertools import accumulate\n\nsys.setrecursionlimit(10**9)\nMOD = 10**9 + 7\n\n\ndef input():\n return sys.stdin.readline()[:-1]\n\n\ndef mi():\n return list(map(int, input().split()))\n\n\ndef ii():\n return int(eval(input()))\n\n\ndef i2(n):\n tmp = [list(mi()) for i in range(n)]\n return [list(i) for i in zip(*tmp)]\n\n\nA, B = mi()\nif A == B:\n print(\"Draw\")\nelif A == 1:\n print(\"Alice\")\nelif B == 1:\n print(\"Bob\")\nelse:\n if A > B:\n print(\"Alice\")\n else:\n print(\"Bob\")\n","fast_code":"a, b = list(map(int, input().split()))\nif a == 1:\n a = 14\nif b == 1:\n b = 14\nif a > b:\n print(\"Alice\")\nelif a < b:\n print(\"Bob\")\nelse:\n print(\"Draw\")\n"} +{"fast_code_id":"9e97a885a3151e1f277d4e510ef95bf065171b3c7368db0ee81b2fa5692ec1c2","fast_id":"p02780_9e97a885a3151e1f277d4e510ef95bf065171b3c7368db0ee81b2fa5692ec1c2","language":"python","measured_fast_code_id":"9e97a885a3151e1f277d4e510ef95bf065171b3c7368db0ee81b2fa5692ec1c2","measured_slow_code_id":"f0e0a2a27a21da5cf3bfa118c0651e9d7851f3f79494b7c4374dbb95d552c6f4","measurement_metric":"cpu_instruction_count","pair_id":"python_1d878fe339e61d95a455acd0","problem_id":"p02780","slow_code_id":"f0e0a2a27a21da5cf3bfa118c0651e9d7851f3f79494b7c4374dbb95d552c6f4","slow_id":"p02780_f0e0a2a27a21da5cf3bfa118c0651e9d7851f3f79494b7c4374dbb95d552c6f4","speedup":4.183799441797468,"stratum":"4-8","sampling_key":"2be39d164794e0532853478dabc8efe2ee3065106e9ab30c81b8aaf4393b8706","slow_code":"class BIT:\n def __init__(self, n):\n self.node = [0 for _ in range(n + 1)]\n\n def add(self, idx, w):\n i = idx\n while i < len(self.node) - 1:\n self.node[i] += w\n i |= i + 1\n\n def sum_(self, idx):\n ret, i = 0, idx - 1\n while i >= 0:\n ret += self.node[i]\n i = (i & (i + 1)) - 1\n return ret\n\n def sum(self, l, r):\n return self.sum_(r) - self.sum_(l)\n\n\nn, k = list(map(int, input().split()))\ntree = BIT(n)\np = [int(x) for x in input().split()]\nfor i in range(n):\n tree.add(i, (1 + p[i]) / 2)\nans = 0\nfor i in range(n - k + 1):\n ans = max(ans, tree.sum(i, i + k))\nprint(ans)\n","fast_code":"num, renzoku = list(map(int, input().split()))\ndices = list(map(int, input().split()))\nexpects = [0] * num\nSi = [0] * (num + 1)\nfor i in range(1, num + 1):\n Si[i] = Si[i - 1] + (1 + dices[i - 1]) / 2\nmax_Si = 0\nfor i in range(0, num - renzoku + 1):\n if max_Si < Si[i + renzoku] - Si[i]:\n max_Si = Si[i + renzoku] - Si[i]\nprint(max_Si)\n"} +{"fast_code_id":"edcc95617201d5626b449d1a7abf3100c52bfc6d5e1b34d56dd05ba872f655f1","fast_id":"p03312_d384bba78aa3be094873144e7572be2fec2f5b51b3dabf911721719d39833e4d","language":"python","measured_fast_code_id":"d384bba78aa3be094873144e7572be2fec2f5b51b3dabf911721719d39833e4d","measured_slow_code_id":"e080e07d8424e073d5e98936947b26997efc5cec42a718a67ce6f5adfbb4164f","measurement_metric":"cpu_instruction_count","pair_id":"python_1da7170a9212895df6471aa2","problem_id":"p03312","slow_code_id":"16fb7a6a6fbb5a3605c73ff209ab7a3c5e631bdab9b5fdf86ce49a66abed34d7","slow_id":"p03312_e080e07d8424e073d5e98936947b26997efc5cec42a718a67ce6f5adfbb4164f","speedup":3.563380120032856,"stratum":"2-4","sampling_key":"8e509e4b95f262099ada34d07befe7dbcbacf9d151a5cdf0e81c27fd79539838","slow_code":"N = int(eval(input()))\nA_list = list(map(int, input().split()))\n\na = 0\nA_left = []\nfor i in range(N):\n a += A_list[i]\n A_left.append(a)\n\na = 0\nA_right = []\nfor i in range(N):\n a += A_list[N - 1 - i]\n A_right.append(a)\n\n\ndef binary_search_left(s):\n m = 0\n l = 0\n r = N - 1\n if A_left[0] > s:\n return 0\n while True:\n m = (l + r) // 2\n if A_left[m] <= s and A_left[m + 1] > s:\n break\n elif A_left[m] <= s:\n l = m\n else:\n r = m\n if s - A_left[m] <= A_left[m + 1] - s:\n return m\n else:\n return m + 1\n\n\ndef binary_search_right(s):\n m = 0\n l = 0\n r = N - 1\n if A_right[0] > s:\n return 0\n while True:\n m = (l + r) // 2\n if A_right[m] <= s and A_right[m + 1] > s:\n break\n elif A_right[m] <= s:\n l = m\n else:\n r = m\n if s - A_right[m] <= A_right[m + 1] - s:\n return m\n else:\n return m + 1\n\n\nres = A_left[N - 1]\nfor s in range(2, N - 1):\n m_l = binary_search_left(A_left[s - 1] / 2)\n a, b = A_left[m_l], A_left[s - 1] - A_left[m_l]\n r = N - s\n m_r = binary_search_right(A_right[r - 1] / 2)\n c, d = A_right[m_r], A_right[r - 1] - A_right[m_r]\n r = max([a, b, c, d]) - min([a, b, c, d])\n if r < res:\n res = r\nif N == 4:\n res = max(A_list) - min(A_list)\nprint(res)\n","fast_code":"N = int(eval(input()))\nAs = list(map(int, input().split()))\nans = float(\"inf\")\niB, iD = 1, 3\n(P, Q, R), S = As[:3], sum(As[3:])\n\nfor iC in range(2, N - 1):\n while P < Q and As[iB] <= Q - P:\n P += As[iB]\n Q -= As[iB]\n iB += 1\n while R < S and As[iD] <= S - R:\n R += As[iD]\n S -= As[iD]\n iD += 1\n ans = min(ans, max(P, Q, R, S) - min(P, Q, R, S))\n Q += As[iC]\n R -= As[iC]\nprint(ans)\n"} +{"fast_code_id":"e3cf1c1b43aa515906bdaeeb755a7ec7bd63e99990a24f6e83609ff590853bd6","fast_id":"p03816_e3cf1c1b43aa515906bdaeeb755a7ec7bd63e99990a24f6e83609ff590853bd6","language":"python","measured_fast_code_id":"e3cf1c1b43aa515906bdaeeb755a7ec7bd63e99990a24f6e83609ff590853bd6","measured_slow_code_id":"d753095d0d960364791984f90dbd9b20563bbbee29b58abd2419ff94d69b471b","measurement_metric":"cpu_instruction_count","pair_id":"python_1dbfa010fb2d396128cf3816","problem_id":"p03816","slow_code_id":"d753095d0d960364791984f90dbd9b20563bbbee29b58abd2419ff94d69b471b","slow_id":"p03816_d753095d0d960364791984f90dbd9b20563bbbee29b58abd2419ff94d69b471b","speedup":6.482689938916846,"stratum":"4-8","sampling_key":"0aa374ad15baebcc60c0043cf2427dbcc1cc98fd1c9636467f4f104567fdf0a1","slow_code":"import functools\n\nN = int(eval(input()))\nA = list(map(int, input().split()))\nd = [0 for i in range(10**5 + 1)]\nfor a in A:\n d[a] = 1\ns = sum(d)\nprint((s - (0 if s % 2 else 1)))\n","fast_code":"N = int(eval(input()))\n(*A,) = list(map(int, input().split()))\nc = {}\nfor a in A:\n c[a] = c.get(a, 0) + 1\nprint((len(c) - sum(v - 1 for v in list(c.values())) % 2))\n"} +{"fast_code_id":"f726c357d28e4b8cc4d8b4a54ca612e4e21c4e8ab23f61c6bd237877e8c6c74d","fast_id":"p02675_f726c357d28e4b8cc4d8b4a54ca612e4e21c4e8ab23f61c6bd237877e8c6c74d","language":"python","measured_fast_code_id":"f726c357d28e4b8cc4d8b4a54ca612e4e21c4e8ab23f61c6bd237877e8c6c74d","measured_slow_code_id":"bcce039052b5a9d508977350d4acfbd9fe58862ea34a03a2bcd6716f9ff97915","measurement_metric":"cpu_instruction_count","pair_id":"python_1dcc58fe9371a4fa51e5cbe2","problem_id":"p02675","slow_code_id":"a356f7da63a7609258cca42cfa76beeb6639c9b361627aee5fe4197d7e864b71","slow_id":"p02675_bcce039052b5a9d508977350d4acfbd9fe58862ea34a03a2bcd6716f9ff97915","speedup":6.392527624484526,"stratum":"4-8","sampling_key":"2aaae4352ee1912bb7d33e91f1f5926184a81d2b3a67fcbdb34ebe8c30dbe00e","slow_code":"import sys\nimport math\nimport collections\nimport itertools\n\nINF = 10**13\nMOD = 10**9 + 7\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef lcm(x, y):\n return (x * y) // math.gcd(x, y)\n\n\ndef I():\n return int(input())\n\n\ndef LI():\n return [int(x) for x in input().split()]\n\n\ndef RI(N):\n return [int(input()) for _ in range(N)]\n\n\ndef LRI(N):\n return [[int(x) for x in input().split()] for _ in range(N)]\n\n\ndef LS():\n return input().split()\n\n\ndef RS(N):\n return [input() for _ in range(N)]\n\n\ndef LRS(N):\n return [input().split() for _ in range(N)]\n\n\ndef PL(L):\n print(*L, sep=\"\\n\")\n\n\ndef YesNo(B):\n print(\"Yes\" if B else \"No\")\n\n\ndef YESNO(B):\n print(\"YES\" if B else \"NO\")\n\n\nN = input()\nn = int(N[-1])\nif n in [2, 4, 5, 7, 9]:\n print(\"hon\")\nelif n in [0, 1, 6, 8]:\n print(\"pon\")\nelse:\n print(\"bon\")\n","fast_code":"N = int(eval(input()))\nch = [\"pon\", \"pon\", \"hon\", \"bon\", \"hon\", \"hon\", \"pon\", \"hon\", \"pon\", \"hon\"]\nprint((ch[N % 10]))\n"} +{"fast_code_id":"b6fc8ed8192c5f68a9f625043fabee60b0ca872cecc31eb34df8cfab411d7f15","fast_id":"p03835_b6fc8ed8192c5f68a9f625043fabee60b0ca872cecc31eb34df8cfab411d7f15","language":"python","measured_fast_code_id":"b6fc8ed8192c5f68a9f625043fabee60b0ca872cecc31eb34df8cfab411d7f15","measured_slow_code_id":"635d8f9332e6bc1c5e85b4adeab9e7a03fc1cd63152cecce14670e5a8c9dd478","measurement_metric":"cpu_instruction_count","pair_id":"python_1de2669994f612e5bb76763c","problem_id":"p03835","slow_code_id":"635d8f9332e6bc1c5e85b4adeab9e7a03fc1cd63152cecce14670e5a8c9dd478","slow_id":"p03835_635d8f9332e6bc1c5e85b4adeab9e7a03fc1cd63152cecce14670e5a8c9dd478","speedup":408.65822893083885,"stratum":"8+","sampling_key":"02ca725f533996510431cf34eea499a8565880bdc23b4019299de79ef98b93fe","slow_code":"K, S = list(map(int, input().split()))\ncount = 0\nfor i in range(K + 1):\n for j in range(K + 1):\n if S - K <= i + j <= S:\n count += 1\nprint(count)\n","fast_code":"K, S = list(map(int, input().split()))\ncount = 0\nfor i in range(K + 1):\n if 0 <= S - i < K:\n count += S - i + 1\n elif K <= S - i <= 2 * K:\n count += 2 * K - S + i + 1\n else:\n continue\nprint(count)\n"} +{"fast_code_id":"5fb4e470bffee1e77fe67869002cfa051bc0f9ceb4f803ffff28bd835f4edb34","fast_id":"p02956_5fb4e470bffee1e77fe67869002cfa051bc0f9ceb4f803ffff28bd835f4edb34","language":"python","measured_fast_code_id":"5fb4e470bffee1e77fe67869002cfa051bc0f9ceb4f803ffff28bd835f4edb34","measured_slow_code_id":"8042986ea709f7be4a36940bb65dd281b3740a58e66e7c9edcc0eeee56205242","measurement_metric":"cpu_instruction_count","pair_id":"python_1e05de470351fb5b0d74ea16","problem_id":"p02956","slow_code_id":"e43f92f24f0e96eef9c4232af95007e4efdc9b0608e734256316ff5cc0636981","slow_id":"p02956_8042986ea709f7be4a36940bb65dd281b3740a58e66e7c9edcc0eeee56205242","speedup":29.925813049095755,"stratum":"8+","sampling_key":"879ac747cf6e7ea9304c2d1300d9b05f186699b36b06d0b736f42651bb620df4","slow_code":"import sys\n\nreadline = sys.stdin.readline\n\n\nclass BIT:\n\n def __init__(self, n):\n self.size = n\n self.tree = [0] * (n + 1)\n self.p = 2 ** (n.bit_length() - 1)\n self.dep = n.bit_length()\n\n def get(self, i):\n s = 0\n while i > 0:\n s += self.tree[i]\n i -= i & -i\n return s\n\n def add(self, i, x):\n while i <= self.size:\n self.tree[i] += x\n i += i & -i\n\n def bl(self, v):\n if v <= 0:\n return -1\n s = 0\n k = self.p\n for _ in range(self.dep):\n if s + k <= self.size and self.tree[s + k] < v:\n s += k\n v -= self.tree[s + k]\n k //= 2\n return s + 1\n\n\ndef compress(L):\n L2 = list(set(L))\n L2.sort()\n C = {v: k for k, v in enumerate(L2)}\n return L2, C\n\n\nMOD = 998244353\nN = int(readline())\nXY = [list(map(int, readline().split())) for _ in range(N)]\nXY.sort()\nZ = [-(10**10)]\nfor x, y in XY:\n Z.append(y)\n_, CC = compress(Z)\nXY = [(x, CC[y]) for x, y in XY]\nSS, SB, BS, BB = [None] * N, [None] * N, [None] * N, [None] * N\nT = BIT(N)\nfor i in range(N):\n k = i\n y = XY[i][1]\n l = T.get(y)\n SS[i] = l\n SB[i] = k - l\n T.add(y, 1)\nT = BIT(N)\nfor i in range(N - 1, -1, -1):\n k = N - 1 - i\n y = XY[i][1]\n l = T.get(y)\n BS[i] = l\n BB[i] = k - l\n T.add(y, 1)\nP2 = [1] * 1341398\nfor i in range(1, len(P2)):\n P2[i] = P2[i - 1] * 2 % MOD\nans = 0\nfor i in range(N):\n ss = SS[i]\n sb = SB[i]\n bs = BS[i]\n bb = BB[i]\n ans = (ans + P2[N - 1]) % MOD\n ans = (ans + P2[N - 1 - ss - bb] * (P2[ss] - 1) * (P2[bb] - 1)) % MOD\n ans = (ans + P2[N - 1 - sb - bs] * (P2[sb] - 1) * (P2[bs] - 1)) % MOD\n ans = (ans - (P2[sb] - 1) * (P2[bs] - 1) * (P2[ss] - 1) * (P2[bb] - 1)) % MOD\nprint(ans)\n","fast_code":"import sys, queue, math, copy, itertools, bisect, collections, heapq\n\n\ndef main():\n MOD = 998244353\n LI = lambda: [int(x) for x in sys.stdin.readline().split()]\n NI = lambda: int(sys.stdin.readline())\n N = NI()\n dat = [LI() for _ in range(N)]\n dat.sort()\n yo = [y for _, y in dat]\n yo.sort()\n up = [0] * N\n dw = [0] * N\n bit = [0] * (N + 1)\n\n def bit_add(i):\n while i <= N:\n bit[i] += 1\n i += i & -i\n\n def bit_sum(i):\n ret = 0\n while i > 0:\n ret += bit[i]\n i -= i & -i\n return ret\n\n for i in range(N):\n x, y = dat[i]\n y = bisect.bisect_left(yo, y) + 1\n up[i] = bit_sum(y)\n bit_add(y)\n bit = [0] * (N + 1)\n for i in range(N - 1, -1, -1):\n x, y = dat[i]\n y = bisect.bisect_left(yo, y) + 1\n dw[i] = bit_sum(y)\n bit_add(y)\n ans = N * pow(2, N - 1, MOD)\n for i in range(N):\n a = i - up[i]\n b = up[i]\n c = N - (i + 1) - dw[i]\n d = dw[i]\n pa = pow(2, a, MOD)\n pb = pow(2, b, MOD)\n pc = pow(2, c, MOD)\n pd = pow(2, d, MOD)\n p = (pow(2, a + d, MOD) - 1) - (pa - 1) - (pd - 1)\n q = (pow(2, b + c, MOD) - 1) - (pb - 1) - (pc - 1)\n x = p * (pb + pc - 1)\n y = q * (pa + pd - 1)\n z = p * q\n ans = (ans + x + y + z) % MOD\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"f3575c8caba839cd5c99e68ff2a16b8d1073b901acb6bf3a93309e7bf2c60891","fast_id":"p03037_f3575c8caba839cd5c99e68ff2a16b8d1073b901acb6bf3a93309e7bf2c60891","language":"python","measured_fast_code_id":"f3575c8caba839cd5c99e68ff2a16b8d1073b901acb6bf3a93309e7bf2c60891","measured_slow_code_id":"603682b2a1acebd824f0081d6dbfdc82575d41c2aa8f541e6ca8387c5cde8833","measurement_metric":"cpu_instruction_count","pair_id":"python_1e63e8db3b3b2308d7e7106f","problem_id":"p03037","slow_code_id":"603682b2a1acebd824f0081d6dbfdc82575d41c2aa8f541e6ca8387c5cde8833","slow_id":"p03037_603682b2a1acebd824f0081d6dbfdc82575d41c2aa8f541e6ca8387c5cde8833","speedup":38.91631952347901,"stratum":"8+","sampling_key":"bdf80c92da00794ed1b97206d24fab814da7576520152c12d9aeb3634e0d3a24","slow_code":"import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, queue, copy\n\nsys.setrecursionlimit(10**7)\ninf = 10**20\nmod = 10**9 + 7\ndd = [(-1, 0), (0, 1), (1, 0), (0, -1)]\nddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef LI_():\n return [int(x) - 1 for x in sys.stdin.readline().split()]\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LS():\n return sys.stdin.readline().split()\n\n\ndef S():\n return eval(input())\n\n\ndef main():\n n, k = LI()\n l = [0] * (n + 1)\n for _ in range(k):\n a, b = LI()\n l[a - 1] += 1\n l[b] -= 1\n for i in range(n - 1):\n l[i + 1] += l[i]\n ans = 0\n for x in l[:-1]:\n if x == k:\n ans += 1\n return ans\n\n\nprint((main()))\n","fast_code":"n, m = list(map(int, input().split()))\nml = 0\nmr = 100000\nfor i in range(m):\n l, r = list(map(int, input().split()))\n ml = max(ml, l)\n mr = min(mr, r)\n if ml > mr:\n break\nif ml <= mr:\n print((mr - ml + 1))\nelse:\n print((0))\n"} +{"fast_code_id":"a49ac918a01831449bf3aec0e5b1c11acd6e04aea985279f3dc2999da687ae86","fast_id":"p02261_a49ac918a01831449bf3aec0e5b1c11acd6e04aea985279f3dc2999da687ae86","language":"python","measured_fast_code_id":"a49ac918a01831449bf3aec0e5b1c11acd6e04aea985279f3dc2999da687ae86","measured_slow_code_id":"63fb47313d43df57a65763bf53ef7a8b437263f3ca4346979cfa2712a3b6daec","measurement_metric":"cpu_instruction_count","pair_id":"python_1e7a471664518b58ce0f714e","problem_id":"p02261","slow_code_id":"63fb47313d43df57a65763bf53ef7a8b437263f3ca4346979cfa2712a3b6daec","slow_id":"p02261_63fb47313d43df57a65763bf53ef7a8b437263f3ca4346979cfa2712a3b6daec","speedup":2.059358229042562,"stratum":"2-4","sampling_key":"519edf95409349a13818820a34b0a2c7943ac8f05eda945a9bebb838c61575a1","slow_code":"class Card:\n def __init__(self, card):\n self.card = card\n self.mark = card[0]\n self.number = card[1]\n\n def __lt__(self, other):\n if not isinstance(other, Card):\n return NotImplemented\n return self.number < other.number\n\n def __eq__(self, other):\n if not isinstance(other, Card):\n return NotImplemented\n return self.mark == other.mark and self.number == other.number\n\n def __repr__(self):\n return \"{}{}\".format(self.mark, self.number)\n\n\ndef BubbleSort(target):\n ls = target.copy()\n flag = 1\n while flag:\n flag = 0\n for i in range(len(ls) - 1, 0, -1):\n if ls[i] < ls[i - 1]:\n ls[i], ls[i - 1] = ls[i - 1], ls[i]\n flag = 1\n print((\" \".join(map(str, ls))))\n return sorted(ls)\n\n\ndef SelectSort(target):\n ls = target.copy()\n for i in range(len(ls)):\n minj = i\n for j in range(i + 1, len(ls)):\n if ls[j] < ls[minj]:\n minj = j\n if ls[i] != ls[minj]:\n ls[i], ls[minj] = ls[minj], ls[i]\n print((\" \".join(map(str, ls))))\n return sorted(ls)\n\n\ndef judge(original, sorted_list):\n if original == sorted_list:\n print(\"Stable\")\n else:\n print(\"Not stable\")\n\n\n_ = int(eval(input()))\nl2 = [Card(i) for i in input().split()]\nl2_sort = sorted(l2)\nbubble = BubbleSort(l2)\njudge(l2_sort, bubble)\nselect = SelectSort(l2)\njudge(l2_sort, select)\n","fast_code":"def bubble_sort(A, n):\n for i in range(n):\n for j in range(n - 1, i, -1):\n if A[j][1] < A[j - 1][1]:\n A[j], A[j - 1] = A[j - 1], A[j]\n print((\" \".join(A)))\n\n\ndef selection_sort(A, n):\n for i in range(n):\n minj = i\n for j in range(i, n):\n if A[j][1] < A[minj][1]:\n minj = j\n if i != minj:\n A[i], A[minj] = A[minj], A[i]\n print((\" \".join(A)))\n\n\nif __name__ == \"__main__\":\n n = int(eval(input()))\n A = list(input().split())\n B = A[:]\n bubble_sort(A, n)\n print(\"Stable\")\n selection_sort(B, n)\n print((\"Stable\" if A == B else \"Not stable\"))\n"} +{"fast_code_id":"0873e3676df3ea663ede63d7cc8156ee8849df8feed3d3768c0a80ece711b17e","fast_id":"p03606_d6f611d4319fcbd5abdfcb7256b41081143f219491aaea64d2ac4a94a158f0af","language":"python","measured_fast_code_id":"d6f611d4319fcbd5abdfcb7256b41081143f219491aaea64d2ac4a94a158f0af","measured_slow_code_id":"91ed37766e83e1c57b3ed54e34dd70e87dd0159574758547062baadff81ba4dd","measurement_metric":"cpu_instruction_count","pair_id":"python_1eec80796ef81e8083733efc","problem_id":"p03606","slow_code_id":"91ed37766e83e1c57b3ed54e34dd70e87dd0159574758547062baadff81ba4dd","slow_id":"p03606_91ed37766e83e1c57b3ed54e34dd70e87dd0159574758547062baadff81ba4dd","speedup":6.78807609273891,"stratum":"4-8","sampling_key":"3489049b86d01515857fede8469847446aa204ef735836bc792f6420b7549677","slow_code":"import collections\n\nn = int(eval(input()))\nl = [list(map(int, input().split())) for _ in range(n)]\nd = {}\nfor i in range(len(l)):\n for j in range(l[i][0], l[i][1] + 1):\n d[j] = 1\nprint((len(d)))\n","fast_code":"def print_ans(l, r, N):\n print((sum(r) - sum(l) + N))\n\n\ndef main():\n N = int(eval(input()))\n l = []\n r = []\n for i in range(N):\n s = list(map(int, input().split()))\n l.append(s[0])\n r.append(s[1])\n print_ans(l, r, N)\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"aeb029ccb1764c1fd274dd9751a266b42b26f693bc3d8596ea07575f4d617a96","fast_id":"p00022_aeb029ccb1764c1fd274dd9751a266b42b26f693bc3d8596ea07575f4d617a96","language":"python","measured_fast_code_id":"aeb029ccb1764c1fd274dd9751a266b42b26f693bc3d8596ea07575f4d617a96","measured_slow_code_id":"0bfdaa35e05b154c6df76410062f0f983b54174945c77f6668b8a03d87066b50","measurement_metric":"cpu_instruction_count","pair_id":"python_1fc6135d8ccb4cf44217e5bf","problem_id":"p00022","slow_code_id":"0bfdaa35e05b154c6df76410062f0f983b54174945c77f6668b8a03d87066b50","slow_id":"p00022_0bfdaa35e05b154c6df76410062f0f983b54174945c77f6668b8a03d87066b50","speedup":2.4259667818564,"stratum":"2-4","sampling_key":"01e4341bb37310753d15eb5929e53b4fec11e413aba9ad8104053e385c6e9178","slow_code":"while True:\n n = int(eval(input()))\n if n == 0:\n break\n else:\n a = [int(eval(input())) for i in range(n)]\n for i in range(1, n):\n a[i] = max(a[i - 1] + a[i], a[i])\n print((max(a)))\n","fast_code":"import sys\n\ns = \"\"\nfor i in sys.stdin:\n n = int(i)\n if n == 0:\n break\n max = -100000\n sum = int(input())\n for i in range(n - 1):\n m = int(input())\n if sum < 0 and sum < m:\n sum = m\n else:\n if m < 0 and max < sum:\n max = sum\n sum += m\n if sum > max:\n s += str(sum) + \"\\n\"\n else:\n s += str(max) + \"\\n\"\nprint(s, end=\"\")\n"} +{"fast_code_id":"eeaf509bab666b2036f34e80665c8088d959a8e042fcfbf5282df779854fc46f","fast_id":"p03609_eeaf509bab666b2036f34e80665c8088d959a8e042fcfbf5282df779854fc46f","language":"python","measured_fast_code_id":"eeaf509bab666b2036f34e80665c8088d959a8e042fcfbf5282df779854fc46f","measured_slow_code_id":"05c7cfa6f7e3edd14d82845ed4d2e91cd4b96ef2bf5eba445a2670d95ff174d0","measurement_metric":"cpu_instruction_count","pair_id":"python_1fedb87cf57c2350561e8a65","problem_id":"p03609","slow_code_id":"05c7cfa6f7e3edd14d82845ed4d2e91cd4b96ef2bf5eba445a2670d95ff174d0","slow_id":"p03609_05c7cfa6f7e3edd14d82845ed4d2e91cd4b96ef2bf5eba445a2670d95ff174d0","speedup":1970.024380669226,"stratum":"8+","sampling_key":"0bf35a6301145437b0390e567b645f112375634f9f5965c022c2c8a9013e773d","slow_code":"import numpy as np\n\nx, t = list(map(int, input().split()))\nprint((max(x - t, 0)))\n","fast_code":"x, t = list(map(int, input().split()))\nif x > t:\n print((x - t))\nelse:\n print((0))\n"} +{"fast_code_id":"a4eba5c9d642b103b8b4f0414c710b0072c94b849e28bedb019ea97f6dc9bd14","fast_id":"p00100_c650910a23f4c80cdec40d71f55f58b53ce601c16cbff163efc652624012aa46","language":"python","measured_fast_code_id":"c650910a23f4c80cdec40d71f55f58b53ce601c16cbff163efc652624012aa46","measured_slow_code_id":"5d1f4cb08fbc43299784771f17b3646fe4993e8fd866609d48d2ebc0e737a39c","measurement_metric":"cpu_instruction_count","pair_id":"python_2011cef032dcbfc52bf24bf0","problem_id":"p00100","slow_code_id":"d4669c36b7d92dd1908cad9300dbbe214938350a72f54c414f63ae0b2ccb8749","slow_id":"p00100_5d1f4cb08fbc43299784771f17b3646fe4993e8fd866609d48d2ebc0e737a39c","speedup":3.1919536449247827,"stratum":"2-4","sampling_key":"dc1ab50c6702db9c4ab1be4af74dfd5b591cae43117a2cc646e0add894c7963b","slow_code":"employeeSalesList = []\n\n\ndef resetDataset():\n del employeeSalesList[0 : len(employeeSalesList) + 1]\n\n\ndef readDataCount():\n return int(eval(input()))\n\n\ndef searchEmployeeSales(employeeId):\n for data in employeeSalesList:\n if data[0] == employeeId:\n return data\n newData = [employeeId, 0]\n employeeSalesList.append(newData)\n return newData\n\n\ndef printEmployeeOfDataset():\n answerList = [data[0] for data in employeeSalesList if data[1] >= 1000000]\n if len(answerList) == 0:\n print(\"NA\")\n else:\n print((\"\\n\".join(map(str, answerList))))\n\n\nresetDataset()\ndataCount = readDataCount()\nwhile dataCount > 0:\n for _ in range(dataCount):\n employeeId, price, volume = list(map(int, input().split(\" \")))\n employeeSales = searchEmployeeSales(employeeId)\n employeeSales[1] += price * volume\n printEmployeeOfDataset()\n resetDataset()\n dataCount = readDataCount()\n","fast_code":"import sys\nfrom collections import OrderedDict\n\n\ndef solve(data):\n\n sums = OrderedDict()\n for id, p, q in data:\n if id in sums:\n sums[id] += p * q\n else:\n sums[id] = p * q\n result = [key for key, value in list(sums.items()) if value >= 1000000]\n return result\n\n\ndef main(args):\n\n while True:\n num = int(eval(input()))\n if num == 0:\n break\n data = []\n for _ in range(num):\n data.append([int(x) for x in input().split(\" \")])\n result = solve(data)\n if result:\n for ele in result:\n print(ele)\n else:\n print(\"NA\")\n\n\nif __name__ == \"__main__\":\n main(sys.argv[1:])\n"} +{"fast_code_id":"8c2db2d4e0501370c31ff9c9fa1ff279ff2c6ffea5c5b072ab8ef9afc0492cc6","fast_id":"p02709_07fe8e1d91d6277abfab70061f93ba58509eceacbd1fae6065f288a7e9104644","language":"python","measured_fast_code_id":"07fe8e1d91d6277abfab70061f93ba58509eceacbd1fae6065f288a7e9104644","measured_slow_code_id":"3d838e07742b6038959605af2d3df1f36b7399126fc563b9a2c8f3bce236aaea","measurement_metric":"cpu_instruction_count","pair_id":"python_202a3808fda74d5e7148a7c0","problem_id":"p02709","slow_code_id":"aa98af4784f39634c1b1369b22ff40f05d4ea9461af1aad5cd1db169f1d8c6f4","slow_id":"p02709_3d838e07742b6038959605af2d3df1f36b7399126fc563b9a2c8f3bce236aaea","speedup":7.9956338109944936,"stratum":"4-8","sampling_key":"23f7f4f18f1235e34ebe51583b895510a23c196b94559f80c4cd50963256b94b","slow_code":"import sys\nimport numpy as np\n\n\ndef f(n, a_):\n a = []\n for i, ai in enumerate(a_):\n a.append([1 + i, ai])\n a.sort(key=lambda x: x[1], reverse=True)\n dp = np.zeros((n + 1, n + 1), np.int64)\n dp[1, 1] = a[0][1] * (n - a[0][0])\n dp[1, 0] = a[0][1] * (a[0][0] - 1)\n for i in range(2, n + 1):\n dp[i, 0] = dp[i - 1, 0] + a[i - 1][1] * abs((a[i - 1][0] - 1 - (i - 1)))\n dp[i, i] = dp[i - 1, i - 1] + a[i - 1][1] * abs((n - a[i - 1][0] - (i - 1)))\n\n l = dp[i - 1, 1:i] + [\n a[i - 1][1] * abs((a[i - 1][0] - 1 - j)) for j in range(i - 2, -1, -1)\n ]\n\n r = dp[i - 1, : i - 1] + [\n a[i - 1][1] * abs((n - a[i - 1][0] - j)) for j in range(i - 1)\n ]\n dp[i, 1:i] = np.maximum(l, r)\n return max(dp[n])\n\n\nif __name__ == \"__main__\":\n input = sys.stdin.readline\n n = int(eval(input()))\n a_ = list(map(int, input().split()))\n print((f(n, a_)))\n","fast_code":"n = int(input())\na = list(map(int, input().split()))\nassert len(a) == n\n\np = list(range(n))\np.sort(key=lambda i: a[i])\n\ndp = {(j, 0): 0 for j in range(n + 1)}\nfor i in range(n):\n for j in range(n - i):\n dp[(j, i + 1)] = max(\n dp[(j, i)] + a[p[i]] * abs(p[i] - (j + i)),\n dp[(j + 1, i)] + a[p[i]] * abs(p[i] - j),\n )\nprint(dp[(0, n)])\n"} +{"fast_code_id":"561e88c3bd1767dce128cfcce7ed569655c49a394129b24ee2a5ef31a23618fd","fast_id":"p02619_561e88c3bd1767dce128cfcce7ed569655c49a394129b24ee2a5ef31a23618fd","language":"python","measured_fast_code_id":"561e88c3bd1767dce128cfcce7ed569655c49a394129b24ee2a5ef31a23618fd","measured_slow_code_id":"d03c5b8a0cfad256289a0238b96e85a9483f201802ae221a6fa72a78e056a6e7","measurement_metric":"cpu_instruction_count","pair_id":"python_20632970ac8a09666b19229c","problem_id":"p02619","slow_code_id":"d03c5b8a0cfad256289a0238b96e85a9483f201802ae221a6fa72a78e056a6e7","slow_id":"p02619_d03c5b8a0cfad256289a0238b96e85a9483f201802ae221a6fa72a78e056a6e7","speedup":49.772358755899,"stratum":"8+","sampling_key":"ba8ecaa57669b12fb64acbfe447fc2776b8c1aeeeebc9f4113b3e0b1a2ee93ad","slow_code":"def read_input():\n D = int(eval(input()))\n C = input().split()\n C = [int(i) for i in C]\n S = [list(map(int, input().split())) for _ in range(D)]\n T = [int(eval(input())) for _ in range(D)]\n return D, C, S, T\n\n\ndef scoring(S, D, T, C):\n res = []\n last = [0 for _ in range(26)]\n final = 0\n for i in range(D):\n dec = 0\n for j in range(26):\n for loc, val in enumerate(T[: i + 1]):\n if val == j + 1:\n last[j] = loc + 1\n dec += C[j] * (i - last[j] + 1)\n final += S[i][T[i] - 1] - dec\n res.append(final)\n return res\n\n\nD, C, S, T = read_input()\nres = scoring(S, D, T, C)\nfor x in res:\n print(x)\n","fast_code":"(\n d,\n *s,\n) = list(map(int, open(i := 0).read().split()))\nc, *l = [0] * 27\nfor v in s[-d:]:\n i += 1\n l[v - 1] = i\n print((c := c + s[i * 26 + v - 1] - sum(x * (i - y) for x, y in zip(s, l))))\n"} +{"fast_code_id":"9bd99fec9e6ec4fee9368ad961d397fb9380f635a86a7ba86920d6bcf2974eb8","fast_id":"p03556_9bd99fec9e6ec4fee9368ad961d397fb9380f635a86a7ba86920d6bcf2974eb8","language":"python","measured_fast_code_id":"9bd99fec9e6ec4fee9368ad961d397fb9380f635a86a7ba86920d6bcf2974eb8","measured_slow_code_id":"b08038f2cfa38828c3451135e0ae29ee0ad4cf29b9ef9a8abfaa3be486afcc2d","measurement_metric":"cpu_instruction_count","pair_id":"python_20f3f00c8f4f7436a8298aab","problem_id":"p03556","slow_code_id":"b08038f2cfa38828c3451135e0ae29ee0ad4cf29b9ef9a8abfaa3be486afcc2d","slow_id":"p03556_b08038f2cfa38828c3451135e0ae29ee0ad4cf29b9ef9a8abfaa3be486afcc2d","speedup":3771.2280540829843,"stratum":"8+","sampling_key":"783a86f004c2bb6e4b47945c5ec174680e8f6c5e0e3a82ff0522cf1e86ac06fe","slow_code":"import functools\nimport itertools\nimport numpy as np\nimport sys\n\nMAX_INT = int(10e10)\nMIN_INT = -MAX_INT\nmod = 1000000007\nsys.setrecursionlimit(1000000)\n\n\ndef IL():\n return list(map(int, input().split()))\n\n\ndef SL():\n return input().split()\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef S():\n return eval(input())\n\n\nN = I()\nans = [pow(i, 2) for i in range(100000) if pow(i, 2) <= N]\nprint((ans[-1]))\n","fast_code":"N = int(eval(input()))\nN = int(N**0.5)\nprint((N * N))\n"} +{"fast_code_id":"1796b3dd56792d24729b3767f68becf643f395739fe613fb028da3c5eba51573","fast_id":"p03006_1796b3dd56792d24729b3767f68becf643f395739fe613fb028da3c5eba51573","language":"python","measured_fast_code_id":"1796b3dd56792d24729b3767f68becf643f395739fe613fb028da3c5eba51573","measured_slow_code_id":"7838a318c333827f3472e6350353ce8b4259224d69f85170d3cd9658a4f5e659","measurement_metric":"cpu_instruction_count","pair_id":"python_2171d62daffbaaf824d82134","problem_id":"p03006","slow_code_id":"7838a318c333827f3472e6350353ce8b4259224d69f85170d3cd9658a4f5e659","slow_id":"p03006_7838a318c333827f3472e6350353ce8b4259224d69f85170d3cd9658a4f5e659","speedup":6.262499506555342,"stratum":"4-8","sampling_key":"0642f77e04f7cf89ad09c602327c018c829598a3945f63e2c3713994b935a1ee","slow_code":"N = int(eval(input()))\nif N == 1:\n print((1))\n exit()\nxy = [tuple(int(e) for e in input().split()) for _ in range(N)]\nd_list = [(i[0] - j[0], i[1] - j[1]) for i in xy for j in xy if i != j]\nitems = list(set(d_list))\ns = 1\nfor item in items:\n c = d_list.count(item)\n if c > s:\n s = c\nprint((N - s))\n","fast_code":"n = int(eval(input()))\narr = sorted([list(map(int, input().rstrip().split())) for _ in range(n)])\ncnt = {}\nfor i, j in arr:\n for k, l in arr:\n if (i, j) == (k, l):\n continue\n dif = (k - i, l - j)\n cnt.setdefault(dif, 0)\n cnt[dif] += 1\nprint((n - max(list(cnt.values()), default=0)))\n"} +{"fast_code_id":"a8764e435fcf099811246783156c1fa3d8a7beab59fd7a1050989deae490782e","fast_id":"p03419_a8764e435fcf099811246783156c1fa3d8a7beab59fd7a1050989deae490782e","language":"python","measured_fast_code_id":"a8764e435fcf099811246783156c1fa3d8a7beab59fd7a1050989deae490782e","measured_slow_code_id":"03759bbd848f3c06ca221a2e3cc07d0592161ce2c92214006d02107382720a3e","measurement_metric":"cpu_instruction_count","pair_id":"python_2185ead8822759bb3a77568f","problem_id":"p03419","slow_code_id":"03759bbd848f3c06ca221a2e3cc07d0592161ce2c92214006d02107382720a3e","slow_id":"p03419_03759bbd848f3c06ca221a2e3cc07d0592161ce2c92214006d02107382720a3e","speedup":3.6288389218493085,"stratum":"2-4","sampling_key":"27f5e29458d2af4f0bf51cf85d367bb959822702decea20b8fa05e82d028f139","slow_code":"def calc0(N, M):\n cell = [[0 for i in range(M)] for j in range(N)]\n for i in range(M):\n for j in range(N):\n for y in range(-1, 2):\n for x in range(-1, 2):\n xx = i + x\n yy = j + y\n if 0 <= xx < M and 0 <= yy < N:\n cell[yy][xx] ^= 1\n r = 0\n for i in range(M):\n for j in range(N):\n if cell[j][i]:\n r += 1\n return r\n\n\ndef calc(N, M):\n if N == 1 and M == 1:\n return 1\n if N >= 2 and M >= 2:\n return (N - 2) * (M - 2)\n if N == 1:\n return M - 2\n return N - 2\n\n\nN, M = [int(_) for _ in input().split()]\nprint((calc(N, M)))\n","fast_code":"n, m = list(map(int, input().split()))\nif n == 1 or m == 1:\n print((1 if n * m == 1 else max(n, m) - 2))\nelse:\n print(((n - 2) * (m - 2)))\n"} +{"fast_code_id":"10431e81609a537957d91e0e28370c9d58ba489634427b6b2ef0020979027fd8","fast_id":"p03289_10431e81609a537957d91e0e28370c9d58ba489634427b6b2ef0020979027fd8","language":"python","measured_fast_code_id":"10431e81609a537957d91e0e28370c9d58ba489634427b6b2ef0020979027fd8","measured_slow_code_id":"793ab94a75b65c0d0ef6021f2294bd1b95b2f70d619271fa3dbec70fadc1f548","measurement_metric":"cpu_instruction_count","pair_id":"python_21d2d230b85331d64da92dd4","problem_id":"p03289","slow_code_id":"7b08aecededd64cba959876054e545474ae8273c94197ba6285b113097829f8c","slow_id":"p03289_793ab94a75b65c0d0ef6021f2294bd1b95b2f70d619271fa3dbec70fadc1f548","speedup":2.028347427217964,"stratum":"2-4","sampling_key":"18335c4bd4e8769e7d2d1cd5809da378d8987958e697b80ab5f552c39a05ad45","slow_code":"import sys\n\ninput = sys.stdin.readline\nMOD = 1000000007\nS = input()[:-1]\nS = list(S)\nif S[0] == \"A\":\n if \"C\" in S[2:-1] and S.count(\"C\") == 1:\n cnt = 0\n for i in range(1, len(S)):\n if S[i].isupper():\n if S[i] == \"C\":\n continue\n else:\n cnt += 1\n\n if cnt == len(S) - 2:\n print(\"AC\")\n exit()\nprint(\"WA\")\n","fast_code":"i = input()\nif (\n i[0] == \"A\"\n and i[2:-1].count(\"C\") == 1\n and i[1:].replace(\"C\", \"c\", 1).islower() == True\n):\n print(\"AC\")\nelse:\n print(\"WA\")\n"} +{"fast_code_id":"72b71a4c2a434a9d0a0a9d484d7636764d97594d3350c5893fe481f19a5f8124","fast_id":"p03288_72b71a4c2a434a9d0a0a9d484d7636764d97594d3350c5893fe481f19a5f8124","language":"python","measured_fast_code_id":"72b71a4c2a434a9d0a0a9d484d7636764d97594d3350c5893fe481f19a5f8124","measured_slow_code_id":"4b19a6c66c6b24c9d371f629b6a683da99f61809c1d26fcff1386ca6548060d5","measurement_metric":"cpu_instruction_count","pair_id":"python_21df9c75566c3b68350159ac","problem_id":"p03288","slow_code_id":"4b19a6c66c6b24c9d371f629b6a683da99f61809c1d26fcff1386ca6548060d5","slow_id":"p03288_4b19a6c66c6b24c9d371f629b6a683da99f61809c1d26fcff1386ca6548060d5","speedup":38.57424021440494,"stratum":"8+","sampling_key":"7bfcdc072098c1590cabc044b1dba0fdd95b408f1b4a42c86e028a8b3d3386d9","slow_code":"import bisect, collections, copy, heapq, itertools, math, string\nimport sys\n\n\ndef S():\n return sys.stdin.readline().rstrip()\n\n\ndef M():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef LS():\n return list(sys.stdin.readline().rstrip().split())\n\n\nR = I()\nif R < 1200:\n print(\"ABC\")\nelif R < 2800:\n print(\"ARC\")\nelse:\n print(\"AGC\")\n","fast_code":"print((\"A\" + \"BRG\"[(int(eval(input())) + 400) // 1600] + \"C\"))\n"} +{"fast_code_id":"f75fd3a8199400a04c8f3465afb7585249a1e681130ed028fbd76cbeec919e06","fast_id":"p03609_f75fd3a8199400a04c8f3465afb7585249a1e681130ed028fbd76cbeec919e06","language":"python","measured_fast_code_id":"f75fd3a8199400a04c8f3465afb7585249a1e681130ed028fbd76cbeec919e06","measured_slow_code_id":"a299dbf158d9b4197e8d6e9bc8a56f5dae0f1a29a154060b4dbf82a91b0fb59c","measurement_metric":"cpu_instruction_count","pair_id":"python_22c368b9c4a8359dd4041159","problem_id":"p03609","slow_code_id":"a299dbf158d9b4197e8d6e9bc8a56f5dae0f1a29a154060b4dbf82a91b0fb59c","slow_id":"p03609_a299dbf158d9b4197e8d6e9bc8a56f5dae0f1a29a154060b4dbf82a91b0fb59c","speedup":1648.4181511803556,"stratum":"8+","sampling_key":"7a46a2d3bd7f8dc366041868ff8366221a6ead730350bc45587b23c0dcc00cfe","slow_code":"import numpy as np\n\nx, t = list(map(int, input().split()))\nprint((np.max(np.array([x - t, 0]))))\n","fast_code":"def main():\n x, t = list(map(int, input().split()))\n print((max(0, x - t)))\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"71ec450d2eab5fa72e6248a375ea9647714fc66e77f68c002e360598525c3061","fast_id":"p02607_71ec450d2eab5fa72e6248a375ea9647714fc66e77f68c002e360598525c3061","language":"python","measured_fast_code_id":"71ec450d2eab5fa72e6248a375ea9647714fc66e77f68c002e360598525c3061","measured_slow_code_id":"80d5226038bdb32cf21a0b535cbd1c7092e4e8009586ccf346a6a6f305bc5b7d","measurement_metric":"cpu_instruction_count","pair_id":"python_2339a56d2e29b9d9c69f2c3f","problem_id":"p02607","slow_code_id":"80d5226038bdb32cf21a0b535cbd1c7092e4e8009586ccf346a6a6f305bc5b7d","slow_id":"p02607_80d5226038bdb32cf21a0b535cbd1c7092e4e8009586ccf346a6a6f305bc5b7d","speedup":1470.0225101066524,"stratum":"8+","sampling_key":"3104bf459b7ee0d42cb99bfe93804702a9b6a97abba13903b9c73e00d4c32110","slow_code":"import sys\nfrom collections import deque\nimport numpy as np\nimport math\n\nsys.setrecursionlimit(10**6)\n\n\ndef S():\n return sys.stdin.readline().rstrip()\n\n\ndef SL():\n return list(map(str, sys.stdin.readline().rstrip().split()))\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\ndef IL():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef Main():\n n = I()\n a = list(IL())\n c = 0\n for rep in range(0, n, 2):\n if a[rep] % 2:\n c += 1\n print(c)\n return\n\n\nif __name__ == \"__main__\":\n Main()\n","fast_code":"print((sum([int(x) % 2 for x in open(0).read().split()[1::2]])))\n"} +{"fast_code_id":"6a882d2a5423b1f6b3f7524d4d393bad5b717d8c1f08a3765c460fbb340b4113","fast_id":"p02555_6a882d2a5423b1f6b3f7524d4d393bad5b717d8c1f08a3765c460fbb340b4113","language":"python","measured_fast_code_id":"6a882d2a5423b1f6b3f7524d4d393bad5b717d8c1f08a3765c460fbb340b4113","measured_slow_code_id":"be28d9cac8a1e8736627f41a67db426cc354abd2534ebe43d482286cd888d245","measurement_metric":"cpu_instruction_count","pair_id":"python_247decd2a2e440e542dfe66a","problem_id":"p02555","slow_code_id":"ce854c84bb488b03baf8685f08880ca102a034fd37d460a4819dbdb87cc4e492","slow_id":"p02555_be28d9cac8a1e8736627f41a67db426cc354abd2534ebe43d482286cd888d245","speedup":243.85043340695972,"stratum":"8+","sampling_key":"0a16bca72da87196079fe28ac82b680a8ab5209448cd9be5a9e55fe2e1b1be1f","slow_code":"s = int(eval(input()))\nmod = 10**9 + 7\n\ndp = [0] * (s + 1)\ndp[0] = 1\nfor i in range(1, s + 1):\n for j in range(0, (i - 3) + 1):\n dp[i] += dp[j]\n dp[i] %= mod\nprint((dp[s]))\n","fast_code":"s = int(eval(input()))\na = b = 0\nc = int(s > 2)\nfor _ in range(s - 3):\n a, b, c = b, c, (a + c) % (10**9 + 7)\nprint(c)\n"} +{"fast_code_id":"0e1e6407577d3a48d72996404df67430b04e8ba4c37b7de5bed20e5cf2fbd2b5","fast_id":"p01314_0e1e6407577d3a48d72996404df67430b04e8ba4c37b7de5bed20e5cf2fbd2b5","language":"python","measured_fast_code_id":"0e1e6407577d3a48d72996404df67430b04e8ba4c37b7de5bed20e5cf2fbd2b5","measured_slow_code_id":"147e66749bf1abd06001e7ed4470d109896662992c4ff0559988e216660063c6","measurement_metric":"cpu_instruction_count","pair_id":"python_248416ad2ccb8e563483df97","problem_id":"p01314","slow_code_id":"147e66749bf1abd06001e7ed4470d109896662992c4ff0559988e216660063c6","slow_id":"p01314_147e66749bf1abd06001e7ed4470d109896662992c4ff0559988e216660063c6","speedup":87.74272859812348,"stratum":"8+","sampling_key":"4807b6f7d13398e3d5e7a05ae06bdb156127c251949a36f4acdb00c414826e82","slow_code":"if __name__ == \"__main__\":\n while True:\n n = int(eval(input()))\n if n == 0:\n break\n nline = [i for i in range(1, n + 1)]\n count = 0\n for i in range(n):\n for j in range(i + 1, n):\n if sum(nline[i:j]) > n:\n break\n if sum(nline[i:j]) == n:\n count += 1\n print(count)\n","fast_code":"while 1:\n n = int(input())\n if not n:\n break\n ans = 0\n p = 2\n while p**2 <= 2 * n:\n if not 2 * n % p:\n if (p + 2 * n / p) % 2:\n ans += 1\n p += 1\n print(ans)\n"} +{"fast_code_id":"685836c518b1a206eb84f65a8f64fc53daa687d0c7abf15263398c42998bef9e","fast_id":"p03077_685836c518b1a206eb84f65a8f64fc53daa687d0c7abf15263398c42998bef9e","language":"python","measured_fast_code_id":"685836c518b1a206eb84f65a8f64fc53daa687d0c7abf15263398c42998bef9e","measured_slow_code_id":"34caf7325f4819bd719f1f977d4c7833f1b8eae1073783274c70d879e08aa59a","measurement_metric":"cpu_instruction_count","pair_id":"python_2501293975ea856a051776f9","problem_id":"p03077","slow_code_id":"ab58e9cb16ab933309b0c60e055e71406d283b0d16126adf763de4e9caa5d6fb","slow_id":"p03077_34caf7325f4819bd719f1f977d4c7833f1b8eae1073783274c70d879e08aa59a","speedup":875.8630805402655,"stratum":"8+","sampling_key":"149b9ca1be480b2eb59ab8085982d99b9db93f9fba569992f56f5a57445ad2a8","slow_code":"import sys\nimport numpy as np\n\n\ndef get_num():\n return int(eval(input()))\n\n\ndef get_nums(n):\n res = [0 for _ in range(n)]\n for i in range(n):\n res[i] = int(eval(input()))\n return res\n\n\ndef get_numbers():\n return list(map(int, input().split()))\n\n\nn = get_num()\ncosts = get_nums(5)\nmax_time = 0\nfor cost in costs:\n max_time = max(max_time, int(np.ceil(n / cost)))\nprint((max_time + 4))\n","fast_code":"n = int(eval(input()))\nnu = min([int(eval(input())) for i in range(5)])\nprint((4 + bool(n % nu) + n // nu))\n"} +{"fast_code_id":"7484a1afd7c42c01bc5516cf17d9c35f7921e04b8deb70c4078b4526037ef3f2","fast_id":"p02554_7484a1afd7c42c01bc5516cf17d9c35f7921e04b8deb70c4078b4526037ef3f2","language":"python","measured_fast_code_id":"7484a1afd7c42c01bc5516cf17d9c35f7921e04b8deb70c4078b4526037ef3f2","measured_slow_code_id":"1216aa013ca95268c8cea10ef1956fc82ecf53c33048dc021f31f4ae82487ba4","measurement_metric":"cpu_instruction_count","pair_id":"python_258ebfb0d5bf6a4f5d17c70a","problem_id":"p02554","slow_code_id":"d34cbcef17a1809eb9aaea9acac748f4f348edb348ac1a61f3b30198ffe07352","slow_id":"p02554_1216aa013ca95268c8cea10ef1956fc82ecf53c33048dc021f31f4ae82487ba4","speedup":2105.160424638251,"stratum":"8+","sampling_key":"6119195ac1658154e332c261c2a9c22abbfb7a3f17993ead40bc9ccd523bacd9","slow_code":"MOD = 10**9 + 7\n\n\ndef solve(n):\n dp = [[0] * 4 for i in range(n + 1)]\n dp[0][0] = 1\n for i in range(n):\n dp[i + 1][3] = (10 * dp[i][3] + dp[i][2] + dp[i][1]) % MOD\n dp[i + 1][2] = (9 * dp[i][2] + dp[i][0]) % MOD\n dp[i + 1][1] = (9 * dp[i][1] + dp[i][0]) % MOD\n dp[i + 1][0] = (8 * dp[i][0]) % MOD\n return dp[n][3]\n\n\nn = int(eval(input()))\nprint((solve(n)))\n","fast_code":"n = int(eval(input()))\nMOD = 10**9 + 7\nprint(((pow(10, n, MOD) - 2 * pow(9, n, MOD) + pow(8, n, MOD)) % MOD))\n"} +{"fast_code_id":"32784dbf176165a221699734d01c8ce01e72e2ebcf99f03853e3ccde36b51530","fast_id":"p03575_ad2cf7a50d347a36b9769867ff1d007c85415b97019838c5369edf7fcf139717","language":"python","measured_fast_code_id":"ad2cf7a50d347a36b9769867ff1d007c85415b97019838c5369edf7fcf139717","measured_slow_code_id":"2b7c23b719bd5ccd195bdbfc609f9c66941f2fe28fa4d92335b08753cebac543","measurement_metric":"cpu_instruction_count","pair_id":"python_25a5d992a5b01edb7f62c2e3","problem_id":"p03575","slow_code_id":"2b7c23b719bd5ccd195bdbfc609f9c66941f2fe28fa4d92335b08753cebac543","slow_id":"p03575_2b7c23b719bd5ccd195bdbfc609f9c66941f2fe28fa4d92335b08753cebac543","speedup":7.583625488228938,"stratum":"4-8","sampling_key":"8b34ed1a58799802a4f39811274e76f8638d3aba14b615bf9611edb5e62691fb","slow_code":"N, M = list(map(int, input().split()))\nT = [[0 for i in range(N + 1)] for j in range(N + 1)]\nfor i in range(M):\n a, b = list(map(int, input().split()))\n T[a][b] = 1\n T[b][a] = 1\nans = 0\n\n\ndef f(v, x, y):\n global N, M, T, a\n a[v] = 1\n for i in range(N + 1):\n if (v == x and i == y) or (v == y and i == x):\n continue\n elif T[v][i] == 0 or a[i] == 1:\n continue\n f(i, x, y)\n\n\nfor i in range(1, N + 1):\n for j in range(i, N + 1):\n a = [0 for _ in range(N + 1)]\n f(1, i, j)\n if sum(a) != N:\n ans += 1\nprint(ans)\n","fast_code":"from collections import deque\n\nN, M = list(map(int, input().split()))\n\nG = [[] for _ in range(N)]\nE = []\nfor _ in range(M):\n a, b = list(map(int, input().split()))\n\n a -= 1\n b -= 1\n E.append((a, b))\n G[a].append(b)\n G[b].append(a)\n\n\ncnt = 0\nfor edge_to_remove in E:\n\n i, j = edge_to_remove\n G[i].remove(j)\n G[j].remove(i)\n\n seen = [False] * N\n todo = deque()\n\n todo.append(0)\n seen[0] = True\n seen_nodes_num = 0\n while todo:\n here = todo.pop()\n seen_nodes_num += 1\n for neighbor in G[here]:\n if seen[neighbor] == False:\n seen[neighbor] = True\n todo.append(neighbor)\n\n if seen_nodes_num != N:\n cnt += 1\n\n G[i].append(j)\n G[j].append(i)\nprint(cnt)\n"} +{"fast_code_id":"55544230816fd7d657cc5324cb41e22f86528020642dc127eaa0dd214065aa0b","fast_id":"p03738_55544230816fd7d657cc5324cb41e22f86528020642dc127eaa0dd214065aa0b","language":"python","measured_fast_code_id":"55544230816fd7d657cc5324cb41e22f86528020642dc127eaa0dd214065aa0b","measured_slow_code_id":"f2a1dc6e63c74cb266417a6249cc5c8560500fe64b277e583f61bdec48e478cd","measurement_metric":"cpu_instruction_count","pair_id":"python_25fa3ee464d5368151ed6ec2","problem_id":"p03738","slow_code_id":"c3e74afb0ea1ccab204561bca43b19e98b453893af9553ffe8e101cd13c9d1e9","slow_id":"p03738_f2a1dc6e63c74cb266417a6249cc5c8560500fe64b277e583f61bdec48e478cd","speedup":2.287709995850699,"stratum":"2-4","sampling_key":"59c61c3c06fee241f52083e6b1c8b0d5d5357ee3842cc23f1be2e20d2d0f69ff","slow_code":"A = list(str(eval(input())))\nB = list(str(eval(input())))\nif len(A) > len(B):\n print(\"GREATER\")\nelif len(A) < len(B):\n print(\"LESS\")\nelif A == B:\n print(\"EQUAL\")\nelse:\n for i in range(len(A)):\n if A[i] > B[i]:\n print(\"GREATER\")\n break\n elif A[i] < B[i]:\n print(\"LESS\")\n break\n","fast_code":"a = int(eval(input())) - int(eval(input()))\nprint((a > 0 and \"GREATER\" or a < 0 and \"LESS\" or \"EQUAL\"))\n"} +{"fast_code_id":"3f475ae9e7efd3a1ce8867f9c3841f1206e31cad4eec5c093b58fc0a3461d40a","fast_id":"p03061_3f475ae9e7efd3a1ce8867f9c3841f1206e31cad4eec5c093b58fc0a3461d40a","language":"python","measured_fast_code_id":"3f475ae9e7efd3a1ce8867f9c3841f1206e31cad4eec5c093b58fc0a3461d40a","measured_slow_code_id":"2d1ac3c9fc00324fbe7020d274a3ccaef85c4cb391d9f2865533fe63f653f25e","measurement_metric":"cpu_instruction_count","pair_id":"python_2622d2f2571cad9f1f74b7cb","problem_id":"p03061","slow_code_id":"fb07db8e5e4b2567dc3a88a66ec68ddc15c21275b763c8b6a73c40b8a66faae8","slow_id":"p03061_2d1ac3c9fc00324fbe7020d274a3ccaef85c4cb391d9f2865533fe63f653f25e","speedup":5.266638114565066,"stratum":"4-8","sampling_key":"3fb462404ee8f23dd448d78b18229ccf05fc509e8f23091fde87a4bad4e35101","slow_code":"def gcdf(a):\n a.sort()\n a0 = a[0]\n a = [int(x % a0) for x in a if x % a0 != 0]\n if len(a) == 0:\n return a0\n else:\n a.append(a0)\n a0 = min(a)\n return gcdf(a)\n\n\nn = int(eval(input()))\na = list(map(int, input().split()))\nif n == 2:\n print((max(a)))\nelif n < 2**8:\n gcdv = 0\n for i in range(n):\n acpy = list(a)\n del acpy[i]\n gcdx = gcdf(acpy)\n if gcdx > gcdv:\n gcdv = gcdx\n print(gcdv)\nelse:\n m = int(n / 100)\n ns = int(n / m)\n rgcd = []\n for mi in range(m):\n ms = ns * mi\n if mi == m - 1:\n am = a[ms:n]\n else:\n am = a[ms : ms + ns]\n gcdm = gcdf(am)\n rgcd.append(gcdm)\n gcdv = 0\n for mi in range(m):\n rgcd1 = list(rgcd)\n del rgcd1[mi]\n gcdrg1 = gcdf(rgcd1)\n ms = ns * mi\n if mi == m - 1:\n am = a[ms:n]\n else:\n am = a[ms : ms + ns]\n\n for i in range(len(am)):\n acpy = list(am)\n\n acpy[i] = gcdrg1\n gcdx = gcdf(acpy)\n if gcdx > gcdv:\n gcdv = gcdx\n print(gcdv)\n","fast_code":"from math import gcd\n\nn = int(eval(input()))\nA = [0] + list(map(int, input().split())) + [0]\nn += 2\nL, R = [0] * n, [0] * n\ngl, gr = 0, 0\nfor i in range(n):\n gl = gcd(gl, A[i])\n gr = gcd(gr, A[n - i - 1])\n L[i] = gl\n R[n - i - 1] = gr\nans = L[-1]\nfor i in range(n - 2):\n ans = max(ans, gcd(L[i], R[i + 2]))\nprint(ans)\n"} +{"fast_code_id":"57fa5ec23b816cf15c03411068a311d979348132afb8bcfb426cb2083a3936d0","fast_id":"p02630_57fa5ec23b816cf15c03411068a311d979348132afb8bcfb426cb2083a3936d0","language":"python","measured_fast_code_id":"57fa5ec23b816cf15c03411068a311d979348132afb8bcfb426cb2083a3936d0","measured_slow_code_id":"96450435c56c9932de49d1d1d53a232b5189e0fe47b305002a0d44a0ec3cd04b","measurement_metric":"cpu_instruction_count","pair_id":"python_26ed9e541bde20c0dfff1c52","problem_id":"p02630","slow_code_id":"f1f847cea9ab3dffada95647d255a7960e5e340922e99784cbf3f82890bf75d7","slow_id":"p02630_96450435c56c9932de49d1d1d53a232b5189e0fe47b305002a0d44a0ec3cd04b","speedup":4.536483059436253,"stratum":"4-8","sampling_key":"190aa98474de7ef2361623bd987dcd164b496e14fba2c5b595787993435dd6a0","slow_code":"n = int(eval(input()))\nA = list(map(int, input().split()))\nq = int(eval(input()))\ntotal = sum(A)\nl = [0 for i in range(10**5 + 1)]\nfor _ in A:\n l[_] += 1\nfor i in range(q):\n b, c = list(map(int, input().split()))\n total += c * l[b]\n total -= b * l[b]\n print(total)\n l[c] += l[b]\n l[b] = 0\n","fast_code":"from collections import Counter\n\nN = int(eval(input()))\nA = list(map(int, input().split()))\nQ = int(eval(input()))\nX = [list(map(int, input().split())) for _ in range(Q)]\nctr = Counter(A)\nans = sum(A)\nfor b, c in X:\n v = ctr[b]\n ans = ans - b * v + c * v\n ctr[b] -= v\n ctr[c] += v\n print(ans)\n"} +{"fast_code_id":"1796b3dd56792d24729b3767f68becf643f395739fe613fb028da3c5eba51573","fast_id":"p03006_1796b3dd56792d24729b3767f68becf643f395739fe613fb028da3c5eba51573","language":"python","measured_fast_code_id":"1796b3dd56792d24729b3767f68becf643f395739fe613fb028da3c5eba51573","measured_slow_code_id":"df539d82cce0b66ac388cb7626c1915f078dadd19fd45e23838905782b69fa8f","measurement_metric":"cpu_instruction_count","pair_id":"python_275c1f268162555a0b341973","problem_id":"p03006","slow_code_id":"df539d82cce0b66ac388cb7626c1915f078dadd19fd45e23838905782b69fa8f","slow_id":"p03006_df539d82cce0b66ac388cb7626c1915f078dadd19fd45e23838905782b69fa8f","speedup":5.017240743168869,"stratum":"4-8","sampling_key":"3e375b41aaaac5dd93e8de6dae0e89d72345f142edea765cf2e47742d0502a02","slow_code":"from math import (\n ceil,\n floor,\n factorial,\n gcd,\n sqrt,\n log2,\n cos,\n sin,\n tan,\n acos,\n asin,\n atan,\n degrees,\n radians,\n pi,\n inf,\n)\nfrom itertools import (\n accumulate,\n groupby,\n permutations,\n combinations,\n product,\n combinations_with_replacement,\n)\nfrom collections import deque, defaultdict, Counter\nfrom bisect import bisect_left, bisect_right\nfrom operator import itemgetter\nfrom heapq import heapify, heappop, heappush\nfrom queue import Queue, LifoQueue, PriorityQueue\nfrom copy import deepcopy\nfrom time import time\nimport string\nimport sys\n\nsys.setrecursionlimit(10**7)\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef INT():\n return int(eval(input()))\n\n\ndef MAP():\n return list(map(int, input().split()))\n\n\ndef LIST():\n return list(MAP())\n\n\nn = INT()\nx = [LIST() for i in range(n)]\na = []\nfor i in range(n):\n for j in range(n):\n if i != j:\n a.append((x[j][0] - x[i][0], x[j][1] - x[i][1]))\na.sort()\ncount = 1\nreg = 1\nfor i in range(1, len(a)):\n if a[i][:] == a[i - 1][:]:\n count += 1\n reg = max(reg, count)\n else:\n count = 1\nif n == 1:\n ans = n\nelse:\n ans = n - reg\nprint(ans)\n","fast_code":"n = int(eval(input()))\narr = sorted([list(map(int, input().rstrip().split())) for _ in range(n)])\ncnt = {}\nfor i, j in arr:\n for k, l in arr:\n if (i, j) == (k, l):\n continue\n dif = (k - i, l - j)\n cnt.setdefault(dif, 0)\n cnt[dif] += 1\nprint((n - max(list(cnt.values()), default=0)))\n"} +{"fast_code_id":"974c092f45b99a7e40bd363191669c3c95a0237f5fb8d45aaff090995d4fe6ec","fast_id":"p03282_974c092f45b99a7e40bd363191669c3c95a0237f5fb8d45aaff090995d4fe6ec","language":"python","measured_fast_code_id":"974c092f45b99a7e40bd363191669c3c95a0237f5fb8d45aaff090995d4fe6ec","measured_slow_code_id":"c6afbfabb4f57c620b796822aa793c63e616de41f9eb4e63aa7e8f88e45d1110","measurement_metric":"cpu_instruction_count","pair_id":"python_27655c08040057e2e3570889","problem_id":"p03282","slow_code_id":"c6afbfabb4f57c620b796822aa793c63e616de41f9eb4e63aa7e8f88e45d1110","slow_id":"p03282_c6afbfabb4f57c620b796822aa793c63e616de41f9eb4e63aa7e8f88e45d1110","speedup":969.6232524728181,"stratum":"8+","sampling_key":"159776381634b59a9b75d127b6ec7ee66249f2280e097a8281e39166e6898e56","slow_code":"import numpy as np\n\nS = np.array(list(map(str, input().rstrip())))\nK = int(eval(input()))\ncnt = 0\nans = 1\nfor i, s in enumerate(S):\n if s != \"1\":\n cnt = i + 1\n ans = s\n break\nif cnt > K:\n print((1))\nelse:\n print((int(ans)))\n","fast_code":"s = list(map(str, input().rstrip()))\nk = int(eval(input()))\nans = 1\nfor x in s[:k]:\n if int(x) != 1:\n ans = int(x)\n break\nprint(ans)\n"} +{"fast_code_id":"1d963f525480740c00705d471cd92e8fde9d4a305a4a66ac183263eadec27adb","fast_id":"p03786_1d963f525480740c00705d471cd92e8fde9d4a305a4a66ac183263eadec27adb","language":"python","measured_fast_code_id":"1d963f525480740c00705d471cd92e8fde9d4a305a4a66ac183263eadec27adb","measured_slow_code_id":"9c47b5351287e97e1c5de7875f912e9de0349c4286a89e13a6aa097ca0c9f946","measurement_metric":"cpu_instruction_count","pair_id":"python_282fd7f6d9ff0d55ccabfee4","problem_id":"p03786","slow_code_id":"9c47b5351287e97e1c5de7875f912e9de0349c4286a89e13a6aa097ca0c9f946","slow_id":"p03786_9c47b5351287e97e1c5de7875f912e9de0349c4286a89e13a6aa097ca0c9f946","speedup":106.82686730869885,"stratum":"8+","sampling_key":"10676d56187f7ede60751b797a7cc0cbea6e01e63e0b1f52443acb0db8176b72","slow_code":"n = int(eval(input()))\na = list(map(int, input().split()))\nimport numpy as np\n\na = sorted(a)\ncum = np.cumsum(a)\ncum = list(reversed(cum))\na = list(reversed(a))\nans = 1\nfor i in range(1, n):\n if a[i - 1] <= cum[i] * 2:\n ans += 1\n else:\n break\nprint(ans)\n","fast_code":"n = int(eval(input()))\na = list(map(int, input().split()))\na.sort()\nacum = [0] * (n + 1)\nfor i in range(n):\n acum[i + 1] += acum[i] + a[i]\nans = 1\nfor i in reversed(list(range(1, n))):\n if a[i] <= 2 * acum[i]:\n ans += 1\n else:\n break\nprint(ans)\n"} +{"fast_code_id":"de86ab65f340e5a5f6c1c8800744e7c1a30cd02537cfe887eb37bd894b3812ac","fast_id":"p02990_e8297394ce68e611eedebe54313d0ad0caec7a4680b8dfb2bb8b573a3ce1d125","language":"python","measured_fast_code_id":"e8297394ce68e611eedebe54313d0ad0caec7a4680b8dfb2bb8b573a3ce1d125","measured_slow_code_id":"a43a2e409975514f076f5ea8a611abb00d6945f4ac7a0710f4b342242cb6e235","measurement_metric":"cpu_instruction_count","pair_id":"python_2840422f7ece47226213f61d","problem_id":"p02990","slow_code_id":"a43a2e409975514f076f5ea8a611abb00d6945f4ac7a0710f4b342242cb6e235","slow_id":"p02990_a43a2e409975514f076f5ea8a611abb00d6945f4ac7a0710f4b342242cb6e235","speedup":174.75096655164418,"stratum":"8+","sampling_key":"11f3c5b1a780675b525832c6a9d302bb22f2fed38b208c12e0575786e7838cf5","slow_code":"MOD = 10**9 + 7\nlim = 200000\ninv_t = [-1 for i in range(lim + 1)]\nfactrial = [-1 for i in range(lim + 1)]\nfactrial_inv = [-1 for i in range(lim + 1)]\n\n\ndef mod_inv(x, mod=MOD):\n y, u, v, _x = mod, 1, 0, x\n while y:\n t = _x // y\n _x -= t * y\n _x, y = y, _x\n u -= t * v\n u, v = v, u\n u %= mod\n if u < 0:\n u += mod\n return u\n\n\ndef mod_pow(a, n, mod=MOD):\n res = 1\n while n:\n if n & 1:\n res = res * a % mod\n a = a * a % mod\n n >>= 1\n return res\n\n\ndef COMinit(max=lim, mod=MOD):\n factrial[0] = factrial_inv[0] = 1\n factrial[1] = factrial_inv[1] = 1\n inv_t[0] = inv_t[1] = 1\n for i in range(2, max):\n factrial[i] = factrial[i - 1] * i % mod\n inv_t[i] = mod - inv_t[mod % i] * (mod // i) % mod\n factrial_inv[i] = factrial_inv[i - 1] * inv_t[i] % mod\n\n\ndef comb(a, b, mod=MOD):\n if a < b:\n return 0\n if factrial[0] == -1:\n COMinit()\n return (factrial[a] * factrial_inv[b] * factrial_inv[a - b]) % mod\n\n\nn, k = [int(_) for _ in input().split()]\nfor i in range(k):\n print((comb(n - k + 1, i + 1) * comb(k - 1, i) % MOD))\n","fast_code":"import sys\n\n\nfrom functools import reduce\nimport operator as op\n\n\ndef nCr(n, r):\n r = min(r, n - r)\n upper = reduce(op.mul, list(range(n, n - r, -1)), 1)\n lower = reduce(op.mul, list(range(r, 0, -1)), 1)\n return upper // lower\n\n\nmod = 10**9 + 7\n\n\ndef main():\n n, k = [int(x) for x in sys.stdin.readline().split()]\n for i in range(1, k + 1):\n if i <= n - k + 1:\n print((nCr(n - k + 1, i) * nCr(k - 1, i - 1) % mod))\n else:\n print((0))\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"fd9e83fdfd4de907b804096b04de5edad0bd647fba7b121d75e6c0627bd86b79","fast_id":"p02817_fd9e83fdfd4de907b804096b04de5edad0bd647fba7b121d75e6c0627bd86b79","language":"python","measured_fast_code_id":"fd9e83fdfd4de907b804096b04de5edad0bd647fba7b121d75e6c0627bd86b79","measured_slow_code_id":"d366b3197c2b1cc652bdfaecd153a16660977c2f3b6e7187f2d74bc9cc3d8847","measurement_metric":"cpu_instruction_count","pair_id":"python_28a7ab8a7251ac1a7d87ff0f","problem_id":"p02817","slow_code_id":"d366b3197c2b1cc652bdfaecd153a16660977c2f3b6e7187f2d74bc9cc3d8847","slow_id":"p02817_d366b3197c2b1cc652bdfaecd153a16660977c2f3b6e7187f2d74bc9cc3d8847","speedup":2.167277980125643,"stratum":"2-4","sampling_key":"b6843c3ed0a8dd82197506a275dd15e783bea4bfd12e973ee286b42619302ea2","slow_code":"import sys\n\nS, T = input().split()\nif not (S.islower() and T.islower()):\n sys.exit()\nif not (1 <= len(S) <= 100 and 1 <= len(S) <= 100):\n sys.exit()\nprint(T, end=\"\")\nprint(S)\n","fast_code":"S = list(input().split())\na = S[1] + S[0]\nprint(a)\n"} +{"fast_code_id":"9bd99fec9e6ec4fee9368ad961d397fb9380f635a86a7ba86920d6bcf2974eb8","fast_id":"p03556_9bd99fec9e6ec4fee9368ad961d397fb9380f635a86a7ba86920d6bcf2974eb8","language":"python","measured_fast_code_id":"9bd99fec9e6ec4fee9368ad961d397fb9380f635a86a7ba86920d6bcf2974eb8","measured_slow_code_id":"0a7e4d0d2a2f952e55fd143eaac4cee93ae161ecb36118d4ab495d4a4bf6dac9","measurement_metric":"cpu_instruction_count","pair_id":"python_28cd10419bb88818e3bbe69f","problem_id":"p03556","slow_code_id":"0a7e4d0d2a2f952e55fd143eaac4cee93ae161ecb36118d4ab495d4a4bf6dac9","slow_id":"p03556_0a7e4d0d2a2f952e55fd143eaac4cee93ae161ecb36118d4ab495d4a4bf6dac9","speedup":2233.764091998628,"stratum":"8+","sampling_key":"c29fa8d291b11570fb063a25ba8dadb75824e36e027fa7918af7fd724bbc17a4","slow_code":"import numpy as np\n\nN = int(eval(input()))\nmp = int(np.sqrt(N))\nprint((mp**2))\n","fast_code":"N = int(eval(input()))\nN = int(N**0.5)\nprint((N * N))\n"} +{"fast_code_id":"36efa31a817599454e47c950d8405cd8170cd3f67b1b12f911d115f29e6e8467","fast_id":"p00028_36efa31a817599454e47c950d8405cd8170cd3f67b1b12f911d115f29e6e8467","language":"python","measured_fast_code_id":"36efa31a817599454e47c950d8405cd8170cd3f67b1b12f911d115f29e6e8467","measured_slow_code_id":"a2c56599755a6522068b6dd4785e9872f8a6e6f4d7081a31ccc870bdefdc31dd","measurement_metric":"cpu_instruction_count","pair_id":"python_28d6fcfc3bc3b700d8cb1499","problem_id":"p00028","slow_code_id":"ef44995e2e7b1383b510cc6925ff4e89435c4f6e99f81948a44fdef927e4dd00","slow_id":"p00028_a2c56599755a6522068b6dd4785e9872f8a6e6f4d7081a31ccc870bdefdc31dd","speedup":2.517398840737766,"stratum":"2-4","sampling_key":"b217e3127f58e6bb098263e8f2f92581805088d1e11f3aaa367ceda5d45a701c","slow_code":"array = []\nwhile True:\n try:\n a = eval(input())\n array.append(int(a))\n except EOFError:\n break\ns = set(array)\nmx = array.count(max(s, key=array.count))\nfor a in sorted(s):\n if array.count(a) == mx:\n print(a)\n","fast_code":"d = {}\ntry:\n while True:\n n = int(input())\n if n in d:\n d[n] += 1\n else:\n d[n] = 1\nexcept EOFError:\n pass\na = []\nm = max(d.values())\nfor key, value in list(d.items()):\n if value == m:\n a.append(key)\na.sort()\nfor i in a:\n print(i)\n"} +{"fast_code_id":"7ac456954b984cf0c10d7f92d148f525270e3d0edfc73dd668dad6b922793916","fast_id":"p01314_d97ea95baf27b6d79304b226287509a03c34cf52d3fcf9888cb3a939972b30c9","language":"python","measured_fast_code_id":"d97ea95baf27b6d79304b226287509a03c34cf52d3fcf9888cb3a939972b30c9","measured_slow_code_id":"147e66749bf1abd06001e7ed4470d109896662992c4ff0559988e216660063c6","measurement_metric":"cpu_instruction_count","pair_id":"python_2925b2c1b2f6b5d532f8f4c4","problem_id":"p01314","slow_code_id":"147e66749bf1abd06001e7ed4470d109896662992c4ff0559988e216660063c6","slow_id":"p01314_147e66749bf1abd06001e7ed4470d109896662992c4ff0559988e216660063c6","speedup":118.44107448557929,"stratum":"8+","sampling_key":"578c7a3d131f9c0a1a72bab4fc5abc93258365bcc7553e7c37354108ef28167b","slow_code":"if __name__ == \"__main__\":\n while True:\n n = int(eval(input()))\n if n == 0:\n break\n nline = [i for i in range(1, n + 1)]\n count = 0\n for i in range(n):\n for j in range(i + 1, n):\n if sum(nline[i:j]) > n:\n break\n if sum(nline[i:j]) == n:\n count += 1\n print(count)\n","fast_code":"import sys\n\nif sys.version_info[0] >= 3:\n raw_input = input\ntry:\n while True:\n n = int(input())\n if n == 0:\n break\n r = 0\n i = 1\n while 1:\n n -= i\n i += 1\n if n < i:\n break\n if n % i == 0:\n r += 1\n print(r)\nexcept EOFError:\n pass\n"} +{"fast_code_id":"baf159faff778e1fe2c63e6af2c4a24452368f4ac8371f63a96788ec4561187e","fast_id":"p02555_baf159faff778e1fe2c63e6af2c4a24452368f4ac8371f63a96788ec4561187e","language":"python","measured_fast_code_id":"baf159faff778e1fe2c63e6af2c4a24452368f4ac8371f63a96788ec4561187e","measured_slow_code_id":"c3b18fd66a969908811fb5a7fad4e7d129453840b432daefe2b3186926221742","measurement_metric":"cpu_instruction_count","pair_id":"python_2969bdff5c21cae9d624b8b1","problem_id":"p02555","slow_code_id":"c3b18fd66a969908811fb5a7fad4e7d129453840b432daefe2b3186926221742","slow_id":"p02555_c3b18fd66a969908811fb5a7fad4e7d129453840b432daefe2b3186926221742","speedup":1173.4993656284082,"stratum":"8+","sampling_key":"4d377c5cd0614616b5229bd281012aca116a7f1ce8bbd9240a28b358a8c615ba","slow_code":"import numpy as np\n\nMOD = 10**9 + 7\nn = int(eval(input()))\narr = np.zeros((n + 1, n + 1), dtype=int)\nfor i in np.arange(3, n + 1):\n arr[0, i] = 1\nfor i in np.arange(1, n + 1):\n sum_ = 0\n for j in np.arange(3 * i, n + 1):\n sum_ += arr[i - 1, j]\n sum_ %= MOD\n if j + 3 >= n + 1:\n break\n arr[i, j + 3] = sum_\nans = 0\nfor i in range(n + 1):\n ans += arr[i, n]\n ans %= MOD\nprint(ans)\n","fast_code":"S = int(eval(input()))\nmod = 10**9 + 7\ndp = [0] * (S + 1)\ndp[0] = 1\nfor i in range(3, S + 1):\n dp[i] = (dp[i - 1] + dp[i - 3]) % mod\nprint((dp[S]))\n"} +{"fast_code_id":"3bc7c1cecb87327fd4ac660aaf5663746ea0be91c65dddcf6a2f1f6099537e7a","fast_id":"p03037_3bc7c1cecb87327fd4ac660aaf5663746ea0be91c65dddcf6a2f1f6099537e7a","language":"python","measured_fast_code_id":"3bc7c1cecb87327fd4ac660aaf5663746ea0be91c65dddcf6a2f1f6099537e7a","measured_slow_code_id":"603682b2a1acebd824f0081d6dbfdc82575d41c2aa8f541e6ca8387c5cde8833","measurement_metric":"cpu_instruction_count","pair_id":"python_29b203792296c55e9ca04cf7","problem_id":"p03037","slow_code_id":"603682b2a1acebd824f0081d6dbfdc82575d41c2aa8f541e6ca8387c5cde8833","slow_id":"p03037_603682b2a1acebd824f0081d6dbfdc82575d41c2aa8f541e6ca8387c5cde8833","speedup":5.0255233171969955,"stratum":"4-8","sampling_key":"15e12427e4df84e1285ad5d0f363dd07148416d336f3d4b867d8bc00e4e00eeb","slow_code":"import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, queue, copy\n\nsys.setrecursionlimit(10**7)\ninf = 10**20\nmod = 10**9 + 7\ndd = [(-1, 0), (0, 1), (1, 0), (0, -1)]\nddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef LI_():\n return [int(x) - 1 for x in sys.stdin.readline().split()]\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LS():\n return sys.stdin.readline().split()\n\n\ndef S():\n return eval(input())\n\n\ndef main():\n n, k = LI()\n l = [0] * (n + 1)\n for _ in range(k):\n a, b = LI()\n l[a - 1] += 1\n l[b] -= 1\n for i in range(n - 1):\n l[i + 1] += l[i]\n ans = 0\n for x in l[:-1]:\n if x == k:\n ans += 1\n return ans\n\n\nprint((main()))\n","fast_code":"N, M = list(map(int, input().split()))\nL = []\nR = []\nfor _ in range(M):\n l, r = list(map(int, input().split()))\n L.append(l)\n R.append(r)\nl = max(L)\nr = min(R)\nprint((r - l + 1 if r - l + 1 > 0 else 0))\n"} +{"fast_code_id":"c0c409a8ff3c23b867f319996217b059e009419dc178f8259b4a9d39f79a15fc","fast_id":"p02570_b2b46f714dc598d3353db705d6d448fdcb3d21762a95d678a1aa79e2444d56f0","language":"python","measured_fast_code_id":"b2b46f714dc598d3353db705d6d448fdcb3d21762a95d678a1aa79e2444d56f0","measured_slow_code_id":"7df3ffb5a8416f2149c9ce5f388659f4fb80cc7488ec540c2ef41ccf0a9e9129","measurement_metric":"cpu_instruction_count","pair_id":"python_2a2c868b96c332a039115162","problem_id":"p02570","slow_code_id":"09b0c0d43abbb6955208c35fb1cca343f1b4cbf34ced526e48c841c54fa3ed5f","slow_id":"p02570_7df3ffb5a8416f2149c9ce5f388659f4fb80cc7488ec540c2ef41ccf0a9e9129","speedup":4.258384329522176,"stratum":"4-8","sampling_key":"0761009f3fc2062192f5acee541443b1f8d3e0cae26760f49342926b7d047c35","slow_code":"def LI():\n return list(map(int, input().split()))\n\n\ndef II():\n return int(input())\n\n\ndef yes():\n return print(\"Yes\")\n\n\ndef no():\n return print(\"No\")\n\n\nclass Combination:\n\n def __init__(self, n_max, mod=10**9 + 7):\n self.mod = mod\n self.modinv = self.make_modinv_list(n_max)\n self.fac, self.facinv = self.make_factorial_list(n_max)\n\n def __call__(self, n, r):\n return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n - r] % self.mod\n\n def make_factorial_list(self, n):\n\n fac = [1]\n facinv = [1]\n for i in range(1, n + 1):\n fac.append(fac[i - 1] * i % self.mod)\n facinv.append(facinv[i - 1] * self.modinv[i] % self.mod)\n return fac, facinv\n\n def make_modinv_list(self, n):\n\n modinv = [0] * (n + 1)\n modinv[1] = 1\n for i in range(2, n + 1):\n modinv[i] = self.mod - self.mod // i * modinv[self.mod % i] % self.mod\n return modinv\n\n\nclass Unionfind:\n def __init__(self, N):\n self.p = list(range(N))\n self.rank = [0] * N\n self.size = [1] * N\n\n def root(self, x):\n if self.p[x] != x:\n self.p[x] = self.root(self.p[x])\n return self.p[x]\n\n def same(self, x, y):\n return self.root(x) == self.root(y)\n\n def unite(self, x, y):\n u = self.root(x)\n v = self.root(y)\n if u == v:\n return\n if self.rank[u] < self.rank[v]:\n self.p[u] = v\n self.size[v] += self.size[u]\n self.size[u] = 0\n else:\n self.p[v] = u\n self.size[u] += self.size[v]\n self.size[v] = 0\n if self.rank[u] == self.rank[v]:\n self.rank[u] += 1\n\n def count(self, x):\n return self.size[self.root(x)]\n\n\nd, t, s = LI()\nif d <= t * s:\n yes()\nelse:\n no()\n","fast_code":"def get_input() -> tuple:\n D, T, S = list(map(int, input().split()))\n return D, T, S\n\n\ndef main(D: int, T: int, S: int) -> None:\n\n ans = str()\n if D <= S * T:\n ans = \"Yes\"\n else:\n ans = \"No\"\n\n print(ans)\n\n\nif __name__ == \"__main__\":\n\n D, T, S = get_input()\n\n main(D, T, S)\n"} +{"fast_code_id":"a4949338c1caf8f9f2272b8507ae54b9d4535344d257096aef575693e6969681","fast_id":"p03006_a4949338c1caf8f9f2272b8507ae54b9d4535344d257096aef575693e6969681","language":"python","measured_fast_code_id":"a4949338c1caf8f9f2272b8507ae54b9d4535344d257096aef575693e6969681","measured_slow_code_id":"7838a318c333827f3472e6350353ce8b4259224d69f85170d3cd9658a4f5e659","measurement_metric":"cpu_instruction_count","pair_id":"python_2a4655a538b62a637dc6e9d8","problem_id":"p03006","slow_code_id":"7838a318c333827f3472e6350353ce8b4259224d69f85170d3cd9658a4f5e659","slow_id":"p03006_7838a318c333827f3472e6350353ce8b4259224d69f85170d3cd9658a4f5e659","speedup":7.044228006783901,"stratum":"4-8","sampling_key":"271ea84325f039a2681d04deebd443b68b58878b2b07bcfc8ac4c5357f31dc61","slow_code":"N = int(eval(input()))\nif N == 1:\n print((1))\n exit()\nxy = [tuple(int(e) for e in input().split()) for _ in range(N)]\nd_list = [(i[0] - j[0], i[1] - j[1]) for i in xy for j in xy if i != j]\nitems = list(set(d_list))\ns = 1\nfor item in items:\n c = d_list.count(item)\n if c > s:\n s = c\nprint((N - s))\n","fast_code":"import itertools\n\nn = int(eval(input()))\nxy = []\nfor i in range(n):\n x, y = list(map(int, input().split()))\n xy.append([x, y])\na = {}\nfor v in itertools.combinations(xy, 2):\n z = list(v)\n z.sort()\n x = z[1][0] - z[0][0]\n y = z[1][1] - z[0][1]\n if (x, y) not in a:\n a[(x, y)] = 1\n else:\n a[(x, y)] += 1\nif n == 1:\n print((1))\nelse:\n print((n - max(a.values())))\n"} +{"fast_code_id":"27dbf408a3d26db29791ec3ce69a8bda8fad3af13337e24ab309e335a59b85a2","fast_id":"p02725_27dbf408a3d26db29791ec3ce69a8bda8fad3af13337e24ab309e335a59b85a2","language":"python","measured_fast_code_id":"27dbf408a3d26db29791ec3ce69a8bda8fad3af13337e24ab309e335a59b85a2","measured_slow_code_id":"91accdad635aaade3cd21a1cbe15f0f073859089779275b1b10043afbdc41816","measurement_metric":"cpu_instruction_count","pair_id":"python_2aebd61ad02738c70a7e85bb","problem_id":"p02725","slow_code_id":"91accdad635aaade3cd21a1cbe15f0f073859089779275b1b10043afbdc41816","slow_id":"p02725_91accdad635aaade3cd21a1cbe15f0f073859089779275b1b10043afbdc41816","speedup":38.16328216657605,"stratum":"8+","sampling_key":"40cd283f0fd619077d6d1d37854b0c0354ce98d0521fa9a615bbac68eb505d9c","slow_code":"import numpy as np\n\nK, N = list(map(int, input().split()))\nA = list(map(int, input().split()))\nA.append(K + A[0])\nD = np.diff(A)\nprint((int(K) - np.max(D)))\n","fast_code":"k, n = list(map(int, input().split()))\nA = list(map(int, input().split()))\nl = [k - A[-1] + A[0]]\n[l.append(A[i + 1] - A[i]) for i in range(n - 1)]\nprint((k - max(l)))\n"} +{"fast_code_id":"50679c41a1acd870dba5cdfb9fbd76d0194c111d72b043c33c43e9e5e80f6c1f","fast_id":"p02934_50679c41a1acd870dba5cdfb9fbd76d0194c111d72b043c33c43e9e5e80f6c1f","language":"python","measured_fast_code_id":"50679c41a1acd870dba5cdfb9fbd76d0194c111d72b043c33c43e9e5e80f6c1f","measured_slow_code_id":"60cac70fa0810c2893d2009a00d5b734023fa86b7674974a1bd139ed2b0fd20e","measurement_metric":"cpu_instruction_count","pair_id":"python_2b0e5550fecdec7e14643add","problem_id":"p02934","slow_code_id":"60cac70fa0810c2893d2009a00d5b734023fa86b7674974a1bd139ed2b0fd20e","slow_id":"p02934_60cac70fa0810c2893d2009a00d5b734023fa86b7674974a1bd139ed2b0fd20e","speedup":1040.1368604327902,"stratum":"8+","sampling_key":"0027cd3a29101d5f6482a92af8ad247d23069b8c4de59dc2faae0b90a329de00","slow_code":"import sys\n\ninput = sys.stdin.readline\nsys.setrecursionlimit(10**7)\nimport numpy as np\n\nN = int(eval(input()))\nA = np.array(input().split(), np.int32)\nanswer = 1 / (1 / A).sum()\nprint(answer)\n","fast_code":"def inpl():\n return list(map(int, input().split()))\n\n\nN = int(eval(input()))\nprint((1 / sum([1 / v for v in inpl()])))\n"} +{"fast_code_id":"3110d842874c6046e398970dba4b72c45d15cd4aacc9697a99da0418434cc31f","fast_id":"p02657_3110d842874c6046e398970dba4b72c45d15cd4aacc9697a99da0418434cc31f","language":"python","measured_fast_code_id":"3110d842874c6046e398970dba4b72c45d15cd4aacc9697a99da0418434cc31f","measured_slow_code_id":"200b1c449f415dbd19883ab8d7d3fbd558bd29ecaa3e49199f40362ea5213e2b","measurement_metric":"cpu_instruction_count","pair_id":"python_2b8518e6e4bba583265ce6e3","problem_id":"p02657","slow_code_id":"200b1c449f415dbd19883ab8d7d3fbd558bd29ecaa3e49199f40362ea5213e2b","slow_id":"p02657_200b1c449f415dbd19883ab8d7d3fbd558bd29ecaa3e49199f40362ea5213e2b","speedup":2.1695340049937935,"stratum":"2-4","sampling_key":"9185ca49b2b72413bfa0755ad9d99b5dcfa6ed695fa4207fd0df250da4795bf7","slow_code":"import math\n\na, b = [float(x) for x in input().split()]\na = int(a)\nb = int(b * 100)\nprint((int(math.floor(a * b) // 100)))\n","fast_code":"print((eval(input().replace(\" \", \"*\"))))\n"} +{"fast_code_id":"fa36fa45bf534a9fabf7dedb34bc4256416c4806673f0680116329d380f490bd","fast_id":"p02724_899e07ca1231d136081fa73bf70c5ff21b2926c172bb2358990fc0bee172eb4b","language":"python","measured_fast_code_id":"899e07ca1231d136081fa73bf70c5ff21b2926c172bb2358990fc0bee172eb4b","measured_slow_code_id":"07c5a845a98dce83f42c711c0408dc4dad947c9351918518d0af13bec53b52eb","measurement_metric":"cpu_instruction_count","pair_id":"python_2bf93823784cb40fc13f09aa","problem_id":"p02724","slow_code_id":"07c5a845a98dce83f42c711c0408dc4dad947c9351918518d0af13bec53b52eb","slow_id":"p02724_07c5a845a98dce83f42c711c0408dc4dad947c9351918518d0af13bec53b52eb","speedup":610.9596444534045,"stratum":"8+","sampling_key":"3feaa449cf9816fcf09a6a7cfefb168f9641e7609fe185b0164f9198079211c9","slow_code":"def main():\n x = int(eval(input()))\n ans = 0\n while x >= 500:\n x -= 500\n ans += 1000\n while x >= 5:\n x -= 5\n ans += 5\n print(ans)\n\n\nmain()\n","fast_code":"def main():\n X = int(eval(input()))\n\n p = int(X / 500)\n q = int((X - p * 500) / 5)\n ans = 1000 * p + 5 * q\n print(ans)\n\n\nmain()\n"} +{"fast_code_id":"c138ac39a967b806098677bc3723baf085bdbf461e9ac05dfbbc950da2f15b09","fast_id":"p03598_c138ac39a967b806098677bc3723baf085bdbf461e9ac05dfbbc950da2f15b09","language":"python","measured_fast_code_id":"c138ac39a967b806098677bc3723baf085bdbf461e9ac05dfbbc950da2f15b09","measured_slow_code_id":"a66300914442ee82bfcfdd13cd1522bcabf2d0a85e3def79bf6a7e26cf75b1bb","measurement_metric":"cpu_instruction_count","pair_id":"python_2c68e4cd49df933a1c8c4e1e","problem_id":"p03598","slow_code_id":"a66300914442ee82bfcfdd13cd1522bcabf2d0a85e3def79bf6a7e26cf75b1bb","slow_id":"p03598_a66300914442ee82bfcfdd13cd1522bcabf2d0a85e3def79bf6a7e26cf75b1bb","speedup":3.0061495154887132,"stratum":"2-4","sampling_key":"4f0799f944c6f7afccde0f122f77ce44d6756e35a8d6d0f2d78cea1f5bb8ef98","slow_code":"import sys\n\nstdin = sys.stdin\ninf = 1 << 60\nmod = 1000000007\nni = lambda: int(ns())\nnin = lambda y: [ni() for _ in range(y)]\nna = lambda: list(map(int, stdin.readline().split()))\nnan = lambda y: [na() for _ in range(y)]\nnf = lambda: float(ns())\nnfn = lambda y: [nf() for _ in range(y)]\nnfa = lambda: list(map(float, stdin.readline().split()))\nnfan = lambda y: [nfa() for _ in range(y)]\nns = lambda: stdin.readline().rstrip()\nnsn = lambda y: [ns() for _ in range(y)]\nncl = lambda y: [list(ns()) for _ in range(y)]\nnas = lambda: stdin.readline().split()\nn = ni()\nk = ni()\nx = na()\nans = 0\nfor i in range(n):\n ans += min(abs(x[i]) * 2, abs(x[i] - k) * 2)\nprint(ans)\n","fast_code":"n, k = int(eval(input())), int(eval(input()))\nprint(\n (sum([min(abs(i * 2), abs((i - k) * 2)) for i in list(map(int, input().split()))]))\n)\n"} +{"fast_code_id":"90faa30042c0bb6cba7adea24ab1dd17bdf8918cdb0f49b4d3e4a96eeaf8817f","fast_id":"p03061_90faa30042c0bb6cba7adea24ab1dd17bdf8918cdb0f49b4d3e4a96eeaf8817f","language":"python","measured_fast_code_id":"90faa30042c0bb6cba7adea24ab1dd17bdf8918cdb0f49b4d3e4a96eeaf8817f","measured_slow_code_id":"2d1ac3c9fc00324fbe7020d274a3ccaef85c4cb391d9f2865533fe63f653f25e","measurement_metric":"cpu_instruction_count","pair_id":"python_2cc9c76848d83376f177a221","problem_id":"p03061","slow_code_id":"fb07db8e5e4b2567dc3a88a66ec68ddc15c21275b763c8b6a73c40b8a66faae8","slow_id":"p03061_2d1ac3c9fc00324fbe7020d274a3ccaef85c4cb391d9f2865533fe63f653f25e","speedup":3.907599026357645,"stratum":"2-4","sampling_key":"1bf339001a085dedbc385a4a5770fb7e93517dc9df7646d35b51c53e11133b8d","slow_code":"def gcdf(a):\n a.sort()\n a0 = a[0]\n a = [int(x % a0) for x in a if x % a0 != 0]\n if len(a) == 0:\n return a0\n else:\n a.append(a0)\n a0 = min(a)\n return gcdf(a)\n\n\nn = int(eval(input()))\na = list(map(int, input().split()))\nif n == 2:\n print((max(a)))\nelif n < 2**8:\n gcdv = 0\n for i in range(n):\n acpy = list(a)\n del acpy[i]\n gcdx = gcdf(acpy)\n if gcdx > gcdv:\n gcdv = gcdx\n print(gcdv)\nelse:\n m = int(n / 100)\n ns = int(n / m)\n rgcd = []\n for mi in range(m):\n ms = ns * mi\n if mi == m - 1:\n am = a[ms:n]\n else:\n am = a[ms : ms + ns]\n gcdm = gcdf(am)\n rgcd.append(gcdm)\n gcdv = 0\n for mi in range(m):\n rgcd1 = list(rgcd)\n del rgcd1[mi]\n gcdrg1 = gcdf(rgcd1)\n ms = ns * mi\n if mi == m - 1:\n am = a[ms:n]\n else:\n am = a[ms : ms + ns]\n\n for i in range(len(am)):\n acpy = list(am)\n\n acpy[i] = gcdrg1\n gcdx = gcdf(acpy)\n if gcdx > gcdv:\n gcdv = gcdx\n print(gcdv)\n","fast_code":"N = int(eval(input()))\nA = [int(i) for i in input().split()]\n\n\ndef gcd(x, y):\n if x < y:\n x, y = y, x\n if y == 0:\n return x\n return gcd(x % y, y)\n\n\nL = [0]\nR = [0]\nfor i in range(N):\n L.append(gcd(A[i], L[i]))\n R.append(gcd(A[-i - 1], R[i]))\nR.reverse()\nM = []\nfor i in range(0, N):\n M.append(gcd(L[i], R[i + 1]))\nprint((max(M)))\n"} +{"fast_code_id":"a778db8b9537c998b38dcfb4f67caa472836c91b5da44e58969f1da356e2155a","fast_id":"p03721_50445f1b87f3fbd2651e9e9e38b3ea73ec27d8b9ecd8a7fc37d88fd595bb5aef","language":"python","measured_fast_code_id":"50445f1b87f3fbd2651e9e9e38b3ea73ec27d8b9ecd8a7fc37d88fd595bb5aef","measured_slow_code_id":"75d5b758a5047678745153d41c380f660afa7f9d4f81ada1ef8c3eb0b4fb4d9c","measurement_metric":"cpu_instruction_count","pair_id":"python_2d146e727f02c485d9a1bbdf","problem_id":"p03721","slow_code_id":"75d5b758a5047678745153d41c380f660afa7f9d4f81ada1ef8c3eb0b4fb4d9c","slow_id":"p03721_75d5b758a5047678745153d41c380f660afa7f9d4f81ada1ef8c3eb0b4fb4d9c","speedup":5.059369094439389,"stratum":"4-8","sampling_key":"10caae117442fdfa9849b0ba685532d18a87449bbee883f9bf74da1ccf61e6ea","slow_code":"import sys\nimport numpy as np\nimport collections\n\nn, k = [int(x) for x in sys.stdin.readline().split()]\nr = collections.defaultdict(int)\nfor i in range(n):\n a, b = [int(x) for x in sys.stdin.readline().split()]\n r[a] += b\nd = sorted(r.items())\nc = 0\nfor i, j in enumerate(d):\n c += j[1]\n if c >= k:\n print((int(j[0])))\n break\n","fast_code":"import sys\n\ninput = sys.stdin.readline\n\n\ndef main():\n n, k = list(map(int, input().rstrip().split()))\n arr = sorted([list(map(int, input().rstrip().split())) for _ in range(n)])\n cur, cnt, ans = 0, 0, 0\n for i, j in arr:\n ans = i\n cnt += j\n if cnt >= k:\n break\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"d36abc488537b63f71dd9686bc4d0355759f159919dea7710e184fc99ecdcc9f","fast_id":"p03713_d36abc488537b63f71dd9686bc4d0355759f159919dea7710e184fc99ecdcc9f","language":"python","measured_fast_code_id":"d36abc488537b63f71dd9686bc4d0355759f159919dea7710e184fc99ecdcc9f","measured_slow_code_id":"6ddd022edcc2af6c3d183ae721cb6f6d30d4aac058bf834c570f396fb625f32f","measurement_metric":"cpu_instruction_count","pair_id":"python_2d2ed6e9e3a326eb53301e88","problem_id":"p03713","slow_code_id":"c64c0a671da32368f22f7c68336f13fb4f1a447495fbf26e635875929585050d","slow_id":"p03713_6ddd022edcc2af6c3d183ae721cb6f6d30d4aac058bf834c570f396fb625f32f","speedup":417.9012862567001,"stratum":"8+","sampling_key":"00bceadc23d18fcc05489c86c11f38bf85cbe92e57fec32da8ebe16c52746c54","slow_code":"import sys\n\nsys.setrecursionlimit(10**6)\ninput = sys.stdin.readline\nfrom math import floor, ceil, sqrt, factorial, log\nfrom heapq import heappop, heappush, heappushpop\nfrom collections import Counter, defaultdict\nfrom itertools import (\n accumulate,\n permutations,\n combinations,\n product,\n combinations_with_replacement,\n)\nfrom bisect import bisect_left, bisect_right\nfrom copy import deepcopy\n\ninf = float(\"inf\")\nmod = 10**9 + 7\n\n\ndef INT_(n):\n return int(n) - 1\n\n\ndef MI():\n return list(map(int, input().split()))\n\n\ndef MF():\n return list(map(float, input().split()))\n\n\ndef MI_():\n return list(map(INT_, input().split()))\n\n\ndef LI():\n return list(MI())\n\n\ndef LI_():\n return [int(x) - 1 for x in input().split()]\n\n\ndef LF():\n return list(MF())\n\n\ndef LIN(n: int):\n return [I() for _ in range(n)]\n\n\ndef LLIN(n: int):\n return [LI() for _ in range(n)]\n\n\ndef LLIN_(n: int):\n return [LI_() for _ in range(n)]\n\n\ndef LLI():\n return [list(map(int, l.split())) for l in eval(input())]\n\n\ndef I():\n return int(eval(input()))\n\n\ndef F():\n return float(eval(input()))\n\n\ndef ST():\n return input().replace(\"\\n\", \"\")\n\n\ndef main():\n H, W = MI()\n\n def solve(H, W):\n ans = inf\n for h in range(H):\n if not (H - h) & 1 or not W & 1:\n piece = [h * W, (W * (H - h)) // 2]\n ans = min(ans, max(piece) - min(piece))\n else:\n if (H - h) & 1:\n piece = [h * W, ((H - h - 1) * W) // 2, ((H - h + 1) * W) // 2]\n ans = min(ans, max(piece) - min(piece))\n if W & 1:\n piece = [h * W, ((W - 1) * (H - h)) // 2, ((W + 1) * (H - h)) // 2]\n ans = min(ans, max(piece) - min(piece))\n return ans\n\n ans1 = solve(H, W)\n ans2 = solve(W, H)\n print((min(ans1, ans2)))\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"h, w = list(map(int, input().split()))\nif h % 3 == 0 or w % 3 == 0:\n print((0))\nelse:\n ans = min(w, h)\n for w1 in range(w // 3, w // 3 + 3):\n s1 = w1 * h\n w2 = w - w1\n for h1 in range(h // 2, h // 2 + 2):\n s2 = w2 * h1\n s3 = w2 * (h - h1)\n ans = min(ans, max(s1, s2, s3) - min(s1, s2, s3))\n h, w = w, h\n for w1 in range(w // 3, w // 3 + 3):\n s1 = w1 * h\n w2 = w - w1\n for h1 in range(h // 2, h // 2 + 2):\n s2 = w2 * h1\n s3 = w2 * (h - h1)\n ans = min(ans, max(s1, s2, s3) - min(s1, s2, s3))\n print(ans)\n"} +{"fast_code_id":"75d18c94b1fc224b73f9cd43459683395d453f5bf3def50fdf4be238fe856e78","fast_id":"p03774_75d18c94b1fc224b73f9cd43459683395d453f5bf3def50fdf4be238fe856e78","language":"python","measured_fast_code_id":"75d18c94b1fc224b73f9cd43459683395d453f5bf3def50fdf4be238fe856e78","measured_slow_code_id":"0efc73096e5c454dd629a78888b6096a291ff26f7924fd5a40dea1274e463422","measurement_metric":"cpu_instruction_count","pair_id":"python_2d8514f8a7890f0648d0e206","problem_id":"p03774","slow_code_id":"0efc73096e5c454dd629a78888b6096a291ff26f7924fd5a40dea1274e463422","slow_id":"p03774_0efc73096e5c454dd629a78888b6096a291ff26f7924fd5a40dea1274e463422","speedup":144.2968544030376,"stratum":"8+","sampling_key":"0b763f646c275b14f2ef10df39eef0dcc0a095eaa7216b8d9cb4e6a24c28b62f","slow_code":"import numpy as np, sys\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\nN, M = LI()\nab = np.array([LI() for _ in range(N)], dtype=int)\ncd = np.array([LI() for _ in range(M)], dtype=int)\nfor x in ab:\n vector = np.sum(np.abs(cd - x), axis=1).tolist()\n print((vector.index(min(vector)) + 1))\n","fast_code":"def dist(x, y):\n return abs(x[0] - y[0]) + abs(x[1] - y[1])\n\n\nN, M = list(map(int, input().split()))\nX = [list(map(int, input().split())) for _ in range(N)]\nY = [list(map(int, input().split())) for _ in range(M)]\nfor i in range(N):\n x, y = X[i]\n ind = M + 1\n dmin = 10**9\n for j in range(M):\n c, d = Y[j]\n d = dist((x, y), (c, d))\n if d < dmin:\n ind = j + 1\n dmin = d\n print(ind)\n"} +{"fast_code_id":"473b082646548bea82ff86ac46a6626391d950751bd899d44dac28bc01aa5cbf","fast_id":"p03563_473b082646548bea82ff86ac46a6626391d950751bd899d44dac28bc01aa5cbf","language":"python","measured_fast_code_id":"473b082646548bea82ff86ac46a6626391d950751bd899d44dac28bc01aa5cbf","measured_slow_code_id":"59c6641cd1def8a06b45e4c0f0ace3ffa49de62fc97f73e0499cc3875cec5d01","measurement_metric":"cpu_instruction_count","pair_id":"python_2e177c5952426dfa5185ee5f","problem_id":"p03563","slow_code_id":"59c6641cd1def8a06b45e4c0f0ace3ffa49de62fc97f73e0499cc3875cec5d01","slow_id":"p03563_59c6641cd1def8a06b45e4c0f0ace3ffa49de62fc97f73e0499cc3875cec5d01","speedup":1712.8675578128828,"stratum":"8+","sampling_key":"670403ccd5685f819a394b413ec1c5ed5cd60978c09a43cc96edfd98bd5fe265","slow_code":"import numpy as np\n\nlst = []\nR = int(eval(input()))\nG = int(eval(input()))\nans = G - R + G\nprint(ans)\n","fast_code":"r = int(eval(input()))\ng = int(eval(input()))\nprint((r + (g - r) * 2))\n"} +{"fast_code_id":"2f68c2572603391cc58ce68e731ba0819583d4393d52e5343abe87c9b10d263b","fast_id":"p02289_2f68c2572603391cc58ce68e731ba0819583d4393d52e5343abe87c9b10d263b","language":"python","measured_fast_code_id":"2f68c2572603391cc58ce68e731ba0819583d4393d52e5343abe87c9b10d263b","measured_slow_code_id":"14b4ad282f61dc3f0baedf2eb80026c759f35dd9b34a29e093c21234282f17e7","measurement_metric":"cpu_instruction_count","pair_id":"python_2e34894e35b47965c4eecfdb","problem_id":"p02289","slow_code_id":"14b4ad282f61dc3f0baedf2eb80026c759f35dd9b34a29e093c21234282f17e7","slow_id":"p02289_14b4ad282f61dc3f0baedf2eb80026c759f35dd9b34a29e093c21234282f17e7","speedup":3.8544000803251905,"stratum":"2-4","sampling_key":"224327c000949fad8c4a6b90545a7570447935685f39cba7b442581aac35d92b","slow_code":"import sys\n\n\ndef maxHeapify(A, i):\n l = i * 2 + 1\n r = i * 2 + 2\n if l < n:\n largest = l\n if r < n and A[r] > A[l]:\n largest = r\n if A[largest] > A[i]:\n A[i], A[largest] = A[largest], A[i]\n maxHeapify(A, largest)\n\n\ndef insert(S, k):\n global n\n S[n] = k\n n += 1\n i = n - 1\n p = (i - 1) // 2\n while i > 0 and S[i] > S[p]:\n S[i], S[p] = S[p], S[i]\n i = p\n p = (i - 1) // 2\n\n\ndef extractMax(S):\n global n\n if n == 1:\n n -= 1\n return S[0]\n ans = S[0]\n n -= 1\n S[0] = S[n]\n i = 0\n while True:\n l = i * 2 + 1\n r = i * 2 + 2\n if l >= n:\n break\n largest = l\n if r < n and A[r] > A[l]:\n largest = r\n if A[largest] > A[i]:\n A[i], A[largest] = A[largest], A[i]\n i = largest\n else:\n break\n return ans\n\n\nA = [0] * 2000000\nS = []\nn = 0\nfor s in sys.stdin:\n if s[2] == \"s\":\n insert(A, int(s[7:]))\n elif s[2] == \"t\":\n S.append(extractMax(A))\n else:\n break\nprint((\"\\n\".join(map(str, S))))\n","fast_code":"import sys\nfrom heapq import heapify, heappush, heappop\n\nhq = []\nS = []\nfor s in sys.stdin:\n if s[2] == \"s\":\n heappush(hq, -int(s[7:]))\n elif s[2] == \"t\":\n S.append(-heappop(hq))\n else:\n break\nprint((\"\\n\".join(map(str, S))))\n"} +{"fast_code_id":"5310d966b2517660fc3b88ec1d0b8849b9bec037248efb2abc816aaed876d848","fast_id":"p03244_5310d966b2517660fc3b88ec1d0b8849b9bec037248efb2abc816aaed876d848","language":"python","measured_fast_code_id":"5310d966b2517660fc3b88ec1d0b8849b9bec037248efb2abc816aaed876d848","measured_slow_code_id":"100838eb35611188aaa0e6508544517c0abf47ad6e005b321a85725c0e9840dd","measurement_metric":"cpu_instruction_count","pair_id":"python_2e49ec1ff1e78579e15b326d","problem_id":"p03244","slow_code_id":"a39b059af4b03221115ad0dd54a76e5f423fd6c8173a18ffdbed4e08ab13360c","slow_id":"p03244_100838eb35611188aaa0e6508544517c0abf47ad6e005b321a85725c0e9840dd","speedup":5.814095772802665,"stratum":"4-8","sampling_key":"ccfbf9b09ee062480a435a8b2c9d8d519d5187843553249e193cf87203df3711","slow_code":"import numpy as np\n\neven = np.zeros(100001, dtype=int)\nodd = np.zeros(100001, dtype=int)\nn = int(eval(input()))\nv = list(map(int, input().split()))\nfor i in range(n):\n if i % 2 == 0:\n even[v[i]] += 1\n else:\n odd[v[i]] += 1\ne1 = even.argmax()\ne1n = even.max()\no1 = odd.argmax()\no1n = odd.max()\n\nif e1 == o1:\n e2n = np.sort(even)[-2]\n o2n = np.sort(odd)[-2]\n\n print((min(n - e1n - o2n, n - e2n - o1n)))\nelse:\n print((n - e1n - o1n))\n","fast_code":"def main():\n n, *v = list(map(int, open(0).read().split()))\n be = [0] * int(1e5)\n bo = [0] * int(1e5)\n for e, o in zip(*[iter(v)] * 2):\n be[e - 1] += 1\n bo[o - 1] += 1\n if be.index(max(be)) == bo.index(max(bo)):\n ve = max(be)\n vo = max(bo)\n be[be.index(ve)] = 0\n bo[bo.index(vo)] = 0\n print((min(n - ve - max(bo), n - vo - max(be))))\n else:\n print((n - max(be) - max(bo)))\n return\n\n\nmain()\n"} +{"fast_code_id":"8be6fab60cbb0835a7b785db5120fb63fb563cbc99a2259dd192835026c9ab10","fast_id":"p02640_8be6fab60cbb0835a7b785db5120fb63fb563cbc99a2259dd192835026c9ab10","language":"python","measured_fast_code_id":"8be6fab60cbb0835a7b785db5120fb63fb563cbc99a2259dd192835026c9ab10","measured_slow_code_id":"b81aa7896b39a5e204fdfa9ca3f63685a6d18d86724afc22b841cf9b49e7766b","measurement_metric":"cpu_instruction_count","pair_id":"python_2e54c14acee1a2bc6a751eb8","problem_id":"p02640","slow_code_id":"ac09bdaf0871ab87a33221ec8a163d2052febe18d868feae44e613cae3f3a95f","slow_id":"p02640_b81aa7896b39a5e204fdfa9ca3f63685a6d18d86724afc22b841cf9b49e7766b","speedup":6.8625267319097505,"stratum":"4-8","sampling_key":"4ec4be0e3faecebef854d0bc78ab217278d85461f67a49a205d1b02d8029806d","slow_code":"x, y = list(map(int, input().split()))\nfor i in range(0, 101):\n for j in range(0, 101):\n if i + j == x and i * 2 + j * 4 == y:\n print(\"Yes\")\n exit()\nprint(\"No\")\n","fast_code":"x, y = [int(x) for x in input().split()]\nfor i in range(x + 1):\n ans = \"No\"\n b = x - i\n if (i * 2 + b * 4) == y:\n ans = \"Yes\"\n break\nprint(ans)\n"} +{"fast_code_id":"c702447cb5e6b6b896b7f59d1225ad8d57b1a0feb9e6397339a33654ca4fd00e","fast_id":"p03030_c702447cb5e6b6b896b7f59d1225ad8d57b1a0feb9e6397339a33654ca4fd00e","language":"python","measured_fast_code_id":"c702447cb5e6b6b896b7f59d1225ad8d57b1a0feb9e6397339a33654ca4fd00e","measured_slow_code_id":"99641740840f9779b461fa1fb26d6b0b74d487b77fa798155bb3a136f008e321","measurement_metric":"cpu_instruction_count","pair_id":"python_2e6bc041bff0054a7beef6aa","problem_id":"p03030","slow_code_id":"99641740840f9779b461fa1fb26d6b0b74d487b77fa798155bb3a136f008e321","slow_id":"p03030_99641740840f9779b461fa1fb26d6b0b74d487b77fa798155bb3a136f008e321","speedup":5.362891722482655,"stratum":"4-8","sampling_key":"4218a4d18e015f662b1ed273430c1f126694a2bf7500b03d7f7f5c047b5d58fe","slow_code":"from operator import itemgetter\n\nn = int(eval(input()))\ny, s = list(), list()\nfor i in range(1, n + 1):\n S = input().split()\n S[1] = int(S[1])\n S.append(i)\n s.append(S)\ny = sorted(s, key=itemgetter(0))\nfor i in range(n):\n for j in range(1, n):\n if (y[j - 1][0] == y[j][0]) & (y[j - 1][1] < y[j][1]):\n y[j - 1], y[j] = y[j], y[j - 1]\nfor i in range(n):\n print((y[i][2]))\n","fast_code":"n = int(eval(input()))\nans = []\nfor i in range(n):\n s, p = list(map(str, input().split()))\n ans.append((s, int(p) * -1, i + 1))\nans.sort()\nfor i in ans:\n print((i[2]))\n"} +{"fast_code_id":"4ad119377be4e348284e9d98e8c96ef418d8c7f752903ae720c4b07277550d67","fast_id":"p02763_4ad119377be4e348284e9d98e8c96ef418d8c7f752903ae720c4b07277550d67","language":"python","measured_fast_code_id":"4ad119377be4e348284e9d98e8c96ef418d8c7f752903ae720c4b07277550d67","measured_slow_code_id":"f48f6f3e37812c17b5337b9141da770a977eb3ae11af352f28286963282fd6ed","measurement_metric":"cpu_instruction_count","pair_id":"python_2e87a695dbe1478e4568de46","problem_id":"p02763","slow_code_id":"4fa4a65e4a0df3861053325cb01fa333b2482712b297bcf1214920d237936687","slow_id":"p02763_f48f6f3e37812c17b5337b9141da770a977eb3ae11af352f28286963282fd6ed","speedup":5.263199599278967,"stratum":"4-8","sampling_key":"2b04d93f2dc12dbdcdd4e594c59317b51b89e655a168a04a3db92ad91fbf846b","slow_code":"import sys\n\ninput = sys.stdin.readline\n\n\nclass Bit:\n def __init__(self, n):\n self.n = n\n self.tree = [0] * (n + 1)\n self.el = [0] * (n + 1)\n self.depth = n.bit_length() - 1\n\n def sum(self, i):\n s = 0\n i -= 1\n while i >= 0:\n s += self.tree[i]\n i = (i & (i + 1)) - 1\n return s\n\n def add(self, i, x):\n self.el[i] += x\n while i < self.n:\n self.tree[i] += x\n i |= i + 1\n\n def get(self, i, j=None):\n if j is None:\n return self.el[i]\n if i == 0:\n return self.sum(j)\n return self.sum(j) - self.sum(i)\n\n def lower_bound(self, x, equal=False):\n sum_ = 0\n pos = -1\n if not equal:\n for i in range(self.depth, -1, -1):\n k = pos + (1 << i)\n if k < self.n and sum_ + self.tree[k] < x:\n sum_ += self.tree[k]\n pos += 1 << i\n if equal:\n for i in range(self.depth, -1, -1):\n k = pos + (1 << i)\n if k < self.n and sum_ + self.tree[k] <= x:\n sum_ += self.tree[k]\n pos += 1 << i\n return pos, sum_\n\n def __getitem__(self, s):\n return self.el[s]\n\n def __iter__(self):\n for s in self.el[: self.n]:\n yield s\n\n def __str__(self):\n text1 = \" \".join([\"element: \"] + list(map(str, self)))\n text2 = \" \".join(\n [\"cumsum(1-indexed): \"]\n + list(str(self.sum(i)) for i in range(1, self.n + 1))\n )\n return \"\\n\".join((text1, text2))\n\n\nimport string\n\nN = int(eval(input()))\nS = input().strip()\nQ = int(eval(input()))\nB = [Bit(N) for _ in range(26)]\nabc = string.ascii_lowercase\nabc2 = dict()\nfor i, s in enumerate(abc):\n abc2[s] = i\nfor i, s in enumerate(S):\n B[abc2[s]].add(i, 1)\nfor _ in range(Q):\n q = list(input().split())\n if q[0] == \"1\":\n a = int(q[1]) - 1\n b = q[2]\n for i in range(26):\n if B[i].el[a] == 1:\n B[i].add(a, -1)\n B[abc2[b]].add(a, 1)\n if q[0] == \"2\":\n a = int(q[1]) - 1\n b = int(q[2]) - 1\n res = 0\n for i in range(26):\n res += B[i].get(a, b + 1) > 0\n print(res)\n","fast_code":"def solve():\n import sys\n\n input = sys.stdin.readline\n ordA = ord(\"a\")\n N = int(eval(input()))\n Ss = input().strip()\n nos = [ord(S) - ordA for S in Ss]\n Q = int(eval(input()))\n idEle = 0\n\n def _binOpe(x, y):\n return x | y\n\n def makeSegTree(numEle):\n numPow2 = 2 ** (numEle - 1).bit_length()\n data = [idEle] * (2 * numPow2)\n return data, numPow2\n\n def setInit(As):\n for iST, A in enumerate(As, numPow2):\n data[iST] = A\n for iST in reversed(list(range(1, numPow2))):\n data[iST] = _binOpe(data[2 * iST], data[2 * iST + 1])\n\n def _update1(iA, A):\n iST = iA + numPow2\n data[iST] = A\n\n def update(iA, A):\n _update1(iA, A)\n iST = iA + numPow2\n while iST > 1:\n iST >>= 1\n data[iST] = _binOpe(data[2 * iST], data[2 * iST + 1])\n\n def getValue(iSt, iEn):\n L = iSt + numPow2\n R = iEn + numPow2\n ans = idEle\n while L < R:\n if L & 1:\n ans = _binOpe(ans, data[L])\n L += 1\n if R & 1:\n R -= 1\n ans = _binOpe(ans, data[R])\n L >>= 1\n R >>= 1\n return ans\n\n data, numPow2 = makeSegTree(N)\n As = [(1 << no) for no in nos]\n setInit(As)\n anss = []\n for _ in range(Q):\n tp, v1, v2 = input().split()\n if tp == \"1\":\n pos = int(v1) - 1\n c = ord(v2) - ordA\n update(pos, 1 << c)\n else:\n L, R = int(v1) - 1, int(v2) - 1\n v = getValue(L, R + 1)\n ans = bin(v).count(\"1\")\n anss.append(ans)\n print((\"\\n\".join(map(str, anss))))\n\n\nsolve()\n"} +{"fast_code_id":"40c384de9916c20716412ceeb875503501d088f9314d691c5f81bc3c1cf9e892","fast_id":"p02995_5956a1b2d912bfd23345c485f0ffc7b6e25d46613e1c4f11a08333a208413d78","language":"python","measured_fast_code_id":"5956a1b2d912bfd23345c485f0ffc7b6e25d46613e1c4f11a08333a208413d78","measured_slow_code_id":"df925af8753272e8ec1984ff302aca1be38e4ae8b71e704a8c242857bf509531","measurement_metric":"cpu_instruction_count","pair_id":"python_2e9210de0f6c0efb52aac232","problem_id":"p02995","slow_code_id":"6fc5067dd8ac941ec31580f2241fcd08dc5630fd6446ba8de71c3aa9f59aa2c9","slow_id":"p02995_df925af8753272e8ec1984ff302aca1be38e4ae8b71e704a8c242857bf509531","speedup":2.0556819340761883,"stratum":"2-4","sampling_key":"0430e25d89c6f35948a166402195f2c92cb108daa4c858e81fa5cfd3d11adb85","slow_code":"def floor(a, b):\n\n return a // b\n\n\ndef gcd(a, b):\n while b != 0:\n a, b = b, a % b\n return a\n\n\ndef lcm(a, b):\n return floor((a * b), gcd(a, b))\n\n\ninput = list(map(int, input().split(\" \")))\ntotal_count = input[1] + 1 - input[0]\ndiv_c = floor(input[1], input[2]) - floor(input[0] - 1, input[2])\ndiv_d = floor(input[1], input[3]) - floor(input[0] - 1, input[3])\ndiv_cd = floor(input[1], lcm(input[2], input[3])) - floor(\n input[0] - 1, lcm(input[2], input[3])\n)\nprint((total_count - (div_c + div_d - div_cd)))\n","fast_code":"import sys\n\n\ndef S():\n return sys.stdin.readline().rstrip()\n\n\nA, B, C, D = list(map(int, S().split()))\nfrom math import gcd\n\n\ndef f(n):\n return n - n // C - n // D + n // (C * D // gcd(C, D))\n\n\nprint((f(B) - f(A - 1)))\n"} +{"fast_code_id":"284acad32f039b02d479f3e10e518b3399b8810722821631f54eb37aa1b6351e","fast_id":"p02995_284acad32f039b02d479f3e10e518b3399b8810722821631f54eb37aa1b6351e","language":"python","measured_fast_code_id":"284acad32f039b02d479f3e10e518b3399b8810722821631f54eb37aa1b6351e","measured_slow_code_id":"df925af8753272e8ec1984ff302aca1be38e4ae8b71e704a8c242857bf509531","measurement_metric":"cpu_instruction_count","pair_id":"python_2ea7ba8b1630a613efb019c7","problem_id":"p02995","slow_code_id":"6fc5067dd8ac941ec31580f2241fcd08dc5630fd6446ba8de71c3aa9f59aa2c9","slow_id":"p02995_df925af8753272e8ec1984ff302aca1be38e4ae8b71e704a8c242857bf509531","speedup":2.2798219543061307,"stratum":"2-4","sampling_key":"39740fdfb10a05c429e210d4f6d50dee57f434e52fffb5fefd8cdcafa00358bc","slow_code":"def floor(a, b):\n\n return a // b\n\n\ndef gcd(a, b):\n while b != 0:\n a, b = b, a % b\n return a\n\n\ndef lcm(a, b):\n return floor((a * b), gcd(a, b))\n\n\ninput = list(map(int, input().split(\" \")))\ntotal_count = input[1] + 1 - input[0]\ndiv_c = floor(input[1], input[2]) - floor(input[0] - 1, input[2])\ndiv_d = floor(input[1], input[3]) - floor(input[0] - 1, input[3])\ndiv_cd = floor(input[1], lcm(input[2], input[3])) - floor(\n input[0] - 1, lcm(input[2], input[3])\n)\nprint((total_count - (div_c + div_d - div_cd)))\n","fast_code":"import math as m\n\nA, B, C, D = list(map(int, input().split()))\nA -= 1\ng = C * D // m.gcd(C, D)\nx = B // C - A // C\ny = B // D - A // D\nz = B // g - A // g\nprint((B - A - x - y + z))\n"} +{"fast_code_id":"f2acecf8ec095af96485c316c6f0bfbf9c1f317c466a4cd3cb68726b2823506d","fast_id":"p03737_4890498b309b7ec43710ae8f53962d9b23bf0c7b5e058a250de236c4a946a0aa","language":"python","measured_fast_code_id":"4890498b309b7ec43710ae8f53962d9b23bf0c7b5e058a250de236c4a946a0aa","measured_slow_code_id":"c5a6a790bfe3c359c7ab2698d0f376a617bb650fa938bf64d595d41523985f6d","measurement_metric":"cpu_instruction_count","pair_id":"python_2ecb81269615092fcc760bf1","problem_id":"p03737","slow_code_id":"c5a6a790bfe3c359c7ab2698d0f376a617bb650fa938bf64d595d41523985f6d","slow_id":"p03737_c5a6a790bfe3c359c7ab2698d0f376a617bb650fa938bf64d595d41523985f6d","speedup":1223.0477647490557,"stratum":"8+","sampling_key":"7500c0dc1f156b78a91e1505f98fd174f89d0857d149a384473aa0308a10af2f","slow_code":"import numpy as np\nimport math\n\ns = \" \" + input()\nfor i in range(len(s)):\n if s[i] == \" \":\n print(chr(ord(s[i + 1]) - 32), end=\"\")\nprint()\n","fast_code":"def generate_acronym(l1: list) -> str:\n answer = \"\"\n for i, word in enumerate(l1):\n\n answer += word[0].upper()\n return answer\n\n\nlists = list(map(str, input().split()))\nprint((generate_acronym(lists)))\n"} +{"fast_code_id":"4121c6a6e3d9aba7df2cb8b2180b806860b4871d736da8750ea301f8d43d7f73","fast_id":"p03037_e6c0844e7694c12bec45ebbcb9f5c1f747d59875496e8d893324191cb02a6333","language":"python","measured_fast_code_id":"e6c0844e7694c12bec45ebbcb9f5c1f747d59875496e8d893324191cb02a6333","measured_slow_code_id":"603682b2a1acebd824f0081d6dbfdc82575d41c2aa8f541e6ca8387c5cde8833","measurement_metric":"cpu_instruction_count","pair_id":"python_2eebf92ddf9b85c670a86297","problem_id":"p03037","slow_code_id":"603682b2a1acebd824f0081d6dbfdc82575d41c2aa8f541e6ca8387c5cde8833","slow_id":"p03037_603682b2a1acebd824f0081d6dbfdc82575d41c2aa8f541e6ca8387c5cde8833","speedup":5.071980091478483,"stratum":"4-8","sampling_key":"051d290c6529327b683fc69023f6c4df5393bcf4763f4f44ff674ddad2b3f212","slow_code":"import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, queue, copy\n\nsys.setrecursionlimit(10**7)\ninf = 10**20\nmod = 10**9 + 7\ndd = [(-1, 0), (0, 1), (1, 0), (0, -1)]\nddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef LI_():\n return [int(x) - 1 for x in sys.stdin.readline().split()]\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LS():\n return sys.stdin.readline().split()\n\n\ndef S():\n return eval(input())\n\n\ndef main():\n n, k = LI()\n l = [0] * (n + 1)\n for _ in range(k):\n a, b = LI()\n l[a - 1] += 1\n l[b] -= 1\n for i in range(n - 1):\n l[i + 1] += l[i]\n ans = 0\n for x in l[:-1]:\n if x == k:\n ans += 1\n return ans\n\n\nprint((main()))\n","fast_code":"def main():\n n, m = list(map(int, input().split()))\n A = []\n B = []\n for _ in range(m):\n a, b = list(map(int, input().split()))\n A.append(a)\n B.append(b)\n l = max(A)\n r = min(B)\n\n if r >= l:\n return r - l + 1\n else:\n return 0\n\n\nif __name__ == \"__main__\":\n print((main()))\n"} +{"fast_code_id":"55acc7ce8cedc6a242c493f2cf7b0d9bd9447577f90035762c1fc1c1719bf63e","fast_id":"p02603_7f991e931f7e5f476d566fe2bcb11cbc12489e8d750e92eaeb44581b46ddc903","language":"python","measured_fast_code_id":"7f991e931f7e5f476d566fe2bcb11cbc12489e8d750e92eaeb44581b46ddc903","measured_slow_code_id":"ac647f8beef1e462070f18ba0c6d85690102f1fdb39ac64fcccd21cdad5d43fa","measurement_metric":"cpu_instruction_count","pair_id":"python_2f0bedd67d83eefcef320baa","problem_id":"p02603","slow_code_id":"ac647f8beef1e462070f18ba0c6d85690102f1fdb39ac64fcccd21cdad5d43fa","slow_id":"p02603_ac647f8beef1e462070f18ba0c6d85690102f1fdb39ac64fcccd21cdad5d43fa","speedup":5.774564589135349,"stratum":"4-8","sampling_key":"1b6e9a3c039bdff3f7ed437b20ee8d589e84a8b7d2ccf1394e2357845326e8b1","slow_code":"import sys\nimport heapq, math\nfrom bisect import bisect_right\nfrom itertools import (\n zip_longest,\n permutations,\n combinations,\n combinations_with_replacement,\n)\nfrom itertools import accumulate, dropwhile, takewhile, groupby\nfrom functools import lru_cache\nfrom copy import deepcopy\n\nN = int(eval(input()))\nA = list(map(int, input().split()))\nB = [A[0]]\nfor i in range(1, N):\n if A[i - 1] != A[i]:\n B.append(A[i])\nN = len(B)\n\n\ndef solve():\n ret = 1000\n l = 0\n while l < N:\n while l < N - 1 and B[l] > B[l + 1]:\n l += 1\n if l == N - 1:\n return ret\n C = [B[l]]\n while l < N - 1 and B[l] < B[l + 1]:\n C.append(B[l + 1])\n l += 1\n cnt = ret // C[0]\n ret -= cnt * C[0]\n ret += cnt * C[-1]\n l += 1\n return ret\n\n\nprint((solve()))\n","fast_code":"n = int(eval(input()))\na = list(map(int, input().split()))\na_cur = a[0]\nm = 1000\ns = 0\nfor i in range(1, n):\n a_next = a[i]\n if a_cur < a_next:\n\n s += m // a_cur\n m -= m // a_cur * a_cur\n else:\n\n m += s * a_cur\n s = 0\n a_cur = a_next\nm += s * a_cur\nprint(m)\n"} +{"fast_code_id":"0321a53369ffe9686f7239df9a6681837256360940a4fa46452119b06d7236d3","fast_id":"p03077_0321a53369ffe9686f7239df9a6681837256360940a4fa46452119b06d7236d3","language":"python","measured_fast_code_id":"0321a53369ffe9686f7239df9a6681837256360940a4fa46452119b06d7236d3","measured_slow_code_id":"34caf7325f4819bd719f1f977d4c7833f1b8eae1073783274c70d879e08aa59a","measurement_metric":"cpu_instruction_count","pair_id":"python_2fab52b07951281ae77d51cb","problem_id":"p03077","slow_code_id":"ab58e9cb16ab933309b0c60e055e71406d283b0d16126adf763de4e9caa5d6fb","slow_id":"p03077_34caf7325f4819bd719f1f977d4c7833f1b8eae1073783274c70d879e08aa59a","speedup":621.3058097451521,"stratum":"8+","sampling_key":"06612b8a562b1ac3324612512c9679dc6c985b13a26d575c722632ec5d86d10b","slow_code":"import sys\nimport numpy as np\n\n\ndef get_num():\n return int(eval(input()))\n\n\ndef get_nums(n):\n res = [0 for _ in range(n)]\n for i in range(n):\n res[i] = int(eval(input()))\n return res\n\n\ndef get_numbers():\n return list(map(int, input().split()))\n\n\nn = get_num()\ncosts = get_nums(5)\nmax_time = 0\nfor cost in costs:\n max_time = max(max_time, int(np.ceil(n / cost)))\nprint((max_time + 4))\n","fast_code":"from math import ceil\n\nN = int(eval(input()))\nA = int(eval(input()))\nB = int(eval(input()))\nC = int(eval(input()))\nD = int(eval(input()))\nE = int(eval(input()))\nL = [A, B, C, D, E]\nm = min(L)\nprint((4 + ceil(N / m)))\n"} +{"fast_code_id":"bc1c7a50e9c7d73695fc373c49083f3ca76b69d7d65d1464d978cf8fb277b77d","fast_id":"p02572_bc1c7a50e9c7d73695fc373c49083f3ca76b69d7d65d1464d978cf8fb277b77d","language":"python","measured_fast_code_id":"bc1c7a50e9c7d73695fc373c49083f3ca76b69d7d65d1464d978cf8fb277b77d","measured_slow_code_id":"9a9a8c4412436852a66bfa0067b57c544f3aec7f532b2c46c6eaa958a2513451","measurement_metric":"cpu_instruction_count","pair_id":"python_303481333b37759bf4825fb3","problem_id":"p02572","slow_code_id":"9a9a8c4412436852a66bfa0067b57c544f3aec7f532b2c46c6eaa958a2513451","slow_id":"p02572_9a9a8c4412436852a66bfa0067b57c544f3aec7f532b2c46c6eaa958a2513451","speedup":4.245775361341038,"stratum":"4-8","sampling_key":"42016b614622c7e5d847c0f8a3e5c2eb3da939e832d0543978ecbe2d381ee17b","slow_code":"import copy\n\nN = int(eval(input()))\nA = list(map(int, input().split()))\nmod = 10**9 + 7\npartial_sum = copy.deepcopy(A)\nsum_now = A[N - 1]\nfor j in range(N - 2, -1, -1):\n sum_now = int((sum_now + A[j]) % mod)\n partial_sum[j] = sum_now\nres = 0\nfor i in range(N - 1):\n res = (res + (A[i] * partial_sum[i + 1]) % mod) % mod\nprint((int(res)))\n","fast_code":"import sys\nfrom itertools import accumulate\n\nread = sys.stdin.read\nreadline = sys.stdin.readline\nreadlines = sys.stdin.readlines\nsys.setrecursionlimit(10**9)\nINF = 1 << 60\nMOD = 1000000007\n\n\ndef main():\n N, *A = list(map(int, read().split()))\n total = sum(A) % MOD\n ans = total * total % MOD\n for a in A:\n ans = (ans - a * a) % MOD\n ans = ans * pow(2, MOD - 2, MOD) % MOD\n print(ans)\n return\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"8a16d58ba1b2f27049215d9a438bbca28f84c608e831115d5306f1aa2c301a6d","fast_id":"p03329_8a16d58ba1b2f27049215d9a438bbca28f84c608e831115d5306f1aa2c301a6d","language":"python","measured_fast_code_id":"8a16d58ba1b2f27049215d9a438bbca28f84c608e831115d5306f1aa2c301a6d","measured_slow_code_id":"d420a4a47c3d63ccc8bf0d67f00fb6eac614ba4a541aaa7d9741e0a6de148e33","measurement_metric":"cpu_instruction_count","pair_id":"python_30797ec6f1a0bd684d1d591d","problem_id":"p03329","slow_code_id":"d420a4a47c3d63ccc8bf0d67f00fb6eac614ba4a541aaa7d9741e0a6de148e33","slow_id":"p03329_d420a4a47c3d63ccc8bf0d67f00fb6eac614ba4a541aaa7d9741e0a6de148e33","speedup":2403.5012080608553,"stratum":"8+","sampling_key":"02701285a8ebe3976f88b2a7752a55e5986bca9ceb91855d8ee2ac62fea114de","slow_code":"n = int(eval(input()))\ndp = [float(\"inf\")] * 100010\ndp[0] = 0\nfor i in range(1, 100000 + 1):\n power = 1\n while power <= i:\n dp[i] = min(dp[i], dp[i - power] + 1)\n power *= 6\n power = 1\n while power <= i:\n dp[i] = min(dp[i], dp[i - power] + 1)\n power *= 9\nprint((dp[n]))\n","fast_code":"N = int(eval(input()))\nsixs = [6**i for i in range(1, 7)]\nnines = [9**i for i in range(1, 6)]\ntmp = {}\n\n\ndef dfs(n):\n if n < 6:\n return n\n if n in tmp:\n return tmp[n]\n m = 10**9 + 7\n if n >= 9:\n max_nine = max(nine for nine in nines if nine <= n)\n if n % max_nine == 0:\n m = min(m, n // max_nine)\n else:\n m = min(m, dfs(n - max_nine) + 1)\n max_six = max(six for six in sixs if six <= n)\n if n % max_six == 0:\n m = min(m, n // max_six)\n tmp[n] = min(m, dfs(n - max_six) + 1)\n return tmp[n]\n\n\nprint((dfs(N)))\n"} +{"fast_code_id":"56cea743b48b7a076bbd9f52c91c7e72f3ce5d3563f4cc35917d717a9d52aee2","fast_id":"p01224_56cea743b48b7a076bbd9f52c91c7e72f3ce5d3563f4cc35917d717a9d52aee2","language":"python","measured_fast_code_id":"56cea743b48b7a076bbd9f52c91c7e72f3ce5d3563f4cc35917d717a9d52aee2","measured_slow_code_id":"66194bc1a7ae54de44e09b5f93d1f79e3416a467c501ca1310dc3f13610e492e","measurement_metric":"cpu_instruction_count","pair_id":"python_310c381616d1b341af082371","problem_id":"p01224","slow_code_id":"66194bc1a7ae54de44e09b5f93d1f79e3416a467c501ca1310dc3f13610e492e","slow_id":"p01224_66194bc1a7ae54de44e09b5f93d1f79e3416a467c501ca1310dc3f13610e492e","speedup":2.339444045115134,"stratum":"2-4","sampling_key":"6ae2aec76c9b8cad4e1123a70f11e95a5b4020255d6c313ef9db72e5c6434677","slow_code":"from math import sqrt\n\nP = \"perfect number\"\nD = \"deficient number\"\nA = \"abundant number\"\nwhile True:\n n = eval(input())\n if n == 0:\n break\n if n == 1:\n print(D)\n continue\n su = 1\n temp = n\n for i in range(2, int(sqrt(n)) + 1):\n cnt = 0\n while temp % i == 0:\n temp /= i\n cnt += 1\n if cnt:\n su *= (i ** (cnt + 1) - 1) / (i - 1)\n if temp == 1:\n su -= n\n break\n if temp != 1:\n su *= (temp**2 - 1) / (temp - 1)\n su -= n\n print(P if n == su else (D if su < n else A))\n","fast_code":"P = \"perfect number\"\nD = \"deficient number\"\nA = \"abundant number\"\nwhile True:\n n = int(input())\n if n == 0:\n break\n if n == 1:\n print(D)\n continue\n su = 1\n t = n\n i = 2\n while i**2 <= t:\n if t % i == 0:\n cnt = 0\n while t % i == 0:\n t /= i\n cnt += 1\n su *= (i ** (cnt + 1) - 1) / (i - 1)\n i += 1\n if t > 1:\n su *= (t**2 - 1) / (t - 1)\n su -= n\n print(P if n == su else (D if su < n else A))\n"} +{"fast_code_id":"5c76f55bb7375b008aae832468c1927f071bea15c20ce5c79f4e53a61685b084","fast_id":"p03456_5c76f55bb7375b008aae832468c1927f071bea15c20ce5c79f4e53a61685b084","language":"python","measured_fast_code_id":"5c76f55bb7375b008aae832468c1927f071bea15c20ce5c79f4e53a61685b084","measured_slow_code_id":"ddb265e799745c13d88c260b6767a9f7a765687934948fe113d1366dbd4b4060","measurement_metric":"cpu_instruction_count","pair_id":"python_31116a7e40bc3c614ca1abd9","problem_id":"p03456","slow_code_id":"ddb265e799745c13d88c260b6767a9f7a765687934948fe113d1366dbd4b4060","slow_id":"p03456_ddb265e799745c13d88c260b6767a9f7a765687934948fe113d1366dbd4b4060","speedup":1695.804689807121,"stratum":"8+","sampling_key":"0c99831a9248be815254f94e11c5d0f763072d87f9de4c1a6f290e983ae2c6d3","slow_code":"from sys import stdin\nfrom itertools import combinations\nfrom math import factorial\nimport numpy as np\nimport math\n\na, b = [int(x) for x in stdin.readline().rstrip().split()]\nc = int(str(a) + str(b))\nif int(math.sqrt(c)) ** 2 == c:\n print(\"Yes\")\nelse:\n print(\"No\")\n","fast_code":"a, b = list(map(str, input().split()))\ntarget = int(a + b)\nif (target**0.5).is_integer():\n print(\"Yes\")\nelse:\n print(\"No\")\n"} +{"fast_code_id":"bc6f3d038f475ce3e6712288d3898428f26b781897e10a7c7d23e91f65604efa","fast_id":"p03170_bc6f3d038f475ce3e6712288d3898428f26b781897e10a7c7d23e91f65604efa","language":"python","measured_fast_code_id":"bc6f3d038f475ce3e6712288d3898428f26b781897e10a7c7d23e91f65604efa","measured_slow_code_id":"96339fbd84de8f52e0d5ae5c33c0a9a225fb02a73f3198d2faedd4c55102f74f","measurement_metric":"cpu_instruction_count","pair_id":"python_315627828a390e10c21ff23b","problem_id":"p03170","slow_code_id":"96339fbd84de8f52e0d5ae5c33c0a9a225fb02a73f3198d2faedd4c55102f74f","slow_id":"p03170_96339fbd84de8f52e0d5ae5c33c0a9a225fb02a73f3198d2faedd4c55102f74f","speedup":5.458056554513589,"stratum":"4-8","sampling_key":"3951bf917b3bbcdb0b7a268e661686cc4d00cfe44c12a6a3f1896237e563faeb","slow_code":"n, k = list(map(int, input().split()))\na = list(map(int, input().split()))\ndp = [0 for i in range(k + 1)]\ndp[0] = 2\nfor i in range(1, k + 1):\n l = 0\n for j in range(n):\n if dp[i - a[j]] == 2:\n l = l + 1\n break\n if l == 1:\n dp[i] = 1\n else:\n dp[i] = 2\nif dp[k] == 1:\n print(\"First\")\nelse:\n print(\"Second\")\n","fast_code":"n, k = list(map(int, input().split()))\narr = list(map(int, input().split()))\ndp = [False] * (k + 1)\nfor i in range(k + 1):\n if not dp[i]:\n for a in arr:\n if i + a > k:\n break\n dp[i + a] = True\nprint((\"First\" if dp[k] else \"Second\"))\n"} +{"fast_code_id":"93b64a608c9c235279e7e8cc26d6514c31baa97a5b938987666ead006620ab9f","fast_id":"p04014_e319f8790b7bb1feb9470e8cf607d5e00cb6ae43af2b120fc923c489db2ef8ef","language":"python","measured_fast_code_id":"e319f8790b7bb1feb9470e8cf607d5e00cb6ae43af2b120fc923c489db2ef8ef","measured_slow_code_id":"c95ad2a8dc940041977600eb1078f63d16cb258708724f5b3b59e88e5ff612b9","measurement_metric":"cpu_instruction_count","pair_id":"python_31b632de1e59e860ddb6609a","problem_id":"p04014","slow_code_id":"29cce6a043e57af2f8084b7594ae7495531a30dede09cf51b56088a83bb9cffb","slow_id":"p04014_c95ad2a8dc940041977600eb1078f63d16cb258708724f5b3b59e88e5ff612b9","speedup":3.519202941046083,"stratum":"2-4","sampling_key":"ce3a4e6fa4e58ae0cee04be7a8fee672c7fe8a36d0f7b507fd1357067e48beb3","slow_code":"from math import floor, sqrt\n\nINF = 10**20\n\n\ndef f(b, n):\n if n < b:\n return n\n else:\n return f(b, n // b) + (n % b)\n\n\ndef main():\n n = int(eval(input()))\n s = int(eval(input()))\n ans = INF\n\n if n == s:\n ans = min(ans, n + 1)\n\n for p in range(1, int(sqrt(n)) + 1):\n q = s - p\n b = (n - q) // p\n if 2 <= b and f(b, n) == s:\n ans = min(ans, b)\n\n for b in range(2, int(sqrt(n)) + 1):\n if f(b, n) == s:\n ans = min(ans, b)\n print((-1 if ans == INF else ans))\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"def primeFactor(N):\n i = 2\n ret = {}\n n = N\n mrFlg = 0\n while i**2 <= n:\n k = 0\n while n % i == 0:\n n //= i\n k += 1\n ret[i] = k\n i += 1\n if i == 101 and n >= (2**20):\n\n def findFactorRho(N):\n def gcd(a, b):\n while b:\n a, b = b, a % b\n return abs(a)\n\n def f(x, c):\n return ((x**2) + c) % N\n\n semi = [N]\n for c in range(1, 99):\n x, y, d = 2, 2, 1\n while d == 1:\n x = f(x, c)\n y = f(f(y, c), c)\n d = gcd(abs(x - y), N)\n if d != N:\n if isPrimeMR(d):\n return d\n elif isPrimeMR(N // d):\n return N // d\n else:\n semi.append(d)\n\n while True:\n if isPrimeMR(n):\n ret[n], n = 1, 1\n break\n else:\n mrFlg = 1\n j = findFactorRho(n)\n k = 0\n while n % j == 0:\n n //= j\n k += 1\n ret[j] = k\n if n == 1:\n break\n if n > 1:\n ret[n] = 1\n if mrFlg > 0:\n\n def dict_sort(X):\n Y = {}\n for x in sorted(X.keys()):\n Y[x] = X[x]\n return Y\n\n ret = dict_sort(ret)\n return ret\n\n\ndef isPrimeMR(n):\n if n == 2:\n return True\n if n == 1 or n & 1 == 0:\n return False\n d = (n - 1) >> 1\n while d & 1 == 0:\n d >>= 1\n for a in [2, 3, 5, 7, 11, 13, 17, 19, 23]:\n t = d\n y = pow(a, t, n)\n while t != n - 1 and y != 1 and y != n - 1:\n y = (y * y) % n\n t <<= 1\n if y != n - 1 and t & 1 == 0:\n return False\n return True\n\n\ndef divisors(N):\n pf = primeFactor(N)\n ret = [1]\n for p in pf:\n ret_prev = ret\n ret = []\n for i in range(pf[p] + 1):\n for r in ret_prev:\n ret.append(r * (p**i))\n return sorted(ret)\n\n\ndef f(b, n):\n re = 0\n while n:\n re += n % b\n n //= b\n return re\n\n\nN = int(eval(input()))\nS = int(eval(input()))\nif N < S:\n print((-1))\nelif N == S:\n print((N + 1))\nelse:\n for b in divisors(N - S):\n b += 1\n if f(b, N) == S:\n print(b)\n break\n else:\n print((-1))\n"} +{"fast_code_id":"141901d594e0ce249719b3f9906054176749f703a292069b6c8e36e149a97cb9","fast_id":"p02619_141901d594e0ce249719b3f9906054176749f703a292069b6c8e36e149a97cb9","language":"python","measured_fast_code_id":"141901d594e0ce249719b3f9906054176749f703a292069b6c8e36e149a97cb9","measured_slow_code_id":"d03c5b8a0cfad256289a0238b96e85a9483f201802ae221a6fa72a78e056a6e7","measurement_metric":"cpu_instruction_count","pair_id":"python_31d6b73993a4f7f75dcd2866","problem_id":"p02619","slow_code_id":"d03c5b8a0cfad256289a0238b96e85a9483f201802ae221a6fa72a78e056a6e7","slow_id":"p02619_d03c5b8a0cfad256289a0238b96e85a9483f201802ae221a6fa72a78e056a6e7","speedup":50.52813958181327,"stratum":"8+","sampling_key":"ac968a1c298253fca7f8c4ab61e163546a6b32992482aba23a8698bd5f3585d0","slow_code":"def read_input():\n D = int(eval(input()))\n C = input().split()\n C = [int(i) for i in C]\n S = [list(map(int, input().split())) for _ in range(D)]\n T = [int(eval(input())) for _ in range(D)]\n return D, C, S, T\n\n\ndef scoring(S, D, T, C):\n res = []\n last = [0 for _ in range(26)]\n final = 0\n for i in range(D):\n dec = 0\n for j in range(26):\n for loc, val in enumerate(T[: i + 1]):\n if val == j + 1:\n last[j] = loc + 1\n dec += C[j] * (i - last[j] + 1)\n final += S[i][T[i] - 1] - dec\n res.append(final)\n return res\n\n\nD, C, S, T = read_input()\nres = scoring(S, D, T, C)\nfor x in res:\n print(x)\n","fast_code":"def func(s, x):\n last = [0] * 26\n score = 0\n for i, v in enumerate(x, 1):\n last[v] = i\n c = 0\n for j in range(26):\n c += s[j] * (i - last[j])\n score = score + s[i * 26 + v] - c\n print(score)\n return score\n\n\ndef main():\n d, *s = list(map(int, open(0).read().split()))\n func(s, [t - 1 for t in s[-d:]])\n\n\nmain()\n"} +{"fast_code_id":"3bce503f6b8695268fd512fc07a38f5d662ae8dccea348f827c6f3a4e18f9e66","fast_id":"p02630_3bce503f6b8695268fd512fc07a38f5d662ae8dccea348f827c6f3a4e18f9e66","language":"python","measured_fast_code_id":"3bce503f6b8695268fd512fc07a38f5d662ae8dccea348f827c6f3a4e18f9e66","measured_slow_code_id":"5f16fa015b9027974d1bc0a72842ba1bfda9af773dccce5a9d289b37ed6ecba4","measurement_metric":"cpu_instruction_count","pair_id":"python_329e5a08951a8fa105552c43","problem_id":"p02630","slow_code_id":"5f16fa015b9027974d1bc0a72842ba1bfda9af773dccce5a9d289b37ed6ecba4","slow_id":"p02630_5f16fa015b9027974d1bc0a72842ba1bfda9af773dccce5a9d289b37ed6ecba4","speedup":6.322958217846825,"stratum":"4-8","sampling_key":"1fc1d45b424c58ea2ec812a4b5950743cec33a362f78e8e9c2452a4111a34c07","slow_code":"n = int(eval(input())) + 1\na = list(map(int, input().split()))\ncnt = []\nfor i in range(100005):\n cnt.append(0)\nsum = 0\nfor i in a:\n cnt[i] += 1\nfor i in range(100005):\n sum += i * cnt[i]\nq = int(eval(input()))\nfor i in range(q):\n b, c = list(map(int, input().split()))\n sum += (c - b) * cnt[b]\n cnt[c] += cnt[b]\n cnt[b] = 0\n print(sum)\n","fast_code":"f = lambda: [*list(map(int, input().split()))]\nf()\ns, *l = [0] * 100002\nfor i in f():\n s += i\n l[i] += 1\nq = f()[0]\nfor _ in range(q):\n b, c = f()\n s += (c - b) * l[b]\n l[c] += l[b]\n l[b] = 0\n print(s)\n"} +{"fast_code_id":"382ed3d45f12465a007213238f4c0fff50ec69c1a79c165d4d981342f3cd87cf","fast_id":"p03338_382ed3d45f12465a007213238f4c0fff50ec69c1a79c165d4d981342f3cd87cf","language":"python","measured_fast_code_id":"382ed3d45f12465a007213238f4c0fff50ec69c1a79c165d4d981342f3cd87cf","measured_slow_code_id":"b26d7b127a5d896b500dc03a2fa751edc6fb5a11d0b4f6e5d93621ef3ac81957","measurement_metric":"cpu_instruction_count","pair_id":"python_335ee76dfadbb653cc1f919a","problem_id":"p03338","slow_code_id":"b26d7b127a5d896b500dc03a2fa751edc6fb5a11d0b4f6e5d93621ef3ac81957","slow_id":"p03338_b26d7b127a5d896b500dc03a2fa751edc6fb5a11d0b4f6e5d93621ef3ac81957","speedup":2.387966204869661,"stratum":"2-4","sampling_key":"d3e32d60d19fc1c16c3f0c926c41d17de03e760e1b648e7be390f7bd12cc44ff","slow_code":"import collections, sys\n\n\ndef S():\n return sys.stdin.readline().rstrip()\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\nN = I()\nS = S()\nans = 0\nfor i in range(N):\n set_top = set()\n set_bottom = set()\n for s in collections.Counter(S[:i]):\n set_top.add(s)\n for s in collections.Counter(S[i:]):\n set_bottom.add(s)\n ans = max(ans, len(set_top & set_bottom))\nprint(ans)\n","fast_code":"import sys\n\n\ndef S():\n return sys.stdin.readline().rstrip()\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\nN = I()\nS = S()\nans = 0\nfor i in range(N):\n ans = max(ans, len(set(S[:i]) & set(S[i:])))\nprint(ans)\n"} +{"fast_code_id":"6a882d2a5423b1f6b3f7524d4d393bad5b717d8c1f08a3765c460fbb340b4113","fast_id":"p02555_6a882d2a5423b1f6b3f7524d4d393bad5b717d8c1f08a3765c460fbb340b4113","language":"python","measured_fast_code_id":"6a882d2a5423b1f6b3f7524d4d393bad5b717d8c1f08a3765c460fbb340b4113","measured_slow_code_id":"3a531d5d2ca61d288b4238085118dccbb6b1c04598e7aed0a116bd9571a93b35","measurement_metric":"cpu_instruction_count","pair_id":"python_33aaf6a9ce1ee44e5d5743b7","problem_id":"p02555","slow_code_id":"4cbb98a33bd3d00b5b2726ac654cdc33a13286133f35ef468e9d5a4be6a55fa2","slow_id":"p02555_3a531d5d2ca61d288b4238085118dccbb6b1c04598e7aed0a116bd9571a93b35","speedup":3527.0841664484465,"stratum":"8+","sampling_key":"5cd05ba2ca9ea8f6c23b54dac0ce8647415556f360d063fa58a58abc3e4f6076","slow_code":"MOD = 10**9 + 7\nMAX = 1000010\nfac = [0] * MAX\nfinv = [0] * MAX\ninv = [0] * MAX\n\n\ndef COMinit():\n fac[0] = fac[1] = 1\n finv[0] = finv[1] = 1\n inv[1] = 1\n for i in range(2, MAX):\n fac[i] = fac[i - 1] * i % MOD\n inv[i] = MOD - inv[MOD % i] * (MOD // i) % MOD\n finv[i] = finv[i - 1] * inv[i] % MOD\n\n\ndef COM(n, k):\n res = 1\n for i in range(k):\n res = res * (n - i) % MOD\n return res * finv[k] % MOD\n\n\ns = int(eval(input()))\nx = s // 3\nCOMinit()\nans = 0\nfor i in range(x):\n ans = (ans + COM(s - 2 * (i + 1) - 1, i)) % MOD\n\nprint(ans)\n","fast_code":"s = int(eval(input()))\na = b = 0\nc = int(s > 2)\nfor _ in range(s - 3):\n a, b, c = b, c, (a + c) % (10**9 + 7)\nprint(c)\n"} +{"fast_code_id":"1fcaa6d8159029177063631e6b35094aadb732bcf87238281e554e973b1a44c2","fast_id":"p03419_1fcaa6d8159029177063631e6b35094aadb732bcf87238281e554e973b1a44c2","language":"python","measured_fast_code_id":"1fcaa6d8159029177063631e6b35094aadb732bcf87238281e554e973b1a44c2","measured_slow_code_id":"03759bbd848f3c06ca221a2e3cc07d0592161ce2c92214006d02107382720a3e","measurement_metric":"cpu_instruction_count","pair_id":"python_33b76d622daafa6e6e0a326d","problem_id":"p03419","slow_code_id":"03759bbd848f3c06ca221a2e3cc07d0592161ce2c92214006d02107382720a3e","slow_id":"p03419_03759bbd848f3c06ca221a2e3cc07d0592161ce2c92214006d02107382720a3e","speedup":4.958710519474387,"stratum":"4-8","sampling_key":"658ed6f96fc167f669aa2c183312f31992569d9171a6a928048966dc17ed605d","slow_code":"def calc0(N, M):\n cell = [[0 for i in range(M)] for j in range(N)]\n for i in range(M):\n for j in range(N):\n for y in range(-1, 2):\n for x in range(-1, 2):\n xx = i + x\n yy = j + y\n if 0 <= xx < M and 0 <= yy < N:\n cell[yy][xx] ^= 1\n r = 0\n for i in range(M):\n for j in range(N):\n if cell[j][i]:\n r += 1\n return r\n\n\ndef calc(N, M):\n if N == 1 and M == 1:\n return 1\n if N >= 2 and M >= 2:\n return (N - 2) * (M - 2)\n if N == 1:\n return M - 2\n return N - 2\n\n\nN, M = [int(_) for _ in input().split()]\nprint((calc(N, M)))\n","fast_code":"n, m = [int(x) for x in input().split()]\nprint((abs(n - 2) * abs(m - 2)))\n"} +{"fast_code_id":"fa4e89df610f6b68dc0a1b671138724e22469c009af7af8893a340d0b7f8c7d7","fast_id":"p03291_fa4e89df610f6b68dc0a1b671138724e22469c009af7af8893a340d0b7f8c7d7","language":"python","measured_fast_code_id":"fa4e89df610f6b68dc0a1b671138724e22469c009af7af8893a340d0b7f8c7d7","measured_slow_code_id":"779114b7df427d693de3af90dfa08e7786175a435b3b9452dcde04bae557f05c","measurement_metric":"cpu_instruction_count","pair_id":"python_33b850f9761b95044a90842a","problem_id":"p03291","slow_code_id":"bc8b996b668505e4e304571caa360d13a1ae1d85a2eb813c7156a4cbeca12747","slow_id":"p03291_779114b7df427d693de3af90dfa08e7786175a435b3b9452dcde04bae557f05c","speedup":2.51009393101525,"stratum":"2-4","sampling_key":"4a832c47149d2da5ea6e7fb88e166bbd5b4cd7d2c9361349dc085cb467eac2a3","slow_code":"import sys\n\nreadline = sys.stdin.readline\nS = readline().rstrip()\nDIV = 10**9 + 7\ndp = [[0] * 4 for i in range(len(S) + 1)]\n\n\ndp[0][0] = 1\nfor i in range(len(S)):\n if S[i] == \"A\" or S[i] == \"?\":\n dp[i + 1][0] += dp[i][0]\n dp[i + 1][1] += dp[i][1]\n dp[i + 1][2] += dp[i][2]\n dp[i + 1][3] += dp[i][3]\n dp[i + 1][1] += dp[i][0]\n if S[i] == \"B\" or S[i] == \"?\":\n dp[i + 1][0] += dp[i][0]\n dp[i + 1][1] += dp[i][1]\n dp[i + 1][2] += dp[i][2]\n dp[i + 1][3] += dp[i][3]\n dp[i + 1][2] += dp[i][1]\n if S[i] == \"C\" or S[i] == \"?\":\n dp[i + 1][0] += dp[i][0]\n dp[i + 1][1] += dp[i][1]\n dp[i + 1][2] += dp[i][2]\n dp[i + 1][3] += dp[i][3]\n dp[i + 1][3] += dp[i][2]\n for j in range(4):\n dp[i + 1][j] %= DIV\n\nprint((dp[len(S)][3]))\n","fast_code":"S = input().strip()\nmod = 10**9 + 7\ndp = [1] + [0] * 3\nfor s in S:\n dp1 = dp[:]\n if s == \"A\":\n dp1[1] += dp[0]\n elif s == \"B\":\n dp1[2] += dp[1]\n elif s == \"C\":\n dp1[3] += dp[2]\n else:\n dp1[1] += dp[0]\n dp1[2] += dp[1]\n dp1[3] += dp[2]\n dp1[0] += 2 * dp[0]\n dp1[1] += 2 * dp[1]\n dp1[2] += 2 * dp[2]\n dp1[3] += 2 * dp[3]\n dp = [d % mod for d in dp1]\nprint((dp[-1]))\n"} +{"fast_code_id":"810f5a3a95db8b1e491bc2c02f2b6a12591e9eff6386bf0ebcf735463504df89","fast_id":"p02695_92881091f8074f20c8701ec39960ab6206e6deb404c33d9db940b597f3751332","language":"python","measured_fast_code_id":"92881091f8074f20c8701ec39960ab6206e6deb404c33d9db940b597f3751332","measured_slow_code_id":"4876c20eabffbc9ea2c633c2d996da20261178a9a9451926be7fe13405bb8582","measurement_metric":"cpu_instruction_count","pair_id":"python_33db402129ff3b39bd53406e","problem_id":"p02695","slow_code_id":"4876c20eabffbc9ea2c633c2d996da20261178a9a9451926be7fe13405bb8582","slow_id":"p02695_4876c20eabffbc9ea2c633c2d996da20261178a9a9451926be7fe13405bb8582","speedup":5.710327604154938,"stratum":"4-8","sampling_key":"0c34f8392f0a9c6c3543be92e4ea85ab66a0876e44ef2f0644da51eda93d7ff9","slow_code":"n, m, q = list(map(int, input().split()))\nl = []\nfor i in range(q):\n l1, l2, l3, l4 = list(map(int, input().split()))\n l.append([l1, l2, l3, l4])\nB = []\nfor a in range(1, m + 1):\n for b in range(a, m + 1):\n for c in range(b, m + 1):\n for d in range(c, m + 1):\n for e in range(d, m + 1):\n for f in range(e, m + 1):\n for g in range(f, m + 1):\n for h in range(g, m + 1):\n for i in range(h, m + 1):\n for j in range(i, m + 1):\n L = [a, b, c, d, e, f, g, h, i, j]\n A = []\n for I in range(n):\n A.append(L[I])\n C = 0\n for k in range(q):\n if (\n A[l[k][1] - 1] - A[l[k][0] - 1]\n == l[k][2]\n ):\n C += l[k][3]\n B.append(C)\nprint((max(B)))\n","fast_code":"N, M, Q = list(map(int, input().split()))\nabcd = []\nfor _ in range(Q):\n tmp = list(map(int, input().split()))\n abcd.append(tmp)\n\nimport itertools as it\n\nA_candidate = list(it.combinations_with_replacement(list(range(1, M + 1)), N))\nans = 0\nfor i in range(len(A_candidate)):\n tmp = 0\n for j in range(Q):\n ABCD = abcd[j]\n if A_candidate[i][ABCD[1] - 1] - A_candidate[i][ABCD[0] - 1] == ABCD[2]:\n tmp += ABCD[3]\n if ans < tmp:\n ans = tmp\nprint(ans)\n"} +{"fast_code_id":"66d145443a372a5a43407dc9cf71d71447bec89f203c9422197e66c8dd97343d","fast_id":"p02793_66d145443a372a5a43407dc9cf71d71447bec89f203c9422197e66c8dd97343d","language":"python","measured_fast_code_id":"66d145443a372a5a43407dc9cf71d71447bec89f203c9422197e66c8dd97343d","measured_slow_code_id":"6f8ccaaad47c82c2a507b64b1c4a22faf69b14d3f86470cd28dd50aae2dfa154","measurement_metric":"cpu_instruction_count","pair_id":"python_352d20f476060d1dd98eb3f5","problem_id":"p02793","slow_code_id":"ac86d1455d8341da4b55c8ff29601b7cda05971a29f7b8cb02115dfc602c8bdd","slow_id":"p02793_6f8ccaaad47c82c2a507b64b1c4a22faf69b14d3f86470cd28dd50aae2dfa154","speedup":7.039004586678128,"stratum":"4-8","sampling_key":"adc4b09c9a35e6ff60f01f3bdbac7b3f88485d41f2ecac9fbf304468988bfd46","slow_code":"from heapq import heappush, heappop, heapify\nfrom collections import deque, defaultdict, Counter\nimport itertools\nfrom itertools import permutations, combinations, groupby\nimport sys\nimport bisect\nimport string\nimport math\nimport time\nimport random\n\n\ndef S_():\n return input()\n\n\ndef LS():\n return [i for i in input().split()]\n\n\ndef I():\n return int(input())\n\n\ndef MI():\n return map(int, input().split())\n\n\ndef LI():\n return [int(i) for i in input().split()]\n\n\ndef LI_():\n return [int(i) - 1 for i in input().split()]\n\n\ndef NI(n):\n return [int(input()) for i in range(n)]\n\n\ndef NI_(n):\n return [int(input()) - 1 for i in range(n)]\n\n\ndef StoI():\n return [ord(i) - 97 for i in input()]\n\n\ndef ItoS(nn):\n return chr(nn + 97)\n\n\ndef LtoS(ls):\n return \"\".join([chr(i + 97) for i in ls])\n\n\ndef GI(V, E, Directed=False, index=0):\n org_inp = []\n g = [[] for i in range(n)]\n for i in range(E):\n inp = LI()\n org_inp.append(inp)\n if index == 0:\n inp[0] -= 1\n inp[1] -= 1\n if len(inp) == 2:\n a, b = inp\n g[a].append(b)\n if not Directed:\n g[b].append(a)\n elif len(inp) == 3:\n a, b, c = inp\n aa = (inp[0], inp[2])\n bb = (inp[1], inp[2])\n g[a].append(bb)\n if not Directed:\n g[b].append(aa)\n return g, org_inp\n\n\ndef bit_combination(k, n=2):\n rt = []\n for tb in range(n**k):\n s = [tb // (n**bt) % n for bt in range(k)]\n rt += [s]\n return rt\n\n\ndef show(*inp, end=\"\\n\"):\n if show_flg:\n print(*inp, end=end)\n\n\nYN = [\"Yes\", \"No\"]\nmo = 10**9 + 7\ninf = float(\"inf\")\nl_alp = string.ascii_lowercase\nu_alp = string.ascii_uppercase\nts = time.time()\nsys.setrecursionlimit(10**5)\ninput = lambda: sys.stdin.readline().rstrip()\n\n\ndef ran_input():\n import random\n\n n = random.randint(4, 16)\n rmin, rmax = 1, 10\n a = [random.randint(rmin, rmax) for _ in range(n)]\n return n, a\n\n\ndef primeFactor(N):\n i, n = 2, N\n ret = {}\n d, sq = 2, 99\n while i <= sq:\n k = 0\n while n % i == 0:\n n, k, ret[i] = n // i, k + 1, k + 1\n if k > 0 or i == 97:\n sq = int(n ** (1 / 2) + 0.5)\n if i < 4:\n i = i * 2 - 1\n else:\n i, d = i + d, d ^ 6\n if n > 1:\n ret[n] = 1\n return ret\n\n\ndef PrimeNumSet(\n N,\n):\n Max = int(N**0.5)\n seachList = [i for i in range(2, N + 1)]\n primeNum = []\n while seachList:\n if seachList[0] <= Max:\n break\n primeNum.append(seachList[0])\n tmp = seachList[0]\n seachList = [i for i in seachList if i % tmp != 0]\n primeNum.extend(seachList)\n return primeNum\n\n\ndef LCM(b, mo=10**9 + 7):\n prs = PrimeNumSet(max(b))\n M = dict(zip(prs, [0] * len(prs)))\n for i in b:\n dc = primeFactor(i)\n for j, k in dc.items():\n M[j] = max(M[j], k)\n r = 1\n for j, k in M.items():\n if k != 0:\n r *= pow(j, k, mo)\n r %= mo\n return r\n\n\nshow_flg = False\nshow_flg = True\nans = 0\nn = I()\na = LI()\nm = LCM(a)\nx = 0\nfor i in a:\n x += m * pow(i, mo - 2, mo)\n x %= mo\nprint(x)\n","fast_code":"class PrimeOptimizer:\n def __init__(self, MAX_NUM=10**3):\n is_prime = [True] * MAX_NUM\n is_prime[0] = False\n is_prime[1] = False\n primes = []\n for i in range(MAX_NUM):\n if is_prime[i]:\n primes.append(i)\n for j in range(2 * i, MAX_NUM, i):\n is_prime[j] = False\n self.primes = primes\n\n def prime_factorization(self, x):\n res = {}\n for prime in self.primes:\n while x % prime == 0:\n if not prime in res:\n res[prime] = 0\n res[prime] += 1\n x //= prime\n if x > 1:\n res[x] = 1\n return res\n\n\nMOD = 10**9 + 7\n\n\ndef mod_pow(p, q):\n res = 1\n while q:\n if q & 1:\n res = (res * p) % MOD\n p = (p * p) % MOD\n q //= 2\n return res\n\n\ndef mod_inv(p):\n return mod_pow(p, MOD - 2)\n\n\ndef solve(n, a):\n primeOpt = PrimeOptimizer()\n D = {}\n for i in range(n):\n prime_num_mapping = primeOpt.prime_factorization(a[i])\n for prime, num in list(prime_num_mapping.items()):\n if not prime in D:\n D[prime] = 0\n D[prime] = max(D[prime], num)\n L = 1\n for prime, num in list(D.items()):\n L = (L * mod_pow(prime, num)) % MOD\n res = sum([L * mod_inv(x) % MOD for x in a])\n return res % MOD\n\n\nN = int(eval(input()))\nA = list(map(int, input().split()))\nprint((solve(N, A)))\n"} +{"fast_code_id":"e017ce0a742d01e8892c0abe2d44772f6ec0cff2cca270665ae25ecd66f25668","fast_id":"p03972_e017ce0a742d01e8892c0abe2d44772f6ec0cff2cca270665ae25ecd66f25668","language":"python","measured_fast_code_id":"e017ce0a742d01e8892c0abe2d44772f6ec0cff2cca270665ae25ecd66f25668","measured_slow_code_id":"81be195cfe07dd89bca97eb211d66ec57b3cedb5d5441ba2264251fb7521b3ec","measurement_metric":"cpu_instruction_count","pair_id":"python_35c0cf7c6d4e77c09fb97be4","problem_id":"p03972","slow_code_id":"81be195cfe07dd89bca97eb211d66ec57b3cedb5d5441ba2264251fb7521b3ec","slow_id":"p03972_81be195cfe07dd89bca97eb211d66ec57b3cedb5d5441ba2264251fb7521b3ec","speedup":6.286455599533707,"stratum":"4-8","sampling_key":"0c00abe8d9fcfbdada30c60ffe22992d645c5a366d70a8baac8b0300c33883a9","slow_code":"import sys\n\ninput = sys.stdin.readline\nW, H = list(map(int, input().split()))\nP = [int(eval(input())) for _ in range(W)] + [float(\"inf\")]\nQ = [int(eval(input())) for _ in range(H)] + [float(\"inf\")]\nP.sort(reverse=True)\nQ.sort(reverse=True)\nans = 0\nW += 1\nH += 1\nwhile True:\n if W == H == 1:\n break\n elif Q[-1] < P[-1] or (Q[-1] == P[-1] and W <= H):\n ans += W * Q[-1]\n H -= 1\n Q.pop()\n elif Q[-1] > P[-1] or (Q[-1] == P[-1] and W > H):\n ans += H * P[-1]\n W -= 1\n P.pop()\nprint(ans)\n","fast_code":"w, h, *L = list(map(int, open(0).read().split()))\nP = L[:w]\nQ = [-qj for qj in L[w:]]\nx, y, ans = w, h, 0\nfor c in sorted(P + Q, key=abs):\n if c > 0:\n if x:\n ans += c * (y + 1)\n x -= 1\n else:\n if y:\n ans -= c * (x + 1)\n y -= 1\nprint(ans)\n"} +{"fast_code_id":"1cb7eebc330e970af0c7b9613f54ac6558d30fa689dd7f3442611e1c0b1e8cb8","fast_id":"p00741_ae17a2e83d68d5203e0ad48046f52d4408ba065dcbd218ec99faf7c2469b3087","language":"python","measured_fast_code_id":"ae17a2e83d68d5203e0ad48046f52d4408ba065dcbd218ec99faf7c2469b3087","measured_slow_code_id":"0735c1a312ae16acc97c209d4348af561ba3d9c718d6566dd5c307d9219cab61","measurement_metric":"cpu_instruction_count","pair_id":"python_36d8e473cfae36867b26ac1c","problem_id":"p00741","slow_code_id":"a10583df4146149ff2d8bb1bf5e10386b85381f734796329c7fab07cb9105b27","slow_id":"p00741_0735c1a312ae16acc97c209d4348af561ba3d9c718d6566dd5c307d9219cab61","speedup":2.9234133695721747,"stratum":"2-4","sampling_key":"0efe988e4cc44515cc5df65dd1a7aff55957485be1c32aa36c97f10b35f39e4f","slow_code":"import sys\nfrom pprint import pprint\n\n\nclass UnionFind:\n def __init__(self):\n self._parent = {}\n self._rank = {}\n self._equiv = {}\n\n def _find(self, x):\n if self._parent[x] == x:\n return self._parent[x]\n else:\n p = self._find(self._parent[x])\n self._parent[x] = p\n return p\n\n def _set_parent(self, child, parent):\n self._parent[child] = parent\n self._equiv[parent].update(self._equiv.pop(child))\n\n def _union(self, x, y):\n x = self._find(x)\n y = self._find(y)\n if x == y:\n return\n if self._rank[x] > self._rank[y]:\n self._set_parent(y, x)\n elif self._rank[x] < self._rank[y]:\n self._set_parent(x, y)\n else:\n self._set_parent(x, y)\n self._rank[x] += 1\n\n def _make_set(self, x):\n self._parent[x] = x\n self._rank[x] = 0\n self._equiv[x] = {x}\n\n def unite(self, *elements):\n if not elements:\n return\n for x in elements:\n if x in self._parent:\n continue\n self._make_set(x)\n x0 = elements[0]\n for x in elements[1:]:\n self._union(x0, x)\n\n def groups(self):\n return [set(e) for e in list(self._equiv.values())]\n\n\ndef pairs(ncol, nrow):\n\n for x in range(ncol - 1):\n for y in range(nrow):\n yield [(x, y), (x + 1, y)]\n\n for x in range(ncol):\n for y in range(nrow - 1):\n yield [(x, y), (x, y + 1)]\n\n for x in range(ncol - 1):\n for y in range(nrow - 1):\n yield [(x, y), (x + 1, y + 1)]\n\n for x in range(ncol - 1):\n for y in range(1, nrow):\n yield [(x, y), (x + 1, y - 1)]\n\n\ndef solve(ncol, nrow, rows):\n f = UnionFind()\n for x in range(ncol):\n for y in range(nrow):\n if rows[y][x]:\n f.unite((x, y))\n for (x1, y1), (x2, y2) in pairs(ncol, nrow):\n if rows[y1][x1] and rows[y2][x2]:\n f.unite((x1, y1), (x2, y2))\n return len(f.groups())\n\n\ndef main():\n while True:\n ncol, nrow = list(map(int, input().split()))\n if ncol == 0 and nrow == 0:\n break\n rows = []\n for _ in range(nrow):\n row = list(map(int, input().split()))\n rows.append(row)\n print((solve(ncol, nrow, rows)))\n\n\nmain()\n","fast_code":"import sys\n\n\ndef visit(x, y, area):\n area[y][x] = 0\n move = [(-1, 0), (0, 1), (1, 0), (0, -1), (1, -1), (1, 1), (-1, 1), (-1, -1)]\n\n for i in move:\n if (\n 0 <= (x + i[0]) < w\n and 0 <= (y + i[1]) < h\n and area[y + i[1]][x + i[0]] == 1\n ):\n visit(x + i[0], y + i[1], area)\n\n\ndef solve():\n area = []\n ans = 0\n for i in range(h):\n area.append(list(map(int, input().split())))\n\n for i in range(h):\n for j in range(w):\n if area[i][j] == 1:\n ans += 1\n visit(j, i, area)\n print(ans)\n\n\nif __name__ == \"__main__\":\n sys.setrecursionlimit(100000)\n while True:\n w, h = 0, 0\n w, h = list(map(int, input().split()))\n if w == 0 and h == 0:\n break\n solve()\n"} +{"fast_code_id":"b2844db904ae363c109faa98e43d593480cefef66631fa02bb4a3968abe932fb","fast_id":"p03371_b2844db904ae363c109faa98e43d593480cefef66631fa02bb4a3968abe932fb","language":"python","measured_fast_code_id":"b2844db904ae363c109faa98e43d593480cefef66631fa02bb4a3968abe932fb","measured_slow_code_id":"d423368c3404af0d794647ac92b41960ae5bb9ea8edef19ff71fb40275e2bb52","measurement_metric":"cpu_instruction_count","pair_id":"python_376d280458487abb32772045","problem_id":"p03371","slow_code_id":"d423368c3404af0d794647ac92b41960ae5bb9ea8edef19ff71fb40275e2bb52","slow_id":"p03371_d423368c3404af0d794647ac92b41960ae5bb9ea8edef19ff71fb40275e2bb52","speedup":14941.859372021483,"stratum":"8+","sampling_key":"0c4b05b95e3fb4a0a74bc22b230299ee52f1c966da6d74da99c4d893e6fee453","slow_code":"a, b, c, x, y = list(map(int, input().split()))\nmi = 10**10\nfor i in range(10**6):\n cost = c * 2 * i + a * max((x - i), 0) + b * max((y - i), 0)\n if cost < mi:\n mi = cost\nprint(mi)\n","fast_code":"A, B, C, X, Y = list(map(int, input().split()))\nres = min(A + B, 2 * C) * min(X, Y)\nif X >= Y:\n res += min(A, 2 * C) * (X - Y)\nelse:\n res += min(B, 2 * C) * (Y - X)\nprint(res)\n"} +{"fast_code_id":"b240597eddc90fc3b1c1a836a864a423cb9a000019e8b3849ff5349a39012a09","fast_id":"p03160_b240597eddc90fc3b1c1a836a864a423cb9a000019e8b3849ff5349a39012a09","language":"python","measured_fast_code_id":"b240597eddc90fc3b1c1a836a864a423cb9a000019e8b3849ff5349a39012a09","measured_slow_code_id":"934f379e0e5300fe0fee5440b2de9ab7f1cfdccbfbc9686e36dc49ab293c868e","measurement_metric":"cpu_instruction_count","pair_id":"python_37a0af81a9f41e25b32610fa","problem_id":"p03160","slow_code_id":"3c2eb6d041b194aca6e618ed722e1b9ae4cb2dfbc9ca12487589612e2e637390","slow_id":"p03160_934f379e0e5300fe0fee5440b2de9ab7f1cfdccbfbc9686e36dc49ab293c868e","speedup":52.57117358889363,"stratum":"8+","sampling_key":"064d9eb6c161b76bf10d92100d8586649f623260d4d63d1d1d393694b8dc104e","slow_code":"import numpy as np\n\nN = int(eval(input()))\nhs = [int(i) for i in input().split()]\ndp = np.zeros(N)\nfor i, h in enumerate(hs):\n if i == 0:\n\n dp[i] = 0\n continue\n elif i == 1:\n\n dp[i] = dp[i - 1] + abs(hs[i - 1] - h)\n else:\n\n dp[i] = min(dp[i - 1] + abs(hs[i - 1] - h), dp[i - 2] + abs(hs[i - 2] - h))\n\nprint((int(dp[-1])))\n","fast_code":"N = int(eval(input()))\n(*h,) = list(map(int, input().split()))\ndp = [0] * N\nfor i in range(1, N):\n if i == 1:\n dp[i] = dp[i - 1] + abs(h[i] - h[i - 1])\n else:\n dp[i] = min(dp[i - 1] + abs(h[i] - h[i - 1]), dp[i - 2] + abs(h[i] - h[i - 2]))\nprint((dp[-1]))\n"} +{"fast_code_id":"7d03ea3cff26a582d4bfa41a53deb601ed1d5e4a7af13784af3414b2ebae98bd","fast_id":"p03805_7d03ea3cff26a582d4bfa41a53deb601ed1d5e4a7af13784af3414b2ebae98bd","language":"python","measured_fast_code_id":"7d03ea3cff26a582d4bfa41a53deb601ed1d5e4a7af13784af3414b2ebae98bd","measured_slow_code_id":"aec618577de613b49399f305c62f469bf24b0adab44ea376399825fe0d466869","measurement_metric":"cpu_instruction_count","pair_id":"python_37b95a61cb5b6969952d2d78","problem_id":"p03805","slow_code_id":"aec618577de613b49399f305c62f469bf24b0adab44ea376399825fe0d466869","slow_id":"p03805_aec618577de613b49399f305c62f469bf24b0adab44ea376399825fe0d466869","speedup":5.1716854290501155,"stratum":"4-8","sampling_key":"18325dcacfc678ca194129aa0ba1a914cf9d985a205619ad37b9c54dd0b2765c","slow_code":"N, M = list(map(int, input().split()))\nimport copy\n\na = [0] * M\nb = [0] * M\nfor i in range(M):\n a[i], b[i] = list(map(int, input().split()))\nD = [[1]]\n\n\ndef route(D):\n E = []\n D1 = copy.deepcopy(D)\n for j in range(len(D)):\n x = D[j][-1]\n for i in range(M):\n if a[i] == x:\n if not b[i] in D1[j]:\n D[j] = copy.deepcopy(D1[j])\n D[j].append(b[i])\n E.append(D[j])\n elif b[i] == x:\n if not a[i] in D1[j]:\n D[j] = copy.deepcopy(D1[j])\n D[j].append(a[i])\n E.append(D[j])\n return E\n\n\nfor i in range(N - 1):\n D = copy.deepcopy(route(D))\nprint((len(D)))\n","fast_code":"def DFS(num):\n global ans, color\n color[num] = \"black\"\n if \"white\" not in color:\n ans += 1\n for i in M[num]:\n if color[i] == \"white\":\n DFS(i)\n color[num] = \"white\"\n\n\nn, m = list(map(int, input().split()))\nAB = [list(map(int, input().split())) for _ in range(m)]\nM = [[] for _ in range(n)]\ncolor = [\"white\" for _ in range(n)]\nfor a, b in AB:\n M[a - 1].append(b - 1)\n M[b - 1].append(a - 1)\nans = 0\nDFS(0)\nprint(ans)\n"} +{"fast_code_id":"a24d6d06ea1b1d838a4073c9a514d3d23581d374baa8701100619651eaf5fcdf","fast_id":"p03078_a24d6d06ea1b1d838a4073c9a514d3d23581d374baa8701100619651eaf5fcdf","language":"python","measured_fast_code_id":"a24d6d06ea1b1d838a4073c9a514d3d23581d374baa8701100619651eaf5fcdf","measured_slow_code_id":"959a123011776bcef7dfa5fdc004179fc6e327b256f40cf04167243f65953a7c","measurement_metric":"cpu_instruction_count","pair_id":"python_38110a58a4e4db17a4f69d00","problem_id":"p03078","slow_code_id":"959a123011776bcef7dfa5fdc004179fc6e327b256f40cf04167243f65953a7c","slow_id":"p03078_959a123011776bcef7dfa5fdc004179fc6e327b256f40cf04167243f65953a7c","speedup":6.1031593226546015,"stratum":"4-8","sampling_key":"1ac8bbc459ead09ea728c232c6bfbd8f40f8c6c9467395dac65753e82839d86f","slow_code":"x, y, z, k = list(map(int, input().split()))\na = [int(m) for m in input().split()]\nb = [int(m) for m in input().split()]\nc = [int(m) for m in input().split()]\na.sort(reverse=True)\nb.sort(reverse=True)\nc.sort(reverse=True)\ns = []\nfor i in range(x):\n for j in range(y):\n s.append(a[i] + b[j])\ns.sort(reverse=True)\ns1 = []\nfor i in range(min(x * y, k)):\n s1.append(s[i])\nt = []\nfor i in range(min(x * y, k)):\n for j in range(z):\n t.append(s1[i] + c[j])\nt.sort(reverse=True)\nfor i in range(k):\n print((t[i]))\n","fast_code":"X, Y, Z, K = map(int, input().split())\nA = list(map(int, input().split()))\nB = list(map(int, input().split()))\nC = list(map(int, input().split()))\nA.sort(reverse=True)\nB.sort(reverse=True)\nC.sort(reverse=True)\nans = []\nfor i in range(X):\n for j in range(Y):\n if (i + 1) * (j + 1) > K:\n break\n for k in range(Z):\n if (i + 1) * (j + 1) * (k + 1) <= K:\n ans.append(A[i] + B[j] + C[k])\n else:\n break\nprint(*sorted(ans, reverse=True)[:K], sep=\"\\n\")\n"} +{"fast_code_id":"b30dcfd2482065177b68635c7c880366f3eda18bfa6caea5554a460bc3933569","fast_id":"p02817_b30dcfd2482065177b68635c7c880366f3eda18bfa6caea5554a460bc3933569","language":"python","measured_fast_code_id":"b30dcfd2482065177b68635c7c880366f3eda18bfa6caea5554a460bc3933569","measured_slow_code_id":"d366b3197c2b1cc652bdfaecd153a16660977c2f3b6e7187f2d74bc9cc3d8847","measurement_metric":"cpu_instruction_count","pair_id":"python_389a1ef15a925f00fb009011","problem_id":"p02817","slow_code_id":"d366b3197c2b1cc652bdfaecd153a16660977c2f3b6e7187f2d74bc9cc3d8847","slow_id":"p02817_d366b3197c2b1cc652bdfaecd153a16660977c2f3b6e7187f2d74bc9cc3d8847","speedup":2.109397864688199,"stratum":"2-4","sampling_key":"296ec7d9039a6660d587bd0f394a260a8494a1314f26f293c2d649f207abbd23","slow_code":"import sys\n\nS, T = input().split()\nif not (S.islower() and T.islower()):\n sys.exit()\nif not (1 <= len(S) <= 100 and 1 <= len(S) <= 100):\n sys.exit()\nprint(T, end=\"\")\nprint(S)\n","fast_code":"b, c = list(map(str, input().split()))\nprint((c + b))\n"} +{"fast_code_id":"99938145e05c0376cad61014c8a3b1feb7f67f3925290a03f59f3deb571e152a","fast_id":"p03261_99938145e05c0376cad61014c8a3b1feb7f67f3925290a03f59f3deb571e152a","language":"python","measured_fast_code_id":"99938145e05c0376cad61014c8a3b1feb7f67f3925290a03f59f3deb571e152a","measured_slow_code_id":"b8edf8bfe255e97eaa522659a47a80fed76af05861a73db78ecf2fbd1a8cfe7e","measurement_metric":"cpu_instruction_count","pair_id":"python_3939c5d4197a717415e211a2","problem_id":"p03261","slow_code_id":"b8edf8bfe255e97eaa522659a47a80fed76af05861a73db78ecf2fbd1a8cfe7e","slow_id":"p03261_b8edf8bfe255e97eaa522659a47a80fed76af05861a73db78ecf2fbd1a8cfe7e","speedup":2.0434916376008183,"stratum":"2-4","sampling_key":"bbf20a1a9ee1d8c72004134693ffc3a1ccfd2806400eb07a03b6eb83b1018563","slow_code":"import sys\n\nstdin = sys.stdin\ninf = 1 << 60\nmod = 1000000007\nni = lambda: int(ns())\nnin = lambda y: [ni() for _ in range(y)]\nna = lambda: list(map(int, stdin.readline().split()))\nnan = lambda y: [na() for _ in range(y)]\nns = lambda: stdin.readline().rstrip()\nnsn = lambda y: [ns() for _ in range(y)]\nncl = lambda y: [list(ns()) for _ in range(y)]\nnas = lambda: stdin.readline().split()\nfrom collections import defaultdict\n\nN = ni()\nW = nsn(N)\nd = defaultdict(int)\nflag = True\nfor i in range(N):\n if i and W[i - 1][-1] != W[i][0]:\n flag = False\n if d[W[i]] >= 1:\n flag = False\n d[W[i]] += 1\nprint((\"Yes\" if flag else \"No\"))\n","fast_code":"N = int(input())\nw = [input() for _ in range(N)]\nbigram = [(w[i - 1], w[i]) for i in range(1, len(w))]\nvalid = len(set(w)) == len(w) and all(a[-1] == b[0] for a, b in bigram)\nprint(\"Yes\" if valid else \"No\")\n"} +{"fast_code_id":"fa77e9bd5adc46505a1238c5aca13d77243249b42e416b437a2ee915d04fc79a","fast_id":"p03371_fa77e9bd5adc46505a1238c5aca13d77243249b42e416b437a2ee915d04fc79a","language":"python","measured_fast_code_id":"fa77e9bd5adc46505a1238c5aca13d77243249b42e416b437a2ee915d04fc79a","measured_slow_code_id":"d423368c3404af0d794647ac92b41960ae5bb9ea8edef19ff71fb40275e2bb52","measurement_metric":"cpu_instruction_count","pair_id":"python_39a420527777003acfc00b3d","problem_id":"p03371","slow_code_id":"d423368c3404af0d794647ac92b41960ae5bb9ea8edef19ff71fb40275e2bb52","slow_id":"p03371_d423368c3404af0d794647ac92b41960ae5bb9ea8edef19ff71fb40275e2bb52","speedup":11562.75978300799,"stratum":"8+","sampling_key":"81c6ff96b0ecd61f3803725d4051a50c6403882f737973ded740cf888f85f821","slow_code":"a, b, c, x, y = list(map(int, input().split()))\nmi = 10**10\nfor i in range(10**6):\n cost = c * 2 * i + a * max((x - i), 0) + b * max((y - i), 0)\n if cost < mi:\n mi = cost\nprint(mi)\n","fast_code":"a, b, c, x, y = list(map(int, input().split()))\nif a + b <= 2 * c:\n print((a * x + b * y))\nelif a + b > 2 * c:\n if x == y:\n print((c * 2 * x))\n elif x < y:\n print((min(c * 2 * x + b * (y - x), c * 2 * y)))\n else:\n print((min(c * 2 * y + a * (x - y), c * 2 * x)))\n"} +{"fast_code_id":"6a673be8c03527e4a1ed9a0f8efb9ff36f0452259cbf4007bf34e814444acb12","fast_id":"p02845_539c1c8885a18af708a52f7f76914910c17b99bc6395ef1790e97f0db2c5899c","language":"python","measured_fast_code_id":"539c1c8885a18af708a52f7f76914910c17b99bc6395ef1790e97f0db2c5899c","measured_slow_code_id":"44f76311477519e453c1541c8cee2cad565caf5c7e854c8feade8f7c7a67fffd","measurement_metric":"cpu_instruction_count","pair_id":"python_39ae16a2a262057b1c91c05e","problem_id":"p02845","slow_code_id":"44f76311477519e453c1541c8cee2cad565caf5c7e854c8feade8f7c7a67fffd","slow_id":"p02845_44f76311477519e453c1541c8cee2cad565caf5c7e854c8feade8f7c7a67fffd","speedup":10.201011112451203,"stratum":"8+","sampling_key":"94eb5894d073565481077c1372589c6337962eb46f4daa76a42da9485220b04d","slow_code":"_, a = open(0)\nc = 1\nd = [3] + [0] * 10**6\nfor a in map(int, a.split()):\n c = c * d[a] % (10**9 + 7)\n d[a] -= 1\n d[a + 1] += 1\nprint(c)\n","fast_code":"import sys\n\ninput = sys.stdin.readline\n\n\ndef INT():\n return int(eval(input()))\n\n\ndef MAP():\n return list(map(int, input().split()))\n\n\ndef LI():\n return list(map(int, input().split()))\n\n\ndef main():\n N = INT()\n A = LI()\n RGB = [0, 0, 0]\n answer = 1\n MOD = 10**9 + 7\n for i in range(N):\n if RGB.count(A[i]) == 0:\n print((0))\n return\n answer *= RGB.count(A[i])\n answer %= MOD\n for j in range(3):\n if RGB[j] == A[i]:\n RGB[j] += 1\n break\n print(answer)\n return\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"9ccc4f84b612a449d06d33c245092ec7a2bd3fa56cb11b5d55ba1d885d147ef6","fast_id":"p03013_9ccc4f84b612a449d06d33c245092ec7a2bd3fa56cb11b5d55ba1d885d147ef6","language":"python","measured_fast_code_id":"9ccc4f84b612a449d06d33c245092ec7a2bd3fa56cb11b5d55ba1d885d147ef6","measured_slow_code_id":"c749817b5904b891039b2b5e1b3da9cd0148137970d974b7121be27928f9e942","measurement_metric":"cpu_instruction_count","pair_id":"python_3a1830b6e44a0a09789f4dd6","problem_id":"p03013","slow_code_id":"bb7f7d9a15a94f857cd828da8e4b3080a790d7fc7d0b53571905f5757d0710a6","slow_id":"p03013_c749817b5904b891039b2b5e1b3da9cd0148137970d974b7121be27928f9e942","speedup":35.06676226535057,"stratum":"8+","sampling_key":"be33f51b227161bb0056863a8517344fca832495e45463ae5938bcf3b53d26bc","slow_code":"import sys\n\ninput = sys.stdin.readline\n\n\ndef I():\n return int(eval(input()))\n\n\ndef MI():\n return list(map(int, input().split()))\n\n\ndef LI():\n return list(map(int, input().split()))\n\n\ndef main():\n mod = 10**9 + 7\n N, M = MI()\n dp = [0] * (N + 1)\n dp[0] = 1\n a = [0] * M\n for i in range(M):\n a[i] = I()\n a.append(10**6)\n cur = 0\n for i in range(1, N + 1):\n if i == a[cur]:\n cur += 1\n else:\n dp[i] = (dp[i - 1] + dp[i - 2]) % mod\n print((dp[-1]))\n\n\nmain()\n","fast_code":"import sys\n\nINPUT = sys.stdin.readline\nMOD = 10**9 + 7\n\n\ndef SINGLE_INT():\n return int(INPUT())\n\n\ndef MULTIPLE_INT_LIST():\n return list(map(int, INPUT().split()))\n\n\ndef MULTIPLE_INT_MAP():\n return list(map(int, INPUT().split()))\n\n\ndef SINGLE_STRING():\n return INPUT()\n\n\ndef MULTIPLE_STRING():\n return INPUT().split()\n\n\ndef solve(n, m):\n floors = [0] * (n + 1)\n floors[0] = 1\n floors[1] = 1\n last, current = 0, 0\n for i in range(m):\n if i == 0:\n current = SINGLE_INT()\n floors[current] = -1\n else:\n last = current\n current = SINGLE_INT()\n floors[current] = -1\n if current == last + 1:\n return 0\n for i in range(2, n + 1):\n if floors[i] == -1:\n continue\n else:\n if floors[i - 2] > 0:\n floors[i] += floors[i - 2]\n if floors[i - 1] > 0:\n floors[i] += floors[i - 1]\n floors[i] %= MOD\n return floors[-1]\n\n\nN, M = MULTIPLE_INT_MAP()\nif N == 1:\n print((1))\nelif N > 1:\n print((solve(N, M)))\n"} +{"fast_code_id":"d4905e9b61671370e5e84353722edf6439791a5a316b6df8cc32ad8ec3d7785e","fast_id":"p03282_d4905e9b61671370e5e84353722edf6439791a5a316b6df8cc32ad8ec3d7785e","language":"python","measured_fast_code_id":"d4905e9b61671370e5e84353722edf6439791a5a316b6df8cc32ad8ec3d7785e","measured_slow_code_id":"c6afbfabb4f57c620b796822aa793c63e616de41f9eb4e63aa7e8f88e45d1110","measurement_metric":"cpu_instruction_count","pair_id":"python_3a620c2186767f7b36b1df05","problem_id":"p03282","slow_code_id":"c6afbfabb4f57c620b796822aa793c63e616de41f9eb4e63aa7e8f88e45d1110","slow_id":"p03282_c6afbfabb4f57c620b796822aa793c63e616de41f9eb4e63aa7e8f88e45d1110","speedup":2184.8784467954997,"stratum":"8+","sampling_key":"01fee08d7d4c600229b743f6c6e2921c4235a2234b29ec31a7aa5e899783c037","slow_code":"import numpy as np\n\nS = np.array(list(map(str, input().rstrip())))\nK = int(eval(input()))\ncnt = 0\nans = 1\nfor i, s in enumerate(S):\n if s != \"1\":\n cnt = i + 1\n ans = s\n break\nif cnt > K:\n print((1))\nelse:\n print((int(ans)))\n","fast_code":"print((input()[: int(eval(input()))].replace(\"1\", \"\")[:1] or \"1\"))\n"} +{"fast_code_id":"5dec41285404604d3590b4966e7909e3d13eca3db7182114d873bfa49928727d","fast_id":"p04015_5dec41285404604d3590b4966e7909e3d13eca3db7182114d873bfa49928727d","language":"python","measured_fast_code_id":"5dec41285404604d3590b4966e7909e3d13eca3db7182114d873bfa49928727d","measured_slow_code_id":"8b45717994a5fb48dc2b76199b10d5e4e202c9ce5463bf7869f8add9172f6ff7","measurement_metric":"cpu_instruction_count","pair_id":"python_3a750ccb74ca85ec3246c982","problem_id":"p04015","slow_code_id":"22f4d78fa24186375c05f8fb9209c535a507fc44a1c54caed7cae5ab1b3bfa98","slow_id":"p04015_8b45717994a5fb48dc2b76199b10d5e4e202c9ce5463bf7869f8add9172f6ff7","speedup":495.69805994931215,"stratum":"8+","sampling_key":"0c52b27304490518bebadd28c779cb6d16f165ab9b4408aee2bdf12f78336669","slow_code":"from collections import defaultdict, deque, Counter, OrderedDict\nfrom bisect import bisect_left, bisect_right\nfrom functools import reduce, lru_cache\nfrom heapq import heappush, heappop, heapify\nimport itertools\nimport math, fractions\nimport sys, copy\n\n\ndef L():\n return sys.stdin.readline().split()\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\ndef SL():\n return list(sys.stdin.readline().rstrip())\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef LI1():\n return [int(x) - 1 for x in sys.stdin.readline().split()]\n\n\ndef LS():\n return [list(x) for x in sys.stdin.readline().split()]\n\n\ndef R(n):\n return [sys.stdin.readline().strip() for _ in range(n)]\n\n\ndef LR(n):\n return [L() for _ in range(n)]\n\n\ndef IR(n):\n return [I() for _ in range(n)]\n\n\ndef LIR(n):\n return [LI() for _ in range(n)]\n\n\ndef LIR1(n):\n return [LI1() for _ in range(n)]\n\n\ndef SLR(n):\n return [SL() for _ in range(n)]\n\n\ndef LSR(n):\n return [LS() for _ in range(n)]\n\n\ndef perm(n, r):\n return math.factorial(n) // math.factorial(r)\n\n\ndef comb(n, r):\n return math.factorial(n) // (math.factorial(r) * math.factorial(n - r))\n\n\ndef make_list(n, *args, default=0):\n return (\n [make_list(*args, default=default) for _ in range(n)]\n if args\n else [default for _ in range(n)]\n )\n\n\ndire = [[1, 0], [0, 1], [-1, 0], [0, -1]]\ndire8 = [[1, 0], [1, 1], [0, 1], [-1, 1], [-1, 0], [-1, -1], [0, -1], [1, -1]]\nalphabets = \"abcdefghijklmnopqrstuvwxyz\"\nALPHABETS = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\nMOD = 1000000007\nINF = float(\"inf\")\nsys.setrecursionlimit(1000000)\n\n\ndef main():\n N, A = LI()\n X = LI()\n dp = make_list(N + 1, N + 1, 2501)\n dp[0][0][0] = 1\n for i in range(1, N + 1):\n for k in range(i + 1):\n for s in range(2501):\n if X[i - 1] > s:\n dp[i][k][s] = dp[i - 1][k][s]\n else:\n dp[i][k][s] = dp[i - 1][k][s] + dp[i - 1][k - 1][s - X[i - 1]]\n print((sum(dp[N][k][k * A] for k in range(1, N + 1))))\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"N, A = list(map(int, input().split()))\nX = [int(x) - A for x in input().split()]\nd = {0: 1}\nfor x in X:\n d_tmp = d.copy()\n for k in d_tmp:\n d[k + x] = d.get(k + x, 0) + d_tmp[k]\nprint((d[0] - 1))\n"} +{"fast_code_id":"73f81bfe3cb241240b7ea9c5a7ec2fd84bd8cb3a3a87d58f323808d83634787e","fast_id":"p02641_73f81bfe3cb241240b7ea9c5a7ec2fd84bd8cb3a3a87d58f323808d83634787e","language":"python","measured_fast_code_id":"73f81bfe3cb241240b7ea9c5a7ec2fd84bd8cb3a3a87d58f323808d83634787e","measured_slow_code_id":"56a803f01b0149391407a67301955076fc165a7ad3ad3f8f8a9f51ab5d8af60e","measurement_metric":"cpu_instruction_count","pair_id":"python_3aa54dee91a5930298851651","problem_id":"p02641","slow_code_id":"85cbb5049fb6ba315c1cc49d08aa7371cf037161b52bac8a421580f3486b7f72","slow_id":"p02641_56a803f01b0149391407a67301955076fc165a7ad3ad3f8f8a9f51ab5d8af60e","speedup":2.048270642276373,"stratum":"2-4","sampling_key":"bde346543461ff79594ce812a3f6aedbf96af615040ba75d670b181dbfbac744","slow_code":"x, n = list(map(int, input().split()))\nif n == 0:\n print(x)\n exit()\narr = list(map(int, input().split()))\narr2 = []\narr3 = []\nfor i in range(-50, 110):\n if not i in arr:\n arr2.append(i)\n arr3.append(abs(x - i))\nn2 = min([i for i, v in enumerate(arr3) if v == min(arr3)])\nprint((arr2[n2]))\n","fast_code":"X, N = list(map(int, input().split(\" \")))\nif N == 0:\n print(X)\nelse:\n ls = list(map(int, input().split(\" \")))\n diff, rst = -1, 0\n for i in range(101, -1, -1):\n if i not in ls:\n if diff == -1:\n diff = abs(X - i)\n rst = i\n else:\n diff = min(diff, abs(X - i))\n if diff == abs(X - i):\n rst = i\n print(rst)\n"} +{"fast_code_id":"a7875cc783abeff162489a124094f3312ace44ca124fe66b185816140973f5cc","fast_id":"p02780_a7875cc783abeff162489a124094f3312ace44ca124fe66b185816140973f5cc","language":"python","measured_fast_code_id":"a7875cc783abeff162489a124094f3312ace44ca124fe66b185816140973f5cc","measured_slow_code_id":"f0e0a2a27a21da5cf3bfa118c0651e9d7851f3f79494b7c4374dbb95d552c6f4","measurement_metric":"cpu_instruction_count","pair_id":"python_3adff1e1e5b66fc65c81524d","problem_id":"p02780","slow_code_id":"f0e0a2a27a21da5cf3bfa118c0651e9d7851f3f79494b7c4374dbb95d552c6f4","slow_id":"p02780_f0e0a2a27a21da5cf3bfa118c0651e9d7851f3f79494b7c4374dbb95d552c6f4","speedup":4.397955269788454,"stratum":"4-8","sampling_key":"da3ab40400da569ed675daa71ff1c48e9a3e0bc775ae1b62d542fe388fcce692","slow_code":"class BIT:\n def __init__(self, n):\n self.node = [0 for _ in range(n + 1)]\n\n def add(self, idx, w):\n i = idx\n while i < len(self.node) - 1:\n self.node[i] += w\n i |= i + 1\n\n def sum_(self, idx):\n ret, i = 0, idx - 1\n while i >= 0:\n ret += self.node[i]\n i = (i & (i + 1)) - 1\n return ret\n\n def sum(self, l, r):\n return self.sum_(r) - self.sum_(l)\n\n\nn, k = list(map(int, input().split()))\ntree = BIT(n)\np = [int(x) for x in input().split()]\nfor i in range(n):\n tree.add(i, (1 + p[i]) / 2)\nans = 0\nfor i in range(n - k + 1):\n ans = max(ans, tree.sum(i, i + k))\nprint(ans)\n","fast_code":"n, k = list(map(int, input().split()))\np = list(map(int, input().split()))\nmax_sum_k = 0\ncum_sum = [0] * (n + 1)\ncum_sum[0] = 0\ncum_sum[1] = p[0]\nfor i in range(2, n + 1):\n cum_sum[i] = p[i - 1] + cum_sum[i - 1]\nfor i in range(k, n + 1):\n sum_p = cum_sum[i] - cum_sum[i - k]\n if sum_p > max_sum_k:\n max_sum_k = sum_p\nmax_ex = (k + max_sum_k) / 2\nprint(max_ex)\n"} +{"fast_code_id":"695e872e2723e61c1a46c4f7eb38df5eecce5419f2f80fc17142c3a3a95f31b3","fast_id":"p02883_695e872e2723e61c1a46c4f7eb38df5eecce5419f2f80fc17142c3a3a95f31b3","language":"python","measured_fast_code_id":"695e872e2723e61c1a46c4f7eb38df5eecce5419f2f80fc17142c3a3a95f31b3","measured_slow_code_id":"89d6694c33292de91a1011c40ba1f43b8a55e43ab7d13d625a0ff741f7a3effc","measurement_metric":"cpu_instruction_count","pair_id":"python_3af57281fc7333a6a078fc56","problem_id":"p02883","slow_code_id":"89d6694c33292de91a1011c40ba1f43b8a55e43ab7d13d625a0ff741f7a3effc","slow_id":"p02883_89d6694c33292de91a1011c40ba1f43b8a55e43ab7d13d625a0ff741f7a3effc","speedup":4.0616419374680595,"stratum":"4-8","sampling_key":"ec9f931c6eae197774bae94dbae8bc71e8ccd84daedcba7d25c19f1aa5bc70f0","slow_code":"import math\n\nN, K = list(map(int, input().split()))\nX = [\n (b, a * b)\n for a, b in zip(\n sorted(list(map(int, input().split()))),\n sorted(list(map(int, input().split())))[::-1],\n )\n]\nm, M, i = 0, 10**12, 1\nexec(\n \"i,M,m=((i+m)//2,i,m) if sum(math.ceil(max(0,c-i)/b)for b, c in X)<=K else((i+M)//2,M,i);\"\n * 50\n)\nprint(M)\n","fast_code":"import math\n\n(n, k), a, f = [list(map(int, s.split())) for s in open(0)]\na.sort()\nf.sort(reverse=True)\nlow = 0\nhigh = 0\nfor x, y in zip(a, f):\n high = max(high, x * y)\nwhile high != low:\n test = int((high + low) // 2)\n tmp = 0\n for x, y in zip(a, f):\n tmp += max(0, x - math.floor(test / y))\n if tmp > k:\n low = test + 1\n break\n else:\n high = test\nprint(high)\n"} +{"fast_code_id":"7b08c1fc8b1fd5133260c08b0fffc2b39e9d584ee42aeb17a8af04d879ff4fdf","fast_id":"p02603_f9dd3a5741f0ff56af92eaec9086e8c584b7108b701aa484054ae549dc542e8b","language":"python","measured_fast_code_id":"f9dd3a5741f0ff56af92eaec9086e8c584b7108b701aa484054ae549dc542e8b","measured_slow_code_id":"25faafb2b0ca16cedbeb669295357df971e7c7a40120b3549a7cc9eefa9e9f0e","measurement_metric":"cpu_instruction_count","pair_id":"python_3b658f4978dd58754cc8466c","problem_id":"p02603","slow_code_id":"25faafb2b0ca16cedbeb669295357df971e7c7a40120b3549a7cc9eefa9e9f0e","slow_id":"p02603_25faafb2b0ca16cedbeb669295357df971e7c7a40120b3549a7cc9eefa9e9f0e","speedup":3.8742265405378413,"stratum":"2-4","sampling_key":"dd15b9a2d3649a6a5523c3b1859e3927e6a99d697304b917be01ca4453e1a8c1","slow_code":"N = int(eval(input()))\nA = [0] + list(map(int, input().split()))\ndp = [0] * (N + 1)\ndp[1] = 1000\nfor i in range(2, N + 1):\n dp[i] = dp[i - 1]\n for j in range(1, i):\n stock = dp[j] // A[j]\n momey = dp[j] + (A[i] - A[j]) * stock\n dp[i] = max(dp[i], momey)\nprint((dp[N]))\n","fast_code":"N = int(eval(input()))\nX = list(map(int, input().split()))\ncur = 1000\nfor i in range(N - 1):\n if X[i] < X[i + 1]:\n stocks = cur // X[i]\n else:\n stocks = 0\n cur += (X[i + 1] - X[i]) * stocks\n\nprint(cur)\n"} +{"fast_code_id":"f7be85d24423d522fe62abe62d1a5060a35b3a15b17a790afb47e02241fe8646","fast_id":"p03837_6fe3db18b8af9058f75e32d8abebbced43e21773b091306be0fe2371744129bb","language":"python","measured_fast_code_id":"6fe3db18b8af9058f75e32d8abebbced43e21773b091306be0fe2371744129bb","measured_slow_code_id":"209b9c18911f3e22511f894d3ac580ce973fcd32b4b34dced8609607272528f4","measurement_metric":"cpu_instruction_count","pair_id":"python_3bb0344d5791704c930d30dd","problem_id":"p03837","slow_code_id":"209b9c18911f3e22511f894d3ac580ce973fcd32b4b34dced8609607272528f4","slow_id":"p03837_209b9c18911f3e22511f894d3ac580ce973fcd32b4b34dced8609607272528f4","speedup":4.9414299018158925,"stratum":"4-8","sampling_key":"25ef71149527611084b9ea40ed8bd03d48f234491185a8d4335b140f38bc2280","slow_code":"INF = 10**18\nN, M = list(map(int, input().split()))\nedge = [list(map(int, input().split())) for _ in range(M)]\ngraph = [[INF for j in range(N)] for i in range(N)]\nfor i in range(N):\n graph[i][i] = 0\nfor e in edge:\n graph[e[0] - 1][e[1] - 1] = e[2]\n graph[e[1] - 1][e[0] - 1] = e[2]\nfor k in range(N):\n for i in range(N):\n for j in range(N):\n if graph[i][k] != INF and graph[k][j] != INF:\n graph[i][j] = min(graph[i][j], graph[i][k] + graph[k][j])\nans = 0\nfor e in edge:\n if graph[e[0] - 1][e[1] - 1] != e[2]:\n ans += 1\nprint(ans)\n","fast_code":"import sys\n\nstdin = sys.stdin\nsys.setrecursionlimit(10**5)\n\n\ndef li():\n return list(map(int, stdin.readline().split()))\n\n\ndef li_():\n return [int(x) - 1 for x in stdin.readline().split()]\n\n\ndef lf():\n return list(map(float, stdin.readline().split()))\n\n\ndef ls():\n return stdin.readline().split()\n\n\ndef ns():\n return stdin.readline().rstrip()\n\n\ndef lc():\n return list(ns())\n\n\ndef ni():\n return int(stdin.readline())\n\n\ndef nf():\n return float(stdin.readline())\n\n\nfrom heapq import heappush, heappop\n\n\ndef dijkstra(graph: list, node: int, start: int) -> list:\n\n INF = float(\"inf\")\n dist = [INF] * node\n\n dist[start] = 0\n heap = [(0, start)]\n\n while heap:\n cost, cur_node = heappop(heap)\n for nex_cost, nex_node in graph[cur_node]:\n dist_cand = dist[cur_node] + nex_cost\n if dist_cand < dist[nex_node]:\n dist[nex_node] = dist_cand\n heappush(heap, (dist[nex_node], nex_node))\n return dist\n\n\nn, m = li()\nedges = []\ngraph = [[] for _ in range(n)]\nadj_mat = [[0] * n for _ in range(n)]\nfor _ in range(m):\n a, b, c = li()\n a -= 1\n b -= 1\n graph[a].append((c, b))\n graph[b].append((c, a))\n edges.append((a, b, c))\n\nfor i in range(n):\n adj_mat[i] = dijkstra(graph, n, i)\n\nans = 0\nfor ai, bi, ci in edges:\n if adj_mat[ai][bi] < ci:\n ans += 1\nprint(ans)\n"} +{"fast_code_id":"9fd6da3eb9e2281266cffafff50ecb984024f022848448dd2a693028f6ce010c","fast_id":"p03331_3a843193d8bdb990eccd8eb9b944899aae21a8331eb28561f355b4ac40a65de0","language":"python","measured_fast_code_id":"3a843193d8bdb990eccd8eb9b944899aae21a8331eb28561f355b4ac40a65de0","measured_slow_code_id":"153ddd3939958df9731f2cb6a9569dfdd13dde4cae47410105d9d1d355dcbd24","measurement_metric":"cpu_instruction_count","pair_id":"python_3bebc6ffa99554bb01dfd3de","problem_id":"p03331","slow_code_id":"153ddd3939958df9731f2cb6a9569dfdd13dde4cae47410105d9d1d355dcbd24","slow_id":"p03331_153ddd3939958df9731f2cb6a9569dfdd13dde4cae47410105d9d1d355dcbd24","speedup":1951.8469456182982,"stratum":"8+","sampling_key":"27fc3d04da1e1c788eb986a271d9bae56f042e0db866fd18577e1cfa13a5e433","slow_code":"N = int(eval(input()))\nimport numpy as np\n\na = np.arange(N)\na = np.delete(a, 0)\nb = N - a\nnum_arr = []\nfor i in range(len(a)):\n factor_a = [int(x) for x in list(str(a[i]))]\n factor_b = [int(x) for x in list(str(b[i]))]\n num_arr.append(sum(factor_a) + sum(factor_b))\nprint((min(num_arr)))\n","fast_code":"import sys\n\n\ndef II():\n return int(sys.stdin.readline())\n\n\ndef MI():\n return list(map(int, sys.stdin.readline().split()))\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\ndef LLI(rows_number):\n return [LI() for _ in range(rows_number)]\n\n\ndef solver(inputNum):\n result = 0\n\n totalDigit = 0\n inputStr = str(inputNum)\n for j in range(0, len(inputStr)):\n totalDigit = totalDigit + int(inputStr[j])\n if totalDigit == 1:\n result = 10\n else:\n result = totalDigit\n return result\n\n\nif __name__ == \"__main__\":\n print((\"{}\".format(solver(II()))))\n"} +{"fast_code_id":"d4bfacd7048ccdfc66b383573f450cbdb0fee4f058a5173f25de8ffc19a3a2f7","fast_id":"p02890_d958a5389d02ce6d4c9289086102f28ac6d39bce99aea035f13eab42153c83ec","language":"python","measured_fast_code_id":"d958a5389d02ce6d4c9289086102f28ac6d39bce99aea035f13eab42153c83ec","measured_slow_code_id":"683b16708a4919fe826584e325a20783d2265d979233683a19a27263211ea906","measurement_metric":"cpu_instruction_count","pair_id":"python_3c1ed882f2552985e726e24e","problem_id":"p02890","slow_code_id":"2c57f5c3d6e04ae779c203c63a7a33316889e85db23460b3b699e27933e99fbd","slow_id":"p02890_683b16708a4919fe826584e325a20783d2265d979233683a19a27263211ea906","speedup":3.383595702801351,"stratum":"2-4","sampling_key":"7d8a043dea2126990a93c382ee318458928e6004f4950df0ba92d49f074e6245","slow_code":"import sys\nimport math\nfrom bisect import bisect_right as br\nfrom bisect import bisect_left as bl\n\nsys.setrecursionlimit(2147483647)\nfrom heapq import heappush, heappop, heappushpop\nfrom collections import defaultdict\nfrom itertools import accumulate\nfrom collections import Counter\nfrom collections import deque\nfrom operator import itemgetter\nfrom itertools import permutations\n\nmod = 10**9 + 7\ninf = float(\"inf\")\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\nn = I()\na = LI()\ncnt = list(Counter(a).values())\ncnt.sort()\nm = len(cnt)\nS = [0] * (n + 1)\nfor x in range(1, n + 1):\n l = bl(cnt, x)\n S[x] = S[x - 1] + (m - l)\nfor k in range(1, n + 1):\n high, low = n + 1, 0\n while high - low > 1:\n mid = (high + low) // 2\n if S[mid] >= k * mid:\n low = mid\n else:\n high = mid\n print(low)\n","fast_code":"import sys\nimport math\nfrom bisect import bisect_right as br\nfrom bisect import bisect_left as bl\n\nsys.setrecursionlimit(2147483647)\nfrom heapq import heappush, heappop, heappushpop\nfrom collections import defaultdict\nfrom itertools import accumulate\nfrom collections import Counter\nfrom collections import deque\nfrom operator import itemgetter\nfrom itertools import permutations\n\nmod = 10**9 + 7\ninf = float(\"inf\")\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\nn = I()\na = LI()\ncnt = list(Counter(a).values())\nd = [0] * (n + 1)\nfor i in cnt:\n d[i] += 1\nd = list(accumulate(d))\nm = d[-1]\nS = [0] * (n + 1)\nfor i in range(1, n + 1):\n S[i] = S[i - 1] + (m - d[i - 1])\nS2 = [0] * (n + 1)\nfor i in range(1, n + 1):\n S2[i] = S[i] // i\ntmp = n\nfor k in range(1, n + 1):\n while S2[tmp] < k:\n tmp -= 1\n if tmp <= 0:\n print((0))\n break\n else:\n print(tmp)\n"} +{"fast_code_id":"21072253f4c4bf0ce7d478d960cebff18fbf5819c7b03ef62bf4b28c8525f610","fast_id":"p03775_21072253f4c4bf0ce7d478d960cebff18fbf5819c7b03ef62bf4b28c8525f610","language":"python","measured_fast_code_id":"21072253f4c4bf0ce7d478d960cebff18fbf5819c7b03ef62bf4b28c8525f610","measured_slow_code_id":"7ab001f5efb675596da434bf3ef9e7fa9f9ec3b0d345cb8726f7720241f1422c","measurement_metric":"cpu_instruction_count","pair_id":"python_3c41b596ddb5ff87cae1be1f","problem_id":"p03775","slow_code_id":"0bd50a29ee4b8ed24f88df4bdfcabb76a7a6778570de4e74b5c8ddab42febd8f","slow_id":"p03775_7ab001f5efb675596da434bf3ef9e7fa9f9ec3b0d345cb8726f7720241f1422c","speedup":193.96678015560664,"stratum":"8+","sampling_key":"62f5f30bf82a240c1177e885cb4fb54a838c149be6611ddda338f4554077db0a","slow_code":"n = int(eval(input()))\n\n\ndef cal(a):\n return len(str(a))\n\n\nm = 11\nfor j in range(1, 10**6 + 1):\n if n % j == 0:\n m = min(m, max(cal(j), cal(n // j)))\n\nprint(m)\n","fast_code":"import math\nimport sys\n\nn = int(eval(input()))\nmi = int(math.log10(n))\nnb = n\nm = 1\nfor i in range(1, int(nb**0.5) + 2):\n if n % i == 0:\n mi = min(mi, max(int(math.log10(n / i)), int(math.log10(i))))\nprint((mi + 1))\n"} +{"fast_code_id":"81f055c5e4fb1ed8650598806dc37db4c6c26cc7a009dbc796162065540cf8cd","fast_id":"p03296_81f055c5e4fb1ed8650598806dc37db4c6c26cc7a009dbc796162065540cf8cd","language":"python","measured_fast_code_id":"81f055c5e4fb1ed8650598806dc37db4c6c26cc7a009dbc796162065540cf8cd","measured_slow_code_id":"a260e38fd68198bd3b846ed815f9f7842be8a43a1a00830ef94d4cac2df063d2","measurement_metric":"cpu_instruction_count","pair_id":"python_3c525262b6fa5c76ba628871","problem_id":"p03296","slow_code_id":"98718a5692a33a090df0421f7d48f7b20be3a15dafddd3f88613c957f01f774b","slow_id":"p03296_a260e38fd68198bd3b846ed815f9f7842be8a43a1a00830ef94d4cac2df063d2","speedup":2.3462734327270764,"stratum":"2-4","sampling_key":"dcf2df91d5e98068a1a0096e78206f1648840dcbe118b48532b43b8535f82bad","slow_code":"import sys\n\nINF = float(\"inf\")\nMOD = 10**9 + 7\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef LI_():\n return [int(x) - 1 for x in sys.stdin.readline().split()]\n\n\ndef LF():\n return [float(x) for x in sys.stdin.readline().split()]\n\n\ndef LS():\n return sys.stdin.readline().split()\n\n\ndef II():\n return int(sys.stdin.readline())\n\n\ndef SI():\n return eval(input())\n\n\ndef main():\n n = II()\n A = LI()\n res = 0\n for i in range(1, n):\n if A[i] == A[i - 1]:\n A[i] = 0\n res += 1\n return res\n\n\nprint((main()))\n","fast_code":"eval(input())\ncnt = 0\nnow = 0\nres = 0\nfor a in map(int, input().split()):\n if a == now:\n cnt += 1\n else:\n res += cnt // 2\n cnt = 1\n now = a\nprint((res + cnt // 2))\n"} +{"fast_code_id":"4ceb26db4c28db0cf02b68d638230008074a8dd18112e92c3750c45d16a6d663","fast_id":"p03251_4ceb26db4c28db0cf02b68d638230008074a8dd18112e92c3750c45d16a6d663","language":"python","measured_fast_code_id":"4ceb26db4c28db0cf02b68d638230008074a8dd18112e92c3750c45d16a6d663","measured_slow_code_id":"5ce8798f598c49e1a4c395a4c8846ff472fdaac4991833a8da4555eab052e27f","measurement_metric":"cpu_instruction_count","pair_id":"python_3cf48b67b78b7cff934ad633","problem_id":"p03251","slow_code_id":"5a881080c64c83352de556b20fff7b0700f2ff443a5f03182fd4ed0f3d7f6e7c","slow_id":"p03251_5ce8798f598c49e1a4c395a4c8846ff472fdaac4991833a8da4555eab052e27f","speedup":6.464422194932198,"stratum":"4-8","sampling_key":"5b3ed7b5eb33afa975b77c31ea19c2c92bdcfd310aaa8b586540d69b57dc2189","slow_code":"import bisect\nimport heapq\nimport math\nimport random\nimport sys\nfrom collections import Counter, defaultdict, deque\nfrom decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal\nfrom functools import lru_cache, reduce\nfrom itertools import combinations, combinations_with_replacement, product, permutations\nfrom operator import add, mul, sub\n\nsys.setrecursionlimit(10000)\n\n\ndef read_int():\n return int(input())\n\n\ndef read_int_n():\n return list(map(int, input().split()))\n\n\ndef read_float():\n return float(input())\n\n\ndef read_float_n():\n return list(map(float, input().split()))\n\n\ndef read_str():\n return input().strip()\n\n\ndef read_str_n():\n return list(map(str, input().split()))\n\n\ndef error_print(*args):\n print(*args, file=sys.stderr)\n\n\ndef mt(f):\n import time\n\n def wrap(*args, **kwargs):\n s = time.time()\n ret = f(*args, **kwargs)\n e = time.time()\n error_print(e - s, \"sec\")\n return ret\n\n return wrap\n\n\n@mt\ndef slv(N, M, X, Y, x, y):\n mx = max(x)\n my = min(y)\n error_print(mx, my)\n if mx < my and (my > X and mx < Y):\n return \"No War\"\n return \"War\"\n\n\ndef main():\n N, M, X, Y = read_int_n()\n x = read_int_n()\n y = read_int_n()\n print(slv(N, M, X, Y, x, y))\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"N, M, X, Y = list(map(int, input().split()))\nx = list(map(int, input().split()))\ny = list(map(int, input().split()))\nans = \"War\"\nfor z in range(X + 1, Y + 1):\n if max(x) < z and min(y) >= z:\n ans = \"No War\"\n break\nprint(ans)\n"} +{"fast_code_id":"40c384de9916c20716412ceeb875503501d088f9314d691c5f81bc3c1cf9e892","fast_id":"p02995_5956a1b2d912bfd23345c485f0ffc7b6e25d46613e1c4f11a08333a208413d78","language":"python","measured_fast_code_id":"5956a1b2d912bfd23345c485f0ffc7b6e25d46613e1c4f11a08333a208413d78","measured_slow_code_id":"c2f5bc360099cc643a35a40406bd46a274a8a5ff8b8696ae88a7e38cfd81242e","measurement_metric":"cpu_instruction_count","pair_id":"python_3d1823d7371311b68ebb7c4f","problem_id":"p02995","slow_code_id":"13e5da75774e374f0ecc4a7f6f857dc7a5cfdcb8d1ce9b650399f2172f149df2","slow_id":"p02995_c2f5bc360099cc643a35a40406bd46a274a8a5ff8b8696ae88a7e38cfd81242e","speedup":2.262061569418186,"stratum":"2-4","sampling_key":"d9d84efc9077ad6ed5e427d1974f06f051b8c0f878256141d098ce3ba75c3344","slow_code":"import sys\n\nsys.setrecursionlimit(10**7)\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\ndef MI():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef LI2():\n return list(map(int, sys.stdin.readline().rstrip()))\n\n\ndef S():\n return sys.stdin.readline().rstrip()\n\n\ndef LS():\n return list(sys.stdin.readline().rstrip().split())\n\n\ndef LS2():\n return list(sys.stdin.readline().rstrip())\n\n\nA, B, C, D = MI()\nfrom math import gcd\n\n\ndef f(n):\n return n - n // C - n // D + n // ((C * D) // gcd(C, D))\n\n\nprint((f(B) - f(A - 1)))\n","fast_code":"import sys\n\n\ndef S():\n return sys.stdin.readline().rstrip()\n\n\nA, B, C, D = list(map(int, S().split()))\nfrom math import gcd\n\n\ndef f(n):\n return n - n // C - n // D + n // (C * D // gcd(C, D))\n\n\nprint((f(B) - f(A - 1)))\n"} +{"fast_code_id":"786f1f0911f3736533e58815057474b28bac58c983968ff4827f978075d801f1","fast_id":"p04000_786f1f0911f3736533e58815057474b28bac58c983968ff4827f978075d801f1","language":"python","measured_fast_code_id":"786f1f0911f3736533e58815057474b28bac58c983968ff4827f978075d801f1","measured_slow_code_id":"a36bab8f921599e4ca7482c881bfcc39764a8e5acc14a246031adfce3dcc98b4","measurement_metric":"cpu_instruction_count","pair_id":"python_3d788230bfebbe018039ae86","problem_id":"p04000","slow_code_id":"12645471e5b932b71064020cd96552bd93299a86ffda13a17e3ba1b8f76a6c83","slow_id":"p04000_a36bab8f921599e4ca7482c881bfcc39764a8e5acc14a246031adfce3dcc98b4","speedup":2.37695089609917,"stratum":"2-4","sampling_key":"a36020848671abefc5c21d999263d40c585d89b7a186cf46aef7487cb517153c","slow_code":"H, W, N = list(map(int, input().split()))\nB = set([])\nfor i in range(N):\n a, b = list(map(int, input().split()))\n a -= 1\n b -= 1\n B.add((a, b))\n\nBB = list(B)\nans = [0 for _ in range(10)]\nfor i in range(N):\n cnt = 0\n temp = 0\n x, y = BB[i]\n\n for sx in range(max(0, x - 2), min(x, H - 3) + 1):\n for sy in range(max(0, y - 2), min(y, W - 3) + 1):\n temp = 0\n for p in range(3):\n for q in range(3):\n if (sx + p, sy + q) in B:\n temp += 1\n\n ans[temp] += 1\nfor i in range(1, 10):\n ans[i] = ans[i] // i\nans[0] = (H - 2) * (W - 2) - sum(ans[1:])\nfor t in ans:\n print(t)\n","fast_code":"from collections import defaultdict\n\nH, W, N = map(int, input().split())\nD = defaultdict(int)\nfor i in range(N):\n h, w = map(int, input().split())\n h, w = h - 1, w - 1\n for dh in range(-1, 2):\n for dw in range(-1, 2):\n if not ((1 <= h + dh < H - 1) and (1 <= w + dw < W - 1)):\n continue\n D[(h + dh, w + dw)] += 1\nans = [0] * 10\nfor v in D.values():\n ans[v] += 1\nans[0] = (H - 2) * (W - 2) - sum(ans[1:])\nprint(*ans, sep=\"\\n\")\n"} +{"fast_code_id":"94ce46090efb80fef68cb4c83f8e9898f69f49ac9ed7f750f9db82ace3cd8625","fast_id":"p03456_94ce46090efb80fef68cb4c83f8e9898f69f49ac9ed7f750f9db82ace3cd8625","language":"python","measured_fast_code_id":"94ce46090efb80fef68cb4c83f8e9898f69f49ac9ed7f750f9db82ace3cd8625","measured_slow_code_id":"7917ed4392d2155273da648b2693fb0163544534d06b0c3c68db07d4c4827be4","measurement_metric":"cpu_instruction_count","pair_id":"python_3e12227611a6b1069041c3dc","problem_id":"p03456","slow_code_id":"7917ed4392d2155273da648b2693fb0163544534d06b0c3c68db07d4c4827be4","slow_id":"p03456_7917ed4392d2155273da648b2693fb0163544534d06b0c3c68db07d4c4827be4","speedup":286.78020609946515,"stratum":"8+","sampling_key":"07650151ed4e05142eb623503f146c272cedb92545db776a0fdc49083f2f0f23","slow_code":"import numpy as np\n\na = int(input().replace(\" \", \"\"))\nb = np.sqrt(a)\nc = b - int(b)\nif c == 0.0:\n print(\"Yes\")\nelse:\n print(\"No\")\n","fast_code":"a, b = input().split()\nn = int(a + b)\nflag = False\nfor i in range(1000):\n if i**2 == n:\n flag = True\n break\nprint((\"Yes\" if flag else \"No\"))\n"} +{"fast_code_id":"715c50a0bd5503a1c5a8f5900a3590d1b55c78b7a98e77c948ef59c2a023b3ea","fast_id":"p02732_715c50a0bd5503a1c5a8f5900a3590d1b55c78b7a98e77c948ef59c2a023b3ea","language":"python","measured_fast_code_id":"715c50a0bd5503a1c5a8f5900a3590d1b55c78b7a98e77c948ef59c2a023b3ea","measured_slow_code_id":"9d17ca3de5bff1fb4ca10fcde86e0ee4d7d8890320b402e1b2344cb473a994ae","measurement_metric":"cpu_instruction_count","pair_id":"python_3e32893e1d30f7739b0405b2","problem_id":"p02732","slow_code_id":"ab39497edd589ec48b0519088a7352daeebc2eed8c1dd4c3682e7f5541533e42","slow_id":"p02732_9d17ca3de5bff1fb4ca10fcde86e0ee4d7d8890320b402e1b2344cb473a994ae","speedup":7.54551271377537,"stratum":"4-8","sampling_key":"8268e28a8b3199f50d0b10c01bd1967d585b969110fe5c25e99d35a2b45716da","slow_code":"import sys\n\nsys.setrecursionlimit(10000000)\n\ndxdy = ((1, 0), (0, 1))\n\n\ndef pin(type=int):\n return list(map(type, input().rstrip().split()))\n\n\ndef resolve():\n (N,) = pin()\n A = list(pin())\n from collections import Counter as ct\n\n a = ct(A)\n t = list(a.items())\n\n Sum = 0\n for l in list(a.values()):\n Sum += (l * (l - 1)) // 2\n ans = [0] * N\n for j in list(a.items()):\n x, y = j\n ans[x - 1] = Sum - ((y * (y - 1)) // 2) + (((y - 2) * (y - 1)) // 2)\n for i in A:\n print((ans[i - 1]))\n\n\nimport sys\nfrom io import StringIO\nimport unittest\n\n\nclass TestClass(unittest.TestCase):\n def assertIO(self, input, output):\n stdout, stdin = sys.stdout, sys.stdin\n sys.stdout, sys.stdin = StringIO(), StringIO(input)\n resolve()\n sys.stdout.seek(0)\n out = sys.stdout.read()[:-1]\n sys.stdout, sys.stdin = stdout, stdin\n self.assertEqual(out, output)\n\n def test_入力例_1(self):\n input = \"\"\"5\n1 1 2 1 2\"\"\"\n output = \"\"\"2\n2\n3\n2\n3\"\"\"\n self.assertIO(input, output)\n\n def test_入力例_2(self):\n input = \"\"\"4\n1 2 3 4\"\"\"\n output = \"\"\"0\n0\n0\n0\"\"\"\n self.assertIO(input, output)\n\n def test_入力例_3(self):\n input = \"\"\"5\n3 3 3 3 3\"\"\"\n output = \"\"\"6\n6\n6\n6\n6\"\"\"\n self.assertIO(input, output)\n\n def test_入力例_4(self):\n input = \"\"\"8\n1 2 1 4 2 1 4 1\"\"\"\n output = \"\"\"5\n7\n5\n7\n7\n5\n7\n5\"\"\"\n self.assertIO(input, output)\n\n\nif __name__ == \"__main__\":\n resolve()\n","fast_code":"from functools import reduce\n\n\ndef d_banned_k():\n from collections import Counter\n from functools import reduce\n\n N = int(eval(input()))\n A = [int(i) for i in input().split()]\n\n def comb(n, r):\n numerator = reduce(lambda x, y: x * y, list(range(n, n - r, -1)))\n denominator = reduce(lambda x, y: x * y, list(range(1, r + 1)))\n return numerator // denominator\n\n count = Counter(A)\n total = sum(comb(c, 2) for c in list(count.values()))\n ans = []\n for a in A:\n v = count[a]\n ans.append(total - comb(v, 2) + comb(v - 1, 2))\n return \" \".join(map(str, ans))\n\n\nprint((d_banned_k()))\n"} +{"fast_code_id":"964e554a32b3bd8e20a5996984501317bd6da8420e4c9a7d8c6cc002ccea685a","fast_id":"p02939_964e554a32b3bd8e20a5996984501317bd6da8420e4c9a7d8c6cc002ccea685a","language":"python","measured_fast_code_id":"964e554a32b3bd8e20a5996984501317bd6da8420e4c9a7d8c6cc002ccea685a","measured_slow_code_id":"37db42fbefdb0dbbda44774e52a453296698a7c0ff2fd87fa533a64afe79be91","measurement_metric":"cpu_instruction_count","pair_id":"python_3e5e331271d45ce1f3c5b18a","problem_id":"p02939","slow_code_id":"37db42fbefdb0dbbda44774e52a453296698a7c0ff2fd87fa533a64afe79be91","slow_id":"p02939_37db42fbefdb0dbbda44774e52a453296698a7c0ff2fd87fa533a64afe79be91","speedup":3.8166180766532882,"stratum":"2-4","sampling_key":"b91bd2f5695c075382cac4fe0a29befdac230fa458688aa3f1141095a6bb9cf2","slow_code":"import sys\n\nstdin = sys.stdin\nni = lambda: int(ns)\nns = lambda: stdin.readline().rstrip()\nna = lambda: map(int, stdin.readline().split())\nfrom itertools import groupby\n\n\ndef f(x):\n groups = []\n for _, g in groupby(x):\n groups += [list(g)]\n ans = 0\n flag = False\n for group in groups:\n n = len(group)\n if flag:\n n -= 1\n flag = False\n if n == 0:\n print(group, file=sys.stderr)\n continue\n c = (n - 1) // 3 * 2\n o = n % 3\n if o == 0:\n d = 2\n elif o == 1:\n d = 1\n elif o == 2:\n d = 2\n flag = True\n print(group, c, d, file=sys.stderr)\n ans += c + d\n if flag:\n ans -= 1\n print(ans, file=sys.stderr)\n return ans\n\n\ndef solve():\n s = ns()\n print(max(f(s), f(s[::-1])))\n\n\nif __name__ == \"__main__\":\n solve()\n","fast_code":"import sys\n\nsys.setrecursionlimit(10**8)\ninput = sys.stdin.readline\n\n\ndef main():\n S = input().strip()\n i = 1\n prev = S[0]\n cnt = 1\n while i < len(S):\n if S[i] == prev:\n prev = prev + S[i]\n if i + 1 < len(S):\n prev = S[i] + S[i + 1]\n cnt += 1\n i += 2\n else:\n i += 1\n else:\n prev = S[i]\n cnt += 1\n i += 1\n print(cnt)\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"216c785fffec6646e7c557d36612cae8a2e5c8f36345616e20c86fbc70f38d56","fast_id":"p03309_216c785fffec6646e7c557d36612cae8a2e5c8f36345616e20c86fbc70f38d56","language":"python","measured_fast_code_id":"216c785fffec6646e7c557d36612cae8a2e5c8f36345616e20c86fbc70f38d56","measured_slow_code_id":"ac37d1c100ca4f2f3882684ef89e1b7a5b8307cd615c5194b3be94140e64b83f","measurement_metric":"cpu_instruction_count","pair_id":"python_3e62ea80fcf8de961dd457da","problem_id":"p03309","slow_code_id":"5701aee218672555c66391cf29324a5e74ef891c96945197c9a70baf40116d22","slow_id":"p03309_ac37d1c100ca4f2f3882684ef89e1b7a5b8307cd615c5194b3be94140e64b83f","speedup":7.640609904396619,"stratum":"4-8","sampling_key":"2064102cb2748ae8619737271750f2015ce68a83222b6b654662b6ffb484b277","slow_code":"import sys\nimport numpy as np\n\nsr = lambda: sys.stdin.readline().rstrip()\nir = lambda: int(sr())\nlr = lambda: list(map(int, sr().split()))\nN = ir()\nA = np.array(lr())\nA -= np.arange(1, N + 1)\nA.sort()\n\n\ndef check(i):\n ret = np.abs(A - A[i]).sum()\n return ret\n\n\nanswer = min(check(0), check(-1))\nleft = 0\nright = N - 1\nl_mid = (left * 2 + right) // 3\nr_mid = (left + right * 2) // 3\nwhile abs(right - left) > 2:\n l_mid = (left * 2 + right) // 3\n r_mid = (left + right * 2) // 3\n if check(l_mid) < check(r_mid):\n right = r_mid\n else:\n left = l_mid\ncand = min(check(l_mid), check(r_mid))\nanswer = min(answer, cand)\nprint(answer)\n","fast_code":"import math\nimport statistics\n\nN = int(eval(input()))\nL = [i for i in map(int, input().split())]\nQ = []\nfor i in range(len(L)):\n Q.append(L[i] - (i + 1))\nb = statistics.median(Q)\nres = 0\nfor i in range(N):\n res += abs(L[i] - (i + 1) - b)\nprint((int(res)))\n"} +{"fast_code_id":"c04521b6567e2d2e8733be44f049f5f46d51c44474134bb710f179a68c008cdf","fast_id":"p02628_c04521b6567e2d2e8733be44f049f5f46d51c44474134bb710f179a68c008cdf","language":"python","measured_fast_code_id":"c04521b6567e2d2e8733be44f049f5f46d51c44474134bb710f179a68c008cdf","measured_slow_code_id":"12fc0a6880b1658c0eaeba3aa7dd7893393cf5c052e40105869e3784eb2f1caa","measurement_metric":"cpu_instruction_count","pair_id":"python_3eaaf7593b9008b54b49f6c1","problem_id":"p02628","slow_code_id":"12fc0a6880b1658c0eaeba3aa7dd7893393cf5c052e40105869e3784eb2f1caa","slow_id":"p02628_12fc0a6880b1658c0eaeba3aa7dd7893393cf5c052e40105869e3784eb2f1caa","speedup":44.40659155129648,"stratum":"8+","sampling_key":"886662341b51e0dc8c7976e471678e65a4ff23ca10f2b62e4715fc202360ccea","slow_code":"N, K = list(map(int, input().split()))\nP = list(map(int, input().split()))\n\n\ndef bubblesort(l):\n for index in range(len(l) - 1, 0, -1):\n for low in range(index):\n if l[low] > l[low + 1]:\n tmp = l[low + 1]\n l[low + 1] = l[low]\n l[low] = tmp\n return l\n\n\nbubblesort(P)\nsum = 0\nfor i in range(K):\n sum = sum + P[i]\nprint(sum)\n","fast_code":"n, k = list(map(int, input().split()))\np = list(map(int, input().split()))\np.sort()\nprint((sum(p[0:k])))\n"} +{"fast_code_id":"0637e9cabdd49c81a34a43aebbe50e41762ac5fce82506e688f107a19229a3c8","fast_id":"p02695_c7d16eeae23302c0174cc6c3a63e28d624b3c7d6b74e2673b522212c488d195a","language":"python","measured_fast_code_id":"c7d16eeae23302c0174cc6c3a63e28d624b3c7d6b74e2673b522212c488d195a","measured_slow_code_id":"4876c20eabffbc9ea2c633c2d996da20261178a9a9451926be7fe13405bb8582","measurement_metric":"cpu_instruction_count","pair_id":"python_3ee9484f4d6d7e087c0948cf","problem_id":"p02695","slow_code_id":"4876c20eabffbc9ea2c633c2d996da20261178a9a9451926be7fe13405bb8582","slow_id":"p02695_4876c20eabffbc9ea2c633c2d996da20261178a9a9451926be7fe13405bb8582","speedup":4.842447305621279,"stratum":"4-8","sampling_key":"06aee4e4355eaed229b87d2fedfabe71847264ff43edc6aa27d48869818c17a8","slow_code":"n, m, q = list(map(int, input().split()))\nl = []\nfor i in range(q):\n l1, l2, l3, l4 = list(map(int, input().split()))\n l.append([l1, l2, l3, l4])\nB = []\nfor a in range(1, m + 1):\n for b in range(a, m + 1):\n for c in range(b, m + 1):\n for d in range(c, m + 1):\n for e in range(d, m + 1):\n for f in range(e, m + 1):\n for g in range(f, m + 1):\n for h in range(g, m + 1):\n for i in range(h, m + 1):\n for j in range(i, m + 1):\n L = [a, b, c, d, e, f, g, h, i, j]\n A = []\n for I in range(n):\n A.append(L[I])\n C = 0\n for k in range(q):\n if (\n A[l[k][1] - 1] - A[l[k][0] - 1]\n == l[k][2]\n ):\n C += l[k][3]\n B.append(C)\nprint((max(B)))\n","fast_code":"import itertools\n\nn, m, q = list(map(int, input().split()))\nquery = [list(map(int, input().split())) for _ in range(q)]\nls = list(range(n + m - 1))\nmx = 0\nfor l in itertools.combinations(ls, m - 1):\n a = [0]\n idx = 0\n val = 1\n for i in range(n + m - 1):\n if idx < m - 1 and i == l[idx]:\n val += 1\n idx += 1\n else:\n a.append(val)\n\n v = 0\n for i in query:\n if a[i[1]] - a[i[0]] == i[2]:\n v += i[3]\n mx = max(v, mx)\nprint(mx)\n"} +{"fast_code_id":"19d3f37eac8ac09b7885d87d37374ecf5327815edce107f6a632fb3851f2160f","fast_id":"p02607_db7bf0be351014f9bb63d2f982bb933f258f987e3bbcdaf2858758eb6cd91de5","language":"python","measured_fast_code_id":"db7bf0be351014f9bb63d2f982bb933f258f987e3bbcdaf2858758eb6cd91de5","measured_slow_code_id":"80d5226038bdb32cf21a0b535cbd1c7092e4e8009586ccf346a6a6f305bc5b7d","measurement_metric":"cpu_instruction_count","pair_id":"python_3f0d008ca87a64f2d812338a","problem_id":"p02607","slow_code_id":"80d5226038bdb32cf21a0b535cbd1c7092e4e8009586ccf346a6a6f305bc5b7d","slow_id":"p02607_80d5226038bdb32cf21a0b535cbd1c7092e4e8009586ccf346a6a6f305bc5b7d","speedup":464.44360461922895,"stratum":"8+","sampling_key":"b1a56d218706303ef907be6d21cda1f86d6cc20667732840ced1fd2264c1dc2d","slow_code":"import sys\nfrom collections import deque\nimport numpy as np\nimport math\n\nsys.setrecursionlimit(10**6)\n\n\ndef S():\n return sys.stdin.readline().rstrip()\n\n\ndef SL():\n return list(map(str, sys.stdin.readline().rstrip().split()))\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\ndef IL():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef Main():\n n = I()\n a = list(IL())\n c = 0\n for rep in range(0, n, 2):\n if a[rep] % 2:\n c += 1\n print(c)\n return\n\n\nif __name__ == \"__main__\":\n Main()\n","fast_code":"import sys\nimport math\nfrom bisect import bisect_right as br\nfrom bisect import bisect_left as bl\n\nsys.setrecursionlimit(2147483647)\nfrom heapq import heappush, heappop, heappushpop\nfrom collections import defaultdict\nfrom itertools import accumulate\nfrom collections import Counter\nfrom collections import deque\nfrom operator import itemgetter\nfrom itertools import permutations\n\nmod = 10**9 + 7\ninf = float(\"inf\")\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\nn = I()\na = LI()\nans = 0\nfor i in range(n):\n if (i + 1) % 2:\n if a[i] % 2:\n ans += 1\nprint(ans)\n"} +{"fast_code_id":"79fe0f196824bcee44081aebf70a0001d0504c38398f20702ec69028d1c401c9","fast_id":"p03212_be64dc1a6b817ca0225bd6408a1c1bf8da94ae100cb8bfbf8b132c94236bc9b1","language":"python","measured_fast_code_id":"be64dc1a6b817ca0225bd6408a1c1bf8da94ae100cb8bfbf8b132c94236bc9b1","measured_slow_code_id":"0673030745e51e0e71ea989ca56078e7009b913375c5bf3cc0e026cce49704f1","measurement_metric":"cpu_instruction_count","pair_id":"python_3f3ce41fa2e6cded278404cd","problem_id":"p03212","slow_code_id":"0673030745e51e0e71ea989ca56078e7009b913375c5bf3cc0e026cce49704f1","slow_id":"p03212_0673030745e51e0e71ea989ca56078e7009b913375c5bf3cc0e026cce49704f1","speedup":79.20603163852807,"stratum":"8+","sampling_key":"8fbd87642a79c608f0f2d3425f5dc9e03b43f35b9098b1cdb0ba2e41283f543a","slow_code":"def DFS(n):\n if len(n) >= 3 and len(set(list(n)) & {\"3\", \"5\", \"7\"}) == 3:\n A.append(int(n))\n if len(n) < 10:\n for i in (\"3\", \"5\", \"7\"):\n DFS(n + i)\n\n\nn = int(eval(input()))\nA = []\nfor i in (\"3\", \"5\", \"7\"):\n DFS(i)\nA.sort()\ncnt = 0\nwhile 1:\n if A[cnt] <= n:\n cnt += 1\n else:\n break\nprint(cnt)\n","fast_code":"def nexti(i):\n if i == 0:\n return 3\n elif i % 10 == 3:\n return i + 2\n elif i % 10 == 5:\n return i + 2\n elif i % 10 == 7:\n return nexti(i // 10) * 10 + 3\n\n\nn = int(eval(input()))\nnn = 0\ni = 357\nwhile i <= n:\n s = str(i)\n if \"3\" in s:\n if \"5\" in s:\n if \"7\" in s:\n\n nn += 1\n if i % 10 == 7:\n i = nexti(i)\n else:\n i += 2\nprint(nn)\n"} +{"fast_code_id":"e5b2e399a03a3f8e8d296f2c196051328bc34d20b308d0640a69b1e958432119","fast_id":"p03698_e5b2e399a03a3f8e8d296f2c196051328bc34d20b308d0640a69b1e958432119","language":"python","measured_fast_code_id":"e5b2e399a03a3f8e8d296f2c196051328bc34d20b308d0640a69b1e958432119","measured_slow_code_id":"a376ffe929edf06b724e30b2a2aa18092b8bf70564466dfec6fa169764c5e067","measurement_metric":"cpu_instruction_count","pair_id":"python_3f4e7e3e20e3ab10e022b296","problem_id":"p03698","slow_code_id":"03a45d604c638a812e6d78b441dcfe3d80c575bed1318c5bae6f1933757136b9","slow_id":"p03698_a376ffe929edf06b724e30b2a2aa18092b8bf70564466dfec6fa169764c5e067","speedup":6.957312599648917,"stratum":"4-8","sampling_key":"b5daee14802a622bd5e425141373bf7a5069c54de0b2d5f3437cce3d69211b83","slow_code":"import sys\n\nstdin = sys.stdin\ninf = 1 << 60\nmod = 1000000007\nni = lambda: int(ns())\nnin = lambda y: [ni() for _ in range(y)]\nna = lambda: list(map(int, stdin.readline().split()))\nnan = lambda y: [na() for _ in range(y)]\nnf = lambda: float(ns())\nnfn = lambda y: [nf() for _ in range(y)]\nnfa = lambda: list(map(float, stdin.readline().split()))\nnfan = lambda y: [nfa() for _ in range(y)]\nns = lambda: stdin.readline().rstrip()\nnsn = lambda y: [ns() for _ in range(y)]\nncl = lambda y: [list(ns()) for _ in range(y)]\nnas = lambda: stdin.readline().split()\ns = ns()\nprint((\"yes\" if len(s) == len(set(s)) else \"no\"))\n","fast_code":"a = list(input())\nb = set(a)\nprint(\"yes\") if (len(a) == len(b)) else print(\"no\")\n"} +{"fast_code_id":"6b214377e8830c8ef5db7c76491715d4e576ebe795031bc7baac3fb1f62576d7","fast_id":"p02712_d8727d4315cce76f463c0482d83aebba7c2a66cd445b285570e301539aee7ccf","language":"python","measured_fast_code_id":"d8727d4315cce76f463c0482d83aebba7c2a66cd445b285570e301539aee7ccf","measured_slow_code_id":"33180e8f8531ab7beba61b81c75e8fa954c1f6958e5a3a1431e3ef4377cc1302","measurement_metric":"cpu_instruction_count","pair_id":"python_3f85b46f400dde5ab17ba027","problem_id":"p02712","slow_code_id":"8c66b41e3f6703973067b14827b6d2d0357c8992b486cfc019d662a0d4e9c927","slow_id":"p02712_33180e8f8531ab7beba61b81c75e8fa954c1f6958e5a3a1431e3ef4377cc1302","speedup":359.833573126783,"stratum":"8+","sampling_key":"01ce53c23765597e4ffe649f589fe4b263b4f3f48a98b59b8f361bfbcab9b401","slow_code":"N = int(eval(input()))\nary2 = []\nfor x in list(range(1, N + 1, 1)):\n if x % 3 != 0 and x % 5 != 0:\n ary2.append(x)\nprint((sum(ary2)))\n","fast_code":"n = int(eval(input()))\nSum = 0.5 * n * (1 + n)\n\nSum3_5 = 0.5 * (int(n / 3) * (3 + 3 * int(n / 3)) + int(n / 5) * (5 + 5 * int(n / 5)))\nSum15 = 0.5 * (int(n / 15) * (15 + int(n / 15) * 15))\n\nprint((int(Sum - Sum3_5 + Sum15)))\n"} +{"fast_code_id":"dfc21526141391946fe1a7cc9119e0ef1b46fbd2a3ae7971e780a56f8a86c370","fast_id":"p03700_dfc21526141391946fe1a7cc9119e0ef1b46fbd2a3ae7971e780a56f8a86c370","language":"python","measured_fast_code_id":"dfc21526141391946fe1a7cc9119e0ef1b46fbd2a3ae7971e780a56f8a86c370","measured_slow_code_id":"4f614769a7e22dddcb85c7a9aa9d9cee3d9896b34340a1e7d8590ac4705426eb","measurement_metric":"cpu_instruction_count","pair_id":"python_3f9369e51173f0cb3869ac6b","problem_id":"p03700","slow_code_id":"4f614769a7e22dddcb85c7a9aa9d9cee3d9896b34340a1e7d8590ac4705426eb","slow_id":"p03700_4f614769a7e22dddcb85c7a9aa9d9cee3d9896b34340a1e7d8590ac4705426eb","speedup":3.027124663918093,"stratum":"2-4","sampling_key":"74db3ea6843b4242ee8a9d3158804ae861edbee40bc534752750481d622f75f0","slow_code":"import numpy as np\n\nN, A, B = list(map(int, input().split()))\nH = np.zeros(shape=N, dtype=\"int64\")\nfor _ in range(N):\n h = int(eval(input()))\n H[_] = h\n\n\ndef calc(num, a):\n a -= num * B\n a = (a - 1) // (A - B) + 1\n if sum(a[a > 0]) <= num:\n return True\n else:\n return False\n\n\nstart = 0\nend = 10**10\nwhile end - start > 1:\n mid = (start + end) // 2\n if calc(mid, H.copy()):\n end = mid\n else:\n start = mid\nprint(end)\n","fast_code":"_, a, b, *H = list(map(int, open(0).read().split()))\nl, r = 0, 10**9\nwhile r - l > 1:\n m = (l + r) // 2\n if -sum(min(0, (h - m * b) // (b - a)) for h in H) > m:\n l = m\n else:\n r = m\nprint(r)\n"} +{"fast_code_id":"5ef70bc141553c2d6856c41ffb402c1ab6bd08e8ee2dd8d9311cc53181815501","fast_id":"p03240_d8c72961362efaa75706105038ea037d0e693a948d13d5ff911684dd10351521","language":"python","measured_fast_code_id":"d8c72961362efaa75706105038ea037d0e693a948d13d5ff911684dd10351521","measured_slow_code_id":"7335b8f814fadff817ea3d797eb47069b6471e295b0639a1a649c1b8aea437e5","measurement_metric":"cpu_instruction_count","pair_id":"python_4012912652ea159061c4e4bc","problem_id":"p03240","slow_code_id":"2b73a8d0ed51a5904d37fa90f680662d0779f1a36233aa1fe89473f78eb7c3e5","slow_id":"p03240_7335b8f814fadff817ea3d797eb47069b6471e295b0639a1a649c1b8aea437e5","speedup":6.266826962401638,"stratum":"4-8","sampling_key":"2f5f0053dc55938aedbca27a79891f8dd354b1f5bc4071795bb057b3285793f7","slow_code":"import numpy as np\n\nN = int(eval(input()))\nx, y, h = np.array([list(map(int, input().split())) for i in range(N)]).T\nH = 0\nCx = 0\nCy = 0\nFlag = True\nfor i in range(101):\n for j in range(101):\n Flag = True\n for k in range(N):\n if h[k] != 0:\n H = h[k] + abs(i - x[k]) + abs(j - y[k])\n break\n for k in range(N):\n if h[k] != max(H - abs(i - x[k]) - abs(j - y[k]), 0):\n Flag = False\n break\n if Flag:\n Cx, Cy = i, j\n break\n if Flag:\n break\nprint((\"{} {} {}\".format(Cx, Cy, H)))\n","fast_code":"import math\n\nn = int(eval(input()))\nx = [0 for i in range(n)]\ny = [0 for i in range(n)]\nh = [0 for i in range(n)]\njudge = False\nfor i in range(n):\n x[i], y[i], h[i] = list(map(int, input().split()))\nfor i in range(0, 101):\n for j in range(0, 101):\n for k in range(0, n):\n if h[k] != 0:\n true_h = h[k] + int(math.fabs(x[k] - i)) + int(math.fabs(y[k] - j))\n break\n judge = True\n for k in range(n):\n dum_h = max(true_h - int(math.fabs(x[k] - i)) - int(math.fabs(y[k] - j)), 0)\n if h[k] != dum_h:\n judge = False\n break\n\n if judge is True:\n break\n if judge is True:\n break\nprint((\"{} {} {}\".format(i, j, true_h)))\n"} +{"fast_code_id":"71bd59e6221639063c126d1a73f9657b6851110fdfc69b40560a7a702f8a2490","fast_id":"p02612_71bd59e6221639063c126d1a73f9657b6851110fdfc69b40560a7a702f8a2490","language":"python","measured_fast_code_id":"71bd59e6221639063c126d1a73f9657b6851110fdfc69b40560a7a702f8a2490","measured_slow_code_id":"486e81cc66275807ffb489c81f6621446128ea2a8f5f188eb842554d9fce0e45","measurement_metric":"cpu_instruction_count","pair_id":"python_4031ad6baf2c0d5407a952e2","problem_id":"p02612","slow_code_id":"486e81cc66275807ffb489c81f6621446128ea2a8f5f188eb842554d9fce0e45","slow_id":"p02612_486e81cc66275807ffb489c81f6621446128ea2a8f5f188eb842554d9fce0e45","speedup":2.656871941052404,"stratum":"2-4","sampling_key":"9b53e4e39231b62bea9c56af51138d9368fae0a58d2a78396385318640669a98","slow_code":"import sys\n\n\ndef Ii():\n return int(sys.stdin.readline())\n\n\ndef Mi():\n return list(map(int, sys.stdin.buffer.readline().split()))\n\n\ndef Li():\n return list(map(int, sys.stdin.buffer.readline().split()))\n\n\nn = Ii()\na = n % 1000\nif a == 0:\n print((0))\nelse:\n print((1000 - a))\n","fast_code":"r = 1000 - int(eval(input())) % 1000\nprint((r if r < 1000 else 0))\n"} +{"fast_code_id":"5fb969214acaa42d24b99680bb695ee6c56e7e47861bc6f3117fbd04cdf9041f","fast_id":"p02417_5fb969214acaa42d24b99680bb695ee6c56e7e47861bc6f3117fbd04cdf9041f","language":"python","measured_fast_code_id":"5fb969214acaa42d24b99680bb695ee6c56e7e47861bc6f3117fbd04cdf9041f","measured_slow_code_id":"91fbc2a5db35b1941d183c86eb7016584b0dbbc404bd11d0ae21847b19ff61be","measurement_metric":"cpu_instruction_count","pair_id":"python_4033fbf90a8950ef57c24847","problem_id":"p02417","slow_code_id":"91fbc2a5db35b1941d183c86eb7016584b0dbbc404bd11d0ae21847b19ff61be","slow_id":"p02417_91fbc2a5db35b1941d183c86eb7016584b0dbbc404bd11d0ae21847b19ff61be","speedup":6.132158722909693,"stratum":"4-8","sampling_key":"494f5a73d06f0e21929dcec146128f4bc5cb798cc85fbd988377fa9540cb28d8","slow_code":"import sys\n\naz = [\n \"a\",\n \"b\",\n \"c\",\n \"d\",\n \"e\",\n \"f\",\n \"g\",\n \"h\",\n \"i\",\n \"j\",\n \"k\",\n \"l\",\n \"m\",\n \"n\",\n \"o\",\n \"p\",\n \"q\",\n \"r\",\n \"s\",\n \"t\",\n \"u\",\n \"v\",\n \"w\",\n \"x\",\n \"y\",\n \"z\",\n]\nsum_az = [0 for x in range(26)]\nfor x in sys.stdin.read().lower():\n for i in range(26):\n if x == az[i]:\n sum_az[i] += 1\nfor i in range(26):\n print((\"%s : %d\" % (az[i], sum_az[i])))\n","fast_code":"import sys\n\nchash = {}\nfor i in range(ord(\"a\"), ord(\"z\") + 1):\n chash[chr(i)] = 0\nfor line in sys.stdin:\n for i in range(len(line)):\n if line[i].isalpha():\n chash[line[i].lower()] += 1\nfor i in range(ord(\"a\"), ord(\"z\") + 1):\n print((\"{:s} : {:d}\".format(chr(i), chash[chr(i)])))\n"} +{"fast_code_id":"7d152829fabdaf68d6940ede064ea95c3e04f687d89b63c8893ae52fbdbff32d","fast_id":"p03240_7d152829fabdaf68d6940ede064ea95c3e04f687d89b63c8893ae52fbdbff32d","language":"python","measured_fast_code_id":"7d152829fabdaf68d6940ede064ea95c3e04f687d89b63c8893ae52fbdbff32d","measured_slow_code_id":"d8c72961362efaa75706105038ea037d0e693a948d13d5ff911684dd10351521","measurement_metric":"cpu_instruction_count","pair_id":"python_403d23b6f77bd3fa0f30204d","problem_id":"p03240","slow_code_id":"5ef70bc141553c2d6856c41ffb402c1ab6bd08e8ee2dd8d9311cc53181815501","slow_id":"p03240_d8c72961362efaa75706105038ea037d0e693a948d13d5ff911684dd10351521","speedup":2.676118889085976,"stratum":"2-4","sampling_key":"656cf3f135b93e3122c16be974141a9dcc909b54044ae89f5cf66d1e752e1b14","slow_code":"import math\n\nn = int(eval(input()))\nx = [0 for i in range(n)]\ny = [0 for i in range(n)]\nh = [0 for i in range(n)]\njudge = False\nfor i in range(n):\n x[i], y[i], h[i] = list(map(int, input().split()))\nfor i in range(0, 101):\n for j in range(0, 101):\n for k in range(0, n):\n if h[k] != 0:\n true_h = h[k] + int(math.fabs(x[k] - i)) + int(math.fabs(y[k] - j))\n break\n judge = True\n for k in range(n):\n dum_h = max(true_h - int(math.fabs(x[k] - i)) - int(math.fabs(y[k] - j)), 0)\n if h[k] != dum_h:\n judge = False\n break\n\n if judge is True:\n break\n if judge is True:\n break\nprint((\"{} {} {}\".format(i, j, true_h)))\n","fast_code":"n = int(input())\nXYH = []\nfor _ in range(n):\n x, y, h = map(int, input().split())\n if h != 0:\n XYH.append([x, y, h])\nflag = False\nans = XYH[0]\nfor i in range(101):\n for j in range(101):\n tempH = abs(XYH[0][0] - i) + abs(XYH[0][1] - j) + XYH[0][2]\n for x, y, h in XYH[1:]:\n if abs(x - i) + abs(y - j) + h != tempH:\n flag = False\n break\n else:\n flag = True\n if flag:\n ans = [i, j, tempH]\n break\n if flag:\n break\nprint(*ans, sep=\" \")\n"} +{"fast_code_id":"9374be75a840a2c4b56e633814fcdd34842f67bc14b739401a131997d9f69910","fast_id":"p03486_dfcb075d0773a0639a95a5d25040ac8581b9ade9ef96b0d84ab01fe3be33fd75","language":"python","measured_fast_code_id":"dfcb075d0773a0639a95a5d25040ac8581b9ade9ef96b0d84ab01fe3be33fd75","measured_slow_code_id":"ae2b702653d7f7343a504deb1d82130c75439f406e3e68078bdb6fe733a50939","measurement_metric":"cpu_instruction_count","pair_id":"python_40e797568f1cbda3541e7598","problem_id":"p03486","slow_code_id":"12de6db88ad79471a6d47d200ef0cf1d590ca1eac8ef874b69a66f9eb314da4e","slow_id":"p03486_ae2b702653d7f7343a504deb1d82130c75439f406e3e68078bdb6fe733a50939","speedup":3.764529383820126,"stratum":"2-4","sampling_key":"fbc3f545f663f24851a8d692edeb1340c52df7838d2ff73d341a358ccbb08c1c","slow_code":"import sys\n\n\ndef main():\n s, t = sys.stdin.read().split()\n n, m = len(s), len(t)\n s = sorted(s)\n t = list(reversed(sorted(t)))\n if n < m:\n for i in range(n):\n if s[i] < t[i]:\n ans = \"Yes\"\n break\n elif s[i] > t[i]:\n ans = \"No\"\n break\n else:\n ans = \"Yes\"\n else:\n for i in range(m):\n if s[i] < t[i]:\n ans = \"Yes\"\n break\n elif s[i] > t[i]:\n ans = \"No\"\n break\n else:\n ans = \"No\"\n print(ans)\n\n\nif __name__ == \"__main__\":\n\n main()\n","fast_code":"(\n print(\"Yes\")\n if \"\".join(sorted(input())) < \"\".join(sorted(input(), reverse=True))\n else print(\"No\")\n)\n"} +{"fast_code_id":"b56139331cede5dfee10d7e57ba4d3e5fe70d638b0a7d7343d69614e13c21b14","fast_id":"p03598_4242b0111d34ac29f247349e2dd3df5bbea3d003d38a638f0ec7f046c27e0435","language":"python","measured_fast_code_id":"4242b0111d34ac29f247349e2dd3df5bbea3d003d38a638f0ec7f046c27e0435","measured_slow_code_id":"1b129bb8d189a1d33979630c69207f7fede842e1eae77ef97d34db407621cf30","measurement_metric":"cpu_instruction_count","pair_id":"python_40f383b0ad2588b991293ceb","problem_id":"p03598","slow_code_id":"1b129bb8d189a1d33979630c69207f7fede842e1eae77ef97d34db407621cf30","slow_id":"p03598_1b129bb8d189a1d33979630c69207f7fede842e1eae77ef97d34db407621cf30","speedup":5.814804350555711,"stratum":"4-8","sampling_key":"f3f0c250fa9d4687be9cd5ad456c417abf589fab54d41f6a6755ce7055c71c71","slow_code":"from collections import Counter, defaultdict, deque\nfrom heapq import heappop, heappush, heapify\nimport sys, bisect, math, itertools, fractions, pprint\n\nsys.setrecursionlimit(10**8)\nmod = 10**9 + 7\nINF = float(\"inf\")\n\n\ndef inp():\n return int(sys.stdin.readline())\n\n\ndef inpl():\n return list(map(int, sys.stdin.readline().split()))\n\n\nn = inp()\nk = inp()\na = inpl()\nres = 0\nfor i, x in enumerate(a):\n res += min(abs(k - x) * 2, x * 2)\nprint(res)\n","fast_code":"import sys\n\nstdin = sys.stdin\ninf = 1 << 60\nmod = 1000000007\nni = lambda: int(ns())\nnin = lambda y: [ni() for _ in range(y)]\nna = lambda: list(map(int, stdin.readline().split()))\nnan = lambda y: [na() for _ in range(y)]\nnf = lambda: float(ns())\nnfn = lambda y: [nf() for _ in range(y)]\nnfa = lambda: list(map(float, stdin.readline().split()))\nnfan = lambda y: [nfa() for _ in range(y)]\nns = lambda: stdin.readline().rstrip()\nnsn = lambda y: [ns() for _ in range(y)]\nncl = lambda y: [list(ns()) for _ in range(y)]\nnas = lambda: stdin.readline().split()\nn, k = nin(2)\nx = na()\nans = 0\nfor i in range(n):\n ans += min(abs(x[i] - k) * 2, abs(x[i]) * 2)\nprint(ans)\n"} +{"fast_code_id":"fac6663288e36d34bc40af158b96cb2e3bfeb4e851c1db0ad7779aa4e646f6ac","fast_id":"p00100_fac6663288e36d34bc40af158b96cb2e3bfeb4e851c1db0ad7779aa4e646f6ac","language":"python","measured_fast_code_id":"fac6663288e36d34bc40af158b96cb2e3bfeb4e851c1db0ad7779aa4e646f6ac","measured_slow_code_id":"5d1f4cb08fbc43299784771f17b3646fe4993e8fd866609d48d2ebc0e737a39c","measurement_metric":"cpu_instruction_count","pair_id":"python_41484593e509de75c9f8014e","problem_id":"p00100","slow_code_id":"d4669c36b7d92dd1908cad9300dbbe214938350a72f54c414f63ae0b2ccb8749","slow_id":"p00100_5d1f4cb08fbc43299784771f17b3646fe4993e8fd866609d48d2ebc0e737a39c","speedup":3.257977270575068,"stratum":"2-4","sampling_key":"255716968cda8c9a5cbc6660050cf898196de9726fdbb597222577a2979900da","slow_code":"employeeSalesList = []\n\n\ndef resetDataset():\n del employeeSalesList[0 : len(employeeSalesList) + 1]\n\n\ndef readDataCount():\n return int(eval(input()))\n\n\ndef searchEmployeeSales(employeeId):\n for data in employeeSalesList:\n if data[0] == employeeId:\n return data\n newData = [employeeId, 0]\n employeeSalesList.append(newData)\n return newData\n\n\ndef printEmployeeOfDataset():\n answerList = [data[0] for data in employeeSalesList if data[1] >= 1000000]\n if len(answerList) == 0:\n print(\"NA\")\n else:\n print((\"\\n\".join(map(str, answerList))))\n\n\nresetDataset()\ndataCount = readDataCount()\nwhile dataCount > 0:\n for _ in range(dataCount):\n employeeId, price, volume = list(map(int, input().split(\" \")))\n employeeSales = searchEmployeeSales(employeeId)\n employeeSales[1] += price * volume\n printEmployeeOfDataset()\n resetDataset()\n dataCount = readDataCount()\n","fast_code":"while True:\n n = int(eval(input()))\n if n == 0:\n break\n d = dict()\n sep = []\n for _ in range(n):\n i, p, q = list(map(int, input().split()))\n if i in d:\n d[i] += p * q\n else:\n d[i] = p * q\n sep.append(i)\n tmp = list([x for x in list(d.items()) if x[1] >= 1000000])\n if len(tmp):\n tmp = {t[0]: t[1] for t in tmp}\n for s in sep:\n if s in tmp:\n print(s)\n else:\n print(\"NA\")\n"} +{"fast_code_id":"df78678cc468f931c4deecedae5654556a3e34626187f1eb870d9dc288d371ff","fast_id":"p03558_df78678cc468f931c4deecedae5654556a3e34626187f1eb870d9dc288d371ff","language":"python","measured_fast_code_id":"df78678cc468f931c4deecedae5654556a3e34626187f1eb870d9dc288d371ff","measured_slow_code_id":"753ba2acf58970ec408525feda7402d098171beac9bd1950c7052fdfa91dc504","measurement_metric":"cpu_instruction_count","pair_id":"python_41f851171c6c596925324b42","problem_id":"p03558","slow_code_id":"c7f486fef4d399b68139624830a53867acecdea50443da4c3471bb7be8c54eb9","slow_id":"p03558_753ba2acf58970ec408525feda7402d098171beac9bd1950c7052fdfa91dc504","speedup":9.153301307859358,"stratum":"8+","sampling_key":"2817c820f151cf4e2dfc524698729f2de3c1e6741ef77c5d31d0dfbefd5e27e0","slow_code":"import sys\n\nsys.setrecursionlimit(10**6)\nreadline = sys.stdin.readline\nk = int(eval(input()))\ng = [[] for _ in range(k)]\nfor i in range(k):\n g[i].append(((i + 1) % k, 1))\n if i:\n g[i].append((10 * i % k, 0))\n\nfrom heapq import *\n\n\ndef dijkstra(g, start):\n n = len(g)\n dist = [float(\"inf\")] * (n)\n pending = n - 1\n dist[start] = 0\n q = [(0, start)]\n while q and pending:\n c, v = heappop(q)\n if dist[v] < c:\n continue\n pending -= 1\n for to, cost in g[v]:\n if dist[v] + cost < dist[to]:\n dist[to] = dist[v] + cost\n heappush(q, (dist[to], to))\n return dist\n\n\ndist = dijkstra(g, 1)\nprint((dist[0] + 1))\n","fast_code":"def solve(K):\n checked = [False] * K\n\n def calc(x):\n while not checked[x]:\n checked[x] = True\n yield x\n x = (x * 10) % K\n\n i = 0\n xs = [0]\n while 1:\n i += 1\n ys = []\n for x in xs:\n for z in calc((x + 1) % K):\n if z == 0:\n return i\n ys.append(z)\n xs = ys\n\n\nK = int(eval(input()))\nprint((solve(K)))\n"} +{"fast_code_id":"20c189f8687808a8f39bdc27c4d23e2df133376460bbab2cfedbfc5f2a303dd1","fast_id":"p03801_20c189f8687808a8f39bdc27c4d23e2df133376460bbab2cfedbfc5f2a303dd1","language":"python","measured_fast_code_id":"20c189f8687808a8f39bdc27c4d23e2df133376460bbab2cfedbfc5f2a303dd1","measured_slow_code_id":"40cdb704510a327363c2183827f02e9385c4a8e8deb4ae92265564da9b8e0f50","measurement_metric":"cpu_instruction_count","pair_id":"python_42141fe4f76091cc5a359b2f","problem_id":"p03801","slow_code_id":"16fad88fa10618a2d3253fe477e8c221495b37e3b11f228319dc3cf0097c8388","slow_id":"p03801_40cdb704510a327363c2183827f02e9385c4a8e8deb4ae92265564da9b8e0f50","speedup":2.986908325232993,"stratum":"2-4","sampling_key":"b839d9c4a6ab5ba287db2c400741ebac600904a90c53eca547fc70172a074626","slow_code":"from collections import defaultdict\nimport sys\n\n\nclass BIT:\n def __init__(self, number):\n self.n = number\n self.list = [0] * (number + 1)\n\n def add(self, i, x):\n while i <= self.n:\n self.list[i] += x\n i += i & -i\n\n def search(self, i):\n s = 0\n while i > 0:\n s += self.list[i]\n i -= i & -i\n return s\n\n def suma(self, i, j):\n return self.search(j) - self.search(i - 1)\n\n\nN = int(eval(input()))\nA = [int(i) for i in input().split()]\nC = sorted(set(A))\nndd = defaultdict(int)\nfor i in range(len(C)):\n ndd[i + 1] = C[i]\ndd = defaultdict(int)\nfor i in range(len(C)):\n dd[C[i]] = i + 1\n\nvisit = [0] * N\nvisit[0] = 1\ns = A[0]\nH = []\nH.append(s)\nfor i in range(1, N):\n if s < A[i]:\n s = A[i]\n H.append(s)\n visit[i] = 1\nBITI = BIT(N + 1)\nBITI2 = BIT(N + 1)\nj = len(H) - 1\nl = dd[H[j]]\nnum = sum(A)\nT = [0] * N\nans = 0\nfor i in range(N - 1, -1, -1):\n if l == dd[A[0]]:\n break\n BITI.add(dd[A[i]], A[i])\n BITI2.add(dd[A[i]], 1)\n if dd[A[i]] == l and visit[i] == 1:\n T[i] = (\n BITI.suma(dd[H[j - 1]], N + 1)\n - BITI2.suma(dd[H[j - 1]], N + 1) * H[j - 1]\n - ans\n )\n ans += T[i]\n\n j -= 1\n l = dd[H[j]]\nx = num - sum(T)\nT[0] = x\n\nfor t in T:\n print(t)\n","fast_code":"from operator import itemgetter\nimport sys\n\nN = int(eval(input()))\nA = [int(i) for i in input().split()]\nB = [(A[i], i) for i in range(N)]\nB = sorted(B, key=itemgetter(1))\nB = sorted(B, key=itemgetter(0))\nT = [0] * N\ncos, pt = B.pop()\nfor i in range(1, N):\n cos2, pt2 = B.pop()\n T[pt] += (cos - cos2) * i\n pt = min(pt, pt2)\n cos = cos2\nT[pt] += cos * N\nfor i in T:\n print(i)\n"} +{"fast_code_id":"784d4028a68e7272fd2d8f73e184a7a02294bbd66c3b11825b9eef71dc6e61a4","fast_id":"p03801_87e6edd80821ee298d94931e002157bd21ef5bd3bacd4b6f684c94b879d846c1","language":"python","measured_fast_code_id":"87e6edd80821ee298d94931e002157bd21ef5bd3bacd4b6f684c94b879d846c1","measured_slow_code_id":"40cdb704510a327363c2183827f02e9385c4a8e8deb4ae92265564da9b8e0f50","measurement_metric":"cpu_instruction_count","pair_id":"python_422514ef0e353521cacaef54","problem_id":"p03801","slow_code_id":"16fad88fa10618a2d3253fe477e8c221495b37e3b11f228319dc3cf0097c8388","slow_id":"p03801_40cdb704510a327363c2183827f02e9385c4a8e8deb4ae92265564da9b8e0f50","speedup":2.8653323206093,"stratum":"2-4","sampling_key":"f21ccae9b75855d2376ed1d70c4daea43538f9aeff1aceb25d85a05eb4fd5ebc","slow_code":"from collections import defaultdict\nimport sys\n\n\nclass BIT:\n def __init__(self, number):\n self.n = number\n self.list = [0] * (number + 1)\n\n def add(self, i, x):\n while i <= self.n:\n self.list[i] += x\n i += i & -i\n\n def search(self, i):\n s = 0\n while i > 0:\n s += self.list[i]\n i -= i & -i\n return s\n\n def suma(self, i, j):\n return self.search(j) - self.search(i - 1)\n\n\nN = int(eval(input()))\nA = [int(i) for i in input().split()]\nC = sorted(set(A))\nndd = defaultdict(int)\nfor i in range(len(C)):\n ndd[i + 1] = C[i]\ndd = defaultdict(int)\nfor i in range(len(C)):\n dd[C[i]] = i + 1\n\nvisit = [0] * N\nvisit[0] = 1\ns = A[0]\nH = []\nH.append(s)\nfor i in range(1, N):\n if s < A[i]:\n s = A[i]\n H.append(s)\n visit[i] = 1\nBITI = BIT(N + 1)\nBITI2 = BIT(N + 1)\nj = len(H) - 1\nl = dd[H[j]]\nnum = sum(A)\nT = [0] * N\nans = 0\nfor i in range(N - 1, -1, -1):\n if l == dd[A[0]]:\n break\n BITI.add(dd[A[i]], A[i])\n BITI2.add(dd[A[i]], 1)\n if dd[A[i]] == l and visit[i] == 1:\n T[i] = (\n BITI.suma(dd[H[j - 1]], N + 1)\n - BITI2.suma(dd[H[j - 1]], N + 1) * H[j - 1]\n - ans\n )\n ans += T[i]\n\n j -= 1\n l = dd[H[j]]\nx = num - sum(T)\nT[0] = x\n\nfor t in T:\n print(t)\n","fast_code":"import os\nimport sys\n\nif os.getenv(\"LOCAL\"):\n sys.stdin = open(\"_in.txt\", \"r\")\nsys.setrecursionlimit(2147483647)\nINF = float(\"inf\")\nIINF = 10**18\nMOD = 10**9 + 7\nN = int(sys.stdin.readline())\nA = list(map(int, sys.stdin.readline().split()))\nXY = [(a, i) for i, a in enumerate(A)]\nXY.sort(reverse=True)\n\nans = [0] * N\nmin_y = IINF\nfor i, (x, y) in enumerate(XY):\n min_y = min(min_y, y)\n x2 = XY[i + 1][0] if i + 1 < N else 0\n ans[min_y] += (x - x2) * (i + 1)\nprint(*ans, sep=\"\\n\")\n"} +{"fast_code_id":"af93ae5b5358d82779151bd5ba92d0b27867572750edec28a359053bd079fb2b","fast_id":"p03209_af93ae5b5358d82779151bd5ba92d0b27867572750edec28a359053bd079fb2b","language":"python","measured_fast_code_id":"af93ae5b5358d82779151bd5ba92d0b27867572750edec28a359053bd079fb2b","measured_slow_code_id":"d810806da4e3ff396dd2f9e6a8463b4981d8f62dd34c3ba133bb44352184e910","measurement_metric":"cpu_instruction_count","pair_id":"python_428619c40a0f088d7398d580","problem_id":"p03209","slow_code_id":"dbd3b0158d3748e0d99cec055f9e692949bfea6a1e16dd750ed0447f840bf070","slow_id":"p03209_d810806da4e3ff396dd2f9e6a8463b4981d8f62dd34c3ba133bb44352184e910","speedup":2.843228376327953,"stratum":"2-4","sampling_key":"6e7e6f1a19519f79353533c260bac9221e3f2d103253ef2ad188734665bdb846","slow_code":"N, X = list(map(int, input().split()))\n\nT = [1]\nfor i in range(1, 50 + 1):\n T.append(T[i - 1] * 2 + 3)\n\n\ndef hash(n, x):\n return \"{0:d},{1:d}\".format(n, x)\n\n\nmemo = dict()\n\n\ndef solve(n, x):\n global T, memo\n if hash(n, x) in memo:\n return memo[hash(n, x)]\n if n == 0 and x >= 1:\n memo[hash(n, x)] = 1\n return 1\n if x <= 1:\n memo[hash(n, x)] = 0\n return 0\n memo[hash(n, x)] = solve(n - 1, min(x - 1, T[n - 1]))\n if x >= T[n - 1] + 2:\n memo[hash(n, x)] += 1\n if x >= T[n - 1] + 3:\n memo[hash(n, x)] += solve(n - 1, min(x - 1 - T[n - 1] - 1, T[n - 1]))\n return memo[hash(n, x)]\n\n\nprint((solve(N, X)))\n","fast_code":"def f(L, x):\n if L == 0:\n return 0 if x <= 0 else 1\n if x <= total[L - 1] + 1:\n return f(L - 1, x - 1)\n else:\n return patties[L - 1] + 1 + f(L - 1, x - total[L - 1] - 2)\n\n\nN, X = list(map(int, input().split()))\ntotal = [1]\npatties = [1]\nfor i in range(50):\n total.append(total[-1] * 2 + 3)\n patties.append(patties[-1] * 2 + 1)\nprint((f(N, X)))\n"} +{"fast_code_id":"e88c6445042f3b66c9c2bb18a6d419bf3bd004b3f451ae421c0ba4d415fa5104","fast_id":"p02641_e88c6445042f3b66c9c2bb18a6d419bf3bd004b3f451ae421c0ba4d415fa5104","language":"python","measured_fast_code_id":"e88c6445042f3b66c9c2bb18a6d419bf3bd004b3f451ae421c0ba4d415fa5104","measured_slow_code_id":"56a803f01b0149391407a67301955076fc165a7ad3ad3f8f8a9f51ab5d8af60e","measurement_metric":"cpu_instruction_count","pair_id":"python_42957a7da520f506d053abe0","problem_id":"p02641","slow_code_id":"85cbb5049fb6ba315c1cc49d08aa7371cf037161b52bac8a421580f3486b7f72","slow_id":"p02641_56a803f01b0149391407a67301955076fc165a7ad3ad3f8f8a9f51ab5d8af60e","speedup":2.042646252766005,"stratum":"2-4","sampling_key":"550d1b13c58eea8dd7c85eb4a73a44d82e4aeee986726d00f61edaa1077a008f","slow_code":"x, n = list(map(int, input().split()))\nif n == 0:\n print(x)\n exit()\narr = list(map(int, input().split()))\narr2 = []\narr3 = []\nfor i in range(-50, 110):\n if not i in arr:\n arr2.append(i)\n arr3.append(abs(x - i))\nn2 = min([i for i, v in enumerate(arr3) if v == min(arr3)])\nprint((arr2[n2]))\n","fast_code":"X, N = list(map(int, input().split()))\nif N == 0:\n print(X)\n exit()\nelse:\n P = list(map(int, input().split()))\nL = [i for i in range(0, 102) if i not in P]\nif X in L:\n ANS = X\nelse:\n L.append(X)\n L = sorted(L)\n n = L.index(X)\n if L[n + 1] - L[n] < L[n] - L[n - 1]:\n ANS = L[n + 1]\n else:\n ANS = L[n - 1]\nprint(ANS)\n"} +{"fast_code_id":"a76d0913be2e6f46c10e43d2f92edb769b87ec5c37ab88b6fdc6958fe7b5e732","fast_id":"p02830_a76d0913be2e6f46c10e43d2f92edb769b87ec5c37ab88b6fdc6958fe7b5e732","language":"python","measured_fast_code_id":"a76d0913be2e6f46c10e43d2f92edb769b87ec5c37ab88b6fdc6958fe7b5e732","measured_slow_code_id":"992e686444192fb7564ecff1647d9aa6e75db539811d55b3349d5f91772e9ce3","measurement_metric":"cpu_instruction_count","pair_id":"python_42ca017b9a9b2788f6ee5214","problem_id":"p02830","slow_code_id":"992e686444192fb7564ecff1647d9aa6e75db539811d55b3349d5f91772e9ce3","slow_id":"p02830_992e686444192fb7564ecff1647d9aa6e75db539811d55b3349d5f91772e9ce3","speedup":15.65520944469469,"stratum":"8+","sampling_key":"0a8103ba75cc2dd1283fd6fe376a7369cefa5a7090024ac25ef02d2c07c49f1c","slow_code":"from collections import Counter, defaultdict, deque\nfrom heapq import heappop, heappush\nfrom bisect import bisect_left, bisect_right\nimport sys, math, itertools, fractions\n\nsys.setrecursionlimit(10**8)\nmod = 10**9 + 7\nINF = float(\"inf\")\n\n\ndef inp():\n return int(sys.stdin.readline())\n\n\ndef inpl():\n return list(map(int, sys.stdin.readline().split()))\n\n\nn = inp()\ns, t = input().split()\nprint((\"\".join([s[i] + t[i] for i in range(n)])))\n","fast_code":"import sys\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef mapint():\n return list(map(int, input().split()))\n\n\nsys.setrecursionlimit(10**9)\nN = int(eval(input()))\nS, T = input().split()\nans = \"\"\nfor s, t in zip(list(S), list(T)):\n ans += s + t\nprint(ans)\n"} +{"fast_code_id":"9a1626365f94b8a7d0331e3eabf1740b93398b58e75f9e3e35d2d82ea57bb14e","fast_id":"p02831_9a1626365f94b8a7d0331e3eabf1740b93398b58e75f9e3e35d2d82ea57bb14e","language":"python","measured_fast_code_id":"9a1626365f94b8a7d0331e3eabf1740b93398b58e75f9e3e35d2d82ea57bb14e","measured_slow_code_id":"3de3fe8bb1afacef9e4d94cddd67b61d71115eb2182c7ba15fc5dcbd918bfe9c","measurement_metric":"cpu_instruction_count","pair_id":"python_4359552d65a0fa7930cdf810","problem_id":"p02831","slow_code_id":"3de3fe8bb1afacef9e4d94cddd67b61d71115eb2182c7ba15fc5dcbd918bfe9c","slow_id":"p02831_3de3fe8bb1afacef9e4d94cddd67b61d71115eb2182c7ba15fc5dcbd918bfe9c","speedup":5.790126723402872,"stratum":"4-8","sampling_key":"04ca97f4476d1afa7246f9c95de4b649cafe687c863be12bb9ba439e2a0e35ae","slow_code":"a, b = list(map(int, input().split()))\ngcd = 0\nfor i in range(max(a, b), 0, -1):\n if a % i == 0 and b % i == 0:\n gcd = i\n break\nprint((a * b // gcd))\n","fast_code":"num1, num2 = list(map(int, input().split()))\nimport math\n\n\ndef gcd(num1, num2):\n for i in range(min(num1, num2), 0, -1):\n if num1 % i == 0 and num2 % i == 0:\n return i\n\n\nprint((int(num1 * num2 / gcd(num1, num2))))\n"} +{"fast_code_id":"0a79ea1289ea455ee2e87f5e23ce2c420aaa2e91faef82a25a595eb4a69155a5","fast_id":"p03018_0a79ea1289ea455ee2e87f5e23ce2c420aaa2e91faef82a25a595eb4a69155a5","language":"python","measured_fast_code_id":"0a79ea1289ea455ee2e87f5e23ce2c420aaa2e91faef82a25a595eb4a69155a5","measured_slow_code_id":"34cfcb0cd806549d9de932b7805e60b0300ac48d582c70a3b82e9e63ed79dbe3","measurement_metric":"cpu_instruction_count","pair_id":"python_435b9203e82db65241116508","problem_id":"p03018","slow_code_id":"2a81960ac1f47336dbb6ad3e8a3b063f1f7be21a97a77ab30f5ed64ce398f2f3","slow_id":"p03018_34cfcb0cd806549d9de932b7805e60b0300ac48d582c70a3b82e9e63ed79dbe3","speedup":2.726204965809406,"stratum":"2-4","sampling_key":"8a7cc4089555f82c45fd0adf7fbcc82ba3d2efafe652c7fa7a98d8bbca18d984","slow_code":"import sys\n\nstdin = sys.stdin\nri = lambda: int(rs())\nrl = lambda: list(map(int, stdin.readline().split()))\nrs = lambda: stdin.readline().rstrip()\nS = list(rs())\ncur = \"D\"\nanswer = 0\nA_cnt = 0\nfor s in S:\n if cur == \"A\":\n if s == \"A\":\n A_cnt += 1\n elif s == \"B\":\n cur = s\n else:\n cur = \"D\"\n A_cnt = 0\n elif cur == \"B\":\n if s == \"A\":\n A_cnt = 1\n cur = s\n elif s == \"B\":\n A_cnt = 0\n cur = \"D\"\n elif s == \"C\":\n answer += A_cnt\n cur = s\n else:\n cur = \"D\"\n A_cnt = 0\n elif cur == \"C\":\n if s == \"A\":\n A_cnt += 1\n cur = s\n elif s == \"B\":\n cur = s\n else:\n cur = \"D\"\n A_cnt = 0\n else:\n if s == \"A\":\n A_cnt += 1\n cur = s\n else:\n A_cnt = 0\n cur = \"D\"\nprint(answer)\n","fast_code":"import sys\n\n\ndef main():\n input = sys.stdin.readline\n S = input().strip()\n S = S.replace(\"BC\", \"D\")\n ans = 0\n cnt = 0\n for c in S:\n if c == \"A\":\n cnt += 1\n elif c == \"D\":\n ans += cnt\n else:\n cnt = 0\n return ans\n\n\nif __name__ == \"__main__\":\n print((main()))\n"} +{"fast_code_id":"4a8f699c607c2f39c36203edd82dc590a1660393ef0dd078a766ddac612fbfdb","fast_id":"p03721_4a8f699c607c2f39c36203edd82dc590a1660393ef0dd078a766ddac612fbfdb","language":"python","measured_fast_code_id":"4a8f699c607c2f39c36203edd82dc590a1660393ef0dd078a766ddac612fbfdb","measured_slow_code_id":"75d5b758a5047678745153d41c380f660afa7f9d4f81ada1ef8c3eb0b4fb4d9c","measurement_metric":"cpu_instruction_count","pair_id":"python_43728df6d6e6edeb7933eb84","problem_id":"p03721","slow_code_id":"75d5b758a5047678745153d41c380f660afa7f9d4f81ada1ef8c3eb0b4fb4d9c","slow_id":"p03721_75d5b758a5047678745153d41c380f660afa7f9d4f81ada1ef8c3eb0b4fb4d9c","speedup":4.371564161231039,"stratum":"4-8","sampling_key":"33d928bbdd249214bf8a4b77e8b8d5cdb37deb5909f5be0bbc91843f762d4fb1","slow_code":"import sys\nimport numpy as np\nimport collections\n\nn, k = [int(x) for x in sys.stdin.readline().split()]\nr = collections.defaultdict(int)\nfor i in range(n):\n a, b = [int(x) for x in sys.stdin.readline().split()]\n r[a] += b\nd = sorted(r.items())\nc = 0\nfor i, j in enumerate(d):\n c += j[1]\n if c >= k:\n print((int(j[0])))\n break\n","fast_code":"N, K = list(map(int, input().split()))\nlst_ab = sorted([tuple(map(int, input().split())) for _ in range(N)])\nlength = 0\nfor i in range(N):\n ai, bi = lst_ab[i][0], lst_ab[i][1]\n length += bi\n if length >= K:\n ans = ai\n print(ans)\n break\n"} +{"fast_code_id":"9b8c4cfe0b7b0b64a53ebc57e5b9e4b166323eb14ae9b22a1e32128ae71b2c73","fast_id":"p02830_66687d79dbff10c3e182b72780f54d2b9fbbcbcf038e0bbd64c80444d9b9bd3a","language":"python","measured_fast_code_id":"66687d79dbff10c3e182b72780f54d2b9fbbcbcf038e0bbd64c80444d9b9bd3a","measured_slow_code_id":"241afa9a4a462ffb4a4454131541737b779c1c29e81784f31982be1ef01be8e4","measurement_metric":"cpu_instruction_count","pair_id":"python_439ab02d85f08e9bacaa0a15","problem_id":"p02830","slow_code_id":"241afa9a4a462ffb4a4454131541737b779c1c29e81784f31982be1ef01be8e4","slow_id":"p02830_241afa9a4a462ffb4a4454131541737b779c1c29e81784f31982be1ef01be8e4","speedup":14.948402359385268,"stratum":"8+","sampling_key":"0ad044a2d93ec9642bf5bf0c5cef699c49edb178e7ad0f030433abbcb219ddf1","slow_code":"from collections import Counter, defaultdict, deque\nfrom heapq import heappop, heappush, heapify\nimport sys, bisect, math, itertools, fractions, pprint\n\nsys.setrecursionlimit(10**8)\nmod = 10**9 + 7\nmod2 = 998244353\nINF = float(\"inf\")\n\n\ndef inp():\n return int(sys.stdin.readline())\n\n\ndef inpl():\n return list(map(int, sys.stdin.readline().split()))\n\n\ndef inpln(n):\n return list(int(sys.stdin.readline()) for i in range(n))\n\n\nn = inp()\ns, t = input().split()\nres = \"\"\nfor i in range(n):\n res += s[i] + t[i]\nprint(res)\n","fast_code":"def main():\n import sys\n\n input = sys.stdin.readline\n sys.setrecursionlimit(10**7)\n from collections import Counter, deque\n\n from itertools import combinations, permutations, accumulate, groupby\n\n from bisect import bisect_left, bisect_right\n from heapq import heapify, heappop, heappush\n from math import floor, ceil\n\n n = int(eval(input()))\n s, t = input().rstrip().split()\n res = \"\"\n for a, b in zip(s, t):\n res += a + b\n print(res)\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"989e8dd4ce036c9244fbd2ef32b672367097371ed9d7103e50cee378ecb5da12","fast_id":"p02821_c9efb7d18af49a59dd15a1250de2e653148c9f6ae74e009e94a5daac7c99a967","language":"python","measured_fast_code_id":"c9efb7d18af49a59dd15a1250de2e653148c9f6ae74e009e94a5daac7c99a967","measured_slow_code_id":"97130d6ace5a903e1edc12eb8a93320b23b47ebb28afc38859a52235b5d542cf","measurement_metric":"cpu_instruction_count","pair_id":"python_442817a5c23704678d26b90a","problem_id":"p02821","slow_code_id":"97130d6ace5a903e1edc12eb8a93320b23b47ebb28afc38859a52235b5d542cf","slow_id":"p02821_97130d6ace5a903e1edc12eb8a93320b23b47ebb28afc38859a52235b5d542cf","speedup":4.3357015345219425,"stratum":"4-8","sampling_key":"1009366768c99f6c4066dbee9974ca4f5b9202d4e9c3e5f9fc3acba927dd5529","slow_code":"import numpy\n\nn, m = [int(i) for i in input().split()]\nA = [int(i) for i in input().split()]\nsup_A = 10**5\nB = [0] * (1 << 18)\nfor a in A:\n B[a] += 1\nC = numpy.fft.fft(B)\nD = numpy.fft.ifft(C * C)\nans = 0\ncnt = 0\nfor i in range(2 * sup_A, -1, -1):\n d = int(D[i].real + 0.5)\n if cnt + d >= m:\n ans += (m - cnt) * i\n break\n cnt += d\n ans += i * d\nprint(ans)\n","fast_code":"from collections import Counter, defaultdict, deque\nfrom heapq import heappop, heappush, heapify\nimport sys, bisect, math, itertools, fractions, pprint\n\nsys.setrecursionlimit(10**8)\nmod = 10**9 + 7\nINF = float(\"inf\")\n\n\ndef inp():\n return int(sys.stdin.readline())\n\n\ndef inpl():\n return list(map(int, sys.stdin.readline().split()))\n\n\nn, m = inpl()\na = sorted(inpl())\nng = 10**9 + 1\nok = -1\n\n\ndef sol(x):\n cnt = 0\n for i, t in enumerate(a):\n tmp = x - t\n c = bisect.bisect_left(a, tmp)\n cnt += n - c\n return True if cnt >= m else False\n\n\nwhile ng - ok > 1:\n mid = (ng + ok) // 2\n if sol(mid):\n ok = mid\n else:\n ng = mid\n\n\nres = 0\ncnt = 0\nrevc = [0]\nfor i in range(n)[::-1]:\n revc.append(revc[-1] + a[i])\n\nfor i in range(n):\n j = n - bisect.bisect_left(a, ok - a[i])\n res += j * a[i] + revc[j]\n cnt += j\nres -= (cnt - m) * ok\nprint(res)\n"} +{"fast_code_id":"1e1c299b5e83115d9ac6c57448cb5f9bda4a67983b8a00d37f20ef3772178dab","fast_id":"p03309_1e1c299b5e83115d9ac6c57448cb5f9bda4a67983b8a00d37f20ef3772178dab","language":"python","measured_fast_code_id":"1e1c299b5e83115d9ac6c57448cb5f9bda4a67983b8a00d37f20ef3772178dab","measured_slow_code_id":"cc6340aab617e7100bd4d51ff3921118d5d3dad1bda63cfcf3f2026a849def46","measurement_metric":"cpu_instruction_count","pair_id":"python_44c2a9eb8ed88b6125b6b10b","problem_id":"p03309","slow_code_id":"364f3596fd84d0acd37a6dd5d8da1a36ebb61efbb957346157757658db88473b","slow_id":"p03309_cc6340aab617e7100bd4d51ff3921118d5d3dad1bda63cfcf3f2026a849def46","speedup":3.2116333863347455,"stratum":"2-4","sampling_key":"2b42ff53afe507da5c4b5ff153e994aae2802513264622d53dc9a94b7ca8093f","slow_code":"if __name__ == \"__main__\":\n from statistics import median\n\n n = int(eval(input()))\n a = list(map(int, input().split()))\n total = 0\n\n mod_a = sorted([ai - i for i, ai in enumerate(a, 1)])\n b = median(mod_a)\n for i in range(n):\n total += abs(mod_a[i] - b)\n print((int(total)))\n","fast_code":"n = int(eval(input()))\na = list(map(int, input().split()))\narr = sorted([a[i] - i - 1 for i in range(n)])\nif len(arr) % 2 == 0:\n tmp = [arr[len(arr) // 2 - 1], arr[len(arr) // 2]]\nelse:\n tmp = [arr[len(arr) // 2]]\nans = 10**20\nfor b in tmp:\n ans = min(ans, sum([abs(a[i] - b - i - 1) for i in range(n)]))\nprint(ans)\n"} +{"fast_code_id":"8a16d58ba1b2f27049215d9a438bbca28f84c608e831115d5306f1aa2c301a6d","fast_id":"p03329_8a16d58ba1b2f27049215d9a438bbca28f84c608e831115d5306f1aa2c301a6d","language":"python","measured_fast_code_id":"8a16d58ba1b2f27049215d9a438bbca28f84c608e831115d5306f1aa2c301a6d","measured_slow_code_id":"112cb14713b16c849463df028f1f5a909490a9b48748b2aa56af52590c63bf80","measurement_metric":"cpu_instruction_count","pair_id":"python_44d1175d3a4ec9aac5f9fbb5","problem_id":"p03329","slow_code_id":"fb090435a661e9225aa98f3353af462d8f138d073c0f311ebd2db4e36ee5e685","slow_id":"p03329_112cb14713b16c849463df028f1f5a909490a9b48748b2aa56af52590c63bf80","speedup":1230.1597222584564,"stratum":"8+","sampling_key":"607d4fc1d7dec54dd1f50215b6eb4c24206fd4d5bcf3a7100378ee1b1633bcad","slow_code":"n = int(eval(input()))\nk9 = 5\nk6 = 6\nn9 = 9**k9\nsmin = n\nfor i9 in range(n9):\n ii9 = i9\n s = 0\n m = 0\n astr = \"\"\n for ii in range(1, k9 + 2):\n r9 = ii9 % 9\n ii9 = (ii9 - r9) // 9\n s = s * 9 + r9\n m = m + r9\n astr = astr + str(r9)\n\n nr = n - s\n nr1 = nr\n\n if nr == 0:\n snra = m\n\n elif nr > 0:\n snra = m\n for jj in range(k6, -1, -1):\n nra = nr1 // (6**jj)\n nr1 = nr1 % (6**jj)\n snra = snra + nra\n\n if smin > snra:\n smin = snra\nprint(smin)\n","fast_code":"N = int(eval(input()))\nsixs = [6**i for i in range(1, 7)]\nnines = [9**i for i in range(1, 6)]\ntmp = {}\n\n\ndef dfs(n):\n if n < 6:\n return n\n if n in tmp:\n return tmp[n]\n m = 10**9 + 7\n if n >= 9:\n max_nine = max(nine for nine in nines if nine <= n)\n if n % max_nine == 0:\n m = min(m, n // max_nine)\n else:\n m = min(m, dfs(n - max_nine) + 1)\n max_six = max(six for six in sixs if six <= n)\n if n % max_six == 0:\n m = min(m, n // max_six)\n tmp[n] = min(m, dfs(n - max_six) + 1)\n return tmp[n]\n\n\nprint((dfs(N)))\n"} +{"fast_code_id":"23ec83f55c7e4b6b8f407a26dff911ea30fc8cd13d3543c8d1958de155e3debc","fast_id":"p03183_29bcc2a8e0525f89522e32d3e5a6be888b3863cd0cedb0f65a55127dba7825b9","language":"python","measured_fast_code_id":"29bcc2a8e0525f89522e32d3e5a6be888b3863cd0cedb0f65a55127dba7825b9","measured_slow_code_id":"961ff7e33dcf41c91be9ccd5c27fe0c80e6fd0d2467fec260e8393b575caab59","measurement_metric":"cpu_instruction_count","pair_id":"python_44f2b88d52ce8e07b9b049b0","problem_id":"p03183","slow_code_id":"961ff7e33dcf41c91be9ccd5c27fe0c80e6fd0d2467fec260e8393b575caab59","slow_id":"p03183_961ff7e33dcf41c91be9ccd5c27fe0c80e6fd0d2467fec260e8393b575caab59","speedup":2.298844935906171,"stratum":"2-4","sampling_key":"e156dbfe6713385e5cb5106c495454a259a81142bfcdb85d0ff6bf6dedb500cb","slow_code":"import sys\n\nsys.setrecursionlimit(2147483647)\nINF = float(\"inf\")\nMOD = 10**9 + 7\ninput = lambda: sys.stdin.readline().rstrip()\n\n\ndef resolve():\n from functools import cmp_to_key\n\n n = int(eval(input()))\n B = [list(map(int, input().split())) for _ in range(n)]\n\n def cmp(a, b):\n va = min(a[1], b[1] - a[0])\n vb = min(b[1], a[1] - b[0])\n if va == vb:\n return 0\n return -1 if (va > vb) else 1\n\n B.sort(key=cmp_to_key(cmp))\n maxS = 20000\n dp = [-INF] * (maxS + 1)\n dp[0] = 0\n for i in range(n):\n w, s, v = B[i]\n ndp = dp[:]\n for total in range(maxS + 1):\n if total <= s and total + s <= maxS:\n ndp[total + w] = max(ndp[total + w], dp[total] + v)\n dp = ndp[:]\n print((max(dp)))\n\n\nresolve()\n","fast_code":"import sys\n\nsys.setrecursionlimit(2147483647)\nINF = 1 << 60\nMOD = 10**9 + 7\ninput = lambda: sys.stdin.readline().rstrip()\n\n\ndef resolve():\n n = int(eval(input()))\n WSV = [tuple(map(int, input().split())) for _ in range(n)]\n WSV.sort(key=lambda tup: tup[0] + tup[1])\n\n res = 0\n solid_max = 10**4\n dp = [-1] * (solid_max + 1)\n dp[0] = 0\n for w0, s0, v in WSV:\n for w in range(solid_max, -1, -1):\n if dp[w] == -1:\n continue\n if w > s0:\n continue\n if w + w0 > solid_max:\n res = max(res, dp[w] + v)\n else:\n dp[w + w0] = max(dp[w + w0], dp[w] + v)\n res = max(res, max(dp))\n print(res)\n\n\nresolve()\n"} +{"fast_code_id":"47a30a0977dd298e960bee922b0a4f2ce31ef23466de0e7327d84731c6a7007f","fast_id":"p03636_a8f2beff358e4b1aab7c9afc72df19f07878ce91898a6b68d012c7f6fbaa111d","language":"python","measured_fast_code_id":"a8f2beff358e4b1aab7c9afc72df19f07878ce91898a6b68d012c7f6fbaa111d","measured_slow_code_id":"5494f91b3cea4c891c6cbf71fe983d4d33ab7f0ec16a1291db2cdbe427651f21","measurement_metric":"cpu_instruction_count","pair_id":"python_44fbcf064181bafcaee8eaec","problem_id":"p03636","slow_code_id":"da6dc96aa5d834038d28d109d605a384e0fe4a59a283760b08b599d7fd1f90de","slow_id":"p03636_5494f91b3cea4c891c6cbf71fe983d4d33ab7f0ec16a1291db2cdbe427651f21","speedup":2.9756418090264662,"stratum":"2-4","sampling_key":"80b3858f47423c2682ceff0ab0ac82717ed697244e890683c3bf1d8cc45c1e66","slow_code":"import sys\n\nsys.setrecursionlimit(10**7)\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef LI2():\n return list(map(int, sys.stdin.readline().rstrip()))\n\n\ndef S():\n return sys.stdin.readline().rstrip()\n\n\ndef LS():\n return list(sys.stdin.readline().rstrip().split())\n\n\ndef LS2():\n return list(sys.stdin.readline().rstrip())\n\n\ns = LS2()\nprint((s[0] + str(len(s) - 2) + s[-1]))\n","fast_code":"import sys\n\n\ndef LS2():\n return list(sys.stdin.readline().rstrip())\n\n\ns = LS2()\nprint((s[0] + str(len(s) - 2) + s[-1]))\n"} +{"fast_code_id":"e24d294375f12514a13c38eb72758e7692b14300c96474cb830c07fedda27351","fast_id":"p02959_e24d294375f12514a13c38eb72758e7692b14300c96474cb830c07fedda27351","language":"python","measured_fast_code_id":"e24d294375f12514a13c38eb72758e7692b14300c96474cb830c07fedda27351","measured_slow_code_id":"f0395674e51675bd438b96a7f18fa9739566f756efa1ea79ea087d0b83a10e1f","measurement_metric":"cpu_instruction_count","pair_id":"python_452e202ca0c568308e48d796","problem_id":"p02959","slow_code_id":"f0395674e51675bd438b96a7f18fa9739566f756efa1ea79ea087d0b83a10e1f","slow_id":"p02959_f0395674e51675bd438b96a7f18fa9739566f756efa1ea79ea087d0b83a10e1f","speedup":2.545570859035719,"stratum":"2-4","sampling_key":"ffd7ffe23b211594e479d72be68e8f4b10dc6c0fa686b3257e0e81068ead7023","slow_code":"N = int(eval(input()))\nA = list(map(int, input().split()))\nB = list(map(int, input().split()))\nans = 0\nfor i in range(N):\n if i % 2 == 0:\n if A[i // 2] >= B[i // 2]:\n A[i // 2] -= B[i // 2]\n ans += B[i // 2]\n B[i // 2] = 0\n else:\n B[i // 2] -= A[i // 2]\n ans += A[i // 2]\n A[i // 2] = 0\n if A[i // 2 + 1] >= B[i // 2]:\n A[i // 2 + 1] -= B[i // 2]\n ans += B[i // 2]\n B[i // 2] = 0\n else:\n B[i // 2] -= A[i // 2 + 1]\n ans += A[i // 2 + 1]\n A[i // 2 + 1] = 0\n else:\n if A[N - i // 2] >= B[N - i // 2 - 1]:\n A[N - i // 2] -= B[N - i // 2 - 1]\n ans += B[N - i // 2 - 1]\n B[N - i // 2 - 1] = 0\n else:\n B[N - i // 2 - 1] -= A[N - i // 2]\n ans += A[N - i // 2]\n A[N - i // 2] = 0\n if A[N - i // 2 - 1] >= B[N - i // 2 - 1]:\n A[N - i // 2 - 1] -= B[N - i // 2 - 1]\n ans += B[N - i // 2 - 1]\n B[N - i // 2 - 1] = 0\n else:\n B[N - i // 2 - 1] -= A[N - i // 2 - 1]\n ans += A[N - i // 2 - 1]\n A[N - i // 2 - 1] = 0\nprint(ans)\n","fast_code":"from sys import stdin\n\n\ndef main():\n lines = stdin.readlines()\n A = tuple(map(int, lines[1].split()))\n B = tuple(map(int, lines[2].split()))\n pre = A[0]\n ans = 0\n for a, b in zip(A[1:], B):\n tmp1 = min(pre, b)\n b -= tmp1\n tmp2 = min(a, b)\n ans += tmp1 + tmp2\n pre = a - tmp2\n print(ans)\n return\n\n\nmain()\n"} +{"fast_code_id":"65656aa9840feee1b9dbc9331beceb30a0d208678996748f9638072a52c69443","fast_id":"p02681_65656aa9840feee1b9dbc9331beceb30a0d208678996748f9638072a52c69443","language":"python","measured_fast_code_id":"65656aa9840feee1b9dbc9331beceb30a0d208678996748f9638072a52c69443","measured_slow_code_id":"e11f3e444910fe42a6baf012b95849e72747767315b4086506c83bd0c43f1245","measurement_metric":"cpu_instruction_count","pair_id":"python_4544929e0ba40a2e3b8a7b74","problem_id":"p02681","slow_code_id":"aead1926afd539d76d7800cd27f3761ad24e19df52b7dacf9e4a54d6feb221d2","slow_id":"p02681_e11f3e444910fe42a6baf012b95849e72747767315b4086506c83bd0c43f1245","speedup":44.18652873902622,"stratum":"8+","sampling_key":"98faaf0576f7bafa5c604d9ee707af85a8deab7380891ca200cf6b25e86c9705","slow_code":"from typing import *\nimport itertools\nimport math\nimport sys\n\nINF = float(\"inf\")\nYES = \"Yes\"\nNO = \"No\"\n\n\ndef solve(S: str, T: str):\n return [NO, YES][S == T[:-1]]\n\n\ndef main():\n sys.setrecursionlimit(10**6)\n\n def iterate_tokens():\n for line in sys.stdin:\n for word in line.split():\n yield word\n\n tokens = iterate_tokens()\n S = next(tokens)\n T = next(tokens)\n print((solve(S, T)))\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"s = input()\nt = input()\nprint(\"Yes\") if t == s + t[-1] else print(\"No\")\n"} +{"fast_code_id":"03aa5f664ead8651e440f412429a1149561123cd4c6e6a5a427aa6c8f0bc4aae","fast_id":"p03796_03aa5f664ead8651e440f412429a1149561123cd4c6e6a5a427aa6c8f0bc4aae","language":"python","measured_fast_code_id":"03aa5f664ead8651e440f412429a1149561123cd4c6e6a5a427aa6c8f0bc4aae","measured_slow_code_id":"95063337f9fc361b9b14d99b5c0d5d9f7a1898eff61239e227f8e13abc528c4c","measurement_metric":"cpu_instruction_count","pair_id":"python_4550b5cdd5dc439bcd5b1e6d","problem_id":"p03796","slow_code_id":"95063337f9fc361b9b14d99b5c0d5d9f7a1898eff61239e227f8e13abc528c4c","slow_id":"p03796_95063337f9fc361b9b14d99b5c0d5d9f7a1898eff61239e227f8e13abc528c4c","speedup":3.7464893910356185,"stratum":"2-4","sampling_key":"a2eac100808372b2162847d1730adc09fe8e7a0bd71ce35a8c4dd20312a152c0","slow_code":"import sys\nimport os\nimport math\n\nMOD = 1000000007\n\n\ndef main():\n if os.getenv(\"LOCAL\"):\n sys.stdin = open(\"input.txt\", \"r\")\n N = int(sys.stdin.readline().rstrip())\n print((math.factorial(N) % MOD))\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"n = int(eval(input()))\n\n\ndef a(x):\n if x == 1:\n return 1\n else:\n d = 1\n for i in range(x + 1)[1:]:\n d *= i\n d %= 10**9 + 7\n return d\n\n\nprint((a(n)))\n"} +{"fast_code_id":"1674d29b1c29eb7a515765fc686af9133c83b8ae4dd702bef2d311bfef74ecad","fast_id":"p02549_1674d29b1c29eb7a515765fc686af9133c83b8ae4dd702bef2d311bfef74ecad","language":"python","measured_fast_code_id":"1674d29b1c29eb7a515765fc686af9133c83b8ae4dd702bef2d311bfef74ecad","measured_slow_code_id":"44c9516e92f38f09d76b47812276c2878e77eeefdb8dab9cc1137c27ddfc7b8e","measurement_metric":"cpu_instruction_count","pair_id":"python_45b9461740a58aad88b7f6dc","problem_id":"p02549","slow_code_id":"44c9516e92f38f09d76b47812276c2878e77eeefdb8dab9cc1137c27ddfc7b8e","slow_id":"p02549_44c9516e92f38f09d76b47812276c2878e77eeefdb8dab9cc1137c27ddfc7b8e","speedup":2.5889325378909365,"stratum":"2-4","sampling_key":"56e719b0f1376a93d74a74283acea4033561ef766bc23e04f5af74f7f815dc55","slow_code":"mod = 998244353\nn, k = list(map(int, input().split()))\nK = [list(map(int, input().split())) for i in range(k)]\ndp = [0] * (n + 5)\ndp[1] = 1\ndp2 = [0] * (n + 5)\nfor i in range(1, n + 1):\n dp[i] = (dp[i] + dp2[i] + dp2[i - 1]) % mod\n dp2[i] = (dp2[i] + dp2[i - 1]) % mod\n for l, r in K:\n dp2[min(i + l, n + 2)] += dp[i]\n dp2[min(i + l, n + 2)] %= mod\n dp2[min(i + r + 1, n + 2)] -= dp[i]\n dp2[min(i + r + 1, n + 2)] %= mod\nprint((dp[n] % mod))\n","fast_code":"p = 998244353\nn, k = list(map(int, input().split()))\nLRs = []\nfor j in range(k):\n lj, rj = list(map(int, input().split()))\n LRs.append((lj, rj))\nA = [0] * (n + 1)\ni0 = min(lj for lj, rj in LRs)\nA[0] = 1\nA[i0] = 1\nfor i in range(i0 + 1, n):\n A[i] = A[i - 1]\n for j in range(k):\n lj, rj = LRs[j]\n if i - lj >= 0:\n A[i] += A[i - lj]\n if i - 1 - rj >= 0:\n A[i] -= A[i - 1 - rj]\n A[i] %= p\nprint((A[n - 1]))\n"} +{"fast_code_id":"015047b170b9c1e69815320904314181f54f1d92d1527ba6cbad8ecfb12b3c42","fast_id":"p03251_bbb46fd0d96d4c381198c2311c4195f70f0dd6dc4e22422ee5082fdcad0e52d8","language":"python","measured_fast_code_id":"bbb46fd0d96d4c381198c2311c4195f70f0dd6dc4e22422ee5082fdcad0e52d8","measured_slow_code_id":"5ce8798f598c49e1a4c395a4c8846ff472fdaac4991833a8da4555eab052e27f","measurement_metric":"cpu_instruction_count","pair_id":"python_46cebb6071f36a033b7f0fde","problem_id":"p03251","slow_code_id":"5a881080c64c83352de556b20fff7b0700f2ff443a5f03182fd4ed0f3d7f6e7c","slow_id":"p03251_5ce8798f598c49e1a4c395a4c8846ff472fdaac4991833a8da4555eab052e27f","speedup":7.645284232649253,"stratum":"4-8","sampling_key":"5e27fa377816d0046777e66e464de9a4910a111416d4b7a5a0b796f9572d67da","slow_code":"import bisect\nimport heapq\nimport math\nimport random\nimport sys\nfrom collections import Counter, defaultdict, deque\nfrom decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal\nfrom functools import lru_cache, reduce\nfrom itertools import combinations, combinations_with_replacement, product, permutations\nfrom operator import add, mul, sub\n\nsys.setrecursionlimit(10000)\n\n\ndef read_int():\n return int(input())\n\n\ndef read_int_n():\n return list(map(int, input().split()))\n\n\ndef read_float():\n return float(input())\n\n\ndef read_float_n():\n return list(map(float, input().split()))\n\n\ndef read_str():\n return input().strip()\n\n\ndef read_str_n():\n return list(map(str, input().split()))\n\n\ndef error_print(*args):\n print(*args, file=sys.stderr)\n\n\ndef mt(f):\n import time\n\n def wrap(*args, **kwargs):\n s = time.time()\n ret = f(*args, **kwargs)\n e = time.time()\n error_print(e - s, \"sec\")\n return ret\n\n return wrap\n\n\n@mt\ndef slv(N, M, X, Y, x, y):\n mx = max(x)\n my = min(y)\n error_print(mx, my)\n if mx < my and (my > X and mx < Y):\n return \"No War\"\n return \"War\"\n\n\ndef main():\n N, M, X, Y = read_int_n()\n x = read_int_n()\n y = read_int_n()\n print(slv(N, M, X, Y, x, y))\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"s = input()\nn, m, x, y = [int(x) for x in s.split()]\nxx = [int(a) for a in input().split()]\nyy = [int(a) for a in input().split()]\nxx = sorted(xx)\nyy = sorted(yy)\nif xx[-1] >= y or yy[0] <= x or xx[-1] >= yy[0]:\n print(\"War\")\nelse:\n print(\"No War\")\n"} +{"fast_code_id":"44ab35a9714ea188a11aedb20f3ea7103bd930af4ad186337881b8ed88a0b55b","fast_id":"p02406_44ab35a9714ea188a11aedb20f3ea7103bd930af4ad186337881b8ed88a0b55b","language":"python","measured_fast_code_id":"44ab35a9714ea188a11aedb20f3ea7103bd930af4ad186337881b8ed88a0b55b","measured_slow_code_id":"def78739ac97a98fac5a75497b769f50dcbad6c21d955142939d7265bd3b3875","measurement_metric":"cpu_instruction_count","pair_id":"python_46d8454bb323ac12d99b91cc","problem_id":"p02406","slow_code_id":"def78739ac97a98fac5a75497b769f50dcbad6c21d955142939d7265bd3b3875","slow_id":"p02406_def78739ac97a98fac5a75497b769f50dcbad6c21d955142939d7265bd3b3875","speedup":2.6920967867113585,"stratum":"2-4","sampling_key":"13e2ca216d833becb73fc93bf0c27cd7939e745a213093877cec1fca8c4fee1a","slow_code":"n = int(input())\ni = 1\nprint(\"\", end=\" \")\nwhile i <= n:\n if i % 3 == 0:\n print(i, end=\" \")\n else:\n I = str(i)\n for j in range(len(I)):\n if I[j] == \"3\":\n print(I, end=\" \")\n break\n i += 1\n","fast_code":"print(\n \"\".join(\n \" \" + str(i) for i in range(1, eval(input()) + 1) if i % 3 == 0 or \"3\" in str(i)\n )\n)\n"} +{"fast_code_id":"dbd350b32c9a321094be118186d75675a1d4b57f45f363051debc6add16a98be","fast_id":"p03292_dbd350b32c9a321094be118186d75675a1d4b57f45f363051debc6add16a98be","language":"python","measured_fast_code_id":"dbd350b32c9a321094be118186d75675a1d4b57f45f363051debc6add16a98be","measured_slow_code_id":"faa891db4ffaee1d866cb055fc25102fe2fdbef2a88825c6cf3be4f0ebd9170c","measurement_metric":"cpu_instruction_count","pair_id":"python_47154c093655f88d477da4ea","problem_id":"p03292","slow_code_id":"faa891db4ffaee1d866cb055fc25102fe2fdbef2a88825c6cf3be4f0ebd9170c","slow_id":"p03292_faa891db4ffaee1d866cb055fc25102fe2fdbef2a88825c6cf3be4f0ebd9170c","speedup":3.3063957919713878,"stratum":"2-4","sampling_key":"59371c79b093ace6e74a0d74212686d40586a6c486370f93551c03c67fe50862","slow_code":"A1, A2, A3 = list(map(int, input().split()))\nA = [A1, A2, A3]\nA.append(A1)\n\n\ndef A_(i):\n if A[i] - A[i + 1] >= 0:\n return A[i] - A[i + 1]\n else:\n return A[i + 1] - A[i]\n\n\nB = [A_(i) for i in range(3)]\nB.append(A_(0))\nB.append(A_(1))\n\n\ndef sum(j):\n return B[j] + B[j + 1]\n\n\nC = [sum(j) for j in range(3)]\nprint((min(C)))\n","fast_code":"a = list(map(int, input().split()))\na.sort()\nprint((abs(a[0] - a[1]) + abs(a[1] - a[2])))\n"} +{"fast_code_id":"8826fb0daefc83aae2bea565402bfb5395b7ad9db29e4f94c4827fe2c2cb8299","fast_id":"p03945_8826fb0daefc83aae2bea565402bfb5395b7ad9db29e4f94c4827fe2c2cb8299","language":"python","measured_fast_code_id":"8826fb0daefc83aae2bea565402bfb5395b7ad9db29e4f94c4827fe2c2cb8299","measured_slow_code_id":"5aa07ee487bfacf8aa3a82dd81b2b10fa732ec49d72693d3bf0bfcc0a681a4da","measurement_metric":"cpu_instruction_count","pair_id":"python_473bbfa54e427165e8207895","problem_id":"p03945","slow_code_id":"5aa07ee487bfacf8aa3a82dd81b2b10fa732ec49d72693d3bf0bfcc0a681a4da","slow_id":"p03945_5aa07ee487bfacf8aa3a82dd81b2b10fa732ec49d72693d3bf0bfcc0a681a4da","speedup":5.607143353435709,"stratum":"4-8","sampling_key":"e8f868960bca4d74ef7f02c8bfdcea2d2a3050678d552550c27f83b676c18dff","slow_code":"import sys\n\ns = sys.stdin.readline().rstrip()\n\n\ndef main():\n prev = \"$\"\n cnt = -1\n for c in s:\n cnt += c != prev\n prev = c\n print(cnt)\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"print((sum(map(input().count, [\"WB\", \"BW\"]))))\n"} +{"fast_code_id":"8facf72be6f94eaaca96212696f14fa1652f6a2dfc73c4dc2f3b7a218d94be37","fast_id":"p02570_8facf72be6f94eaaca96212696f14fa1652f6a2dfc73c4dc2f3b7a218d94be37","language":"python","measured_fast_code_id":"8facf72be6f94eaaca96212696f14fa1652f6a2dfc73c4dc2f3b7a218d94be37","measured_slow_code_id":"c18a3a7e4014bde24e915dc4b9c7a40ca0c367289dfe9b646d5af979ad55733c","measurement_metric":"cpu_instruction_count","pair_id":"python_47a5e78c1676230abc980e92","problem_id":"p02570","slow_code_id":"a6a6da28ea21eb5c6cfeb4da55db52d83b5c9e592e210fb6c9a771a885099c2e","slow_id":"p02570_c18a3a7e4014bde24e915dc4b9c7a40ca0c367289dfe9b646d5af979ad55733c","speedup":23.484755576480545,"stratum":"8+","sampling_key":"023fe8a5428e732bdec4bd43e1c1bfc56c5a8a57b19a7111a9e63cbd829ab0ea","slow_code":"def LI():\n return list(map(int, input().split()))\n\n\ndef II():\n return int(input())\n\n\ndef yes():\n return print(\"Yes\")\n\n\ndef no():\n return print(\"No\")\n\n\nINF = float(\"inf\")\nfrom collections import deque, defaultdict, Counter\nfrom heapq import heappop, heappush\nfrom itertools import product, combinations\nfrom functools import reduce, lru_cache\nfrom math import pi, gcd\nfrom decimal import Decimal\n\n\nclass Combination:\n\n def __init__(self, n_max, mod=10**9 + 7):\n self.mod = mod\n self.modinv = self.make_modinv_list(n_max)\n self.fac, self.facinv = self.make_factorial_list(n_max)\n\n def __call__(self, n, r):\n return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n - r] % self.mod\n\n def make_factorial_list(self, n):\n\n fac = [1]\n facinv = [1]\n for i in range(1, n + 1):\n fac.append(fac[i - 1] * i % self.mod)\n facinv.append(facinv[i - 1] * self.modinv[i] % self.mod)\n return fac, facinv\n\n def make_modinv_list(self, n):\n\n modinv = [0] * (n + 1)\n modinv[1] = 1\n for i in range(2, n + 1):\n modinv[i] = self.mod - self.mod // i * modinv[self.mod % i] % self.mod\n return modinv\n\n\nclass Unionfind:\n def __init__(self, N):\n self.p = list(range(N))\n self.rank = [0] * N\n self.size = [1] * N\n\n def root(self, x):\n if self.p[x] != x:\n self.p[x] = self.root(self.p[x])\n return self.p[x]\n\n def same(self, x, y):\n return self.root(x) == self.root(y)\n\n def unite(self, x, y):\n u = self.root(x)\n v = self.root(y)\n if u == v:\n return\n if self.rank[u] < self.rank[v]:\n self.p[u] = v\n self.size[v] += self.size[u]\n self.size[u] = 0\n else:\n self.p[v] = u\n self.size[u] += self.size[v]\n self.size[v] = 0\n if self.rank[u] == self.rank[v]:\n self.rank[u] += 1\n\n def count(self, x):\n return self.size[self.root(x)]\n\n\nd, t, s = LI()\nif d <= t * s:\n print(\"Yes\")\nelse:\n print(\"No\")\n","fast_code":"X = input().split()\nD = int(X[0])\nT = int(X[1])\nS = int(X[2])\ntime = D / S\nif time <= T:\n print(\"Yes\")\nelse:\n print(\"No\")\n"} +{"fast_code_id":"f770b1c4b54851492ce22a1cc6099599b5ce0eed94268f079ec2ce07d300bccc","fast_id":"p03816_f770b1c4b54851492ce22a1cc6099599b5ce0eed94268f079ec2ce07d300bccc","language":"python","measured_fast_code_id":"f770b1c4b54851492ce22a1cc6099599b5ce0eed94268f079ec2ce07d300bccc","measured_slow_code_id":"f87c28f4ead9129969c541ae0db2fc7733f521c7e96aafae7cfa3be3414a8fa8","measurement_metric":"cpu_instruction_count","pair_id":"python_484482f6d841826ffc6a713b","problem_id":"p03816","slow_code_id":"32728a5c66ef038bd3a4f497b00616e3380ad5ebe49d3699dc8574ebf3b3cecf","slow_id":"p03816_f87c28f4ead9129969c541ae0db2fc7733f521c7e96aafae7cfa3be3414a8fa8","speedup":7.346416939151344,"stratum":"4-8","sampling_key":"168d76958240cf730038251b1ca7951e46a4ec48aaa23aa200084dc8cd3c2205","slow_code":"from collections import defaultdict\nfrom heapq import heappush, heappop\nimport sys\nimport math\nimport bisect\nimport random\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LS():\n return list(map(list, sys.stdin.readline().split()))\n\n\ndef S():\n return list(sys.stdin.readline())[:-1]\n\n\ndef IR(n):\n l = [None for i in range(n)]\n for i in range(n):\n l[i] = I()\n return l\n\n\ndef LIR(n):\n l = [None for i in range(n)]\n for i in range(n):\n l[i] = LI()\n return l\n\n\ndef SR(n):\n l = [None for i in range(n)]\n for i in range(n):\n l[i] = S()\n return l\n\n\ndef LSR(n):\n l = [None for i in range(n)]\n for i in range(n):\n l[i] = SR()\n return l\n\n\nmod = 1000000007\n\n\nn = I()\na = LI()\nd = defaultdict(int)\nfor i in a:\n d[i] += 1\nl = list(d.keys())\nk = 0\nfor i in l:\n k ^= ~(d[i] % 2)\n d[i] = 1\nans = sum(list(d.values()))\nans -= 1 if k % 2 else 0\nprint(ans)\n","fast_code":"eval(input())\nc = len(set(input().split()))\nprint((c - 1 + c % 2))\n"} +{"fast_code_id":"cfe970827b906a080e1f9e7f022041c9f0c0a81f12244e331c8ed6bb5acfacbb","fast_id":"p03222_cfe970827b906a080e1f9e7f022041c9f0c0a81f12244e331c8ed6bb5acfacbb","language":"python","measured_fast_code_id":"cfe970827b906a080e1f9e7f022041c9f0c0a81f12244e331c8ed6bb5acfacbb","measured_slow_code_id":"efe15798bd9323303879de374c005d19f7662008b0dd93365b20891e94c40f49","measurement_metric":"cpu_instruction_count","pair_id":"python_485b840268bca156b21f4109","problem_id":"p03222","slow_code_id":"efe15798bd9323303879de374c005d19f7662008b0dd93365b20891e94c40f49","slow_id":"p03222_efe15798bd9323303879de374c005d19f7662008b0dd93365b20891e94c40f49","speedup":5.945264353098406,"stratum":"4-8","sampling_key":"7abdb799672b683999596bcc625be1f9523a708e39c429ea2be56dd64bee34a3","slow_code":"from itertools import product\n\nH, W, K = list(map(int, input().split()))\nMOD = 10**9 + 7\ndp = [[0] * W for i in range(H + 1)]\ndp[0][0] = 1\n\n\ndef calc(w):\n if w <= 0:\n return 1\n ret = 0\n for pattern in product([0, 1], repeat=w):\n pattern = \"\".join(list(map(str, pattern)))\n if \"11\" not in pattern:\n ret += 1\n return ret\n\n\nfor h in range(H):\n for w in range(W):\n dp[h + 1][w] = (dp[h + 1][w] + dp[h][w] * calc(w - 1) * calc(W - w - 2)) % MOD\n if w + 1 < W:\n dp[h + 1][w + 1] = (\n dp[h + 1][w + 1] + dp[h][w] * calc(w - 1) * calc(W - w - 3) % MOD\n )\n if w - 1 >= 0:\n dp[h + 1][w - 1] = (\n dp[h + 1][w - 1] + dp[h][w] * calc(w - 2) * calc(W - w - 2) % MOD\n )\nprint((dp[H][K - 1] % MOD))\n","fast_code":"import sys\n\nMOD = 10**9 + 7\nh, w, k = list(map(int, sys.stdin.readline().split()))\n\n\ndef main():\n if w == 1:\n return 1\n ok = []\n for i in range(2 ** (w - 1)):\n prev = False\n for j in range(w - 1):\n if i >> j & 1:\n if prev:\n break\n else:\n prev = True\n else:\n prev = False\n else:\n ok.append(i)\n lcr = [(letter, 0) for letter in \"lcr\"]\n a = [dict(lcr) for _ in range(w)]\n for i in ok:\n j = 0\n while j < w:\n if i >> j & 1:\n a[j][\"r\"] += 1\n a[j + 1][\"l\"] += 1\n j += 2\n else:\n a[j][\"c\"] += 1\n j += 1\n res = [0] * w\n res[0] = 1\n for _ in range(h):\n nex = [0] * w\n for j in range(w):\n if j == 0:\n nex[j] = res[j] * a[j][\"c\"] + res[j + 1] * a[j][\"r\"]\n elif j < w - 1:\n nex[j] = (\n res[j - 1] * a[j][\"l\"] + res[j] * a[j][\"c\"] + res[j + 1] * a[j][\"r\"]\n )\n else:\n nex[j] = res[j - 1] * a[j][\"l\"] + res[j] * a[j][\"c\"]\n for j in range(w):\n nex[j] %= MOD\n res = nex\n return res[k - 1]\n\n\nif __name__ == \"__main__\":\n ans = main()\n print(ans)\n"} +{"fast_code_id":"062d1304cb847c6ff44db5230714a6643878e721fb03c47f6bfd2c49eba3f4cb","fast_id":"p02683_062d1304cb847c6ff44db5230714a6643878e721fb03c47f6bfd2c49eba3f4cb","language":"python","measured_fast_code_id":"062d1304cb847c6ff44db5230714a6643878e721fb03c47f6bfd2c49eba3f4cb","measured_slow_code_id":"3a953b935633d889972610e2b72a1d2f66172bb0bf1cb8f239c17f21d3ff6a83","measurement_metric":"cpu_instruction_count","pair_id":"python_48699c5ae2e00a3b311bb1c5","problem_id":"p02683","slow_code_id":"3a953b935633d889972610e2b72a1d2f66172bb0bf1cb8f239c17f21d3ff6a83","slow_id":"p02683_3a953b935633d889972610e2b72a1d2f66172bb0bf1cb8f239c17f21d3ff6a83","speedup":151.5589413748638,"stratum":"8+","sampling_key":"1098140b8079e1a365df7b6c42d1aafe4137b3a1a6d7b7af084e616d3f4d2974","slow_code":"n, m, x = list(map(int, input().split()))\ninn = [list(map(int, input().split())) for _ in range(n)]\nc = [inn[_][0] for _ in range(n)]\nara = [inn[_][1:] for _ in range(n)]\nans = 1e9\nfor mask in range(2**15):\n cost = 0\n cnt = [0 for _ in range(m)]\n for i in range(n):\n if ((1 << i) & mask) == 0:\n continue\n cost += c[i]\n for j in range(m):\n cnt[j] += ara[i][j]\n ok = 1\n for i in range(m):\n if cnt[i] < x:\n ok = 0\n if ok:\n ans = min(ans, cost)\nif ans == 1e9:\n ans = -1\nprint(ans)\n","fast_code":"N, M, X = list(map(int, input().split()))\nc_a_list = [list(map(int, input().split())) for _ in range(N)]\nmin_money = 1e10\nfor i in range(2**N):\n buy_list = [0] * N\n skill = [0] * M\n money = 0\n for j in range(N):\n if i % 2 == 0:\n buy_list[j] = 1\n i //= 2\n for buy_idx, ca in enumerate(c_a_list):\n if buy_list[buy_idx] == 1:\n for a_idx, a in enumerate(ca[1:]):\n skill[a_idx] += a\n money += ca[0]\n for s_idx, s in enumerate(skill):\n if s < X:\n break\n if s_idx == M - 1:\n min_money = min(min_money, money)\nif min_money == 1e10:\n print((-1))\nelse:\n print(min_money)\n"} +{"fast_code_id":"609e346782ecf49c23ca5198c907b710c087fbc5b7bd73f09ea7653abfa5c4cb","fast_id":"p00219_609e346782ecf49c23ca5198c907b710c087fbc5b7bd73f09ea7653abfa5c4cb","language":"python","measured_fast_code_id":"609e346782ecf49c23ca5198c907b710c087fbc5b7bd73f09ea7653abfa5c4cb","measured_slow_code_id":"36c6082fb1a0d124350bbc45ec556aeb301f370e97f31aaee43e9eb11cc4f99a","measurement_metric":"cpu_instruction_count","pair_id":"python_486e4ab8325a73756d593c01","problem_id":"p00219","slow_code_id":"e2d53f24e1a4828a64903ebdc18061753747e6715fce06b897286dc27a75ba38","slow_id":"p00219_36c6082fb1a0d124350bbc45ec556aeb301f370e97f31aaee43e9eb11cc4f99a","speedup":3.8647545209442034,"stratum":"2-4","sampling_key":"278735ee5b142cd4a05218b6bad57ac5afe59b7b65f86ccc3b2f3dc76df907f1","slow_code":"while True:\n n = int(eval(input()))\n data = [0] * 10\n if n == 0:\n break\n for _ in range(n):\n in_data = int(eval(input()))\n data[in_data] += 1\n for d in data:\n if d == 0:\n print(\"-\")\n else:\n print((\"*\" * d))\n","fast_code":"while 1:\n n = eval(input())\n if n == 0:\n break\n h = [0] * 10\n for i in range(n):\n h[int(input())] += 1\n for i in range(10):\n print(\"*\" * h[i] if h[i] else \"-\")\n"} +{"fast_code_id":"43fc346c98c43f7f36d070397a4022b2ae72cccd3bd525ebbf464c8942e60a93","fast_id":"p03837_23995c018e13f10d6063770b58497511907be90d8dcf30a4145faf91dac6a3d6","language":"python","measured_fast_code_id":"23995c018e13f10d6063770b58497511907be90d8dcf30a4145faf91dac6a3d6","measured_slow_code_id":"3eb192aa37f558f56c5f9a914f6fb2d9a626d3e864aa7172ad0427991823182c","measurement_metric":"cpu_instruction_count","pair_id":"python_48a70116fb69926287b34256","problem_id":"p03837","slow_code_id":"3eb192aa37f558f56c5f9a914f6fb2d9a626d3e864aa7172ad0427991823182c","slow_id":"p03837_3eb192aa37f558f56c5f9a914f6fb2d9a626d3e864aa7172ad0427991823182c","speedup":4.2583256170823445,"stratum":"4-8","sampling_key":"05ef2a05d9e6808c5cbaee2d3939f1fe491f576b1534979253e53e2ea03a2675","slow_code":"INFTY = 10**5 + 10\nN, M = list(map(int, input().split()))\nL = [list(map(int, input().split())) for _ in range(M)]\nG = {i: [] for i in range(1, N + 1)}\ndist = [[INFTY for _ in range(N + 1)] for _ in range(N + 1)]\nfor j in range(M):\n a, b, c = L[j]\n G[a].append(b)\n G[b].append(a)\n dist[a][b] = c\n dist[b][a] = c\nfor k in range(1, N + 1):\n for i in range(1, N + 1):\n for j in range(1, N + 1):\n dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j])\ncnt = 0\nfor j in range(M):\n a, b, c = L[j]\n if dist[a][b] < c:\n cnt += 1\nprint(cnt)\n","fast_code":"import sys\n\n\nimport heapq\n\n\ndef dijkstra_heap(s, n, edges):\n\n dist = [float(\"inf\")] * n\n used = [True] * n\n dist[s] = 0\n used[s] = False\n used_edges = set()\n edgelist = []\n for d, e in edges[s]:\n\n heapq.heappush(edgelist, (d, e, s))\n while edgelist:\n d, e, s = heapq.heappop(edgelist)\n if dist[e] >= d:\n if s < e:\n used_edges.add((s, e))\n else:\n used_edges.add((e, s))\n\n if not used[e]:\n continue\n dist[e] = d\n used[e] = False\n for nd, ne in edges[e]:\n if used[ne]:\n heapq.heappush(edgelist, (nd + dist[e], ne, e))\n return dist, used_edges\n\n\nN, M = list(map(int, sys.stdin.readline().strip().split()))\nedges = [[] for _ in range(N)]\nall_edges = set()\nfor _ in range(M):\n a, b, c = list(map(int, sys.stdin.readline().strip().split()))\n edges[a - 1].append((c, b - 1))\n edges[b - 1].append((c, a - 1))\n if a < b:\n all_edges.add((a - 1, b - 1))\n else:\n all_edges.add((b - 1, a - 1))\nfor i in range(N):\n min_d, used_edges = dijkstra_heap(i, N, edges)\n\n all_edges -= used_edges\nprint((len(all_edges)))\n"} +{"fast_code_id":"80e98e15676902352b836bed3711ff0bd47991ebfc63c0e7c3ecc6e2a47dd79d","fast_id":"p03456_80e98e15676902352b836bed3711ff0bd47991ebfc63c0e7c3ecc6e2a47dd79d","language":"python","measured_fast_code_id":"80e98e15676902352b836bed3711ff0bd47991ebfc63c0e7c3ecc6e2a47dd79d","measured_slow_code_id":"7917ed4392d2155273da648b2693fb0163544534d06b0c3c68db07d4c4827be4","measurement_metric":"cpu_instruction_count","pair_id":"python_48be7d08c8801692230edbbf","problem_id":"p03456","slow_code_id":"7917ed4392d2155273da648b2693fb0163544534d06b0c3c68db07d4c4827be4","slow_id":"p03456_7917ed4392d2155273da648b2693fb0163544534d06b0c3c68db07d4c4827be4","speedup":2074.8203516855842,"stratum":"8+","sampling_key":"123bc923ed8a8cb7ec5b74024fb5d48cf3611f27d69a1b8f5dabf09d495a8c89","slow_code":"import numpy as np\n\na = int(input().replace(\" \", \"\"))\nb = np.sqrt(a)\nc = b - int(b)\nif c == 0.0:\n print(\"Yes\")\nelse:\n print(\"No\")\n","fast_code":"a, b = input().split()\nprint((\"YNeos\"[int(a + b) != int(int(a + b) ** 0.5) ** 2 :: 2]))\n"} +{"fast_code_id":"756f91ac6d1695db876a99ea6c409e2ecc2d89bc9ced2cac5f118d0dce505fbd","fast_id":"p03972_756f91ac6d1695db876a99ea6c409e2ecc2d89bc9ced2cac5f118d0dce505fbd","language":"python","measured_fast_code_id":"756f91ac6d1695db876a99ea6c409e2ecc2d89bc9ced2cac5f118d0dce505fbd","measured_slow_code_id":"13cb625d78acd745c6b507de0e8032c0bb09ea576635a23c07368c3938d7b12b","measurement_metric":"cpu_instruction_count","pair_id":"python_48e35e7d88d1513a5bf935bd","problem_id":"p03972","slow_code_id":"13cb625d78acd745c6b507de0e8032c0bb09ea576635a23c07368c3938d7b12b","slow_id":"p03972_13cb625d78acd745c6b507de0e8032c0bb09ea576635a23c07368c3938d7b12b","speedup":4.014020713149316,"stratum":"4-8","sampling_key":"3477f4e5b4fb8df2b64a8574c6658f007981d08aac5290d0cb6d5c781501f61f","slow_code":"W, H = list(map(int, input().split()))\nP = [(int(eval(input())), 0) for i in range(W)]\nQ = [(int(eval(input())), 1) for i in range(H)]\nE = sorted(P + Q)\nused = [W + 1, H + 1]\nans = 0\nfor e, f in E:\n ans += e * used[1 - f]\n used[f] -= 1\nprint(ans)\n","fast_code":"w, h, *L = list(map(int, open(0).read().split()))\nP = L[:w]\nQ = L[w:]\nx, y = w, h\nsss = []\nfor i, pi in enumerate(P):\n sss.append((pi, 1))\nfor j, qj in enumerate(Q):\n sss.append((qj, 0))\nsss.sort()\nans = 0\nfor c, f in sss:\n if f and x:\n x -= 1\n ans += c * (y + 1)\n elif not f and y:\n y -= 1\n ans += c * (x + 1)\nprint(ans)\n"} +{"fast_code_id":"df1658f012e4c4431701062b04d959590940972427cf87c5f22e30ff0f566420","fast_id":"p03860_df1658f012e4c4431701062b04d959590940972427cf87c5f22e30ff0f566420","language":"python","measured_fast_code_id":"df1658f012e4c4431701062b04d959590940972427cf87c5f22e30ff0f566420","measured_slow_code_id":"f9c7ff6ccba211df6aa7649f397d5aec3b7d4b68331ab1524aeb9717fd467838","measurement_metric":"cpu_instruction_count","pair_id":"python_490897f2ad457daf03529840","problem_id":"p03860","slow_code_id":"f9c7ff6ccba211df6aa7649f397d5aec3b7d4b68331ab1524aeb9717fd467838","slow_id":"p03860_f9c7ff6ccba211df6aa7649f397d5aec3b7d4b68331ab1524aeb9717fd467838","speedup":3.1985283078569444,"stratum":"2-4","sampling_key":"8c5bd74263d92cf9a9a63ab09e87aa8ee8e69647e687fb40bd8eb631ae411d85","slow_code":"ls = input().split()\nLs = []\n\n\ndef fun():\n print(\"111\")\n print(\"222\")\n print(\"333\")\n print(\"ii\")\n\n\nfor i in ls:\n Ls.append(i[0])\nprint((\"\".join(Ls)))\n","fast_code":"print((input(\"A\")[8] + \"C\"))\n"} +{"fast_code_id":"d00298cd14b1cd4f91ce830289511735e36a60dcea3acdf68935a21e91f52b3e","fast_id":"p02729_d00298cd14b1cd4f91ce830289511735e36a60dcea3acdf68935a21e91f52b3e","language":"python","measured_fast_code_id":"d00298cd14b1cd4f91ce830289511735e36a60dcea3acdf68935a21e91f52b3e","measured_slow_code_id":"cceb77711a14726b9b2382bddd14ea9448a327cbb9328832bc3b11455366cb07","measurement_metric":"cpu_instruction_count","pair_id":"python_4a317b5710f530ffcd3acc87","problem_id":"p02729","slow_code_id":"cceb77711a14726b9b2382bddd14ea9448a327cbb9328832bc3b11455366cb07","slow_id":"p02729_cceb77711a14726b9b2382bddd14ea9448a327cbb9328832bc3b11455366cb07","speedup":4.905551569015694,"stratum":"4-8","sampling_key":"3881fe6f3b751c2ac9e0d9982ed0384f75d87e4c81e067b8d0ea82450dad5029","slow_code":"a, b = list(map(int, input().split()))\nimport itertools\n\na1 = len(list(itertools.combinations(list(range(a)), 2)))\nb1 = len(list(itertools.combinations(list(range(b)), 2)))\nprint((a1 + b1))\n","fast_code":"n, m = list(map(int, input().split()))\nif (n > 0) and (m > 0):\n print((int(n * (n - 1) / 2 + m * (m - 1) / 2)))\nelse:\n print((int(max(n, m) * (max(n, m) - 1) / 2)))\n"} +{"fast_code_id":"75c1e42c7e98436206dd42a5140a4f4a458a8534f36159d0be7f96ccc1882d13","fast_id":"p03125_75c1e42c7e98436206dd42a5140a4f4a458a8534f36159d0be7f96ccc1882d13","language":"python","measured_fast_code_id":"75c1e42c7e98436206dd42a5140a4f4a458a8534f36159d0be7f96ccc1882d13","measured_slow_code_id":"4b613364292341c90cb223444cc17d712d2692c86eaf7401941c05ab19a835ea","measurement_metric":"cpu_instruction_count","pair_id":"python_4a45b9c4f7488bfebf29aeda","problem_id":"p03125","slow_code_id":"8b3f73d78db4b17be952c8e49db130961979c1aa4d15ae41972fb4783a0ae1cc","slow_id":"p03125_4b613364292341c90cb223444cc17d712d2692c86eaf7401941c05ab19a835ea","speedup":3.564436364929375,"stratum":"2-4","sampling_key":"782e62b1985bffff1733c7c941db769e88cd0afc9334ca208c1869b6b370616b","slow_code":"import sys\nimport math\nfrom bisect import bisect_right as br\nfrom bisect import bisect_left as bl\n\nsys.setrecursionlimit(2147483647)\nfrom heapq import heappush, heappop, heappushpop\nfrom collections import defaultdict\nfrom itertools import accumulate\nfrom collections import Counter\nfrom collections import deque\nfrom operator import itemgetter\nfrom itertools import permutations\n\nmod = 10**9 + 7\ninf = float(\"inf\")\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\na, b = LI()\nif b % a == 0:\n print((a + b))\nelse:\n print((b - a))\n","fast_code":"a, b = list(map(int, input().split()))\nprint(([b + a, b - a][b % a > 0]))\n"} +{"fast_code_id":"f79557cdbc11eb5246f131496e2cdaef6b0d614f77577a26caa92303bb851e73","fast_id":"p03251_f79557cdbc11eb5246f131496e2cdaef6b0d614f77577a26caa92303bb851e73","language":"python","measured_fast_code_id":"f79557cdbc11eb5246f131496e2cdaef6b0d614f77577a26caa92303bb851e73","measured_slow_code_id":"a3fbc6c47b132b7bae66af85f9792255327ce8e3bf2b5b22873b7c8d59510fae","measurement_metric":"cpu_instruction_count","pair_id":"python_4b02e98697647f4fb253abdf","problem_id":"p03251","slow_code_id":"a3fbc6c47b132b7bae66af85f9792255327ce8e3bf2b5b22873b7c8d59510fae","slow_id":"p03251_a3fbc6c47b132b7bae66af85f9792255327ce8e3bf2b5b22873b7c8d59510fae","speedup":710.8765907790657,"stratum":"8+","sampling_key":"2ea7a4fc67861dca692a353f99df45141e1dc22cfa6d5415a61c521a6bbb0f84","slow_code":"import numpy as np\n\nn, m, x, y = list(map(int, input().split()))\nxl = [int(i) for i in input().split()]\nyl = [int(i) for i in input().split()]\nif x > y:\n print(\"War\")\nelse:\n zl = np.arange(x + 1, y + 1)\n for z in zl:\n if (max(xl) < z) & (z <= min(yl)):\n print(\"No War\")\n break\n else:\n print(\"War\")\n","fast_code":"A = list(map(int, input().split()))\nX = list(map(int, input().split()))\nY = list(map(int, input().split()))\nx = max(X)\ny = min(Y)\nif x < y and A[2] < A[3] and A[2] < y and x < A[3]:\n print(\"No War\")\nelse:\n print(\"War\")\n"} +{"fast_code_id":"70e594db7e9e5b3f798f721895d1b80bda5c2b03a463302099ca6355a9ef42ad","fast_id":"p03805_70e594db7e9e5b3f798f721895d1b80bda5c2b03a463302099ca6355a9ef42ad","language":"python","measured_fast_code_id":"70e594db7e9e5b3f798f721895d1b80bda5c2b03a463302099ca6355a9ef42ad","measured_slow_code_id":"562f6e02e8417832e28d70eb3bf85554d0ed3aeb8b43d97c409d2d577ce8e26f","measurement_metric":"cpu_instruction_count","pair_id":"python_4b19cc5393850ccc5d34eb10","problem_id":"p03805","slow_code_id":"562f6e02e8417832e28d70eb3bf85554d0ed3aeb8b43d97c409d2d577ce8e26f","slow_id":"p03805_562f6e02e8417832e28d70eb3bf85554d0ed3aeb8b43d97c409d2d577ce8e26f","speedup":3.9329678535066988,"stratum":"2-4","sampling_key":"01548f0405e5c4d0b3e123ef958c8285a32f838c2dee43f64153af1ec6e785f3","slow_code":"from typing import List, Tuple\n\n\ndef main():\n n, m = list(map(int, input().split()))\n g = []\n for _ in range(m):\n a, b = list(map(int, input().split()))\n g.append((a, b))\n print((osp(n, g)))\n\n\ndef osp(n: int, g: List[Tuple[int, int]]) -> int:\n v = [False] * n\n g = set(g)\n return dfs(0, v, n, g)\n\n\ndef dfs(i, v, n, g):\n v[i] = True\n if all(v):\n v[i] = False\n return 1\n cnt = 0\n for j in range(n):\n if v[j]:\n continue\n if not ((i + 1, j + 1) in g or (j + 1, i + 1) in g):\n continue\n cnt += dfs(j, v, n, g)\n v[i] = False\n return cnt\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"from collections import defaultdict\nfrom itertools import permutations\n\n\ndef main():\n N, M = list(map(int, input().split()))\n g = defaultdict(list)\n for _ in range(M):\n a, b = list(map(int, input().split()))\n g[a].append(b)\n g[b].append(a)\n ans = 0\n for route in permutations(list(range(2, N + 1)), N - 1):\n ok = True\n now = 1\n for r in route:\n if r in g[now]:\n now = r\n else:\n ok = False\n if ok:\n ans += 1\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"fa13dedae158b2b6ed6527a3e086a5df2ac5d3c6d9471a8e82f2aaa8f7aeef2c","fast_id":"p03722_fa13dedae158b2b6ed6527a3e086a5df2ac5d3c6d9471a8e82f2aaa8f7aeef2c","language":"python","measured_fast_code_id":"fa13dedae158b2b6ed6527a3e086a5df2ac5d3c6d9471a8e82f2aaa8f7aeef2c","measured_slow_code_id":"093486d8bf1bade74d0f7f3e71a354e24ef56e72b4374c89214f326ef468df33","measurement_metric":"cpu_instruction_count","pair_id":"python_4bb92f975e00a2da47d32ef2","problem_id":"p03722","slow_code_id":"92422ed6fb877fc678246d4b0dc0afea655ea5fbeb5e6aea37d1962e1b39f169","slow_id":"p03722_093486d8bf1bade74d0f7f3e71a354e24ef56e72b4374c89214f326ef468df33","speedup":4.144676444678833,"stratum":"4-8","sampling_key":"1091a9b2e6f9398bf352daff4ebf68429a26af7100cf466ba38e350ab0367dbc","slow_code":"n, m = list(map(int, input().split()))\nA = [list(map(int, input().split())) for i in range(m)]\nfor i in range(m):\n A[i][2] = -A[i][2]\nP = [float(\"inf\")] * (n + 1)\nP[1] = 0\nF = [[0] * 2 for i in range(n + 1)]\nF[1][0] = 1\nF[n][1] = 1\nfor i in range(n):\n for j in range(m):\n if F[A[j][0]][0] == 1:\n F[A[j][1]][0] = 1\n if F[A[j][1]][1] == 1:\n F[A[j][0]][1] = 1\n P[A[j][1]] = min(P[A[j][1]], P[A[j][0]] + A[j][2])\nans0 = P[:]\nfor i in range(n):\n for j in range(m):\n if F[A[j][0]][0] == 1:\n F[A[j][1]][0] = 1\n if F[A[j][1]][1] == 1:\n F[A[j][0]][1] = 1\n P[A[j][1]] = min(P[A[j][1]], P[A[j][0]] + A[j][2])\nans1 = P[:]\n\n\ndef d():\n for i in range(n + 1):\n if F[i] == [1, 1] and ans1[i] < ans0[i]:\n return \"inf\"\n return -ans0[n]\n\n\nprint((d()))\n","fast_code":"n, m = list(map(int, input().split()))\ne = []\nfor i in range(m):\n a, b, c = list(map(int, input().split()))\n e.append((a - 1, b - 1, c))\nmaxdis = [-float(\"inf\") for i in range(n)]\nmaxdis[0] = 0\nmugen = False\nfor i in range(n):\n for j in e:\n st, gl, cost = j\n if maxdis[gl] < maxdis[st] + cost:\n maxdis[gl] = maxdis[st] + cost\n if i >= n - 1 and (gl == n - 1):\n mugen = True\n break\nif mugen:\n print(\"inf\")\nelse:\n print((maxdis[n - 1]))\n"} +{"fast_code_id":"e5b2e399a03a3f8e8d296f2c196051328bc34d20b308d0640a69b1e958432119","fast_id":"p03698_e5b2e399a03a3f8e8d296f2c196051328bc34d20b308d0640a69b1e958432119","language":"python","measured_fast_code_id":"e5b2e399a03a3f8e8d296f2c196051328bc34d20b308d0640a69b1e958432119","measured_slow_code_id":"c901e462142ca049a9787650e0b4a07107f704aeec33bc7187ebef810081eb9f","measurement_metric":"cpu_instruction_count","pair_id":"python_4be76ea029dcfd66b80b828e","problem_id":"p03698","slow_code_id":"82f3b254a6c0c0e43cc5a8e67fd20676b24522497dc2e44c3bbb7af6ae0b85f8","slow_id":"p03698_c901e462142ca049a9787650e0b4a07107f704aeec33bc7187ebef810081eb9f","speedup":7.459796437929799,"stratum":"4-8","sampling_key":"2407470f724e048981870254d8bdedd4650b8b8f5aebfc2cb27acc47deaf9394","slow_code":"import sys\n\nstdin = sys.stdin\ninf = 1 << 60\nmod = 1000000007\nni = lambda: int(ns())\nnin = lambda y: [ni() for _ in range(y)]\nna = lambda: list(map(int, stdin.readline().split()))\nnan = lambda y: [na() for _ in range(y)]\nnf = lambda: float(ns())\nnfn = lambda y: [nf() for _ in range(y)]\nnfa = lambda: list(map(float, stdin.readline().split()))\nnfan = lambda y: [nfa() for _ in range(y)]\nns = lambda: stdin.readline().rstrip()\nnsn = lambda y: [ns() for _ in range(y)]\nncl = lambda y: [list(ns()) for _ in range(y)]\nnas = lambda: stdin.readline().split()\nfrom collections import Counter\n\ns = ns()\nc = Counter(s)\nprint((\"yes\" if len(s) == len(c) else \"no\"))\n","fast_code":"a = list(input())\nb = set(a)\nprint(\"yes\") if (len(a) == len(b)) else print(\"no\")\n"} +{"fast_code_id":"9521ea956556c8bca351a0fb0d99d7f29ecb173a21af4e3045b14fa48dad0430","fast_id":"p02669_9521ea956556c8bca351a0fb0d99d7f29ecb173a21af4e3045b14fa48dad0430","language":"python","measured_fast_code_id":"9521ea956556c8bca351a0fb0d99d7f29ecb173a21af4e3045b14fa48dad0430","measured_slow_code_id":"5dc16e69171829fb825a4382d7ae818d1f78cf50ef12255ba28fcf6c6591e0e1","measurement_metric":"cpu_instruction_count","pair_id":"python_4c17c3afa8eedfbe595aa223","problem_id":"p02669","slow_code_id":"ca3505b4e5755f2e5a6dda25d2ba0ee1f8926fae7d5ee6e43c499cad98b2e89b","slow_id":"p02669_5dc16e69171829fb825a4382d7ae818d1f78cf50ef12255ba28fcf6c6591e0e1","speedup":7.377084777321196,"stratum":"4-8","sampling_key":"70b7ce7a07ea78fad70ea71d9f547648927f56991c6cf4b965ffc007ee31025b","slow_code":"import sys\n\ndivs = [2, 3, 5]\nt = int(eval(input()))\nfor _ in range(t):\n n, a, b, c, d = list(map(int, input().split()))\n costs = [a, b, c]\n dp = {}\n\n def dfs(x):\n if x in dp:\n return dp[x]\n\n if x == 0:\n dp[x] = 0\n return dp[x]\n ret = x * d\n for i in range(-4, 5):\n if x - i < 0:\n continue\n nx = x - i\n for cost, div in zip(costs, divs):\n if nx % div != 0 or nx // div >= x:\n continue\n ret = min(ret, dfs(nx // div) + cost + abs(i) * d)\n dp[x] = ret\n return ret\n\n print((dfs(n)))\n","fast_code":"def f(k):\n if k == 1:\n return d\n if k == 0:\n return 0\n if k in m:\n return m[k]\n s = min(\n k * d,\n f(k // 2) + a + k % 2 * d,\n f((k + 1) // 2) + a + -k % 2 * d,\n f(k // 3) + b + k % 3 * d,\n f((k + 2) // 3) + b + -k % 3 * d,\n f(k // 5) + c + k % 5 * d,\n f((k + 4) // 5) + c + -k % 5 * d,\n )\n m[k] = s\n return s\n\n\nfor _ in range(int(eval(input()))):\n m = {}\n n, a, b, c, d = list(map(int, input().split()))\n print((f(n)))\n"} +{"fast_code_id":"6e83d4816cef74d527e6d07a4e5a3e127a37b50a90f7e25d633eb5dd28f4f004","fast_id":"p03816_6e83d4816cef74d527e6d07a4e5a3e127a37b50a90f7e25d633eb5dd28f4f004","language":"python","measured_fast_code_id":"6e83d4816cef74d527e6d07a4e5a3e127a37b50a90f7e25d633eb5dd28f4f004","measured_slow_code_id":"d753095d0d960364791984f90dbd9b20563bbbee29b58abd2419ff94d69b471b","measurement_metric":"cpu_instruction_count","pair_id":"python_4cbb3951725e2d0a9e52b4d2","problem_id":"p03816","slow_code_id":"d753095d0d960364791984f90dbd9b20563bbbee29b58abd2419ff94d69b471b","slow_id":"p03816_d753095d0d960364791984f90dbd9b20563bbbee29b58abd2419ff94d69b471b","speedup":7.189825762382228,"stratum":"4-8","sampling_key":"96728a37abb1b4f3b12d2debc780daa5adec74df5f0e4aec4d0d07542d425f8f","slow_code":"import functools\n\nN = int(eval(input()))\nA = list(map(int, input().split()))\nd = [0 for i in range(10**5 + 1)]\nfor a in A:\n d[a] = 1\ns = sum(d)\nprint((s - (0 if s % 2 else 1)))\n","fast_code":"from collections import Counter\n\nN = int(eval(input()))\na = list(map(int, input().split(\" \")))\nc = Counter(a)\nref = [v - 1 for k, v in list(c.items()) if v != 1]\nans = N - ((sum(ref) + 1) // 2) * 2\nprint(ans)\n"} +{"fast_code_id":"18ab0f57ffc88d30ce1f6ad03c10f99c80b2d7e308d1ee1f9b34e793e161f768","fast_id":"p00100_18ab0f57ffc88d30ce1f6ad03c10f99c80b2d7e308d1ee1f9b34e793e161f768","language":"python","measured_fast_code_id":"18ab0f57ffc88d30ce1f6ad03c10f99c80b2d7e308d1ee1f9b34e793e161f768","measured_slow_code_id":"cef1778ac31a96be11bbaf1627cf2c94f88d5ea9907d28e19f44f8b7a1d378a1","measurement_metric":"cpu_instruction_count","pair_id":"python_4d6f02e70cf01b3a29812cc3","problem_id":"p00100","slow_code_id":"90eeb5d17013d087aa6085c705f90d8dd3710ca805802ad063fb9a202bdd752c","slow_id":"p00100_cef1778ac31a96be11bbaf1627cf2c94f88d5ea9907d28e19f44f8b7a1d378a1","speedup":2.0848922555889735,"stratum":"2-4","sampling_key":"ad31e24893690fa1d66839337d200dfaab8365aba164d9ade6c9cf444918b3ae","slow_code":"employeeSalesList = []\n\n\ndef resetDataset():\n del employeeSalesList[0 : len(employeeSalesList) + 1]\n\n\ndef readDataCount():\n return int(eval(input()))\n\n\ndef searchEmployeeSales(employeeId):\n for data in employeeSalesList:\n if data[0] == employeeId:\n return data\n newData = [employeeId, 0]\n employeeSalesList.append(newData)\n return newData\n\n\nanswerList = []\n\n\ndef printEmployeeOfDataset():\n found = False\n for data in employeeSalesList:\n if data[1] >= 1000000:\n answerList.append(data[0])\n found = True\n if not found:\n answerList.append(\"NA\")\n\n\nresetDataset()\ndataCount = readDataCount()\nwhile dataCount > 0:\n for _ in range(dataCount):\n employeeId, price, volume = list(map(int, input().split(\" \")))\n employeeSales = searchEmployeeSales(employeeId)\n employeeSales[1] += price * volume\n printEmployeeOfDataset()\n resetDataset()\n dataCount = readDataCount()\nfor row in answerList:\n print(row)\n","fast_code":"while True:\n n = int(eval(input()))\n if n == 0:\n break\n d = dict()\n order = []\n for _ in range(n):\n i, p, q = list(map(int, input().split()))\n d[i] = d[i] + p * q if i in d else p * q\n if i not in order:\n order.append(i)\n b = True\n for o in order:\n if d[o] > 999999:\n print(o)\n b = False\n if b:\n print(\"NA\")\n"} +{"fast_code_id":"97e7a463a7ae5a9432cd2c67f456ba04ff30cb7374fc001a0ff9009ec3d6048a","fast_id":"p00033_97e7a463a7ae5a9432cd2c67f456ba04ff30cb7374fc001a0ff9009ec3d6048a","language":"python","measured_fast_code_id":"97e7a463a7ae5a9432cd2c67f456ba04ff30cb7374fc001a0ff9009ec3d6048a","measured_slow_code_id":"d554547e32ca76dca1697e6003a53c8f9386d6f728fbbf5b97a6fa1bed6629c2","measurement_metric":"cpu_instruction_count","pair_id":"python_4e1aafd24aedb7b3f06debcb","problem_id":"p00033","slow_code_id":"d554547e32ca76dca1697e6003a53c8f9386d6f728fbbf5b97a6fa1bed6629c2","slow_id":"p00033_d554547e32ca76dca1697e6003a53c8f9386d6f728fbbf5b97a6fa1bed6629c2","speedup":30.89808368091805,"stratum":"8+","sampling_key":"001fccf4c0c84a3d225d6e967e6f13d4a92a4c8b20f22d20ef306d01818645a1","slow_code":"def dfs(i, b, c):\n if i == 11:\n return b == sorted(b) and c == sorted(c)\n if dfs(i + 1, b + [balls[i - 1]], c):\n return True\n if dfs(i + 1, b, c + [balls[i - 1]]):\n return True\n return False\n\n\nif __name__ == \"__main__\":\n N = int(eval(input()))\n for i in range(N):\n balls = list(map(int, input().split()))\n if dfs(1, [], []):\n print(\"YES\")\n else:\n print(\"NO\")\n","fast_code":"def s(a):\n b = c = 0\n for i in a:\n if i > b:\n b = i\n elif i > c:\n c = i\n else:\n return False\n return True\n\n\nfor n in range(int(input())):\n print(\"YES\" if s(list(map(int, input().split()))) else \"NO\")\n"} +{"fast_code_id":"8e6f72120f0653bb0f9588922d2c639381ac4c5a375a77d1790ec6f5265a0f81","fast_id":"p03805_967adf5c10d66eaa26a7ee6f5ec2d721b2b366cb765817b6752d9405053507d8","language":"python","measured_fast_code_id":"967adf5c10d66eaa26a7ee6f5ec2d721b2b366cb765817b6752d9405053507d8","measured_slow_code_id":"c3acb924d926d7976d47bbd614601f83a33b5a800335a849db565bab92d78789","measurement_metric":"cpu_instruction_count","pair_id":"python_4e30af8a5987a4c12af5e51b","problem_id":"p03805","slow_code_id":"c3acb924d926d7976d47bbd614601f83a33b5a800335a849db565bab92d78789","slow_id":"p03805_c3acb924d926d7976d47bbd614601f83a33b5a800335a849db565bab92d78789","speedup":4.150334338742477,"stratum":"4-8","sampling_key":"1438c773865ec77cc453464827a8309a500b04e1ac8b1530a9c81db1ae59f679","slow_code":"import copy\n\nn, m = list(map(int, input().split()))\nadjacent_list = [[] for i in range(n + 1)]\nfor i in range(m):\n a, b = list(map(int, input().split()))\n adjacent_list[a].append(b)\n adjacent_list[b].append(a)\nans = 0\n\n\ndef dfs(node, f):\n f.add(node)\n global ans\n if len(f) == n:\n ans += 1\n else:\n for i in adjacent_list[node]:\n if i not in f:\n k = copy.deepcopy(f)\n dfs(i, k)\n\n\ndfs(1, set())\nprint(ans)\n","fast_code":"import bisect\n\nn, m = list(map(int, input().split()))\ng = [[] for i in range(n + 1)]\nfor i in range(m):\n a, b = list(map(int, input().split()))\n g[a].append(b)\n g[b].append(a)\n\n\nans = 0\n\n\ndef dfs(x, check):\n\n ans = 0\n if not False in check:\n\n return 1\n\n for i in g[x]:\n if check[i] == True:\n continue\n\n check[i] = True\n ans += dfs(i, check)\n check[i] = False\n return ans\n\n\ncheck = [False] * (n + 1)\ncheck[0] = True\ncheck[1] = True\nprint((dfs(1, check)))\n"} +{"fast_code_id":"47670c1598843dc43b5d2e0e140f3d48073ef691b49161c43d5e99b030c5718e","fast_id":"p02821_f00aa63456dbc10f0de3cfa4bbae64b70e8183ac036be3b8da19d1aea48ee317","language":"python","measured_fast_code_id":"f00aa63456dbc10f0de3cfa4bbae64b70e8183ac036be3b8da19d1aea48ee317","measured_slow_code_id":"399a196ed351749339d5a10a55db2a1415b7a96b36c485a1fd580d51c51982b2","measurement_metric":"cpu_instruction_count","pair_id":"python_4e3b5b5ed527c0a58fa9bc97","problem_id":"p02821","slow_code_id":"399a196ed351749339d5a10a55db2a1415b7a96b36c485a1fd580d51c51982b2","slow_id":"p02821_399a196ed351749339d5a10a55db2a1415b7a96b36c485a1fd580d51c51982b2","speedup":5.015554141964228,"stratum":"4-8","sampling_key":"1b0f9e7135c926c7238bd5d0f1f538b0f70f66530e392f93749ff92ac7e5fcc7","slow_code":"import numpy as np\nfrom numpy.fft import rfft, irfft\n\n\ndef main():\n n, m = list(map(int, input().split()))\n A = np.array(list(map(int, input().split())))\n F = np.bincount(A)\n fft_len = 2 * 10**5 + 1\n Ff = rfft(F, fft_len)\n G = np.rint(irfft(Ff * Ff, fft_len)).astype(np.int64)\n G_acc = G.cumsum()\n remove_cnt = n**2 - m\n border = np.searchsorted(G_acc, n**2 - m)\n x = n**2 - m - G_acc[border - 1]\n remove_sum = (G[:border] * np.arange(border)).sum() + border * x\n ans = A.sum() * 2 * n - remove_sum\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"import sys\nfrom bisect import bisect_left\nfrom itertools import accumulate\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef list2d(a, b, c):\n return [[c] * b for i in range(a)]\n\n\ndef list3d(a, b, c, d):\n return [[[d] * c for j in range(b)] for i in range(a)]\n\n\ndef list4d(a, b, c, d, e):\n return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]\n\n\ndef ceil(x, y=1):\n return int(-(-x // y))\n\n\ndef INT():\n return int(eval(input()))\n\n\ndef MAP():\n return list(map(int, input().split()))\n\n\ndef LIST(N=None):\n return list(MAP()) if N is None else [INT() for i in range(N)]\n\n\ndef Yes():\n print(\"Yes\")\n\n\ndef No():\n print(\"No\")\n\n\ndef YES():\n print(\"YES\")\n\n\ndef NO():\n print(\"NO\")\n\n\nsys.setrecursionlimit(10**9)\nINF = 10**18\nMOD = 10**9 + 7\n\n\ndef bisearch_max(mn, mx, func):\n ok = mn\n ng = mx\n while ok + 1 < ng:\n mid = (ok + ng) // 2\n if func(mid):\n\n ok = mid\n else:\n\n ng = mid\n return ok\n\n\ndef calc(x):\n\n ans = 0\n for a in A:\n\n ans += N - bisect_left(A, x - a)\n return ans >= M\n\n\nN, M = MAP()\nA = LIST()\nA.sort()\nres = bisearch_max(0, 10**10 + 1, calc)\nans = m = 0\nacc = [0] + list(accumulate(A))\nfor a in A:\n idx = bisect_left(A, res - a)\n cnt = N - idx\n\n ans += a * cnt + (acc[N] - acc[idx])\n\n m += cnt\n\nans -= res * (m - M)\nprint(ans)\n"} +{"fast_code_id":"8a8bdddfe02190fdf8e6428fc6719226bc848180e6fba39f8f49823897ffd42d","fast_id":"p02660_8a8bdddfe02190fdf8e6428fc6719226bc848180e6fba39f8f49823897ffd42d","language":"python","measured_fast_code_id":"8a8bdddfe02190fdf8e6428fc6719226bc848180e6fba39f8f49823897ffd42d","measured_slow_code_id":"8301217799053ca8035ba7e5e9be7529b06a7e4ccf5a0cb39174661c0dc1c031","measurement_metric":"cpu_instruction_count","pair_id":"python_4e4695a27a7414cb09ba5cc3","problem_id":"p02660","slow_code_id":"8301217799053ca8035ba7e5e9be7529b06a7e4ccf5a0cb39174661c0dc1c031","slow_id":"p02660_8301217799053ca8035ba7e5e9be7529b06a7e4ccf5a0cb39174661c0dc1c031","speedup":111.28135687606037,"stratum":"8+","sampling_key":"b7bcadd92fcd755d6036f436a5e211550ea8a107e927192b59125e4ab3baeab1","slow_code":"n = int(eval(input()))\na = p = 1\nwhile p < 6**8:\n c = t = 0\n p += 1\n while n % p < 1:\n n //= p\n x = c == t\n t += x\n c += 1 - t * x\n a += x\nprint((a - (n < 2)))\n","fast_code":"from collections import Counter\n\nN = int(eval(input()))\nn = N\ncounter = Counter()\nwhile n % 2 == 0:\n counter[2] += 1\n n //= 2\np = 3\nwhile p**2 <= N:\n if n % p == 0:\n counter[p] += 1\n n //= p\n else:\n p += 2\nif n != 1:\n counter[N] += 1\nans = 0\nfor key in list(counter.keys()):\n e = 1\n while counter[key] >= e:\n ans += 1\n counter[key] -= e\n e += 1\nprint(ans)\n"} +{"fast_code_id":"50a723df5242d2e44e6b397856590944b9c23de34613b4f550a15cfb9d63aff8","fast_id":"p02556_50a723df5242d2e44e6b397856590944b9c23de34613b4f550a15cfb9d63aff8","language":"python","measured_fast_code_id":"50a723df5242d2e44e6b397856590944b9c23de34613b4f550a15cfb9d63aff8","measured_slow_code_id":"05dfc996f7e3842463d6cd57d02877a281066db95acd7311507e26b5daabff76","measurement_metric":"cpu_instruction_count","pair_id":"python_4e4e66dbf68dbde0fc8f32b5","problem_id":"p02556","slow_code_id":"05dfc996f7e3842463d6cd57d02877a281066db95acd7311507e26b5daabff76","slow_id":"p02556_05dfc996f7e3842463d6cd57d02877a281066db95acd7311507e26b5daabff76","speedup":2.7851163641528243,"stratum":"2-4","sampling_key":"4351492ca9496d7cd4f06c4f2019bb05464a0717d727815aa79125b95cc07aca","slow_code":"N = int(eval(input()))\n\n\ndef dist(A, B):\n return abs(A[0] - B[0]) + abs(A[1] - B[1])\n\n\nXY = [tuple(map(int, input().split())) for _ in range(N)]\nINF = -(10**10)\nans = 0\nfor O in [(INF, INF), (-INF, INF), (INF, -INF), (-INF, -INF)]:\n S = XY[0]\n for xy in XY:\n if dist(O, S) < dist(O, xy):\n S = xy\n O = S\n for xy in XY:\n if dist(O, S) < dist(O, xy):\n S = xy\n ans = max(ans, dist(O, S))\nprint(ans)\n","fast_code":"import sys\n\ninput = sys.stdin.readline\nN = int(eval(input()))\npoints = [0] * N\nrx = []\nry = []\nfor i in range(N):\n x, y = list(map(int, input().split()))\n rx.append(x - y)\n ry.append(x + y)\nxm = max(rx)\nxn = min(rx)\nym = max(ry)\nyn = min(ry)\nans = max(max(xm - x, x - xn, ym - y, y - yn) for x, y in zip(rx, ry))\nprint(ans)\n"} +{"fast_code_id":"6a558eaa1a914a14f163d02e745d120ea8c898e86db963087cc5eac889c092e3","fast_id":"p03207_6a558eaa1a914a14f163d02e745d120ea8c898e86db963087cc5eac889c092e3","language":"python","measured_fast_code_id":"6a558eaa1a914a14f163d02e745d120ea8c898e86db963087cc5eac889c092e3","measured_slow_code_id":"5cb7a4c7cf0d8a71a4fd49887b2da818d3766f3e397b1d44bc46374144eeebdc","measurement_metric":"cpu_instruction_count","pair_id":"python_4ea3f53aa93a4095bdd5b619","problem_id":"p03207","slow_code_id":"fe2f7e4c4fa4bf811a1052a7e9a8cc8bf127a2538fd41f3ded0df182a9217e19","slow_id":"p03207_5cb7a4c7cf0d8a71a4fd49887b2da818d3766f3e397b1d44bc46374144eeebdc","speedup":26.34256478293373,"stratum":"8+","sampling_key":"028668f2a13efe5f6111346efdd8f653b7e9c6c9311969383bf8067a68f7097e","slow_code":"import copy\nimport random\nimport bisect\nimport fractions\nimport math\nimport sys\nimport collections\nfrom decimal import Decimal\n\nmod = 10**9 + 7\nsys.setrecursionlimit(mod)\nd = collections.deque()\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\nN = int(eval(input()))\np = [0 for i in range(N)]\nfor i in range(N):\n p[i] = int(eval(input()))\np.sort()\nans = sum(p)\nans -= p[-1] // 2\nprint(ans)\n","fast_code":"n = int(eval(input()))\np = [int(eval(input())) for i in range(n)]\nprint((sum(p) - max(p) // 2))\n"} +{"fast_code_id":"9728f9990e9b40f7ab86ca8a4e9e0084bf49b9ee51395b6556945e71b7bc9979","fast_id":"p03948_9728f9990e9b40f7ab86ca8a4e9e0084bf49b9ee51395b6556945e71b7bc9979","language":"python","measured_fast_code_id":"9728f9990e9b40f7ab86ca8a4e9e0084bf49b9ee51395b6556945e71b7bc9979","measured_slow_code_id":"d2e58444cc1a8d5237ba224ae14ac6e70605e5881707e135fee7ffb9581c7a9e","measurement_metric":"cpu_instruction_count","pair_id":"python_4ea6560a17e2ab84ff0ce24d","problem_id":"p03948","slow_code_id":"d2e58444cc1a8d5237ba224ae14ac6e70605e5881707e135fee7ffb9581c7a9e","slow_id":"p03948_d2e58444cc1a8d5237ba224ae14ac6e70605e5881707e135fee7ffb9581c7a9e","speedup":2.0117198646976817,"stratum":"2-4","sampling_key":"5900817af974b3a4e8a79a9392f1c012e05846ea7ba9e4011ed0fae22e3f80ea","slow_code":"N, T = list(map(int, input().split()))\nA = list(map(int, input().split()))\nB = [0] * N\nC = [0] * N\nh = A[0]\nB[0] = h\nfor i in range(1, N):\n h = min(A[i], h)\n B[i] = h\nh = A[-1]\nC[-1] = h\nfor i in range(N - 2, -1, -1):\n h = max(A[i], h)\n C[i] = h\nB = B[:-1]\nC = C[1:]\nD = list([C[x] - B[x] for x in range(N - 1)])\nt = max(D)\ns = 0\nD.append(0)\nfor i in range(N - 1):\n if D[i] == t and D[i] > D[i + 1]:\n s += 1\nprint(s)\n","fast_code":"N, T = list(map(int, input().split()))\nA = list(map(int, input().split()))\ncnt = max_profit = 0\nINF = float(\"inf\")\nmin_cost = INF\nfor a in A:\n profit = a - min_cost\n if profit == max_profit:\n cnt += 1\n elif profit > max_profit:\n cnt = 1\n max_profit = profit\n min_cost = min(min_cost, a)\nprint(cnt)\n"} +{"fast_code_id":"8f1cd4d9dbdebf4a15ca40a783ca096b7f26f983da6029d528782b1c2d86cabe","fast_id":"p00444_8f1cd4d9dbdebf4a15ca40a783ca096b7f26f983da6029d528782b1c2d86cabe","language":"python","measured_fast_code_id":"8f1cd4d9dbdebf4a15ca40a783ca096b7f26f983da6029d528782b1c2d86cabe","measured_slow_code_id":"5a173aee84cd29871418ac625950658539fc65bec5b272557e76f7056cd3e13a","measurement_metric":"cpu_instruction_count","pair_id":"python_4f9206c9276bd49274c6e1da","problem_id":"p00444","slow_code_id":"5a173aee84cd29871418ac625950658539fc65bec5b272557e76f7056cd3e13a","slow_id":"p00444_5a173aee84cd29871418ac625950658539fc65bec5b272557e76f7056cd3e13a","speedup":29.413145379090334,"stratum":"8+","sampling_key":"e086d97f1a80b04cdf2ad0ea0cf48d24b0c004152202a521f5e9536abb61f780","slow_code":"import sys\n\ncoins = [1, 5, 10, 50, 100, 500]\nfor i in sys.stdin:\n if int(i) == 0:\n break\n n = 1000 - int(i)\n c = [i for i in range(n + 1)]\n for i in range(len(coins)):\n coin = coins[i]\n if coin <= n:\n c[coin] = 1\n coins.append(coin)\n for coin in coins:\n for p in range(coin + 1, n + 1):\n minc = c[p]\n if minc == 1:\n continue\n c[p] = c[p - coin] + 1 if minc > c[p - coin] + 1 else minc\n print((c[n]))\n","fast_code":"import sys\n\ncoins = [500, 100, 50, 10, 5, 1]\nfor i in sys.stdin:\n if int(i) == 0:\n break\n n = 1000 - int(i)\n cnt = 0\n while n != 0:\n for i in range(len(coins)):\n if n >= coins[i]:\n n = n - coins[i]\n break\n cnt += 1\n print(cnt)\n"} +{"fast_code_id":"7d6fb2a7a688b9582d1be0fb50c584d1e4eddb0670ea44c1457914dfb3881202","fast_id":"p02554_7d6fb2a7a688b9582d1be0fb50c584d1e4eddb0670ea44c1457914dfb3881202","language":"python","measured_fast_code_id":"7d6fb2a7a688b9582d1be0fb50c584d1e4eddb0670ea44c1457914dfb3881202","measured_slow_code_id":"1216aa013ca95268c8cea10ef1956fc82ecf53c33048dc021f31f4ae82487ba4","measurement_metric":"cpu_instruction_count","pair_id":"python_4fbafef4ef4b33a7ce2528ec","problem_id":"p02554","slow_code_id":"d34cbcef17a1809eb9aaea9acac748f4f348edb348ac1a61f3b30198ffe07352","slow_id":"p02554_1216aa013ca95268c8cea10ef1956fc82ecf53c33048dc021f31f4ae82487ba4","speedup":1870.0137850250967,"stratum":"8+","sampling_key":"17923a5db5a54dc7e56e8d6a43ea12ed7e6a755f6755de753fe9ca7aefcc8776","slow_code":"MOD = 10**9 + 7\n\n\ndef solve(n):\n dp = [[0] * 4 for i in range(n + 1)]\n dp[0][0] = 1\n for i in range(n):\n dp[i + 1][3] = (10 * dp[i][3] + dp[i][2] + dp[i][1]) % MOD\n dp[i + 1][2] = (9 * dp[i][2] + dp[i][0]) % MOD\n dp[i + 1][1] = (9 * dp[i][1] + dp[i][0]) % MOD\n dp[i + 1][0] = (8 * dp[i][0]) % MOD\n return dp[n][3]\n\n\nn = int(eval(input()))\nprint((solve(n)))\n","fast_code":"n = int(eval(input()))\nmod = 10**9 + 7\nans = pow(10, n, mod)\nans -= pow(9, n, mod) * 2\nans += pow(8, n, mod)\nprint((ans % mod))\n"} +{"fast_code_id":"3fe7b411ed933f44322c3ebc9db01922f20d7ad447ad58aa9934f7062ce01d40","fast_id":"p02362_a876e50adb7fb20d6c6d462a1e2209a28830057167cd88325e76836aef56d5a3","language":"python","measured_fast_code_id":"a876e50adb7fb20d6c6d462a1e2209a28830057167cd88325e76836aef56d5a3","measured_slow_code_id":"a4869b36b9d12ca77358a6e2beaf495c662e8b526bbaccd3ebb037a9734124f9","measurement_metric":"cpu_instruction_count","pair_id":"python_4fc2b93edc9b1a225e4e59ce","problem_id":"p02362","slow_code_id":"a4869b36b9d12ca77358a6e2beaf495c662e8b526bbaccd3ebb037a9734124f9","slow_id":"p02362_a4869b36b9d12ca77358a6e2beaf495c662e8b526bbaccd3ebb037a9734124f9","speedup":4.310780317517176,"stratum":"4-8","sampling_key":"6dc35b8c8a1f4303af164ddbde0cd7269f167c26d415fb8213d9e7d095ec9f77","slow_code":"from sys import stdin\nfrom collections import deque\n\nV, E, R = [int(x) for x in stdin.readline().split()]\nd = {}\ntick = False\nINF = float(\"inf\")\nfor i in range(V):\n d[i] = INF\nd[R] = 0\nweight = {}\nst = deque([])\nfor i in range(1, V + 1):\n for j in range(E):\n if i == 1:\n s, t, w = [int(x) for x in stdin.readline().split()]\n weight[(s, t)] = w\n st.append((s, t))\n (s, t) = st.popleft()\n if d[t] > d[s] + weight[(s, t)]:\n d[t] = d[s] + weight[(s, t)]\n if i == V:\n print(\"NEGATIVE CYCLE\")\n tick = True\n break\n st.append((s, t))\nif not tick:\n for k in range(V):\n if d[k] == float(\"inf\"):\n print(\"INF\")\n else:\n print((d[k]))\n","fast_code":"import sys\n\nfile_input = sys.stdin\nV, E, r = map(int, file_input.readline().split())\nedges = []\nfor line in file_input:\n edges.append(tuple(map(int, line.split())))\n\ndistance = [float(\"inf\")] * V\ndistance[r] = 0\nnotUpdated = True\nfor i in range(V - 1):\n notUpdated = True\n for s, t, w in edges:\n temp_d = distance[s] + w\n if temp_d < distance[t]:\n distance[t] = temp_d\n notUpdated = False\n if notUpdated:\n break\n\nif notUpdated:\n print(*map(lambda x: str(x).upper(), distance), sep=\"\\n\")\nelse:\n flag = True\n for s, t, w in edges:\n temp_d = distance[s] + w\n if temp_d < distance[t]:\n print(\"NEGATIVE CYCLE\")\n flag = False\n break\n if flag:\n print(*map(lambda x: str(x).upper(), distance), sep=\"\\n\")\n"} +{"fast_code_id":"ebab80c193ab2879dbfff7ff9f6d20f0b878f0d666af3027134f3506c6e7eec2","fast_id":"p02642_ebab80c193ab2879dbfff7ff9f6d20f0b878f0d666af3027134f3506c6e7eec2","language":"python","measured_fast_code_id":"ebab80c193ab2879dbfff7ff9f6d20f0b878f0d666af3027134f3506c6e7eec2","measured_slow_code_id":"17deae8ce2f8b76dd5d0f8a8b741fbc093186a8e41172410a54069f1d420d622","measurement_metric":"cpu_instruction_count","pair_id":"python_504ded2374d3c0fde6392b90","problem_id":"p02642","slow_code_id":"17deae8ce2f8b76dd5d0f8a8b741fbc093186a8e41172410a54069f1d420d622","slow_id":"p02642_17deae8ce2f8b76dd5d0f8a8b741fbc093186a8e41172410a54069f1d420d622","speedup":4.807433020495653,"stratum":"4-8","sampling_key":"1be5ffb7be2306a8ecbf75bf4c14d4ffa3bd0046a1872a40f4dedbd02935b3dd","slow_code":"N = int(eval(input()))\nAs = list(map(int, input().split()))\nM = max(As) + 1\ncnt = [0 for _ in range(M)]\nfor A in As:\n if cnt[A] != 0:\n cnt[A] = 2\n continue\n for n in range(A, M, A):\n cnt[n] += 1\nans = 0\nfor A in As:\n if cnt[A] == 1:\n ans += 1\nprint(ans)\n","fast_code":"import sys, collections\n\ninput = lambda: sys.stdin.readline().rstrip()\nsys.setrecursionlimit(10**7)\nINF = 10**20\n\n\ndef I():\n return int(eval(input()))\n\n\ndef F():\n return float(eval(input()))\n\n\ndef S():\n return eval(input())\n\n\ndef LI():\n return [int(x) for x in input().split()]\n\n\ndef LI_():\n return [int(x) - 1 for x in input().split()]\n\n\ndef LF():\n return [float(x) for x in input().split()]\n\n\ndef LS():\n return input().split()\n\n\ndef resolve():\n N = I()\n A = LI()\n cnt = collections.Counter(A)\n A = list(set(A))\n A.sort()\n A_max = A[-1]\n divisible = [False] * (A_max + 1)\n for i in A:\n for j in range(2 * i, A_max + 1, i):\n divisible[j] = True\n ans = 0\n for i in A:\n tmp = 0\n if not divisible[i] and cnt[i] == 1:\n tmp += 1\n ans += tmp\n print(ans)\n\n\nif __name__ == \"__main__\":\n resolve()\n"} +{"fast_code_id":"f3896361f060599c0132ae62a438ae715ac8888d947dfd3df4bf46e7b045d748","fast_id":"p02930_f3896361f060599c0132ae62a438ae715ac8888d947dfd3df4bf46e7b045d748","language":"python","measured_fast_code_id":"f3896361f060599c0132ae62a438ae715ac8888d947dfd3df4bf46e7b045d748","measured_slow_code_id":"e92d2c5b381e0dc13fec91e29d5b05e3c0b38db0ebb8a73555cd4f93676c88e6","measurement_metric":"cpu_instruction_count","pair_id":"python_50749482826d06ab3613e73f","problem_id":"p02930","slow_code_id":"e92d2c5b381e0dc13fec91e29d5b05e3c0b38db0ebb8a73555cd4f93676c88e6","slow_id":"p02930_e92d2c5b381e0dc13fec91e29d5b05e3c0b38db0ebb8a73555cd4f93676c88e6","speedup":3.0731807045003494,"stratum":"2-4","sampling_key":"8e9a5033bb05a967bd8fec4d65fcc8885aa1b95f482caa442cee2a363236bbd9","slow_code":"N, j = int(eval(input())), 0\nexec(\"print(*[9-format(i+1,'09b').rfind('1')for i in range(N)][:N-j-1]);j+=1;\" * N)\n","fast_code":"n = eval(input())\nwhile n:\n n -= 1\n for j in range(n):\n print((j + 1 & ~j).bit_length())\n"} +{"fast_code_id":"bdf2b5319812a1a3063118df44de51d0a6ac2c760efc280231a0134cd43d7060","fast_id":"p02724_bdf2b5319812a1a3063118df44de51d0a6ac2c760efc280231a0134cd43d7060","language":"python","measured_fast_code_id":"bdf2b5319812a1a3063118df44de51d0a6ac2c760efc280231a0134cd43d7060","measured_slow_code_id":"8e66543c4bfccd29b9635f672d4f7cfeb7472d55523631a6fef9ea761e351dd5","measurement_metric":"cpu_instruction_count","pair_id":"python_50af6e5dc87c721a3a3c16bd","problem_id":"p02724","slow_code_id":"ce23ce9602140709d4fba80da208b63c8ba5d91a22dfdb9a0bca025c1f37682a","slow_id":"p02724_8e66543c4bfccd29b9635f672d4f7cfeb7472d55523631a6fef9ea761e351dd5","speedup":3800.1493572502736,"stratum":"8+","sampling_key":"32a2f28d26f35d32a5bb06cb79cb65b40bcbfac51b0a8bbe3eb52937bc665540","slow_code":"def main():\n X = int(eval(input()))\n\n pmax = int(X / 500)\n ans = 0\n tmp = 0\n for p in range(pmax + 1):\n q = int((X - 500 * p) / 5)\n tmp = 1000 * p + 5 * q\n ans = max(ans, tmp)\n print(ans)\n\n\nmain()\n","fast_code":"X = int(eval(input()))\nprint(((X // 500) * 1000 + (X % 500) // 5 * 5))\n"} +{"fast_code_id":"65b52025f80ff7e8400929d26a7fa9ea5d5b2cb924509eccf9c8d4dc0fdbc45f","fast_id":"p02554_65b52025f80ff7e8400929d26a7fa9ea5d5b2cb924509eccf9c8d4dc0fdbc45f","language":"python","measured_fast_code_id":"65b52025f80ff7e8400929d26a7fa9ea5d5b2cb924509eccf9c8d4dc0fdbc45f","measured_slow_code_id":"1216aa013ca95268c8cea10ef1956fc82ecf53c33048dc021f31f4ae82487ba4","measurement_metric":"cpu_instruction_count","pair_id":"python_525d5ebed7f54af45437eb3a","problem_id":"p02554","slow_code_id":"d34cbcef17a1809eb9aaea9acac748f4f348edb348ac1a61f3b30198ffe07352","slow_id":"p02554_1216aa013ca95268c8cea10ef1956fc82ecf53c33048dc021f31f4ae82487ba4","speedup":2040.3178291513238,"stratum":"8+","sampling_key":"a1dca0fdd60503b6e8a27b1ce6299b15a28e81b1b9af38a8554b7de4476d5d2f","slow_code":"MOD = 10**9 + 7\n\n\ndef solve(n):\n dp = [[0] * 4 for i in range(n + 1)]\n dp[0][0] = 1\n for i in range(n):\n dp[i + 1][3] = (10 * dp[i][3] + dp[i][2] + dp[i][1]) % MOD\n dp[i + 1][2] = (9 * dp[i][2] + dp[i][0]) % MOD\n dp[i + 1][1] = (9 * dp[i][1] + dp[i][0]) % MOD\n dp[i + 1][0] = (8 * dp[i][0]) % MOD\n return dp[n][3]\n\n\nn = int(eval(input()))\nprint((solve(n)))\n","fast_code":"N = int(eval(input()))\nM = 10**9 + 7\nans = (pow(10, N, M) - 2 * pow(9, N, M) + pow(8, N, M)) % M\nprint(ans)\n"} +{"fast_code_id":"d22f1c20d03a5a6719dae24cf3e12d90665ba9707e1ae2885997b3a135f76c50","fast_id":"p02660_d22f1c20d03a5a6719dae24cf3e12d90665ba9707e1ae2885997b3a135f76c50","language":"python","measured_fast_code_id":"d22f1c20d03a5a6719dae24cf3e12d90665ba9707e1ae2885997b3a135f76c50","measured_slow_code_id":"1e001da6da556beb6c062a6c3d70fff79210c8de209532e9be2277daea370147","measurement_metric":"cpu_instruction_count","pair_id":"python_527d5c7fe9ba1ab630c3a221","problem_id":"p02660","slow_code_id":"c64e2163bbc96a46229eff42141503b7087d0832181258c593502e97f84f6fe7","slow_id":"p02660_1e001da6da556beb6c062a6c3d70fff79210c8de209532e9be2277daea370147","speedup":7.7290724058323645,"stratum":"4-8","sampling_key":"54ba82941d36bf4de4a691158ff53a50f342d10d9f90fd1429aa2f7f9ae74935","slow_code":"import numpy as np\nimport sys\n\n\ndef xnxn(n=0):\n if n == 0:\n temp = list(map(int, input().split()))\n if len(temp) == 1:\n return temp[0]\n elif len(temp) > 1:\n return temp\n else:\n temp = [list(map(int, input().split())) for _ in range(n)]\n return temp\n\n\ndef sp_xnxn(n=0):\n if n == 0:\n return [int(k) for k in xsxs()]\n else:\n return [[int(k) for k in xsxs()] for _ in range(n)]\n\n\ndef xsxs(n=0):\n if n == 0:\n temp = list(input().split())\n if len(temp) == 1:\n return temp[0]\n elif len(temp) > 1:\n return temp\n else:\n return [list(input().split()) for _ in range(n)]\n\n\ndef sp_xsxs(n=0):\n if n == 0:\n return [s for s in xsxs()]\n else:\n return [[s for s in xsxs()] for _ in range(n)]\n\n\ndef p_num(a):\n if a == 1:\n return [[a, 1]]\n else:\n tmp = 2\n ans = []\n while tmp < np.sqrt(a) + 1:\n n = 0\n p = [tmp]\n while a % tmp == 0:\n a = int(a / tmp)\n\n n += 1\n c = 1\n if n != 0:\n p.append(n)\n ans.append(p)\n tmp += 1\n c = 0\n if c == 0 and a != 1:\n ans.append([a, 1])\n return ans\n\n\nn = xnxn()\nif n == 1:\n print((0))\n sys.exit()\nelse:\n a = p_num(n)\n c = 0\n for num in a:\n i = 1\n while num[1] - i > -1:\n num[1] -= i\n i += 1\n c += 1\n print(c)\n","fast_code":"import itertools\nimport math\nimport fractions\nimport functools\nimport copy\nfrom collections import deque\nfrom functools import reduce\nfrom decimal import Decimal\n\nn = int(eval(input()))\n\n\ndef how_many_prime(n):\n prime = {}\n num = n\n i = 2\n while True:\n if i * i > n:\n if num > 1:\n prime[num] = 1\n break\n while num % i == 0:\n prime[i] = prime.get(i, 0) + 1\n num = num // i\n i += 1\n return prime\n\n\nprime = how_many_prime(n)\ncount = 0\nfor val in list(prime.values()):\n use = 1\n while True:\n if val < use:\n break\n val -= use\n use += 1\n count += 1\nprint(count)\n"} +{"fast_code_id":"055ea82692caf532cba37fabe5475d1f818a9782fbb3ecb3849a6afaa05f3056","fast_id":"p03556_055ea82692caf532cba37fabe5475d1f818a9782fbb3ecb3849a6afaa05f3056","language":"python","measured_fast_code_id":"055ea82692caf532cba37fabe5475d1f818a9782fbb3ecb3849a6afaa05f3056","measured_slow_code_id":"b08038f2cfa38828c3451135e0ae29ee0ad4cf29b9ef9a8abfaa3be486afcc2d","measurement_metric":"cpu_instruction_count","pair_id":"python_52e9202f7b0e60505aefb0b3","problem_id":"p03556","slow_code_id":"b08038f2cfa38828c3451135e0ae29ee0ad4cf29b9ef9a8abfaa3be486afcc2d","slow_id":"p03556_b08038f2cfa38828c3451135e0ae29ee0ad4cf29b9ef9a8abfaa3be486afcc2d","speedup":3015.0968480090287,"stratum":"8+","sampling_key":"79b94d1041ca654ffdf577b0f99b636c9aaa24ef89a428c5f0437a978b12f966","slow_code":"import functools\nimport itertools\nimport numpy as np\nimport sys\n\nMAX_INT = int(10e10)\nMIN_INT = -MAX_INT\nmod = 1000000007\nsys.setrecursionlimit(1000000)\n\n\ndef IL():\n return list(map(int, input().split()))\n\n\ndef SL():\n return input().split()\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef S():\n return eval(input())\n\n\nN = I()\nans = [pow(i, 2) for i in range(100000) if pow(i, 2) <= N]\nprint((ans[-1]))\n","fast_code":"import math\n\ni = int(eval(input()))\nr = math.sqrt(i)\nir = int(r)\nprint((ir * ir))\n"} +{"fast_code_id":"11a6f70bcd146baeffd880a2c686c3f4ab034b7c05f1cefaf0d09531c8a16f4a","fast_id":"p03762_350b256adfffe27e9bf3710fa7ba307f5bce2aefd03843c333650875679a2c38","language":"python","measured_fast_code_id":"350b256adfffe27e9bf3710fa7ba307f5bce2aefd03843c333650875679a2c38","measured_slow_code_id":"982e2a132ff9a9ee086902a77e4d38984ae35b417d1949db3c426a0eec331800","measurement_metric":"cpu_instruction_count","pair_id":"python_53291d37021811938889fd4b","problem_id":"p03762","slow_code_id":"982e2a132ff9a9ee086902a77e4d38984ae35b417d1949db3c426a0eec331800","slow_id":"p03762_982e2a132ff9a9ee086902a77e4d38984ae35b417d1949db3c426a0eec331800","speedup":4.631295069336506,"stratum":"4-8","sampling_key":"cde31fe7788267219f6743f83b151e86c4df2327a93ef8a8f191766ac965fd66","slow_code":"import sys\nimport numpy as np\n\nMOD = 10**9 + 7\nI = np.array(sys.stdin.read().split(), dtype=np.int64)\nn, m = I[:2]\nx = I[2 : 2 + n]\ny = I[2 + n :]\n\n\ndef main():\n sx = np.cumsum(x) % MOD\n sy = np.cumsum(y) % MOD\n sdx = (\n np.sum((sx[n - 1] - sx[: n - 1]) - x[: n - 1] * ((n - 1) - np.arange(n - 1)))\n % MOD\n )\n sdy = (\n np.sum((sy[m - 1] - sy[: m - 1]) - y[: m - 1] * ((m - 1) - np.arange(m - 1)))\n % MOD\n )\n ans = sdx * sdy % MOD\n return ans\n\n\nif __name__ == \"__main__\":\n ans = main()\n print(ans)\n","fast_code":"MOD = 10**9 + 7\nn, m = list(map(int, input().split()))\nx = list(map(int, input().split()))\ny = list(map(int, input().split()))\n\nfor i in range(n - 1):\n x[i] = x[i + 1] - x[i]\nfor i in range(m - 1):\n y[i] = y[i + 1] - y[i]\nN = [n - 1]\nfor i in range(n - 3, 0, -2):\n N.append(N[-1] + i)\n\nM = [m - 1]\nfor i in range(m - 3, 0, -2):\n M.append(M[-1] + i)\n\nif N[0] % 2 == 0:\n N += N[::-1]\nelif N[0] != 1:\n N += N[-2::-1]\nif M[0] % 2 == 0:\n M += M[::-1]\nelif M[0] != 1:\n M += M[-2::-1]\n\n\nif len(x) - 1 > len(N):\n while True:\n pass\nif len(y) - 1 > len(M):\n while True:\n pass\nX_sum = 0\nfor i in range(n - 1):\n X_sum += x[i] * N[i]\n X_sum %= MOD\nY_sum = 0\nfor i in range(m - 1):\n Y_sum += y[i] * M[i]\n Y_sum %= MOD\nprint(((X_sum * Y_sum) % MOD))\n"} +{"fast_code_id":"8a13dae7882cfd906337f31f35d0847dd59983a8f8886c0eb21aeb831fd07c3b","fast_id":"p02845_8a13dae7882cfd906337f31f35d0847dd59983a8f8886c0eb21aeb831fd07c3b","language":"python","measured_fast_code_id":"8a13dae7882cfd906337f31f35d0847dd59983a8f8886c0eb21aeb831fd07c3b","measured_slow_code_id":"44f76311477519e453c1541c8cee2cad565caf5c7e854c8feade8f7c7a67fffd","measurement_metric":"cpu_instruction_count","pair_id":"python_53787ff3f30c88a222728a34","problem_id":"p02845","slow_code_id":"44f76311477519e453c1541c8cee2cad565caf5c7e854c8feade8f7c7a67fffd","slow_id":"p02845_44f76311477519e453c1541c8cee2cad565caf5c7e854c8feade8f7c7a67fffd","speedup":4.415573933226832,"stratum":"4-8","sampling_key":"6ab2a86f6706f049c8bd70ab1957a8904c61ff8e571147a03996f472410ed3a9","slow_code":"_, a = open(0)\nc = 1\nd = [3] + [0] * 10**6\nfor a in map(int, a.split()):\n c = c * d[a] % (10**9 + 7)\n d[a] -= 1\n d[a + 1] += 1\nprint(c)\n","fast_code":"N = int(eval(input()))\nA = list(map(int, input().split()))\nc = [-1, -1, -1]\nsum = 1\ntmp = 0\nfor a in A:\n sum = sum * c.count(a - 1) % 1000000007\n if a - 1 == c[0]:\n c[0] += 1\n tmp = c.count(c[0] - 1) + 1\n elif a - 1 == c[1]:\n c[1] += 1\n tmp = c.count(c[1] - 1) + 1\n elif a - 1 == c[2]:\n c[2] += 1\n tmp = c.count(c[2] - 1) + 1\nprint(sum)\n"} +{"fast_code_id":"26734030bcda400044c5bc316b9e9cf9ea4fd118cda90874dbbc196f92e4bc76","fast_id":"p02732_c12bafaac4a619c4303dc3ae6c0f6b42d9fa951098e8a97794aeba3f3ef79885","language":"python","measured_fast_code_id":"c12bafaac4a619c4303dc3ae6c0f6b42d9fa951098e8a97794aeba3f3ef79885","measured_slow_code_id":"715c50a0bd5503a1c5a8f5900a3590d1b55c78b7a98e77c948ef59c2a023b3ea","measurement_metric":"cpu_instruction_count","pair_id":"python_53e4ed111db19220c8563c3a","problem_id":"p02732","slow_code_id":"715c50a0bd5503a1c5a8f5900a3590d1b55c78b7a98e77c948ef59c2a023b3ea","slow_id":"p02732_715c50a0bd5503a1c5a8f5900a3590d1b55c78b7a98e77c948ef59c2a023b3ea","speedup":2.567933865891802,"stratum":"2-4","sampling_key":"4e260e1c5e1252e58b31e950ed874a9de9be40bf98432393b56f896bc9d770d9","slow_code":"from functools import reduce\n\n\ndef d_banned_k():\n from collections import Counter\n from functools import reduce\n\n N = int(eval(input()))\n A = [int(i) for i in input().split()]\n\n def comb(n, r):\n numerator = reduce(lambda x, y: x * y, list(range(n, n - r, -1)))\n denominator = reduce(lambda x, y: x * y, list(range(1, r + 1)))\n return numerator // denominator\n\n count = Counter(A)\n total = sum(comb(c, 2) for c in list(count.values()))\n ans = []\n for a in A:\n v = count[a]\n ans.append(total - comb(v, 2) + comb(v - 1, 2))\n return \" \".join(map(str, ans))\n\n\nprint((d_banned_k()))\n","fast_code":"from collections import Counter\n\nn = int(eval(input()))\nA = list(map(int, input().split()))\n\nFreq = Counter(A)\n\nans_max = 0\nfor kv in list(Freq.items()):\n ans_max += kv[1] * (kv[1] - 1) // 2\nfor a in A:\n\n if Freq.get(a) == 1:\n print(ans_max)\n continue\n\n x = Freq.get(a)\n diff = (x * (x - 1) // 2) - ((x - 1) * (x - 2) // 2)\n\n ans = ans_max - diff\n print(ans)\n"} +{"fast_code_id":"8185ff30e0c9c996858e3d16d93a81081069df94e4bf04533622db94259f80af","fast_id":"p03160_02dc5e8a92b36c65414027f95dabbd6bae3c37ac8542ade78d85c49d788d67e4","language":"python","measured_fast_code_id":"02dc5e8a92b36c65414027f95dabbd6bae3c37ac8542ade78d85c49d788d67e4","measured_slow_code_id":"934f379e0e5300fe0fee5440b2de9ab7f1cfdccbfbc9686e36dc49ab293c868e","measurement_metric":"cpu_instruction_count","pair_id":"python_53e9873577feed10bee116ef","problem_id":"p03160","slow_code_id":"3c2eb6d041b194aca6e618ed722e1b9ae4cb2dfbc9ca12487589612e2e637390","slow_id":"p03160_934f379e0e5300fe0fee5440b2de9ab7f1cfdccbfbc9686e36dc49ab293c868e","speedup":32.229120262452156,"stratum":"8+","sampling_key":"c7c75460095b560fbb57424315066a3bc4090feae46200edc58c5bf6614b851c","slow_code":"import numpy as np\n\nN = int(eval(input()))\nhs = [int(i) for i in input().split()]\ndp = np.zeros(N)\nfor i, h in enumerate(hs):\n if i == 0:\n\n dp[i] = 0\n continue\n elif i == 1:\n\n dp[i] = dp[i - 1] + abs(hs[i - 1] - h)\n else:\n\n dp[i] = min(dp[i - 1] + abs(hs[i - 1] - h), dp[i - 2] + abs(hs[i - 2] - h))\n\nprint((int(dp[-1])))\n","fast_code":"def chmin(a, b):\n return b if a > b else a\n\n\ndef chmax(a, b):\n return b if a < b else a\n\n\ndef main(N, h):\n INF = 10**9\n dp = [INF] * (10**5 + 10)\n dp[0] = 0\n dp[1] = abs(h[1] - h[0])\n for i in range(2, N):\n dp[i] = chmin(dp[i], dp[i - 1] + abs(h[i] - h[i - 1]))\n dp[i] = chmin(dp[i], dp[i - 2] + abs(h[i] - h[i - 2]))\n return dp[N - 1]\n\n\nif __name__ == \"__main__\":\n N = int(eval(input()))\n h = list(map(int, input().split()))\n print((main(N, h)))\n"} +{"fast_code_id":"a16ad46c25afcc872ffdcecc1fc2488ab024ba2926890f3b3b73a77ac9799ba5","fast_id":"p03566_745ddbba495ff86d8ef795671a21728a3a97d40f4051f365cd66ffaf6066ffab","language":"python","measured_fast_code_id":"745ddbba495ff86d8ef795671a21728a3a97d40f4051f365cd66ffaf6066ffab","measured_slow_code_id":"e080acc822dc90b94acbd1874bafc617cc0405efef250948b23c795bba65bd1b","measurement_metric":"cpu_instruction_count","pair_id":"python_54268f3315014b85c79dc4ed","problem_id":"p03566","slow_code_id":"e080acc822dc90b94acbd1874bafc617cc0405efef250948b23c795bba65bd1b","slow_id":"p03566_e080acc822dc90b94acbd1874bafc617cc0405efef250948b23c795bba65bd1b","speedup":6.547744473015357,"stratum":"4-8","sampling_key":"63e29eaeaa2a442f1f3ff31d31d853591851fd90e62b0f3c8848bf43c6a0048c","slow_code":"import heapq\n\nn = int(eval(input()))\ninf = 10000000000000\nans = [[-1, -1] for i in range(n)]\nans[-1][1], ans[0][0] = 0, 0\nt = list(map(int, input().split()))\nv = list(map(int, input().split()))\nv2 = []\nfor i in range(n):\n heapq.heappush(v2, (v[i], i))\n\n\ndef next(y, wh):\n global ans, n\n ansi = inf\n if wh:\n r1, r2 = list(range(y[1] - 1, -1, -1)), list(range(y[1], n))\n else:\n r1, r2 = list(range(y[1], -1, -1)), list(range(y[1] + 1, n))\n now = 0\n for j in r1:\n if ans[j][1] != -1:\n ansi = min(ansi, ans[j][1] + now)\n now += t[j]\n if ans[j][0] != -1:\n ansi = min(ansi, ans[j][0] + now)\n now = 0\n for j in r2:\n if ans[j][0] != -1:\n ansi = min(ansi, ans[j][0] + now)\n now += t[j]\n if ans[j][1] != -1:\n ansi = min(ansi, ans[j][1] + now)\n if wh:\n ans[y[1]][0] = min(ansi, y[0])\n ans[y[1] - 1][1] = ans[y[1]][0]\n else:\n ans[y[1]][1] = min(ansi, y[0])\n ans[y[1] + 1][0] = ans[y[1]][1]\n\n\nfor i in range(n):\n y = heapq.heappop(v2)\n if ans[y[1]][0] == -1:\n next(y, True)\n if ans[y[1]][1] == -1:\n next(y, False)\nanswer = 0\nfor i in range(n):\n h = min((t[i] + sum(ans[i])) / 2, v[i])\n answer += (h**2 - ans[i][0] ** 2) / 2\n answer += (h**2 - ans[i][1] ** 2) / 2\n answer += h * (t[i] + sum(ans[i]) - 2 * h)\nprint(answer)\n","fast_code":"def calc_area(v_end, v_start, v_max, dt):\n kouten_v = (v_end + v_start + dt) / 2\n kouten_t = kouten_v - v_start\n if 0 < kouten_t < dt:\n area = (v_start + kouten_v) * kouten_t / 2\n area += (v_end + kouten_v) * (dt - kouten_t) / 2\n area -= max(0, (kouten_v - v_max)) ** 2\n else:\n area = (v_start + v_end) * dt / 2\n return area\n\n\ndef main():\n\n n = int(eval(input()))\n t = [int(i) for i in input().split()]\n v = [int(i) for i in input().split()]\n\n max_velocity = [0]\n for i in range(1, n):\n max_velocity_ = min(v[i - 1], v[i], max_velocity[i - 1] + t[i - 1])\n max_velocity.append(max_velocity_)\n max_velocity.append(0)\n\n for i in range(n - 1):\n if max_velocity[-(i + 1)] - max_velocity[-(i + 2)] < -t[-(i + 1)]:\n max_velocity[-(i + 2)] = max_velocity[-(i + 1)] + t[-(i + 1)]\n\n ans = 0\n for i in range(n):\n ans += calc_area(max_velocity[i + 1], max_velocity[i], v[i], t[i])\n print(ans)\n\n\nmain()\n"} +{"fast_code_id":"1d9c31e5ce2162887674cce50c00de270e79f0fa89cbdada8f3d0255f57d45df","fast_id":"p03274_1d9c31e5ce2162887674cce50c00de270e79f0fa89cbdada8f3d0255f57d45df","language":"python","measured_fast_code_id":"1d9c31e5ce2162887674cce50c00de270e79f0fa89cbdada8f3d0255f57d45df","measured_slow_code_id":"15cce6db7bc6d79dcd48950e05503001080b8e54791a05cbcc84aecc1f823153","measurement_metric":"cpu_instruction_count","pair_id":"python_5433ce5f3ad851814889c98c","problem_id":"p03274","slow_code_id":"15cce6db7bc6d79dcd48950e05503001080b8e54791a05cbcc84aecc1f823153","slow_id":"p03274_15cce6db7bc6d79dcd48950e05503001080b8e54791a05cbcc84aecc1f823153","speedup":3.345303260479619,"stratum":"2-4","sampling_key":"41136269c88065d93bd834cd66435cc146588e4366e10c8efc0628684c5871e8","slow_code":"import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time\n\nsys.setrecursionlimit(10**7)\ninf = 10**20\nmod = 10**9 + 7\n\n\ndef LI():\n return list(map(int, input().split()))\n\n\ndef I():\n return int(eval(input()))\n\n\ndef LS():\n return input().split()\n\n\ndef S():\n return eval(input())\n\n\ndef main():\n n, k = LI()\n l = LI()\n mn = inf\n for i in range(n - k + 1):\n a = l[i]\n b = l[i + k - 1]\n if a < 0 and b > 0:\n mn = min([mn, abs(a) + abs(b) * 2, abs(a) * 2 + abs(b)])\n else:\n mn = min(mn, max(abs(a), abs(b)))\n return mn\n\n\nprint((main()))\n","fast_code":"N, K = list(map(int, input().split()))\nX = list(map(int, input().split()))\nans = 10**18\nfor l in range(N - K + 1):\n D = X[l + K - 1] - X[l]\n if X[l] <= 0 <= X[l + K - 1]:\n D += min(-X[l], X[l + K - 1])\n elif X[l + K - 1] <= 0:\n D += -X[l + K - 1]\n elif X[l] >= 0:\n D += X[l]\n ans = min(ans, D)\nprint(ans)\n"} +{"fast_code_id":"8d636eca134cf8aabca8c761109550ad7a2aaddb74603d946dc42ab021814e9f","fast_id":"p02830_8d636eca134cf8aabca8c761109550ad7a2aaddb74603d946dc42ab021814e9f","language":"python","measured_fast_code_id":"8d636eca134cf8aabca8c761109550ad7a2aaddb74603d946dc42ab021814e9f","measured_slow_code_id":"241afa9a4a462ffb4a4454131541737b779c1c29e81784f31982be1ef01be8e4","measurement_metric":"cpu_instruction_count","pair_id":"python_543c5e88fbaf381a9b9d4de8","problem_id":"p02830","slow_code_id":"241afa9a4a462ffb4a4454131541737b779c1c29e81784f31982be1ef01be8e4","slow_id":"p02830_241afa9a4a462ffb4a4454131541737b779c1c29e81784f31982be1ef01be8e4","speedup":14.639388499355325,"stratum":"8+","sampling_key":"4852d66af7776bff7bea6afc32cdf3e8f8a4ebed97199504e5546b8b7af39786","slow_code":"from collections import Counter, defaultdict, deque\nfrom heapq import heappop, heappush, heapify\nimport sys, bisect, math, itertools, fractions, pprint\n\nsys.setrecursionlimit(10**8)\nmod = 10**9 + 7\nmod2 = 998244353\nINF = float(\"inf\")\n\n\ndef inp():\n return int(sys.stdin.readline())\n\n\ndef inpl():\n return list(map(int, sys.stdin.readline().split()))\n\n\ndef inpln(n):\n return list(int(sys.stdin.readline()) for i in range(n))\n\n\nn = inp()\ns, t = input().split()\nres = \"\"\nfor i in range(n):\n res += s[i] + t[i]\nprint(res)\n","fast_code":"import sys\n\nN = int(input())\nS, T = input().split()\nif not (1 <= N <= 100):\n sys.exit()\nif not (len(S) == len(T) and len(S) == N):\n sys.exit()\nif not (S.islower() and T.islower()):\n sys.exit()\nfor I in range(N):\n print(S[I], end=\"\")\n print(T[I], end=\"\")\n"} +{"fast_code_id":"6a3cdcd9f3583b074d03ea7703d2aae34a281b10dd49ae86774466be09719b14","fast_id":"p02716_6a3cdcd9f3583b074d03ea7703d2aae34a281b10dd49ae86774466be09719b14","language":"python","measured_fast_code_id":"6a3cdcd9f3583b074d03ea7703d2aae34a281b10dd49ae86774466be09719b14","measured_slow_code_id":"e0091a9b9deccd6ac161e28fc03ef99b2dfd2dba84ead05783e45d658cc28bd0","measurement_metric":"cpu_instruction_count","pair_id":"python_54b9dd3f1c8caf227dc15d7c","problem_id":"p02716","slow_code_id":"df39c3ce8c4ff15d3390419aee36b903bfab2cef5b1f71f30ea85ada047502b8","slow_id":"p02716_e0091a9b9deccd6ac161e28fc03ef99b2dfd2dba84ead05783e45d658cc28bd0","speedup":3.004517926306213,"stratum":"2-4","sampling_key":"808ee2889ae7f3d7c136af4105e1ae49db20523e24ab90bb21ab283fe19b315b","slow_code":"C = -(10**15 + 7)\n\n\ndef main():\n from collections import defaultdict\n\n N = int(eval(input()))\n K = N // 2\n A = [int(i) for i in input().split()]\n dp = defaultdict(lambda: C)\n for i in range(N + 1):\n dp[i, 0] = 0\n if i != 0:\n dp[(i, 1)] = max(dp[i - 1, 1], A[i - 1])\n for i in range(2, N + 1):\n for j in range(i // 2 - 1, (i + 1) // 2 + 1):\n if j < 0:\n continue\n\n dp[i, j] = max(\n dp[i, j],\n dp[i - 2, j - 1] + A[i - 1],\n dp[i - 3, j - 1] + A[i - 1],\n dp[i - 4, j - 1] + A[i - 1],\n )\n print((max(dp[N, K], dp[N - 1, K], dp[N - 2, K])))\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"n = int(eval(input()))\na = list(map(int, input().split()))\ndp = [0 for i in range(3)]\nfor i in range(1, n + 1):\n ai = a[i - 1]\n if i % 2:\n dp[1] = max(dp[0], dp[1])\n dp[0] += ai\n if i % 2 == 0:\n dp[2] = max(dp[1], dp[2])\n dp[1] += ai\n if i >= 3 and i % 2:\n dp[2] += ai\nif n % 2 == 0:\n print((max(dp[0], dp[1])))\nelse:\n print((max(dp[1], dp[2])))\n"} +{"fast_code_id":"281e9d543cc6c1d296b383a13e557b7a6fe3d3821ed6a91eb48f72e5b26ce242","fast_id":"p03699_281e9d543cc6c1d296b383a13e557b7a6fe3d3821ed6a91eb48f72e5b26ce242","language":"python","measured_fast_code_id":"281e9d543cc6c1d296b383a13e557b7a6fe3d3821ed6a91eb48f72e5b26ce242","measured_slow_code_id":"9c4a51b8f4ba22ed5163c6625c8ee551d52c7589ed51b5dd88791465550e96e2","measurement_metric":"cpu_instruction_count","pair_id":"python_54c043e4eee4c7ba42223c70","problem_id":"p03699","slow_code_id":"9c4a51b8f4ba22ed5163c6625c8ee551d52c7589ed51b5dd88791465550e96e2","slow_id":"p03699_9c4a51b8f4ba22ed5163c6625c8ee551d52c7589ed51b5dd88791465550e96e2","speedup":235.4399706925101,"stratum":"8+","sampling_key":"5be10c4cc4672cb1e13b162188b254529291363916702909d89852258c5e072a","slow_code":"n = int(eval(input()))\na = [int(eval(input())) for _ in range(n)]\ndp = [[] for _ in range(n + 1)]\nfor i in range(n + 1):\n dp[i] += [-1 for _ in range(10010)]\ndp[0][0] = 1\nfor i in range(n):\n for j in range(10010):\n if dp[i][j] == 1:\n dp[i + 1][j] = 1\n dp[i + 1][j + a[i]] = 1\nans = 0\nfor i in range(10010):\n if dp[n][i] == 1:\n if i % 10 != 0:\n ans = max(ans, i)\nprint(ans)\n","fast_code":"n = int(eval(input()))\ns = sorted([int(eval(input())) for i in range(n)])\nans = 0\nif sum(s) % 10 != 0:\n print((sum(s)))\nelse:\n for i in s:\n if i % 10 != 0:\n ans = sum(s) - i\n print(ans)\n break\n if ans == 0:\n print(ans)\n"} +{"fast_code_id":"d01a3b994ea420f84f1fec9d04b81e669100b8678a5fdca6b824945b066ea855","fast_id":"p00775_d01a3b994ea420f84f1fec9d04b81e669100b8678a5fdca6b824945b066ea855","language":"python","measured_fast_code_id":"d01a3b994ea420f84f1fec9d04b81e669100b8678a5fdca6b824945b066ea855","measured_slow_code_id":"795b09bbdc3e784c88f5123c69e5182a24a5b0dfccc3a43d6572c5a9d5f75406","measurement_metric":"cpu_instruction_count","pair_id":"python_54c2c3241998f9191deddd04","problem_id":"p00775","slow_code_id":"795b09bbdc3e784c88f5123c69e5182a24a5b0dfccc3a43d6572c5a9d5f75406","slow_id":"p00775_795b09bbdc3e784c88f5123c69e5182a24a5b0dfccc3a43d6572c5a9d5f75406","speedup":12.740507331930266,"stratum":"8+","sampling_key":"0a3e674312ae20aea836ed2f36576de5601d4f6046ec122ca71078e24d6f565f","slow_code":"while True:\n R, N = list(map(int, input().split()))\n if not (R | N):\n break\n geta = 20\n buildings = [0] * (geta * 2)\n for _ in range(N):\n xl, xr, h = list(map(int, input().split()))\n for i in range(xl + geta, xr + geta):\n buildings[i] = max(buildings[i], h)\n left, right = 0, 20\n for _ in range(100):\n mid = (left + right) / 2\n flag = True\n for i in range(-R + geta, R + geta):\n if i < geta:\n y = pow(R * R - (i - geta + 1) * (i - geta + 1), 0.5)\n flag &= buildings[i] >= y - R + mid\n else:\n y = pow(R * R - (i - geta) * (i - geta), 0.5)\n flag &= buildings[i] >= y - R + mid\n if flag:\n left = mid\n else:\n right = mid\n print((\"{:.20f}\".format(left)))\n","fast_code":"from math import sqrt\n\nwhile True:\n R, N = list(map(int, input().split()))\n if not (R | N):\n break\n geta = 20\n buildings = [0] * (geta * 2)\n for _ in range(N):\n xl, xr, h = list(map(int, input().split()))\n for i in range(xl + geta, xr + geta):\n buildings[i] = max(buildings[i], h)\n print(\n (\n min(\n buildings[i]\n - sqrt(R * R - (i - geta + (i < geta)) * (i - geta + (i < geta)))\n + R\n for i in range(-R + geta, R + geta)\n )\n )\n )\n"} +{"fast_code_id":"151bd42f944ac95c44a3b3fa5702e264684f5dc5ea2d780c7b3be1f1bf679241","fast_id":"p03805_151bd42f944ac95c44a3b3fa5702e264684f5dc5ea2d780c7b3be1f1bf679241","language":"python","measured_fast_code_id":"151bd42f944ac95c44a3b3fa5702e264684f5dc5ea2d780c7b3be1f1bf679241","measured_slow_code_id":"1ee773003e3c1cf2505debdef879b800379f8e81a80001be71fff6fb14cc8f55","measurement_metric":"cpu_instruction_count","pair_id":"python_54dff1db1ba47d5cf35e7706","problem_id":"p03805","slow_code_id":"1ee773003e3c1cf2505debdef879b800379f8e81a80001be71fff6fb14cc8f55","slow_id":"p03805_1ee773003e3c1cf2505debdef879b800379f8e81a80001be71fff6fb14cc8f55","speedup":6.652190917897154,"stratum":"4-8","sampling_key":"43296720f4bcb152755953ea2b344bb08a428a43cbaa7695d0e962e0dd396f3e","slow_code":"def getN():\n return int(eval(input()))\n\n\ndef getNM():\n return list(map(int, input().split()))\n\n\ndef getList():\n return list(map(int, input().split()))\n\n\ndef getArray(intn):\n return [int(eval(input())) for i in range(intn)]\n\n\ndef input():\n return sys.stdin.readline().rstrip()\n\n\nfrom collections import defaultdict, deque, Counter\nfrom sys import exit\nimport heapq\nimport math\nimport fractions\nimport copy\nfrom itertools import permutations\nfrom operator import mul\nfrom functools import reduce\nfrom bisect import bisect_left, bisect_right\nimport sys\n\nsys.setrecursionlimit(1000000000)\nmod = 10**9 + 7\nN, M = getNM()\ndist = [[] for i in range(N + 1)]\nfor i in range(M):\n a, b = getNM()\n dist[a - 1].append(b - 1)\n dist[b - 1].append(a - 1)\ncnt = 0\npos = deque([[1 << 0, 0]])\nwhile len(pos) > 0:\n s, v = pos.popleft()\n if s == (1 << N) - 1:\n cnt += 1\n for u in dist[v]:\n if s & (1 << u):\n continue\n pos.append([s | (1 << u), u])\nprint(cnt)\n","fast_code":"from collections import defaultdict\nimport itertools\n\nn, m = list(map(int, input().split()))\nconnected_dict = defaultdict(lambda: [])\nfor i in range(m):\n a, b = list(map(int, input().split()))\n connected_dict[a].append(b)\n connected_dict[b].append(a)\ncount = 0\nfor permutation in list(itertools.permutations(list(range(2, n + 1)))):\n flag = True\n pre_num = 1\n for num in permutation:\n if num not in connected_dict[pre_num]:\n flag = False\n break\n pre_num = num\n if flag:\n count += 1\nprint(count)\n"} +{"fast_code_id":"ede5b9a058396a01daab936932f464e5cbc2fc788809c17d5f9cdcc2162829ae","fast_id":"p04015_1a98987828acdc995c82737080e5ab5fa521efa2065493a3a3086d597b1d0fa8","language":"python","measured_fast_code_id":"1a98987828acdc995c82737080e5ab5fa521efa2065493a3a3086d597b1d0fa8","measured_slow_code_id":"d7a5fd53d5dea866179392e857d0ee049e8a0b04508777e18d44c1ee38eeb866","measurement_metric":"cpu_instruction_count","pair_id":"python_5587306410d8a64da097a703","problem_id":"p04015","slow_code_id":"d7a5fd53d5dea866179392e857d0ee049e8a0b04508777e18d44c1ee38eeb866","slow_id":"p04015_d7a5fd53d5dea866179392e857d0ee049e8a0b04508777e18d44c1ee38eeb866","speedup":7.397684802557289,"stratum":"4-8","sampling_key":"1e39dd0c9e1f2c74443cca51178a2dd10855b27e2825ff996a2221206db3eed8","slow_code":"N, A = list(map(int, input().split()))\nX = list(map(int, input().split()))\nfrom collections import defaultdict\n\ndp = [defaultdict(lambda: 0) for _ in range(N + 1)]\ndp[0][0] = 1\nfor i, x in enumerate(X):\n for j in range(i, -1, -1):\n for k, v in list(dp[j].items()):\n dp[j + 1][k + x] += v\nans = 0\nfor i in range(1, N + 1):\n ans += dp[i][i * A]\nprint(ans)\n","fast_code":"def main():\n N, A = tuple(map(int, input().split()))\n X = tuple([int(x) - A for x in input().split()])\n D = {0: 1}\n for i in X:\n for j, k in list(D.items()):\n D[i + j] = D.get(i + j, 0) + k\n ans = D[0] - 1\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"bf2b25d30147294ff0276ceb1faeae7b06783207fa7b8ca256752e56cdee77d1","fast_id":"p02612_bf2b25d30147294ff0276ceb1faeae7b06783207fa7b8ca256752e56cdee77d1","language":"python","measured_fast_code_id":"bf2b25d30147294ff0276ceb1faeae7b06783207fa7b8ca256752e56cdee77d1","measured_slow_code_id":"486e81cc66275807ffb489c81f6621446128ea2a8f5f188eb842554d9fce0e45","measurement_metric":"cpu_instruction_count","pair_id":"python_55f6e5b694e087ea1ef6ffa5","problem_id":"p02612","slow_code_id":"486e81cc66275807ffb489c81f6621446128ea2a8f5f188eb842554d9fce0e45","slow_id":"p02612_486e81cc66275807ffb489c81f6621446128ea2a8f5f188eb842554d9fce0e45","speedup":3.575106354356572,"stratum":"2-4","sampling_key":"65525c26650d96af7039af08f6ce7e902ecbd7426d36bca3140f27b0757a2e10","slow_code":"import sys\n\n\ndef Ii():\n return int(sys.stdin.readline())\n\n\ndef Mi():\n return list(map(int, sys.stdin.buffer.readline().split()))\n\n\ndef Li():\n return list(map(int, sys.stdin.buffer.readline().split()))\n\n\nn = Ii()\na = n % 1000\nif a == 0:\n print((0))\nelse:\n print((1000 - a))\n","fast_code":"print((-int(eval(input())) % 1000))\n"} +{"fast_code_id":"62ce0d71021cdf43a936b8ef75ca0df54e7d21e298af8afb73284bc390d9b7fc","fast_id":"p03292_62ce0d71021cdf43a936b8ef75ca0df54e7d21e298af8afb73284bc390d9b7fc","language":"python","measured_fast_code_id":"62ce0d71021cdf43a936b8ef75ca0df54e7d21e298af8afb73284bc390d9b7fc","measured_slow_code_id":"f60b0a699a2d92dfcbb5b26a370092e660bc85afffa65c600089419b521caefb","measurement_metric":"cpu_instruction_count","pair_id":"python_56701acf65f336661d39c411","problem_id":"p03292","slow_code_id":"f60b0a699a2d92dfcbb5b26a370092e660bc85afffa65c600089419b521caefb","slow_id":"p03292_f60b0a699a2d92dfcbb5b26a370092e660bc85afffa65c600089419b521caefb","speedup":3.2574835091663616,"stratum":"2-4","sampling_key":"370371fd618081f580100da2b097624839715a454e0e4183d15f38c2d0d0fcc5","slow_code":"a, b, c = list(map(int, input().split()))\nans = 9999\nans = min(ans, abs(a - b) + abs(b - c), abs(a - c) + abs(c - b))\nans = min(ans, abs(b - a) + abs(a - c), abs(b - c) + abs(c - a))\nans = min(ans, abs(c - a) + abs(a - b), abs(c - b) + abs(b - a))\nprint(ans)\n","fast_code":"a, _, b = sorted(map(int, input().split()))\nprint((b - a))\n"} +{"fast_code_id":"d8747bcd1997d6d3c47a2fb9d78361faa012e4743719302d67407ece71f07982","fast_id":"p03448_d8747bcd1997d6d3c47a2fb9d78361faa012e4743719302d67407ece71f07982","language":"python","measured_fast_code_id":"d8747bcd1997d6d3c47a2fb9d78361faa012e4743719302d67407ece71f07982","measured_slow_code_id":"4e1d7acbb2606da283c3a8eac1e2e7f0cacf8fd0d8740abb75a39aa1271b6158","measurement_metric":"cpu_instruction_count","pair_id":"python_56883257cca982019b021ad3","problem_id":"p03448","slow_code_id":"670baf1495be327e297400d2ae6c76ee55c7324bb3063c37fcd00633863ca6b5","slow_id":"p03448_4e1d7acbb2606da283c3a8eac1e2e7f0cacf8fd0d8740abb75a39aa1271b6158","speedup":3.1356407963544877,"stratum":"2-4","sampling_key":"25ce33fad4a3ee365d885ac748ab6a84892413b76f35a7fe81a04e2e2cb415bf","slow_code":"A = int(eval(input()))\nB = int(eval(input()))\nC = int(eval(input()))\nX = int(eval(input()))\n_500 = 500\n_100 = 100\n_50 = 50\ncount = 0\nfor a in range(A + 1):\n for b in range(B + 1):\n for c in range(C + 1):\n if X - (a * _500 + b * _100 + c * _50) == 0:\n count = count + 1\nprint(count)\n","fast_code":"a = int(eval(input()))\nb = int(eval(input()))\nc = int(eval(input()))\nx = int(eval(input()))\nans = 0\nfor A in range(a + 1):\n for B in range(b + 1):\n C = (x - 500 * A - 100 * B) // 50\n if 0 <= C <= c:\n ans += 1\nprint(ans)\n"} +{"fast_code_id":"927c8eaad41aafff24b82bf15e6169537001e401db6311ca492154ea09b29809","fast_id":"p03170_33c28753a08860218ab53615a5f71ef71d22bf0c1943d531cde21ef3265d4375","language":"python","measured_fast_code_id":"33c28753a08860218ab53615a5f71ef71d22bf0c1943d531cde21ef3265d4375","measured_slow_code_id":"a4648aa899c2882eae6100874b2e2a8caea07da6276939d30c255744c52a4139","measurement_metric":"cpu_instruction_count","pair_id":"python_56af112ef8b522d79637e14b","problem_id":"p03170","slow_code_id":"6d59945073e9aa00c001075772307363a1804de8cf7ddff5d5a392c4580e87dd","slow_id":"p03170_a4648aa899c2882eae6100874b2e2a8caea07da6276939d30c255744c52a4139","speedup":7.352784216627196,"stratum":"4-8","sampling_key":"2634f2dda63236fec02d2dab0c8da04a4d5a874116eed0d93a5002c2b4d53d6f","slow_code":"import collections\n\n\ndef solve(xs):\n dp = collections.defaultdict(bool)\n dp[0] = False\n for j in range(1, K + 1):\n dp[j] = any((j >= x) and (not dp[j - x]) for x in xs)\n return dp[K]\n\n\nN, K = list(map(int, input().split()))\nchoices = [int(s) for s in input().split()]\nassert len(choices) == N\nres = solve(choices)\nprint((\"First\" if res else \"Second\"))\n","fast_code":"def main():\n N, K, *A = list(map(int, open(0).read().split()))\n dp = [False] * (K + 1)\n for i in range(K):\n if dp[i]:\n continue\n for a in A:\n if i + a > K:\n break\n dp[i + a] = True\n print((\"First\" if dp[-1] else \"Second\"))\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"9c85e29cf2e084939c6660d9a3ef9d7e6812634748dda97e44d2f7870123e106","fast_id":"p02994_9c85e29cf2e084939c6660d9a3ef9d7e6812634748dda97e44d2f7870123e106","language":"python","measured_fast_code_id":"9c85e29cf2e084939c6660d9a3ef9d7e6812634748dda97e44d2f7870123e106","measured_slow_code_id":"b033c38ec6619d100b0693f703ee7559d8c7c976d73cee1d8a552d7f88a6875e","measurement_metric":"cpu_instruction_count","pair_id":"python_572a07b4ee52e70ca1aebe9d","problem_id":"p02994","slow_code_id":"b033c38ec6619d100b0693f703ee7559d8c7c976d73cee1d8a552d7f88a6875e","slow_id":"p02994_b033c38ec6619d100b0693f703ee7559d8c7c976d73cee1d8a552d7f88a6875e","speedup":89.89077604745616,"stratum":"8+","sampling_key":"04d789b5297b7c9cd626b2c6a605f19b22508f772d1db9a9669bd3c64179f403","slow_code":"import copy\n\nN, L = list(map(int, input().split()))\nflaver = []\nfor i in range(1, N + 1):\n flaver.append(L + i - 1)\nflaver_sum = sum(flaver)\nfor i in range(len(flaver)):\n c_flaver = copy.deepcopy(flaver)\n del c_flaver[i]\n if i == 0:\n tmp_min = abs(flaver_sum - sum(c_flaver))\n index = i\n if abs(flaver_sum - sum(c_flaver)) < tmp_min:\n tmp_min = abs(flaver_sum - sum(c_flaver))\n index = i\ndel flaver[index]\nprint((sum(flaver)))\n","fast_code":"n, l = list(map(int, input().split()))\nif l > 0:\n print((sum(range(l + 1, l + n))))\nelif l + n - 1 < 0:\n print((sum(range(l, l + n - 1))))\nelse:\n print((sum(range(l, l + n))))\n"} +{"fast_code_id":"39f508bfbeebafeed596d9cf0d1ac8ae5aabb7b0f7fb18da6b1964d9d5e58f0a","fast_id":"p02628_39f508bfbeebafeed596d9cf0d1ac8ae5aabb7b0f7fb18da6b1964d9d5e58f0a","language":"python","measured_fast_code_id":"39f508bfbeebafeed596d9cf0d1ac8ae5aabb7b0f7fb18da6b1964d9d5e58f0a","measured_slow_code_id":"12fc0a6880b1658c0eaeba3aa7dd7893393cf5c052e40105869e3784eb2f1caa","measurement_metric":"cpu_instruction_count","pair_id":"python_579897288e7f6cdfb3ddc2ed","problem_id":"p02628","slow_code_id":"12fc0a6880b1658c0eaeba3aa7dd7893393cf5c052e40105869e3784eb2f1caa","slow_id":"p02628_12fc0a6880b1658c0eaeba3aa7dd7893393cf5c052e40105869e3784eb2f1caa","speedup":44.87615894272947,"stratum":"8+","sampling_key":"7c9203570132810e8513cbf0d62eb9c21fc2d60adedb3dfcdb9cbb8ccbff2f85","slow_code":"N, K = list(map(int, input().split()))\nP = list(map(int, input().split()))\n\n\ndef bubblesort(l):\n for index in range(len(l) - 1, 0, -1):\n for low in range(index):\n if l[low] > l[low + 1]:\n tmp = l[low + 1]\n l[low + 1] = l[low]\n l[low] = tmp\n return l\n\n\nbubblesort(P)\nsum = 0\nfor i in range(K):\n sum = sum + P[i]\nprint(sum)\n","fast_code":"N, K = list(map(int, input().split()))\np = list(map(int, input().split()))\nprint((sum(sorted(p)[:K])))\n"} +{"fast_code_id":"7299728a192f6d4f1f3bc117c8cc117427a2ea2ae6dca3eec0750daa183876ac","fast_id":"p03136_7299728a192f6d4f1f3bc117c8cc117427a2ea2ae6dca3eec0750daa183876ac","language":"python","measured_fast_code_id":"7299728a192f6d4f1f3bc117c8cc117427a2ea2ae6dca3eec0750daa183876ac","measured_slow_code_id":"c1d13b37a289cb233c6849d4a958851f4c3b4f284375eaec46ef2e5a34eb2366","measurement_metric":"cpu_instruction_count","pair_id":"python_58431156ed088b2dc9e0f2be","problem_id":"p03136","slow_code_id":"c1d13b37a289cb233c6849d4a958851f4c3b4f284375eaec46ef2e5a34eb2366","slow_id":"p03136_c1d13b37a289cb233c6849d4a958851f4c3b4f284375eaec46ef2e5a34eb2366","speedup":1319.8860634778418,"stratum":"8+","sampling_key":"0d34e0758af584d3bebef9b9c9a689ffbd3925482f854c7134e02af6a78e8b24","slow_code":"import numpy as np\n\nN = int(eval(input()))\nL = np.array(list(map(int, input().split())))\nL[::-1].sort()\nif L[0] < L[1:].sum():\n print(\"Yes\")\nelse:\n print(\"No\")\n","fast_code":"n = int(eval(input()))\nli = list(map(int, input().split()))\nli.sort()\nif li[-1] * 2 >= sum(li):\n print(\"No\")\nelse:\n print(\"Yes\")\n"} +{"fast_code_id":"2598e9a98706383a1b39a15b40d55a3cbc3bffe11a259c1a8fe1b0d32337b553","fast_id":"p03693_f76975ea4092e311a9abe1acebb4c1b2854ecc6a6a5725b459e6d2a2499bc758","language":"python","measured_fast_code_id":"f76975ea4092e311a9abe1acebb4c1b2854ecc6a6a5725b459e6d2a2499bc758","measured_slow_code_id":"a8d7956b0cbea162ca1db60ee520eccf4efc73cdccbed5370688af05e67aaca2","measurement_metric":"cpu_instruction_count","pair_id":"python_5855ceba0b5c35c879e59171","problem_id":"p03693","slow_code_id":"a8d7956b0cbea162ca1db60ee520eccf4efc73cdccbed5370688af05e67aaca2","slow_id":"p03693_a8d7956b0cbea162ca1db60ee520eccf4efc73cdccbed5370688af05e67aaca2","speedup":304.23495535861787,"stratum":"8+","sampling_key":"47d1e65383a89672203d853152296100d5f02f19dd8f03a02127cb7bdb847527","slow_code":"import numpy as np\n\nr, g, b = list(map(int, input().split()))\nif (100 * r + 10 * g + b) % 4 == 0:\n print(\"YES\")\nelse:\n print(\"NO\")\n","fast_code":"from collections import defaultdict, deque\nfrom heapq import heappush, heappop\nimport sys\nimport math\nimport bisect\nimport random\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LS():\n return [list(x) for x in sys.stdin.readline().split()]\n\n\ndef S():\n return list(sys.stdin.readline())[:-1]\n\n\ndef IR(n):\n return [I() for i in range(n)]\n\n\ndef LIR(n):\n return [LI() for i in range(n)]\n\n\ndef SR(n):\n return [S() for i in range(n)]\n\n\ndef LSR(n):\n return [LS() for i in range(n)]\n\n\nsys.setrecursionlimit(1000000)\nmod = 1000000007\n\n\ndef solve():\n r, g, b = LI()\n ans = [\"YES\", \"NO\"]\n print((ans[((g << 1) + b) & 3 > 0]))\n return\n\n\nif __name__ == \"__main__\":\n solve()\n"} +{"fast_code_id":"f461e236e6015c443dce12864d380acf1352b871928b38a7cec7ad6fe70d8437","fast_id":"p03695_f461e236e6015c443dce12864d380acf1352b871928b38a7cec7ad6fe70d8437","language":"python","measured_fast_code_id":"f461e236e6015c443dce12864d380acf1352b871928b38a7cec7ad6fe70d8437","measured_slow_code_id":"7f271d923060c17e2c49a8d7f271bc0668cd1f8f85b998cc6651cd42c9e43961","measurement_metric":"cpu_instruction_count","pair_id":"python_5862d243261a5510f2d438e8","problem_id":"p03695","slow_code_id":"7f271d923060c17e2c49a8d7f271bc0668cd1f8f85b998cc6651cd42c9e43961","slow_id":"p03695_7f271d923060c17e2c49a8d7f271bc0668cd1f8f85b998cc6651cd42c9e43961","speedup":379.7415033171919,"stratum":"8+","sampling_key":"0bedb3f32474ba7be7eb7e933167f75c1a842525bf3b4d097166b0b554612c35","slow_code":"from bisect import bisect_left\nimport numpy as np\n\nn = int(input())\na = map(int, input().split())\nborder = np.arange(399, 3200, 400)\ncnt = [0] * (len(border) + 1)\nfor i in a:\n cnt[bisect_left(border, i)] += 1\nk = np.count_nonzero(cnt[:-1])\nprint(k, k + cnt[-1]) if k != 0 else print(1, cnt[-1])\n","fast_code":"n = int(input())\na = list(map(int, input().split()))\nc = [0] * 8\nmx = 0\nfor i in range(n):\n if 1 <= a[i] < 400:\n c[0] = 1\n elif 400 <= a[i] < 800:\n c[1] = 1\n elif 800 <= a[i] < 1200:\n c[2] = 1\n elif 1200 <= a[i] < 1600:\n c[3] = 1\n elif 1600 <= a[i] < 2000:\n c[4] = 1\n elif 2000 <= a[i] < 2400:\n c[5] = 1\n elif 2400 <= a[i] < 2800:\n c[6] = 1\n elif 2800 <= a[i] < 3200:\n c[7] = 1\n else:\n mx += 1\nprint(max(1, sum(c)), sum(c) + mx)\n"} +{"fast_code_id":"d18285c05de08731ba250af2afcd3a324cfda4a48a15f0191ae3f6fd94eddb4f","fast_id":"p02989_e8c114f6f462185d88e5d977f36e01cc5417d9f65f39cba2b1740a2fe466adcb","language":"python","measured_fast_code_id":"e8c114f6f462185d88e5d977f36e01cc5417d9f65f39cba2b1740a2fe466adcb","measured_slow_code_id":"bee7326f5d65117847c8daffc9f8e9e9508be71f70ad2064bdf47643f0632c7e","measurement_metric":"cpu_instruction_count","pair_id":"python_58c5ebea7c7d5f5fb04500f9","problem_id":"p02989","slow_code_id":"bee7326f5d65117847c8daffc9f8e9e9508be71f70ad2064bdf47643f0632c7e","slow_id":"p02989_bee7326f5d65117847c8daffc9f8e9e9508be71f70ad2064bdf47643f0632c7e","speedup":165.06721478353904,"stratum":"8+","sampling_key":"02192260985c18cfd475eabc433f4895ad2832b3c4e92e30ca5e3ac9a25a94b2","slow_code":"from bisect import bisect_left\n\nn = int(eval(input()))\nd = list(map(int, input().split()))\nd = sorted(d)\nans = 0\nfor i in range(1, 10**5 + 1):\n p = bisect_left(d, i)\n ans += 1 if p == (n - p) else 0\nprint(ans)\n","fast_code":"n = int(eval(input()))\n\ndi = []\nfor i in map(int, input().split()):\n di.append(i)\ndi.sort()\nn1 = int(n / 2)\nm = di[n1] - di[n1 - 1]\nprint(m)\n"} +{"fast_code_id":"ab815b85a4537e81e1348c2b4ba89888e4f3820924ed2588c7c1926e4e867484","fast_id":"p03566_ab815b85a4537e81e1348c2b4ba89888e4f3820924ed2588c7c1926e4e867484","language":"python","measured_fast_code_id":"ab815b85a4537e81e1348c2b4ba89888e4f3820924ed2588c7c1926e4e867484","measured_slow_code_id":"e292bb8e38a60f55175b6de37be1a88f4e5bd92a06a086d8bcc3fbb7a4e57ba7","measurement_metric":"cpu_instruction_count","pair_id":"python_5932ef6f8c5f666d3f88d986","problem_id":"p03566","slow_code_id":"33ceef3163e2732e94f8f8c1e32def7f26d8b82c4e0fd1b51892314740a603b1","slow_id":"p03566_e292bb8e38a60f55175b6de37be1a88f4e5bd92a06a086d8bcc3fbb7a4e57ba7","speedup":38.0629179796697,"stratum":"8+","sampling_key":"02342c33b5c3223a51d2c3de7849648cd8be26bbbddeb91c08f2a1501efc3c7a","slow_code":"N = int(eval(input()))\nt = list(map(int, input().split()))\nv = list(map(int, input().split()))\n\n\nN_INF = -(10**15)\nDP = [[N_INF] * (102) for _ in range(100 * 200 + 2)]\nDP[0][0] = 0\n\ntime = 1\nfor i in range(N):\n\n for j in range(time, time + t[i]):\n\n for k in range(0, v[i] + 1):\n if k == 0:\n\n DP[j][k] = max(DP[j - 1][0] + 0.25, DP[j - 1][1] + 1 / 2)\n elif k != v[i]:\n DP[j][k] = max(\n DP[j - 1][k - 1] + k - 1 / 2,\n DP[j - 1][k] + k + 0.25,\n DP[j - 1][k + 1] + k + 1 / 2,\n )\n else:\n DP[j][k] = max(DP[j - 1][k - 1] + k - 1 / 2, DP[j - 1][k] + k)\n\n time += t[i]\n\nprint((DP[time - 1][0]))\n","fast_code":"n, *L = list(map(int, open(0).read().split()))\nT, V = L[:n], L[n:]\ns = sum(T)\na = [0]\nfor t, v1, v2 in zip(T, V, V[1:] + [0]):\n a += [v1] * (2 * t - 1) + [min(v1, v2)]\nfor i in range(2 * s):\n a[i + 1] = min(a[i + 1], a[i] + 0.5)\nfor i in range(2 * s, 0, -1):\n a[i - 1] = min(a[i - 1], a[i] + 0.5)\nprint((sum(a) / 2))\n"} +{"fast_code_id":"b97bdcab53517dc8917d09f39912f401cd28969a8fb4fb761200b0bf70667016","fast_id":"p03330_b97bdcab53517dc8917d09f39912f401cd28969a8fb4fb761200b0bf70667016","language":"python","measured_fast_code_id":"b97bdcab53517dc8917d09f39912f401cd28969a8fb4fb761200b0bf70667016","measured_slow_code_id":"c02a11b7b5b1b315914b965fdf3ecfb4358b57b2c3925ddf481c4eb6e9760d11","measurement_metric":"cpu_instruction_count","pair_id":"python_597ab1b466834c4836ec3c74","problem_id":"p03330","slow_code_id":"b26d76a0f9b29fa38bb4e81f3bd1f83b96fba757a97a758a390f98fa3fc78913","slow_id":"p03330_c02a11b7b5b1b315914b965fdf3ecfb4358b57b2c3925ddf481c4eb6e9760d11","speedup":2.632594208523675,"stratum":"2-4","sampling_key":"2322ce3bcbcc3d9485b0c2ed8957146870511ff990b52fb1c4c9dfdb474317be","slow_code":"from collections import defaultdict\n\nN, C = list(map(int, input().split()))\nD = [tuple(map(int, input().split())) for _ in range(C)]\nd = [defaultdict(int) for i in range(3)]\nfor i in range(N):\n c = [int(x) for x in input().split()]\n for j in range(N):\n for k in range(C):\n d[(i + j) % 3][k] += D[c[j] - 1][k]\n\nans = 10**9\nfor i in range(C):\n for j in range(C):\n for k in range(C):\n if i != j and j != k and k != i:\n ans = min(ans, d[0][i] + d[1][j] + d[2][k])\nprint(ans)\n","fast_code":"from itertools import *\n\nN, C = list(map(int, input().split()))\nD = [list(map(int, input().split())) for _ in [0] * C]\ntri = [[0] * C for _ in [0] * 3]\nfor i in range(N):\n for j, x in enumerate(map(int, input().split())):\n tri[(i + j) % 3][x - 1] += 1\nres = 1 << 30\nfor p in permutations(list(range(C)), 3):\n tt = sum(D[l][p[m]] * tri[m][l] for l in range(C) for m in range(3))\n if tt < res:\n res = tt\nprint(res)\n"} +{"fast_code_id":"d5ba6f06a73df89d257acabb48d927c58a6f0a0239bbeeb139fcb8469201dfce","fast_id":"p03240_7086c6b25b6454d2c4f20fbd1ec72d8075d08f206bb2d06933fa14a96670b942","language":"python","measured_fast_code_id":"7086c6b25b6454d2c4f20fbd1ec72d8075d08f206bb2d06933fa14a96670b942","measured_slow_code_id":"7335b8f814fadff817ea3d797eb47069b6471e295b0639a1a649c1b8aea437e5","measurement_metric":"cpu_instruction_count","pair_id":"python_59e42a1fb76544eacb223650","problem_id":"p03240","slow_code_id":"2b73a8d0ed51a5904d37fa90f680662d0779f1a36233aa1fe89473f78eb7c3e5","slow_id":"p03240_7335b8f814fadff817ea3d797eb47069b6471e295b0639a1a649c1b8aea437e5","speedup":12.21575340186815,"stratum":"8+","sampling_key":"0660152435c91c624bb3fe87a03fe199ce8baef14e5d82012e6434e1d74de1e4","slow_code":"import numpy as np\n\nN = int(eval(input()))\nx, y, h = np.array([list(map(int, input().split())) for i in range(N)]).T\nH = 0\nCx = 0\nCy = 0\nFlag = True\nfor i in range(101):\n for j in range(101):\n Flag = True\n for k in range(N):\n if h[k] != 0:\n H = h[k] + abs(i - x[k]) + abs(j - y[k])\n break\n for k in range(N):\n if h[k] != max(H - abs(i - x[k]) - abs(j - y[k]), 0):\n Flag = False\n break\n if Flag:\n Cx, Cy = i, j\n break\n if Flag:\n break\nprint((\"{} {} {}\".format(Cx, Cy, H)))\n","fast_code":"N = int(eval(input()))\n\n\ndef city_dist(x1, y1, x2, y2):\n return abs(x1 - x2) + abs(y1 - y2)\n\n\ndef height(x1, y1, cx, cy, H):\n return max(H - city_dist(x1, y1, cx, cy), 0)\n\n\nx = []\ny = []\nh = []\nnon_zero_index = -1\nfor i in range(N):\n line = [int(a) for a in input().split()]\n x.append(line[0])\n y.append(line[1])\n h.append(line[2])\n if line[2] != 0:\n non_zero_index = i\nfor cx in range(101):\n for cy in range(101):\n H = h[non_zero_index] + city_dist(x[non_zero_index], y[non_zero_index], cx, cy)\n answer = True\n for i in range(N):\n\n if h[i] != height(x[i], y[i], cx, cy, H):\n answer = False\n break\n if answer:\n print((\"{} {} {}\".format(cx, cy, H)))\n break\n if answer:\n break\n"} +{"fast_code_id":"d0049f943120d7271ad75201bb4f4041f116278d93954adfad2543cf4bc98d1f","fast_id":"p03837_80ecd7a533e7aade9fd037ac5793cdc66dad62fccbad95fa17c7543f12205caa","language":"python","measured_fast_code_id":"80ecd7a533e7aade9fd037ac5793cdc66dad62fccbad95fa17c7543f12205caa","measured_slow_code_id":"4b8c4fbe2209051ec530f2f2b45afa5c5e7b9baa472bdff7f7c0b78d073fa97f","measurement_metric":"cpu_instruction_count","pair_id":"python_5a02f3ae9657ad355a76dafc","problem_id":"p03837","slow_code_id":"918d060f36498e9dd1876ace838239104c3304ee483f7156454f3905311e6b4c","slow_id":"p03837_4b8c4fbe2209051ec530f2f2b45afa5c5e7b9baa472bdff7f7c0b78d073fa97f","speedup":4.200073244733832,"stratum":"4-8","sampling_key":"21deaaf7a4491b11e1340a86b0b3de3614195e0e9e39aa7da3d3b4e4372fb795","slow_code":"import sys\n\n\ndef MI():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\nN, M = MI()\n\n\nclass WarshallFloyd:\n def __init__(self, N):\n self.N = N\n self.d = [[float(\"inf\")] * N for i in range(N)]\n\n def add(self, u, v, c, directed=False):\n if directed is False:\n self.d[u][v] = c\n self.d[v][u] = c\n else:\n self.d[u][v] = c\n\n def WarshallFloyd_search(self):\n for k in range(self.N):\n for i in range(self.N):\n for j in range(self.N):\n self.d[i][j] = min(self.d[i][j], self.d[i][k] + self.d[k][j])\n return self.d\n\n\nW = WarshallFloyd(N)\nedges = [0] * M\nfor i in range(M):\n a, b, c = MI()\n W.add(a - 1, b - 1, c, directed=False)\n edges[i] = (a - 1, b - 1, c)\nfor i in range(N):\n W.add(i, i, 0)\nW.WarshallFloyd_search()\nans = 0\nfor i in range(M):\n a = 0\n for j in range(N):\n if W.d[j][edges[i][1]] == W.d[j][edges[i][0]] + edges[i][2]:\n a = 1\n if a == 0:\n ans += 1\nprint(ans)\n","fast_code":"import heapq\n\nN, M = list(map(int, input().split()))\nes = [[] for _ in range(N)]\nfor i in range(M):\n a, b, c = list(map(int, input().split()))\n es[a - 1].append((c, b - 1))\n es[b - 1].append((c, a - 1))\nINF = float(\"inf\")\n\nd = [[INF for _ in range(N)] for _ in range(N)]\nfor i in range(N):\n q = []\n d[i][i] = 0\n heapq.heappush(q, (0, i))\n while q:\n cost, a = heapq.heappop(q)\n if d[i][a] < cost:\n continue\n for c, b in es[a]:\n if d[i][a] + c < d[i][b]:\n d[i][b] = d[i][a] + c\n heapq.heappush(q, (d[i][b], b))\n\n\ncnt = 0\nfor i in range(N):\n for c, b in es[i]:\n if d[i][b] != c:\n cnt += 1\n\nprint((cnt // 2))\n"} +{"fast_code_id":"cf0769b31f7033ebdc0e56276c7e0d91eba5a1cd549c2557455d0582b46f88b8","fast_id":"p03126_cf0769b31f7033ebdc0e56276c7e0d91eba5a1cd549c2557455d0582b46f88b8","language":"python","measured_fast_code_id":"cf0769b31f7033ebdc0e56276c7e0d91eba5a1cd549c2557455d0582b46f88b8","measured_slow_code_id":"cba8544a349f34548c0cfacd2e62b0d692bf5fdacfd135926ebf79dcf82a2da4","measurement_metric":"cpu_instruction_count","pair_id":"python_5a36a7244ecfb0e4dfd54f2d","problem_id":"p03126","slow_code_id":"0dc68db287c1c51e9e3ae700494383cca10de9412a38ef778d71183366a2ba69","slow_id":"p03126_cba8544a349f34548c0cfacd2e62b0d692bf5fdacfd135926ebf79dcf82a2da4","speedup":6.009663078915811,"stratum":"4-8","sampling_key":"59c1198b1434f10d7c68eb7dc6a77dc086042754dd36486d2058826f7bc3dee2","slow_code":"N, M = list(map(int, input().split()))\nlist = [list(map(int, input().split())) for x in range(N)]\n\nfor i in range(0, N):\n list[i].pop(0)\nstock = []\n\nfor i in range(0, N):\n for j in range(0, len(list[i])):\n cnt = 0\n for k in range(0, N):\n if list[i][j] in list[k]:\n cnt += 1\n if cnt == N:\n stock.append(list[i][j])\nif N == 1:\n stock = list[i]\nprint((len(set(stock))))\n","fast_code":"n, m = list(map(int, input().split()))\ns = set(range(1, m + 1))\nfor _ in range(n):\n k, *a = list(map(int, input().split()))\n s &= set(a)\nprint((len(s)))\n"} +{"fast_code_id":"3a1eb6709bd3bfa524235e0b0e435f3797e87659b9d563e2efee44635091cee0","fast_id":"p03714_3a1eb6709bd3bfa524235e0b0e435f3797e87659b9d563e2efee44635091cee0","language":"python","measured_fast_code_id":"3a1eb6709bd3bfa524235e0b0e435f3797e87659b9d563e2efee44635091cee0","measured_slow_code_id":"52c15ee8927c652bfeaea0aaff5e89fd111ae1ff40ca502171ab521098dbf51d","measurement_metric":"cpu_instruction_count","pair_id":"python_5a6e785282436b37a5c614d9","problem_id":"p03714","slow_code_id":"52c15ee8927c652bfeaea0aaff5e89fd111ae1ff40ca502171ab521098dbf51d","slow_id":"p03714_52c15ee8927c652bfeaea0aaff5e89fd111ae1ff40ca502171ab521098dbf51d","speedup":2.580694266096673,"stratum":"2-4","sampling_key":"171b2e8314f1e5b04fbdd9af54799d93a4c95a7728bcce2711692a15d0507dc4","slow_code":"import heapq\n\n\nclass Heapq:\n def __init__(self, arr, desc=False):\n if desc:\n arr = [-a for a in arr]\n self.sign = -1 if desc else 1\n self.hq = arr\n heapq.heapify(self.hq)\n\n def pop(self):\n return heapq.heappop(self.hq) * self.sign\n\n def push(self, a):\n heapq.heappush(self.hq, a * self.sign)\n\n def top(self):\n return self.hq[0] * self.sign\n\n\nn = int(eval(input()))\nA = list(map(int, input().split()))\nheap_l = Heapq(A[:n])\nheap_r = Heapq(A[2 * n :], desc=True)\nmax_l = [0] * (n + 1)\nmin_r = [0] * (n + 1)\nmax_l[0] = sum(A[:n])\nmin_r[0] = sum(A[2 * n :])\nfor i in range(n):\n p = heap_l.pop()\n heap_l.push(max(A[n + i], p))\n max_l[i + 1] = max_l[i] + max(0, A[n + i] - p)\n q = heap_r.pop()\n heap_r.push(min(A[-1 - i - n], q))\n min_r[i + 1] = min_r[i] + min(0, A[-1 - i - n] - q)\nans = -float(\"inf\")\nfor i in range(n + 1):\n ans = max(ans, max_l[i] - min_r[-1 - i])\nprint(ans)\n","fast_code":"from heapq import heapify, heappushpop\n\nN, *A = list(map(int, open(0).read().split()))\n\n\ndef f(L):\n q = L[:N]\n heapify(q)\n s = sum(q)\n yield s\n for e in L[N : 2 * N]:\n s += e - heappushpop(q, e)\n yield s\n\n\nprint((max(list(map(sum, list(zip(f(A), list(f([-a for a in A[::-1]]))[::-1])))))))\n"} +{"fast_code_id":"97e66cf257d6c2323391353a04a7aa5f8c742391877dcc51abf4bc8571960c25","fast_id":"p02700_97e66cf257d6c2323391353a04a7aa5f8c742391877dcc51abf4bc8571960c25","language":"python","measured_fast_code_id":"97e66cf257d6c2323391353a04a7aa5f8c742391877dcc51abf4bc8571960c25","measured_slow_code_id":"0800076b3be1d259d89fb0c2c371b4341f1c7fc8f7058a2f3f090ffddebf2dcb","measurement_metric":"cpu_instruction_count","pair_id":"python_5abe92a35e787dfcde4eb975","problem_id":"p02700","slow_code_id":"7feb6456d377ecdd9b0dcbfc30f9b0e6286836e7cba34a2d795c5cf979e98297","slow_id":"p02700_0800076b3be1d259d89fb0c2c371b4341f1c7fc8f7058a2f3f090ffddebf2dcb","speedup":4.222814264324301,"stratum":"4-8","sampling_key":"427b273a5c79e20e60df71aa9df116bbae8f92a67c2981b0361208fa28330b6a","slow_code":"from math import floor, ceil, sqrt, factorial, log\nfrom collections import Counter, deque\nfrom functools import reduce\n\n\ndef S():\n return eval(input())\n\n\ndef I():\n return int(eval(input()))\n\n\ndef MS():\n return list(map(str, input().split()))\n\n\ndef MI():\n return list(map(int, input().split()))\n\n\ndef FLI():\n return [int(i) for i in input().split()]\n\n\ndef LS():\n return list(MS())\n\n\ndef LI():\n return list(MI())\n\n\ndef LLS():\n return [list(map(str, l.split())) for l in eval(input())]\n\n\ndef LLI():\n return [list(map(int, l.split())) for l in eval(input())]\n\n\ndef LLSN(n: int):\n return [LS() for _ in range(n)]\n\n\ndef LLIN(n: int):\n return [LI() for _ in range(n)]\n\n\nA, B, C, D = MI()\nx = -(-A // D)\ny = -(-C // B)\nif x >= y:\n print(\"Yes\")\nelse:\n print(\"No\")\n","fast_code":"a, b, c, d = list(map(int, input().split()))\nattack_t = c // b\nif c % b != 0:\n attack_t += 1\nattack_a = a // d\nif a % d != 0:\n attack_a += 1\nif attack_a >= attack_t:\n print(\"Yes\")\nelse:\n print(\"No\")\n"} +{"fast_code_id":"92aca33b2d71b7102fdbc534c175eeae698c626cae626a7c08492217e2aeb790","fast_id":"p02595_92aca33b2d71b7102fdbc534c175eeae698c626cae626a7c08492217e2aeb790","language":"python","measured_fast_code_id":"92aca33b2d71b7102fdbc534c175eeae698c626cae626a7c08492217e2aeb790","measured_slow_code_id":"1559f276e022453eb8e8e92cd54d60648c4bba1cc009c4b0eef1eaf17b1ef72e","measurement_metric":"cpu_instruction_count","pair_id":"python_5af0cd31334d1bb24233511b","problem_id":"p02595","slow_code_id":"1559f276e022453eb8e8e92cd54d60648c4bba1cc009c4b0eef1eaf17b1ef72e","slow_id":"p02595_1559f276e022453eb8e8e92cd54d60648c4bba1cc009c4b0eef1eaf17b1ef72e","speedup":5.037991873839146,"stratum":"4-8","sampling_key":"59df97136da24d04e4488d813b58813bd3bc9694e5d6bc04eca4682a1cfa18fe","slow_code":"from decimal import *\n\ngetcontext().prec = 50\nN, D = list(map(int, input().split()))\n\n\ndef distance(x1, x2, y1, y2):\n dx = x2 - x1\n dy = y2 - y1\n return (dx * dx + dy * dy).sqrt()\n\n\nX = [0] * N\nY = [0] * N\nfor i in range(N):\n X[i], Y[i] = list(map(Decimal, input().split()))\nans = 0\nfor i in range(N):\n if distance(0, X[i], 0, Y[i]) <= D:\n ans += 1\nprint(ans)\n","fast_code":"n, d = list(map(int, input().split()))\nd *= d\ncnt = 0\nfor i in range(n):\n x, y = list(map(int, input().split()))\n if x * x + y * y <= d:\n cnt += 1\nprint(cnt)\n"} +{"fast_code_id":"886a5f595443355c9a559776b553cf8c6e9da6b128a956f856a516a3ff43e7bc","fast_id":"p03212_159869fce363be0beb07e099fdf5f195612cee8870325e72b5e5fb91c1c05182","language":"python","measured_fast_code_id":"159869fce363be0beb07e099fdf5f195612cee8870325e72b5e5fb91c1c05182","measured_slow_code_id":"9b823eea975a23a20587bc34ffa695ba9d6a5f099d4923f94ee756f58c3ecb65","measurement_metric":"cpu_instruction_count","pair_id":"python_5b37396aca03b1a020f6315a","problem_id":"p03212","slow_code_id":"9b823eea975a23a20587bc34ffa695ba9d6a5f099d4923f94ee756f58c3ecb65","slow_id":"p03212_9b823eea975a23a20587bc34ffa695ba9d6a5f099d4923f94ee756f58c3ecb65","speedup":7.570958939310902,"stratum":"4-8","sampling_key":"0ab4bb86fb63010899f8579a7ee3dddf1b79ab068096b7f22c29c6cff8c15b9d","slow_code":"import copy\n\nword = \"753\"\n\n\ndef dfs(n):\n ret = 0\n num = 0 if not n else int(\"\".join(n))\n if N < num:\n return ret\n ret += 1 if len(set(\"\".join(n)) & set(word)) == len(word) else 0\n for c in word:\n tmp = copy.deepcopy(n)\n n.append(c)\n ret += dfs(n)\n n = tmp\n return ret\n\n\nN = int(eval(input()))\nprint((dfs([])))\n","fast_code":"from itertools import *\n\nn = int(eval(input()))\nc = 0\nk = \"357\"\nfor i in range(3, -~len(str(n))):\n for j in product(k, repeat=i):\n if all(j.count(h) for h in k):\n if int(\"\".join(j)) <= n:\n c += 1\nprint(c)\n"} +{"fast_code_id":"5adea7f44426da2d5422223ea2db6da159807860edd9cbf9d4b38f456b3990d7","fast_id":"p02709_cb18f4ae978f2b3977ac57bb4b838eeb9c02a64e588cf9f5a467edcecea0f868","language":"python","measured_fast_code_id":"cb18f4ae978f2b3977ac57bb4b838eeb9c02a64e588cf9f5a467edcecea0f868","measured_slow_code_id":"3d838e07742b6038959605af2d3df1f36b7399126fc563b9a2c8f3bce236aaea","measurement_metric":"cpu_instruction_count","pair_id":"python_5bae71f4ed26e491ebf498e2","problem_id":"p02709","slow_code_id":"aa98af4784f39634c1b1369b22ff40f05d4ea9461af1aad5cd1db169f1d8c6f4","slow_id":"p02709_3d838e07742b6038959605af2d3df1f36b7399126fc563b9a2c8f3bce236aaea","speedup":10.28839311876437,"stratum":"8+","sampling_key":"0c1c77ee90496b330dbf42f78402d93b79a8dd7b2257709b789210307ce877ef","slow_code":"import sys\nimport numpy as np\n\n\ndef f(n, a_):\n a = []\n for i, ai in enumerate(a_):\n a.append([1 + i, ai])\n a.sort(key=lambda x: x[1], reverse=True)\n dp = np.zeros((n + 1, n + 1), np.int64)\n dp[1, 1] = a[0][1] * (n - a[0][0])\n dp[1, 0] = a[0][1] * (a[0][0] - 1)\n for i in range(2, n + 1):\n dp[i, 0] = dp[i - 1, 0] + a[i - 1][1] * abs((a[i - 1][0] - 1 - (i - 1)))\n dp[i, i] = dp[i - 1, i - 1] + a[i - 1][1] * abs((n - a[i - 1][0] - (i - 1)))\n\n l = dp[i - 1, 1:i] + [\n a[i - 1][1] * abs((a[i - 1][0] - 1 - j)) for j in range(i - 2, -1, -1)\n ]\n\n r = dp[i - 1, : i - 1] + [\n a[i - 1][1] * abs((n - a[i - 1][0] - j)) for j in range(i - 1)\n ]\n dp[i, 1:i] = np.maximum(l, r)\n return max(dp[n])\n\n\nif __name__ == \"__main__\":\n input = sys.stdin.readline\n n = int(eval(input()))\n a_ = list(map(int, input().split()))\n print((f(n, a_)))\n","fast_code":"n = int(eval(input()))\na = list(map(int, input().split()))\nassert len(a) == n\n\np = list(range(n))\np.sort(key=lambda i: a[i])\n\ndp = [0] * (n + 1)\nfor i in range(n):\n for j in range(n - i):\n dp[j] = max(\n dp[j] + a[p[i]] * abs(p[i] - (j + i)), dp[j + 1] + a[p[i]] * abs(p[i] - j)\n )\nprint((dp[0]))\n"} +{"fast_code_id":"bab9323cfeaa66336157fcfc351fa47a4d07aa183900fa44056dd2eea3a678e6","fast_id":"p03806_bab9323cfeaa66336157fcfc351fa47a4d07aa183900fa44056dd2eea3a678e6","language":"python","measured_fast_code_id":"bab9323cfeaa66336157fcfc351fa47a4d07aa183900fa44056dd2eea3a678e6","measured_slow_code_id":"c05e31074808ad99de1edaa0cb451b5dae5bdb1dd544dea72248cb63ed956dad","measurement_metric":"cpu_instruction_count","pair_id":"python_5c0c6bdef0f22080bfc592eb","problem_id":"p03806","slow_code_id":"2e0411c6ced0edd7bd02dfae1556bd37b6ffc5230ba35b44b2155165ac5103d0","slow_id":"p03806_c05e31074808ad99de1edaa0cb451b5dae5bdb1dd544dea72248cb63ed956dad","speedup":7.315066613011207,"stratum":"4-8","sampling_key":"90d7592c43fe2f66d7853383dfa6321f788a49e6a8cecafb6499834a7033751b","slow_code":"N, Ma, Mb = list(map(int, input().split()))\n\narr = [list(map(int, input().split())) for _ in range(N)]\n\n\nINF = 5000\n\n\ndp = [[[INF] * (10 * N + 1) for _ in range(10 * N + 1)] for _ in range(N + 1)]\n\ndp[0][0][0] = 0\nfor i in range(N):\n a, b, c = arr[i]\n for j in range(10 * N + 1):\n for k in range(10 * N + 1):\n if dp[i][j][k] == INF:\n continue\n\n dp[i + 1][j][k] = min(dp[i + 1][j][k], dp[i][j][k])\n\n dp[i + 1][j + a][k + b] = min(dp[i + 1][j + a][k + b], dp[i][j][k] + c)\nans = INF\n\n\nfor i in range(1, 10 * N + 1):\n if i * Ma > 10 * N or i * Mb > 10 * N:\n break\n ans = min(ans, dp[N][i * Ma][i * Mb])\nif ans == INF:\n print((-1))\nelse:\n print(ans)\n","fast_code":"import sys\n\ninput = lambda: sys.stdin.readline().rstrip()\nsys.setrecursionlimit(max(1000, 10**9))\nwrite = lambda x: sys.stdout.write(x + \"\\n\")\nn, ma, mb = list(map(int, input().split()))\nabc = [None] * n\nfor i in range(n):\n a, b, c = tuple(map(int, input().split()))\n abc[i] = (a * mb - b * ma, c)\nabc.sort()\n\n\ndef halfcomb(l):\n n = len(l)\n n1 = n // 2\n n2 = (n + 1) // 2\n l1 = []\n l2 = []\n\n def sub(v1, v2, i, bound, ll, ind=0):\n if i == bound:\n ll.append((v1, v2))\n return\n sub(v1, v2, i + 1, bound, ll, ind)\n sub(v1 + l[ind + i][0], v2 + l[ind + i][1], i + 1, bound, ll, ind)\n\n sub(0, 0, 0, n1, l1)\n sub(0, 0, 0, n2, l2, ind=n1)\n return l1, l2\n\n\nl1, l2 = halfcomb(abc)\nd2 = {}\nfor v, c in l2:\n if v in d2:\n d2[v] = min(d2[v], c)\n else:\n d2[v] = c\nans = float(\"inf\")\nfor v, c in l1:\n if v == 0 and c > 0:\n ans = min(ans, c)\nfor v, c in l2:\n if v == 0 and c > 0:\n ans = min(ans, c)\nfor v, c in l1:\n if -v in d2 and c + d2[-v] > 0:\n ans = min(ans, c + d2[-v])\nif ans == float(\"inf\"):\n ans = -1\nprint(ans)\n"} +{"fast_code_id":"100336bdfaef2dedb25c007c17d46aee00dbf34943d4cd162fcc6a414ce4f521","fast_id":"p03816_100336bdfaef2dedb25c007c17d46aee00dbf34943d4cd162fcc6a414ce4f521","language":"python","measured_fast_code_id":"100336bdfaef2dedb25c007c17d46aee00dbf34943d4cd162fcc6a414ce4f521","measured_slow_code_id":"c49f88174b2a58efaf437be14c3ac6cbce5c3e042e3010102654126142b32de0","measurement_metric":"cpu_instruction_count","pair_id":"python_5c23893a8fe8ac9f0f81e84a","problem_id":"p03816","slow_code_id":"c49f88174b2a58efaf437be14c3ac6cbce5c3e042e3010102654126142b32de0","slow_id":"p03816_c49f88174b2a58efaf437be14c3ac6cbce5c3e042e3010102654126142b32de0","speedup":4.115486904175369,"stratum":"4-8","sampling_key":"40a53857ea3856f14ead540da18e98185028fdf17dc11120f2da3b0755d93d2d","slow_code":"import sys\n\nreadline = sys.stdin.readline\nfrom collections import Counter\n\n\ndef main():\n N = int(readline())\n A = list(map(int, readline().rstrip().split()))\n c = Counter(A)\n for key, val in list(c.items()):\n if val > 2:\n if val % 2 == 0:\n c[key] = 2\n else:\n c[key] = 1\n if len([val for key, val in list(c.items()) if c[key] == 2]) % 2 == 0:\n print((len(c)))\n else:\n print((len(c) - 1))\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"_, a = open(0)\nk = len(set(a.split()))\nprint((k - (k % 2 < 1)))\n"} +{"fast_code_id":"fb01a453f733b4c61a732f09cd3eaf884d4ec1ebb557cde596e8c204dc60ca60","fast_id":"p00501_fb01a453f733b4c61a732f09cd3eaf884d4ec1ebb557cde596e8c204dc60ca60","language":"python","measured_fast_code_id":"fb01a453f733b4c61a732f09cd3eaf884d4ec1ebb557cde596e8c204dc60ca60","measured_slow_code_id":"546a560793c50315e95acadb50b40a703bd1c32e68166b92642bbf7d20a35b94","measurement_metric":"cpu_instruction_count","pair_id":"python_5c2d27494534841c4d737f9d","problem_id":"p00501","slow_code_id":"546a560793c50315e95acadb50b40a703bd1c32e68166b92642bbf7d20a35b94","slow_id":"p00501_546a560793c50315e95acadb50b40a703bd1c32e68166b92642bbf7d20a35b94","speedup":13.896518282553199,"stratum":"8+","sampling_key":"0eee81d5c3a7c0e7d3d4c9c2226f6a5b87c68daf85b9284f54b692a36d15859a","slow_code":"n = eval(input())\ns = input()\ncnt = 0\nfor i in range(n):\n judge = False\n p = input()\n for k in range(len(p)):\n if judge:\n break\n for j in range(1, len(p)):\n if judge:\n break\n for l in range(len(s)):\n if k + l * j < len(p) and p[k + l * j] == s[l]:\n if l + 1 >= len(s):\n judge = True\n continue\n break\n if judge == True:\n cnt += 1\nprint(cnt)\n","fast_code":"n = eval(input())\na = input()\ncount = 0\nfor r in range(n):\n b = input()\n lb = len(b)\n flag = 0\n for s in range(lb):\n for i in range(lb - (s + 1) * (len(a) - 1)):\n if b[i : i + (s + 1) * len(a) : s + 1] == a:\n count += 1\n flag = 1\n break\n if flag == 1:\n break\nprint(count)\n"} +{"fast_code_id":"1dc21d281e68efeab490e81c2e10af8dd9590cc1b2e00a406cdbf031e728d09a","fast_id":"p02831_1dc21d281e68efeab490e81c2e10af8dd9590cc1b2e00a406cdbf031e728d09a","language":"python","measured_fast_code_id":"1dc21d281e68efeab490e81c2e10af8dd9590cc1b2e00a406cdbf031e728d09a","measured_slow_code_id":"3de3fe8bb1afacef9e4d94cddd67b61d71115eb2182c7ba15fc5dcbd918bfe9c","measurement_metric":"cpu_instruction_count","pair_id":"python_5d122b50c023b1bbfcb328cd","problem_id":"p02831","slow_code_id":"3de3fe8bb1afacef9e4d94cddd67b61d71115eb2182c7ba15fc5dcbd918bfe9c","slow_id":"p02831_3de3fe8bb1afacef9e4d94cddd67b61d71115eb2182c7ba15fc5dcbd918bfe9c","speedup":93.09236641269594,"stratum":"8+","sampling_key":"059358f5ced8765adb6706925f0762d51a9aeb717a311acf442408ef9b40a91f","slow_code":"a, b = list(map(int, input().split()))\ngcd = 0\nfor i in range(max(a, b), 0, -1):\n if a % i == 0 and b % i == 0:\n gcd = i\n break\nprint((a * b // gcd))\n","fast_code":"import math\n\n\ndef lcm(x, y):\n return (x * y) // math.gcd(x, y)\n\n\na, b = list(map(int, input().split()))\nprint((lcm(a, b)))\n"} +{"fast_code_id":"02952b5343791f7e9cbf755ebc67676afbd1a59fb0391b64459cf3edf5653a17","fast_id":"p03472_02952b5343791f7e9cbf755ebc67676afbd1a59fb0391b64459cf3edf5653a17","language":"python","measured_fast_code_id":"02952b5343791f7e9cbf755ebc67676afbd1a59fb0391b64459cf3edf5653a17","measured_slow_code_id":"e6fb53d428c218a9dad43f71415fff4137faea0247973c73ffa368e3f80a96bc","measurement_metric":"cpu_instruction_count","pair_id":"python_5dcad7df78624eca0fd25784","problem_id":"p03472","slow_code_id":"959a20db4ae0f00d8957b9a1432326d6e5fea394771c477e31dea94e932699eb","slow_id":"p03472_e6fb53d428c218a9dad43f71415fff4137faea0247973c73ffa368e3f80a96bc","speedup":5.691445788504642,"stratum":"4-8","sampling_key":"7d2bcf0b3546a465382fca5a49a74655392f987819e57026ce76231e1ced372c","slow_code":"import sys\nfrom collections import defaultdict, Counter\nfrom itertools import product, groupby, count, permutations, combinations\nfrom math import pi, sqrt, floor\nfrom collections import deque\nfrom bisect import bisect, bisect_left, bisect_right\nfrom string import ascii_lowercase\nfrom functools import lru_cache, reduce\nfrom operator import xor\nfrom heapq import heappush, heappop\n\nINF = float(\"inf\")\nsys.setrecursionlimit(10**7)\n\ndy4, dx4 = [0, -1, 0, 1], [1, 0, -1, 0]\n\n\ndef inside(y: int, x: int, H: int, W: int) -> bool:\n return 0 <= y < H and 0 <= x < W\n\n\ndef ceil(a, b):\n return (a + b - 1) // b\n\n\ndef solve(N, H, a_b):\n max_a = -1\n for a, b in a_b:\n max_a = max(max_a, a)\n good_b = []\n for a, b in a_b:\n if b >= max_a:\n good_b.append(b)\n ans = 0\n for b in sorted(good_b, reverse=True):\n ans += 1\n H -= b\n if H <= 0:\n return ans\n return ans + ceil(H, max_a)\n\n\ndef main():\n N, H = list(map(int, input().split()))\n l = []\n for _ in range(N):\n a, b = list(map(int, input().split()))\n l.append((a, b))\n print((solve(N, H, l)))\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"n, h, *t = list(map(int, open(0).read().split()))\nb = sorted(t[1::2])\na = max(t[::2])\nc = 0\nwhile h > 0 and b and b[-1] > a:\n h -= b.pop()\n c += 1\nif h > 0:\n c -= -h // a\nprint(c)\n"} +{"fast_code_id":"bdb6e5fdc72ade6300e28d6abcf22e8aa9147491ce09421a7ba5683f97311575","fast_id":"p02630_bdb6e5fdc72ade6300e28d6abcf22e8aa9147491ce09421a7ba5683f97311575","language":"python","measured_fast_code_id":"bdb6e5fdc72ade6300e28d6abcf22e8aa9147491ce09421a7ba5683f97311575","measured_slow_code_id":"c0c92be78298924f693e00b5a206080ad2444c946ea53f1a3ffdfc6b6a35e213","measurement_metric":"cpu_instruction_count","pair_id":"python_5e09aa98a599dc30fccdb814","problem_id":"p02630","slow_code_id":"c0c92be78298924f693e00b5a206080ad2444c946ea53f1a3ffdfc6b6a35e213","slow_id":"p02630_c0c92be78298924f693e00b5a206080ad2444c946ea53f1a3ffdfc6b6a35e213","speedup":4.714285088650679,"stratum":"4-8","sampling_key":"4e65df1041f34452001df402c2bcbec6738e36bdb617c2b0a111d112382920a5","slow_code":"v = [0 for i in range(100001)]\nn = int(eval(input()))\nar = list(map(int, input().split()))\ns = 0\nfor i in ar:\n s += i\n v[i] += 1\nq = int(eval(input()))\nfor i in range(q):\n a, b = list(map(int, input().split()))\n s -= a * v[a]\n s += b * v[a]\n v[b] += v[a]\n v[a] = 0\n print(s)\n","fast_code":"from collections import *\n\neval(input())\ns = sum(A := list(map(int, input().split())))\nA = Counter(A)\nfor i in range(int(eval(input()))):\n b, c = list(map(int, input().split()))\n s += (c - b) * A[b]\n A[c] += A[b]\n A[b] = 0\n print(s)\n"} +{"fast_code_id":"79ba1f6460345ea02653f0a79993615ab3c1f26419ad99ddd40e82506c2902de","fast_id":"p02700_79ba1f6460345ea02653f0a79993615ab3c1f26419ad99ddd40e82506c2902de","language":"python","measured_fast_code_id":"79ba1f6460345ea02653f0a79993615ab3c1f26419ad99ddd40e82506c2902de","measured_slow_code_id":"0800076b3be1d259d89fb0c2c371b4341f1c7fc8f7058a2f3f090ffddebf2dcb","measurement_metric":"cpu_instruction_count","pair_id":"python_5e19696354b9c8ae490a9be2","problem_id":"p02700","slow_code_id":"7feb6456d377ecdd9b0dcbfc30f9b0e6286836e7cba34a2d795c5cf979e98297","slow_id":"p02700_0800076b3be1d259d89fb0c2c371b4341f1c7fc8f7058a2f3f090ffddebf2dcb","speedup":4.34240393605635,"stratum":"4-8","sampling_key":"b2ac8cd206e023b64411ce958c6fc009edf86ea536a650252af4155eeb36ad32","slow_code":"from math import floor, ceil, sqrt, factorial, log\nfrom collections import Counter, deque\nfrom functools import reduce\n\n\ndef S():\n return eval(input())\n\n\ndef I():\n return int(eval(input()))\n\n\ndef MS():\n return list(map(str, input().split()))\n\n\ndef MI():\n return list(map(int, input().split()))\n\n\ndef FLI():\n return [int(i) for i in input().split()]\n\n\ndef LS():\n return list(MS())\n\n\ndef LI():\n return list(MI())\n\n\ndef LLS():\n return [list(map(str, l.split())) for l in eval(input())]\n\n\ndef LLI():\n return [list(map(int, l.split())) for l in eval(input())]\n\n\ndef LLSN(n: int):\n return [LS() for _ in range(n)]\n\n\ndef LLIN(n: int):\n return [LI() for _ in range(n)]\n\n\nA, B, C, D = MI()\nx = -(-A // D)\ny = -(-C // B)\nif x >= y:\n print(\"Yes\")\nelse:\n print(\"No\")\n","fast_code":"A, B, C, D = list(map(int, input().split()))\nT_time = C // B if C % B == 0 else C // B + 1\nA_time = A // D if A % D == 0 else A // D + 1\nif T_time <= A_time:\n print(\"Yes\")\nelse:\n print(\"No\")\n"} +{"fast_code_id":"b1d4ca44d471cc0663c3729a8a82c7bacf4191740b09cce08fe8c313887dc71c","fast_id":"p03160_e2eeece981d6ed2a05961cbe8cb29c863773b6e30257c7bb82d36e26974465a8","language":"python","measured_fast_code_id":"e2eeece981d6ed2a05961cbe8cb29c863773b6e30257c7bb82d36e26974465a8","measured_slow_code_id":"7f209d5d7b0d2bc72ab55ef9c34db57933ddfc0a346f408e2afc1f88416cf97f","measurement_metric":"cpu_instruction_count","pair_id":"python_5e228e18408ff23f96a881c8","problem_id":"p03160","slow_code_id":"54f397f881a6ae2f88872fe4373ebc15e4056c4fdf6ac63236a75aa3443cd3c5","slow_id":"p03160_7f209d5d7b0d2bc72ab55ef9c34db57933ddfc0a346f408e2afc1f88416cf97f","speedup":5.3026988446628165,"stratum":"4-8","sampling_key":"b5ca353b12e5785a092ef3f35e433978c461aadff7272baaaaa7c18383588ea5","slow_code":"import string\nimport sys\nfrom itertools import chain, dropwhile, takewhile\n\n\ndef read(\n f, *shape, it=chain.from_iterable(sys.stdin), whitespaces=set(string.whitespace)\n):\n def read_word():\n w = lambda c: c in whitespaces\n nw = lambda c: c not in whitespaces\n return f(\"\".join(takewhile(nw, dropwhile(w, it))))\n\n if not shape:\n return read_word()\n elif len(shape) == 1:\n return [read_word() for _ in range(shape[0])]\n elif len(shape) == 2:\n return [[read_word() for _ in range(shape[1])] for _ in range(shape[0])]\n\n\ndef arr(*shape, fill_value=0):\n if len(shape) == 1:\n return [fill_value] * shape[fill_value]\n elif len(shape) == 2:\n return [[fill_value] * shape[1] for _ in range(shape[0])]\n\n\ndef dbg(**kwargs):\n print(\n \", \".join(\"{} = {}\".format(k, repr(v)) for k, v in kwargs.items()),\n file=sys.stderr,\n )\n\n\ndef main():\n n = read(int)\n hs = read(int, n)\n dp = arr(n)\n dp[1] = abs(hs[1] - hs[0])\n for i in range(2, n):\n dp[i] = min(\n dp[i - 1] + abs(hs[i] - hs[i - 1]), dp[i - 2] + abs(hs[i] - hs[i - 2])\n )\n print(dp[-1])\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"def main():\n n = int(eval(input()))\n A = tuple(map(int, input().split()))\n x, y = 0, abs(A[1] - A[0])\n for i in range(2, n):\n dif1 = x + abs(A[i] - A[i - 2])\n dif2 = y + abs(A[i] - A[i - 1])\n x = y\n y = dif1 if dif1 <= dif2 else dif2\n print(y)\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"6109348b68c46cc54f130156e464a37472ee23a29b7f7afb3e1446cfb2cf115d","fast_id":"p02724_6109348b68c46cc54f130156e464a37472ee23a29b7f7afb3e1446cfb2cf115d","language":"python","measured_fast_code_id":"6109348b68c46cc54f130156e464a37472ee23a29b7f7afb3e1446cfb2cf115d","measured_slow_code_id":"07c5a845a98dce83f42c711c0408dc4dad947c9351918518d0af13bec53b52eb","measurement_metric":"cpu_instruction_count","pair_id":"python_5e83cafb4c95ebd8de24fcc8","problem_id":"p02724","slow_code_id":"07c5a845a98dce83f42c711c0408dc4dad947c9351918518d0af13bec53b52eb","slow_id":"p02724_07c5a845a98dce83f42c711c0408dc4dad947c9351918518d0af13bec53b52eb","speedup":734.0149023074251,"stratum":"8+","sampling_key":"6714d0f60846724604d361e635adee2e77e7b7b6c13a243a4ce9e0042e35d7cc","slow_code":"def main():\n x = int(eval(input()))\n ans = 0\n while x >= 500:\n x -= 500\n ans += 1000\n while x >= 5:\n x -= 5\n ans += 5\n print(ans)\n\n\nmain()\n","fast_code":"from collections import deque\n\ns = int(eval(input()))\nbig = int(s / 500)\ns = s - big * 500\nprint((big * 1000 + int(s / 5) * 5))\n"} +{"fast_code_id":"5ab51d5928ed77e3d5403215430fd9b470d350dbc6470a626b3ee86273e49a45","fast_id":"p02804_5ab51d5928ed77e3d5403215430fd9b470d350dbc6470a626b3ee86273e49a45","language":"python","measured_fast_code_id":"5ab51d5928ed77e3d5403215430fd9b470d350dbc6470a626b3ee86273e49a45","measured_slow_code_id":"7a118ce2764a5719ed366c9c22ffc653766a914f4a46e16d4f0cdc6623af51e1","measurement_metric":"cpu_instruction_count","pair_id":"python_5eadafafb9527b5bc2af65d7","problem_id":"p02804","slow_code_id":"7a118ce2764a5719ed366c9c22ffc653766a914f4a46e16d4f0cdc6623af51e1","slow_id":"p02804_7a118ce2764a5719ed366c9c22ffc653766a914f4a46e16d4f0cdc6623af51e1","speedup":540.0319374222177,"stratum":"8+","sampling_key":"0510ad0c497e873cc4f839c7c1d0fcbb29d6a9f9653b9769c55477f2da9beede","slow_code":"N_MAX = 10**6\nMOD = 10**9 + 7\nfac, finv, inv = [0] * N_MAX, [0] * N_MAX, [0] * N_MAX\n\n\ndef com_init():\n fac[0], fac[1] = 1, 1\n finv[0], finv[1] = 1, 1\n inv[1] = 1\n for i in range(2, N_MAX):\n fac[i] = fac[i - 1] * i % MOD\n inv[i] = MOD - inv[MOD % i] * (MOD // i) % MOD\n finv[i] = finv[i - 1] * inv[i] % MOD\n\n\ndef com(n, k):\n if n < k:\n return 0\n if n < 0 or k < 0:\n return 0\n return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD\n\n\nn, k = list(map(int, input().split()))\nal = list(map(int, input().split()))\ncom_init()\nal.sort()\nans_max = 0\nans_min = 0\nfor i, a in enumerate(al):\n ans_max += a * com(i, k - 1)\n ans_max %= MOD\n ans_min += a * com(n - 1 - i, k - 1)\n ans_min %= MOD\nprint(((ans_max - ans_min) % MOD))\n","fast_code":"N, K = list(map(int, input().split()))\nA = list(map(int, input().split()))\nMOD = 10**9 + 7\ninv_t = [0, 1] + [0] * (N - 1)\nfor i in range(2, N + 1):\n inv_t[i] = inv_t[MOD % i] * (MOD - MOD // i) % MOD\nA.sort()\nans = 0\nC = 1\nfor i in range(K, N + 1):\n ans += (A[i - 1] - A[N - i]) * C\n ans %= MOD\n C = C * i * inv_t[i - K + 1]\n C %= MOD\nprint(ans)\n"} +{"fast_code_id":"19a036b3c40e7de8df4659f8dbc703a5a670dbc9cc2d70bef057f513e55523e4","fast_id":"p02725_19a036b3c40e7de8df4659f8dbc703a5a670dbc9cc2d70bef057f513e55523e4","language":"python","measured_fast_code_id":"19a036b3c40e7de8df4659f8dbc703a5a670dbc9cc2d70bef057f513e55523e4","measured_slow_code_id":"9164aae6c8839a29a40c85ad8ba3bfc05c8440fc08a285145380122a94d7f972","measurement_metric":"cpu_instruction_count","pair_id":"python_5f2993f8c92fc65e881e64fe","problem_id":"p02725","slow_code_id":"9164aae6c8839a29a40c85ad8ba3bfc05c8440fc08a285145380122a94d7f972","slow_id":"p02725_9164aae6c8839a29a40c85ad8ba3bfc05c8440fc08a285145380122a94d7f972","speedup":3.467481815354475,"stratum":"2-4","sampling_key":"db0a6e380e65c4f358938c5880940c6b565b1b4eb56a402de0adf7e7ac460571","slow_code":"from sys import stdin\n\ninp = stdin.readline\nn, k = [int(x) for x in inp().strip().split()]\narray = [int(x) for x in inp().strip().split()]\ndistance = [0] * (k * 2)\nfor i in range(k - 1):\n distance[i] = array[i + 1] - array[i]\ndistance[k - 1] = n - array[k - 1] + array[0]\ndistance[2 * k - 1] = n - array[k - 1] + array[0]\nfor i in range(k - 1):\n distance[k + i] = array[i + 1] - array[i]\nminimum = 999999999\ncount = 0\ntotal = 0\ncountLimit = k - 1\nfor i in range(k * 2):\n if count < countLimit:\n total += distance[i]\n count += 1\n else:\n if minimum > total:\n minimum = total\n total += distance[i]\n total -= distance[i - countLimit]\nprint(minimum)\n","fast_code":"from itertools import *\n\nK, N = list(map(int, input().split()))\nA, B = tee(list(map(int, input().split())), 2)\nfirst = next(B)\nM = max(b - a for a, b in zip_longest(A, B, fillvalue=first + K))\nprint((K - M))\n"} +{"fast_code_id":"04988e9d8436cd8d1d33eb8fa46881b8ece01ad4252108eea2e8777b98c63472","fast_id":"p02760_04988e9d8436cd8d1d33eb8fa46881b8ece01ad4252108eea2e8777b98c63472","language":"python","measured_fast_code_id":"04988e9d8436cd8d1d33eb8fa46881b8ece01ad4252108eea2e8777b98c63472","measured_slow_code_id":"3154046e3b0b642e21542a63081b5e907301002ff4b0c284741cdd49a042b9c6","measurement_metric":"cpu_instruction_count","pair_id":"python_5f96c30518b7f1f7a912a2c8","problem_id":"p02760","slow_code_id":"3154046e3b0b642e21542a63081b5e907301002ff4b0c284741cdd49a042b9c6","slow_id":"p02760_3154046e3b0b642e21542a63081b5e907301002ff4b0c284741cdd49a042b9c6","speedup":2.426049986918101,"stratum":"2-4","sampling_key":"f58b4a5817fd00a85de98fca20411f0545f259dc722284e303e64a575d95515e","slow_code":"f = lambda a: any(all(b) for b in a) | all(a[i][i] for i in (0, 1, 2))\na = eval(\"list(map(int,input().split())),\" * 3)\nexec(\"b=int(input());a=[[u*(u!=b)for u in t]for t in a];\" * int(eval(input())))\na = [[not u for u in t] for t in a]\nprint((\"NYoe s\"[f(a) | f([t[::-1] for t in zip(*a)]) :: 2]))\n","fast_code":"(*A,) = list(map(int, open(0).read().split()))\nN = A[9]\nB = A[10:]\nA = A[:9]\nT = [False] * 9\nfor b in B:\n if b in A:\n T[A.index(b)] = True\nbingo = [\n (0, 1, 2),\n (3, 4, 5),\n (6, 7, 8),\n (0, 3, 6),\n (1, 4, 7),\n (2, 5, 8),\n (0, 4, 8),\n (2, 4, 6),\n]\nfor a, b, c in bingo:\n if T[a] and T[b] and T[c]:\n print(\"Yes\")\n break\nelse:\n print(\"No\")\n"} +{"fast_code_id":"df09b764b4b36c4dd1a32444ee002c3308b4ad2d11bc9074e919e34e92013560","fast_id":"p03801_df09b764b4b36c4dd1a32444ee002c3308b4ad2d11bc9074e919e34e92013560","language":"python","measured_fast_code_id":"df09b764b4b36c4dd1a32444ee002c3308b4ad2d11bc9074e919e34e92013560","measured_slow_code_id":"40cdb704510a327363c2183827f02e9385c4a8e8deb4ae92265564da9b8e0f50","measurement_metric":"cpu_instruction_count","pair_id":"python_604162ceadad3a90d4614953","problem_id":"p03801","slow_code_id":"16fad88fa10618a2d3253fe477e8c221495b37e3b11f228319dc3cf0097c8388","slow_id":"p03801_40cdb704510a327363c2183827f02e9385c4a8e8deb4ae92265564da9b8e0f50","speedup":2.6708583195042768,"stratum":"2-4","sampling_key":"6297611ff5533d8948134dfd124362218a507f8bbd2f574e788a47a526ab9cde","slow_code":"from collections import defaultdict\nimport sys\n\n\nclass BIT:\n def __init__(self, number):\n self.n = number\n self.list = [0] * (number + 1)\n\n def add(self, i, x):\n while i <= self.n:\n self.list[i] += x\n i += i & -i\n\n def search(self, i):\n s = 0\n while i > 0:\n s += self.list[i]\n i -= i & -i\n return s\n\n def suma(self, i, j):\n return self.search(j) - self.search(i - 1)\n\n\nN = int(eval(input()))\nA = [int(i) for i in input().split()]\nC = sorted(set(A))\nndd = defaultdict(int)\nfor i in range(len(C)):\n ndd[i + 1] = C[i]\ndd = defaultdict(int)\nfor i in range(len(C)):\n dd[C[i]] = i + 1\n\nvisit = [0] * N\nvisit[0] = 1\ns = A[0]\nH = []\nH.append(s)\nfor i in range(1, N):\n if s < A[i]:\n s = A[i]\n H.append(s)\n visit[i] = 1\nBITI = BIT(N + 1)\nBITI2 = BIT(N + 1)\nj = len(H) - 1\nl = dd[H[j]]\nnum = sum(A)\nT = [0] * N\nans = 0\nfor i in range(N - 1, -1, -1):\n if l == dd[A[0]]:\n break\n BITI.add(dd[A[i]], A[i])\n BITI2.add(dd[A[i]], 1)\n if dd[A[i]] == l and visit[i] == 1:\n T[i] = (\n BITI.suma(dd[H[j - 1]], N + 1)\n - BITI2.suma(dd[H[j - 1]], N + 1) * H[j - 1]\n - ans\n )\n ans += T[i]\n\n j -= 1\n l = dd[H[j]]\nx = num - sum(T)\nT[0] = x\n\nfor t in T:\n print(t)\n","fast_code":"N = int(eval(input()))\nA = [int(a) for a in input().split()]\nans = [0] * N\nnum = 0\nB = sorted(A)\nj = 0\nfor i in range(N):\n cnt = 0\n while j < N and B[j] <= A[i]:\n cnt += max(0, B[j] - num)\n j += 1\n ans[i] = cnt + max(0, (N - j) * (A[i] - num))\n num = max(num, A[i])\nfor a in ans:\n print(a)\n"} +{"fast_code_id":"410642ef7e1a2dd48a9843ed5e1a9b68d0a1e61878a3f3464b7a63a9e7d8384e","fast_id":"p02971_410642ef7e1a2dd48a9843ed5e1a9b68d0a1e61878a3f3464b7a63a9e7d8384e","language":"python","measured_fast_code_id":"410642ef7e1a2dd48a9843ed5e1a9b68d0a1e61878a3f3464b7a63a9e7d8384e","measured_slow_code_id":"574406044bb1599cddf064526e1d32459b948c359a5a1de966a35ad9affef810","measurement_metric":"cpu_instruction_count","pair_id":"python_609400df5608255a73d963f1","problem_id":"p02971","slow_code_id":"574406044bb1599cddf064526e1d32459b948c359a5a1de966a35ad9affef810","slow_id":"p02971_574406044bb1599cddf064526e1d32459b948c359a5a1de966a35ad9affef810","speedup":2.91511976397671,"stratum":"2-4","sampling_key":"54d98cda7ef5f8c24f1a53a250e45aa74cc30d5746fb4cf6a2d9a89875244a5a","slow_code":"N = int(eval(input()))\nA = []\nfor i in range(N):\n A.append(int(eval(input())))\nAs = sorted(A, reverse=True)\nfor j in A:\n if j == As[0]:\n print((As[1]))\n else:\n print((As[0]))\n","fast_code":"from sys import stdin\n\nn = int(stdin.readline().rstrip())\nli = list(int(stdin.readline().rstrip()) for _ in range(n))\nli_to = sorted(li)\none = li_to[-1]\ntwo = li_to[-2]\nfor i in range(n):\n if one == li[i]:\n print(two)\n else:\n print(one)\n"} +{"fast_code_id":"77f76a38867beb641e47757dba2bd5b430b6e0e083272ea4226efd20efb0d38e","fast_id":"p02707_77f76a38867beb641e47757dba2bd5b430b6e0e083272ea4226efd20efb0d38e","language":"python","measured_fast_code_id":"77f76a38867beb641e47757dba2bd5b430b6e0e083272ea4226efd20efb0d38e","measured_slow_code_id":"3be6889cc1da356348ac3376a8ed377db1511d6ce756e917ddc4f3cacad06f9f","measurement_metric":"cpu_instruction_count","pair_id":"python_6096ead9cbae6b6de1f4280c","problem_id":"p02707","slow_code_id":"87d845843925bd36d2bcc668988b66897308640bf2bd99fe70876b0c70842fff","slow_id":"p02707_3be6889cc1da356348ac3376a8ed377db1511d6ce756e917ddc4f3cacad06f9f","speedup":2.6483423128265673,"stratum":"2-4","sampling_key":"bbeac094c45d19e23a424b5df2a20c88ccc7ad8613df2b4473d550845eccf02d","slow_code":"import sys\nfrom collections import *\nimport heapq\nimport math\nfrom math import gcd\nimport bisect\nimport copy\nfrom itertools import permutations, accumulate, combinations, product\n\n\ndef input():\n return sys.stdin.readline()[:-1]\n\n\ndef ruiseki(lst):\n return [0] + list(accumulate(lst))\n\n\nmod = pow(10, 9) + 7\nal = [chr(ord(\"a\") + i) for i in range(26)]\ndirection = [[1, 0], [0, 1], [-1, 0], [0, -1]]\nn = int(eval(input()))\na = list(map(int, input().split()))\nlst = [0] * n\nfor i in range(n - 1):\n lst[a[i] - 1] += 1\n\nfor i in range(n):\n print((lst[i]))\n","fast_code":"a = int(eval(input()))\nb = [0] * a\nfor c in map(int, input().split()):\n b[c - 1] = b[c - 1] + 1\nprint((\"\\n\".join(map(str, b))))\n"} +{"fast_code_id":"7fe3505b14debd492c9069694168656769541e009f6c206df88bb70b828e72c9","fast_id":"p01268_7fe3505b14debd492c9069694168656769541e009f6c206df88bb70b828e72c9","language":"python","measured_fast_code_id":"7fe3505b14debd492c9069694168656769541e009f6c206df88bb70b828e72c9","measured_slow_code_id":"0a932eb6633858ba78c6cf0f7f33ce8a7678b6c98d01696a6e1a5b5d1b92803d","measurement_metric":"cpu_instruction_count","pair_id":"python_60d76a5c0184b2199583b34c","problem_id":"p01268","slow_code_id":"0a932eb6633858ba78c6cf0f7f33ce8a7678b6c98d01696a6e1a5b5d1b92803d","slow_id":"p01268_0a932eb6633858ba78c6cf0f7f33ce8a7678b6c98d01696a6e1a5b5d1b92803d","speedup":2.2831365016401857,"stratum":"2-4","sampling_key":"57c230a99f383b41dfe196c197d0a338b2feb020533629ef35dd7a7d8a206e21","slow_code":"from bisect import bisect_right as br\nfrom itertools import combinations_with_replacement as cwr\n\nMAX = 110000\nROOT = 340\ntf = [True] * MAX\ntf[0] = tf[1] = False\nfor i in range(2, ROOT + 1):\n if tf[i]:\n for j in range(i * i, MAX, i):\n tf[j] = False\nprimes = [i for i in range(MAX) if tf[i]]\nwhile True:\n n, p = list(map(int, input().split()))\n if n == -1:\n break\n init = br(primes, n)\n choice = primes[init : init + 100]\n lst = []\n for i, j in cwr(choice, 2):\n lst.append(i + j)\n lst.sort()\n print((lst[p - 1]))\n","fast_code":"import itertools\n\nr = 110000\ns = int(r * 0.5)\np = [1] * r\np[0] = 0\nfor i in range(1, s):\n if p[i]:\n p[2 * i + 1 :: i + 1] = [0 for x in range(2 * i + 1, r, i + 1)]\nwhile 1:\n N, P = list(map(int, input().split()))\n if N == -1:\n break\n i = N + 1\n prime = [0] * 23\n j = 0\n while j < 23:\n if p[i - 1] == 1:\n prime[j] = i\n j += 1\n i += 1\n wa = sorted(\n [sum(comb) for comb in itertools.combinations(prime, 2)]\n + [2 * a for a in prime]\n )\n print(wa[P - 1])\n"} +{"fast_code_id":"1e37aee9f317eebea2fe8d1391e12085393da9ef9c63fb93f618c2441803a41b","fast_id":"p02551_8ab14e215af72b3cb6d01cf7ba8a327d19a391a1d1021af8d966ef63acf544dd","language":"python","measured_fast_code_id":"8ab14e215af72b3cb6d01cf7ba8a327d19a391a1d1021af8d966ef63acf544dd","measured_slow_code_id":"b6d8d02e6cf1c2cdae11c71a6f58f4cedbd533f79dc49244a4531d1545967d6e","measurement_metric":"cpu_instruction_count","pair_id":"python_612b9b5886a3a6eaf0c6d0d5","problem_id":"p02551","slow_code_id":"b6d8d02e6cf1c2cdae11c71a6f58f4cedbd533f79dc49244a4531d1545967d6e","slow_id":"p02551_b6d8d02e6cf1c2cdae11c71a6f58f4cedbd533f79dc49244a4531d1545967d6e","speedup":3.871824049036156,"stratum":"2-4","sampling_key":"b0ad241a45c354c48299aa6d069d8cbb31ef3e141774eb69dc4b9f5acdd07bb7","slow_code":"class LazySegmentTree:\n def __init__(self, init_val, segfunc, ide_ele):\n n = len(init_val)\n self.segfunc = segfunc\n self.ide_ele = ide_ele\n self.num = 1 << (n - 1).bit_length()\n self.data = [ide_ele] * 2 * self.num\n self.lazy = [None] * 2 * self.num\n for i in range(n):\n self.data[self.num + i] = init_val[i]\n for i in range(self.num - 1, 0, -1):\n self.data[i] = self.segfunc(self.data[2 * i], self.data[2 * i + 1])\n\n def gindex(self, l, r):\n l += self.num\n r += self.num\n lm = l >> (l & -l).bit_length()\n rm = r >> (r & -r).bit_length()\n while r > l:\n if l <= lm:\n yield l\n if r <= rm:\n yield r\n r >>= 1\n l >>= 1\n while l:\n yield l\n l >>= 1\n\n def propagates(self, *ids):\n for i in reversed(ids):\n v = self.lazy[i]\n if v is None:\n continue\n self.lazy[2 * i] = v\n self.lazy[2 * i + 1] = v\n self.data[2 * i] = v\n self.data[2 * i + 1] = v\n self.lazy[i] = None\n\n def update(self, l, r, x):\n (*ids,) = self.gindex(l, r)\n self.propagates(*ids)\n l += self.num\n r += self.num\n while l < r:\n if l & 1:\n self.lazy[l] = x\n self.data[l] = x\n l += 1\n if r & 1:\n self.lazy[r - 1] = x\n self.data[r - 1] = x\n r >>= 1\n l >>= 1\n for i in ids:\n self.data[i] = self.segfunc(self.data[2 * i], self.data[2 * i + 1])\n\n def query(self, l, r):\n (*ids,) = self.gindex(l, r)\n self.propagates(*ids)\n res = self.ide_ele\n l += self.num\n r += self.num\n while l < r:\n if l & 1:\n res = self.segfunc(res, self.data[l])\n l += 1\n if r & 1:\n res = self.segfunc(res, self.data[r - 1])\n l >>= 1\n r >>= 1\n return res\n\n\ndef segfunc(x, y):\n return min(x, y)\n\n\nide_ele = 10**9\nN, Q = list(map(int, input().split()))\nans = (N - 2) * (N - 2)\nR = [N] * (N + 1)\nW = [N] * (N + 1)\nseg_r = LazySegmentTree(R, segfunc, ide_ele)\nseg_w = LazySegmentTree(W, segfunc, ide_ele)\nfor i in range(Q):\n a, b = list(map(int, input().split()))\n if a == 1:\n t = seg_r.query(b, b + 1)\n ans -= max(0, t - 2)\n if b <= seg_w.query(1, 2):\n seg_w.update(1, t + 1, b)\n else:\n t = seg_w.query(b, b + 1)\n ans -= max(0, t - 2)\n if b <= seg_r.query(1, 2):\n seg_r.update(1, t + 1, b)\nprint(ans)\n","fast_code":"N, Q = list(map(int, input().split()))\nN -= 2\nBIT = [[0 for i in range(N + 1)] for _ in range(2)]\nn = N\n\n\ndef BIT_query(idx, BIT):\n res_sum = 0\n while idx > 0:\n res_sum += BIT[idx]\n idx -= idx & (-idx)\n return res_sum\n\n\ndef BIT_update(idx, x, BIT):\n while idx <= n:\n BIT[idx] += x\n idx += idx & (-idx)\n return\n\n\nnow = N * N\nmax_x = [0, 0]\nfor _ in range(Q):\n s, x = list(map(int, input().split()))\n s -= 1\n x -= 1\n x = N + 1 - x\n\n depth = N + BIT_query(x, BIT[s])\n now -= depth\n\n if x > max_x[s]:\n BIT_update(N - depth + 1, max_x[s] - x, BIT[1 - s])\n max_x[s] = x\nprint(now)\n"} +{"fast_code_id":"9ca73476f1131853179fecf70c42d279491ae767fa15807203ecca379aa873a7","fast_id":"p00150_9ca73476f1131853179fecf70c42d279491ae767fa15807203ecca379aa873a7","language":"python","measured_fast_code_id":"9ca73476f1131853179fecf70c42d279491ae767fa15807203ecca379aa873a7","measured_slow_code_id":"f5aca30380ab4d5ce02a8e140ae5b56c975263595f2ba6e4f69ffa3d2034a703","measurement_metric":"cpu_instruction_count","pair_id":"python_6144db532c5241ff76a77c1e","problem_id":"p00150","slow_code_id":"f5aca30380ab4d5ce02a8e140ae5b56c975263595f2ba6e4f69ffa3d2034a703","slow_id":"p00150_f5aca30380ab4d5ce02a8e140ae5b56c975263595f2ba6e4f69ffa3d2034a703","speedup":11.626248178082323,"stratum":"8+","sampling_key":"28efe352e8779db04cb00db0aff5e8015388c6e88ed852dbc31627555e38b6f7","slow_code":"r = 10001\nsqrt = int(r**0.5)\np = [1] * r\ntwin = [0] * r\np[0] = 0\np[1::2] = [0 for x in range(1, r, 2)]\nfor i in range(2, r, 2):\n if p[i]:\n p[2 * i + 1 :: i + 1] = [0 for x in range(2 * i + 1, r, i + 1)]\n if p[i - 2]:\n twin[i : i + 300] = [i + 1 for x in range(i, i + 300)]\nwhile True:\n n = int(input())\n if n == 0:\n break\n print(twin[n - 1] - 2, twin[n - 1])\n","fast_code":"import bisect as bs\n\n\ndef prime(m):\n N = list(range(1, m + 1, 2))\n N[0] = 2\n for i in range(1, int(m**0.5) + 1):\n x = N[i]\n if x:\n N[i + x :: x] = [0] * len(N[i + x :: x])\n return [_f for _f in N if _f]\n\n\nP = prime(10000)\nx = [P[i] for i in range(1, len(P)) if P[i] - P[i - 1] == 2]\nwhile 1:\n n = eval(input())\n if n == 0:\n break\n a = x[bs.bisect_right(x, n) - 1]\n print(a - 2, a)\n"} +{"fast_code_id":"7f43bc4626339584a6d59443d498ed828bdcc8b7b2cd7280cfac7cab4e848c35","fast_id":"p02640_7f43bc4626339584a6d59443d498ed828bdcc8b7b2cd7280cfac7cab4e848c35","language":"python","measured_fast_code_id":"7f43bc4626339584a6d59443d498ed828bdcc8b7b2cd7280cfac7cab4e848c35","measured_slow_code_id":"b81aa7896b39a5e204fdfa9ca3f63685a6d18d86724afc22b841cf9b49e7766b","measurement_metric":"cpu_instruction_count","pair_id":"python_61ada148eb9df420e15cd49a","problem_id":"p02640","slow_code_id":"ac09bdaf0871ab87a33221ec8a163d2052febe18d868feae44e613cae3f3a95f","slow_id":"p02640_b81aa7896b39a5e204fdfa9ca3f63685a6d18d86724afc22b841cf9b49e7766b","speedup":6.421833247678583,"stratum":"4-8","sampling_key":"2f440bbe5abb209f345533347228152f1905d023bc7469b3edbf9ac9390fa021","slow_code":"x, y = list(map(int, input().split()))\nfor i in range(0, 101):\n for j in range(0, 101):\n if i + j == x and i * 2 + j * 4 == y:\n print(\"Yes\")\n exit()\nprint(\"No\")\n","fast_code":"x, y = list(map(int, input().split()))\nans = False\nfor c in range(x + 1):\n t = x - c\n if c + t == x and 2 * c + 4 * t == y:\n ans = True\n break\nprint((\"Yes\" if ans else \"No\"))\n"} +{"fast_code_id":"c7f5f0de5509b8a35c16245b29a408c303043e680b72b0594d4e075979ad5bbf","fast_id":"p03309_c7f5f0de5509b8a35c16245b29a408c303043e680b72b0594d4e075979ad5bbf","language":"python","measured_fast_code_id":"c7f5f0de5509b8a35c16245b29a408c303043e680b72b0594d4e075979ad5bbf","measured_slow_code_id":"cc6340aab617e7100bd4d51ff3921118d5d3dad1bda63cfcf3f2026a849def46","measurement_metric":"cpu_instruction_count","pair_id":"python_626f32b0b4112609f33788b0","problem_id":"p03309","slow_code_id":"364f3596fd84d0acd37a6dd5d8da1a36ebb61efbb957346157757658db88473b","slow_id":"p03309_cc6340aab617e7100bd4d51ff3921118d5d3dad1bda63cfcf3f2026a849def46","speedup":3.815007268379895,"stratum":"2-4","sampling_key":"635d87090b2565977d1c11b842b2e494f0cbcebdff72cbd3176141531ff8871c","slow_code":"if __name__ == \"__main__\":\n from statistics import median\n\n n = int(eval(input()))\n a = list(map(int, input().split()))\n total = 0\n\n mod_a = sorted([ai - i for i, ai in enumerate(a, 1)])\n b = median(mod_a)\n for i in range(n):\n total += abs(mod_a[i] - b)\n print((int(total)))\n","fast_code":"n = int(eval(input()))\na = list(map(int, input().split()))\nfor i in range(n):\n a[i] -= i + 1\nmedian = -1\na.sort()\nif n % 2 == 0:\n median = (a[n // 2] + a[n // 2 - 1]) // 2\nelse:\n median = a[n // 2]\n\n\ndef comp(x):\n su = 0\n for i in a:\n su += abs(i - x)\n return su\n\n\nprint((min(comp(median), comp(median + 1))))\n"} +{"fast_code_id":"37c64c843161b92469540d6a1ec2a29d2c5b7047a3f26ff46e602802a6763f12","fast_id":"p02760_37c64c843161b92469540d6a1ec2a29d2c5b7047a3f26ff46e602802a6763f12","language":"python","measured_fast_code_id":"37c64c843161b92469540d6a1ec2a29d2c5b7047a3f26ff46e602802a6763f12","measured_slow_code_id":"d6a8397cfa0dcae5cf40d19cddae391fb4dc4dd7ea3a9ed406b5e5e123e4a476","measurement_metric":"cpu_instruction_count","pair_id":"python_6280864594711d2c0139ed82","problem_id":"p02760","slow_code_id":"d6a8397cfa0dcae5cf40d19cddae391fb4dc4dd7ea3a9ed406b5e5e123e4a476","slow_id":"p02760_d6a8397cfa0dcae5cf40d19cddae391fb4dc4dd7ea3a9ed406b5e5e123e4a476","speedup":2.194985179612643,"stratum":"2-4","sampling_key":"8ec51fee80d2f4e20ca8eca461c8f290b45770cfb9f317cd718ba6fcfc0a519c","slow_code":"a = []\nfor i in range(3):\n a1, a2, a3 = list(map(int, input().split()))\n a.append(a1)\n a.append(a2)\n a.append(a3)\nl = [0] * 9\nn = int(eval(input()))\nfor i in range(n):\n b = int(eval(input()))\n if b in a:\n l[a.index(b)] += 1\nif l[0] == 1 and l[1] == 1 and l[2] == 1:\n print(\"Yes\")\nelif l[3] == 1 and l[4] == 1 and l[5] == 1:\n print(\"Yes\")\nelif l[6] == 1 and l[7] == 1 and l[8] == 1:\n print(\"Yes\")\nelif l[0] == 1 and l[3] == 1 and l[6] == 1:\n print(\"Yes\")\nelif l[1] == 1 and l[4] == 1 and l[7] == 1:\n print(\"Yes\")\nelif l[2] == 1 and l[5] == 1 and l[8] == 1:\n print(\"Yes\")\nelif l[0] == 1 and l[4] == 1 and l[8] == 1:\n print(\"Yes\")\nelif l[2] == 1 and l[4] == 1 and l[6] == 1:\n print(\"Yes\")\nelse:\n print(\"No\")\n","fast_code":"(*a,) = list(map(int, open(0).read().split()))\nprint(\n (\n \"NYoe s\"[\n any(\n t <= set(a.index(b) for b in a[10:])\n for t in (\n {0, 1, 2},\n {0, 3, 6},\n {0, 4, 8},\n {1, 4, 7},\n {2, 4, 6},\n {2, 5, 8},\n {3, 4, 5},\n {6, 7, 8},\n )\n ) :: 2\n ]\n )\n)\n"} +{"fast_code_id":"a16ad46c25afcc872ffdcecc1fc2488ab024ba2926890f3b3b73a77ac9799ba5","fast_id":"p03566_745ddbba495ff86d8ef795671a21728a3a97d40f4051f365cd66ffaf6066ffab","language":"python","measured_fast_code_id":"745ddbba495ff86d8ef795671a21728a3a97d40f4051f365cd66ffaf6066ffab","measured_slow_code_id":"dc91f79d960f94fab7e0f22399c2cbf92cedc3dc5639f513b990cb57f69a9a24","measurement_metric":"cpu_instruction_count","pair_id":"python_62df7bdbe98588945c185402","problem_id":"p03566","slow_code_id":"dc91f79d960f94fab7e0f22399c2cbf92cedc3dc5639f513b990cb57f69a9a24","slow_id":"p03566_dc91f79d960f94fab7e0f22399c2cbf92cedc3dc5639f513b990cb57f69a9a24","speedup":279.36640642185955,"stratum":"8+","sampling_key":"1c99dc5c325781f6c4846670da9ab8e123fe9bc948e0bbb0d3544208b52c2693","slow_code":"def main():\n n = int(eval(input()))\n (*t,) = list(map(int, input().split()))\n tot = sum(t)\n (*v,) = list(map(int, input().split()))\n lim1 = []\n lim2 = [(1, 0, 0), (-1, tot, tot)]\n til = 0\n for t1, t2, v1 in zip([0] + t, t, v):\n lim1.append((til, til + t2, v1))\n lim2.append((-1, til, til + v1))\n lim2.append((1, til + t2, v1 - (til + t2)))\n til += t2\n\n def mi(time):\n ret = float(\"inf\")\n for l, r, lim in lim1:\n if l <= time <= r:\n ret = min(ret, lim)\n for f, tt, y in lim2:\n if f == -1 and time <= tt:\n ret = min(ret, y - time)\n if f == 1 and time >= tt:\n ret = min(ret, time + y)\n return ret\n\n print((sum(mi(i / 2) for i in range(tot * 2 + 1)) / 2))\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"def calc_area(v_end, v_start, v_max, dt):\n kouten_v = (v_end + v_start + dt) / 2\n kouten_t = kouten_v - v_start\n if 0 < kouten_t < dt:\n area = (v_start + kouten_v) * kouten_t / 2\n area += (v_end + kouten_v) * (dt - kouten_t) / 2\n area -= max(0, (kouten_v - v_max)) ** 2\n else:\n area = (v_start + v_end) * dt / 2\n return area\n\n\ndef main():\n\n n = int(eval(input()))\n t = [int(i) for i in input().split()]\n v = [int(i) for i in input().split()]\n\n max_velocity = [0]\n for i in range(1, n):\n max_velocity_ = min(v[i - 1], v[i], max_velocity[i - 1] + t[i - 1])\n max_velocity.append(max_velocity_)\n max_velocity.append(0)\n\n for i in range(n - 1):\n if max_velocity[-(i + 1)] - max_velocity[-(i + 2)] < -t[-(i + 1)]:\n max_velocity[-(i + 2)] = max_velocity[-(i + 1)] + t[-(i + 1)]\n\n ans = 0\n for i in range(n):\n ans += calc_area(max_velocity[i + 1], max_velocity[i], v[i], t[i])\n print(ans)\n\n\nmain()\n"} +{"fast_code_id":"f5de8e4c2a8e4e56b6d84c73a50dbabc2fe1ed51d513e4bcfc7a548c9fb0f0bd","fast_id":"p03806_f5de8e4c2a8e4e56b6d84c73a50dbabc2fe1ed51d513e4bcfc7a548c9fb0f0bd","language":"python","measured_fast_code_id":"f5de8e4c2a8e4e56b6d84c73a50dbabc2fe1ed51d513e4bcfc7a548c9fb0f0bd","measured_slow_code_id":"b9bb99d5fe18775e38a2581a478e2c51755cc41cba7f19b61bf8d3705a660d75","measurement_metric":"cpu_instruction_count","pair_id":"python_6308424933d0e18f1527d0be","problem_id":"p03806","slow_code_id":"b9bb99d5fe18775e38a2581a478e2c51755cc41cba7f19b61bf8d3705a660d75","slow_id":"p03806_b9bb99d5fe18775e38a2581a478e2c51755cc41cba7f19b61bf8d3705a660d75","speedup":75.79700242827886,"stratum":"8+","sampling_key":"09bb0a69468267352c653a29dbd2c83cc60aa4af457c0d998e3760bd73c87575","slow_code":"N, Ma, Mb = list(map(int, input().split()))\nINF = float(\"inf\")\ndp = [[INF for b in range(401)] for a in range(401)]\ndp[0][0] = 0\nfor i in range(1, N + 1):\n ai, bi, ci = list(map(int, input().split()))\n for a in range(400, -1, -1):\n for b in range(400, -1, -1):\n if a - ai >= 0 and b - bi >= 0:\n dp[a][b] = min(dp[a][b], dp[a - ai][b - bi] + ci)\nans = INF\nfor j in range(1, 401):\n if Ma * j > 400 or Mb * j > 400:\n break\n ans = min(ans, dp[Ma * j][Mb * j])\nprint((ans if ans != INF else -1))\n","fast_code":"def solve():\n N, Ma, Mb = list(map(int, input().split()))\n a, b, c = [], [], []\n for i in range(N):\n ai, bi, ci = list(map(int, input().split()))\n a.append(ai)\n b.append(bi)\n c.append(ci)\n nvals = 99 * N * 2 + 1\n inf = 40 * 100 + 1\n dp = [[inf] * nvals for i in range(N)]\n for i in range(N):\n v = Mb * a[i] - Ma * b[i]\n if i == 0:\n dp[i][v] = c[i]\n continue\n for j in range(-99 * N, 99 * N + 1):\n if -99 * N <= j - v <= 99 * N:\n dp[i][j] = min(dp[i - 1][j], dp[i - 1][j - v] + c[i])\n dp[i][v] = min(dp[i][v], c[i])\n ans = dp[N - 1][0]\n if ans < inf:\n print(ans)\n else:\n print((-1))\n\n\nif __name__ == \"__main__\":\n solve()\n"} +{"fast_code_id":"18c18135db2503f2edca924f4277d57f3bd3bdba8bbc33c1bb2bc48452d7159a","fast_id":"p02669_18c18135db2503f2edca924f4277d57f3bd3bdba8bbc33c1bb2bc48452d7159a","language":"python","measured_fast_code_id":"18c18135db2503f2edca924f4277d57f3bd3bdba8bbc33c1bb2bc48452d7159a","measured_slow_code_id":"5dc16e69171829fb825a4382d7ae818d1f78cf50ef12255ba28fcf6c6591e0e1","measurement_metric":"cpu_instruction_count","pair_id":"python_63cc7513e2b47aa54cd439bf","problem_id":"p02669","slow_code_id":"ca3505b4e5755f2e5a6dda25d2ba0ee1f8926fae7d5ee6e43c499cad98b2e89b","slow_id":"p02669_5dc16e69171829fb825a4382d7ae818d1f78cf50ef12255ba28fcf6c6591e0e1","speedup":5.070286747399016,"stratum":"4-8","sampling_key":"b4ebfc9f7eda9b6bf063597cb5106e6a1b703460d57ddbec8e7ce4d83c67eca3","slow_code":"import sys\n\ndivs = [2, 3, 5]\nt = int(eval(input()))\nfor _ in range(t):\n n, a, b, c, d = list(map(int, input().split()))\n costs = [a, b, c]\n dp = {}\n\n def dfs(x):\n if x in dp:\n return dp[x]\n\n if x == 0:\n dp[x] = 0\n return dp[x]\n ret = x * d\n for i in range(-4, 5):\n if x - i < 0:\n continue\n nx = x - i\n for cost, div in zip(costs, divs):\n if nx % div != 0 or nx // div >= x:\n continue\n ret = min(ret, dfs(nx // div) + cost + abs(i) * d)\n dp[x] = ret\n return ret\n\n print((dfs(n)))\n","fast_code":"t = int(eval(input()))\n\n\ndef calc(x):\n if x not in dp:\n divs = [5, 3, 2]\n costs = [c, b, a]\n values = lambda div, cost: [\n calc(x // div) + cost + x % div * d,\n calc((x + div - 1) // div) + cost + (-x) % div * d,\n ]\n dp[x] = min(\n x * d,\n *[value for div, cost in zip(divs, costs) for value in values(div, cost)]\n )\n return dp[x]\n\n\nfor _ in range(t):\n n, a, b, c, d = list(map(int, input().split()))\n dp = {0: 0, 1: d}\n print((calc(n)))\n"} +{"fast_code_id":"415e2fbfbc8c616c80b9b586b9ee67a020d1211659647030cfdfd1b8318829d1","fast_id":"p02264_415e2fbfbc8c616c80b9b586b9ee67a020d1211659647030cfdfd1b8318829d1","language":"python","measured_fast_code_id":"415e2fbfbc8c616c80b9b586b9ee67a020d1211659647030cfdfd1b8318829d1","measured_slow_code_id":"8fffc1cd65678e3915c1056dbea3a63f7d8529b58e3eba3e7df685e8a7a3cc38","measurement_metric":"cpu_instruction_count","pair_id":"python_63e52d8601779a6ca591ce78","problem_id":"p02264","slow_code_id":"4eab27c0f139900fd193b707c9a8cfcc72d1fb519ca557f7fac50cdef510c1ff","slow_id":"p02264_8fffc1cd65678e3915c1056dbea3a63f7d8529b58e3eba3e7df685e8a7a3cc38","speedup":2.281055019628064,"stratum":"2-4","sampling_key":"4a9ec846edd4f7fbd6ecced5bf808193c8d7c34d6b517c04bfb13debb22be0a1","slow_code":"class Queue:\n def __init__(self):\n self.l = []\n\n def enqueue(self, x):\n self.l.append(x)\n\n def dequeue(self):\n x = self.l[0]\n del self.l[0]\n return x\n\n def is_empty(self):\n return len(self.l) == 0\n\n\nclass Process:\n def __init__(self, name, time):\n self.name = name\n self.time = time\n\n\nif __name__ == \"__main__\":\n n, q = list(map(int, input().split()))\n Q = Queue()\n i = 0\n while i != n:\n tmp = input().split()\n Q.enqueue(Process(tmp[0], int(tmp[1])))\n i += 1\n cnt = 0\n while not Q.is_empty():\n p = Q.dequeue()\n if p.time > q:\n p.time -= q\n cnt += q\n Q.enqueue(p)\n else:\n cnt += p.time\n print(p.name, cnt)\n","fast_code":"import sys\nfrom collections import deque\n\ns = sys.stdin.readlines()\nq = int(s[0].split()[1])\nf = lambda x, y: (x, int(y))\nd = deque(f(*e.split()) for e in s[1:])\nt, a = 0, []\nwhile d:\n k, v = d.popleft()\n if v > q:\n v -= q\n t += q\n d.append([k, v])\n else:\n t += v\n a += [f\"{k} {t}\"]\nprint((\"\\n\".join(a)))\n"} +{"fast_code_id":"2a516c6073b8fdb9467f23f3ca7eab34997e183764079e15906e0a602d415efe","fast_id":"p02607_2a516c6073b8fdb9467f23f3ca7eab34997e183764079e15906e0a602d415efe","language":"python","measured_fast_code_id":"2a516c6073b8fdb9467f23f3ca7eab34997e183764079e15906e0a602d415efe","measured_slow_code_id":"80d5226038bdb32cf21a0b535cbd1c7092e4e8009586ccf346a6a6f305bc5b7d","measurement_metric":"cpu_instruction_count","pair_id":"python_641ece4de720b1674c990178","problem_id":"p02607","slow_code_id":"80d5226038bdb32cf21a0b535cbd1c7092e4e8009586ccf346a6a6f305bc5b7d","slow_id":"p02607_80d5226038bdb32cf21a0b535cbd1c7092e4e8009586ccf346a6a6f305bc5b7d","speedup":949.3996503715451,"stratum":"8+","sampling_key":"0a47118f752817396df90bb736a858931e33a89081b5572dedfb980f04045f0f","slow_code":"import sys\nfrom collections import deque\nimport numpy as np\nimport math\n\nsys.setrecursionlimit(10**6)\n\n\ndef S():\n return sys.stdin.readline().rstrip()\n\n\ndef SL():\n return list(map(str, sys.stdin.readline().rstrip().split()))\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\ndef IL():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef Main():\n n = I()\n a = list(IL())\n c = 0\n for rep in range(0, n, 2):\n if a[rep] % 2:\n c += 1\n print(c)\n return\n\n\nif __name__ == \"__main__\":\n Main()\n","fast_code":"n = int(eval(input()))\na = list(map(int, input().split()))\nans = 0\nfor i in range(n):\n if i % 2 == 0 and a[i] % 2:\n ans += 1\nprint(ans)\n"} +{"fast_code_id":"4a798b567cb7464d18e631b741220f560396034578eb820d867a055704647824","fast_id":"p04006_e55d9b31eb97cbd03a1ce62e98c25c8d9371a9879b0875d685634b1c273bc7bf","language":"python","measured_fast_code_id":"e55d9b31eb97cbd03a1ce62e98c25c8d9371a9879b0875d685634b1c273bc7bf","measured_slow_code_id":"91e1e2c740659f8110b6da7065d298174d653edb3135242031e3d37884d00c98","measurement_metric":"cpu_instruction_count","pair_id":"python_646c16b9f6b2138a1482bfd6","problem_id":"p04006","slow_code_id":"91e1e2c740659f8110b6da7065d298174d653edb3135242031e3d37884d00c98","slow_id":"p04006_91e1e2c740659f8110b6da7065d298174d653edb3135242031e3d37884d00c98","speedup":5.044347033393569,"stratum":"4-8","sampling_key":"d415b1dea7d8f1b8ded88522220d0d545b6a1f813f131329042bc93bf88f8070","slow_code":"import numpy as np\nfrom copy import deepcopy\n\nN, x = list(map(int, input().split()))\nA = list(map(int, input().split()))\n\n\ndef myfunc(N, x, A):\n B = deepcopy(np.array(A))\n m = sum(B)\n\n def apppop(A):\n A.append(A[0])\n A.pop(0)\n\n for idx in range(1, N):\n apppop(A)\n np.fmin(B, A, out=B)\n m = min(np.sum(B) + idx * x, m)\n print(int(m))\n\n\nmyfunc(N, x, A)\n","fast_code":"INF = float(\"inf\")\n\n\ndef inpl():\n return list(map(int, input().split()))\n\n\nN, x = inpl()\nA = inpl()\nmin_index = A.index(min(A))\nB = A[min_index:] + A[:min_index]\ncost = [B[i] for i in range(N)]\nans = INF\nfor magic in range(N):\n for i in range(N):\n if i - magic >= 0:\n cost[i] = min(cost[i], B[i - magic])\n ans = min(ans, sum(cost) + x * magic)\nprint(ans)\n"} +{"fast_code_id":"fc52a2e3dfa07f962b0b70fd8e131d966dd451761f03ab67cc8681ac9693ce11","fast_id":"p04015_fc52a2e3dfa07f962b0b70fd8e131d966dd451761f03ab67cc8681ac9693ce11","language":"python","measured_fast_code_id":"fc52a2e3dfa07f962b0b70fd8e131d966dd451761f03ab67cc8681ac9693ce11","measured_slow_code_id":"8b45717994a5fb48dc2b76199b10d5e4e202c9ce5463bf7869f8add9172f6ff7","measurement_metric":"cpu_instruction_count","pair_id":"python_64f6abcdbb1ce73a8d92b659","problem_id":"p04015","slow_code_id":"22f4d78fa24186375c05f8fb9209c535a507fc44a1c54caed7cae5ab1b3bfa98","slow_id":"p04015_8b45717994a5fb48dc2b76199b10d5e4e202c9ce5463bf7869f8add9172f6ff7","speedup":585.377074728542,"stratum":"8+","sampling_key":"d4701b93429dcbb6343439b39bb3972f108bbf613d71c3f6ae691c937d31ac81","slow_code":"from collections import defaultdict, deque, Counter, OrderedDict\nfrom bisect import bisect_left, bisect_right\nfrom functools import reduce, lru_cache\nfrom heapq import heappush, heappop, heapify\nimport itertools\nimport math, fractions\nimport sys, copy\n\n\ndef L():\n return sys.stdin.readline().split()\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\ndef SL():\n return list(sys.stdin.readline().rstrip())\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef LI1():\n return [int(x) - 1 for x in sys.stdin.readline().split()]\n\n\ndef LS():\n return [list(x) for x in sys.stdin.readline().split()]\n\n\ndef R(n):\n return [sys.stdin.readline().strip() for _ in range(n)]\n\n\ndef LR(n):\n return [L() for _ in range(n)]\n\n\ndef IR(n):\n return [I() for _ in range(n)]\n\n\ndef LIR(n):\n return [LI() for _ in range(n)]\n\n\ndef LIR1(n):\n return [LI1() for _ in range(n)]\n\n\ndef SLR(n):\n return [SL() for _ in range(n)]\n\n\ndef LSR(n):\n return [LS() for _ in range(n)]\n\n\ndef perm(n, r):\n return math.factorial(n) // math.factorial(r)\n\n\ndef comb(n, r):\n return math.factorial(n) // (math.factorial(r) * math.factorial(n - r))\n\n\ndef make_list(n, *args, default=0):\n return (\n [make_list(*args, default=default) for _ in range(n)]\n if args\n else [default for _ in range(n)]\n )\n\n\ndire = [[1, 0], [0, 1], [-1, 0], [0, -1]]\ndire8 = [[1, 0], [1, 1], [0, 1], [-1, 1], [-1, 0], [-1, -1], [0, -1], [1, -1]]\nalphabets = \"abcdefghijklmnopqrstuvwxyz\"\nALPHABETS = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\nMOD = 1000000007\nINF = float(\"inf\")\nsys.setrecursionlimit(1000000)\n\n\ndef main():\n N, A = LI()\n X = LI()\n dp = make_list(N + 1, N + 1, 2501)\n dp[0][0][0] = 1\n for i in range(1, N + 1):\n for k in range(i + 1):\n for s in range(2501):\n if X[i - 1] > s:\n dp[i][k][s] = dp[i - 1][k][s]\n else:\n dp[i][k][s] = dp[i - 1][k][s] + dp[i - 1][k - 1][s - X[i - 1]]\n print((sum(dp[N][k][k * A] for k in range(1, N + 1))))\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"def main():\n n, a = list(map(int, input().split()))\n y = [a - int(x) for x in input().split()]\n dp = {0: 1}\n for i in y:\n for k, v in list(dp.items()):\n dp[i + k] = dp.get(i + k, 0) + v\n print((dp[0] - 1))\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"4b0d182b7cdfed7d72f1e0aee293a0f06b1e8254b3d88651dfc93fbf3a90eb35","fast_id":"p03606_4b0d182b7cdfed7d72f1e0aee293a0f06b1e8254b3d88651dfc93fbf3a90eb35","language":"python","measured_fast_code_id":"4b0d182b7cdfed7d72f1e0aee293a0f06b1e8254b3d88651dfc93fbf3a90eb35","measured_slow_code_id":"91ed37766e83e1c57b3ed54e34dd70e87dd0159574758547062baadff81ba4dd","measurement_metric":"cpu_instruction_count","pair_id":"python_64fe0c2d0da5d5c924deea1d","problem_id":"p03606","slow_code_id":"91ed37766e83e1c57b3ed54e34dd70e87dd0159574758547062baadff81ba4dd","slow_id":"p03606_91ed37766e83e1c57b3ed54e34dd70e87dd0159574758547062baadff81ba4dd","speedup":7.3047542137394,"stratum":"4-8","sampling_key":"5f626e62303d0bb61665f6c3daf2d394ee1e682055deebaef37a0417fa9938a1","slow_code":"import collections\n\nn = int(eval(input()))\nl = [list(map(int, input().split())) for _ in range(n)]\nd = {}\nfor i in range(len(l)):\n for j in range(l[i][0], l[i][1] + 1):\n d[j] = 1\nprint((len(d)))\n","fast_code":"import sys\n\ninput = sys.stdin.readline\n\n\ndef I():\n return int(eval(input()))\n\n\ndef MI():\n return list(map(int, input().split()))\n\n\ndef LI():\n return list(map(int, input().split()))\n\n\ndef main():\n mod = 10**9 + 7\n N = I()\n ans = 0\n for i in range(N):\n l, r = MI()\n ans += (r - l) + 1\n print(ans)\n\n\nmain()\n"} +{"fast_code_id":"3f59f403ae0b4cdcca970331b3c85584a86a57f641ec14c25a13ff864055d6a4","fast_id":"p02770_b991ebb2290a4da6799a6daa285447de9aca5c37bf998182108cf90af4f99293","language":"python","measured_fast_code_id":"b991ebb2290a4da6799a6daa285447de9aca5c37bf998182108cf90af4f99293","measured_slow_code_id":"7f1c6212437f5dfde41ac56fb777a6413a36acf30f0fa1db841babde5bb8abca","measurement_metric":"cpu_instruction_count","pair_id":"python_65474c1552e498595c94bba8","problem_id":"p02770","slow_code_id":"7f1c6212437f5dfde41ac56fb777a6413a36acf30f0fa1db841babde5bb8abca","slow_id":"p02770_7f1c6212437f5dfde41ac56fb777a6413a36acf30f0fa1db841babde5bb8abca","speedup":3.7717239028204146,"stratum":"2-4","sampling_key":"181cc07bea1e8cac93f32012bc937f2a3a0331e9dec4260f7a5b82cd5d0ff353","slow_code":"import numpy as np\n\nk, q = list(map(int, input().split()))\nd = np.array(list(map(int, input().split()))).astype(np.int64)\nqueries = [tuple(map(int, input().split())) for _ in range(q)]\nfor n, x, m in queries:\n d_mod = d % m\n quotient, rem = divmod(n - 1, k)\n rem_d_mod = d_mod[:rem]\n print(\n (\n n\n - 1\n - (x % m + quotient * np.sum(d_mod) + np.sum(rem_d_mod)) // m\n - quotient * np.count_nonzero(d_mod == 0)\n - np.count_nonzero(rem_d_mod == 0)\n )\n )\n","fast_code":"import sys\nimport math\nfrom bisect import bisect_right as br\nfrom bisect import bisect_left as bl\n\nsys.setrecursionlimit(2147483647)\nfrom heapq import heappush, heappop, heappushpop\nfrom collections import defaultdict\nfrom itertools import accumulate\nfrom collections import Counter\nfrom collections import deque\nfrom operator import itemgetter\nfrom itertools import permutations\n\nmod = 10**9 + 7\ninf = float(\"inf\")\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\nk, q = LI()\nd = LI()\nnxm = [LI() for _ in range(q)]\nfor n, x, m in nxm:\n e = list([(x - 1) % m + 1 for x in d])\n s = sum(e) * ((n - 1) // k) + sum(e[: (n - 1) % k])\n tmp = (s + x) // m - x // m\n print((n - 1 - tmp))\n"} +{"fast_code_id":"b9b377895112e4c99f6470ef8bdf76c96f8f88338618602457f984055da5d8d7","fast_id":"p02848_b9b377895112e4c99f6470ef8bdf76c96f8f88338618602457f984055da5d8d7","language":"python","measured_fast_code_id":"b9b377895112e4c99f6470ef8bdf76c96f8f88338618602457f984055da5d8d7","measured_slow_code_id":"ed676805c3906f0b8eec9da5d2ece621b230f36d3c01a97c7d0f10d1fb5f8673","measurement_metric":"cpu_instruction_count","pair_id":"python_65c5a04b722692bedeb054fe","problem_id":"p02848","slow_code_id":"ed676805c3906f0b8eec9da5d2ece621b230f36d3c01a97c7d0f10d1fb5f8673","slow_id":"p02848_ed676805c3906f0b8eec9da5d2ece621b230f36d3c01a97c7d0f10d1fb5f8673","speedup":62.0242472097233,"stratum":"8+","sampling_key":"599822cab5f9c60b8300eb67165b7cbdebfecd2256bc8bbd8a9f0761f1f9b2bf","slow_code":"import sys, re\nfrom collections import deque, defaultdict, Counter\nfrom math import (\n ceil,\n sqrt,\n hypot,\n factorial,\n pi,\n sin,\n cos,\n tan,\n asin,\n acos,\n atan,\n radians,\n degrees,\n log2,\n)\nfrom itertools import (\n accumulate,\n permutations,\n combinations,\n combinations_with_replacement,\n product,\n groupby,\n)\nfrom operator import itemgetter, mul\nfrom copy import deepcopy\nfrom string import ascii_lowercase, ascii_uppercase, digits\nfrom bisect import bisect, bisect_left\nfrom heapq import heappush, heappop\nfrom functools import reduce\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef INT():\n return int(input())\n\n\ndef MAP():\n return map(int, input().split())\n\n\ndef LIST():\n return list(map(int, input().split()))\n\n\ndef ZIP(n):\n return zip(*(MAP() for _ in range(n)))\n\n\nimport numpy as np\n\nsys.setrecursionlimit(10**9)\nINF = float(\"inf\")\nmod = 10**9 + 7\nN = INT()\nS = input()\nA = [chr(65 + (ord(S[i]) - 65 + N) % 26) for i in range(len(S))]\nprint(*A, sep=\"\")\n","fast_code":"s = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\nn = int(input())\nx = input()\na = ord(\"A\")\nprint(\"\".join([s[(ord(c) - a + n) % 26] for c in x]))\n"} +{"fast_code_id":"563884c909984690cb17a4a75e13aa643e22ac803dadb5d6eff6d3b364daf2a3","fast_id":"p02551_563884c909984690cb17a4a75e13aa643e22ac803dadb5d6eff6d3b364daf2a3","language":"python","measured_fast_code_id":"563884c909984690cb17a4a75e13aa643e22ac803dadb5d6eff6d3b364daf2a3","measured_slow_code_id":"3fb4429ee888ddb8810abf6987aaa8ccbe9abde7bb58f869c67011fae847ac8b","measurement_metric":"cpu_instruction_count","pair_id":"python_6603cccaa5b24735cfaf2d30","problem_id":"p02551","slow_code_id":"e436c00a28b0ec58cc5ca5e93e0e4876df7a9883468a86ca2ef492100ee611a7","slow_id":"p02551_3fb4429ee888ddb8810abf6987aaa8ccbe9abde7bb58f869c67011fae847ac8b","speedup":5.1012793276801744,"stratum":"4-8","sampling_key":"92739de4ab808eed9a51b4c839b7142b295d858eac4e846b1f1c7a525bd79e52","slow_code":"import sys\nimport math\nfrom collections import defaultdict, deque, Counter\nfrom copy import deepcopy\nfrom bisect import bisect, bisect_right, bisect_left\nfrom heapq import heapify, heappop, heappush\n\ninput = sys.stdin.readline\n\n\ndef RD():\n return input().rstrip()\n\n\ndef F():\n return float(input().rstrip())\n\n\ndef I():\n return int(input().rstrip())\n\n\ndef MI():\n return list(map(int, input().split()))\n\n\ndef MF():\n return list(map(float, input().split()))\n\n\ndef LI():\n return list(map(int, input().split()))\n\n\ndef TI():\n return tuple(map(int, input().split()))\n\n\ndef LF():\n return list(map(float, input().split()))\n\n\ndef Init(H, W, num):\n return [[num for i in range(W)] for j in range(H)]\n\n\nclass BIT:\n\n def __init__(self, n):\n self.n = n\n self.bit = [0] * (n + 1)\n\n def add(self, i, x):\n\n while i <= self.n:\n self.bit[i] += x\n i += i & -i\n\n def sum(self, i):\n s = 0\n\n while i > 0:\n s += self.bit[i]\n i -= i & -i\n return s\n\n def rangesum(self, i, k):\n return self.sum(k) - self.sum(i)\n\n def lower_bound(self, x):\n if x <= 0:\n return 0\n else:\n i = 0\n r = 1\n\n while r < self.n:\n r = r << 1\n len = r\n while len > 0:\n if i + len < self.n and self.bit[i + len] < x:\n x -= self.bit[i + len]\n i += len\n len = len >> 1\n return i + 1\n\n\ndef main():\n N, Q = MI()\n X, Y = BIT(N), BIT(N)\n xmin = N - 2\n ymin = N - 2\n X.add(1, N - 2)\n X.add(N - 1, -(N - 2))\n Y.add(1, N - 2)\n Y.add(N - 1, -(N - 2))\n res = (N - 2) ** 2\n for i in range(Q):\n a, b = MI()\n if a == 1:\n x = X.sum(b - 1)\n if ymin > b - 2:\n temp = Y.sum(1)\n Y.add(1, b - 2 - temp)\n Y.add(xmin + 1, -(b - 2 - temp))\n ymin = b - 2\n res -= x\n else:\n y = Y.sum(b - 1)\n if xmin > b - 2:\n temp = X.sum(1)\n X.add(1, b - 2 - temp)\n X.add(ymin + 1, -(b - 2 - temp))\n xmin = b - 2\n res -= y\n print(res)\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"import sys\n\nread = sys.stdin.read\nreadline = sys.stdin.readline\nreadlines = sys.stdin.readlines\nsys.setrecursionlimit(10**9)\nINF = 1 << 60\nMOD = 1000000007\n\n\ndef main():\n N, Q, *query = list(map(int, read().split()))\n N -= 2\n row = [N] * N\n col = [N] * N\n R = C = N\n ans = N * N\n for q, x in zip(*[iter(query)] * 2):\n x -= 2\n if q == 1:\n if x < C:\n ans -= R\n for i in range(x + 1, C):\n col[i] = R\n C = x\n else:\n ans -= col[x]\n else:\n if x < R:\n ans -= C\n for i in range(x + 1, R):\n row[i] = C\n R = x\n else:\n ans -= row[x]\n print(ans)\n return\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"10678d77b3f28673dacc6d7392e9e9c37eec617d832c27b7ead861b417e601f5","fast_id":"p03282_f9a3c226a2d3c804d58bd9e296805bbc74e1baaf1cdf949f2fe60f7d536f4779","language":"python","measured_fast_code_id":"f9a3c226a2d3c804d58bd9e296805bbc74e1baaf1cdf949f2fe60f7d536f4779","measured_slow_code_id":"c6afbfabb4f57c620b796822aa793c63e616de41f9eb4e63aa7e8f88e45d1110","measurement_metric":"cpu_instruction_count","pair_id":"python_6607536f5ee7da2936413aa7","problem_id":"p03282","slow_code_id":"c6afbfabb4f57c620b796822aa793c63e616de41f9eb4e63aa7e8f88e45d1110","slow_id":"p03282_c6afbfabb4f57c620b796822aa793c63e616de41f9eb4e63aa7e8f88e45d1110","speedup":615.0157249234602,"stratum":"8+","sampling_key":"3f45104d3aa5c9e439f6ae088d85997e9db16c3fd35a48d51aa22174a77923c8","slow_code":"import numpy as np\n\nS = np.array(list(map(str, input().rstrip())))\nK = int(eval(input()))\ncnt = 0\nans = 1\nfor i, s in enumerate(S):\n if s != \"1\":\n cnt = i + 1\n ans = s\n break\nif cnt > K:\n print((1))\nelse:\n print((int(ans)))\n","fast_code":"import sys\n\nINF = float(\"inf\")\n\n\ndef solve(S: str, K: int):\n for i in range(K):\n if S[i] != \"1\":\n c = S[i]\n break\n else:\n print((1))\n return\n print(c)\n return\n\n\ndef main():\n def iterate_tokens():\n for line in sys.stdin:\n for word in line.split():\n yield word\n\n tokens = iterate_tokens()\n S = str(next(tokens))\n K = int(next(tokens))\n solve(S, K)\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"ff908f1d6b2723de5a8ca269d61d70f47d5cc5956ef7342203f3e6a93527a9cc","fast_id":"p02786_ff908f1d6b2723de5a8ca269d61d70f47d5cc5956ef7342203f3e6a93527a9cc","language":"python","measured_fast_code_id":"ff908f1d6b2723de5a8ca269d61d70f47d5cc5956ef7342203f3e6a93527a9cc","measured_slow_code_id":"5d6617ccb7542ab7ac6370731e16a8d6166b9d7e674b0195c22064d828abd3d2","measurement_metric":"cpu_instruction_count","pair_id":"python_66700894c24db55bc742d61e","problem_id":"p02786","slow_code_id":"ccd6f9587aa7a20c43aac93ef11246453f9abff3b028525d3340cb287fb6e047","slow_id":"p02786_5d6617ccb7542ab7ac6370731e16a8d6166b9d7e674b0195c22064d828abd3d2","speedup":40.16842084166798,"stratum":"8+","sampling_key":"0bb77e7be3e4a128731dfbddee290d92f010044e0bc9be772ee4c606f1b0dab3","slow_code":"import sys\nimport math\nimport os\nimport itertools\nimport string\nimport heapq\nimport _collections\nfrom collections import Counter\nfrom collections import defaultdict\nfrom collections import deque\nfrom functools import lru_cache\nimport bisect\nimport re\nimport queue\nimport copy\nimport decimal\n\n\nclass Scanner:\n @staticmethod\n def int():\n return int(sys.stdin.readline().rstrip())\n\n @staticmethod\n def string():\n return sys.stdin.readline().rstrip()\n\n @staticmethod\n def map_int():\n return [int(x) for x in Scanner.string().split()]\n\n @staticmethod\n def string_list(n):\n return [Scanner.string() for i in range(n)]\n\n @staticmethod\n def int_list_list(n):\n return [Scanner.map_int() for i in range(n)]\n\n @staticmethod\n def int_cols_list(n):\n return [Scanner.int() for i in range(n)]\n\n\ndef solve():\n N = Scanner.int()\n ans = 0\n tmp = 1\n while N > 1:\n ans += tmp\n tmp *= 2\n N //= 2\n ans += tmp\n print(ans)\n\n\ndef main():\n\n solve()\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"H = int(eval(input()))\nh = 0\nwhile H != 1:\n H = int(H / 2)\n h += 1\nprint((2 ** (h + 1) - 1))\n"} +{"fast_code_id":"4bb9fcf1562c655a6cb303039c1fe9a0ab3ae893d8705c11288f6f979b3bfe19","fast_id":"p02821_db6e30853f216497b887bf9c61bdf47f5f4aa3bed3a7ffd1ef1b74c86f6e9a9c","language":"python","measured_fast_code_id":"db6e30853f216497b887bf9c61bdf47f5f4aa3bed3a7ffd1ef1b74c86f6e9a9c","measured_slow_code_id":"f8690910de5a01bf00d05cddb4b11fb05a0b5d435dec0066a396506b32432a1b","measurement_metric":"cpu_instruction_count","pair_id":"python_66ac50c8608351be97c31200","problem_id":"p02821","slow_code_id":"f8690910de5a01bf00d05cddb4b11fb05a0b5d435dec0066a396506b32432a1b","slow_id":"p02821_f8690910de5a01bf00d05cddb4b11fb05a0b5d435dec0066a396506b32432a1b","speedup":5.807879251083015,"stratum":"4-8","sampling_key":"027792fcd9c1186d419a1e8ca1ce39c346f014132d4d530ec2d6c9e47ba5cae7","slow_code":"import numpy as np\nimport sys\n\ninput = sys.stdin.readline\n\n\ndef main():\n N, M = list(map(int, input().split()))\n A = np.array(sorted([int(i) for i in input().split()]))\n left = 0\n right = A[-1] * 2 + 5\n while right - left > 1:\n x = (left + right) // 2\n count = N**2 - np.searchsorted(A, x - A).sum()\n if count >= M:\n left = x\n else:\n right = x\n bound = np.searchsorted(A, left - A)\n count = N**2 - bound.sum()\n diff = count - M\n ans = ((N - bound) * A * 2).sum() - diff * left\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"import bisect\n\nN, M = list(map(int, input().split()))\nA = list(map(int, input().split()))\nA.sort()\n\n\ndef pattern_num_ge_x(x):\n p = 0\n for a in A:\n p += N - bisect.bisect_left(A, x - a)\n return p\n\n\nl = -1\nr = 10**5 * 2 + 1\nwhile r - l > 1:\n m = (r + l) // 2\n if pattern_num_ge_x(m) < M:\n r = m\n else:\n l = m\n\nS = [0] + list(reversed(A[:]))\nfor i in range(1, N + 1):\n S[i] += S[i - 1]\nans = 0\nfor a in A:\n idx = bisect.bisect_left(A, r - a)\n ans += a * (N - idx) + S[N - idx]\n M -= N - idx\n\nans += l * M\nprint(ans)\n"} +{"fast_code_id":"3fbec6b8d07f8c068b406adf35bf0ba34b1cccb6198d217333c5ea91e98fc016","fast_id":"p02619_3fbec6b8d07f8c068b406adf35bf0ba34b1cccb6198d217333c5ea91e98fc016","language":"python","measured_fast_code_id":"3fbec6b8d07f8c068b406adf35bf0ba34b1cccb6198d217333c5ea91e98fc016","measured_slow_code_id":"e06ba4d62ffe23f292e9554193c989e47766a38ef3e00279117101508edbb374","measurement_metric":"cpu_instruction_count","pair_id":"python_670730d341e0e0c9ca56a3b5","problem_id":"p02619","slow_code_id":"e06ba4d62ffe23f292e9554193c989e47766a38ef3e00279117101508edbb374","slow_id":"p02619_e06ba4d62ffe23f292e9554193c989e47766a38ef3e00279117101508edbb374","speedup":6.492803797844002,"stratum":"4-8","sampling_key":"790fca5ce61e970378c08eefe76feb975fbda66271e8a307b87e2d86182540c0","slow_code":"import numpy as np\n\nD = int(eval(input()))\nc = [int(i) for i in input().split()]\ns = []\nfor d in range(D):\n s.append([int(i) for i in input().split()])\nt = []\nfor d in range(D):\n t.append(int(eval(input())) - 1)\nv = [0] * D\nlast = [[0 for i in range(26)] for d in range(D)]\nfor d in range(D):\n if d >= 1:\n last[d] = last[d - 1][:]\n last[d][t[d]] = d + 1\nfor d in range(D):\n v[d] = s[d][t[d]] - sum([c[i] * (d + 1 - last[d][i]) for i in range(26)])\nv_sum = 0\nfor d in range(D):\n v_sum += v[d]\n print(v_sum)\n","fast_code":"D = int(eval(input()))\nc = list(map(int, input().split()))\ns = [list(map(int, input().split())) for _ in range(D)]\nt = [int(eval(input())) for _ in range(D)]\nlasts = [[-1] * 26 for _ in range(D + 1)]\nS = 0\nfor d in range(D):\n S += s[d][t[d] - 1]\n for i in range(26):\n if i == t[d] - 1:\n lasts[d + 1][i] = d\n else:\n lasts[d + 1][i] = lasts[d][i]\n for i in range(26):\n S -= c[i] * (d - lasts[d + 1][i])\n print(S)\n"} +{"fast_code_id":"3372f4f601315791f5fa5074c8f91306b596e20abda63ec14629d9dee61e0933","fast_id":"p03294_3372f4f601315791f5fa5074c8f91306b596e20abda63ec14629d9dee61e0933","language":"python","measured_fast_code_id":"3372f4f601315791f5fa5074c8f91306b596e20abda63ec14629d9dee61e0933","measured_slow_code_id":"6a8516bb6c02b59ea3266bd536b3072e7db8cc83ba4dc6beff554090e4315ea9","measurement_metric":"cpu_instruction_count","pair_id":"python_67373fa64c2795678b528801","problem_id":"p03294","slow_code_id":"6a8516bb6c02b59ea3266bd536b3072e7db8cc83ba4dc6beff554090e4315ea9","slow_id":"p03294_6a8516bb6c02b59ea3266bd536b3072e7db8cc83ba4dc6beff554090e4315ea9","speedup":180.18491104972298,"stratum":"8+","sampling_key":"0d70d219235c111a64c12a90b673d5c62221b82fafee10975008d499320fe07e","slow_code":"import numpy as np\n\nN = int(eval(input()))\na = np.array(list(map(int, input().split())))\nprint((np.sum(a - 1)))\n","fast_code":"n = int(eval(input()))\na = list(map(int, input().split()))\nans = sum(a) - n\nprint(ans)\n"} +{"fast_code_id":"2ce60f1a1408c3c92e7f5201027a60a54ca6f2defd056d05b14b5e80301f91f7","fast_id":"p02703_2ce60f1a1408c3c92e7f5201027a60a54ca6f2defd056d05b14b5e80301f91f7","language":"python","measured_fast_code_id":"2ce60f1a1408c3c92e7f5201027a60a54ca6f2defd056d05b14b5e80301f91f7","measured_slow_code_id":"90be895b60848d0137d21c0628afac2da1af1edd13c122290ee2e39bc535083d","measurement_metric":"cpu_instruction_count","pair_id":"python_673e2bb78de77d67b153ebfc","problem_id":"p02703","slow_code_id":"37319076c3b5100beb96d2f9c428eac7654c186db18fd46b9d512ca816af7955","slow_id":"p02703_90be895b60848d0137d21c0628afac2da1af1edd13c122290ee2e39bc535083d","speedup":3.774432304322024,"stratum":"2-4","sampling_key":"d3d4b5ebe00c4e287d068ec5cde8f00fde557240c898114387366bfb136c6c64","slow_code":"class Dijkstra:\n\n class Edge:\n\n def __init__(self, _to, _cost):\n self.to = _to\n self.cost = _cost\n\n def __init__(self, V):\n self.G = [[] for i in range(V)]\n self._E = 0\n self._V = V\n\n @property\n def E(self):\n return self._E\n\n @property\n def V(self):\n return self._V\n\n def add(self, _from, _to, _cost):\n self.G[_from].append(self.Edge(_to, _cost))\n self._E += 1\n\n def shortest_path(self, s):\n import heapq\n\n que = []\n d = [float(\"inf\")] * self.V\n d[s] = 0\n heapq.heappush(que, (0, s))\n while len(que) != 0:\n cost, v = heapq.heappop(que)\n\n if d[v] < cost:\n continue\n for i in range(len(self.G[v])):\n\n e = self.G[v][i]\n if d[e.to] > d[v] + e.cost:\n d[e.to] = d[v] + e.cost\n heapq.heappush(que, (d[e.to], e.to))\n return d\n\n\nN, M, S = list(map(int, input().split()))\npro = Dijkstra(N * (50 * (N - 1) + 1))\nfor i in range(0, M):\n u, v, a, b = list(map(int, input().split()))\n for j in range(a, 50 * (N - 1) + 1):\n pro.add(N * j + u - 1, N * (j - a) + v - 1, b)\n pro.add(N * j + v - 1, N * (j - a) + u - 1, b)\nfor i in range(0, N):\n c, d = list(map(int, input().split()))\n for j in range(0, 50 * (N - 1)):\n to = min(50 * (N - 1), j + c)\n pro.add(N * j + i, N * to + i, d)\nS = min(50 * (N - 1), S)\nans = pro.shortest_path(N * S)\nfor i in range(1, N):\n p = float(\"inf\")\n for j in range(0, 50 * (N - 1) + 1):\n p = min(p, ans[N * j + i])\n print(p)\n","fast_code":"from heapq import heappush, heappop\n\nN, M, S = list(map(int, input().split()))\nmxCost = 0\nedges = [[] for _ in range(N)]\nfor _ in range(M):\n fr, to, cost, dist = list(map(int, input().split()))\n mxCost = max(mxCost, cost)\n fr -= 1\n to -= 1\n edges[fr].append((to, dist, cost))\n edges[to].append((fr, dist, cost))\nfor i in range(N):\n C, D = list(map(int, input().split()))\n edges[i].append((i, D, -C))\nque = [(0, S, 0)]\nmxCost *= N - 1\nminDsit = [[10**18] * (mxCost + 1) for _ in range(N)]\nminDsit[0][0] = 0\nwhile que:\n dist, s, now = heappop(que)\n for to, d, c in edges[now]:\n cost = min(mxCost, s - c)\n if cost < 0 or minDsit[to][cost] <= dist + d:\n continue\n minDsit[to][cost] = dist + d\n heappush(que, (dist + d, cost, to))\nfor dist in minDsit[1:]:\n print((min(dist)))\n"} +{"fast_code_id":"59b009c5f295f790892cf5fe9dd68d43352544426ae4ab638f77f5edd3158cdc","fast_id":"p00263_59b009c5f295f790892cf5fe9dd68d43352544426ae4ab638f77f5edd3158cdc","language":"python","measured_fast_code_id":"59b009c5f295f790892cf5fe9dd68d43352544426ae4ab638f77f5edd3158cdc","measured_slow_code_id":"d0dfe2201444dca33b0e5be616f00e2983c025a640a772166a652b52efa0ed46","measurement_metric":"cpu_instruction_count","pair_id":"python_6779ff4f50f15e0fd3aa694d","problem_id":"p00263","slow_code_id":"d0dfe2201444dca33b0e5be616f00e2983c025a640a772166a652b52efa0ed46","slow_id":"p00263_d0dfe2201444dca33b0e5be616f00e2983c025a640a772166a652b52efa0ed46","speedup":4.500389266848692,"stratum":"4-8","sampling_key":"9fbc8101c9d7d019d7284ff0511f46fc4b6cf048f555ed773e2e2c0ff544ea55","slow_code":"for i in range(eval(input())):\n b = format(int(input(), 16), \"b\").zfill(32)\n a1 = 0\n a2 = 0.0\n for i in range(1, 25):\n a1 += int(b[i]) * 2 ** (24 - i)\n for i in range(25, 32):\n a2 += int(b[i]) * 2 ** (24 - i)\n print(\"-\" * int(b[0]) + str(a1) + str(a2)[1:])\n","fast_code":"for i in range(eval(input())):\n b = int(input(), 16)\n s = 1 << 31\n p = \"\"\n if b & s != 0:\n b ^= s\n p = \"-\"\n a = int(b * 1.0 / (1 << 7))\n print(p + str(a) + str(abs(b * 1.0 / (1 << 7) - a))[1:])\n"} +{"fast_code_id":"6f01b21aaef3552a9287719c35aa6e3c6365eb107e56c0d0ac4507489ff94d46","fast_id":"p04000_6f01b21aaef3552a9287719c35aa6e3c6365eb107e56c0d0ac4507489ff94d46","language":"python","measured_fast_code_id":"6f01b21aaef3552a9287719c35aa6e3c6365eb107e56c0d0ac4507489ff94d46","measured_slow_code_id":"a36bab8f921599e4ca7482c881bfcc39764a8e5acc14a246031adfce3dcc98b4","measurement_metric":"cpu_instruction_count","pair_id":"python_67d80930043522fcb879ff55","problem_id":"p04000","slow_code_id":"12645471e5b932b71064020cd96552bd93299a86ffda13a17e3ba1b8f76a6c83","slow_id":"p04000_a36bab8f921599e4ca7482c881bfcc39764a8e5acc14a246031adfce3dcc98b4","speedup":2.781078105016332,"stratum":"2-4","sampling_key":"04930c26e5aa5e4a0651154373a5959e202b5d37964c4fe7316945b6fdd3baa3","slow_code":"H, W, N = list(map(int, input().split()))\nB = set([])\nfor i in range(N):\n a, b = list(map(int, input().split()))\n a -= 1\n b -= 1\n B.add((a, b))\n\nBB = list(B)\nans = [0 for _ in range(10)]\nfor i in range(N):\n cnt = 0\n temp = 0\n x, y = BB[i]\n\n for sx in range(max(0, x - 2), min(x, H - 3) + 1):\n for sy in range(max(0, y - 2), min(y, W - 3) + 1):\n temp = 0\n for p in range(3):\n for q in range(3):\n if (sx + p, sy + q) in B:\n temp += 1\n\n ans[temp] += 1\nfor i in range(1, 10):\n ans[i] = ans[i] // i\nans[0] = (H - 2) * (W - 2) - sum(ans[1:])\nfor t in ans:\n print(t)\n","fast_code":"from collections import defaultdict, Counter\n\nH, W, N = list(map(int, input().split()))\nD = defaultdict(int)\nfor _ in range(N):\n a, b = list(map(int, input().split()))\n for i in range(a - 2, a + 1):\n if 1 <= i <= H - 2:\n for j in range(b - 2, b + 1):\n if 1 <= j <= W - 2:\n D[(i, j)] += 1\nprint(((H - 2) * (W - 2) - len(D)))\nc = Counter(list(D.values()))\nfor i in range(1, 10):\n print((c.get(i, 0)))\n"} +{"fast_code_id":"3110d842874c6046e398970dba4b72c45d15cd4aacc9697a99da0418434cc31f","fast_id":"p02657_3110d842874c6046e398970dba4b72c45d15cd4aacc9697a99da0418434cc31f","language":"python","measured_fast_code_id":"3110d842874c6046e398970dba4b72c45d15cd4aacc9697a99da0418434cc31f","measured_slow_code_id":"b1697d82d892b2441ee34ccc53dde64479bc475c073927fdbb5370e4d2f6f2a7","measurement_metric":"cpu_instruction_count","pair_id":"python_681cad52dc017088113f2c2d","problem_id":"p02657","slow_code_id":"b1697d82d892b2441ee34ccc53dde64479bc475c073927fdbb5370e4d2f6f2a7","slow_id":"p02657_b1697d82d892b2441ee34ccc53dde64479bc475c073927fdbb5370e4d2f6f2a7","speedup":2.217937702208235,"stratum":"2-4","sampling_key":"2b54c448f5f6e6184b0ce92989f1f416b5432926ba9e492c2b5aad617ce0c140","slow_code":"a, b = list(map(float, input().split()))\nimport math\n\na = int(math.floor(a))\nb = int(math.floor(b * 100))\nc = math.floor(a * b / 100)\nprint(c)\n","fast_code":"print((eval(input().replace(\" \", \"*\"))))\n"} +{"fast_code_id":"2819d7c8cc00872606043ee4fddb28de6790a7f383b7df0acb3abd65bc17e61a","fast_id":"p04019_13aaad38fd67705d7e42e1b96c63f107570c0e957db5018cd448de424e044d69","language":"python","measured_fast_code_id":"13aaad38fd67705d7e42e1b96c63f107570c0e957db5018cd448de424e044d69","measured_slow_code_id":"948826aa95725a2d7b656cdcdf166ae16f7a6d2351882b45f31328741761d57a","measurement_metric":"cpu_instruction_count","pair_id":"python_684cbd9d7550d343822776fd","problem_id":"p04019","slow_code_id":"948826aa95725a2d7b656cdcdf166ae16f7a6d2351882b45f31328741761d57a","slow_id":"p04019_948826aa95725a2d7b656cdcdf166ae16f7a6d2351882b45f31328741761d57a","speedup":3.795283678671744,"stratum":"2-4","sampling_key":"b05c7854296cd781da021d090a98a848c68eef2b215a6215d5d58352becefcd1","slow_code":"S = input().strip()\nC = {\"N\": 0, \"S\": 0, \"E\": 0, \"W\": 0}\nfor i in range(len(S)):\n C[S[i]] += 1\nif C[\"N\"] > 0 and C[\"S\"] > 0:\n if (C[\"E\"] > 0 and C[\"W\"] > 0) or (C[\"E\"] == 0 and C[\"W\"] == 0):\n print(\"Yes\")\n else:\n print(\"No\")\nelif C[\"N\"] == 0 and C[\"S\"] == 0:\n if (C[\"E\"] > 0 and C[\"W\"] > 0) or (C[\"E\"] == 0 and C[\"W\"] == 0):\n print(\"Yes\")\n else:\n print(\"No\")\nelse:\n print(\"No\")\n","fast_code":"def main():\n S = input().rstrip()\n flg = ((\"N\" in S) ^ (\"S\" in S) ^ 1) & ((\"E\" in S) ^ (\"W\" in S) ^ 1)\n print((\"Yes\" if flg else \"No\"))\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"5ced6e0b952d86ed809d917d485c647faa0cc370d7b4fdcc6c1cd87683767c80","fast_id":"p02556_7896bc590cfdf788519614e85615135d8291cfa5c7b9f8a2aaf117c848422c17","language":"python","measured_fast_code_id":"7896bc590cfdf788519614e85615135d8291cfa5c7b9f8a2aaf117c848422c17","measured_slow_code_id":"05dfc996f7e3842463d6cd57d02877a281066db95acd7311507e26b5daabff76","measurement_metric":"cpu_instruction_count","pair_id":"python_68844ff491b617268b215b1f","problem_id":"p02556","slow_code_id":"05dfc996f7e3842463d6cd57d02877a281066db95acd7311507e26b5daabff76","slow_id":"p02556_05dfc996f7e3842463d6cd57d02877a281066db95acd7311507e26b5daabff76","speedup":3.119564157461502,"stratum":"2-4","sampling_key":"5ac5498484ddb848166d03c13ccdb6a4340ce47dfae067914f0141ccf32ecd4b","slow_code":"N = int(eval(input()))\n\n\ndef dist(A, B):\n return abs(A[0] - B[0]) + abs(A[1] - B[1])\n\n\nXY = [tuple(map(int, input().split())) for _ in range(N)]\nINF = -(10**10)\nans = 0\nfor O in [(INF, INF), (-INF, INF), (INF, -INF), (-INF, -INF)]:\n S = XY[0]\n for xy in XY:\n if dist(O, S) < dist(O, xy):\n S = xy\n O = S\n for xy in XY:\n if dist(O, S) < dist(O, xy):\n S = xy\n ans = max(ans, dist(O, S))\nprint(ans)\n","fast_code":"def main():\n point_count = int(eval(input()))\n sums = set()\n diffs = set()\n for _ in range(point_count):\n x, y = [int(x) for x in input().split()]\n sums.add(x + y)\n diffs.add(x - y)\n pat_sum = max(sums) - min(sums)\n pat_diff = max(diffs) - min(diffs)\n return max(pat_sum, pat_diff)\n\n\nif __name__ == \"__main__\":\n print((main()))\n"} +{"fast_code_id":"a9c37374f81204d4bfa0276115d13e5c0adca7fe6eb99f80ec27a41e8d33dc8e","fast_id":"p03713_a9c37374f81204d4bfa0276115d13e5c0adca7fe6eb99f80ec27a41e8d33dc8e","language":"python","measured_fast_code_id":"a9c37374f81204d4bfa0276115d13e5c0adca7fe6eb99f80ec27a41e8d33dc8e","measured_slow_code_id":"0693797c39d60eb7350d694d73bb29b82143b0a89c4b2e8fa8b67145d95dc8d0","measurement_metric":"cpu_instruction_count","pair_id":"python_68902345470de0316af3f3fb","problem_id":"p03713","slow_code_id":"0693797c39d60eb7350d694d73bb29b82143b0a89c4b2e8fa8b67145d95dc8d0","slow_id":"p03713_0693797c39d60eb7350d694d73bb29b82143b0a89c4b2e8fa8b67145d95dc8d0","speedup":7.784250698271554,"stratum":"4-8","sampling_key":"89abbb178e89372ed8ac78132466d6367eec0b186320d131b8767e8feeb9395c","slow_code":"def calc(H, W, ans):\n w0 = W // 2\n w1 = W - w0\n for h0 in range(1, H):\n Sa = h0 * W\n h1 = H - h0\n h2 = h1 // 2\n h3 = h1 - h2\n Sb1, Sc1 = h1 * w0, h1 * w1\n Sb2, Sc2 = h2 * W, h3 * W\n m1, _, M1 = sorted([Sa, Sb1, Sc1])\n m2, _, M2 = sorted([Sa, Sb2, Sc2])\n ans = min(ans, M1 - m1, M2 - m2)\n return ans\n\n\nH, W = list(map(int, input().split()))\nprint((calc(W, H, calc(H, W, H * W))))\n","fast_code":"h, w = list(map(int, input().split()))\nans = float(\"Inf\")\nif h % 3 == 0 or w % 3 == 0:\n print((0))\n exit()\nfor i in range(1, h):\n a = (h - i) * (w // 2)\n b = (h - i) * -(-w // 2)\n ans = min(ans, abs(max(i * w, a, b) - min(i * w, a, b)))\nfor i in range(1, w):\n a = (w - i) * (h // 2)\n b = (w - i) * -(-h // 2)\n ans = min(ans, abs(max(i * h, a, b) - min(i * h, a, b)))\nprint((min(ans, h, w)))\n"} +{"fast_code_id":"6cf0fbae01df2d11f5ea1421c4f7d2610272c73db432d3cccb91a30ba12264af","fast_id":"p03147_7e8bf1c73619f52a92f199219e4ce04b3d4dd877ffbb5a7d41f0473776c1a7ae","language":"python","measured_fast_code_id":"7e8bf1c73619f52a92f199219e4ce04b3d4dd877ffbb5a7d41f0473776c1a7ae","measured_slow_code_id":"232a30a45b9984917ad37bb950a7a870c82450918c11dc8b73764555b059b604","measurement_metric":"cpu_instruction_count","pair_id":"python_68bd28566ef22dd53544674f","problem_id":"p03147","slow_code_id":"232a30a45b9984917ad37bb950a7a870c82450918c11dc8b73764555b059b604","slow_id":"p03147_232a30a45b9984917ad37bb950a7a870c82450918c11dc8b73764555b059b604","speedup":641.5920771450382,"stratum":"8+","sampling_key":"dee136c37c536fa4709d4f99109d70297262681e5eebca9945b5cef671b15626","slow_code":"import numpy as np\n\nn = int(eval(input()))\nh = np.array([0] + list(map(int, input().split())))\nr = 0\nwhile np.any(h > 0):\n r += np.sum(np.logical_and(h[1:] > 0, h[:-1] <= 0))\n h -= 1\nprint(r)\n","fast_code":"import sys\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef resolve():\n n = int(eval(input()))\n l = list(map(int, input().split()))\n ans = l[0]\n\n for i in range(len(l) - 1):\n ans += max(l[i + 1] - l[i], 0)\n print(ans)\n\n\nresolve()\n"} +{"fast_code_id":"f7b7ddd2b42f6973d7aba8b61d872f27d79c463514ee1eb0b4c44ad11428b580","fast_id":"p02763_f7b7ddd2b42f6973d7aba8b61d872f27d79c463514ee1eb0b4c44ad11428b580","language":"python","measured_fast_code_id":"f7b7ddd2b42f6973d7aba8b61d872f27d79c463514ee1eb0b4c44ad11428b580","measured_slow_code_id":"f48f6f3e37812c17b5337b9141da770a977eb3ae11af352f28286963282fd6ed","measurement_metric":"cpu_instruction_count","pair_id":"python_6900582c185bf220d68269be","problem_id":"p02763","slow_code_id":"4fa4a65e4a0df3861053325cb01fa333b2482712b297bcf1214920d237936687","slow_id":"p02763_f48f6f3e37812c17b5337b9141da770a977eb3ae11af352f28286963282fd6ed","speedup":4.001277108738945,"stratum":"4-8","sampling_key":"474d12ddef195aaa8edb6fabd2e4f46f5c7a073eafc07cb35a788ab5c2dfb39d","slow_code":"import sys\n\ninput = sys.stdin.readline\n\n\nclass Bit:\n def __init__(self, n):\n self.n = n\n self.tree = [0] * (n + 1)\n self.el = [0] * (n + 1)\n self.depth = n.bit_length() - 1\n\n def sum(self, i):\n s = 0\n i -= 1\n while i >= 0:\n s += self.tree[i]\n i = (i & (i + 1)) - 1\n return s\n\n def add(self, i, x):\n self.el[i] += x\n while i < self.n:\n self.tree[i] += x\n i |= i + 1\n\n def get(self, i, j=None):\n if j is None:\n return self.el[i]\n if i == 0:\n return self.sum(j)\n return self.sum(j) - self.sum(i)\n\n def lower_bound(self, x, equal=False):\n sum_ = 0\n pos = -1\n if not equal:\n for i in range(self.depth, -1, -1):\n k = pos + (1 << i)\n if k < self.n and sum_ + self.tree[k] < x:\n sum_ += self.tree[k]\n pos += 1 << i\n if equal:\n for i in range(self.depth, -1, -1):\n k = pos + (1 << i)\n if k < self.n and sum_ + self.tree[k] <= x:\n sum_ += self.tree[k]\n pos += 1 << i\n return pos, sum_\n\n def __getitem__(self, s):\n return self.el[s]\n\n def __iter__(self):\n for s in self.el[: self.n]:\n yield s\n\n def __str__(self):\n text1 = \" \".join([\"element: \"] + list(map(str, self)))\n text2 = \" \".join(\n [\"cumsum(1-indexed): \"]\n + list(str(self.sum(i)) for i in range(1, self.n + 1))\n )\n return \"\\n\".join((text1, text2))\n\n\nimport string\n\nN = int(eval(input()))\nS = input().strip()\nQ = int(eval(input()))\nB = [Bit(N) for _ in range(26)]\nabc = string.ascii_lowercase\nabc2 = dict()\nfor i, s in enumerate(abc):\n abc2[s] = i\nfor i, s in enumerate(S):\n B[abc2[s]].add(i, 1)\nfor _ in range(Q):\n q = list(input().split())\n if q[0] == \"1\":\n a = int(q[1]) - 1\n b = q[2]\n for i in range(26):\n if B[i].el[a] == 1:\n B[i].add(a, -1)\n B[abc2[b]].add(a, 1)\n if q[0] == \"2\":\n a = int(q[1]) - 1\n b = int(q[2]) - 1\n res = 0\n for i in range(26):\n res += B[i].get(a, b + 1) > 0\n print(res)\n","fast_code":"import sys\n\nsys.setrecursionlimit(10**6)\nint1 = lambda x: int(x) - 1\np2D = lambda x: print(*x, sep=\"\\n\")\n\n\ndef II():\n return int(sys.stdin.readline())\n\n\ndef MI():\n return map(int, sys.stdin.readline().split())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\ndef LLI(rows_number):\n return [LI() for _ in range(rows_number)]\n\n\ndef SI():\n return sys.stdin.readline()[:-1]\n\n\nclass SegTree:\n def __init__(self, aa):\n n = 1 << (len(aa) - 1).bit_length()\n tree = [0] * (2 * n - 1)\n tree[n - 1 : n - 1 + len(aa)] = aa\n for i in range(n - 2, -1, -1):\n tree[i] = tree[2 * i + 1] | tree[2 * i + 2]\n self.tree = tree\n self.n = n\n\n def update(self, i, a):\n i = self.n - 1 + i\n self.tree[i] = a\n while i:\n i = (i - 1) // 2\n self.tree[i] = self.tree[2 * i + 1] | self.tree[2 * i + 2]\n\n def SegOr(self, l, r, i=0, segl=0, segr=-1):\n if segr == -1:\n segr = self.n\n if r <= segl or segr <= l:\n return 0\n if l <= segl and segr <= r:\n return self.tree[i]\n m = (segl + segr) // 2\n return self.SegOr(l, r, 2 * i + 1, segl, m) | self.SegOr(\n l, r, 2 * i + 2, m, segr\n )\n\n\ndef main():\n code = lambda c: ord(c) - ord(\"a\")\n popcnt = lambda x: bin(x).count(\"1\")\n n = II()\n s = SI()\n aa = [1 << code(c) for c in s]\n st = SegTree(aa)\n q = II()\n for _ in range(q):\n op, x, y = SI().split()\n if op == \"1\":\n i = int(x) - 1\n st.update(i, 1 << code(y))\n else:\n l, r = int(x) - 1, int(y)\n print(popcnt(st.SegOr(l, r)))\n\n\nmain()\n"} +{"fast_code_id":"055ea82692caf532cba37fabe5475d1f818a9782fbb3ecb3849a6afaa05f3056","fast_id":"p03556_055ea82692caf532cba37fabe5475d1f818a9782fbb3ecb3849a6afaa05f3056","language":"python","measured_fast_code_id":"055ea82692caf532cba37fabe5475d1f818a9782fbb3ecb3849a6afaa05f3056","measured_slow_code_id":"0a7e4d0d2a2f952e55fd143eaac4cee93ae161ecb36118d4ab495d4a4bf6dac9","measurement_metric":"cpu_instruction_count","pair_id":"python_6900d816cb18e001664370d8","problem_id":"p03556","slow_code_id":"0a7e4d0d2a2f952e55fd143eaac4cee93ae161ecb36118d4ab495d4a4bf6dac9","slow_id":"p03556_0a7e4d0d2a2f952e55fd143eaac4cee93ae161ecb36118d4ab495d4a4bf6dac9","speedup":1785.894402670515,"stratum":"8+","sampling_key":"337beeb95098bf680118e763aec8fc9b75a28580663919a90a3d55c2e0c94cd1","slow_code":"import numpy as np\n\nN = int(eval(input()))\nmp = int(np.sqrt(N))\nprint((mp**2))\n","fast_code":"import math\n\ni = int(eval(input()))\nr = math.sqrt(i)\nir = int(r)\nprint((ir * ir))\n"} +{"fast_code_id":"e017ce0a742d01e8892c0abe2d44772f6ec0cff2cca270665ae25ecd66f25668","fast_id":"p03972_e017ce0a742d01e8892c0abe2d44772f6ec0cff2cca270665ae25ecd66f25668","language":"python","measured_fast_code_id":"e017ce0a742d01e8892c0abe2d44772f6ec0cff2cca270665ae25ecd66f25668","measured_slow_code_id":"993994cc2c3d5ff5afe18fa6ff8857111da3e3e71c173a82b9a78d6f98107ea1","measurement_metric":"cpu_instruction_count","pair_id":"python_6970a7a4936c8eca4369ce04","problem_id":"p03972","slow_code_id":"993994cc2c3d5ff5afe18fa6ff8857111da3e3e71c173a82b9a78d6f98107ea1","slow_id":"p03972_993994cc2c3d5ff5afe18fa6ff8857111da3e3e71c173a82b9a78d6f98107ea1","speedup":6.818175977959753,"stratum":"4-8","sampling_key":"39be61b0ae7476fa6d5249892b34bf1d5cef8b9c4bc0e682cf829435c0c77a67","slow_code":"W, H = list(map(int, input().split()))\nP = [int(eval(input())) for i in range(W)]\nQ = [int(eval(input())) for j in range(H)]\nP.append(float(\"inf\"))\nQ.append(float(\"inf\"))\nP.sort(reverse=True)\nQ.sort(reverse=True)\nnow_W = W + 1\nnow_H = H + 1\ncost = 0\nwhile now_W > 1 or now_H > 1:\n if P[-1] < Q[-1]:\n cost += P.pop() * now_H\n now_W -= 1\n elif Q[-1] < P[-1]:\n cost += Q.pop() * now_W\n now_H -= 1\n elif P[-1] == Q[-1]:\n if now_W <= now_H:\n cost += Q.pop() * now_W\n now_H -= 1\n elif now_W > now_H:\n cost += P.pop() * now_H\n now_W -= 1\nprint(cost)\n","fast_code":"w, h, *L = list(map(int, open(0).read().split()))\nP = L[:w]\nQ = [-qj for qj in L[w:]]\nx, y, ans = w, h, 0\nfor c in sorted(P + Q, key=abs):\n if c > 0:\n if x:\n ans += c * (y + 1)\n x -= 1\n else:\n if y:\n ans -= c * (x + 1)\n y -= 1\nprint(ans)\n"} +{"fast_code_id":"d4ae0ad416990f5d9c42e6d7199d39c5413ae17b219868252d45844df14acc05","fast_id":"p03244_d4ae0ad416990f5d9c42e6d7199d39c5413ae17b219868252d45844df14acc05","language":"python","measured_fast_code_id":"d4ae0ad416990f5d9c42e6d7199d39c5413ae17b219868252d45844df14acc05","measured_slow_code_id":"100838eb35611188aaa0e6508544517c0abf47ad6e005b321a85725c0e9840dd","measurement_metric":"cpu_instruction_count","pair_id":"python_69a21b555afb4968b7616230","problem_id":"p03244","slow_code_id":"a39b059af4b03221115ad0dd54a76e5f423fd6c8173a18ffdbed4e08ab13360c","slow_id":"p03244_100838eb35611188aaa0e6508544517c0abf47ad6e005b321a85725c0e9840dd","speedup":220.20111757151173,"stratum":"8+","sampling_key":"21af5519c103972af80914a5aa089128ea71624384e7caaa8c332a394868c37f","slow_code":"import numpy as np\n\neven = np.zeros(100001, dtype=int)\nodd = np.zeros(100001, dtype=int)\nn = int(eval(input()))\nv = list(map(int, input().split()))\nfor i in range(n):\n if i % 2 == 0:\n even[v[i]] += 1\n else:\n odd[v[i]] += 1\ne1 = even.argmax()\ne1n = even.max()\no1 = odd.argmax()\no1n = odd.max()\n\nif e1 == o1:\n e2n = np.sort(even)[-2]\n o2n = np.sort(odd)[-2]\n\n print((min(n - e1n - o2n, n - e2n - o1n)))\nelse:\n print((n - e1n - o1n))\n","fast_code":"from collections import *\n\nN = int(eval(input()))\nv_list = input().split()\nif len(set(v_list)) == 1:\n print((len(v_list) // 2))\n exit()\nv1_count_list = Counter(v_list[::2]).most_common()\nv2_count_list = Counter(v_list[1::2]).most_common()\nif v1_count_list[0][0] != v2_count_list[0][0]:\n leave_value = v1_count_list[0][1] + v2_count_list[0][1]\nelse:\n leave_value = max(\n v1_count_list[1][1] + v2_count_list[0][1],\n v1_count_list[0][1] + v2_count_list[1][1],\n )\nprint((len(v_list) - leave_value))\n"} +{"fast_code_id":"14d062ba1fdfedcb7da5501ac08db70378afe95bb6ccb7773b4c5b572d572918","fast_id":"p02642_14d062ba1fdfedcb7da5501ac08db70378afe95bb6ccb7773b4c5b572d572918","language":"python","measured_fast_code_id":"14d062ba1fdfedcb7da5501ac08db70378afe95bb6ccb7773b4c5b572d572918","measured_slow_code_id":"812f58e5e74c625583dfedc46d01e059e3015c6446ce2676cf4582b4912570b5","measurement_metric":"cpu_instruction_count","pair_id":"python_69a57c8c6d5e45ca5a89770c","problem_id":"p02642","slow_code_id":"812f58e5e74c625583dfedc46d01e059e3015c6446ce2676cf4582b4912570b5","slow_id":"p02642_812f58e5e74c625583dfedc46d01e059e3015c6446ce2676cf4582b4912570b5","speedup":3.8746231475279247,"stratum":"2-4","sampling_key":"0cc03f2f07ec123c87d3327eba24fdbd0dfaa10ddf0c8841667c398b763dd953","slow_code":"n = int(eval(input()))\na = [int(i) for i in input().split()]\nmax_a = max(a)\nflag = [True for i in range(max_a + 1)]\ndup = set()\nfor i in range(n):\n if a[i] in dup:\n flag[a[i]] = False\n else:\n dup.add(a[i])\n for j in range(2 * a[i], max_a + 1, a[i]):\n flag[j] = False\nans = 0\nfor i in a:\n ans += flag[i]\nprint(ans)\n","fast_code":"n = int(eval(input()))\na = list(map(int, input().split()))\na.sort()\nmax_num = a[-1] + 1\ncnt = [0] * (max_num)\na.sort()\nans = 0\nfor i in a:\n cnt[i] += 1\na = set(a)\nfor k in a:\n for l in range(k * 2, (max_num), k):\n cnt[l] += 1\nfor m in a:\n if cnt[m] == 1:\n ans += 1\nprint(ans)\n"} +{"fast_code_id":"4e8b27c908a06d77f811f3d9df5ae88d5e5e752bd4b576ed8b8896184adeda2d","fast_id":"p02641_4e8b27c908a06d77f811f3d9df5ae88d5e5e752bd4b576ed8b8896184adeda2d","language":"python","measured_fast_code_id":"4e8b27c908a06d77f811f3d9df5ae88d5e5e752bd4b576ed8b8896184adeda2d","measured_slow_code_id":"56a803f01b0149391407a67301955076fc165a7ad3ad3f8f8a9f51ab5d8af60e","measurement_metric":"cpu_instruction_count","pair_id":"python_69ac5bfed071010088a37c33","problem_id":"p02641","slow_code_id":"85cbb5049fb6ba315c1cc49d08aa7371cf037161b52bac8a421580f3486b7f72","slow_id":"p02641_56a803f01b0149391407a67301955076fc165a7ad3ad3f8f8a9f51ab5d8af60e","speedup":2.0406498541957063,"stratum":"2-4","sampling_key":"92aea02bbbc0b1d54efabdfda9b7a511851ab13d9d238111ef6df026f79575f3","slow_code":"x, n = list(map(int, input().split()))\nif n == 0:\n print(x)\n exit()\narr = list(map(int, input().split()))\narr2 = []\narr3 = []\nfor i in range(-50, 110):\n if not i in arr:\n arr2.append(i)\n arr3.append(abs(x - i))\nn2 = min([i for i, v in enumerate(arr3) if v == min(arr3)])\nprint((arr2[n2]))\n","fast_code":"x, n = list(map(int, input().split(\" \")))\ndiff = x\nresult = 0\nif n != 0:\n ls = list(map(int, input().split(\" \")))\n ls_remaind = []\n for i in range(1, 102):\n if i not in ls:\n ls_remaind.append(i)\n for j in ls_remaind:\n if abs(x - j) == diff:\n result = min(result, j)\n elif abs(x - j) < diff:\n diff = abs(x - j)\n result = j\nelse:\n result = x\nprint(result)\n"} +{"fast_code_id":"7dc27a09ef2c9b461fbcb4fe978ad658f28d48d6f3e4857cd289415097f687c2","fast_id":"p02848_7dc27a09ef2c9b461fbcb4fe978ad658f28d48d6f3e4857cd289415097f687c2","language":"python","measured_fast_code_id":"7dc27a09ef2c9b461fbcb4fe978ad658f28d48d6f3e4857cd289415097f687c2","measured_slow_code_id":"28ec796f8eb56af2fabfccd11148299be75fe687af7fbeca1341511e952857a1","measurement_metric":"cpu_instruction_count","pair_id":"python_6a479de71e433ba5768f5d90","problem_id":"p02848","slow_code_id":"4e03a4428b1aa0327e66a8cb999ff15a637eaad3acbd2fd2d565e47714f697dd","slow_id":"p02848_28ec796f8eb56af2fabfccd11148299be75fe687af7fbeca1341511e952857a1","speedup":2.5111125685704003,"stratum":"2-4","sampling_key":"1af1e90071141bf6c118c3d445518a3826c435962393d9941fc3866340e378ac","slow_code":"import sys\nimport math\nimport collections\nimport itertools\nfrom inspect import currentframe\n\nINF = 10**10\nMOD = 10**9 + 7\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef gcd(x, y):\n return y if x % y == 0 else gcd(y, x % y)\n\n\ndef lcm(x, y):\n return (x * y) // gcd(x, y)\n\n\ndef I():\n return int(input())\n\n\ndef MI():\n return map(int, input().split())\n\n\ndef LI():\n return [int(x) for x in input().split()]\n\n\ndef RI(N):\n return [int(input()) for _ in range(N)]\n\n\ndef LRI(N):\n return [[int(x) for x in input().split()] for _ in range(N)]\n\n\ndef chkprint(*args):\n names = {id(v): k for k, v in currentframe().f_back.f_locals.items()}\n print(\", \".join(names.get(id(arg), \"???\") + \" = \" + repr(arg) for arg in args))\n\n\nN = I()\nS = input()\nalp = [\n \"A\",\n \"B\",\n \"C\",\n \"D\",\n \"E\",\n \"F\",\n \"G\",\n \"H\",\n \"I\",\n \"J\",\n \"K\",\n \"L\",\n \"M\",\n \"N\",\n \"O\",\n \"P\",\n \"Q\",\n \"R\",\n \"S\",\n \"T\",\n \"U\",\n \"V\",\n \"W\",\n \"X\",\n \"Y\",\n \"Z\",\n]\nfor s in S:\n print(alp[(alp.index(s) + N) % 26], end=\"\")\n","fast_code":"N = int(input())\nS = input()\nfor s in S:\n ans = chr((ord(s) - ord(\"A\") + N) % 26 + ord(\"A\"))\n print(ans, end=\"\")\n"} +{"fast_code_id":"16771a04e6276b491192dc984b7d0363d20dc7ef3d6fad47bf439b11ebe5f507","fast_id":"p03775_16771a04e6276b491192dc984b7d0363d20dc7ef3d6fad47bf439b11ebe5f507","language":"python","measured_fast_code_id":"16771a04e6276b491192dc984b7d0363d20dc7ef3d6fad47bf439b11ebe5f507","measured_slow_code_id":"1fcdee0cf9f26ff44998480a2c5fd43e6576ee1e9f08733d502a79c33e3e20a7","measurement_metric":"cpu_instruction_count","pair_id":"python_6af5ed1b4fac35a2d005bb0e","problem_id":"p03775","slow_code_id":"1fcdee0cf9f26ff44998480a2c5fd43e6576ee1e9f08733d502a79c33e3e20a7","slow_id":"p03775_1fcdee0cf9f26ff44998480a2c5fd43e6576ee1e9f08733d502a79c33e3e20a7","speedup":3.289527673813855,"stratum":"2-4","sampling_key":"1622dd44654158055dd845763a6f6eb8e48136729cafeeb0b5de3c6f7a46b34a","slow_code":"from math import sqrt\n\nN = int(eval(input()))\nn = int(sqrt(N)) + 10\n\n\ndef f(A, B):\n a = len(str(A))\n b = len(str(B))\n return max(a, b)\n\n\nans = 10**10\nfor i in range(1, n):\n if (N // i) * i == N:\n ans = min(ans, f(i, N // i))\nprint(ans)\n","fast_code":"n = int(eval(input()))\nif n == 6983776800:\n print((5))\n exit()\n\n\ndef prime_factorize(n):\n a = []\n while n % 2 == 0:\n a.append(2)\n n //= 2\n f = 3\n while f**2 <= n:\n if n % f == 0:\n a.append(f)\n n //= f\n else:\n f += 2\n if n != 1:\n a.append(n)\n return a\n\n\nF = prime_factorize(n)\nA, B = 1, 1\nfor i in F[::-1]:\n if A <= B:\n A *= i\n else:\n B *= i\nprint((max(len(str(A)), len(str(B)))))\n"} +{"fast_code_id":"67612659d343df45b96738503f23033fa5569ad14e1a7341ab06ca1c5e5a8d4e","fast_id":"p02934_67612659d343df45b96738503f23033fa5569ad14e1a7341ab06ca1c5e5a8d4e","language":"python","measured_fast_code_id":"67612659d343df45b96738503f23033fa5569ad14e1a7341ab06ca1c5e5a8d4e","measured_slow_code_id":"60cac70fa0810c2893d2009a00d5b734023fa86b7674974a1bd139ed2b0fd20e","measurement_metric":"cpu_instruction_count","pair_id":"python_6b0c51de16670b9f89987e5b","problem_id":"p02934","slow_code_id":"60cac70fa0810c2893d2009a00d5b734023fa86b7674974a1bd139ed2b0fd20e","slow_id":"p02934_60cac70fa0810c2893d2009a00d5b734023fa86b7674974a1bd139ed2b0fd20e","speedup":951.9407097414071,"stratum":"8+","sampling_key":"1552767acf98a6332146afabb815ae8b9047f2d2b74bddd71de633d45289ad71","slow_code":"import sys\n\ninput = sys.stdin.readline\nsys.setrecursionlimit(10**7)\nimport numpy as np\n\nN = int(eval(input()))\nA = np.array(input().split(), np.int32)\nanswer = 1 / (1 / A).sum()\nprint(answer)\n","fast_code":"n = int(eval(input()))\na = list(map(int, input().split()))\nt = 0\nfor i in range(n):\n t = t + 1 / a[i]\nans = 1 / t\nprint(ans)\n"} +{"fast_code_id":"da439b42fe4cab43135da3d8a37ba8eafda74b0df42deaad78f5eb8c8f40dd4e","fast_id":"p03649_da439b42fe4cab43135da3d8a37ba8eafda74b0df42deaad78f5eb8c8f40dd4e","language":"python","measured_fast_code_id":"da439b42fe4cab43135da3d8a37ba8eafda74b0df42deaad78f5eb8c8f40dd4e","measured_slow_code_id":"7802cf9e83571cee9bec8533b955c7050920fb8e58d892c4118c792371ce1f89","measurement_metric":"cpu_instruction_count","pair_id":"python_6b298efcec66cdb2e0cc0cc8","problem_id":"p03649","slow_code_id":"e4305a239f9ea2717f70ed35fb3cc27a2302b00f0e1b22d9b7c48daa06061a76","slow_id":"p03649_7802cf9e83571cee9bec8533b955c7050920fb8e58d892c4118c792371ce1f89","speedup":38.80890525572216,"stratum":"8+","sampling_key":"113207fdab1063f6d3047bd6eecfa5002f221bd9893963cfe1ff19867eed7d80","slow_code":"N = int(eval(input()))\nA = list(map(int, input().split()))\n\n\ndef is_possible(C):\n res = 0\n for x in A:\n if x + C - N >= 0:\n res += (x + C - N) // (N + 1) + 1\n\n return int(res <= C)\n\n\nl = 0\nr = 10**30\nwhile r - l > 1:\n M = (l + r) // 2\n if is_possible(M) > 0:\n r = M\n else:\n l = M\nfor i in range(10**5, -1, -1):\n if is_possible(r - i):\n print((r - i))\n break\n","fast_code":"N = int(eval(input()))\nA = list(map(int, input().split()))\nans = 0\nwhile any([a > N - 1 for a in A]):\n A.sort()\n d = A[-1] - (N - 1)\n k = -(-d // N)\n ans += k\n A[-1] -= k * N\n for i in range(N - 1):\n A[i] += k\nprint(ans)\n"} +{"fast_code_id":"925a90965952d07731bd01b01ce659b8f80e38b52ed1f2948136c1fb852a8ede","fast_id":"p02699_925a90965952d07731bd01b01ce659b8f80e38b52ed1f2948136c1fb852a8ede","language":"python","measured_fast_code_id":"925a90965952d07731bd01b01ce659b8f80e38b52ed1f2948136c1fb852a8ede","measured_slow_code_id":"f2cc4bf0fe7fb5f3b139743ef8c168fecc1b7ec24219170b0370aa9ddc4eb707","measurement_metric":"cpu_instruction_count","pair_id":"python_6b68b4d3faae34f2569a7654","problem_id":"p02699","slow_code_id":"bf5eea10074c63eaba5bcd155494237aaf0b2185b148b7614e311e92f7bef084","slow_id":"p02699_f2cc4bf0fe7fb5f3b139743ef8c168fecc1b7ec24219170b0370aa9ddc4eb707","speedup":2.6761935764082745,"stratum":"2-4","sampling_key":"e537aa6180c271668a8916845c619de27bd1ff51903effeb26aa2257935a385c","slow_code":"import sys\nimport math\nfrom bisect import bisect_right as br\nfrom bisect import bisect_left as bl\n\nsys.setrecursionlimit(2147483647)\nfrom heapq import heappush, heappop, heappushpop\nfrom collections import defaultdict\nfrom itertools import accumulate\nfrom collections import Counter\nfrom collections import deque\nfrom operator import itemgetter\nfrom itertools import permutations\n\nmod = 10**9 + 7\ninf = float(\"inf\")\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\ns, w = LI()\nif s <= w:\n print(\"unsafe\")\nelse:\n print(\"safe\")\n","fast_code":"def issafe(S, W):\n if S > W:\n return \"safe\"\n return \"unsafe\"\n\n\nS, W = list(map(int, input().split()))\nprint((issafe(S, W)))\n"} +{"fast_code_id":"1c6500df6434b4b516268de2191bc284b12208aa6d004a63137b0accccbd60de","fast_id":"p02971_1c6500df6434b4b516268de2191bc284b12208aa6d004a63137b0accccbd60de","language":"python","measured_fast_code_id":"1c6500df6434b4b516268de2191bc284b12208aa6d004a63137b0accccbd60de","measured_slow_code_id":"e1cbade75788fa3b7538fe39880a19cbc511ed2429eaad2cbdc8cdff78f2a1df","measurement_metric":"cpu_instruction_count","pair_id":"python_6b89c9c56fc6ac6bbdb6f922","problem_id":"p02971","slow_code_id":"e1cbade75788fa3b7538fe39880a19cbc511ed2429eaad2cbdc8cdff78f2a1df","slow_id":"p02971_e1cbade75788fa3b7538fe39880a19cbc511ed2429eaad2cbdc8cdff78f2a1df","speedup":3.4490827028485165,"stratum":"2-4","sampling_key":"3d7016f385e9e51d1dde6d63b8cacac81fd76012f0d0a90520ebf3d50239ef8b","slow_code":"A = [int(eval(input())) for i in range(int(eval(input())))]\nB = sorted(A)\none = B[-1]\ntwo = B[-2]\nfor i in A:\n print((one if i != one else two))\n","fast_code":"import sys\n\nread = sys.stdin.read\nreadline = sys.stdin.readline\nreadlines = sys.stdin.readlines\n\n\ndef main():\n N, *A = list(map(int, read().split()))\n A_ = sorted(A)\n m = max(A)\n for a in A:\n if a == m:\n print((A_[-2]))\n else:\n print(m)\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"03b86cbfa76d7854336f621e0cbdf6c7c30ef10052ed51cb9103b8d7aaac613d","fast_id":"p00687_03b86cbfa76d7854336f621e0cbdf6c7c30ef10052ed51cb9103b8d7aaac613d","language":"python","measured_fast_code_id":"03b86cbfa76d7854336f621e0cbdf6c7c30ef10052ed51cb9103b8d7aaac613d","measured_slow_code_id":"6486ddf14964ef7aa6b8c7fbb5874210ea0777d2d49521051480fb0ab0da206b","measurement_metric":"cpu_instruction_count","pair_id":"python_6b931204348c225f7ad026ca","problem_id":"p00687","slow_code_id":"6486ddf14964ef7aa6b8c7fbb5874210ea0777d2d49521051480fb0ab0da206b","slow_id":"p00687_6486ddf14964ef7aa6b8c7fbb5874210ea0777d2d49521051480fb0ab0da206b","speedup":3.204618570475595,"stratum":"2-4","sampling_key":"34ddab28ba35973473d60d3317799c1604f3f42b0460266bf753abfaa1bc5421","slow_code":"while 1:\n n, a, b = list(map(int, input().split()))\n if n == a == b == 0:\n break\n c = 0\n d = [1] + [0] * 1000000\n for i in range(0, n + 1):\n if d[i]:\n if i + a <= n:\n d[i + a] = 1\n if i + b <= n:\n d[i + b] = 1\n else:\n c += 1\n print(c)\n","fast_code":"while 1:\n n, a, b = list(map(int, input().split()))\n if n == 0:\n break\n dp = [0] * (n + 1)\n if a < n + 1:\n dp[a] = 1\n if b < n + 1:\n dp[b] = 1\n for i in range(n + 1):\n if dp[i]:\n if i + a < n + 1:\n dp[i + a] = 1\n if i + b < n + 1:\n dp[i + b] = 1\n print(n - sum(dp))\n"} +{"fast_code_id":"22b0fda1bf6bb83ee2771c74c3b3ccba31b37a1226e9dd8738fbaca696b5c6c6","fast_id":"p03449_22b0fda1bf6bb83ee2771c74c3b3ccba31b37a1226e9dd8738fbaca696b5c6c6","language":"python","measured_fast_code_id":"22b0fda1bf6bb83ee2771c74c3b3ccba31b37a1226e9dd8738fbaca696b5c6c6","measured_slow_code_id":"ef6ef8b6058f8fe2ff3f6c515307d0adaccb7ef0774b4fc4ee42af36434cbe6d","measurement_metric":"cpu_instruction_count","pair_id":"python_6b9e92c2d50bcc2c3eb18f45","problem_id":"p03449","slow_code_id":"c9914409980530d0996d00d624d6ced5bcaa5e46404bf56c166db3c30c8b45e2","slow_id":"p03449_ef6ef8b6058f8fe2ff3f6c515307d0adaccb7ef0774b4fc4ee42af36434cbe6d","speedup":4.73634655995686,"stratum":"4-8","sampling_key":"3a1384759921cdad1cb913a75b7b63d7a606d18d537b033c6301352fc05267e0","slow_code":"def readInts():\n return list(map(int, input().split()))\n\n\ndef main():\n n = int(eval(input()))\n A = [readInts() for _ in range(2)]\n\n idx = 0\n\n ma_ = -1\n while idx < n:\n j = 0\n cnt = 0\n dist = 0\n k = 0\n while k <= idx:\n if cnt <= n:\n dist += A[j][k]\n cnt += 1\n else:\n break\n k += 1\n k -= 1\n\n if cnt <= n:\n j += 1\n\n dist += A[j][k]\n cnt += 1\n k += 1\n\n if cnt <= n:\n while k < n:\n if cnt <= n:\n\n dist += A[j][k]\n cnt += 1\n else:\n break\n k += 1\n idx += 1\n\n ma_ = max(ma_, dist)\n print(ma_)\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"N = int(eval(input()))\nA1 = list(map(int, input().split()))\nA2 = list(map(int, input().split()))\nans = 0\nfor i in range(N):\n ans = max(ans, sum(A1[0 : i + 1] + A2[i:]))\nprint(ans)\n"} +{"fast_code_id":"d9ff430bc8ea080e528cda29abbbe9237aa0ef47408baa025510bd569541c292","fast_id":"p02595_1880fd82f65524cac8b0fecc254d1238de2e4b2094196bb4071dda25f20a686f","language":"python","measured_fast_code_id":"1880fd82f65524cac8b0fecc254d1238de2e4b2094196bb4071dda25f20a686f","measured_slow_code_id":"1559f276e022453eb8e8e92cd54d60648c4bba1cc009c4b0eef1eaf17b1ef72e","measurement_metric":"cpu_instruction_count","pair_id":"python_6ba0fdc388616825981c8915","problem_id":"p02595","slow_code_id":"1559f276e022453eb8e8e92cd54d60648c4bba1cc009c4b0eef1eaf17b1ef72e","slow_id":"p02595_1559f276e022453eb8e8e92cd54d60648c4bba1cc009c4b0eef1eaf17b1ef72e","speedup":4.340593865135875,"stratum":"4-8","sampling_key":"0295f5365991baf47c2b35f389f32f51852baf9adbaac1a96842e290fc770da4","slow_code":"from decimal import *\n\ngetcontext().prec = 50\nN, D = list(map(int, input().split()))\n\n\ndef distance(x1, x2, y1, y2):\n dx = x2 - x1\n dy = y2 - y1\n return (dx * dx + dy * dy).sqrt()\n\n\nX = [0] * N\nY = [0] * N\nfor i in range(N):\n X[i], Y[i] = list(map(Decimal, input().split()))\nans = 0\nfor i in range(N):\n if distance(0, X[i], 0, Y[i]) <= D:\n ans += 1\nprint(ans)\n","fast_code":"n, d = list(map(int, input().split()))\nans = 0\nd = d**2\nfor i in range(n):\n x, y = list(map(int, input().split()))\n if d >= x**2 + y**2:\n ans += 1\nprint(ans)\n"} +{"fast_code_id":"3201853fc23fca3c0ef8a612c9c8c3c65d41a44d108928dd70d7afa5b139702f","fast_id":"p02989_ea89f11dc11b95f6b4d47d4294c595dbbd77b5de19015b0460eeb188891e0b0b","language":"python","measured_fast_code_id":"ea89f11dc11b95f6b4d47d4294c595dbbd77b5de19015b0460eeb188891e0b0b","measured_slow_code_id":"bee7326f5d65117847c8daffc9f8e9e9508be71f70ad2064bdf47643f0632c7e","measurement_metric":"cpu_instruction_count","pair_id":"python_6c8e5e59ae56f17e85bdcbd6","problem_id":"p02989","slow_code_id":"bee7326f5d65117847c8daffc9f8e9e9508be71f70ad2064bdf47643f0632c7e","slow_id":"p02989_bee7326f5d65117847c8daffc9f8e9e9508be71f70ad2064bdf47643f0632c7e","speedup":7.1809535389374455,"stratum":"4-8","sampling_key":"f9e69ec9369ccfb4dff8b7d82a378affde7901ea4e6733e22af21b9d9fe9e7a5","slow_code":"from bisect import bisect_left\n\nn = int(eval(input()))\nd = list(map(int, input().split()))\nd = sorted(d)\nans = 0\nfor i in range(1, 10**5 + 1):\n p = bisect_left(d, i)\n ans += 1 if p == (n - p) else 0\nprint(ans)\n","fast_code":"from bisect import bisect_left\n\nN = int(eval(input()))\nd = list(map(int, input().split()))\nd.sort()\nto_take = N // 2\ncnt = 0\nfor x in range(d[0], d[-1] + 1):\n idx = bisect_left(d, x)\n\n if idx == to_take:\n cnt += 1\nprint(cnt)\n"} +{"fast_code_id":"7188df051969712755fc178404f6a0826e6bb59b46b3085137607e4095e3d546","fast_id":"p02628_7188df051969712755fc178404f6a0826e6bb59b46b3085137607e4095e3d546","language":"python","measured_fast_code_id":"7188df051969712755fc178404f6a0826e6bb59b46b3085137607e4095e3d546","measured_slow_code_id":"12fc0a6880b1658c0eaeba3aa7dd7893393cf5c052e40105869e3784eb2f1caa","measurement_metric":"cpu_instruction_count","pair_id":"python_6cc36ea307490b128675c1d7","problem_id":"p02628","slow_code_id":"12fc0a6880b1658c0eaeba3aa7dd7893393cf5c052e40105869e3784eb2f1caa","slow_id":"p02628_12fc0a6880b1658c0eaeba3aa7dd7893393cf5c052e40105869e3784eb2f1caa","speedup":44.88678460644107,"stratum":"8+","sampling_key":"37320ed4f9fa3c375bf62c860d7d47a17a7a9789861f7f3e3bb0b080c8b75a5a","slow_code":"N, K = list(map(int, input().split()))\nP = list(map(int, input().split()))\n\n\ndef bubblesort(l):\n for index in range(len(l) - 1, 0, -1):\n for low in range(index):\n if l[low] > l[low + 1]:\n tmp = l[low + 1]\n l[low + 1] = l[low]\n l[low] = tmp\n return l\n\n\nbubblesort(P)\nsum = 0\nfor i in range(K):\n sum = sum + P[i]\nprint(sum)\n","fast_code":"n, k = list(map(int, input().split()))\np = sorted(list(map(int, input().split())))\nprint((sum(p[:k])))\n"} +{"fast_code_id":"b7a50bcc6feb7fd034053a77ca216f3dcb531d4fe421cf97ea0ac41086db53f3","fast_id":"p03343_b7a50bcc6feb7fd034053a77ca216f3dcb531d4fe421cf97ea0ac41086db53f3","language":"python","measured_fast_code_id":"b7a50bcc6feb7fd034053a77ca216f3dcb531d4fe421cf97ea0ac41086db53f3","measured_slow_code_id":"99dd2d44382de196d10ae4f2c327d5c91d71e1646ed9d910338f34f2fd115024","measurement_metric":"cpu_instruction_count","pair_id":"python_6ce823fedef1a6c63721a3ac","problem_id":"p03343","slow_code_id":"99dd2d44382de196d10ae4f2c327d5c91d71e1646ed9d910338f34f2fd115024","slow_id":"p03343_99dd2d44382de196d10ae4f2c327d5c91d71e1646ed9d910338f34f2fd115024","speedup":7.348345823893066,"stratum":"4-8","sampling_key":"4c3a9158d593821c310dd468d49036a0b16d652ac6a36ed84d4f836264bb6b43","slow_code":"n, k, q = list(map(int, input().split()))\na = list(map(int, input().split()))\nans = 10**10\nfor i, y in enumerate(a):\n li = []\n l = 0\n cnd = []\n l_cnd = 0\n for j, x in enumerate(a + [-1]):\n if x < y:\n if l - k + 1 >= 0:\n li.sort()\n cnd += li[: l - k + 1]\n l_cnd += l - k + 1\n li = []\n l = 0\n else:\n li.append(x)\n l += 1\n if l_cnd >= q:\n cnd.sort()\n sub = cnd[q - 1] - y\n ans = min(ans, sub)\nprint(ans)\n","fast_code":"N, K, Q = list(map(int, input().split()))\nA = list(map(int, input().split()))\nD = set()\nfor i in range(N):\n D.add(A[i])\nD = list(D)\nans = float(\"inf\")\nfor Y in D:\n T = []\n tmp = []\n for j in range(N):\n if A[j] >= Y:\n tmp.append(A[j])\n else:\n if len(tmp) >= K:\n tmp = sorted(tmp)\n T += tmp[: len(tmp) - K + 1]\n tmp = []\n if len(tmp) >= K:\n tmp = sorted(tmp)\n T += tmp[: len(tmp) - K + 1]\n if len(T) >= Q:\n T = sorted(T)\n T = T[:Q]\n ans = min(ans, T[-1] - T[0])\nprint(ans)\n"} +{"fast_code_id":"6cfc2bb869afd4f65a971a78de62e8f0f38f425f40964192e72021fc744587e2","fast_id":"p02982_6cfc2bb869afd4f65a971a78de62e8f0f38f425f40964192e72021fc744587e2","language":"python","measured_fast_code_id":"6cfc2bb869afd4f65a971a78de62e8f0f38f425f40964192e72021fc744587e2","measured_slow_code_id":"3062723b648fda295737e748d4e0d5d9caa11a6c4d2d4160eb2931cf3e53df51","measurement_metric":"cpu_instruction_count","pair_id":"python_6d13a4ba056ed263da0fce1d","problem_id":"p02982","slow_code_id":"3062723b648fda295737e748d4e0d5d9caa11a6c4d2d4160eb2931cf3e53df51","slow_id":"p02982_3062723b648fda295737e748d4e0d5d9caa11a6c4d2d4160eb2931cf3e53df51","speedup":387.7899233322059,"stratum":"8+","sampling_key":"0407de76f99bc7f01404ca303244c65bc33177b22e8c57db52dd20fc9224cf62","slow_code":"import numpy as np\n\nN, D = list(map(int, input().split()))\nX = np.zeros((N, D))\nfor i in range(N):\n X[i][:] = list(map(int, input().split()))\nn = 0\nfor i in range(N):\n for j in range(i + 1, N):\n dist = np.linalg.norm(X[i] - X[j])\n if dist.is_integer():\n n += 1\nprint(n)\n","fast_code":"N, D = list(map(int, input().split()))\nX = [list(map(int, input().split())) for _ in range(N)]\n\n\ndef nasu(x, y):\n t = 0\n for i in range(D):\n t += (X[x][i] - X[y][i]) ** 2\n t **= 1 / 2\n if t == int(t):\n return 1\n else:\n return 0\n\n\nans = 0\nfor i in range(N - 1):\n for j in range(i + 1, N):\n ans += nasu(i, j)\nprint(ans)\n"} +{"fast_code_id":"5e5d45c0337c73356db47f95f31dfd7bbd6720881381254dc15fe8aaba30aafa","fast_id":"p02709_b6eb215539872bfb716d1e2bae3f194760f2526b7e15cf2967d55c38d6819dd3","language":"python","measured_fast_code_id":"b6eb215539872bfb716d1e2bae3f194760f2526b7e15cf2967d55c38d6819dd3","measured_slow_code_id":"3d838e07742b6038959605af2d3df1f36b7399126fc563b9a2c8f3bce236aaea","measurement_metric":"cpu_instruction_count","pair_id":"python_6d24a0adfd3e798275bf8365","problem_id":"p02709","slow_code_id":"aa98af4784f39634c1b1369b22ff40f05d4ea9461af1aad5cd1db169f1d8c6f4","slow_id":"p02709_3d838e07742b6038959605af2d3df1f36b7399126fc563b9a2c8f3bce236aaea","speedup":5.877460144985842,"stratum":"4-8","sampling_key":"8fd6cc86eee1fc832a5a4d594a638996b4b66ab866fd0928531e4b6c31573d32","slow_code":"import sys\nimport numpy as np\n\n\ndef f(n, a_):\n a = []\n for i, ai in enumerate(a_):\n a.append([1 + i, ai])\n a.sort(key=lambda x: x[1], reverse=True)\n dp = np.zeros((n + 1, n + 1), np.int64)\n dp[1, 1] = a[0][1] * (n - a[0][0])\n dp[1, 0] = a[0][1] * (a[0][0] - 1)\n for i in range(2, n + 1):\n dp[i, 0] = dp[i - 1, 0] + a[i - 1][1] * abs((a[i - 1][0] - 1 - (i - 1)))\n dp[i, i] = dp[i - 1, i - 1] + a[i - 1][1] * abs((n - a[i - 1][0] - (i - 1)))\n\n l = dp[i - 1, 1:i] + [\n a[i - 1][1] * abs((a[i - 1][0] - 1 - j)) for j in range(i - 2, -1, -1)\n ]\n\n r = dp[i - 1, : i - 1] + [\n a[i - 1][1] * abs((n - a[i - 1][0] - j)) for j in range(i - 1)\n ]\n dp[i, 1:i] = np.maximum(l, r)\n return max(dp[n])\n\n\nif __name__ == \"__main__\":\n input = sys.stdin.readline\n n = int(eval(input()))\n a_ = list(map(int, input().split()))\n print((f(n, a_)))\n","fast_code":"n = int(eval(input()))\na_ = list(map(int, input().split()))\na = [[i + 1, ai] for i, ai in enumerate(a_)]\na.sort(key=lambda x: x[1], reverse=True)\ndp = [[0] * (n + 1) for _ in range(n + 1)]\n\ndp[1][0] = a[0][1] * abs(a[0][0] - 1)\ndp[0][1] = a[0][1] * abs(a[0][0] - n)\nfor k in range(2, n + 1):\n for i in range(k + 1):\n j = k - i\n if j == 0:\n dp[i][j] = dp[i - 1][j] + a[i + j - 1][1] * abs(a[i + j - 1][0] - i)\n elif i == 0:\n dp[i][j] = dp[i][j - 1] + a[i + j - 1][1] * abs(n - a[i + j - 1][0] - j + 1)\n else:\n dp[i][j] = max(\n dp[i - 1][j] + a[i + j - 1][1] * abs(a[i + j - 1][0] - i),\n dp[i][j - 1] + a[i + j - 1][1] * abs(n - a[i + j - 1][0] - j + 1),\n )\nans = 0\nfor i in range(n + 1):\n ans = max(dp[i][n - i], ans)\nprint(ans)\n"} +{"fast_code_id":"d6b6871e692160af7f0d73d4608c82582507b0bb8a329d5b9f01972611b52bcc","fast_id":"p02417_d6b6871e692160af7f0d73d4608c82582507b0bb8a329d5b9f01972611b52bcc","language":"python","measured_fast_code_id":"d6b6871e692160af7f0d73d4608c82582507b0bb8a329d5b9f01972611b52bcc","measured_slow_code_id":"eba8ff064d91bd334752fa85969781cb8d76d5d6444c4537dbf886c48a0fb75f","measurement_metric":"cpu_instruction_count","pair_id":"python_6db60b2e61755fef4e8337ea","problem_id":"p02417","slow_code_id":"eba8ff064d91bd334752fa85969781cb8d76d5d6444c4537dbf886c48a0fb75f","slow_id":"p02417_eba8ff064d91bd334752fa85969781cb8d76d5d6444c4537dbf886c48a0fb75f","speedup":7.954515057800551,"stratum":"4-8","sampling_key":"6bf95e2286742270a10b3258bdd5d3124d36af786d34e7a9229f81a44a31f29d","slow_code":"a = [0] * 26\nw = \"abcdefghijklmnopqrstuvwxyz\"\ntry:\n while True:\n s = list(input().upper())\n for i in s:\n if i == \"A\":\n a[0] += 1\n elif i == \"B\":\n a[1] += 1\n elif i == \"C\":\n a[2] += 1\n elif i == \"D\":\n a[3] += 1\n elif i == \"E\":\n a[4] += 1\n elif i == \"F\":\n a[5] += 1\n elif i == \"G\":\n a[6] += 1\n elif i == \"H\":\n a[7] += 1\n elif i == \"I\":\n a[8] += 1\n elif i == \"J\":\n a[9] += 1\n elif i == \"K\":\n a[10] += 1\n elif i == \"L\":\n a[11] += 1\n elif i == \"M\":\n a[12] += 1\n elif i == \"N\":\n a[13] += 1\n elif i == \"O\":\n a[14] += 1\n elif i == \"P\":\n a[15] += 1\n elif i == \"Q\":\n a[16] += 1\n elif i == \"R\":\n a[17] += 1\n elif i == \"S\":\n a[18] += 1\n elif i == \"T\":\n a[19] += 1\n elif i == \"U\":\n a[20] += 1\n elif i == \"V\":\n a[21] += 1\n elif i == \"W\":\n a[22] += 1\n elif i == \"X\":\n a[23] += 1\n elif i == \"Y\":\n a[24] += 1\n elif i == \"Z\":\n a[25] += 1\nexcept EOFError:\n pass\nfor i in range(26):\n print(w[i : i + 1], \":\", str(a[i]))\n","fast_code":"alpha = \"abcdefghijklmnopqrstuvwxyz\"\ntext = \"\"\nwhile True:\n try:\n text += input().lower()\n except:\n break\n[print(\"{} : {}\".format(key, text.count(key))) for key in alpha]\n"} +{"fast_code_id":"13f6206637df99c95d420fdbd5f7932e864745dc78bd6e36e4163071448074c2","fast_id":"p02392_13f6206637df99c95d420fdbd5f7932e864745dc78bd6e36e4163071448074c2","language":"python","measured_fast_code_id":"13f6206637df99c95d420fdbd5f7932e864745dc78bd6e36e4163071448074c2","measured_slow_code_id":"de04487b5a08627844d61298f885965ab158d25d2bda51807fc27addaf67096b","measurement_metric":"cpu_instruction_count","pair_id":"python_6e5851838c5a974140e9de49","problem_id":"p02392","slow_code_id":"c3d3757a61b38da19ec84678b61451515bf53604660861738644c471aeb44260","slow_id":"p02392_de04487b5a08627844d61298f885965ab158d25d2bda51807fc27addaf67096b","speedup":11.03626647147546,"stratum":"8+","sampling_key":"0311b63b3c40cb361aedf7769cec2f8b719eb4904e0ac071877559300470bc5c","slow_code":"import copy\n\nn = list(map(int, input().split()))\nif n[0] < n[1] < n[2]:\n print(\"Yes\")\nelse:\n print(\"No\")\n","fast_code":"[a, b, c] = list(map(int, input().split()))\nprint(({True: \"Yes\", False: \"No\"}[a < b < c]))\n"} +{"fast_code_id":"41ca3f0e87b68277c575f3c05bc4d4d0a118974755d14ead187e1a329982fbac","fast_id":"p03261_41ca3f0e87b68277c575f3c05bc4d4d0a118974755d14ead187e1a329982fbac","language":"python","measured_fast_code_id":"41ca3f0e87b68277c575f3c05bc4d4d0a118974755d14ead187e1a329982fbac","measured_slow_code_id":"b8edf8bfe255e97eaa522659a47a80fed76af05861a73db78ecf2fbd1a8cfe7e","measurement_metric":"cpu_instruction_count","pair_id":"python_6e60766d9371b7926b9c5216","problem_id":"p03261","slow_code_id":"b8edf8bfe255e97eaa522659a47a80fed76af05861a73db78ecf2fbd1a8cfe7e","slow_id":"p03261_b8edf8bfe255e97eaa522659a47a80fed76af05861a73db78ecf2fbd1a8cfe7e","speedup":2.6560979234109707,"stratum":"2-4","sampling_key":"70bd65788b3bbb5c063a142e21872dc27aa695c3034865a833c97188f1070c0b","slow_code":"import sys\n\nstdin = sys.stdin\ninf = 1 << 60\nmod = 1000000007\nni = lambda: int(ns())\nnin = lambda y: [ni() for _ in range(y)]\nna = lambda: list(map(int, stdin.readline().split()))\nnan = lambda y: [na() for _ in range(y)]\nns = lambda: stdin.readline().rstrip()\nnsn = lambda y: [ns() for _ in range(y)]\nncl = lambda y: [list(ns()) for _ in range(y)]\nnas = lambda: stdin.readline().split()\nfrom collections import defaultdict\n\nN = ni()\nW = nsn(N)\nd = defaultdict(int)\nflag = True\nfor i in range(N):\n if i and W[i - 1][-1] != W[i][0]:\n flag = False\n if d[W[i]] >= 1:\n flag = False\n d[W[i]] += 1\nprint((\"Yes\" if flag else \"No\"))\n","fast_code":"l = open(0).readlines()[1:]\nprint((\"YNeos\"[any(a[-2] != b[0] * l.count(a) for a, b in zip(l, l[1:])) :: 2]))\n"} +{"fast_code_id":"c90ec233f5c2e155da8773eaeb4f4f89b96b046ea6e538b68f143636b57d580f","fast_id":"p02716_c90ec233f5c2e155da8773eaeb4f4f89b96b046ea6e538b68f143636b57d580f","language":"python","measured_fast_code_id":"c90ec233f5c2e155da8773eaeb4f4f89b96b046ea6e538b68f143636b57d580f","measured_slow_code_id":"ae97c447785b06d1f5812a68515622d5acc48349199365015b8b5c8a994bd13d","measurement_metric":"cpu_instruction_count","pair_id":"python_6e8ab845eeef54660e94bba0","problem_id":"p02716","slow_code_id":"1bcb5d76a0a5d68e7ba9b6269802f1acd8274da41797d4a3bfb682dbc9d2a825","slow_id":"p02716_ae97c447785b06d1f5812a68515622d5acc48349199365015b8b5c8a994bd13d","speedup":2.957957834297895,"stratum":"2-4","sampling_key":"430abe252967d20e099b04eb249327d66096e4215711cf24ad3025d4f4facacb","slow_code":"from heapq import heappush, heappop, heapify\nfrom collections import deque, defaultdict, Counter\nimport itertools\nfrom itertools import permutations, combinations, accumulate\nimport sys\nimport bisect\nimport string\nimport math\nimport time\n\n\ndef I():\n return int(eval(input()))\n\n\ndef S():\n return eval(input())\n\n\ndef MI():\n return list(map(int, input().split()))\n\n\ndef MS():\n return list(map(str, input().split()))\n\n\ndef LI():\n return [int(i) for i in input().split()]\n\n\ndef LI_():\n return [int(i) - 1 for i in input().split()]\n\n\ndef StoI():\n return [ord(i) - 97 for i in eval(input())]\n\n\ndef ItoS(nn):\n return chr(nn + 97)\n\n\ndef input():\n return sys.stdin.readline().rstrip()\n\n\nyn = {False: \"No\", True: \"Yes\"}\nYN = {False: \"NO\", True: \"YES\"}\nMOD = 10**9 + 7\ninf = float(\"inf\")\nIINF = 10**10\nl_alp = string.ascii_lowercase\nu_alp = string.ascii_uppercase\nts = time.time()\nsys.setrecursionlimit(10**6)\nnums = [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\"]\nshow_flg = False\n\n\ndef main():\n N = I()\n a = LI()\n dp = [0] * N\n dp[1] = max(a[0], a[1])\n c = a[0]\n for i in range(2, N):\n if i % 2 == 0:\n c += a[i]\n dp[i] = max(dp[i - 2] + a[i], dp[i - 1])\n else:\n dp[i] = max(dp[i - 2] + a[i], c)\n print((dp[-1]))\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"import sys\n\ninput = sys.stdin.readline\nn = int(eval(input()))\na = list(map(int, input().split()))\ndp = [0] * n\nc = a[0]\ndp[1] = max(a[0], a[1])\nfor i in range(2, n):\n if i % 2 == 0:\n c += a[i]\n dp[i] = max(dp[i - 2] + a[i], dp[i - 1])\n else:\n dp[i] = max(dp[i - 2] + a[i], c)\nprint((dp[-1]))\n"} +{"fast_code_id":"b861cafa9e56a6b56448ce2ee20ec17d8f37ee0dbb75a5e7dd10e82725810ec2","fast_id":"p03807_b861cafa9e56a6b56448ce2ee20ec17d8f37ee0dbb75a5e7dd10e82725810ec2","language":"python","measured_fast_code_id":"b861cafa9e56a6b56448ce2ee20ec17d8f37ee0dbb75a5e7dd10e82725810ec2","measured_slow_code_id":"8baca45625cd0c593d3689761edf66d3fece4f44f81b27a47e938cff4b898bb0","measurement_metric":"cpu_instruction_count","pair_id":"python_6f22d3cd477af88ba475d448","problem_id":"p03807","slow_code_id":"8baca45625cd0c593d3689761edf66d3fece4f44f81b27a47e938cff4b898bb0","slow_id":"p03807_8baca45625cd0c593d3689761edf66d3fece4f44f81b27a47e938cff4b898bb0","speedup":4.085162596504946,"stratum":"4-8","sampling_key":"30e03ef58c163d1419141b0f81f577f4fc7d731fca333d46d7f489dd09b20415","slow_code":"import sys\nimport bisect\nimport collections\nimport fractions\nimport heapq\n\n\ndef slove():\n input = sys.stdin.readline\n n = int(input().rstrip(\"\\n\"))\n a = list(map(int, input().rstrip(\"\\n\").split()))\n cnt = 0\n for i in range(n):\n if a[i] % 2 != 0:\n cnt += 1\n if cnt % 2 == 0:\n print(\"YES\")\n else:\n print(\"NO\")\n\n\nif __name__ == \"__main__\":\n slove()\n","fast_code":"N = int(eval(input()))\nA = list(map(int, input().split()))\nc = 0\nfor e in A:\n if e % 2 == 1:\n c += 1\nif c % 2 == 1:\n print(\"NO\")\nelse:\n print(\"YES\")\n"} +{"fast_code_id":"425ddb17dce624add9e7f091087552cb6b7a49b0d598f13282350396fcff2a4c","fast_id":"p02607_425ddb17dce624add9e7f091087552cb6b7a49b0d598f13282350396fcff2a4c","language":"python","measured_fast_code_id":"425ddb17dce624add9e7f091087552cb6b7a49b0d598f13282350396fcff2a4c","measured_slow_code_id":"80d5226038bdb32cf21a0b535cbd1c7092e4e8009586ccf346a6a6f305bc5b7d","measurement_metric":"cpu_instruction_count","pair_id":"python_6f60f367565c31b5e3b7fb5f","problem_id":"p02607","slow_code_id":"80d5226038bdb32cf21a0b535cbd1c7092e4e8009586ccf346a6a6f305bc5b7d","slow_id":"p02607_80d5226038bdb32cf21a0b535cbd1c7092e4e8009586ccf346a6a6f305bc5b7d","speedup":1106.55256875361,"stratum":"8+","sampling_key":"2c5aacd1d3b44ce61257dbab3e4a2a1f7383357bc19b68ea0a81337bd259cd52","slow_code":"import sys\nfrom collections import deque\nimport numpy as np\nimport math\n\nsys.setrecursionlimit(10**6)\n\n\ndef S():\n return sys.stdin.readline().rstrip()\n\n\ndef SL():\n return list(map(str, sys.stdin.readline().rstrip().split()))\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\ndef IL():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef Main():\n n = I()\n a = list(IL())\n c = 0\n for rep in range(0, n, 2):\n if a[rep] % 2:\n c += 1\n print(c)\n return\n\n\nif __name__ == \"__main__\":\n Main()\n","fast_code":"eval(input())\nprint(\n (\n len(\n [\n i\n for n, i in enumerate(map(int, input().split()), 1)\n if i % 2 == 1 and n % 2\n ]\n )\n )\n)\n"} +{"fast_code_id":"28fd6b5b96432fbebbbf8df390d378ed81b231b8e2ec65a8cc6786f802c9c09e","fast_id":"p02804_28fd6b5b96432fbebbbf8df390d378ed81b231b8e2ec65a8cc6786f802c9c09e","language":"python","measured_fast_code_id":"28fd6b5b96432fbebbbf8df390d378ed81b231b8e2ec65a8cc6786f802c9c09e","measured_slow_code_id":"7a118ce2764a5719ed366c9c22ffc653766a914f4a46e16d4f0cdc6623af51e1","measurement_metric":"cpu_instruction_count","pair_id":"python_6fbca4b7422d8464f8471018","problem_id":"p02804","slow_code_id":"7a118ce2764a5719ed366c9c22ffc653766a914f4a46e16d4f0cdc6623af51e1","slow_id":"p02804_7a118ce2764a5719ed366c9c22ffc653766a914f4a46e16d4f0cdc6623af51e1","speedup":7.58208278260213,"stratum":"4-8","sampling_key":"96e61cdf14c7425d1a1dd231c823f4b4d7cbcb04e2a60a9a282654fc644fedad","slow_code":"N_MAX = 10**6\nMOD = 10**9 + 7\nfac, finv, inv = [0] * N_MAX, [0] * N_MAX, [0] * N_MAX\n\n\ndef com_init():\n fac[0], fac[1] = 1, 1\n finv[0], finv[1] = 1, 1\n inv[1] = 1\n for i in range(2, N_MAX):\n fac[i] = fac[i - 1] * i % MOD\n inv[i] = MOD - inv[MOD % i] * (MOD // i) % MOD\n finv[i] = finv[i - 1] * inv[i] % MOD\n\n\ndef com(n, k):\n if n < k:\n return 0\n if n < 0 or k < 0:\n return 0\n return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD\n\n\nn, k = list(map(int, input().split()))\nal = list(map(int, input().split()))\ncom_init()\nal.sort()\nans_max = 0\nans_min = 0\nfor i, a in enumerate(al):\n ans_max += a * com(i, k - 1)\n ans_max %= MOD\n ans_min += a * com(n - 1 - i, k - 1)\n ans_min %= MOD\nprint(((ans_max - ans_min) % MOD))\n","fast_code":"n, k = list(map(int, input().split()))\nA = list(map(int, input().split()))\nmod = 10**9 + 7\nN = 10**5 + 50\nfac = [1] * (N + 1)\nfinv = [1] * (N + 1)\nfor i in range(N):\n fac[i + 1] = fac[i] * (i + 1) % mod\nfinv[-1] = pow(fac[-1], mod - 2, mod)\nfor i in reversed(list(range(N))):\n finv[i] = finv[i + 1] * (i + 1) % mod\n\n\ndef cmb1(n, r, mod):\n if r < 0 or r > n:\n return 0\n r = min(r, n - r)\n return fac[n] * finv[r] * finv[n - r] % mod\n\n\nA.sort()\nans = 0\nfor i, a in enumerate(A):\n M = n - 1 - i\n m = i\n if m >= 0:\n ans += a * cmb1(m, k - 1, mod)\n if M >= 0:\n ans -= a * cmb1(M, k - 1, mod)\nans %= mod\nprint(ans)\n"} +{"fast_code_id":"f9cafd9d8dce68b230b9b99bbd992611304ab19e259b30cf8ca6a1c29fa0d18e","fast_id":"p02417_f9cafd9d8dce68b230b9b99bbd992611304ab19e259b30cf8ca6a1c29fa0d18e","language":"python","measured_fast_code_id":"f9cafd9d8dce68b230b9b99bbd992611304ab19e259b30cf8ca6a1c29fa0d18e","measured_slow_code_id":"b4a2f6a100e7b36723d529bf95abed8f3c81365ab27266a35eaab453ba0653db","measurement_metric":"cpu_instruction_count","pair_id":"python_6fd9c773013c4fc22273abaf","problem_id":"p02417","slow_code_id":"b4a2f6a100e7b36723d529bf95abed8f3c81365ab27266a35eaab453ba0653db","slow_id":"p02417_b4a2f6a100e7b36723d529bf95abed8f3c81365ab27266a35eaab453ba0653db","speedup":7.943838561894085,"stratum":"4-8","sampling_key":"16fd1eb52dfb525f4d1d837813f233b9ff4245805f32b131fcd82a5bf5c6d3d1","slow_code":"from collections import Counter\nimport string\n\ncounter = Counter()\nwhile True:\n try:\n s = input().lower()\n counter += Counter(s)\n except EOFError:\n break\nfor c in string.ascii_lowercase:\n count = counter[c]\n print(f\"{c} : {count}\")\n","fast_code":"alpha = \"abcdefghijklmnopqrstuvwxyz\"\ntext = \"\"\nwhile True:\n try:\n text += input().lower()\n except:\n break\nfor key in alpha:\n print((\"{} : {}\".format(key, text.count(key))))\n"} +{"fast_code_id":"cfb6ff2bd6c408397a0d5a1bf802c6eba8bf6af84bc11fb1b6d6f747d0a4406c","fast_id":"p03317_cfb6ff2bd6c408397a0d5a1bf802c6eba8bf6af84bc11fb1b6d6f747d0a4406c","language":"python","measured_fast_code_id":"cfb6ff2bd6c408397a0d5a1bf802c6eba8bf6af84bc11fb1b6d6f747d0a4406c","measured_slow_code_id":"40f790b9daefbd644d38ba942e539d6681ed03212cd68a297874ac055d84131a","measurement_metric":"cpu_instruction_count","pair_id":"python_701291c562fcce7fb7e89bf4","problem_id":"p03317","slow_code_id":"40f790b9daefbd644d38ba942e539d6681ed03212cd68a297874ac055d84131a","slow_id":"p03317_40f790b9daefbd644d38ba942e539d6681ed03212cd68a297874ac055d84131a","speedup":6.740758398138692,"stratum":"4-8","sampling_key":"e64af21ea0182e7597ed8eea6c25a0d225610c53685017b17b7f2455175e5b45","slow_code":"import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time\n\nsys.setrecursionlimit(10**7)\ninf = 10**20\nmod = 10**9 + 7\n\n\ndef LI():\n return list(map(int, input().split()))\n\n\ndef I():\n return int(eval(input()))\n\n\ndef LS():\n return input().split()\n\n\ndef S():\n return eval(input())\n\n\ndef main():\n a, b = LI()\n l = LI()\n c = 1\n _b = b\n while True:\n if a <= _b:\n break\n else:\n _b += b - 1\n c += 1\n return c\n\n\nprint((main()))\n","fast_code":"N, K = [int(nk) for nk in input().split()]\nA = [int(a) for a in input().split()]\nif (N - 1) % (K - 1) == 0:\n print(((N - 1) // (K - 1)))\nelse:\n print((((N - 1) // (K - 1)) + 1))\n"} +{"fast_code_id":"f0395674e51675bd438b96a7f18fa9739566f756efa1ea79ea087d0b83a10e1f","fast_id":"p02959_f0395674e51675bd438b96a7f18fa9739566f756efa1ea79ea087d0b83a10e1f","language":"python","measured_fast_code_id":"f0395674e51675bd438b96a7f18fa9739566f756efa1ea79ea087d0b83a10e1f","measured_slow_code_id":"bbec5135de8ae25a58f3728f93973966763aa68a02b38478ffe3b521ca53b35a","measurement_metric":"cpu_instruction_count","pair_id":"python_703c31beaa8e25096b51c8a3","problem_id":"p02959","slow_code_id":"965de35434130d5fc575218190a738f566bab157fb864eeaa9ad161ab765410e","slow_id":"p02959_bbec5135de8ae25a58f3728f93973966763aa68a02b38478ffe3b521ca53b35a","speedup":13.2003395806158,"stratum":"8+","sampling_key":"ce10adc64d16ca60a5b7424b22558224f39bf2833b2049e16f1022984282f301","slow_code":"import sys\n\ninput = sys.stdin.readline\nimport numpy as np\n\n\ndef main():\n n = int(eval(input()))\n mob = np.array(list(map(int, input().split())), dtype=int)\n bra = np.array(list(map(int, input().split())), dtype=int)\n ans = 0\n for i in range(n):\n tmp1 = min(mob[i], bra[i])\n ans += tmp1\n tmp2 = min(mob[i + 1], bra[i] - tmp1)\n ans += tmp2\n mob[i + 1] -= tmp2\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"N = int(eval(input()))\nA = list(map(int, input().split()))\nB = list(map(int, input().split()))\nans = 0\nfor i in range(N):\n if i % 2 == 0:\n if A[i // 2] >= B[i // 2]:\n A[i // 2] -= B[i // 2]\n ans += B[i // 2]\n B[i // 2] = 0\n else:\n B[i // 2] -= A[i // 2]\n ans += A[i // 2]\n A[i // 2] = 0\n if A[i // 2 + 1] >= B[i // 2]:\n A[i // 2 + 1] -= B[i // 2]\n ans += B[i // 2]\n B[i // 2] = 0\n else:\n B[i // 2] -= A[i // 2 + 1]\n ans += A[i // 2 + 1]\n A[i // 2 + 1] = 0\n else:\n if A[N - i // 2] >= B[N - i // 2 - 1]:\n A[N - i // 2] -= B[N - i // 2 - 1]\n ans += B[N - i // 2 - 1]\n B[N - i // 2 - 1] = 0\n else:\n B[N - i // 2 - 1] -= A[N - i // 2]\n ans += A[N - i // 2]\n A[N - i // 2] = 0\n if A[N - i // 2 - 1] >= B[N - i // 2 - 1]:\n A[N - i // 2 - 1] -= B[N - i // 2 - 1]\n ans += B[N - i // 2 - 1]\n B[N - i // 2 - 1] = 0\n else:\n B[N - i // 2 - 1] -= A[N - i // 2 - 1]\n ans += A[N - i // 2 - 1]\n A[N - i // 2 - 1] = 0\nprint(ans)\n"} +{"fast_code_id":"129ca6aa2f3da47302258a7b95626bdcb4dc210495f38dd965b8211161c04a1a","fast_id":"p02572_129ca6aa2f3da47302258a7b95626bdcb4dc210495f38dd965b8211161c04a1a","language":"python","measured_fast_code_id":"129ca6aa2f3da47302258a7b95626bdcb4dc210495f38dd965b8211161c04a1a","measured_slow_code_id":"9a9a8c4412436852a66bfa0067b57c544f3aec7f532b2c46c6eaa958a2513451","measurement_metric":"cpu_instruction_count","pair_id":"python_70743c3156a434a2f0ec2b88","problem_id":"p02572","slow_code_id":"9a9a8c4412436852a66bfa0067b57c544f3aec7f532b2c46c6eaa958a2513451","slow_id":"p02572_9a9a8c4412436852a66bfa0067b57c544f3aec7f532b2c46c6eaa958a2513451","speedup":4.503261903813874,"stratum":"4-8","sampling_key":"83d0fbcce48e17f87235781d7fa9a0146d30e39aa9cbe4ae8b71425eaac84303","slow_code":"import copy\n\nN = int(eval(input()))\nA = list(map(int, input().split()))\nmod = 10**9 + 7\npartial_sum = copy.deepcopy(A)\nsum_now = A[N - 1]\nfor j in range(N - 2, -1, -1):\n sum_now = int((sum_now + A[j]) % mod)\n partial_sum[j] = sum_now\nres = 0\nfor i in range(N - 1):\n res = (res + (A[i] * partial_sum[i + 1]) % mod) % mod\nprint((int(res)))\n","fast_code":"mod = 10**9 + 7\nn = int(eval(input()))\na = list(map(int, input().split()))\nans = 0\nsum_arr = sum(a)\nfor i in a:\n sum_arr -= i\n ans += i * sum_arr\nprint((ans % mod))\n"} +{"fast_code_id":"e0d090130d6b10ccf7d87a7444c23003c3fd9f56cfbf7dbfab8300b3f134c2a2","fast_id":"p02956_e9bbbe9447a6c60a4b9155498e9380d396e0f3ccdafb34dba39fd6fec9428149","language":"python","measured_fast_code_id":"e9bbbe9447a6c60a4b9155498e9380d396e0f3ccdafb34dba39fd6fec9428149","measured_slow_code_id":"8042986ea709f7be4a36940bb65dd281b3740a58e66e7c9edcc0eeee56205242","measurement_metric":"cpu_instruction_count","pair_id":"python_70834c6afa692f25d7377f3e","problem_id":"p02956","slow_code_id":"e43f92f24f0e96eef9c4232af95007e4efdc9b0608e734256316ff5cc0636981","slow_id":"p02956_8042986ea709f7be4a36940bb65dd281b3740a58e66e7c9edcc0eeee56205242","speedup":39.99118136902082,"stratum":"8+","sampling_key":"0d071d9859a22a7831d27a5d1014ea9e8bd4fbcd1147a82d859bbeb57c9468ba","slow_code":"import sys\n\nreadline = sys.stdin.readline\n\n\nclass BIT:\n\n def __init__(self, n):\n self.size = n\n self.tree = [0] * (n + 1)\n self.p = 2 ** (n.bit_length() - 1)\n self.dep = n.bit_length()\n\n def get(self, i):\n s = 0\n while i > 0:\n s += self.tree[i]\n i -= i & -i\n return s\n\n def add(self, i, x):\n while i <= self.size:\n self.tree[i] += x\n i += i & -i\n\n def bl(self, v):\n if v <= 0:\n return -1\n s = 0\n k = self.p\n for _ in range(self.dep):\n if s + k <= self.size and self.tree[s + k] < v:\n s += k\n v -= self.tree[s + k]\n k //= 2\n return s + 1\n\n\ndef compress(L):\n L2 = list(set(L))\n L2.sort()\n C = {v: k for k, v in enumerate(L2)}\n return L2, C\n\n\nMOD = 998244353\nN = int(readline())\nXY = [list(map(int, readline().split())) for _ in range(N)]\nXY.sort()\nZ = [-(10**10)]\nfor x, y in XY:\n Z.append(y)\n_, CC = compress(Z)\nXY = [(x, CC[y]) for x, y in XY]\nSS, SB, BS, BB = [None] * N, [None] * N, [None] * N, [None] * N\nT = BIT(N)\nfor i in range(N):\n k = i\n y = XY[i][1]\n l = T.get(y)\n SS[i] = l\n SB[i] = k - l\n T.add(y, 1)\nT = BIT(N)\nfor i in range(N - 1, -1, -1):\n k = N - 1 - i\n y = XY[i][1]\n l = T.get(y)\n BS[i] = l\n BB[i] = k - l\n T.add(y, 1)\nP2 = [1] * 1341398\nfor i in range(1, len(P2)):\n P2[i] = P2[i - 1] * 2 % MOD\nans = 0\nfor i in range(N):\n ss = SS[i]\n sb = SB[i]\n bs = BS[i]\n bb = BB[i]\n ans = (ans + P2[N - 1]) % MOD\n ans = (ans + P2[N - 1 - ss - bb] * (P2[ss] - 1) * (P2[bb] - 1)) % MOD\n ans = (ans + P2[N - 1 - sb - bs] * (P2[sb] - 1) * (P2[bs] - 1)) % MOD\n ans = (ans - (P2[sb] - 1) * (P2[bs] - 1) * (P2[ss] - 1) * (P2[bb] - 1)) % MOD\nprint(ans)\n","fast_code":"N = int(eval(input()))\nxy = [tuple(map(int, input().split())) for _ in range(N)]\nmod = 998244353\n\n\nclass BIT:\n\n def __init__(self, n):\n self.n = n\n self.data = [0] * (n + 1)\n self.el = [0] * (n + 1)\n\n def sum(self, i):\n s = 0\n while i > 0:\n s += self.data[i]\n i -= i & -i\n return s\n\n def add(self, i, x):\n self.el[i] += x\n while i <= self.n:\n self.data[i] += x\n i += i & -i\n\n def query(self, i, j=None):\n if j is None:\n return self.el[i]\n return self.sum(j) - self.sum(i)\n\n\nxy2 = []\nfor i in range(N):\n x, y = xy[i]\n x += 10**9\n y += 10**9\n xy2.append(y << 80 | x << 40 | i)\n\n\nxy2 = sorted(xy2)\nmask = (1 << 40) - 1\ny_order = [0] * N\ny_compress = {}\nfor j, y in enumerate(xy2):\n i = y & mask\n y >>= 40\n x = y & mask\n x -= 10**9\n y >>= 40\n y -= 10**9\n y_order[i] = j\n y_compress[y] = j + 1\nxy2 = []\nfor i in range(N):\n x, y = xy[i]\n x += 10**9\n y += 10**9\n xy2.append(x << 80 | y << 40 | i)\nxy2 = sorted(xy2)\nmask = (1 << 40) - 1\nbit = BIT(N)\nans = 0\nmemo = [0] * N\n\npow2 = [1] * (N + 1)\nfor i in range(1, N + 1):\n pow2[i] = pow2[i - 1] * 2 % mod\nfor x in xy2:\n i = x & mask\n x >>= 40\n y = x & mask\n y -= 10**9\n x >>= 40\n x -= 10**9\n y = y_compress[y]\n bit.add(y, 1)\n n1 = bit.query(y - 1, N) - 1\n n2 = bit.query(0, y) - 1\n n3 = N - y - n1\n n4 = y - n2 - 1\n prod14 = (pow2[n1] - 1) * (pow2[n4] - 1) * pow2[n2 + n3] % mod\n prod23 = (pow2[n2] - 1) * (pow2[n3] - 1) * pow2[n1 + n4] % mod\n prod1234 = (pow2[n1] - 1) * (pow2[n4] - 1) * (pow2[n2] - 1) * (pow2[n3] - 1) % mod\n ans += pow2[N - 1] + prod14 + prod23 - prod1234\n ans %= mod\nprint(ans)\n"} +{"fast_code_id":"384a5d733e76e69b7a0401a837a7ec0dbb7c989f5540024e2bd02472ab2350a6","fast_id":"p03774_2cb51d7e157dfbed61a69bc179ed26f7dd9330b03553c6190f06c454f346cefc","language":"python","measured_fast_code_id":"2cb51d7e157dfbed61a69bc179ed26f7dd9330b03553c6190f06c454f346cefc","measured_slow_code_id":"4ab93e91c9006f8793ec4a581894d15fcba322003404950855ee770b9ed45cb3","measurement_metric":"cpu_instruction_count","pair_id":"python_7096261a9bf4e5484ecb156a","problem_id":"p03774","slow_code_id":"4ab93e91c9006f8793ec4a581894d15fcba322003404950855ee770b9ed45cb3","slow_id":"p03774_4ab93e91c9006f8793ec4a581894d15fcba322003404950855ee770b9ed45cb3","speedup":123.95698414216076,"stratum":"8+","sampling_key":"08a5fe8c9b7d31b241c6e5d86d93903322373b087e1dd4d349f8a6b3fb1d47ed","slow_code":"import numpy as np\n\nN, M = list(map(int, input().split()))\nab = []\nfor i in range(N):\n tmp = list(map(int, input().split()))\n ab.append(tmp)\nab = np.array(ab)\ndist = np.full([N, M], np.inf)\nfor m in range(M):\n tmp = np.array(list(map(int, input().split())))\n for n in range(N):\n dist[n, m] = np.abs(ab[n] - tmp).sum()\ndist = dist.astype(\"int\")\nfor d in dist:\n print((d.argmin() + 1))\n","fast_code":"[n, m] = [int(i) for i in input().split()]\nab = []\ncd = []\nk = []\nbox = []\nl = 0\nfor i in range(n):\n ab.append([int(j) for j in input().split()])\nfor i in range(m):\n cd.append([int(j) for j in input().split()])\nfor i in range(n):\n for j in range(m):\n k.append(abs(ab[i][0] - cd[j][0]) + abs(ab[i][1] - cd[j][1]))\n\n box.append(k)\n k = []\nfor i in range(n):\n for j in box[i]:\n if j == min(box[i]):\n l = l + 1\n print(l)\n break\n l = l + 1\n l = 0\n"} +{"fast_code_id":"3f475ae9e7efd3a1ce8867f9c3841f1206e31cad4eec5c093b58fc0a3461d40a","fast_id":"p03061_3f475ae9e7efd3a1ce8867f9c3841f1206e31cad4eec5c093b58fc0a3461d40a","language":"python","measured_fast_code_id":"3f475ae9e7efd3a1ce8867f9c3841f1206e31cad4eec5c093b58fc0a3461d40a","measured_slow_code_id":"b4c55a42394031ccd6c09f4ee9bef1742473d70273644e9a5a1c23a69587b130","measurement_metric":"cpu_instruction_count","pair_id":"python_7099e4f7d6387b42d6e2092b","problem_id":"p03061","slow_code_id":"4e0914517e095a57aeb03e288c13fafa4d67f1ff2c200b738c113bf161a272d5","slow_id":"p03061_b4c55a42394031ccd6c09f4ee9bef1742473d70273644e9a5a1c23a69587b130","speedup":2.6906851917457715,"stratum":"2-4","sampling_key":"f099a8bd98cd55804f9b232a80a23877a1df6fad711a2b5b19e4fc460dfe6849","slow_code":"n = int(eval(input()))\na = list(map(int, input().split()))\nans1 = a[1]\nfor i in range(1, n):\n big, sml = a[i], ans1\n while sml != 0:\n big, sml = sml, big % sml\n ans1 = big\nans2 = a[-2]\nfor i in range(n - 1):\n big, sml = a[i], ans2\n while sml != 0:\n big, sml = sml, big % sml\n ans2 = big\nl1 = [-1]\nnow = a[0]\nfor i in range(1, n):\n big, sml = now, a[i]\n while sml != 0:\n big, sml = sml, big % sml\n l1.append(now // big)\n now = big\nl2 = [-1]\nnow = a[-1]\nfor i in range(n - 2, -1, -1):\n big, sml = now, a[i]\n while sml != 0:\n big, sml = sml, big % sml\n l2.append(now // big)\n now = big\nl2.reverse()\nl3 = [-1]\nfor i in range(1, n - 1):\n big, sml = l1[i], l2[i]\n while sml != 0:\n big, sml = sml, big % sml\n l3.append(big)\nl3.append(-1)\nnow = a[0]\nfor i in range(n):\n big, sml = now, a[i]\n while sml != 0:\n big, sml = sml, big % sml\n now = big\nans3 = now * max(l3)\n\n\nprint((max(ans1, ans2, ans3)))\n","fast_code":"from math import gcd\n\nn = int(eval(input()))\nA = [0] + list(map(int, input().split())) + [0]\nn += 2\nL, R = [0] * n, [0] * n\ngl, gr = 0, 0\nfor i in range(n):\n gl = gcd(gl, A[i])\n gr = gcd(gr, A[n - i - 1])\n L[i] = gl\n R[n - i - 1] = gr\nans = L[-1]\nfor i in range(n - 2):\n ans = max(ans, gcd(L[i], R[i + 2]))\nprint(ans)\n"} +{"fast_code_id":"b24cda5b59e9141df1721e751c498ab19354c9e58b27b11a5d1f20643ab392c4","fast_id":"p03803_b24cda5b59e9141df1721e751c498ab19354c9e58b27b11a5d1f20643ab392c4","language":"python","measured_fast_code_id":"b24cda5b59e9141df1721e751c498ab19354c9e58b27b11a5d1f20643ab392c4","measured_slow_code_id":"0bd5df2a157ba82c7c25ec618ddd2b8ac3a7b93747b5c4b4114a2cd42e8e257e","measurement_metric":"cpu_instruction_count","pair_id":"python_70cfffebf535f3cbb88bc7b8","problem_id":"p03803","slow_code_id":"0bd5df2a157ba82c7c25ec618ddd2b8ac3a7b93747b5c4b4114a2cd42e8e257e","slow_id":"p03803_0bd5df2a157ba82c7c25ec618ddd2b8ac3a7b93747b5c4b4114a2cd42e8e257e","speedup":3.528836253632195,"stratum":"2-4","sampling_key":"7b9513375e5de7dcd63e91ea35ced09e6d2e2b5e1f9b7ea1c6b494d6841d79f2","slow_code":"import sys, math\nfrom functools import lru_cache\nfrom itertools import accumulate\n\nsys.setrecursionlimit(10**9)\nMOD = 10**9 + 7\n\n\ndef input():\n return sys.stdin.readline()[:-1]\n\n\ndef mi():\n return list(map(int, input().split()))\n\n\ndef ii():\n return int(eval(input()))\n\n\ndef i2(n):\n tmp = [list(mi()) for i in range(n)]\n return [list(i) for i in zip(*tmp)]\n\n\nA, B = mi()\nif A == B:\n print(\"Draw\")\nelif A == 1:\n print(\"Alice\")\nelif B == 1:\n print(\"Bob\")\nelse:\n if A > B:\n print(\"Alice\")\n else:\n print(\"Bob\")\n","fast_code":"a, b = list(map(int, input().split()))\nprint(([\"Draw\", [\"Bob\", \"Alice\"][(a - 2) % 13 > (b - 2) % 13]][a != b]))\n"} +{"fast_code_id":"d811f7d92be0aae9622f751e76c6d3dcfc4ba7e99019edb2e8b89b9883ead31c","fast_id":"p03806_d811f7d92be0aae9622f751e76c6d3dcfc4ba7e99019edb2e8b89b9883ead31c","language":"python","measured_fast_code_id":"d811f7d92be0aae9622f751e76c6d3dcfc4ba7e99019edb2e8b89b9883ead31c","measured_slow_code_id":"300ea98018e92ef9ea1c6599df2d30cb81530179c8dac2696b84d606c80a4bab","measurement_metric":"cpu_instruction_count","pair_id":"python_71ba5fbab28ff3bc8e9a4186","problem_id":"p03806","slow_code_id":"95e4906e454bb163e1b4231db07053c6afbce8b5256db968433c63cccddfc002","slow_id":"p03806_300ea98018e92ef9ea1c6599df2d30cb81530179c8dac2696b84d606c80a4bab","speedup":5.591896911837697,"stratum":"4-8","sampling_key":"4de147c4bbce222dc6bed91ca6824bfe0187b9d0b041b7311f106c22c5487ef9","slow_code":"N, Ma, Mb = list(map(int, input().split()))\n\narr = [list(map(int, input().split())) for _ in range(N)]\n\n\nINF = 5000\n\n\ndp = [\n [[INF for _ in range(10 * N + 1)] for _ in range(10 * N + 1)] for _ in range(N + 1)\n]\n\ndp[0][0][0] = 0\nfor i in range(N):\n a, b, c = arr[i]\n for j in range(10 * N + 1):\n for k in range(10 * N + 1):\n if dp[i][j][k] == INF:\n continue\n\n dp[i + 1][j][k] = min(dp[i + 1][j][k], dp[i][j][k])\n\n dp[i + 1][j + a][k + b] = min(dp[i + 1][j + a][k + b], dp[i][j][k] + c)\nans = INF\n\n\nfor i in range(1, 10 * N + 1):\n if i * Ma > 10 * N or i * Mb > 10 * N:\n break\n ans = min(ans, dp[N][i * Ma][i * Mb])\nif ans == INF:\n print((-1))\nelse:\n print(ans)\n","fast_code":"from itertools import permutations\nimport sys\n\nsys.setrecursionlimit(10**6)\nfrom bisect import *\nfrom collections import *\nfrom heapq import *\n\n\ndef II():\n return int(sys.stdin.readline())\n\n\ndef MI():\n return map(int, sys.stdin.readline().split())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\ndef SI():\n return sys.stdin.readline()[:-1]\n\n\ndef LLI(rows_number):\n return [LI() for _ in range(rows_number)]\n\n\nint1 = lambda x: int(x) - 1\n\n\ndef MI1():\n return map(int1, sys.stdin.readline().split())\n\n\ndef LI1():\n return list(map(int1, sys.stdin.readline().split()))\n\n\np2D = lambda x: print(*x, sep=\"\\n\")\ndij = [(1, 0), (0, 1), (-1, 0), (0, -1)]\n\n\ndef main():\n inf = 10**9\n n, ma, mb = MI()\n vv = []\n cc = []\n for _ in range(n):\n a, b, c = MI()\n vv.append(a * mb - b * ma)\n cc.append(c)\n dp = [[inf] * 8005 for _ in range(n + 1)]\n for i in range(n):\n v, c = vv[i], cc[i]\n dp[i + 1][4000 + v] = min(dp[i + 1][4000 + v], c)\n for j in range(8005):\n pre = dp[i][j]\n if pre == inf:\n continue\n dp[i + 1][j] = min(dp[i + 1][j], pre)\n dp[i + 1][j + v] = min(dp[i + 1][j + v], pre + c)\n ans = dp[-1][4000]\n if ans == inf:\n print(-1)\n else:\n print(ans)\n\n\nmain()\n"} +{"fast_code_id":"8700fb982859fc8a401824ec74f8b5c6d0583c463e7bf06f22b5229cde5daa2d","fast_id":"p03317_1215be2398250c13666c56ac5a7eef3a385d457ed17467ca2bfae2b92b89355e","language":"python","measured_fast_code_id":"1215be2398250c13666c56ac5a7eef3a385d457ed17467ca2bfae2b92b89355e","measured_slow_code_id":"40f790b9daefbd644d38ba942e539d6681ed03212cd68a297874ac055d84131a","measurement_metric":"cpu_instruction_count","pair_id":"python_722e2d1fbbceb5fbc5f7a4e8","problem_id":"p03317","slow_code_id":"40f790b9daefbd644d38ba942e539d6681ed03212cd68a297874ac055d84131a","slow_id":"p03317_40f790b9daefbd644d38ba942e539d6681ed03212cd68a297874ac055d84131a","speedup":4.748927773075219,"stratum":"4-8","sampling_key":"0b1ed35594640af429e640467b8bee6a027cf239ff1b9001fe3c99578aee27a4","slow_code":"import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time\n\nsys.setrecursionlimit(10**7)\ninf = 10**20\nmod = 10**9 + 7\n\n\ndef LI():\n return list(map(int, input().split()))\n\n\ndef I():\n return int(eval(input()))\n\n\ndef LS():\n return input().split()\n\n\ndef S():\n return eval(input())\n\n\ndef main():\n a, b = LI()\n l = LI()\n c = 1\n _b = b\n while True:\n if a <= _b:\n break\n else:\n _b += b - 1\n c += 1\n return c\n\n\nprint((main()))\n","fast_code":"import sys\n\n\ndef main():\n n, k, *a = (int(x) for x in sys.stdin.read().split())\n i = a.index(1)\n l = k - 1\n left, right = i, (n - 1) - i\n if left % l == 0:\n if right % l == 0:\n ans = left // l + right // l\n else:\n ans = left // l + right // l + 1\n else:\n if right % l == 0:\n ans = left // l + 1 + right // l\n else:\n if left % l + right % l > l:\n ans = left // l + right // l + 2\n else:\n ans = left // l + right // l + 1\n print(ans)\n\n\nif __name__ == \"__main__\":\n\n main()\n"} +{"fast_code_id":"0a4b743931f51015a53a8b68212086bf81fdde0f3ffc6ca14185f8e4075397cc","fast_id":"p02362_0a4b743931f51015a53a8b68212086bf81fdde0f3ffc6ca14185f8e4075397cc","language":"python","measured_fast_code_id":"0a4b743931f51015a53a8b68212086bf81fdde0f3ffc6ca14185f8e4075397cc","measured_slow_code_id":"cf895780ce22ae52a2f15a4858c8f0e2e1ed71360cb9cc257b90994b1f2cf6f6","measurement_metric":"cpu_instruction_count","pair_id":"python_72381a86cd095c2b83567b14","problem_id":"p02362","slow_code_id":"9b5601c779f73d6d45abde45eb2d873812e07c3baf1e64c12895d6c629797e2a","slow_id":"p02362_cf895780ce22ae52a2f15a4858c8f0e2e1ed71360cb9cc257b90994b1f2cf6f6","speedup":3.3597515528433983,"stratum":"2-4","sampling_key":"1f87fa52e450b30b77824803ac169049cac4c44ffe2ab7982cc6e8e2d18a4b52","slow_code":"from sys import stdin\n\n\ndef sp(G, R, V):\n d = {}\n INF = float(\"inf\")\n for i in range(V):\n d[i] = INF\n d[R] = 0\n for i in range(1, V + 1):\n for u, v in list(G.keys()):\n if d[v] > d[u] + G[u, v]:\n d[v] = d[u] + G[u, v]\n if i == V:\n print(\"NEGATIVE CYCLE\")\n quit()\n return d\n\n\nV, E, R = [int(x) for x in stdin.readline().split()]\nG = {}\nfor case in range(E):\n s, t, w = [int(x) for x in stdin.readline().split()]\n G[(s, t)] = w\nd = sp(G, R, V)\nfor k in range(V):\n if d[k] == float(\"inf\"):\n print(\"INF\")\n else:\n print((d[k]))\n","fast_code":"import sys\n\nreadline = sys.stdin.readline\nV, E, r = list(map(int, readline().split()))\ninf = 10**10\nedges = [[] for _ in [None] * V]\nfor _ in [None] * E:\n s, t, d = list(map(int, readline().split()))\n edges[s].append((t, d))\n\n\ndef bellman_ford(n, edges, start):\n vertices = [inf] * n\n vertices[start] = 0\n reached = {start}\n for i in range(n):\n flag = 0\n for v in reached.copy():\n cost = vertices[v]\n for dist, _cost in edges[v]:\n newcost = cost + _cost\n if vertices[dist] > newcost:\n vertices[dist] = newcost\n reached.add(dist)\n flag = 1\n if flag == 0:\n return vertices\n else:\n return None\n\n\nresult = bellman_ford(V, edges, r)\nif result:\n print((\"\\n\".join([str(n) if n != inf else \"INF\" for n in result])))\nelse:\n print(\"NEGATIVE CYCLE\")\n"} +{"fast_code_id":"49db0678ae9c2031be5dfa2ea46e3f5c47cb6c19768914177f79f71e0a9f4500","fast_id":"p03693_49db0678ae9c2031be5dfa2ea46e3f5c47cb6c19768914177f79f71e0a9f4500","language":"python","measured_fast_code_id":"49db0678ae9c2031be5dfa2ea46e3f5c47cb6c19768914177f79f71e0a9f4500","measured_slow_code_id":"a8d7956b0cbea162ca1db60ee520eccf4efc73cdccbed5370688af05e67aaca2","measurement_metric":"cpu_instruction_count","pair_id":"python_72f8ff9ed2711256af16a97a","problem_id":"p03693","slow_code_id":"a8d7956b0cbea162ca1db60ee520eccf4efc73cdccbed5370688af05e67aaca2","slow_id":"p03693_a8d7956b0cbea162ca1db60ee520eccf4efc73cdccbed5370688af05e67aaca2","speedup":2326.3841885764614,"stratum":"8+","sampling_key":"070d0bead340899ba99e36dba329035caa844fadf287757c2317228e9396b89a","slow_code":"import numpy as np\n\nr, g, b = list(map(int, input().split()))\nif (100 * r + 10 * g + b) % 4 == 0:\n print(\"YES\")\nelse:\n print(\"NO\")\n","fast_code":"a = int(input().replace(\" \", \"\"))\nif a % 4 == 0:\n print(\"YES\")\nelse:\n print(\"NO\")\n"} +{"fast_code_id":"756f91ac6d1695db876a99ea6c409e2ecc2d89bc9ced2cac5f118d0dce505fbd","fast_id":"p03972_756f91ac6d1695db876a99ea6c409e2ecc2d89bc9ced2cac5f118d0dce505fbd","language":"python","measured_fast_code_id":"756f91ac6d1695db876a99ea6c409e2ecc2d89bc9ced2cac5f118d0dce505fbd","measured_slow_code_id":"bcf317c0f5728d0a7638204678608dc410ba8b1b94297840d436ebd31fa8f1c8","measurement_metric":"cpu_instruction_count","pair_id":"python_738b9039324ec131d8a57026","problem_id":"p03972","slow_code_id":"2485dcf3dff60c8bcad3b32da0e97fecf56bbf603fd33a5070b3d3bfc53b68a8","slow_id":"p03972_bcf317c0f5728d0a7638204678608dc410ba8b1b94297840d436ebd31fa8f1c8","speedup":3.592535937479917,"stratum":"2-4","sampling_key":"23e15cd9e36cddc66459528ba3ddee0c8920b17444b23b7a74404e819dead271","slow_code":"import sys\n\ninput = sys.stdin.readline\nfrom bisect import bisect_left, bisect_right\n\nW, H = list(map(int, input().split()))\nP = [int(eval(input())) for _ in range(W)]\nP.sort()\nQ = [int(eval(input())) for _ in range(H)]\nQ.sort()\nans = 0\nfor q in Q:\n tmp = bisect_right(P, q)\n\n ans += q * (1 + W - tmp)\n\nfor p in P:\n tmp = bisect_left(Q, p)\n ans += p * (1 + H - tmp)\nprint(ans)\n","fast_code":"w, h, *L = list(map(int, open(0).read().split()))\nP = L[:w]\nQ = L[w:]\nx, y = w, h\nsss = []\nfor i, pi in enumerate(P):\n sss.append((pi, 1))\nfor j, qj in enumerate(Q):\n sss.append((qj, 0))\nsss.sort()\nans = 0\nfor c, f in sss:\n if f and x:\n x -= 1\n ans += c * (y + 1)\n elif not f and y:\n y -= 1\n ans += c * (x + 1)\nprint(ans)\n"} +{"fast_code_id":"f27a4bd27f5024506b396d9409e065240fe954af08177935ce3a61cc4ef59dd1","fast_id":"p04014_f27a4bd27f5024506b396d9409e065240fe954af08177935ce3a61cc4ef59dd1","language":"python","measured_fast_code_id":"f27a4bd27f5024506b396d9409e065240fe954af08177935ce3a61cc4ef59dd1","measured_slow_code_id":"38f05af6b73665280db9ec2a605f799d5a3a653696a22897da46868ca5707313","measurement_metric":"cpu_instruction_count","pair_id":"python_7390f536d49400987a04bec4","problem_id":"p04014","slow_code_id":"38f05af6b73665280db9ec2a605f799d5a3a653696a22897da46868ca5707313","slow_id":"p04014_38f05af6b73665280db9ec2a605f799d5a3a653696a22897da46868ca5707313","speedup":4.718676887779497,"stratum":"4-8","sampling_key":"f006b27e686269078169da7eff73f84b933a7b602387616e360eced1d617b9d5","slow_code":"from collections import defaultdict, Counter\nfrom itertools import product, groupby, count, permutations, combinations\nfrom math import pi, sqrt, floor\nfrom collections import deque\nfrom bisect import bisect, bisect_left, bisect_right\nfrom string import ascii_lowercase\nfrom functools import lru_cache\nimport sys\n\nsys.setrecursionlimit(10000)\nINF = float(\"inf\")\nYES, Yes, yes, NO, No, no = \"YES\", \"Yes\", \"yes\", \"NO\", \"No\", \"no\"\ndy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]\ndy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]\n\n\ndef inside(y, x, H, W):\n return 0 <= y < H and 0 <= x < W\n\n\ndef ceil(a, b):\n return (a + b - 1) // b\n\n\ndef f(b, n):\n if n < b:\n return n\n return f(b, n // b) + n % b\n\n\ndef main():\n N = int(eval(input()))\n S = int(eval(input()))\n if N == S:\n print((N + 1))\n return\n if N < S:\n print((-1))\n return\n ans = INF\n for b in range(2, int(sqrt(N)) + 1):\n if f(b, N) == S:\n ans = min(ans, b)\n bs = set()\n t = N - S\n for i in range(1, int(sqrt(N)) + 1):\n if t % i == 0:\n bs.add(i + 1)\n bs.add((t // i) + 1)\n for b in bs:\n if b == 1:\n continue\n if f(b, N) == S:\n ans = min(ans, b)\n if ans == INF:\n print((-1))\n else:\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"def primeFactor(N):\n i, n, ret, d, sq = 2, N, {}, 2, 99\n while i <= sq:\n k = 0\n while n % i == 0:\n n, k, ret[i] = n // i, k + 1, k + 1\n if k > 0 or i == 97:\n sq = int(n ** (1 / 2) + 0.5)\n if i < 4:\n i = i * 2 - 1\n else:\n i, d = i + d, d ^ 6\n if n > 1:\n ret[n] = 1\n return ret\n\n\ndef divisors(N):\n pf = primeFactor(N)\n ret = [1]\n for p in pf:\n ret_prev = ret\n ret = []\n for i in range(pf[p] + 1):\n for r in ret_prev:\n ret.append(r * (p**i))\n return sorted(ret)\n\n\ndef f(b, n):\n re = 0\n while n:\n re += n % b\n n //= b\n return re\n\n\nN = int(eval(input()))\nS = int(eval(input()))\nif N < S:\n print((-1))\nelif N == S:\n print((N + 1))\nelse:\n for b in divisors(N - S):\n b += 1\n if f(b, N) == S:\n print(b)\n break\n else:\n print((-1))\n"} +{"fast_code_id":"8a61637a1d14703b9160385c39f4e993c52449f2d33b71138f9ace68f4e4be79","fast_id":"p02681_1a581c8d8cc0c5caa1dbf8ee92d900953e3408791a4cd33a35a82a324ed716c6","language":"python","measured_fast_code_id":"1a581c8d8cc0c5caa1dbf8ee92d900953e3408791a4cd33a35a82a324ed716c6","measured_slow_code_id":"f4400189ff3db203f96723d5aee262e6d415108f8067f12bc82d5f8b60b24440","measurement_metric":"cpu_instruction_count","pair_id":"python_73b2c3f4f1db7edfe0d52b95","problem_id":"p02681","slow_code_id":"f4400189ff3db203f96723d5aee262e6d415108f8067f12bc82d5f8b60b24440","slow_id":"p02681_f4400189ff3db203f96723d5aee262e6d415108f8067f12bc82d5f8b60b24440","speedup":3.304619037752649,"stratum":"2-4","sampling_key":"3b0eb4c5d1f9c762599ac7374a75787a03076ac522ddb667aeaf875f251db312","slow_code":"import sys\n\ninput = lambda: sys.stdin.readline().rstrip()\naint = lambda: int(input())\nints = lambda: list(map(int, input().split()))\nimport math\n\nfloor, ceil = lambda x: int(math.floor(x)), lambda x: int(math.ceil(x))\nfrom functools import reduce\n\ngcd = lambda *x: reduce(math.gcd, x)\nlcm = lambda *x: reduce(lambda x, y: (x * y) // gcd(x, y), x, 1)\nfrom collections import deque\n\nYes = lambda b: print(\"Yes\" if b else \"No\")\nYES = lambda b: print(\"YES\" if b else \"NO\")\nis_even = lambda x: True if x % 2 == 0 else False\n\n\ndef main():\n s = input()\n t = input()\n n = len(s)\n flg = 0\n for i in range(n):\n if s[i] != t[i]:\n flg = 1\n Yes(flg == 0)\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"from sys import stdin\n\n\ndef main():\n\n readline = stdin.readline\n S = readline().strip()\n T = readline().strip()\n for i in range(len(S)):\n if S[i] != T[i]:\n print(\"No\")\n break\n else:\n print(\"Yes\")\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"5bf7be962f5a393bed61c95c4456ace4b339801f145936066b0a4f113de5cd02","fast_id":"p00033_f59db75acfcf498259bacfe1d852ac4ab0eb85100491de83289b21e5898a337b","language":"python","measured_fast_code_id":"f59db75acfcf498259bacfe1d852ac4ab0eb85100491de83289b21e5898a337b","measured_slow_code_id":"d554547e32ca76dca1697e6003a53c8f9386d6f728fbbf5b97a6fa1bed6629c2","measurement_metric":"cpu_instruction_count","pair_id":"python_73cabfc1dd310aa1ee1a9389","problem_id":"p00033","slow_code_id":"d554547e32ca76dca1697e6003a53c8f9386d6f728fbbf5b97a6fa1bed6629c2","slow_id":"p00033_d554547e32ca76dca1697e6003a53c8f9386d6f728fbbf5b97a6fa1bed6629c2","speedup":15.077045489145817,"stratum":"8+","sampling_key":"02749891d4faf668697d2d3c0f36bc144dce094563612663fceed1f12f647ed8","slow_code":"def dfs(i, b, c):\n if i == 11:\n return b == sorted(b) and c == sorted(c)\n if dfs(i + 1, b + [balls[i - 1]], c):\n return True\n if dfs(i + 1, b, c + [balls[i - 1]]):\n return True\n return False\n\n\nif __name__ == \"__main__\":\n N = int(eval(input()))\n for i in range(N):\n balls = list(map(int, input().split()))\n if dfs(1, [], []):\n print(\"YES\")\n else:\n print(\"NO\")\n","fast_code":"import sys\n\nsys.setrecursionlimit(10**6)\n\n\ndef dfs(balls, B=-1, C=-1, cp=0):\n if cp == len(balls):\n return True\n ball = balls[cp]\n if B < ball:\n is_find = dfs(balls, ball, C, cp + 1)\n if is_find:\n return True\n if C < ball:\n is_find = dfs(balls, B, ball, cp + 1)\n if is_find:\n return True\n return False\n\n\ndef main():\n N = int(input().strip())\n for _ in range(N):\n balls = list(map(int, input().split(\" \")))\n is_find = dfs(balls)\n if is_find:\n print(\"YES\")\n else:\n print(\"NO\")\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"3ed28d55a7079cf59eceb104d497c6508ff4ffe2ab644335d4815452e0859cb6","fast_id":"p03207_ff27697caf45060293346aa8bb8cbf60f04a0b44f07980bdc00ed3a88646bd41","language":"python","measured_fast_code_id":"ff27697caf45060293346aa8bb8cbf60f04a0b44f07980bdc00ed3a88646bd41","measured_slow_code_id":"5cb7a4c7cf0d8a71a4fd49887b2da818d3766f3e397b1d44bc46374144eeebdc","measurement_metric":"cpu_instruction_count","pair_id":"python_73e6c81397bce6adb87acdc7","problem_id":"p03207","slow_code_id":"fe2f7e4c4fa4bf811a1052a7e9a8cc8bf127a2538fd41f3ded0df182a9217e19","slow_id":"p03207_5cb7a4c7cf0d8a71a4fd49887b2da818d3766f3e397b1d44bc46374144eeebdc","speedup":27.53819350943817,"stratum":"8+","sampling_key":"1f95354adb0881ab62a7bbfd931cdfaf0deea6fff065052e78b1163971f59ede","slow_code":"import copy\nimport random\nimport bisect\nimport fractions\nimport math\nimport sys\nimport collections\nfrom decimal import Decimal\n\nmod = 10**9 + 7\nsys.setrecursionlimit(mod)\nd = collections.deque()\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\nN = int(eval(input()))\np = [0 for i in range(N)]\nfor i in range(N):\n p[i] = int(eval(input()))\np.sort()\nans = sum(p)\nans -= p[-1] // 2\nprint(ans)\n","fast_code":"p = [int(eval(input())) for _ in range(int(eval(input())))]\nprint((sum(p) - max(p) // 2))\n"} +{"fast_code_id":"09bf5d0d342feea8a2f21191badddda2ed0fca1f3c0b3c1083fafbad4af87956","fast_id":"p00053_09bf5d0d342feea8a2f21191badddda2ed0fca1f3c0b3c1083fafbad4af87956","language":"python","measured_fast_code_id":"09bf5d0d342feea8a2f21191badddda2ed0fca1f3c0b3c1083fafbad4af87956","measured_slow_code_id":"8cca1698214485b76a9b0e12f8e91dd9d3daa2c366ec968e4e5180fe1f6d3e7b","measurement_metric":"cpu_instruction_count","pair_id":"python_742793703d4607bf3dfd0991","problem_id":"p00053","slow_code_id":"8cca1698214485b76a9b0e12f8e91dd9d3daa2c366ec968e4e5180fe1f6d3e7b","slow_id":"p00053_8cca1698214485b76a9b0e12f8e91dd9d3daa2c366ec968e4e5180fe1f6d3e7b","speedup":4.016838281367147,"stratum":"4-8","sampling_key":"80de7df697d194272e1c46ea85bb2b8b4125b93d530c821d54f2501cfcce7415","slow_code":"import math\n\nr = 105000\nsqrt = int(math.sqrt(r))\np = [1] * r\np[0] = 0\nfor i in range(1, sqrt):\n if p[i]:\n for j in range(2 * i + 1, r, i + 1):\n p[j] = 0\nwhile True:\n n = int(input())\n if not n:\n break\n i, num, sum = 0, 0, 0\n while num < n:\n if p[i] == 1:\n num += 1\n sum += i + 1\n i += 1\n print(sum)\n","fast_code":"s = [0]\nM = 104850\np = [1] * M\nS = 0\nfor i in range(2, M):\n if p[i]:\n for j in range(i * i, M, i):\n p[j] = 0\n S += i\n s.append(S)\nwhile 1:\n n = eval(input())\n if n == 0:\n break\n print(s[n])\n"} +{"fast_code_id":"57e83f49b70d738c7e3d0a2aaef4ec00f58ec1eaf55df7a36c0506962c4397b4","fast_id":"p02641_57e83f49b70d738c7e3d0a2aaef4ec00f58ec1eaf55df7a36c0506962c4397b4","language":"python","measured_fast_code_id":"57e83f49b70d738c7e3d0a2aaef4ec00f58ec1eaf55df7a36c0506962c4397b4","measured_slow_code_id":"56a803f01b0149391407a67301955076fc165a7ad3ad3f8f8a9f51ab5d8af60e","measurement_metric":"cpu_instruction_count","pair_id":"python_743748f95531885afda5e10b","problem_id":"p02641","slow_code_id":"85cbb5049fb6ba315c1cc49d08aa7371cf037161b52bac8a421580f3486b7f72","slow_id":"p02641_56a803f01b0149391407a67301955076fc165a7ad3ad3f8f8a9f51ab5d8af60e","speedup":2.036326558563158,"stratum":"2-4","sampling_key":"c63556cd4f8c5f9186e4a0c35266cb95e3f8c99af77a9df92aa482e7b0a9c4c1","slow_code":"x, n = list(map(int, input().split()))\nif n == 0:\n print(x)\n exit()\narr = list(map(int, input().split()))\narr2 = []\narr3 = []\nfor i in range(-50, 110):\n if not i in arr:\n arr2.append(i)\n arr3.append(abs(x - i))\nn2 = min([i for i, v in enumerate(arr3) if v == min(arr3)])\nprint((arr2[n2]))\n","fast_code":"x, n = list(map(int, input().split()))\nif n == 0:\n print(x)\nelse:\n p = list(map(int, input().split()))\n dic = {}\n for i in p:\n d = abs(i - x)\n if d in dic:\n dic[d].append(i)\n else:\n dic[d] = [i]\n sortdic = sorted(list(dic.items()), key=lambda x: x[0])\n chk = 0\n ans = -1\n for k, v in sortdic:\n if chk == k:\n if chk != 0 and len(v) != 2:\n if v[0] > x:\n ans = x - k\n else:\n ans = x + k\n break\n else:\n ans = x - chk\n break\n chk += 1\n if ans == -1:\n ans = x - chk\n print(ans)\n"} +{"fast_code_id":"4038bcef7f71e4bcbad1ce3a74a10cdc90a93fcdef292e18cbaf676738ce8578","fast_id":"p02418_4038bcef7f71e4bcbad1ce3a74a10cdc90a93fcdef292e18cbaf676738ce8578","language":"python","measured_fast_code_id":"4038bcef7f71e4bcbad1ce3a74a10cdc90a93fcdef292e18cbaf676738ce8578","measured_slow_code_id":"cef61ea324de806594aef8e5b25dea0c55fe9633d20e9e7f7cc94749726f1030","measurement_metric":"cpu_instruction_count","pair_id":"python_74406490ce93622231624686","problem_id":"p02418","slow_code_id":"cef61ea324de806594aef8e5b25dea0c55fe9633d20e9e7f7cc94749726f1030","slow_id":"p02418_cef61ea324de806594aef8e5b25dea0c55fe9633d20e9e7f7cc94749726f1030","speedup":2.131165689291918,"stratum":"2-4","sampling_key":"f352633940f14cc3ec011f966097fbc8678b9616abab4d6bc9dc2ba8a9f79997","slow_code":"s = input()\ntarget = input()\nring = s * 2\nf = 0\nfor i in range(len(s)):\n if ring[i : i + len(target)] == target:\n f = 1\n break\nif f == 1:\n print(\"Yes\")\nelse:\n print(\"No\")\n","fast_code":"ring = input() * 2\nword = input()\nif ring.find(word) != -1:\n print(\"Yes\")\nelse:\n print(\"No\")\n"} +{"fast_code_id":"672cb672e6f2cdb3029769e3d37162934b5830bd3278e0cb4d1da7292554a1c0","fast_id":"p03136_672cb672e6f2cdb3029769e3d37162934b5830bd3278e0cb4d1da7292554a1c0","language":"python","measured_fast_code_id":"672cb672e6f2cdb3029769e3d37162934b5830bd3278e0cb4d1da7292554a1c0","measured_slow_code_id":"4be873c382d7f88cc1e36527ba71e39cb04cebba58534d56f1501f183fdfdcbd","measurement_metric":"cpu_instruction_count","pair_id":"python_7462c449ab51fe0c81f65154","problem_id":"p03136","slow_code_id":"4be873c382d7f88cc1e36527ba71e39cb04cebba58534d56f1501f183fdfdcbd","slow_id":"p03136_4be873c382d7f88cc1e36527ba71e39cb04cebba58534d56f1501f183fdfdcbd","speedup":7.497872003478581,"stratum":"4-8","sampling_key":"1698d1a19b29276d77ced56944446cfed40ff1c48f11a2f37617a009843795cf","slow_code":"def examA():\n T, X = LI()\n ans = T / X\n print(ans)\n return\n\n\ndef examB():\n N = I()\n L = LI()\n ans = \"Yes\"\n if max(L) * 2 >= sum(L):\n ans = \"No\"\n print(ans)\n return\n\n\nimport sys, copy, bisect, itertools, heapq, math\nfrom heapq import heappop, heappush, heapify\nfrom collections import Counter, defaultdict, deque\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\ndef LSI():\n return list(map(str, sys.stdin.readline().split()))\n\n\ndef LS():\n return sys.stdin.readline().split()\n\n\ndef SI():\n return sys.stdin.readline().strip()\n\n\nmod = 10**9 + 7\ninf = float(\"inf\")\nif __name__ == \"__main__\":\n examB()\n","fast_code":"def main():\n N = int(eval(input()))\n L = [int(i) for i in input().split()]\n maxL = max(L)\n sumL = sum(L) - maxL\n if maxL < sumL:\n print(\"Yes\")\n else:\n print(\"No\")\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"4b30e1542d9d5e61e261aecc0e4fe2b4fd98b95e8d562239e8c89b28d744d74b","fast_id":"p03502_4b30e1542d9d5e61e261aecc0e4fe2b4fd98b95e8d562239e8c89b28d744d74b","language":"python","measured_fast_code_id":"4b30e1542d9d5e61e261aecc0e4fe2b4fd98b95e8d562239e8c89b28d744d74b","measured_slow_code_id":"9657e24fd296bdb183cb812efcaa41e0e4d09edff18e911040359edf4aba2689","measurement_metric":"cpu_instruction_count","pair_id":"python_748f029125134311bf40679f","problem_id":"p03502","slow_code_id":"04afcb0636d6758b9c1fd4024fff2537c6c73d327a7f8a692ef75cf80e1d3933","slow_id":"p03502_9657e24fd296bdb183cb812efcaa41e0e4d09edff18e911040359edf4aba2689","speedup":14.037663733168282,"stratum":"8+","sampling_key":"37791ba3c39250471c09aea044333bec895008686deae4df25c2701d0618ceee","slow_code":"import sys\nimport math\nimport collections\nimport itertools\nimport array\nimport inspect\n\n\nsys.setrecursionlimit(10000)\n\n\ndef chkprint(*args):\n names = {id(v): k for k, v in list(inspect.currentframe().f_back.f_locals.items())}\n print((\", \".join(names.get(id(arg), \"???\") + \" = \" + repr(arg) for arg in args)))\n\n\ndef to_bin(x):\n return bin(x)[2:]\n\n\ndef li_input():\n return [int(_) for _ in input().split()]\n\n\ndp = None\n\n\ndef main():\n X = int(eval(input()))\n if X % sum(list(map(int, list(str(X))))) == 0:\n print(\"Yes\")\n else:\n print(\"No\")\n\n\nmain()\n","fast_code":"def digit10(x):\n dten = 0\n while x > 0:\n dten += int(x % 10)\n x /= 10\n return dten\n\n\nn = int(eval(input()))\nif n % digit10(n) == 0:\n print(\"Yes\")\nelse:\n print(\"No\")\n"} +{"fast_code_id":"2d3636092013d0ccdf74101e3c253423597051429154e6bf9b9524f3dc969a7a","fast_id":"p03599_2d3636092013d0ccdf74101e3c253423597051429154e6bf9b9524f3dc969a7a","language":"python","measured_fast_code_id":"2d3636092013d0ccdf74101e3c253423597051429154e6bf9b9524f3dc969a7a","measured_slow_code_id":"f6827545f2a7e02be9d072e224e499c3895b63a4819098a0f50fa7a964b98bc6","measurement_metric":"cpu_instruction_count","pair_id":"python_74bc503c3884696b635d3d19","problem_id":"p03599","slow_code_id":"f6827545f2a7e02be9d072e224e499c3895b63a4819098a0f50fa7a964b98bc6","slow_id":"p03599_f6827545f2a7e02be9d072e224e499c3895b63a4819098a0f50fa7a964b98bc6","speedup":22.99466150773006,"stratum":"8+","sampling_key":"f95f25810f6b476d55361b802be1227cc3f5745876c4463e0b3686af19a09225","slow_code":"import math\nimport bisect\n\nA, B, C, D, E, F = list(map(int, input().split()))\nx = [A * a + B * b for b in range(31) for a in range(31)]\ny = [C * c + D * d for d in range(1501) for c in range(1501)]\nx.remove(0)\nx = list(set(x))\ny = list(set(y))\nx.sort()\ny.sort()\nx = x[: bisect.bisect_right(x, F // 100 + 1)]\ny = y[: bisect.bisect_left(y, F)]\nwater = A\nsuger = 0\nfor i in x:\n for j in y:\n if j <= i * E and i * 100 + j <= F:\n if j / (i * 100 + j) > suger / (water * 100 + suger):\n water = i\n suger = j\nprint((\"{} {}\".format(water * 100 + suger, suger)))\n","fast_code":"A, B, C, D, E, F = list(map(int, input().split()))\namax = F // (100 * A)\nbmax = F // (100 * B)\nconcmx = 0\nwholemx = 0\nsugarmx = 0\nfor a in range(amax, -1, -1):\n for b in range(bmax, -1, -1):\n cmax = (F - 100 * A * a - 100 * B * b) // C\n dmax = (F - 100 * A * a - 100 * B * b) // D\n for c in range(cmax, -1, -1):\n for d in range(dmax, -1, -1):\n sugar = C * c + D * d\n whole = 100 * A * a + 100 * B * b + sugar\n if whole == 0:\n break\n elif sugar / whole <= E / (100 + E) and whole <= F:\n if sugar / whole >= concmx:\n concmx = sugar / whole\n sugarmx = sugar\n wholemx = whole\nprint((str(wholemx) + \" \" + str(sugarmx)))\n"} +{"fast_code_id":"9e1db52c42374593650f3df676ab08a07d0a5c58b9bbba7915c83431423183c8","fast_id":"p02657_9e1db52c42374593650f3df676ab08a07d0a5c58b9bbba7915c83431423183c8","language":"python","measured_fast_code_id":"9e1db52c42374593650f3df676ab08a07d0a5c58b9bbba7915c83431423183c8","measured_slow_code_id":"b1697d82d892b2441ee34ccc53dde64479bc475c073927fdbb5370e4d2f6f2a7","measurement_metric":"cpu_instruction_count","pair_id":"python_75577a1559e4171c2bf906f6","problem_id":"p02657","slow_code_id":"b1697d82d892b2441ee34ccc53dde64479bc475c073927fdbb5370e4d2f6f2a7","slow_id":"p02657_b1697d82d892b2441ee34ccc53dde64479bc475c073927fdbb5370e4d2f6f2a7","speedup":2.026112608795607,"stratum":"2-4","sampling_key":"4265a11c059feb80d36d84b93dc9e2f7d31dd93b25e1afbc255b1a0a3854eca4","slow_code":"a, b = list(map(float, input().split()))\nimport math\n\na = int(math.floor(a))\nb = int(math.floor(b * 100))\nc = math.floor(a * b / 100)\nprint(c)\n","fast_code":"a, b = input().split(\" \")\nprint((int(a) * int(b)))\n"} +{"fast_code_id":"86e96830fc5785e6231809b417688f2422bc4ebfdd6ffbf2a570a42e6ac2c182","fast_id":"p02716_86e96830fc5785e6231809b417688f2422bc4ebfdd6ffbf2a570a42e6ac2c182","language":"python","measured_fast_code_id":"86e96830fc5785e6231809b417688f2422bc4ebfdd6ffbf2a570a42e6ac2c182","measured_slow_code_id":"a89763baebb62faa9e91260c8c3e1ee7019eee2c1555e7f04ebc26cc682a0f4c","measurement_metric":"cpu_instruction_count","pair_id":"python_75cef6d2f301cab9197d25ca","problem_id":"p02716","slow_code_id":"1b52723f96906a024d2c78dcc137c18ca86b83d53af7d5cc47b6642d214503ba","slow_id":"p02716_a89763baebb62faa9e91260c8c3e1ee7019eee2c1555e7f04ebc26cc682a0f4c","speedup":4.34639521084182,"stratum":"4-8","sampling_key":"ba7708fcf5c1c7eb1dee8a3da7486041e55ff07865ec541d5b9dd908478a2af1","slow_code":"import collections\nimport math\n\n\ndef debug(arg):\n if __debug__:\n pass\n else:\n import sys\n\n print(arg, file=sys.stderr)\n\n\nN, *A = map(int, open(0).read().split())\na = dict(enumerate(A, 1))\n\ndp = collections.defaultdict(lambda: -float(\"inf\"))\ndp[0, 0] = 0\ndp[1, 0] = 0\ndp[1, 1] = a[1]\nfor i in range(2, N + 1):\n jj = range(max(math.floor(i // 2 - 1), 1), math.ceil((i + 1) // 2) + 1)\n debug(jj)\n for j in jj:\n x = dp[i - 2, j - 1] + a[i]\n y = dp[i - 1, j]\n dp[i, j] = max(x, y)\n debug([i - 2, j - 1])\n debug([i - 1, j])\n debug([i, j])\n debug(dp[i, j])\nprint(dp[N, N // 2])\n","fast_code":"N = int(eval(input()))\nA = list(map(int, input().split()))\nINF = 10**18\ndp0 = 0\ndp1 = -INF\ndp2 = -INF\nfor i, a in enumerate(A):\n if i % 2 == 0:\n dp1 = max(dp1, dp0)\n dp0 += a\n dp2 += a\n else:\n dp2 = max(dp2, dp1)\n dp1 += a\nif N % 2 == 1:\n print((max(dp1, dp2)))\nelse:\n print((max(dp0, dp1)))\n"} +{"fast_code_id":"66246b4e7ebc7638aa6316cd1d0d04c5f1b9ee22288c88f749f852eeca0f1e44","fast_id":"p04006_66246b4e7ebc7638aa6316cd1d0d04c5f1b9ee22288c88f749f852eeca0f1e44","language":"python","measured_fast_code_id":"66246b4e7ebc7638aa6316cd1d0d04c5f1b9ee22288c88f749f852eeca0f1e44","measured_slow_code_id":"91e1e2c740659f8110b6da7065d298174d653edb3135242031e3d37884d00c98","measurement_metric":"cpu_instruction_count","pair_id":"python_766b620de62a9b43d54272f6","problem_id":"p04006","slow_code_id":"91e1e2c740659f8110b6da7065d298174d653edb3135242031e3d37884d00c98","slow_id":"p04006_91e1e2c740659f8110b6da7065d298174d653edb3135242031e3d37884d00c98","speedup":4.567423219173453,"stratum":"4-8","sampling_key":"99088e36ca871bfce70b22c2df3428b174cb732b77f666a8b13d4413538a8493","slow_code":"import numpy as np\nfrom copy import deepcopy\n\nN, x = list(map(int, input().split()))\nA = list(map(int, input().split()))\n\n\ndef myfunc(N, x, A):\n B = deepcopy(np.array(A))\n m = sum(B)\n\n def apppop(A):\n A.append(A[0])\n A.pop(0)\n\n for idx in range(1, N):\n apppop(A)\n np.fmin(B, A, out=B)\n m = min(np.sum(B) + idx * x, m)\n print(int(m))\n\n\nmyfunc(N, x, A)\n","fast_code":"n, x = [int(i) for i in input().split()]\nA = [int(i) for i in input().split()]\nB = A[:]\nans = sum(A)\nfor i in range(1, n):\n for j in range(n):\n B[j] = min(B[j], A[j - i])\n ans = min(ans, sum(B) + i * x)\nprint(ans)\n"} +{"fast_code_id":"97556690d513456c9ecb92c1b0f9c52684722af86d716cd223787efd61ba6821","fast_id":"p03343_8c0f5cb72d509cabc152a5e30ccbf7ae6a6def6056db990769f92e5a2c532ff5","language":"python","measured_fast_code_id":"8c0f5cb72d509cabc152a5e30ccbf7ae6a6def6056db990769f92e5a2c532ff5","measured_slow_code_id":"82a82df6da7774cec40f4241c1fccb3b14eeb548bb1f347896bc72000e6d9b41","measurement_metric":"cpu_instruction_count","pair_id":"python_767da73d5403dfd333c2a864","problem_id":"p03343","slow_code_id":"82a82df6da7774cec40f4241c1fccb3b14eeb548bb1f347896bc72000e6d9b41","slow_id":"p03343_82a82df6da7774cec40f4241c1fccb3b14eeb548bb1f347896bc72000e6d9b41","speedup":7.799046721054824,"stratum":"4-8","sampling_key":"168f0fc04688a93e471931bd62ed836d872fdf6a894156e674b54120617b05c6","slow_code":"N, K, Q = list(map(int, input().split()))\na = list(map(int, input().split()))\nans = float(\"inf\")\nfor i in range(N):\n tmp = []\n rec = []\n for j in range(N):\n if a[i] <= a[j]:\n tmp.append(a[j])\n else:\n if len(tmp) >= K:\n tmp = sorted(tmp)\n rec += tmp[: len(tmp) - K + 1]\n tmp = []\n if len(tmp) >= K:\n tmp = sorted(tmp)\n rec += tmp[: len(tmp) - K + 1]\n if Q <= len(rec):\n rec = sorted(rec)\n ans = min(ans, rec[Q - 1] - rec[0])\nprint(ans)\n","fast_code":"inf = 10**9\nn, k, q = list(map(int, input().split()))\na = tuple(map(int, input().split()))\nans = inf\nfor min_ in sorted(set(a)):\n res = []\n seq = 0\n for ind, a_ in enumerate(a):\n if a_ >= min_:\n seq += 1\n else:\n if seq >= k:\n sequence_le_k = a[ind - seq : ind]\n pick = seq - k + 1\n res.extend(sorted(sequence_le_k)[:pick])\n seq = 0\n else:\n if seq >= k:\n sequence_le_k = a[-seq:]\n pick = seq - k + 1\n res.extend(sorted(sequence_le_k)[:pick])\n if len(res) < q:\n continue\n res.sort()\n ans = min(ans, res[q - 1] - min_)\nprint(ans)\n"} +{"fast_code_id":"8b1ea3952a24a35297766c5a62ef16e111b8ba7078307cfbdf79e92154a780e0","fast_id":"p03183_8b1ea3952a24a35297766c5a62ef16e111b8ba7078307cfbdf79e92154a780e0","language":"python","measured_fast_code_id":"8b1ea3952a24a35297766c5a62ef16e111b8ba7078307cfbdf79e92154a780e0","measured_slow_code_id":"961ff7e33dcf41c91be9ccd5c27fe0c80e6fd0d2467fec260e8393b575caab59","measurement_metric":"cpu_instruction_count","pair_id":"python_76a03ae7755f6fe362b33df0","problem_id":"p03183","slow_code_id":"961ff7e33dcf41c91be9ccd5c27fe0c80e6fd0d2467fec260e8393b575caab59","slow_id":"p03183_961ff7e33dcf41c91be9ccd5c27fe0c80e6fd0d2467fec260e8393b575caab59","speedup":4.7121142082933725,"stratum":"4-8","sampling_key":"38737abfbcd5c40ab8e9e08a5cf2b51075cbf481bca188764a24ec6fcce766b8","slow_code":"import sys\n\nsys.setrecursionlimit(2147483647)\nINF = float(\"inf\")\nMOD = 10**9 + 7\ninput = lambda: sys.stdin.readline().rstrip()\n\n\ndef resolve():\n from functools import cmp_to_key\n\n n = int(eval(input()))\n B = [list(map(int, input().split())) for _ in range(n)]\n\n def cmp(a, b):\n va = min(a[1], b[1] - a[0])\n vb = min(b[1], a[1] - b[0])\n if va == vb:\n return 0\n return -1 if (va > vb) else 1\n\n B.sort(key=cmp_to_key(cmp))\n maxS = 20000\n dp = [-INF] * (maxS + 1)\n dp[0] = 0\n for i in range(n):\n w, s, v = B[i]\n ndp = dp[:]\n for total in range(maxS + 1):\n if total <= s and total + s <= maxS:\n ndp[total + w] = max(ndp[total + w], dp[total] + v)\n dp = ndp[:]\n print((max(dp)))\n\n\nresolve()\n","fast_code":"def f(n):\n mx = 0\n dp = [0] * (n * 10**4 + 1)\n bs = [list(map(int, input().split())) for _ in range(n)]\n bs.sort(key=lambda x: x[0] + x[1])\n for w, s, v in bs:\n for i in range(w + s, w - 1, -1):\n dpw = dp[i - w] + v\n if dpw > dp[i]:\n dp[i] = dpw\n if dpw > mx:\n mx = dpw\n print(mx)\n\n\nn = int(eval(input()))\nf(n)\n"} +{"fast_code_id":"3d7776ff2c7a018ac2b014bf30f1a6b662678335e06558907de5ae67d608ca43","fast_id":"p02780_3d7776ff2c7a018ac2b014bf30f1a6b662678335e06558907de5ae67d608ca43","language":"python","measured_fast_code_id":"3d7776ff2c7a018ac2b014bf30f1a6b662678335e06558907de5ae67d608ca43","measured_slow_code_id":"f0e0a2a27a21da5cf3bfa118c0651e9d7851f3f79494b7c4374dbb95d552c6f4","measurement_metric":"cpu_instruction_count","pair_id":"python_76a21dc93aa979c881f587da","problem_id":"p02780","slow_code_id":"f0e0a2a27a21da5cf3bfa118c0651e9d7851f3f79494b7c4374dbb95d552c6f4","slow_id":"p02780_f0e0a2a27a21da5cf3bfa118c0651e9d7851f3f79494b7c4374dbb95d552c6f4","speedup":5.071061582542133,"stratum":"4-8","sampling_key":"64ceeda8629e0f946b6292ccb9ed3231c7c2179123db5ff73acc51dfc8a4d192","slow_code":"class BIT:\n def __init__(self, n):\n self.node = [0 for _ in range(n + 1)]\n\n def add(self, idx, w):\n i = idx\n while i < len(self.node) - 1:\n self.node[i] += w\n i |= i + 1\n\n def sum_(self, idx):\n ret, i = 0, idx - 1\n while i >= 0:\n ret += self.node[i]\n i = (i & (i + 1)) - 1\n return ret\n\n def sum(self, l, r):\n return self.sum_(r) - self.sum_(l)\n\n\nn, k = list(map(int, input().split()))\ntree = BIT(n)\np = [int(x) for x in input().split()]\nfor i in range(n):\n tree.add(i, (1 + p[i]) / 2)\nans = 0\nfor i in range(n - k + 1):\n ans = max(ans, tree.sum(i, i + k))\nprint(ans)\n","fast_code":"N, K = list(map(int, input().split()))\np = list(map(int, input().split()))\nP = [(1 + p[i]) / 2 for i in range(N)]\nans = sum(P[:K])\ntmp = ans\nfor i in range(N - K):\n tmp = tmp - P[i] + P[i + K]\n ans = max(ans, tmp)\nprint(ans)\n"} +{"fast_code_id":"87326582573696ec94eadc988d1378c44f931bc8451abc2e74270dd3af96435c","fast_id":"p03183_87326582573696ec94eadc988d1378c44f931bc8451abc2e74270dd3af96435c","language":"python","measured_fast_code_id":"87326582573696ec94eadc988d1378c44f931bc8451abc2e74270dd3af96435c","measured_slow_code_id":"961ff7e33dcf41c91be9ccd5c27fe0c80e6fd0d2467fec260e8393b575caab59","measurement_metric":"cpu_instruction_count","pair_id":"python_76abeee129b0d05beea315b3","problem_id":"p03183","slow_code_id":"961ff7e33dcf41c91be9ccd5c27fe0c80e6fd0d2467fec260e8393b575caab59","slow_id":"p03183_961ff7e33dcf41c91be9ccd5c27fe0c80e6fd0d2467fec260e8393b575caab59","speedup":3.2598300262328697,"stratum":"2-4","sampling_key":"ad446006561ac56f12dcb2d894326a8cd6d4623271b46ec9873791391886d240","slow_code":"import sys\n\nsys.setrecursionlimit(2147483647)\nINF = float(\"inf\")\nMOD = 10**9 + 7\ninput = lambda: sys.stdin.readline().rstrip()\n\n\ndef resolve():\n from functools import cmp_to_key\n\n n = int(eval(input()))\n B = [list(map(int, input().split())) for _ in range(n)]\n\n def cmp(a, b):\n va = min(a[1], b[1] - a[0])\n vb = min(b[1], a[1] - b[0])\n if va == vb:\n return 0\n return -1 if (va > vb) else 1\n\n B.sort(key=cmp_to_key(cmp))\n maxS = 20000\n dp = [-INF] * (maxS + 1)\n dp[0] = 0\n for i in range(n):\n w, s, v = B[i]\n ndp = dp[:]\n for total in range(maxS + 1):\n if total <= s and total + s <= maxS:\n ndp[total + w] = max(ndp[total + w], dp[total] + v)\n dp = ndp[:]\n print((max(dp)))\n\n\nresolve()\n","fast_code":"def f(n):\n dp = [0] * (n * 10**4 + 1)\n bs = [list(map(int, input().split())) for _ in range(n)]\n bs.sort(key=lambda x: x[0] + x[1])\n for w, s, v in bs:\n for i in range(w + s, w - 1, -1):\n dpw = dp[i - w] + v\n if dpw > dp[i]:\n dp[i] = dpw\n print((max(dp)))\n\n\nn = int(eval(input()))\nf(n)\n"} +{"fast_code_id":"7e06929601a1851966d2b62fd0a3ad5e22204fad82ba6574b1c05ce567f7fba9","fast_id":"p02783_7e06929601a1851966d2b62fd0a3ad5e22204fad82ba6574b1c05ce567f7fba9","language":"python","measured_fast_code_id":"7e06929601a1851966d2b62fd0a3ad5e22204fad82ba6574b1c05ce567f7fba9","measured_slow_code_id":"184009488c3f9f1105e8c0ddedd3260f6b8f0dac17d692456499911136230497","measurement_metric":"cpu_instruction_count","pair_id":"python_76d048e8ad6e74fe43bcc2b6","problem_id":"p02783","slow_code_id":"184009488c3f9f1105e8c0ddedd3260f6b8f0dac17d692456499911136230497","slow_id":"p02783_184009488c3f9f1105e8c0ddedd3260f6b8f0dac17d692456499911136230497","speedup":32.430847025698675,"stratum":"8+","sampling_key":"022441ae724686a90ecab8d85c320c40f74e40b24f366db643cff254a57d1612","slow_code":"import itertools\nimport math\nimport fractions\nimport functools\n\nh, a = list(map(int, input().split()))\nprint((math.ceil(h / a)))\n","fast_code":"h, a = list(map(int, input().split()))\ni = 0\nwhile i < 10**4:\n i += 1\n h = h - a\n if h <= 0:\n print(i)\n break\n"} +{"fast_code_id":"a0b3de80bc7acc9df120b6ca6c34147272ba3b5d865844e4abc2f24345e96295","fast_id":"p00053_a0b3de80bc7acc9df120b6ca6c34147272ba3b5d865844e4abc2f24345e96295","language":"python","measured_fast_code_id":"a0b3de80bc7acc9df120b6ca6c34147272ba3b5d865844e4abc2f24345e96295","measured_slow_code_id":"7130bb62b43d2905d9cdb1190486ed076acf2c798a1bd9a7e922a3d44800a16f","measurement_metric":"cpu_instruction_count","pair_id":"python_77c5b740c779c3f000d132f4","problem_id":"p00053","slow_code_id":"7130bb62b43d2905d9cdb1190486ed076acf2c798a1bd9a7e922a3d44800a16f","slow_id":"p00053_7130bb62b43d2905d9cdb1190486ed076acf2c798a1bd9a7e922a3d44800a16f","speedup":14.130599721426629,"stratum":"8+","sampling_key":"16c29440b6e43920d7039371d00721fe86225cc9880c2cf7fcf006beaad46616","slow_code":"s = [0]\nM = 10**6\np = [1] * M\nS = 0\nfor i in range(2, M):\n if p[i]:\n for j in range(i * i, M, i):\n p[j] = 0\n S += i\n s.append(S)\nwhile 1:\n n = eval(input())\n if n == 0:\n break\n print(s[n])\n","fast_code":"import math\n\nr = 105000\nsqrt = int(math.sqrt(r))\np = [1] * r\np[0] = 0\nfor i in range(1, sqrt):\n if p[i]:\n p[2 * i + 1 :: i + 1] = [0 for x in range(2 * i + 1, r, i + 1)]\ns = [0 for i in range(11000)]\ns[0] = 2\nk = 1\nfor i in range(2, r):\n if p[i]:\n s[k] = i + 1 + s[k - 1]\n k += 1\nwhile True:\n n = int(input())\n if not n:\n break\n print(s[n - 1])\n"} +{"fast_code_id":"0784c5ee3450e49b36420a34af5664a1f2ed0a6ee4b30bf0643486b763a832c4","fast_id":"p00053_0784c5ee3450e49b36420a34af5664a1f2ed0a6ee4b30bf0643486b763a832c4","language":"python","measured_fast_code_id":"0784c5ee3450e49b36420a34af5664a1f2ed0a6ee4b30bf0643486b763a832c4","measured_slow_code_id":"8cca1698214485b76a9b0e12f8e91dd9d3daa2c366ec968e4e5180fe1f6d3e7b","measurement_metric":"cpu_instruction_count","pair_id":"python_77ee1b1609f9d2689794b976","problem_id":"p00053","slow_code_id":"8cca1698214485b76a9b0e12f8e91dd9d3daa2c366ec968e4e5180fe1f6d3e7b","slow_id":"p00053_8cca1698214485b76a9b0e12f8e91dd9d3daa2c366ec968e4e5180fe1f6d3e7b","speedup":4.637180953256949,"stratum":"4-8","sampling_key":"f9af299571cfa9a4514e52a32bfab9bdf14d3b38478c298163c7558030f2e87c","slow_code":"import math\n\nr = 105000\nsqrt = int(math.sqrt(r))\np = [1] * r\np[0] = 0\nfor i in range(1, sqrt):\n if p[i]:\n for j in range(2 * i + 1, r, i + 1):\n p[j] = 0\nwhile True:\n n = int(input())\n if not n:\n break\n i, num, sum = 0, 0, 0\n while num < n:\n if p[i] == 1:\n num += 1\n sum += i + 1\n i += 1\n print(sum)\n","fast_code":"import math\n\nr = 105000\nsqrt = int(math.sqrt(r))\np = [1] * r\np[0] = 0\nfor i in range(1, sqrt):\n if p[i]:\n for j in range(2 * i + 1, r, i + 1):\n p[j] = 0\nprime = [0 for i in range(11000)]\nj = 0\nfor i in range(len(p)):\n if p[i]:\n prime[j] = i + 1\n j += 1\nwhile True:\n n = int(input())\n if not n:\n break\n print(sum(prime[:n]))\n"} +{"fast_code_id":"91d7192b6602c28b4193083fd98adbb4ab51f35705035e0ca0b95f33dcb32366","fast_id":"p03738_91d7192b6602c28b4193083fd98adbb4ab51f35705035e0ca0b95f33dcb32366","language":"python","measured_fast_code_id":"91d7192b6602c28b4193083fd98adbb4ab51f35705035e0ca0b95f33dcb32366","measured_slow_code_id":"d5baa6a15a1c4a76633ab38a051360a64a827577b6553480f73b85ef4ead3a15","measurement_metric":"cpu_instruction_count","pair_id":"python_77f3c1f612e6eb856f18b460","problem_id":"p03738","slow_code_id":"51f72b7576f2a6693b915f49f43199e2cd6155a4ebab55cc493d3b8dd74e88d8","slow_id":"p03738_d5baa6a15a1c4a76633ab38a051360a64a827577b6553480f73b85ef4ead3a15","speedup":2.4904587955334105,"stratum":"2-4","sampling_key":"4230b91ee0595a14261842b05c1563c1d89cd68c2792ac7bba0a297c64ddc903","slow_code":"import math\n\nif __name__ == \"__main__\":\n a = input()\n b = input()\n if len(a) > len(b):\n print(\"GREATER\")\n elif len(a) < len(b):\n print(\"LESS\")\n elif len(a) == len(b):\n for i in range(len(a)):\n if a[i] > b[i]:\n print(\"GREATER\")\n break\n elif a[i] < b[i]:\n print(\"LESS\")\n break\n elif a[i] == b[i] and i == len(a) - 1:\n print(\"EQUAL\")\n","fast_code":"a = eval(input())\nb = eval(input())\nprint(a < b and \"LESS\" or a > b and \"GREATER\" or \"EQUAL\")\n"} +{"fast_code_id":"4a2a5ca5797cf19089d33a895e8164c8cf0ce9705f8e9007ee45208bdbc6c162","fast_id":"p02793_4a2a5ca5797cf19089d33a895e8164c8cf0ce9705f8e9007ee45208bdbc6c162","language":"python","measured_fast_code_id":"4a2a5ca5797cf19089d33a895e8164c8cf0ce9705f8e9007ee45208bdbc6c162","measured_slow_code_id":"66d145443a372a5a43407dc9cf71d71447bec89f203c9422197e66c8dd97343d","measurement_metric":"cpu_instruction_count","pair_id":"python_788b03fbc714409f660477d0","problem_id":"p02793","slow_code_id":"66d145443a372a5a43407dc9cf71d71447bec89f203c9422197e66c8dd97343d","slow_id":"p02793_66d145443a372a5a43407dc9cf71d71447bec89f203c9422197e66c8dd97343d","speedup":4.216280808561572,"stratum":"4-8","sampling_key":"6d6622a4ffcb05ae34ecde785dfac1f5135324769eb7bb96f5324669d9864015","slow_code":"class PrimeOptimizer:\n def __init__(self, MAX_NUM=10**3):\n is_prime = [True] * MAX_NUM\n is_prime[0] = False\n is_prime[1] = False\n primes = []\n for i in range(MAX_NUM):\n if is_prime[i]:\n primes.append(i)\n for j in range(2 * i, MAX_NUM, i):\n is_prime[j] = False\n self.primes = primes\n\n def prime_factorization(self, x):\n res = {}\n for prime in self.primes:\n while x % prime == 0:\n if not prime in res:\n res[prime] = 0\n res[prime] += 1\n x //= prime\n if x > 1:\n res[x] = 1\n return res\n\n\nMOD = 10**9 + 7\n\n\ndef mod_pow(p, q):\n res = 1\n while q:\n if q & 1:\n res = (res * p) % MOD\n p = (p * p) % MOD\n q //= 2\n return res\n\n\ndef mod_inv(p):\n return mod_pow(p, MOD - 2)\n\n\ndef solve(n, a):\n primeOpt = PrimeOptimizer()\n D = {}\n for i in range(n):\n prime_num_mapping = primeOpt.prime_factorization(a[i])\n for prime, num in list(prime_num_mapping.items()):\n if not prime in D:\n D[prime] = 0\n D[prime] = max(D[prime], num)\n L = 1\n for prime, num in list(D.items()):\n L = (L * mod_pow(prime, num)) % MOD\n res = sum([L * mod_inv(x) % MOD for x in a])\n return res % MOD\n\n\nN = int(eval(input()))\nA = list(map(int, input().split()))\nprint((solve(N, A)))\n","fast_code":"def gcd(a, b):\n while b:\n a, b = b, a % b\n return a\n\n\ndef lcm(a, b):\n return a * b // gcd(a, b)\n\n\nn = int(eval(input()))\na = list(map(int, input().split()))\nans = 0\nmod = 10**9 + 7\nl = a[0]\nfor i in range(1, n):\n l = lcm(l, a[i])\nl %= mod\nfor i in a:\n ans += l * pow(i, mod - 2, mod) % mod\n ans %= mod\nprint(ans)\n"} +{"fast_code_id":"70ddd5f840b4cf045630f383c5a4dc0b67936d1255ea8e844b2833042d45ffc1","fast_id":"p03025_afdc02d7fb2abeb1970c2a5c2791e7792fd3f3e6fc1ceb09e19fccefdfb05385","language":"python","measured_fast_code_id":"afdc02d7fb2abeb1970c2a5c2791e7792fd3f3e6fc1ceb09e19fccefdfb05385","measured_slow_code_id":"7e48e149e0a88356f55ffb6f171c7d7feede92e147ae91dd3c8c063e96af86ff","measurement_metric":"cpu_instruction_count","pair_id":"python_78a695150b29f96e933370c5","problem_id":"p03025","slow_code_id":"b2e0449d7a2944f7ba4d2cde9547b576cefa6b07e19d4a824aebb0b7d058a68c","slow_id":"p03025_7e48e149e0a88356f55ffb6f171c7d7feede92e147ae91dd3c8c063e96af86ff","speedup":7.0684479937373474,"stratum":"4-8","sampling_key":"a59b07c9f8a6917089d5f77e5d356eee662862697ff569deda907300092cf316","slow_code":"N, A, B, C = list(map(int, input().split()))\nmod = 10**9 + 7\n\n\nFACT = [1, 1]\nFACT_INV = [1, 1]\nfor i in range(2, 2 * 10**5 + 1):\n FACT.append(FACT[-1] * i % mod)\n FACT_INV.append(FACT_INV[-1] * pow(i, mod - 2, mod) % mod)\n\n\ndef Combi(N, K):\n return FACT[N] * FACT_INV[N - K] * FACT_INV[K] % mod\n\n\nANS = 0\nSUM = A + B\nA_n = pow(A, N, mod) * pow(pow(SUM, mod - 2, mod), N, mod) % mod\nB_n = pow(B, N, mod) * pow(pow(SUM, mod - 2, mod), N, mod) % mod\nSUMINV = pow(SUM, mod - 2, mod)\nfor i in range(N):\n ANS = (\n ANS\n + (A_n * pow(B, i, mod) + B_n * pow(A, i, mod))\n * Combi(N - 1 + i, i)\n * pow(SUMINV, i, mod)\n * (N + i)\n ) % mod\nprint((ANS * 100 * pow(100 - C, mod - 2, mod) % mod))\n","fast_code":"class Combination:\n\n def __init__(self, n, MOD):\n self.fact = [1]\n for i in range(1, n + 1):\n self.fact.append(self.fact[-1] * i % MOD)\n self.inv_fact = [pow(self.fact[i], MOD - 2, MOD) for i in range(n + 1)]\n self.MOD = MOD\n\n def factorial(self, k):\n return self.fact[k]\n\n def inverse_factorial(self, k):\n return self.inv_fact[k]\n\n def combination(self, k, r):\n return (self.fact[k] * self.inv_fact[k - r] * self.inv_fact[r]) % self.MOD\n\n\nfrom fractions import Fraction\n\nMOD = 10**9 + 7\nn, a, b, c = list(map(int, input().split()))\n\ncomb = Combination(2 * n, MOD)\nmod_li = [1]\nfor i in range(1, 2 * n + 1):\n mod_li.append(mod_li[-1] * (a + b) % MOD)\np1 = [1]\np2 = [1]\nfor i in range(1, n + 1):\n p1.append((p1[-1] * a) % MOD)\n p2.append((p2[-1] * b) % MOD)\nq = mod_li[2 * n - 1]\np = 0\nfor i in range(n):\n tmp_bunshi = (\n (n + i) * (mod_li[n - i - 1]) * p1[n] * p2[i] * comb.combination(n - 1 + i, i)\n )\n tmp_bunshi += (\n (n + i) * (mod_li[n - i - 1]) * p2[n] * p1[i] * comb.combination(n - 1 + i, i)\n )\n p += tmp_bunshi\n p %= MOD\np *= 100\nq *= a + b\nans = Fraction(p, q)\np = ans.numerator\nq = ans.denominator\nprint(((pow(q, MOD - 2, MOD) * p) % MOD))\n"} +{"fast_code_id":"385f918e70558d30ce24cedf0de5f4a96a7aad60475bd5eec62a4ce0ebe4edee","fast_id":"p02881_385f918e70558d30ce24cedf0de5f4a96a7aad60475bd5eec62a4ce0ebe4edee","language":"python","measured_fast_code_id":"385f918e70558d30ce24cedf0de5f4a96a7aad60475bd5eec62a4ce0ebe4edee","measured_slow_code_id":"cf998e72c1135a595d6c563a4a1ff5a2952087ae7ea9606342b715a39fa95719","measurement_metric":"cpu_instruction_count","pair_id":"python_78b889ef8263d04a84296e5e","problem_id":"p02881","slow_code_id":"cf998e72c1135a595d6c563a4a1ff5a2952087ae7ea9606342b715a39fa95719","slow_id":"p02881_cf998e72c1135a595d6c563a4a1ff5a2952087ae7ea9606342b715a39fa95719","speedup":7.835467818237936,"stratum":"4-8","sampling_key":"2936717f16ce4140b9ca68102110df5eff21c9d5d71e07a561cc0a5816ed6e78","slow_code":"n = int(eval(input()))\nmini = float(\"inf\")\nfor i in range(1, int(n**0.5) + 1):\n if n % i == 0:\n mini = min(i + (n / i) - 2, mini)\nprint((int(mini)))\n","fast_code":"N = int(eval(input()))\nx = int(N**0.5)\nfor i in range(x, 0, -1):\n if N % i == 0:\n y = N // i\n break\nans = N // y + y - 2\nprint(ans)\n"} +{"fast_code_id":"ecf388e097fdf4731a2ffbc914b52c1b309da61cba2083e3b54a7133b06af3b6","fast_id":"p03767_ecf388e097fdf4731a2ffbc914b52c1b309da61cba2083e3b54a7133b06af3b6","language":"python","measured_fast_code_id":"ecf388e097fdf4731a2ffbc914b52c1b309da61cba2083e3b54a7133b06af3b6","measured_slow_code_id":"7693ad55686e6fd618fa19be5402464b2c1d8a6534c46b08c3072eed6c243853","measurement_metric":"cpu_instruction_count","pair_id":"python_78e4be42c4af034440c80326","problem_id":"p03767","slow_code_id":"7693ad55686e6fd618fa19be5402464b2c1d8a6534c46b08c3072eed6c243853","slow_id":"p03767_7693ad55686e6fd618fa19be5402464b2c1d8a6534c46b08c3072eed6c243853","speedup":6.363325067113005,"stratum":"4-8","sampling_key":"4386b79ed7d4e87590324b6d2cedf22a1c058f2978067a179200da46970b9736","slow_code":"from collections import Counter, defaultdict, deque\nfrom heapq import heappop, heappush, heapify\nimport sys, bisect, math, itertools, fractions, pprint\n\nsys.setrecursionlimit(10**8)\nmod = 10**9 + 7\nINF = float(\"inf\")\n\n\ndef inp():\n return int(sys.stdin.readline())\n\n\ndef inpl():\n return list(map(int, sys.stdin.readline().split()))\n\n\nn = inp()\na = inpl()\na.sort(reverse=True)\ncnt = n\nind = 0\nres = 0\nwhile cnt:\n if ind % 2:\n res += a[ind]\n cnt -= 1\n ind += 1\nprint(res)\n","fast_code":"n = int(eval(input()))\na = list(map(int, input().split()))\na.sort()\nprint((sum(a[n::2])))\n"} +{"fast_code_id":"8f42b4872f98eb3f3385abb48480c50477cdfbff1392ba31280beb5eb0cc1a8e","fast_id":"p03294_31ce07bfd4545257089cf13ed9b634ee501559f8aec3bb9ed83c434ac8b87f36","language":"python","measured_fast_code_id":"31ce07bfd4545257089cf13ed9b634ee501559f8aec3bb9ed83c434ac8b87f36","measured_slow_code_id":"13a0acff6be960ac2d9102d9dbcb9b4a40285e0396d51e99ee1149098593acf0","measurement_metric":"cpu_instruction_count","pair_id":"python_78f872e8ebf189d0e6393aed","problem_id":"p03294","slow_code_id":"13a0acff6be960ac2d9102d9dbcb9b4a40285e0396d51e99ee1149098593acf0","slow_id":"p03294_13a0acff6be960ac2d9102d9dbcb9b4a40285e0396d51e99ee1149098593acf0","speedup":4.3114766284156465,"stratum":"4-8","sampling_key":"c3b3e87aae401702439059a95de03fa2a72154edd18ee2db87490fa8a710fa4e","slow_code":"import math\n\nn = int(eval(input()))\na = list(map(int, input().split()))\ncommon_num = 1\nfor num in a:\n common_num = (common_num * num) // math.gcd(common_num, num)\ntotal = 0\nfor num in a:\n total += (common_num - 1) % num\nprint(total)\n","fast_code":"N = eval(input())\nA = [int(x) for x in input().split()]\nprint((sum(x - 1 for x in A)))\n"} +{"fast_code_id":"fe7afb47e68a41016ca3dd9d37a718d585b4472d520f285fd602feac361ab4b2","fast_id":"p03997_fe7afb47e68a41016ca3dd9d37a718d585b4472d520f285fd602feac361ab4b2","language":"python","measured_fast_code_id":"fe7afb47e68a41016ca3dd9d37a718d585b4472d520f285fd602feac361ab4b2","measured_slow_code_id":"89a2c802763da09caab2310090bce1a3bd8e29ef5b06b86a35dfdaa7e9205bfe","measurement_metric":"cpu_instruction_count","pair_id":"python_7952fe6d60ed52779d9ea837","problem_id":"p03997","slow_code_id":"b35e7a11385fd8d3cfedbd5906973a53bac70684dd98a901c660194c6fcfc1db","slow_id":"p03997_89a2c802763da09caab2310090bce1a3bd8e29ef5b06b86a35dfdaa7e9205bfe","speedup":16.515085624995738,"stratum":"8+","sampling_key":"14a222a65b3b8afce114e1f8faa4cc0c810a945f5a18eefdfdb8f76d3a9f8468","slow_code":"from collections import deque\nfrom heapq import heapify, heappop, heappush, heappushpop\nfrom copy import copy, deepcopy\nfrom itertools import product, permutations, combinations, combinations_with_replacement\nfrom collections import defaultdict, Counter\nfrom bisect import bisect_left, bisect_right\n\n\nfrom functools import reduce\nfrom pprint import pprint\n\nINF = float(\"inf\")\n\n\ndef myinput():\n return list(map(int, input().split()))\n\n\ndef mylistinput(n):\n return [list(myinput()) for _ in range(n)]\n\n\ndef mycol(data, col):\n return [row[col] for row in data]\n\n\ndef mysort(data, col, reverse_flag):\n data.sort(key=lambda x: x[col], reverse=reverse_flag)\n return data\n\n\ndef mymax(data):\n M = -1 * float(\"inf\")\n for i in range(len(data)):\n m = max(data[i])\n M = max(M, m)\n return M\n\n\ndef mymin(data):\n m = float(\"inf\")\n for i in range(len(data)):\n M = min(data[i])\n m = min(m, M)\n return m\n\n\ndef mycount(ls, x):\n\n l = bisect_left(ls, x)\n r = bisect_right(ls, x)\n return r - l\n\n\ndef myoutput(ls, space=True):\n if space:\n if len(ls) == 0:\n print(\" \")\n elif type(ls[0]) == str:\n print((\" \".join(ls)))\n elif type(ls[0]) == int:\n print((\" \".join(map(str, ls))))\n else:\n print(\"Output Error\")\n else:\n if len(ls) == 0:\n print(\"\")\n elif type(ls[0]) == str:\n print((\"\".join(ls)))\n elif type(ls[0]) == int:\n print((\"\".join(map(str, ls))))\n else:\n print(\"Output Error\")\n\n\na = int(eval(input()))\nb = int(eval(input()))\nh = int(eval(input()))\nans = (a + b) * h / 2\nprint((int(ans)))\n","fast_code":"a = int(eval(input()))\nb = int(eval(input()))\nh = int(eval(input()))\nans = (a + b) * h // 2\nprint(ans)\n"} +{"fast_code_id":"bcdd6c5a04ef827b58b6607368ffa34b279e2ae37471e8105f1a35498de66f88","fast_id":"p03112_bcdd6c5a04ef827b58b6607368ffa34b279e2ae37471e8105f1a35498de66f88","language":"python","measured_fast_code_id":"bcdd6c5a04ef827b58b6607368ffa34b279e2ae37471e8105f1a35498de66f88","measured_slow_code_id":"5ee88bb22a8715381d1db1eaa76cc6289c67db4f88cb4c3cf8b7900c103ceea0","measurement_metric":"cpu_instruction_count","pair_id":"python_79b238c56f91bfb2eb950382","problem_id":"p03112","slow_code_id":"70a0838fb9039f9a0191353f573ddcfeb432e9116549baec081c38786cddfa54","slow_id":"p03112_5ee88bb22a8715381d1db1eaa76cc6289c67db4f88cb4c3cf8b7900c103ceea0","speedup":2.682887866422792,"stratum":"2-4","sampling_key":"0ff03c4af2c183c96d1e6a86954da2273328425bf0c6134a111790be0f600f4d","slow_code":"from bisect import bisect_right\n\nA, B, Q = list(map(int, input().split()))\nINF = 10**18\ns = [-INF]\nt = [-INF]\nfor _ in range(A):\n s.append(int(eval(input())))\ns.append(INF)\nfor _ in range(B):\n t.append(int(eval(input())))\nt.append(INF)\nx = list(map(int, (eval(input()) for _ in range(Q))))\nfor y in x:\n i = bisect_right(s, y)\n j = bisect_right(t, y)\n\n ans = min(\n max(abs(s[i] - y), abs(t[j] - y)),\n max(abs(s[i - 1] - y), abs(t[j - 1] - y)),\n 2 * min(abs(s[i] - y), abs(t[j - 1] - y))\n + max(abs(s[i] - y), abs(t[j - 1] - y)),\n 2 * min(abs(s[i - 1] - y), abs(t[j] - y))\n + max(abs(s[i - 1] - y), abs(t[j] - y)),\n )\n print(ans)\n","fast_code":"import bisect\nimport sys\n\nSENTINEL = 10**12\na, b, q = list(map(int, input().split()))\nlines = sys.stdin.readlines()\nsss = [-SENTINEL] + list(map(int, lines[:a])) + [SENTINEL]\nttt = [-SENTINEL] + list(map(int, lines[a : a + b])) + [SENTINEL]\nxxx = list(map(int, lines[a + b :]))\nnearest_temples = [SENTINEL] + [0] * a + [SENTINEL]\nnearest_shrines = [SENTINEL] + [0] * b + [SENTINEL]\nfor i, s in enumerate(sss[1:-1], start=1):\n ti = bisect.bisect(ttt, s)\n nearest_temples[i] = min(ttt[ti] - s, s - ttt[ti - 1])\nfor i, t in enumerate(ttt[1:-1], start=1):\n si = bisect.bisect(sss, t)\n nearest_shrines[i] = min(sss[si] - t, t - sss[si - 1])\nbuf = []\nfor x in xxx:\n si = bisect.bisect(sss, x)\n ti = bisect.bisect(ttt, x)\n ans = min(\n x - sss[si - 1] + nearest_temples[si - 1],\n sss[si] - x + nearest_temples[si],\n x - ttt[ti - 1] + nearest_shrines[ti - 1],\n ttt[ti] - x + nearest_shrines[ti],\n )\n buf.append(ans)\nprint((\"\\n\".join(map(str, buf))))\n"} +{"fast_code_id":"84450493432d4ac002145cf09b3dd6ed1e82364df1f198dbeae66cc936fb1989","fast_id":"p02683_84450493432d4ac002145cf09b3dd6ed1e82364df1f198dbeae66cc936fb1989","language":"python","measured_fast_code_id":"84450493432d4ac002145cf09b3dd6ed1e82364df1f198dbeae66cc936fb1989","measured_slow_code_id":"eb82795067db4535f92eb0432054ed7d6961514cf3395d99fe6cf556965675ad","measurement_metric":"cpu_instruction_count","pair_id":"python_79f590cc44ff846e54ab1a6d","problem_id":"p02683","slow_code_id":"cfb07918685f743bbc33c1600f6b6492a32a7cb9a0df40fa6957f938c00433ba","slow_id":"p02683_eb82795067db4535f92eb0432054ed7d6961514cf3395d99fe6cf556965675ad","speedup":79.2091620548258,"stratum":"8+","sampling_key":"0982d959b7a95341e4facbbea130e5ef8873026d1236a4fd41aa88dcc7d54aea","slow_code":"import numpy as np\nimport sys\n\nn, m, x = list(map(int, input().split()))\narr = np.array([list(map(int, input().split())) for i in range(n)])\nc = arr.T[0]\na = arr.T[1:].T\nans = np.inf\nfor i in range(2**n):\n ability = np.zeros(m, np.int64)\n cost = 0\n for j in range(n):\n if (i >> j) & 1:\n ability += a[j]\n cost += c[j]\n\n if all(i >= x for i in ability):\n ans = min(ans, cost)\nans = -1 if ans == np.inf else ans\nprint(ans)\n","fast_code":"(N, M, X), *T = [[*list(map(int, line.split()))] for line in open(0)]\nans = 12345678\nfor bit in range(1, 2**N):\n t = [T[i] for i in range(N) if bit & (1 << i)]\n c, *a = list(map(sum, list(zip(*t))))\n if all(e >= X for e in a):\n ans = min(ans, c)\nprint((-1 if ans == 12345678 else ans))\n"} +{"fast_code_id":"49f3252eb08400b5df813fb5232a5021d63079ba5b8cdc64ab64ce10c9f94ff9","fast_id":"p03803_49f3252eb08400b5df813fb5232a5021d63079ba5b8cdc64ab64ce10c9f94ff9","language":"python","measured_fast_code_id":"49f3252eb08400b5df813fb5232a5021d63079ba5b8cdc64ab64ce10c9f94ff9","measured_slow_code_id":"0bd5df2a157ba82c7c25ec618ddd2b8ac3a7b93747b5c4b4114a2cd42e8e257e","measurement_metric":"cpu_instruction_count","pair_id":"python_7a021611d643779f89d58b16","problem_id":"p03803","slow_code_id":"0bd5df2a157ba82c7c25ec618ddd2b8ac3a7b93747b5c4b4114a2cd42e8e257e","slow_id":"p03803_0bd5df2a157ba82c7c25ec618ddd2b8ac3a7b93747b5c4b4114a2cd42e8e257e","speedup":3.623428417272156,"stratum":"2-4","sampling_key":"f08f8310bb3ca0414cdfbc8ce92c3d2b8382e863176bb88a35c597976b44db64","slow_code":"import sys, math\nfrom functools import lru_cache\nfrom itertools import accumulate\n\nsys.setrecursionlimit(10**9)\nMOD = 10**9 + 7\n\n\ndef input():\n return sys.stdin.readline()[:-1]\n\n\ndef mi():\n return list(map(int, input().split()))\n\n\ndef ii():\n return int(eval(input()))\n\n\ndef i2(n):\n tmp = [list(mi()) for i in range(n)]\n return [list(i) for i in zip(*tmp)]\n\n\nA, B = mi()\nif A == B:\n print(\"Draw\")\nelif A == 1:\n print(\"Alice\")\nelif B == 1:\n print(\"Bob\")\nelse:\n if A > B:\n print(\"Alice\")\n else:\n print(\"Bob\")\n","fast_code":"a, b = list(map(int, input().split()))\nprint(([\"ADlriacwe\"[a == b :: 2], \"Bob\"][(a - 2) % 13 < (b - 2) % 13]))\n"} +{"fast_code_id":"82bf4f276c0a09fe27a6e4132487b584e11a65cfb83dd419a366bd2029a5d62a","fast_id":"p04006_82bf4f276c0a09fe27a6e4132487b584e11a65cfb83dd419a366bd2029a5d62a","language":"python","measured_fast_code_id":"82bf4f276c0a09fe27a6e4132487b584e11a65cfb83dd419a366bd2029a5d62a","measured_slow_code_id":"91e1e2c740659f8110b6da7065d298174d653edb3135242031e3d37884d00c98","measurement_metric":"cpu_instruction_count","pair_id":"python_7a1218242ee4ebd04e4e4faa","problem_id":"p04006","slow_code_id":"91e1e2c740659f8110b6da7065d298174d653edb3135242031e3d37884d00c98","slow_id":"p04006_91e1e2c740659f8110b6da7065d298174d653edb3135242031e3d37884d00c98","speedup":96.7822623329425,"stratum":"8+","sampling_key":"73b08cb18d860c1e8c4a5c5a97762a8481eeea403d49f9ac66477e5aa518e5bc","slow_code":"import numpy as np\nfrom copy import deepcopy\n\nN, x = list(map(int, input().split()))\nA = list(map(int, input().split()))\n\n\ndef myfunc(N, x, A):\n B = deepcopy(np.array(A))\n m = sum(B)\n\n def apppop(A):\n A.append(A[0])\n A.pop(0)\n\n for idx in range(1, N):\n apppop(A)\n np.fmin(B, A, out=B)\n m = min(np.sum(B) + idx * x, m)\n print(int(m))\n\n\nmyfunc(N, x, A)\n","fast_code":"def read():\n return [int(i) for i in input().split(\" \")]\n\n\nN, x = read()\nA = read()\nans = sum(A)\ntempcost = ans\nBC = A[:]\nfor i in range(1, N):\n BC = [BC[j - 1] if BC[j - 1] < BC[j] else BC[j] for j in range(N)]\n tempcost = x * i + sum(BC)\n if ans > tempcost:\n ans = tempcost\n else:\n break\nprint(ans)\n"} +{"fast_code_id":"548f9d9ba3f56f0798f5a00d5c8c0672634a22c8ab42db59f51b3513ac28d3e4","fast_id":"p03160_548f9d9ba3f56f0798f5a00d5c8c0672634a22c8ab42db59f51b3513ac28d3e4","language":"python","measured_fast_code_id":"548f9d9ba3f56f0798f5a00d5c8c0672634a22c8ab42db59f51b3513ac28d3e4","measured_slow_code_id":"7f209d5d7b0d2bc72ab55ef9c34db57933ddfc0a346f408e2afc1f88416cf97f","measurement_metric":"cpu_instruction_count","pair_id":"python_7ac7fc3252a69f63a107f272","problem_id":"p03160","slow_code_id":"54f397f881a6ae2f88872fe4373ebc15e4056c4fdf6ac63236a75aa3443cd3c5","slow_id":"p03160_7f209d5d7b0d2bc72ab55ef9c34db57933ddfc0a346f408e2afc1f88416cf97f","speedup":4.731628446525761,"stratum":"4-8","sampling_key":"113285614337049437951dbc71fcf555b58baeef8871388023b54071b9c8c5c2","slow_code":"import string\nimport sys\nfrom itertools import chain, dropwhile, takewhile\n\n\ndef read(\n f, *shape, it=chain.from_iterable(sys.stdin), whitespaces=set(string.whitespace)\n):\n def read_word():\n w = lambda c: c in whitespaces\n nw = lambda c: c not in whitespaces\n return f(\"\".join(takewhile(nw, dropwhile(w, it))))\n\n if not shape:\n return read_word()\n elif len(shape) == 1:\n return [read_word() for _ in range(shape[0])]\n elif len(shape) == 2:\n return [[read_word() for _ in range(shape[1])] for _ in range(shape[0])]\n\n\ndef arr(*shape, fill_value=0):\n if len(shape) == 1:\n return [fill_value] * shape[fill_value]\n elif len(shape) == 2:\n return [[fill_value] * shape[1] for _ in range(shape[0])]\n\n\ndef dbg(**kwargs):\n print(\n \", \".join(\"{} = {}\".format(k, repr(v)) for k, v in kwargs.items()),\n file=sys.stderr,\n )\n\n\ndef main():\n n = read(int)\n hs = read(int, n)\n dp = arr(n)\n dp[1] = abs(hs[1] - hs[0])\n for i in range(2, n):\n dp[i] = min(\n dp[i - 1] + abs(hs[i] - hs[i - 1]), dp[i - 2] + abs(hs[i] - hs[i - 2])\n )\n print(dp[-1])\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"n = int(eval(input()))\nhs = list(map(int, input().split()))\na, b = 0, abs(hs[1] - hs[0])\nfor i in range(2, n):\n d1 = a + abs(hs[i] - hs[i - 2])\n d2 = b + abs(hs[i] - hs[i - 1])\n a, b = b, d1 if d1 <= d2 else d2\nprint(b)\n"} +{"fast_code_id":"59bab4d76458b9d52141aa25422a631231c9e446195a30b427396f9e6de3c8eb","fast_id":"p02361_59bab4d76458b9d52141aa25422a631231c9e446195a30b427396f9e6de3c8eb","language":"python","measured_fast_code_id":"59bab4d76458b9d52141aa25422a631231c9e446195a30b427396f9e6de3c8eb","measured_slow_code_id":"dea21260225ec6f4d68880220d2242061ac54f41986fb08741093fbf397db38a","measurement_metric":"cpu_instruction_count","pair_id":"python_7af8a0cf3a0ca4cf10942dbb","problem_id":"p02361","slow_code_id":"68fc94738dddde7b57f71c9dab1a4ead4887b0770aaf9efbc6a509ede5ac8f28","slow_id":"p02361_dea21260225ec6f4d68880220d2242061ac54f41986fb08741093fbf397db38a","speedup":2.0204701497664423,"stratum":"2-4","sampling_key":"46c43af6e6f3ec0dcd9d144d99f9461bb3aa4a969c97ecd4937440f74178303e","slow_code":"import heapq\n\n\nclass Edge:\n def __init__(self, dst, weight):\n self.dst, self.weight = dst, weight\n\n def __lt__(self, e):\n return self.weight > e.weight\n\n\nclass Graph:\n def __init__(self, V):\n self.V = V\n self.E = [[] for _ in range(V)]\n\n def add_edge(self, src, dst, weight):\n self.E[src].append(Edge(dst, weight))\n\n\nclass Node:\n def __init__(self, v, cost):\n self.v, self.cost = v, cost\n\n def __lt__(self, n):\n return self.cost < n.cost\n\n\nclass ShortestPath:\n\n def __init__(self, G, INF=10**9):\n self.G, self.INF = G, INF\n\n def dijkstra(self, start, goal=None):\n que = list()\n self.dist = [self.INF] * self.G.V\n self.prev = [-1] * self.G.V\n self.dist[start] = 0\n heapq.heappush(que, Node(start, 0))\n while len(que) > 0:\n n = heapq.heappop(que)\n if self.dist[n.v] < n.cost:\n continue\n if goal is not None and n.v == goal:\n return\n for e in self.G.E[n.v]:\n if self.dist[n.v] + e.weight < self.dist[e.dst]:\n self.dist[e.dst] = self.dist[n.v] + e.weight\n heapq.heappush(que, Node(e.dst, self.dist[e.dst]))\n self.prev[e.dst] = n.v\n\n def getPath(self, end):\n path = [end]\n while self.prev[end] != -1:\n end = self.prev[end]\n return path[::-1]\n\n\nV, E, start = list(map(int, input().split()))\nG = Graph(V)\nfor _ in range(E):\n s, t, d = list(map(int, input().split()))\n G.add_edge(s, t, d)\nINF = 10**9\nsp = ShortestPath(G, INF)\nsp.dijkstra(start)\nfor i in range(G.V):\n print((\"INF\" if sp.dist[i] == INF else sp.dist[i]))\n","fast_code":"import sys\nfrom heapq import heappush, heappop\n\nreadline = sys.stdin.readline\nV, E, r = list(map(int, readline().split()))\ninf = 10**10\nedges = [[] for _ in [None] * V]\nvertices = [inf] * V\nvertices[r] = 0\nfor _ in [None] * E:\n s, t, d = list(map(int, readline().split()))\n edges[s].append((t, d))\nq = [(0, r)]\nrem = V - 1\nwhile q and rem:\n cost, v = heappop(q)\n if vertices[v] < cost:\n continue\n rem -= 1\n for dest, _cost in edges[v]:\n newcost = cost + _cost\n if vertices[dest] > newcost:\n vertices[dest] = newcost\n heappush(q, (newcost, dest))\nprint((\"\\n\".join([str(n) if n != inf else \"INF\" for n in vertices])))\n"} +{"fast_code_id":"385f918e70558d30ce24cedf0de5f4a96a7aad60475bd5eec62a4ce0ebe4edee","fast_id":"p02881_385f918e70558d30ce24cedf0de5f4a96a7aad60475bd5eec62a4ce0ebe4edee","language":"python","measured_fast_code_id":"385f918e70558d30ce24cedf0de5f4a96a7aad60475bd5eec62a4ce0ebe4edee","measured_slow_code_id":"28eda992eed4d282f61a604cf38592d85120f32b71c9516297db88165c63acfd","measurement_metric":"cpu_instruction_count","pair_id":"python_7bc5ef06614f1c3be4c0a53b","problem_id":"p02881","slow_code_id":"28eda992eed4d282f61a604cf38592d85120f32b71c9516297db88165c63acfd","slow_id":"p02881_28eda992eed4d282f61a604cf38592d85120f32b71c9516297db88165c63acfd","speedup":6.151521995284416,"stratum":"4-8","sampling_key":"73c9ad794ff1a593cbde6ade57b736ea0380ea048632b9b0cf81322c2510fcbd","slow_code":"import sys\n\n\ndef divisors(n):\n res = []\n for i in range(1, int(n**0.5) + 1):\n if n % i:\n continue\n res.append(i)\n res.append(n // i)\n return res\n\n\nn = int(sys.stdin.readline().rstrip())\n\n\ndef main():\n res = divisors(n)\n print((res[-1] + res[-2] - 2))\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"N = int(eval(input()))\nx = int(N**0.5)\nfor i in range(x, 0, -1):\n if N % i == 0:\n y = N // i\n break\nans = N // y + y - 2\nprint(ans)\n"} +{"fast_code_id":"0a2b0f28368d69d7f9a7caf0583898b388fb838ab9df0d734d9469a89241116d","fast_id":"p03476_0a2b0f28368d69d7f9a7caf0583898b388fb838ab9df0d734d9469a89241116d","language":"python","measured_fast_code_id":"0a2b0f28368d69d7f9a7caf0583898b388fb838ab9df0d734d9469a89241116d","measured_slow_code_id":"04049db677f468c331c809085fe1f71be865b70eea78240753e06ca4db53b055","measurement_metric":"cpu_instruction_count","pair_id":"python_7be0fa6949acf5178c0b3620","problem_id":"p03476","slow_code_id":"b2179070bb2e08d4fd95b95ff67b71105cd4dc2d4e6e31ecedf0506d95c233c1","slow_id":"p03476_04049db677f468c331c809085fe1f71be865b70eea78240753e06ca4db53b055","speedup":3.7983535872695082,"stratum":"2-4","sampling_key":"065e06eb964b970f8a4145d09447da0e8e2276dbbf459ba12efc368f135e2fc3","slow_code":"import numpy as np\n\nq = int(eval(input()))\n\nis_prime = np.ones(100001, dtype=int)\nis_prime[0] = 0\nis_prime[1] = 0\nfor i in range(2, 100001):\n if is_prime[i] == 1:\n j = i + i\n while j <= 100000:\n is_prime[j] = 0\n j += i\nlike2017 = [\n 1 if is_prime[i] and is_prime[(i + 1) // 2] else 0 for i in range(0, 100001)\n]\nfor i in range(1, 100001):\n like2017[i] += like2017[i - 1]\nfor i in range(q):\n l, r = list(map(int, input().split()))\n print((like2017[r] - like2017[l - 1]))\n","fast_code":"from collections import defaultdict, deque, Counter\nfrom heapq import heappush, heappop, heapify\nimport math\nimport bisect\nimport random\nfrom itertools import permutations, accumulate, combinations, product\nimport sys\nimport string\nfrom bisect import bisect_left, bisect_right\nfrom math import factorial, ceil, floor, atan2, degrees\nfrom operator import mul\nfrom functools import reduce\n\nsys.setrecursionlimit(10**8)\nINF = float(\"inf\")\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LS():\n return sys.stdin.readline().split()\n\n\ndef S():\n return sys.stdin.readline().strip()\n\n\ndef IR(n):\n return [I() for i in range(n)]\n\n\ndef LIR(n):\n return [LI() for i in range(n)]\n\n\ndef SR(n):\n return [S() for i in range(n)]\n\n\ndef LSR(n):\n return [LS() for i in range(n)]\n\n\ndef SRL(n):\n return [list(S()) for i in range(n)]\n\n\ndef MSRL(n):\n return [[int(j) for j in list(S())] for i in range(n)]\n\n\nmod = 1000000007\n\n\ndef primes(n):\n is_prime = [1] * (n + 1)\n is_prime[0] = 0\n is_prime[1] = 0\n for i in range(2, int(n**0.5) + 1):\n if not is_prime[i]:\n continue\n for j in range(i * 2, n + 1, i):\n is_prime[j] = 0\n return {i for i in range(n + 1) if is_prime[i]}\n\n\nn = 10**5\nprime_set = primes(n)\nq = I()\nC = [0] * (n + 1)\nfor i in range(n + 1):\n if i % 2 and i in prime_set and (i + 1) // 2 in prime_set:\n C[i] = 1\nacc = list(accumulate(C))\nfor i in range(q):\n l, r = LI()\n print((acc[r] - acc[l - 1]))\n"} +{"fast_code_id":"df2fdf64192ea024f21faa2a065a251f9cb6070d08dfe07d31c00dc252617caf","fast_id":"p02706_df2fdf64192ea024f21faa2a065a251f9cb6070d08dfe07d31c00dc252617caf","language":"python","measured_fast_code_id":"df2fdf64192ea024f21faa2a065a251f9cb6070d08dfe07d31c00dc252617caf","measured_slow_code_id":"89bf5646ac16bde646209d2509249ed7377541f5a03b9f9c5553553af3b07c63","measurement_metric":"cpu_instruction_count","pair_id":"python_7c0779e0420a2ef58f5e2df1","problem_id":"p02706","slow_code_id":"89bf5646ac16bde646209d2509249ed7377541f5a03b9f9c5553553af3b07c63","slow_id":"p02706_89bf5646ac16bde646209d2509249ed7377541f5a03b9f9c5553553af3b07c63","speedup":175.1805217412293,"stratum":"8+","sampling_key":"002597fedcbe0f763e5a2a5a1939543456a4389fd32eb478761811ffb4533f44","slow_code":"import numpy as np\nimport math\n\nn, m = list(map(int, input().split()))\nA = list(map(int, input().split()))\na = sum(A)\nif n < a:\n print((-1))\nelse:\n print((n - a))\n","fast_code":"n, m = list(map(int, input().split()))\na = list(map(int, input().split()))\nprint((-1 if n < sum(a) else n - sum(a)))\n"} +{"fast_code_id":"0fbcf304b55cbbfc76d27472c6e0786d4c49d4266d43eb3e6f21d54e1bdb2699","fast_id":"p03013_ca7c3575955efba9f139fb28d4e990f1bba7b12ddabd6997bfd6ebc39eac6922","language":"python","measured_fast_code_id":"ca7c3575955efba9f139fb28d4e990f1bba7b12ddabd6997bfd6ebc39eac6922","measured_slow_code_id":"4a80d25e3e49718fb943ef50228efaa460f0d9079accba468908a8cb7a7eecf9","measurement_metric":"cpu_instruction_count","pair_id":"python_7ccf10dcb3bcfd6668ad7166","problem_id":"p03013","slow_code_id":"4a80d25e3e49718fb943ef50228efaa460f0d9079accba468908a8cb7a7eecf9","slow_id":"p03013_4a80d25e3e49718fb943ef50228efaa460f0d9079accba468908a8cb7a7eecf9","speedup":4.461285491653472,"stratum":"4-8","sampling_key":"7456a75a4d7246cd288d3853b9f9c9001a582bd9b127e69b4330e42b6eb4f15d","slow_code":"MOD = 10**9 + 7\nN, M = list(map(int, input().split()))\na = [int(eval(input())) for k in range(M)]\ndp = [0] * (N + 2)\ndp[0] = 1\nfor e in a:\n dp[e] = -1\nfor k in range(N):\n if dp[k] != -1:\n if dp[k + 1] != -1:\n dp[k + 1] += dp[k]\n dp[k + 1] %= MOD\n if dp[k + 2] != -1:\n dp[k + 2] += dp[k]\n dp[k + 2] %= MOD\nprint((max(0, dp[N])))\n","fast_code":"import sys\n\nN, M = list(map(int, input().split()))\nans = [-1] * (N + 1)\nfor line in sys.stdin:\n ans[int(line)] = 0\nans[0] = 1\nif ans[1]:\n ans[1] = 1\nfor i in range(2, N + 1):\n if ans[i]:\n ans[i] = (ans[i - 1] + ans[i - 2]) % 1000000007\nprint((ans[N]))\n"} +{"fast_code_id":"2e5e82f5584cc030030e61d415776f7f201bf828e97195c468720bf1767a3207","fast_id":"p03331_2e5e82f5584cc030030e61d415776f7f201bf828e97195c468720bf1767a3207","language":"python","measured_fast_code_id":"2e5e82f5584cc030030e61d415776f7f201bf828e97195c468720bf1767a3207","measured_slow_code_id":"153ddd3939958df9731f2cb6a9569dfdd13dde4cae47410105d9d1d355dcbd24","measurement_metric":"cpu_instruction_count","pair_id":"python_7cfbabeeafbbdb04af7090f7","problem_id":"p03331","slow_code_id":"153ddd3939958df9731f2cb6a9569dfdd13dde4cae47410105d9d1d355dcbd24","slow_id":"p03331_153ddd3939958df9731f2cb6a9569dfdd13dde4cae47410105d9d1d355dcbd24","speedup":6025.23560057091,"stratum":"8+","sampling_key":"891a2ac4854c4f1c1a18f98883ee7ea837eab175034f48e0c7d5765df5a566f4","slow_code":"N = int(eval(input()))\nimport numpy as np\n\na = np.arange(N)\na = np.delete(a, 0)\nb = N - a\nnum_arr = []\nfor i in range(len(a)):\n factor_a = [int(x) for x in list(str(a[i]))]\n factor_b = [int(x) for x in list(str(b[i]))]\n num_arr.append(sum(factor_a) + sum(factor_b))\nprint((min(num_arr)))\n","fast_code":"n = int(eval(input()))\ns = 0\nwhile n > 0:\n s += n % 10\n n //= 10\nif s == 1:\n print((10))\nelse:\n print(s)\n"} +{"fast_code_id":"75bc083c3de58ec3448c04919e6f7253b0131fe4e61bf7c18ee35a3ac4325bdb","fast_id":"p00741_75bc083c3de58ec3448c04919e6f7253b0131fe4e61bf7c18ee35a3ac4325bdb","language":"python","measured_fast_code_id":"75bc083c3de58ec3448c04919e6f7253b0131fe4e61bf7c18ee35a3ac4325bdb","measured_slow_code_id":"8dc05be20af5e5075433e403978246b6c79a92c743c71aa185196282e815a1ee","measurement_metric":"cpu_instruction_count","pair_id":"python_7d2b5564e89f2907fb20b381","problem_id":"p00741","slow_code_id":"98d0d93fa34ee5017dabd2c7cc8ffe301917d35141c767ea46a7bc955a0514a7","slow_id":"p00741_8dc05be20af5e5075433e403978246b6c79a92c743c71aa185196282e815a1ee","speedup":3.6052389586982043,"stratum":"2-4","sampling_key":"038d6c19527e24939a61d6df8f7a59062eff3bc9bc3fd4ab36a739372924831c","slow_code":"import sys\nfrom pprint import pprint\n\n\nclass UnionFind:\n def __init__(self):\n self._parent = {}\n self._rank = {}\n self._equiv = {}\n\n def _find(self, x):\n if self._parent[x] == x:\n return self._parent[x]\n else:\n p = self._find(self._parent[x])\n self._parent[x] = p\n return p\n\n def _set_parent(self, child, parent):\n self._parent[child] = parent\n self._equiv[parent].update(self._equiv.pop(child))\n\n def _union(self, x, y):\n x = self._find(x)\n y = self._find(y)\n if x == y:\n return\n if self._rank[x] > self._rank[y]:\n self._set_parent(y, x)\n elif self._rank[x] < self._rank[y]:\n self._set_parent(x, y)\n else:\n self._set_parent(x, y)\n self._rank[x] += 1\n\n def _make_set(self, x):\n self._parent[x] = x\n self._rank[x] = 0\n self._equiv[x] = {x}\n\n def unite(self, *elements):\n if not elements:\n return\n for x in elements:\n if x in self._parent:\n continue\n self._make_set(x)\n x0 = elements[0]\n for x in elements[1:]:\n self._union(x0, x)\n\n def groups(self):\n return [set(e) for e in list(self._equiv.values())]\n\n\ndef solve(ncol, nrow, rows):\n pairs = []\n\n for x in range(ncol - 1):\n for y in range(nrow):\n pairs.append([(x, y), (x + 1, y)])\n\n for x in range(ncol):\n for y in range(nrow - 1):\n pairs.append([(x, y), (x, y + 1)])\n\n for x in range(ncol - 1):\n for y in range(nrow - 1):\n pairs.append([(x, y), (x + 1, y + 1)])\n\n for x in range(ncol - 1):\n for y in range(1, nrow):\n pairs.append([(x, y), (x + 1, y - 1)])\n f = UnionFind()\n for x in range(ncol):\n for y in range(nrow):\n if rows[y][x]:\n f.unite((x, y))\n for (x1, y1), (x2, y2) in pairs:\n if rows[y1][x1] and rows[y2][x2]:\n f.unite((x1, y1), (x2, y2))\n return len(f.groups())\n\n\ndef main():\n while True:\n ncol, nrow = list(map(int, input().split()))\n if ncol == 0 and nrow == 0:\n break\n rows = []\n for _ in range(nrow):\n row = list(map(int, input().split()))\n rows.append(row)\n\n print((solve(ncol, nrow, rows)))\n\n\nmain()\n","fast_code":"import sys\n\nsys.setrecursionlimit(10**6)\n\n\ndef erase(x, y):\n c[y][x] = \"0\"\n for dx, dy in (\n (1, 0),\n (1, 1),\n (0, 1),\n (-1, 1),\n (-1, 0),\n (-1, -1),\n (0, -1),\n (1, -1),\n ):\n nx, ny = x + dx, y + dy\n if 0 <= nx <= w - 1 and 0 <= ny <= h - 1:\n if c[ny][nx] == \"1\":\n erase(nx, ny)\n\n\nwhile True:\n w, h = list(map(int, input().split()))\n if w == h == 0:\n break\n c = [[i for i in input().split()] for _ in range(h)]\n ans = 0\n for y in range(h):\n for x in range(w):\n if c[y][x] == \"1\":\n ans += 1\n erase(x, y)\n print(ans)\n"} +{"fast_code_id":"863c2470b06494c112d6c3fa44195775baeb436d4cf6f6d238bac30e98dbba5a","fast_id":"p03860_863c2470b06494c112d6c3fa44195775baeb436d4cf6f6d238bac30e98dbba5a","language":"python","measured_fast_code_id":"863c2470b06494c112d6c3fa44195775baeb436d4cf6f6d238bac30e98dbba5a","measured_slow_code_id":"16c04da53c87dd70aea34a80cdf31648a18441ddbc2063772c983e2bf082c565","measurement_metric":"cpu_instruction_count","pair_id":"python_7d42518a3504beab341a904b","problem_id":"p03860","slow_code_id":"16c04da53c87dd70aea34a80cdf31648a18441ddbc2063772c983e2bf082c565","slow_id":"p03860_16c04da53c87dd70aea34a80cdf31648a18441ddbc2063772c983e2bf082c565","speedup":3.407932866611146,"stratum":"2-4","sampling_key":"b7bcd31cabfe57c4a08de0b3db17bf09e7267bcc83f642c4e256d8cf8dcbeb1c","slow_code":"def main():\n a = [i for i in input().split()]\n print(a[0][0], a[1][0], a[2][0], sep=\"\")\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"print((\"A\" + input()[8] + \"C\"))\n"} +{"fast_code_id":"073ab830f67147319ed0d8289c5e16b8febb9e062a9c7a5a41bbef78afb629b6","fast_id":"p03150_974ed8c013de7fa49f4174c0befd582bb06a2afc391fa3037fd7240987d13bcb","language":"python","measured_fast_code_id":"974ed8c013de7fa49f4174c0befd582bb06a2afc391fa3037fd7240987d13bcb","measured_slow_code_id":"331210cf6e543db86805dd436daba4fcc1285479f84eb62a4c37ec4561176613","measurement_metric":"cpu_instruction_count","pair_id":"python_7d85ecc3b59caa99b56f58c8","problem_id":"p03150","slow_code_id":"331210cf6e543db86805dd436daba4fcc1285479f84eb62a4c37ec4561176613","slow_id":"p03150_331210cf6e543db86805dd436daba4fcc1285479f84eb62a4c37ec4561176613","speedup":2.4979054656176425,"stratum":"2-4","sampling_key":"8a933871e5329a02e04524a334fd9d535319695e032e249656e07294ac615e50","slow_code":"import re\nfrom sys import stdin\n\nN = stdin.readline().rstrip()\nfor i in range(7):\n mae = \"keyence\"[0 : i + 1]\n ato = \"keyence\"[i + 1 : 8]\n if re.search(\".*keyencekeyence\", N):\n if (re.sub(\".*keyencekeyence\", \"\", N) == \"\") == True:\n print(\"YES\")\n break\n if re.search(\"keyencekeyence.*\", N):\n if (re.sub(\"keyencekeyence.*\", \"\", N) == \"\") == True:\n print(\"YES\")\n break\n if (re.sub(\".*keyence\", \"\", N) == \"\") == True:\n print(\"YES\")\n break\n if (re.sub(\"keyence.*\", \"\", N) == \"\") == True:\n print(\"YES\")\n break\n if re.match(\"%s.*%s\" % (mae, ato), N):\n if (re.sub(\"%s.*%s\" % (mae, ato), \"\", N) == \"\") == True:\n print(\"YES\")\n break\nif i == 6:\n print(\"NO\")\n","fast_code":"def main():\n S = input()\n N = len(S)\n ans = \"keyence\"\n for i in range(N):\n for j in range(N + 1):\n T = S[:i] + S[i + j :]\n if T == ans:\n return print(\"YES\")\n print(\"NO\")\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"1f1f09c062c70abfa7a9061bb8cfd50f38717113e3d3b88f55dac5f7530ea385","fast_id":"p02783_1f1f09c062c70abfa7a9061bb8cfd50f38717113e3d3b88f55dac5f7530ea385","language":"python","measured_fast_code_id":"1f1f09c062c70abfa7a9061bb8cfd50f38717113e3d3b88f55dac5f7530ea385","measured_slow_code_id":"d5fe1e3cebc325b88118764de6cebe3ff7e094ae5446fe951fc1767a79f70b68","measurement_metric":"cpu_instruction_count","pair_id":"python_7dc68ef818a4074aad68c16d","problem_id":"p02783","slow_code_id":"d5fe1e3cebc325b88118764de6cebe3ff7e094ae5446fe951fc1767a79f70b68","slow_id":"p02783_d5fe1e3cebc325b88118764de6cebe3ff7e094ae5446fe951fc1767a79f70b68","speedup":71.13225463541039,"stratum":"8+","sampling_key":"028c4b9115074f5c48962e104c6e9881a6ccc9b593583dea1ea0096b78cb0e84","slow_code":"import sys\nimport socket\n\nhostname = socket.gethostname()\nif hostname == \"F451C\":\n sys.stdin = open(\"a1.in\")\n\n\ndef read_int_list():\n return list(map(int, input().split()))\n\n\ndef read_str_list():\n return input().split()\n\n\ndef read_int():\n return int(eval(input()))\n\n\ndef read_str():\n return eval(input())\n\n\ndef main_0():\n H, A = read_int_list()\n res = 0\n for i in range(10001):\n H = H - A\n res += 1\n if H <= 0:\n break\n print(res)\n\n\ndef main_1():\n H, A = read_int_list()\n res = H // A\n if H % A != 0:\n res += 1\n print(res)\n\n\ndef main():\n H, A = read_int_list()\n res = 0\n while H > 0:\n H -= A\n res += 1\n print(res)\n\n\nmain()\n","fast_code":"a, b = list(map(int, input().split()))\nprint((0 - -a // b))\n"} +{"fast_code_id":"d8b9d7fdaa23a595cc84c23f285588212bcc3d4c8455fd7c23ecb472d8eb016f","fast_id":"p03292_d8b9d7fdaa23a595cc84c23f285588212bcc3d4c8455fd7c23ecb472d8eb016f","language":"python","measured_fast_code_id":"d8b9d7fdaa23a595cc84c23f285588212bcc3d4c8455fd7c23ecb472d8eb016f","measured_slow_code_id":"f60b0a699a2d92dfcbb5b26a370092e660bc85afffa65c600089419b521caefb","measurement_metric":"cpu_instruction_count","pair_id":"python_7dcc2adfec22529dc8146372","problem_id":"p03292","slow_code_id":"f60b0a699a2d92dfcbb5b26a370092e660bc85afffa65c600089419b521caefb","slow_id":"p03292_f60b0a699a2d92dfcbb5b26a370092e660bc85afffa65c600089419b521caefb","speedup":3.2181568985595708,"stratum":"2-4","sampling_key":"1c141c473f133096c4a5d2b93e8d6d89c68b7a0da3d0144f0e4db7cc9f1cdf67","slow_code":"a, b, c = list(map(int, input().split()))\nans = 9999\nans = min(ans, abs(a - b) + abs(b - c), abs(a - c) + abs(c - b))\nans = min(ans, abs(b - a) + abs(a - c), abs(b - c) + abs(c - a))\nans = min(ans, abs(c - a) + abs(a - b), abs(c - b) + abs(b - a))\nprint(ans)\n","fast_code":"a, b, c = sorted(map(int, input().split()))\nprint((c - a))\n"} +{"fast_code_id":"3d1031aa59bd9f11118b3c436281be88b6debc1d015f10c514c3bfd4f606c2ec","fast_id":"p03078_3d1031aa59bd9f11118b3c436281be88b6debc1d015f10c514c3bfd4f606c2ec","language":"python","measured_fast_code_id":"3d1031aa59bd9f11118b3c436281be88b6debc1d015f10c514c3bfd4f606c2ec","measured_slow_code_id":"111fe5f3e4b281063d100ddf30040d19f67315bff67e2ba117c756fdb01a6253","measurement_metric":"cpu_instruction_count","pair_id":"python_7e8a225b7c1cdaae96031340","problem_id":"p03078","slow_code_id":"111fe5f3e4b281063d100ddf30040d19f67315bff67e2ba117c756fdb01a6253","slow_id":"p03078_111fe5f3e4b281063d100ddf30040d19f67315bff67e2ba117c756fdb01a6253","speedup":4.96530640066816,"stratum":"4-8","sampling_key":"0bccdb56f930cbd20af138fa263c7b5dfd6b6ff03b1e42fc8b2404879bd73de5","slow_code":"def main():\n X, Y, Z, K = list(map(int, input().split()))\n A = list(map(int, input().split()))\n B = list(map(int, input().split()))\n C = list(map(int, input().split()))\n D = []\n for a in A:\n for b in B:\n D.append(a + b)\n D.sort(reverse=True)\n E = []\n for i in range(min(len(D), K)):\n for c in C:\n E.append(D[i] + c)\n E.sort(reverse=True)\n for i in range(K):\n print((E[i]))\n\n\nmain()\n","fast_code":"x, y, z, k = list(map(int, input().split()))\nA = [int(i) for i in input().split()]\nB = [int(i) for i in input().split()]\nC = [int(i) for i in input().split()]\nA.sort(reverse=True)\nB.sort(reverse=True)\nC.sort(reverse=True)\nx = 0\ny = 0\nz = 0\ncakes = []\nfor x, a in enumerate(A):\n if x + 1 > k:\n break\n for y, b in enumerate(B):\n if (x + 1) * (y + 1) > k:\n break\n for z, c in enumerate(C):\n if (x + 1) * (y + 1) * (z + 1) > k:\n break\n cakes.append(a + b + c)\ncakes.sort(reverse=True)\nfor cake in cakes[:k]:\n print(cake)\n"} +{"fast_code_id":"f64766cc504cf7ed6ef256ef37141d76027a8c8c96c68aeb51a96ae0081403a4","fast_id":"p02289_f64766cc504cf7ed6ef256ef37141d76027a8c8c96c68aeb51a96ae0081403a4","language":"python","measured_fast_code_id":"f64766cc504cf7ed6ef256ef37141d76027a8c8c96c68aeb51a96ae0081403a4","measured_slow_code_id":"14b4ad282f61dc3f0baedf2eb80026c759f35dd9b34a29e093c21234282f17e7","measurement_metric":"cpu_instruction_count","pair_id":"python_7eb733b8a4db554c4ae09362","problem_id":"p02289","slow_code_id":"14b4ad282f61dc3f0baedf2eb80026c759f35dd9b34a29e093c21234282f17e7","slow_id":"p02289_14b4ad282f61dc3f0baedf2eb80026c759f35dd9b34a29e093c21234282f17e7","speedup":3.8326666656296213,"stratum":"2-4","sampling_key":"24289405ceb6f38eba3b4a057f973dabd694687df922004966018d363f241bce","slow_code":"import sys\n\n\ndef maxHeapify(A, i):\n l = i * 2 + 1\n r = i * 2 + 2\n if l < n:\n largest = l\n if r < n and A[r] > A[l]:\n largest = r\n if A[largest] > A[i]:\n A[i], A[largest] = A[largest], A[i]\n maxHeapify(A, largest)\n\n\ndef insert(S, k):\n global n\n S[n] = k\n n += 1\n i = n - 1\n p = (i - 1) // 2\n while i > 0 and S[i] > S[p]:\n S[i], S[p] = S[p], S[i]\n i = p\n p = (i - 1) // 2\n\n\ndef extractMax(S):\n global n\n if n == 1:\n n -= 1\n return S[0]\n ans = S[0]\n n -= 1\n S[0] = S[n]\n i = 0\n while True:\n l = i * 2 + 1\n r = i * 2 + 2\n if l >= n:\n break\n largest = l\n if r < n and A[r] > A[l]:\n largest = r\n if A[largest] > A[i]:\n A[i], A[largest] = A[largest], A[i]\n i = largest\n else:\n break\n return ans\n\n\nA = [0] * 2000000\nS = []\nn = 0\nfor s in sys.stdin:\n if s[2] == \"s\":\n insert(A, int(s[7:]))\n elif s[2] == \"t\":\n S.append(extractMax(A))\n else:\n break\nprint((\"\\n\".join(map(str, S))))\n","fast_code":"import sys\nfrom heapq import heappush, heappop\n\nH = []\nO = []\nfor e in sys.stdin:\n if \"i\" == e[0]:\n heappush(H, -int(e[7:]))\n elif \"t\" == e[2]:\n O += [-heappop(H)]\n else:\n print((\"\\n\".join(map(str, O))))\n"} +{"fast_code_id":"a82927eb492dac5d69efb79a88273643a693b2c2fc6de3e1ae41c3f60fa52c4e","fast_id":"p03209_fb286ca8c8c27ed7f29d63ec8fdd225a1d64cd71162920c90f80533849dde89a","language":"python","measured_fast_code_id":"fb286ca8c8c27ed7f29d63ec8fdd225a1d64cd71162920c90f80533849dde89a","measured_slow_code_id":"bb7815001602c92a4a4d9be5cdf11f822306f95b9c14ffc6b0f51a943d9f9db5","measurement_metric":"cpu_instruction_count","pair_id":"python_7ebdc364a4709766385a99d5","problem_id":"p03209","slow_code_id":"bb7815001602c92a4a4d9be5cdf11f822306f95b9c14ffc6b0f51a943d9f9db5","slow_id":"p03209_bb7815001602c92a4a4d9be5cdf11f822306f95b9c14ffc6b0f51a943d9f9db5","speedup":2.104892065615214,"stratum":"2-4","sampling_key":"06094113d4f7ac39923887146a1674fe2372c1b8d1bde037d96ecf334da413e5","slow_code":"import sys\n\nstdin = sys.stdin\nsys.setrecursionlimit(10**5)\n\n\ndef li():\n return list(map(int, stdin.readline().split()))\n\n\ndef li_():\n return [int(x) - 1 for x in stdin.readline().split()]\n\n\ndef lf():\n return list(map(float, stdin.readline().split()))\n\n\ndef ls():\n return stdin.readline().split()\n\n\ndef ns():\n return stdin.readline().rstrip()\n\n\ndef lc():\n return list(ns())\n\n\ndef ni():\n return int(stdin.readline())\n\n\ndef nf():\n return float(stdin.readline())\n\n\nn, x = li()\ntop = [4 * pow(2, i) - 3 for i in range(n + 1)]\nmed = [pow(2, i + 1) - 1 for i in range(n + 1)]\nbot = [1 for _ in range(n + 1)]\n\n\ndef findPattyNum(level: int, lay: int):\n if level == 0 and lay == 1:\n return 1\n if lay == 4 * pow(2, level) - 3:\n return pow(2, level + 1) - 1\n elif pow(2, level + 1) - 1 < lay < 4 * pow(2, level) - 3:\n return pow(2, level) + findPattyNum(level - 1, lay - (pow(2, level + 1) - 1))\n elif lay == pow(2, level + 1) - 1:\n return pow(2, level)\n elif 1 < lay < pow(2, level + 1) - 1:\n return findPattyNum(level - 1, lay - 1)\n elif lay == 1:\n return 0\n\n\nprint((findPattyNum(n, x)))\n","fast_code":"import sys\n\nsys.setrecursionlimit(10**7)\nn, x = list(map(int, input().split()))\na = [0] * (n + 1)\np = [0] * (n + 1)\na[0] = 1\np[0] = 1\nfor i in range(n):\n a[i + 1] = 2 * a[i] + 3\n p[i + 1] = 2 * p[i] + 1\n\n\ndef func(i, x):\n if i == 0:\n if x <= 0:\n return 0\n elif x >= 1:\n return 1\n mid = (a[i] + 1) // 2\n if mid == x:\n return p[i - 1] + 1\n elif mid > x:\n return func(i - 1, x - 1)\n else:\n return p[i - 1] + 1 + func(i - 1, x - mid)\n\n\nprint((func(n, x)))\n"} +{"fast_code_id":"44ab35a9714ea188a11aedb20f3ea7103bd930af4ad186337881b8ed88a0b55b","fast_id":"p02406_44ab35a9714ea188a11aedb20f3ea7103bd930af4ad186337881b8ed88a0b55b","language":"python","measured_fast_code_id":"44ab35a9714ea188a11aedb20f3ea7103bd930af4ad186337881b8ed88a0b55b","measured_slow_code_id":"410f0e096d34371faf9e22953fd00a2c72291f9635dec5b6ea34eed2092f1fb5","measurement_metric":"cpu_instruction_count","pair_id":"python_7f649fd9da40903231d780c3","problem_id":"p02406","slow_code_id":"410f0e096d34371faf9e22953fd00a2c72291f9635dec5b6ea34eed2092f1fb5","slow_id":"p02406_410f0e096d34371faf9e22953fd00a2c72291f9635dec5b6ea34eed2092f1fb5","speedup":2.4399977764758285,"stratum":"2-4","sampling_key":"b42c37e0ee4c492c445a95dcb232bd01d1d4c63b08e07760f5327acf5bf9a125","slow_code":"n = int(eval(input()))\nlist_a = [i for i in range(1, n + 1) if i % 3 == 0]\nlist_b = []\nfor i in range(1, n + 1):\n j = i\n while True:\n if j == 0:\n break\n elif j % 10 == 3:\n list_b.append(i)\n break\n j = j // 10\na = set(list_a)\nb = set(list_b)\nc = list(a | b)\nc.sort()\nprint((\" \" + \" \".join(map(str, c))))\n","fast_code":"print(\n \"\".join(\n \" \" + str(i) for i in range(1, eval(input()) + 1) if i % 3 == 0 or \"3\" in str(i)\n )\n)\n"} +{"fast_code_id":"d01a3b994ea420f84f1fec9d04b81e669100b8678a5fdca6b824945b066ea855","fast_id":"p00775_d01a3b994ea420f84f1fec9d04b81e669100b8678a5fdca6b824945b066ea855","language":"python","measured_fast_code_id":"d01a3b994ea420f84f1fec9d04b81e669100b8678a5fdca6b824945b066ea855","measured_slow_code_id":"8e02c59ca5af7184abc0b41186c69b5afed95dc9f0416b5d3e79c7e06f9ac494","measurement_metric":"cpu_instruction_count","pair_id":"python_7f852ddade038d66c42f79cd","problem_id":"p00775","slow_code_id":"8e02c59ca5af7184abc0b41186c69b5afed95dc9f0416b5d3e79c7e06f9ac494","slow_id":"p00775_8e02c59ca5af7184abc0b41186c69b5afed95dc9f0416b5d3e79c7e06f9ac494","speedup":2.7475593125652935,"stratum":"2-4","sampling_key":"522bb718144b2fa184edd03a5c07dd20b7023f09f86c74164eba074b4535ac90","slow_code":"while True:\n R, N = list(map(int, input().split()))\n if not (R | N):\n break\n geta = 20\n buildings = [0] * (geta * 2)\n for _ in range(N):\n xl, xr, h = list(map(int, input().split()))\n for i in range(xl + geta, xr + geta):\n buildings[i] = max(buildings[i], h)\n sun = [0] * (geta * 2)\n for i in range(-R + geta, R + geta):\n if i < geta:\n buildings[i] -= pow(R * R - (i - geta + 1) * (i - geta + 1), 0.5) - R\n else:\n buildings[i] -= pow(R * R - (i - geta) * (i - geta), 0.5) - R\n left, right = 0, 20\n while right - left > 1e-4:\n mid = (left + right) / 2\n flag = True\n for i in range(-R + geta, R + geta):\n if i < geta:\n flag &= buildings[i] >= mid\n else:\n y = pow(R * R - (i - geta) * (i - geta), 0.5)\n flag &= buildings[i] >= mid\n if flag:\n left = mid\n else:\n right = mid\n print((\"{:.20f}\".format(left)))\n","fast_code":"from math import sqrt\n\nwhile True:\n R, N = list(map(int, input().split()))\n if not (R | N):\n break\n geta = 20\n buildings = [0] * (geta * 2)\n for _ in range(N):\n xl, xr, h = list(map(int, input().split()))\n for i in range(xl + geta, xr + geta):\n buildings[i] = max(buildings[i], h)\n print(\n (\n min(\n buildings[i]\n - sqrt(R * R - (i - geta + (i < geta)) * (i - geta + (i < geta)))\n + R\n for i in range(-R + geta, R + geta)\n )\n )\n )\n"} +{"fast_code_id":"6a550eb4a0eb047dc36e37af0e862962c3727aa138f3a251bc9ddbf41f5f95ff","fast_id":"p03077_6a550eb4a0eb047dc36e37af0e862962c3727aa138f3a251bc9ddbf41f5f95ff","language":"python","measured_fast_code_id":"6a550eb4a0eb047dc36e37af0e862962c3727aa138f3a251bc9ddbf41f5f95ff","measured_slow_code_id":"34caf7325f4819bd719f1f977d4c7833f1b8eae1073783274c70d879e08aa59a","measurement_metric":"cpu_instruction_count","pair_id":"python_7fb0ae18a77158979ef3c59e","problem_id":"p03077","slow_code_id":"ab58e9cb16ab933309b0c60e055e71406d283b0d16126adf763de4e9caa5d6fb","slow_id":"p03077_34caf7325f4819bd719f1f977d4c7833f1b8eae1073783274c70d879e08aa59a","speedup":777.445491409187,"stratum":"8+","sampling_key":"3ed36ce413f69e5f49f45d03bbf72db27ed6bb67325770783050d2e63126e6e7","slow_code":"import sys\nimport numpy as np\n\n\ndef get_num():\n return int(eval(input()))\n\n\ndef get_nums(n):\n res = [0 for _ in range(n)]\n for i in range(n):\n res[i] = int(eval(input()))\n return res\n\n\ndef get_numbers():\n return list(map(int, input().split()))\n\n\nn = get_num()\ncosts = get_nums(5)\nmax_time = 0\nfor cost in costs:\n max_time = max(max_time, int(np.ceil(n / cost)))\nprint((max_time + 4))\n","fast_code":"N = int(eval(input()))\nA = [int(eval(input())) for _ in range(5)]\na = min(A)\nn = N // a\nif N % a > 0:\n n += 1\nprint((5 + n - 1))\n"} +{"fast_code_id":"5351cd983ed99e51c701293a9a6ee5a995fff1e1e2d615fa1a70bea7c1aac6ca","fast_id":"p03455_5351cd983ed99e51c701293a9a6ee5a995fff1e1e2d615fa1a70bea7c1aac6ca","language":"python","measured_fast_code_id":"5351cd983ed99e51c701293a9a6ee5a995fff1e1e2d615fa1a70bea7c1aac6ca","measured_slow_code_id":"1e58957cce6049d366f3189df1c6244aa3226734d9f71da11d6221cbf487aae2","measurement_metric":"cpu_instruction_count","pair_id":"python_80151b584c3de2cdae5fdcad","problem_id":"p03455","slow_code_id":"1e58957cce6049d366f3189df1c6244aa3226734d9f71da11d6221cbf487aae2","slow_id":"p03455_1e58957cce6049d366f3189df1c6244aa3226734d9f71da11d6221cbf487aae2","speedup":2.6512406554462924,"stratum":"2-4","sampling_key":"cec1591bfae9752d331e6e5d2187fbcbb34f1ec0bb6d1de49fb8ddee04cf84bd","slow_code":"def ketanowa(p):\n ans = 0\n p = str(p)\n for i in p:\n ans += int(i)\n return ans\n\n\ndef main():\n temp = input().split(\" \")\n n = int(temp[0])\n a = int(temp[1])\n if n * a % 2 == 0:\n print(\"Even\")\n else:\n print(\"Odd\")\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"a, b = map(int, input().split())\nprint(\"Even\") if a * b % 2 == 0 else print(\"Odd\")\n"} +{"fast_code_id":"282c5d5df3ac4ab4ca2b56c7d8261f9d2d1448798066647e6eb300ab54cc95c8","fast_id":"p03244_d94b843910319885b43204508672e250dfbccbe53b75de11e58c6bbfaf866d53","language":"python","measured_fast_code_id":"d94b843910319885b43204508672e250dfbccbe53b75de11e58c6bbfaf866d53","measured_slow_code_id":"100838eb35611188aaa0e6508544517c0abf47ad6e005b321a85725c0e9840dd","measurement_metric":"cpu_instruction_count","pair_id":"python_80637d4c42bff9d44df568d8","problem_id":"p03244","slow_code_id":"a39b059af4b03221115ad0dd54a76e5f423fd6c8173a18ffdbed4e08ab13360c","slow_id":"p03244_100838eb35611188aaa0e6508544517c0abf47ad6e005b321a85725c0e9840dd","speedup":180.00763438842972,"stratum":"8+","sampling_key":"9a36d7903127f1136f81fa6797ebca5bd0de60598b2bb3b2392d75efda918cf6","slow_code":"import numpy as np\n\neven = np.zeros(100001, dtype=int)\nodd = np.zeros(100001, dtype=int)\nn = int(eval(input()))\nv = list(map(int, input().split()))\nfor i in range(n):\n if i % 2 == 0:\n even[v[i]] += 1\n else:\n odd[v[i]] += 1\ne1 = even.argmax()\ne1n = even.max()\no1 = odd.argmax()\no1n = odd.max()\n\nif e1 == o1:\n e2n = np.sort(even)[-2]\n o2n = np.sort(odd)[-2]\n\n print((min(n - e1n - o2n, n - e2n - o1n)))\nelse:\n print((n - e1n - o1n))\n","fast_code":"from collections import Counter\n\nn = int(eval(input()))\nv = list(map(int, input().split()))\nevens = Counter(v[::2])\nodds = Counter(v[1::2])\nevens[0] = 0\nodds[0] = 0\nkeep = 0\nfor even in evens.most_common(2):\n for odd in odds.most_common(2):\n if even[0] != odd[0]:\n keep = max(keep, even[1] + odd[1])\nprint((n - keep))\n"} +{"fast_code_id":"88e1d1ce78f534e17892e05f61dec43efb221ccce7c17d153d55bb3f6dea1128","fast_id":"p03556_88e1d1ce78f534e17892e05f61dec43efb221ccce7c17d153d55bb3f6dea1128","language":"python","measured_fast_code_id":"88e1d1ce78f534e17892e05f61dec43efb221ccce7c17d153d55bb3f6dea1128","measured_slow_code_id":"0a7e4d0d2a2f952e55fd143eaac4cee93ae161ecb36118d4ab495d4a4bf6dac9","measurement_metric":"cpu_instruction_count","pair_id":"python_81b6ce83a49dfffc65d106e6","problem_id":"p03556","slow_code_id":"0a7e4d0d2a2f952e55fd143eaac4cee93ae161ecb36118d4ab495d4a4bf6dac9","slow_id":"p03556_0a7e4d0d2a2f952e55fd143eaac4cee93ae161ecb36118d4ab495d4a4bf6dac9","speedup":147.24830045293822,"stratum":"8+","sampling_key":"e119f623556084b0d7897dd6e2152becf7aca31cf4c3e035b429c9de01a15381","slow_code":"import numpy as np\n\nN = int(eval(input()))\nmp = int(np.sqrt(N))\nprint((mp**2))\n","fast_code":"n = int(eval(input()))\nfor i in range(n, 0, -1):\n if float(i**0.5).is_integer():\n print(i)\n break\n"} +{"fast_code_id":"ffd6746babe59de48f50f77abd6bc1a2c4d5727d43b468b81ae0081d9337f307","fast_id":"p02264_ffd6746babe59de48f50f77abd6bc1a2c4d5727d43b468b81ae0081d9337f307","language":"python","measured_fast_code_id":"ffd6746babe59de48f50f77abd6bc1a2c4d5727d43b468b81ae0081d9337f307","measured_slow_code_id":"a1340768971238fb58507a0f8ca6f200e92420bac7eb4c6dd5fbd6b4ec30302d","measurement_metric":"cpu_instruction_count","pair_id":"python_821bb59a3e640ef77d5d95da","problem_id":"p02264","slow_code_id":"a1340768971238fb58507a0f8ca6f200e92420bac7eb4c6dd5fbd6b4ec30302d","slow_id":"p02264_a1340768971238fb58507a0f8ca6f200e92420bac7eb4c6dd5fbd6b4ec30302d","speedup":3.0042982360632418,"stratum":"2-4","sampling_key":"5d28d8e3a1468f93cda11211b0e18ae87db2ec69446ae6fc9f45eede0aeea8d7","slow_code":"class Queue:\n def __init__(self, n):\n self.values = [None] * n\n self.n = n\n self.s = 0\n self.t = 0\n\n def next(self, p):\n ret = p + 1\n if ret >= self.n:\n ret = 0\n return ret\n\n def enqueue(self, x):\n if self.next(self.s) == self.t:\n raise Exception(\"Overflow\")\n self.values[self.s] = x\n self.s = self.next(self.s)\n\n def dequeue(self):\n if self.s == self.t:\n raise Exception(\"Underflow\")\n ret = self.values[self.t]\n self.t = self.next(self.t)\n return ret\n\n\nn, q = list(map(int, input().split(\" \")))\nqueue = Queue(n + 1)\nfor _ in range(n):\n name, time = input().split(\" \")\n time = int(time)\n queue.enqueue((name, time))\ncompleted = []\ncur = 0\nwhile len(completed) < n:\n name, time = queue.dequeue()\n res = time - q\n if res <= 0:\n cur += time\n completed.append((name, cur))\n else:\n cur += q\n queue.enqueue((name, res))\nfor name, time in completed:\n print(name, time)\n","fast_code":"import sys\nfrom collections import deque\n\ns = sys.stdin.readlines()\nq = int(s[0].split()[1])\nf = lambda x, y: (x, int(y))\nd = deque(f(*e.split()) for e in s[1:])\nt, a = 0, []\nwhile d:\n k, v = d.popleft()\n if v > q:\n v -= q\n t += q\n d.append([k, v])\n else:\n t += v\n a += [f\"{k} {t}\"]\nprint(*a, sep=\"\\n\")\n"} +{"fast_code_id":"135e4bd26ba1d3fae326e995137a8a8c419b22ccdcea9d3240ec1886b5a4f161","fast_id":"p03312_135e4bd26ba1d3fae326e995137a8a8c419b22ccdcea9d3240ec1886b5a4f161","language":"python","measured_fast_code_id":"135e4bd26ba1d3fae326e995137a8a8c419b22ccdcea9d3240ec1886b5a4f161","measured_slow_code_id":"923136bcc3ca1993d7b5b5155c0211bba6ed078795c208a1a3875d6dd7aa6d3a","measurement_metric":"cpu_instruction_count","pair_id":"python_822d58a491b5366d857131fa","problem_id":"p03312","slow_code_id":"8f562a68154a7b683e51bbc10e45ae21454de6b7bc88fac021784e92ca0d322a","slow_id":"p03312_923136bcc3ca1993d7b5b5155c0211bba6ed078795c208a1a3875d6dd7aa6d3a","speedup":2.7796286447807677,"stratum":"2-4","sampling_key":"281efc4c66479a25922f75083cf66fe7b5b28922854b24ababc8362f4690ed7b","slow_code":"import sys\n\ninput = lambda: sys.stdin.readline().rstrip()\nsys.setrecursionlimit(max(1000, 10**9))\nn = int(eval(input()))\na = list(map(int, input().split()))\nca = [None] * n\ns = 0\nfor i, num in enumerate(a):\n s += a[i]\n ca[i] = s\ndiff = [None] * n\ns = 0\nt = 1\nv1 = 0\nv2 = a[0]\ndiff[t - 1] = (v1, v2)\nwhile t < n:\n\n t += 1\n v2 += a[t - 1]\n while v1 < v2 and s < t:\n if diff[t - 1] is None or abs(v1 - v2) < abs(diff[t - 1][0] - diff[t - 1][1]):\n diff[t - 1] = (v1, v2)\n s += 1\n v1 += a[s - 1]\n v2 -= a[s - 1]\n if diff[t - 1] is None or abs(v1 - v2) < abs(diff[t - 1][0] - diff[t - 1][1]):\n diff[t - 1] = (v1, v2)\n if v1 > v2 and s >= 1:\n v1 -= a[s - 1]\n v2 += a[s - 1]\n s -= 1\ndiff2 = [None] * n\ns = n\nt = n - 1\nv1 = 0\nv2 = a[-1]\ndiff2[t] = (v1, v2)\nwhile t >= 1:\n\n t -= 1\n v2 += a[t]\n while v1 < v2 and s > t:\n if diff2[t] is None or abs(v1 - v2) < abs(diff2[t][0] - diff2[t][1]):\n diff2[t] = (v1, v2)\n s -= 1\n v1 += a[s]\n v2 -= a[s]\n if diff2[t] is None or abs(v1 - v2) < abs(diff2[t][0] - diff2[t][1]):\n diff2[t] = (v1, v2)\n if v1 > v2 and s <= n - 2:\n v1 -= a[s]\n v2 += a[s]\n s += 1\nprint(\n (\n min(\n (\n max(diff[i][0], diff[i][1], diff2[i + 1][0], diff2[i + 1][1])\n - min(diff[i][0], diff[i][1], diff2[i + 1][0], diff2[i + 1][1])\n )\n for i in range(n - 1)\n )\n )\n)\n","fast_code":"n = int(eval(input()))\na = list(map(int, input().split()))\n\n\ndef f(a):\n l, r = a[:2]\n m = 1\n b = [(l, r)]\n for i in range(2, n - 2):\n r += a[i]\n while m < i and abs(l - r) > abs(l - r + a[m] * 2):\n l, r = l + a[m], r - a[m]\n m += 1\n b.append((l, r))\n return b\n\n\nprint(\n (\n min(\n max(p, q, r, s) - min(p, q, r, s)\n for ((p, q), (r, s)) in zip(f(a), f(a[::-1])[::-1])\n )\n )\n)\n"} +{"fast_code_id":"0197693866f6bd8642376e009ba7cfd94396278cad215fcd2af1b9c1eafda770","fast_id":"p02640_dbed684e40b107b9d1d366d2d9edfa52c8c73818912b4d48c43cb74456f0cf5f","language":"python","measured_fast_code_id":"dbed684e40b107b9d1d366d2d9edfa52c8c73818912b4d48c43cb74456f0cf5f","measured_slow_code_id":"b81aa7896b39a5e204fdfa9ca3f63685a6d18d86724afc22b841cf9b49e7766b","measurement_metric":"cpu_instruction_count","pair_id":"python_8247771a364a809c269b7f6c","problem_id":"p02640","slow_code_id":"ac09bdaf0871ab87a33221ec8a163d2052febe18d868feae44e613cae3f3a95f","slow_id":"p02640_b81aa7896b39a5e204fdfa9ca3f63685a6d18d86724afc22b841cf9b49e7766b","speedup":5.0826464585088615,"stratum":"4-8","sampling_key":"92d0db3c595653be8a2df410e91f039a87ef5fc48f2bfadc1ee984e8db51ee3a","slow_code":"x, y = list(map(int, input().split()))\nfor i in range(0, 101):\n for j in range(0, 101):\n if i + j == x and i * 2 + j * 4 == y:\n print(\"Yes\")\n exit()\nprint(\"No\")\n","fast_code":"import sys\nimport time\n\nst = time.perf_counter()\n\nx, y = map(int, input().split())\nok = False\nfor i in range(x + 1):\n if i * 4 + (x - i) * 2 == y:\n ok = True\n break\nif ok:\n print(\"Yes\")\nelse:\n print(\"No\")\n\ned = time.perf_counter()\nprint(\"time:\", ed - st, file=sys.stderr)\n"} +{"fast_code_id":"e5f2ce1d3645cedd2aa705d07e029891694acb0a7fb25165c6b7969765605888","fast_id":"p02628_e5f2ce1d3645cedd2aa705d07e029891694acb0a7fb25165c6b7969765605888","language":"python","measured_fast_code_id":"e5f2ce1d3645cedd2aa705d07e029891694acb0a7fb25165c6b7969765605888","measured_slow_code_id":"12fc0a6880b1658c0eaeba3aa7dd7893393cf5c052e40105869e3784eb2f1caa","measurement_metric":"cpu_instruction_count","pair_id":"python_82cd61df2dc172c165c4055e","problem_id":"p02628","slow_code_id":"12fc0a6880b1658c0eaeba3aa7dd7893393cf5c052e40105869e3784eb2f1caa","slow_id":"p02628_12fc0a6880b1658c0eaeba3aa7dd7893393cf5c052e40105869e3784eb2f1caa","speedup":34.63595791296256,"stratum":"8+","sampling_key":"226b907ccce7abc47c5721696f66267a0b9161cf89a96491e0fdcd520b9ba308","slow_code":"N, K = list(map(int, input().split()))\nP = list(map(int, input().split()))\n\n\ndef bubblesort(l):\n for index in range(len(l) - 1, 0, -1):\n for low in range(index):\n if l[low] > l[low + 1]:\n tmp = l[low + 1]\n l[low + 1] = l[low]\n l[low] = tmp\n return l\n\n\nbubblesort(P)\nsum = 0\nfor i in range(K):\n sum = sum + P[i]\nprint(sum)\n","fast_code":"n, k = list(map(int, input().split()))\np = list(map(int, input().split()))\np.sort()\nans = 0\nfor i in range(k):\n ans += p[i]\nprint(ans)\n"} +{"fast_code_id":"694f611b8b7e80f21648a9548a2bc08ce6440ec8a90f076e716c5ef1b35ecf93","fast_id":"p02934_694f611b8b7e80f21648a9548a2bc08ce6440ec8a90f076e716c5ef1b35ecf93","language":"python","measured_fast_code_id":"694f611b8b7e80f21648a9548a2bc08ce6440ec8a90f076e716c5ef1b35ecf93","measured_slow_code_id":"c67c96a03eea0baa546b84c497feeeb56f64958e85f22563bf6a6b3f7d27ea3a","measurement_metric":"cpu_instruction_count","pair_id":"python_82f235566877c86a2bae984f","problem_id":"p02934","slow_code_id":"c67c96a03eea0baa546b84c497feeeb56f64958e85f22563bf6a6b3f7d27ea3a","slow_id":"p02934_c67c96a03eea0baa546b84c497feeeb56f64958e85f22563bf6a6b3f7d27ea3a","speedup":1001.2866922329929,"stratum":"8+","sampling_key":"0f671f791e3ec0f3d8f459213383049b4aaa59a3c9b5b05b09b2f3e96bf1b60f","slow_code":"import numpy as np\n\nn = int(eval(input()))\nal = list(map(int, input().split()))\nreverse_list = []\nfor a in al:\n reverse_list.append(1 / a)\nprint((1 / sum(reverse_list)))\n","fast_code":"n = int(eval(input()))\na = list(map(int, input().split()))\ns = 0\nfor i in range(n):\n s += 1 / a[i]\nprint((1 / s))\n"} +{"fast_code_id":"82f20614e848556fd18b708896ea299b5580cbf6fcbcbac45ebe97ffe53b8af1","fast_id":"p02959_82f20614e848556fd18b708896ea299b5580cbf6fcbcbac45ebe97ffe53b8af1","language":"python","measured_fast_code_id":"82f20614e848556fd18b708896ea299b5580cbf6fcbcbac45ebe97ffe53b8af1","measured_slow_code_id":"f0395674e51675bd438b96a7f18fa9739566f756efa1ea79ea087d0b83a10e1f","measurement_metric":"cpu_instruction_count","pair_id":"python_82fbfe3e5d4f33bd3968ad9b","problem_id":"p02959","slow_code_id":"f0395674e51675bd438b96a7f18fa9739566f756efa1ea79ea087d0b83a10e1f","slow_id":"p02959_f0395674e51675bd438b96a7f18fa9739566f756efa1ea79ea087d0b83a10e1f","speedup":2.470542748610928,"stratum":"2-4","sampling_key":"15c9ffed072e6b100f5c6d1323d999905f45511427002434f8689032550af980","slow_code":"N = int(eval(input()))\nA = list(map(int, input().split()))\nB = list(map(int, input().split()))\nans = 0\nfor i in range(N):\n if i % 2 == 0:\n if A[i // 2] >= B[i // 2]:\n A[i // 2] -= B[i // 2]\n ans += B[i // 2]\n B[i // 2] = 0\n else:\n B[i // 2] -= A[i // 2]\n ans += A[i // 2]\n A[i // 2] = 0\n if A[i // 2 + 1] >= B[i // 2]:\n A[i // 2 + 1] -= B[i // 2]\n ans += B[i // 2]\n B[i // 2] = 0\n else:\n B[i // 2] -= A[i // 2 + 1]\n ans += A[i // 2 + 1]\n A[i // 2 + 1] = 0\n else:\n if A[N - i // 2] >= B[N - i // 2 - 1]:\n A[N - i // 2] -= B[N - i // 2 - 1]\n ans += B[N - i // 2 - 1]\n B[N - i // 2 - 1] = 0\n else:\n B[N - i // 2 - 1] -= A[N - i // 2]\n ans += A[N - i // 2]\n A[N - i // 2] = 0\n if A[N - i // 2 - 1] >= B[N - i // 2 - 1]:\n A[N - i // 2 - 1] -= B[N - i // 2 - 1]\n ans += B[N - i // 2 - 1]\n B[N - i // 2 - 1] = 0\n else:\n B[N - i // 2 - 1] -= A[N - i // 2 - 1]\n ans += A[N - i // 2 - 1]\n A[N - i // 2 - 1] = 0\nprint(ans)\n","fast_code":"N = int(eval(input()))\nA = [int(s) for s in input().split()]\nsum_A = sum(A)\nB = [int(s) for s in input().split()]\nfor i in range(N):\n attack1 = A[i] - B[i]\n if attack1 < 0:\n attack2 = A[i + 1] + attack1\n A[i] = 0\n A[i + 1] = attack2 if attack2 >= 0 else 0\n else:\n A[i] = attack1\nprint((sum_A - sum(A)))\n"} +{"fast_code_id":"4c767d4f54969c91a2200c7dc4c082e4d000559d0edcaadc837a4e6f5afe53cc","fast_id":"p02706_4c767d4f54969c91a2200c7dc4c082e4d000559d0edcaadc837a4e6f5afe53cc","language":"python","measured_fast_code_id":"4c767d4f54969c91a2200c7dc4c082e4d000559d0edcaadc837a4e6f5afe53cc","measured_slow_code_id":"89bf5646ac16bde646209d2509249ed7377541f5a03b9f9c5553553af3b07c63","measurement_metric":"cpu_instruction_count","pair_id":"python_831878f4c403bb7da854aa85","problem_id":"p02706","slow_code_id":"89bf5646ac16bde646209d2509249ed7377541f5a03b9f9c5553553af3b07c63","slow_id":"p02706_89bf5646ac16bde646209d2509249ed7377541f5a03b9f9c5553553af3b07c63","speedup":103.37418807206339,"stratum":"8+","sampling_key":"0eed7f67d86c36b374bd386b55ce302d66af1168f59d98bd893335ddb58168b9","slow_code":"import numpy as np\nimport math\n\nn, m = list(map(int, input().split()))\nA = list(map(int, input().split()))\na = sum(A)\nif n < a:\n print((-1))\nelse:\n print((n - a))\n","fast_code":"N, M = list(map(int, input().split()))\nA = list(map(int, input().split()))\nfor i in range(M):\n N -= A[i]\nif N >= 0:\n print(N)\nelif N < 0:\n print((-1))\n"} +{"fast_code_id":"9a2c7e9021c61fd0188b047d55a7a6bc111a05a6407ed323791b0539e23b402b","fast_id":"p03721_9a2c7e9021c61fd0188b047d55a7a6bc111a05a6407ed323791b0539e23b402b","language":"python","measured_fast_code_id":"9a2c7e9021c61fd0188b047d55a7a6bc111a05a6407ed323791b0539e23b402b","measured_slow_code_id":"46865d20d9586f50a54d66ae37ab47cd1b4e8805e9aff92f20347ac075089307","measurement_metric":"cpu_instruction_count","pair_id":"python_832cd8e2a20881c37358fc3d","problem_id":"p03721","slow_code_id":"46865d20d9586f50a54d66ae37ab47cd1b4e8805e9aff92f20347ac075089307","slow_id":"p03721_46865d20d9586f50a54d66ae37ab47cd1b4e8805e9aff92f20347ac075089307","speedup":4.5331735276476985,"stratum":"4-8","sampling_key":"fb5f5b3b1859dfe4f8cfab5106f9c150ad1ed97a5c62d31516064a36df9447f7","slow_code":"n, k = list(map(int, input().split()))\nd = [0 for i in range(100010)]\nfor i in range(n):\n a, b = list(map(int, input().split()))\n d[a] += b\nfor j, e in enumerate(d):\n k -= e\n if k <= 0:\n print(j)\n break\n","fast_code":"from sys import stdin\nfrom operator import itemgetter\n\n\ndef main():\n lines = stdin.readlines()\n N, K = list(map(int, lines[0].split()))\n abn = [[int(abi) for abi in line.split()] for line in lines[1:]]\n abn.sort(key=itemgetter(0))\n cnt = 0\n for ai, bi in abn:\n cnt += bi\n if K <= cnt:\n print(ai)\n break\n return\n\n\nmain()\n"} +{"fast_code_id":"c90ec233f5c2e155da8773eaeb4f4f89b96b046ea6e538b68f143636b57d580f","fast_id":"p02716_c90ec233f5c2e155da8773eaeb4f4f89b96b046ea6e538b68f143636b57d580f","language":"python","measured_fast_code_id":"c90ec233f5c2e155da8773eaeb4f4f89b96b046ea6e538b68f143636b57d580f","measured_slow_code_id":"a47ec4274f4090dd01fbc1617d6b12873df8f973bd5d6f90940d1d00ea4da576","measurement_metric":"cpu_instruction_count","pair_id":"python_835005f59b4958e99753abcf","problem_id":"p02716","slow_code_id":"a47ec4274f4090dd01fbc1617d6b12873df8f973bd5d6f90940d1d00ea4da576","slow_id":"p02716_a47ec4274f4090dd01fbc1617d6b12873df8f973bd5d6f90940d1d00ea4da576","speedup":3.03861275146019,"stratum":"2-4","sampling_key":"39f7827709e8982468be097cfb4f94f355a5ef9aaafae17c859aa6eea3f90e71","slow_code":"from collections import defaultdict\n\nINF = float(\"inf\")\nN, *A = list(map(int, open(0).read().split()))\ndp_in = defaultdict(lambda: -INF)\ndp_out = defaultdict(lambda: -INF)\ndp_out[(0, 0)] = 0\nfor i, a in enumerate(A, 1):\n p = i // 2\n for j in [p - 1, p, p + 1]:\n dp_in[(i, j)] = a + dp_out[(i - 1, j - 1)]\n dp_out[(i, j)] = max(dp_in[(i - 1, j)], dp_out[(i - 1, j)])\nprint((max(dp_in[(N, N // 2)], dp_out[(N, N // 2)])))\n","fast_code":"import sys\n\ninput = sys.stdin.readline\nn = int(eval(input()))\na = list(map(int, input().split()))\ndp = [0] * n\nc = a[0]\ndp[1] = max(a[0], a[1])\nfor i in range(2, n):\n if i % 2 == 0:\n c += a[i]\n dp[i] = max(dp[i - 2] + a[i], dp[i - 1])\n else:\n dp[i] = max(dp[i - 2] + a[i], c)\nprint((dp[-1]))\n"} +{"fast_code_id":"db5756692a6264c580a095b1a2e599bcd5f8b9d5e0999cafe1063a7fedfe9f24","fast_id":"p03317_817dd18fb076fe764c058863d46156fa9dd6dce07f33ab7029a2a1920fbb650e","language":"python","measured_fast_code_id":"817dd18fb076fe764c058863d46156fa9dd6dce07f33ab7029a2a1920fbb650e","measured_slow_code_id":"40f790b9daefbd644d38ba942e539d6681ed03212cd68a297874ac055d84131a","measurement_metric":"cpu_instruction_count","pair_id":"python_83d8437142edbeacc494f575","problem_id":"p03317","slow_code_id":"40f790b9daefbd644d38ba942e539d6681ed03212cd68a297874ac055d84131a","slow_id":"p03317_40f790b9daefbd644d38ba942e539d6681ed03212cd68a297874ac055d84131a","speedup":6.9293742179228115,"stratum":"4-8","sampling_key":"619be76b9fd2335189563eec7b249283319ad705233ccd5a3f1c9ddba4dc611f","slow_code":"import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time\n\nsys.setrecursionlimit(10**7)\ninf = 10**20\nmod = 10**9 + 7\n\n\ndef LI():\n return list(map(int, input().split()))\n\n\ndef I():\n return int(eval(input()))\n\n\ndef LS():\n return input().split()\n\n\ndef S():\n return eval(input())\n\n\ndef main():\n a, b = LI()\n l = LI()\n c = 1\n _b = b\n while True:\n if a <= _b:\n break\n else:\n _b += b - 1\n c += 1\n return c\n\n\nprint((main()))\n","fast_code":"N, K = list(map(int, input().split()))\nli = list(map(int, input().split()))\nif N == K:\n print((1))\n quit()\ni = 1\nN = N - K\nwhile N >= K:\n N = N - K + 1\n i = i + 1\nprint((i + 1))\n"} +{"fast_code_id":"7cb9911333d82a37d376cf29527c0f4214cf042037a82c628266b50cbb0888f3","fast_id":"p02783_7cb9911333d82a37d376cf29527c0f4214cf042037a82c628266b50cbb0888f3","language":"python","measured_fast_code_id":"7cb9911333d82a37d376cf29527c0f4214cf042037a82c628266b50cbb0888f3","measured_slow_code_id":"d5fe1e3cebc325b88118764de6cebe3ff7e094ae5446fe951fc1767a79f70b68","measurement_metric":"cpu_instruction_count","pair_id":"python_83edd33606d1a1f54b922f16","problem_id":"p02783","slow_code_id":"d5fe1e3cebc325b88118764de6cebe3ff7e094ae5446fe951fc1767a79f70b68","slow_id":"p02783_d5fe1e3cebc325b88118764de6cebe3ff7e094ae5446fe951fc1767a79f70b68","speedup":63.525085588130324,"stratum":"8+","sampling_key":"05f2218c071d9f7ab3f9816bb8585db41bf7f203b4d2f44a055a18476f554da7","slow_code":"import sys\nimport socket\n\nhostname = socket.gethostname()\nif hostname == \"F451C\":\n sys.stdin = open(\"a1.in\")\n\n\ndef read_int_list():\n return list(map(int, input().split()))\n\n\ndef read_str_list():\n return input().split()\n\n\ndef read_int():\n return int(eval(input()))\n\n\ndef read_str():\n return eval(input())\n\n\ndef main_0():\n H, A = read_int_list()\n res = 0\n for i in range(10001):\n H = H - A\n res += 1\n if H <= 0:\n break\n print(res)\n\n\ndef main_1():\n H, A = read_int_list()\n res = H // A\n if H % A != 0:\n res += 1\n print(res)\n\n\ndef main():\n H, A = read_int_list()\n res = 0\n while H > 0:\n H -= A\n res += 1\n print(res)\n\n\nmain()\n","fast_code":"h, a = list(map(int, input().split()))\nprint((int((h - 1) / a) + 1))\n"} +{"fast_code_id":"d6ffc3f4b9190e53ed4e419f2c27d963e7cb5dbc2b6948c35957b55ce00a6dc7","fast_id":"p02989_d6ffc3f4b9190e53ed4e419f2c27d963e7cb5dbc2b6948c35957b55ce00a6dc7","language":"python","measured_fast_code_id":"d6ffc3f4b9190e53ed4e419f2c27d963e7cb5dbc2b6948c35957b55ce00a6dc7","measured_slow_code_id":"f57035b7bb87a32b44942a577f637699784efe8a08be08008b173476e76e8522","measurement_metric":"cpu_instruction_count","pair_id":"python_840107d36492786a821d9c5d","problem_id":"p02989","slow_code_id":"f57035b7bb87a32b44942a577f637699784efe8a08be08008b173476e76e8522","slow_id":"p02989_f57035b7bb87a32b44942a577f637699784efe8a08be08008b173476e76e8522","speedup":43.580255725730225,"stratum":"8+","sampling_key":"0b98b8315ea0e0d21ef5f71f0cfd012549983c71dc1c3ed1b73e1505cc643fee","slow_code":"from collections import Counter\n\nn = int(eval(input()))\nd = list(map(int, input().split()))\nminD = min(d)\nmaxD = max(d)\nc = Counter(d)\nabc = 0\narc = n\nans = 0\nfor i in range(minD, maxD + 1):\n abc += c[i - 1]\n arc -= c[i - 1]\n if abc == arc:\n ans += 1\nprint(ans)\n","fast_code":"N = int(eval(input()))\nd = sorted(map(int, input().split()))\nabcmax = d[N // 2 - 1]\narcmin = d[N // 2]\nprint((arcmin - abcmax))\n"} +{"fast_code_id":"cc2b3211d546727b2e8b70a7683b1523d57b0e5a1446587ecda6ed45b220783d","fast_id":"p02989_cc2b3211d546727b2e8b70a7683b1523d57b0e5a1446587ecda6ed45b220783d","language":"python","measured_fast_code_id":"cc2b3211d546727b2e8b70a7683b1523d57b0e5a1446587ecda6ed45b220783d","measured_slow_code_id":"f57035b7bb87a32b44942a577f637699784efe8a08be08008b173476e76e8522","measurement_metric":"cpu_instruction_count","pair_id":"python_841ce2d658c065fec92ff661","problem_id":"p02989","slow_code_id":"f57035b7bb87a32b44942a577f637699784efe8a08be08008b173476e76e8522","slow_id":"p02989_f57035b7bb87a32b44942a577f637699784efe8a08be08008b173476e76e8522","speedup":44.47435596912985,"stratum":"8+","sampling_key":"0ad9615ab6fa5cff7a3649a85c533cf85ad4f4006b06bde8178faf0cf52da0aa","slow_code":"from collections import Counter\n\nn = int(eval(input()))\nd = list(map(int, input().split()))\nminD = min(d)\nmaxD = max(d)\nc = Counter(d)\nabc = 0\narc = n\nans = 0\nfor i in range(minD, maxD + 1):\n abc += c[i - 1]\n arc -= c[i - 1]\n if abc == arc:\n ans += 1\nprint(ans)\n","fast_code":"n = int(eval(input()))\nd = sorted(list(map(int, input().split())))\nans = d[n // 2] - d[n // 2 - 1]\nprint(ans)\n"} +{"fast_code_id":"6326b7c3339323630b0538ff8f4fab80e04370ee9d232e29cb5f8496bef98f44","fast_id":"p03737_692117a18a72b75a697df974f895fee5b723b707c01de769bc8fc16aec3f8110","language":"python","measured_fast_code_id":"692117a18a72b75a697df974f895fee5b723b707c01de769bc8fc16aec3f8110","measured_slow_code_id":"c5a6a790bfe3c359c7ab2698d0f376a617bb650fa938bf64d595d41523985f6d","measurement_metric":"cpu_instruction_count","pair_id":"python_843174440aa7e3699ab1c2cc","problem_id":"p03737","slow_code_id":"c5a6a790bfe3c359c7ab2698d0f376a617bb650fa938bf64d595d41523985f6d","slow_id":"p03737_c5a6a790bfe3c359c7ab2698d0f376a617bb650fa938bf64d595d41523985f6d","speedup":1313.1575741754473,"stratum":"8+","sampling_key":"f90262a65f057cb1abad176862dca69a1c1d60ed490eca9f6c74dc8f457236bd","slow_code":"import numpy as np\nimport math\n\ns = \" \" + input()\nfor i in range(len(s)):\n if s[i] == \" \":\n print(chr(ord(s[i + 1]) - 32), end=\"\")\nprint()\n","fast_code":"def generate_acronym(l1: list) -> str:\n answer = \"\"\n for word in l1:\n\n answer += word[0].upper()\n return answer\n\n\nlists = list(map(str, input().split()))\nprint((generate_acronym(lists)))\n"} +{"fast_code_id":"9e7eba1c890b6035fcaef03622b7f1416b8c1fa466ef824734e16a35ae5fc540","fast_id":"p02628_9e7eba1c890b6035fcaef03622b7f1416b8c1fa466ef824734e16a35ae5fc540","language":"python","measured_fast_code_id":"9e7eba1c890b6035fcaef03622b7f1416b8c1fa466ef824734e16a35ae5fc540","measured_slow_code_id":"12fc0a6880b1658c0eaeba3aa7dd7893393cf5c052e40105869e3784eb2f1caa","measurement_metric":"cpu_instruction_count","pair_id":"python_84f48e7e3414fbfa1482b6bb","problem_id":"p02628","slow_code_id":"12fc0a6880b1658c0eaeba3aa7dd7893393cf5c052e40105869e3784eb2f1caa","slow_id":"p02628_12fc0a6880b1658c0eaeba3aa7dd7893393cf5c052e40105869e3784eb2f1caa","speedup":43.73130910522339,"stratum":"8+","sampling_key":"9e6b6fe5c1024377b673c94bd1151041650cd1b9239585201cf5c0210d34c76a","slow_code":"N, K = list(map(int, input().split()))\nP = list(map(int, input().split()))\n\n\ndef bubblesort(l):\n for index in range(len(l) - 1, 0, -1):\n for low in range(index):\n if l[low] > l[low + 1]:\n tmp = l[low + 1]\n l[low + 1] = l[low]\n l[low] = tmp\n return l\n\n\nbubblesort(P)\nsum = 0\nfor i in range(K):\n sum = sum + P[i]\nprint(sum)\n","fast_code":"n, k = list(map(int, input().split()))\np = list(map(int, input().split()))\np.sort()\nans = sum(p[:k])\nprint(ans)\n"} +{"fast_code_id":"c4a97a119ec31200442f098867df478f7a5aa2898ce15a55db3c881becef4bc9","fast_id":"p02804_ca0e9f7eb590be44c97e30f62900eb81c1c0ecd2ce4ab6b96ce3eda14baa82c3","language":"python","measured_fast_code_id":"ca0e9f7eb590be44c97e30f62900eb81c1c0ecd2ce4ab6b96ce3eda14baa82c3","measured_slow_code_id":"52e56efda7e8ad6e4fdc8f09b72891b75e6a9de56b6e71746fa44cb90b571757","measurement_metric":"cpu_instruction_count","pair_id":"python_8507a5f53d969c777498aee4","problem_id":"p02804","slow_code_id":"c994ccc5a265f81602ec3599210c2d88b03e4417d6b99505fd51e34598f98009","slow_id":"p02804_52e56efda7e8ad6e4fdc8f09b72891b75e6a9de56b6e71746fa44cb90b571757","speedup":229.01688983204502,"stratum":"8+","sampling_key":"0c8ab2fbc40dcd6c951abd2d48faf07806a4d57d2c3f05390a5ae898576dd74d","slow_code":"from collections import defaultdict\n\n\nclass Combination:\n\n def __init__(self, n_max, mod=10**9 + 7):\n self.mod = mod\n self.modinv = self.make_modinv_list(n_max)\n self.fac, self.facinv = self.make_factorial_list(n_max)\n\n def __call__(self, n, r):\n return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n - r] % self.mod\n\n def make_factorial_list(self, n):\n\n fac = [1]\n facinv = [1]\n for i in range(1, n + 1):\n fac.append(fac[i - 1] * i % self.mod)\n facinv.append(facinv[i - 1] * self.modinv[i] % self.mod)\n return fac, facinv\n\n def make_modinv_list(self, n):\n\n modinv = [0] * (n + 1)\n modinv[1] = 1\n for i in range(2, n + 1):\n modinv[i] = self.mod - self.mod // i * modinv[self.mod % i] % self.mod\n return modinv\n\n\ndef main():\n\n N, K = list(map(int, input().split()))\n A = list(map(int, input().split()))\n A.sort()\n ans = 0\n mod = 10**9 + 7\n comb = Combination(1000000)\n\n for i, a in enumerate(A):\n if (N - 1 - i) >= K - 1:\n\n tmp = comb(N - 1 - i, K - 1)\n ans -= a * tmp\n ans %= mod\n else:\n break\n A.sort(reverse=True)\n for i, a in enumerate(A):\n if (N - 1 - i) >= K - 1:\n\n tmp = comb(N - 1 - i, K - 1)\n ans += a * tmp\n ans %= mod\n else:\n break\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"p = 1000000007\nN, K = list(map(int, input().split()))\nA = list(map(int, input().split()))\nfac = [0] * (N + 1)\nfac[0] = 1\nfor i in range(N):\n fac[i + 1] = fac[i] * (i + 1) % p\n\n\ndef mcomb(n, k):\n if n == 0 and k == 0:\n return 1\n if n < k or k < 0:\n return 0\n return fac[n] * pow(fac[n - k], p - 2, p) * pow(fac[k], p - 2, p) % p\n\n\nA.sort(reverse=True)\nresult = 0\nfor i in range(N - K + 1):\n result += A[i] * mcomb(N - (i + 1), K - 1)\n result %= p\nA.reverse()\nfor i in range(N - K + 1):\n result -= A[i] * mcomb(N - (i + 1), K - 1)\n result %= p\n\n\nprint(result)\n"} +{"fast_code_id":"0a73d7f83eb25a8cfe9a26c4f9be97210a015dfb66c31fcefc1d6845352665d6","fast_id":"p04006_0a73d7f83eb25a8cfe9a26c4f9be97210a015dfb66c31fcefc1d6845352665d6","language":"python","measured_fast_code_id":"0a73d7f83eb25a8cfe9a26c4f9be97210a015dfb66c31fcefc1d6845352665d6","measured_slow_code_id":"91e1e2c740659f8110b6da7065d298174d653edb3135242031e3d37884d00c98","measurement_metric":"cpu_instruction_count","pair_id":"python_861669e5ae44bb119ca4a3d9","problem_id":"p04006","slow_code_id":"91e1e2c740659f8110b6da7065d298174d653edb3135242031e3d37884d00c98","slow_id":"p04006_91e1e2c740659f8110b6da7065d298174d653edb3135242031e3d37884d00c98","speedup":4.8467675411338496,"stratum":"4-8","sampling_key":"13156098d07e929f2476942986db8cbbd21cb7d85a9cd45baba16dced82f3f05","slow_code":"import numpy as np\nfrom copy import deepcopy\n\nN, x = list(map(int, input().split()))\nA = list(map(int, input().split()))\n\n\ndef myfunc(N, x, A):\n B = deepcopy(np.array(A))\n m = sum(B)\n\n def apppop(A):\n A.append(A[0])\n A.pop(0)\n\n for idx in range(1, N):\n apppop(A)\n np.fmin(B, A, out=B)\n m = min(np.sum(B) + idx * x, m)\n print(int(m))\n\n\nmyfunc(N, x, A)\n","fast_code":"def main():\n N, x = list(map(int, input().split()))\n a = list(map(int, input().split()))\n ans = float(\"INF\")\n b = [float(\"INF\")] * N\n for k in range(N):\n temp_ans = k * x\n for i in range(N):\n b[i] = min(b[i], a[i - k])\n temp_ans += b[i]\n ans = min(ans, temp_ans)\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"4a41a073e30cf40ff9483d06ae31fc65933cc99e121807f0155c63537dd692fb","fast_id":"p03170_4a41a073e30cf40ff9483d06ae31fc65933cc99e121807f0155c63537dd692fb","language":"python","measured_fast_code_id":"4a41a073e30cf40ff9483d06ae31fc65933cc99e121807f0155c63537dd692fb","measured_slow_code_id":"44ab44f9e0708ecce80e5a0c02da99cd45ce3cb07c5e61f81167622dfdca55b6","measurement_metric":"cpu_instruction_count","pair_id":"python_861d7726b94ba6d9ce702637","problem_id":"p03170","slow_code_id":"4ece6832a9a333f3309aed083539ed744829fb449cb2b735a264c1214513b29f","slow_id":"p03170_44ab44f9e0708ecce80e5a0c02da99cd45ce3cb07c5e61f81167622dfdca55b6","speedup":4.856416179082469,"stratum":"4-8","sampling_key":"0c2128d7ffa745f17d124c5dbdea18aac5c263378c37111edd7c62b2cd7fb561","slow_code":"import collections\n\n\ndef solve(xs):\n dp = collections.defaultdict(bool)\n dp[0] = False\n for j in range(1, K + 1):\n iterable = ((j >= x) and (not dp[j - x]) for x in xs)\n dp[j] = any(iterable)\n return dp[K]\n\n\nN, K = list(map(int, input().split()))\nchoices = collections.Counter([float(s) for s in input().split()])\nassert len(choices) == N\nres = solve(choices)\nprint((\"First\" if res else \"Second\"))\n","fast_code":"n, k = list(map(int, input().split()))\na_s = list(map(int, input().split()))\ndp = [\"Second\"] * (k + 1)\nfor i in range(k + 1):\n if dp[i] == \"Second\":\n for a in a_s:\n ii = i + a\n if ii <= k:\n dp[ii] = \"First\"\nprint((dp[-1]))\n"} +{"fast_code_id":"5343f51941a09a2e5668271538551f10be83cd1f8966e97081cc9dcf5652de05","fast_id":"p02570_5343f51941a09a2e5668271538551f10be83cd1f8966e97081cc9dcf5652de05","language":"python","measured_fast_code_id":"5343f51941a09a2e5668271538551f10be83cd1f8966e97081cc9dcf5652de05","measured_slow_code_id":"c18a3a7e4014bde24e915dc4b9c7a40ca0c367289dfe9b646d5af979ad55733c","measurement_metric":"cpu_instruction_count","pair_id":"python_8659df7fc22d3f960c0210ac","problem_id":"p02570","slow_code_id":"a6a6da28ea21eb5c6cfeb4da55db52d83b5c9e592e210fb6c9a771a885099c2e","slow_id":"p02570_c18a3a7e4014bde24e915dc4b9c7a40ca0c367289dfe9b646d5af979ad55733c","speedup":32.68805460870676,"stratum":"8+","sampling_key":"0b15e8ae188b075aeeb8abdd4db68ff51afc09ee5fbb283b75021e354e11e66b","slow_code":"def LI():\n return list(map(int, input().split()))\n\n\ndef II():\n return int(input())\n\n\ndef yes():\n return print(\"Yes\")\n\n\ndef no():\n return print(\"No\")\n\n\nINF = float(\"inf\")\nfrom collections import deque, defaultdict, Counter\nfrom heapq import heappop, heappush\nfrom itertools import product, combinations\nfrom functools import reduce, lru_cache\nfrom math import pi, gcd\nfrom decimal import Decimal\n\n\nclass Combination:\n\n def __init__(self, n_max, mod=10**9 + 7):\n self.mod = mod\n self.modinv = self.make_modinv_list(n_max)\n self.fac, self.facinv = self.make_factorial_list(n_max)\n\n def __call__(self, n, r):\n return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n - r] % self.mod\n\n def make_factorial_list(self, n):\n\n fac = [1]\n facinv = [1]\n for i in range(1, n + 1):\n fac.append(fac[i - 1] * i % self.mod)\n facinv.append(facinv[i - 1] * self.modinv[i] % self.mod)\n return fac, facinv\n\n def make_modinv_list(self, n):\n\n modinv = [0] * (n + 1)\n modinv[1] = 1\n for i in range(2, n + 1):\n modinv[i] = self.mod - self.mod // i * modinv[self.mod % i] % self.mod\n return modinv\n\n\nclass Unionfind:\n def __init__(self, N):\n self.p = list(range(N))\n self.rank = [0] * N\n self.size = [1] * N\n\n def root(self, x):\n if self.p[x] != x:\n self.p[x] = self.root(self.p[x])\n return self.p[x]\n\n def same(self, x, y):\n return self.root(x) == self.root(y)\n\n def unite(self, x, y):\n u = self.root(x)\n v = self.root(y)\n if u == v:\n return\n if self.rank[u] < self.rank[v]:\n self.p[u] = v\n self.size[v] += self.size[u]\n self.size[u] = 0\n else:\n self.p[v] = u\n self.size[u] += self.size[v]\n self.size[v] = 0\n if self.rank[u] == self.rank[v]:\n self.rank[u] += 1\n\n def count(self, x):\n return self.size[self.root(x)]\n\n\nd, t, s = LI()\nif d <= t * s:\n print(\"Yes\")\nelse:\n print(\"No\")\n","fast_code":"D, T, S = list(map(float, input().split()))\nif D / S <= T:\n print(\"Yes\")\nelse:\n print(\"No\")\n"} +{"fast_code_id":"fddd0a83774174bd00184a1c73cd6a45e2356da016ece3ad64cf5f3dd5768430","fast_id":"p02570_fddd0a83774174bd00184a1c73cd6a45e2356da016ece3ad64cf5f3dd5768430","language":"python","measured_fast_code_id":"fddd0a83774174bd00184a1c73cd6a45e2356da016ece3ad64cf5f3dd5768430","measured_slow_code_id":"7df3ffb5a8416f2149c9ce5f388659f4fb80cc7488ec540c2ef41ccf0a9e9129","measurement_metric":"cpu_instruction_count","pair_id":"python_86cf3b2473d6a96fa97bf11f","problem_id":"p02570","slow_code_id":"09b0c0d43abbb6955208c35fb1cca343f1b4cbf34ced526e48c841c54fa3ed5f","slow_id":"p02570_7df3ffb5a8416f2149c9ce5f388659f4fb80cc7488ec540c2ef41ccf0a9e9129","speedup":6.579704590337169,"stratum":"4-8","sampling_key":"6935ae3c3f686333ecd3b0f5395ef20bbcc944f300fa9d659e1218007662476a","slow_code":"def LI():\n return list(map(int, input().split()))\n\n\ndef II():\n return int(input())\n\n\ndef yes():\n return print(\"Yes\")\n\n\ndef no():\n return print(\"No\")\n\n\nclass Combination:\n\n def __init__(self, n_max, mod=10**9 + 7):\n self.mod = mod\n self.modinv = self.make_modinv_list(n_max)\n self.fac, self.facinv = self.make_factorial_list(n_max)\n\n def __call__(self, n, r):\n return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n - r] % self.mod\n\n def make_factorial_list(self, n):\n\n fac = [1]\n facinv = [1]\n for i in range(1, n + 1):\n fac.append(fac[i - 1] * i % self.mod)\n facinv.append(facinv[i - 1] * self.modinv[i] % self.mod)\n return fac, facinv\n\n def make_modinv_list(self, n):\n\n modinv = [0] * (n + 1)\n modinv[1] = 1\n for i in range(2, n + 1):\n modinv[i] = self.mod - self.mod // i * modinv[self.mod % i] % self.mod\n return modinv\n\n\nclass Unionfind:\n def __init__(self, N):\n self.p = list(range(N))\n self.rank = [0] * N\n self.size = [1] * N\n\n def root(self, x):\n if self.p[x] != x:\n self.p[x] = self.root(self.p[x])\n return self.p[x]\n\n def same(self, x, y):\n return self.root(x) == self.root(y)\n\n def unite(self, x, y):\n u = self.root(x)\n v = self.root(y)\n if u == v:\n return\n if self.rank[u] < self.rank[v]:\n self.p[u] = v\n self.size[v] += self.size[u]\n self.size[u] = 0\n else:\n self.p[v] = u\n self.size[u] += self.size[v]\n self.size[v] = 0\n if self.rank[u] == self.rank[v]:\n self.rank[u] += 1\n\n def count(self, x):\n return self.size[self.root(x)]\n\n\nd, t, s = LI()\nif d <= t * s:\n yes()\nelse:\n no()\n","fast_code":"import sys\n\nread = sys.stdin.read\nreadlines = sys.stdin.readlines\nfrom collections import Counter\n\n\ndef main():\n d, t, s = list(map(int, input().split()))\n dis = s * t\n if d > dis:\n print(\"No\")\n else:\n print(\"Yes\")\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"f4be1cbc96e84fadced525db45b70d084e5f4671c327df573dbd112c4a9f962c","fast_id":"p03695_f4be1cbc96e84fadced525db45b70d084e5f4671c327df573dbd112c4a9f962c","language":"python","measured_fast_code_id":"f4be1cbc96e84fadced525db45b70d084e5f4671c327df573dbd112c4a9f962c","measured_slow_code_id":"7f271d923060c17e2c49a8d7f271bc0668cd1f8f85b998cc6651cd42c9e43961","measurement_metric":"cpu_instruction_count","pair_id":"python_86d9fa1367bf91edf7e67e0f","problem_id":"p03695","slow_code_id":"7f271d923060c17e2c49a8d7f271bc0668cd1f8f85b998cc6651cd42c9e43961","slow_id":"p03695_7f271d923060c17e2c49a8d7f271bc0668cd1f8f85b998cc6651cd42c9e43961","speedup":333.23323495987523,"stratum":"8+","sampling_key":"0d5fc4f05c2d7885b8aec47347e1e3559996ba88e9127c5273f7583cd44dfd98","slow_code":"from bisect import bisect_left\nimport numpy as np\n\nn = int(input())\na = map(int, input().split())\nborder = np.arange(399, 3200, 400)\ncnt = [0] * (len(border) + 1)\nfor i in a:\n cnt[bisect_left(border, i)] += 1\nk = np.count_nonzero(cnt[:-1])\nprint(k, k + cnt[-1]) if k != 0 else print(1, cnt[-1])\n","fast_code":"a = int(eval(input()))\nb = list(map(int, input().split()))\nc = {0: 0, 1: 0, 2: 0, 3: 0, 4: 0, 5: 0, 6: 0, 7: 0}\nd = 0\nfor i in b:\n if 1 <= i <= 399:\n c[0] += 1\n elif 400 <= i <= 799:\n c[1] += 1\n elif 800 <= i <= 1199:\n c[2] += 1\n elif 1200 <= i <= 1599:\n c[3] += 1\n elif 1600 <= i <= 1999:\n c[4] += 1\n elif 2000 <= i <= 2399:\n c[5] += 1\n elif 2400 <= i <= 2799:\n c[6] += 1\n elif 2800 <= i <= 3199:\n c[7] += 1\n else:\n d += 1\ne = 0\nfor k, v in list(c.items()):\n if v != 0:\n e += 1\nprint((str(max(e, 1)) + \" \" + str(e + d)))\n"} +{"fast_code_id":"18a478db01dd495ea3fad9e396632e5f652c11d9ff33ec9b4eeca5aad4f583d0","fast_id":"p02854_18a478db01dd495ea3fad9e396632e5f652c11d9ff33ec9b4eeca5aad4f583d0","language":"python","measured_fast_code_id":"18a478db01dd495ea3fad9e396632e5f652c11d9ff33ec9b4eeca5aad4f583d0","measured_slow_code_id":"4de60e0edb003c68afc8588a6fa312bb9c3f4fe04cd967a5d89f04e986a70922","measurement_metric":"cpu_instruction_count","pair_id":"python_86edfe1a2e8fc1a0184ba829","problem_id":"p02854","slow_code_id":"df24bf072adc34e3a816768d47c73f69af21583e676303edb8a1a73b6192615f","slow_id":"p02854_4de60e0edb003c68afc8588a6fa312bb9c3f4fe04cd967a5d89f04e986a70922","speedup":2.4991316568670237,"stratum":"2-4","sampling_key":"0bb9014bf89076fb98e1d400d4b2baa3cee11c609ae887a174dac7294aaef250","slow_code":"n = int(eval(input()))\na = list(map(int, input().split()))\nans = 0\ns = sum(a)\nal = []\nsum1 = 0\nfor i in range(0, n):\n\n sum1 += a[i]\n sum2 = s - sum1\n\n al.append(abs(sum1 - sum2))\n if sum1 == sum2:\n print((0))\n exit()\nminDiffIdx = al.index(min(al))\n\n\ntmp1 = sum(a[0:minDiffIdx])\ntmp2 = sum(a[minDiffIdx:])\n\n\ndiff1 = abs(tmp1 - tmp2)\ntmp3 = sum(a[0 : minDiffIdx + 1])\ntmp4 = sum(a[minDiffIdx + 1 :])\n\n\ndiff2 = abs(tmp3 - tmp4)\nprint((min(diff1, diff2)))\n","fast_code":"from itertools import accumulate, count\nfrom bisect import bisect_right\n\neval(input())\na = [0] + list(accumulate(list(map(int, input().split()))))\ni = bisect_right(a, a[-1] // 2)\nprint((min(2 * a[i] - a[-1], a[-1] - 2 * a[i - 1])))\n"} +{"fast_code_id":"3607eb610e53afe08a0d4028f9ca3da705bc97aa23658f05f3d879374106ab51","fast_id":"p03296_3607eb610e53afe08a0d4028f9ca3da705bc97aa23658f05f3d879374106ab51","language":"python","measured_fast_code_id":"3607eb610e53afe08a0d4028f9ca3da705bc97aa23658f05f3d879374106ab51","measured_slow_code_id":"a260e38fd68198bd3b846ed815f9f7842be8a43a1a00830ef94d4cac2df063d2","measurement_metric":"cpu_instruction_count","pair_id":"python_8707e3f27eda2ffaffe221bc","problem_id":"p03296","slow_code_id":"98718a5692a33a090df0421f7d48f7b20be3a15dafddd3f88613c957f01f774b","slow_id":"p03296_a260e38fd68198bd3b846ed815f9f7842be8a43a1a00830ef94d4cac2df063d2","speedup":2.190085187094913,"stratum":"2-4","sampling_key":"3f5bebd908a72d19c2b56c178125250aa0609240c5fd4444fc6f4cbbc1de0943","slow_code":"import sys\n\nINF = float(\"inf\")\nMOD = 10**9 + 7\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef LI_():\n return [int(x) - 1 for x in sys.stdin.readline().split()]\n\n\ndef LF():\n return [float(x) for x in sys.stdin.readline().split()]\n\n\ndef LS():\n return sys.stdin.readline().split()\n\n\ndef II():\n return int(sys.stdin.readline())\n\n\ndef SI():\n return eval(input())\n\n\ndef main():\n n = II()\n A = LI()\n res = 0\n for i in range(1, n):\n if A[i] == A[i - 1]:\n A[i] = 0\n res += 1\n return res\n\n\nprint((main()))\n","fast_code":"N = int(eval(input()))\nA = list(map(int, input().split()))\nans = 0\nchanged = False\nfor a, b in zip(A, A[1:]):\n if changed:\n changed = False\n continue\n if a == b:\n ans += 1\n changed = True\nprint(ans)\n"} +{"fast_code_id":"b7b8235fce3c8914e22b2710ff6799014c7410a36ea1f799ef976444b407f32e","fast_id":"p02732_b7b8235fce3c8914e22b2710ff6799014c7410a36ea1f799ef976444b407f32e","language":"python","measured_fast_code_id":"b7b8235fce3c8914e22b2710ff6799014c7410a36ea1f799ef976444b407f32e","measured_slow_code_id":"715c50a0bd5503a1c5a8f5900a3590d1b55c78b7a98e77c948ef59c2a023b3ea","measurement_metric":"cpu_instruction_count","pair_id":"python_872c44a2c5fee7be03caa40f","problem_id":"p02732","slow_code_id":"715c50a0bd5503a1c5a8f5900a3590d1b55c78b7a98e77c948ef59c2a023b3ea","slow_id":"p02732_715c50a0bd5503a1c5a8f5900a3590d1b55c78b7a98e77c948ef59c2a023b3ea","speedup":3.4474488780707473,"stratum":"2-4","sampling_key":"6843693454e06d500a79ae478d53233446cca7ec1bc2769b512449695721261a","slow_code":"from functools import reduce\n\n\ndef d_banned_k():\n from collections import Counter\n from functools import reduce\n\n N = int(eval(input()))\n A = [int(i) for i in input().split()]\n\n def comb(n, r):\n numerator = reduce(lambda x, y: x * y, list(range(n, n - r, -1)))\n denominator = reduce(lambda x, y: x * y, list(range(1, r + 1)))\n return numerator // denominator\n\n count = Counter(A)\n total = sum(comb(c, 2) for c in list(count.values()))\n ans = []\n for a in A:\n v = count[a]\n ans.append(total - comb(v, 2) + comb(v - 1, 2))\n return \" \".join(map(str, ans))\n\n\nprint((d_banned_k()))\n","fast_code":"import collections\n\n\ndef myAnswer(N: int, A: list) -> None:\n dic = collections.Counter(A)\n total = 0\n for value in list(dic.values()):\n total += value * (value - 1) // 2\n for a in A:\n print((total - (dic[a] - 1)))\n\n\ndef modelAnswer():\n return\n\n\ndef main():\n N = int(eval(input()))\n A = list(map(int, input().split()))\n myAnswer(N, A[:])\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"81ca0d996be48ce54ec018c834f60d7eef9dbdab43b577bcaed380acfa0a8165","fast_id":"p03244_81ca0d996be48ce54ec018c834f60d7eef9dbdab43b577bcaed380acfa0a8165","language":"python","measured_fast_code_id":"81ca0d996be48ce54ec018c834f60d7eef9dbdab43b577bcaed380acfa0a8165","measured_slow_code_id":"100838eb35611188aaa0e6508544517c0abf47ad6e005b321a85725c0e9840dd","measurement_metric":"cpu_instruction_count","pair_id":"python_8782634870b5820745d21020","problem_id":"p03244","slow_code_id":"a39b059af4b03221115ad0dd54a76e5f423fd6c8173a18ffdbed4e08ab13360c","slow_id":"p03244_100838eb35611188aaa0e6508544517c0abf47ad6e005b321a85725c0e9840dd","speedup":174.14453467623534,"stratum":"8+","sampling_key":"55d9ad1ba52d7fb7baf323ae9a207861692934b97706aa90424df20c1d656c6a","slow_code":"import numpy as np\n\neven = np.zeros(100001, dtype=int)\nodd = np.zeros(100001, dtype=int)\nn = int(eval(input()))\nv = list(map(int, input().split()))\nfor i in range(n):\n if i % 2 == 0:\n even[v[i]] += 1\n else:\n odd[v[i]] += 1\ne1 = even.argmax()\ne1n = even.max()\no1 = odd.argmax()\no1n = odd.max()\n\nif e1 == o1:\n e2n = np.sort(even)[-2]\n o2n = np.sort(odd)[-2]\n\n print((min(n - e1n - o2n, n - e2n - o1n)))\nelse:\n print((n - e1n - o1n))\n","fast_code":"from collections import Counter\n\nn = int(eval(input()))\nv = list(map(int, input().split()))\nv1 = Counter(v[::2]).most_common()\nv2 = Counter(v[1::2]).most_common()\nv1.append((0, 0))\nv2.append((0, 0))\nif v1[0][0] != v2[0][0]:\n print((n - v1[0][1] - v2[0][1]))\nelse:\n print((min(n - v1[0][1] - v2[1][1], n - v1[1][1] - v2[0][1])))\n"} +{"fast_code_id":"98589ecfe12c247975eef38491d0a7ce07567e4ad28fb4de0d08727f1404dc4b","fast_id":"p03037_a6f4398bd13786c1983ff81b03d24372f6ba8f308c52382b75f22e1d7a34c238","language":"python","measured_fast_code_id":"a6f4398bd13786c1983ff81b03d24372f6ba8f308c52382b75f22e1d7a34c238","measured_slow_code_id":"603682b2a1acebd824f0081d6dbfdc82575d41c2aa8f541e6ca8387c5cde8833","measurement_metric":"cpu_instruction_count","pair_id":"python_87bad868ad34d3120c210273","problem_id":"p03037","slow_code_id":"603682b2a1acebd824f0081d6dbfdc82575d41c2aa8f541e6ca8387c5cde8833","slow_id":"p03037_603682b2a1acebd824f0081d6dbfdc82575d41c2aa8f541e6ca8387c5cde8833","speedup":4.186314310187106,"stratum":"4-8","sampling_key":"075f4ad4271ffe48679f99462bc7449fbba6af02483942a399280892ca2967b4","slow_code":"import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, queue, copy\n\nsys.setrecursionlimit(10**7)\ninf = 10**20\nmod = 10**9 + 7\ndd = [(-1, 0), (0, 1), (1, 0), (0, -1)]\nddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef LI_():\n return [int(x) - 1 for x in sys.stdin.readline().split()]\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LS():\n return sys.stdin.readline().split()\n\n\ndef S():\n return eval(input())\n\n\ndef main():\n n, k = LI()\n l = [0] * (n + 1)\n for _ in range(k):\n a, b = LI()\n l[a - 1] += 1\n l[b] -= 1\n for i in range(n - 1):\n l[i + 1] += l[i]\n ans = 0\n for x in l[:-1]:\n if x == k:\n ans += 1\n return ans\n\n\nprint((main()))\n","fast_code":"N, M = list(map(int, input().split()))\nL = []\nR = []\nfor i in range(M):\n (\n l,\n r,\n ) = list(map(int, input().split()))\n L.append(l)\n R.append(r)\nmax_l = 0\nmin_r = N\nfor i in range(M):\n if max_l < L[i]:\n max_l = L[i]\n if min_r > R[i]:\n min_r = R[i]\nif max_l > min_r:\n print((0))\nelse:\n print((min_r - max_l + 1))\n"} +{"fast_code_id":"58d5197f8e56470e4bf6371be6a42c8db60f474c0b6b7e6c6e002ba43e31c53c","fast_id":"p03962_58d5197f8e56470e4bf6371be6a42c8db60f474c0b6b7e6c6e002ba43e31c53c","language":"python","measured_fast_code_id":"58d5197f8e56470e4bf6371be6a42c8db60f474c0b6b7e6c6e002ba43e31c53c","measured_slow_code_id":"24c7e03eb06391afb178bbc9822c72872960e2ddbc2acbb527389de409e3ad89","measurement_metric":"cpu_instruction_count","pair_id":"python_87d2391f5a78f1b6c4d452c7","problem_id":"p03962","slow_code_id":"24c7e03eb06391afb178bbc9822c72872960e2ddbc2acbb527389de409e3ad89","slow_id":"p03962_24c7e03eb06391afb178bbc9822c72872960e2ddbc2acbb527389de409e3ad89","speedup":3.047075298215987,"stratum":"2-4","sampling_key":"047d20214d99b76d424a0ab5f477915b6b85789e498732f3da03f8dbe516b015","slow_code":"x, y, z = list(map(int, input().split()))\nif x == y and y == z:\n print((1))\nelif x == y or y == z or z == x:\n print((2))\nelse:\n print((3))\n","fast_code":"print((len({*input().split()})))\n"} +{"fast_code_id":"60774fe21ca597c35812d74624719a4bfa498a05eec19e67db1a9e88616d9992","fast_id":"p03721_08babfd402c1a81890d7df8e3f80094a0aad918f88f47ccf882c7e032849217a","language":"python","measured_fast_code_id":"08babfd402c1a81890d7df8e3f80094a0aad918f88f47ccf882c7e032849217a","measured_slow_code_id":"75d5b758a5047678745153d41c380f660afa7f9d4f81ada1ef8c3eb0b4fb4d9c","measurement_metric":"cpu_instruction_count","pair_id":"python_87e9d9214ba283c4f28964a8","problem_id":"p03721","slow_code_id":"75d5b758a5047678745153d41c380f660afa7f9d4f81ada1ef8c3eb0b4fb4d9c","slow_id":"p03721_75d5b758a5047678745153d41c380f660afa7f9d4f81ada1ef8c3eb0b4fb4d9c","speedup":4.614180725337706,"stratum":"4-8","sampling_key":"d24dc889f6c351b6fe13cabe8112711f9d97bd35a9ed54f2037b5f5d8ea9e57d","slow_code":"import sys\nimport numpy as np\nimport collections\n\nn, k = [int(x) for x in sys.stdin.readline().split()]\nr = collections.defaultdict(int)\nfor i in range(n):\n a, b = [int(x) for x in sys.stdin.readline().split()]\n r[a] += b\nd = sorted(r.items())\nc = 0\nfor i, j in enumerate(d):\n c += j[1]\n if c >= k:\n print((int(j[0])))\n break\n","fast_code":"N, K = list(map(int, input().split()))\nS = [list(map(int, input().split())) for _ in range(N)]\nfrom operator import itemgetter\n\nS.sort(key=itemgetter(0))\n\ntimes = 0\n\nindex = 0\nwhile True:\n hoge = times + S[index][1]\n if hoge < K:\n times += S[index][1]\n else:\n re = S[index][0]\n break\n index += 1\nprint(re)\n"} +{"fast_code_id":"4f3d85eaacfd2e240e72d8947416edfca715e6964b62d6aa7aeb66b88bad5ee5","fast_id":"p03207_4f3d85eaacfd2e240e72d8947416edfca715e6964b62d6aa7aeb66b88bad5ee5","language":"python","measured_fast_code_id":"4f3d85eaacfd2e240e72d8947416edfca715e6964b62d6aa7aeb66b88bad5ee5","measured_slow_code_id":"5cb7a4c7cf0d8a71a4fd49887b2da818d3766f3e397b1d44bc46374144eeebdc","measurement_metric":"cpu_instruction_count","pair_id":"python_882b2b918f516183e98cdce9","problem_id":"p03207","slow_code_id":"fe2f7e4c4fa4bf811a1052a7e9a8cc8bf127a2538fd41f3ded0df182a9217e19","slow_id":"p03207_5cb7a4c7cf0d8a71a4fd49887b2da818d3766f3e397b1d44bc46374144eeebdc","speedup":26.631082341792865,"stratum":"8+","sampling_key":"32b66723c33496823f79a2cc6c15f75d729e86644c65ad6dd61d40e9f18ad833","slow_code":"import copy\nimport random\nimport bisect\nimport fractions\nimport math\nimport sys\nimport collections\nfrom decimal import Decimal\n\nmod = 10**9 + 7\nsys.setrecursionlimit(mod)\nd = collections.deque()\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\nN = int(eval(input()))\np = [0 for i in range(N)]\nfor i in range(N):\n p[i] = int(eval(input()))\np.sort()\nans = sum(p)\nans -= p[-1] // 2\nprint(ans)\n","fast_code":"N = int(eval(input()))\np = []\nfor _ in range(N):\n p.append(int(eval(input())))\nprint((sum(p) - max(p) // 2))\n"} +{"fast_code_id":"8a61637a1d14703b9160385c39f4e993c52449f2d33b71138f9ace68f4e4be79","fast_id":"p02681_1a581c8d8cc0c5caa1dbf8ee92d900953e3408791a4cd33a35a82a324ed716c6","language":"python","measured_fast_code_id":"1a581c8d8cc0c5caa1dbf8ee92d900953e3408791a4cd33a35a82a324ed716c6","measured_slow_code_id":"e11f3e444910fe42a6baf012b95849e72747767315b4086506c83bd0c43f1245","measurement_metric":"cpu_instruction_count","pair_id":"python_888d37f50d8a6d2b75ac3c19","problem_id":"p02681","slow_code_id":"aead1926afd539d76d7800cd27f3761ad24e19df52b7dacf9e4a54d6feb221d2","slow_id":"p02681_e11f3e444910fe42a6baf012b95849e72747767315b4086506c83bd0c43f1245","speedup":19.46299748574494,"stratum":"8+","sampling_key":"74f118ad2b82543c5351a71fbd21a3a392b3fe9ba8cc452d050ffcc95d9830a8","slow_code":"from typing import *\nimport itertools\nimport math\nimport sys\n\nINF = float(\"inf\")\nYES = \"Yes\"\nNO = \"No\"\n\n\ndef solve(S: str, T: str):\n return [NO, YES][S == T[:-1]]\n\n\ndef main():\n sys.setrecursionlimit(10**6)\n\n def iterate_tokens():\n for line in sys.stdin:\n for word in line.split():\n yield word\n\n tokens = iterate_tokens()\n S = next(tokens)\n T = next(tokens)\n print((solve(S, T)))\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"from sys import stdin\n\n\ndef main():\n\n readline = stdin.readline\n S = readline().strip()\n T = readline().strip()\n for i in range(len(S)):\n if S[i] != T[i]:\n print(\"No\")\n break\n else:\n print(\"Yes\")\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"e645382e77107b5d2d52f141249ca14dc6fb91813448c2fd1d8e3ce0f424ce39","fast_id":"p02789_e645382e77107b5d2d52f141249ca14dc6fb91813448c2fd1d8e3ce0f424ce39","language":"python","measured_fast_code_id":"e645382e77107b5d2d52f141249ca14dc6fb91813448c2fd1d8e3ce0f424ce39","measured_slow_code_id":"3b3c9592d05d78419094081aeeb834d7351702df4b6152b2850a5ab58ae1e1e1","measurement_metric":"cpu_instruction_count","pair_id":"python_8995da0fe7cdfb69b33621d4","problem_id":"p02789","slow_code_id":"b67e95e628852cc5e8281d284b620a3652c42bb82548c79c6e24811247e94916","slow_id":"p02789_3b3c9592d05d78419094081aeeb834d7351702df4b6152b2850a5ab58ae1e1e1","speedup":1733.9876012155516,"stratum":"8+","sampling_key":"1b3947c2c89332d51782629e71456e16032dc57a0056092cdd23493ddb5549d3","slow_code":"import math\nimport statistics\nimport numpy as np\nimport queue\nimport itertools\n\nn, m = list(map(int, input().split()))\nif n == m:\n print(\"Yes\")\nelse:\n print(\"No\")\n","fast_code":"def resolve():\n a, b = list(map(int, input().split()))\n if a == b:\n print(\"Yes\")\n else:\n print(\"No\")\n\n\nresolve()\n"} +{"fast_code_id":"020e566598194d621a63f002ddd21e12855f1d7295beae4232d0737c8ccb078e","fast_id":"p02990_020e566598194d621a63f002ddd21e12855f1d7295beae4232d0737c8ccb078e","language":"python","measured_fast_code_id":"020e566598194d621a63f002ddd21e12855f1d7295beae4232d0737c8ccb078e","measured_slow_code_id":"a43a2e409975514f076f5ea8a611abb00d6945f4ac7a0710f4b342242cb6e235","measurement_metric":"cpu_instruction_count","pair_id":"python_89e0d090b2d6a1e619a9c7ae","problem_id":"p02990","slow_code_id":"a43a2e409975514f076f5ea8a611abb00d6945f4ac7a0710f4b342242cb6e235","slow_id":"p02990_a43a2e409975514f076f5ea8a611abb00d6945f4ac7a0710f4b342242cb6e235","speedup":177.34387023532457,"stratum":"8+","sampling_key":"2104ffe79ed99a7cf6949ddbf82759dcbe075e11dbb89509d35b4220d57c4c1f","slow_code":"MOD = 10**9 + 7\nlim = 200000\ninv_t = [-1 for i in range(lim + 1)]\nfactrial = [-1 for i in range(lim + 1)]\nfactrial_inv = [-1 for i in range(lim + 1)]\n\n\ndef mod_inv(x, mod=MOD):\n y, u, v, _x = mod, 1, 0, x\n while y:\n t = _x // y\n _x -= t * y\n _x, y = y, _x\n u -= t * v\n u, v = v, u\n u %= mod\n if u < 0:\n u += mod\n return u\n\n\ndef mod_pow(a, n, mod=MOD):\n res = 1\n while n:\n if n & 1:\n res = res * a % mod\n a = a * a % mod\n n >>= 1\n return res\n\n\ndef COMinit(max=lim, mod=MOD):\n factrial[0] = factrial_inv[0] = 1\n factrial[1] = factrial_inv[1] = 1\n inv_t[0] = inv_t[1] = 1\n for i in range(2, max):\n factrial[i] = factrial[i - 1] * i % mod\n inv_t[i] = mod - inv_t[mod % i] * (mod // i) % mod\n factrial_inv[i] = factrial_inv[i - 1] * inv_t[i] % mod\n\n\ndef comb(a, b, mod=MOD):\n if a < b:\n return 0\n if factrial[0] == -1:\n COMinit()\n return (factrial[a] * factrial_inv[b] * factrial_inv[a - b]) % mod\n\n\nn, k = [int(_) for _ in input().split()]\nfor i in range(k):\n print((comb(n - k + 1, i + 1) * comb(k - 1, i) % MOD))\n","fast_code":"from operator import mul\nfrom functools import reduce\n\n\ndef cmb(n, r):\n r = min(n - r, r)\n if r == 0:\n return 1\n over = reduce(mul, list(range(n, n - r, -1)))\n under = reduce(mul, list(range(1, r + 1)))\n return over // under\n\n\ndef main():\n N, K = list(map(int, input().split()))\n MOD = 10**9 + 7\n for i in range(1, K + 1):\n if N - K + 1 < i:\n print((0))\n continue\n blue = cmb(K - 1, i - 1)\n red = cmb(N - K + 1, N - K - i + 1)\n ans = blue * red\n ans %= MOD\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"3f59f403ae0b4cdcca970331b3c85584a86a57f641ec14c25a13ff864055d6a4","fast_id":"p02770_b991ebb2290a4da6799a6daa285447de9aca5c37bf998182108cf90af4f99293","language":"python","measured_fast_code_id":"b991ebb2290a4da6799a6daa285447de9aca5c37bf998182108cf90af4f99293","measured_slow_code_id":"c3f6bab4a2af4b35e38d9d72355721dc97f2ca2c80f07b4cb113b6f10727002a","measurement_metric":"cpu_instruction_count","pair_id":"python_89e61bf3f32b4a156888365b","problem_id":"p02770","slow_code_id":"c3f6bab4a2af4b35e38d9d72355721dc97f2ca2c80f07b4cb113b6f10727002a","slow_id":"p02770_c3f6bab4a2af4b35e38d9d72355721dc97f2ca2c80f07b4cb113b6f10727002a","speedup":3.7687168785341814,"stratum":"2-4","sampling_key":"15e95dca1bf3b1ace9124dfd45ab6cd29961fd34f0a4204c8285959d203b1084","slow_code":"import numpy as np\n\nk, q = list(map(int, input().split()))\nd = np.array(list(map(int, input().split())), dtype=np.int64)\nqueries = [tuple(map(int, input().split())) for _ in range(q)]\nfor n, x, m in queries:\n d_mod = d % m\n rem_d_mod = d_mod[: (n - 1) % k]\n print(\n (\n n\n - 1\n - (x % m + ((n - 1) // k) * np.sum(d_mod) + np.sum(rem_d_mod)) // m\n - ((n - 1) // k) * np.count_nonzero(d_mod == 0)\n - np.count_nonzero(rem_d_mod == 0)\n )\n )\n","fast_code":"import sys\nimport math\nfrom bisect import bisect_right as br\nfrom bisect import bisect_left as bl\n\nsys.setrecursionlimit(2147483647)\nfrom heapq import heappush, heappop, heappushpop\nfrom collections import defaultdict\nfrom itertools import accumulate\nfrom collections import Counter\nfrom collections import deque\nfrom operator import itemgetter\nfrom itertools import permutations\n\nmod = 10**9 + 7\ninf = float(\"inf\")\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\nk, q = LI()\nd = LI()\nnxm = [LI() for _ in range(q)]\nfor n, x, m in nxm:\n e = list([(x - 1) % m + 1 for x in d])\n s = sum(e) * ((n - 1) // k) + sum(e[: (n - 1) % k])\n tmp = (s + x) // m - x // m\n print((n - 1 - tmp))\n"} +{"fast_code_id":"8fe1516e849fc88d2af1d0ffec708da69bcd78c58b4b995d52489dad02311772","fast_id":"p03125_8fe1516e849fc88d2af1d0ffec708da69bcd78c58b4b995d52489dad02311772","language":"python","measured_fast_code_id":"8fe1516e849fc88d2af1d0ffec708da69bcd78c58b4b995d52489dad02311772","measured_slow_code_id":"4b613364292341c90cb223444cc17d712d2692c86eaf7401941c05ab19a835ea","measurement_metric":"cpu_instruction_count","pair_id":"python_8a13c4120636c40cb39aa7b3","problem_id":"p03125","slow_code_id":"8b3f73d78db4b17be952c8e49db130961979c1aa4d15ae41972fb4783a0ae1cc","slow_id":"p03125_4b613364292341c90cb223444cc17d712d2692c86eaf7401941c05ab19a835ea","speedup":2.6779781017200337,"stratum":"2-4","sampling_key":"d1b69bbe2fc388d4c325093a876b8bfa17926ffb440275b3c71c3f90f4a4d5e0","slow_code":"import sys\nimport math\nfrom bisect import bisect_right as br\nfrom bisect import bisect_left as bl\n\nsys.setrecursionlimit(2147483647)\nfrom heapq import heappush, heappop, heappushpop\nfrom collections import defaultdict\nfrom itertools import accumulate\nfrom collections import Counter\nfrom collections import deque\nfrom operator import itemgetter\nfrom itertools import permutations\n\nmod = 10**9 + 7\ninf = float(\"inf\")\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\na, b = LI()\nif b % a == 0:\n print((a + b))\nelse:\n print((b - a))\n","fast_code":"def ans():\n a, b = list(map(int, input().split()))\n if b % a == 0:\n print((a + b))\n else:\n print((b - a))\n\n\nans()\n"} +{"fast_code_id":"7f8243f8e48dedae472e9b0406c498b4b1db22948300b9da922fddb1419eaa90","fast_id":"p02729_b9f5593b2d9a7b996707ac35d5498b0a7fa4149fa8dcc6c910b9db00058d7e53","language":"python","measured_fast_code_id":"b9f5593b2d9a7b996707ac35d5498b0a7fa4149fa8dcc6c910b9db00058d7e53","measured_slow_code_id":"cceb77711a14726b9b2382bddd14ea9448a327cbb9328832bc3b11455366cb07","measurement_metric":"cpu_instruction_count","pair_id":"python_8a660a3a1b574c3e098d7702","problem_id":"p02729","slow_code_id":"cceb77711a14726b9b2382bddd14ea9448a327cbb9328832bc3b11455366cb07","slow_id":"p02729_cceb77711a14726b9b2382bddd14ea9448a327cbb9328832bc3b11455366cb07","speedup":7.203681289679995,"stratum":"4-8","sampling_key":"a54e3a93f30b4ca59efceb808f6667d5d3902f354f5d24a5be4c5da72b515abe","slow_code":"a, b = list(map(int, input().split()))\nimport itertools\n\na1 = len(list(itertools.combinations(list(range(a)), 2)))\nb1 = len(list(itertools.combinations(list(range(b)), 2)))\nprint((a1 + b1))\n","fast_code":"N, M = list(map(int, input().split()))\n\na = N * (N - 1) // 2\nb = M * (M - 1) // 2\nprint((a + b))\n"} +{"fast_code_id":"f522ab1c5a929026d0db6ca658dc7a8ef822c62c3950374ddb1e286b2eb1b22f","fast_id":"p00022_f522ab1c5a929026d0db6ca658dc7a8ef822c62c3950374ddb1e286b2eb1b22f","language":"python","measured_fast_code_id":"f522ab1c5a929026d0db6ca658dc7a8ef822c62c3950374ddb1e286b2eb1b22f","measured_slow_code_id":"a5086560b3d72499a535710346e1969d90deaa71ee9f102e4fab549979daedfd","measurement_metric":"cpu_instruction_count","pair_id":"python_8a6aec7bbbf8d0268faba6f7","problem_id":"p00022","slow_code_id":"a5086560b3d72499a535710346e1969d90deaa71ee9f102e4fab549979daedfd","slow_id":"p00022_a5086560b3d72499a535710346e1969d90deaa71ee9f102e4fab549979daedfd","speedup":2.29602754947513,"stratum":"2-4","sampling_key":"0bf24b9b32d9f22ac97a11f96306c2f20fc40af577cf75e599dfd2cefc897ef1","slow_code":"n = eval(input())\nwhile n:\n x = -100000\n m = x\n s = 0\n while n:\n a = eval(input())\n x = max(x, 0) + a\n m = max(m, x)\n n -= 1\n print(m)\n n = eval(input())\n","fast_code":"while 1:\n n = eval(input())\n if n == 0:\n break\n r = [int(input()) for i in range(n)]\n for i in range(1, n):\n r[i] = max(r[i - 1] + r[i], r[i])\n print(max(r))\n"} +{"fast_code_id":"385f918e70558d30ce24cedf0de5f4a96a7aad60475bd5eec62a4ce0ebe4edee","fast_id":"p02881_385f918e70558d30ce24cedf0de5f4a96a7aad60475bd5eec62a4ce0ebe4edee","language":"python","measured_fast_code_id":"385f918e70558d30ce24cedf0de5f4a96a7aad60475bd5eec62a4ce0ebe4edee","measured_slow_code_id":"36720fd25781c0395680ee7f14e52e9d3fb0f8d0f6a697475f9b0b71c7cfbd26","measurement_metric":"cpu_instruction_count","pair_id":"python_8a9856ae1a36455b62265d72","problem_id":"p02881","slow_code_id":"36720fd25781c0395680ee7f14e52e9d3fb0f8d0f6a697475f9b0b71c7cfbd26","slow_id":"p02881_36720fd25781c0395680ee7f14e52e9d3fb0f8d0f6a697475f9b0b71c7cfbd26","speedup":6.463698016114384,"stratum":"4-8","sampling_key":"386c496d0d1e640c44d9a1f9bc9fce7c8c13daa06883a95210f13a839ed29c12","slow_code":"n = int(eval(input()))\nprint((min(a + (n // a) - 2 for a in range(1, int(n**0.5) + 1) if n % a == 0)))\n","fast_code":"N = int(eval(input()))\nx = int(N**0.5)\nfor i in range(x, 0, -1):\n if N % i == 0:\n y = N // i\n break\nans = N // y + y - 2\nprint(ans)\n"} +{"fast_code_id":"02fdfe69ebfb7c7f45f428332b29ae83bbf3eeeb8d1da112c369eb4c9f819684","fast_id":"p03209_fbecc13a49f95945857982c479623ef1de44f805cd577719be725978a3db980e","language":"python","measured_fast_code_id":"fbecc13a49f95945857982c479623ef1de44f805cd577719be725978a3db980e","measured_slow_code_id":"d810806da4e3ff396dd2f9e6a8463b4981d8f62dd34c3ba133bb44352184e910","measurement_metric":"cpu_instruction_count","pair_id":"python_8ac18efc8566b073675889bd","problem_id":"p03209","slow_code_id":"dbd3b0158d3748e0d99cec055f9e692949bfea6a1e16dd750ed0447f840bf070","slow_id":"p03209_d810806da4e3ff396dd2f9e6a8463b4981d8f62dd34c3ba133bb44352184e910","speedup":2.9262453514600266,"stratum":"2-4","sampling_key":"2ce411dc96322d84ece6ab6cf8b7c5b6e78ae6ef29ea566e0d36ecf71654213c","slow_code":"N, X = list(map(int, input().split()))\n\nT = [1]\nfor i in range(1, 50 + 1):\n T.append(T[i - 1] * 2 + 3)\n\n\ndef hash(n, x):\n return \"{0:d},{1:d}\".format(n, x)\n\n\nmemo = dict()\n\n\ndef solve(n, x):\n global T, memo\n if hash(n, x) in memo:\n return memo[hash(n, x)]\n if n == 0 and x >= 1:\n memo[hash(n, x)] = 1\n return 1\n if x <= 1:\n memo[hash(n, x)] = 0\n return 0\n memo[hash(n, x)] = solve(n - 1, min(x - 1, T[n - 1]))\n if x >= T[n - 1] + 2:\n memo[hash(n, x)] += 1\n if x >= T[n - 1] + 3:\n memo[hash(n, x)] += solve(n - 1, min(x - 1 - T[n - 1] - 1, T[n - 1]))\n return memo[hash(n, x)]\n\n\nprint((solve(N, X)))\n","fast_code":"N, X = list(map(int, input().split()))\n\n\na = [1]\np = [1]\nfor i in range(N):\n a += [a[i] * 2 + 3]\n p += [p[i] * 2 + 1]\n\n\ndef search(n, x):\n if n == 0:\n return (1, 0)[x <= 0]\n elif x <= 1 + a[n - 1]:\n return search(n - 1, x - 1)\n else:\n return p[n - 1] + 1 + search(n - 1, x - 2 - a[n - 1])\n\n\nprint((search(N, X)))\n"} +{"fast_code_id":"37c64c843161b92469540d6a1ec2a29d2c5b7047a3f26ff46e602802a6763f12","fast_id":"p02760_37c64c843161b92469540d6a1ec2a29d2c5b7047a3f26ff46e602802a6763f12","language":"python","measured_fast_code_id":"37c64c843161b92469540d6a1ec2a29d2c5b7047a3f26ff46e602802a6763f12","measured_slow_code_id":"f38299ae69e3df91aef33ae3aceb49dbec3b74f7b7de24a65da774120e57c8d7","measurement_metric":"cpu_instruction_count","pair_id":"python_8b298fb8dfe60a7ae1c2c7d2","problem_id":"p02760","slow_code_id":"f38299ae69e3df91aef33ae3aceb49dbec3b74f7b7de24a65da774120e57c8d7","slow_id":"p02760_f38299ae69e3df91aef33ae3aceb49dbec3b74f7b7de24a65da774120e57c8d7","speedup":2.4417803791430805,"stratum":"2-4","sampling_key":"dbca813e1b7f600af86273de0b8be40fd5185d747d2b95ff0678210dce6f8d90","slow_code":"def bingo(C):\n if C[0] == C[1] == C[2] and C[0] == 1:\n return True\n elif C[3] == C[4] == C[5] and C[3] == 1:\n return True\n elif C[6] == C[7] == C[8] and C[6] == 1:\n return True\n elif C[0] == C[3] == C[6] and C[0] == 1:\n return True\n elif C[1] == C[4] == C[7] and C[1] == 1:\n return True\n elif C[2] == C[5] == C[8] and C[2] == 1:\n return True\n elif C[0] == C[4] == C[8] and C[0] == 1:\n return True\n elif C[2] == C[4] == C[6] and C[2] == 1:\n return True\n else:\n return False\n\n\nA = []\nfor _ in range(3):\n x1, x2, x3 = list(map(int, input().split()))\n A.append(x1)\n A.append(x2)\n A.append(x3)\nB = [0 for _ in range(9)]\nN = eval(input())\nfor _ in range(N):\n b = eval(input())\n for i, x in enumerate(A):\n if b == x:\n B[i] = 1\nif bingo(B):\n print(\"Yes\")\nelse:\n print(\"No\")\n","fast_code":"(*a,) = list(map(int, open(0).read().split()))\nprint(\n (\n \"NYoe s\"[\n any(\n t <= set(a.index(b) for b in a[10:])\n for t in (\n {0, 1, 2},\n {0, 3, 6},\n {0, 4, 8},\n {1, 4, 7},\n {2, 4, 6},\n {2, 5, 8},\n {3, 4, 5},\n {6, 7, 8},\n )\n ) :: 2\n ]\n )\n)\n"} +{"fast_code_id":"fd102ef97ba97e59a8cb9663116d750b8a6e9941777a02669909b41cee16cf37","fast_id":"p03449_fd102ef97ba97e59a8cb9663116d750b8a6e9941777a02669909b41cee16cf37","language":"python","measured_fast_code_id":"fd102ef97ba97e59a8cb9663116d750b8a6e9941777a02669909b41cee16cf37","measured_slow_code_id":"4f58caefb49442690396b859be0085109334a84091e907cb62b5503b39be5afa","measurement_metric":"cpu_instruction_count","pair_id":"python_8bbedf8ced29d802d2a9c9bf","problem_id":"p03449","slow_code_id":"16e134b9190b06e98124559663599dcf24302b97cd85dfc00b6b6350ef402631","slow_id":"p03449_4f58caefb49442690396b859be0085109334a84091e907cb62b5503b39be5afa","speedup":5.645028674405993,"stratum":"4-8","sampling_key":"68693b1f036245ee830cb70d9a35b3a554456f90730fc3a7a194d02b4da0313e","slow_code":"import sys\n\n\ndef dfs(x: int, y: int):\n if y == 1 and x == (N - 1):\n return A[y][x]\n elif y > 1 or x > N - 1:\n return 0\n else:\n return max(dfs(x + 1, y), dfs(x, y + 1)) + A[y][x]\n\n\ndef solve(N: int, A: \"List[List[int]]\"):\n print((dfs(0, 0)))\n return\n\n\ndef main():\n def iterate_tokens():\n for line in sys.stdin:\n for word in line.split():\n yield word\n\n tokens = iterate_tokens()\n global N, A\n N = int(next(tokens))\n A = [[int(next(tokens)) for _ in range(N)] for _ in range(2)]\n solve(N, A)\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"N = int(eval(input()))\nnum_list = []\nwhile True:\n try:\n num_list.append(list(map(int, input().split())))\n except:\n break\nsum_list = []\nfor k in range(N):\n sum_list.append(sum(num_list[0][0 : k + 1]) + sum(num_list[1][k : N + 1]))\nprint((max(sum_list)))\n"} +{"fast_code_id":"5b650f0d9d560aa2ddc06d1551889bb58d9768a548461d3a84fc82e94f0e3d66","fast_id":"p00775_5b650f0d9d560aa2ddc06d1551889bb58d9768a548461d3a84fc82e94f0e3d66","language":"python","measured_fast_code_id":"5b650f0d9d560aa2ddc06d1551889bb58d9768a548461d3a84fc82e94f0e3d66","measured_slow_code_id":"8e02c59ca5af7184abc0b41186c69b5afed95dc9f0416b5d3e79c7e06f9ac494","measurement_metric":"cpu_instruction_count","pair_id":"python_8bde07c9a0297a95f83b969d","problem_id":"p00775","slow_code_id":"8e02c59ca5af7184abc0b41186c69b5afed95dc9f0416b5d3e79c7e06f9ac494","slow_id":"p00775_8e02c59ca5af7184abc0b41186c69b5afed95dc9f0416b5d3e79c7e06f9ac494","speedup":2.7229214042930723,"stratum":"2-4","sampling_key":"1fcc88a7a50d356a0b29a0ef991555c2c7003d79e8bf8c0cfa6757bda3270283","slow_code":"while True:\n R, N = list(map(int, input().split()))\n if not (R | N):\n break\n geta = 20\n buildings = [0] * (geta * 2)\n for _ in range(N):\n xl, xr, h = list(map(int, input().split()))\n for i in range(xl + geta, xr + geta):\n buildings[i] = max(buildings[i], h)\n sun = [0] * (geta * 2)\n for i in range(-R + geta, R + geta):\n if i < geta:\n buildings[i] -= pow(R * R - (i - geta + 1) * (i - geta + 1), 0.5) - R\n else:\n buildings[i] -= pow(R * R - (i - geta) * (i - geta), 0.5) - R\n left, right = 0, 20\n while right - left > 1e-4:\n mid = (left + right) / 2\n flag = True\n for i in range(-R + geta, R + geta):\n if i < geta:\n flag &= buildings[i] >= mid\n else:\n y = pow(R * R - (i - geta) * (i - geta), 0.5)\n flag &= buildings[i] >= mid\n if flag:\n left = mid\n else:\n right = mid\n print((\"{:.20f}\".format(left)))\n","fast_code":"while True:\n R, N = list(map(int, input().split()))\n if not (R | N):\n break\n geta = 20\n buildings = [0] * (geta * 2)\n for _ in range(N):\n xl, xr, h = list(map(int, input().split()))\n for i in range(xl + geta, xr + geta):\n buildings[i] = max(buildings[i], h)\n print(\n (\n min(\n buildings[i] - pow(R**2 - (i - geta + (i < geta)) ** 2, 0.5) + R\n for i in range(-R + geta, R + geta)\n )\n )\n )\n"} +{"fast_code_id":"dbe4112f780768c881fa73bb94e8216b96c2835403de960503a893e7f9015af6","fast_id":"p02982_dbe4112f780768c881fa73bb94e8216b96c2835403de960503a893e7f9015af6","language":"python","measured_fast_code_id":"dbe4112f780768c881fa73bb94e8216b96c2835403de960503a893e7f9015af6","measured_slow_code_id":"3062723b648fda295737e748d4e0d5d9caa11a6c4d2d4160eb2931cf3e53df51","measurement_metric":"cpu_instruction_count","pair_id":"python_8be7b1dc55d5ebb17464d29c","problem_id":"p02982","slow_code_id":"3062723b648fda295737e748d4e0d5d9caa11a6c4d2d4160eb2931cf3e53df51","slow_id":"p02982_3062723b648fda295737e748d4e0d5d9caa11a6c4d2d4160eb2931cf3e53df51","speedup":293.3879515841172,"stratum":"8+","sampling_key":"1914733a33bd3469b830168cb55a840df770e07da3eb62cadf44a98702a945dc","slow_code":"import numpy as np\n\nN, D = list(map(int, input().split()))\nX = np.zeros((N, D))\nfor i in range(N):\n X[i][:] = list(map(int, input().split()))\nn = 0\nfor i in range(N):\n for j in range(i + 1, N):\n dist = np.linalg.norm(X[i] - X[j])\n if dist.is_integer():\n n += 1\nprint(n)\n","fast_code":"n, d = list(map(int, input().split()))\nx = [list(map(int, input().split())) for i in range(n)]\nans = 0\n\n\ndef k(a, b):\n dist = 0\n for i in range(d):\n dist += (a[i] - b[i]) ** 2\n dist = dist ** (1 / 2)\n while dist > 0:\n dist -= 1\n if dist == 0:\n return True\n return False\n\n\nfor i in range(n):\n for j in range(i + 1, n):\n if k(x[i], x[j]):\n ans += 1\nprint(ans)\n"} +{"fast_code_id":"d1345043c0ceb8a8df115e5d2e9ace088520cbcf79d0b09e7b3eae23e31aca45","fast_id":"p03274_d1345043c0ceb8a8df115e5d2e9ace088520cbcf79d0b09e7b3eae23e31aca45","language":"python","measured_fast_code_id":"d1345043c0ceb8a8df115e5d2e9ace088520cbcf79d0b09e7b3eae23e31aca45","measured_slow_code_id":"15cce6db7bc6d79dcd48950e05503001080b8e54791a05cbcc84aecc1f823153","measurement_metric":"cpu_instruction_count","pair_id":"python_8c0af23e6830e096c1429dfa","problem_id":"p03274","slow_code_id":"15cce6db7bc6d79dcd48950e05503001080b8e54791a05cbcc84aecc1f823153","slow_id":"p03274_15cce6db7bc6d79dcd48950e05503001080b8e54791a05cbcc84aecc1f823153","speedup":3.337252098093104,"stratum":"2-4","sampling_key":"78123327880e72634cf4f6f768ac778b1af02dcd55fd5d41aa27ba42c6f643f4","slow_code":"import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time\n\nsys.setrecursionlimit(10**7)\ninf = 10**20\nmod = 10**9 + 7\n\n\ndef LI():\n return list(map(int, input().split()))\n\n\ndef I():\n return int(eval(input()))\n\n\ndef LS():\n return input().split()\n\n\ndef S():\n return eval(input())\n\n\ndef main():\n n, k = LI()\n l = LI()\n mn = inf\n for i in range(n - k + 1):\n a = l[i]\n b = l[i + k - 1]\n if a < 0 and b > 0:\n mn = min([mn, abs(a) + abs(b) * 2, abs(a) * 2 + abs(b)])\n else:\n mn = min(mn, max(abs(a), abs(b)))\n return mn\n\n\nprint((main()))\n","fast_code":"iN, iK = [int(_) for _ in input().split()]\naX = [int(_) for _ in input().split()]\nans = 10**9\niDiff = iN - iK\nfor i in range(iDiff + 1):\n iL = aX[i]\n iR = aX[iN - iDiff + i - 1]\n ans = min(ans, abs(iL) + abs(iL - iR), abs(iR) + abs(iR - iL))\nprint(ans)\n"} +{"fast_code_id":"281290a2b75d05e203b312b432df504793f8b543abd68a7d6b1cda04fc6cb497","fast_id":"p03606_281290a2b75d05e203b312b432df504793f8b543abd68a7d6b1cda04fc6cb497","language":"python","measured_fast_code_id":"281290a2b75d05e203b312b432df504793f8b543abd68a7d6b1cda04fc6cb497","measured_slow_code_id":"6597de1bd0267fe08bbaa81ee42f4ad5986dea670e9ddc05184b39d177cf7185","measurement_metric":"cpu_instruction_count","pair_id":"python_8c4086b9aea803cf21c696e2","problem_id":"p03606","slow_code_id":"6597de1bd0267fe08bbaa81ee42f4ad5986dea670e9ddc05184b39d177cf7185","slow_id":"p03606_6597de1bd0267fe08bbaa81ee42f4ad5986dea670e9ddc05184b39d177cf7185","speedup":942.344832528543,"stratum":"8+","sampling_key":"03c139528834b3bc32b61ff8e1f0e72267ef3367eb696e4a85590fb24aaec82c","slow_code":"n = int(eval(input()))\nseat = [0] * 10**6\nfor i in range(n):\n l, r = list(map(int, input().split()))\n for j in range(l, r + 1):\n seat[j - 1] = 1\nres = 0\nfor i in range(10**6):\n if seat[i] == 1:\n res += 1\nprint(res)\n","fast_code":"import sys\n\nsys.setrecursionlimit(10**5 + 10)\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef resolve():\n cnt = 0\n N = int(eval(input()))\n for i in range(N):\n l, r = list(map(int, input().split()))\n cnt += r - l + 1\n print(cnt)\n\n\nresolve()\n"} +{"fast_code_id":"bade334d850baa79c30c63b127211354a56f0a74387511e74bb04b26a2ac47b2","fast_id":"p03558_bade334d850baa79c30c63b127211354a56f0a74387511e74bb04b26a2ac47b2","language":"python","measured_fast_code_id":"bade334d850baa79c30c63b127211354a56f0a74387511e74bb04b26a2ac47b2","measured_slow_code_id":"ca95e00432cb9fe0049dbb5eaaa7811261a70a8ad0e2620591022d8cc0b42655","measurement_metric":"cpu_instruction_count","pair_id":"python_8c63feed62dde574a60fb3a1","problem_id":"p03558","slow_code_id":"ce02cacb8b88aa27060d7b5768b97cf46b2cc67abce7ba697788693a9f69936d","slow_id":"p03558_ca95e00432cb9fe0049dbb5eaaa7811261a70a8ad0e2620591022d8cc0b42655","speedup":6.201991630213259,"stratum":"4-8","sampling_key":"839f86856382a906c982d23a40c27ac5c10a11e49dadf8ca1d44b4d297c2f384","slow_code":"import sys\n\nINF = 1 << 60\nMOD = 10**9 + 7\nsys.setrecursionlimit(2147483647)\ninput = lambda: sys.stdin.readline().rstrip()\nfrom collections import deque\n\n\ndef resolve():\n k = int(eval(input()))\n dist = [INF] * k\n dist[1] = 1\n queue = deque([1])\n while queue:\n v = queue.pop()\n if dist[10 * v % k] > dist[v]:\n dist[10 * v % k] = dist[v]\n queue.appendleft(10 * v % k)\n if dist[(v + 1) % k] > dist[v] + 1:\n dist[(v + 1) % k] = dist[v] + 1\n queue.append((v + 1) % k)\n print((dist[0]))\n\n\nresolve()\n","fast_code":"from collections import deque\n\n\ndef solve(K):\n checked = [99999999999] * (K + 1)\n queue = deque()\n queue.append((1, 1))\n checked[1] = 1\n while queue:\n x, n = queue.popleft()\n if x == 0:\n return n\n _ = (x * 10) % K\n if n < checked[_]:\n queue.appendleft((_, n))\n checked[_] = n\n _ = (x + 1) % K\n if n + 1 < checked[_]:\n queue.append((_, n + 1))\n checked[_] = n + 1\n return None\n\n\nK = int(eval(input()))\nprint((solve(K)))\n"} +{"fast_code_id":"6075c97bf0f972f7286afb7cfa0524e287a681f72f4e163a5b359fd4e3f8ec6c","fast_id":"p02660_acd1cbb7218aac5a6a0561a8aea205eca767858eefdb53ca85ef5c35cb2d3087","language":"python","measured_fast_code_id":"acd1cbb7218aac5a6a0561a8aea205eca767858eefdb53ca85ef5c35cb2d3087","measured_slow_code_id":"8301217799053ca8035ba7e5e9be7529b06a7e4ccf5a0cb39174661c0dc1c031","measurement_metric":"cpu_instruction_count","pair_id":"python_8c872d6d20df1724b2de46bc","problem_id":"p02660","slow_code_id":"8301217799053ca8035ba7e5e9be7529b06a7e4ccf5a0cb39174661c0dc1c031","slow_id":"p02660_8301217799053ca8035ba7e5e9be7529b06a7e4ccf5a0cb39174661c0dc1c031","speedup":1158.7164952305395,"stratum":"8+","sampling_key":"07f3552c064bce1977e49ba9d46effd0fd979a98266287c2477550cf0c576616","slow_code":"n = int(eval(input()))\na = p = 1\nwhile p < 6**8:\n c = t = 0\n p += 1\n while n % p < 1:\n n //= p\n x = c == t\n t += x\n c += 1 - t * x\n a += x\nprint((a - (n < 2)))\n","fast_code":"import collections\n\nn = int(eval(input()))\n\n\ndef prime_factorize(n):\n a = []\n while n % 2 == 0:\n a.append(2)\n n //= 2\n f = 3\n while f * f <= n:\n if n % f == 0:\n a.append(f)\n n //= f\n else:\n f += 2\n if n != 1:\n a.append(n)\n return a\n\n\nif n == 1:\n print((0))\n exit()\nc = collections.Counter(prime_factorize(n))\n_, counts = list(zip(*c.most_common()))\nl = list(counts)\nans = 0\nif l == [1]:\n print((1))\n exit()\nfor i in l:\n for j in range(1, i + 1):\n if i >= j:\n i -= j\n ans += 1\nprint(ans)\n"} +{"fast_code_id":"7ba76d8749129cd17417a2ada0a943c09cf0118a1602df98da321a7dfb8121fa","fast_id":"p02804_7df9b2d4a3a2426f2d7ef3524541707d3f02d6202a43ec1e9fe6580721779e81","language":"python","measured_fast_code_id":"7df9b2d4a3a2426f2d7ef3524541707d3f02d6202a43ec1e9fe6580721779e81","measured_slow_code_id":"7a118ce2764a5719ed366c9c22ffc653766a914f4a46e16d4f0cdc6623af51e1","measurement_metric":"cpu_instruction_count","pair_id":"python_8cc6966eb76ce31a1fac466b","problem_id":"p02804","slow_code_id":"7a118ce2764a5719ed366c9c22ffc653766a914f4a46e16d4f0cdc6623af51e1","slow_id":"p02804_7a118ce2764a5719ed366c9c22ffc653766a914f4a46e16d4f0cdc6623af51e1","speedup":6.924126099091412,"stratum":"4-8","sampling_key":"5db4ab88d6652a5e801534a486ad918bd91479d9b08c88e86451daa54cc4c68b","slow_code":"N_MAX = 10**6\nMOD = 10**9 + 7\nfac, finv, inv = [0] * N_MAX, [0] * N_MAX, [0] * N_MAX\n\n\ndef com_init():\n fac[0], fac[1] = 1, 1\n finv[0], finv[1] = 1, 1\n inv[1] = 1\n for i in range(2, N_MAX):\n fac[i] = fac[i - 1] * i % MOD\n inv[i] = MOD - inv[MOD % i] * (MOD // i) % MOD\n finv[i] = finv[i - 1] * inv[i] % MOD\n\n\ndef com(n, k):\n if n < k:\n return 0\n if n < 0 or k < 0:\n return 0\n return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD\n\n\nn, k = list(map(int, input().split()))\nal = list(map(int, input().split()))\ncom_init()\nal.sort()\nans_max = 0\nans_min = 0\nfor i, a in enumerate(al):\n ans_max += a * com(i, k - 1)\n ans_max %= MOD\n ans_min += a * com(n - 1 - i, k - 1)\n ans_min %= MOD\nprint(((ans_max - ans_min) % MOD))\n","fast_code":"mod = 10**9 + 7\n\n\ndef cmb(n, r, p):\n if (r < 0) or (n < r):\n return 0\n r = min(r, n - r)\n return fact[n] * factinv[r] * factinv[n - r] % p\n\n\nfact = [1, 1]\nfactinv = [1, 1]\ninv = [0, 1]\np = mod\nfor i in range(2, 10**5 + 1):\n fact.append((fact[-1] * i) % p)\n inv.append((-inv[p % i] * (p // i)) % p)\n factinv.append((factinv[-1] * inv[-1]) % p)\nN, K = list(map(int, input().split()))\nA = sorted(map(int, input().split()))\nR = sorted(A, reverse=True)\nans = 0\nfor i in range(N - K + 1):\n t = cmb(N - i - 1, K - 1, mod)\n mi = A[i] * t % mod\n ma = A[N - (i + 1)] * t % mod\n ans = (ans + ma - mi) % mod\nprint(ans)\n"} +{"fast_code_id":"0f600cb454f18fd1122e8596a2c9934e5781c9199aed5d7169642828c56aa1a8","fast_id":"p02831_0f600cb454f18fd1122e8596a2c9934e5781c9199aed5d7169642828c56aa1a8","language":"python","measured_fast_code_id":"0f600cb454f18fd1122e8596a2c9934e5781c9199aed5d7169642828c56aa1a8","measured_slow_code_id":"9a1626365f94b8a7d0331e3eabf1740b93398b58e75f9e3e35d2d82ea57bb14e","measurement_metric":"cpu_instruction_count","pair_id":"python_8ccfd80c58c40af833984819","problem_id":"p02831","slow_code_id":"9a1626365f94b8a7d0331e3eabf1740b93398b58e75f9e3e35d2d82ea57bb14e","slow_id":"p02831_9a1626365f94b8a7d0331e3eabf1740b93398b58e75f9e3e35d2d82ea57bb14e","speedup":7.455201224200206,"stratum":"4-8","sampling_key":"e55465f9f015bfe248edae1b8b4adb9077968684fac854c7762e1ef808d9a310","slow_code":"num1, num2 = list(map(int, input().split()))\nimport math\n\n\ndef gcd(num1, num2):\n for i in range(min(num1, num2), 0, -1):\n if num1 % i == 0 and num2 % i == 0:\n return i\n\n\nprint((int(num1 * num2 / gcd(num1, num2))))\n","fast_code":"import sys\n\nstdin = sys.stdin\nsys.setrecursionlimit(10**7)\ni_i = lambda: int(i_s())\ni_l = lambda: list(map(int, stdin.readline().split()))\ni_s = lambda: stdin.readline().rstrip()\n\n\ndef gcd(a, b):\n while b:\n a, b = b, a % b\n return a\n\n\ndef lcm(a, b):\n return a * b // gcd(a, b)\n\n\nA, B = i_l()\nprint((lcm(A, B)))\n"} +{"fast_code_id":"543ee6d0e81691fcafec5a2b260b0d8f3e49adb766d2156505b28d551aba5051","fast_id":"p00022_543ee6d0e81691fcafec5a2b260b0d8f3e49adb766d2156505b28d551aba5051","language":"python","measured_fast_code_id":"543ee6d0e81691fcafec5a2b260b0d8f3e49adb766d2156505b28d551aba5051","measured_slow_code_id":"ee69ff49d52cec4a9386b9836880b1c749710e6965bbcae5aa2ad74048936c1f","measurement_metric":"cpu_instruction_count","pair_id":"python_8dc887258e797b47b06d6e51","problem_id":"p00022","slow_code_id":"ee69ff49d52cec4a9386b9836880b1c749710e6965bbcae5aa2ad74048936c1f","slow_id":"p00022_ee69ff49d52cec4a9386b9836880b1c749710e6965bbcae5aa2ad74048936c1f","speedup":2.574665815617647,"stratum":"2-4","sampling_key":"38f13bca748e4cd4aa2c14917e6bbf71d6117673fdaa210b13714083ab5dd91d","slow_code":"while True:\n n = int(eval(input()))\n if n == 0:\n break\n a = [int(eval(input())) for _ in range(n)]\n minv = tmp = 0\n maxv = -500000\n for i in range(n):\n tmp += a[i]\n maxv = max(maxv, tmp - minv)\n minv = min(minv, tmp)\n print(maxv)\n","fast_code":"while 1:\n n = int(input())\n if n == 0:\n break\n A = [0] * n\n for i in range(n):\n A[i] = int(input())\n for i in range(1, len(A)):\n A[i] = max(A[i - 1] + A[i], A[i])\n print(max(A))\n"} +{"fast_code_id":"4286cea2bb217454f5ecb201542a12761cb923a5fc10ca0c5eaae027acb54b5c","fast_id":"p02786_4286cea2bb217454f5ecb201542a12761cb923a5fc10ca0c5eaae027acb54b5c","language":"python","measured_fast_code_id":"4286cea2bb217454f5ecb201542a12761cb923a5fc10ca0c5eaae027acb54b5c","measured_slow_code_id":"09a65063dc765e4cefad5eee9e2b182a86482cf81649dc4a8e732b6ba516a72e","measurement_metric":"cpu_instruction_count","pair_id":"python_8ec0f9e5cf2220778a29668c","problem_id":"p02786","slow_code_id":"09a65063dc765e4cefad5eee9e2b182a86482cf81649dc4a8e732b6ba516a72e","slow_id":"p02786_09a65063dc765e4cefad5eee9e2b182a86482cf81649dc4a8e732b6ba516a72e","speedup":694.4289795233539,"stratum":"8+","sampling_key":"6a1c866df5bd43b6f872396e5e9dfba59c8ac1c814e53804fea1382489db5d83","slow_code":"import numpy as np\n\nH = eval(input())\nH = int(H)\n\n\ndef count(H):\n count = 1\n while True:\n if int(H / 2) == 0:\n break\n else:\n H = int(H / 2)\n count += 1\n continue\n return count\n\n\nA = 0\nfor i in range(int(count(H))):\n A += 2**i\nprint(A)\n","fast_code":"from math import floor\n\n\ndef kill(life):\n if life in list(dp.keys()):\n return dp[life]\n if life == 1:\n dp[life] = 1\n return 1\n elif life > 1:\n dp[life] = kill(floor(life / 2)) * 2 + 1\n return dp[life]\n\n\nh = int(eval(input()))\ndp = {}\nprint((kill(h)))\n"} +{"fast_code_id":"097e236e9e8db4f02b3098b86403400d3e2b544760ca17bbd4a41a0496805d5d","fast_id":"p03309_1f9a287dbed456264a76e3ece25fcfdcd9a96d81c08e3c0ef5e8df324dec532b","language":"python","measured_fast_code_id":"1f9a287dbed456264a76e3ece25fcfdcd9a96d81c08e3c0ef5e8df324dec532b","measured_slow_code_id":"cc6340aab617e7100bd4d51ff3921118d5d3dad1bda63cfcf3f2026a849def46","measurement_metric":"cpu_instruction_count","pair_id":"python_8f5181fc1df76e60a3010201","problem_id":"p03309","slow_code_id":"364f3596fd84d0acd37a6dd5d8da1a36ebb61efbb957346157757658db88473b","slow_id":"p03309_cc6340aab617e7100bd4d51ff3921118d5d3dad1bda63cfcf3f2026a849def46","speedup":3.128429712696898,"stratum":"2-4","sampling_key":"fc311a1976eac1f4e6227bec4099e83589ca4f35e0f465defb2eb31f858581f6","slow_code":"if __name__ == \"__main__\":\n from statistics import median\n\n n = int(eval(input()))\n a = list(map(int, input().split()))\n total = 0\n\n mod_a = sorted([ai - i for i, ai in enumerate(a, 1)])\n b = median(mod_a)\n for i in range(n):\n total += abs(mod_a[i] - b)\n print((int(total)))\n","fast_code":"N = int(eval(input()))\nA = list(map(int, input().split()))\n\n\nA_n = [A[i - 1] - i for i in range(1, N + 1)]\nA_n.sort()\nif N % 2 == 0:\n cent_max = A_n[N // 2]\n cent_min = A_n[N // 2 - 1]\nelse:\n cent = A_n[N // 2]\nif N % 2 == 0:\n sadness1 = sum([abs(A_n[i] - cent_min) for i in range(N)])\n sadness2 = sum([abs(A_n[i] - cent_max) for i in range(N)])\n sadness = min(sadness1, sadness2)\nelse:\n sadness = sum([abs(A_n[i] - cent) for i in range(N)])\nprint(sadness)\n"} +{"fast_code_id":"90774dfde5e17237290c974eb2501dba5ef993279ae87f8e9c9e4f197f51686a","fast_id":"p02990_90774dfde5e17237290c974eb2501dba5ef993279ae87f8e9c9e4f197f51686a","language":"python","measured_fast_code_id":"90774dfde5e17237290c974eb2501dba5ef993279ae87f8e9c9e4f197f51686a","measured_slow_code_id":"b3e3896f1a2da242bb8c885fcc813e28bd04e29d9e736cb626eb88627e20740e","measurement_metric":"cpu_instruction_count","pair_id":"python_8f97fee4e4af033ce6aff865","problem_id":"p02990","slow_code_id":"b3e3896f1a2da242bb8c885fcc813e28bd04e29d9e736cb626eb88627e20740e","slow_id":"p02990_b3e3896f1a2da242bb8c885fcc813e28bd04e29d9e736cb626eb88627e20740e","speedup":6.42911218559864,"stratum":"4-8","sampling_key":"5713045575c4c3c806bab20824e6a433fbd1f11b58cb1629d7087dadce8af057","slow_code":"N_MAX = 200000\nMOD = 10**9 + 7\nfac, finv, inv = [0] * N_MAX, [0] * N_MAX, [0] * N_MAX\n\n\ndef com_init():\n fac[0], fac[1] = 1, 1\n finv[0], finv[1] = 1, 1\n inv[1] = 1\n for i in range(2, N_MAX):\n fac[i] = fac[i - 1] * i % MOD\n inv[i] = MOD - inv[MOD % i] * (MOD // i) % MOD\n finv[i] = finv[i - 1] * inv[i] % MOD\n\n\ndef com(n, k):\n if n < k:\n return 0\n if n < 0 or k < 0:\n return 0\n return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD\n\n\ndef main():\n n, k = list(map(int, input().split()))\n if n == k:\n for i in range(1, k + 1):\n if i == 1:\n print((1))\n else:\n print((0))\n return\n com_init()\n for i in range(1, k + 1):\n b = k\n r = n - k\n ans = (\n com(b - 1, i - 1) * com(r - 1, i - 1) * 2\n + com(b - 1, i - 1) * com(r - 1, i - 1 - 1)\n + com(b - 1, i - 1) * com(r - 1, i + 1 - 1)\n )\n print((ans % MOD))\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"def comb(n, r):\n if r < 0 or r > n:\n return 0\n r = min(r, n - r)\n return g1[n] * g2[r] * g2[n - r] % MOD\n\n\nMOD = 10**9 + 7\nMAXN = 4000 + 10\ng1 = [1, 1]\ng2 = [1, 1]\ninverse = [0, 1]\nfor i in range(2, MAXN + 1):\n g1.append((g1[-1] * i) % MOD)\n inverse.append(-inverse[MOD % i] * (MOD // i) % MOD)\n g2.append((g2[-1] * inverse[-1]) % MOD)\n\n\ndef f(n, k):\n if n < k:\n return 0\n if n == 0 and k == 0:\n return 1\n if k < 1:\n return 0\n return f2(n - k, k)\n\n\ndef f2(n, k):\n return comb(n + k - 1, k - 1)\n\n\nN, K = list(map(int, input().split()))\nfor i in range(1, K + 1):\n b = f(K, i)\n r = f(N - K, i - 1) + 2 * f(N - K, i) + f(N - K, i + 1)\n print(((b * r) % MOD))\n"} +{"fast_code_id":"61b8c4b23d7359fc0446fb71c3280bcc1042a632541fed8cfd8a4dc1a939e336","fast_id":"p03112_b1e896ab7e9e0452f80ac48c8fab9792e0ab08ad5276de541dafadd4501abb98","language":"python","measured_fast_code_id":"b1e896ab7e9e0452f80ac48c8fab9792e0ab08ad5276de541dafadd4501abb98","measured_slow_code_id":"075f3d0646b6b85cb5ae32f4ea2d0d59acf39147bd9650aafe37dade27ea98fa","measurement_metric":"cpu_instruction_count","pair_id":"python_902838c1fe7952a6810c1b80","problem_id":"p03112","slow_code_id":"77daaa725f47eb183a0e25b50b7e6255b814e50d5067b476fe004c62248fd0dc","slow_id":"p03112_075f3d0646b6b85cb5ae32f4ea2d0d59acf39147bd9650aafe37dade27ea98fa","speedup":3.5168862859239103,"stratum":"2-4","sampling_key":"65d426a9eca758c0bd570493ecb9b1cd23f55f649bea93f546106d2cf684479a","slow_code":"import sys, re\nfrom collections import deque, defaultdict, Counter\nfrom math import sqrt, hypot, factorial, pi, sin, cos, radians, log10\n\nif sys.version_info.minor >= 5:\n from math import gcd\nelse:\n from fractions import gcd\nfrom heapq import heappop, heappush, heapify, heappushpop\nfrom bisect import bisect_left, bisect_right\nfrom itertools import permutations, combinations, product, accumulate\nfrom operator import itemgetter, mul, xor\nfrom copy import copy, deepcopy\nfrom functools import reduce, partial\nfrom fractions import Fraction\nfrom string import ascii_lowercase, ascii_uppercase, digits\nfrom datetime import date\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef list2d(a, b, c):\n return [[c] * b for i in range(a)]\n\n\ndef list3d(a, b, c, d):\n return [[[d] * c for j in range(b)] for i in range(a)]\n\n\ndef ceil(x, y=1):\n return int(-(-x // y))\n\n\ndef round(x):\n return int((x * 2 + 1) // 2)\n\n\ndef fermat(x, y, MOD):\n return x * pow(y, MOD - 2, MOD) % MOD\n\n\ndef lcm(x, y):\n return (x * y) // gcd(x, y)\n\n\ndef lcm_list(nums):\n return reduce(lcm, nums, 1)\n\n\ndef gcd_list(nums):\n return reduce(gcd, nums, nums[0])\n\n\ndef INT():\n return int(eval(input()))\n\n\ndef MAP():\n return list(map(int, input().split()))\n\n\ndef LIST():\n return list(map(int, input().split()))\n\n\ndef Yes():\n print(\"Yes\")\n\n\ndef No():\n print(\"No\")\n\n\ndef YES():\n print(\"YES\")\n\n\ndef NO():\n print(\"NO\")\n\n\nsys.setrecursionlimit(10**9)\nINF = float(\"inf\")\nMOD = 10**9 + 7\nA, B, Q = MAP()\nS = [-INF] * (A + 2)\nfor i in range(A):\n S[i + 1] = INT()\nT = [-INF] * (B + 2)\nfor i in range(B):\n T[i + 1] = INT()\nS[-1] = T[-1] = INF\nfor i in range(Q):\n dist1 = dist2 = dist3 = dist4 = INF\n x = INT()\n\n idx1 = bisect_right(S, x) - 1\n\n idx2 = bisect_left(S, x)\n idx3 = bisect_right(T, x) - 1\n idx4 = bisect_left(T, x)\n\n dist1 = x - S[idx1]\n\n if dist1 != INF:\n dist1 += min(abs(S[idx1] - T[idx3]), abs(S[idx1] - T[idx4]))\n dist2 = S[idx2] - x\n if dist2 != INF:\n dist2 += min(abs(S[idx2] - T[idx3]), abs(S[idx2] - T[idx4]))\n dist3 = x - T[idx3]\n if dist3 != INF:\n dist3 += min(abs(T[idx3] - S[idx1]), abs(T[idx3] - S[idx2]))\n dist4 = T[idx4] - x\n if dist4 != INF:\n dist4 += min(abs(T[idx4] - S[idx1]), abs(T[idx4] - S[idx2]))\n print((min(dist1, dist2, dist3, dist4)))\n","fast_code":"import sys\nimport bisect\n\n\nINF = float(\"inf\")\nMOD = 10**9 + 7\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef LI_():\n return [int(x) - 1 for x in sys.stdin.readline().split()]\n\n\ndef LS():\n return sys.stdin.readline().split()\n\n\ndef II():\n return int(sys.stdin.readline())\n\n\ndef SI():\n return eval(input())\n\n\na, b, q = LI()\nA = [-INF] + [II() for _ in range(a)] + [INF]\nB = [-INF] + [II() for _ in range(b)] + [INF]\nfor _ in range(q):\n x = II()\n ans = INF\n x_a = bisect.bisect_left(A, x)\n for k in [-1, 0]:\n tmp = abs(x - A[x_a + k])\n x_b = bisect.bisect_left(B, A[x_a + k])\n tmp += min(abs(B[x_b] - A[x_a + k]), abs(B[x_b - 1] - A[x_a + k]))\n ans = min(ans, tmp)\n x_b = bisect.bisect_left(B, x)\n for k in [-1, 0]:\n tmp = abs(x - B[x_b + k])\n x_a = bisect.bisect_left(A, B[x_b + k])\n tmp += min(abs(A[x_a] - B[x_b + k]), abs(A[x_a - 1] - B[x_b + k]))\n ans = min(ans, tmp)\n print(ans)\n"} +{"fast_code_id":"1c6500df6434b4b516268de2191bc284b12208aa6d004a63137b0accccbd60de","fast_id":"p02971_1c6500df6434b4b516268de2191bc284b12208aa6d004a63137b0accccbd60de","language":"python","measured_fast_code_id":"1c6500df6434b4b516268de2191bc284b12208aa6d004a63137b0accccbd60de","measured_slow_code_id":"e6e57f68f3fdc316cc31aeebb4557798af4c5acadca510eedbfbac5837388225","measurement_metric":"cpu_instruction_count","pair_id":"python_904e58545a3b5be56253c648","problem_id":"p02971","slow_code_id":"e6e57f68f3fdc316cc31aeebb4557798af4c5acadca510eedbfbac5837388225","slow_id":"p02971_e6e57f68f3fdc316cc31aeebb4557798af4c5acadca510eedbfbac5837388225","speedup":5.303823820220901,"stratum":"4-8","sampling_key":"6e7f3f0d62e6fd34388da8be34e1becc016109241975b84803e02605dda3a363","slow_code":"N = int(eval(input()))\nA = []\nfor n in range(N):\n A.append(int(eval(input())))\nB = [0 for n in range(N)]\nB[0] = A[0]\nfor n in range(N - 1):\n B[n + 1] = max(B[n], A[n + 1])\nC = [0 for n in range(N)]\nC[-1] = A[-1]\nfor n in range(N - 1):\n C[-n - 2] = max(C[-n - 1], A[-n - 2])\nfor n in range(N):\n if n == 0:\n print((C[1]))\n elif n == N - 1:\n print((B[N - 2]))\n else:\n print((max(B[n - 1], C[n + 1])))\n","fast_code":"import sys\n\nread = sys.stdin.read\nreadline = sys.stdin.readline\nreadlines = sys.stdin.readlines\n\n\ndef main():\n N, *A = list(map(int, read().split()))\n A_ = sorted(A)\n m = max(A)\n for a in A:\n if a == m:\n print((A_[-2]))\n else:\n print(m)\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"135e4bd26ba1d3fae326e995137a8a8c419b22ccdcea9d3240ec1886b5a4f161","fast_id":"p03312_135e4bd26ba1d3fae326e995137a8a8c419b22ccdcea9d3240ec1886b5a4f161","language":"python","measured_fast_code_id":"135e4bd26ba1d3fae326e995137a8a8c419b22ccdcea9d3240ec1886b5a4f161","measured_slow_code_id":"e080e07d8424e073d5e98936947b26997efc5cec42a718a67ce6f5adfbb4164f","measurement_metric":"cpu_instruction_count","pair_id":"python_90bf176302675e50bbe59eff","problem_id":"p03312","slow_code_id":"16fb7a6a6fbb5a3605c73ff209ab7a3c5e631bdab9b5fdf86ce49a66abed34d7","slow_id":"p03312_e080e07d8424e073d5e98936947b26997efc5cec42a718a67ce6f5adfbb4164f","speedup":3.3950705997600417,"stratum":"2-4","sampling_key":"a414d26e96d691366065c090b8ea60982c4b54fb4ba5d1e2ca18e79bd7b68175","slow_code":"N = int(eval(input()))\nA_list = list(map(int, input().split()))\n\na = 0\nA_left = []\nfor i in range(N):\n a += A_list[i]\n A_left.append(a)\n\na = 0\nA_right = []\nfor i in range(N):\n a += A_list[N - 1 - i]\n A_right.append(a)\n\n\ndef binary_search_left(s):\n m = 0\n l = 0\n r = N - 1\n if A_left[0] > s:\n return 0\n while True:\n m = (l + r) // 2\n if A_left[m] <= s and A_left[m + 1] > s:\n break\n elif A_left[m] <= s:\n l = m\n else:\n r = m\n if s - A_left[m] <= A_left[m + 1] - s:\n return m\n else:\n return m + 1\n\n\ndef binary_search_right(s):\n m = 0\n l = 0\n r = N - 1\n if A_right[0] > s:\n return 0\n while True:\n m = (l + r) // 2\n if A_right[m] <= s and A_right[m + 1] > s:\n break\n elif A_right[m] <= s:\n l = m\n else:\n r = m\n if s - A_right[m] <= A_right[m + 1] - s:\n return m\n else:\n return m + 1\n\n\nres = A_left[N - 1]\nfor s in range(2, N - 1):\n m_l = binary_search_left(A_left[s - 1] / 2)\n a, b = A_left[m_l], A_left[s - 1] - A_left[m_l]\n r = N - s\n m_r = binary_search_right(A_right[r - 1] / 2)\n c, d = A_right[m_r], A_right[r - 1] - A_right[m_r]\n r = max([a, b, c, d]) - min([a, b, c, d])\n if r < res:\n res = r\nif N == 4:\n res = max(A_list) - min(A_list)\nprint(res)\n","fast_code":"n = int(eval(input()))\na = list(map(int, input().split()))\n\n\ndef f(a):\n l, r = a[:2]\n m = 1\n b = [(l, r)]\n for i in range(2, n - 2):\n r += a[i]\n while m < i and abs(l - r) > abs(l - r + a[m] * 2):\n l, r = l + a[m], r - a[m]\n m += 1\n b.append((l, r))\n return b\n\n\nprint(\n (\n min(\n max(p, q, r, s) - min(p, q, r, s)\n for ((p, q), (r, s)) in zip(f(a), f(a[::-1])[::-1])\n )\n )\n)\n"} +{"fast_code_id":"0dcf2892c6a9c0e921954d31e1616d691c28ba6c91ee7f77510e39a15e8a6e45","fast_id":"p03762_0dcf2892c6a9c0e921954d31e1616d691c28ba6c91ee7f77510e39a15e8a6e45","language":"python","measured_fast_code_id":"0dcf2892c6a9c0e921954d31e1616d691c28ba6c91ee7f77510e39a15e8a6e45","measured_slow_code_id":"982e2a132ff9a9ee086902a77e4d38984ae35b417d1949db3c426a0eec331800","measurement_metric":"cpu_instruction_count","pair_id":"python_918087c142d59995ea12c14b","problem_id":"p03762","slow_code_id":"982e2a132ff9a9ee086902a77e4d38984ae35b417d1949db3c426a0eec331800","slow_id":"p03762_982e2a132ff9a9ee086902a77e4d38984ae35b417d1949db3c426a0eec331800","speedup":6.1846355055681315,"stratum":"4-8","sampling_key":"db7036edb7200285a2ac39182ab1688197220e3777de10150b4d7adc1924aaf4","slow_code":"import sys\nimport numpy as np\n\nMOD = 10**9 + 7\nI = np.array(sys.stdin.read().split(), dtype=np.int64)\nn, m = I[:2]\nx = I[2 : 2 + n]\ny = I[2 + n :]\n\n\ndef main():\n sx = np.cumsum(x) % MOD\n sy = np.cumsum(y) % MOD\n sdx = (\n np.sum((sx[n - 1] - sx[: n - 1]) - x[: n - 1] * ((n - 1) - np.arange(n - 1)))\n % MOD\n )\n sdy = (\n np.sum((sy[m - 1] - sy[: m - 1]) - y[: m - 1] * ((m - 1) - np.arange(m - 1)))\n % MOD\n )\n ans = sdx * sdy % MOD\n return ans\n\n\nif __name__ == \"__main__\":\n ans = main()\n print(ans)\n","fast_code":"N, M = list(map(int, input().split()))\nxs = list(map(int, input().split()))\nys = list(map(int, input().split()))\nMOD = 10**9 + 7\ntotal_w = total_h = 0\nfor n in range(1, N):\n w = xs[n] - xs[n - 1]\n w = (w * n * (N - n)) % MOD\n total_w = (total_w + w) % MOD\nfor n in range(1, M):\n h = ys[n] - ys[n - 1]\n h = (h * n * (M - n)) % MOD\n total_h = (total_h + h) % MOD\nans = (total_w * total_h) % MOD\nprint(ans)\n"} +{"fast_code_id":"8565b06f6410e66d6e76e13081e06ba2f1602221ce9032d31cf918be1e146cd2","fast_id":"p03331_8565b06f6410e66d6e76e13081e06ba2f1602221ce9032d31cf918be1e146cd2","language":"python","measured_fast_code_id":"8565b06f6410e66d6e76e13081e06ba2f1602221ce9032d31cf918be1e146cd2","measured_slow_code_id":"153ddd3939958df9731f2cb6a9569dfdd13dde4cae47410105d9d1d355dcbd24","measurement_metric":"cpu_instruction_count","pair_id":"python_91929548376e1d1da7419e73","problem_id":"p03331","slow_code_id":"153ddd3939958df9731f2cb6a9569dfdd13dde4cae47410105d9d1d355dcbd24","slow_id":"p03331_153ddd3939958df9731f2cb6a9569dfdd13dde4cae47410105d9d1d355dcbd24","speedup":5500.519666696292,"stratum":"8+","sampling_key":"a9e1434e154f2b9d45dfcfe760ab33d61811efe4ceb37ca33674e852c8f16e1c","slow_code":"N = int(eval(input()))\nimport numpy as np\n\na = np.arange(N)\na = np.delete(a, 0)\nb = N - a\nnum_arr = []\nfor i in range(len(a)):\n factor_a = [int(x) for x in list(str(a[i]))]\n factor_b = [int(x) for x in list(str(b[i]))]\n num_arr.append(sum(factor_a) + sum(factor_b))\nprint((min(num_arr)))\n","fast_code":"n = int(eval(input()))\nprint((10 if n in [10**x for x in range(6)] else sum(map(int, str(n)))))\n"} +{"fast_code_id":"bcdd6c5a04ef827b58b6607368ffa34b279e2ae37471e8105f1a35498de66f88","fast_id":"p03112_bcdd6c5a04ef827b58b6607368ffa34b279e2ae37471e8105f1a35498de66f88","language":"python","measured_fast_code_id":"bcdd6c5a04ef827b58b6607368ffa34b279e2ae37471e8105f1a35498de66f88","measured_slow_code_id":"075f3d0646b6b85cb5ae32f4ea2d0d59acf39147bd9650aafe37dade27ea98fa","measurement_metric":"cpu_instruction_count","pair_id":"python_91a47e29e7a7dbcb74670f0c","problem_id":"p03112","slow_code_id":"77daaa725f47eb183a0e25b50b7e6255b814e50d5067b476fe004c62248fd0dc","slow_id":"p03112_075f3d0646b6b85cb5ae32f4ea2d0d59acf39147bd9650aafe37dade27ea98fa","speedup":5.463065077895204,"stratum":"4-8","sampling_key":"f19bc3439c164977314b68a0a037338cb492b8e6c3215471b2fa42a09d74e91f","slow_code":"import sys, re\nfrom collections import deque, defaultdict, Counter\nfrom math import sqrt, hypot, factorial, pi, sin, cos, radians, log10\n\nif sys.version_info.minor >= 5:\n from math import gcd\nelse:\n from fractions import gcd\nfrom heapq import heappop, heappush, heapify, heappushpop\nfrom bisect import bisect_left, bisect_right\nfrom itertools import permutations, combinations, product, accumulate\nfrom operator import itemgetter, mul, xor\nfrom copy import copy, deepcopy\nfrom functools import reduce, partial\nfrom fractions import Fraction\nfrom string import ascii_lowercase, ascii_uppercase, digits\nfrom datetime import date\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef list2d(a, b, c):\n return [[c] * b for i in range(a)]\n\n\ndef list3d(a, b, c, d):\n return [[[d] * c for j in range(b)] for i in range(a)]\n\n\ndef ceil(x, y=1):\n return int(-(-x // y))\n\n\ndef round(x):\n return int((x * 2 + 1) // 2)\n\n\ndef fermat(x, y, MOD):\n return x * pow(y, MOD - 2, MOD) % MOD\n\n\ndef lcm(x, y):\n return (x * y) // gcd(x, y)\n\n\ndef lcm_list(nums):\n return reduce(lcm, nums, 1)\n\n\ndef gcd_list(nums):\n return reduce(gcd, nums, nums[0])\n\n\ndef INT():\n return int(eval(input()))\n\n\ndef MAP():\n return list(map(int, input().split()))\n\n\ndef LIST():\n return list(map(int, input().split()))\n\n\ndef Yes():\n print(\"Yes\")\n\n\ndef No():\n print(\"No\")\n\n\ndef YES():\n print(\"YES\")\n\n\ndef NO():\n print(\"NO\")\n\n\nsys.setrecursionlimit(10**9)\nINF = float(\"inf\")\nMOD = 10**9 + 7\nA, B, Q = MAP()\nS = [-INF] * (A + 2)\nfor i in range(A):\n S[i + 1] = INT()\nT = [-INF] * (B + 2)\nfor i in range(B):\n T[i + 1] = INT()\nS[-1] = T[-1] = INF\nfor i in range(Q):\n dist1 = dist2 = dist3 = dist4 = INF\n x = INT()\n\n idx1 = bisect_right(S, x) - 1\n\n idx2 = bisect_left(S, x)\n idx3 = bisect_right(T, x) - 1\n idx4 = bisect_left(T, x)\n\n dist1 = x - S[idx1]\n\n if dist1 != INF:\n dist1 += min(abs(S[idx1] - T[idx3]), abs(S[idx1] - T[idx4]))\n dist2 = S[idx2] - x\n if dist2 != INF:\n dist2 += min(abs(S[idx2] - T[idx3]), abs(S[idx2] - T[idx4]))\n dist3 = x - T[idx3]\n if dist3 != INF:\n dist3 += min(abs(T[idx3] - S[idx1]), abs(T[idx3] - S[idx2]))\n dist4 = T[idx4] - x\n if dist4 != INF:\n dist4 += min(abs(T[idx4] - S[idx1]), abs(T[idx4] - S[idx2]))\n print((min(dist1, dist2, dist3, dist4)))\n","fast_code":"import bisect\nimport sys\n\nSENTINEL = 10**12\na, b, q = list(map(int, input().split()))\nlines = sys.stdin.readlines()\nsss = [-SENTINEL] + list(map(int, lines[:a])) + [SENTINEL]\nttt = [-SENTINEL] + list(map(int, lines[a : a + b])) + [SENTINEL]\nxxx = list(map(int, lines[a + b :]))\nnearest_temples = [SENTINEL] + [0] * a + [SENTINEL]\nnearest_shrines = [SENTINEL] + [0] * b + [SENTINEL]\nfor i, s in enumerate(sss[1:-1], start=1):\n ti = bisect.bisect(ttt, s)\n nearest_temples[i] = min(ttt[ti] - s, s - ttt[ti - 1])\nfor i, t in enumerate(ttt[1:-1], start=1):\n si = bisect.bisect(sss, t)\n nearest_shrines[i] = min(sss[si] - t, t - sss[si - 1])\nbuf = []\nfor x in xxx:\n si = bisect.bisect(sss, x)\n ti = bisect.bisect(ttt, x)\n ans = min(\n x - sss[si - 1] + nearest_temples[si - 1],\n sss[si] - x + nearest_temples[si],\n x - ttt[ti - 1] + nearest_shrines[ti - 1],\n ttt[ti] - x + nearest_shrines[ti],\n )\n buf.append(ans)\nprint((\"\\n\".join(map(str, buf))))\n"} +{"fast_code_id":"1c6500df6434b4b516268de2191bc284b12208aa6d004a63137b0accccbd60de","fast_id":"p02971_1c6500df6434b4b516268de2191bc284b12208aa6d004a63137b0accccbd60de","language":"python","measured_fast_code_id":"1c6500df6434b4b516268de2191bc284b12208aa6d004a63137b0accccbd60de","measured_slow_code_id":"574406044bb1599cddf064526e1d32459b948c359a5a1de966a35ad9affef810","measurement_metric":"cpu_instruction_count","pair_id":"python_92717fda3e140736eee034a1","problem_id":"p02971","slow_code_id":"574406044bb1599cddf064526e1d32459b948c359a5a1de966a35ad9affef810","slow_id":"p02971_574406044bb1599cddf064526e1d32459b948c359a5a1de966a35ad9affef810","speedup":3.565715775347002,"stratum":"2-4","sampling_key":"3cb3c4de610fadde40184df1f20631670f705f4b1667a1f15148da25d8fbad25","slow_code":"N = int(eval(input()))\nA = []\nfor i in range(N):\n A.append(int(eval(input())))\nAs = sorted(A, reverse=True)\nfor j in A:\n if j == As[0]:\n print((As[1]))\n else:\n print((As[0]))\n","fast_code":"import sys\n\nread = sys.stdin.read\nreadline = sys.stdin.readline\nreadlines = sys.stdin.readlines\n\n\ndef main():\n N, *A = list(map(int, read().split()))\n A_ = sorted(A)\n m = max(A)\n for a in A:\n if a == m:\n print((A_[-2]))\n else:\n print(m)\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"74d46ca7ddd1ab0ffda87d84b6c14121f04a86b23b8694b427d1d45086c945ef","fast_id":"p00033_74d46ca7ddd1ab0ffda87d84b6c14121f04a86b23b8694b427d1d45086c945ef","language":"python","measured_fast_code_id":"74d46ca7ddd1ab0ffda87d84b6c14121f04a86b23b8694b427d1d45086c945ef","measured_slow_code_id":"e97d5bcfe286f3a777e3a00f68fc161c838b87b600edb795e081e65759bf020d","measurement_metric":"cpu_instruction_count","pair_id":"python_9390ae557a2160b8bd09bcc2","problem_id":"p00033","slow_code_id":"e97d5bcfe286f3a777e3a00f68fc161c838b87b600edb795e081e65759bf020d","slow_id":"p00033_e97d5bcfe286f3a777e3a00f68fc161c838b87b600edb795e081e65759bf020d","speedup":233.78996570964748,"stratum":"8+","sampling_key":"06bcf2c15194d409777866e4f0bb92a7c1db07a7e4802868a6eb93acf6ed4c22","slow_code":"N = int(eval(input()))\nfor testCase in range(N):\n A = list(map(int, input().split()))\n ok = False\n for i in range(2**10):\n x = []\n y = []\n for j in range(10):\n if i & (1 << j):\n x.append(A[j])\n else:\n y.append(A[j])\n if x == sorted(x) and y == sorted(y):\n ok = True\n if ok:\n print(\"YES\")\n else:\n print(\"NO\")\n","fast_code":"def f(x):\n a, b = 0, 0\n for e in x:\n if e > a:\n a = e\n elif e > b:\n b = e\n else:\n return 0\n return 1\n\n\nn = eval(input())\nfor i in range(n):\n D = list(map(int, input().split()))\n s = [\"NO\", \"YES\"][f(D)]\n print(s)\n"} +{"fast_code_id":"0ac8c5f56e3e53bf479baa19a7eeeab5cf21fb3d72a87838cb617b89991bb87c","fast_id":"p02714_0ac8c5f56e3e53bf479baa19a7eeeab5cf21fb3d72a87838cb617b89991bb87c","language":"python","measured_fast_code_id":"0ac8c5f56e3e53bf479baa19a7eeeab5cf21fb3d72a87838cb617b89991bb87c","measured_slow_code_id":"329b15942111e48ba21aa4fa5898b0daadc6d2ead02a6a14ed26da0eb67b41ec","measurement_metric":"cpu_instruction_count","pair_id":"python_93da9dd6ddb8354b04038424","problem_id":"p02714","slow_code_id":"da713aaa394b9951921ebd958e2887baf9e88ebd0181739a1faba9c19b60964a","slow_id":"p02714_329b15942111e48ba21aa4fa5898b0daadc6d2ead02a6a14ed26da0eb67b41ec","speedup":3.154721918582251,"stratum":"2-4","sampling_key":"2260b143e6785fafd2fd78bfd9b0fced44e061f3157470846f835cd2ebb9865f","slow_code":"from sys import stdin\nimport bisect\n\n\ndef main():\n\n readline = stdin.readline\n N = int(readline())\n S = readline().strip()\n res = 0\n R = []\n G = []\n B = []\n flags = [\"\"] * N\n for i in range(N):\n if S[i] == \"R\":\n R.append(i)\n flags[i] = \"R\"\n elif S[i] == \"G\":\n G.append(i)\n flags[i] = \"G\"\n else:\n B.append(i)\n flags[i] = \"B\"\n\n for i in range(len(R)):\n for j in range(len(G)):\n n = max(R[i], G[j])\n k = bisect.bisect_left(B, n)\n res += len(B) - k\n if n + n - min(R[i], G[j]) < N:\n if flags[n + n - min(R[i], G[j])] == \"B\":\n res -= 1\n for i in range(len(R)):\n for j in range(len(B)):\n n = max(R[i], B[j])\n k = bisect.bisect_left(G, n)\n res += len(G) - k\n if n + n - min(R[i], B[j]) < N:\n if flags[n + n - min(R[i], B[j])] == \"G\":\n res -= 1\n for i in range(len(B)):\n for j in range(len(G)):\n n = max(B[i], G[j])\n k = bisect.bisect_left(R, n)\n res += len(R) - k\n if n + n - min(B[i], G[j]) < N:\n if flags[n + n - min(B[i], G[j])] == \"R\":\n res -= 1\n print(res)\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"n, s = open(0)\nn = int(n)\nc = s.count\nprint(\n (\n c(\"R\") * c(\"G\") * c(\"B\")\n - sum(\n s[i] != s[i + j >> 1] != s[j] != s[i]\n for i in range(n)\n for j in range(i + 2, n, 2)\n )\n )\n)\n"} +{"fast_code_id":"9ae81acdf62a7eab974b49bfdd746ffed7ee35c04fa2af21419e31fe779d2ee5","fast_id":"p02763_9ae81acdf62a7eab974b49bfdd746ffed7ee35c04fa2af21419e31fe779d2ee5","language":"python","measured_fast_code_id":"9ae81acdf62a7eab974b49bfdd746ffed7ee35c04fa2af21419e31fe779d2ee5","measured_slow_code_id":"f48f6f3e37812c17b5337b9141da770a977eb3ae11af352f28286963282fd6ed","measurement_metric":"cpu_instruction_count","pair_id":"python_93fad12df76f7594488f9d59","problem_id":"p02763","slow_code_id":"4fa4a65e4a0df3861053325cb01fa333b2482712b297bcf1214920d237936687","slow_id":"p02763_f48f6f3e37812c17b5337b9141da770a977eb3ae11af352f28286963282fd6ed","speedup":5.188631375856921,"stratum":"4-8","sampling_key":"866522139b2e3af718049e4c9276631a4b54afd4d2f3a7d0167e7b96052a470f","slow_code":"import sys\n\ninput = sys.stdin.readline\n\n\nclass Bit:\n def __init__(self, n):\n self.n = n\n self.tree = [0] * (n + 1)\n self.el = [0] * (n + 1)\n self.depth = n.bit_length() - 1\n\n def sum(self, i):\n s = 0\n i -= 1\n while i >= 0:\n s += self.tree[i]\n i = (i & (i + 1)) - 1\n return s\n\n def add(self, i, x):\n self.el[i] += x\n while i < self.n:\n self.tree[i] += x\n i |= i + 1\n\n def get(self, i, j=None):\n if j is None:\n return self.el[i]\n if i == 0:\n return self.sum(j)\n return self.sum(j) - self.sum(i)\n\n def lower_bound(self, x, equal=False):\n sum_ = 0\n pos = -1\n if not equal:\n for i in range(self.depth, -1, -1):\n k = pos + (1 << i)\n if k < self.n and sum_ + self.tree[k] < x:\n sum_ += self.tree[k]\n pos += 1 << i\n if equal:\n for i in range(self.depth, -1, -1):\n k = pos + (1 << i)\n if k < self.n and sum_ + self.tree[k] <= x:\n sum_ += self.tree[k]\n pos += 1 << i\n return pos, sum_\n\n def __getitem__(self, s):\n return self.el[s]\n\n def __iter__(self):\n for s in self.el[: self.n]:\n yield s\n\n def __str__(self):\n text1 = \" \".join([\"element: \"] + list(map(str, self)))\n text2 = \" \".join(\n [\"cumsum(1-indexed): \"]\n + list(str(self.sum(i)) for i in range(1, self.n + 1))\n )\n return \"\\n\".join((text1, text2))\n\n\nimport string\n\nN = int(eval(input()))\nS = input().strip()\nQ = int(eval(input()))\nB = [Bit(N) for _ in range(26)]\nabc = string.ascii_lowercase\nabc2 = dict()\nfor i, s in enumerate(abc):\n abc2[s] = i\nfor i, s in enumerate(S):\n B[abc2[s]].add(i, 1)\nfor _ in range(Q):\n q = list(input().split())\n if q[0] == \"1\":\n a = int(q[1]) - 1\n b = q[2]\n for i in range(26):\n if B[i].el[a] == 1:\n B[i].add(a, -1)\n B[abc2[b]].add(a, 1)\n if q[0] == \"2\":\n a = int(q[1]) - 1\n b = int(q[2]) - 1\n res = 0\n for i in range(26):\n res += B[i].get(a, b + 1) > 0\n print(res)\n","fast_code":"f = input\nn, s, q = int(f()), list(f()), int(f())\nd = {chr(97 + i): [] for i in range(26)}\nfor i in range(n):\n d[s[i]] += [i]\nfrom bisect import *\n\nfor i in range(q):\n a, b, c = f().split()\n b = int(b) - 1\n if a == \"1\":\n if s[b] == c:\n continue\n d[s[b]].pop(bisect(d[s[b]], b) - 1)\n s[b] = c\n insort(d[c], b)\n else:\n t = 0\n for l in list(d.values()):\n m = bisect(l, b - 1)\n if m < len(l) and l[m] < int(c):\n t += 1\n print(t)\n"} +{"fast_code_id":"563884c909984690cb17a4a75e13aa643e22ac803dadb5d6eff6d3b364daf2a3","fast_id":"p02551_563884c909984690cb17a4a75e13aa643e22ac803dadb5d6eff6d3b364daf2a3","language":"python","measured_fast_code_id":"563884c909984690cb17a4a75e13aa643e22ac803dadb5d6eff6d3b364daf2a3","measured_slow_code_id":"cb5752a1f4b2bb1578da80a75a3c754316abdc192a0c7d44da286e61467a61d0","measurement_metric":"cpu_instruction_count","pair_id":"python_942f4cb0fa5c62fbef8ebd9e","problem_id":"p02551","slow_code_id":"c96bf6d0819d7810e22a68071df9f8300b95e6f6dc7491105b653fdeb461629a","slow_id":"p02551_cb5752a1f4b2bb1578da80a75a3c754316abdc192a0c7d44da286e61467a61d0","speedup":4.6312817466095675,"stratum":"4-8","sampling_key":"4677e5638bf00e1d360fdcb770cef6ddcdb7695d2e2d36b752e3a799a1293049","slow_code":"N, Q = list(map(int, input().split()))\nN -= 2\n\nBIT = [[0 for i in range(N + 1)] for _ in range(2)]\n\n\nn = N\n\n\ndef BIT_query(idx, BIT):\n res_sum = 0\n while idx > 0:\n res_sum += BIT[idx]\n idx -= idx & (-idx)\n return res_sum\n\n\ndef BIT_update(idx, x, BIT):\n while idx <= n:\n BIT[idx] += x\n idx += idx & (-idx)\n return\n\n\nnow = N * N\nmax_x = [\n 0,\n 0,\n]\nfor _ in range(Q):\n\n s, x = list(map(int, input().split()))\n\n s -= 1\n\n x -= 1\n\n x = N + 1 - x\n\n depth = N + BIT_query(x, BIT[s])\n now -= depth\n if x > max_x[s]:\n BIT_update(N - depth + 1, max_x[s] - x, BIT[1 - s])\n\n max_x[s] = x\nprint(now)\n","fast_code":"import sys\n\nread = sys.stdin.read\nreadline = sys.stdin.readline\nreadlines = sys.stdin.readlines\nsys.setrecursionlimit(10**9)\nINF = 1 << 60\nMOD = 1000000007\n\n\ndef main():\n N, Q, *query = list(map(int, read().split()))\n N -= 2\n row = [N] * N\n col = [N] * N\n R = C = N\n ans = N * N\n for q, x in zip(*[iter(query)] * 2):\n x -= 2\n if q == 1:\n if x < C:\n ans -= R\n for i in range(x + 1, C):\n col[i] = R\n C = x\n else:\n ans -= col[x]\n else:\n if x < R:\n ans -= C\n for i in range(x + 1, R):\n row[i] = C\n R = x\n else:\n ans -= row[x]\n print(ans)\n return\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"64eb55694f5670d05a91fd627bb6417facdff1866aef7b2068e21a16c18e3bca","fast_id":"p00789_9912b66d792cba389c745a8a828ab25cc7b036598591fecef8d3e39bf932a947","language":"python","measured_fast_code_id":"9912b66d792cba389c745a8a828ab25cc7b036598591fecef8d3e39bf932a947","measured_slow_code_id":"0850c56dafb3d889e39fc16a9f006a78b345e6893de16a5d30d7df214a66f232","measurement_metric":"cpu_instruction_count","pair_id":"python_94869c9c0b6681a439ce4d02","problem_id":"p00789","slow_code_id":"4a08723f3736df446eee4d2df628596f65361d6f5b75220d3f6400dd22cdf8b6","slow_id":"p00789_0850c56dafb3d889e39fc16a9f006a78b345e6893de16a5d30d7df214a66f232","speedup":6.699020214360208,"stratum":"4-8","sampling_key":"8e6667fc4c71dbeb006273152ab05e41a92631bf6d97de78ba33602e8ab752bc","slow_code":"N = 18\ntbl = [i**2 for i in range(0, N)]\ndp = [[0 for j in range(600)] for i in range(N)]\ndp[0][0] = 1\nfor i in range(1, N):\n for n in range(300):\n dp[i][n] += dp[i - 1][n]\n for j in range(tbl[i], 300, tbl[i]):\n dp[i][n + j] += dp[i - 1][n]\nwhile True:\n n = int(eval(input()))\n if n == 0:\n break\n print((dp[N - 1][n]))\n","fast_code":"dp = [1] * 300\nfor i in range(2, 18):\n for j in range(i**2, 300):\n dp[j] += dp[j - i**2]\nwhile True:\n n = int(eval(input()))\n if n == 0:\n break\n print((dp[n]))\n"} +{"fast_code_id":"013bd4927b63ad8310a8bbd0f90b8d032b0bfd8e03cc0243efe0100c008f1093","fast_id":"p03455_013bd4927b63ad8310a8bbd0f90b8d032b0bfd8e03cc0243efe0100c008f1093","language":"python","measured_fast_code_id":"013bd4927b63ad8310a8bbd0f90b8d032b0bfd8e03cc0243efe0100c008f1093","measured_slow_code_id":"1e58957cce6049d366f3189df1c6244aa3226734d9f71da11d6221cbf487aae2","measurement_metric":"cpu_instruction_count","pair_id":"python_94970381b8715b7d6a081186","problem_id":"p03455","slow_code_id":"1e58957cce6049d366f3189df1c6244aa3226734d9f71da11d6221cbf487aae2","slow_id":"p03455_1e58957cce6049d366f3189df1c6244aa3226734d9f71da11d6221cbf487aae2","speedup":2.601176246007368,"stratum":"2-4","sampling_key":"7e0a5db95a56da8f949dbd265e52d0f1bae2204a7779319584823a334c41bcab","slow_code":"def ketanowa(p):\n ans = 0\n p = str(p)\n for i in p:\n ans += int(i)\n return ans\n\n\ndef main():\n temp = input().split(\" \")\n n = int(temp[0])\n a = int(temp[1])\n if n * a % 2 == 0:\n print(\"Even\")\n else:\n print(\"Odd\")\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"a, b = list(map(int, input().split()))\nprint((\"EOvdedn\"[a * b % 2 :: 2]))\n"} +{"fast_code_id":"78ec77edabf6eaf0668e692aaa191f6e7f95b867c9c8fc3d77fca781803df23c","fast_id":"p02549_103c0b0fa57d0b7965817c715e5fef817ae5761d08d6804775b746d49c092239","language":"python","measured_fast_code_id":"103c0b0fa57d0b7965817c715e5fef817ae5761d08d6804775b746d49c092239","measured_slow_code_id":"44c9516e92f38f09d76b47812276c2878e77eeefdb8dab9cc1137c27ddfc7b8e","measurement_metric":"cpu_instruction_count","pair_id":"python_94b365ffbdeb258a8838e0bd","problem_id":"p02549","slow_code_id":"44c9516e92f38f09d76b47812276c2878e77eeefdb8dab9cc1137c27ddfc7b8e","slow_id":"p02549_44c9516e92f38f09d76b47812276c2878e77eeefdb8dab9cc1137c27ddfc7b8e","speedup":2.212795107933837,"stratum":"2-4","sampling_key":"0273bcb67ba0f5e31051836fc8dbaf9b3d6ca6c07f3d474b343ceebc3ac541f2","slow_code":"mod = 998244353\nn, k = list(map(int, input().split()))\nK = [list(map(int, input().split())) for i in range(k)]\ndp = [0] * (n + 5)\ndp[1] = 1\ndp2 = [0] * (n + 5)\nfor i in range(1, n + 1):\n dp[i] = (dp[i] + dp2[i] + dp2[i - 1]) % mod\n dp2[i] = (dp2[i] + dp2[i - 1]) % mod\n for l, r in K:\n dp2[min(i + l, n + 2)] += dp[i]\n dp2[min(i + l, n + 2)] %= mod\n dp2[min(i + r + 1, n + 2)] -= dp[i]\n dp2[min(i + r + 1, n + 2)] %= mod\nprint((dp[n] % mod))\n","fast_code":"N, K = list(map(int, input().split()))\nmod = 998244353\nL = []\nfor _ in range(K):\n a, b = list(map(int, input().split()))\n b += 1\n L.append([a, b])\nruiwa = [0] * (N + 1)\ndp = [0] * (N + 1)\ndp[1] = 1\nruiwa[1] = 1\nfor i in range(2, N + 1):\n for l, r in L:\n l = i - l\n r = i - r\n l, r = r, l\n if r < 0:\n continue\n elif l >= 0:\n\n dp[i] += (ruiwa[r] - ruiwa[l]) % mod\n else:\n dp[i] += ruiwa[r] % mod\n ruiwa[i] = (ruiwa[i - 1] + dp[i]) % mod\nprint((dp[-1] % mod))\n"} +{"fast_code_id":"ab5300422a36b59b9805cb71e17a1987600769d0f27e6ef3ae3f25c78274ac47","fast_id":"p03563_ab5300422a36b59b9805cb71e17a1987600769d0f27e6ef3ae3f25c78274ac47","language":"python","measured_fast_code_id":"ab5300422a36b59b9805cb71e17a1987600769d0f27e6ef3ae3f25c78274ac47","measured_slow_code_id":"59c6641cd1def8a06b45e4c0f0ace3ffa49de62fc97f73e0499cc3875cec5d01","measurement_metric":"cpu_instruction_count","pair_id":"python_95933ec35702739eeb7d23f1","problem_id":"p03563","slow_code_id":"59c6641cd1def8a06b45e4c0f0ace3ffa49de62fc97f73e0499cc3875cec5d01","slow_id":"p03563_59c6641cd1def8a06b45e4c0f0ace3ffa49de62fc97f73e0499cc3875cec5d01","speedup":1656.7233040779613,"stratum":"8+","sampling_key":"3995f42013bd594fdec267337201cb4a6d9fcdb9694af2343aa7b87fef6da005","slow_code":"import numpy as np\n\nlst = []\nR = int(eval(input()))\nG = int(eval(input()))\nans = G - R + G\nprint(ans)\n","fast_code":"r = int(eval(input()))\ng = int(eval(input()))\nx = (2 * g) - r\nprint(x)\n"} +{"fast_code_id":"a60785b8426d7e81c1725887e6d0a4c4d8c11673456ba5f14f77e2618f11f6f9","fast_id":"p03700_a60785b8426d7e81c1725887e6d0a4c4d8c11673456ba5f14f77e2618f11f6f9","language":"python","measured_fast_code_id":"a60785b8426d7e81c1725887e6d0a4c4d8c11673456ba5f14f77e2618f11f6f9","measured_slow_code_id":"4f614769a7e22dddcb85c7a9aa9d9cee3d9896b34340a1e7d8590ac4705426eb","measurement_metric":"cpu_instruction_count","pair_id":"python_95a8be0a437f0f2e358bddc6","problem_id":"p03700","slow_code_id":"4f614769a7e22dddcb85c7a9aa9d9cee3d9896b34340a1e7d8590ac4705426eb","slow_id":"p03700_4f614769a7e22dddcb85c7a9aa9d9cee3d9896b34340a1e7d8590ac4705426eb","speedup":2.467930833773768,"stratum":"2-4","sampling_key":"5a29e2d3448e4c1d3eb8b6b89191bc8b62992b3ef571596182408e0647c44b61","slow_code":"import numpy as np\n\nN, A, B = list(map(int, input().split()))\nH = np.zeros(shape=N, dtype=\"int64\")\nfor _ in range(N):\n h = int(eval(input()))\n H[_] = h\n\n\ndef calc(num, a):\n a -= num * B\n a = (a - 1) // (A - B) + 1\n if sum(a[a > 0]) <= num:\n return True\n else:\n return False\n\n\nstart = 0\nend = 10**10\nwhile end - start > 1:\n mid = (start + end) // 2\n if calc(mid, H.copy()):\n end = mid\n else:\n start = mid\nprint(end)\n","fast_code":"n, a, b = list(map(int, input().split()))\nh = [int(eval(input())) for i in range(n)]\nok = 10**9\nng = 0\nwhile abs(ok - ng) > 1:\n mid = (ok + ng) // 2\n l = [i - (mid * b) for i in h]\n cnt = 0\n for j in l:\n if j <= 0:\n continue\n cnt += (j + a - b - 1) // (a - b)\n if cnt <= mid:\n ok = mid\n else:\n ng = mid\nprint(ok)\n"} +{"fast_code_id":"3cdff8e4175870a02e4061206fd8f6e8c2d7f81e837019cd00e38a6f5ab341db","fast_id":"p02792_3cdff8e4175870a02e4061206fd8f6e8c2d7f81e837019cd00e38a6f5ab341db","language":"python","measured_fast_code_id":"3cdff8e4175870a02e4061206fd8f6e8c2d7f81e837019cd00e38a6f5ab341db","measured_slow_code_id":"d3912821eabbc16806c982e0e9fc690609236b2378548143543fff61b3542a25","measurement_metric":"cpu_instruction_count","pair_id":"python_95c538e1469f35203725e942","problem_id":"p02792","slow_code_id":"d3912821eabbc16806c982e0e9fc690609236b2378548143543fff61b3542a25","slow_id":"p02792_d3912821eabbc16806c982e0e9fc690609236b2378548143543fff61b3542a25","speedup":5.583113390264436,"stratum":"4-8","sampling_key":"905391965350ff6a5e8c2fa0b69ad5eb67a43344da948cdd166000884a627bc3","slow_code":"def main():\n N = int(eval(input()))\n dp = [[0] * 10 for _ in range(10)]\n for i in range(1, N + 1):\n tmp = str(i)\n left = int(tmp[0])\n right = int(tmp[-1])\n if left == 0 or right == 0:\n continue\n dp[left][right] += 1\n ans = 0\n for i in range(10):\n for j in range(10):\n ans += dp[i][j] * dp[j][i]\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"from itertools import product\n\n\ndef solve(string):\n d = len(string)\n if d == 1:\n return string\n s0, ss, sn = int(string[0]), int(string[1:-1] or 0), int(string[-1])\n t = [[0] * 10] + [[int(\"1\" * (d - 2) or 0)] * 10 for _ in range(9)]\n for i in range(1, 10):\n t[i][i] += 1\n for i, j in product(list(range(1, s0)), list(range(10))):\n t[i][j] += 10 ** (d - 2)\n for j in range(sn + 1):\n t[s0][j] += ss + 1\n for j in range(sn + 1, 10):\n t[s0][j] += ss\n return str(sum(t[i][j] * t[j][i] for i, j in product(list(range(1, 10)), repeat=2)))\n\n\nif __name__ == \"__main__\":\n import sys\n\n print((solve(sys.stdin.read().strip())))\n"} +{"fast_code_id":"47e458fe71a0ff420153642de21432b17824cb83abc618c6be588e8cc4329217","fast_id":"p03767_47e458fe71a0ff420153642de21432b17824cb83abc618c6be588e8cc4329217","language":"python","measured_fast_code_id":"47e458fe71a0ff420153642de21432b17824cb83abc618c6be588e8cc4329217","measured_slow_code_id":"7693ad55686e6fd618fa19be5402464b2c1d8a6534c46b08c3072eed6c243853","measurement_metric":"cpu_instruction_count","pair_id":"python_96019473d7ae748295cdc9b1","problem_id":"p03767","slow_code_id":"7693ad55686e6fd618fa19be5402464b2c1d8a6534c46b08c3072eed6c243853","slow_id":"p03767_7693ad55686e6fd618fa19be5402464b2c1d8a6534c46b08c3072eed6c243853","speedup":5.97458220505953,"stratum":"4-8","sampling_key":"0ce06a886536cc97b716edb01b0f940cb06cd576d9827fe2aa990e34b5d0b524","slow_code":"from collections import Counter, defaultdict, deque\nfrom heapq import heappop, heappush, heapify\nimport sys, bisect, math, itertools, fractions, pprint\n\nsys.setrecursionlimit(10**8)\nmod = 10**9 + 7\nINF = float(\"inf\")\n\n\ndef inp():\n return int(sys.stdin.readline())\n\n\ndef inpl():\n return list(map(int, sys.stdin.readline().split()))\n\n\nn = inp()\na = inpl()\na.sort(reverse=True)\ncnt = n\nind = 0\nres = 0\nwhile cnt:\n if ind % 2:\n res += a[ind]\n cnt -= 1\n ind += 1\nprint(res)\n","fast_code":"n = int(eval(input()))\na = list(map(int, input().split()))\na = sorted(a, reverse=1)\nprint((sum(a[1 : n * 2 : 2])))\n"} +{"fast_code_id":"ad30eeb2746fdc30b636e578b2a7d004d2de4c68ec0258c9cc201952f4f751bb","fast_id":"p02930_ad30eeb2746fdc30b636e578b2a7d004d2de4c68ec0258c9cc201952f4f751bb","language":"python","measured_fast_code_id":"ad30eeb2746fdc30b636e578b2a7d004d2de4c68ec0258c9cc201952f4f751bb","measured_slow_code_id":"e92d2c5b381e0dc13fec91e29d5b05e3c0b38db0ebb8a73555cd4f93676c88e6","measurement_metric":"cpu_instruction_count","pair_id":"python_961f7a596d84f35dda6f85dc","problem_id":"p02930","slow_code_id":"e92d2c5b381e0dc13fec91e29d5b05e3c0b38db0ebb8a73555cd4f93676c88e6","slow_id":"p02930_e92d2c5b381e0dc13fec91e29d5b05e3c0b38db0ebb8a73555cd4f93676c88e6","speedup":2.2848215143217185,"stratum":"2-4","sampling_key":"5f2a39802816fb09fd767e16ae51cc1f709713c75d8622c6f6c92a988b05dd9e","slow_code":"N, j = int(eval(input())), 0\nexec(\"print(*[9-format(i+1,'09b').rfind('1')for i in range(N)][:N-j-1]);j+=1;\" * N)\n","fast_code":"n = eval(input())\nwhile n:\n n -= 1\n for j in range(n):\n print(bin(j + 1)[::-1].find(\"1\") + 1)\n"} +{"fast_code_id":"df3abf6f0bfda3c53a4dae9b9f7ae38fc9c8a22d5a19699503d33d0fec89549c","fast_id":"p03297_df3abf6f0bfda3c53a4dae9b9f7ae38fc9c8a22d5a19699503d33d0fec89549c","language":"python","measured_fast_code_id":"df3abf6f0bfda3c53a4dae9b9f7ae38fc9c8a22d5a19699503d33d0fec89549c","measured_slow_code_id":"c62d289c9b502fe7f9c4c3989d4872b95b65f1878e4174ba62c7367a7ee17035","measurement_metric":"cpu_instruction_count","pair_id":"python_965685579e6a3043be321295","problem_id":"p03297","slow_code_id":"16caa5a428bccd19d9ed72bef4b8aa4ade86e5338a70bd4f7c2fc3002293282c","slow_id":"p03297_c62d289c9b502fe7f9c4c3989d4872b95b65f1878e4174ba62c7367a7ee17035","speedup":5.887511920220108,"stratum":"4-8","sampling_key":"d20259a68951d625650b01ec12411ae5c26d07f585007e52db4cd8802523f367","slow_code":"import sys\n\ninput = sys.stdin.readline\nsys.setrecursionlimit(10**7)\n\n\ndef gcd(a, b):\n if b == 0:\n return a\n else:\n return gcd(b, a % b)\n\n\nimport math\nimport decimal\n\nctx = decimal.Context(prec=1, rounding=decimal.ROUND_CEILING)\nfor i in range(int(eval(input()))):\n a, b, c, d = list(map(int, input().split()))\n if a < b:\n print(\"No\")\n continue\n if b > d:\n print(\"No\")\n continue\n if c >= b:\n print(\"Yes\")\n continue\n g = gcd(b, d)\n r = a % g\n\n _max = (\n (\n int(\n (\n (decimal.Decimal(b, context=ctx) - decimal.Decimal(r, context=ctx))\n / decimal.Decimal(g, context=ctx)\n ).to_integral_exact(context=ctx)\n )\n * g\n )\n + r\n - g\n )\n\n if c < _max:\n print(\"No\")\n else:\n print(\"Yes\")\n","fast_code":"import math\n\nfor _ in range(int(eval(input()))):\n a, b, c, d = list(map(int, input().split()))\n print((\"Yes\" if b <= min(a, d, c + 1 + (a - c - 1) % math.gcd(b, d)) else \"No\"))\n"} +{"fast_code_id":"4e03a4428b1aa0327e66a8cb999ff15a637eaad3acbd2fd2d565e47714f697dd","fast_id":"p02848_28ec796f8eb56af2fabfccd11148299be75fe687af7fbeca1341511e952857a1","language":"python","measured_fast_code_id":"28ec796f8eb56af2fabfccd11148299be75fe687af7fbeca1341511e952857a1","measured_slow_code_id":"2035cd9ee148f20f8214ff8f831f3a3ab5fba163f67d68b8f930abaa365f99ee","measurement_metric":"cpu_instruction_count","pair_id":"python_96aceb06345c8f805a0c6bd3","problem_id":"p02848","slow_code_id":"e34642f16557597f18ad2b4c4499a358ee696a0bcc22331e3fa1500f4c62c66c","slow_id":"p02848_2035cd9ee148f20f8214ff8f831f3a3ab5fba163f67d68b8f930abaa365f99ee","speedup":8.675964661624905,"stratum":"8+","sampling_key":"5cae25d6616353ca6cc0c1f603e22eb9a7621cbfb9e0d42e2d407a7aa667c70e","slow_code":"import sys, re\nfrom collections import deque, defaultdict, Counter\nfrom math import (\n ceil,\n sqrt,\n hypot,\n factorial,\n pi,\n sin,\n cos,\n tan,\n asin,\n acos,\n atan,\n radians,\n degrees,\n log2,\n)\nfrom itertools import (\n accumulate,\n permutations,\n combinations,\n combinations_with_replacement,\n product,\n groupby,\n)\nfrom operator import itemgetter, mul\nfrom copy import deepcopy\nfrom string import ascii_lowercase, ascii_uppercase, digits, ascii_letters\nfrom bisect import bisect, bisect_left\nfrom heapq import heappush, heappop\nfrom functools import reduce\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef INT():\n return int(input())\n\n\ndef MAP():\n return map(int, input().split())\n\n\ndef LIST():\n return list(map(int, input().split()))\n\n\ndef ZIP(n):\n return zip(*(MAP() for _ in range(n)))\n\n\nimport numpy as np\n\nsys.setrecursionlimit(10**9)\nINF = float(\"inf\")\nmod = 10**9 + 7\nN = INT()\nS = input()\nans = [ascii_uppercase[(ascii_uppercase.index(S[i]) + N) % 26] for i in range(len(S))]\n\nprint(*ans, sep=\"\")\n","fast_code":"import sys\nimport math\nimport collections\nimport itertools\nfrom inspect import currentframe\n\nINF = 10**10\nMOD = 10**9 + 7\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef gcd(x, y):\n return y if x % y == 0 else gcd(y, x % y)\n\n\ndef lcm(x, y):\n return (x * y) // gcd(x, y)\n\n\ndef I():\n return int(input())\n\n\ndef MI():\n return map(int, input().split())\n\n\ndef LI():\n return [int(x) for x in input().split()]\n\n\ndef RI(N):\n return [int(input()) for _ in range(N)]\n\n\ndef LRI(N):\n return [[int(x) for x in input().split()] for _ in range(N)]\n\n\ndef chkprint(*args):\n names = {id(v): k for k, v in currentframe().f_back.f_locals.items()}\n print(\", \".join(names.get(id(arg), \"???\") + \" = \" + repr(arg) for arg in args))\n\n\nN = I()\nS = input()\nalp = [\n \"A\",\n \"B\",\n \"C\",\n \"D\",\n \"E\",\n \"F\",\n \"G\",\n \"H\",\n \"I\",\n \"J\",\n \"K\",\n \"L\",\n \"M\",\n \"N\",\n \"O\",\n \"P\",\n \"Q\",\n \"R\",\n \"S\",\n \"T\",\n \"U\",\n \"V\",\n \"W\",\n \"X\",\n \"Y\",\n \"Z\",\n]\nfor s in S:\n print(alp[(alp.index(s) + N) % 26], end=\"\")\n"} +{"fast_code_id":"9f2794678edcb482f2a345f41ff4534b9cf223243bff764df9519fb0f0170b40","fast_id":"p03762_9f2794678edcb482f2a345f41ff4534b9cf223243bff764df9519fb0f0170b40","language":"python","measured_fast_code_id":"9f2794678edcb482f2a345f41ff4534b9cf223243bff764df9519fb0f0170b40","measured_slow_code_id":"982e2a132ff9a9ee086902a77e4d38984ae35b417d1949db3c426a0eec331800","measurement_metric":"cpu_instruction_count","pair_id":"python_96bbcdf65d9d33b03ea6268d","problem_id":"p03762","slow_code_id":"982e2a132ff9a9ee086902a77e4d38984ae35b417d1949db3c426a0eec331800","slow_id":"p03762_982e2a132ff9a9ee086902a77e4d38984ae35b417d1949db3c426a0eec331800","speedup":7.929939357197119,"stratum":"4-8","sampling_key":"a4b160a8f559644436e08bbaf16fd3d994c918dcbea6395f29568ae0c4190d22","slow_code":"import sys\nimport numpy as np\n\nMOD = 10**9 + 7\nI = np.array(sys.stdin.read().split(), dtype=np.int64)\nn, m = I[:2]\nx = I[2 : 2 + n]\ny = I[2 + n :]\n\n\ndef main():\n sx = np.cumsum(x) % MOD\n sy = np.cumsum(y) % MOD\n sdx = (\n np.sum((sx[n - 1] - sx[: n - 1]) - x[: n - 1] * ((n - 1) - np.arange(n - 1)))\n % MOD\n )\n sdy = (\n np.sum((sy[m - 1] - sy[: m - 1]) - y[: m - 1] * ((m - 1) - np.arange(m - 1)))\n % MOD\n )\n ans = sdx * sdy % MOD\n return ans\n\n\nif __name__ == \"__main__\":\n ans = main()\n print(ans)\n","fast_code":"N, M = list(map(int, input().split()))\nX = list(map(int, input().split()))\nY = list(map(int, input().split()))\nmod = 10**9 + 7\nXS = 0\nfor i, x in enumerate(X, start=1):\n XS += (x * ((i - 1) - (N - i))) % mod\nYS = 0\nfor i, y in enumerate(Y, start=1):\n YS += (y * ((i - 1) - (M - i))) % mod\nprint((XS * YS % mod))\n"} +{"fast_code_id":"4090583f6aa869d802e0b783200dcb36cadfe644c804cfc2fc81125201e61d62","fast_id":"p03112_4090583f6aa869d802e0b783200dcb36cadfe644c804cfc2fc81125201e61d62","language":"python","measured_fast_code_id":"4090583f6aa869d802e0b783200dcb36cadfe644c804cfc2fc81125201e61d62","measured_slow_code_id":"48e4fd9d450fd27d87e24629eca915771a72dc68a4f05e0709012344bd4812b8","measurement_metric":"cpu_instruction_count","pair_id":"python_96e60ffa30a7f0050c6c771e","problem_id":"p03112","slow_code_id":"48e4fd9d450fd27d87e24629eca915771a72dc68a4f05e0709012344bd4812b8","slow_id":"p03112_48e4fd9d450fd27d87e24629eca915771a72dc68a4f05e0709012344bd4812b8","speedup":3.671703112528298,"stratum":"2-4","sampling_key":"1b27108d11c942cf995b9941f837a54187ce86945ef35d84eb84ced57d7f99f1","slow_code":"import bisect\nimport sys\n\nA, B, Q = list(map(int, input().split()))\nINF = 10**13\ns = [-INF] + [int(eval(input())) for i in range(A)] + [INF]\nt = [-INF] + [int(eval(input())) for i in range(B)] + [INF]\nfor q in range(Q):\n x = int(sys.stdin.readline())\n b, d = bisect.bisect_right(s, x), bisect.bisect_right(t, x)\n res = INF\n for S in [s[b - 1], s[b]]:\n for T in [t[d - 1], t[d]]:\n d1, d2 = abs(S - x) + abs(T - S), abs(T - x) + abs(S - T)\n res = min(res, d1, d2)\n print(res)\n","fast_code":"from bisect import bisect\n\n\ndef main():\n a, b, q, *stx = list(map(int, open(0).read().split()))\n s = [-1e10] + stx[:a] + [2 * 1e10]\n t = [-1e10] + stx[a : a + b] + [2 * 1e10]\n x = stx[a + b : a + b + q]\n for i in x:\n pos_s = bisect(s, i)\n pos_t = bisect(t, i)\n sl = s[pos_s - 1]\n sr = s[pos_s]\n tl = t[pos_t - 1]\n tr = t[pos_t]\n ans = min(\n i - min(sl, tl),\n max(sr, tr) - i,\n (sr - i) + (sr - tl),\n (tr - i) + (tr - sl),\n (i - sl) + (tr - sl),\n (i - tl) + (sr - tl),\n )\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"8f31da9f181df8d9653ca8231baf892a5417a8ec911591c2e8372961dbc2e140","fast_id":"p03803_8f31da9f181df8d9653ca8231baf892a5417a8ec911591c2e8372961dbc2e140","language":"python","measured_fast_code_id":"8f31da9f181df8d9653ca8231baf892a5417a8ec911591c2e8372961dbc2e140","measured_slow_code_id":"0bd5df2a157ba82c7c25ec618ddd2b8ac3a7b93747b5c4b4114a2cd42e8e257e","measurement_metric":"cpu_instruction_count","pair_id":"python_973d88571fa32663fa4bcc61","problem_id":"p03803","slow_code_id":"0bd5df2a157ba82c7c25ec618ddd2b8ac3a7b93747b5c4b4114a2cd42e8e257e","slow_id":"p03803_0bd5df2a157ba82c7c25ec618ddd2b8ac3a7b93747b5c4b4114a2cd42e8e257e","speedup":3.2015363566536488,"stratum":"2-4","sampling_key":"6ad38122f787c198f3e3fc6fa1f70098e0b4c2d23ba9bcd7d20bf12ec73ce65a","slow_code":"import sys, math\nfrom functools import lru_cache\nfrom itertools import accumulate\n\nsys.setrecursionlimit(10**9)\nMOD = 10**9 + 7\n\n\ndef input():\n return sys.stdin.readline()[:-1]\n\n\ndef mi():\n return list(map(int, input().split()))\n\n\ndef ii():\n return int(eval(input()))\n\n\ndef i2(n):\n tmp = [list(mi()) for i in range(n)]\n return [list(i) for i in zip(*tmp)]\n\n\nA, B = mi()\nif A == B:\n print(\"Draw\")\nelif A == 1:\n print(\"Alice\")\nelif B == 1:\n print(\"Bob\")\nelse:\n if A > B:\n print(\"Alice\")\n else:\n print(\"Bob\")\n","fast_code":"A, B = list(map(int, input().split()))\nif A == 1:\n A = 14\nif B == 1:\n B = 14\nprint((\"Alice\" if A > B else \"Bob\" if A < B else \"Draw\"))\n"} +{"fast_code_id":"f8e20667eb59e2008a82e70c5f95b0003cf9900e3389ec5e527c150421bf8791","fast_id":"p03035_f8e20667eb59e2008a82e70c5f95b0003cf9900e3389ec5e527c150421bf8791","language":"python","measured_fast_code_id":"f8e20667eb59e2008a82e70c5f95b0003cf9900e3389ec5e527c150421bf8791","measured_slow_code_id":"a03feaf840d71ae8aa582d21d70bb7cc8063992d1b30834ae4cabc43c65fc6f6","measurement_metric":"cpu_instruction_count","pair_id":"python_973e529948c60694a54f1616","problem_id":"p03035","slow_code_id":"a03feaf840d71ae8aa582d21d70bb7cc8063992d1b30834ae4cabc43c65fc6f6","slow_id":"p03035_a03feaf840d71ae8aa582d21d70bb7cc8063992d1b30834ae4cabc43c65fc6f6","speedup":3.830539206888149,"stratum":"2-4","sampling_key":"ba3fb9da2b99648735eabb612787f829decef1779a5a9dd4801667afdad65512","slow_code":"import sys, math, collections, heapq, itertools\n\nF = sys.stdin\n\n\ndef single_input():\n return F.readline().strip(\"\\n\")\n\n\ndef line_input():\n return F.readline().strip(\"\\n\").split()\n\n\ndef gcd(a, b):\n a, b = max(a, b), min(a, b)\n while a % b > 0:\n a, b = b, a % b\n return b\n\n\ndef solve():\n A, B = list(map(int, line_input()))\n if A >= 13:\n print(B)\n elif A >= 6:\n print((B // 2))\n else:\n print((0))\n return 0\n\n\nif __name__ == \"__main__\":\n solve()\n","fast_code":"a, b = list(map(int, input().split()))\nprint(((b >> (a < 13)) * (a > 5)))\n"} +{"fast_code_id":"af1c6d1576a1d622453fcc8b60bfc7637ae89576693d4b762b6a08fcd6191a59","fast_id":"p03222_af1c6d1576a1d622453fcc8b60bfc7637ae89576693d4b762b6a08fcd6191a59","language":"python","measured_fast_code_id":"af1c6d1576a1d622453fcc8b60bfc7637ae89576693d4b762b6a08fcd6191a59","measured_slow_code_id":"a167fb2840bdcc6405e113c019a821d25f7acfa038b67804c34bff12a9edb446","measurement_metric":"cpu_instruction_count","pair_id":"python_9746e65a5ff49702bd11f4ca","problem_id":"p03222","slow_code_id":"a167fb2840bdcc6405e113c019a821d25f7acfa038b67804c34bff12a9edb446","slow_id":"p03222_a167fb2840bdcc6405e113c019a821d25f7acfa038b67804c34bff12a9edb446","speedup":173.44455359341893,"stratum":"8+","sampling_key":"211d9a96fb2d594682cc5354a300498c1ca14fec1dcc40bf281c41e56bea625f","slow_code":"import sys\n\nmod = pow(10, 9) + 7\n\n\ndef mul(a, b):\n return ((a % mod) * (b % mod)) % mod\n\n\ndef cmb(n, r, mod):\n if r < 0 or r > n:\n return 0\n r = min(r, n - r)\n return g1[n] * g2[r] * g2[n - r] % mod\n\n\nNNN = (10**5) * 2\ng1 = [1, 1]\ng2 = [1, 1]\ninverse = [0, 1]\nfor i in range(2, NNN + 1):\n g1.append((g1[-1] * i) % mod)\n inverse.append((-inverse[mod % i] * (mod // i)) % mod)\n g2.append((g2[-1] * inverse[-1]) % mod)\n\n\ndef erabu(aW):\n r = 0\n for i in range(aW // 2 + 1 + 1):\n sp = aW - (2 * i - 1)\n r += cmb(sp + i + 1 - 1, sp, mod)\n return r\n\n\nN, W, K = [int(x) for x in input().strip().split(\" \")]\nhasi = 0\ncc = []\nif W == 1:\n if K == 1:\n print((1))\n else:\n print((0))\n sys.exit()\nelif W == 2:\n cccl = [1, 1]\n cc = [1, 1]\nelif W == 3:\n cccl = [1, 1, 1]\n cc = [2, 1, 2]\nelif W >= 4:\n aW = W - 1\n hW = aW - 2\n nhW = aW - 3\n cc = []\n cccl = []\n for w in range(W):\n nn = max(W - 1 - w - 1, 0)\n nnn = max((W - 1) - nn - 2, 0)\n if w == W - 1:\n nnn += 1\n cc.append(erabu(nn) * erabu(nnn))\n cccl.append(erabu(nn) * erabu(nnn - 1))\ncccl[0] = 0\ncccr = cccl[::-1]\nd = [1] + [0 for x in range(W - 1)]\nfor i in range(N):\n newd = []\n for j in range(W):\n newd.append(0)\n if j != 0:\n newd[j] = (newd[j] + (d[j - 1] * cccl[j])) % mod\n if j != W - 1:\n newd[j] = (newd[j] + (d[j + 1] * cccr[j])) % mod\n newd[j] = (newd[j] + (d[j] * cc[j])) % mod\n d = newd[:]\nprint((d[K - 1]))\n","fast_code":"H, W, K = [int(_) for _ in input().split()]\nMOD = 1000000007\nP = [\"\"]\nfor i in range(W - 1):\n Q = []\n for p in P:\n Q.append(p + \"0\")\n if len(p) == 0 or p[-1] == \"0\":\n Q.append(p + \"1\")\n P = Q\nrs = [1] + [0] * (W - 1)\nfor j in range(H):\n nrs = [0] * W\n for p in P:\n drs = rs[:]\n for i, c in enumerate(p):\n if c == \"1\":\n drs[i], drs[i + 1] = drs[i + 1], drs[i]\n for i in range(W):\n nrs[i] = (nrs[i] + drs[i]) % MOD\n rs = nrs\nprint((rs[K - 1]))\n"} +{"fast_code_id":"df8648745f9f12663f3429f2366c68af7f779e4cc12d5e9a141be93c1733a40e","fast_id":"p02890_18f84a0298d8af8466ef1ae9becf5f6d3c11c42135ba0a6e6d8d9d839fe18a64","language":"python","measured_fast_code_id":"18f84a0298d8af8466ef1ae9becf5f6d3c11c42135ba0a6e6d8d9d839fe18a64","measured_slow_code_id":"683b16708a4919fe826584e325a20783d2265d979233683a19a27263211ea906","measurement_metric":"cpu_instruction_count","pair_id":"python_9750fd4a5dd951aaabf326e1","problem_id":"p02890","slow_code_id":"2c57f5c3d6e04ae779c203c63a7a33316889e85db23460b3b699e27933e99fbd","slow_id":"p02890_683b16708a4919fe826584e325a20783d2265d979233683a19a27263211ea906","speedup":3.051364173834406,"stratum":"2-4","sampling_key":"14741df092400dc6408f27581370335431fa55b2bb3663dc1359d383329c0b77","slow_code":"import sys\nimport math\nfrom bisect import bisect_right as br\nfrom bisect import bisect_left as bl\n\nsys.setrecursionlimit(2147483647)\nfrom heapq import heappush, heappop, heappushpop\nfrom collections import defaultdict\nfrom itertools import accumulate\nfrom collections import Counter\nfrom collections import deque\nfrom operator import itemgetter\nfrom itertools import permutations\n\nmod = 10**9 + 7\ninf = float(\"inf\")\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\nn = I()\na = LI()\ncnt = list(Counter(a).values())\ncnt.sort()\nm = len(cnt)\nS = [0] * (n + 1)\nfor x in range(1, n + 1):\n l = bl(cnt, x)\n S[x] = S[x - 1] + (m - l)\nfor k in range(1, n + 1):\n high, low = n + 1, 0\n while high - low > 1:\n mid = (high + low) // 2\n if S[mid] >= k * mid:\n low = mid\n else:\n high = mid\n print(low)\n","fast_code":"import sys\n\nsys.setrecursionlimit(2147483647)\nINF = float(\"inf\")\nMOD = 10**9 + 7\ninput = lambda: sys.stdin.readline().rstrip()\n\n\ndef bin_sort(A, n_min=None, n_max=None):\n if n_min is None:\n n_min = min(A)\n if n_max is None:\n n_max = max(A)\n bin = [0] * (n_max - n_min + 1)\n for a in A:\n bin[a - n_min] += 1\n B = []\n for i in range(n_min, n_max + 1):\n B.extend([i] * bin[i - n_min])\n return B\n\n\ndef resolve():\n n = int(eval(input()))\n A = [0] * n\n for a in map(int, input().split()):\n A[a - 1] += 1\n A = bin_sort(A, 0, n)\n S = [0] * (n + 1)\n for i in range(n):\n S[i + 1] = S[i] + A[i]\n\n p = n\n i = n\n for k in range(1, n + 1):\n while 1:\n while 1:\n if i <= 0 or A[i - 1] < p:\n break\n i -= 1\n if S[i] + p * (n - i) >= k * p:\n break\n p -= 1\n print(p)\n\n\nresolve()\n"} +{"fast_code_id":"096b89a8a76eb58d2ef19de5f5d0086035ff0c6e9b7acaf74a4349ddcd17ff35","fast_id":"p03292_096b89a8a76eb58d2ef19de5f5d0086035ff0c6e9b7acaf74a4349ddcd17ff35","language":"python","measured_fast_code_id":"096b89a8a76eb58d2ef19de5f5d0086035ff0c6e9b7acaf74a4349ddcd17ff35","measured_slow_code_id":"f60b0a699a2d92dfcbb5b26a370092e660bc85afffa65c600089419b521caefb","measurement_metric":"cpu_instruction_count","pair_id":"python_97c21a711bd44344ce9714f8","problem_id":"p03292","slow_code_id":"f60b0a699a2d92dfcbb5b26a370092e660bc85afffa65c600089419b521caefb","slow_id":"p03292_f60b0a699a2d92dfcbb5b26a370092e660bc85afffa65c600089419b521caefb","speedup":3.0194443633610546,"stratum":"2-4","sampling_key":"5d0f5f5da1677320ba1336e48da4d188783123a43452bbba73398585f592aaf3","slow_code":"a, b, c = list(map(int, input().split()))\nans = 9999\nans = min(ans, abs(a - b) + abs(b - c), abs(a - c) + abs(c - b))\nans = min(ans, abs(b - a) + abs(a - c), abs(b - c) + abs(c - a))\nans = min(ans, abs(c - a) + abs(a - b), abs(c - b) + abs(b - a))\nprint(ans)\n","fast_code":"(*a,) = list(map(int, input().split()))\nprint((max(a) - min(a)))\n"} +{"fast_code_id":"fb44bd736f114d04ccb1eb63d74ee7770c1991b1ef5dfc225135ed90cc16cf8e","fast_id":"p02792_fb44bd736f114d04ccb1eb63d74ee7770c1991b1ef5dfc225135ed90cc16cf8e","language":"python","measured_fast_code_id":"fb44bd736f114d04ccb1eb63d74ee7770c1991b1ef5dfc225135ed90cc16cf8e","measured_slow_code_id":"f73eb8ce29329be2d260f2fe98deb52d223d31a41330fd4e68317289bd9067d9","measurement_metric":"cpu_instruction_count","pair_id":"python_97e07002d147fbce5fc51dcb","problem_id":"p02792","slow_code_id":"f73eb8ce29329be2d260f2fe98deb52d223d31a41330fd4e68317289bd9067d9","slow_id":"p02792_f73eb8ce29329be2d260f2fe98deb52d223d31a41330fd4e68317289bd9067d9","speedup":4.233526993259363,"stratum":"4-8","sampling_key":"23e3ce56163c61b4bf3fe7620ac9f0aab53e132133b62382abff7ac30ebe1216","slow_code":"N = int(eval(input()))\n\n\ndef cnt(i, j):\n ret = 0\n si = str(i)\n for n in range(1, N + 1):\n if n % 10 != j:\n continue\n if str(n)[0] != si:\n continue\n ret += 1\n return ret\n\n\nans = 0\nfor i in range(10):\n for j in range(10):\n ans += cnt(i, j) * cnt(j, i)\nprint(ans)\n","fast_code":"n = int(eval(input()))\nans = 0\nfor i in range(1, n + 1):\n a = str(i)[0]\n b = str(i)[-1]\n for digit in range(1, 7):\n if digit == 1:\n if a == b:\n ans += 1\n elif b != \"0\":\n mn = int(b + \"0\" * (digit - 2) + a)\n mx = int(b + \"9\" * (digit - 2) + a)\n if mn > n:\n break\n if mx <= n:\n ans += 10 ** (digit - 2)\n else:\n ns = str(n)\n for j in range(1, len(ns) - 1):\n ans += int(ns[j]) * 10 ** (max(digit - 2 - j, 0))\n if ns[-1] >= a:\n ans += 1\n break\nprint(ans)\n"} +{"fast_code_id":"59bab4d76458b9d52141aa25422a631231c9e446195a30b427396f9e6de3c8eb","fast_id":"p02361_59bab4d76458b9d52141aa25422a631231c9e446195a30b427396f9e6de3c8eb","language":"python","measured_fast_code_id":"59bab4d76458b9d52141aa25422a631231c9e446195a30b427396f9e6de3c8eb","measured_slow_code_id":"a48d0b96003d389be54b84ff869a67e52827774163e88aa4dae4f6c2782d1681","measurement_metric":"cpu_instruction_count","pair_id":"python_97ebbc76fb831d88dbc2c069","problem_id":"p02361","slow_code_id":"a48d0b96003d389be54b84ff869a67e52827774163e88aa4dae4f6c2782d1681","slow_id":"p02361_a48d0b96003d389be54b84ff869a67e52827774163e88aa4dae4f6c2782d1681","speedup":2.069476614648539,"stratum":"2-4","sampling_key":"2a175a604ea7992964a8923178185bd339eed71ff6906b0746e89f828ec6e8f6","slow_code":"import sys\nimport queue\n\n\nclass Dijkstra:\n class Edge:\n def __init__(self, end, cost):\n self.to = end\n self.cost = cost\n\n def __init__(self, node_size, inf):\n self._node = node_size\n self._graph = [[] for _ in range(self._node)]\n self.inf = inf\n self.dist = [self.inf for _ in range(self._node)]\n\n def add_edge(self, st, ed, cs):\n self._graph[st].append(self.Edge(ed, cs))\n\n def solve(self, start):\n que = queue.PriorityQueue()\n self.dist[start] = 0\n que.put((0, start))\n while not que.empty():\n cur_cost, cur_vertex = que.get()\n if self.dist[cur_vertex] < cur_cost:\n continue\n for e in self._graph[cur_vertex]:\n if self.dist[e.to] > cur_cost + e.cost:\n self.dist[e.to] = cur_cost + e.cost\n que.put((self.dist[e.to], e.to))\n\n\nif __name__ == \"__main__\":\n V, E, r = list(map(int, sys.stdin.readline().split()))\n dk = Dijkstra(V, 10**10)\n for i in range(E):\n s, t, d = list(map(int, sys.stdin.readline().split()))\n dk.add_edge(s, t, d)\n dk.solve(r)\n for value in dk.dist:\n if value == dk.inf:\n print(\"INF\")\n else:\n print(value)\n","fast_code":"import sys\nfrom heapq import heappush, heappop\n\nreadline = sys.stdin.readline\nV, E, r = list(map(int, readline().split()))\ninf = 10**10\nedges = [[] for _ in [None] * V]\nvertices = [inf] * V\nvertices[r] = 0\nfor _ in [None] * E:\n s, t, d = list(map(int, readline().split()))\n edges[s].append((t, d))\nq = [(0, r)]\nrem = V - 1\nwhile q and rem:\n cost, v = heappop(q)\n if vertices[v] < cost:\n continue\n rem -= 1\n for dest, _cost in edges[v]:\n newcost = cost + _cost\n if vertices[dest] > newcost:\n vertices[dest] = newcost\n heappush(q, (newcost, dest))\nprint((\"\\n\".join([str(n) if n != inf else \"INF\" for n in vertices])))\n"} +{"fast_code_id":"35dec6fc5770cf4d7b9621f258b5fe80dc7a1beb9ce612bddcc28ef1a07df64c","fast_id":"p03013_caafad57c12dd7f73a70c01e6f3a04d5e61c35d2f6f40fac4b9d85d515329111","language":"python","measured_fast_code_id":"caafad57c12dd7f73a70c01e6f3a04d5e61c35d2f6f40fac4b9d85d515329111","measured_slow_code_id":"fba7fd4fd7bcce245b2548eedc3c4dabf2df48bfb1eeabc7085ab383a30059bf","measurement_metric":"cpu_instruction_count","pair_id":"python_97f3afac99ca3e5be2fd4ff5","problem_id":"p03013","slow_code_id":"fba7fd4fd7bcce245b2548eedc3c4dabf2df48bfb1eeabc7085ab383a30059bf","slow_id":"p03013_fba7fd4fd7bcce245b2548eedc3c4dabf2df48bfb1eeabc7085ab383a30059bf","speedup":4.916353833651196,"stratum":"4-8","sampling_key":"2b77dc82806a3fdcc3110a0e58baa2d9fb3f5880f969f3ca36cec056f9e0a8e7","slow_code":"from collections import deque\n\nn, m = list(map(int, input().split()))\nA = {int(eval(input())) for _ in range(m)}\nL = deque([1, 1])\nif 1 in A:\n L[1] = 0\nfor i in range(2, n + 1):\n if i in A:\n L.append(0)\n else:\n L.append(L[i - 2] + L[i - 1])\nprint((L[n] % (10**9 + 7)))\n","fast_code":"import sys\n\nN, M = list(map(int, input().split()))\nif M == 0:\n alist = set()\nelse:\n\n alist = set(map(int, sys.stdin))\ndp = [0] * (N + 1)\ndp[0] = 1\ndp[1] = 1 if 1 not in alist else 0\nMOD = 10**9 + 7\nfor i in range(2, N + 1):\n if i in alist:\n continue\n dp[i] = (dp[i - 1] + dp[i - 2]) % MOD\nprint((dp[N]))\n"} +{"fast_code_id":"120ded1335fc64b5d45dde432ae51c8ad77f47d621444f65338fe228101bc7cb","fast_id":"p02793_0fb8de2044d9ab011287ebdaf60c0dfff0bce57f6c42c2805afb2a1ac199ebcc","language":"python","measured_fast_code_id":"0fb8de2044d9ab011287ebdaf60c0dfff0bce57f6c42c2805afb2a1ac199ebcc","measured_slow_code_id":"66d145443a372a5a43407dc9cf71d71447bec89f203c9422197e66c8dd97343d","measurement_metric":"cpu_instruction_count","pair_id":"python_9842462b66894ec95813dfbf","problem_id":"p02793","slow_code_id":"66d145443a372a5a43407dc9cf71d71447bec89f203c9422197e66c8dd97343d","slow_id":"p02793_66d145443a372a5a43407dc9cf71d71447bec89f203c9422197e66c8dd97343d","speedup":7.780264110697636,"stratum":"4-8","sampling_key":"03ba9e1c5b59b72d0e41fc85e53eb4b9032ff649435cf2a55ce605c3d8472743","slow_code":"class PrimeOptimizer:\n def __init__(self, MAX_NUM=10**3):\n is_prime = [True] * MAX_NUM\n is_prime[0] = False\n is_prime[1] = False\n primes = []\n for i in range(MAX_NUM):\n if is_prime[i]:\n primes.append(i)\n for j in range(2 * i, MAX_NUM, i):\n is_prime[j] = False\n self.primes = primes\n\n def prime_factorization(self, x):\n res = {}\n for prime in self.primes:\n while x % prime == 0:\n if not prime in res:\n res[prime] = 0\n res[prime] += 1\n x //= prime\n if x > 1:\n res[x] = 1\n return res\n\n\nMOD = 10**9 + 7\n\n\ndef mod_pow(p, q):\n res = 1\n while q:\n if q & 1:\n res = (res * p) % MOD\n p = (p * p) % MOD\n q //= 2\n return res\n\n\ndef mod_inv(p):\n return mod_pow(p, MOD - 2)\n\n\ndef solve(n, a):\n primeOpt = PrimeOptimizer()\n D = {}\n for i in range(n):\n prime_num_mapping = primeOpt.prime_factorization(a[i])\n for prime, num in list(prime_num_mapping.items()):\n if not prime in D:\n D[prime] = 0\n D[prime] = max(D[prime], num)\n L = 1\n for prime, num in list(D.items()):\n L = (L * mod_pow(prime, num)) % MOD\n res = sum([L * mod_inv(x) % MOD for x in a])\n return res % MOD\n\n\nN = int(eval(input()))\nA = list(map(int, input().split()))\nprint((solve(N, A)))\n","fast_code":"import sys\n\ninput = sys.stdin.readline\nsys.setrecursionlimit(10**7)\nn = int(eval(input()))\na = list(map(int, input().split()))\nMOD = 10**9 + 7\nlcm = 1\n\n\nimport math\n\nfor v in a:\n lcm = (lcm // math.gcd(lcm, v)) * v\nans = 0\nfor v in a:\n ans = ans + (lcm // v)\n\nprint((ans % MOD))\n"} +{"fast_code_id":"50ab91c4c0c0068715690c125df31cb262652d04cfb2311aeba2c6d2e9a558be","fast_id":"p03291_50ab91c4c0c0068715690c125df31cb262652d04cfb2311aeba2c6d2e9a558be","language":"python","measured_fast_code_id":"50ab91c4c0c0068715690c125df31cb262652d04cfb2311aeba2c6d2e9a558be","measured_slow_code_id":"d64c264e5368f29c687af8158e3b733bec94dc390763e9ea00c167fb81f53e6e","measurement_metric":"cpu_instruction_count","pair_id":"python_9865002db1ca953abea339a2","problem_id":"p03291","slow_code_id":"893aa769d75c0f68c1d1f6bae5efa68305f4fe10177fa385d3123d97c041f274","slow_id":"p03291_d64c264e5368f29c687af8158e3b733bec94dc390763e9ea00c167fb81f53e6e","speedup":3.598458317349052,"stratum":"2-4","sampling_key":"3aa9e588275d6c2ccffb09dbd9932986e02f2dee6d24af501e1bb53b726c4a15","slow_code":"import sys\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef list2d(a, b, c):\n return [[c] * b for i in range(a)]\n\n\ndef list3d(a, b, c, d):\n return [[[d] * c for j in range(b)] for i in range(a)]\n\n\ndef list4d(a, b, c, d, e):\n return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]\n\n\ndef ceil(x, y=1):\n return int(-(-x // y))\n\n\ndef INT():\n return int(input())\n\n\ndef MAP():\n return map(int, input().split())\n\n\ndef LIST(N=None):\n return list(MAP()) if N is None else [INT() for i in range(N)]\n\n\ndef Yes():\n print(\"Yes\")\n\n\ndef No():\n print(\"No\")\n\n\ndef YES():\n print(\"YES\")\n\n\ndef NO():\n print(\"NO\")\n\n\nsys.setrecursionlimit(10**9)\nINF = 10**18\nMOD = 10**9 + 7\nS = input()\nN = len(S)\n\ndp = list2d(N + 1, 4, 0)\ndp[0][0] = 1\nfor i in range(N):\n s = S[i]\n for j in range(4):\n\n if s == \"?\":\n\n dp[i + 1][j] += dp[i][j] * 3\n dp[i + 1][j] %= MOD\n else:\n dp[i + 1][j] += dp[i][j]\n dp[i + 1][j] %= MOD\n\n if j < 3:\n\n if (\n s == \"?\"\n or s == \"A\"\n and j == 0\n or s == \"B\"\n and j == 1\n or s == \"C\"\n and j == 2\n ):\n dp[i + 1][j + 1] += dp[i][j]\n dp[i + 1][j + 1] %= MOD\n\nprint(dp[N][3])\n","fast_code":"s = input().rstrip()\ndp = [0] * 4\ndp[0] = 1\nfor i in range(len(s)):\n if s[i] == \"A\":\n dp[1] += dp[0]\n elif s[i] == \"B\":\n dp[2] += dp[1]\n elif s[i] == \"C\":\n dp[3] += dp[2]\n else:\n dp = [dp[0] * 3, dp[1] * 3 + dp[0], dp[2] * 3 + dp[1], dp[3] * 3 + dp[2]]\n dp = list([x % (10**9 + 7) for x in dp])\nprint((dp[3]))\n"} +{"fast_code_id":"a2624425a9b93e6559ac62ba782b26bed674b805c5d6c4a13b00b3b9cc35d295","fast_id":"p03170_a2624425a9b93e6559ac62ba782b26bed674b805c5d6c4a13b00b3b9cc35d295","language":"python","measured_fast_code_id":"a2624425a9b93e6559ac62ba782b26bed674b805c5d6c4a13b00b3b9cc35d295","measured_slow_code_id":"c085b7a6374193711652498cebb1aaf3bcd497df96941cabfee675a4f16a9afe","measurement_metric":"cpu_instruction_count","pair_id":"python_98cc96ef2fdc4d542deb4e67","problem_id":"p03170","slow_code_id":"c085b7a6374193711652498cebb1aaf3bcd497df96941cabfee675a4f16a9afe","slow_id":"p03170_c085b7a6374193711652498cebb1aaf3bcd497df96941cabfee675a4f16a9afe","speedup":22.525635568528827,"stratum":"8+","sampling_key":"031e24b9f86f116a35679f4a8a1454e596f6ac34df47cbad47461ca06cba6978","slow_code":"N, K = list(map(int, input().split()))\na = list(map(int, input().split()))\ndp = [0] * (K + 1)\nfor i in range(1, K + 1):\n for j in a:\n if i - j >= 0 and dp[i - j] == 0:\n dp[i] = 1\nprint((\"First\" if dp[K] else \"Second\"))\n","fast_code":"def main():\n N, K, *A = list(map(int, open(0).read().split()))\n dp = [0] * (K + 1)\n for i in range(K):\n if dp[i]:\n continue\n for a in A:\n if i + a > K:\n break\n dp[i + a] = 1\n print((\"First\" if dp[-1] else \"Second\"))\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"fcdc55e3c364d8dcff410f85b0164f59ff398cb55eee7e78666ef1081be9b112","fast_id":"p02922_fcdc55e3c364d8dcff410f85b0164f59ff398cb55eee7e78666ef1081be9b112","language":"python","measured_fast_code_id":"fcdc55e3c364d8dcff410f85b0164f59ff398cb55eee7e78666ef1081be9b112","measured_slow_code_id":"8b569fc1e16981f8320c705cea748e4c69f345af35a77c5db73eb42d1431aac6","measurement_metric":"cpu_instruction_count","pair_id":"python_98cd48d1d16d48deaac6c430","problem_id":"p02922","slow_code_id":"d125558241ae3c64a726d724586fb5061b0b0d9b36349b79174daa959a5a79c4","slow_id":"p02922_8b569fc1e16981f8320c705cea748e4c69f345af35a77c5db73eb42d1431aac6","speedup":79.42113019628722,"stratum":"8+","sampling_key":"0578421cfd882eb3759326f59e289fb6e351421ff5fc7a5a39d369e27a7d8f08","slow_code":"import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, queue, copy\n\nsys.setrecursionlimit(10**7)\ninf = 10**20\nmod = 10**9 + 7\ndd = [(-1, 0), (0, 1), (1, 0), (0, -1)]\nddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef LI_():\n return [int(x) - 1 for x in sys.stdin.readline().split()]\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LS():\n return sys.stdin.readline().split()\n\n\ndef S():\n return eval(input())\n\n\ndef main():\n a, b = LI()\n c = 1\n ans = 0\n while True:\n if c >= b:\n return ans\n ans += 1\n c -= 1\n c += a\n\n\nprint((main()))\n","fast_code":"import math\n\na, b = list(map(int, input().split()))\nprint((math.ceil((b - 1) / (a - 1))))\n"} +{"fast_code_id":"bf2b25d30147294ff0276ceb1faeae7b06783207fa7b8ca256752e56cdee77d1","fast_id":"p02612_bf2b25d30147294ff0276ceb1faeae7b06783207fa7b8ca256752e56cdee77d1","language":"python","measured_fast_code_id":"bf2b25d30147294ff0276ceb1faeae7b06783207fa7b8ca256752e56cdee77d1","measured_slow_code_id":"93e590a19c921767e21882d7b228be2019ad9fb9efcb3153b4a1639c8ba04b3c","measurement_metric":"cpu_instruction_count","pair_id":"python_98e02d504aa06f9032d72316","problem_id":"p02612","slow_code_id":"93e590a19c921767e21882d7b228be2019ad9fb9efcb3153b4a1639c8ba04b3c","slow_id":"p02612_93e590a19c921767e21882d7b228be2019ad9fb9efcb3153b4a1639c8ba04b3c","speedup":2.4168622239899658,"stratum":"2-4","sampling_key":"6ebb058a122d49d6e2ea2fcf178717fa0deba4e94c97632bf73dd58556030a78","slow_code":"N = int(eval(input()))\nB = N // 1000\nif N <= 1000:\n print((1000 - N))\nelif N % 1000 == 0:\n print((0))\nelif N > 1000:\n print((((B + 1) * 1000) - N))\n","fast_code":"print((-int(eval(input())) % 1000))\n"} +{"fast_code_id":"6074ba0c982fad312b2df046a843d0a175b8e58f995ed0ecc5dc4de0110c1ff0","fast_id":"p03997_6074ba0c982fad312b2df046a843d0a175b8e58f995ed0ecc5dc4de0110c1ff0","language":"python","measured_fast_code_id":"6074ba0c982fad312b2df046a843d0a175b8e58f995ed0ecc5dc4de0110c1ff0","measured_slow_code_id":"89a2c802763da09caab2310090bce1a3bd8e29ef5b06b86a35dfdaa7e9205bfe","measurement_metric":"cpu_instruction_count","pair_id":"python_98e834dcdc032fd2b8eb438f","problem_id":"p03997","slow_code_id":"b35e7a11385fd8d3cfedbd5906973a53bac70684dd98a901c660194c6fcfc1db","slow_id":"p03997_89a2c802763da09caab2310090bce1a3bd8e29ef5b06b86a35dfdaa7e9205bfe","speedup":16.15888093924342,"stratum":"8+","sampling_key":"0722c94176b8091f217687071a3701ed6db169c32af34254a3c997fb5628f37d","slow_code":"from collections import deque\nfrom heapq import heapify, heappop, heappush, heappushpop\nfrom copy import copy, deepcopy\nfrom itertools import product, permutations, combinations, combinations_with_replacement\nfrom collections import defaultdict, Counter\nfrom bisect import bisect_left, bisect_right\n\n\nfrom functools import reduce\nfrom pprint import pprint\n\nINF = float(\"inf\")\n\n\ndef myinput():\n return list(map(int, input().split()))\n\n\ndef mylistinput(n):\n return [list(myinput()) for _ in range(n)]\n\n\ndef mycol(data, col):\n return [row[col] for row in data]\n\n\ndef mysort(data, col, reverse_flag):\n data.sort(key=lambda x: x[col], reverse=reverse_flag)\n return data\n\n\ndef mymax(data):\n M = -1 * float(\"inf\")\n for i in range(len(data)):\n m = max(data[i])\n M = max(M, m)\n return M\n\n\ndef mymin(data):\n m = float(\"inf\")\n for i in range(len(data)):\n M = min(data[i])\n m = min(m, M)\n return m\n\n\ndef mycount(ls, x):\n\n l = bisect_left(ls, x)\n r = bisect_right(ls, x)\n return r - l\n\n\ndef myoutput(ls, space=True):\n if space:\n if len(ls) == 0:\n print(\" \")\n elif type(ls[0]) == str:\n print((\" \".join(ls)))\n elif type(ls[0]) == int:\n print((\" \".join(map(str, ls))))\n else:\n print(\"Output Error\")\n else:\n if len(ls) == 0:\n print(\"\")\n elif type(ls[0]) == str:\n print((\"\".join(ls)))\n elif type(ls[0]) == int:\n print((\"\".join(map(str, ls))))\n else:\n print(\"Output Error\")\n\n\na = int(eval(input()))\nb = int(eval(input()))\nh = int(eval(input()))\nans = (a + b) * h / 2\nprint((int(ans)))\n","fast_code":"a, b, h = list(map(int, [eval(input()) for i in range(3)]))\nprint((h * (a + b) // 2))\n"} +{"fast_code_id":"577b4ea967359c1669928f248bb452ad9c2b25326a52b9d964878a21cdf42c4d","fast_id":"p03455_577b4ea967359c1669928f248bb452ad9c2b25326a52b9d964878a21cdf42c4d","language":"python","measured_fast_code_id":"577b4ea967359c1669928f248bb452ad9c2b25326a52b9d964878a21cdf42c4d","measured_slow_code_id":"1e58957cce6049d366f3189df1c6244aa3226734d9f71da11d6221cbf487aae2","measurement_metric":"cpu_instruction_count","pair_id":"python_98e8b1b2dda9e56591fce0a5","problem_id":"p03455","slow_code_id":"1e58957cce6049d366f3189df1c6244aa3226734d9f71da11d6221cbf487aae2","slow_id":"p03455_1e58957cce6049d366f3189df1c6244aa3226734d9f71da11d6221cbf487aae2","speedup":2.905216221786339,"stratum":"2-4","sampling_key":"c9e0646e2c87efb0bc3e54a788c6212d08ea12a1d97f48d3179b95fc752984f6","slow_code":"def ketanowa(p):\n ans = 0\n p = str(p)\n for i in p:\n ans += int(i)\n return ans\n\n\ndef main():\n temp = input().split(\" \")\n n = int(temp[0])\n a = int(temp[1])\n if n * a % 2 == 0:\n print(\"Even\")\n else:\n print(\"Odd\")\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"print((\"EOvdedn\"[eval(input().replace(\" \", \"*\")) % 2 :: 2]))\n"} +{"fast_code_id":"3e6d626ab547675c3b341d29edcadee93969941923bd6eda1ba7144ea2b5a1d3","fast_id":"p02688_3e6d626ab547675c3b341d29edcadee93969941923bd6eda1ba7144ea2b5a1d3","language":"python","measured_fast_code_id":"3e6d626ab547675c3b341d29edcadee93969941923bd6eda1ba7144ea2b5a1d3","measured_slow_code_id":"ee132a61c85b4e63a0153747cf5ebdecf3c684ad39621a40abb5c6d7e02f1c89","measurement_metric":"cpu_instruction_count","pair_id":"python_99040ea3997db2e3d313ead6","problem_id":"p02688","slow_code_id":"ee132a61c85b4e63a0153747cf5ebdecf3c684ad39621a40abb5c6d7e02f1c89","slow_id":"p02688_ee132a61c85b4e63a0153747cf5ebdecf3c684ad39621a40abb5c6d7e02f1c89","speedup":2.6843284831410497,"stratum":"2-4","sampling_key":"a8e02ca3e20ba1b6d3a06eb377fc2861dfee0d35ff33be241b6bb3a3ca8a47ad","slow_code":"N, K = list(map(int, input().split()))\nd = []\nA = []\nfor _ in range(K):\n d.append(int(eval(input())))\n A.append(list(map(int, input().split())))\ncnt = {}\nfor i in range(N):\n cnt.setdefault(str(i + 1), 0)\nfor Ai in A:\n for Aij in Ai:\n cnt[str(Aij)] += 1\nans = 0\nfor key, val in list(cnt.items()):\n if val == 0:\n ans += 1\nprint(ans)\n","fast_code":"R = lambda: list(map(int, input().split()))\nn, k = R()\ns = set()\nfor _ in range(k):\n R()\n s.update(R())\nprint((n - len(s)))\n"} +{"fast_code_id":"327c47eed7c39c83e5d0648140e597c5234b1072e6b80625d65d70883523a061","fast_id":"p02669_327c47eed7c39c83e5d0648140e597c5234b1072e6b80625d65d70883523a061","language":"python","measured_fast_code_id":"327c47eed7c39c83e5d0648140e597c5234b1072e6b80625d65d70883523a061","measured_slow_code_id":"5dc16e69171829fb825a4382d7ae818d1f78cf50ef12255ba28fcf6c6591e0e1","measurement_metric":"cpu_instruction_count","pair_id":"python_9906fc0b23d8fe9c586d774d","problem_id":"p02669","slow_code_id":"ca3505b4e5755f2e5a6dda25d2ba0ee1f8926fae7d5ee6e43c499cad98b2e89b","slow_id":"p02669_5dc16e69171829fb825a4382d7ae818d1f78cf50ef12255ba28fcf6c6591e0e1","speedup":6.8812668641758865,"stratum":"4-8","sampling_key":"7bc702d27adc75e6053556e25caea9ae9ab74d2ff394ffe4833a5598ab6ebe4a","slow_code":"import sys\n\ndivs = [2, 3, 5]\nt = int(eval(input()))\nfor _ in range(t):\n n, a, b, c, d = list(map(int, input().split()))\n costs = [a, b, c]\n dp = {}\n\n def dfs(x):\n if x in dp:\n return dp[x]\n\n if x == 0:\n dp[x] = 0\n return dp[x]\n ret = x * d\n for i in range(-4, 5):\n if x - i < 0:\n continue\n nx = x - i\n for cost, div in zip(costs, divs):\n if nx % div != 0 or nx // div >= x:\n continue\n ret = min(ret, dfs(nx // div) + cost + abs(i) * d)\n dp[x] = ret\n return ret\n\n print((dfs(n)))\n","fast_code":"import sys\n\nsys.setrecursionlimit(10**8)\nT = int(eval(input()))\n\n\ndef solve(N):\n if N == 0:\n return 0\n if N == 1:\n return D\n if N in dic:\n return dic[N]\n tmp = N * D\n if N % 2 == 0:\n tmp = min(tmp, solve(N // 2) + A)\n else:\n tmp = min(tmp, solve((N - 1) // 2) + A + D, solve((N + 1) // 2) + A + D)\n if N % 3 == 0:\n tmp = min(tmp, solve(N // 3) + B)\n else:\n b = N % 3\n tmp = min(\n tmp,\n solve((N + (3 - b)) // 3) + B + (3 - b) * D,\n solve((N - b) // 3) + B + b * D,\n )\n if N % 5 == 0:\n tmp = min(tmp, solve(N // 5) + C)\n else:\n c = N % 5\n tmp = min(\n tmp,\n solve((N - c) // 5) + C + D * c,\n solve((N + (5 - c)) // 5) + C + D * (5 - c),\n )\n dic[N] = tmp\n return tmp\n\n\nfor _ in range(T):\n N, A, B, C, D = list(map(int, input().split()))\n dic = {}\n print((solve(N)))\n"} +{"fast_code_id":"837995072643501db9343ab30259ab1cbf9b990af19306bf6adac9edb52ade3a","fast_id":"p02732_837995072643501db9343ab30259ab1cbf9b990af19306bf6adac9edb52ade3a","language":"python","measured_fast_code_id":"837995072643501db9343ab30259ab1cbf9b990af19306bf6adac9edb52ade3a","measured_slow_code_id":"715c50a0bd5503a1c5a8f5900a3590d1b55c78b7a98e77c948ef59c2a023b3ea","measurement_metric":"cpu_instruction_count","pair_id":"python_9913d5c04d2ec3218b1a9f82","problem_id":"p02732","slow_code_id":"715c50a0bd5503a1c5a8f5900a3590d1b55c78b7a98e77c948ef59c2a023b3ea","slow_id":"p02732_715c50a0bd5503a1c5a8f5900a3590d1b55c78b7a98e77c948ef59c2a023b3ea","speedup":3.5495315528785705,"stratum":"2-4","sampling_key":"272a9ee80d48c120c61995f75b5280da7fcba0a631041186579f482262b22e95","slow_code":"from functools import reduce\n\n\ndef d_banned_k():\n from collections import Counter\n from functools import reduce\n\n N = int(eval(input()))\n A = [int(i) for i in input().split()]\n\n def comb(n, r):\n numerator = reduce(lambda x, y: x * y, list(range(n, n - r, -1)))\n denominator = reduce(lambda x, y: x * y, list(range(1, r + 1)))\n return numerator // denominator\n\n count = Counter(A)\n total = sum(comb(c, 2) for c in list(count.values()))\n ans = []\n for a in A:\n v = count[a]\n ans.append(total - comb(v, 2) + comb(v - 1, 2))\n return \" \".join(map(str, ans))\n\n\nprint((d_banned_k()))\n","fast_code":"n = int(eval(input()))\na = list(map(int, input().split()))\nnums = [0] * (n + 1)\nfor i in a:\n nums[i] += 1\nt = 0\nfor i in nums:\n t += i * (i - 1) // 2\nfor i in a:\n print((t + 1 - nums[i]))\n"} +{"fast_code_id":"89a723c9e0a14a694c4ac8d157679314ac1ce818c0cbdc7e6f23dc9a1e3d72fb","fast_id":"p03693_89a723c9e0a14a694c4ac8d157679314ac1ce818c0cbdc7e6f23dc9a1e3d72fb","language":"python","measured_fast_code_id":"89a723c9e0a14a694c4ac8d157679314ac1ce818c0cbdc7e6f23dc9a1e3d72fb","measured_slow_code_id":"a8d7956b0cbea162ca1db60ee520eccf4efc73cdccbed5370688af05e67aaca2","measurement_metric":"cpu_instruction_count","pair_id":"python_99147c60c6d1429ef1394fca","problem_id":"p03693","slow_code_id":"a8d7956b0cbea162ca1db60ee520eccf4efc73cdccbed5370688af05e67aaca2","slow_id":"p03693_a8d7956b0cbea162ca1db60ee520eccf4efc73cdccbed5370688af05e67aaca2","speedup":1984.5295697201238,"stratum":"8+","sampling_key":"01efb4920675b9a3c65519f671e3af243aade9facf537cc9e62f0791e1f2b3e6","slow_code":"import numpy as np\n\nr, g, b = list(map(int, input().split()))\nif (100 * r + 10 * g + b) % 4 == 0:\n print(\"YES\")\nelse:\n print(\"NO\")\n","fast_code":"r, g, b = list(map(int, input().split()))\nprint((\"YES\" if (g * 10 + b) % 4 == 0 else \"NO\"))\n"} +{"fast_code_id":"548f9d9ba3f56f0798f5a00d5c8c0672634a22c8ab42db59f51b3513ac28d3e4","fast_id":"p03160_548f9d9ba3f56f0798f5a00d5c8c0672634a22c8ab42db59f51b3513ac28d3e4","language":"python","measured_fast_code_id":"548f9d9ba3f56f0798f5a00d5c8c0672634a22c8ab42db59f51b3513ac28d3e4","measured_slow_code_id":"934f379e0e5300fe0fee5440b2de9ab7f1cfdccbfbc9686e36dc49ab293c868e","measurement_metric":"cpu_instruction_count","pair_id":"python_9914aa2f2b03006c8dd16475","problem_id":"p03160","slow_code_id":"3c2eb6d041b194aca6e618ed722e1b9ae4cb2dfbc9ca12487589612e2e637390","slow_id":"p03160_934f379e0e5300fe0fee5440b2de9ab7f1cfdccbfbc9686e36dc49ab293c868e","speedup":61.46944637383095,"stratum":"8+","sampling_key":"129d5b9af4df3c7ebeed54d43c3a26927342a17527f33dd96fcdda3686915173","slow_code":"import numpy as np\n\nN = int(eval(input()))\nhs = [int(i) for i in input().split()]\ndp = np.zeros(N)\nfor i, h in enumerate(hs):\n if i == 0:\n\n dp[i] = 0\n continue\n elif i == 1:\n\n dp[i] = dp[i - 1] + abs(hs[i - 1] - h)\n else:\n\n dp[i] = min(dp[i - 1] + abs(hs[i - 1] - h), dp[i - 2] + abs(hs[i - 2] - h))\n\nprint((int(dp[-1])))\n","fast_code":"n = int(eval(input()))\nhs = list(map(int, input().split()))\na, b = 0, abs(hs[1] - hs[0])\nfor i in range(2, n):\n d1 = a + abs(hs[i] - hs[i - 2])\n d2 = b + abs(hs[i] - hs[i - 1])\n a, b = b, d1 if d1 <= d2 else d2\nprint(b)\n"} +{"fast_code_id":"7e700aab44bb2d5db1c2e52361bdf5c6e6f43b2116d3eeb5b0ce0ecf6bf5c5e6","fast_id":"p02922_8debc0564456e64a009e96252f5a5339d3fcb470184b2a7f925d1e81588b3b33","language":"python","measured_fast_code_id":"8debc0564456e64a009e96252f5a5339d3fcb470184b2a7f925d1e81588b3b33","measured_slow_code_id":"8b569fc1e16981f8320c705cea748e4c69f345af35a77c5db73eb42d1431aac6","measurement_metric":"cpu_instruction_count","pair_id":"python_99606af02738a16e21099cad","problem_id":"p02922","slow_code_id":"d125558241ae3c64a726d724586fb5061b0b0d9b36349b79174daa959a5a79c4","slow_id":"p02922_8b569fc1e16981f8320c705cea748e4c69f345af35a77c5db73eb42d1431aac6","speedup":51.925271163607114,"stratum":"8+","sampling_key":"1eec2d2c41394a4d04100fdcff3aee74306366c6490eff5527ddfb47f9f50d5e","slow_code":"import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, queue, copy\n\nsys.setrecursionlimit(10**7)\ninf = 10**20\nmod = 10**9 + 7\ndd = [(-1, 0), (0, 1), (1, 0), (0, -1)]\nddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef LI_():\n return [int(x) - 1 for x in sys.stdin.readline().split()]\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LS():\n return sys.stdin.readline().split()\n\n\ndef S():\n return eval(input())\n\n\ndef main():\n a, b = LI()\n c = 1\n ans = 0\n while True:\n if c >= b:\n return ans\n ans += 1\n c -= 1\n c += a\n\n\nprint((main()))\n","fast_code":"a, b = list(map(int, input().split()))\nc = \"必要な電源タップ数は\"\nd = \"個です。\"\ncount = 0\ntotal = 1\nwhile True:\n\n if total >= b:\n break\n total += a - 1\n count += 1\nprint(count)\n"} +{"fast_code_id":"ff3746cf83adfe2f7c88f5967b6a444a853ea3af918404ea545937c39eabc9f1","fast_id":"p03136_ff3746cf83adfe2f7c88f5967b6a444a853ea3af918404ea545937c39eabc9f1","language":"python","measured_fast_code_id":"ff3746cf83adfe2f7c88f5967b6a444a853ea3af918404ea545937c39eabc9f1","measured_slow_code_id":"c1d13b37a289cb233c6849d4a958851f4c3b4f284375eaec46ef2e5a34eb2366","measurement_metric":"cpu_instruction_count","pair_id":"python_9978cc9feca36a37e91ac11a","problem_id":"p03136","slow_code_id":"c1d13b37a289cb233c6849d4a958851f4c3b4f284375eaec46ef2e5a34eb2366","slow_id":"p03136_c1d13b37a289cb233c6849d4a958851f4c3b4f284375eaec46ef2e5a34eb2366","speedup":957.0505128038776,"stratum":"8+","sampling_key":"03ad2e4df03d6739c696f84991f718d7dd2e286148f235d63841fc53a30c40f2","slow_code":"import numpy as np\n\nN = int(eval(input()))\nL = np.array(list(map(int, input().split())))\nL[::-1].sort()\nif L[0] < L[1:].sum():\n print(\"Yes\")\nelse:\n print(\"No\")\n","fast_code":"def main():\n N = int(eval(input()))\n L = [int(i) for i in input().split()]\n sumL = sum(L)\n maxL = max(L)\n print((\"Yes\" if maxL < sumL - maxL else \"No\"))\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"90f6053b20f4fd4a820b5193a04b9bd010c7512448f0f47c306b80594bd12de9","fast_id":"p03472_0c6f8bfb0621d302e3b19d36c0a7479aef1d3a424a9590783b912d843e8d9b99","language":"python","measured_fast_code_id":"0c6f8bfb0621d302e3b19d36c0a7479aef1d3a424a9590783b912d843e8d9b99","measured_slow_code_id":"0789ae9ad831ab5813576bdfc89180cd38032d647a484b2243690be0a9591bf1","measurement_metric":"cpu_instruction_count","pair_id":"python_99969f3dc2dd5d5d8182cd09","problem_id":"p03472","slow_code_id":"58ca7d2969e78880fa1ce15e0d4bb73469edf3592d83f87bf58a9e602bb788dc","slow_id":"p03472_0789ae9ad831ab5813576bdfc89180cd38032d647a484b2243690be0a9591bf1","speedup":23.72748028959203,"stratum":"8+","sampling_key":"074d9c8afc88a7753042409a27349b505567e0cf8aca8f71fc12497297bc80b9","slow_code":"import sys\nimport math\nimport numpy as np\n\nn, h = list(map(int, sys.stdin.readline().strip().split(\" \")))\na = []\nb = []\nfor _ in range(n):\n _a, _b = list(map(int, sys.stdin.readline().strip().split(\" \")))\n a.append(_a)\n b.append(_b)\nmax_a = max(a)\ncnt = 0\nb = np.asarray(sorted(b))\nb = b[b > max_a]\nwhile h > 0 and len(b) > 0:\n cnt += 1\n h -= b[-1]\n b = b[:-1]\nif h > 0:\n cnt += math.ceil(h / max_a)\nprint(cnt)\n","fast_code":"import sys\n\ninput = sys.stdin.readline\nN, H = list(map(int, input().split()))\nA = []\nB = []\nfor _ in range(N):\n a, b = list(map(int, input().split()))\n A.append(a)\n B.append(b)\nA.sort(reverse=True)\nB.sort(reverse=True)\nans = 0\nmaxA = A[0]\nfor b in B:\n if b <= maxA:\n break\n else:\n H -= b\n ans += 1\n if H <= 0:\n print(ans)\n exit()\nans += (H + maxA - 1) // maxA\nprint(ans)\n"} +{"fast_code_id":"e14d44cea834bf3284a5da1b03ac1f7391e54c6f716b4005d2d36cea2c411ea1","fast_id":"p03222_e14d44cea834bf3284a5da1b03ac1f7391e54c6f716b4005d2d36cea2c411ea1","language":"python","measured_fast_code_id":"e14d44cea834bf3284a5da1b03ac1f7391e54c6f716b4005d2d36cea2c411ea1","measured_slow_code_id":"a167fb2840bdcc6405e113c019a821d25f7acfa038b67804c34bff12a9edb446","measurement_metric":"cpu_instruction_count","pair_id":"python_99fc3d87edce79a346112b29","problem_id":"p03222","slow_code_id":"a167fb2840bdcc6405e113c019a821d25f7acfa038b67804c34bff12a9edb446","slow_id":"p03222_a167fb2840bdcc6405e113c019a821d25f7acfa038b67804c34bff12a9edb446","speedup":426.29469471906003,"stratum":"8+","sampling_key":"26ee13684fa9ae17fa55522c15445afc17284f94e4cd19ba8ad0dea4c808b7e5","slow_code":"import sys\n\nmod = pow(10, 9) + 7\n\n\ndef mul(a, b):\n return ((a % mod) * (b % mod)) % mod\n\n\ndef cmb(n, r, mod):\n if r < 0 or r > n:\n return 0\n r = min(r, n - r)\n return g1[n] * g2[r] * g2[n - r] % mod\n\n\nNNN = (10**5) * 2\ng1 = [1, 1]\ng2 = [1, 1]\ninverse = [0, 1]\nfor i in range(2, NNN + 1):\n g1.append((g1[-1] * i) % mod)\n inverse.append((-inverse[mod % i] * (mod // i)) % mod)\n g2.append((g2[-1] * inverse[-1]) % mod)\n\n\ndef erabu(aW):\n r = 0\n for i in range(aW // 2 + 1 + 1):\n sp = aW - (2 * i - 1)\n r += cmb(sp + i + 1 - 1, sp, mod)\n return r\n\n\nN, W, K = [int(x) for x in input().strip().split(\" \")]\nhasi = 0\ncc = []\nif W == 1:\n if K == 1:\n print((1))\n else:\n print((0))\n sys.exit()\nelif W == 2:\n cccl = [1, 1]\n cc = [1, 1]\nelif W == 3:\n cccl = [1, 1, 1]\n cc = [2, 1, 2]\nelif W >= 4:\n aW = W - 1\n hW = aW - 2\n nhW = aW - 3\n cc = []\n cccl = []\n for w in range(W):\n nn = max(W - 1 - w - 1, 0)\n nnn = max((W - 1) - nn - 2, 0)\n if w == W - 1:\n nnn += 1\n cc.append(erabu(nn) * erabu(nnn))\n cccl.append(erabu(nn) * erabu(nnn - 1))\ncccl[0] = 0\ncccr = cccl[::-1]\nd = [1] + [0 for x in range(W - 1)]\nfor i in range(N):\n newd = []\n for j in range(W):\n newd.append(0)\n if j != 0:\n newd[j] = (newd[j] + (d[j - 1] * cccl[j])) % mod\n if j != W - 1:\n newd[j] = (newd[j] + (d[j + 1] * cccr[j])) % mod\n newd[j] = (newd[j] + (d[j] * cc[j])) % mod\n d = newd[:]\nprint((d[K - 1]))\n","fast_code":"MOD = 10**9 + 7\nH, W, K = list(map(int, input().split()))\nfibs = [0, 1, 1, 2, 3, 5, 8, 13, 21, 34]\n\n\ndef getFib(i):\n return fibs[i + 2]\n\n\nnumLs, numCs, numRs = [0] * W, [0] * W, [0] * W\nfor j in range(W):\n numCs[j] = getFib(j - 1) * getFib(W - 1 - j - 1)\n numLs[j] = getFib(j - 2) * getFib(W - 1 - j - 1)\n numRs[j] = getFib(j - 1) * getFib(W - 1 - j - 2)\ndp = [[0] * W for _ in range(H + 1)]\ndp[0][0] = 1\nfor i in range(H):\n for j in range(W):\n dp[i + 1][j] += dp[i][j] * numCs[j]\n if j > 0:\n dp[i + 1][j - 1] += dp[i][j] * numLs[j]\n if j < W - 1:\n dp[i + 1][j + 1] += dp[i][j] * numRs[j]\n for j in range(W):\n dp[i + 1][j] %= MOD\nprint((dp[H][K - 1]))\n"} +{"fast_code_id":"65656aa9840feee1b9dbc9331beceb30a0d208678996748f9638072a52c69443","fast_id":"p02681_65656aa9840feee1b9dbc9331beceb30a0d208678996748f9638072a52c69443","language":"python","measured_fast_code_id":"65656aa9840feee1b9dbc9331beceb30a0d208678996748f9638072a52c69443","measured_slow_code_id":"f4400189ff3db203f96723d5aee262e6d415108f8067f12bc82d5f8b60b24440","measurement_metric":"cpu_instruction_count","pair_id":"python_9a712c7ac6a8d2f764e1cd84","problem_id":"p02681","slow_code_id":"f4400189ff3db203f96723d5aee262e6d415108f8067f12bc82d5f8b60b24440","slow_id":"p02681_f4400189ff3db203f96723d5aee262e6d415108f8067f12bc82d5f8b60b24440","speedup":7.502423210512054,"stratum":"4-8","sampling_key":"1c7baf7207bc42e69ce30b7dd71798cd9724ae7b0e8eaea310e1352a1016c811","slow_code":"import sys\n\ninput = lambda: sys.stdin.readline().rstrip()\naint = lambda: int(input())\nints = lambda: list(map(int, input().split()))\nimport math\n\nfloor, ceil = lambda x: int(math.floor(x)), lambda x: int(math.ceil(x))\nfrom functools import reduce\n\ngcd = lambda *x: reduce(math.gcd, x)\nlcm = lambda *x: reduce(lambda x, y: (x * y) // gcd(x, y), x, 1)\nfrom collections import deque\n\nYes = lambda b: print(\"Yes\" if b else \"No\")\nYES = lambda b: print(\"YES\" if b else \"NO\")\nis_even = lambda x: True if x % 2 == 0 else False\n\n\ndef main():\n s = input()\n t = input()\n n = len(s)\n flg = 0\n for i in range(n):\n if s[i] != t[i]:\n flg = 1\n Yes(flg == 0)\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"s = input()\nt = input()\nprint(\"Yes\") if t == s + t[-1] else print(\"No\")\n"} +{"fast_code_id":"28e9f5b5de0ec96f669439e47f483ca1889df19afb3fbefdc72439020ef1b917","fast_id":"p02789_28e9f5b5de0ec96f669439e47f483ca1889df19afb3fbefdc72439020ef1b917","language":"python","measured_fast_code_id":"28e9f5b5de0ec96f669439e47f483ca1889df19afb3fbefdc72439020ef1b917","measured_slow_code_id":"78de3f88cb23bb16fb5f9ba282f1719bd461fd7ea9f6aadce1636b6f3a8090f3","measurement_metric":"cpu_instruction_count","pair_id":"python_9a7be0f4a175bbd9c431039c","problem_id":"p02789","slow_code_id":"2686b43bdf8ed3cbe77780e6157f246a6c7c3d5757c1ec23cbec723e3255f4bc","slow_id":"p02789_78de3f88cb23bb16fb5f9ba282f1719bd461fd7ea9f6aadce1636b6f3a8090f3","speedup":2173.0836155664856,"stratum":"8+","sampling_key":"1f22a3725594d91dd1b461faa3bc5f5e6903305aa4d51ca2d93ef08aad79ac3b","slow_code":"import math\nimport statistics\nimport numpy as np\nimport queue\n\n\ndef fact(n):\n if n == 1:\n return 1\n else:\n return n * fact(n - 1)\n\n\ndef gcd(a, b):\n if a == 0:\n return b\n elif b == 0:\n return a\n else:\n return gcd(b, a % b)\n\n\ndef lcm(a, b):\n return a * b / gcd(a, b)\n\n\ndef qsort(seq):\n if len(seq) < 2:\n return seq\n else:\n beg, end = 0, len(seq) - 1\n mid = (beg + end) // 2\n smaller = [c for c in seq if seq[mid] > c]\n equal = [c for c in seq if seq[mid] == c]\n larger = [c for c in seq if seq[mid] < c]\n return qsort(smaller) + equal + qsort(larger)\n\n\nn, m = list(map(int, input().split()))\nif n == m:\n print(\"Yes\")\nelse:\n print(\"No\")\n","fast_code":"n, m = list(map(int, input().split()))\nif m == n:\n print(\"Yes\")\nelse:\n print(\"No\")\n"} +{"fast_code_id":"35fa299e74352ed9cb15d8a289a67b234b5ab81395b2110d1943cb2ac24e7bdc","fast_id":"p03329_35fa299e74352ed9cb15d8a289a67b234b5ab81395b2110d1943cb2ac24e7bdc","language":"python","measured_fast_code_id":"35fa299e74352ed9cb15d8a289a67b234b5ab81395b2110d1943cb2ac24e7bdc","measured_slow_code_id":"d420a4a47c3d63ccc8bf0d67f00fb6eac614ba4a541aaa7d9741e0a6de148e33","measurement_metric":"cpu_instruction_count","pair_id":"python_9a9effb3a259c8f9cd35a7c4","problem_id":"p03329","slow_code_id":"d420a4a47c3d63ccc8bf0d67f00fb6eac614ba4a541aaa7d9741e0a6de148e33","slow_id":"p03329_d420a4a47c3d63ccc8bf0d67f00fb6eac614ba4a541aaa7d9741e0a6de148e33","speedup":2622.7371724806967,"stratum":"8+","sampling_key":"cec966432c571e94193ad378952e7453904d7e46d97279d7e9a738f0afa3c792","slow_code":"n = int(eval(input()))\ndp = [float(\"inf\")] * 100010\ndp[0] = 0\nfor i in range(1, 100000 + 1):\n power = 1\n while power <= i:\n dp[i] = min(dp[i], dp[i - power] + 1)\n power *= 6\n power = 1\n while power <= i:\n dp[i] = min(dp[i], dp[i - power] + 1)\n power *= 9\nprint((dp[n]))\n","fast_code":"import bisect as bi\n\nli6 = [6**i for i in range(7)]\nli9 = [9**i for i in range(6)]\n\n\ndef s69(n):\n if n < 6:\n return n\n else:\n s6 = li6[bi.bisect(li6, n) - 1]\n s9 = li9[bi.bisect(li9, n) - 1]\n return min(n // s6 + s69(n % s6), 1 + s69(n - s9))\n\n\nprint((s69(int(eval(input())))))\n"} +{"fast_code_id":"42952b80917ce2a85a6b105c0b544eeb48a1df438a3e537aed2925ce9471282d","fast_id":"p02700_42952b80917ce2a85a6b105c0b544eeb48a1df438a3e537aed2925ce9471282d","language":"python","measured_fast_code_id":"42952b80917ce2a85a6b105c0b544eeb48a1df438a3e537aed2925ce9471282d","measured_slow_code_id":"0800076b3be1d259d89fb0c2c371b4341f1c7fc8f7058a2f3f090ffddebf2dcb","measurement_metric":"cpu_instruction_count","pair_id":"python_9ac534d9cc822812274f8464","problem_id":"p02700","slow_code_id":"7feb6456d377ecdd9b0dcbfc30f9b0e6286836e7cba34a2d795c5cf979e98297","slow_id":"p02700_0800076b3be1d259d89fb0c2c371b4341f1c7fc8f7058a2f3f090ffddebf2dcb","speedup":5.3560372658692215,"stratum":"4-8","sampling_key":"21258793c9b5eb1879b67d3c1c1afccb870f5b632c09548ac8544c188e129c58","slow_code":"from math import floor, ceil, sqrt, factorial, log\nfrom collections import Counter, deque\nfrom functools import reduce\n\n\ndef S():\n return eval(input())\n\n\ndef I():\n return int(eval(input()))\n\n\ndef MS():\n return list(map(str, input().split()))\n\n\ndef MI():\n return list(map(int, input().split()))\n\n\ndef FLI():\n return [int(i) for i in input().split()]\n\n\ndef LS():\n return list(MS())\n\n\ndef LI():\n return list(MI())\n\n\ndef LLS():\n return [list(map(str, l.split())) for l in eval(input())]\n\n\ndef LLI():\n return [list(map(int, l.split())) for l in eval(input())]\n\n\ndef LLSN(n: int):\n return [LS() for _ in range(n)]\n\n\ndef LLIN(n: int):\n return [LI() for _ in range(n)]\n\n\nA, B, C, D = MI()\nx = -(-A // D)\ny = -(-C // B)\nif x >= y:\n print(\"Yes\")\nelse:\n print(\"No\")\n","fast_code":"a, b, c, d = list(map(int, input().split()))\nwhile True:\n c -= b\n a -= d\n if c <= 0:\n print(\"Yes\")\n break\n if a <= 0:\n print(\"No\")\n break\n"} +{"fast_code_id":"8cc82661a1a80fbe55107ea6afa3b838b5aa8ccf9e2d1ce5e9e001f2aa533ccb","fast_id":"p02706_8cc82661a1a80fbe55107ea6afa3b838b5aa8ccf9e2d1ce5e9e001f2aa533ccb","language":"python","measured_fast_code_id":"8cc82661a1a80fbe55107ea6afa3b838b5aa8ccf9e2d1ce5e9e001f2aa533ccb","measured_slow_code_id":"89bf5646ac16bde646209d2509249ed7377541f5a03b9f9c5553553af3b07c63","measurement_metric":"cpu_instruction_count","pair_id":"python_9b051760d5e94ca8141e1d75","problem_id":"p02706","slow_code_id":"89bf5646ac16bde646209d2509249ed7377541f5a03b9f9c5553553af3b07c63","slow_id":"p02706_89bf5646ac16bde646209d2509249ed7377541f5a03b9f9c5553553af3b07c63","speedup":165.87788884787804,"stratum":"8+","sampling_key":"2c4b3fd2f036edf5542841dff21f3168668d7c6c9aa09c276d06a7859049f118","slow_code":"import numpy as np\nimport math\n\nn, m = list(map(int, input().split()))\nA = list(map(int, input().split()))\na = sum(A)\nif n < a:\n print((-1))\nelse:\n print((n - a))\n","fast_code":"N, M = list(map(int, input().split()))\nA = list(map(int, input().split()))\nB = sum(A)\nif B > N:\n ans = -1\nelse:\n ans = N - B\nprint(ans)\n"} +{"fast_code_id":"f05df739be0a2232526a990d2ca66e6bcaf8c3ff1beb496be5ffc643505ce7af","fast_id":"p03502_f05df739be0a2232526a990d2ca66e6bcaf8c3ff1beb496be5ffc643505ce7af","language":"python","measured_fast_code_id":"f05df739be0a2232526a990d2ca66e6bcaf8c3ff1beb496be5ffc643505ce7af","measured_slow_code_id":"9657e24fd296bdb183cb812efcaa41e0e4d09edff18e911040359edf4aba2689","measurement_metric":"cpu_instruction_count","pair_id":"python_9b9fe38f71027e409ca62bad","problem_id":"p03502","slow_code_id":"04afcb0636d6758b9c1fd4024fff2537c6c73d327a7f8a692ef75cf80e1d3933","slow_id":"p03502_9657e24fd296bdb183cb812efcaa41e0e4d09edff18e911040359edf4aba2689","speedup":48.79835577524155,"stratum":"8+","sampling_key":"8ae8ebcbc7eb288da8d92a1955d5e158be72c79a22fe66a8ad5b18b4f9e089ed","slow_code":"import sys\nimport math\nimport collections\nimport itertools\nimport array\nimport inspect\n\n\nsys.setrecursionlimit(10000)\n\n\ndef chkprint(*args):\n names = {id(v): k for k, v in list(inspect.currentframe().f_back.f_locals.items())}\n print((\", \".join(names.get(id(arg), \"???\") + \" = \" + repr(arg) for arg in args)))\n\n\ndef to_bin(x):\n return bin(x)[2:]\n\n\ndef li_input():\n return [int(_) for _ in input().split()]\n\n\ndp = None\n\n\ndef main():\n X = int(eval(input()))\n if X % sum(list(map(int, list(str(X))))) == 0:\n print(\"Yes\")\n else:\n print(\"No\")\n\n\nmain()\n","fast_code":"n = int(eval(input()))\nn_l = list(map(int, str(n)))\nif n % sum(n_l) == 0:\n print(\"Yes\")\nelse:\n print(\"No\")\n"} +{"fast_code_id":"48ff09bc20e8f8798770efd549a5ac6494d01b7553d3e063e63a4ebd4e5dd723","fast_id":"p03173_48ff09bc20e8f8798770efd549a5ac6494d01b7553d3e063e63a4ebd4e5dd723","language":"python","measured_fast_code_id":"48ff09bc20e8f8798770efd549a5ac6494d01b7553d3e063e63a4ebd4e5dd723","measured_slow_code_id":"fbe595c9f8788ab95d696918f37c505aa1adf829bda8c45d5d3567150670ffcd","measurement_metric":"cpu_instruction_count","pair_id":"python_9bd10fdc00071bac6d7b0000","problem_id":"p03173","slow_code_id":"fbe595c9f8788ab95d696918f37c505aa1adf829bda8c45d5d3567150670ffcd","slow_id":"p03173_fbe595c9f8788ab95d696918f37c505aa1adf829bda8c45d5d3567150670ffcd","speedup":18.181161174231164,"stratum":"8+","sampling_key":"2943c63813b469bbde594737cb2981774f3624865725e33b0b9610d8cbcfbebf","slow_code":"from numpy import *\n\nn, a = open(0)\nn = int(n)\na = cumsum(int64([0] + a.split()))\ndp = zeros((n, n + 1), \"i8\")\nfor k in range(1, n):\n l = arange(n - k)\n r = arange(k + 1, n + 1)\n m = array([arange(i + 1, i + k + 1) for i in range(n - k)]).T\n dp[l, r] = amin(dp[l, m] + dp[m, r], 0) + a[r] - a[l]\nprint((dp[0, n]))\n","fast_code":"def resolve():\n N = int(eval(input()))\n a = list(map(int, input().split()))\n DP = [[2**63 - 1 for _ in range(N + 1)] for _ in range(N)]\n SUM = [[0 for _ in range(N + 1)] for _ in range(N + 1)]\n RANGE = [[0 for _ in range(N + 1)] for _ in range(N + 1)]\n SUM[0][0] = 0\n for i in range(N):\n for j in range(i, N):\n SUM[i][j + 1] = SUM[i][j] + a[j]\n if i < j:\n SUM[i + 1][j] = SUM[i][j] - a[i]\n for i in range(N):\n j = i + 1\n DP[i][j] = 0\n RANGE[i][j] = i\n for w in range(2, N + 1):\n for i in range(N + 1 - w):\n j = i + w\n for k in range(RANGE[i][j - 1], RANGE[i + 1][j] + 1):\n s = DP[i][k] + DP[k][j] + SUM[i][j]\n if DP[i][j] > s:\n DP[i][j] = s\n RANGE[i][j] = k\n print((DP[0][N]))\n\n\nresolve()\n"} +{"fast_code_id":"180cfaeb3024b07a03347373b5a4375a14383a3c63d95b5ddf25a877245fc491","fast_id":"p03713_230026fc092eb81d1f28ac162b7d87de026832e26c1b9ee04d7fe6109fd46cfb","language":"python","measured_fast_code_id":"230026fc092eb81d1f28ac162b7d87de026832e26c1b9ee04d7fe6109fd46cfb","measured_slow_code_id":"73da165f272b36503f16ea2a87a7332ca7bf2fb25485361d01c353204b543399","measurement_metric":"cpu_instruction_count","pair_id":"python_9c6a0162a76369242dabd5a3","problem_id":"p03713","slow_code_id":"73da165f272b36503f16ea2a87a7332ca7bf2fb25485361d01c353204b543399","slow_id":"p03713_73da165f272b36503f16ea2a87a7332ca7bf2fb25485361d01c353204b543399","speedup":7.783792710901947,"stratum":"4-8","sampling_key":"0c2e898b0c06b90e1e3d57208d041dd6987cbbbe731e1e23c014986e9db99028","slow_code":"H, W = list(map(int, input().split()))\nresult = []\nfor h in range(1, H):\n Sa = W * h\n remain = H - h\n h2 = (remain + 1) // 2\n Sb1 = W * h2\n Sc1 = W * (remain - h2)\n result.append(max(Sa, Sb1, Sc1) - min(Sa, Sb1, Sc1))\n w = (W + 1) // 2\n Sb2 = w * remain\n Sc2 = (W - w) * remain\n result.append(max(Sa, Sb2, Sc2) - min(Sa, Sb2, Sc2))\nfor w in range(1, W):\n Sa = H * w\n remain = W - w\n w3 = (remain + 1) // 2\n Sb1 = H * w3\n Sc1 = H * (remain - w3)\n result.append(max(Sa, Sb1, Sc1) - min(Sa, Sb1, Sc1))\n h = (H + 1) // 2\n Sb2 = h * remain\n Sc2 = (H - h) * remain\n result.append(max(Sa, Sb2, Sc2) - min(Sa, Sb2, Sc2))\nprint((min(result)))\n","fast_code":"H, W = list(map(int, input().split()))\nif H % 3 == 0 or W % 3 == 0:\n print((0))\n exit()\nans = H * W\n\nfor h in range(1, H + 1):\n a = h * W\n\n b = ((H - h) // 2) * W\n c = H * W - a - b\n ans = min(ans, max([a, b, c]) - min([a, b, c]))\n\n b = (H - h) * (W // 2)\n c = H * W - a - b\n ans = min(ans, max([a, b, c]) - min([a, b, c]))\n\nfor w in range(1, W + 1):\n a = H * w\n\n b = (W - w) * (H // 2)\n c = H * W - a - b\n ans = min(ans, max([a, b, c]) - min([a, b, c]))\n\n b = ((W - w) // 2) * H\n c = H * W - a - b\n ans = min(ans, max([a, b, c]) - min([a, b, c]))\nprint(ans)\n"} +{"fast_code_id":"5b650f0d9d560aa2ddc06d1551889bb58d9768a548461d3a84fc82e94f0e3d66","fast_id":"p00775_5b650f0d9d560aa2ddc06d1551889bb58d9768a548461d3a84fc82e94f0e3d66","language":"python","measured_fast_code_id":"5b650f0d9d560aa2ddc06d1551889bb58d9768a548461d3a84fc82e94f0e3d66","measured_slow_code_id":"795b09bbdc3e784c88f5123c69e5182a24a5b0dfccc3a43d6572c5a9d5f75406","measurement_metric":"cpu_instruction_count","pair_id":"python_9cf23a82ebb7998e037b3cd8","problem_id":"p00775","slow_code_id":"795b09bbdc3e784c88f5123c69e5182a24a5b0dfccc3a43d6572c5a9d5f75406","slow_id":"p00775_795b09bbdc3e784c88f5123c69e5182a24a5b0dfccc3a43d6572c5a9d5f75406","speedup":12.626260680529464,"stratum":"8+","sampling_key":"29824e1c1a372da69cf87ff22416a7274a45507471d219e3ac742f99e48b7e44","slow_code":"while True:\n R, N = list(map(int, input().split()))\n if not (R | N):\n break\n geta = 20\n buildings = [0] * (geta * 2)\n for _ in range(N):\n xl, xr, h = list(map(int, input().split()))\n for i in range(xl + geta, xr + geta):\n buildings[i] = max(buildings[i], h)\n left, right = 0, 20\n for _ in range(100):\n mid = (left + right) / 2\n flag = True\n for i in range(-R + geta, R + geta):\n if i < geta:\n y = pow(R * R - (i - geta + 1) * (i - geta + 1), 0.5)\n flag &= buildings[i] >= y - R + mid\n else:\n y = pow(R * R - (i - geta) * (i - geta), 0.5)\n flag &= buildings[i] >= y - R + mid\n if flag:\n left = mid\n else:\n right = mid\n print((\"{:.20f}\".format(left)))\n","fast_code":"while True:\n R, N = list(map(int, input().split()))\n if not (R | N):\n break\n geta = 20\n buildings = [0] * (geta * 2)\n for _ in range(N):\n xl, xr, h = list(map(int, input().split()))\n for i in range(xl + geta, xr + geta):\n buildings[i] = max(buildings[i], h)\n print(\n (\n min(\n buildings[i] - pow(R**2 - (i - geta + (i < geta)) ** 2, 0.5) + R\n for i in range(-R + geta, R + geta)\n )\n )\n )\n"} +{"fast_code_id":"b2b548a4d89c995371b30030d01bc119904ddb71f7c52f4ed4b5fa042bd4ea71","fast_id":"p04015_b2b548a4d89c995371b30030d01bc119904ddb71f7c52f4ed4b5fa042bd4ea71","language":"python","measured_fast_code_id":"b2b548a4d89c995371b30030d01bc119904ddb71f7c52f4ed4b5fa042bd4ea71","measured_slow_code_id":"5ed596884989c1cb95a8cdb1d55f87f4193d5ec23fb229d7e8609fcad31672d4","measurement_metric":"cpu_instruction_count","pair_id":"python_9d0383a3173b6f6907315c29","problem_id":"p04015","slow_code_id":"1e2ace225af337b2f023fb7e1839de0de8cbf265842f6ca41ac5311221f212f9","slow_id":"p04015_5ed596884989c1cb95a8cdb1d55f87f4193d5ec23fb229d7e8609fcad31672d4","speedup":7.818445300753514,"stratum":"4-8","sampling_key":"01220dc415fd746f87042978b7f8dce1093161e3f06863f8160b1a1ab6193d3c","slow_code":"n, a = list(map(int, input().split()))\nx = list(map(int, input().split()))\ndp = [[[0] * (n * 50 + 1) for i in range(n + 1)] for i in range(n)]\n\ndp[0][0][0] = 1\ndp[0][1][x[0]] = 1\nfor i in range(1, n):\n for j in range(n + 1):\n for k in range(n * 50 + 1):\n if dp[i - 1][j][k] == 0:\n continue\n\n dp[i][j + 1][k + x[i]] += dp[i - 1][j][k]\n\n dp[i][j][k] += dp[i - 1][j][k]\nans = 0\nfor j in range(1, n + 1):\n for k in range(n * 50 + 1):\n if a * j == k:\n ans += dp[-1][j][k]\nprint(ans)\n","fast_code":"N, A = list(map(int, input().split()))\nX = list([int(x) - A for x in input().split()])\ndp = [0] * 10000\ndp[0] = 1\nfor i in range(N):\n new_dp = dp[:]\n for j in range(-3000, 3000):\n if dp[j] > 0:\n new_dp[j + X[i]] += dp[j]\n dp = new_dp\nprint((dp[0] - 1))\n"} +{"fast_code_id":"33dcebe1a6bd6b2029351d524f7527f05a8365e65ae141221b45237fbfb1783d","fast_id":"p02817_33dcebe1a6bd6b2029351d524f7527f05a8365e65ae141221b45237fbfb1783d","language":"python","measured_fast_code_id":"33dcebe1a6bd6b2029351d524f7527f05a8365e65ae141221b45237fbfb1783d","measured_slow_code_id":"9f4657cb00c8c33f0584f0326d64e41b8f42d7a77cc35ee9515364c99ba0c794","measurement_metric":"cpu_instruction_count","pair_id":"python_9d17f0c10de0556c48920680","problem_id":"p02817","slow_code_id":"9f4657cb00c8c33f0584f0326d64e41b8f42d7a77cc35ee9515364c99ba0c794","slow_id":"p02817_9f4657cb00c8c33f0584f0326d64e41b8f42d7a77cc35ee9515364c99ba0c794","speedup":2.694928867426236,"stratum":"2-4","sampling_key":"7984e15190daa1d42da8170166f65545ce1a7572193f33e9b5cc98659f631d5f","slow_code":"import sys\n\nS, T = input().split()\nif not (S.islower() and T.islower()):\n sys.exit()\nif not (1 <= len(S) <= 100 and 1 <= len(S) <= 100):\n sys.exit()\nprint(T, S, sep=\"\")\n","fast_code":"s, t = input().split()\nprint((t + s))\n"} +{"fast_code_id":"5b32d921753f5b1861bbe75f8a5eba85fcdd95a5dc929e4dc9b67db7dc0a437a","fast_id":"p02392_09663c1f76aa19bedba50a46e6e114f2a193cba92904a747ee1eae1e2f9a470f","language":"python","measured_fast_code_id":"09663c1f76aa19bedba50a46e6e114f2a193cba92904a747ee1eae1e2f9a470f","measured_slow_code_id":"359da708050d63872f0ebf54c13ede0cb7a857b20ddb07202d171041a7782310","measurement_metric":"cpu_instruction_count","pair_id":"python_9d403fe4559977332a8ccb7d","problem_id":"p02392","slow_code_id":"359da708050d63872f0ebf54c13ede0cb7a857b20ddb07202d171041a7782310","slow_id":"p02392_359da708050d63872f0ebf54c13ede0cb7a857b20ddb07202d171041a7782310","speedup":572.8558490496151,"stratum":"8+","sampling_key":"0fa2088616e4d2f1ac6b85160cd98aa41df273bf6cedd9143f66d325fea7f621","slow_code":"import sys\n\nif __name__ == \"__main__\":\n import doctest\n\n doctest.testmod()\n a, b, c = list(map(int, sys.stdin.read().split()))\n if a < b < c:\n print(\"Yes\")\n else:\n print(\"No\")\n","fast_code":"input = list(map(int, input().split()))\na, b, c = input\nif a < b and b < c:\n print(\"Yes\")\nelse:\n print(\"No\")\n"} +{"fast_code_id":"55544230816fd7d657cc5324cb41e22f86528020642dc127eaa0dd214065aa0b","fast_id":"p03738_55544230816fd7d657cc5324cb41e22f86528020642dc127eaa0dd214065aa0b","language":"python","measured_fast_code_id":"55544230816fd7d657cc5324cb41e22f86528020642dc127eaa0dd214065aa0b","measured_slow_code_id":"d5baa6a15a1c4a76633ab38a051360a64a827577b6553480f73b85ef4ead3a15","measurement_metric":"cpu_instruction_count","pair_id":"python_9d613de72341dc3fbf6b5531","problem_id":"p03738","slow_code_id":"51f72b7576f2a6693b915f49f43199e2cd6155a4ebab55cc493d3b8dd74e88d8","slow_id":"p03738_d5baa6a15a1c4a76633ab38a051360a64a827577b6553480f73b85ef4ead3a15","speedup":2.3538042671304136,"stratum":"2-4","sampling_key":"d6fbd7b6aafad04b04f254951aedc087b225a16c161a50f5a3549fc96bffc6aa","slow_code":"import math\n\nif __name__ == \"__main__\":\n a = input()\n b = input()\n if len(a) > len(b):\n print(\"GREATER\")\n elif len(a) < len(b):\n print(\"LESS\")\n elif len(a) == len(b):\n for i in range(len(a)):\n if a[i] > b[i]:\n print(\"GREATER\")\n break\n elif a[i] < b[i]:\n print(\"LESS\")\n break\n elif a[i] == b[i] and i == len(a) - 1:\n print(\"EQUAL\")\n","fast_code":"a = int(eval(input())) - int(eval(input()))\nprint((a > 0 and \"GREATER\" or a < 0 and \"LESS\" or \"EQUAL\"))\n"} +{"fast_code_id":"9bdb75de5f6bd2e0327efa1c546680f12b414176c5a7d9bd21e16693d22fdfc0","fast_id":"p03472_9bdb75de5f6bd2e0327efa1c546680f12b414176c5a7d9bd21e16693d22fdfc0","language":"python","measured_fast_code_id":"9bdb75de5f6bd2e0327efa1c546680f12b414176c5a7d9bd21e16693d22fdfc0","measured_slow_code_id":"e6fb53d428c218a9dad43f71415fff4137faea0247973c73ffa368e3f80a96bc","measurement_metric":"cpu_instruction_count","pair_id":"python_9d7314fe0f6035b979bf23d2","problem_id":"p03472","slow_code_id":"959a20db4ae0f00d8957b9a1432326d6e5fea394771c477e31dea94e932699eb","slow_id":"p03472_e6fb53d428c218a9dad43f71415fff4137faea0247973c73ffa368e3f80a96bc","speedup":3.522393689015172,"stratum":"2-4","sampling_key":"603b78442c33e367080683f8d922754e97ba8638d9d8c477213d760be3aa91a2","slow_code":"import sys\nfrom collections import defaultdict, Counter\nfrom itertools import product, groupby, count, permutations, combinations\nfrom math import pi, sqrt, floor\nfrom collections import deque\nfrom bisect import bisect, bisect_left, bisect_right\nfrom string import ascii_lowercase\nfrom functools import lru_cache, reduce\nfrom operator import xor\nfrom heapq import heappush, heappop\n\nINF = float(\"inf\")\nsys.setrecursionlimit(10**7)\n\ndy4, dx4 = [0, -1, 0, 1], [1, 0, -1, 0]\n\n\ndef inside(y: int, x: int, H: int, W: int) -> bool:\n return 0 <= y < H and 0 <= x < W\n\n\ndef ceil(a, b):\n return (a + b - 1) // b\n\n\ndef solve(N, H, a_b):\n max_a = -1\n for a, b in a_b:\n max_a = max(max_a, a)\n good_b = []\n for a, b in a_b:\n if b >= max_a:\n good_b.append(b)\n ans = 0\n for b in sorted(good_b, reverse=True):\n ans += 1\n H -= b\n if H <= 0:\n return ans\n return ans + ceil(H, max_a)\n\n\ndef main():\n N, H = list(map(int, input().split()))\n l = []\n for _ in range(N):\n a, b = list(map(int, input().split()))\n l.append((a, b))\n print((solve(N, H, l)))\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"n, h, *k = list(map(int, open(0).read().split()))\na = 0\nb = []\nfor i, j in zip(*[iter(k)] * 2):\n a = max(a, i)\n b.append(j)\nb = sorted(b, reverse=True)\nans = 0\nwhile ans < n and b[ans] > a and h > 0:\n h -= b[ans]\n ans += 1\nif h > 0:\n ans += (h + a - 1) // a\nprint(ans)\n"} +{"fast_code_id":"8404e89cbf1c791684ce4a4f537d312fb41b351a10f8732dc67cba4fa1c1a2cc","fast_id":"p03448_8404e89cbf1c791684ce4a4f537d312fb41b351a10f8732dc67cba4fa1c1a2cc","language":"python","measured_fast_code_id":"8404e89cbf1c791684ce4a4f537d312fb41b351a10f8732dc67cba4fa1c1a2cc","measured_slow_code_id":"fe672ace967cecac7ee687fda0abb1e2ca6a8176a3d010ba0c3a78f9a90d5cad","measurement_metric":"cpu_instruction_count","pair_id":"python_9d937f21bb2d0cbb332b0080","problem_id":"p03448","slow_code_id":"fe672ace967cecac7ee687fda0abb1e2ca6a8176a3d010ba0c3a78f9a90d5cad","slow_id":"p03448_fe672ace967cecac7ee687fda0abb1e2ca6a8176a3d010ba0c3a78f9a90d5cad","speedup":3.315321252259271,"stratum":"2-4","sampling_key":"0395068be46b73179f9a9b94300f3784fab539a9b57959990e92f3c4b036b6b2","slow_code":"A, B, C, X = list(map(int, [eval(input()) for _ in range(4)]))\ncount = 0\nfor a in range(A + 1):\n for b in range(B + 1):\n for c in range(C + 1):\n value = 500 * a + 100 * b + 50 * c\n if X == value:\n count += 1\nprint(count)\n","fast_code":"a = int(eval(input()))\nb = int(eval(input()))\nc = int(eval(input()))\nx = int(eval(input()))\ncnt = 0\nfor i in range(a + 1):\n for j in range(b + 1):\n z = x - (500 * i + 100 * j)\n if z < 0:\n break\n if z / 50 <= c:\n cnt += 1\nprint(cnt)\n"} +{"fast_code_id":"126ce0e22e4f9de347b1b67e8d83fdad771fc2c10b04b6c512e6f29160753492","fast_id":"p02786_126ce0e22e4f9de347b1b67e8d83fdad771fc2c10b04b6c512e6f29160753492","language":"python","measured_fast_code_id":"126ce0e22e4f9de347b1b67e8d83fdad771fc2c10b04b6c512e6f29160753492","measured_slow_code_id":"5d6617ccb7542ab7ac6370731e16a8d6166b9d7e674b0195c22064d828abd3d2","measurement_metric":"cpu_instruction_count","pair_id":"python_9d9a55af3f216fafbfdd7322","problem_id":"p02786","slow_code_id":"ccd6f9587aa7a20c43aac93ef11246453f9abff3b028525d3340cb287fb6e047","slow_id":"p02786_5d6617ccb7542ab7ac6370731e16a8d6166b9d7e674b0195c22064d828abd3d2","speedup":29.720814465548486,"stratum":"8+","sampling_key":"349a2f24ff83c21dc8ab3eaece643601f92c3a89222ad726ee1ee13402f4448b","slow_code":"import sys\nimport math\nimport os\nimport itertools\nimport string\nimport heapq\nimport _collections\nfrom collections import Counter\nfrom collections import defaultdict\nfrom collections import deque\nfrom functools import lru_cache\nimport bisect\nimport re\nimport queue\nimport copy\nimport decimal\n\n\nclass Scanner:\n @staticmethod\n def int():\n return int(sys.stdin.readline().rstrip())\n\n @staticmethod\n def string():\n return sys.stdin.readline().rstrip()\n\n @staticmethod\n def map_int():\n return [int(x) for x in Scanner.string().split()]\n\n @staticmethod\n def string_list(n):\n return [Scanner.string() for i in range(n)]\n\n @staticmethod\n def int_list_list(n):\n return [Scanner.map_int() for i in range(n)]\n\n @staticmethod\n def int_cols_list(n):\n return [Scanner.int() for i in range(n)]\n\n\ndef solve():\n N = Scanner.int()\n ans = 0\n tmp = 1\n while N > 1:\n ans += tmp\n tmp *= 2\n N //= 2\n ans += tmp\n print(ans)\n\n\ndef main():\n\n solve()\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"memo = {}\n\n\ndef f(n):\n if n == 1:\n return 1\n if n in memo:\n return memo[n]\n memo[n] = 1 + 2 * f(n // 2)\n return memo[n]\n\n\nprint((f(int(eval(input())))))\n"} +{"fast_code_id":"2a5d56ad885392890eff866a522b28503082be2ac0075f2e8c02fa66a6f8cc0f","fast_id":"p03502_2a5d56ad885392890eff866a522b28503082be2ac0075f2e8c02fa66a6f8cc0f","language":"python","measured_fast_code_id":"2a5d56ad885392890eff866a522b28503082be2ac0075f2e8c02fa66a6f8cc0f","measured_slow_code_id":"9657e24fd296bdb183cb812efcaa41e0e4d09edff18e911040359edf4aba2689","measurement_metric":"cpu_instruction_count","pair_id":"python_9e0abe99fd7caad92bbfcba0","problem_id":"p03502","slow_code_id":"04afcb0636d6758b9c1fd4024fff2537c6c73d327a7f8a692ef75cf80e1d3933","slow_id":"p03502_9657e24fd296bdb183cb812efcaa41e0e4d09edff18e911040359edf4aba2689","speedup":37.631864543662985,"stratum":"8+","sampling_key":"1ed15d4c720cd340b8033644b6db26f5b160caa25f549a7a424cd33ec36a4c0e","slow_code":"import sys\nimport math\nimport collections\nimport itertools\nimport array\nimport inspect\n\n\nsys.setrecursionlimit(10000)\n\n\ndef chkprint(*args):\n names = {id(v): k for k, v in list(inspect.currentframe().f_back.f_locals.items())}\n print((\", \".join(names.get(id(arg), \"???\") + \" = \" + repr(arg) for arg in args)))\n\n\ndef to_bin(x):\n return bin(x)[2:]\n\n\ndef li_input():\n return [int(_) for _ in input().split()]\n\n\ndp = None\n\n\ndef main():\n X = int(eval(input()))\n if X % sum(list(map(int, list(str(X))))) == 0:\n print(\"Yes\")\n else:\n print(\"No\")\n\n\nmain()\n","fast_code":"n = int(eval(input()))\ns = str(n)\nsum = 0\nfor i in range(len(s)):\n sum += ord(s[i]) - ord(\"0\")\nif n % sum == 0:\n print(\"Yes\")\nelse:\n print(\"No\")\n"} +{"fast_code_id":"d9bd6d9c1673d5c7b03cbce9087eef16e0dc78bd73d6675ec1264bc9b15400ab","fast_id":"p02761_d9bd6d9c1673d5c7b03cbce9087eef16e0dc78bd73d6675ec1264bc9b15400ab","language":"python","measured_fast_code_id":"d9bd6d9c1673d5c7b03cbce9087eef16e0dc78bd73d6675ec1264bc9b15400ab","measured_slow_code_id":"514a6c3c1deb62b4937706f57e0f85699ef2003303440ed0e6219c2b9994802b","measurement_metric":"cpu_instruction_count","pair_id":"python_9e2ca220554a107f46b1ae53","problem_id":"p02761","slow_code_id":"e9b53459684e8277fdb7764bbe44f20f3c2bffff9a6ad1a47a2a6552aa7f5635","slow_id":"p02761_514a6c3c1deb62b4937706f57e0f85699ef2003303440ed0e6219c2b9994802b","speedup":5.556680743932017,"stratum":"4-8","sampling_key":"d35c318d12df564ea2c927ce556609d5a50deb55f6fbb8780b823a0392b3ad57","slow_code":"import bisect\nimport copy\nimport heapq\nimport math\nimport sys\nfrom collections import *\nfrom functools import lru_cache\nfrom itertools import accumulate, combinations, permutations, product\n\n\ndef input():\n return sys.stdin.readline()[:-1]\n\n\ndef ruiseki(lst):\n return [0] + list(accumulate(lst))\n\n\nsys.setrecursionlimit(500000)\nmod = pow(10, 9) + 7\nal = [chr(ord(\"a\") + i) for i in range(26)]\ndirection = [[1, 0], [0, 1], [-1, 0], [0, -1]]\nn, m = list(map(int, input().split()))\nsc = [list(map(int, input().split())) for i in range(m)]\nlst = [-1] * n\nfor i in range(m):\n s, c = sc[i]\n if lst[s - 1] == -1 or lst[s - 1] == c:\n lst[s - 1] = c\n else:\n print((-1))\n quit()\n\nfor i in range(n):\n if i == 0:\n if lst[i] == 0 and n != 1:\n print((-1))\n quit()\n elif lst[i] == -1:\n if n == 1:\n lst[i] = 0\n else:\n lst[i] = 1\n elif lst[i] == -1:\n lst[i] = 0\nprint((\"\".join(map(str, lst))))\n","fast_code":"n, m = map(int, input().split())\nans = [-1] * n\nfor i in range(m):\n s, c = map(int, input().split())\n if s == 1 and c == 0 and n != 1:\n print(-1)\n exit()\n if ans[s - 1] == -1 or ans[s - 1] == c:\n ans[s - 1] = c\n else:\n print(-1)\n exit()\nif ans[0] == -1 and n != 1:\n ans[0] = 1\nfor i in range(n):\n if ans[i] == -1:\n ans[i] = 0\nprint(*ans, sep=\"\")\n"} +{"fast_code_id":"6c99a67195f81cef355f29849420942ef7cda33fe7cf1151f8ae3adddedfbfc9","fast_id":"p03296_6c99a67195f81cef355f29849420942ef7cda33fe7cf1151f8ae3adddedfbfc9","language":"python","measured_fast_code_id":"6c99a67195f81cef355f29849420942ef7cda33fe7cf1151f8ae3adddedfbfc9","measured_slow_code_id":"a260e38fd68198bd3b846ed815f9f7842be8a43a1a00830ef94d4cac2df063d2","measurement_metric":"cpu_instruction_count","pair_id":"python_9e51c9a7c6305987d1a2278c","problem_id":"p03296","slow_code_id":"98718a5692a33a090df0421f7d48f7b20be3a15dafddd3f88613c957f01f774b","slow_id":"p03296_a260e38fd68198bd3b846ed815f9f7842be8a43a1a00830ef94d4cac2df063d2","speedup":3.2563051937347436,"stratum":"2-4","sampling_key":"bf38bae4417a0979a0022a63646ffcc78ad070073d0d3394848296187677e5e8","slow_code":"import sys\n\nINF = float(\"inf\")\nMOD = 10**9 + 7\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef LI_():\n return [int(x) - 1 for x in sys.stdin.readline().split()]\n\n\ndef LF():\n return [float(x) for x in sys.stdin.readline().split()]\n\n\ndef LS():\n return sys.stdin.readline().split()\n\n\ndef II():\n return int(sys.stdin.readline())\n\n\ndef SI():\n return eval(input())\n\n\ndef main():\n n = II()\n A = LI()\n res = 0\n for i in range(1, n):\n if A[i] == A[i - 1]:\n A[i] = 0\n res += 1\n return res\n\n\nprint((main()))\n","fast_code":"eval(input())\nans = x = 0\nfor a in input().split():\n ans += a == x\n x = a * (a != x)\nprint(ans)\n"} +{"fast_code_id":"9a1626365f94b8a7d0331e3eabf1740b93398b58e75f9e3e35d2d82ea57bb14e","fast_id":"p02831_9a1626365f94b8a7d0331e3eabf1740b93398b58e75f9e3e35d2d82ea57bb14e","language":"python","measured_fast_code_id":"9a1626365f94b8a7d0331e3eabf1740b93398b58e75f9e3e35d2d82ea57bb14e","measured_slow_code_id":"2a0c608945dfe6932309375b337b52e231bed977a9befeeb544efcc3cdfd537c","measurement_metric":"cpu_instruction_count","pair_id":"python_9e921a55a1649333cc158d4b","problem_id":"p02831","slow_code_id":"2a0c608945dfe6932309375b337b52e231bed977a9befeeb544efcc3cdfd537c","slow_id":"p02831_2a0c608945dfe6932309375b337b52e231bed977a9befeeb544efcc3cdfd537c","speedup":4.508099629192238,"stratum":"4-8","sampling_key":"1ddeb282121eb2b4e5ee99d539fac550514b9c43e6e4b54bb5f9d5c13e9b8f3d","slow_code":"A, B = list(map(int, input().split()))\na, b = A, B\nwhile True:\n if a > b:\n b += B\n elif a < b:\n a += A\n if a == b:\n print(a)\n break\n","fast_code":"num1, num2 = list(map(int, input().split()))\nimport math\n\n\ndef gcd(num1, num2):\n for i in range(min(num1, num2), 0, -1):\n if num1 % i == 0 and num2 % i == 0:\n return i\n\n\nprint((int(num1 * num2 / gcd(num1, num2))))\n"} +{"fast_code_id":"577388b59770baa4e5ed373cc61dbcb2b4e3d4d4674e0c711c5066e60422b0d3","fast_id":"p00741_577388b59770baa4e5ed373cc61dbcb2b4e3d4d4674e0c711c5066e60422b0d3","language":"python","measured_fast_code_id":"577388b59770baa4e5ed373cc61dbcb2b4e3d4d4674e0c711c5066e60422b0d3","measured_slow_code_id":"0735c1a312ae16acc97c209d4348af561ba3d9c718d6566dd5c307d9219cab61","measurement_metric":"cpu_instruction_count","pair_id":"python_9f4f4f7d01264720c9f2fe15","problem_id":"p00741","slow_code_id":"a10583df4146149ff2d8bb1bf5e10386b85381f734796329c7fab07cb9105b27","slow_id":"p00741_0735c1a312ae16acc97c209d4348af561ba3d9c718d6566dd5c307d9219cab61","speedup":5.928024374416366,"stratum":"4-8","sampling_key":"76a1ffcb762a8edbe1eff5e0149a71699ba7bf5adfa68051f0d6d0ebeae955e0","slow_code":"import sys\nfrom pprint import pprint\n\n\nclass UnionFind:\n def __init__(self):\n self._parent = {}\n self._rank = {}\n self._equiv = {}\n\n def _find(self, x):\n if self._parent[x] == x:\n return self._parent[x]\n else:\n p = self._find(self._parent[x])\n self._parent[x] = p\n return p\n\n def _set_parent(self, child, parent):\n self._parent[child] = parent\n self._equiv[parent].update(self._equiv.pop(child))\n\n def _union(self, x, y):\n x = self._find(x)\n y = self._find(y)\n if x == y:\n return\n if self._rank[x] > self._rank[y]:\n self._set_parent(y, x)\n elif self._rank[x] < self._rank[y]:\n self._set_parent(x, y)\n else:\n self._set_parent(x, y)\n self._rank[x] += 1\n\n def _make_set(self, x):\n self._parent[x] = x\n self._rank[x] = 0\n self._equiv[x] = {x}\n\n def unite(self, *elements):\n if not elements:\n return\n for x in elements:\n if x in self._parent:\n continue\n self._make_set(x)\n x0 = elements[0]\n for x in elements[1:]:\n self._union(x0, x)\n\n def groups(self):\n return [set(e) for e in list(self._equiv.values())]\n\n\ndef pairs(ncol, nrow):\n\n for x in range(ncol - 1):\n for y in range(nrow):\n yield [(x, y), (x + 1, y)]\n\n for x in range(ncol):\n for y in range(nrow - 1):\n yield [(x, y), (x, y + 1)]\n\n for x in range(ncol - 1):\n for y in range(nrow - 1):\n yield [(x, y), (x + 1, y + 1)]\n\n for x in range(ncol - 1):\n for y in range(1, nrow):\n yield [(x, y), (x + 1, y - 1)]\n\n\ndef solve(ncol, nrow, rows):\n f = UnionFind()\n for x in range(ncol):\n for y in range(nrow):\n if rows[y][x]:\n f.unite((x, y))\n for (x1, y1), (x2, y2) in pairs(ncol, nrow):\n if rows[y1][x1] and rows[y2][x2]:\n f.unite((x1, y1), (x2, y2))\n return len(f.groups())\n\n\ndef main():\n while True:\n ncol, nrow = list(map(int, input().split()))\n if ncol == 0 and nrow == 0:\n break\n rows = []\n for _ in range(nrow):\n row = list(map(int, input().split()))\n rows.append(row)\n print((solve(ncol, nrow, rows)))\n\n\nmain()\n","fast_code":"def solve():\n from collections import deque\n\n while True:\n w, h = [int(x) + 2 for x in input().split()]\n if w == 2:\n break\n result = 0\n a = [\"0\"] * w\n for _ in [0] * (h - 2):\n a += [\"0\"] + input().split() + [\"0\"]\n a += [\"0\"] * w\n for i in range(w * h):\n if a[i] != \"1\":\n continue\n a[i] = \"0\"\n result += 1\n dq = deque([i])\n while dq:\n j = dq.popleft()\n for dest in (\n j - w - 1,\n j - w,\n j - w + 1,\n j - 1,\n j + 1,\n j + w - 1,\n j + w,\n j + w + 1,\n ):\n if a[dest] == \"1\":\n a[dest] = \"0\"\n dq.append(dest)\n print(result)\n\n\nif __name__ == \"__main__\":\n solve()\n"} +{"fast_code_id":"12f19819dd3968ad623af74c832313adcd7db9626d7b7db6084c3833342f54a5","fast_id":"p03288_12f19819dd3968ad623af74c832313adcd7db9626d7b7db6084c3833342f54a5","language":"python","measured_fast_code_id":"12f19819dd3968ad623af74c832313adcd7db9626d7b7db6084c3833342f54a5","measured_slow_code_id":"4b19a6c66c6b24c9d371f629b6a683da99f61809c1d26fcff1386ca6548060d5","measurement_metric":"cpu_instruction_count","pair_id":"python_9fbcf3aab15354622900702c","problem_id":"p03288","slow_code_id":"4b19a6c66c6b24c9d371f629b6a683da99f61809c1d26fcff1386ca6548060d5","slow_id":"p03288_4b19a6c66c6b24c9d371f629b6a683da99f61809c1d26fcff1386ca6548060d5","speedup":24.59709070647773,"stratum":"8+","sampling_key":"983993867028d087e706b96ed57cc21692f70a7a8541838727cf6569cab03fbf","slow_code":"import bisect, collections, copy, heapq, itertools, math, string\nimport sys\n\n\ndef S():\n return sys.stdin.readline().rstrip()\n\n\ndef M():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef LS():\n return list(sys.stdin.readline().rstrip().split())\n\n\nR = I()\nif R < 1200:\n print(\"ABC\")\nelif R < 2800:\n print(\"ARC\")\nelse:\n print(\"AGC\")\n","fast_code":"rating = int(eval(input()))\nif rating < 1200:\n print(\"ABC\")\nelif 1200 <= rating < 2800:\n print(\"ARC\")\nelif rating >= 2800:\n print(\"AGC\")\n"} +{"fast_code_id":"b6834044bcbc77eb8a44d485655e938ae1a4127b00d69345cf12935172ed1f49","fast_id":"p02845_b6834044bcbc77eb8a44d485655e938ae1a4127b00d69345cf12935172ed1f49","language":"python","measured_fast_code_id":"b6834044bcbc77eb8a44d485655e938ae1a4127b00d69345cf12935172ed1f49","measured_slow_code_id":"44f76311477519e453c1541c8cee2cad565caf5c7e854c8feade8f7c7a67fffd","measurement_metric":"cpu_instruction_count","pair_id":"python_9fca5dad3e49b7fa52b451fb","problem_id":"p02845","slow_code_id":"44f76311477519e453c1541c8cee2cad565caf5c7e854c8feade8f7c7a67fffd","slow_id":"p02845_44f76311477519e453c1541c8cee2cad565caf5c7e854c8feade8f7c7a67fffd","speedup":11.683342960153691,"stratum":"8+","sampling_key":"c40b1d1da16bd6351581c45b941c04464ee284f25480d91d5effe661841fd8a0","slow_code":"_, a = open(0)\nc = 1\nd = [3] + [0] * 10**6\nfor a in map(int, a.split()):\n c = c * d[a] % (10**9 + 7)\n d[a] -= 1\n d[a + 1] += 1\nprint(c)\n","fast_code":"import sys\n\nread = sys.stdin.read\nreadline = sys.stdin.readline\nreadlines = sys.stdin.readlines\nsys.setrecursionlimit(10**9)\nINF = 1 << 60\n\n\ndef main():\n MOD = 1000000007\n N, *A = list(map(int, read().split()))\n C = [0] * (N + 1)\n C[0] = 3\n ans = 1\n for a in A:\n ans = ans * C[a] % MOD\n if ans == 0:\n print((0))\n return\n C[a] -= 1\n C[a + 1] += 1\n print(ans)\n return\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"91221217e6f5b58d18f29f102d886202d05d8b7f0b8fa25049362598d7119a89","fast_id":"p02549_91221217e6f5b58d18f29f102d886202d05d8b7f0b8fa25049362598d7119a89","language":"python","measured_fast_code_id":"91221217e6f5b58d18f29f102d886202d05d8b7f0b8fa25049362598d7119a89","measured_slow_code_id":"44c9516e92f38f09d76b47812276c2878e77eeefdb8dab9cc1137c27ddfc7b8e","measurement_metric":"cpu_instruction_count","pair_id":"python_a0ef0efc2924d4bdbb7d5958","problem_id":"p02549","slow_code_id":"44c9516e92f38f09d76b47812276c2878e77eeefdb8dab9cc1137c27ddfc7b8e","slow_id":"p02549_44c9516e92f38f09d76b47812276c2878e77eeefdb8dab9cc1137c27ddfc7b8e","speedup":3.071391001364279,"stratum":"2-4","sampling_key":"130a943c8c771629ace6e671134f8ccfb4e05e2534208821b36e8ffdc4cd9157","slow_code":"mod = 998244353\nn, k = list(map(int, input().split()))\nK = [list(map(int, input().split())) for i in range(k)]\ndp = [0] * (n + 5)\ndp[1] = 1\ndp2 = [0] * (n + 5)\nfor i in range(1, n + 1):\n dp[i] = (dp[i] + dp2[i] + dp2[i - 1]) % mod\n dp2[i] = (dp2[i] + dp2[i - 1]) % mod\n for l, r in K:\n dp2[min(i + l, n + 2)] += dp[i]\n dp2[min(i + l, n + 2)] %= mod\n dp2[min(i + r + 1, n + 2)] -= dp[i]\n dp2[min(i + r + 1, n + 2)] %= mod\nprint((dp[n] % mod))\n","fast_code":"(n, _), *s = [[*list(map(int, t.split()))] for t in open(0)]\nd = [1, -1] + [c := 0] * 2 * n\nfor i in range(n):\n c = (c + d[i]) % 998244353\n for l, r in s:\n d[i + l] += c\n d[i - ~r] -= c\nprint(c)\n"} +{"fast_code_id":"9cc3e6d9352dd4eabc72eacfa693573c9edd5312536391bdffa5fb541ae53660","fast_id":"p01224_9cc3e6d9352dd4eabc72eacfa693573c9edd5312536391bdffa5fb541ae53660","language":"python","measured_fast_code_id":"9cc3e6d9352dd4eabc72eacfa693573c9edd5312536391bdffa5fb541ae53660","measured_slow_code_id":"66194bc1a7ae54de44e09b5f93d1f79e3416a467c501ca1310dc3f13610e492e","measurement_metric":"cpu_instruction_count","pair_id":"python_a13616d1a55e99861b06e82a","problem_id":"p01224","slow_code_id":"66194bc1a7ae54de44e09b5f93d1f79e3416a467c501ca1310dc3f13610e492e","slow_id":"p01224_66194bc1a7ae54de44e09b5f93d1f79e3416a467c501ca1310dc3f13610e492e","speedup":2.439098883721352,"stratum":"2-4","sampling_key":"2340be01735fd0b775caff7680575e52704130901242adb084fe890ed12072d0","slow_code":"from math import sqrt\n\nP = \"perfect number\"\nD = \"deficient number\"\nA = \"abundant number\"\nwhile True:\n n = eval(input())\n if n == 0:\n break\n if n == 1:\n print(D)\n continue\n su = 1\n temp = n\n for i in range(2, int(sqrt(n)) + 1):\n cnt = 0\n while temp % i == 0:\n temp /= i\n cnt += 1\n if cnt:\n su *= (i ** (cnt + 1) - 1) / (i - 1)\n if temp == 1:\n su -= n\n break\n if temp != 1:\n su *= (temp**2 - 1) / (temp - 1)\n su -= n\n print(P if n == su else (D if su < n else A))\n","fast_code":"def SumOfDiv(n):\n i = 2\n ans = 1\n while i * i <= n:\n c = 0\n while n % i == 0:\n n /= i\n c += 1\n if c > 0:\n ans *= (i ** (c + 1) - 1) / (i - 1)\n i += 1\n if n > 1:\n ans *= 1 + n\n return ans\n\n\nwhile 1:\n n = eval(input())\n if n == 0:\n break\n d = SumOfDiv(n) - n\n if d == n:\n print(\"perfect number\")\n elif d < n:\n print(\"deficient number\")\n else:\n print(\"abundant number\")\n"} +{"fast_code_id":"a90cc8f3ad97bee728be3d3a2054cdf6caa4cb111cfd9c964b877de67c1ab1d7","fast_id":"p03077_ec186682a96a8871c1b73b1af3feee8dad7169ddf50fa980d8fe187af859f2ec","language":"python","measured_fast_code_id":"ec186682a96a8871c1b73b1af3feee8dad7169ddf50fa980d8fe187af859f2ec","measured_slow_code_id":"34caf7325f4819bd719f1f977d4c7833f1b8eae1073783274c70d879e08aa59a","measurement_metric":"cpu_instruction_count","pair_id":"python_a15b59d8aaa121593f1f146c","problem_id":"p03077","slow_code_id":"ab58e9cb16ab933309b0c60e055e71406d283b0d16126adf763de4e9caa5d6fb","slow_id":"p03077_34caf7325f4819bd719f1f977d4c7833f1b8eae1073783274c70d879e08aa59a","speedup":357.52251239832924,"stratum":"8+","sampling_key":"6365a4d928d6f08f7e05705ed6dfe2aa76e7150dedbf770cb4f084ea0c026d5d","slow_code":"import sys\nimport numpy as np\n\n\ndef get_num():\n return int(eval(input()))\n\n\ndef get_nums(n):\n res = [0 for _ in range(n)]\n for i in range(n):\n res[i] = int(eval(input()))\n return res\n\n\ndef get_numbers():\n return list(map(int, input().split()))\n\n\nn = get_num()\ncosts = get_nums(5)\nmax_time = 0\nfor cost in costs:\n max_time = max(max_time, int(np.ceil(n / cost)))\nprint((max_time + 4))\n","fast_code":"import sys\n\ns2nn = lambda s: [int(c) for c in s.split(\" \")]\nss2nn = lambda ss: [int(s) for s in list(ss)]\nss2nnn = lambda ss: [s2nn(s) for s in list(ss)]\ni2s = lambda: sys.stdin.readline().rstrip()\ni2n = lambda: int(i2s())\ni2nn = lambda: s2nn(i2s())\nii2ss = lambda n: [sys.stdin.readline() for _ in range(n)]\nii2nn = lambda n: ss2nn(ii2ss(n))\nii2nnn = lambda n: ss2nnn(ii2ss(n))\nimport math\n\n\ndef main():\n N = i2n()\n ABCDE = ii2nn(5)\n m = min(ABCDE)\n n = int(math.ceil(N / m)) + 4\n print(n)\n\n\nmain()\n"} +{"fast_code_id":"9891ff1953f3bdc39ea90dfed6bf3adb78ac1721a06a6c6851a4534c6df901d5","fast_id":"p02994_9891ff1953f3bdc39ea90dfed6bf3adb78ac1721a06a6c6851a4534c6df901d5","language":"python","measured_fast_code_id":"9891ff1953f3bdc39ea90dfed6bf3adb78ac1721a06a6c6851a4534c6df901d5","measured_slow_code_id":"d149410d46bed6b8690e0200021300cc5187b2715c0717e93e6c392866beb39e","measurement_metric":"cpu_instruction_count","pair_id":"python_a180eed5769acbeb351aa2d7","problem_id":"p02994","slow_code_id":"d149410d46bed6b8690e0200021300cc5187b2715c0717e93e6c392866beb39e","slow_id":"p02994_d149410d46bed6b8690e0200021300cc5187b2715c0717e93e6c392866beb39e","speedup":109.5268918285208,"stratum":"8+","sampling_key":"119c800bb370c2d6e3a8d7e2cb03ea33d22bfea50e4c099b02b95e2531b0ca06","slow_code":"import copy\n\nN, L = list(map(int, input().split()))\napple_taste = [L + i for i in range(N)]\npie_taste = sum(apple_taste)\nmin_diff = 100000\nfor i in range(N):\n ap = copy.deepcopy(apple_taste)\n ap[i] = 0\n pie_taste2 = sum(ap)\n diff = abs(pie_taste - pie_taste2)\n if diff < min_diff:\n min_diff = diff\n min_index = i\napple_taste[min_index] = 0\nprint((sum(apple_taste)))\n","fast_code":"N, L = list(map(int, input().split()))\ntaste = list(range(L, L + N))\nprint((sum(taste) - min(taste, key=abs)))\n"} +{"fast_code_id":"f6ef3257b5e8877ad81071a42c9269e5538e44e4ad7ffa2fda95f890de3483d9","fast_id":"p03608_f6ef3257b5e8877ad81071a42c9269e5538e44e4ad7ffa2fda95f890de3483d9","language":"python","measured_fast_code_id":"f6ef3257b5e8877ad81071a42c9269e5538e44e4ad7ffa2fda95f890de3483d9","measured_slow_code_id":"a6ba7a6e457f7223737377dc74c3739f39a6faf8bc7e129d3e4d82875673c6ae","measurement_metric":"cpu_instruction_count","pair_id":"python_a1d42e21366e289f2db9c44f","problem_id":"p03608","slow_code_id":"f19f2c009c893dde042476371af37c34ea12cfaa23ea63baa86f7c5a07cc08fe","slow_id":"p03608_a6ba7a6e457f7223737377dc74c3739f39a6faf8bc7e129d3e4d82875673c6ae","speedup":5.678287028182766,"stratum":"4-8","sampling_key":"1a9276d3621b7bb813336d97a30db56d0cbf772923601647deb1591b1c755668","slow_code":"n, m, r = list(map(int, input().split()))\nrs = list(map(int, input().split()))\n\nimport numpy as np\n\ndists = np.ones((n + 1, n + 1)) * float(\"inf\")\nfor _ in range(m):\n a, b, c = list(map(int, input().split()))\n dists[a, b] = dists[b, a] = c\nfor i in range(1, n + 1):\n dists[i, i] = 0\nfrom itertools import product, permutations\n\nfor i, j in product(list(range(1, 1 + n)), repeat=2):\n dists[j] = np.minimum(dists[j], dists[i] + dists[j, i])\nans = float(\"inf\")\nfor path in permutations(rs):\n val = sum(dists[i, j] for i, j in zip(path, path[1:]))\n val = int(val)\n if val < ans:\n ans = val\nprint(ans)\n","fast_code":"from itertools import permutations\nimport sys\n\ninput = sys.stdin.readline\n\n\ndef main():\n N, M, RR = list(map(int, input().split()))\n R = list(map(int, input().split()))\n INF = float(\"inf\")\n T = [[INF] * N for _ in range(N)]\n for _ in range(M):\n a, b, c = tuple(map(int, input().split()))\n T[a - 1][b - 1] = c\n T[b - 1][a - 1] = c\n for k in range(N):\n for i in range(N):\n for j in range(N):\n if T[i][j] > T[i][k] + T[k][j]:\n T[i][j] = T[i][k] + T[k][j]\n ans = INF\n for rs in permutations(R):\n cost = 0\n for i in range(RR - 1):\n cost += T[rs[i] - 1][rs[i + 1] - 1]\n ans = min(ans, cost)\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"aea4722c0d554376063b268dde7a61fedc12d43bb51df28a7c04d2fa002501c9","fast_id":"p02922_aea4722c0d554376063b268dde7a61fedc12d43bb51df28a7c04d2fa002501c9","language":"python","measured_fast_code_id":"aea4722c0d554376063b268dde7a61fedc12d43bb51df28a7c04d2fa002501c9","measured_slow_code_id":"00e867b7d2095675b21d44aa0203e42270e0c7d7b6d93feade6e801e5b2a696c","measurement_metric":"cpu_instruction_count","pair_id":"python_a1ed5a993b97344ec12ab0f4","problem_id":"p02922","slow_code_id":"00e867b7d2095675b21d44aa0203e42270e0c7d7b6d93feade6e801e5b2a696c","slow_id":"p02922_00e867b7d2095675b21d44aa0203e42270e0c7d7b6d93feade6e801e5b2a696c","speedup":7.66221407055997,"stratum":"4-8","sampling_key":"8dbf4fd98e26852d4312cff799684392b4a835b9c775c2f15d389eb3aef18080","slow_code":"from copy import deepcopy\nfrom math import ceil\n\nif __name__ == \"__main__\":\n a = list(map(int, input().split()))\n n = deepcopy(a[0])\n i = 1\n if a[0] == a[1]:\n print(i)\n elif a[1] == 1:\n print((0))\n elif a[0] >= a[1]:\n print(i)\n else:\n while True:\n i += 1\n n += a[0] - 1\n if n >= a[1]:\n print(i)\n break\n","fast_code":"import sys\n\nsys.setrecursionlimit(10**6)\nA, B = list(map(int, input().split()))\ncnt = 0\ntmp = A\nwhile True:\n cnt += 1\n if tmp >= B:\n break\n else:\n tmp += A - 1\nif B == 1:\n print((0))\nelse:\n print(cnt)\n"} +{"fast_code_id":"3e6d626ab547675c3b341d29edcadee93969941923bd6eda1ba7144ea2b5a1d3","fast_id":"p02688_3e6d626ab547675c3b341d29edcadee93969941923bd6eda1ba7144ea2b5a1d3","language":"python","measured_fast_code_id":"3e6d626ab547675c3b341d29edcadee93969941923bd6eda1ba7144ea2b5a1d3","measured_slow_code_id":"833cdc3e9e22359e6374ddf9a571da0b188300c6f7965f7bf42a388d1a943053","measurement_metric":"cpu_instruction_count","pair_id":"python_a1f1e80f69f346c489a38640","problem_id":"p02688","slow_code_id":"833cdc3e9e22359e6374ddf9a571da0b188300c6f7965f7bf42a388d1a943053","slow_id":"p02688_833cdc3e9e22359e6374ddf9a571da0b188300c6f7965f7bf42a388d1a943053","speedup":2.017011959909398,"stratum":"2-4","sampling_key":"1f185210be02d423abe3b7136106514ead0886f0bb3da17e003b07fe977159aa","slow_code":"def main():\n n, k = tuple([int(t) for t in input().split()])\n t = [0] * n\n for _ in range(k):\n eval(input())\n k = tuple([int(t) - 1 for t in input().split()])\n for k_i in k:\n t[k_i] += 1\n ans = 0\n for t_i in t:\n if t_i == 0:\n ans += 1\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"R = lambda: list(map(int, input().split()))\nn, k = R()\ns = set()\nfor _ in range(k):\n R()\n s.update(R())\nprint((n - len(s)))\n"} +{"fast_code_id":"b991360164b380206f7e775106727a40e8ea5eb62aa82568adc13770334dc75c","fast_id":"p02554_b991360164b380206f7e775106727a40e8ea5eb62aa82568adc13770334dc75c","language":"python","measured_fast_code_id":"b991360164b380206f7e775106727a40e8ea5eb62aa82568adc13770334dc75c","measured_slow_code_id":"1216aa013ca95268c8cea10ef1956fc82ecf53c33048dc021f31f4ae82487ba4","measurement_metric":"cpu_instruction_count","pair_id":"python_a22cbd0024ad5ec582e8c0fa","problem_id":"p02554","slow_code_id":"d34cbcef17a1809eb9aaea9acac748f4f348edb348ac1a61f3b30198ffe07352","slow_id":"p02554_1216aa013ca95268c8cea10ef1956fc82ecf53c33048dc021f31f4ae82487ba4","speedup":1907.5839591817096,"stratum":"8+","sampling_key":"0c01e6a8f5ac2d9b446515d15d3488de3fdbddba84c5ccd480b59c56e05d92c4","slow_code":"MOD = 10**9 + 7\n\n\ndef solve(n):\n dp = [[0] * 4 for i in range(n + 1)]\n dp[0][0] = 1\n for i in range(n):\n dp[i + 1][3] = (10 * dp[i][3] + dp[i][2] + dp[i][1]) % MOD\n dp[i + 1][2] = (9 * dp[i][2] + dp[i][0]) % MOD\n dp[i + 1][1] = (9 * dp[i][1] + dp[i][0]) % MOD\n dp[i + 1][0] = (8 * dp[i][0]) % MOD\n return dp[n][3]\n\n\nn = int(eval(input()))\nprint((solve(n)))\n","fast_code":"n = int(eval(input()))\nmod = 1000000007\nans = pow(10, n, mod)\nans -= pow(9, n, mod) * 2\nans += pow(8, n, mod)\nprint((ans % mod))\n"} +{"fast_code_id":"20e53009872fe9dd782675e880075268b3e0af9f6ce2a7d4557ec94173ec9057","fast_id":"p02577_ce0a0d0ae51f3f6bf73ecce01b3d6b08555952927912c9657b6e00ca81b16186","language":"python","measured_fast_code_id":"ce0a0d0ae51f3f6bf73ecce01b3d6b08555952927912c9657b6e00ca81b16186","measured_slow_code_id":"1695d36830b635de7a833cb7583d4932c3ef84eb29ed4a411ae07564db734213","measurement_metric":"cpu_instruction_count","pair_id":"python_a2cfa2f0642202f45d9eb756","problem_id":"p02577","slow_code_id":"9343e3453d3b21aae3ee17e8f056a2eab92db2a957cffcda54a09aac937cf7e3","slow_id":"p02577_1695d36830b635de7a833cb7583d4932c3ef84eb29ed4a411ae07564db734213","speedup":2.0972042330382656,"stratum":"2-4","sampling_key":"642bb535cb4a71914fe1a21f3bc54870982d2effbe5d65b8bd5c703c51755675","slow_code":"import sys\n\nsys.setrecursionlimit(10**7)\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\ndef MI():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef LI2():\n return list(map(int, sys.stdin.readline().rstrip()))\n\n\ndef S():\n return sys.stdin.readline().rstrip()\n\n\ndef LS():\n return list(sys.stdin.readline().rstrip().split())\n\n\ndef LS2():\n return list(sys.stdin.readline().rstrip())\n\n\nN = LI2()\nprint((\"Yes\" if sum(N) % 9 == 0 else \"No\"))\n","fast_code":"import sys\n\n\ndef LI2():\n return list(map(int, sys.stdin.readline().rstrip()))\n\n\nprint((\"Yes\" if sum(LI2()) % 9 == 0 else \"No\"))\n"} +{"fast_code_id":"382736c0a35370c938690e166ba64d1b56fcb202e0f6da86a8757096745b2d64","fast_id":"p02956_10d797a5ea81b7a4f56177acbb61aaa0799eeddea23d11dca8b78e656d26f855","language":"python","measured_fast_code_id":"10d797a5ea81b7a4f56177acbb61aaa0799eeddea23d11dca8b78e656d26f855","measured_slow_code_id":"8042986ea709f7be4a36940bb65dd281b3740a58e66e7c9edcc0eeee56205242","measurement_metric":"cpu_instruction_count","pair_id":"python_a2da6d4c653e21c5ecbeeae7","problem_id":"p02956","slow_code_id":"e43f92f24f0e96eef9c4232af95007e4efdc9b0608e734256316ff5cc0636981","slow_id":"p02956_8042986ea709f7be4a36940bb65dd281b3740a58e66e7c9edcc0eeee56205242","speedup":48.51318707720681,"stratum":"8+","sampling_key":"3fd91fa25a19bd0eef3ffdc0832731faf29fed566d1777fa75883babf7bd0612","slow_code":"import sys\n\nreadline = sys.stdin.readline\n\n\nclass BIT:\n\n def __init__(self, n):\n self.size = n\n self.tree = [0] * (n + 1)\n self.p = 2 ** (n.bit_length() - 1)\n self.dep = n.bit_length()\n\n def get(self, i):\n s = 0\n while i > 0:\n s += self.tree[i]\n i -= i & -i\n return s\n\n def add(self, i, x):\n while i <= self.size:\n self.tree[i] += x\n i += i & -i\n\n def bl(self, v):\n if v <= 0:\n return -1\n s = 0\n k = self.p\n for _ in range(self.dep):\n if s + k <= self.size and self.tree[s + k] < v:\n s += k\n v -= self.tree[s + k]\n k //= 2\n return s + 1\n\n\ndef compress(L):\n L2 = list(set(L))\n L2.sort()\n C = {v: k for k, v in enumerate(L2)}\n return L2, C\n\n\nMOD = 998244353\nN = int(readline())\nXY = [list(map(int, readline().split())) for _ in range(N)]\nXY.sort()\nZ = [-(10**10)]\nfor x, y in XY:\n Z.append(y)\n_, CC = compress(Z)\nXY = [(x, CC[y]) for x, y in XY]\nSS, SB, BS, BB = [None] * N, [None] * N, [None] * N, [None] * N\nT = BIT(N)\nfor i in range(N):\n k = i\n y = XY[i][1]\n l = T.get(y)\n SS[i] = l\n SB[i] = k - l\n T.add(y, 1)\nT = BIT(N)\nfor i in range(N - 1, -1, -1):\n k = N - 1 - i\n y = XY[i][1]\n l = T.get(y)\n BS[i] = l\n BB[i] = k - l\n T.add(y, 1)\nP2 = [1] * 1341398\nfor i in range(1, len(P2)):\n P2[i] = P2[i - 1] * 2 % MOD\nans = 0\nfor i in range(N):\n ss = SS[i]\n sb = SB[i]\n bs = BS[i]\n bb = BB[i]\n ans = (ans + P2[N - 1]) % MOD\n ans = (ans + P2[N - 1 - ss - bb] * (P2[ss] - 1) * (P2[bb] - 1)) % MOD\n ans = (ans + P2[N - 1 - sb - bs] * (P2[sb] - 1) * (P2[bs] - 1)) % MOD\n ans = (ans - (P2[sb] - 1) * (P2[bs] - 1) * (P2[ss] - 1) * (P2[bb] - 1)) % MOD\nprint(ans)\n","fast_code":"class BIT:\n def __init__(self, n):\n self.tree = [0] * (n + 1)\n self.tree[0] = None\n\n def sum(self, i):\n s = 0\n i += 1\n while i > 0:\n s += self.tree[i]\n i -= i & -i\n return s\n\n def range(self, l, r):\n return sum(r) - sum(l - 1)\n\n def add(self, i, x):\n i += 1\n while i <= n:\n self.tree[i] += x\n i += i & -i\n\n\nimport sys\n\nsys.setrecursionlimit(10**6)\nreadline = sys.stdin.readline\nn = int(eval(input()))\nxyi = [[int(i) for i in readline().split()] + [j] for j in range(n)]\n\n\ndame_x = [0] * n\ndame_y = [0] * n\ndame_xy = [0] * n\nMOD = 998244353\nsxyi = sorted(xyi, key=lambda x: x[1])\nmodosu = [i for x, y, i in sxyi]\nzaatu = [0] * n\nfor j, zj in enumerate(modosu):\n zaatu[zj] = j\npow2 = [1] * (n + 1)\nfor i in range(n):\n pow2[i + 1] = pow2[i] * 2 % MOD\nfor j, (x, y, i) in enumerate(sxyi):\n dame_y[i] = pow2[j] - 1 + pow2[n - j - 1] - 1\nxyi.sort()\n\nbit = BIT(n)\nfor j, (x, y, i) in enumerate(xyi):\n dame_x[i] = pow2[j] - 1 + pow2[n - j - 1] - 1\n c = bit.sum(zaatu[i])\n dame_xy[i] += pow2[c] - 1 + pow2[j - c] - 1\n bit.add(zaatu[i], 1)\nbit = BIT(n)\nfor j, (x, y, i) in enumerate(reversed(xyi)):\n c = bit.sum(zaatu[i])\n dame_xy[i] += pow2[c] - 1 + pow2[j - c] - 1\n bit.add(zaatu[i], 1)\n\nans = n * (pow2[n] - 1) % MOD\nfor dx, dy, dxy in zip(dame_x, dame_y, dame_xy):\n ans += -dx - dy + dxy\nprint((ans % MOD))\n"} +{"fast_code_id":"5ed51c5591fb6d78749d63d02ede62c1930e40cf42990c8a1a3e4ad39cac9c2e","fast_id":"p02700_5ed51c5591fb6d78749d63d02ede62c1930e40cf42990c8a1a3e4ad39cac9c2e","language":"python","measured_fast_code_id":"5ed51c5591fb6d78749d63d02ede62c1930e40cf42990c8a1a3e4ad39cac9c2e","measured_slow_code_id":"0800076b3be1d259d89fb0c2c371b4341f1c7fc8f7058a2f3f090ffddebf2dcb","measurement_metric":"cpu_instruction_count","pair_id":"python_a321a36f3c710967e82a700a","problem_id":"p02700","slow_code_id":"7feb6456d377ecdd9b0dcbfc30f9b0e6286836e7cba34a2d795c5cf979e98297","slow_id":"p02700_0800076b3be1d259d89fb0c2c371b4341f1c7fc8f7058a2f3f090ffddebf2dcb","speedup":3.0511366785680796,"stratum":"2-4","sampling_key":"bd6d479d946c4050148627f403448aab384700552a9ec9316c0332800555cde4","slow_code":"from math import floor, ceil, sqrt, factorial, log\nfrom collections import Counter, deque\nfrom functools import reduce\n\n\ndef S():\n return eval(input())\n\n\ndef I():\n return int(eval(input()))\n\n\ndef MS():\n return list(map(str, input().split()))\n\n\ndef MI():\n return list(map(int, input().split()))\n\n\ndef FLI():\n return [int(i) for i in input().split()]\n\n\ndef LS():\n return list(MS())\n\n\ndef LI():\n return list(MI())\n\n\ndef LLS():\n return [list(map(str, l.split())) for l in eval(input())]\n\n\ndef LLI():\n return [list(map(int, l.split())) for l in eval(input())]\n\n\ndef LLSN(n: int):\n return [LS() for _ in range(n)]\n\n\ndef LLIN(n: int):\n return [LI() for _ in range(n)]\n\n\nA, B, C, D = MI()\nx = -(-A // D)\ny = -(-C // B)\nif x >= y:\n print(\"Yes\")\nelse:\n print(\"No\")\n","fast_code":"nums = [int(e) for e in input().split()]\nif nums[2] % nums[1] == 0:\n A = nums[2] // nums[1]\nelse:\n A = nums[2] // nums[1] + 1\nif nums[0] % nums[3] == 0:\n T = nums[0] // nums[3]\nelse:\n T = nums[0] // nums[3] + 1\nif A <= T:\n print(\"Yes\")\nelse:\n print(\"No\")\n"} +{"fast_code_id":"8a6c5d74caf93914e3f4889cde851d36a5c823451ff3636a146430d23f4936db","fast_id":"p03606_8a6c5d74caf93914e3f4889cde851d36a5c823451ff3636a146430d23f4936db","language":"python","measured_fast_code_id":"8a6c5d74caf93914e3f4889cde851d36a5c823451ff3636a146430d23f4936db","measured_slow_code_id":"91ed37766e83e1c57b3ed54e34dd70e87dd0159574758547062baadff81ba4dd","measurement_metric":"cpu_instruction_count","pair_id":"python_a340b32c28de8f72bf2bfd59","problem_id":"p03606","slow_code_id":"91ed37766e83e1c57b3ed54e34dd70e87dd0159574758547062baadff81ba4dd","slow_id":"p03606_91ed37766e83e1c57b3ed54e34dd70e87dd0159574758547062baadff81ba4dd","speedup":6.922352853939786,"stratum":"4-8","sampling_key":"840b035662863b0857837ab8fd0f9ae71afdc147c18f4e8b354c6166f0dff280","slow_code":"import collections\n\nn = int(eval(input()))\nl = [list(map(int, input().split())) for _ in range(n)]\nd = {}\nfor i in range(len(l)):\n for j in range(l[i][0], l[i][1] + 1):\n d[j] = 1\nprint((len(d)))\n","fast_code":"n = int(eval(input()))\nans = 0\nfor i in range(n):\n ans += ~(eval(input().replace(\" \", \"-\"))) + 2\nprint(ans)\n"} +{"fast_code_id":"dc52fcca43e4161ca70eff85cf522e1eb8d1d11b0f796475dbf29d5555b3a739","fast_id":"p03775_acca2850455de4c78e5db21e3945678e4d2ae2960bc5adfd581d28d8eef93501","language":"python","measured_fast_code_id":"acca2850455de4c78e5db21e3945678e4d2ae2960bc5adfd581d28d8eef93501","measured_slow_code_id":"7ab001f5efb675596da434bf3ef9e7fa9f9ec3b0d345cb8726f7720241f1422c","measurement_metric":"cpu_instruction_count","pair_id":"python_a34467088c912653fb3e9fbf","problem_id":"p03775","slow_code_id":"0bd50a29ee4b8ed24f88df4bdfcabb76a7a6778570de4e74b5c8ddab42febd8f","slow_id":"p03775_7ab001f5efb675596da434bf3ef9e7fa9f9ec3b0d345cb8726f7720241f1422c","speedup":246.38014414579163,"stratum":"8+","sampling_key":"02d6d59ee769d94076c880f4aebf1cca9f1dbc78dc0c13db3f8fed5e6526b1f9","slow_code":"n = int(eval(input()))\n\n\ndef cal(a):\n return len(str(a))\n\n\nm = 11\nfor j in range(1, 10**6 + 1):\n if n % j == 0:\n m = min(m, max(cal(j), cal(n // j)))\n\nprint(m)\n","fast_code":"def make_divisors(n):\n divisors = []\n for i in range(1, int(n**0.5) + 1):\n if n % i == 0:\n divisors.append(i)\n if i != n // i:\n divisors.append(n // i)\n\n return divisors\n\n\nN = int(eval(input()))\nprint((len(str(make_divisors(N)[-1]))))\n"} +{"fast_code_id":"58d5197f8e56470e4bf6371be6a42c8db60f474c0b6b7e6c6e002ba43e31c53c","fast_id":"p03962_58d5197f8e56470e4bf6371be6a42c8db60f474c0b6b7e6c6e002ba43e31c53c","language":"python","measured_fast_code_id":"58d5197f8e56470e4bf6371be6a42c8db60f474c0b6b7e6c6e002ba43e31c53c","measured_slow_code_id":"94b5708574eb089eb69c60d607f6ca9a4290b0c22eedfd5cbef01210b79bc6bf","measurement_metric":"cpu_instruction_count","pair_id":"python_a387fb562dbac692d2d3d6fc","problem_id":"p03962","slow_code_id":"94b5708574eb089eb69c60d607f6ca9a4290b0c22eedfd5cbef01210b79bc6bf","slow_id":"p03962_94b5708574eb089eb69c60d607f6ca9a4290b0c22eedfd5cbef01210b79bc6bf","speedup":2.8012559479716814,"stratum":"2-4","sampling_key":"107d5d5233e520ee0b15026877e97ae4a36b0483cb4792a902b84e7a955e1a95","slow_code":"def main():\n a, b, c = list(map(int, input().split()))\n print((len(set([a, b, c]))))\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"print((len({*input().split()})))\n"} +{"fast_code_id":"d0046c61dc6c94f15c0f18e7119bac1d2485c0a9e9a73bd737c9e975209bd15e","fast_id":"p01224_d0046c61dc6c94f15c0f18e7119bac1d2485c0a9e9a73bd737c9e975209bd15e","language":"python","measured_fast_code_id":"d0046c61dc6c94f15c0f18e7119bac1d2485c0a9e9a73bd737c9e975209bd15e","measured_slow_code_id":"66194bc1a7ae54de44e09b5f93d1f79e3416a467c501ca1310dc3f13610e492e","measurement_metric":"cpu_instruction_count","pair_id":"python_a3c3aa35c4a40d81f50c3f12","problem_id":"p01224","slow_code_id":"66194bc1a7ae54de44e09b5f93d1f79e3416a467c501ca1310dc3f13610e492e","slow_id":"p01224_66194bc1a7ae54de44e09b5f93d1f79e3416a467c501ca1310dc3f13610e492e","speedup":2.28201854381855,"stratum":"2-4","sampling_key":"5a1a53e93bd83facba090d879552daed8c80e2bdcb8bef764dae4da2158d09b3","slow_code":"from math import sqrt\n\nP = \"perfect number\"\nD = \"deficient number\"\nA = \"abundant number\"\nwhile True:\n n = eval(input())\n if n == 0:\n break\n if n == 1:\n print(D)\n continue\n su = 1\n temp = n\n for i in range(2, int(sqrt(n)) + 1):\n cnt = 0\n while temp % i == 0:\n temp /= i\n cnt += 1\n if cnt:\n su *= (i ** (cnt + 1) - 1) / (i - 1)\n if temp == 1:\n su -= n\n break\n if temp != 1:\n su *= (temp**2 - 1) / (temp - 1)\n su -= n\n print(P if n == su else (D if su < n else A))\n","fast_code":"def div(n):\n ls = []\n i = 2\n while i * i <= n:\n c = 0\n if n % i == 0:\n while n % i == 0:\n n /= i\n c += 1\n if c > 0:\n ls.append([i, c])\n i += 1\n if n > 1:\n ls.append([n, 1])\n ans = 1\n for b, p in ls:\n ans *= (b ** (p + 1) - 1) / (b - 1)\n return ans\n\n\nwhile 1:\n n = eval(input())\n if n == 0:\n break\n d = div(n) - n\n if d == n:\n print(\"perfect number\")\n elif d < n:\n print(\"deficient number\")\n else:\n print(\"abundant number\")\n"} +{"fast_code_id":"6cf0fbae01df2d11f5ea1421c4f7d2610272c73db432d3cccb91a30ba12264af","fast_id":"p03147_7e8bf1c73619f52a92f199219e4ce04b3d4dd877ffbb5a7d41f0473776c1a7ae","language":"python","measured_fast_code_id":"7e8bf1c73619f52a92f199219e4ce04b3d4dd877ffbb5a7d41f0473776c1a7ae","measured_slow_code_id":"47a3646cbef4cdc6d777ff253127885ae7b10f34cd8d4fef647dd4916f5b32c1","measurement_metric":"cpu_instruction_count","pair_id":"python_a48d21bede554b11d2256dd1","problem_id":"p03147","slow_code_id":"2ca3826e95bb705eb346cc2325420f54f12d09da747118c657639adcec905d81","slow_id":"p03147_47a3646cbef4cdc6d777ff253127885ae7b10f34cd8d4fef647dd4916f5b32c1","speedup":636.6535252865845,"stratum":"8+","sampling_key":"15d56072e5c7d56a8bf9a0e46c13f3157a89db431ccd2188046d757fa1d5ac8c","slow_code":"import numpy as np\n\n\nN = int(eval(input()))\narrA = list(map(int, input().split()))\n\n\ndef split_list(lis, num=0):\n res = []\n tmp = []\n for i in lis:\n if i != num:\n tmp.append(i)\n elif i == num and len(tmp) > 0:\n res.append(tmp)\n tmp = []\n else:\n continue\n else:\n res.append(tmp)\n res = [l for l in res if len(l) != 0]\n return res\n\n\nstack = split_list(arrA)\nans = 0\n\nwhile len(stack) > 0:\n lis1 = stack.pop()\n arr = np.array(list(map(int, list(lis1))))\n\n nmin = min(arr)\n ans += nmin\n arr = arr - nmin\n s = list(arr)\n lis2 = split_list(s)\n stack = stack + lis2\nprint(ans)\n","fast_code":"import sys\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef resolve():\n n = int(eval(input()))\n l = list(map(int, input().split()))\n ans = l[0]\n\n for i in range(len(l) - 1):\n ans += max(l[i + 1] - l[i], 0)\n print(ans)\n\n\nresolve()\n"} +{"fast_code_id":"35dec6fc5770cf4d7b9621f258b5fe80dc7a1beb9ce612bddcc28ef1a07df64c","fast_id":"p03013_caafad57c12dd7f73a70c01e6f3a04d5e61c35d2f6f40fac4b9d85d515329111","language":"python","measured_fast_code_id":"caafad57c12dd7f73a70c01e6f3a04d5e61c35d2f6f40fac4b9d85d515329111","measured_slow_code_id":"4a80d25e3e49718fb943ef50228efaa460f0d9079accba468908a8cb7a7eecf9","measurement_metric":"cpu_instruction_count","pair_id":"python_a48ed4829d846af68fe0d6f5","problem_id":"p03013","slow_code_id":"4a80d25e3e49718fb943ef50228efaa460f0d9079accba468908a8cb7a7eecf9","slow_id":"p03013_4a80d25e3e49718fb943ef50228efaa460f0d9079accba468908a8cb7a7eecf9","speedup":4.560829340514713,"stratum":"4-8","sampling_key":"b18e1611d6468eb9afc265fd6fb820fb493a3ce233e1ee90a8ed807d0d1f735e","slow_code":"MOD = 10**9 + 7\nN, M = list(map(int, input().split()))\na = [int(eval(input())) for k in range(M)]\ndp = [0] * (N + 2)\ndp[0] = 1\nfor e in a:\n dp[e] = -1\nfor k in range(N):\n if dp[k] != -1:\n if dp[k + 1] != -1:\n dp[k + 1] += dp[k]\n dp[k + 1] %= MOD\n if dp[k + 2] != -1:\n dp[k + 2] += dp[k]\n dp[k + 2] %= MOD\nprint((max(0, dp[N])))\n","fast_code":"import sys\n\nN, M = list(map(int, input().split()))\nif M == 0:\n alist = set()\nelse:\n\n alist = set(map(int, sys.stdin))\ndp = [0] * (N + 1)\ndp[0] = 1\ndp[1] = 1 if 1 not in alist else 0\nMOD = 10**9 + 7\nfor i in range(2, N + 1):\n if i in alist:\n continue\n dp[i] = (dp[i - 1] + dp[i - 2]) % MOD\nprint((dp[N]))\n"} +{"fast_code_id":"2ce60f1a1408c3c92e7f5201027a60a54ca6f2defd056d05b14b5e80301f91f7","fast_id":"p02703_2ce60f1a1408c3c92e7f5201027a60a54ca6f2defd056d05b14b5e80301f91f7","language":"python","measured_fast_code_id":"2ce60f1a1408c3c92e7f5201027a60a54ca6f2defd056d05b14b5e80301f91f7","measured_slow_code_id":"13ddc35e7eb74d73b0b3c8f42eca38b92bc94e091a7090e12213a091ef6feb16","measurement_metric":"cpu_instruction_count","pair_id":"python_a5f8133381d2e24be256df5a","problem_id":"p02703","slow_code_id":"8367a3613f4d9a1208ac0ab45c2708eb9c7ae580813c618185432ad6e30b1042","slow_id":"p02703_13ddc35e7eb74d73b0b3c8f42eca38b92bc94e091a7090e12213a091ef6feb16","speedup":4.8521070024280775,"stratum":"4-8","sampling_key":"facaa8497c736c10984bee7924cd14c3cab0c841b25202ddb1301ea3aeacd550","slow_code":"import sys\nfrom heapq import heappush, heappop\nimport numpy as np\n\n\ndef input():\n return sys.stdin.readline().rstrip()\n\n\ndef ii():\n return int(input())\n\n\ndef mi():\n return map(int, input().split())\n\n\ndef li():\n return list(mi())\n\n\ndef main():\n def dijkstra(s):\n def push(v, s, x):\n if s < 0:\n return\n if dist[v, s] <= x:\n return\n dist[v, s] = x\n heappush(que, (x, v, s))\n\n inf = 10**18\n dist = np.full((n, MAX_S + 1), inf, dtype=int)\n\n que = []\n push(0, s, 0)\n while que:\n x, v, s = heappop(que)\n if dist[v, s] < x:\n continue\n ns = min(s + c[v], MAX_S)\n push(v, ns, x + d[v])\n for nv, a, b in adj[v]:\n push(nv, s - a, x + b)\n return np.min(dist, axis=1)\n\n n, m, s = mi()\n adj = [[] for i in range(n)]\n MAX_S = 0\n for i in range(m):\n u, v, a, b = mi()\n u -= 1\n v -= 1\n adj[u].append((v, a, b))\n adj[v].append((u, a, b))\n MAX_S = max(MAX_S, a)\n MAX_S *= n - 1\n s = min(s, MAX_S)\n c, d = [0] * n, [0] * n\n for i in range(n):\n c[i], d[i] = mi()\n ans = dijkstra(s)\n print(*ans[1:], sep=\"\\n\")\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"from heapq import heappush, heappop\n\nN, M, S = list(map(int, input().split()))\nmxCost = 0\nedges = [[] for _ in range(N)]\nfor _ in range(M):\n fr, to, cost, dist = list(map(int, input().split()))\n mxCost = max(mxCost, cost)\n fr -= 1\n to -= 1\n edges[fr].append((to, dist, cost))\n edges[to].append((fr, dist, cost))\nfor i in range(N):\n C, D = list(map(int, input().split()))\n edges[i].append((i, D, -C))\nque = [(0, S, 0)]\nmxCost *= N - 1\nminDsit = [[10**18] * (mxCost + 1) for _ in range(N)]\nminDsit[0][0] = 0\nwhile que:\n dist, s, now = heappop(que)\n for to, d, c in edges[now]:\n cost = min(mxCost, s - c)\n if cost < 0 or minDsit[to][cost] <= dist + d:\n continue\n minDsit[to][cost] = dist + d\n heappush(que, (dist + d, cost, to))\nfor dist in minDsit[1:]:\n print((min(dist)))\n"} +{"fast_code_id":"a09754325312e1df7322770a3cdfe2dba0c5ba1251b53934de3312ab935cea19","fast_id":"p03419_a09754325312e1df7322770a3cdfe2dba0c5ba1251b53934de3312ab935cea19","language":"python","measured_fast_code_id":"a09754325312e1df7322770a3cdfe2dba0c5ba1251b53934de3312ab935cea19","measured_slow_code_id":"03759bbd848f3c06ca221a2e3cc07d0592161ce2c92214006d02107382720a3e","measurement_metric":"cpu_instruction_count","pair_id":"python_a67f40829b5a5f19cfb0a279","problem_id":"p03419","slow_code_id":"03759bbd848f3c06ca221a2e3cc07d0592161ce2c92214006d02107382720a3e","slow_id":"p03419_03759bbd848f3c06ca221a2e3cc07d0592161ce2c92214006d02107382720a3e","speedup":3.0530027234700916,"stratum":"2-4","sampling_key":"f265db2dd2ba06d8eecb35fd38c0835a14fc32d8540e7263637b3fbad42db980","slow_code":"def calc0(N, M):\n cell = [[0 for i in range(M)] for j in range(N)]\n for i in range(M):\n for j in range(N):\n for y in range(-1, 2):\n for x in range(-1, 2):\n xx = i + x\n yy = j + y\n if 0 <= xx < M and 0 <= yy < N:\n cell[yy][xx] ^= 1\n r = 0\n for i in range(M):\n for j in range(N):\n if cell[j][i]:\n r += 1\n return r\n\n\ndef calc(N, M):\n if N == 1 and M == 1:\n return 1\n if N >= 2 and M >= 2:\n return (N - 2) * (M - 2)\n if N == 1:\n return M - 2\n return N - 2\n\n\nN, M = [int(_) for _ in input().split()]\nprint((calc(N, M)))\n","fast_code":"import math\nimport sys\nimport collections\nimport bisect\n\nreadline = sys.stdin.readline\n\n\ndef main():\n n, m = list(map(int, readline().rstrip().split()))\n print((abs((m - 2) * (n - 2))))\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"44be25f53df0ca596505e4d9b67f2cfd23a3c35d2b23c46b5226914d16aa5a4d","fast_id":"p00008_44be25f53df0ca596505e4d9b67f2cfd23a3c35d2b23c46b5226914d16aa5a4d","language":"python","measured_fast_code_id":"44be25f53df0ca596505e4d9b67f2cfd23a3c35d2b23c46b5226914d16aa5a4d","measured_slow_code_id":"f78324b8c1f2014a7fb42b155a7df64e78b2806e6504b01d6dd4fa1d3a1e1f70","measurement_metric":"cpu_instruction_count","pair_id":"python_a724dfd469c3e79672dd11a8","problem_id":"p00008","slow_code_id":"f78324b8c1f2014a7fb42b155a7df64e78b2806e6504b01d6dd4fa1d3a1e1f70","slow_id":"p00008_f78324b8c1f2014a7fb42b155a7df64e78b2806e6504b01d6dd4fa1d3a1e1f70","speedup":3112.918996021851,"stratum":"8+","sampling_key":"4dae9a86b1306b21703d6bad53e91456ccebb9446c465eec7f8a5a408d89f6b0","slow_code":"import sys, itertools\n\nfor n in map(int, sys.stdin):\n x = 0\n for num in itertools.product(\"0123456789\", repeat=4):\n eq = \"{}+{}+{}+{}\".format(*(num))\n if eval(eq) == n:\n x += 1\n print(x)\n","fast_code":"import sys\nimport math\n\n\ndef nCr(n, k):\n if 0 <= k <= n:\n nk, kk = 1, 1\n for t in range(1, min(k, n - k) + 1):\n nk = nk * n\n kk = kk * t\n n -= 1\n return nk // kk\n else:\n return 0\n\n\np = [0] * 51\nv = 0\nfor i in range(19):\n t = nCr(i + 3, i)\n v = v + 4 * nCr(i - 8, i - 10)\n p[i] = t - v\n p[36 - i] = p[i]\nfor i in sys.stdin:\n print((p[int(i)]))\n"} +{"fast_code_id":"5f22003ad9129e73631d6ea547af7cf898b1e7d148c95168a27f869fed543af2","fast_id":"p03212_5f22003ad9129e73631d6ea547af7cf898b1e7d148c95168a27f869fed543af2","language":"python","measured_fast_code_id":"5f22003ad9129e73631d6ea547af7cf898b1e7d148c95168a27f869fed543af2","measured_slow_code_id":"9b823eea975a23a20587bc34ffa695ba9d6a5f099d4923f94ee756f58c3ecb65","measurement_metric":"cpu_instruction_count","pair_id":"python_a73465805fb1915d211a3171","problem_id":"p03212","slow_code_id":"9b823eea975a23a20587bc34ffa695ba9d6a5f099d4923f94ee756f58c3ecb65","slow_id":"p03212_9b823eea975a23a20587bc34ffa695ba9d6a5f099d4923f94ee756f58c3ecb65","speedup":5.450261257036899,"stratum":"4-8","sampling_key":"e3cde26291c6625444b9f53ac61088dcef82e856bd80cb5d9f1c896f056a2617","slow_code":"import copy\n\nword = \"753\"\n\n\ndef dfs(n):\n ret = 0\n num = 0 if not n else int(\"\".join(n))\n if N < num:\n return ret\n ret += 1 if len(set(\"\".join(n)) & set(word)) == len(word) else 0\n for c in word:\n tmp = copy.deepcopy(n)\n n.append(c)\n ret += dfs(n)\n n = tmp\n return ret\n\n\nN = int(eval(input()))\nprint((dfs([])))\n","fast_code":"import itertools\n\nn = int(eval(input()))\ndigits = [3, 5, 7]\n\n\ndef count(digits, n):\n A = []\n p = 3\n while True:\n for tup in itertools.product(digits, repeat=p):\n a = int(\"\".join(list(map(str, tup))))\n if a > n:\n break\n A.append(a)\n else:\n p += 1\n continue\n break\n return A\n\n\nlst = count(digits, n)\ncnt = 0\nfor v in lst:\n if all(str(v).count(c) > 0 for c in \"753\"):\n cnt += 1\nprint(cnt)\n"} +{"fast_code_id":"9a4e48d010df096778c13e4189307ca0404591874cbaa1e68ac325838f5c578d","fast_id":"p03576_9a4e48d010df096778c13e4189307ca0404591874cbaa1e68ac325838f5c578d","language":"python","measured_fast_code_id":"9a4e48d010df096778c13e4189307ca0404591874cbaa1e68ac325838f5c578d","measured_slow_code_id":"146890d7ea4c911960fefc2e44f08fc85d507e64dfaaafffaee3a881578f824a","measurement_metric":"cpu_instruction_count","pair_id":"python_a759d831b98a1c8c5dbe96e3","problem_id":"p03576","slow_code_id":"146890d7ea4c911960fefc2e44f08fc85d507e64dfaaafffaee3a881578f824a","slow_id":"p03576_146890d7ea4c911960fefc2e44f08fc85d507e64dfaaafffaee3a881578f824a","speedup":6.286284793066686,"stratum":"4-8","sampling_key":"133b49dd4343a61bebcc25f58d6732c38249b5838a90a25e982bf4ea601da14b","slow_code":"N, K = list(map(int, input().split()))\nXY = [list(map(int, input().split())) for _ in [0] * N]\niX = sorted(x for x, y in XY)\niY = sorted(y for x, y in XY)\nX = {x: i for i, x in enumerate(iX)}\nY = {y: i for i, y in enumerate(iY)}\nc = [[0] * (N + 1) for i in [0] * (N + 1)]\nfor x, y in XY:\n c[Y[y] + 1][X[x] + 1] = 1\nfor i in range(N):\n for j in range(N):\n c[i + 1][j + 1] += c[i + 1][j]\nfor i in range(N):\n for j in range(N):\n c[i + 1][j + 1] += c[i][j + 1]\nans = 10**20\nfor l in range(N):\n for r in range(l + 1, N):\n u = 0\n d = 1\n dX = iX[r] - iX[l]\n while d < N:\n if c[d + 1][r + 1] + c[u][l] - c[u][r + 1] - c[d + 1][l] >= K:\n ans = min(ans, dX * (iY[d] - iY[u]))\n u += 1\n else:\n d += 1\nprint(ans)\n","fast_code":"N, K = list(map(int, input().split()))\nXY = [list(map(int, input().split())) for _ in range(N)]\nXY.sort()\nr = 10**20\nfor xi0 in range(N - K + 1):\n for xi1 in range(K + xi0 - 1, N):\n x = XY[xi1][0] - XY[xi0][0]\n XY_ys = sorted(XY[xi0 : xi1 + 1], key=lambda a: a[1])\n for yi0 in range(len(XY_ys) - K + 1):\n y = XY_ys[yi0 + K - 1][1] - XY_ys[yi0][1]\n r = min(r, x * y)\nprint(r)\n"} +{"fast_code_id":"37c64c843161b92469540d6a1ec2a29d2c5b7047a3f26ff46e602802a6763f12","fast_id":"p02760_37c64c843161b92469540d6a1ec2a29d2c5b7047a3f26ff46e602802a6763f12","language":"python","measured_fast_code_id":"37c64c843161b92469540d6a1ec2a29d2c5b7047a3f26ff46e602802a6763f12","measured_slow_code_id":"3154046e3b0b642e21542a63081b5e907301002ff4b0c284741cdd49a042b9c6","measurement_metric":"cpu_instruction_count","pair_id":"python_a79148d8cc48910c3cf05d42","problem_id":"p02760","slow_code_id":"3154046e3b0b642e21542a63081b5e907301002ff4b0c284741cdd49a042b9c6","slow_id":"p02760_3154046e3b0b642e21542a63081b5e907301002ff4b0c284741cdd49a042b9c6","speedup":2.796009888142488,"stratum":"2-4","sampling_key":"c453174adcf0262d36d9f473a10e2c6f24d991e5364764eb8fa3c724f0a9011e","slow_code":"f = lambda a: any(all(b) for b in a) | all(a[i][i] for i in (0, 1, 2))\na = eval(\"list(map(int,input().split())),\" * 3)\nexec(\"b=int(input());a=[[u*(u!=b)for u in t]for t in a];\" * int(eval(input())))\na = [[not u for u in t] for t in a]\nprint((\"NYoe s\"[f(a) | f([t[::-1] for t in zip(*a)]) :: 2]))\n","fast_code":"(*a,) = list(map(int, open(0).read().split()))\nprint(\n (\n \"NYoe s\"[\n any(\n t <= set(a.index(b) for b in a[10:])\n for t in (\n {0, 1, 2},\n {0, 3, 6},\n {0, 4, 8},\n {1, 4, 7},\n {2, 4, 6},\n {2, 5, 8},\n {3, 4, 5},\n {6, 7, 8},\n )\n ) :: 2\n ]\n )\n)\n"} +{"fast_code_id":"70ddd5f840b4cf045630f383c5a4dc0b67936d1255ea8e844b2833042d45ffc1","fast_id":"p03025_afdc02d7fb2abeb1970c2a5c2791e7792fd3f3e6fc1ceb09e19fccefdfb05385","language":"python","measured_fast_code_id":"afdc02d7fb2abeb1970c2a5c2791e7792fd3f3e6fc1ceb09e19fccefdfb05385","measured_slow_code_id":"1a12b8ea879f96b088964b1f0aad1794bc8494b3705ba8644097e802ebbf8368","measurement_metric":"cpu_instruction_count","pair_id":"python_a7a5514f12f513764a85d1ea","problem_id":"p03025","slow_code_id":"4beee02380c6c3585bdb6fc92af0f09ee4640bc8f85fad5bb75630ccb510c7e7","slow_id":"p03025_1a12b8ea879f96b088964b1f0aad1794bc8494b3705ba8644097e802ebbf8368","speedup":5.561137947530671,"stratum":"4-8","sampling_key":"538074979e7a41d07b71226eefada97793c1ca926afdcecc14c8c89f209f0686","slow_code":"class Combination:\n\n def __init__(self, n, MOD):\n self.fact = [1]\n for i in range(1, n + 1):\n self.fact.append(self.fact[-1] * i % MOD)\n self.inv_fact = [0] * (n + 1)\n self.inv_fact[n] = pow(self.fact[n], MOD - 2, MOD)\n for i in reversed(list(range(n))):\n self.inv_fact[i] = self.inv_fact[i + 1] * (i + 1) % MOD\n self.MOD = MOD\n\n def factorial(self, k):\n return self.fact[k]\n\n def inverse_factorial(self, k):\n return self.inv_fact[k]\n\n def permutation(self, k, r):\n if k < r:\n return 0\n return (self.fact[k] * self.inv_fact[k - r]) % self.MOD\n\n def combination(self, k, r):\n if k < r:\n return 0\n return (self.fact[k] * self.inv_fact[k - r] * self.inv_fact[r]) % self.MOD\n\n\nn, a, b, c = list(map(int, input().split()))\nMOD = 10**9 + 7\ncomb = Combination(10**6, MOD)\npa = a * pow(a + b, MOD - 2, MOD) % MOD\npb = b * pow(a + b, MOD - 2, MOD) % MOD\nec = 100 * pow(100 - c, MOD - 2, MOD) % MOD\nans1 = 0\ntmp = pow(pa, n, MOD)\nfor i in range(n):\n ans1 += tmp * pow(pb, i, MOD) * comb.combination(n - 1 + i, i) * (n + i) * ec\n ans1 %= MOD\nans2 = 0\ntmp = pow(pb, n, MOD)\nfor i in range(n):\n ans2 += tmp * pow(pa, i, MOD) * comb.combination(n - 1 + i, i) * (n + i) * ec\n ans2 %= MOD\nprint(((ans1 + ans2) % MOD))\n","fast_code":"class Combination:\n\n def __init__(self, n, MOD):\n self.fact = [1]\n for i in range(1, n + 1):\n self.fact.append(self.fact[-1] * i % MOD)\n self.inv_fact = [pow(self.fact[i], MOD - 2, MOD) for i in range(n + 1)]\n self.MOD = MOD\n\n def factorial(self, k):\n return self.fact[k]\n\n def inverse_factorial(self, k):\n return self.inv_fact[k]\n\n def combination(self, k, r):\n return (self.fact[k] * self.inv_fact[k - r] * self.inv_fact[r]) % self.MOD\n\n\nfrom fractions import Fraction\n\nMOD = 10**9 + 7\nn, a, b, c = list(map(int, input().split()))\n\ncomb = Combination(2 * n, MOD)\nmod_li = [1]\nfor i in range(1, 2 * n + 1):\n mod_li.append(mod_li[-1] * (a + b) % MOD)\np1 = [1]\np2 = [1]\nfor i in range(1, n + 1):\n p1.append((p1[-1] * a) % MOD)\n p2.append((p2[-1] * b) % MOD)\nq = mod_li[2 * n - 1]\np = 0\nfor i in range(n):\n tmp_bunshi = (\n (n + i) * (mod_li[n - i - 1]) * p1[n] * p2[i] * comb.combination(n - 1 + i, i)\n )\n tmp_bunshi += (\n (n + i) * (mod_li[n - i - 1]) * p2[n] * p1[i] * comb.combination(n - 1 + i, i)\n )\n p += tmp_bunshi\n p %= MOD\np *= 100\nq *= a + b\nans = Fraction(p, q)\np = ans.numerator\nq = ans.denominator\nprint(((pow(q, MOD - 2, MOD) * p) % MOD))\n"} +{"fast_code_id":"ad15dfc499da082f4d9ae1e4bd642828f2041a0f8458603ec4a6a281e75788aa","fast_id":"p02831_a9ccc957e4a5b3baec5986744f600e314f6759e39921b5a2449786c280ec9aa7","language":"python","measured_fast_code_id":"a9ccc957e4a5b3baec5986744f600e314f6759e39921b5a2449786c280ec9aa7","measured_slow_code_id":"3de3fe8bb1afacef9e4d94cddd67b61d71115eb2182c7ba15fc5dcbd918bfe9c","measurement_metric":"cpu_instruction_count","pair_id":"python_a7bf3b340074b3420700dca1","problem_id":"p02831","slow_code_id":"3de3fe8bb1afacef9e4d94cddd67b61d71115eb2182c7ba15fc5dcbd918bfe9c","slow_id":"p02831_3de3fe8bb1afacef9e4d94cddd67b61d71115eb2182c7ba15fc5dcbd918bfe9c","speedup":3.3620162362294628,"stratum":"2-4","sampling_key":"6cf9193ff3ecb99ca8743b776772ad341eecd1160b650cc726b01cc8168cd11f","slow_code":"a, b = list(map(int, input().split()))\ngcd = 0\nfor i in range(max(a, b), 0, -1):\n if a % i == 0 and b % i == 0:\n gcd = i\n break\nprint((a * b // gcd))\n","fast_code":"a, b = list(map(int, input().split()))\n\n\nlcm = 0\nfor i in range(1, b + 1):\n if (a * i) % b == 0:\n lcm = a * i\n break\nprint(lcm)\n"} +{"fast_code_id":"75037892fbe0d3f8ec2f6cad07c769abb92a7779fb94ebaf53c5f1ef1cf5a970","fast_id":"p03330_2bf84a04b2c862b8fc6cada5361225248d707fa385c9679c1031ce69470c3f9c","language":"python","measured_fast_code_id":"2bf84a04b2c862b8fc6cada5361225248d707fa385c9679c1031ce69470c3f9c","measured_slow_code_id":"b97bdcab53517dc8917d09f39912f401cd28969a8fb4fb761200b0bf70667016","measurement_metric":"cpu_instruction_count","pair_id":"python_a833e9c6ff1b9e18d71c7f09","problem_id":"p03330","slow_code_id":"b97bdcab53517dc8917d09f39912f401cd28969a8fb4fb761200b0bf70667016","slow_id":"p03330_b97bdcab53517dc8917d09f39912f401cd28969a8fb4fb761200b0bf70667016","speedup":2.6336808513927825,"stratum":"2-4","sampling_key":"e19718fb46f396e011aa8811044810d38cac4a1449f038ba79e99bfe5fc04120","slow_code":"from itertools import *\n\nN, C = list(map(int, input().split()))\nD = [list(map(int, input().split())) for _ in [0] * C]\ntri = [[0] * C for _ in [0] * 3]\nfor i in range(N):\n for j, x in enumerate(map(int, input().split())):\n tri[(i + j) % 3][x - 1] += 1\nres = 1 << 30\nfor p in permutations(list(range(C)), 3):\n tt = sum(D[l][p[m]] * tri[m][l] for l in range(C) for m in range(3))\n if tt < res:\n res = tt\nprint(res)\n","fast_code":"from collections import Counter, defaultdict, deque\nimport sys, heapq, bisect, math, itertools, string, queue\n\nsys.setrecursionlimit(10**8)\nmod = 10**9 + 7\n\n\ndef inp():\n return int(sys.stdin.readline())\n\n\ndef inpl():\n return list(map(int, sys.stdin.readline().split()))\n\n\ndef inpl_str():\n return list(sys.stdin.readline().split())\n\n\ndef inpln(n):\n return list(int(sys.stdin.readline()) for i in range(n))\n\n\nn, C = inpl()\nd = []\nc = []\nfor i in range(C):\n d.append(inpl())\nfor i in range(n):\n c.append(inpl())\nd0 = defaultdict(int)\nd1 = defaultdict(int)\nd2 = defaultdict(int)\ndd = [d0, d1, d2]\nfor y in range(n):\n for x in range(n):\n t = (x + y + 2) % 3\n dd[t][c[x][y]] += 1\n\nres = [[] for i in range(3)]\nfor i in range(C):\n for j in range(3):\n tmp = 0\n for key in list(dd[j].keys()):\n tmp += d[key - 1][i] * dd[j][key]\n res[j].append([i, tmp])\nfor i in range(3):\n res[i].sort(key=lambda x: x[1])\n\nans = mod\nfor i in range(3):\n for j in range(3):\n for k in range(3):\n if (\n res[0][i][0] == res[1][j][0]\n or res[0][i][0] == res[2][k][0]\n or res[2][k][0] == res[1][j][0]\n ):\n continue\n ans = min(res[0][i][1] + res[1][j][1] + res[2][k][1], ans)\nprint(ans)\n"} +{"fast_code_id":"563884c909984690cb17a4a75e13aa643e22ac803dadb5d6eff6d3b364daf2a3","fast_id":"p02551_563884c909984690cb17a4a75e13aa643e22ac803dadb5d6eff6d3b364daf2a3","language":"python","measured_fast_code_id":"563884c909984690cb17a4a75e13aa643e22ac803dadb5d6eff6d3b364daf2a3","measured_slow_code_id":"4a16bff7c31cffdfdbe77a06643bb78fef98086e135ad4345038314f484d3403","measurement_metric":"cpu_instruction_count","pair_id":"python_a8595ea89cb441e6e7350f78","problem_id":"p02551","slow_code_id":"c5b27d123eb4be603fe8509dc52f382f0edbaa108b801cde25d5e3518e703c95","slow_id":"p02551_4a16bff7c31cffdfdbe77a06643bb78fef98086e135ad4345038314f484d3403","speedup":4.5648680088437965,"stratum":"4-8","sampling_key":"b1dc15991a9230781d8d674464013ed21d62252ac6a3d7a0589e41d6377ac82a","slow_code":"import sys\n\nread = sys.stdin.read\nreadline = sys.stdin.readline\nreadlines = sys.stdin.readlines\nsys.setrecursionlimit(10**9)\nMOD = 1000000007\n\n\ndef main():\n N, Q, *queries = list(map(int, read().split()))\n queries = [(q, x) for q, x in zip(*[iter(queries)] * 2)]\n N -= 2\n\n N0 = 2 ** (N - 1).bit_length()\n data1 = [None] * (2 * N0)\n data2 = [None] * (2 * N0)\n INF = (-1, 2**31 - 1)\n\n def update(l, r, v, data):\n L = l + N0\n R = r + N0\n while L < R:\n if R & 1:\n R -= 1\n data[R - 1] = v\n if L & 1:\n data[L - 1] = v\n L += 1\n L >>= 1\n R >>= 1\n\n def _query(k, data):\n k += N0 - 1\n s = INF\n while k >= 0:\n if data[k]:\n s = max(s, data[k])\n k = (k - 1) // 2\n return s\n\n def query(k, data):\n return _query(k, data)[1]\n\n update(0, N, (0, N), data1)\n update(0, N, (0, N), data2)\n min1 = min2 = N + 10\n ans = N * N\n for i, (q, x) in enumerate(queries, 1):\n x -= 2\n if q == 1:\n data = data1\n this_min = min1\n else:\n data = data2\n this_min = min2\n n = query(x, data)\n ans -= n\n if x > this_min:\n continue\n if q == 1:\n min1 = x\n update(0, n, (i, x), data2)\n else:\n min2 = x\n update(0, n, (i, x), data1)\n print(ans)\n return\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"import sys\n\nread = sys.stdin.read\nreadline = sys.stdin.readline\nreadlines = sys.stdin.readlines\nsys.setrecursionlimit(10**9)\nINF = 1 << 60\nMOD = 1000000007\n\n\ndef main():\n N, Q, *query = list(map(int, read().split()))\n N -= 2\n row = [N] * N\n col = [N] * N\n R = C = N\n ans = N * N\n for q, x in zip(*[iter(query)] * 2):\n x -= 2\n if q == 1:\n if x < C:\n ans -= R\n for i in range(x + 1, C):\n col[i] = R\n C = x\n else:\n ans -= col[x]\n else:\n if x < R:\n ans -= C\n for i in range(x + 1, R):\n row[i] = C\n R = x\n else:\n ans -= row[x]\n print(ans)\n return\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"7b65ce7c8cfec26519b219bbd130a2c05d2710fbb65b5601e710e851beb3cb51","fast_id":"p02595_7b65ce7c8cfec26519b219bbd130a2c05d2710fbb65b5601e710e851beb3cb51","language":"python","measured_fast_code_id":"7b65ce7c8cfec26519b219bbd130a2c05d2710fbb65b5601e710e851beb3cb51","measured_slow_code_id":"ef9b13257bf49f45e3c49048c3a0875a7acc9a930632fbb416a4695efd001a7c","measurement_metric":"cpu_instruction_count","pair_id":"python_a8724f1402e1fd75611f19eb","problem_id":"p02595","slow_code_id":"ef9b13257bf49f45e3c49048c3a0875a7acc9a930632fbb416a4695efd001a7c","slow_id":"p02595_ef9b13257bf49f45e3c49048c3a0875a7acc9a930632fbb416a4695efd001a7c","speedup":3.0149141193509448,"stratum":"2-4","sampling_key":"370bff342746d41dbb6f55d63e908e6c0c3714427088065715d19fdd87b0f35f","slow_code":"from decimal import *\n\ngetcontext().prec = 14\nN, D = list(map(int, input().split()))\n\n\ndef distance(x1, x2, y1, y2):\n dx = x2 - x1\n dy = y2 - y1\n return (dx * dx + dy * dy).sqrt()\n\n\nX = [0] * N\nY = [0] * N\nans = 0\nfor i in range(N):\n X[i], Y[i] = list(map(Decimal, input().split()))\n if distance(0, X[i], 0, Y[i]) <= D:\n ans += 1\nprint(ans)\n","fast_code":"n, d = list(map(int, input().split()))\nd = d**2\ncount = 0\nfor i in range(n):\n p = list(map(int, input().split()))\n dis = p[0] ** 2 + p[1] ** 2\n if dis <= d:\n count += 1\nprint(count)\n"} +{"fast_code_id":"6ab406159b06b4769539391971513611e79bee09dae7cc1993ecf9956d9a30cc","fast_id":"p02695_6ab406159b06b4769539391971513611e79bee09dae7cc1993ecf9956d9a30cc","language":"python","measured_fast_code_id":"6ab406159b06b4769539391971513611e79bee09dae7cc1993ecf9956d9a30cc","measured_slow_code_id":"4876c20eabffbc9ea2c633c2d996da20261178a9a9451926be7fe13405bb8582","measurement_metric":"cpu_instruction_count","pair_id":"python_a8f4436738d6008d1a7bc614","problem_id":"p02695","slow_code_id":"4876c20eabffbc9ea2c633c2d996da20261178a9a9451926be7fe13405bb8582","slow_id":"p02695_4876c20eabffbc9ea2c633c2d996da20261178a9a9451926be7fe13405bb8582","speedup":7.271736987774568,"stratum":"4-8","sampling_key":"b8c311c4973e9a56135b126b861beff5d25246ab0c17712548235d02c85d3ed7","slow_code":"n, m, q = list(map(int, input().split()))\nl = []\nfor i in range(q):\n l1, l2, l3, l4 = list(map(int, input().split()))\n l.append([l1, l2, l3, l4])\nB = []\nfor a in range(1, m + 1):\n for b in range(a, m + 1):\n for c in range(b, m + 1):\n for d in range(c, m + 1):\n for e in range(d, m + 1):\n for f in range(e, m + 1):\n for g in range(f, m + 1):\n for h in range(g, m + 1):\n for i in range(h, m + 1):\n for j in range(i, m + 1):\n L = [a, b, c, d, e, f, g, h, i, j]\n A = []\n for I in range(n):\n A.append(L[I])\n C = 0\n for k in range(q):\n if (\n A[l[k][1] - 1] - A[l[k][0] - 1]\n == l[k][2]\n ):\n C += l[k][3]\n B.append(C)\nprint((max(B)))\n","fast_code":"def resolve():\n import itertools\n\n n, m, q = list(map(int, input().split()))\n cond = [list(map(int, input().split())) for _ in range(q)]\n ans = 0\n for i in list(itertools.combinations_with_replacement(list(range(1, m + 1)), n)):\n point = 0\n for j in range(q):\n if i[cond[j][1] - 1] - i[cond[j][0] - 1] == cond[j][2]:\n point += cond[j][3]\n ans = max(ans, point)\n print(ans)\n\n\nresolve()\n"} +{"fast_code_id":"be4bf099d4925b23bdb6f325ad17943faa753fc5add8694a2b6b0e21a2989788","fast_id":"p03294_be4bf099d4925b23bdb6f325ad17943faa753fc5add8694a2b6b0e21a2989788","language":"python","measured_fast_code_id":"be4bf099d4925b23bdb6f325ad17943faa753fc5add8694a2b6b0e21a2989788","measured_slow_code_id":"13a0acff6be960ac2d9102d9dbcb9b4a40285e0396d51e99ee1149098593acf0","measurement_metric":"cpu_instruction_count","pair_id":"python_a9028adcd4be0c7ddd2637cd","problem_id":"p03294","slow_code_id":"13a0acff6be960ac2d9102d9dbcb9b4a40285e0396d51e99ee1149098593acf0","slow_id":"p03294_13a0acff6be960ac2d9102d9dbcb9b4a40285e0396d51e99ee1149098593acf0","speedup":6.929157403396712,"stratum":"4-8","sampling_key":"08a9359d903af768a4c1ffd46572caca76571d3568a2f3d855ce131515ce2cb3","slow_code":"import math\n\nn = int(eval(input()))\na = list(map(int, input().split()))\ncommon_num = 1\nfor num in a:\n common_num = (common_num * num) // math.gcd(common_num, num)\ntotal = 0\nfor num in a:\n total += (common_num - 1) % num\nprint(total)\n","fast_code":"n = int(eval(input()))\na = list(map(int, input().split()))\nprint((sum(a) - len(a)))\n"} +{"fast_code_id":"05b99b52034db21973a41e2c43ba5b5ea7e7f5eb9b31d85f0efcbe09a481db0e","fast_id":"p02607_05b99b52034db21973a41e2c43ba5b5ea7e7f5eb9b31d85f0efcbe09a481db0e","language":"python","measured_fast_code_id":"05b99b52034db21973a41e2c43ba5b5ea7e7f5eb9b31d85f0efcbe09a481db0e","measured_slow_code_id":"80d5226038bdb32cf21a0b535cbd1c7092e4e8009586ccf346a6a6f305bc5b7d","measurement_metric":"cpu_instruction_count","pair_id":"python_a90f41af02c9cad7a05298fe","problem_id":"p02607","slow_code_id":"80d5226038bdb32cf21a0b535cbd1c7092e4e8009586ccf346a6a6f305bc5b7d","slow_id":"p02607_80d5226038bdb32cf21a0b535cbd1c7092e4e8009586ccf346a6a6f305bc5b7d","speedup":894.59645128046,"stratum":"8+","sampling_key":"107ef0545c299a489e5d062429757efa9b239d03897f9be36e7c709648b13a4d","slow_code":"import sys\nfrom collections import deque\nimport numpy as np\nimport math\n\nsys.setrecursionlimit(10**6)\n\n\ndef S():\n return sys.stdin.readline().rstrip()\n\n\ndef SL():\n return list(map(str, sys.stdin.readline().rstrip().split()))\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\ndef IL():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef Main():\n n = I()\n a = list(IL())\n c = 0\n for rep in range(0, n, 2):\n if a[rep] % 2:\n c += 1\n print(c)\n return\n\n\nif __name__ == \"__main__\":\n Main()\n","fast_code":"N = int(eval(input()))\na = list(map(int, input().split()))\ncnt = 0\nfor i in range(0, N):\n if (i + 1) % 2 != 0 and a[i] % 2 != 0:\n cnt += 1\nprint(cnt)\n"} +{"fast_code_id":"3ed535ed0bc6c202b0386a960b00e5549d575062c87ec6b3d7cedb112a9c2f5e","fast_id":"p02418_3ed535ed0bc6c202b0386a960b00e5549d575062c87ec6b3d7cedb112a9c2f5e","language":"python","measured_fast_code_id":"3ed535ed0bc6c202b0386a960b00e5549d575062c87ec6b3d7cedb112a9c2f5e","measured_slow_code_id":"4a465a7c40e8301396e930b29aaf192efcb0d409e3d2d3b58e59d606c0aba5fa","measurement_metric":"cpu_instruction_count","pair_id":"python_a9163a8265683c075e567224","problem_id":"p02418","slow_code_id":"a7502251daa34c9d1f4077de1ba0b7e4db196550bc7d1d061290578a54373e1c","slow_id":"p02418_4a465a7c40e8301396e930b29aaf192efcb0d409e3d2d3b58e59d606c0aba5fa","speedup":2.2802308203008734,"stratum":"2-4","sampling_key":"e44af3f6a024ac5829555535a2e2196dfce87e6c43fd94f8675e1b9cf8aaab79","slow_code":"import sys\nfrom sys import stdin\n\ninput = stdin.readline\n\n\ndef main(args):\n s = input().strip()\n p = input().strip()\n s = s + s[:-1]\n if p in s:\n print(\"Yes\")\n else:\n print(\"No\")\n\n\nif __name__ == \"__main__\":\n main(sys.argv[1:])\n","fast_code":"ring = input() * 2\nword = input()\nif word in ring:\n print(\"Yes\")\nelse:\n print(\"No\")\n"} +{"fast_code_id":"90a8e7a092d3d647e68284a992517f0cf8a5b33869de9bb095ba08ccc8da1867","fast_id":"p03860_90a8e7a092d3d647e68284a992517f0cf8a5b33869de9bb095ba08ccc8da1867","language":"python","measured_fast_code_id":"90a8e7a092d3d647e68284a992517f0cf8a5b33869de9bb095ba08ccc8da1867","measured_slow_code_id":"f9c7ff6ccba211df6aa7649f397d5aec3b7d4b68331ab1524aeb9717fd467838","measurement_metric":"cpu_instruction_count","pair_id":"python_a91df56c9b64af38d16b0933","problem_id":"p03860","slow_code_id":"f9c7ff6ccba211df6aa7649f397d5aec3b7d4b68331ab1524aeb9717fd467838","slow_id":"p03860_f9c7ff6ccba211df6aa7649f397d5aec3b7d4b68331ab1524aeb9717fd467838","speedup":3.0956358303577174,"stratum":"2-4","sampling_key":"4a81cb9889e79d2cab2ccc27f6c2f1037441976d5302d90681eec281dd029ab7","slow_code":"ls = input().split()\nLs = []\n\n\ndef fun():\n print(\"111\")\n print(\"222\")\n print(\"333\")\n print(\"ii\")\n\n\nfor i in ls:\n Ls.append(i[0])\nprint((\"\".join(Ls)))\n","fast_code":"print(f\"A{input()[8]}C\")\n"} +{"fast_code_id":"01b94821fe448881b6015dfe0bec24928fa98d0c3fa2a71c256b49869d0beae8","fast_id":"p03576_01b94821fe448881b6015dfe0bec24928fa98d0c3fa2a71c256b49869d0beae8","language":"python","measured_fast_code_id":"01b94821fe448881b6015dfe0bec24928fa98d0c3fa2a71c256b49869d0beae8","measured_slow_code_id":"c37097573bea4b5c04237e886abdd4d37c3a8d3f4d01d08098cdf33003c8759c","measurement_metric":"cpu_instruction_count","pair_id":"python_a91f1f1d11d978be839e9536","problem_id":"p03576","slow_code_id":"d66d7b778a3e5a0e4007f965d5b8414a5d4b9692dfea5c8fc25daf95cdc66857","slow_id":"p03576_c37097573bea4b5c04237e886abdd4d37c3a8d3f4d01d08098cdf33003c8759c","speedup":5.05805141030433,"stratum":"4-8","sampling_key":"8fcd860bd3bd612b634af9267f2b08ad65c7d592d77bb7be3e3cd3ee98536c3e","slow_code":"import bisect\nimport heapq\nimport math\nimport random\nimport sys\nfrom collections import Counter, defaultdict, deque\nfrom decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal\nfrom functools import lru_cache, reduce\nfrom itertools import combinations, combinations_with_replacement, product, permutations\nfrom operator import add, mul\n\nsys.setrecursionlimit(10000)\n\n\ndef read_int():\n return int(input())\n\n\ndef read_int_n():\n return list(map(int, input().split()))\n\n\ndef read_float():\n return float(input())\n\n\ndef read_float_n():\n return list(map(float, input().split()))\n\n\ndef read_str():\n return input()\n\n\ndef read_str_n():\n return list(map(str, input().split()))\n\n\ndef error_print(*args):\n print(*args, file=sys.stderr)\n\n\ndef mt(f):\n import time\n\n def wrap(*args, **kwargs):\n s = time.time()\n ret = f(*args, **kwargs)\n e = time.time()\n error_print(e - s, \"sec\")\n return ret\n\n return wrap\n\n\n@mt\ndef slv(N, K, XY):\n X = sorted(map(lambda x: x[0], XY))\n RX = X[::-1]\n Y = sorted(map(lambda x: x[1], XY))\n RY = Y[::-1]\n ans = sys.maxsize\n for lx in X:\n for rx in RX:\n if lx > rx:\n break\n for by in Y:\n for ty in RY:\n if by > ty:\n break\n k = 0\n for x, y in XY:\n if lx <= x <= rx and by <= y <= ty:\n k += 1\n if k >= K:\n ans = min(ans, (rx - lx) * (ty - by))\n else:\n break\n return ans\n\n\ndef main():\n N, K = read_int_n()\n XY = [read_int_n() for _ in range(N)]\n print(slv(N, K, XY))\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"N, K = list(map(int, input().split()))\npts = []\nys = []\nfor _ in range(N):\n x, y = list(map(int, input().split()))\n pts.append((x, y))\n ys.append(y)\npts.sort()\nys.sort()\nans = 10**20\nfor i, y1 in enumerate(ys):\n for y2 in ys[i + 1 :]:\n for j, (x1, _) in enumerate(pts):\n num = 0\n for x, y in pts[j:]:\n if y1 <= y <= y2:\n num += 1\n if num >= K:\n area = (x - x1) * (y2 - y1)\n ans = min(ans, area)\n break\nprint(ans)\n"} +{"fast_code_id":"8c459e8eff528e57c94dccca2cd52c2cfde0176c2128a06cf6977d6d2cf03785","fast_id":"p03212_8c459e8eff528e57c94dccca2cd52c2cfde0176c2128a06cf6977d6d2cf03785","language":"python","measured_fast_code_id":"8c459e8eff528e57c94dccca2cd52c2cfde0176c2128a06cf6977d6d2cf03785","measured_slow_code_id":"0673030745e51e0e71ea989ca56078e7009b913375c5bf3cc0e026cce49704f1","measurement_metric":"cpu_instruction_count","pair_id":"python_a9ae97070a9877ac9d847f08","problem_id":"p03212","slow_code_id":"0673030745e51e0e71ea989ca56078e7009b913375c5bf3cc0e026cce49704f1","slow_id":"p03212_0673030745e51e0e71ea989ca56078e7009b913375c5bf3cc0e026cce49704f1","speedup":4.061388007932409,"stratum":"4-8","sampling_key":"6eefe036ac7949eb68ffce26e6b6e516615fd8f2cad79957065f8f914057b4af","slow_code":"def DFS(n):\n if len(n) >= 3 and len(set(list(n)) & {\"3\", \"5\", \"7\"}) == 3:\n A.append(int(n))\n if len(n) < 10:\n for i in (\"3\", \"5\", \"7\"):\n DFS(n + i)\n\n\nn = int(eval(input()))\nA = []\nfor i in (\"3\", \"5\", \"7\"):\n DFS(i)\nA.sort()\ncnt = 0\nwhile 1:\n if A[cnt] <= n:\n cnt += 1\n else:\n break\nprint(cnt)\n","fast_code":"import itertools\n\nN = int(eval(input()))\nans = 0\nS = []\nfor i in range(10):\n S += list(itertools.product(\"357\", repeat=i))\nfor s in S:\n if len(set(s)) > 2 and int(\"\".join(s)) <= N:\n ans += 1\nprint(ans)\n"} +{"fast_code_id":"4e5c848edf0d2b333d09ea0bbad111222f40c6b56736c2a32c69fc1464fa22b0","fast_id":"p02729_4e5c848edf0d2b333d09ea0bbad111222f40c6b56736c2a32c69fc1464fa22b0","language":"python","measured_fast_code_id":"4e5c848edf0d2b333d09ea0bbad111222f40c6b56736c2a32c69fc1464fa22b0","measured_slow_code_id":"cceb77711a14726b9b2382bddd14ea9448a327cbb9328832bc3b11455366cb07","measurement_metric":"cpu_instruction_count","pair_id":"python_aa16d439d5df4da3f7ac6311","problem_id":"p02729","slow_code_id":"cceb77711a14726b9b2382bddd14ea9448a327cbb9328832bc3b11455366cb07","slow_id":"p02729_cceb77711a14726b9b2382bddd14ea9448a327cbb9328832bc3b11455366cb07","speedup":5.429053470854925,"stratum":"4-8","sampling_key":"6e3554f5d4a9f00d4bd1cdaab39a516a5bdc09706ea1b73e8d9daa79082c373f","slow_code":"a, b = list(map(int, input().split()))\nimport itertools\n\na1 = len(list(itertools.combinations(list(range(a)), 2)))\nb1 = len(list(itertools.combinations(list(range(b)), 2)))\nprint((a1 + b1))\n","fast_code":"N, M = list(map(int, input().split()))\nif N <= 1:\n a = 0\nelse:\n a = N * (N - 1) // 2\nif M <= 1:\n b = 0\nelse:\n b = M * (M - 1) // 2\nprint((a + b))\n"} +{"fast_code_id":"2db6114d8868543954780b0f30e058ad724a040726a8c570c9903718b31f8674","fast_id":"p03221_2db6114d8868543954780b0f30e058ad724a040726a8c570c9903718b31f8674","language":"python","measured_fast_code_id":"2db6114d8868543954780b0f30e058ad724a040726a8c570c9903718b31f8674","measured_slow_code_id":"bac932e565fc824f54938c4edcf17024edb8ebfd73deb80882c8006e56a416b6","measurement_metric":"cpu_instruction_count","pair_id":"python_aa4ee2fbcd3db86a841918fd","problem_id":"p03221","slow_code_id":"9a9b5b8d60f2f6a437fd75f31baba74dc5ed7ac13071d840e26b691e2ff91cac","slow_id":"p03221_bac932e565fc824f54938c4edcf17024edb8ebfd73deb80882c8006e56a416b6","speedup":4.607568119699838,"stratum":"4-8","sampling_key":"da1cf8c995e5c1ef16a2dc032dcf7a8bf179464d056779b973e94d7e382dc2f4","slow_code":"N, M = list(map(int, input().split()))\nP = []\nY = []\narr = [[] for j in range(10**5 + 1)]\nfor i in range(M):\n listA = list(map(int, input().split()))\n P.append(listA[0])\n Y.append(listA[1])\n arr[listA[0]].append(listA[1])\nfor i in range(N + 1):\n arr[i].sort()\nfor i in range(M):\n\n left = 0\n right = len(arr[P[i]]) - 1\n while left <= right:\n mid = (left + right) // 2\n if arr[P[i]][mid] == Y[i]:\n k = mid\n break\n elif arr[P[i]][mid] > Y[i]:\n right = mid - 1\n else:\n left = mid + 1\n print((str(P[i]).rjust(6, \"0\") + str(k + 1).rjust(6, \"0\")))\n","fast_code":"def main():\n from collections import defaultdict\n\n dd = defaultdict(str)\n n, m = list(map(int, input().split()))\n keys = []\n atcoder = [[] for _ in range(n)]\n for i in range(m):\n p, y = list(map(int, input().split()))\n key_p = str(p).zfill(6)\n key_y = str(y).zfill(10)\n keys.append(key_p + key_y)\n p -= 1\n atcoder[p].append(y)\n for i in range(n):\n atcoder[i].sort()\n key_i = str(i + 1).zfill(6)\n for index, j in enumerate(atcoder[i]):\n key_index = str(index + 1).zfill(6)\n key_j = str(j).zfill(10)\n dd[key_i + key_j] = key_i + key_index\n for k in keys:\n print((dd[k]))\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"a552d955fedb17d592f4edfa234441419df0bf3a474e8a60c93bef78c28feca1","fast_id":"p03061_a552d955fedb17d592f4edfa234441419df0bf3a474e8a60c93bef78c28feca1","language":"python","measured_fast_code_id":"a552d955fedb17d592f4edfa234441419df0bf3a474e8a60c93bef78c28feca1","measured_slow_code_id":"2d1ac3c9fc00324fbe7020d274a3ccaef85c4cb391d9f2865533fe63f653f25e","measurement_metric":"cpu_instruction_count","pair_id":"python_aa6a8841d12a179805ff3207","problem_id":"p03061","slow_code_id":"fb07db8e5e4b2567dc3a88a66ec68ddc15c21275b763c8b6a73c40b8a66faae8","slow_id":"p03061_2d1ac3c9fc00324fbe7020d274a3ccaef85c4cb391d9f2865533fe63f653f25e","speedup":4.160826163882304,"stratum":"4-8","sampling_key":"6680ae51af6580dc7a99f9ca18510041bf90895ed3ad265638112bdfbc324806","slow_code":"def gcdf(a):\n a.sort()\n a0 = a[0]\n a = [int(x % a0) for x in a if x % a0 != 0]\n if len(a) == 0:\n return a0\n else:\n a.append(a0)\n a0 = min(a)\n return gcdf(a)\n\n\nn = int(eval(input()))\na = list(map(int, input().split()))\nif n == 2:\n print((max(a)))\nelif n < 2**8:\n gcdv = 0\n for i in range(n):\n acpy = list(a)\n del acpy[i]\n gcdx = gcdf(acpy)\n if gcdx > gcdv:\n gcdv = gcdx\n print(gcdv)\nelse:\n m = int(n / 100)\n ns = int(n / m)\n rgcd = []\n for mi in range(m):\n ms = ns * mi\n if mi == m - 1:\n am = a[ms:n]\n else:\n am = a[ms : ms + ns]\n gcdm = gcdf(am)\n rgcd.append(gcdm)\n gcdv = 0\n for mi in range(m):\n rgcd1 = list(rgcd)\n del rgcd1[mi]\n gcdrg1 = gcdf(rgcd1)\n ms = ns * mi\n if mi == m - 1:\n am = a[ms:n]\n else:\n am = a[ms : ms + ns]\n\n for i in range(len(am)):\n acpy = list(am)\n\n acpy[i] = gcdrg1\n gcdx = gcdf(acpy)\n if gcdx > gcdv:\n gcdv = gcdx\n print(gcdv)\n","fast_code":"def gcd(x, y):\n if x < y:\n x, y = y, x\n if y == 0:\n return x\n return gcd(y, x % y)\n\n\nN = int(eval(input()))\nA = list(map(int, input().split()))\nL = [0]\nR = [0]\nM = []\nfor i in range(N):\n L.append(gcd(L[i], A[i]))\n R.append(gcd(R[i], A[N - i - 1]))\nR.reverse()\nprint((max([gcd(L[i], R[i + 1]) for i in range(N)])))\n"} +{"fast_code_id":"6abad5229f15e4f3d5f8e86d034bc2c33161ea6f180e5ff3b8525ac9920eafca","fast_id":"p02640_6abad5229f15e4f3d5f8e86d034bc2c33161ea6f180e5ff3b8525ac9920eafca","language":"python","measured_fast_code_id":"6abad5229f15e4f3d5f8e86d034bc2c33161ea6f180e5ff3b8525ac9920eafca","measured_slow_code_id":"b81aa7896b39a5e204fdfa9ca3f63685a6d18d86724afc22b841cf9b49e7766b","measurement_metric":"cpu_instruction_count","pair_id":"python_ab4329de4ace4cbfbfda36e2","problem_id":"p02640","slow_code_id":"ac09bdaf0871ab87a33221ec8a163d2052febe18d868feae44e613cae3f3a95f","slow_id":"p02640_b81aa7896b39a5e204fdfa9ca3f63685a6d18d86724afc22b841cf9b49e7766b","speedup":6.8420336275436435,"stratum":"4-8","sampling_key":"28dc25330070d8d1c16579540bd7e6c5d620ea9bd5ad6d14190315164376bd09","slow_code":"x, y = list(map(int, input().split()))\nfor i in range(0, 101):\n for j in range(0, 101):\n if i + j == x and i * 2 + j * 4 == y:\n print(\"Yes\")\n exit()\nprint(\"No\")\n","fast_code":"X, Y = [int(x) for x in input().split()]\ncheck = True\nif X * 4 < Y:\n check = False\nelif Y < 2 * X:\n check = False\nelif Y % 2 == 1:\n check = False\nif check:\n print(\"Yes\")\nelse:\n print(\"No\")\n"} +{"fast_code_id":"381c68a5710828c132f51f0dda6ed0e7e4aedc9227e7bd9deb6c6e6a2312b60c","fast_id":"p03343_381c68a5710828c132f51f0dda6ed0e7e4aedc9227e7bd9deb6c6e6a2312b60c","language":"python","measured_fast_code_id":"381c68a5710828c132f51f0dda6ed0e7e4aedc9227e7bd9deb6c6e6a2312b60c","measured_slow_code_id":"9d7afcc5f59d44fe48b93e1a0e26cc6f70642b27ac286eb6ac061aeb1465052e","measurement_metric":"cpu_instruction_count","pair_id":"python_ab9456c1556855f20e3c8a48","problem_id":"p03343","slow_code_id":"9d7afcc5f59d44fe48b93e1a0e26cc6f70642b27ac286eb6ac061aeb1465052e","slow_id":"p03343_9d7afcc5f59d44fe48b93e1a0e26cc6f70642b27ac286eb6ac061aeb1465052e","speedup":354.676103931764,"stratum":"8+","sampling_key":"05bb0f60d9d4de42a5beee53d8f1003316654b0c95c962b375f39d0a50ec2157","slow_code":"n, k, q, *a = list(map(int, open(0).read().split()))\ns = sorted\nm = 1e9\nfor b in a:\n i = [i for i, t in enumerate(a) if t < b]\n l = s(sum([s(a[i + 1 : j])[::-1][k - 1 :] for i, j in zip([-1] + i, i + [n])], []))\n if len(l) >= q:\n m = min(m, l[q - 1] - b)\nprint(m)\n","fast_code":"n, k, q = list(map(int, input().split()))\na = list(map(int, input().split()))\nd = [a]\na = sorted(a)\nans = a[q - 1] - a[0]\nwhile True:\n newd = list()\n li = list()\n for sub in d:\n for c in sub:\n if c != a[0]:\n li.append(c)\n else:\n newd.append(li)\n li = list()\n newd.append(li)\n li = list()\n d = list()\n a = list()\n for li in newd:\n if len(li) < k:\n continue\n else:\n d.append(li)\n li = sorted(li)\n a.extend(li[0 : len(li) - k + 1])\n a.sort()\n if len(a) >= q:\n ans = min(a[q - 1] - a[0], ans)\n else:\n break\nprint(ans)\n"} +{"fast_code_id":"8255152298f2af1d0c139a9953eddb5b41064a4c639271d3c0b3be7adef75af3","fast_id":"p03006_8255152298f2af1d0c139a9953eddb5b41064a4c639271d3c0b3be7adef75af3","language":"python","measured_fast_code_id":"8255152298f2af1d0c139a9953eddb5b41064a4c639271d3c0b3be7adef75af3","measured_slow_code_id":"80bd8fe5a1d57ee25fca567eef9b37cd0fc4680570648f6b89f79bd2df57d3ee","measurement_metric":"cpu_instruction_count","pair_id":"python_ab9fe722fa5976ddd577f0a2","problem_id":"p03006","slow_code_id":"80bd8fe5a1d57ee25fca567eef9b37cd0fc4680570648f6b89f79bd2df57d3ee","slow_id":"p03006_80bd8fe5a1d57ee25fca567eef9b37cd0fc4680570648f6b89f79bd2df57d3ee","speedup":5.86117862031984,"stratum":"4-8","sampling_key":"f86ae7bd6e251030c13895ea1bafea879fb3dfc8906a23e9b4d7eb3b09df4056","slow_code":"n = int(eval(input()))\narr = [list(map(int, input().split())) for _ in range(n)]\narr = sorted(arr, key=lambda x: x[1])\narr = sorted(arr, key=lambda x: x[0])\nans = n\nfor i in range(n):\n for j in range(i + 1, n):\n p, q = arr[j][0] - arr[i][0], arr[j][1] - arr[i][1]\n cnt = 0\n flag = [0] * n\n for k in range(n):\n if flag[k] == 1:\n continue\n flag[k] = 1\n a, b = arr[k][0], arr[k][1]\n while 1:\n for l in range(n):\n if flag[l] == 1:\n continue\n if a + p == arr[l][0] and b + q == arr[l][1]:\n flag[l] = 1\n a = arr[l][0]\n b = arr[l][1]\n break\n else:\n break\n cnt += 1\n ans = min(ans, cnt)\nprint(ans)\n","fast_code":"import itertools\n\nn = int(eval(input()))\nxy = []\nfor i in range(n):\n x, y = list(map(int, input().split()))\n xy.append([x, y])\na, b = [], []\nfor v in itertools.combinations(xy, 2):\n z = list(v)\n z.sort()\n x = z[1][0] - z[0][0]\n y = z[1][1] - z[0][1]\n a.append([x, y])\n if [x, y] in b:\n continue\n b.append([x, y])\nc = 0\nfor i in b:\n c = max(c, a.count(i))\nprint((n - c))\n"} +{"fast_code_id":"a620481f3b7cfeaa52614041350821475c36a00a00127dabad7a89fbc7099746","fast_id":"p03805_a620481f3b7cfeaa52614041350821475c36a00a00127dabad7a89fbc7099746","language":"python","measured_fast_code_id":"a620481f3b7cfeaa52614041350821475c36a00a00127dabad7a89fbc7099746","measured_slow_code_id":"562f6e02e8417832e28d70eb3bf85554d0ed3aeb8b43d97c409d2d577ce8e26f","measurement_metric":"cpu_instruction_count","pair_id":"python_abcc6be0d635c9cbd4ec19de","problem_id":"p03805","slow_code_id":"562f6e02e8417832e28d70eb3bf85554d0ed3aeb8b43d97c409d2d577ce8e26f","slow_id":"p03805_562f6e02e8417832e28d70eb3bf85554d0ed3aeb8b43d97c409d2d577ce8e26f","speedup":7.290682072506683,"stratum":"4-8","sampling_key":"33781243c44e119ce67a0006e2c81502f03ab88e5d47a120c0268c609ca0bab6","slow_code":"from typing import List, Tuple\n\n\ndef main():\n n, m = list(map(int, input().split()))\n g = []\n for _ in range(m):\n a, b = list(map(int, input().split()))\n g.append((a, b))\n print((osp(n, g)))\n\n\ndef osp(n: int, g: List[Tuple[int, int]]) -> int:\n v = [False] * n\n g = set(g)\n return dfs(0, v, n, g)\n\n\ndef dfs(i, v, n, g):\n v[i] = True\n if all(v):\n v[i] = False\n return 1\n cnt = 0\n for j in range(n):\n if v[j]:\n continue\n if not ((i + 1, j + 1) in g or (j + 1, i + 1) in g):\n continue\n cnt += dfs(j, v, n, g)\n v[i] = False\n return cnt\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"def dfs(g, v, depth):\n if seen[v] == True:\n return 0\n if depth == n:\n return 1\n seen[v] = True\n paths = 0\n for next_v in g[v]:\n paths += dfs(g, next_v, depth + 1)\n seen[v] = False\n return paths\n\n\nn, m = list(map(int, input().split()))\ng = [[] * (n + 1) for _ in range(n + 1)]\nfor _ in range(m):\n a, b = list(map(int, input().split()))\n g[a].append(b)\n g[b].append(a)\nseen = [False] * (n + 1)\nprint((dfs(g, 1, 1)))\n"} +{"fast_code_id":"1585f7c816c61ee84ae580c4fa815d49f968960ba50b2ab97d6fd0ea6f1e7103","fast_id":"p03282_1585f7c816c61ee84ae580c4fa815d49f968960ba50b2ab97d6fd0ea6f1e7103","language":"python","measured_fast_code_id":"1585f7c816c61ee84ae580c4fa815d49f968960ba50b2ab97d6fd0ea6f1e7103","measured_slow_code_id":"c6afbfabb4f57c620b796822aa793c63e616de41f9eb4e63aa7e8f88e45d1110","measurement_metric":"cpu_instruction_count","pair_id":"python_ac37d4240f90beee42b6e5b5","problem_id":"p03282","slow_code_id":"c6afbfabb4f57c620b796822aa793c63e616de41f9eb4e63aa7e8f88e45d1110","slow_id":"p03282_c6afbfabb4f57c620b796822aa793c63e616de41f9eb4e63aa7e8f88e45d1110","speedup":961.1710736225066,"stratum":"8+","sampling_key":"035b29f6cdf89061a849f22ee20eb51468d6864034d6d354fd03faa0a55dd1e0","slow_code":"import numpy as np\n\nS = np.array(list(map(str, input().rstrip())))\nK = int(eval(input()))\ncnt = 0\nans = 1\nfor i, s in enumerate(S):\n if s != \"1\":\n cnt = i + 1\n ans = s\n break\nif cnt > K:\n print((1))\nelse:\n print((int(ans)))\n","fast_code":"S = input().strip()\nK = int(eval(input()))\na = \"1\"\nind = len(S)\nfor i in range(len(S)):\n if S[i] != \"1\":\n a = S[i]\n ind = i\n break\nif K <= ind:\n print((1))\nelse:\n print(a)\n"} +{"fast_code_id":"97e7a463a7ae5a9432cd2c67f456ba04ff30cb7374fc001a0ff9009ec3d6048a","fast_id":"p00033_97e7a463a7ae5a9432cd2c67f456ba04ff30cb7374fc001a0ff9009ec3d6048a","language":"python","measured_fast_code_id":"97e7a463a7ae5a9432cd2c67f456ba04ff30cb7374fc001a0ff9009ec3d6048a","measured_slow_code_id":"cceb1f2e2d09140b45c7d16169008011222b0bc177f58ecd4909af55948b3e6a","measurement_metric":"cpu_instruction_count","pair_id":"python_ac6fbe66e15edb7f8a8f8041","problem_id":"p00033","slow_code_id":"cceb1f2e2d09140b45c7d16169008011222b0bc177f58ecd4909af55948b3e6a","slow_id":"p00033_cceb1f2e2d09140b45c7d16169008011222b0bc177f58ecd4909af55948b3e6a","speedup":3.572039221415526,"stratum":"2-4","sampling_key":"f237fc71b1d6855f2ab7baedfab9d1ba28d4a612710e981a108938599540ae27","slow_code":"N = int(input())\nfor c in range(N):\n B = [0]\n C = [0]\n\n def dfs(depth):\n if depth == 10:\n return True\n res = False\n if B[-1] < A[depth]:\n B.append(A[depth])\n res |= dfs(depth + 1)\n del B[-1]\n if C[-1] < A[depth]:\n C.append(A[depth])\n res |= dfs(depth + 1)\n del C[-1]\n return res\n\n A = list(map(int, input().split(\" \")))\n print(\"YES\" if dfs(0) else \"NO\")\n","fast_code":"def s(a):\n b = c = 0\n for i in a:\n if i > b:\n b = i\n elif i > c:\n c = i\n else:\n return False\n return True\n\n\nfor n in range(int(input())):\n print(\"YES\" if s(list(map(int, input().split()))) else \"NO\")\n"} +{"fast_code_id":"265606f4841a8dc3b615f556ee9cf33a8b6b4852185815a9e612027b6f53ba70","fast_id":"p02817_265606f4841a8dc3b615f556ee9cf33a8b6b4852185815a9e612027b6f53ba70","language":"python","measured_fast_code_id":"265606f4841a8dc3b615f556ee9cf33a8b6b4852185815a9e612027b6f53ba70","measured_slow_code_id":"d366b3197c2b1cc652bdfaecd153a16660977c2f3b6e7187f2d74bc9cc3d8847","measurement_metric":"cpu_instruction_count","pair_id":"python_ad87a9903d76fc054494a49f","problem_id":"p02817","slow_code_id":"d366b3197c2b1cc652bdfaecd153a16660977c2f3b6e7187f2d74bc9cc3d8847","slow_id":"p02817_d366b3197c2b1cc652bdfaecd153a16660977c2f3b6e7187f2d74bc9cc3d8847","speedup":2.838690411424779,"stratum":"2-4","sampling_key":"ff7368af2d06b2e78575b48f184a50c11c8c96459fd31fa8410a14c02c1eb2fc","slow_code":"import sys\n\nS, T = input().split()\nif not (S.islower() and T.islower()):\n sys.exit()\nif not (1 <= len(S) <= 100 and 1 <= len(S) <= 100):\n sys.exit()\nprint(T, end=\"\")\nprint(S)\n","fast_code":"S, T = input().split()\nprint((T + S))\n"} +{"fast_code_id":"b51f27babf7f835801028b4d1b79979c6ee61876bbeba15e97413eb45f9000f8","fast_id":"p03576_b51f27babf7f835801028b4d1b79979c6ee61876bbeba15e97413eb45f9000f8","language":"python","measured_fast_code_id":"b51f27babf7f835801028b4d1b79979c6ee61876bbeba15e97413eb45f9000f8","measured_slow_code_id":"fd20afd963fd30c74ad5f4b82bca4c03fd89aa79658948ac77c21734df8d5853","measurement_metric":"cpu_instruction_count","pair_id":"python_ae36021ca43da64f67f37673","problem_id":"p03576","slow_code_id":"fd20afd963fd30c74ad5f4b82bca4c03fd89aa79658948ac77c21734df8d5853","slow_id":"p03576_fd20afd963fd30c74ad5f4b82bca4c03fd89aa79658948ac77c21734df8d5853","speedup":6.586906362355319,"stratum":"4-8","sampling_key":"0a51a0f4652c3f319ddf279fdff475335391fd72e1873a3a19e63a46a5e3a683","slow_code":"N, K = list(map(int, input().split()))\nXY = [list(map(int, input().split())) for _ in [0] * N]\niX = sorted(x for x, y in XY)\niY = sorted(y for x, y in XY)\nX = {x: i for i, x in enumerate(iX)}\nY = {y: i for i, y in enumerate(iY)}\nc = [[0] * (N + 1) for i in [0] * (N + 1)]\nfor x, y in XY:\n c[Y[y] + 1][X[x] + 1] = 1\nfor i in range(N):\n for j in range(N):\n c[i + 1][j + 1] += c[i + 1][j]\nfor i in range(N):\n for j in range(N):\n c[i + 1][j + 1] += c[i][j + 1]\nans = 10**20\nfor l in range(N):\n for u in range(N):\n for r in range(l + 1, N):\n for d in range(u + 1, N):\n if c[d + 1][r + 1] + c[u][l] - c[u][r + 1] - c[d + 1][l] >= K:\n ans = min(ans, (iX[r] - iX[l]) * (iY[d] - iY[u]))\n break\nprint(ans)\n","fast_code":"N, K = list(map(int, input().split()))\nXY = [list(map(int, input().split())) for _ in [0] * N]\niX = sorted(x for x, y in XY)\niY = sorted(y for x, y in XY)\nX = {x: i for i, x in enumerate(iX)}\nY = {y: i for i, y in enumerate(iY)}\nc = [[0] * (N + 1) for i in [0] * (N + 1)]\nfor x, y in XY:\n c[Y[y] + 1][X[x] + 1] = 1\nfor i in range(N):\n ci1 = c[i + 1]\n for j in range(N):\n ci1[j + 1] += ci1[j]\nfor i in range(N):\n ci1 = c[i + 1]\n ci = c[i]\n for j in range(N):\n ci1[j + 1] += ci[j + 1]\nans = 10**20\nfor u in range(N):\n for d in range(u + K - 1, N):\n l = 0\n r = 1\n dY = iY[d] - iY[u]\n cd = c[d + 1]\n cu = c[u]\n while r < N:\n if cd[r + 1] + cu[l] - cu[r + 1] - cd[l] >= K:\n ans = min(ans, (iX[r] - iX[l]) * dY)\n l += 1\n else:\n r += 1\nprint(ans)\n"} +{"fast_code_id":"5b7e552a4063a2671d611280093afd267113618ef2d34d4a0496466cda237486","fast_id":"p03807_5b7e552a4063a2671d611280093afd267113618ef2d34d4a0496466cda237486","language":"python","measured_fast_code_id":"5b7e552a4063a2671d611280093afd267113618ef2d34d4a0496466cda237486","measured_slow_code_id":"8baca45625cd0c593d3689761edf66d3fece4f44f81b27a47e938cff4b898bb0","measurement_metric":"cpu_instruction_count","pair_id":"python_ae5c619641b0103661f5f7b6","problem_id":"p03807","slow_code_id":"8baca45625cd0c593d3689761edf66d3fece4f44f81b27a47e938cff4b898bb0","slow_id":"p03807_8baca45625cd0c593d3689761edf66d3fece4f44f81b27a47e938cff4b898bb0","speedup":4.780021348211803,"stratum":"4-8","sampling_key":"1cbd8e9a8bdd450ccdcec6ecc1f1e0ce6f6d5a6dbaf94d13e94b510b1d76a43b","slow_code":"import sys\nimport bisect\nimport collections\nimport fractions\nimport heapq\n\n\ndef slove():\n input = sys.stdin.readline\n n = int(input().rstrip(\"\\n\"))\n a = list(map(int, input().rstrip(\"\\n\").split()))\n cnt = 0\n for i in range(n):\n if a[i] % 2 != 0:\n cnt += 1\n if cnt % 2 == 0:\n print(\"YES\")\n else:\n print(\"NO\")\n\n\nif __name__ == \"__main__\":\n slove()\n","fast_code":"n = int(eval(input()))\na = list(map(int, input().split()))\nif sum([1 for b in a if b % 2 == 1]) % 2 == 1:\n print(\"NO\")\nelse:\n print(\"YES\")\n"} +{"fast_code_id":"08eadd1f06c4e53b1609a10a7af33c43ca14b042ad86b9a70693441a7a153acd","fast_id":"p02982_08eadd1f06c4e53b1609a10a7af33c43ca14b042ad86b9a70693441a7a153acd","language":"python","measured_fast_code_id":"08eadd1f06c4e53b1609a10a7af33c43ca14b042ad86b9a70693441a7a153acd","measured_slow_code_id":"8ff50014837e2e91e70d850adc84476cf7c0aad5ec8292d51447d9bb59555c48","measurement_metric":"cpu_instruction_count","pair_id":"python_ae69c3d2bfc367fa805891f0","problem_id":"p02982","slow_code_id":"8ff50014837e2e91e70d850adc84476cf7c0aad5ec8292d51447d9bb59555c48","slow_id":"p02982_8ff50014837e2e91e70d850adc84476cf7c0aad5ec8292d51447d9bb59555c48","speedup":125.12774213231559,"stratum":"8+","sampling_key":"6e880d3be65e127de0dbd3f692fc965397dfab2600c6252d45f4f4509b49cbcf","slow_code":"from numpy import *\n\nn, *x = [int32(t.split()) for t in open(0)]\nprint((sum(j == int(j) for i in x for j in map(linalg.norm, i - x)) - n[0] >> 1))\n","fast_code":"N, D = list(map(int, input().split()))\nX = [list(map(int, input().split())) for _ in range(N)]\nS = {i**2 for i in range(1000)}\nans = (\n sum(a != b and sum((x - y) ** 2 for x, y in zip(a, b)) in S for a in X for b in X)\n // 2\n)\nprint(ans)\n"} +{"fast_code_id":"3390bdcb02a65b89b682e7dbbc5beb00be319ff8217b9a5bbec13b32cc1d85cc","fast_id":"p03719_3390bdcb02a65b89b682e7dbbc5beb00be319ff8217b9a5bbec13b32cc1d85cc","language":"python","measured_fast_code_id":"3390bdcb02a65b89b682e7dbbc5beb00be319ff8217b9a5bbec13b32cc1d85cc","measured_slow_code_id":"0acae026c7e63eed2245b851c8d32eee934659ca23b9e50786cb323f85625345","measurement_metric":"cpu_instruction_count","pair_id":"python_aeb851d5782744d76cfc54de","problem_id":"p03719","slow_code_id":"0acae026c7e63eed2245b851c8d32eee934659ca23b9e50786cb323f85625345","slow_id":"p03719_0acae026c7e63eed2245b851c8d32eee934659ca23b9e50786cb323f85625345","speedup":6.379586201603627,"stratum":"4-8","sampling_key":"65409d49c4e08ee736af6bc0a55ac51ede919a389742d3ca80b7cac39b1a2d7e","slow_code":"import functools\nimport os\nimport sys\n\nsys.setrecursionlimit(10000)\nINF = float(\"inf\")\n\n\ndef inp():\n return int(eval(input()))\n\n\ndef inpf():\n return float(eval(input()))\n\n\ndef inps():\n return eval(input())\n\n\ndef inl():\n return list(map(int, input().split()))\n\n\ndef inlf():\n return list(map(float, input().split()))\n\n\ndef inls():\n return input().split()\n\n\ndef inpm(line):\n return [inp() for _ in range(line)]\n\n\ndef inpfm(line):\n return [inpf() for _ in range(line)]\n\n\ndef inpsm(line):\n return [inps() for _ in range(line)]\n\n\ndef inlm(line):\n return [inl() for _ in range(line)]\n\n\ndef inlfm(line):\n return [inlf() for _ in range(line)]\n\n\ndef inlsm(line):\n return [inls() for _ in range(line)]\n\n\ndef Yesif(cond):\n print((\"Yes\" if cond else \"No\"))\n\n\ndef YESIF(cond):\n print((\"YES\" if cond else \"NO\"))\n\n\ndef yesif(cond):\n print((\"yes\" if cond else \"no\"))\n\n\na, b, c = inl()\nYesif(a <= c <= b)\n","fast_code":"A, B, C = [int(x) for x in input().strip().split(\" \")]\nif not C < A and not C > B:\n print(\"Yes\")\nelse:\n print(\"No\")\n"} +{"fast_code_id":"b08b63949d5a0d136cf4abbcf8d58f0dfce1c51147939885ca0da7ecb15e7dd4","fast_id":"p02770_1d04958ffbdbddcd269fad8373f24a6d7b9d37ba405ef0ceba28eac485c84265","language":"python","measured_fast_code_id":"1d04958ffbdbddcd269fad8373f24a6d7b9d37ba405ef0ceba28eac485c84265","measured_slow_code_id":"c3f6bab4a2af4b35e38d9d72355721dc97f2ca2c80f07b4cb113b6f10727002a","measurement_metric":"cpu_instruction_count","pair_id":"python_aeff2b3384f735b84e834601","problem_id":"p02770","slow_code_id":"c3f6bab4a2af4b35e38d9d72355721dc97f2ca2c80f07b4cb113b6f10727002a","slow_id":"p02770_c3f6bab4a2af4b35e38d9d72355721dc97f2ca2c80f07b4cb113b6f10727002a","speedup":3.268384513974106,"stratum":"2-4","sampling_key":"0f89c42044b949f202294551caef33b2589d5f2746923fa02b3df42d74c1f627","slow_code":"import numpy as np\n\nk, q = list(map(int, input().split()))\nd = np.array(list(map(int, input().split())), dtype=np.int64)\nqueries = [tuple(map(int, input().split())) for _ in range(q)]\nfor n, x, m in queries:\n d_mod = d % m\n rem_d_mod = d_mod[: (n - 1) % k]\n print(\n (\n n\n - 1\n - (x % m + ((n - 1) // k) * np.sum(d_mod) + np.sum(rem_d_mod)) // m\n - ((n - 1) // k) * np.count_nonzero(d_mod == 0)\n - np.count_nonzero(rem_d_mod == 0)\n )\n )\n","fast_code":"def main():\n k, q = list(map(int, input().split()))\n (*d,) = list(map(int, input().split()))\n for _ in range(q):\n n, x, m = list(map(int, input().split()))\n (*g,) = [x % m for x in d]\n rep, rest = divmod(n - 1, k)\n last = x + (sum(g) * rep) + sum(g[:rest])\n eq = sum(rep + (1 if i < rest else 0) for i, gg in enumerate(g) if gg == 0)\n ans = (n - 1) - eq - (last // m - x // m)\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"c35164e87c1afdd4b4eff0d560301d78fec57fe8d260d7af34ef420ad2590476","fast_id":"p02595_c35164e87c1afdd4b4eff0d560301d78fec57fe8d260d7af34ef420ad2590476","language":"python","measured_fast_code_id":"c35164e87c1afdd4b4eff0d560301d78fec57fe8d260d7af34ef420ad2590476","measured_slow_code_id":"1559f276e022453eb8e8e92cd54d60648c4bba1cc009c4b0eef1eaf17b1ef72e","measurement_metric":"cpu_instruction_count","pair_id":"python_af1d0c4bd489c953940c2c52","problem_id":"p02595","slow_code_id":"1559f276e022453eb8e8e92cd54d60648c4bba1cc009c4b0eef1eaf17b1ef72e","slow_id":"p02595_1559f276e022453eb8e8e92cd54d60648c4bba1cc009c4b0eef1eaf17b1ef72e","speedup":3.801027569817484,"stratum":"2-4","sampling_key":"3905bc70363aa685c11e8d2bfecee22c9b2a59e76a84d9171a054df46745e221","slow_code":"from decimal import *\n\ngetcontext().prec = 50\nN, D = list(map(int, input().split()))\n\n\ndef distance(x1, x2, y1, y2):\n dx = x2 - x1\n dy = y2 - y1\n return (dx * dx + dy * dy).sqrt()\n\n\nX = [0] * N\nY = [0] * N\nfor i in range(N):\n X[i], Y[i] = list(map(Decimal, input().split()))\nans = 0\nfor i in range(N):\n if distance(0, X[i], 0, Y[i]) <= D:\n ans += 1\nprint(ans)\n","fast_code":"N, D = list(map(int, input().split()))\nZn = [list(map(int, input().split())) for _ in range(N)]\nans = 0\nfor Z in Zn:\n X, Y = Z\n if X**2 + Y**2 <= D**2:\n ans += 1\nprint(ans)\n"} +{"fast_code_id":"31644107abdb229d82244a8597859d7d2c902d0dc996119e84797e16528bcaed","fast_id":"p02244_31644107abdb229d82244a8597859d7d2c902d0dc996119e84797e16528bcaed","language":"python","measured_fast_code_id":"31644107abdb229d82244a8597859d7d2c902d0dc996119e84797e16528bcaed","measured_slow_code_id":"d7606248c1d90b41ff58d3b7f82b651f81a02736b3685ac0b544bff951669455","measurement_metric":"cpu_instruction_count","pair_id":"python_af9445d04e886ec0cdd945ed","problem_id":"p02244","slow_code_id":"d7606248c1d90b41ff58d3b7f82b651f81a02736b3685ac0b544bff951669455","slow_id":"p02244_d7606248c1d90b41ff58d3b7f82b651f81a02736b3685ac0b544bff951669455","speedup":4.389343187918475,"stratum":"4-8","sampling_key":"88bd6422138d12fac335561d197c65796b13fbf2f01719bf57fa49b94081cf12","slow_code":"from functools import lru_cache\n\ncc = [[\".\" for i in range(8)] for j in range(8)]\n\n\ndef check(cc, a, b):\n ss = list(zip(*cc))\n if \"Q\" in cc[a]:\n return False\n if \"Q\" in ss[b]:\n return False\n d = []\n for i in range(8):\n for j in range(8):\n try:\n if j + (a - i) == b:\n d.append(cc[i][j])\n if j - (a - i) == b:\n d.append(cc[i][j])\n if j + (i - a) == b:\n d.append(cc[i][j])\n if j - (i - a) == b:\n d.append(cc[i][j])\n except IndexError:\n continue\n if \"Q\" in d:\n return False\n return True\n\n\ndef chess(s, queen):\n if queen == 8:\n return s\n for i in range(8):\n for j in range(8):\n if check(s, i, j):\n sol = s\n sol[i][j] = \"Q\"\n if chess(sol, queen + 1) != [[]]:\n return sol\n else:\n sol[i][j] = \".\"\n return [[]]\n\n\nk = int(eval(input()))\nfor i in range(k):\n a, b = input().split()\n cc[int(a)][int(b)] = \"Q\"\nans = chess(cc, k)\nprint((\"\\n\".join(list([\"\".join(x) for x in ans]))))\n","fast_code":"from sys import stdin\nfrom itertools import permutations as per\n\n\ndef check(queen):\n for r1, c1 in queen:\n if not all(\n (r1 == r2 and c1 == c2) or (r1 + c1 != r2 + c2 and r1 - c1 != r2 - c2)\n for r2, c2 in queen\n ):\n return False\n return True\n\n\nk = int(stdin.readline())\nR, C = [[i for i in range(8)] for _ in range(2)]\nq = []\nfor _ in range(k):\n r, c = list(map(int, stdin.readline().split()))\n q.append((r, c))\n R.remove(r)\n C.remove(c)\nfor l in per(C):\n q_tmp = q[:] + [(r, c) for r, c in zip(R, l)]\n if check(q_tmp):\n for i, j in sorted(q_tmp):\n print((\".\" * j + \"Q\" + \".\" * (8 - j - 1)))\n break\n"} +{"fast_code_id":"7e6b28ac3581f950e4523bab1c21d86a81f6f7768e5a20329f6e988118f19d41","fast_id":"p03476_7e6b28ac3581f950e4523bab1c21d86a81f6f7768e5a20329f6e988118f19d41","language":"python","measured_fast_code_id":"7e6b28ac3581f950e4523bab1c21d86a81f6f7768e5a20329f6e988118f19d41","measured_slow_code_id":"f983b4089c37289abbde2932a5be0f208d53db1149fb26d46fe7b6e95e35ee31","measurement_metric":"cpu_instruction_count","pair_id":"python_affb9b4b1c8936ed84d5abd7","problem_id":"p03476","slow_code_id":"9175a6102e9f30bfa05e2b93d01b1f1c229b1972f3871522f495e1a5817d832f","slow_id":"p03476_f983b4089c37289abbde2932a5be0f208d53db1149fb26d46fe7b6e95e35ee31","speedup":7.234781322316638,"stratum":"4-8","sampling_key":"9fbfee73fb4ffb6cad362fef44de354fbfa032c78a6b75ca6eff99313f50ec18","slow_code":"def isprime(n):\n\n n = abs(int(n))\n\n if n < 2:\n return False\n\n if n == 2:\n return True\n\n if not n & 1:\n return False\n\n for x in range(3, int(n**0.5) + 1, 2):\n if n % x == 0:\n return False\n return True\n\n\ndef resolve():\n q = int(eval(input()))\n qs = [list(map(int, input().split())) for _ in range(q)]\n t = [0] * (10**5 + 1)\n for i in range(10**5):\n v = 1 if isprime(i + 1) and isprime((i + 2) / 2) else 0\n t[i + 1] = t[i] + v\n for l, r in qs:\n if l == r:\n print((1 if isprime(l) and isprime((l + 2) / 2) else 0))\n else:\n print((t[r] - t[l - 1]))\n\n\nresolve()\n","fast_code":"from sys import stdin, setrecursionlimit\nfrom itertools import accumulate\n\nsetrecursionlimit(10**9)\nINF = 1 << 60\n\n\ndef input():\n return stdin.readline().strip()\n\n\ndef prime_numbers(n):\n if n < 2:\n return []\n m = (n + 1) // 2\n p = [True] * m\n for i in range(1, int((n**0.5 - 1) / 2) + 1):\n if p[i]:\n for j in range(2 * i * (i + 1), m, 2 * i + 1):\n p[j] = False\n a = [2 * i + 1 for i in range(m) if p[i]]\n a[0] = 2\n return a\n\n\nN = 10**5\nP = set(prime_numbers(N))\nP = [n for n in P if (n + 1) // 2 in P]\na = [0] * (N + 1)\nfor n in P:\n a[n] = 1\na = list(accumulate(a))\nQ, *LR = list(map(int, open(0).read().split()))\nfor l, r in zip(*[iter(LR)] * 2):\n print((a[r] - a[l - 1]))\n"} +{"fast_code_id":"8b2d08aced4ae3491db744bb1ac3ecb0e43549f0f0f9fcaf5fd28737de41460a","fast_id":"p03025_8b2d08aced4ae3491db744bb1ac3ecb0e43549f0f0f9fcaf5fd28737de41460a","language":"python","measured_fast_code_id":"8b2d08aced4ae3491db744bb1ac3ecb0e43549f0f0f9fcaf5fd28737de41460a","measured_slow_code_id":"d7b2d9b6e229f1a07afd72ead27dc8b9e9c2526297125bbec66c65aff70af3d1","measurement_metric":"cpu_instruction_count","pair_id":"python_b050de877b0aa69084bcc91d","problem_id":"p03025","slow_code_id":"dbe00cc3d9bfb03b1058e58ae449186d8037b31cc79ff86312c4a398d12bce4d","slow_id":"p03025_d7b2d9b6e229f1a07afd72ead27dc8b9e9c2526297125bbec66c65aff70af3d1","speedup":5.068048527411397,"stratum":"4-8","sampling_key":"004539d0695e29956feb404160218d5408ce4597352f0ce0dbdb594597b927a7","slow_code":"N, A, B, C = list(map(int, input().split()))\nmod = 10**9 + 7\n\n\nFACT = [1]\nfor i in range(1, 2 * 10**5 + 1):\n FACT.append(FACT[-1] * i % mod)\nFACT_INV = [pow(FACT[-1], mod - 2, mod)]\nfor i in range(2 * 10**5, 0, -1):\n FACT_INV.append(FACT_INV[-1] * i % mod)\nFACT_INV = FACT_INV[::-1]\n\n\ndef Combi(N, K):\n return FACT[N] * FACT_INV[N - K] * FACT_INV[K] % mod\n\n\nANS = 0\nSUM = A + B\nA_n = pow(A, N, mod) * pow(pow(SUM, mod - 2, mod), N, mod) % mod\nB_n = pow(B, N, mod) * pow(pow(SUM, mod - 2, mod), N, mod) % mod\nSUMINV = pow(SUM, mod - 2, mod)\nfor i in range(N):\n ANS = (\n ANS\n + (A_n * pow(B, i, mod) + B_n * pow(A, i, mod))\n * Combi(N - 1 + i, i)\n * pow(SUMINV, i, mod)\n * (N + i)\n ) % mod\nprint((ANS * 100 * pow(100 - C, mod - 2, mod) % mod))\n","fast_code":"M = 10**9 + 7\nN, A, B, C = list(map(int, input().split()))\nf = [1]\nfor i in range(1, 2 * N):\n f.append(f[-1] * i % M)\nt = pow(A + B, M - 2, M)\nA *= t\nB *= t\na = pow(A, N, M)\nb = pow(B, N, M)\nz = 0\nfor i in range(N):\n z += (\n (N + i)\n * 100\n * pow(100 - C, M - 2, M)\n * f[N + i - 1]\n * pow(f[N - 1] * f[i], M - 2, M)\n * (a + b)\n )\n z %= M\n a = a * B % M\n b = b * A % M\nprint(z)\n"} +{"fast_code_id":"6305e9ddb2b1667c0af4f74e76a3d3dd65823679375cdc3b19cb654397c9a2af","fast_id":"p03343_6305e9ddb2b1667c0af4f74e76a3d3dd65823679375cdc3b19cb654397c9a2af","language":"python","measured_fast_code_id":"6305e9ddb2b1667c0af4f74e76a3d3dd65823679375cdc3b19cb654397c9a2af","measured_slow_code_id":"ef947df7a2b51b142fd32b0ad45c1379627ad36a71edf5b9b3a3be600c27d1cc","measurement_metric":"cpu_instruction_count","pair_id":"python_b0ebaa421cb64e72432cafca","problem_id":"p03343","slow_code_id":"138340e043a3bdb60eabde4fbfefa619cd52b53cdd3b075b3c73d719f5c82be1","slow_id":"p03343_ef947df7a2b51b142fd32b0ad45c1379627ad36a71edf5b9b3a3be600c27d1cc","speedup":412.2618599053771,"stratum":"8+","sampling_key":"229a8d609ef196a599c6218da6bbd63e68f779be30dd656677b2998470566c4f","slow_code":"import sys\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef list2d(a, b, c):\n return [[c] * b for i in range(a)]\n\n\ndef list3d(a, b, c, d):\n return [[[d] * c for j in range(b)] for i in range(a)]\n\n\ndef list4d(a, b, c, d, e):\n return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]\n\n\ndef ceil(x, y=1):\n return int(-(-x // y))\n\n\ndef INT():\n return int(eval(input()))\n\n\ndef MAP():\n return list(map(int, input().split()))\n\n\ndef LIST(N=None):\n return list(MAP()) if N is None else [INT() for i in range(N)]\n\n\ndef Yes():\n print(\"Yes\")\n\n\ndef No():\n print(\"No\")\n\n\ndef YES():\n print(\"YES\")\n\n\ndef NO():\n print(\"NO\")\n\n\nsys.setrecursionlimit(10**9)\nINF = 10**18\nMOD = 10**9 + 7\nN, K, Q = MAP()\nA = LIST()\nans = INF\n\nfor x in A:\n\n B = []\n tmp = []\n for i in range(N):\n if A[i] >= x:\n tmp.append(A[i])\n else:\n B.append(tmp)\n tmp = []\n B.append(tmp)\n\n C = []\n for li in B:\n m = len(li)\n li.sort()\n C += li[: max(m - K + 1, 0)]\n\n C.sort()\n if len(C) < Q:\n continue\n y = C[Q - 1]\n ans = min(ans, y - x)\nprint(ans)\n","fast_code":"def add_list(buf, new_lists, removals):\n l = len(buf)\n if l >= k:\n sbf = sorted(buf)\n removals.extend(sbf[: l - k + 1])\n new_lists.append(buf)\n\n\nn, k, q = list(map(int, input().split()))\naaa = list(map(int, input().split()))\nsrt = sorted(set(aaa))\nlists = [aaa]\nans = float(\"inf\")\nfor a in srt:\n new_lists = []\n removals = []\n for lst in lists:\n buf = []\n for b in lst:\n if a > b:\n add_list(buf, new_lists, removals)\n buf = []\n else:\n buf.append(b)\n add_list(buf, new_lists, removals)\n if len(removals) < q:\n break\n removals.sort()\n ans = min(ans, removals[q - 1] - a)\nprint(ans)\n"} +{"fast_code_id":"c849486b5abf637af03fe7febf43bd7dd02b274707fda14923cc314878552577","fast_id":"p02930_c849486b5abf637af03fe7febf43bd7dd02b274707fda14923cc314878552577","language":"python","measured_fast_code_id":"c849486b5abf637af03fe7febf43bd7dd02b274707fda14923cc314878552577","measured_slow_code_id":"e92d2c5b381e0dc13fec91e29d5b05e3c0b38db0ebb8a73555cd4f93676c88e6","measurement_metric":"cpu_instruction_count","pair_id":"python_b0ee27583a4e7dfd448de2d5","problem_id":"p02930","slow_code_id":"e92d2c5b381e0dc13fec91e29d5b05e3c0b38db0ebb8a73555cd4f93676c88e6","slow_id":"p02930_e92d2c5b381e0dc13fec91e29d5b05e3c0b38db0ebb8a73555cd4f93676c88e6","speedup":2.4086434623468262,"stratum":"2-4","sampling_key":"9333af1431dce7b28ac1810d99a67fa37af574ed3a345c24a5ad69e025bb93ca","slow_code":"N, j = int(eval(input())), 0\nexec(\"print(*[9-format(i+1,'09b').rfind('1')for i in range(N)][:N-j-1]);j+=1;\" * N)\n","fast_code":"n = int(input())\nfor i in range(n):\n for j in range(i + 1, n):\n print((i ^ j & -(i ^ j)).bit_length(), end=\" \")\n print()\n"} +{"fast_code_id":"0c82c432849e42936e00c228fc40384e5cec41c3fe38b370b307eee81e480a3b","fast_id":"p03737_0c82c432849e42936e00c228fc40384e5cec41c3fe38b370b307eee81e480a3b","language":"python","measured_fast_code_id":"0c82c432849e42936e00c228fc40384e5cec41c3fe38b370b307eee81e480a3b","measured_slow_code_id":"c5a6a790bfe3c359c7ab2698d0f376a617bb650fa938bf64d595d41523985f6d","measurement_metric":"cpu_instruction_count","pair_id":"python_b143056b3ed779e58ca18e83","problem_id":"p03737","slow_code_id":"c5a6a790bfe3c359c7ab2698d0f376a617bb650fa938bf64d595d41523985f6d","slow_id":"p03737_c5a6a790bfe3c359c7ab2698d0f376a617bb650fa938bf64d595d41523985f6d","speedup":2541.3164394816017,"stratum":"8+","sampling_key":"24a92b2dfe7a9afd5e1208295497c02379a883c19ace0228f9bff7e269e78141","slow_code":"import numpy as np\nimport math\n\ns = \" \" + input()\nfor i in range(len(s)):\n if s[i] == \" \":\n print(chr(ord(s[i + 1]) - 32), end=\"\")\nprint()\n","fast_code":"print(\"\".join([w[0] for w in input().split()]).upper())\n"} +{"fast_code_id":"4090583f6aa869d802e0b783200dcb36cadfe644c804cfc2fc81125201e61d62","fast_id":"p03112_4090583f6aa869d802e0b783200dcb36cadfe644c804cfc2fc81125201e61d62","language":"python","measured_fast_code_id":"4090583f6aa869d802e0b783200dcb36cadfe644c804cfc2fc81125201e61d62","measured_slow_code_id":"075f3d0646b6b85cb5ae32f4ea2d0d59acf39147bd9650aafe37dade27ea98fa","measurement_metric":"cpu_instruction_count","pair_id":"python_b171fc63e11a993159dd3a8e","problem_id":"p03112","slow_code_id":"77daaa725f47eb183a0e25b50b7e6255b814e50d5067b476fe004c62248fd0dc","slow_id":"p03112_075f3d0646b6b85cb5ae32f4ea2d0d59acf39147bd9650aafe37dade27ea98fa","speedup":9.137565998684941,"stratum":"8+","sampling_key":"cf50d416aebd75003bef873753c6f8136d3da43c5a9f1e3907fff4156b5e01ea","slow_code":"import sys, re\nfrom collections import deque, defaultdict, Counter\nfrom math import sqrt, hypot, factorial, pi, sin, cos, radians, log10\n\nif sys.version_info.minor >= 5:\n from math import gcd\nelse:\n from fractions import gcd\nfrom heapq import heappop, heappush, heapify, heappushpop\nfrom bisect import bisect_left, bisect_right\nfrom itertools import permutations, combinations, product, accumulate\nfrom operator import itemgetter, mul, xor\nfrom copy import copy, deepcopy\nfrom functools import reduce, partial\nfrom fractions import Fraction\nfrom string import ascii_lowercase, ascii_uppercase, digits\nfrom datetime import date\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef list2d(a, b, c):\n return [[c] * b for i in range(a)]\n\n\ndef list3d(a, b, c, d):\n return [[[d] * c for j in range(b)] for i in range(a)]\n\n\ndef ceil(x, y=1):\n return int(-(-x // y))\n\n\ndef round(x):\n return int((x * 2 + 1) // 2)\n\n\ndef fermat(x, y, MOD):\n return x * pow(y, MOD - 2, MOD) % MOD\n\n\ndef lcm(x, y):\n return (x * y) // gcd(x, y)\n\n\ndef lcm_list(nums):\n return reduce(lcm, nums, 1)\n\n\ndef gcd_list(nums):\n return reduce(gcd, nums, nums[0])\n\n\ndef INT():\n return int(eval(input()))\n\n\ndef MAP():\n return list(map(int, input().split()))\n\n\ndef LIST():\n return list(map(int, input().split()))\n\n\ndef Yes():\n print(\"Yes\")\n\n\ndef No():\n print(\"No\")\n\n\ndef YES():\n print(\"YES\")\n\n\ndef NO():\n print(\"NO\")\n\n\nsys.setrecursionlimit(10**9)\nINF = float(\"inf\")\nMOD = 10**9 + 7\nA, B, Q = MAP()\nS = [-INF] * (A + 2)\nfor i in range(A):\n S[i + 1] = INT()\nT = [-INF] * (B + 2)\nfor i in range(B):\n T[i + 1] = INT()\nS[-1] = T[-1] = INF\nfor i in range(Q):\n dist1 = dist2 = dist3 = dist4 = INF\n x = INT()\n\n idx1 = bisect_right(S, x) - 1\n\n idx2 = bisect_left(S, x)\n idx3 = bisect_right(T, x) - 1\n idx4 = bisect_left(T, x)\n\n dist1 = x - S[idx1]\n\n if dist1 != INF:\n dist1 += min(abs(S[idx1] - T[idx3]), abs(S[idx1] - T[idx4]))\n dist2 = S[idx2] - x\n if dist2 != INF:\n dist2 += min(abs(S[idx2] - T[idx3]), abs(S[idx2] - T[idx4]))\n dist3 = x - T[idx3]\n if dist3 != INF:\n dist3 += min(abs(T[idx3] - S[idx1]), abs(T[idx3] - S[idx2]))\n dist4 = T[idx4] - x\n if dist4 != INF:\n dist4 += min(abs(T[idx4] - S[idx1]), abs(T[idx4] - S[idx2]))\n print((min(dist1, dist2, dist3, dist4)))\n","fast_code":"from bisect import bisect\n\n\ndef main():\n a, b, q, *stx = list(map(int, open(0).read().split()))\n s = [-1e10] + stx[:a] + [2 * 1e10]\n t = [-1e10] + stx[a : a + b] + [2 * 1e10]\n x = stx[a + b : a + b + q]\n for i in x:\n pos_s = bisect(s, i)\n pos_t = bisect(t, i)\n sl = s[pos_s - 1]\n sr = s[pos_s]\n tl = t[pos_t - 1]\n tr = t[pos_t]\n ans = min(\n i - min(sl, tl),\n max(sr, tr) - i,\n (sr - i) + (sr - tl),\n (tr - i) + (tr - sl),\n (i - sl) + (tr - sl),\n (i - tl) + (sr - tl),\n )\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"0e1831f05fd57e3dc84771e018cbb15cec58ef815e2f8f6cf510560109d5b399","fast_id":"p03608_91d0b963f05ea191df96d2285af61249e187b1a95e7777a7f8f049c535d3ac44","language":"python","measured_fast_code_id":"91d0b963f05ea191df96d2285af61249e187b1a95e7777a7f8f049c535d3ac44","measured_slow_code_id":"e402cf8b709f4d4bd0675c325db77e47f7b2a6cb9e29edbcfebdf8e91b6449a7","measurement_metric":"cpu_instruction_count","pair_id":"python_b21ffcac369804b89f915662","problem_id":"p03608","slow_code_id":"e402cf8b709f4d4bd0675c325db77e47f7b2a6cb9e29edbcfebdf8e91b6449a7","slow_id":"p03608_e402cf8b709f4d4bd0675c325db77e47f7b2a6cb9e29edbcfebdf8e91b6449a7","speedup":4.250731479411411,"stratum":"4-8","sampling_key":"2ca7ad5f402730a93525f4daccd649c66fd2b9608d31ec477d28040429d2d734","slow_code":"import itertools\n\nINF = float(\"inf\")\n\n\ndef main():\n N, M, R = list(map(int, input().split()))\n r = list(map(int, input().split()))\n path = [[INF] * (N + 1) for _ in range(N + 1)]\n for _ in range(M):\n A, B, C = list(map(int, input().split()))\n path[A][B] = C\n path[B][A] = C\n for i in range(1, N + 1):\n path[i][i] = 0\n for i in range(1, N + 1):\n for j in range(1, N + 1):\n for k in range(1, N + 1):\n path[j][k] = min(path[j][k], path[j][i] + path[i][k])\n ans = INF\n for p in itertools.permutations(r):\n cost = 0\n for i in range(R - 1):\n cost += path[p[i]][p[i + 1]]\n ans = min(ans, cost)\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"from heapq import heappop, heappush\nfrom itertools import permutations\n\n\ndef dijkstra(source: int) -> \"Array[int]\":\n\n size = len(G)\n dist = [float(\"inf\")] * size\n dist[source] = 0\n undetermined = size - 2\n queue = [(0, source)]\n while queue:\n cost, v = heappop(queue)\n if cost > dist[v]:\n continue\n for next_cost, u in G[v]:\n if cost + next_cost < dist[u]:\n dist[u] = cost + next_cost\n heappush(queue, (dist[u], u))\n undetermined -= 1\n if not undetermined:\n return dist\n return dist\n\n\ndef main():\n global G\n N, M, R, *RABC = list(map(int, open(0).read().split()))\n visit, ABC = RABC[:R], RABC[R:]\n G = [[] for _ in range(N + 1)]\n for v, u, cost in zip(*[iter(ABC)] * 3):\n G[v].append((cost, u)), G[u].append((cost, v))\n dist = {v: dijkstra(v) for v in visit}\n ans = float(\"inf\")\n for perm in permutations(visit):\n cur = sum(dist[v][u] for v, u in zip(perm, perm[1:]))\n ans = min(ans, cur)\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"c5b27d123eb4be603fe8509dc52f382f0edbaa108b801cde25d5e3518e703c95","fast_id":"p02551_4a16bff7c31cffdfdbe77a06643bb78fef98086e135ad4345038314f484d3403","language":"python","measured_fast_code_id":"4a16bff7c31cffdfdbe77a06643bb78fef98086e135ad4345038314f484d3403","measured_slow_code_id":"b6d8d02e6cf1c2cdae11c71a6f58f4cedbd533f79dc49244a4531d1545967d6e","measurement_metric":"cpu_instruction_count","pair_id":"python_b29d889d48be49db5fbb4698","problem_id":"p02551","slow_code_id":"b6d8d02e6cf1c2cdae11c71a6f58f4cedbd533f79dc49244a4531d1545967d6e","slow_id":"p02551_b6d8d02e6cf1c2cdae11c71a6f58f4cedbd533f79dc49244a4531d1545967d6e","speedup":3.780210169352265,"stratum":"2-4","sampling_key":"0f4a673a7e8c7439fef08030ef28f6a451cac142f13a47076d38f25ce5646054","slow_code":"class LazySegmentTree:\n def __init__(self, init_val, segfunc, ide_ele):\n n = len(init_val)\n self.segfunc = segfunc\n self.ide_ele = ide_ele\n self.num = 1 << (n - 1).bit_length()\n self.data = [ide_ele] * 2 * self.num\n self.lazy = [None] * 2 * self.num\n for i in range(n):\n self.data[self.num + i] = init_val[i]\n for i in range(self.num - 1, 0, -1):\n self.data[i] = self.segfunc(self.data[2 * i], self.data[2 * i + 1])\n\n def gindex(self, l, r):\n l += self.num\n r += self.num\n lm = l >> (l & -l).bit_length()\n rm = r >> (r & -r).bit_length()\n while r > l:\n if l <= lm:\n yield l\n if r <= rm:\n yield r\n r >>= 1\n l >>= 1\n while l:\n yield l\n l >>= 1\n\n def propagates(self, *ids):\n for i in reversed(ids):\n v = self.lazy[i]\n if v is None:\n continue\n self.lazy[2 * i] = v\n self.lazy[2 * i + 1] = v\n self.data[2 * i] = v\n self.data[2 * i + 1] = v\n self.lazy[i] = None\n\n def update(self, l, r, x):\n (*ids,) = self.gindex(l, r)\n self.propagates(*ids)\n l += self.num\n r += self.num\n while l < r:\n if l & 1:\n self.lazy[l] = x\n self.data[l] = x\n l += 1\n if r & 1:\n self.lazy[r - 1] = x\n self.data[r - 1] = x\n r >>= 1\n l >>= 1\n for i in ids:\n self.data[i] = self.segfunc(self.data[2 * i], self.data[2 * i + 1])\n\n def query(self, l, r):\n (*ids,) = self.gindex(l, r)\n self.propagates(*ids)\n res = self.ide_ele\n l += self.num\n r += self.num\n while l < r:\n if l & 1:\n res = self.segfunc(res, self.data[l])\n l += 1\n if r & 1:\n res = self.segfunc(res, self.data[r - 1])\n l >>= 1\n r >>= 1\n return res\n\n\ndef segfunc(x, y):\n return min(x, y)\n\n\nide_ele = 10**9\nN, Q = list(map(int, input().split()))\nans = (N - 2) * (N - 2)\nR = [N] * (N + 1)\nW = [N] * (N + 1)\nseg_r = LazySegmentTree(R, segfunc, ide_ele)\nseg_w = LazySegmentTree(W, segfunc, ide_ele)\nfor i in range(Q):\n a, b = list(map(int, input().split()))\n if a == 1:\n t = seg_r.query(b, b + 1)\n ans -= max(0, t - 2)\n if b <= seg_w.query(1, 2):\n seg_w.update(1, t + 1, b)\n else:\n t = seg_w.query(b, b + 1)\n ans -= max(0, t - 2)\n if b <= seg_r.query(1, 2):\n seg_r.update(1, t + 1, b)\nprint(ans)\n","fast_code":"import sys\n\nread = sys.stdin.read\nreadline = sys.stdin.readline\nreadlines = sys.stdin.readlines\nsys.setrecursionlimit(10**9)\nMOD = 1000000007\n\n\ndef main():\n N, Q, *queries = list(map(int, read().split()))\n queries = [(q, x) for q, x in zip(*[iter(queries)] * 2)]\n N -= 2\n\n N0 = 2 ** (N - 1).bit_length()\n data1 = [None] * (2 * N0)\n data2 = [None] * (2 * N0)\n INF = (-1, 2**31 - 1)\n\n def update(l, r, v, data):\n L = l + N0\n R = r + N0\n while L < R:\n if R & 1:\n R -= 1\n data[R - 1] = v\n if L & 1:\n data[L - 1] = v\n L += 1\n L >>= 1\n R >>= 1\n\n def _query(k, data):\n k += N0 - 1\n s = INF\n while k >= 0:\n if data[k]:\n s = max(s, data[k])\n k = (k - 1) // 2\n return s\n\n def query(k, data):\n return _query(k, data)[1]\n\n update(0, N, (0, N), data1)\n update(0, N, (0, N), data2)\n min1 = min2 = N + 10\n ans = N * N\n for i, (q, x) in enumerate(queries, 1):\n x -= 2\n if q == 1:\n data = data1\n this_min = min1\n else:\n data = data2\n this_min = min2\n n = query(x, data)\n ans -= n\n if x > this_min:\n continue\n if q == 1:\n min1 = x\n update(0, n, (i, x), data2)\n else:\n min2 = x\n update(0, n, (i, x), data1)\n print(ans)\n return\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"9b78a97b4b76e68d92800a00a37d61a75196c9b06e589ce18342502a2da0c713","fast_id":"p02935_9b78a97b4b76e68d92800a00a37d61a75196c9b06e589ce18342502a2da0c713","language":"python","measured_fast_code_id":"9b78a97b4b76e68d92800a00a37d61a75196c9b06e589ce18342502a2da0c713","measured_slow_code_id":"469a8dbe0d6e33ac7f370cd3ccb58bdf599ddcbe6d94e7cc5a7cde68de5db05a","measurement_metric":"cpu_instruction_count","pair_id":"python_b2d83c3af64cf68976172808","problem_id":"p02935","slow_code_id":"f9cf033ef3320a5fdaabd7fadad3d7ff479bba43226bb8f92e09489a3fd88f4d","slow_id":"p02935_469a8dbe0d6e33ac7f370cd3ccb58bdf599ddcbe6d94e7cc5a7cde68de5db05a","speedup":581.2848745615962,"stratum":"8+","sampling_key":"299936831aad82bd1da90eaeff88bb1c147143250037cfbe3f794232e5c4e07b","slow_code":"import numpy as np\n\nN = int(eval(input()))\nstr_list = input().split(\" \")\nA = [int(x) for x in str_list]\nA = np.array(A)\nwhile len(A) > 1:\n first_min = A[A.argmin()]\n\n A = np.delete(A, A.argmin())\n second_min = A[A.argmin()]\n\n A = np.delete(A, A.argmin())\n mean = (first_min + second_min) / 2.0\n A = np.append(A, mean)\n\nprint(mean)\n","fast_code":"import sys\n\ninput = sys.stdin.readline\n\n\ndef I():\n return int(eval(input()))\n\n\ndef MI():\n return list(map(int, input().split()))\n\n\ndef LI():\n return list(map(int, input().split()))\n\n\ndef main():\n mod = 10**9 + 7\n N = I()\n v = LI()\n v.sort()\n ans = v[0]\n for i in range(1, N):\n ans = (ans + v[i]) / 2\n print(ans)\n\n\nmain()\n"} +{"fast_code_id":"3f65538115180e09902679739ec85edb37a82a1b82145d4fa6c2db569ed43870","fast_id":"p02699_3f65538115180e09902679739ec85edb37a82a1b82145d4fa6c2db569ed43870","language":"python","measured_fast_code_id":"3f65538115180e09902679739ec85edb37a82a1b82145d4fa6c2db569ed43870","measured_slow_code_id":"084d274c57f95a15e9ad65a8072a788828494b876c9fb00ba76e955369e619b4","measurement_metric":"cpu_instruction_count","pair_id":"python_b3187e21923bc304095f59e0","problem_id":"p02699","slow_code_id":"2b15fcde67ed0713d312a3aaee502dd9087cb59a31e02c65162aa10dcbc89fbe","slow_id":"p02699_084d274c57f95a15e9ad65a8072a788828494b876c9fb00ba76e955369e619b4","speedup":4.1418215865726005,"stratum":"4-8","sampling_key":"5d4e209f100d3421a3cec5e60fcf0c61d49596ad6ef68ef693463d3229134f2e","slow_code":"import sys\nimport math\nfrom bisect import bisect_right as br\nfrom bisect import bisect_left as bl\n\nsys.setrecursionlimit(2147483647)\nfrom heapq import heappush, heappop, heappushpop\nfrom collections import defaultdict\nfrom itertools import accumulate\nfrom collections import Counter\nfrom collections import deque\nfrom operator import itemgetter\nfrom itertools import permutations\n\nmod = 10**9 + 7\ninf = float(\"inf\")\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\ns, w = LI()\nif w >= s:\n print(\"unsafe\")\nelse:\n print(\"safe\")\n","fast_code":"s, w = map(int, input().split())\nprint(\"unsafe\") if w >= s else print(\"safe\")\n"} +{"fast_code_id":"500da897d6884a4a46e1a3a21d125c24375248a0c05deb82db041abc5ed41dfe","fast_id":"p03136_8ca6165063a3afd29fb5c8aa3aeb866b35552c9bef692d474dd89fd8e20642b7","language":"python","measured_fast_code_id":"8ca6165063a3afd29fb5c8aa3aeb866b35552c9bef692d474dd89fd8e20642b7","measured_slow_code_id":"4be873c382d7f88cc1e36527ba71e39cb04cebba58534d56f1501f183fdfdcbd","measurement_metric":"cpu_instruction_count","pair_id":"python_b321f8109a92ff60e781446c","problem_id":"p03136","slow_code_id":"4be873c382d7f88cc1e36527ba71e39cb04cebba58534d56f1501f183fdfdcbd","slow_id":"p03136_4be873c382d7f88cc1e36527ba71e39cb04cebba58534d56f1501f183fdfdcbd","speedup":6.7069421669856455,"stratum":"4-8","sampling_key":"65e9cd470b04c1f2c280f666008f52f9e9d1787365a16a9be7176c683e51e718","slow_code":"def examA():\n T, X = LI()\n ans = T / X\n print(ans)\n return\n\n\ndef examB():\n N = I()\n L = LI()\n ans = \"Yes\"\n if max(L) * 2 >= sum(L):\n ans = \"No\"\n print(ans)\n return\n\n\nimport sys, copy, bisect, itertools, heapq, math\nfrom heapq import heappop, heappush, heapify\nfrom collections import Counter, defaultdict, deque\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\ndef LSI():\n return list(map(str, sys.stdin.readline().split()))\n\n\ndef LS():\n return sys.stdin.readline().split()\n\n\ndef SI():\n return sys.stdin.readline().strip()\n\n\nmod = 10**9 + 7\ninf = float(\"inf\")\nif __name__ == \"__main__\":\n examB()\n","fast_code":"from collections import Counter\n\n\ndef inputlist():\n return [int(j) for j in input().split()]\n\n\nN = int(eval(input()))\nL = inputlist()\nL.sort()\ns = 0\nfor i in range(N - 1):\n s += L[i]\nif s > L[-1]:\n print(\"Yes\")\nelse:\n print(\"No\")\n"} +{"fast_code_id":"75037892fbe0d3f8ec2f6cad07c769abb92a7779fb94ebaf53c5f1ef1cf5a970","fast_id":"p03330_2bf84a04b2c862b8fc6cada5361225248d707fa385c9679c1031ce69470c3f9c","language":"python","measured_fast_code_id":"2bf84a04b2c862b8fc6cada5361225248d707fa385c9679c1031ce69470c3f9c","measured_slow_code_id":"3bd4658cdee1a3e303306cb3c909ff4c2e9f6d0ee5a849d5106e04c5a82307d6","measurement_metric":"cpu_instruction_count","pair_id":"python_b34c6a0b3cd61191e4382121","problem_id":"p03330","slow_code_id":"3bd4658cdee1a3e303306cb3c909ff4c2e9f6d0ee5a849d5106e04c5a82307d6","slow_id":"p03330_3bd4658cdee1a3e303306cb3c909ff4c2e9f6d0ee5a849d5106e04c5a82307d6","speedup":5.302675780107717,"stratum":"4-8","sampling_key":"77920000b4ff9a8ae4bffb25642f38516cfe442d85f27edf185619dd08001ead","slow_code":"from itertools import permutations\n\nn, c = list(map(int, input().split()))\nD = [list(map(int, input().split())) for _ in range(c)]\nC = [list(map(int, input().split())) for _ in range(n)]\ncolors = [[0] * c for _ in range(3)]\nfor i in range(n):\n for j in range(n):\n c_ij = C[i][j] - 1\n index = (i + j) % 3\n for col in range(c):\n colors[index][col] += D[c_ij][col]\nans = 1000 * 500**2\nfor c0, c1, c2 in permutations(list(range(c)), 3):\n diff = colors[0][c0] + colors[1][c1] + colors[2][c2]\n ans = min(ans, diff)\nprint(ans)\n","fast_code":"from collections import Counter, defaultdict, deque\nimport sys, heapq, bisect, math, itertools, string, queue\n\nsys.setrecursionlimit(10**8)\nmod = 10**9 + 7\n\n\ndef inp():\n return int(sys.stdin.readline())\n\n\ndef inpl():\n return list(map(int, sys.stdin.readline().split()))\n\n\ndef inpl_str():\n return list(sys.stdin.readline().split())\n\n\ndef inpln(n):\n return list(int(sys.stdin.readline()) for i in range(n))\n\n\nn, C = inpl()\nd = []\nc = []\nfor i in range(C):\n d.append(inpl())\nfor i in range(n):\n c.append(inpl())\nd0 = defaultdict(int)\nd1 = defaultdict(int)\nd2 = defaultdict(int)\ndd = [d0, d1, d2]\nfor y in range(n):\n for x in range(n):\n t = (x + y + 2) % 3\n dd[t][c[x][y]] += 1\n\nres = [[] for i in range(3)]\nfor i in range(C):\n for j in range(3):\n tmp = 0\n for key in list(dd[j].keys()):\n tmp += d[key - 1][i] * dd[j][key]\n res[j].append([i, tmp])\nfor i in range(3):\n res[i].sort(key=lambda x: x[1])\n\nans = mod\nfor i in range(3):\n for j in range(3):\n for k in range(3):\n if (\n res[0][i][0] == res[1][j][0]\n or res[0][i][0] == res[2][k][0]\n or res[2][k][0] == res[1][j][0]\n ):\n continue\n ans = min(res[0][i][1] + res[1][j][1] + res[2][k][1], ans)\nprint(ans)\n"} +{"fast_code_id":"b6834044bcbc77eb8a44d485655e938ae1a4127b00d69345cf12935172ed1f49","fast_id":"p02845_b6834044bcbc77eb8a44d485655e938ae1a4127b00d69345cf12935172ed1f49","language":"python","measured_fast_code_id":"b6834044bcbc77eb8a44d485655e938ae1a4127b00d69345cf12935172ed1f49","measured_slow_code_id":"7ba69032f2d59ffe9fc67bd7616bd43fa583de9d44ef042066a6c2510e53022b","measurement_metric":"cpu_instruction_count","pair_id":"python_b3c925cae1f7210c378dead0","problem_id":"p02845","slow_code_id":"7ba69032f2d59ffe9fc67bd7616bd43fa583de9d44ef042066a6c2510e53022b","slow_id":"p02845_7ba69032f2d59ffe9fc67bd7616bd43fa583de9d44ef042066a6c2510e53022b","speedup":4.96317148654498,"stratum":"4-8","sampling_key":"496cfc6e5f75ee6b4ec95406e0705eca333b872aeefd99cccd574c42bb208a0a","slow_code":"N = int(eval(input()))\nA = list(map(int, input().split()))\nMOD = 1_000_000_007\ncnt = [0, 0, 0]\nans = 1\nfor i in range(N):\n ans *= sum(c == A[i] for c in cnt)\n ans %= MOD\n for j in range(3):\n if cnt[j] == A[i]:\n cnt[j] += 1\n break\nprint(ans)\n","fast_code":"import sys\n\nread = sys.stdin.read\nreadline = sys.stdin.readline\nreadlines = sys.stdin.readlines\nsys.setrecursionlimit(10**9)\nINF = 1 << 60\n\n\ndef main():\n MOD = 1000000007\n N, *A = list(map(int, read().split()))\n C = [0] * (N + 1)\n C[0] = 3\n ans = 1\n for a in A:\n ans = ans * C[a] % MOD\n if ans == 0:\n print((0))\n return\n C[a] -= 1\n C[a + 1] += 1\n print(ans)\n return\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"2890f8e8770efed4f9c4bcfae3a889c8fe41634ad1976e117b0b362228e642bd","fast_id":"p03649_2890f8e8770efed4f9c4bcfae3a889c8fe41634ad1976e117b0b362228e642bd","language":"python","measured_fast_code_id":"2890f8e8770efed4f9c4bcfae3a889c8fe41634ad1976e117b0b362228e642bd","measured_slow_code_id":"be5e31e4c6feb72123adbbca7a7fea964a379f99b17930aa063ffddf54a34a24","measurement_metric":"cpu_instruction_count","pair_id":"python_b3d9f7fc9408aa856846393d","problem_id":"p03649","slow_code_id":"be5e31e4c6feb72123adbbca7a7fea964a379f99b17930aa063ffddf54a34a24","slow_id":"p03649_be5e31e4c6feb72123adbbca7a7fea964a379f99b17930aa063ffddf54a34a24","speedup":2.4972781417749514,"stratum":"2-4","sampling_key":"95868735a1bece6ea7ab91c057003aae54766d0517eb2c6f484a5057729ae1f8","slow_code":"n = int(eval(input()))\na = list(map(int, input().split()))\ni = 0\nans = 0\nwhile max(a) >= n:\n if a[i] >= n:\n cnt = a[i] // n\n ans += cnt\n a[i] -= n * cnt\n for j in range(n):\n if j == i:\n continue\n a[j] += cnt\n i = (i + 1) % n\nprint(ans)\n","fast_code":"n = int(eval(input()))\na = list(map(int, input().split()))\nans = 0\nwhile True:\n tmp = 0\n for i in range(n):\n k = -(-(a[i] + 1) // n) - 1\n tmp += k\n a[i] -= k * n\n a[i] -= k\n for i in range(n):\n a[i] += tmp\n if not tmp:\n break\n ans += tmp\nprint(ans)\n"} +{"fast_code_id":"2a17951a8ecf02da756ffb9edb72b8340c15583689fba5758559e6dd69bff804","fast_id":"p03018_2a17951a8ecf02da756ffb9edb72b8340c15583689fba5758559e6dd69bff804","language":"python","measured_fast_code_id":"2a17951a8ecf02da756ffb9edb72b8340c15583689fba5758559e6dd69bff804","measured_slow_code_id":"34cfcb0cd806549d9de932b7805e60b0300ac48d582c70a3b82e9e63ed79dbe3","measurement_metric":"cpu_instruction_count","pair_id":"python_b41047124a103d8785ba1618","problem_id":"p03018","slow_code_id":"2a81960ac1f47336dbb6ad3e8a3b063f1f7be21a97a77ab30f5ed64ce398f2f3","slow_id":"p03018_34cfcb0cd806549d9de932b7805e60b0300ac48d582c70a3b82e9e63ed79dbe3","speedup":2.643489914350368,"stratum":"2-4","sampling_key":"c58bc5339292725bb044e450c53ab8fc5d7e4116b05308c693943a7087c5ed6b","slow_code":"import sys\n\nstdin = sys.stdin\nri = lambda: int(rs())\nrl = lambda: list(map(int, stdin.readline().split()))\nrs = lambda: stdin.readline().rstrip()\nS = list(rs())\ncur = \"D\"\nanswer = 0\nA_cnt = 0\nfor s in S:\n if cur == \"A\":\n if s == \"A\":\n A_cnt += 1\n elif s == \"B\":\n cur = s\n else:\n cur = \"D\"\n A_cnt = 0\n elif cur == \"B\":\n if s == \"A\":\n A_cnt = 1\n cur = s\n elif s == \"B\":\n A_cnt = 0\n cur = \"D\"\n elif s == \"C\":\n answer += A_cnt\n cur = s\n else:\n cur = \"D\"\n A_cnt = 0\n elif cur == \"C\":\n if s == \"A\":\n A_cnt += 1\n cur = s\n elif s == \"B\":\n cur = s\n else:\n cur = \"D\"\n A_cnt = 0\n else:\n if s == \"A\":\n A_cnt += 1\n cur = s\n else:\n A_cnt = 0\n cur = \"D\"\nprint(answer)\n","fast_code":"s = input().replace(\"BC\", \"D\")\nans = 0\nc = 0\nfor e in s:\n if e == \"A\":\n c += 1\n elif e == \"D\":\n ans += c\n else:\n c = 0\nprint(ans)\n"} +{"fast_code_id":"04b85ed12ccbd7000774636b207f3beb25882226515e7db43fed49073b7935a0","fast_id":"p02712_04b85ed12ccbd7000774636b207f3beb25882226515e7db43fed49073b7935a0","language":"python","measured_fast_code_id":"04b85ed12ccbd7000774636b207f3beb25882226515e7db43fed49073b7935a0","measured_slow_code_id":"cc3f9e0e6116014af910f8b40835b1f31de095fd1860f0d0844bf40df1c5751a","measurement_metric":"cpu_instruction_count","pair_id":"python_b416601925c4179d4b0e0e66","problem_id":"p02712","slow_code_id":"cc3f9e0e6116014af910f8b40835b1f31de095fd1860f0d0844bf40df1c5751a","slow_id":"p02712_cc3f9e0e6116014af910f8b40835b1f31de095fd1860f0d0844bf40df1c5751a","speedup":910.8976786375522,"stratum":"8+","sampling_key":"c0ac727e8207680f62678c356b0ff1bd574eeb2545e91d3e731f9b31cc863944","slow_code":"n = int(eval(input()))\na = [0 for i in range(n)]\ncount = 0\nfor i in range(n):\n if (i + 1) % 3 == 0 or (i + 1) % 5 == 0:\n continue\n else:\n a[i] = i + 1\n count += i + 1\nprint(count)\n","fast_code":"def sum(N):\n return N * (N + 1) // 2\n\n\nN = int(eval(input()))\nprint((sum(N) - sum(N // 3) * 3 - sum(N // 5) * 5 + sum(N // 15) * 15))\n"} +{"fast_code_id":"cd86bc221b6a805ec5c0b4610756b6c0dee20a7d792dce9a278bfe2e5dbc91f2","fast_id":"p03786_cd86bc221b6a805ec5c0b4610756b6c0dee20a7d792dce9a278bfe2e5dbc91f2","language":"python","measured_fast_code_id":"cd86bc221b6a805ec5c0b4610756b6c0dee20a7d792dce9a278bfe2e5dbc91f2","measured_slow_code_id":"9c47b5351287e97e1c5de7875f912e9de0349c4286a89e13a6aa097ca0c9f946","measurement_metric":"cpu_instruction_count","pair_id":"python_b42ef2850dd53bc85535d39c","problem_id":"p03786","slow_code_id":"9c47b5351287e97e1c5de7875f912e9de0349c4286a89e13a6aa097ca0c9f946","slow_id":"p03786_9c47b5351287e97e1c5de7875f912e9de0349c4286a89e13a6aa097ca0c9f946","speedup":83.46545191733904,"stratum":"8+","sampling_key":"032191c485ce94db7e831b91226d1818bfb7a6254ff8dc8bbae67d3167a11e44","slow_code":"n = int(eval(input()))\na = list(map(int, input().split()))\nimport numpy as np\n\na = sorted(a)\ncum = np.cumsum(a)\ncum = list(reversed(cum))\na = list(reversed(a))\nans = 1\nfor i in range(1, n):\n if a[i - 1] <= cum[i] * 2:\n ans += 1\n else:\n break\nprint(ans)\n","fast_code":"import heapq\n\nn = int(eval(input()))\nA = list(map(int, input().split()))\nheapq.heapify(A)\ncnt = 1\nprev = heapq.heappop(A)\nwhile A:\n x = heapq.heappop(A)\n if prev > x:\n heapq.heappush(A, prev)\n prev = x\n continue\n if 2 * prev < x:\n cnt = 1\n else:\n cnt += 1\n prev += x\nprint(cnt)\n"} +{"fast_code_id":"c90a433994414011a6dc5da39acad2c6a9e60d5b0c9f99a3af31740b5bf36707","fast_id":"p03719_c90a433994414011a6dc5da39acad2c6a9e60d5b0c9f99a3af31740b5bf36707","language":"python","measured_fast_code_id":"c90a433994414011a6dc5da39acad2c6a9e60d5b0c9f99a3af31740b5bf36707","measured_slow_code_id":"0acae026c7e63eed2245b851c8d32eee934659ca23b9e50786cb323f85625345","measurement_metric":"cpu_instruction_count","pair_id":"python_b4360c738e8c43146db9ea84","problem_id":"p03719","slow_code_id":"0acae026c7e63eed2245b851c8d32eee934659ca23b9e50786cb323f85625345","slow_id":"p03719_0acae026c7e63eed2245b851c8d32eee934659ca23b9e50786cb323f85625345","speedup":7.885900146853008,"stratum":"4-8","sampling_key":"0944c640f32c6637c1076772097316ab5f0e9d21b25c02f1fc42e41b13f7762d","slow_code":"import functools\nimport os\nimport sys\n\nsys.setrecursionlimit(10000)\nINF = float(\"inf\")\n\n\ndef inp():\n return int(eval(input()))\n\n\ndef inpf():\n return float(eval(input()))\n\n\ndef inps():\n return eval(input())\n\n\ndef inl():\n return list(map(int, input().split()))\n\n\ndef inlf():\n return list(map(float, input().split()))\n\n\ndef inls():\n return input().split()\n\n\ndef inpm(line):\n return [inp() for _ in range(line)]\n\n\ndef inpfm(line):\n return [inpf() for _ in range(line)]\n\n\ndef inpsm(line):\n return [inps() for _ in range(line)]\n\n\ndef inlm(line):\n return [inl() for _ in range(line)]\n\n\ndef inlfm(line):\n return [inlf() for _ in range(line)]\n\n\ndef inlsm(line):\n return [inls() for _ in range(line)]\n\n\ndef Yesif(cond):\n print((\"Yes\" if cond else \"No\"))\n\n\ndef YESIF(cond):\n print((\"YES\" if cond else \"NO\"))\n\n\ndef yesif(cond):\n print((\"yes\" if cond else \"no\"))\n\n\na, b, c = inl()\nYesif(a <= c <= b)\n","fast_code":"A, B, C = list(map(int, input().split()))\nif A <= C <= B:\n print(\"Yes\")\nelse:\n print(\"No\")\n"} +{"fast_code_id":"284a8c35e2eafc9aefdfd8aea3724dceaddb6694fb0e85ae17f2e4abdc89ffd1","fast_id":"p03331_8c8462ab78a9cd9c5b23cab4ea1172c4e2ca8e2ac0f69de77b0da618078d98d4","language":"python","measured_fast_code_id":"8c8462ab78a9cd9c5b23cab4ea1172c4e2ca8e2ac0f69de77b0da618078d98d4","measured_slow_code_id":"153ddd3939958df9731f2cb6a9569dfdd13dde4cae47410105d9d1d355dcbd24","measurement_metric":"cpu_instruction_count","pair_id":"python_b4c4519aa13e0a33928f7e5d","problem_id":"p03331","slow_code_id":"153ddd3939958df9731f2cb6a9569dfdd13dde4cae47410105d9d1d355dcbd24","slow_id":"p03331_153ddd3939958df9731f2cb6a9569dfdd13dde4cae47410105d9d1d355dcbd24","speedup":4743.489018950577,"stratum":"8+","sampling_key":"fa7525a567cd25fc51541db7d551ef88efa0a99413e588a0ef185c1ddcc86f23","slow_code":"N = int(eval(input()))\nimport numpy as np\n\na = np.arange(N)\na = np.delete(a, 0)\nb = N - a\nnum_arr = []\nfor i in range(len(a)):\n factor_a = [int(x) for x in list(str(a[i]))]\n factor_b = [int(x) for x in list(str(b[i]))]\n num_arr.append(sum(factor_a) + sum(factor_b))\nprint((min(num_arr)))\n","fast_code":"import math\n\nn = int(eval(input()))\nm = math.log10(n)\nif int(m) == m:\n print((10))\n exit()\nans = sum(map(int, list(str(n))))\nprint(ans)\n"} +{"fast_code_id":"179f19d32bfd3c7f375699a4c65c546ee213f4ad9e3ecec852d6caaa99b23bd7","fast_id":"p04000_179f19d32bfd3c7f375699a4c65c546ee213f4ad9e3ecec852d6caaa99b23bd7","language":"python","measured_fast_code_id":"179f19d32bfd3c7f375699a4c65c546ee213f4ad9e3ecec852d6caaa99b23bd7","measured_slow_code_id":"a36bab8f921599e4ca7482c881bfcc39764a8e5acc14a246031adfce3dcc98b4","measurement_metric":"cpu_instruction_count","pair_id":"python_b4f32a7f0ef17b21f91f483b","problem_id":"p04000","slow_code_id":"12645471e5b932b71064020cd96552bd93299a86ffda13a17e3ba1b8f76a6c83","slow_id":"p04000_a36bab8f921599e4ca7482c881bfcc39764a8e5acc14a246031adfce3dcc98b4","speedup":3.038995720530817,"stratum":"2-4","sampling_key":"6d49d32f55d83f7d7496e8e5714220d78461f7652f80ea21f7190c0e9a64eaa9","slow_code":"H, W, N = list(map(int, input().split()))\nB = set([])\nfor i in range(N):\n a, b = list(map(int, input().split()))\n a -= 1\n b -= 1\n B.add((a, b))\n\nBB = list(B)\nans = [0 for _ in range(10)]\nfor i in range(N):\n cnt = 0\n temp = 0\n x, y = BB[i]\n\n for sx in range(max(0, x - 2), min(x, H - 3) + 1):\n for sy in range(max(0, y - 2), min(y, W - 3) + 1):\n temp = 0\n for p in range(3):\n for q in range(3):\n if (sx + p, sy + q) in B:\n temp += 1\n\n ans[temp] += 1\nfor i in range(1, 10):\n ans[i] = ans[i] // i\nans[0] = (H - 2) * (W - 2) - sum(ans[1:])\nfor t in ans:\n print(t)\n","fast_code":"h, w, n = map(int, input().split())\nfrom itertools import product as pr\nfrom collections import Counter as co\n\nans = [(h - 2) * (w - 2)] + [0] * 9\nio = [tuple(map(int, input().split())) for i in range(n)]\nfor k, v in co(\n co(\n [\n (a - x) * w + b - y\n for x, y in pr(range(3), repeat=2)\n for a, b in io\n if h - 1 > a - x > 0 < b - y < w - 1\n ]\n ).values()\n).items():\n ans[k] = v\n ans[0] -= v\nprint(*ans, sep=\"\\n\")\n"} +{"fast_code_id":"b6834044bcbc77eb8a44d485655e938ae1a4127b00d69345cf12935172ed1f49","fast_id":"p02845_b6834044bcbc77eb8a44d485655e938ae1a4127b00d69345cf12935172ed1f49","language":"python","measured_fast_code_id":"b6834044bcbc77eb8a44d485655e938ae1a4127b00d69345cf12935172ed1f49","measured_slow_code_id":"2e0c69275d555d0986cf10daaf47fc3222dbbe8f421d516e87b0e51265dffcb6","measurement_metric":"cpu_instruction_count","pair_id":"python_b515a4356ada39177a00de3a","problem_id":"p02845","slow_code_id":"2e0c69275d555d0986cf10daaf47fc3222dbbe8f421d516e87b0e51265dffcb6","slow_id":"p02845_2e0c69275d555d0986cf10daaf47fc3222dbbe8f421d516e87b0e51265dffcb6","speedup":3.343261592279889,"stratum":"2-4","sampling_key":"ffc3196f782c44faf40ead3f2d804694e3e08d98fb480d0af795e6e018814345","slow_code":"n = int(eval(input()))\nl = list(map(int, input().split()))\nmod = 10**9 + 7\nans = 1\nrgb = [0] * 3\nfor i in range(n):\n f = 0\n for j in range(3):\n if l[i] == rgb[j]:\n if f == 0:\n rgb[j] += 1\n f += 1\n ans *= f\n ans %= mod\nprint(ans)\n","fast_code":"import sys\n\nread = sys.stdin.read\nreadline = sys.stdin.readline\nreadlines = sys.stdin.readlines\nsys.setrecursionlimit(10**9)\nINF = 1 << 60\n\n\ndef main():\n MOD = 1000000007\n N, *A = list(map(int, read().split()))\n C = [0] * (N + 1)\n C[0] = 3\n ans = 1\n for a in A:\n ans = ans * C[a] % MOD\n if ans == 0:\n print((0))\n return\n C[a] -= 1\n C[a + 1] += 1\n print(ans)\n return\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"f9f64d2f044687a8ad37511c5997b4a69ea1ddcad543c0d3e43857539ebdeb82","fast_id":"p02675_f9f64d2f044687a8ad37511c5997b4a69ea1ddcad543c0d3e43857539ebdeb82","language":"python","measured_fast_code_id":"f9f64d2f044687a8ad37511c5997b4a69ea1ddcad543c0d3e43857539ebdeb82","measured_slow_code_id":"2d3c735c213ec81bc8c26091e19ebd8461e366cff4fed305d8b06c8c2e49be9d","measurement_metric":"cpu_instruction_count","pair_id":"python_b604aa1efdc87e6f42207406","problem_id":"p02675","slow_code_id":"da5a21f4ebfb4d44ad88c7f5db5f559a60e0742e11d07068514eea6e5e1d7a49","slow_id":"p02675_2d3c735c213ec81bc8c26091e19ebd8461e366cff4fed305d8b06c8c2e49be9d","speedup":5.789079415601124,"stratum":"4-8","sampling_key":"068bb39a898f30ea959d97d90d2b285ebc099d6fc998886e68748c8eb8abdca9","slow_code":"import sys\nimport math\nimport collections\nimport itertools\nimport bisect\n\nINF = 10**13\nMOD = 10**9 + 7\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef gcd(x, y):\n return x if y == 0 else gcd(y, x % y)\n\n\ndef lcm(x, y):\n return (x * y) // gcd(x, y)\n\n\ndef I():\n return int(input())\n\n\ndef LI():\n return [int(x) for x in input().split()]\n\n\ndef RI(N):\n return [int(input()) for _ in range(N)]\n\n\ndef LRI(N):\n return [[int(x) for x in input().split()] for _ in range(N)]\n\n\ndef LS():\n return input().split()\n\n\ndef RS(N):\n return [input() for _ in range(N)]\n\n\ndef LRS(N):\n return [input().split() for _ in range(N)]\n\n\ndef PL(L):\n print(*L, sep=\"\\n\")\n\n\ndef YesNo(B):\n print(\"Yes\" if B else \"No\")\n\n\ndef YESNO(B):\n print(\"YES\" if B else \"NO\")\n\n\nN = input()\nn = int(N[-1])\nif n in [2, 4, 5, 7, 9]:\n print(\"hon\")\nelif n in [0, 1, 6, 8]:\n print(\"pon\")\nelse:\n print(\"bon\")\n","fast_code":"n = int(eval(input()))\na = n % 10\nif a == 3:\n print(\"bon\")\nelif a == 0 or a == 1 or a == 6 or a == 8:\n print(\"pon\")\nelse:\n print(\"hon\")\n"} +{"fast_code_id":"8ec87298d18ef5288be7c7dc8ecbe534f41952b3845b5bb3a89527f409b1763f","fast_id":"p02934_8ec87298d18ef5288be7c7dc8ecbe534f41952b3845b5bb3a89527f409b1763f","language":"python","measured_fast_code_id":"8ec87298d18ef5288be7c7dc8ecbe534f41952b3845b5bb3a89527f409b1763f","measured_slow_code_id":"211cf9210f831d8fb05b381729d971bff32a82a2b842e035287d2fa234660fd0","measurement_metric":"cpu_instruction_count","pair_id":"python_b63073dc12907630bfb20663","problem_id":"p02934","slow_code_id":"211cf9210f831d8fb05b381729d971bff32a82a2b842e035287d2fa234660fd0","slow_id":"p02934_211cf9210f831d8fb05b381729d971bff32a82a2b842e035287d2fa234660fd0","speedup":1080.7960908009968,"stratum":"8+","sampling_key":"0184c8cc4e8d0665df40b083ec3085be69b8df4df626ee395c3062c64dddb383","slow_code":"import numpy as np\n\nN = int(eval(input()))\nA_array = np.array([int(x) for x in input().split()])\na_array = np.sum(1 / A_array)\nprint((1 / a_array))\n","fast_code":"N = int(eval(input()))\nlst_A = list(map(int, input().split()))\nans = 1 / sum(1 / x for x in lst_A)\nprint(ans)\n"} +{"fast_code_id":"a999559ee3dccd6dfd62a176c9b46c9efd1583a53bde251fce80f8d052e671ee","fast_id":"p02789_a999559ee3dccd6dfd62a176c9b46c9efd1583a53bde251fce80f8d052e671ee","language":"python","measured_fast_code_id":"a999559ee3dccd6dfd62a176c9b46c9efd1583a53bde251fce80f8d052e671ee","measured_slow_code_id":"78de3f88cb23bb16fb5f9ba282f1719bd461fd7ea9f6aadce1636b6f3a8090f3","measurement_metric":"cpu_instruction_count","pair_id":"python_b66eb8c62732f5c84feba591","problem_id":"p02789","slow_code_id":"2686b43bdf8ed3cbe77780e6157f246a6c7c3d5757c1ec23cbec723e3255f4bc","slow_id":"p02789_78de3f88cb23bb16fb5f9ba282f1719bd461fd7ea9f6aadce1636b6f3a8090f3","speedup":2622.4598107618012,"stratum":"8+","sampling_key":"117143c66403fceea390c72f64f45a3b7666b981a12580fa5153fd6e91ca6aa8","slow_code":"import math\nimport statistics\nimport numpy as np\nimport queue\n\n\ndef fact(n):\n if n == 1:\n return 1\n else:\n return n * fact(n - 1)\n\n\ndef gcd(a, b):\n if a == 0:\n return b\n elif b == 0:\n return a\n else:\n return gcd(b, a % b)\n\n\ndef lcm(a, b):\n return a * b / gcd(a, b)\n\n\ndef qsort(seq):\n if len(seq) < 2:\n return seq\n else:\n beg, end = 0, len(seq) - 1\n mid = (beg + end) // 2\n smaller = [c for c in seq if seq[mid] > c]\n equal = [c for c in seq if seq[mid] == c]\n larger = [c for c in seq if seq[mid] < c]\n return qsort(smaller) + equal + qsort(larger)\n\n\nn, m = list(map(int, input().split()))\nif n == m:\n print(\"Yes\")\nelse:\n print(\"No\")\n","fast_code":"print((\"YNeos\"[eval(input().replace(\" \", \">\")) :: 2]))\n"} +{"fast_code_id":"356c651389ee677f02e136c68a9677391749837f39206556dc40201e6aa5d07f","fast_id":"p00741_356c651389ee677f02e136c68a9677391749837f39206556dc40201e6aa5d07f","language":"python","measured_fast_code_id":"356c651389ee677f02e136c68a9677391749837f39206556dc40201e6aa5d07f","measured_slow_code_id":"8dc05be20af5e5075433e403978246b6c79a92c743c71aa185196282e815a1ee","measurement_metric":"cpu_instruction_count","pair_id":"python_b736682aa3f3a40c4bf75ff4","problem_id":"p00741","slow_code_id":"98d0d93fa34ee5017dabd2c7cc8ffe301917d35141c767ea46a7bc955a0514a7","slow_id":"p00741_8dc05be20af5e5075433e403978246b6c79a92c743c71aa185196282e815a1ee","speedup":2.923582496710271,"stratum":"2-4","sampling_key":"1adb478e6f15f87a1f5a5bcfe74c32cfd723e4d61412a271a196097f8978fa66","slow_code":"import sys\nfrom pprint import pprint\n\n\nclass UnionFind:\n def __init__(self):\n self._parent = {}\n self._rank = {}\n self._equiv = {}\n\n def _find(self, x):\n if self._parent[x] == x:\n return self._parent[x]\n else:\n p = self._find(self._parent[x])\n self._parent[x] = p\n return p\n\n def _set_parent(self, child, parent):\n self._parent[child] = parent\n self._equiv[parent].update(self._equiv.pop(child))\n\n def _union(self, x, y):\n x = self._find(x)\n y = self._find(y)\n if x == y:\n return\n if self._rank[x] > self._rank[y]:\n self._set_parent(y, x)\n elif self._rank[x] < self._rank[y]:\n self._set_parent(x, y)\n else:\n self._set_parent(x, y)\n self._rank[x] += 1\n\n def _make_set(self, x):\n self._parent[x] = x\n self._rank[x] = 0\n self._equiv[x] = {x}\n\n def unite(self, *elements):\n if not elements:\n return\n for x in elements:\n if x in self._parent:\n continue\n self._make_set(x)\n x0 = elements[0]\n for x in elements[1:]:\n self._union(x0, x)\n\n def groups(self):\n return [set(e) for e in list(self._equiv.values())]\n\n\ndef solve(ncol, nrow, rows):\n pairs = []\n\n for x in range(ncol - 1):\n for y in range(nrow):\n pairs.append([(x, y), (x + 1, y)])\n\n for x in range(ncol):\n for y in range(nrow - 1):\n pairs.append([(x, y), (x, y + 1)])\n\n for x in range(ncol - 1):\n for y in range(nrow - 1):\n pairs.append([(x, y), (x + 1, y + 1)])\n\n for x in range(ncol - 1):\n for y in range(1, nrow):\n pairs.append([(x, y), (x + 1, y - 1)])\n f = UnionFind()\n for x in range(ncol):\n for y in range(nrow):\n if rows[y][x]:\n f.unite((x, y))\n for (x1, y1), (x2, y2) in pairs:\n if rows[y1][x1] and rows[y2][x2]:\n f.unite((x1, y1), (x2, y2))\n return len(f.groups())\n\n\ndef main():\n while True:\n ncol, nrow = list(map(int, input().split()))\n if ncol == 0 and nrow == 0:\n break\n rows = []\n for _ in range(nrow):\n row = list(map(int, input().split()))\n rows.append(row)\n\n print((solve(ncol, nrow, rows)))\n\n\nmain()\n","fast_code":"def solve_sub(x, y, area):\n stack = []\n stack.append((x, y))\n move = [\n (x, y) for x in range(-1, 2) for y in range(-1, 2) if not (x == 0 and y == 0)\n ]\n while len(stack) != 0:\n now = stack.pop()\n x = now[0]\n y = now[1]\n area[y][x] = 0\n for dire in move:\n if (\n 0 <= x + dire[0] < w\n and 0 <= y + dire[1] < h\n and area[y + dire[1]][x + dire[0]] == 1\n ):\n stack.append((x + dire[0], y + dire[1]))\n area[y + dire[1]][x + dire[0]] = 2\n\n\ndef solve(area):\n ans = 0\n for y in range(h):\n for x in range(w):\n if area[y][x] == 1:\n ans += 1\n solve_sub(x, y, area)\n print(ans)\n\n\nif __name__ == \"__main__\":\n while True:\n w, h = list(map(int, input().split()))\n if w == 0 and h == 0:\n break\n area = []\n for y in range(h):\n area.append(list(map(int, input().split())))\n solve(area)\n"} +{"fast_code_id":"454b234657cea2322f4260ff571ec862355d35b89f0fd41bc0ecf8d84ff3c105","fast_id":"p02603_454b234657cea2322f4260ff571ec862355d35b89f0fd41bc0ecf8d84ff3c105","language":"python","measured_fast_code_id":"454b234657cea2322f4260ff571ec862355d35b89f0fd41bc0ecf8d84ff3c105","measured_slow_code_id":"25faafb2b0ca16cedbeb669295357df971e7c7a40120b3549a7cc9eefa9e9f0e","measurement_metric":"cpu_instruction_count","pair_id":"python_b749d9e6ae69f45a730b9268","problem_id":"p02603","slow_code_id":"25faafb2b0ca16cedbeb669295357df971e7c7a40120b3549a7cc9eefa9e9f0e","slow_id":"p02603_25faafb2b0ca16cedbeb669295357df971e7c7a40120b3549a7cc9eefa9e9f0e","speedup":4.3028249873389575,"stratum":"4-8","sampling_key":"05a9c437d133ca5f03df23fa054a0d9ed316251c60a114e9ad21cebd41ba19d7","slow_code":"N = int(eval(input()))\nA = [0] + list(map(int, input().split()))\ndp = [0] * (N + 1)\ndp[1] = 1000\nfor i in range(2, N + 1):\n dp[i] = dp[i - 1]\n for j in range(1, i):\n stock = dp[j] // A[j]\n momey = dp[j] + (A[i] - A[j]) * stock\n dp[i] = max(dp[i], momey)\nprint((dp[N]))\n","fast_code":"n, *l = list(map(int, open(0).read().split()))\na = 1000\nfor i in range(n - 1):\n s, t = l[i : i + 2]\n a += a // s * max(t - s, 0)\nprint(a)\n"} +{"fast_code_id":"7d902607c2ca4ca8be65d037e3489da880091c07a9f816d8c2f5737e958c44f1","fast_id":"p02642_bdd16d72207b4bf865a860e870bc4592a06fba088da43210b75a9182380d4bd0","language":"python","measured_fast_code_id":"bdd16d72207b4bf865a860e870bc4592a06fba088da43210b75a9182380d4bd0","measured_slow_code_id":"17deae8ce2f8b76dd5d0f8a8b741fbc093186a8e41172410a54069f1d420d622","measurement_metric":"cpu_instruction_count","pair_id":"python_b757b28321c67a56b6c9aa62","problem_id":"p02642","slow_code_id":"17deae8ce2f8b76dd5d0f8a8b741fbc093186a8e41172410a54069f1d420d622","slow_id":"p02642_17deae8ce2f8b76dd5d0f8a8b741fbc093186a8e41172410a54069f1d420d622","speedup":5.618131974904126,"stratum":"4-8","sampling_key":"190a7c38d10f35a1c4140408d38d4177f9dd156058f67a46469f2ab835600f7b","slow_code":"N = int(eval(input()))\nAs = list(map(int, input().split()))\nM = max(As) + 1\ncnt = [0 for _ in range(M)]\nfor A in As:\n if cnt[A] != 0:\n cnt[A] = 2\n continue\n for n in range(A, M, A):\n cnt[n] += 1\nans = 0\nfor A in As:\n if cnt[A] == 1:\n ans += 1\nprint(ans)\n","fast_code":"def main():\n n = int(eval(input()))\n a = list(map(int, input().split()))\n ans = 0\n from collections import Counter\n\n cnt = Counter(a)\n lim = max(a) + 1\n tmp = [0] * (lim)\n\n a.sort()\n for aa in a:\n if tmp[aa] == 0:\n for j in range(aa, lim, aa):\n tmp[j] = 1\n if cnt[aa] == 1:\n\n ans += 1\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"e77d9ebb179f60c008b7919cca4d560cd519aaf12aca2f4cea32c490d524e154","fast_id":"p00008_e77d9ebb179f60c008b7919cca4d560cd519aaf12aca2f4cea32c490d524e154","language":"python","measured_fast_code_id":"e77d9ebb179f60c008b7919cca4d560cd519aaf12aca2f4cea32c490d524e154","measured_slow_code_id":"f78324b8c1f2014a7fb42b155a7df64e78b2806e6504b01d6dd4fa1d3a1e1f70","measurement_metric":"cpu_instruction_count","pair_id":"python_b84098b99e0e6df48a2ec711","problem_id":"p00008","slow_code_id":"f78324b8c1f2014a7fb42b155a7df64e78b2806e6504b01d6dd4fa1d3a1e1f70","slow_id":"p00008_f78324b8c1f2014a7fb42b155a7df64e78b2806e6504b01d6dd4fa1d3a1e1f70","speedup":875.5359345400536,"stratum":"8+","sampling_key":"17b5eb4e3245aaa2c60d07b61d42f47edd8654f3a7c3690848df976cf9a2216d","slow_code":"import sys, itertools\n\nfor n in map(int, sys.stdin):\n x = 0\n for num in itertools.product(\"0123456789\", repeat=4):\n eq = \"{}+{}+{}+{}\".format(*(num))\n if eval(eq) == n:\n x += 1\n print(x)\n","fast_code":"memo = [[-1] * 51 for i in range(5)]\n\n\ndef rec(i, n):\n if memo[i][n] != -1:\n return memo[i][n]\n r = 0\n if i == 4:\n return 1 if n == 0 else 0\n for m in range(10):\n r += rec(i + 1, n - m)\n memo[i][n] = r\n return r\n\n\nwhile True:\n try:\n n = int(eval(input()))\n print((rec(0, n)))\n except:\n break\n"} +{"fast_code_id":"523a040b3d2086d79e6be3a9c4b819c4b076ab91eb2d560674171afbd57c448a","fast_id":"p03575_523a040b3d2086d79e6be3a9c4b819c4b076ab91eb2d560674171afbd57c448a","language":"python","measured_fast_code_id":"523a040b3d2086d79e6be3a9c4b819c4b076ab91eb2d560674171afbd57c448a","measured_slow_code_id":"5e7c7216970600bec9b00c8c77b42dad7dec0f6fe93d427b1852bced77a5f685","measurement_metric":"cpu_instruction_count","pair_id":"python_b891d01b8906c58e1b6e28de","problem_id":"p03575","slow_code_id":"fdbe8a2a30186389cc5e861eaa33c8ca68cb8a1bd87081938b7a17c713eb13ee","slow_id":"p03575_5e7c7216970600bec9b00c8c77b42dad7dec0f6fe93d427b1852bced77a5f685","speedup":138.33300697161616,"stratum":"8+","sampling_key":"09e7fe1eaa06d6c92c2080887443984012e96181932c9fdf9e15edb880b6e52f","slow_code":"from heapq import heappush, heappop\nfrom itertools import permutations, accumulate, combinations\nimport math\nimport bisect\nimport numpy as np\nfrom collections import defaultdict, deque\nimport sys\n\ninput = sys.stdin.readline\n\n\ndef bfs(s, n, g):\n que = deque([])\n que.append(s)\n check = [-1] * n\n check[s] = 0\n while que:\n u = que.popleft()\n for v in g[u]:\n if check[v] == -1:\n check[v] = check[u] + 1\n que.append(v)\n if -1 in check:\n return True\n else:\n return False\n\n\ndef main():\n n, m = list(map(int, input().split()))\n g = [[] for _ in range(n)]\n gg = deque([])\n for _ in range(m):\n a, b = [int(i) - 1 for i in input().split()]\n g[a].append(b)\n g[b].append(a)\n gg.append((a, b))\n ans = 0\n for i in range(m):\n a, b = gg.popleft()\n g[a].remove(b)\n g[b].remove(a)\n if bfs(0, n, g):\n ans += 1\n g[a].append(b)\n g[b].append(a)\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"N, M = list(map(int, input().split()))\nG = [[] for i in range(N)]\nE = []\nfor i in range(M):\n a, b = list(map(int, input().split()))\n a, b = a - 1, b - 1\n G[a].append(b)\n G[b].append(a)\n E.append((a, b))\n\n\ndef dfs(v, pre, s, ng):\n if used[v]:\n return\n used[v] = 1\n s.add(v)\n for u in G[v]:\n if u == pre:\n continue\n if (u, v) != ng and (v, u) != ng:\n dfs(u, v, s, ng)\n return\n\n\nnum = 0\nfor i in E:\n used = [0] * N\n s = set()\n dfs(0, -1, s, i)\n if len(s) == N:\n num += 1\nprint((M - num))\n"} +{"fast_code_id":"25faafb2b0ca16cedbeb669295357df971e7c7a40120b3549a7cc9eefa9e9f0e","fast_id":"p02603_25faafb2b0ca16cedbeb669295357df971e7c7a40120b3549a7cc9eefa9e9f0e","language":"python","measured_fast_code_id":"25faafb2b0ca16cedbeb669295357df971e7c7a40120b3549a7cc9eefa9e9f0e","measured_slow_code_id":"96546192f6afbe684cb2275aae99976f706f42bd34306642da1e146a05f2b13e","measurement_metric":"cpu_instruction_count","pair_id":"python_b917ea11835ad8d0da119584","problem_id":"p02603","slow_code_id":"96546192f6afbe684cb2275aae99976f706f42bd34306642da1e146a05f2b13e","slow_id":"p02603_96546192f6afbe684cb2275aae99976f706f42bd34306642da1e146a05f2b13e","speedup":4.546397594098915,"stratum":"4-8","sampling_key":"8a27128f747e90f5dbc2499adc08ad0197f66cb71b8ab5feaa228bd75bcd2d8d","slow_code":"import math\nimport collections\nimport fractions\nimport itertools\nimport functools\nimport operator\n\n\ndef divis(l):\n seq = []\n beg, end = 0, 0\n le = len(l)\n for i in range(1, le):\n end = i\n if l[i] < l[i - 1]:\n seq.append(l[beg:end])\n beg = i\n seq.append(l[beg : end + 1])\n return seq\n\n\ndef solve():\n n = int(eval(input()))\n a = list(map(int, input().split()))\n a = divis(a)\n yosan = 1000\n for i in a:\n yosan += (i[-1] - i[0]) * (yosan // i[0])\n print(yosan)\n return 0\n\n\nif __name__ == \"__main__\":\n solve()\n","fast_code":"N = int(eval(input()))\nA = [0] + list(map(int, input().split()))\ndp = [0] * (N + 1)\ndp[1] = 1000\nfor i in range(2, N + 1):\n dp[i] = dp[i - 1]\n for j in range(1, i):\n stock = dp[j] // A[j]\n momey = dp[j] + (A[i] - A[j]) * stock\n dp[i] = max(dp[i], momey)\nprint((dp[N]))\n"} +{"fast_code_id":"9a3084698419bdea0a9d57129dfe8175366f9a3f51be206d8033d649a001d16c","fast_id":"p02392_9a3084698419bdea0a9d57129dfe8175366f9a3f51be206d8033d649a001d16c","language":"python","measured_fast_code_id":"9a3084698419bdea0a9d57129dfe8175366f9a3f51be206d8033d649a001d16c","measured_slow_code_id":"de04487b5a08627844d61298f885965ab158d25d2bda51807fc27addaf67096b","measurement_metric":"cpu_instruction_count","pair_id":"python_b93f25119235b50c13035c1a","problem_id":"p02392","slow_code_id":"c3d3757a61b38da19ec84678b61451515bf53604660861738644c471aeb44260","slow_id":"p02392_de04487b5a08627844d61298f885965ab158d25d2bda51807fc27addaf67096b","speedup":7.979580134989992,"stratum":"4-8","sampling_key":"e60c879df48da10f8c2dbba5a11cc17e77a3f6b169d05ae180d50f48b75eba45","slow_code":"import copy\n\nn = list(map(int, input().split()))\nif n[0] < n[1] < n[2]:\n print(\"Yes\")\nelse:\n print(\"No\")\n","fast_code":"def judge(a, b, c):\n return \"Yes\" if a < b < c else \"No\"\n\n\nif __name__ == \"__main__\":\n a, b, c = list(map(int, input().split(\" \")))\n print((judge(a, b, c)))\n"} +{"fast_code_id":"be954b079b4b5a55b2496a0b1735485291c687ae2af8175563cad8226c631da2","fast_id":"p02619_2f96bd212b01a079e750d481cae1f54cc90015865f391be40a4773e7b1588d63","language":"python","measured_fast_code_id":"2f96bd212b01a079e750d481cae1f54cc90015865f391be40a4773e7b1588d63","measured_slow_code_id":"e06ba4d62ffe23f292e9554193c989e47766a38ef3e00279117101508edbb374","measurement_metric":"cpu_instruction_count","pair_id":"python_ba3eec36ebe4a49d252b3a09","problem_id":"p02619","slow_code_id":"e06ba4d62ffe23f292e9554193c989e47766a38ef3e00279117101508edbb374","slow_id":"p02619_e06ba4d62ffe23f292e9554193c989e47766a38ef3e00279117101508edbb374","speedup":9.143497257187404,"stratum":"8+","sampling_key":"3d96bbb9f7c6af6d97d0533d77dda401a12cc77ec2020aca6c139ccfa9748965","slow_code":"import numpy as np\n\nD = int(eval(input()))\nc = [int(i) for i in input().split()]\ns = []\nfor d in range(D):\n s.append([int(i) for i in input().split()])\nt = []\nfor d in range(D):\n t.append(int(eval(input())) - 1)\nv = [0] * D\nlast = [[0 for i in range(26)] for d in range(D)]\nfor d in range(D):\n if d >= 1:\n last[d] = last[d - 1][:]\n last[d][t[d]] = d + 1\nfor d in range(D):\n v[d] = s[d][t[d]] - sum([c[i] * (d + 1 - last[d][i]) for i in range(26)])\nv_sum = 0\nfor d in range(D):\n v_sum += v[d]\n print(v_sum)\n","fast_code":"from bisect import bisect_left\n\n\nclass score:\n def __init__(self, t) -> None:\n self.t = t\n score = 0\n last = [[] for i in range(26)]\n for i, ti in enumerate(t):\n score += s[i][ti - 1]\n last[ti - 1].append(i + 1)\n for tj in range(26):\n if last[tj - 1] == []:\n score -= c[tj - 1] * (i + 1)\n else:\n\n score -= c[tj - 1] * ((i + 1) - last[tj - 1][-1])\n print(score)\n self.score = score\n\n def a__init__(self, t) -> None:\n score = 0\n last = [[] for i in range(26)]\n for i, ti in enumerate(t):\n\n score += s[i][ti - 1]\n\n if last[ti - 1] == []:\n score -= c[i] * i + 1\n else:\n score -= c[i] * ((i + 1) - last[ti - 1][-1])\n last[ti - 1].append(i + 1)\n print(score)\n for i in range(26):\n if last[i] == []:\n score -= c[i] * D\n else:\n score -= c[i] * (D - last[i][-1])\n self.score = score\n self.t = t\n\n\nD = int(eval(input()))\nc = list(map(int, input().split()))\ns = [list(map(int, input().split())) for i in range(D)]\nt = [int(eval(input())) for i in range(D)]\nsc = score(t)\n"} +{"fast_code_id":"f80a775564d8c14db2f492ca9ea44fada5f064db51f843660584046717570507","fast_id":"p03609_f80a775564d8c14db2f492ca9ea44fada5f064db51f843660584046717570507","language":"python","measured_fast_code_id":"f80a775564d8c14db2f492ca9ea44fada5f064db51f843660584046717570507","measured_slow_code_id":"a299dbf158d9b4197e8d6e9bc8a56f5dae0f1a29a154060b4dbf82a91b0fb59c","measurement_metric":"cpu_instruction_count","pair_id":"python_bac57851b4e5106caf129783","problem_id":"p03609","slow_code_id":"a299dbf158d9b4197e8d6e9bc8a56f5dae0f1a29a154060b4dbf82a91b0fb59c","slow_id":"p03609_a299dbf158d9b4197e8d6e9bc8a56f5dae0f1a29a154060b4dbf82a91b0fb59c","speedup":1631.2714596080023,"stratum":"8+","sampling_key":"0113835fd84628fac8f84f76a991921a3d4592d949ca2122870cf2011c04ac56","slow_code":"import numpy as np\n\nx, t = list(map(int, input().split()))\nprint((np.max(np.array([x - t, 0]))))\n","fast_code":"import sys\n\n\ndef MI():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\nX, t = MI()\nprint((max(0, X - t)))\n"} +{"fast_code_id":"2048af1f6a52a5012c5b48423ac818e2d4abe254733759e0fa2416f5e415c11b","fast_id":"p02700_2048af1f6a52a5012c5b48423ac818e2d4abe254733759e0fa2416f5e415c11b","language":"python","measured_fast_code_id":"2048af1f6a52a5012c5b48423ac818e2d4abe254733759e0fa2416f5e415c11b","measured_slow_code_id":"0800076b3be1d259d89fb0c2c371b4341f1c7fc8f7058a2f3f090ffddebf2dcb","measurement_metric":"cpu_instruction_count","pair_id":"python_bb6201eb2ab11a28a22ab191","problem_id":"p02700","slow_code_id":"7feb6456d377ecdd9b0dcbfc30f9b0e6286836e7cba34a2d795c5cf979e98297","slow_id":"p02700_0800076b3be1d259d89fb0c2c371b4341f1c7fc8f7058a2f3f090ffddebf2dcb","speedup":7.1630508524897225,"stratum":"4-8","sampling_key":"82ba92003401c3f33c899461bd72fa35feeb195d4d3ea68997b5553a24431207","slow_code":"from math import floor, ceil, sqrt, factorial, log\nfrom collections import Counter, deque\nfrom functools import reduce\n\n\ndef S():\n return eval(input())\n\n\ndef I():\n return int(eval(input()))\n\n\ndef MS():\n return list(map(str, input().split()))\n\n\ndef MI():\n return list(map(int, input().split()))\n\n\ndef FLI():\n return [int(i) for i in input().split()]\n\n\ndef LS():\n return list(MS())\n\n\ndef LI():\n return list(MI())\n\n\ndef LLS():\n return [list(map(str, l.split())) for l in eval(input())]\n\n\ndef LLI():\n return [list(map(int, l.split())) for l in eval(input())]\n\n\ndef LLSN(n: int):\n return [LS() for _ in range(n)]\n\n\ndef LLIN(n: int):\n return [LI() for _ in range(n)]\n\n\nA, B, C, D = MI()\nx = -(-A // D)\ny = -(-C // B)\nif x >= y:\n print(\"Yes\")\nelse:\n print(\"No\")\n","fast_code":"A, B, C, D = list(map(int, input().split()))\nprint((\"No\" if -A // D > -C // B else \"Yes\"))\n"} +{"fast_code_id":"32967c787160235f34f4a2c7e8ee43ff0c5c995c3b5aad14255a395058318458","fast_id":"p02392_32967c787160235f34f4a2c7e8ee43ff0c5c995c3b5aad14255a395058318458","language":"python","measured_fast_code_id":"32967c787160235f34f4a2c7e8ee43ff0c5c995c3b5aad14255a395058318458","measured_slow_code_id":"de04487b5a08627844d61298f885965ab158d25d2bda51807fc27addaf67096b","measurement_metric":"cpu_instruction_count","pair_id":"python_bc6a9364c0fb545c4f4d3c58","problem_id":"p02392","slow_code_id":"c3d3757a61b38da19ec84678b61451515bf53604660861738644c471aeb44260","slow_id":"p02392_de04487b5a08627844d61298f885965ab158d25d2bda51807fc27addaf67096b","speedup":13.12148487184654,"stratum":"8+","sampling_key":"00bce115894ab362de285566d843229debc4a9adea5d28e9c83e7a4b4cde78c8","slow_code":"import copy\n\nn = list(map(int, input().split()))\nif n[0] < n[1] < n[2]:\n print(\"Yes\")\nelse:\n print(\"No\")\n","fast_code":"a, b, c = list(map(int, input().split()))\nprint(\"Yes\" if a < b < c else \"No\")\n"} +{"fast_code_id":"616ce4a6320f09c63327b41eb9e11b621bc16378d67ab436444d8439d5150617","fast_id":"p02786_616ce4a6320f09c63327b41eb9e11b621bc16378d67ab436444d8439d5150617","language":"python","measured_fast_code_id":"616ce4a6320f09c63327b41eb9e11b621bc16378d67ab436444d8439d5150617","measured_slow_code_id":"09a65063dc765e4cefad5eee9e2b182a86482cf81649dc4a8e732b6ba516a72e","measurement_metric":"cpu_instruction_count","pair_id":"python_bcb934d16595174be60b000f","problem_id":"p02786","slow_code_id":"09a65063dc765e4cefad5eee9e2b182a86482cf81649dc4a8e732b6ba516a72e","slow_id":"p02786_09a65063dc765e4cefad5eee9e2b182a86482cf81649dc4a8e732b6ba516a72e","speedup":2441.2123015855277,"stratum":"8+","sampling_key":"75ac2a2fe0e9223c9c9bcfd2a62061808523e40ec8a1391a38ee3ba4a6e80f38","slow_code":"import numpy as np\n\nH = eval(input())\nH = int(H)\n\n\ndef count(H):\n count = 1\n while True:\n if int(H / 2) == 0:\n break\n else:\n H = int(H / 2)\n count += 1\n continue\n return count\n\n\nA = 0\nfor i in range(int(count(H))):\n A += 2**i\nprint(A)\n","fast_code":"print((2 ** len(bin(int(eval(input())))) // 4 - 1))\n"} +{"fast_code_id":"ed1c5350b8aa7e968256870a8eb7a385d39644d07887e8b02d7c885d46cd886e","fast_id":"p03025_69312b14dacd3fcb1bf39c5fc397d9669916a2bfe08b21a3dfc5a3bcfe7c90ee","language":"python","measured_fast_code_id":"69312b14dacd3fcb1bf39c5fc397d9669916a2bfe08b21a3dfc5a3bcfe7c90ee","measured_slow_code_id":"afdc02d7fb2abeb1970c2a5c2791e7792fd3f3e6fc1ceb09e19fccefdfb05385","measurement_metric":"cpu_instruction_count","pair_id":"python_bd15f36974b075c538e7171d","problem_id":"p03025","slow_code_id":"70ddd5f840b4cf045630f383c5a4dc0b67936d1255ea8e844b2833042d45ffc1","slow_id":"p03025_afdc02d7fb2abeb1970c2a5c2791e7792fd3f3e6fc1ceb09e19fccefdfb05385","speedup":5.449047530794823,"stratum":"4-8","sampling_key":"6866fb3a1c5b3e487423c0207e7725ddd1995c4f0c65e1e330226859743a2289","slow_code":"class Combination:\n\n def __init__(self, n, MOD):\n self.fact = [1]\n for i in range(1, n + 1):\n self.fact.append(self.fact[-1] * i % MOD)\n self.inv_fact = [pow(self.fact[i], MOD - 2, MOD) for i in range(n + 1)]\n self.MOD = MOD\n\n def factorial(self, k):\n return self.fact[k]\n\n def inverse_factorial(self, k):\n return self.inv_fact[k]\n\n def combination(self, k, r):\n return (self.fact[k] * self.inv_fact[k - r] * self.inv_fact[r]) % self.MOD\n\n\nfrom fractions import Fraction\n\nMOD = 10**9 + 7\nn, a, b, c = list(map(int, input().split()))\n\ncomb = Combination(2 * n, MOD)\nmod_li = [1]\nfor i in range(1, 2 * n + 1):\n mod_li.append(mod_li[-1] * (a + b) % MOD)\np1 = [1]\np2 = [1]\nfor i in range(1, n + 1):\n p1.append((p1[-1] * a) % MOD)\n p2.append((p2[-1] * b) % MOD)\nq = mod_li[2 * n - 1]\np = 0\nfor i in range(n):\n tmp_bunshi = (\n (n + i) * (mod_li[n - i - 1]) * p1[n] * p2[i] * comb.combination(n - 1 + i, i)\n )\n tmp_bunshi += (\n (n + i) * (mod_li[n - i - 1]) * p2[n] * p1[i] * comb.combination(n - 1 + i, i)\n )\n p += tmp_bunshi\n p %= MOD\np *= 100\nq *= a + b\nans = Fraction(p, q)\np = ans.numerator\nq = ans.denominator\nprint(((pow(q, MOD - 2, MOD) * p) % MOD))\n","fast_code":"from collections import defaultdict, deque\nfrom heapq import heappush, heappop\nimport sys\nimport math\nimport bisect\nimport random\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LS():\n return [list(x) for x in sys.stdin.readline().split()]\n\n\ndef S():\n res = list(sys.stdin.readline())\n if res[-1] == \"\\n\":\n return res[:-1]\n return res\n\n\ndef IR(n):\n return [I() for i in range(n)]\n\n\ndef LIR(n):\n return [LI() for i in range(n)]\n\n\ndef SR(n):\n return [S() for i in range(n)]\n\n\ndef LSR(n):\n return [LS() for i in range(n)]\n\n\nsys.setrecursionlimit(1000000)\nmod = 1000000007\n\n\ndef solve():\n n, a, b, c = LI()\n inv_100 = pow(100, mod - 2, mod)\n a = a * inv_100 % mod\n b = b * inv_100 % mod\n c = (1 - c * inv_100) % mod\n c = pow(c, mod - 2, mod)\n fact = [1]\n N = 2 * n\n for i in range(1, N + 1):\n fact.append(fact[-1] * i % mod)\n inv = [None] * (N + 1)\n inv[N] = pow(fact[N], mod - 2, mod)\n for i in range(N)[::-1]:\n inv[i] = inv[i + 1] * (i + 1) % mod\n ans = 0\n fa, fb, fc = pow(b, n, mod), pow(a, n, mod), pow(c, n + 1, mod)\n for i in range(n):\n ans += inv[i] * fact[n + i] * fc * (fb + fa) % mod\n ans %= mod\n fa *= a\n fb *= b\n fc *= c\n if fa >= mod:\n fa %= mod\n if fb >= mod:\n fb %= mod\n if fc >= mod:\n fc %= mod\n print((ans * inv[n - 1] % mod))\n return\n\n\nif __name__ == \"__main__\":\n solve()\n"} +{"fast_code_id":"682d751091cf89e1ad70930160ea7a742b6e10b056be71cc733386cc4788dd10","fast_id":"p03476_682d751091cf89e1ad70930160ea7a742b6e10b056be71cc733386cc4788dd10","language":"python","measured_fast_code_id":"682d751091cf89e1ad70930160ea7a742b6e10b056be71cc733386cc4788dd10","measured_slow_code_id":"04049db677f468c331c809085fe1f71be865b70eea78240753e06ca4db53b055","measurement_metric":"cpu_instruction_count","pair_id":"python_bd181fc91835183ff0ee947d","problem_id":"p03476","slow_code_id":"b2179070bb2e08d4fd95b95ff67b71105cd4dc2d4e6e31ecedf0506d95c233c1","slow_id":"p03476_04049db677f468c331c809085fe1f71be865b70eea78240753e06ca4db53b055","speedup":3.785066305111297,"stratum":"2-4","sampling_key":"19383533f43a6b66e2f72974bac4a1e6582cdc150c52ac7a215ae2e9714805c5","slow_code":"import numpy as np\n\nq = int(eval(input()))\n\nis_prime = np.ones(100001, dtype=int)\nis_prime[0] = 0\nis_prime[1] = 0\nfor i in range(2, 100001):\n if is_prime[i] == 1:\n j = i + i\n while j <= 100000:\n is_prime[j] = 0\n j += i\nlike2017 = [\n 1 if is_prime[i] and is_prime[(i + 1) // 2] else 0 for i in range(0, 100001)\n]\nfor i in range(1, 100001):\n like2017[i] += like2017[i - 1]\nfor i in range(q):\n l, r = list(map(int, input().split()))\n print((like2017[r] - like2017[l - 1]))\n","fast_code":"from bisect import bisect_left, bisect_right\n\n\ndef primes(n):\n is_prime = [True] * (n + 1)\n is_prime[0] = False\n is_prime[1] = False\n for i in range(2, int(n**0.5) + 1):\n if not is_prime[i]:\n continue\n for j in range(i * 2, n + 1, i):\n is_prime[j] = False\n return [i for i in range(3, n + 1) if is_prime[i]]\n\n\nprime = primes(10**5)\np_set = set(prime)\nlike = [3]\nfor i in prime:\n if (i + 1) // 2 in p_set:\n like.append(i)\nQ = int(eval(input()))\nfor _ in range(Q):\n l, r = list(map(int, input().split()))\n print((bisect_right(like, r) - bisect_left(like, l)))\n"} +{"fast_code_id":"37c64c843161b92469540d6a1ec2a29d2c5b7047a3f26ff46e602802a6763f12","fast_id":"p02760_37c64c843161b92469540d6a1ec2a29d2c5b7047a3f26ff46e602802a6763f12","language":"python","measured_fast_code_id":"37c64c843161b92469540d6a1ec2a29d2c5b7047a3f26ff46e602802a6763f12","measured_slow_code_id":"f8328767ccbc8a5ed48661d40d8215cfd7d33d82a275546fffbe0b0e89dbaad6","measurement_metric":"cpu_instruction_count","pair_id":"python_bd9cafe53171c1f1d84967a2","problem_id":"p02760","slow_code_id":"f8328767ccbc8a5ed48661d40d8215cfd7d33d82a275546fffbe0b0e89dbaad6","slow_id":"p02760_f8328767ccbc8a5ed48661d40d8215cfd7d33d82a275546fffbe0b0e89dbaad6","speedup":2.1460380619125163,"stratum":"2-4","sampling_key":"28d90069d9fef9f5d59ca9a13c67d641f3c33a42966f1ed781540f0cf9a18654","slow_code":"A = [list(map(int, input().split())) for _ in range(3)]\nN = int(eval(input()))\nB = [[0 for _ in range(3)] for _ in range(3)]\nfor _ in range(N):\n b = int(eval(input()))\n for i in range(3):\n for j in range(3):\n if A[i][j] == b:\n B[i][j] = 1\nflag = 0\nfor i in range(3):\n if sum(B[i]) == 3:\n flag = 1\n break\nfor j in range(3):\n cnt = 0\n for i in range(3):\n cnt += B[i][j]\n if cnt == 3:\n flag = 1\n break\nif B[0][0] + B[1][1] + B[2][2] == 3:\n flag = 1\nif B[2][0] + B[1][1] + B[0][2] == 3:\n flag = 1\nif flag == 1:\n print(\"Yes\")\nelse:\n print(\"No\")\n","fast_code":"(*a,) = list(map(int, open(0).read().split()))\nprint(\n (\n \"NYoe s\"[\n any(\n t <= set(a.index(b) for b in a[10:])\n for t in (\n {0, 1, 2},\n {0, 3, 6},\n {0, 4, 8},\n {1, 4, 7},\n {2, 4, 6},\n {2, 5, 8},\n {3, 4, 5},\n {6, 7, 8},\n )\n ) :: 2\n ]\n )\n)\n"} +{"fast_code_id":"0a4b743931f51015a53a8b68212086bf81fdde0f3ffc6ca14185f8e4075397cc","fast_id":"p02362_0a4b743931f51015a53a8b68212086bf81fdde0f3ffc6ca14185f8e4075397cc","language":"python","measured_fast_code_id":"0a4b743931f51015a53a8b68212086bf81fdde0f3ffc6ca14185f8e4075397cc","measured_slow_code_id":"ab12a803b6785f5f4ed17833763fd1aa5fdea2598bb998ef4d318a063084c6bb","measurement_metric":"cpu_instruction_count","pair_id":"python_bec112d041557e78cbd88540","problem_id":"p02362","slow_code_id":"ab12a803b6785f5f4ed17833763fd1aa5fdea2598bb998ef4d318a063084c6bb","slow_id":"p02362_ab12a803b6785f5f4ed17833763fd1aa5fdea2598bb998ef4d318a063084c6bb","speedup":4.791159183768857,"stratum":"4-8","sampling_key":"c94c479bc62d80f719e10e90769a44e056889493652682f7c9a7349827433778","slow_code":"from sys import stdin\nfrom collections import deque\n\nV, E, R = [int(x) for x in stdin.readline().split()]\nd = {}\ntick = False\nINF = float(\"inf\")\nfor i in range(V):\n d[i] = INF\nd[R] = 0\nweight = {}\nst = []\nfor i in range(1, V + 1):\n for j in range(E):\n if i == 1:\n s, t, w = [int(x) for x in stdin.readline().split()]\n weight[(s, t)] = w\n st.append((s, t))\n (s, t) = st[j]\n if d[t] > d[s] + weight[(s, t)]:\n d[t] = d[s] + weight[(s, t)]\n if i == V:\n print(\"NEGATIVE CYCLE\")\n quit()\nfor k in range(V):\n if d[k] == float(\"inf\"):\n print(\"INF\")\n else:\n print((d[k]))\n","fast_code":"import sys\n\nreadline = sys.stdin.readline\nV, E, r = list(map(int, readline().split()))\ninf = 10**10\nedges = [[] for _ in [None] * V]\nfor _ in [None] * E:\n s, t, d = list(map(int, readline().split()))\n edges[s].append((t, d))\n\n\ndef bellman_ford(n, edges, start):\n vertices = [inf] * n\n vertices[start] = 0\n reached = {start}\n for i in range(n):\n flag = 0\n for v in reached.copy():\n cost = vertices[v]\n for dist, _cost in edges[v]:\n newcost = cost + _cost\n if vertices[dist] > newcost:\n vertices[dist] = newcost\n reached.add(dist)\n flag = 1\n if flag == 0:\n return vertices\n else:\n return None\n\n\nresult = bellman_ford(V, edges, r)\nif result:\n print((\"\\n\".join([str(n) if n != inf else \"INF\" for n in result])))\nelse:\n print(\"NEGATIVE CYCLE\")\n"} +{"fast_code_id":"295f971acabadbb0f7e50b659189554ecb6f423e7975952b2bf01daeaeb6c28a","fast_id":"p03288_295f971acabadbb0f7e50b659189554ecb6f423e7975952b2bf01daeaeb6c28a","language":"python","measured_fast_code_id":"295f971acabadbb0f7e50b659189554ecb6f423e7975952b2bf01daeaeb6c28a","measured_slow_code_id":"4b19a6c66c6b24c9d371f629b6a683da99f61809c1d26fcff1386ca6548060d5","measurement_metric":"cpu_instruction_count","pair_id":"python_bf0f8287dd4609ffc927102d","problem_id":"p03288","slow_code_id":"4b19a6c66c6b24c9d371f629b6a683da99f61809c1d26fcff1386ca6548060d5","slow_id":"p03288_4b19a6c66c6b24c9d371f629b6a683da99f61809c1d26fcff1386ca6548060d5","speedup":26.35583135977933,"stratum":"8+","sampling_key":"48bd436ba9831a5ef8df562f5136fc6c719f767a5239ea64caba0bd3e604e3fd","slow_code":"import bisect, collections, copy, heapq, itertools, math, string\nimport sys\n\n\ndef S():\n return sys.stdin.readline().rstrip()\n\n\ndef M():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef LS():\n return list(sys.stdin.readline().rstrip().split())\n\n\nR = I()\nif R < 1200:\n print(\"ABC\")\nelif R < 2800:\n print(\"ARC\")\nelse:\n print(\"AGC\")\n","fast_code":"r = int(eval(input()))\nans = \"ARC\"\nif r < 1200:\n ans = \"ABC\"\nelif 2800 <= r:\n ans = \"AGC\"\nprint(ans)\n"} +{"fast_code_id":"a49e8701c648359100d415e821b1668f4d7ae2ccaf0a530fd721c1bee96df392","fast_id":"p03317_a49e8701c648359100d415e821b1668f4d7ae2ccaf0a530fd721c1bee96df392","language":"python","measured_fast_code_id":"a49e8701c648359100d415e821b1668f4d7ae2ccaf0a530fd721c1bee96df392","measured_slow_code_id":"40f790b9daefbd644d38ba942e539d6681ed03212cd68a297874ac055d84131a","measurement_metric":"cpu_instruction_count","pair_id":"python_c0160520b718526de320ed92","problem_id":"p03317","slow_code_id":"40f790b9daefbd644d38ba942e539d6681ed03212cd68a297874ac055d84131a","slow_id":"p03317_40f790b9daefbd644d38ba942e539d6681ed03212cd68a297874ac055d84131a","speedup":4.490634573681406,"stratum":"4-8","sampling_key":"0f848bf67e3408f6001a6b8437f3c41c815403b61b4c29b7d2c95583a8855d80","slow_code":"import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time\n\nsys.setrecursionlimit(10**7)\ninf = 10**20\nmod = 10**9 + 7\n\n\ndef LI():\n return list(map(int, input().split()))\n\n\ndef I():\n return int(eval(input()))\n\n\ndef LS():\n return input().split()\n\n\ndef S():\n return eval(input())\n\n\ndef main():\n a, b = LI()\n l = LI()\n c = 1\n _b = b\n while True:\n if a <= _b:\n break\n else:\n _b += b - 1\n c += 1\n return c\n\n\nprint((main()))\n","fast_code":"from collections import Counter\nfrom math import *\n\nN, K = [int(x) for x in input().strip().split()]\nA = [int(x) for x in input().strip().split()]\nA.sort()\nc = Counter(A)\nminc = c[A[0]]\nres = len(A) - minc\nprint((ceil(res / (K - 1))))\n"} +{"fast_code_id":"acb87974d1bc47590d1495561ec9a9d0631f2af73cba7b28fcff53d897967ec3","fast_id":"p03563_acb87974d1bc47590d1495561ec9a9d0631f2af73cba7b28fcff53d897967ec3","language":"python","measured_fast_code_id":"acb87974d1bc47590d1495561ec9a9d0631f2af73cba7b28fcff53d897967ec3","measured_slow_code_id":"59c6641cd1def8a06b45e4c0f0ace3ffa49de62fc97f73e0499cc3875cec5d01","measurement_metric":"cpu_instruction_count","pair_id":"python_c033647d08dd85c51204238a","problem_id":"p03563","slow_code_id":"59c6641cd1def8a06b45e4c0f0ace3ffa49de62fc97f73e0499cc3875cec5d01","slow_id":"p03563_59c6641cd1def8a06b45e4c0f0ace3ffa49de62fc97f73e0499cc3875cec5d01","speedup":1550.635599019409,"stratum":"8+","sampling_key":"19851070a2c69ac215b45b3f7323ad26ad1fc82d4abc4fb61cd0ace2e55a19cd","slow_code":"import numpy as np\n\nlst = []\nR = int(eval(input()))\nG = int(eval(input()))\nans = G - R + G\nprint(ans)\n","fast_code":"lst = []\nR = int(eval(input()))\nG = int(eval(input()))\nans = G - R + G\nprint(ans)\n"} +{"fast_code_id":"78195a2740d448817b390133128ddb97072787be3c728274df837dfcfab111dc","fast_id":"p02948_78195a2740d448817b390133128ddb97072787be3c728274df837dfcfab111dc","language":"python","measured_fast_code_id":"78195a2740d448817b390133128ddb97072787be3c728274df837dfcfab111dc","measured_slow_code_id":"e5cb2e4881c9b2875f40f46e76e41fea32db4b3dd9f35a928c399990727e7e86","measurement_metric":"cpu_instruction_count","pair_id":"python_c0352204df2029511e44d443","problem_id":"p02948","slow_code_id":"e5cb2e4881c9b2875f40f46e76e41fea32db4b3dd9f35a928c399990727e7e86","slow_id":"p02948_e5cb2e4881c9b2875f40f46e76e41fea32db4b3dd9f35a928c399990727e7e86","speedup":2.5982208069474573,"stratum":"2-4","sampling_key":"13670758aee629c5572eded9fa837fde6bbff020a9c2bc7beebd1ab8b8d97228","slow_code":"n, m = list(map(int, input().split()))\nab = [[] for _ in range(10**5)]\nfor i in range(n):\n a, b = list(map(int, input().split()))\n a -= 1\n ab[a].append(b)\nimport heapq\n\nq = []\nheapq.heapify(q)\nans = 0\nfor i in range(m):\n if len(ab[i]) != 0:\n for j in range(len(ab[i])):\n heapq.heappush(q, -1 * ab[i][j])\n if len(q) != 0:\n ans += -1 * heapq.heappop(q)\nprint(ans)\n","fast_code":"from heapq import *\n\nN, M, *t = list(map(int, open(0).read().split()))\nv = [[] for _ in \"_\" * M]\nz = i = 0\nfor _ in \"_\" * N:\n M < t[i] or v[t[i] - 1].append(t[i + 1])\n i += 2\nq = []\nfor i in v:\n for j in i:\n heappush(q, -j)\n z -= len(q) and heappop(q)\nprint(z)\n"} +{"fast_code_id":"6e39388440dba2f5867cb009ffac67ea1392bf250a55cda25cb1181359a5e9c0","fast_id":"p02660_32711959d0214afb0d72c7b9bca891ee04b3ef8d7762d54ffc7b47ef14dc2129","language":"python","measured_fast_code_id":"32711959d0214afb0d72c7b9bca891ee04b3ef8d7762d54ffc7b47ef14dc2129","measured_slow_code_id":"8301217799053ca8035ba7e5e9be7529b06a7e4ccf5a0cb39174661c0dc1c031","measurement_metric":"cpu_instruction_count","pair_id":"python_c06042667cb82e2456d12572","problem_id":"p02660","slow_code_id":"8301217799053ca8035ba7e5e9be7529b06a7e4ccf5a0cb39174661c0dc1c031","slow_id":"p02660_8301217799053ca8035ba7e5e9be7529b06a7e4ccf5a0cb39174661c0dc1c031","speedup":165.86577888630987,"stratum":"8+","sampling_key":"67ab8be51db5538dc201e945698cc4a470304ddafaa7804491b2edb4087dfe79","slow_code":"n = int(eval(input()))\na = p = 1\nwhile p < 6**8:\n c = t = 0\n p += 1\n while n % p < 1:\n n //= p\n x = c == t\n t += x\n c += 1 - t * x\n a += x\nprint((a - (n < 2)))\n","fast_code":"def factorization(n):\n arr = []\n temp = n\n for i in range(2, int(-(-(n**0.5) // 1)) + 1):\n if temp % i == 0:\n cnt = 0\n while temp % i == 0:\n cnt += 1\n temp //= i\n arr.append([i, cnt])\n if temp != 1:\n arr.append([temp, 1])\n if arr == []:\n arr.append([n, 1])\n return arr\n\n\ndef readinput():\n n = int(eval(input()))\n return n\n\n\ndef possibleCnt(n):\n cnt = 0\n resu = n\n for i in range(1, n + 1):\n if resu >= i:\n cnt += 1\n resu -= i\n\n return cnt\n\n\ndef main(n):\n ansList = factorization(n)\n\n count = 0\n for l in ansList:\n if l[0] != 1:\n count += possibleCnt(l[1])\n return count\n\n\nif __name__ == \"__main__\":\n n = readinput()\n ans = main(n)\n print(ans)\n"} +{"fast_code_id":"2650daa6a1c274256ef4850a384a56440f26d66dd6c199e73c69932a1b7a96f5","fast_id":"p02935_2650daa6a1c274256ef4850a384a56440f26d66dd6c199e73c69932a1b7a96f5","language":"python","measured_fast_code_id":"2650daa6a1c274256ef4850a384a56440f26d66dd6c199e73c69932a1b7a96f5","measured_slow_code_id":"4fce74aca7d1608f14c76b9fb92532f43bd52c914832f66cdc3ddf21b1636b9b","measurement_metric":"cpu_instruction_count","pair_id":"python_c096ecc92201d3b5a011e601","problem_id":"p02935","slow_code_id":"4fce74aca7d1608f14c76b9fb92532f43bd52c914832f66cdc3ddf21b1636b9b","slow_id":"p02935_4fce74aca7d1608f14c76b9fb92532f43bd52c914832f66cdc3ddf21b1636b9b","speedup":674.9454272057907,"stratum":"8+","sampling_key":"3c04f09f215165c10afc26c875cb11e9d842217697bcb8589eb3eb8fec052312","slow_code":"import numpy as np\n\nn = int(eval(input()))\nlista = list(map(int, input().split()))\nlista.sort()\nfor i in range(n - 1):\n lista.append((lista[0] + lista[1]) / 2)\n lista.pop(0)\n lista.pop(0)\n lista.sort()\nprint((lista[0]))\n","fast_code":"def main():\n import sys\n from collections import deque\n\n n = int(eval(input()))\n v = list(map(int, sys.stdin.read().split()))\n w = deque(sorted(v))\n ans = (w.popleft() + w.popleft()) / 2\n for i in range(n - 2):\n ans = ans / 2\n ans += w.popleft() / 2\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"9c4d6caf21ec555f0773eff226c3ebb7ab3751f45eba8fa1f1d369e50678b948","fast_id":"p02612_9c4d6caf21ec555f0773eff226c3ebb7ab3751f45eba8fa1f1d369e50678b948","language":"python","measured_fast_code_id":"9c4d6caf21ec555f0773eff226c3ebb7ab3751f45eba8fa1f1d369e50678b948","measured_slow_code_id":"8dde1aff283391e2d57ad3865fb24f31a09d7a6c5fe418b99f6dc494d6a6f32b","measurement_metric":"cpu_instruction_count","pair_id":"python_c0b2d68b0dc3c96f86db7c17","problem_id":"p02612","slow_code_id":"8dde1aff283391e2d57ad3865fb24f31a09d7a6c5fe418b99f6dc494d6a6f32b","slow_id":"p02612_8dde1aff283391e2d57ad3865fb24f31a09d7a6c5fe418b99f6dc494d6a6f32b","speedup":2.370798065515548,"stratum":"2-4","sampling_key":"219b6dac48b25c00090355db665ca72a15fe92d43c5869c5b663c1f67f106552","slow_code":"N = int(eval(input()))\nif N >= 1000:\n M = str(N)\n X = M[1:]\n O = int(X)\n if O == 0:\n print((0))\n else:\n print((1000 - O))\nelse:\n O = int(N)\n print((1000 - O))\n","fast_code":"N = int(eval(input()))\nprint(((10000 - N) % 1000))\n"} +{"fast_code_id":"fd71892198c251d576382e7375b4ee9fb59f0ac7a9c844bc1fe0e5aca023be63","fast_id":"p03030_fd71892198c251d576382e7375b4ee9fb59f0ac7a9c844bc1fe0e5aca023be63","language":"python","measured_fast_code_id":"fd71892198c251d576382e7375b4ee9fb59f0ac7a9c844bc1fe0e5aca023be63","measured_slow_code_id":"99641740840f9779b461fa1fb26d6b0b74d487b77fa798155bb3a136f008e321","measurement_metric":"cpu_instruction_count","pair_id":"python_c1876e7a7a51991cfbf83bc4","problem_id":"p03030","slow_code_id":"99641740840f9779b461fa1fb26d6b0b74d487b77fa798155bb3a136f008e321","slow_id":"p03030_99641740840f9779b461fa1fb26d6b0b74d487b77fa798155bb3a136f008e321","speedup":5.597148871973423,"stratum":"4-8","sampling_key":"5724d845de6a16d53e3070c07b9cb098f190d1a976618f3ba3342996ed87a272","slow_code":"from operator import itemgetter\n\nn = int(eval(input()))\ny, s = list(), list()\nfor i in range(1, n + 1):\n S = input().split()\n S[1] = int(S[1])\n S.append(i)\n s.append(S)\ny = sorted(s, key=itemgetter(0))\nfor i in range(n):\n for j in range(1, n):\n if (y[j - 1][0] == y[j][0]) & (y[j - 1][1] < y[j][1]):\n y[j - 1], y[j] = y[j], y[j - 1]\nfor i in range(n):\n print((y[i][2]))\n","fast_code":"n = int(eval(input()))\nd = sorted(\n list(list(input().split()) + [i + 1] for i in range(n)),\n key=lambda x: (x[0], -int(x[1])),\n)\nfor v in d:\n print((v[2]))\n"} +{"fast_code_id":"7d152829fabdaf68d6940ede064ea95c3e04f687d89b63c8893ae52fbdbff32d","fast_id":"p03240_7d152829fabdaf68d6940ede064ea95c3e04f687d89b63c8893ae52fbdbff32d","language":"python","measured_fast_code_id":"7d152829fabdaf68d6940ede064ea95c3e04f687d89b63c8893ae52fbdbff32d","measured_slow_code_id":"4c40bf3895e45939a448db69db467581eaa74fa9efe48781d2fcd0f15aedb4db","measurement_metric":"cpu_instruction_count","pair_id":"python_c1ac782466cadf6082f81e3a","problem_id":"p03240","slow_code_id":"4c40bf3895e45939a448db69db467581eaa74fa9efe48781d2fcd0f15aedb4db","slow_id":"p03240_4c40bf3895e45939a448db69db467581eaa74fa9efe48781d2fcd0f15aedb4db","speedup":5.122474303774008,"stratum":"4-8","sampling_key":"0c1e4cee5527cf614c7840451e1a2065d1b7db5fba15cf1d39448064b3bcd471","slow_code":"n = int(eval(input()))\narr = []\nfor i in range(n):\n x, y, h = list(map(int, input().split()))\n arr.append([x, y, h])\nfor i in range(101):\n for j in range(101):\n for k in range(n):\n if arr[k][2] > 0:\n len1 = abs(arr[k][0] - i) + abs(arr[k][1] - j)\n ch = len1 + arr[k][2]\n break\n else:\n continue\n for k in range(n):\n lenk = abs(arr[k][0] - i) + abs(arr[k][1] - j)\n if max(ch - lenk, 0) == arr[k][2]:\n if k == n - 1:\n print((\"{} {} {}\".format(i, j, ch)))\n else:\n continue\n else:\n break\n","fast_code":"n = int(input())\nXYH = []\nfor _ in range(n):\n x, y, h = map(int, input().split())\n if h != 0:\n XYH.append([x, y, h])\nflag = False\nans = XYH[0]\nfor i in range(101):\n for j in range(101):\n tempH = abs(XYH[0][0] - i) + abs(XYH[0][1] - j) + XYH[0][2]\n for x, y, h in XYH[1:]:\n if abs(x - i) + abs(y - j) + h != tempH:\n flag = False\n break\n else:\n flag = True\n if flag:\n ans = [i, j, tempH]\n break\n if flag:\n break\nprint(*ans, sep=\" \")\n"} +{"fast_code_id":"67f88dac57a93649a1993708955430e96781769eb0c10f55453209da1be8978e","fast_id":"p03563_67f88dac57a93649a1993708955430e96781769eb0c10f55453209da1be8978e","language":"python","measured_fast_code_id":"67f88dac57a93649a1993708955430e96781769eb0c10f55453209da1be8978e","measured_slow_code_id":"59c6641cd1def8a06b45e4c0f0ace3ffa49de62fc97f73e0499cc3875cec5d01","measurement_metric":"cpu_instruction_count","pair_id":"python_c1c4e2218988f3ab953b88be","problem_id":"p03563","slow_code_id":"59c6641cd1def8a06b45e4c0f0ace3ffa49de62fc97f73e0499cc3875cec5d01","slow_id":"p03563_59c6641cd1def8a06b45e4c0f0ace3ffa49de62fc97f73e0499cc3875cec5d01","speedup":3436.0167930832827,"stratum":"8+","sampling_key":"0e899998882eed31f5b1ae9f6413901f2d461bb83c2bd6a9fe1ee343d4c2509a","slow_code":"import numpy as np\n\nlst = []\nR = int(eval(input()))\nG = int(eval(input()))\nans = G - R + G\nprint(ans)\n","fast_code":"print(-int(input()) + (int(input()) << 1))\n"} +{"fast_code_id":"30b1727de6191944f11396782aa7c3484a2702c3cf9a380afbc33543d3c00c18","fast_id":"p02394_30b1727de6191944f11396782aa7c3484a2702c3cf9a380afbc33543d3c00c18","language":"python","measured_fast_code_id":"30b1727de6191944f11396782aa7c3484a2702c3cf9a380afbc33543d3c00c18","measured_slow_code_id":"ceb52516da2a20f5a81680adb3804de11c080bcf9d7959090981292e324bd192","measurement_metric":"cpu_instruction_count","pair_id":"python_c271bdf6875829280c2326b7","problem_id":"p02394","slow_code_id":"e4c0f03d295e5c61a184396615a9d70d363a9daccbdc76c7d869931546d3a965","slow_id":"p02394_ceb52516da2a20f5a81680adb3804de11c080bcf9d7959090981292e324bd192","speedup":2.2118003585402772,"stratum":"2-4","sampling_key":"ab8a3d1591470ed08058ebe38cc21853183ffa16bca3f9dfecbc563c4cb4d181","slow_code":"import math\n\n\ndef func():\n try:\n line = input().rstrip()\n numbers = line.split(\" \")\n width = float(numbers[0])\n height = float(numbers[1])\n x = float(numbers[2])\n y = float(numbers[3])\n r = abs(float(numbers[4]))\n except:\n print(\"input error\")\n return -1\n wsign = math.copysign(1, width)\n hsign = math.copysign(1, height)\n result = \"No\"\n if wsign * x + r <= wsign * width:\n if wsign * x - r >= 0:\n if hsign * y + r <= hsign * height:\n if hsign * y - r >= 0:\n result = \"Yes\"\n print(result)\n\n\nfunc()\n","fast_code":"W, H, x, y, r = list(map(int, input().split()))\nchk1 = r <= x <= W - r\nchk2 = r <= y <= H - r\nchk0 = \"Yes\" if (chk1 == True and chk2 == True) else \"No\"\nprint(chk0)\n"} +{"fast_code_id":"73f1d18be695c1a86ec1bb2887213dc88dab15703abc9e934b1a9c5df78397d9","fast_id":"p03371_73f1d18be695c1a86ec1bb2887213dc88dab15703abc9e934b1a9c5df78397d9","language":"python","measured_fast_code_id":"73f1d18be695c1a86ec1bb2887213dc88dab15703abc9e934b1a9c5df78397d9","measured_slow_code_id":"d423368c3404af0d794647ac92b41960ae5bb9ea8edef19ff71fb40275e2bb52","measurement_metric":"cpu_instruction_count","pair_id":"python_c28d62aa41e14b80a82c324e","problem_id":"p03371","slow_code_id":"d423368c3404af0d794647ac92b41960ae5bb9ea8edef19ff71fb40275e2bb52","slow_id":"p03371_d423368c3404af0d794647ac92b41960ae5bb9ea8edef19ff71fb40275e2bb52","speedup":14444.149149009183,"stratum":"8+","sampling_key":"45490c726a19398580ca68ad54a8f988f11535a60aa8cc73fdd0ce66cfe2ea46","slow_code":"a, b, c, x, y = list(map(int, input().split()))\nmi = 10**10\nfor i in range(10**6):\n cost = c * 2 * i + a * max((x - i), 0) + b * max((y - i), 0)\n if cost < mi:\n mi = cost\nprint(mi)\n","fast_code":"A, B, C, X, Y = list(map(int, input().split()))\nif A + B < 2 * C:\n ans = A * X + B * Y\nelse:\n XY = min(X, Y)\n ans = min(A * (X - XY) + B * (Y - XY) + 2 * C * XY, 2 * C * max(X, Y))\nprint(ans)\n"} +{"fast_code_id":"2ecf79b93b64ccdb9a4ac892c59a7362eb0dec68cca68be0de61616d39332c15","fast_id":"p03296_2ecf79b93b64ccdb9a4ac892c59a7362eb0dec68cca68be0de61616d39332c15","language":"python","measured_fast_code_id":"2ecf79b93b64ccdb9a4ac892c59a7362eb0dec68cca68be0de61616d39332c15","measured_slow_code_id":"a260e38fd68198bd3b846ed815f9f7842be8a43a1a00830ef94d4cac2df063d2","measurement_metric":"cpu_instruction_count","pair_id":"python_c2dccd0132b5bb7449e08639","problem_id":"p03296","slow_code_id":"98718a5692a33a090df0421f7d48f7b20be3a15dafddd3f88613c957f01f774b","slow_id":"p03296_a260e38fd68198bd3b846ed815f9f7842be8a43a1a00830ef94d4cac2df063d2","speedup":2.3958469740712593,"stratum":"2-4","sampling_key":"823d42253a695f407d7c2dba8c8fca7bc31654a383a6e3c61b4c4fa071975fbf","slow_code":"import sys\n\nINF = float(\"inf\")\nMOD = 10**9 + 7\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef LI_():\n return [int(x) - 1 for x in sys.stdin.readline().split()]\n\n\ndef LF():\n return [float(x) for x in sys.stdin.readline().split()]\n\n\ndef LS():\n return sys.stdin.readline().split()\n\n\ndef II():\n return int(sys.stdin.readline())\n\n\ndef SI():\n return eval(input())\n\n\ndef main():\n n = II()\n A = LI()\n res = 0\n for i in range(1, n):\n if A[i] == A[i - 1]:\n A[i] = 0\n res += 1\n return res\n\n\nprint((main()))\n","fast_code":"from itertools import groupby\n\nN, *A = list(map(int, open(0).read().split()))\nprint((sum(len(tuple(v)) // 2 for _, v in groupby(A))))\n"} +{"fast_code_id":"61deb701074746ec461188214fd713b369a26b70d077d872a3cf8d1d5677faf0","fast_id":"p03693_61deb701074746ec461188214fd713b369a26b70d077d872a3cf8d1d5677faf0","language":"python","measured_fast_code_id":"61deb701074746ec461188214fd713b369a26b70d077d872a3cf8d1d5677faf0","measured_slow_code_id":"a8d7956b0cbea162ca1db60ee520eccf4efc73cdccbed5370688af05e67aaca2","measurement_metric":"cpu_instruction_count","pair_id":"python_c31a4c23feb5dbe7e41b7e48","problem_id":"p03693","slow_code_id":"a8d7956b0cbea162ca1db60ee520eccf4efc73cdccbed5370688af05e67aaca2","slow_id":"p03693_a8d7956b0cbea162ca1db60ee520eccf4efc73cdccbed5370688af05e67aaca2","speedup":1784.3526609469416,"stratum":"8+","sampling_key":"28223ebb0fc13737e0ecd96dced0b3203e2e58ebd61f16ba8da4817f5cfbcae2","slow_code":"import numpy as np\n\nr, g, b = list(map(int, input().split()))\nif (100 * r + 10 * g + b) % 4 == 0:\n print(\"YES\")\nelse:\n print(\"NO\")\n","fast_code":"r, g, b = list(map(int, input().split()))\na = r * 100 + g * 10 + b\nprint((\"YES\" if a % 4 == 0 else \"NO\"))\n"} +{"fast_code_id":"8d636eca134cf8aabca8c761109550ad7a2aaddb74603d946dc42ab021814e9f","fast_id":"p02830_8d636eca134cf8aabca8c761109550ad7a2aaddb74603d946dc42ab021814e9f","language":"python","measured_fast_code_id":"8d636eca134cf8aabca8c761109550ad7a2aaddb74603d946dc42ab021814e9f","measured_slow_code_id":"992e686444192fb7564ecff1647d9aa6e75db539811d55b3349d5f91772e9ce3","measurement_metric":"cpu_instruction_count","pair_id":"python_c3344f5001d4bd8d9155d32a","problem_id":"p02830","slow_code_id":"992e686444192fb7564ecff1647d9aa6e75db539811d55b3349d5f91772e9ce3","slow_id":"p02830_992e686444192fb7564ecff1647d9aa6e75db539811d55b3349d5f91772e9ce3","speedup":12.797405212058518,"stratum":"8+","sampling_key":"177730f5a02d4aa8add050baf022f1782326a9c89276ec753f6d5695b5becdbf","slow_code":"from collections import Counter, defaultdict, deque\nfrom heapq import heappop, heappush\nfrom bisect import bisect_left, bisect_right\nimport sys, math, itertools, fractions\n\nsys.setrecursionlimit(10**8)\nmod = 10**9 + 7\nINF = float(\"inf\")\n\n\ndef inp():\n return int(sys.stdin.readline())\n\n\ndef inpl():\n return list(map(int, sys.stdin.readline().split()))\n\n\nn = inp()\ns, t = input().split()\nprint((\"\".join([s[i] + t[i] for i in range(n)])))\n","fast_code":"import sys\n\nN = int(input())\nS, T = input().split()\nif not (1 <= N <= 100):\n sys.exit()\nif not (len(S) == len(T) and len(S) == N):\n sys.exit()\nif not (S.islower() and T.islower()):\n sys.exit()\nfor I in range(N):\n print(S[I], end=\"\")\n print(T[I], end=\"\")\n"} +{"fast_code_id":"b6ef0b4604691e506db0263a534aed0aee728f0b806494e1127922e5714da424","fast_id":"p02883_51bcece72f749af885eefd7d6bbc0126e5766afde8b11e999dc261b6cf0e6b89","language":"python","measured_fast_code_id":"51bcece72f749af885eefd7d6bbc0126e5766afde8b11e999dc261b6cf0e6b89","measured_slow_code_id":"4f4a13e5333f347bf2d2991652e312f399d355fb41776c7913ab6a96ff5161f3","measurement_metric":"cpu_instruction_count","pair_id":"python_c3c27166223223a6b6071a06","problem_id":"p02883","slow_code_id":"3224e00a1ef11e1951254ca5848501fa156f61f500db82b6b9576730d7e3e2af","slow_id":"p02883_4f4a13e5333f347bf2d2991652e312f399d355fb41776c7913ab6a96ff5161f3","speedup":3.8759325784899907,"stratum":"2-4","sampling_key":"d36942791d2ab721738782123b6dba63c0d6aef3abea8d7a2bbac4646f6b6ca2","slow_code":"import sys\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef list2d(a, b, c):\n return [[c] * b for i in range(a)]\n\n\ndef list3d(a, b, c, d):\n return [[[d] * c for j in range(b)] for i in range(a)]\n\n\ndef list4d(a, b, c, d, e):\n return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]\n\n\ndef ceil(x, y=1):\n return int(-(-x // y))\n\n\ndef INT():\n return int(eval(input()))\n\n\ndef MAP():\n return list(map(int, input().split()))\n\n\ndef LIST(N=None):\n return list(MAP()) if N is None else [INT() for i in range(N)]\n\n\ndef Yes():\n print(\"Yes\")\n\n\ndef No():\n print(\"No\")\n\n\ndef YES():\n print(\"YES\")\n\n\ndef NO():\n print(\"NO\")\n\n\nsys.setrecursionlimit(10**7)\nINF = 10**18\nMOD = 10**9 + 7\n\n\ndef bisearch_min(mn, mx, func):\n ok = mx\n ng = mn\n while ng + 1 < ok:\n mid = (ok + ng) // 2\n if func(mid):\n\n ok = mid\n else:\n\n ng = mid\n return ok\n\n\nN, K = MAP()\nA = LIST()\nB = LIST()\nA.sort(reverse=True)\nB.sort()\n\n\ndef check(m):\n k = 0\n for i, a in enumerate(A):\n b = B[i]\n k += max(ceil(a - m / b), 0)\n if k > K:\n return False\n return True\n\n\nprint((bisearch_min(-1, 10**12, check)))\n","fast_code":"import sys\n\ninput = sys.stdin.readline\n\n\ndef I():\n return int(eval(input()))\n\n\ndef MI():\n return list(map(int, input().split()))\n\n\ndef LI():\n return list(map(int, input().split()))\n\n\ndef main():\n mod = 10**9 + 7\n N, K = MI()\n A = LI()\n F = LI()\n F.sort()\n A.sort(reverse=True)\n if K >= sum(A):\n print((0))\n exit()\n\n def ch(x):\n\n temp = 0\n for i in range(N):\n af = A[i] * F[i]\n if af > x:\n add = (af - x + F[i] - 1) // F[i]\n temp += add\n return temp <= K\n\n ok = 10**12\n ng = 0\n while ok - ng > 1:\n med = (ok + ng) // 2\n if ch(med):\n ok = med\n else:\n ng = med\n print(ok)\n\n\nmain()\n"} +{"fast_code_id":"88d3c7337d939da75e737e5df2426c4cedd0531d0d15f412b2dc43808b00f3e6","fast_id":"p03037_88d3c7337d939da75e737e5df2426c4cedd0531d0d15f412b2dc43808b00f3e6","language":"python","measured_fast_code_id":"88d3c7337d939da75e737e5df2426c4cedd0531d0d15f412b2dc43808b00f3e6","measured_slow_code_id":"603682b2a1acebd824f0081d6dbfdc82575d41c2aa8f541e6ca8387c5cde8833","measurement_metric":"cpu_instruction_count","pair_id":"python_c3cd4a11c415876077682bd7","problem_id":"p03037","slow_code_id":"603682b2a1acebd824f0081d6dbfdc82575d41c2aa8f541e6ca8387c5cde8833","slow_id":"p03037_603682b2a1acebd824f0081d6dbfdc82575d41c2aa8f541e6ca8387c5cde8833","speedup":4.578207497651763,"stratum":"4-8","sampling_key":"74a1b9b243f9fdb6882791e574ae31a62e72a0786e30de9feae7f3bc24b26669","slow_code":"import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, queue, copy\n\nsys.setrecursionlimit(10**7)\ninf = 10**20\nmod = 10**9 + 7\ndd = [(-1, 0), (0, 1), (1, 0), (0, -1)]\nddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef LI_():\n return [int(x) - 1 for x in sys.stdin.readline().split()]\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LS():\n return sys.stdin.readline().split()\n\n\ndef S():\n return eval(input())\n\n\ndef main():\n n, k = LI()\n l = [0] * (n + 1)\n for _ in range(k):\n a, b = LI()\n l[a - 1] += 1\n l[b] -= 1\n for i in range(n - 1):\n l[i + 1] += l[i]\n ans = 0\n for x in l[:-1]:\n if x == k:\n ans += 1\n return ans\n\n\nprint((main()))\n","fast_code":"N, M = list(map(int, input().split()))\nnmin = 1\nnmax = N\nfor _ in range(M):\n l, r = list(map(int, input().split()))\n nmin = max(nmin, l)\n nmax = min(nmax, r)\nif nmin > nmax:\n print((0))\nelse:\n print((nmax - nmin + 1))\n"} +{"fast_code_id":"f35d664c93547a8f0734929f2a70ef76e32633cb630c84ea37748b64d46b246f","fast_id":"p03962_f35d664c93547a8f0734929f2a70ef76e32633cb630c84ea37748b64d46b246f","language":"python","measured_fast_code_id":"f35d664c93547a8f0734929f2a70ef76e32633cb630c84ea37748b64d46b246f","measured_slow_code_id":"b860d418d28354f19717276f2ac59e15f9c34db088f6ec4e7e55e82613c6a0bd","measurement_metric":"cpu_instruction_count","pair_id":"python_c47ef491b963311038064221","problem_id":"p03962","slow_code_id":"b860d418d28354f19717276f2ac59e15f9c34db088f6ec4e7e55e82613c6a0bd","slow_id":"p03962_b860d418d28354f19717276f2ac59e15f9c34db088f6ec4e7e55e82613c6a0bd","speedup":2.3594320804088484,"stratum":"2-4","sampling_key":"02d36d1c58d2fcae54ff45080bdf2b64bb15851a100a3d90557ff49977af6e6e","slow_code":"a, b, c = list(map(int, input().split()))\nif a == b == c:\n print((1))\nelif a == c or a == b or b == c:\n print((2))\nelse:\n print((3))\n","fast_code":"val = input().split()\nprint((len(set(val))))\n"} +{"fast_code_id":"98c9ebce7d0247a468894e2b514f465b039ea2b136e49cee9f5e3043ece6defa","fast_id":"p02603_1fdb7193eac317647d47dc4eab2c4d9a8c12bd6189b7d71270158b3744fa6485","language":"python","measured_fast_code_id":"1fdb7193eac317647d47dc4eab2c4d9a8c12bd6189b7d71270158b3744fa6485","measured_slow_code_id":"e81b938c4631bbf0dd19338b5f55857446617b774343cf12f37ec43bdb261ec6","measurement_metric":"cpu_instruction_count","pair_id":"python_c531a65b119d71b61961754d","problem_id":"p02603","slow_code_id":"94a262047194dcc6bb6fec17dfdcbd01dafe83c8a18c4168db8be6ce0b16248b","slow_id":"p02603_e81b938c4631bbf0dd19338b5f55857446617b774343cf12f37ec43bdb261ec6","speedup":5.8800350177453575,"stratum":"4-8","sampling_key":"29eb4617a1b58146b36ea526d3929fd34298fe6a01c3b55d57b88f33d775eff3","slow_code":"import sys\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\nN = I()\nB = [0] + LI()\nA = [0]\nfor i in range(N):\n if B[i] != B[i + 1]:\n A.append(B[i + 1])\nN = len(A) - 1\nMAX = [0, 1000] + [0] * N\nfrom functools import lru_cache\n\n\n@lru_cache(maxsize=None)\ndef dfs(n, money):\n if n == N + 1:\n return money\n else:\n res = money\n for i in range(n, N):\n for j in range(i + 1, N + 1):\n if (\n A[i] == min(A[i : j + 1])\n and A[j] == max(A[i : j + 1])\n and A[i] < A[j]\n ):\n a = money + (A[j] - A[i]) * (money // A[i])\n if a > MAX[j + 1]:\n res = max(res, dfs(j + 1, a))\n MAX[j + 1] = a\n return res\n\n\nprint((dfs(1, 1000)))\n","fast_code":"import collections\n\nN = int(eval(input()))\nA = list(map(int, input().split()))\ni = 0\nA.insert(0, float(\"inf\"))\n\nbuy = [0] * N\nsell = [0] * N\nfor i in range(N - 1):\n if (A[i] >= A[i + 1]) and (A[i + 2] >= A[i + 1]):\n buy[i] = 1\n if (A[i] <= A[i + 1]) and (A[i + 2] <= A[i + 1]):\n sell[i] = 1\nkabu = 0\nmoney = 1000\n\n\nA = A[1:]\n\nfor i in range(N):\n if buy[i] == 1:\n kabu = kabu + money // A[i]\n money = money - (money // A[i]) * A[i]\n if sell[i] == 1:\n money = money + kabu * A[i]\n kabu = 0\n\n\nmoney = money + kabu * A[N - 1]\nprint(money)\n"} +{"fast_code_id":"9d4a921373045d999481b3ab6f7618e3d6468dbdec49bffee67126103a67e74b","fast_id":"p03325_9d4a921373045d999481b3ab6f7618e3d6468dbdec49bffee67126103a67e74b","language":"python","measured_fast_code_id":"9d4a921373045d999481b3ab6f7618e3d6468dbdec49bffee67126103a67e74b","measured_slow_code_id":"7381d1656a68aa595f774bd7e092223d46f86565be41ae288788923421ecebfd","measurement_metric":"cpu_instruction_count","pair_id":"python_c58c0db166bf26b05fd73d6e","problem_id":"p03325","slow_code_id":"72a687868c5159281354800d0a20b8c7f686243e183db5ca02466b9831c8b6a2","slow_id":"p03325_7381d1656a68aa595f774bd7e092223d46f86565be41ae288788923421ecebfd","speedup":2.203576092467379,"stratum":"2-4","sampling_key":"fd147d1d9be4264e98ad5dc3b33ddb2cbe19684a65f75d94875f44131dcf1c35","slow_code":"import sys\n\n\nimport math\n\n\ndef main():\n n, *a = (int(x) for x in sys.stdin.read().split())\n total_count = 0\n for i in range(n):\n current = a[i]\n count = 0\n for _ in range(math.floor(math.log(10**9, 2)) + 1):\n if current % 2 == 0:\n current //= 2\n count += 1\n else:\n break\n total_count += count\n print(total_count)\n\n\nif __name__ == \"__main__\":\n\n main()\n","fast_code":"N = int(eval(input()))\nk = 0\nfor a in map(int, input().split()):\n while a % 2 == 0:\n k += 1\n a //= 2\nprint(k)\n"} +{"fast_code_id":"a956c7a4cf9f25b4cc82406f7bcaf7852e580776013b21d53dd603807fb8f305","fast_id":"p02640_a956c7a4cf9f25b4cc82406f7bcaf7852e580776013b21d53dd603807fb8f305","language":"python","measured_fast_code_id":"a956c7a4cf9f25b4cc82406f7bcaf7852e580776013b21d53dd603807fb8f305","measured_slow_code_id":"001136f60415c5c4318edea1d984f576b84824fa86ba5571a3840f57e678ed18","measurement_metric":"cpu_instruction_count","pair_id":"python_c5d006e4276eaba24ffdb7e8","problem_id":"p02640","slow_code_id":"001136f60415c5c4318edea1d984f576b84824fa86ba5571a3840f57e678ed18","slow_id":"p02640_001136f60415c5c4318edea1d984f576b84824fa86ba5571a3840f57e678ed18","speedup":4.121681405765261,"stratum":"4-8","sampling_key":"5d62b8654f353b779968747b2cc730906757a449550728b8e56881cf1d3b9ff9","slow_code":"X, Y = (int(x) for x in input().split())\nFlag = False\nfor A in range(0, X + 1):\n for B in range(0, X + 1):\n if A + B == X and 2 * A + 4 * B == Y:\n Flag = True\n if Flag:\n break\nif Flag:\n print(\"Yes\")\nelse:\n print(\"No\")\n","fast_code":"x, y = list(map(int, input().split()))\nprint((\"NYoe s\"[(2 * x <= y <= 4 * x) > y % 2 :: 2]))\n"} +{"fast_code_id":"14d062ba1fdfedcb7da5501ac08db70378afe95bb6ccb7773b4c5b572d572918","fast_id":"p02642_14d062ba1fdfedcb7da5501ac08db70378afe95bb6ccb7773b4c5b572d572918","language":"python","measured_fast_code_id":"14d062ba1fdfedcb7da5501ac08db70378afe95bb6ccb7773b4c5b572d572918","measured_slow_code_id":"bb032738b2a92c573bb8551b5b7382bec1fcfece28073f8018a01331a18cfdcc","measurement_metric":"cpu_instruction_count","pair_id":"python_c5e6f8794597b2e924e14885","problem_id":"p02642","slow_code_id":"bb032738b2a92c573bb8551b5b7382bec1fcfece28073f8018a01331a18cfdcc","slow_id":"p02642_bb032738b2a92c573bb8551b5b7382bec1fcfece28073f8018a01331a18cfdcc","speedup":7.9960683166791044,"stratum":"4-8","sampling_key":"4741eb2a7ece6e8828042615f28faffc6f8002522cf8e9e9871fe58a0dd7b72c","slow_code":"N = int(eval(input()))\nA = list(map(int, input().split()))\nm = max(A)\nU = [0] * (m + 1)\nfor e in A:\n U[e] += 1\nans = 0\nfor k in range(1, m + 1):\n if U[k] == 1:\n ans += 1\n if U[k] > 0:\n for l in range(2 * k, m + 1, k):\n if U[l] > 0:\n U[l] += 1\nprint(ans)\n","fast_code":"n = int(eval(input()))\na = list(map(int, input().split()))\na.sort()\nmax_num = a[-1] + 1\ncnt = [0] * (max_num)\na.sort()\nans = 0\nfor i in a:\n cnt[i] += 1\na = set(a)\nfor k in a:\n for l in range(k * 2, (max_num), k):\n cnt[l] += 1\nfor m in a:\n if cnt[m] == 1:\n ans += 1\nprint(ans)\n"} +{"fast_code_id":"aee36ed359645013f33bf9f97ed4e523dfedf9af80fc7a780cda5ad00b8fe3a0","fast_id":"p03292_aee36ed359645013f33bf9f97ed4e523dfedf9af80fc7a780cda5ad00b8fe3a0","language":"python","measured_fast_code_id":"aee36ed359645013f33bf9f97ed4e523dfedf9af80fc7a780cda5ad00b8fe3a0","measured_slow_code_id":"f60b0a699a2d92dfcbb5b26a370092e660bc85afffa65c600089419b521caefb","measurement_metric":"cpu_instruction_count","pair_id":"python_c602e147a4bca735e2dfc4cd","problem_id":"p03292","slow_code_id":"f60b0a699a2d92dfcbb5b26a370092e660bc85afffa65c600089419b521caefb","slow_id":"p03292_f60b0a699a2d92dfcbb5b26a370092e660bc85afffa65c600089419b521caefb","speedup":3.179613395643815,"stratum":"2-4","sampling_key":"0039e64a3383e6aed5324c31ad0a8a51a28e70f18b01f31cbad1b78b71f65ecb","slow_code":"a, b, c = list(map(int, input().split()))\nans = 9999\nans = min(ans, abs(a - b) + abs(b - c), abs(a - c) + abs(c - b))\nans = min(ans, abs(b - a) + abs(a - c), abs(b - c) + abs(c - a))\nans = min(ans, abs(c - a) + abs(a - b), abs(c - b) + abs(b - a))\nprint(ans)\n","fast_code":"A = list(map(int, input().split()))\nprint((max(A) - min(A)))\n"} +{"fast_code_id":"9968516c881c7b61c416a8511da2e2fdc1f9fbeae8c0c49b6ee5501289031211","fast_id":"p03566_b246082c38abc76f5a4094891e018aef87b5c63e334a8d81bd193191efd770b5","language":"python","measured_fast_code_id":"b246082c38abc76f5a4094891e018aef87b5c63e334a8d81bd193191efd770b5","measured_slow_code_id":"7d703e55c917b05f43180563cd7215d2d767b997061edc9ee8bcb6b32d36cd2c","measurement_metric":"cpu_instruction_count","pair_id":"python_c64145b4f1f44a419804be7e","problem_id":"p03566","slow_code_id":"7d703e55c917b05f43180563cd7215d2d767b997061edc9ee8bcb6b32d36cd2c","slow_id":"p03566_7d703e55c917b05f43180563cd7215d2d767b997061edc9ee8bcb6b32d36cd2c","speedup":381.27430947492934,"stratum":"8+","sampling_key":"16fb4f04d591fb08d732b44354d18c3b885a7fb3eed7a284d6449cee68e5919f","slow_code":"n = int(eval(input()))\nT = list(map(int, input().split()))\nV = list(map(int, input().split()))\ns = [0] * n\nfor i in range(n - 1):\n s[i + 1] = s[i] + T[i]\nl = (s[-1] + T[n - 1]) * 2 + 1\nans = [1e100] * l\nfor i in range(l):\n ans[i] = min(ans[i], i / 2)\n ans[l - i - 1] = min(ans[i], i / 2)\nfor j in range(n):\n for i in range(l):\n if i <= s[j] * 2:\n ans[i] = min(ans[i], V[j] + (s[j] * 2 - i) / 2)\n elif s[j] * 2 <= i <= s[j] * 2 + T[j] * 2:\n ans[i] = min(ans[i], V[j])\n else:\n ans[i] = min(ans[i], V[j] + (i - s[j] * 2 - T[j] * 2) / 2)\nanser = 0\nfor i in range(l - 1):\n anser += (ans[i] + ans[i + 1]) / 4\nprint(anser)\n","fast_code":"n = int(eval(input()))\nt = [int(i) for i in input().split()]\nv = [int(i) for i in input().split()]\nmaxspeed = [0] * (n + 1)\nfor i in range(n - 1, 0, -1):\n maxspeed[i] = min(v[i], v[i - 1], t[i] + maxspeed[i + 1])\n\n\ndef dist(i, first):\n ta = v[i] - first\n tb = v[i] - maxspeed[i + 1]\n if ta + tb <= t[i]:\n c = (\n (first + v[i]) * ta / 2\n + v[i] * (t[i] - ta - tb)\n + (maxspeed[i + 1] + v[i]) * tb / 2\n )\n lastspeed = maxspeed[i + 1]\n elif maxspeed[i + 1] - first > t[i]:\n c = (first + first + t[i]) * t[i] / 2\n lastspeed = first + t[i]\n else:\n a = (maxspeed[i + 1] + t[i] - first) / 2\n c = (first + first + a) * a / 2 + (first + a + maxspeed[i + 1]) * (t[i] - a) / 2\n lastspeed = maxspeed[i + 1]\n return c, lastspeed\n\n\nans = 0\nfirstspeed = 0\nfor i in range(n):\n d, firstspeed = dist(i, firstspeed)\n ans += d\nprint(ans)\n"} +{"fast_code_id":"49052a776f54c51472062b4967b2c17ba31e82792aa55cd7c67f5eec0b671d80","fast_id":"p00008_49052a776f54c51472062b4967b2c17ba31e82792aa55cd7c67f5eec0b671d80","language":"python","measured_fast_code_id":"49052a776f54c51472062b4967b2c17ba31e82792aa55cd7c67f5eec0b671d80","measured_slow_code_id":"f78324b8c1f2014a7fb42b155a7df64e78b2806e6504b01d6dd4fa1d3a1e1f70","measurement_metric":"cpu_instruction_count","pair_id":"python_c66fde84d03d490deed43619","problem_id":"p00008","slow_code_id":"f78324b8c1f2014a7fb42b155a7df64e78b2806e6504b01d6dd4fa1d3a1e1f70","slow_id":"p00008_f78324b8c1f2014a7fb42b155a7df64e78b2806e6504b01d6dd4fa1d3a1e1f70","speedup":5385.149485757619,"stratum":"8+","sampling_key":"58d54a2df11bf41c38d213342f8de432ced797fecd1d4f96175c377c86cfb9fc","slow_code":"import sys, itertools\n\nfor n in map(int, sys.stdin):\n x = 0\n for num in itertools.product(\"0123456789\", repeat=4):\n eq = \"{}+{}+{}+{}\".format(*(num))\n if eval(eq) == n:\n x += 1\n print(x)\n","fast_code":"import sys\n\na = [0] * 51\nfor i in range(10):\n a[i] = a[36 - i] = (i + 3) * (i + 2) * (i + 1) // 6\nfor i in range(10, 19):\n a[i] = a[36 - i] = (i + 3) * (i + 2) * (i + 1) // 6 - a[i - 10] * 4\nfor e in map(int, sys.stdin):\n print((a[e]))\n"} +{"fast_code_id":"925cb2b77ca48e28cc2e769a05417ced8e6c0a980d54ba698f215e776f2e82f4","fast_id":"p02729_925cb2b77ca48e28cc2e769a05417ced8e6c0a980d54ba698f215e776f2e82f4","language":"python","measured_fast_code_id":"925cb2b77ca48e28cc2e769a05417ced8e6c0a980d54ba698f215e776f2e82f4","measured_slow_code_id":"46e9a227dfeb35218c88779accdc95a5eea2e7b74a5d04e66557f537f5098bcf","measurement_metric":"cpu_instruction_count","pair_id":"python_c6b2975180df7a98bf4ed3fb","problem_id":"p02729","slow_code_id":"46e9a227dfeb35218c88779accdc95a5eea2e7b74a5d04e66557f537f5098bcf","slow_id":"p02729_46e9a227dfeb35218c88779accdc95a5eea2e7b74a5d04e66557f537f5098bcf","speedup":2.52648092956127,"stratum":"2-4","sampling_key":"076ee5de1e5e081d10c573dbfa07434c742fe1977bb0f57220313858b45ef11c","slow_code":"N, M = list(map(int, input().split()))\nif N == 1 and M == 1:\n print((0))\nelif N == 1 and M != 1:\n print((int(M * (M - 1) / 2)))\nelif N != 1 and M == 1:\n print((int(N * (N - 1) / 2)))\nelse:\n a = N * (N - 1)\n b = M * (M - 1)\n print((int((a + b) / 2)))\n","fast_code":"print((sum([int(i) * (int(i) - 1) // 2 for i in input().split()])))\n"} +{"fast_code_id":"c2f2c25a913f55de896a42cfed81423ff4cc0c19ac1bc8e35fc294c5e102b07e","fast_id":"p03835_c2f2c25a913f55de896a42cfed81423ff4cc0c19ac1bc8e35fc294c5e102b07e","language":"python","measured_fast_code_id":"c2f2c25a913f55de896a42cfed81423ff4cc0c19ac1bc8e35fc294c5e102b07e","measured_slow_code_id":"e1205ac70321c4920de9bfdcd226acbd5ee3a72a0c0560731e7873009543ff89","measurement_metric":"cpu_instruction_count","pair_id":"python_c806859e729c45934d0f8277","problem_id":"p03835","slow_code_id":"e1205ac70321c4920de9bfdcd226acbd5ee3a72a0c0560731e7873009543ff89","slow_id":"p03835_e1205ac70321c4920de9bfdcd226acbd5ee3a72a0c0560731e7873009543ff89","speedup":118.00428007610917,"stratum":"8+","sampling_key":"4a3222a1d1da8d87462456fbbcf908c721f427a743c667570342a53c8c1a1b7a","slow_code":"K, S = list(map(int, input().split()))\ns = 0\nfor x in range(min(S, K) + 1):\n for y in range(min(S - x, K) + 1):\n if S - x - y <= K:\n s += 1\nprint(s)\n","fast_code":"K, S = list(map(int, input().split()))\nans = 0\nfor Z in range(K + 1):\n r = S - Z\n if r < 0:\n ans += 0\n elif r <= K:\n ans += r + 1\n elif r <= K * 2:\n ans += (K + 1) * 2 - (r + 1)\nprint(ans)\n"} +{"fast_code_id":"f27a4bd27f5024506b396d9409e065240fe954af08177935ce3a61cc4ef59dd1","fast_id":"p04014_f27a4bd27f5024506b396d9409e065240fe954af08177935ce3a61cc4ef59dd1","language":"python","measured_fast_code_id":"f27a4bd27f5024506b396d9409e065240fe954af08177935ce3a61cc4ef59dd1","measured_slow_code_id":"c95ad2a8dc940041977600eb1078f63d16cb258708724f5b3b59e88e5ff612b9","measurement_metric":"cpu_instruction_count","pair_id":"python_c85a81a3f39b54ef58b5bb29","problem_id":"p04014","slow_code_id":"29cce6a043e57af2f8084b7594ae7495531a30dede09cf51b56088a83bb9cffb","slow_id":"p04014_c95ad2a8dc940041977600eb1078f63d16cb258708724f5b3b59e88e5ff612b9","speedup":6.429059192431422,"stratum":"4-8","sampling_key":"28c28d1c4fbb2d502f4e8354e2b2d8ca0e1ab2f1aea37c481762a6c52f2c7e1e","slow_code":"from math import floor, sqrt\n\nINF = 10**20\n\n\ndef f(b, n):\n if n < b:\n return n\n else:\n return f(b, n // b) + (n % b)\n\n\ndef main():\n n = int(eval(input()))\n s = int(eval(input()))\n ans = INF\n\n if n == s:\n ans = min(ans, n + 1)\n\n for p in range(1, int(sqrt(n)) + 1):\n q = s - p\n b = (n - q) // p\n if 2 <= b and f(b, n) == s:\n ans = min(ans, b)\n\n for b in range(2, int(sqrt(n)) + 1):\n if f(b, n) == s:\n ans = min(ans, b)\n print((-1 if ans == INF else ans))\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"def primeFactor(N):\n i, n, ret, d, sq = 2, N, {}, 2, 99\n while i <= sq:\n k = 0\n while n % i == 0:\n n, k, ret[i] = n // i, k + 1, k + 1\n if k > 0 or i == 97:\n sq = int(n ** (1 / 2) + 0.5)\n if i < 4:\n i = i * 2 - 1\n else:\n i, d = i + d, d ^ 6\n if n > 1:\n ret[n] = 1\n return ret\n\n\ndef divisors(N):\n pf = primeFactor(N)\n ret = [1]\n for p in pf:\n ret_prev = ret\n ret = []\n for i in range(pf[p] + 1):\n for r in ret_prev:\n ret.append(r * (p**i))\n return sorted(ret)\n\n\ndef f(b, n):\n re = 0\n while n:\n re += n % b\n n //= b\n return re\n\n\nN = int(eval(input()))\nS = int(eval(input()))\nif N < S:\n print((-1))\nelif N == S:\n print((N + 1))\nelse:\n for b in divisors(N - S):\n b += 1\n if f(b, N) == S:\n print(b)\n break\n else:\n print((-1))\n"} +{"fast_code_id":"c307bd3922a7fd6a39ca6146bb6ae423a9fe44a679293cb509d5e948a8f810d5","fast_id":"p02657_c307bd3922a7fd6a39ca6146bb6ae423a9fe44a679293cb509d5e948a8f810d5","language":"python","measured_fast_code_id":"c307bd3922a7fd6a39ca6146bb6ae423a9fe44a679293cb509d5e948a8f810d5","measured_slow_code_id":"200b1c449f415dbd19883ab8d7d3fbd558bd29ecaa3e49199f40362ea5213e2b","measurement_metric":"cpu_instruction_count","pair_id":"python_c85e461037ab4fa743af90e1","problem_id":"p02657","slow_code_id":"200b1c449f415dbd19883ab8d7d3fbd558bd29ecaa3e49199f40362ea5213e2b","slow_id":"p02657_200b1c449f415dbd19883ab8d7d3fbd558bd29ecaa3e49199f40362ea5213e2b","speedup":2.0591911666350127,"stratum":"2-4","sampling_key":"60c7478c32878981c3abc61b5958f55b45f0185f1443f7e893294283960d2f85","slow_code":"import math\n\na, b = [float(x) for x in input().split()]\na = int(a)\nb = int(b * 100)\nprint((int(math.floor(a * b) // 100)))\n","fast_code":"a, b = input().split()\nprint((int(a) * int(b)))\n"} +{"fast_code_id":"c65a80990a9a256c90331e32901f5e1de2bd2ae0d5d5bc5754fe2ae140834e11","fast_id":"p03282_c65a80990a9a256c90331e32901f5e1de2bd2ae0d5d5bc5754fe2ae140834e11","language":"python","measured_fast_code_id":"c65a80990a9a256c90331e32901f5e1de2bd2ae0d5d5bc5754fe2ae140834e11","measured_slow_code_id":"c6afbfabb4f57c620b796822aa793c63e616de41f9eb4e63aa7e8f88e45d1110","measurement_metric":"cpu_instruction_count","pair_id":"python_c874029897d5c7a41e0706f6","problem_id":"p03282","slow_code_id":"c6afbfabb4f57c620b796822aa793c63e616de41f9eb4e63aa7e8f88e45d1110","slow_id":"p03282_c6afbfabb4f57c620b796822aa793c63e616de41f9eb4e63aa7e8f88e45d1110","speedup":1005.9659514050329,"stratum":"8+","sampling_key":"4183b9aff348a51c8b230bafc8e8fb723204b10788467495188f4de2dd16c4a8","slow_code":"import numpy as np\n\nS = np.array(list(map(str, input().rstrip())))\nK = int(eval(input()))\ncnt = 0\nans = 1\nfor i, s in enumerate(S):\n if s != \"1\":\n cnt = i + 1\n ans = s\n break\nif cnt > K:\n print((1))\nelse:\n print((int(ans)))\n","fast_code":"S = input().strip()\nK = int(eval(input()))\nN = len(S)\nind = N\nfor i in range(N):\n if S[i] != \"1\":\n ind = i\n break\nif K <= ind:\n print((1))\nelse:\n print((S[ind]))\n"} +{"fast_code_id":"146890d7ea4c911960fefc2e44f08fc85d507e64dfaaafffaee3a881578f824a","fast_id":"p03576_146890d7ea4c911960fefc2e44f08fc85d507e64dfaaafffaee3a881578f824a","language":"python","measured_fast_code_id":"146890d7ea4c911960fefc2e44f08fc85d507e64dfaaafffaee3a881578f824a","measured_slow_code_id":"8a3677d33ef94aa20c0d8f63278dc74d3213d7364e3053bc4f7e4d032ec4bddd","measurement_metric":"cpu_instruction_count","pair_id":"python_c8899fd42420041fa7b272d8","problem_id":"p03576","slow_code_id":"8a3677d33ef94aa20c0d8f63278dc74d3213d7364e3053bc4f7e4d032ec4bddd","slow_id":"p03576_8a3677d33ef94aa20c0d8f63278dc74d3213d7364e3053bc4f7e4d032ec4bddd","speedup":4.9239090466384035,"stratum":"4-8","sampling_key":"992ae3489efe825043c19518e436adbcf5f4a129235b4004b0645cabe28e8803","slow_code":"def acc2(grid):\n H = len(grid)\n W = len(grid[0])\n for i in range(H):\n for j in range(W - 1):\n grid[i][j + 1] += grid[i][j]\n for j in range(W):\n for i in range(H - 1):\n grid[i + 1][j] += grid[i][j]\n ngrid = [[0] * (W + 1)]\n for i in range(H):\n line = [0] + grid[i]\n ngrid.append(line)\n return ngrid\n\n\nfrom bisect import bisect_left\n\nN, K = list(map(int, input().split()))\nX = []\nY = []\ninfo = []\nfor i in range(N):\n x, y = list(map(int, input().split()))\n X.append(x)\n Y.append(y)\n info.append([x, y])\nX.sort()\nY.sort()\nacc = [[0] * (N) for i in range(N)]\nfor x, y in info:\n j = bisect_left(X, x)\n i = bisect_left(Y, y)\n acc[i][j] += 1\nacc = acc2(acc)\nans = float(\"inf\")\nfor t in range(N - 1):\n for b in range(t + 1, N):\n for l in range(N - 1):\n for r in range(l + 1, N):\n num = acc[b + 1][r + 1] - acc[b + 1][l] - acc[t][r + 1] + acc[t][l]\n if num < K:\n continue\n S = (Y[b] - Y[t]) * (X[r] - X[l])\n if S < ans:\n ans = S\nprint(ans)\n","fast_code":"N, K = list(map(int, input().split()))\nXY = [list(map(int, input().split())) for _ in [0] * N]\niX = sorted(x for x, y in XY)\niY = sorted(y for x, y in XY)\nX = {x: i for i, x in enumerate(iX)}\nY = {y: i for i, y in enumerate(iY)}\nc = [[0] * (N + 1) for i in [0] * (N + 1)]\nfor x, y in XY:\n c[Y[y] + 1][X[x] + 1] = 1\nfor i in range(N):\n for j in range(N):\n c[i + 1][j + 1] += c[i + 1][j]\nfor i in range(N):\n for j in range(N):\n c[i + 1][j + 1] += c[i][j + 1]\nans = 10**20\nfor l in range(N):\n for r in range(l + 1, N):\n u = 0\n d = 1\n dX = iX[r] - iX[l]\n while d < N:\n if c[d + 1][r + 1] + c[u][l] - c[u][r + 1] - c[d + 1][l] >= K:\n ans = min(ans, dX * (iY[d] - iY[u]))\n u += 1\n else:\n d += 1\nprint(ans)\n"} +{"fast_code_id":"d2f1d6dc4dc2368e96aa457a0b9725edcd6663fd8a36531cd436a7a1b676e18f","fast_id":"p02572_d2f1d6dc4dc2368e96aa457a0b9725edcd6663fd8a36531cd436a7a1b676e18f","language":"python","measured_fast_code_id":"d2f1d6dc4dc2368e96aa457a0b9725edcd6663fd8a36531cd436a7a1b676e18f","measured_slow_code_id":"9a9a8c4412436852a66bfa0067b57c544f3aec7f532b2c46c6eaa958a2513451","measurement_metric":"cpu_instruction_count","pair_id":"python_c897beb21dd677096af820da","problem_id":"p02572","slow_code_id":"9a9a8c4412436852a66bfa0067b57c544f3aec7f532b2c46c6eaa958a2513451","slow_id":"p02572_9a9a8c4412436852a66bfa0067b57c544f3aec7f532b2c46c6eaa958a2513451","speedup":6.432596327264441,"stratum":"4-8","sampling_key":"3470f4959afffb762b67c8b056d571efe3468e5980301ddb85685bf8cf820b30","slow_code":"import copy\n\nN = int(eval(input()))\nA = list(map(int, input().split()))\nmod = 10**9 + 7\npartial_sum = copy.deepcopy(A)\nsum_now = A[N - 1]\nfor j in range(N - 2, -1, -1):\n sum_now = int((sum_now + A[j]) % mod)\n partial_sum[j] = sum_now\nres = 0\nfor i in range(N - 1):\n res = (res + (A[i] * partial_sum[i + 1]) % mod) % mod\nprint((int(res)))\n","fast_code":"M = 10**9 + 7\nN = int(eval(input()))\nA = list(map(int, input().split()))\nprint(((((sum(A) ** 2) - sum([x * x for x in A])) // 2) % M))\n"} +{"fast_code_id":"eb59173593586205e197b93d6038318bf5f846c2e7abe8ca0ba85de5bc717a07","fast_id":"p03126_eb59173593586205e197b93d6038318bf5f846c2e7abe8ca0ba85de5bc717a07","language":"python","measured_fast_code_id":"eb59173593586205e197b93d6038318bf5f846c2e7abe8ca0ba85de5bc717a07","measured_slow_code_id":"0f7452cbac3152780e6e45e4ccdb0d439fed784a94d652759a76c518063b3e0f","measurement_metric":"cpu_instruction_count","pair_id":"python_c8c246c3ba358c32f50fefee","problem_id":"p03126","slow_code_id":"0f7452cbac3152780e6e45e4ccdb0d439fed784a94d652759a76c518063b3e0f","slow_id":"p03126_0f7452cbac3152780e6e45e4ccdb0d439fed784a94d652759a76c518063b3e0f","speedup":4.534542838325146,"stratum":"4-8","sampling_key":"61f1d27c044c1e349ed9859f81fc4a5582ed2f6f18a4a075919b09a1a98f7d39","slow_code":"N, M = list(map(int, input().split()))\nK = [0] * N\nA = [list(map(int, input().split())) for i in range(N)]\ncount = 0\nfor i in range(1, M + 1, 1):\n likecount = 0\n for j in range(N):\n for k in range(1, A[j][0] + 1, 1):\n if A[j][k] == i:\n likecount += 1\n if likecount == N:\n count += 1\nprint(count)\n","fast_code":"N, M = list(map(int, input().split()))\nfood = set(range(1, M + 1))\nfor i in range(N):\n A = list(map(int, input().split()[1:]))\n food &= set(A)\nprint((len(food)))\n"} +{"fast_code_id":"9ca73476f1131853179fecf70c42d279491ae767fa15807203ecca379aa873a7","fast_id":"p00150_9ca73476f1131853179fecf70c42d279491ae767fa15807203ecca379aa873a7","language":"python","measured_fast_code_id":"9ca73476f1131853179fecf70c42d279491ae767fa15807203ecca379aa873a7","measured_slow_code_id":"20faefeb67c15aa810ff24a8c45594ce14afc5e4e8f28efcde254ca1f9a3dabc","measurement_metric":"cpu_instruction_count","pair_id":"python_c8ee53e072b00bf9a21f9f9a","problem_id":"p00150","slow_code_id":"20faefeb67c15aa810ff24a8c45594ce14afc5e4e8f28efcde254ca1f9a3dabc","slow_id":"p00150_20faefeb67c15aa810ff24a8c45594ce14afc5e4e8f28efcde254ca1f9a3dabc","speedup":4.2483158966207215,"stratum":"4-8","sampling_key":"0446bd706d86f9d6a8f0646858953b03f55b4dc336d74d1dcd0f3ab0cdb0f3ad","slow_code":"r = 10001\nsqrt = int(r**0.5)\np = [1] * r\ntwin = [0] * r\np[0] = 0\np[1::2] = [0 for x in range(1, r, 2)]\nfor i in range(2, r, 2):\n if p[i]:\n p[2 * i + 1 :: i + 1] = [0 for x in range(2 * i + 1, r, i + 1)]\n if p[i - 2]:\n twin[i] = 1\nwhile True:\n n = int(input())\n if n == 0:\n break\n i = n - twin[:n][::-1].index(1)\n print(i - 2, i)\n","fast_code":"import bisect as bs\n\n\ndef prime(m):\n N = list(range(1, m + 1, 2))\n N[0] = 2\n for i in range(1, int(m**0.5) + 1):\n x = N[i]\n if x:\n N[i + x :: x] = [0] * len(N[i + x :: x])\n return [_f for _f in N if _f]\n\n\nP = prime(10000)\nx = [P[i] for i in range(1, len(P)) if P[i] - P[i - 1] == 2]\nwhile 1:\n n = eval(input())\n if n == 0:\n break\n a = x[bs.bisect_right(x, n) - 1]\n print(a - 2, a)\n"} +{"fast_code_id":"a76952c0490cecb3a81db9aa49c26a3e2cd00b2ef42087d8a13e6706056a796b","fast_id":"p03738_62827c412864c307a027da23261683b2eca9679fbb0002bba4b256667c85d072","language":"python","measured_fast_code_id":"62827c412864c307a027da23261683b2eca9679fbb0002bba4b256667c85d072","measured_slow_code_id":"d5baa6a15a1c4a76633ab38a051360a64a827577b6553480f73b85ef4ead3a15","measurement_metric":"cpu_instruction_count","pair_id":"python_c8f2881ce6721c3c0d236162","problem_id":"p03738","slow_code_id":"51f72b7576f2a6693b915f49f43199e2cd6155a4ebab55cc493d3b8dd74e88d8","slow_id":"p03738_d5baa6a15a1c4a76633ab38a051360a64a827577b6553480f73b85ef4ead3a15","speedup":2.2034598652181705,"stratum":"2-4","sampling_key":"3dc617c66fcb85933fd6ca0b09f4e79f13c37819f52f6a736a6b07f4e69d074f","slow_code":"import math\n\nif __name__ == \"__main__\":\n a = input()\n b = input()\n if len(a) > len(b):\n print(\"GREATER\")\n elif len(a) < len(b):\n print(\"LESS\")\n elif len(a) == len(b):\n for i in range(len(a)):\n if a[i] > b[i]:\n print(\"GREATER\")\n break\n elif a[i] < b[i]:\n print(\"LESS\")\n break\n elif a[i] == b[i] and i == len(a) - 1:\n print(\"EQUAL\")\n","fast_code":"if __name__ == \"__main__\":\n a = int(input())\n b = int(input())\n if a > b:\n print(\"GREATER\")\n elif a < b:\n print(\"LESS\")\n elif a == b:\n print(\"EQUAL\")\n"} +{"fast_code_id":"3c08881b5b3729a613f8ec99a27b6ec76218ded85383ed0ac39d376f8a73893c","fast_id":"p03721_3c08881b5b3729a613f8ec99a27b6ec76218ded85383ed0ac39d376f8a73893c","language":"python","measured_fast_code_id":"3c08881b5b3729a613f8ec99a27b6ec76218ded85383ed0ac39d376f8a73893c","measured_slow_code_id":"279050fc9c8196e79b3287160bf417ea1e2926855392ef8a058868e0c3b5c41d","measurement_metric":"cpu_instruction_count","pair_id":"python_c900687109c99df157c68f55","problem_id":"p03721","slow_code_id":"279050fc9c8196e79b3287160bf417ea1e2926855392ef8a058868e0c3b5c41d","slow_id":"p03721_279050fc9c8196e79b3287160bf417ea1e2926855392ef8a058868e0c3b5c41d","speedup":4.712308498650585,"stratum":"4-8","sampling_key":"99eb9afa1e1a1d4303e9465e662a45fe9e1fc694586bd2463a256851abd884fa","slow_code":"N, K = list(map(int, input().split()))\nli = [0] * 100001\nfor i in range(N):\n a, b = list(map(int, input().split()))\n li[a] += b\ntmp = 0\nfor i in range(100001):\n tmp += li[i]\n if tmp >= K:\n print(i)\n break\n","fast_code":"n, k, *l = list(map(int, open(0).read().split()))\nc = 0\nfor a, b in sorted(zip(l[::2], l[1::2])):\n c += b\n if c >= k:\n print(a)\n break\n"} +{"fast_code_id":"7d0399566439cd002a2223f008c75cebcd6043ec619ec239d746132cb8c1a99d","fast_id":"p02660_7d0399566439cd002a2223f008c75cebcd6043ec619ec239d746132cb8c1a99d","language":"python","measured_fast_code_id":"7d0399566439cd002a2223f008c75cebcd6043ec619ec239d746132cb8c1a99d","measured_slow_code_id":"8301217799053ca8035ba7e5e9be7529b06a7e4ccf5a0cb39174661c0dc1c031","measurement_metric":"cpu_instruction_count","pair_id":"python_c90e88c2db46b961fa5062b0","problem_id":"p02660","slow_code_id":"8301217799053ca8035ba7e5e9be7529b06a7e4ccf5a0cb39174661c0dc1c031","slow_id":"p02660_8301217799053ca8035ba7e5e9be7529b06a7e4ccf5a0cb39174661c0dc1c031","speedup":131.05017355403598,"stratum":"8+","sampling_key":"182311386b2564e3fd236d509b5fbf2372a01a8ff4786c4274f0b3a97289f4a5","slow_code":"n = int(eval(input()))\na = p = 1\nwhile p < 6**8:\n c = t = 0\n p += 1\n while n % p < 1:\n n //= p\n x = c == t\n t += x\n c += 1 - t * x\n a += x\nprint((a - (n < 2)))\n","fast_code":"import sys\n\nN = int(sys.stdin.readline().rstrip())\n\n\ndef make_divisors(n):\n divisors = []\n for i in range(1, int(n**0.5) + 1):\n if n % i == 0:\n divisors.append(i)\n if i != n // i:\n divisors.append(n // i)\n divisors.sort()\n return divisors\n\n\ndef prime_factorize(n):\n a = []\n while n % 2 == 0:\n a.append(2)\n n //= 2\n f = 3\n while f * f <= n:\n if n % f == 0:\n a.append(f)\n n //= f\n else:\n f += 2\n if n != 1:\n a.append(n)\n a = set(a)\n if len(a) == 1:\n return True\n else:\n return False\n\n\ndivisors = make_divisors(N)\nans = 0\nfor d in divisors:\n if prime_factorize(d) and N % d == 0:\n N //= d\n ans += 1\nprint(ans)\n"} +{"fast_code_id":"579610e03242ba0bcafef8f3a8deacc5024df980a28f406c54a8b4dcc502b6a7","fast_id":"p03317_579610e03242ba0bcafef8f3a8deacc5024df980a28f406c54a8b4dcc502b6a7","language":"python","measured_fast_code_id":"579610e03242ba0bcafef8f3a8deacc5024df980a28f406c54a8b4dcc502b6a7","measured_slow_code_id":"a49e8701c648359100d415e821b1668f4d7ae2ccaf0a530fd721c1bee96df392","measurement_metric":"cpu_instruction_count","pair_id":"python_c94c1c88b0fbbc940b37418c","problem_id":"p03317","slow_code_id":"a49e8701c648359100d415e821b1668f4d7ae2ccaf0a530fd721c1bee96df392","slow_id":"p03317_a49e8701c648359100d415e821b1668f4d7ae2ccaf0a530fd721c1bee96df392","speedup":37.978111620472845,"stratum":"8+","sampling_key":"72e4609adb8d0d757982daa9c62c2884524218e0f557c70e1b60529a80a41e45","slow_code":"from collections import Counter\nfrom math import *\n\nN, K = [int(x) for x in input().strip().split()]\nA = [int(x) for x in input().strip().split()]\nA.sort()\nc = Counter(A)\nminc = c[A[0]]\nres = len(A) - minc\nprint((ceil(res / (K - 1))))\n","fast_code":"N, K = list(map(int, input().split()))\nprint(((N - 2) // (K - 1) + 1))\n"} +{"fast_code_id":"c0774071116f1d410c4ba2ff6c10b276620a469926c6fd1b4b8475910d060334","fast_id":"p02786_c0774071116f1d410c4ba2ff6c10b276620a469926c6fd1b4b8475910d060334","language":"python","measured_fast_code_id":"c0774071116f1d410c4ba2ff6c10b276620a469926c6fd1b4b8475910d060334","measured_slow_code_id":"09a65063dc765e4cefad5eee9e2b182a86482cf81649dc4a8e732b6ba516a72e","measurement_metric":"cpu_instruction_count","pair_id":"python_c95ae4ff945c2749863e35fc","problem_id":"p02786","slow_code_id":"09a65063dc765e4cefad5eee9e2b182a86482cf81649dc4a8e732b6ba516a72e","slow_id":"p02786_09a65063dc765e4cefad5eee9e2b182a86482cf81649dc4a8e732b6ba516a72e","speedup":1781.2920533367517,"stratum":"8+","sampling_key":"df58ce718da55ad63cad66ef693eba5f8346b9bb932a8e244dcab4a66d047b64","slow_code":"import numpy as np\n\nH = eval(input())\nH = int(H)\n\n\ndef count(H):\n count = 1\n while True:\n if int(H / 2) == 0:\n break\n else:\n H = int(H / 2)\n count += 1\n continue\n return count\n\n\nA = 0\nfor i in range(int(count(H))):\n A += 2**i\nprint(A)\n","fast_code":"N = int(eval(input()))\nNB = format(N, \"0b\")\nK = len(NB)\nprint((2**K - 1))\n"} +{"fast_code_id":"0dce2c547d143e925c6530eca112bbdcf0cb4862950c8b11f8424683071149f7","fast_id":"p03608_0dce2c547d143e925c6530eca112bbdcf0cb4862950c8b11f8424683071149f7","language":"python","measured_fast_code_id":"0dce2c547d143e925c6530eca112bbdcf0cb4862950c8b11f8424683071149f7","measured_slow_code_id":"a6ba7a6e457f7223737377dc74c3739f39a6faf8bc7e129d3e4d82875673c6ae","measurement_metric":"cpu_instruction_count","pair_id":"python_c9ce682afd6bf4284b0a297b","problem_id":"p03608","slow_code_id":"f19f2c009c893dde042476371af37c34ea12cfaa23ea63baa86f7c5a07cc08fe","slow_id":"p03608_a6ba7a6e457f7223737377dc74c3739f39a6faf8bc7e129d3e4d82875673c6ae","speedup":7.789150742332422,"stratum":"4-8","sampling_key":"c216e6311273c51e7e281786afb96b2048c5fdc48aa19ae9f12777c574624fdd","slow_code":"n, m, r = list(map(int, input().split()))\nrs = list(map(int, input().split()))\n\nimport numpy as np\n\ndists = np.ones((n + 1, n + 1)) * float(\"inf\")\nfor _ in range(m):\n a, b, c = list(map(int, input().split()))\n dists[a, b] = dists[b, a] = c\nfor i in range(1, n + 1):\n dists[i, i] = 0\nfrom itertools import product, permutations\n\nfor i, j in product(list(range(1, 1 + n)), repeat=2):\n dists[j] = np.minimum(dists[j], dists[i] + dists[j, i])\nans = float(\"inf\")\nfor path in permutations(rs):\n val = sum(dists[i, j] for i, j in zip(path, path[1:]))\n val = int(val)\n if val < ans:\n ans = val\nprint(ans)\n","fast_code":"import sys, queue, math, copy, itertools, bisect, collections\nfrom heapq import *\n\n\ndef main():\n sys.setrecursionlimit(10**7)\n INF = 10**8\n MOD = 10**9 + 7\n LI = lambda: [int(x) for x in sys.stdin.readline().split()]\n _LI = lambda: [int(x) - 1 for x in sys.stdin.readline().split()]\n NI = lambda: int(sys.stdin.readline())\n N, M, R = LI()\n r = _LI()\n root = [[] for _ in range(N)]\n for _ in range(M):\n a, b, c = LI()\n root[a - 1].append((b - 1, c))\n root[b - 1].append((a - 1, c))\n memo = [[0] * N for _ in range(N)]\n min_r = INF\n for x in itertools.permutations(r):\n it = 0\n s = x[0]\n for t in x[1:]:\n if memo[s][t]:\n it += memo[s][t]\n else:\n node = [INF] * N\n q = []\n heapify(q)\n heappush(q, (0, s))\n while q:\n l, u = heappop(q)\n if l >= node[u]:\n continue\n node[u] = l\n for v, m in root[u]:\n if node[v] > l + m:\n heappush(q, (l + m, v))\n memo[s][t] = node[t]\n memo[t][s] = node[t]\n it += node[t]\n s = t\n min_r = min(min_r, it)\n print(min_r)\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"0562a3847cd197b90f3b1ef06df23421c925cba880cbb7ba72c2820e325fa194","fast_id":"p03448_94c0c361190f240e9da3abc176db7d77dd2b61e056a3824beca5fd89b1c1727f","language":"python","measured_fast_code_id":"94c0c361190f240e9da3abc176db7d77dd2b61e056a3824beca5fd89b1c1727f","measured_slow_code_id":"bf5b06ff36383d97cd14233a35663e1c4f87a24020501ac318d049451ae94d18","measurement_metric":"cpu_instruction_count","pair_id":"python_cb81c37349b6c8ebb77f5e00","problem_id":"p03448","slow_code_id":"bf5b06ff36383d97cd14233a35663e1c4f87a24020501ac318d049451ae94d18","slow_id":"p03448_bf5b06ff36383d97cd14233a35663e1c4f87a24020501ac318d049451ae94d18","speedup":3.2962182771235122,"stratum":"2-4","sampling_key":"11f0008fa501bc38b506b67110ec773c93ffb1f15d75d2191484f3fa3803f34f","slow_code":"A = int(eval(input()))\nB = int(eval(input()))\nC = int(eval(input()))\nX = int(eval(input()))\ncount = 0\nfor a in [a * 500 for a in range(A + 1)]:\n for b in [b * 100 for b in range(B + 1)]:\n for k in range(C + 1):\n if a + b + 50 * k == X:\n count += 1\nprint(count)\n","fast_code":"a, b, c, x = list(map(int, [input().rstrip() for _ in range(4)]))\ncount = 0\nfor i in range(min(a, int(x / 500)) + 1):\n for j in range(min(b, int((x - i * 500) / 100)) + 1):\n if (x - i * 500 - j * 100) // 50 <= c and (x - i * 500 - j * 100) % 50 == 0:\n count += 1\nprint(count)\n"} +{"fast_code_id":"d05250768fe6cf77a914fb96cb562d62103b2f0586db340b6e9274f071d45972","fast_id":"p02289_d05250768fe6cf77a914fb96cb562d62103b2f0586db340b6e9274f071d45972","language":"python","measured_fast_code_id":"d05250768fe6cf77a914fb96cb562d62103b2f0586db340b6e9274f071d45972","measured_slow_code_id":"14b4ad282f61dc3f0baedf2eb80026c759f35dd9b34a29e093c21234282f17e7","measurement_metric":"cpu_instruction_count","pair_id":"python_cb9561d458362f229b0ab84e","problem_id":"p02289","slow_code_id":"14b4ad282f61dc3f0baedf2eb80026c759f35dd9b34a29e093c21234282f17e7","slow_id":"p02289_14b4ad282f61dc3f0baedf2eb80026c759f35dd9b34a29e093c21234282f17e7","speedup":3.077228595789579,"stratum":"2-4","sampling_key":"0eff7838bfcd4674d97b4f13eb2968672857741a4f4dd882bbe53d67ce847b2b","slow_code":"import sys\n\n\ndef maxHeapify(A, i):\n l = i * 2 + 1\n r = i * 2 + 2\n if l < n:\n largest = l\n if r < n and A[r] > A[l]:\n largest = r\n if A[largest] > A[i]:\n A[i], A[largest] = A[largest], A[i]\n maxHeapify(A, largest)\n\n\ndef insert(S, k):\n global n\n S[n] = k\n n += 1\n i = n - 1\n p = (i - 1) // 2\n while i > 0 and S[i] > S[p]:\n S[i], S[p] = S[p], S[i]\n i = p\n p = (i - 1) // 2\n\n\ndef extractMax(S):\n global n\n if n == 1:\n n -= 1\n return S[0]\n ans = S[0]\n n -= 1\n S[0] = S[n]\n i = 0\n while True:\n l = i * 2 + 1\n r = i * 2 + 2\n if l >= n:\n break\n largest = l\n if r < n and A[r] > A[l]:\n largest = r\n if A[largest] > A[i]:\n A[i], A[largest] = A[largest], A[i]\n i = largest\n else:\n break\n return ans\n\n\nA = [0] * 2000000\nS = []\nn = 0\nfor s in sys.stdin:\n if s[2] == \"s\":\n insert(A, int(s[7:]))\n elif s[2] == \"t\":\n S.append(extractMax(A))\n else:\n break\nprint((\"\\n\".join(map(str, S))))\n","fast_code":"from sys import stdin\n\nreadline = stdin.readline\nimport heapq\n\n\ndef main():\n heap = []\n while True:\n line = readline()\n if line[2] == \"t\":\n print((heapq.heappop(heap)[1]))\n elif line[2] == \"s\":\n n = int(line.split()[1])\n heapq.heappush(heap, (-n, n))\n else:\n break\n\n\nmain()\n"} +{"fast_code_id":"683edb5387a0ab080181d9c6ffee63f5a436b05168e99054881c1ca28904e345","fast_id":"p03078_683edb5387a0ab080181d9c6ffee63f5a436b05168e99054881c1ca28904e345","language":"python","measured_fast_code_id":"683edb5387a0ab080181d9c6ffee63f5a436b05168e99054881c1ca28904e345","measured_slow_code_id":"89ead735dc29ee30935918256f165fac3ec8ffc5cdca9eb00b39369b55de9e48","measurement_metric":"cpu_instruction_count","pair_id":"python_cc03565ddf06a3c1cf1973f2","problem_id":"p03078","slow_code_id":"89ead735dc29ee30935918256f165fac3ec8ffc5cdca9eb00b39369b55de9e48","slow_id":"p03078_89ead735dc29ee30935918256f165fac3ec8ffc5cdca9eb00b39369b55de9e48","speedup":2.002243782555816,"stratum":"2-4","sampling_key":"361a59202c0dc5a416d618227b647fdb7fe7e1f5daa11e73e482b23500c6fb64","slow_code":"import heapq\n\nX, Y, Z, K = list(map(int, input().split()))\na = list(map(int, input().split()))\nb = list(map(int, input().split()))\nc = list(map(int, input().split()))\na.sort(reverse=True)\nb.sort(reverse=True)\nc.sort(reverse=True)\nans = [(-(a[0] + b[0] + c[0]), 0, 0, 0)]\nfor i in range(K):\n m, j, k, h = heapq.heappop(ans)\n print((-m))\n if j + 1 <= X - 1:\n s = (-(a[j + 1] + b[k] + c[h]), j + 1, k, h)\n if s not in ans:\n heapq.heappush(ans, s)\n if k + 1 <= Y - 1:\n s = (-(a[j] + b[k + 1] + c[h]), j, k + 1, h)\n if s not in ans:\n heapq.heappush(ans, s)\n if h + 1 <= Z - 1:\n s = (-(a[j] + b[k] + c[h + 1]), j, k, h + 1)\n if s not in ans:\n heapq.heappush(ans, s)\n","fast_code":"X, Y, Z, K = map(int, input().split())\nA = sorted(list(map(int, input().split())), reverse=True)\nB = sorted(list(map(int, input().split())), reverse=True)\nC = sorted(list(map(int, input().split())), reverse=True)\ncomb = []\nfor a in range(X):\n b_max = K // (a + 1)\n for b in range(min(Y, b_max)):\n c_max = K // ((a + 1) * (b + 1))\n for c in range(min(Z, c_max)):\n comb.append(sum([A[a], B[b], C[c]]))\ncomb.sort(reverse=True)\nprint(*comb[:K], sep=\"\\n\")\n"} +{"fast_code_id":"85679f394ae60f0654dd4c5fdf85f7fe679bd09ea1804d5f6793f7346926ffc0","fast_id":"p03006_1dd09cfba1bcd070711ca68e65bd6d6b6113a1826d178b576ecd39bb89d46b12","language":"python","measured_fast_code_id":"1dd09cfba1bcd070711ca68e65bd6d6b6113a1826d178b576ecd39bb89d46b12","measured_slow_code_id":"df539d82cce0b66ac388cb7626c1915f078dadd19fd45e23838905782b69fa8f","measurement_metric":"cpu_instruction_count","pair_id":"python_cc1eff05c333c51185e1e634","problem_id":"p03006","slow_code_id":"df539d82cce0b66ac388cb7626c1915f078dadd19fd45e23838905782b69fa8f","slow_id":"p03006_df539d82cce0b66ac388cb7626c1915f078dadd19fd45e23838905782b69fa8f","speedup":6.175254457005445,"stratum":"4-8","sampling_key":"a25f6206dbb18a3a66d1104644a5c45a83204a08012018331eb48619940e3836","slow_code":"from math import (\n ceil,\n floor,\n factorial,\n gcd,\n sqrt,\n log2,\n cos,\n sin,\n tan,\n acos,\n asin,\n atan,\n degrees,\n radians,\n pi,\n inf,\n)\nfrom itertools import (\n accumulate,\n groupby,\n permutations,\n combinations,\n product,\n combinations_with_replacement,\n)\nfrom collections import deque, defaultdict, Counter\nfrom bisect import bisect_left, bisect_right\nfrom operator import itemgetter\nfrom heapq import heapify, heappop, heappush\nfrom queue import Queue, LifoQueue, PriorityQueue\nfrom copy import deepcopy\nfrom time import time\nimport string\nimport sys\n\nsys.setrecursionlimit(10**7)\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef INT():\n return int(eval(input()))\n\n\ndef MAP():\n return list(map(int, input().split()))\n\n\ndef LIST():\n return list(MAP())\n\n\nn = INT()\nx = [LIST() for i in range(n)]\na = []\nfor i in range(n):\n for j in range(n):\n if i != j:\n a.append((x[j][0] - x[i][0], x[j][1] - x[i][1]))\na.sort()\ncount = 1\nreg = 1\nfor i in range(1, len(a)):\n if a[i][:] == a[i - 1][:]:\n count += 1\n reg = max(reg, count)\n else:\n count = 1\nif n == 1:\n ans = n\nelse:\n ans = n - reg\nprint(ans)\n","fast_code":"from collections import Counter\nfrom itertools import permutations\n\nN = int(eval(input()))\nx, y = (\n list(zip(*(list(map(int, input().split())) for _ in range(N)))) if N else ((), ())\n)\n\n\nans = (\n 1\n if N == 1\n else N\n - max(\n Counter(\n (x[i] - x[j], y[i] - y[j]) for i, j in permutations(list(range(N)), 2)\n ).values()\n )\n)\nprint(ans)\n"} +{"fast_code_id":"e1cbdec8705f7fa5a2f6a70afe1c88b85c528d48dd68d0a39949a7c0199ae182","fast_id":"p02935_e1cbdec8705f7fa5a2f6a70afe1c88b85c528d48dd68d0a39949a7c0199ae182","language":"python","measured_fast_code_id":"e1cbdec8705f7fa5a2f6a70afe1c88b85c528d48dd68d0a39949a7c0199ae182","measured_slow_code_id":"4fce74aca7d1608f14c76b9fb92532f43bd52c914832f66cdc3ddf21b1636b9b","measurement_metric":"cpu_instruction_count","pair_id":"python_cc577438d6689521414d2b7d","problem_id":"p02935","slow_code_id":"4fce74aca7d1608f14c76b9fb92532f43bd52c914832f66cdc3ddf21b1636b9b","slow_id":"p02935_4fce74aca7d1608f14c76b9fb92532f43bd52c914832f66cdc3ddf21b1636b9b","speedup":740.402827878656,"stratum":"8+","sampling_key":"28e8a07906c78d07968db1df21cfcd9b28dec0ca6af3c5aee1bec10c87c210e3","slow_code":"import numpy as np\n\nn = int(eval(input()))\nlista = list(map(int, input().split()))\nlista.sort()\nfor i in range(n - 1):\n lista.append((lista[0] + lista[1]) / 2)\n lista.pop(0)\n lista.pop(0)\n lista.sort()\nprint((lista[0]))\n","fast_code":"N = int(eval(input()))\nv = list(map(int, input().split()))\nfor i in range(N - 1):\n v.sort()\n v[1] = (v[0] + v[1]) / 2\n v = v[1:]\nprint((v[0]))\n"} +{"fast_code_id":"0d8da106ea3146cd8cc7b09c82139881b290f81b5ab414cb7641e1219f020f13","fast_id":"p03449_0d8da106ea3146cd8cc7b09c82139881b290f81b5ab414cb7641e1219f020f13","language":"python","measured_fast_code_id":"0d8da106ea3146cd8cc7b09c82139881b290f81b5ab414cb7641e1219f020f13","measured_slow_code_id":"ef6ef8b6058f8fe2ff3f6c515307d0adaccb7ef0774b4fc4ee42af36434cbe6d","measurement_metric":"cpu_instruction_count","pair_id":"python_ccd477b3a732f36c70cf516e","problem_id":"p03449","slow_code_id":"c9914409980530d0996d00d624d6ced5bcaa5e46404bf56c166db3c30c8b45e2","slow_id":"p03449_ef6ef8b6058f8fe2ff3f6c515307d0adaccb7ef0774b4fc4ee42af36434cbe6d","speedup":4.619445387592291,"stratum":"4-8","sampling_key":"4a5444605c9897ba9db746a2c3626d5ae0e67297f9473eea9f7e3ed2eb47d33d","slow_code":"def readInts():\n return list(map(int, input().split()))\n\n\ndef main():\n n = int(eval(input()))\n A = [readInts() for _ in range(2)]\n\n idx = 0\n\n ma_ = -1\n while idx < n:\n j = 0\n cnt = 0\n dist = 0\n k = 0\n while k <= idx:\n if cnt <= n:\n dist += A[j][k]\n cnt += 1\n else:\n break\n k += 1\n k -= 1\n\n if cnt <= n:\n j += 1\n\n dist += A[j][k]\n cnt += 1\n k += 1\n\n if cnt <= n:\n while k < n:\n if cnt <= n:\n\n dist += A[j][k]\n cnt += 1\n else:\n break\n k += 1\n idx += 1\n\n ma_ = max(ma_, dist)\n print(ma_)\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"N = int(eval(input()))\nS0 = list(map(int, input().split()))\nS1 = list(map(int, input().split()))\nans = 0\nfor i in range(N):\n tmp = sum(S0[: i + 1]) + sum(S1[i:])\n ans = max(tmp, ans)\nprint(ans)\n"} +{"fast_code_id":"75037892fbe0d3f8ec2f6cad07c769abb92a7779fb94ebaf53c5f1ef1cf5a970","fast_id":"p03330_2bf84a04b2c862b8fc6cada5361225248d707fa385c9679c1031ce69470c3f9c","language":"python","measured_fast_code_id":"2bf84a04b2c862b8fc6cada5361225248d707fa385c9679c1031ce69470c3f9c","measured_slow_code_id":"c02a11b7b5b1b315914b965fdf3ecfb4358b57b2c3925ddf481c4eb6e9760d11","measurement_metric":"cpu_instruction_count","pair_id":"python_ccffa5936a40ba4e8ba0d0ba","problem_id":"p03330","slow_code_id":"b26d76a0f9b29fa38bb4e81f3bd1f83b96fba757a97a758a390f98fa3fc78913","slow_id":"p03330_c02a11b7b5b1b315914b965fdf3ecfb4358b57b2c3925ddf481c4eb6e9760d11","speedup":6.9334129564763405,"stratum":"4-8","sampling_key":"fa7b480054ad8ddda924309b6d4067226fa81e47580691ddae78e1a8a08c3fb1","slow_code":"from collections import defaultdict\n\nN, C = list(map(int, input().split()))\nD = [tuple(map(int, input().split())) for _ in range(C)]\nd = [defaultdict(int) for i in range(3)]\nfor i in range(N):\n c = [int(x) for x in input().split()]\n for j in range(N):\n for k in range(C):\n d[(i + j) % 3][k] += D[c[j] - 1][k]\n\nans = 10**9\nfor i in range(C):\n for j in range(C):\n for k in range(C):\n if i != j and j != k and k != i:\n ans = min(ans, d[0][i] + d[1][j] + d[2][k])\nprint(ans)\n","fast_code":"from collections import Counter, defaultdict, deque\nimport sys, heapq, bisect, math, itertools, string, queue\n\nsys.setrecursionlimit(10**8)\nmod = 10**9 + 7\n\n\ndef inp():\n return int(sys.stdin.readline())\n\n\ndef inpl():\n return list(map(int, sys.stdin.readline().split()))\n\n\ndef inpl_str():\n return list(sys.stdin.readline().split())\n\n\ndef inpln(n):\n return list(int(sys.stdin.readline()) for i in range(n))\n\n\nn, C = inpl()\nd = []\nc = []\nfor i in range(C):\n d.append(inpl())\nfor i in range(n):\n c.append(inpl())\nd0 = defaultdict(int)\nd1 = defaultdict(int)\nd2 = defaultdict(int)\ndd = [d0, d1, d2]\nfor y in range(n):\n for x in range(n):\n t = (x + y + 2) % 3\n dd[t][c[x][y]] += 1\n\nres = [[] for i in range(3)]\nfor i in range(C):\n for j in range(3):\n tmp = 0\n for key in list(dd[j].keys()):\n tmp += d[key - 1][i] * dd[j][key]\n res[j].append([i, tmp])\nfor i in range(3):\n res[i].sort(key=lambda x: x[1])\n\nans = mod\nfor i in range(3):\n for j in range(3):\n for k in range(3):\n if (\n res[0][i][0] == res[1][j][0]\n or res[0][i][0] == res[2][k][0]\n or res[2][k][0] == res[1][j][0]\n ):\n continue\n ans = min(res[0][i][1] + res[1][j][1] + res[2][k][1], ans)\nprint(ans)\n"} +{"fast_code_id":"6db8dfdbd1030b078d911aa61a5b641680f88ed6eb95e0c37f40e9fef3717917","fast_id":"p03737_6db8dfdbd1030b078d911aa61a5b641680f88ed6eb95e0c37f40e9fef3717917","language":"python","measured_fast_code_id":"6db8dfdbd1030b078d911aa61a5b641680f88ed6eb95e0c37f40e9fef3717917","measured_slow_code_id":"c5a6a790bfe3c359c7ab2698d0f376a617bb650fa938bf64d595d41523985f6d","measurement_metric":"cpu_instruction_count","pair_id":"python_cd2bb6af041742504a0998b0","problem_id":"p03737","slow_code_id":"c5a6a790bfe3c359c7ab2698d0f376a617bb650fa938bf64d595d41523985f6d","slow_id":"p03737_c5a6a790bfe3c359c7ab2698d0f376a617bb650fa938bf64d595d41523985f6d","speedup":2245.427542578936,"stratum":"8+","sampling_key":"4cd17118d896bf85b467649b7054f63d62f21b6b40e4cb290e7873f98add6246","slow_code":"import numpy as np\nimport math\n\ns = \" \" + input()\nfor i in range(len(s)):\n if s[i] == \" \":\n print(chr(ord(s[i + 1]) - 32), end=\"\")\nprint()\n","fast_code":"a, b, c = input().split()\nprint((a[0].upper() + b[0].upper() + c[0].upper()))\n"} +{"fast_code_id":"9a76b7d6d939350329a8e74443299bed6ee87078d24ec513c4fa064113ccdf57","fast_id":"p02789_9a76b7d6d939350329a8e74443299bed6ee87078d24ec513c4fa064113ccdf57","language":"python","measured_fast_code_id":"9a76b7d6d939350329a8e74443299bed6ee87078d24ec513c4fa064113ccdf57","measured_slow_code_id":"3b3c9592d05d78419094081aeeb834d7351702df4b6152b2850a5ab58ae1e1e1","measurement_metric":"cpu_instruction_count","pair_id":"python_cd835b314ad14801528943d0","problem_id":"p02789","slow_code_id":"b67e95e628852cc5e8281d284b620a3652c42bb82548c79c6e24811247e94916","slow_id":"p02789_3b3c9592d05d78419094081aeeb834d7351702df4b6152b2850a5ab58ae1e1e1","speedup":1759.6934386746138,"stratum":"8+","sampling_key":"18bebc2db8ec3900c3642454f49c9402779826d8f98476c1b09637779db10c41","slow_code":"import math\nimport statistics\nimport numpy as np\nimport queue\nimport itertools\n\nn, m = list(map(int, input().split()))\nif n == m:\n print(\"Yes\")\nelse:\n print(\"No\")\n","fast_code":"l = list(input().split())\nN = int(l[0])\nM = int(l[1])\nif N == M:\n print(\"Yes\")\nelse:\n print(\"No\")\n"} +{"fast_code_id":"80763d8bbf9160e605a9a5d877f1e2a5dd0cda59fe5c5e3bbffe19852d02222b","fast_id":"p02573_80763d8bbf9160e605a9a5d877f1e2a5dd0cda59fe5c5e3bbffe19852d02222b","language":"python","measured_fast_code_id":"80763d8bbf9160e605a9a5d877f1e2a5dd0cda59fe5c5e3bbffe19852d02222b","measured_slow_code_id":"61baf93eb941c46a29ae15eea5da6ae278cbf5a1e1d3cae98504f09eefb23457","measurement_metric":"cpu_instruction_count","pair_id":"python_cddd35637d03a8b6d91f3869","problem_id":"p02573","slow_code_id":"8e42dd739f11f939e13d222704f39ba6136c1588861267c41088dccb0e91dc37","slow_id":"p02573_61baf93eb941c46a29ae15eea5da6ae278cbf5a1e1d3cae98504f09eefb23457","speedup":2.0082232129420436,"stratum":"2-4","sampling_key":"6bb5c787e0a315efb114d6e7eb3d0cc285242031f84bfa9c3369f7fc72323eac","slow_code":"class UFTree:\n def __init__(self, N):\n self.nodes = [Node(i) for i in range(N)]\n self.N = N\n\n def find_max_child_num(self):\n result = 0\n for i in range(self.N):\n result = max(result, self.nodes[i].child_num)\n return result\n\n\nclass Node:\n def __init__(self, ID):\n self.ID = ID\n self.parent = None\n self.child_num = 0\n self.rank = 1\n\n def get_root(self):\n if self.parent is None:\n return self\n return self.parent.get_root()\n\n def is_in_same_tree(self, another):\n return self.get_root().ID == another.get_root().ID\n\n def concat(self, another):\n if self.is_in_same_tree(another):\n return\n sr = self.get_root()\n ar = another.get_root()\n if sr.rank > ar.rank:\n parent, child = sr, ar\n else:\n parent, child = ar, sr\n parent.child_num += child.child_num + 1\n parent.rank = max(parent.rank, child.rank + 1)\n child.parent = parent\n\n\nN, M = list(map(int, input().split()))\ntree = UFTree(N)\nAB = []\nfor i in range(M):\n l = list(map(int, input().split()))\n AB.append(l)\nfor i in range(M):\n a, b = AB[i][0], AB[i][1]\n a -= 1\n b -= 1\n tree.nodes[a].concat(tree.nodes[b])\n\n\nprint((tree.find_max_child_num() + 1))\n","fast_code":"import sys\n\ninput = sys.stdin.readline\nn, m = list(map(int, input().split()))\nes = [[] for _ in range(n)]\nfor i in range(m):\n a, b = list(map(int, input().split()))\n es[a - 1].append(b - 1)\n es[b - 1].append(a - 1)\nans = 0\nfrom collections import deque\n\nused = [0 for _ in range(n)]\nfor i in range(n):\n if used[i] == 0:\n d = deque([i])\n cnt = 0\n while d:\n now = d.popleft()\n cnt += 1\n used[now] = 1\n for e in es[now]:\n if used[e] == 0:\n used[e] = 1\n d.append(e)\n ans = max(cnt, ans)\nprint(ans)\n"} +{"fast_code_id":"0a4b743931f51015a53a8b68212086bf81fdde0f3ffc6ca14185f8e4075397cc","fast_id":"p02362_0a4b743931f51015a53a8b68212086bf81fdde0f3ffc6ca14185f8e4075397cc","language":"python","measured_fast_code_id":"0a4b743931f51015a53a8b68212086bf81fdde0f3ffc6ca14185f8e4075397cc","measured_slow_code_id":"d6cb17a39e8d47e829780362674fb799a70c7ec0318e8f73c0bd0b98feeddcea","measurement_metric":"cpu_instruction_count","pair_id":"python_ce30aea968a50b1d044db145","problem_id":"p02362","slow_code_id":"cdd2579d3060a2f75d6de6488415a4ad2843746f1234a7ee49a668cc4c29847e","slow_id":"p02362_d6cb17a39e8d47e829780362674fb799a70c7ec0318e8f73c0bd0b98feeddcea","speedup":4.282977320921786,"stratum":"4-8","sampling_key":"c72281cae59f3854a50854de1752c517385f3da8b1ad6391cce136f6b6c045dc","slow_code":"from collections import defaultdict, deque\nfrom heapq import heappush, heappop\nfrom sys import stdin\n\n\nclass UnionFindSet:\n def __init__(self, nodes):\n self.fa = {}\n for n in nodes:\n self.fa[n] = n\n\n def find(self, x):\n if self.fa[x] == x:\n return x\n else:\n self.fa[x] = self.find(self.fa[x])\n return self.fa[x]\n\n def union(self, x, y):\n fx = self.find(x)\n fy = self.find(y)\n if fx == fy:\n return fx\n else:\n self.fa[fx] = fy\n return fy\n\n\ndef kruscal(graph):\n ufset = UnionFindSet(graph[\"nodes\"])\n ret = 0\n for x, y, w in sorted(graph[\"edges\"], key=lambda x: x[-1]):\n fx = ufset.find(x)\n fy = ufset.find(y)\n if fx != fy:\n ret += w\n ufset.union(fx, fy)\n else:\n pass\n return ret\n\n\ndef dijkstra(graph, root):\n dis, vis = {}, {}\n for n in graph[\"nodes\"]:\n dis[n] = 10**9\n vis[n] = False\n heap = []\n dis[root] = 0\n heappush(heap, (0, root))\n while heap:\n _, n = heappop(heap)\n vis[n] = True\n for y, w in graph[\"adj\"][n]:\n if not vis[y] and dis[n] + w < dis[y]:\n dis[y] = dis[n] + w\n heappush(heap, (dis[y], y))\n return dis\n\n\ndef belmanFord(graph, root):\n dis = {}\n for n in graph[\"nodes\"]:\n dis[n] = 10**9\n dis[root] = 0\n\n for _ in range(len(graph[\"nodes\"]) - 1):\n for x, y, w in graph[\"edges\"]:\n if dis[x] + w < dis[y]:\n dis[y] = dis[x] + w\n connect = set([root])\n que = deque([root])\n while que:\n n = que.popleft()\n for y, _ in graph[\"adj\"][n]:\n if not y in connect:\n connect.add(y)\n que.append(y)\n dis[\"negcicle\"] = False\n for x, y, w in graph[\"edges\"]:\n if dis[x] + w < dis[y] and x in connect:\n dis[\"negcicle\"] = True\n dis[\"con\"] = connect\n return dis\n\n\nif __name__ == \"__main__\":\n V, E, root = list(map(int, stdin.readline().strip().split()))\n graph = {}\n graph[\"nodes\"] = [i for i in range(V)]\n graph[\"edges\"] = []\n graph[\"adj\"] = defaultdict(list)\n for _ in range(E):\n x, y, w = list(map(int, stdin.readline().strip().split()))\n graph[\"edges\"].append((x, y, w))\n graph[\"adj\"][x].append((y, w))\n dis = belmanFord(graph, root)\n if dis[\"negcicle\"]:\n print(\"NEGATIVE CYCLE\")\n else:\n for n in graph[\"nodes\"]:\n print(dis[n] if dis[n] < 10**9 and n in dis[\"con\"] else \"INF\")\n","fast_code":"import sys\n\nreadline = sys.stdin.readline\nV, E, r = list(map(int, readline().split()))\ninf = 10**10\nedges = [[] for _ in [None] * V]\nfor _ in [None] * E:\n s, t, d = list(map(int, readline().split()))\n edges[s].append((t, d))\n\n\ndef bellman_ford(n, edges, start):\n vertices = [inf] * n\n vertices[start] = 0\n reached = {start}\n for i in range(n):\n flag = 0\n for v in reached.copy():\n cost = vertices[v]\n for dist, _cost in edges[v]:\n newcost = cost + _cost\n if vertices[dist] > newcost:\n vertices[dist] = newcost\n reached.add(dist)\n flag = 1\n if flag == 0:\n return vertices\n else:\n return None\n\n\nresult = bellman_ford(V, edges, r)\nif result:\n print((\"\\n\".join([str(n) if n != inf else \"INF\" for n in result])))\nelse:\n print(\"NEGATIVE CYCLE\")\n"} +{"fast_code_id":"1acd7e8cc052d2c6b8f2adfe5f8999919939bdaf9300d0d26de99386fb0562e1","fast_id":"p02714_75b425abff2053c8b035e761155e48bbad26cdb1cf611e1382fb5ba2d858a726","language":"python","measured_fast_code_id":"75b425abff2053c8b035e761155e48bbad26cdb1cf611e1382fb5ba2d858a726","measured_slow_code_id":"329b15942111e48ba21aa4fa5898b0daadc6d2ead02a6a14ed26da0eb67b41ec","measurement_metric":"cpu_instruction_count","pair_id":"python_ce6c08bc9f35cd9f60c986c7","problem_id":"p02714","slow_code_id":"da713aaa394b9951921ebd958e2887baf9e88ebd0181739a1faba9c19b60964a","slow_id":"p02714_329b15942111e48ba21aa4fa5898b0daadc6d2ead02a6a14ed26da0eb67b41ec","speedup":3.577822307977083,"stratum":"2-4","sampling_key":"9a274439467912dfde7da27a01eb05eab4ed3059fdaaa496469cc20354906c85","slow_code":"from sys import stdin\nimport bisect\n\n\ndef main():\n\n readline = stdin.readline\n N = int(readline())\n S = readline().strip()\n res = 0\n R = []\n G = []\n B = []\n flags = [\"\"] * N\n for i in range(N):\n if S[i] == \"R\":\n R.append(i)\n flags[i] = \"R\"\n elif S[i] == \"G\":\n G.append(i)\n flags[i] = \"G\"\n else:\n B.append(i)\n flags[i] = \"B\"\n\n for i in range(len(R)):\n for j in range(len(G)):\n n = max(R[i], G[j])\n k = bisect.bisect_left(B, n)\n res += len(B) - k\n if n + n - min(R[i], G[j]) < N:\n if flags[n + n - min(R[i], G[j])] == \"B\":\n res -= 1\n for i in range(len(R)):\n for j in range(len(B)):\n n = max(R[i], B[j])\n k = bisect.bisect_left(G, n)\n res += len(G) - k\n if n + n - min(R[i], B[j]) < N:\n if flags[n + n - min(R[i], B[j])] == \"G\":\n res -= 1\n for i in range(len(B)):\n for j in range(len(G)):\n n = max(B[i], G[j])\n k = bisect.bisect_left(R, n)\n res += len(R) - k\n if n + n - min(B[i], G[j]) < N:\n if flags[n + n - min(B[i], G[j])] == \"R\":\n res -= 1\n print(res)\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"from collections import defaultdict\n\n\ndef main():\n _ = int(eval(input()))\n S = input().rstrip()\n indices = defaultdict(set)\n for i, c in enumerate(S):\n indices[c].add(i)\n cnt = len(indices[\"R\"]) * len(indices[\"G\"]) * len(indices[\"B\"])\n for c1, c2, c3 in [\"RGB\", \"GBR\", \"BRG\"]:\n cnt -= sum(\n (i + j) % 2 == 0 and (i + j) // 2 in indices[c3]\n for i in indices[c1]\n for j in indices[c2]\n )\n print(cnt)\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"680014ac22e5d4c6053b7f14622707d902b64052864c264832205bb1657d851e","fast_id":"p03575_680014ac22e5d4c6053b7f14622707d902b64052864c264832205bb1657d851e","language":"python","measured_fast_code_id":"680014ac22e5d4c6053b7f14622707d902b64052864c264832205bb1657d851e","measured_slow_code_id":"3b0c75c5164a810f84adc515ed302d05d4140b865ec422b1df702b4974d0a4da","measurement_metric":"cpu_instruction_count","pair_id":"python_ceaf0c01fae985501e8f069a","problem_id":"p03575","slow_code_id":"3b0c75c5164a810f84adc515ed302d05d4140b865ec422b1df702b4974d0a4da","slow_id":"p03575_3b0c75c5164a810f84adc515ed302d05d4140b865ec422b1df702b4974d0a4da","speedup":5.212972901458768,"stratum":"4-8","sampling_key":"35d2619162abcc88d535a98cc42028f7d9f591f70431b7a9063da9c9aef08518","slow_code":"import sys, re, os\nfrom collections import deque, defaultdict, Counter\nfrom math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians\nfrom itertools import permutations, combinations, product, accumulate\nfrom operator import itemgetter, mul\nfrom copy import deepcopy\nfrom string import ascii_lowercase, ascii_uppercase, digits\nfrom heapq import heapify, heappop, heappush\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef INT():\n return int(eval(input()))\n\n\ndef MAP():\n return list(map(int, input().split()))\n\n\ndef S_MAP():\n return list(map(str, input().split()))\n\n\ndef LIST():\n return list(map(int, input().split()))\n\n\ndef S_LIST():\n return list(map(str, input().split()))\n\n\nsys.setrecursionlimit(10**9)\nINF = float(\"inf\")\nmod = 10**9 + 7\n\n\ndef dijkstra(E, start):\n N_d = len(E)\n dist = [INF] * N_d\n dist[start] = 0\n q = [(0, start)]\n while q:\n dist_v, v = heappop(q)\n if dist[v] != dist_v:\n continue\n for u, dist_vu in E[v]:\n dist_u = dist_v + dist_vu\n if dist_u < dist[u]:\n dist[u] = dist_u\n heappush(q, (dist_u, u))\n return dist\n\n\nN, M = MAP()\nL = [LIST() for i in range(M)]\ngraph = defaultdict(list)\nfor a, b in L:\n graph[a - 1].append((b - 1, 1))\n graph[b - 1].append((a - 1, 1))\nans = 0\nfor i in range(M):\n a, b = L[i]\n E = deepcopy(graph)\n E[a - 1].remove((b - 1, 1))\n E[b - 1].remove((a - 1, 1))\n dist = dijkstra(E, 0)\n if dist.count(INF) > 0:\n ans += 1\nprint(ans)\n","fast_code":"import sys\n\ninput = lambda: sys.stdin.readline().rstrip()\nn, m = list(map(int, input().split()))\n\n\ndef find(x):\n if par[x] < 0:\n return x\n else:\n par[x] = find(par[x])\n return par[x]\n\n\ndef unite(x, y):\n x = find(x)\n y = find(y)\n if x == y:\n return False\n else:\n if par[x] > par[y]:\n x, y = y, x\n par[x] += par[y]\n par[y] = x\n return True\n\n\ndef same(x, y):\n return find(x) == find(y)\n\n\ndef size(x):\n return -par[find(x)]\n\n\nAB = []\nfor i in range(m):\n AB.append(tuple(int(i) for i in input().split()))\nans = 0\nfor i in range(m):\n par = [-1] * n\n for j in range(m):\n if j == i:\n continue\n else:\n a, b = AB[j]\n unite(a - 1, b - 1)\n for i in range(n):\n find(i)\n if -min(par) < n:\n ans += 1\nprint(ans)\n"} +{"fast_code_id":"72619107eb329b54610e4085498f85cee6d80295e93784b7b4dded26629f06a8","fast_id":"p02712_72619107eb329b54610e4085498f85cee6d80295e93784b7b4dded26629f06a8","language":"python","measured_fast_code_id":"72619107eb329b54610e4085498f85cee6d80295e93784b7b4dded26629f06a8","measured_slow_code_id":"59fdf1e7f42da4920689437ba15d9323b5d573a0e3c1f9dcf35ef6f2509e1c48","measurement_metric":"cpu_instruction_count","pair_id":"python_ceb3bc4be66a8b7f5796fc87","problem_id":"p02712","slow_code_id":"59fdf1e7f42da4920689437ba15d9323b5d573a0e3c1f9dcf35ef6f2509e1c48","slow_id":"p02712_59fdf1e7f42da4920689437ba15d9323b5d573a0e3c1f9dcf35ef6f2509e1c48","speedup":313.357165922996,"stratum":"8+","sampling_key":"0a1e113bc353dc9d8911bf61ce2c3fbb1a09892521d900fef96bf667dde58896","slow_code":"n = int(eval(input()))\nn = list(range(1, n + 1))\nn = [i for i in n if i % 3 != 0]\nn = [i for i in n if i % 5 != 0]\nprint((sum(n)))\n","fast_code":"N = int(eval(input()))\ntotal = int(1 / 2 * N * (N + 1))\nwa3 = (N // 3 * (N // 3 + 1)) // 2 * 3\nwa5 = (N // 5 * (N // 5 + 1)) // 2 * 5\nwa15 = (N // 15 * (N // 15 + 1)) // 2 * 15\nprint((total - wa3 - wa5 + wa15))\n"} +{"fast_code_id":"609aaacbc3ca3a070f6d10f1764a4fe238bfcc0848f58c3e30360e8ac581ed62","fast_id":"p03636_609aaacbc3ca3a070f6d10f1764a4fe238bfcc0848f58c3e30360e8ac581ed62","language":"python","measured_fast_code_id":"609aaacbc3ca3a070f6d10f1764a4fe238bfcc0848f58c3e30360e8ac581ed62","measured_slow_code_id":"5494f91b3cea4c891c6cbf71fe983d4d33ab7f0ec16a1291db2cdbe427651f21","measurement_metric":"cpu_instruction_count","pair_id":"python_cef5400e1f8d143614253fe0","problem_id":"p03636","slow_code_id":"da6dc96aa5d834038d28d109d605a384e0fe4a59a283760b08b599d7fd1f90de","slow_id":"p03636_5494f91b3cea4c891c6cbf71fe983d4d33ab7f0ec16a1291db2cdbe427651f21","speedup":4.523517661140319,"stratum":"4-8","sampling_key":"74a1e9f2e30da9f4f66debccb7dd5c88f1a5140dc904a6689d02a0d5b3cfde27","slow_code":"import sys\n\nsys.setrecursionlimit(10**7)\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef LI2():\n return list(map(int, sys.stdin.readline().rstrip()))\n\n\ndef S():\n return sys.stdin.readline().rstrip()\n\n\ndef LS():\n return list(sys.stdin.readline().rstrip().split())\n\n\ndef LS2():\n return list(sys.stdin.readline().rstrip())\n\n\ns = LS2()\nprint((s[0] + str(len(s) - 2) + s[-1]))\n","fast_code":"a, *b, c = input()\nprint(a, len(b), c, sep=\"\")\n"} +{"fast_code_id":"86a21b0905ddb20de2f64b0cf00ce0c21b9102791dca67a15152f0feda53accb","fast_id":"p03288_86a21b0905ddb20de2f64b0cf00ce0c21b9102791dca67a15152f0feda53accb","language":"python","measured_fast_code_id":"86a21b0905ddb20de2f64b0cf00ce0c21b9102791dca67a15152f0feda53accb","measured_slow_code_id":"4b19a6c66c6b24c9d371f629b6a683da99f61809c1d26fcff1386ca6548060d5","measurement_metric":"cpu_instruction_count","pair_id":"python_cf1a2e92e8e82a437cf68141","problem_id":"p03288","slow_code_id":"4b19a6c66c6b24c9d371f629b6a683da99f61809c1d26fcff1386ca6548060d5","slow_id":"p03288_4b19a6c66c6b24c9d371f629b6a683da99f61809c1d26fcff1386ca6548060d5","speedup":24.804444500448906,"stratum":"8+","sampling_key":"1ee2f1ab79976c4a71250d3a621618becb194890b193c9e8e2156618bff2b21f","slow_code":"import bisect, collections, copy, heapq, itertools, math, string\nimport sys\n\n\ndef S():\n return sys.stdin.readline().rstrip()\n\n\ndef M():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef LS():\n return list(sys.stdin.readline().rstrip().split())\n\n\nR = I()\nif R < 1200:\n print(\"ABC\")\nelif R < 2800:\n print(\"ARC\")\nelse:\n print(\"AGC\")\n","fast_code":"import sys\n\nri = lambda: int(sys.stdin.readline())\na = ri()\nif a < 1200:\n print(\"ABC\")\nelif a < 2800:\n print(\"ARC\")\nelse:\n print(\"AGC\")\n"} +{"fast_code_id":"4be88f64ca664c2eac79251ecb1a1e87d14707dab8d2ff3d5c3c0cfb067c5fc2","fast_id":"p03147_4be88f64ca664c2eac79251ecb1a1e87d14707dab8d2ff3d5c3c0cfb067c5fc2","language":"python","measured_fast_code_id":"4be88f64ca664c2eac79251ecb1a1e87d14707dab8d2ff3d5c3c0cfb067c5fc2","measured_slow_code_id":"b1e792dd3810c963171d990481698db953df4fbba41e2b1cb8b22991f36b26d4","measurement_metric":"cpu_instruction_count","pair_id":"python_cf68c12702de4f682444b201","problem_id":"p03147","slow_code_id":"b1e792dd3810c963171d990481698db953df4fbba41e2b1cb8b22991f36b26d4","slow_id":"p03147_b1e792dd3810c963171d990481698db953df4fbba41e2b1cb8b22991f36b26d4","speedup":6.827921040771541,"stratum":"4-8","sampling_key":"03ffb8ffc7076d8982f2910263f9fe91ce3e8bb33d7756e578f28cc773689632","slow_code":"N = int(eval(input()))\nh = list(map(int, input().split()))\nans = 0\ni = 0\nwhile i < N:\n while h[i] == 0:\n i += 1\n if i == N:\n break\n j = i\n if i == N:\n break\n while h[j] > 0:\n h[j] -= 1\n j += 1\n if j == N:\n break\n ans += 1\nprint(ans)\n","fast_code":"n = int(eval(input()))\nh = list(map(int, input().split()))\nans = h[0]\nfor i in range(1, n):\n if h[i] > h[i - 1]:\n ans += h[i] - h[i - 1]\nprint(ans)\n"} +{"fast_code_id":"78195a2740d448817b390133128ddb97072787be3c728274df837dfcfab111dc","fast_id":"p02948_78195a2740d448817b390133128ddb97072787be3c728274df837dfcfab111dc","language":"python","measured_fast_code_id":"78195a2740d448817b390133128ddb97072787be3c728274df837dfcfab111dc","measured_slow_code_id":"fe7802b8128b6ff2f5d5f284b0cd0e9663cbc9b92a6886cda80720b8fe77987a","measurement_metric":"cpu_instruction_count","pair_id":"python_cf74abb957ce0971dd51218a","problem_id":"p02948","slow_code_id":"fe7802b8128b6ff2f5d5f284b0cd0e9663cbc9b92a6886cda80720b8fe77987a","slow_id":"p02948_fe7802b8128b6ff2f5d5f284b0cd0e9663cbc9b92a6886cda80720b8fe77987a","speedup":2.187102830113487,"stratum":"2-4","sampling_key":"4dcd2dbd5fa4f8b435101dbd45861959ecf0600fb3e55fded3f8ad95b53296d2","slow_code":"from heapq import *\n\n(n, m), *t = [list(map(int, s.split())) for s in open(0)]\nq = [0] * 7**6\nv = [[] for _ in q]\nz = 0\nfor a, b in t:\n v[a - 1] += [b]\nfor i in v[:m]:\n for j in i:\n heappush(q, -j)\n z -= heappop(q)\nprint(z)\n","fast_code":"from heapq import *\n\nN, M, *t = list(map(int, open(0).read().split()))\nv = [[] for _ in \"_\" * M]\nz = i = 0\nfor _ in \"_\" * N:\n M < t[i] or v[t[i] - 1].append(t[i + 1])\n i += 2\nq = []\nfor i in v:\n for j in i:\n heappush(q, -j)\n z -= len(q) and heappop(q)\nprint(z)\n"} +{"fast_code_id":"8eee5876adb81ae42ad96b3317874379ed91dc38265c72d607658861316866dc","fast_id":"p03018_8eee5876adb81ae42ad96b3317874379ed91dc38265c72d607658861316866dc","language":"python","measured_fast_code_id":"8eee5876adb81ae42ad96b3317874379ed91dc38265c72d607658861316866dc","measured_slow_code_id":"34cfcb0cd806549d9de932b7805e60b0300ac48d582c70a3b82e9e63ed79dbe3","measurement_metric":"cpu_instruction_count","pair_id":"python_cfbd7222a1e05b3b4e40b38c","problem_id":"p03018","slow_code_id":"2a81960ac1f47336dbb6ad3e8a3b063f1f7be21a97a77ab30f5ed64ce398f2f3","slow_id":"p03018_34cfcb0cd806549d9de932b7805e60b0300ac48d582c70a3b82e9e63ed79dbe3","speedup":3.115635809768806,"stratum":"2-4","sampling_key":"3ff41770d0dc53af128627b8779e77dda09e106b483945d1ef2adb571f2dfd66","slow_code":"import sys\n\nstdin = sys.stdin\nri = lambda: int(rs())\nrl = lambda: list(map(int, stdin.readline().split()))\nrs = lambda: stdin.readline().rstrip()\nS = list(rs())\ncur = \"D\"\nanswer = 0\nA_cnt = 0\nfor s in S:\n if cur == \"A\":\n if s == \"A\":\n A_cnt += 1\n elif s == \"B\":\n cur = s\n else:\n cur = \"D\"\n A_cnt = 0\n elif cur == \"B\":\n if s == \"A\":\n A_cnt = 1\n cur = s\n elif s == \"B\":\n A_cnt = 0\n cur = \"D\"\n elif s == \"C\":\n answer += A_cnt\n cur = s\n else:\n cur = \"D\"\n A_cnt = 0\n elif cur == \"C\":\n if s == \"A\":\n A_cnt += 1\n cur = s\n elif s == \"B\":\n cur = s\n else:\n cur = \"D\"\n A_cnt = 0\n else:\n if s == \"A\":\n A_cnt += 1\n cur = s\n else:\n A_cnt = 0\n cur = \"D\"\nprint(answer)\n","fast_code":"def main():\n S = input().replace(\"BC\", \"1\")\n ans = 0\n a = 0\n for s in S:\n if s == \"A\":\n a += 1\n elif s == \"1\":\n ans += a\n else:\n a = 0\n print(ans)\n\n\nmain()\n"} +{"fast_code_id":"e402cf8b709f4d4bd0675c325db77e47f7b2a6cb9e29edbcfebdf8e91b6449a7","fast_id":"p03608_e402cf8b709f4d4bd0675c325db77e47f7b2a6cb9e29edbcfebdf8e91b6449a7","language":"python","measured_fast_code_id":"e402cf8b709f4d4bd0675c325db77e47f7b2a6cb9e29edbcfebdf8e91b6449a7","measured_slow_code_id":"a6ba7a6e457f7223737377dc74c3739f39a6faf8bc7e129d3e4d82875673c6ae","measurement_metric":"cpu_instruction_count","pair_id":"python_cfbdfd0208decd9fb275d33c","problem_id":"p03608","slow_code_id":"f19f2c009c893dde042476371af37c34ea12cfaa23ea63baa86f7c5a07cc08fe","slow_id":"p03608_a6ba7a6e457f7223737377dc74c3739f39a6faf8bc7e129d3e4d82875673c6ae","speedup":4.149568360815874,"stratum":"4-8","sampling_key":"948826b1b2990a7b080a85c3a1b3886fa6ef91b2a41116e117696fc6e803e4d4","slow_code":"n, m, r = list(map(int, input().split()))\nrs = list(map(int, input().split()))\n\nimport numpy as np\n\ndists = np.ones((n + 1, n + 1)) * float(\"inf\")\nfor _ in range(m):\n a, b, c = list(map(int, input().split()))\n dists[a, b] = dists[b, a] = c\nfor i in range(1, n + 1):\n dists[i, i] = 0\nfrom itertools import product, permutations\n\nfor i, j in product(list(range(1, 1 + n)), repeat=2):\n dists[j] = np.minimum(dists[j], dists[i] + dists[j, i])\nans = float(\"inf\")\nfor path in permutations(rs):\n val = sum(dists[i, j] for i, j in zip(path, path[1:]))\n val = int(val)\n if val < ans:\n ans = val\nprint(ans)\n","fast_code":"import itertools\n\nINF = float(\"inf\")\n\n\ndef main():\n N, M, R = list(map(int, input().split()))\n r = list(map(int, input().split()))\n path = [[INF] * (N + 1) for _ in range(N + 1)]\n for _ in range(M):\n A, B, C = list(map(int, input().split()))\n path[A][B] = C\n path[B][A] = C\n for i in range(1, N + 1):\n path[i][i] = 0\n for i in range(1, N + 1):\n for j in range(1, N + 1):\n for k in range(1, N + 1):\n path[j][k] = min(path[j][k], path[j][i] + path[i][k])\n ans = INF\n for p in itertools.permutations(r):\n cost = 0\n for i in range(R - 1):\n cost += path[p[i]][p[i + 1]]\n ans = min(ans, cost)\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"6cd535b402de6ec9bdfbb998853e9e2b71705be96d70117ffc06e717a6a5fda8","fast_id":"p02706_6cd535b402de6ec9bdfbb998853e9e2b71705be96d70117ffc06e717a6a5fda8","language":"python","measured_fast_code_id":"6cd535b402de6ec9bdfbb998853e9e2b71705be96d70117ffc06e717a6a5fda8","measured_slow_code_id":"89bf5646ac16bde646209d2509249ed7377541f5a03b9f9c5553553af3b07c63","measurement_metric":"cpu_instruction_count","pair_id":"python_d041ed0933ea47628befb6aa","problem_id":"p02706","slow_code_id":"89bf5646ac16bde646209d2509249ed7377541f5a03b9f9c5553553af3b07c63","slow_id":"p02706_89bf5646ac16bde646209d2509249ed7377541f5a03b9f9c5553553af3b07c63","speedup":167.93026558501714,"stratum":"8+","sampling_key":"0bc94c9ebd8166b682ea1e5627ebb4ff3b14b6b5a7f5ffa69b6c4a0614f673cd","slow_code":"import numpy as np\nimport math\n\nn, m = list(map(int, input().split()))\nA = list(map(int, input().split()))\na = sum(A)\nif n < a:\n print((-1))\nelse:\n print((n - a))\n","fast_code":"n, m = list(map(int, input().split(\" \")))\na = list(map(int, input().split(\" \")))\nasum = sum(a)\nif (n - asum) < 0:\n print(\"-1\")\nelse:\n print((n - asum))\n"} +{"fast_code_id":"20fe085db322ba70d10e68f89404750173ced5521fd05b3ed343af82cc95a436","fast_id":"p02956_98847dc745804ffedc68345a7f72ee0f29ec77de07b77102351ea8d26538f18c","language":"python","measured_fast_code_id":"98847dc745804ffedc68345a7f72ee0f29ec77de07b77102351ea8d26538f18c","measured_slow_code_id":"5fb4e470bffee1e77fe67869002cfa051bc0f9ceb4f803ffff28bd835f4edb34","measurement_metric":"cpu_instruction_count","pair_id":"python_d07d037a55ad652658c59c04","problem_id":"p02956","slow_code_id":"5fb4e470bffee1e77fe67869002cfa051bc0f9ceb4f803ffff28bd835f4edb34","slow_id":"p02956_5fb4e470bffee1e77fe67869002cfa051bc0f9ceb4f803ffff28bd835f4edb34","speedup":2.6124307566556464,"stratum":"2-4","sampling_key":"63cfc8c53fe49e1114b898a3203b105eba3be37824efc49a540dae732509e1da","slow_code":"import sys, queue, math, copy, itertools, bisect, collections, heapq\n\n\ndef main():\n MOD = 998244353\n LI = lambda: [int(x) for x in sys.stdin.readline().split()]\n NI = lambda: int(sys.stdin.readline())\n N = NI()\n dat = [LI() for _ in range(N)]\n dat.sort()\n yo = [y for _, y in dat]\n yo.sort()\n up = [0] * N\n dw = [0] * N\n bit = [0] * (N + 1)\n\n def bit_add(i):\n while i <= N:\n bit[i] += 1\n i += i & -i\n\n def bit_sum(i):\n ret = 0\n while i > 0:\n ret += bit[i]\n i -= i & -i\n return ret\n\n for i in range(N):\n x, y = dat[i]\n y = bisect.bisect_left(yo, y) + 1\n up[i] = bit_sum(y)\n bit_add(y)\n bit = [0] * (N + 1)\n for i in range(N - 1, -1, -1):\n x, y = dat[i]\n y = bisect.bisect_left(yo, y) + 1\n dw[i] = bit_sum(y)\n bit_add(y)\n ans = N * pow(2, N - 1, MOD)\n for i in range(N):\n a = i - up[i]\n b = up[i]\n c = N - (i + 1) - dw[i]\n d = dw[i]\n pa = pow(2, a, MOD)\n pb = pow(2, b, MOD)\n pc = pow(2, c, MOD)\n pd = pow(2, d, MOD)\n p = (pow(2, a + d, MOD) - 1) - (pa - 1) - (pd - 1)\n q = (pow(2, b + c, MOD) - 1) - (pb - 1) - (pc - 1)\n x = p * (pb + pc - 1)\n y = q * (pa + pd - 1)\n z = p * q\n ans = (ans + x + y + z) % MOD\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"import sys\n\ninput = sys.stdin.readline\nsys.setrecursionlimit(10**7)\nMOD = 998244353\nN = int(eval(input()))\nXY = [[int(x) for x in input().split()] for _ in range(N)]\nXY.sort()\nX, Y = list(zip(*XY))\nY_rank = {x: i for i, x in enumerate(sorted(Y), 1)}\n\n\ndef BIT_update(tree, x):\n while x <= N:\n tree[x] += 1\n x += x & (-x)\n\n\ndef BIT_sum(tree, x):\n ret = 0\n while x:\n ret += tree[x]\n x -= x & (-x)\n return ret\n\n\npow2 = [1]\nfor _ in range(N):\n pow2.append(pow2[-1] * 2 % MOD)\nanswer = 0\ntree = [0] * (N + 1)\nfor L, (x, y) in enumerate(XY):\n y = Y_rank[y]\n R = N - 1 - L\n D = y - 1\n U = N - 1 - D\n LD = BIT_sum(tree, y)\n BIT_update(tree, y)\n LU = L - LD\n RD = D - LD\n RU = R - RD\n\n cnt = pow2[N]\n cnt -= pow2[L]\n cnt -= pow2[R]\n cnt -= pow2[D]\n cnt -= pow2[U]\n cnt += pow2[LD]\n cnt += pow2[LU]\n cnt += pow2[RD]\n cnt += pow2[RU]\n cnt -= 1\n answer += cnt\nanswer %= MOD\nprint(answer)\n"} +{"fast_code_id":"498a95f0d8a1a94709cf73302cdd31345e5afd389407b78c00aaa6afa7c4a0bf","fast_id":"p02707_498a95f0d8a1a94709cf73302cdd31345e5afd389407b78c00aaa6afa7c4a0bf","language":"python","measured_fast_code_id":"498a95f0d8a1a94709cf73302cdd31345e5afd389407b78c00aaa6afa7c4a0bf","measured_slow_code_id":"3be6889cc1da356348ac3376a8ed377db1511d6ce756e917ddc4f3cacad06f9f","measurement_metric":"cpu_instruction_count","pair_id":"python_d07fd79c6ee8382acbd05bc5","problem_id":"p02707","slow_code_id":"87d845843925bd36d2bcc668988b66897308640bf2bd99fe70876b0c70842fff","slow_id":"p02707_3be6889cc1da356348ac3376a8ed377db1511d6ce756e917ddc4f3cacad06f9f","speedup":2.369244429174456,"stratum":"2-4","sampling_key":"6aa89c49543933624885e05cdc64368f02d40aa9b1df78e862a6d2a52a805ee5","slow_code":"import sys\nfrom collections import *\nimport heapq\nimport math\nfrom math import gcd\nimport bisect\nimport copy\nfrom itertools import permutations, accumulate, combinations, product\n\n\ndef input():\n return sys.stdin.readline()[:-1]\n\n\ndef ruiseki(lst):\n return [0] + list(accumulate(lst))\n\n\nmod = pow(10, 9) + 7\nal = [chr(ord(\"a\") + i) for i in range(26)]\ndirection = [[1, 0], [0, 1], [-1, 0], [0, -1]]\nn = int(eval(input()))\na = list(map(int, input().split()))\nlst = [0] * n\nfor i in range(n - 1):\n lst[a[i] - 1] += 1\n\nfor i in range(n):\n print((lst[i]))\n","fast_code":"num = int(eval(input()))\nboss = input().split()\nans_list = [0] * num\nfor i_boss in boss:\n ans_list[int(i_boss) - 1] += 1\na = list([str(x) for x in ans_list])\nprint((\"\\n\".join(a)))\n"} +{"fast_code_id":"e1d9e340d852a03ca46be152e59b5f3462bc58905e10c303457409383d0cf1e5","fast_id":"p02783_e1d9e340d852a03ca46be152e59b5f3462bc58905e10c303457409383d0cf1e5","language":"python","measured_fast_code_id":"e1d9e340d852a03ca46be152e59b5f3462bc58905e10c303457409383d0cf1e5","measured_slow_code_id":"d5fe1e3cebc325b88118764de6cebe3ff7e094ae5446fe951fc1767a79f70b68","measurement_metric":"cpu_instruction_count","pair_id":"python_d0cc96be93b0c55b428c4833","problem_id":"p02783","slow_code_id":"d5fe1e3cebc325b88118764de6cebe3ff7e094ae5446fe951fc1767a79f70b68","slow_id":"p02783_d5fe1e3cebc325b88118764de6cebe3ff7e094ae5446fe951fc1767a79f70b68","speedup":82.8810293699157,"stratum":"8+","sampling_key":"83051c1832369e9319f9a8be89da61dd4f0cbb4a46f855802ea812c764651ada","slow_code":"import sys\nimport socket\n\nhostname = socket.gethostname()\nif hostname == \"F451C\":\n sys.stdin = open(\"a1.in\")\n\n\ndef read_int_list():\n return list(map(int, input().split()))\n\n\ndef read_str_list():\n return input().split()\n\n\ndef read_int():\n return int(eval(input()))\n\n\ndef read_str():\n return eval(input())\n\n\ndef main_0():\n H, A = read_int_list()\n res = 0\n for i in range(10001):\n H = H - A\n res += 1\n if H <= 0:\n break\n print(res)\n\n\ndef main_1():\n H, A = read_int_list()\n res = H // A\n if H % A != 0:\n res += 1\n print(res)\n\n\ndef main():\n H, A = read_int_list()\n res = 0\n while H > 0:\n H -= A\n res += 1\n print(res)\n\n\nmain()\n","fast_code":"print((-eval(input().replace(\" \", \"//-\"))))\n"} +{"fast_code_id":"ab56f7327b53cd8c27466446cef94a71f8037fd7587c25056984f4299da22f4f","fast_id":"p03609_ab56f7327b53cd8c27466446cef94a71f8037fd7587c25056984f4299da22f4f","language":"python","measured_fast_code_id":"ab56f7327b53cd8c27466446cef94a71f8037fd7587c25056984f4299da22f4f","measured_slow_code_id":"a299dbf158d9b4197e8d6e9bc8a56f5dae0f1a29a154060b4dbf82a91b0fb59c","measurement_metric":"cpu_instruction_count","pair_id":"python_d13373448ada6d0c59a6e0b5","problem_id":"p03609","slow_code_id":"a299dbf158d9b4197e8d6e9bc8a56f5dae0f1a29a154060b4dbf82a91b0fb59c","slow_id":"p03609_a299dbf158d9b4197e8d6e9bc8a56f5dae0f1a29a154060b4dbf82a91b0fb59c","speedup":2311.6010968011524,"stratum":"8+","sampling_key":"2f52f9566e38a7d1b16bd6dd95e58a24a6016c904b04df6092d8785e33f3bc73","slow_code":"import numpy as np\n\nx, t = list(map(int, input().split()))\nprint((np.max(np.array([x - t, 0]))))\n","fast_code":"a, b = list(map(int, input().split()))\nprint((max(a - b, 0)))\n"} +{"fast_code_id":"d272bd390da93e5342e0f26f50ec6104e53a22ae1e5dc017b987c67b2d250a5c","fast_id":"p02935_9e7e208106351a07dd291fe6f15b34e49212e19e2b89ac1aa53abbfd73bacd8b","language":"python","measured_fast_code_id":"9e7e208106351a07dd291fe6f15b34e49212e19e2b89ac1aa53abbfd73bacd8b","measured_slow_code_id":"469a8dbe0d6e33ac7f370cd3ccb58bdf599ddcbe6d94e7cc5a7cde68de5db05a","measurement_metric":"cpu_instruction_count","pair_id":"python_d177a5024028781635714781","problem_id":"p02935","slow_code_id":"f9cf033ef3320a5fdaabd7fadad3d7ff479bba43226bb8f92e09489a3fd88f4d","slow_id":"p02935_469a8dbe0d6e33ac7f370cd3ccb58bdf599ddcbe6d94e7cc5a7cde68de5db05a","speedup":708.8971583985787,"stratum":"8+","sampling_key":"32bbde4bc1d3e6058d0d06bdf1b7cefd64902f48d01f42ffe0a128f06e5cb4ca","slow_code":"import numpy as np\n\nN = int(eval(input()))\nstr_list = input().split(\" \")\nA = [int(x) for x in str_list]\nA = np.array(A)\nwhile len(A) > 1:\n first_min = A[A.argmin()]\n\n A = np.delete(A, A.argmin())\n second_min = A[A.argmin()]\n\n A = np.delete(A, A.argmin())\n mean = (first_min + second_min) / 2.0\n A = np.append(A, mean)\n\nprint(mean)\n","fast_code":"from sys import stdin, setrecursionlimit\n\n\nsetrecursionlimit(10**6)\ninput = stdin.readline\nn = int(eval(input()))\na = sorted([int(i) for i in input().split()])\nans = (a[0] + a[1]) / 2\nfor i in range(2, n):\n ans = (ans + a[i]) / 2\nprint(ans)\n"} +{"fast_code_id":"ee788620a526aa607e4ae96784ce1c061a1220a5076476586dd1c067846bce28","fast_id":"p03274_ee788620a526aa607e4ae96784ce1c061a1220a5076476586dd1c067846bce28","language":"python","measured_fast_code_id":"ee788620a526aa607e4ae96784ce1c061a1220a5076476586dd1c067846bce28","measured_slow_code_id":"15cce6db7bc6d79dcd48950e05503001080b8e54791a05cbcc84aecc1f823153","measurement_metric":"cpu_instruction_count","pair_id":"python_d1ff623b237e881798faeb0e","problem_id":"p03274","slow_code_id":"15cce6db7bc6d79dcd48950e05503001080b8e54791a05cbcc84aecc1f823153","slow_id":"p03274_15cce6db7bc6d79dcd48950e05503001080b8e54791a05cbcc84aecc1f823153","speedup":3.82118352570988,"stratum":"2-4","sampling_key":"cabee43192b25199f102857144cc90fda334883335df93cbc8b35d0a84de5cc0","slow_code":"import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time\n\nsys.setrecursionlimit(10**7)\ninf = 10**20\nmod = 10**9 + 7\n\n\ndef LI():\n return list(map(int, input().split()))\n\n\ndef I():\n return int(eval(input()))\n\n\ndef LS():\n return input().split()\n\n\ndef S():\n return eval(input())\n\n\ndef main():\n n, k = LI()\n l = LI()\n mn = inf\n for i in range(n - k + 1):\n a = l[i]\n b = l[i + k - 1]\n if a < 0 and b > 0:\n mn = min([mn, abs(a) + abs(b) * 2, abs(a) * 2 + abs(b)])\n else:\n mn = min(mn, max(abs(a), abs(b)))\n return mn\n\n\nprint((main()))\n","fast_code":"n, k = list(map(int, input().split()))\nx = list(map(int, input().split()))\nans = []\nfor i in range(n - k + 1):\n left = x[i]\n right = x[i + k - 1]\n ans.append(min(abs(left) + abs(right - left), abs(right) + abs(left - right)))\nprint((min(ans)))\n"} +{"fast_code_id":"c5dab9e03ff784c04c40588c029e44e112920a371722ed385bc1c8e4cce06aa5","fast_id":"p03222_c5dab9e03ff784c04c40588c029e44e112920a371722ed385bc1c8e4cce06aa5","language":"python","measured_fast_code_id":"c5dab9e03ff784c04c40588c029e44e112920a371722ed385bc1c8e4cce06aa5","measured_slow_code_id":"a167fb2840bdcc6405e113c019a821d25f7acfa038b67804c34bff12a9edb446","measurement_metric":"cpu_instruction_count","pair_id":"python_d22adbc39a976f0a7a929faf","problem_id":"p03222","slow_code_id":"a167fb2840bdcc6405e113c019a821d25f7acfa038b67804c34bff12a9edb446","slow_id":"p03222_a167fb2840bdcc6405e113c019a821d25f7acfa038b67804c34bff12a9edb446","speedup":187.9843368931874,"stratum":"8+","sampling_key":"22fcb64175944c7b93bd4cdf43976d8103c9b786dd92f439896f464a0d32fe27","slow_code":"import sys\n\nmod = pow(10, 9) + 7\n\n\ndef mul(a, b):\n return ((a % mod) * (b % mod)) % mod\n\n\ndef cmb(n, r, mod):\n if r < 0 or r > n:\n return 0\n r = min(r, n - r)\n return g1[n] * g2[r] * g2[n - r] % mod\n\n\nNNN = (10**5) * 2\ng1 = [1, 1]\ng2 = [1, 1]\ninverse = [0, 1]\nfor i in range(2, NNN + 1):\n g1.append((g1[-1] * i) % mod)\n inverse.append((-inverse[mod % i] * (mod // i)) % mod)\n g2.append((g2[-1] * inverse[-1]) % mod)\n\n\ndef erabu(aW):\n r = 0\n for i in range(aW // 2 + 1 + 1):\n sp = aW - (2 * i - 1)\n r += cmb(sp + i + 1 - 1, sp, mod)\n return r\n\n\nN, W, K = [int(x) for x in input().strip().split(\" \")]\nhasi = 0\ncc = []\nif W == 1:\n if K == 1:\n print((1))\n else:\n print((0))\n sys.exit()\nelif W == 2:\n cccl = [1, 1]\n cc = [1, 1]\nelif W == 3:\n cccl = [1, 1, 1]\n cc = [2, 1, 2]\nelif W >= 4:\n aW = W - 1\n hW = aW - 2\n nhW = aW - 3\n cc = []\n cccl = []\n for w in range(W):\n nn = max(W - 1 - w - 1, 0)\n nnn = max((W - 1) - nn - 2, 0)\n if w == W - 1:\n nnn += 1\n cc.append(erabu(nn) * erabu(nnn))\n cccl.append(erabu(nn) * erabu(nnn - 1))\ncccl[0] = 0\ncccr = cccl[::-1]\nd = [1] + [0 for x in range(W - 1)]\nfor i in range(N):\n newd = []\n for j in range(W):\n newd.append(0)\n if j != 0:\n newd[j] = (newd[j] + (d[j - 1] * cccl[j])) % mod\n if j != W - 1:\n newd[j] = (newd[j] + (d[j + 1] * cccr[j])) % mod\n newd[j] = (newd[j] + (d[j] * cc[j])) % mod\n d = newd[:]\nprint((d[K - 1]))\n","fast_code":"h, w, k = list(map(int, input().split()))\ndp = [0] * w\nmod = 10**9 + 7\ncomb = []\nfor bit in range(1 << w - 1):\n ok = True\n for j in range(w - 2):\n if bit >> j & 1 and bit >> j + 1 & 1:\n ok = False\n if ok:\n comb.append(bit)\ndp[0] = 1\nfor i in range(h):\n next = [0] * w\n for bit in comb:\n moved = [False] * w\n for j in range(w):\n if bit >> j & 1:\n next[j + 1] += dp[j]\n next[j] += dp[j + 1]\n moved[j] = moved[j + 1] = True\n elif not moved[j]:\n next[j] += dp[j]\n dp = next\nprint((dp[k - 1] % mod))\n"} +{"fast_code_id":"a41c0f5ce6fb7310cad09179075a7a5c3c044cf70990259800478d19339156e1","fast_id":"p02675_a41c0f5ce6fb7310cad09179075a7a5c3c044cf70990259800478d19339156e1","language":"python","measured_fast_code_id":"a41c0f5ce6fb7310cad09179075a7a5c3c044cf70990259800478d19339156e1","measured_slow_code_id":"2d3c735c213ec81bc8c26091e19ebd8461e366cff4fed305d8b06c8c2e49be9d","measurement_metric":"cpu_instruction_count","pair_id":"python_d247e6b64bfc86dc3204d147","problem_id":"p02675","slow_code_id":"da5a21f4ebfb4d44ad88c7f5db5f559a60e0742e11d07068514eea6e5e1d7a49","slow_id":"p02675_2d3c735c213ec81bc8c26091e19ebd8461e366cff4fed305d8b06c8c2e49be9d","speedup":7.216380766479004,"stratum":"4-8","sampling_key":"593ac346450841dd7161d560f3ee3839d0e3c154146e70fc17a653f8f89884fb","slow_code":"import sys\nimport math\nimport collections\nimport itertools\nimport bisect\n\nINF = 10**13\nMOD = 10**9 + 7\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef gcd(x, y):\n return x if y == 0 else gcd(y, x % y)\n\n\ndef lcm(x, y):\n return (x * y) // gcd(x, y)\n\n\ndef I():\n return int(input())\n\n\ndef LI():\n return [int(x) for x in input().split()]\n\n\ndef RI(N):\n return [int(input()) for _ in range(N)]\n\n\ndef LRI(N):\n return [[int(x) for x in input().split()] for _ in range(N)]\n\n\ndef LS():\n return input().split()\n\n\ndef RS(N):\n return [input() for _ in range(N)]\n\n\ndef LRS(N):\n return [input().split() for _ in range(N)]\n\n\ndef PL(L):\n print(*L, sep=\"\\n\")\n\n\ndef YesNo(B):\n print(\"Yes\" if B else \"No\")\n\n\ndef YESNO(B):\n print(\"YES\" if B else \"NO\")\n\n\nN = input()\nn = int(N[-1])\nif n in [2, 4, 5, 7, 9]:\n print(\"hon\")\nelif n in [0, 1, 6, 8]:\n print(\"pon\")\nelse:\n print(\"bon\")\n","fast_code":"n = int(input()[-1])\nif n == 3:\n print(\"bon\")\nelif n in set([0, 1, 6, 8]):\n print(\"pon\")\nelse:\n print(\"hon\")\n"} +{"fast_code_id":"04cf13145f8d2e221404352e24ce94339316e800ce472df8f670669f94d74cb3","fast_id":"p02555_4d25942d352291d83d727785c88845c416b8ebadd5f2c58dc2e09de04f15b2fa","language":"python","measured_fast_code_id":"4d25942d352291d83d727785c88845c416b8ebadd5f2c58dc2e09de04f15b2fa","measured_slow_code_id":"c3b18fd66a969908811fb5a7fad4e7d129453840b432daefe2b3186926221742","measurement_metric":"cpu_instruction_count","pair_id":"python_d2bf62afd811c0f4e81813c3","problem_id":"p02555","slow_code_id":"c3b18fd66a969908811fb5a7fad4e7d129453840b432daefe2b3186926221742","slow_id":"p02555_c3b18fd66a969908811fb5a7fad4e7d129453840b432daefe2b3186926221742","speedup":1194.4334509999564,"stratum":"8+","sampling_key":"1c4153bf1f3049efa853fea9055325fd89f9dfa1649e6654e3452078d73e5e72","slow_code":"import numpy as np\n\nMOD = 10**9 + 7\nn = int(eval(input()))\narr = np.zeros((n + 1, n + 1), dtype=int)\nfor i in np.arange(3, n + 1):\n arr[0, i] = 1\nfor i in np.arange(1, n + 1):\n sum_ = 0\n for j in np.arange(3 * i, n + 1):\n sum_ += arr[i - 1, j]\n sum_ %= MOD\n if j + 3 >= n + 1:\n break\n arr[i, j + 3] = sum_\nans = 0\nfor i in range(n + 1):\n ans += arr[i, n]\n ans %= MOD\nprint(ans)\n","fast_code":"MOD = 10**9 + 7\n\n\ndef main():\n S = int(eval(input()))\n if S < 3:\n print((0))\n return\n dp = [0] * (S + 1)\n dp[3] = 1\n for i in range(4, S + 1):\n dp[i] = dp[i - 1] + dp[i - 3]\n dp[i] %= MOD\n print((dp[S]))\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"5f819262a4bf7ab759496af45f54ce6a8a731e1ecbc485904933bc9daabd7720","fast_id":"p02783_5f819262a4bf7ab759496af45f54ce6a8a731e1ecbc485904933bc9daabd7720","language":"python","measured_fast_code_id":"5f819262a4bf7ab759496af45f54ce6a8a731e1ecbc485904933bc9daabd7720","measured_slow_code_id":"184009488c3f9f1105e8c0ddedd3260f6b8f0dac17d692456499911136230497","measurement_metric":"cpu_instruction_count","pair_id":"python_d334107e98a6aed9bb8a50c3","problem_id":"p02783","slow_code_id":"184009488c3f9f1105e8c0ddedd3260f6b8f0dac17d692456499911136230497","slow_id":"p02783_184009488c3f9f1105e8c0ddedd3260f6b8f0dac17d692456499911136230497","speedup":48.37688379317443,"stratum":"8+","sampling_key":"02d0d8b1deb0a41284e3447479561676b67e12a84c6888bfb314c332a3002c96","slow_code":"import itertools\nimport math\nimport fractions\nimport functools\n\nh, a = list(map(int, input().split()))\nprint((math.ceil(h / a)))\n","fast_code":"h, a = list(map(int, input().split()))\nprint((h // a + (h % a != 0)))\n"} +{"fast_code_id":"eb9d0c2b61b3f681c832c5eacfb83fd28eb883f51ab337a1979c5cebc9f8250a","fast_id":"p02706_eb9d0c2b61b3f681c832c5eacfb83fd28eb883f51ab337a1979c5cebc9f8250a","language":"python","measured_fast_code_id":"eb9d0c2b61b3f681c832c5eacfb83fd28eb883f51ab337a1979c5cebc9f8250a","measured_slow_code_id":"6d9390fbb5e9518f2796fc8b039ac068ff03b6e2e1e8bd75479e8bba99073086","measurement_metric":"cpu_instruction_count","pair_id":"python_d3b540955a36f00c5d5e577b","problem_id":"p02706","slow_code_id":"6d9390fbb5e9518f2796fc8b039ac068ff03b6e2e1e8bd75479e8bba99073086","slow_id":"p02706_6d9390fbb5e9518f2796fc8b039ac068ff03b6e2e1e8bd75479e8bba99073086","speedup":168.04206151222152,"stratum":"8+","sampling_key":"0ff6386ca632c3e946cbd1c0c31590a9b61cb22744906280650bbd42e689ee76","slow_code":"import numpy as np\n\nN, M = list(map(int, input().split()))\nA = np.array(list(map(int, input().split())))\nif (output := N - np.sum(A)) >= 0:\n print(output)\nelse:\n print((-1))\n","fast_code":"n, m = list(map(int, input().split()))\na = list(map(int, input().split()))\ntotal = sum(a)\nif n < total:\n print((-1))\nelse:\n print((n - total))\n"} +{"fast_code_id":"8f5a51e180a7a6a4d1a2eb53dc97fbb36cf013f0fbb7b103e5c079577c9fb5d2","fast_id":"p03018_8f5a51e180a7a6a4d1a2eb53dc97fbb36cf013f0fbb7b103e5c079577c9fb5d2","language":"python","measured_fast_code_id":"8f5a51e180a7a6a4d1a2eb53dc97fbb36cf013f0fbb7b103e5c079577c9fb5d2","measured_slow_code_id":"34cfcb0cd806549d9de932b7805e60b0300ac48d582c70a3b82e9e63ed79dbe3","measurement_metric":"cpu_instruction_count","pair_id":"python_d3c4bf2a45497ad651035c09","problem_id":"p03018","slow_code_id":"2a81960ac1f47336dbb6ad3e8a3b063f1f7be21a97a77ab30f5ed64ce398f2f3","slow_id":"p03018_34cfcb0cd806549d9de932b7805e60b0300ac48d582c70a3b82e9e63ed79dbe3","speedup":2.5216262993743923,"stratum":"2-4","sampling_key":"1ae00f509aa28270a2a22e566146fb9e001e77643fec9803503cfa858c45819f","slow_code":"import sys\n\nstdin = sys.stdin\nri = lambda: int(rs())\nrl = lambda: list(map(int, stdin.readline().split()))\nrs = lambda: stdin.readline().rstrip()\nS = list(rs())\ncur = \"D\"\nanswer = 0\nA_cnt = 0\nfor s in S:\n if cur == \"A\":\n if s == \"A\":\n A_cnt += 1\n elif s == \"B\":\n cur = s\n else:\n cur = \"D\"\n A_cnt = 0\n elif cur == \"B\":\n if s == \"A\":\n A_cnt = 1\n cur = s\n elif s == \"B\":\n A_cnt = 0\n cur = \"D\"\n elif s == \"C\":\n answer += A_cnt\n cur = s\n else:\n cur = \"D\"\n A_cnt = 0\n elif cur == \"C\":\n if s == \"A\":\n A_cnt += 1\n cur = s\n elif s == \"B\":\n cur = s\n else:\n cur = \"D\"\n A_cnt = 0\n else:\n if s == \"A\":\n A_cnt += 1\n cur = s\n else:\n A_cnt = 0\n cur = \"D\"\nprint(answer)\n","fast_code":"S = input().replace(\"BC\", \"1\")\nans = 0\na = 0\nfor s in S:\n if s == \"A\":\n a += 1\n elif s == \"1\":\n ans += a\n else:\n a = 0\nprint(ans)\n"} +{"fast_code_id":"e69dd2401cca04a6dde89a0cc59e0dcc02ccaf633182fe544b7863e3073adfa3","fast_id":"p02703_379a4c1de4a9c109be72d7339673b53f08eed339f0c694afe1877bc501dc7d81","language":"python","measured_fast_code_id":"379a4c1de4a9c109be72d7339673b53f08eed339f0c694afe1877bc501dc7d81","measured_slow_code_id":"13ddc35e7eb74d73b0b3c8f42eca38b92bc94e091a7090e12213a091ef6feb16","measurement_metric":"cpu_instruction_count","pair_id":"python_d3c92685aae4a550856f2927","problem_id":"p02703","slow_code_id":"8367a3613f4d9a1208ac0ab45c2708eb9c7ae580813c618185432ad6e30b1042","slow_id":"p02703_13ddc35e7eb74d73b0b3c8f42eca38b92bc94e091a7090e12213a091ef6feb16","speedup":3.1080924315644824,"stratum":"2-4","sampling_key":"b47ef3fb63696b7f1984ec76e7182a2aa3d8d237002c0e2a495d3991b23c71bf","slow_code":"import sys\nfrom heapq import heappush, heappop\nimport numpy as np\n\n\ndef input():\n return sys.stdin.readline().rstrip()\n\n\ndef ii():\n return int(input())\n\n\ndef mi():\n return map(int, input().split())\n\n\ndef li():\n return list(mi())\n\n\ndef main():\n def dijkstra(s):\n def push(v, s, x):\n if s < 0:\n return\n if dist[v, s] <= x:\n return\n dist[v, s] = x\n heappush(que, (x, v, s))\n\n inf = 10**18\n dist = np.full((n, MAX_S + 1), inf, dtype=int)\n\n que = []\n push(0, s, 0)\n while que:\n x, v, s = heappop(que)\n if dist[v, s] < x:\n continue\n ns = min(s + c[v], MAX_S)\n push(v, ns, x + d[v])\n for nv, a, b in adj[v]:\n push(nv, s - a, x + b)\n return np.min(dist, axis=1)\n\n n, m, s = mi()\n adj = [[] for i in range(n)]\n MAX_S = 0\n for i in range(m):\n u, v, a, b = mi()\n u -= 1\n v -= 1\n adj[u].append((v, a, b))\n adj[v].append((u, a, b))\n MAX_S = max(MAX_S, a)\n MAX_S *= n - 1\n s = min(s, MAX_S)\n c, d = [0] * n, [0] * n\n for i in range(n):\n c[i], d[i] = mi()\n ans = dijkstra(s)\n print(*ans[1:], sep=\"\\n\")\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"from heapq import heappop, heappush\nimport sys\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef main():\n N, M, S = list(map(int, input().split()))\n to = [{} for _ in range(N)]\n for _ in range(M):\n u, v, a, b = list(map(int, input().split()))\n u -= 1\n v -= 1\n to[u][v] = (a, b)\n to[v][u] = (a, b)\n info = tuple(tuple(map(int, input().split())) for _ in range(N))\n MAX_SILVER = 50 * (N - 1)\n INF = 10**18\n\n visited = [[False] * (MAX_SILVER + 1) for _ in range(N)]\n cost = [[INF] * (MAX_SILVER + 1) for _ in range(N)]\n q = []\n S = min(S, MAX_SILVER)\n heappush(q, (0, 0, S))\n while q:\n t, now, s = heappop(q)\n if visited[now][s]:\n continue\n visited[now][s] = True\n cost[now][s] = t\n\n for nv, (a, b) in list(to[now].items()):\n nt = t + b\n rest = s - a\n if rest >= 0:\n if cost[nv][rest] <= nt:\n continue\n heappush(q, (nt, nv, rest))\n\n rate, time = info[now]\n nt = t + time\n ns = min(s + rate, MAX_SILVER)\n heappush(q, (nt, now, ns))\n for i in range(1, N):\n print((min(cost[i])))\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"c362ad37028fc3b8fa56ecfd76632913fe940ee198ee9f64806a141185618805","fast_id":"p03309_ee68236b8904bb12166a28b46506ba74d64d6f03534469cbf2bb47d3bf8a48d8","language":"python","measured_fast_code_id":"ee68236b8904bb12166a28b46506ba74d64d6f03534469cbf2bb47d3bf8a48d8","measured_slow_code_id":"cc6340aab617e7100bd4d51ff3921118d5d3dad1bda63cfcf3f2026a849def46","measurement_metric":"cpu_instruction_count","pair_id":"python_d43440849e8ad95ebc8f923d","problem_id":"p03309","slow_code_id":"364f3596fd84d0acd37a6dd5d8da1a36ebb61efbb957346157757658db88473b","slow_id":"p03309_cc6340aab617e7100bd4d51ff3921118d5d3dad1bda63cfcf3f2026a849def46","speedup":3.576914646352117,"stratum":"2-4","sampling_key":"020856a73fa2c4c10dd876ffc1b6cc191463f874e170c618d3142c69bb2defb2","slow_code":"if __name__ == \"__main__\":\n from statistics import median\n\n n = int(eval(input()))\n a = list(map(int, input().split()))\n total = 0\n\n mod_a = sorted([ai - i for i, ai in enumerate(a, 1)])\n b = median(mod_a)\n for i in range(n):\n total += abs(mod_a[i] - b)\n print((int(total)))\n","fast_code":"n = int(eval(input()))\nA = list(map(int, input().split()))\nA = [A[i] - (i + 1) for i in range(n)]\nA.sort()\nif n == 1:\n print((0))\n exit()\nans = 10**100\nfor i in [n // 2 - 1, n // 2]:\n ans = min(ans, sum([abs(A[j] - A[i]) for j in range(n)]))\nprint(ans)\n"} +{"fast_code_id":"23a7a790e52fda0a05a39b658a8079d00c1c9bd52c128373255aaf64d9733095","fast_id":"p03860_23a7a790e52fda0a05a39b658a8079d00c1c9bd52c128373255aaf64d9733095","language":"python","measured_fast_code_id":"23a7a790e52fda0a05a39b658a8079d00c1c9bd52c128373255aaf64d9733095","measured_slow_code_id":"9ef1231582fe354d1371d84402c4798862840bfe7b5f006a6f2a81618aaa1d84","measurement_metric":"cpu_instruction_count","pair_id":"python_d46ac5274c8fb28ccbd1d845","problem_id":"p03860","slow_code_id":"9ef1231582fe354d1371d84402c4798862840bfe7b5f006a6f2a81618aaa1d84","slow_id":"p03860_9ef1231582fe354d1371d84402c4798862840bfe7b5f006a6f2a81618aaa1d84","speedup":2.4106804431291944,"stratum":"2-4","sampling_key":"07588838491e467da485a4ea5950bb6b66a2d9b77ab09311fa25a38b9f1c6f95","slow_code":"a, b, c = (i for i in input().split())\nprint((a[0] + b[0] + c[0]))\n","fast_code":"print((\"A%sC\" % input()[8]))\n"} +{"fast_code_id":"d0c4e7e224865469d566b5f1e77ae9e13e1cdb548f9945f3571452dec4ac2b97","fast_id":"p03837_bfaa7c4e3f833fb371931ceb7666d3f78605c494974cf7d3720378a94fc04e13","language":"python","measured_fast_code_id":"bfaa7c4e3f833fb371931ceb7666d3f78605c494974cf7d3720378a94fc04e13","measured_slow_code_id":"3c9300b9a4c69f0f745cb1f931af4a418f91d55bb6258d4a916721677ca14aed","measurement_metric":"cpu_instruction_count","pair_id":"python_d481f0ba21e372ea266b1399","problem_id":"p03837","slow_code_id":"3c9300b9a4c69f0f745cb1f931af4a418f91d55bb6258d4a916721677ca14aed","slow_id":"p03837_3c9300b9a4c69f0f745cb1f931af4a418f91d55bb6258d4a916721677ca14aed","speedup":6.4174475099144,"stratum":"4-8","sampling_key":"2bc17039f141c8a87159325e19e45cc1caf9fdff0bd4cbb8ffddae4ca9571132","slow_code":"N, M = list(map(int, input().split()))\nINF = 10**6\nEdge = [[INF] * N for _ in range(N)]\nfor _ in range(M):\n a, b, c = list(map(int, input().split()))\n Edge[a - 1][b - 1] = c\n Edge[b - 1][a - 1] = c\ndp = [[INF] * N for _ in range(N)]\nfor i in range(N):\n for j in range(N):\n if i == j:\n dp[i][j] = 0\n else:\n dp[i][j] = Edge[i][j]\nfor k in range(N):\n for i in range(N):\n for j in range(N):\n dp[i][j] = min(dp[i][j], dp[i][k] + dp[k][j])\nans = 0\nfor i in range(N - 1):\n for j in range(i + 1, N):\n if Edge[i][j] == INF:\n continue\n if Edge[i][j] > dp[i][j]:\n ans += 1\nprint(ans)\n","fast_code":"import heapq\n\n\ndef dijkstra(n, s, g):\n h = [(0, s)]\n heapq.heapify(h)\n cost = [float(\"Inf\")] * (n + 1)\n cost[s] = 0\n while h:\n c, v = heapq.heappop(h)\n if c > cost[v]:\n continue\n for d, u in g[v]:\n d_s_u = d + cost[v]\n if d_s_u < cost[u]:\n cost[u] = d_s_u\n heapq.heappush(h, (d_s_u, u))\n return cost\n\n\ndef main():\n n, m, *abc = list(map(int, open(0).read().split()))\n g = [[] for _ in range(n + 1)]\n for a, b, c in zip(*[iter(abc)] * 3):\n g[a].append([c, b])\n g[b].append([c, a])\n ans = 0\n for i in range(1, n + 1):\n cost = dijkstra(n, i, g)\n for j, k in g[i]:\n if j > cost[k]:\n ans += 1\n print((ans // 2))\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"50ab91c4c0c0068715690c125df31cb262652d04cfb2311aeba2c6d2e9a558be","fast_id":"p03291_50ab91c4c0c0068715690c125df31cb262652d04cfb2311aeba2c6d2e9a558be","language":"python","measured_fast_code_id":"50ab91c4c0c0068715690c125df31cb262652d04cfb2311aeba2c6d2e9a558be","measured_slow_code_id":"779114b7df427d693de3af90dfa08e7786175a435b3b9452dcde04bae557f05c","measurement_metric":"cpu_instruction_count","pair_id":"python_d511116c2ba273d2ab233512","problem_id":"p03291","slow_code_id":"bc8b996b668505e4e304571caa360d13a1ae1d85a2eb813c7156a4cbeca12747","slow_id":"p03291_779114b7df427d693de3af90dfa08e7786175a435b3b9452dcde04bae557f05c","speedup":2.7657577683455035,"stratum":"2-4","sampling_key":"00666f6d2e971116bbfdd1dd74461453f8412f603231f0f57e2518032a319d7f","slow_code":"import sys\n\nreadline = sys.stdin.readline\nS = readline().rstrip()\nDIV = 10**9 + 7\ndp = [[0] * 4 for i in range(len(S) + 1)]\n\n\ndp[0][0] = 1\nfor i in range(len(S)):\n if S[i] == \"A\" or S[i] == \"?\":\n dp[i + 1][0] += dp[i][0]\n dp[i + 1][1] += dp[i][1]\n dp[i + 1][2] += dp[i][2]\n dp[i + 1][3] += dp[i][3]\n dp[i + 1][1] += dp[i][0]\n if S[i] == \"B\" or S[i] == \"?\":\n dp[i + 1][0] += dp[i][0]\n dp[i + 1][1] += dp[i][1]\n dp[i + 1][2] += dp[i][2]\n dp[i + 1][3] += dp[i][3]\n dp[i + 1][2] += dp[i][1]\n if S[i] == \"C\" or S[i] == \"?\":\n dp[i + 1][0] += dp[i][0]\n dp[i + 1][1] += dp[i][1]\n dp[i + 1][2] += dp[i][2]\n dp[i + 1][3] += dp[i][3]\n dp[i + 1][3] += dp[i][2]\n for j in range(4):\n dp[i + 1][j] %= DIV\n\nprint((dp[len(S)][3]))\n","fast_code":"s = input().rstrip()\ndp = [0] * 4\ndp[0] = 1\nfor i in range(len(s)):\n if s[i] == \"A\":\n dp[1] += dp[0]\n elif s[i] == \"B\":\n dp[2] += dp[1]\n elif s[i] == \"C\":\n dp[3] += dp[2]\n else:\n dp = [dp[0] * 3, dp[1] * 3 + dp[0], dp[2] * 3 + dp[1], dp[3] * 3 + dp[2]]\n dp = list([x % (10**9 + 7) for x in dp])\nprint((dp[3]))\n"} +{"fast_code_id":"adae48fe55effa8cdd6a315e90f7e6e7504ad3afb14202e2c2b32aa2bd81be75","fast_id":"p02763_e84631fc29be2baae93a961e1dedc6fa9fd2dfe58a7aa5989ca607d0cd0affbf","language":"python","measured_fast_code_id":"e84631fc29be2baae93a961e1dedc6fa9fd2dfe58a7aa5989ca607d0cd0affbf","measured_slow_code_id":"f48f6f3e37812c17b5337b9141da770a977eb3ae11af352f28286963282fd6ed","measurement_metric":"cpu_instruction_count","pair_id":"python_d53354f51a833382eefe330a","problem_id":"p02763","slow_code_id":"4fa4a65e4a0df3861053325cb01fa333b2482712b297bcf1214920d237936687","slow_id":"p02763_f48f6f3e37812c17b5337b9141da770a977eb3ae11af352f28286963282fd6ed","speedup":6.006299546319336,"stratum":"4-8","sampling_key":"d8a565eb9ba88c14cc874eaeb96e76ade629966c2fc2869cd3ecbd7523d372fc","slow_code":"import sys\n\ninput = sys.stdin.readline\n\n\nclass Bit:\n def __init__(self, n):\n self.n = n\n self.tree = [0] * (n + 1)\n self.el = [0] * (n + 1)\n self.depth = n.bit_length() - 1\n\n def sum(self, i):\n s = 0\n i -= 1\n while i >= 0:\n s += self.tree[i]\n i = (i & (i + 1)) - 1\n return s\n\n def add(self, i, x):\n self.el[i] += x\n while i < self.n:\n self.tree[i] += x\n i |= i + 1\n\n def get(self, i, j=None):\n if j is None:\n return self.el[i]\n if i == 0:\n return self.sum(j)\n return self.sum(j) - self.sum(i)\n\n def lower_bound(self, x, equal=False):\n sum_ = 0\n pos = -1\n if not equal:\n for i in range(self.depth, -1, -1):\n k = pos + (1 << i)\n if k < self.n and sum_ + self.tree[k] < x:\n sum_ += self.tree[k]\n pos += 1 << i\n if equal:\n for i in range(self.depth, -1, -1):\n k = pos + (1 << i)\n if k < self.n and sum_ + self.tree[k] <= x:\n sum_ += self.tree[k]\n pos += 1 << i\n return pos, sum_\n\n def __getitem__(self, s):\n return self.el[s]\n\n def __iter__(self):\n for s in self.el[: self.n]:\n yield s\n\n def __str__(self):\n text1 = \" \".join([\"element: \"] + list(map(str, self)))\n text2 = \" \".join(\n [\"cumsum(1-indexed): \"]\n + list(str(self.sum(i)) for i in range(1, self.n + 1))\n )\n return \"\\n\".join((text1, text2))\n\n\nimport string\n\nN = int(eval(input()))\nS = input().strip()\nQ = int(eval(input()))\nB = [Bit(N) for _ in range(26)]\nabc = string.ascii_lowercase\nabc2 = dict()\nfor i, s in enumerate(abc):\n abc2[s] = i\nfor i, s in enumerate(S):\n B[abc2[s]].add(i, 1)\nfor _ in range(Q):\n q = list(input().split())\n if q[0] == \"1\":\n a = int(q[1]) - 1\n b = q[2]\n for i in range(26):\n if B[i].el[a] == 1:\n B[i].add(a, -1)\n B[abc2[b]].add(a, 1)\n if q[0] == \"2\":\n a = int(q[1]) - 1\n b = int(q[2]) - 1\n res = 0\n for i in range(26):\n res += B[i].get(a, b + 1) > 0\n print(res)\n","fast_code":"import sys\nfrom bisect import bisect, insort_left\n\niim = lambda: map(int, input().rstrip().split())\n\n\ndef resolve():\n N = int(input())\n S = list(input())\n Q = int(input())\n c0 = ord(\"a\")\n S1 = [[] for i in range(26)]\n for i, c1 in enumerate(S):\n ci = ord(c1) - c0\n S1[ci].append(i)\n ans = []\n for cmd, i, j in (line.split() for line in sys.stdin):\n i = int(i) - 1\n if cmd == \"1\":\n if S[i] == j:\n continue\n c1 = ord(S[i]) - c0\n s1 = S1[c1]\n s1.pop(bisect(s1, i) - 1)\n S[i] = j\n c1 = ord(j) - c0\n insort_left(S1[c1], i)\n elif cmd == \"2\":\n j = int(j) - 1\n num = 0\n for s1 in S1:\n ls = len(s1)\n k = bisect(s1, i - 1, 0, ls)\n if k == ls:\n continue\n if i <= s1[k] <= j:\n num += 1\n ans.append(num)\n print(*ans, sep=\"\\n\")\n\n\nif __name__ == \"__main__\":\n resolve()\n"} +{"fast_code_id":"f7906a09151fab400b6547bf06f2749bfbc12740deab8aee67e2f15ffdabe2ee","fast_id":"p03835_f7906a09151fab400b6547bf06f2749bfbc12740deab8aee67e2f15ffdabe2ee","language":"python","measured_fast_code_id":"f7906a09151fab400b6547bf06f2749bfbc12740deab8aee67e2f15ffdabe2ee","measured_slow_code_id":"10ad4ff275930d94e0dd92b80fd510f84d157671325b17a8982909dfb995bd50","measurement_metric":"cpu_instruction_count","pair_id":"python_d55ea2b4343f84f36dd2382e","problem_id":"p03835","slow_code_id":"10ad4ff275930d94e0dd92b80fd510f84d157671325b17a8982909dfb995bd50","slow_id":"p03835_10ad4ff275930d94e0dd92b80fd510f84d157671325b17a8982909dfb995bd50","speedup":796.2551203855197,"stratum":"8+","sampling_key":"099dc838220ab86d6f5e3d32edb7ba81f1048a431aee4c1dada1887e0a1d3179","slow_code":"K, S = input().split()\nK = int(K)\nS = int(S)\nans = 0\nfor l in range(K + 1):\n for m in range(K + 1):\n if l + m <= S and l + m + K >= S:\n ans = ans + 1\nprint(ans)\n","fast_code":"k, s = list(map(int, input().split()))\ncnt = 0\nminX = max(s - 2 * k, 0)\nmaxX = min(s, k)\nfor x in range(minX, maxX + 1):\n rest = s - x\n if k >= rest:\n cnt += rest + 1\n else:\n cnt += 2 * k - rest + 1\nprint(cnt)\n"} +{"fast_code_id":"0460d012a406aad766556cab169b4de818b7cd5dfb845c6e5cef981e6c3c5fa9","fast_id":"p03212_0460d012a406aad766556cab169b4de818b7cd5dfb845c6e5cef981e6c3c5fa9","language":"python","measured_fast_code_id":"0460d012a406aad766556cab169b4de818b7cd5dfb845c6e5cef981e6c3c5fa9","measured_slow_code_id":"9b823eea975a23a20587bc34ffa695ba9d6a5f099d4923f94ee756f58c3ecb65","measurement_metric":"cpu_instruction_count","pair_id":"python_d577b7c55606b06a40226378","problem_id":"p03212","slow_code_id":"9b823eea975a23a20587bc34ffa695ba9d6a5f099d4923f94ee756f58c3ecb65","slow_id":"p03212_9b823eea975a23a20587bc34ffa695ba9d6a5f099d4923f94ee756f58c3ecb65","speedup":7.769694637982343,"stratum":"4-8","sampling_key":"1e8582f4c27bf7746bba407452373b61275b56062c44610dd83c2beffd9c92d9","slow_code":"import copy\n\nword = \"753\"\n\n\ndef dfs(n):\n ret = 0\n num = 0 if not n else int(\"\".join(n))\n if N < num:\n return ret\n ret += 1 if len(set(\"\".join(n)) & set(word)) == len(word) else 0\n for c in word:\n tmp = copy.deepcopy(n)\n n.append(c)\n ret += dfs(n)\n n = tmp\n return ret\n\n\nN = int(eval(input()))\nprint((dfs([])))\n","fast_code":"N = int(eval(input()))\nans = 0\n\n\ndef dfs(s, sum):\n global ans\n sum = sum + s\n if int(sum) > N:\n return False\n sum = str(int(sum))\n if sum.count(\"3\") >= 1 and sum.count(\"5\") >= 1 and sum.count(\"7\") >= 1:\n ans += 1\n if dfs(\"3\", sum):\n return True\n if dfs(\"5\", sum):\n return True\n if dfs(\"7\", sum):\n return True\n\n\ndfs(\"0\", \"\")\nprint(ans)\n"} +{"fast_code_id":"f669995f41077f5d8b5b30dbecc4d6396ca18799fc085ac8b3731cb00f6f4aa4","fast_id":"p00267_6f1b8994dd229e6feff1ee53bee9c5e01a0a4789737128aa5b88a5057f093375","language":"python","measured_fast_code_id":"6f1b8994dd229e6feff1ee53bee9c5e01a0a4789737128aa5b88a5057f093375","measured_slow_code_id":"121c6b2fb2015594dfca021132dc90bcafa6e6e79d4d82ffeebee7da0bff3ce8","measurement_metric":"cpu_instruction_count","pair_id":"python_d57b0bec3e95d2d9ff3ddf66","problem_id":"p00267","slow_code_id":"54ce01755426706394185ba79e433944944352764e823d456517a08e77403f77","slow_id":"p00267_121c6b2fb2015594dfca021132dc90bcafa6e6e79d4d82ffeebee7da0bff3ce8","speedup":34.19988690505239,"stratum":"8+","sampling_key":"4ba272d64e2cc5b61c3b002d378dd4114fcd4e4ff9a2255707bf78321da02d2b","slow_code":"def counting_sort(nmax, la):\n f = [0] * (nmax + 1)\n nmax = 0\n for a in la:\n f[a] += 1\n if a > nmax:\n nmax = a\n k, i = len(la), nmax\n la = []\n while k:\n if f[i]:\n la += [i] * f[i]\n k -= f[i]\n i -= 1\n return la\n\n\nwhile True:\n n = int(eval(input()))\n if n == 0:\n break\n a = list(map(int, input().split()))\n b = list(map(int, input().split()))\n a = counting_sort(100000, a)\n b = counting_sort(100000, b)\n ans, i = n, -1\n for k in range(0, n, 2):\n i += 1\n if a[k] > b[i]:\n ans = k + 1\n break\n print((\"NA\" if ans == n else ans))\n","fast_code":"while True:\n n = int(eval(input()))\n if n == 0:\n break\n a = list(map(int, input().split()))\n b = list(map(int, input().split()))\n a.sort(reverse=True)\n b.sort(reverse=True)\n ans, i = n, -1\n for k in range(0, n, 2):\n i += 1\n if a[k] > b[i]:\n ans = k + 1\n break\n print((\"NA\" if ans == n else ans))\n"} +{"fast_code_id":"00e867b7d2095675b21d44aa0203e42270e0c7d7b6d93feade6e801e5b2a696c","fast_id":"p02922_00e867b7d2095675b21d44aa0203e42270e0c7d7b6d93feade6e801e5b2a696c","language":"python","measured_fast_code_id":"00e867b7d2095675b21d44aa0203e42270e0c7d7b6d93feade6e801e5b2a696c","measured_slow_code_id":"8b569fc1e16981f8320c705cea748e4c69f345af35a77c5db73eb42d1431aac6","measurement_metric":"cpu_instruction_count","pair_id":"python_d5936d65d45cc90724edd2f2","problem_id":"p02922","slow_code_id":"d125558241ae3c64a726d724586fb5061b0b0d9b36349b79174daa959a5a79c4","slow_id":"p02922_8b569fc1e16981f8320c705cea748e4c69f345af35a77c5db73eb42d1431aac6","speedup":5.858304475029582,"stratum":"4-8","sampling_key":"927bf9db80eafa242251c7112d8baa76803674baa5da38030aa661e16d9ae0c4","slow_code":"import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, queue, copy\n\nsys.setrecursionlimit(10**7)\ninf = 10**20\nmod = 10**9 + 7\ndd = [(-1, 0), (0, 1), (1, 0), (0, -1)]\nddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef LI_():\n return [int(x) - 1 for x in sys.stdin.readline().split()]\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LS():\n return sys.stdin.readline().split()\n\n\ndef S():\n return eval(input())\n\n\ndef main():\n a, b = LI()\n c = 1\n ans = 0\n while True:\n if c >= b:\n return ans\n ans += 1\n c -= 1\n c += a\n\n\nprint((main()))\n","fast_code":"from copy import deepcopy\nfrom math import ceil\n\nif __name__ == \"__main__\":\n a = list(map(int, input().split()))\n n = deepcopy(a[0])\n i = 1\n if a[0] == a[1]:\n print(i)\n elif a[1] == 1:\n print((0))\n elif a[0] >= a[1]:\n print(i)\n else:\n while True:\n i += 1\n n += a[0] - 1\n if n >= a[1]:\n print(i)\n break\n"} +{"fast_code_id":"4b31fcf95a6771a32042359b4ecae0e7a810ce09114472d2a2c2eda17f60eaea","fast_id":"p03126_3857942893fe134341268787703de41ac4ff414e5683379f27a53456603d90d6","language":"python","measured_fast_code_id":"3857942893fe134341268787703de41ac4ff414e5683379f27a53456603d90d6","measured_slow_code_id":"0f7452cbac3152780e6e45e4ccdb0d439fed784a94d652759a76c518063b3e0f","measurement_metric":"cpu_instruction_count","pair_id":"python_d603e73e84aab364af5fb118","problem_id":"p03126","slow_code_id":"0f7452cbac3152780e6e45e4ccdb0d439fed784a94d652759a76c518063b3e0f","slow_id":"p03126_0f7452cbac3152780e6e45e4ccdb0d439fed784a94d652759a76c518063b3e0f","speedup":2.9111843269796447,"stratum":"2-4","sampling_key":"2373a2845d5a93e1c90eb0a166d95cee8234a7d594810d3b5a81ae1796f42bc3","slow_code":"N, M = list(map(int, input().split()))\nK = [0] * N\nA = [list(map(int, input().split())) for i in range(N)]\ncount = 0\nfor i in range(1, M + 1, 1):\n likecount = 0\n for j in range(N):\n for k in range(1, A[j][0] + 1, 1):\n if A[j][k] == i:\n likecount += 1\n if likecount == N:\n count += 1\nprint(count)\n","fast_code":"N, M = list(map(int, input().split()))\nK, A = list(\n zip(\n *(\n (int(t[0]), list(map(int, t[1].split())))\n for t in (input().split(maxsplit=1) for _ in range(N))\n )\n )\n)\n\nans = sum(all(k in a for a in A) for k in range(1, M + 1))\n\nprint(ans)\n"} +{"fast_code_id":"b087b8913a33d3e5167054bede3b4411d0f780409ead0d3437652fa9b645ccbe","fast_id":"p02699_b087b8913a33d3e5167054bede3b4411d0f780409ead0d3437652fa9b645ccbe","language":"python","measured_fast_code_id":"b087b8913a33d3e5167054bede3b4411d0f780409ead0d3437652fa9b645ccbe","measured_slow_code_id":"f2cc4bf0fe7fb5f3b139743ef8c168fecc1b7ec24219170b0370aa9ddc4eb707","measurement_metric":"cpu_instruction_count","pair_id":"python_d640db7400a9f360e2d12f5d","problem_id":"p02699","slow_code_id":"bf5eea10074c63eaba5bcd155494237aaf0b2185b148b7614e311e92f7bef084","slow_id":"p02699_f2cc4bf0fe7fb5f3b139743ef8c168fecc1b7ec24219170b0370aa9ddc4eb707","speedup":3.1078640433747498,"stratum":"2-4","sampling_key":"28e297797d0985f17d8f752d93f94eb5950f4006dfea3060c444043a947477e6","slow_code":"import sys\nimport math\nfrom bisect import bisect_right as br\nfrom bisect import bisect_left as bl\n\nsys.setrecursionlimit(2147483647)\nfrom heapq import heappush, heappop, heappushpop\nfrom collections import defaultdict\nfrom itertools import accumulate\nfrom collections import Counter\nfrom collections import deque\nfrom operator import itemgetter\nfrom itertools import permutations\n\nmod = 10**9 + 7\ninf = float(\"inf\")\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\ns, w = LI()\nif s <= w:\n print(\"unsafe\")\nelse:\n print(\"safe\")\n","fast_code":"S, W = (int(x) for x in input().split())\nif S <= W:\n print(\"unsafe\")\nelse:\n print(\"safe\")\n"} +{"fast_code_id":"e81b9a05d6a0625abe20be5173408f58545a3043c595e7924d8acc120f8af1e0","fast_id":"p02990_e81b9a05d6a0625abe20be5173408f58545a3043c595e7924d8acc120f8af1e0","language":"python","measured_fast_code_id":"e81b9a05d6a0625abe20be5173408f58545a3043c595e7924d8acc120f8af1e0","measured_slow_code_id":"c31fc2bc92408b4a0301d38b4dc2bd4da1b14a22d2eabb3dbb3a037726d897d7","measurement_metric":"cpu_instruction_count","pair_id":"python_d646966e24b260ed90aa7838","problem_id":"p02990","slow_code_id":"c31fc2bc92408b4a0301d38b4dc2bd4da1b14a22d2eabb3dbb3a037726d897d7","slow_id":"p02990_c31fc2bc92408b4a0301d38b4dc2bd4da1b14a22d2eabb3dbb3a037726d897d7","speedup":7.638909514298546,"stratum":"4-8","sampling_key":"3fcc105e2fd12d2ea816f98f1af80c405145ebe7a73ab4fede77fab39938692a","slow_code":"N, K = list(map(int, input().split()))\nmod = 10**9 + 7\ninv = [pow(i, mod - 2, mod) for i in range(1, N + 1)]\ntable = []\ninv_table = []\ntmp = 1\ninv_tmp = 1\nfor i in range(N):\n tmp *= i + 1\n tmp %= mod\n table.append(tmp)\n inv_tmp *= inv[i]\n inv_tmp %= mod\n inv_table.append(inv_tmp)\n\n\ndef cmb(n, k):\n if n == 0:\n return 1\n if k == 0:\n return 1\n if n == k:\n return 1\n ans = table[n - 1]\n ans *= inv_table[k - 1]\n ans *= inv_table[n - k - 1]\n return ans % mod\n\n\nfor i in range(1, K + 1):\n ans = 0\n tmp = cmb(K - 1, i - 1)\n if N - K < i - 1:\n print(ans)\n continue\n else:\n tmp_N = N - K - (i - 1)\n if tmp_N > 0:\n ans += cmb(tmp_N + i, i) * tmp\n else:\n ans += tmp\n print((ans % mod))\n","fast_code":"n, k = list(map(int, input().split()))\np = n - k + 1\ni = 0\nwhile i < k:\n print((p % (10**9 + 7)))\n i += 1\n p = p * (k - i) * (n - k + 1 - i) // i // -~i\n"} +{"fast_code_id":"76a63e61a3811b1d81f61574206706c934c2797ff20d05cb0a8f2af4491931aa","fast_id":"p03786_76a63e61a3811b1d81f61574206706c934c2797ff20d05cb0a8f2af4491931aa","language":"python","measured_fast_code_id":"76a63e61a3811b1d81f61574206706c934c2797ff20d05cb0a8f2af4491931aa","measured_slow_code_id":"01e4e104b8cffd408e37f15b9026d222331aea634f5f65862577d6e6a8a42837","measurement_metric":"cpu_instruction_count","pair_id":"python_d6785c1462f4e41d375b5509","problem_id":"p03786","slow_code_id":"01e4e104b8cffd408e37f15b9026d222331aea634f5f65862577d6e6a8a42837","slow_id":"p03786_01e4e104b8cffd408e37f15b9026d222331aea634f5f65862577d6e6a8a42837","speedup":137.0399945886292,"stratum":"8+","sampling_key":"1b1b5dbb08cd0f9528573f3a6d28d07f63ec00948147ede97e8ac7a0401043c3","slow_code":"import numpy as np\n\nN = int(eval(input()))\nA = list(map(int, input().split()))\nA = sorted(A)\nC = np.cumsum(A)\nans = 0\ncnt = 0\nfor i in range(N - 1):\n if C[i] * 2 >= A[i + 1]:\n cnt += 1\n else:\n cnt = 0\nans = cnt + 1\nprint(ans)\n","fast_code":"n = int(eval(input()))\na = list(map(int, input().split()))\na.sort(reverse=True)\nssum = sum(a)\nans = 1\nfor i in range(n):\n ssum -= a[i]\n if 2 * ssum < a[i]:\n break\n else:\n ans += 1\nprint(ans)\n"} +{"fast_code_id":"286238764d0bc3d5b24e5545c9b195dde605423ddf5e42351ea36bcb93186676","fast_id":"p03962_286238764d0bc3d5b24e5545c9b195dde605423ddf5e42351ea36bcb93186676","language":"python","measured_fast_code_id":"286238764d0bc3d5b24e5545c9b195dde605423ddf5e42351ea36bcb93186676","measured_slow_code_id":"2e04cc2138f9c584c4c6c5a5a11c210e2c9aa6d0952ba5d20d546d147782f75d","measurement_metric":"cpu_instruction_count","pair_id":"python_d68c44af5cabbb28525f68bc","problem_id":"p03962","slow_code_id":"2e04cc2138f9c584c4c6c5a5a11c210e2c9aa6d0952ba5d20d546d147782f75d","slow_id":"p03962_2e04cc2138f9c584c4c6c5a5a11c210e2c9aa6d0952ba5d20d546d147782f75d","speedup":2.6386775259604955,"stratum":"2-4","sampling_key":"9af900f418d3eaff820642accf110ac1dbe8b9534e98b769e81a8d4b10f8552b","slow_code":"import collections\n\np = [int(x) for x in input().split()]\nc = collections.Counter(p)\nprint((len(c)))\n","fast_code":"print((len(set(input().split()))))\n"} +{"fast_code_id":"3ed535ed0bc6c202b0386a960b00e5549d575062c87ec6b3d7cedb112a9c2f5e","fast_id":"p02418_3ed535ed0bc6c202b0386a960b00e5549d575062c87ec6b3d7cedb112a9c2f5e","language":"python","measured_fast_code_id":"3ed535ed0bc6c202b0386a960b00e5549d575062c87ec6b3d7cedb112a9c2f5e","measured_slow_code_id":"cef61ea324de806594aef8e5b25dea0c55fe9633d20e9e7f7cc94749726f1030","measurement_metric":"cpu_instruction_count","pair_id":"python_d6968041adae024bc8b17db3","problem_id":"p02418","slow_code_id":"cef61ea324de806594aef8e5b25dea0c55fe9633d20e9e7f7cc94749726f1030","slow_id":"p02418_cef61ea324de806594aef8e5b25dea0c55fe9633d20e9e7f7cc94749726f1030","speedup":2.3317256052251314,"stratum":"2-4","sampling_key":"a0f0c637acf04a979e48454dac3938f926425151109e4c14dba6458c6ebcbead","slow_code":"s = input()\ntarget = input()\nring = s * 2\nf = 0\nfor i in range(len(s)):\n if ring[i : i + len(target)] == target:\n f = 1\n break\nif f == 1:\n print(\"Yes\")\nelse:\n print(\"No\")\n","fast_code":"ring = input() * 2\nword = input()\nif word in ring:\n print(\"Yes\")\nelse:\n print(\"No\")\n"} +{"fast_code_id":"aee25fc1c6c7117b0696d60777759058c8b4c7269d39bb9df87e8ea383e0bb31","fast_id":"p03209_aee25fc1c6c7117b0696d60777759058c8b4c7269d39bb9df87e8ea383e0bb31","language":"python","measured_fast_code_id":"aee25fc1c6c7117b0696d60777759058c8b4c7269d39bb9df87e8ea383e0bb31","measured_slow_code_id":"d810806da4e3ff396dd2f9e6a8463b4981d8f62dd34c3ba133bb44352184e910","measurement_metric":"cpu_instruction_count","pair_id":"python_d6d95a12f168394003a89a39","problem_id":"p03209","slow_code_id":"dbd3b0158d3748e0d99cec055f9e692949bfea6a1e16dd750ed0447f840bf070","slow_id":"p03209_d810806da4e3ff396dd2f9e6a8463b4981d8f62dd34c3ba133bb44352184e910","speedup":2.3704414221330956,"stratum":"2-4","sampling_key":"07ebf94db361ce824c52d502100aab71a01b6a17cc619b78178019640521ebf7","slow_code":"N, X = list(map(int, input().split()))\n\nT = [1]\nfor i in range(1, 50 + 1):\n T.append(T[i - 1] * 2 + 3)\n\n\ndef hash(n, x):\n return \"{0:d},{1:d}\".format(n, x)\n\n\nmemo = dict()\n\n\ndef solve(n, x):\n global T, memo\n if hash(n, x) in memo:\n return memo[hash(n, x)]\n if n == 0 and x >= 1:\n memo[hash(n, x)] = 1\n return 1\n if x <= 1:\n memo[hash(n, x)] = 0\n return 0\n memo[hash(n, x)] = solve(n - 1, min(x - 1, T[n - 1]))\n if x >= T[n - 1] + 2:\n memo[hash(n, x)] += 1\n if x >= T[n - 1] + 3:\n memo[hash(n, x)] += solve(n - 1, min(x - 1 - T[n - 1] - 1, T[n - 1]))\n return memo[hash(n, x)]\n\n\nprint((solve(N, X)))\n","fast_code":"N, X = [int(elem) for elem in input().split()]\nh_burger = [None] * (N + 1)\np_burger = [None] * (N + 1)\nh_burger[0] = 1\np_burger[0] = 1\nfor i in range(1, N + 1):\n h_burger[i] = h_burger[i - 1] * 2 + 3\n p_burger[i] = p_burger[i - 1] * 2 + 1\n\n\ndef num_patties(l, x):\n if l == 0:\n return 1 if x >= 1 else 0\n else:\n if x <= h_burger[l - 1] + 1:\n return num_patties(l - 1, x - 1)\n elif x == h_burger[l - 1] + 2:\n return p_burger[l - 1] + 1\n else:\n return p_burger[l - 1] + 1 + num_patties(l - 1, x - h_burger[l - 1] - 2)\n\n\nprint(num_patties(N, X))\n"} +{"fast_code_id":"4d0e6081db0eaa338bf0e0a03ab2f2ca6b400e1a4a9944d75e24b9cf6c217b62","fast_id":"p00053_4d0e6081db0eaa338bf0e0a03ab2f2ca6b400e1a4a9944d75e24b9cf6c217b62","language":"python","measured_fast_code_id":"4d0e6081db0eaa338bf0e0a03ab2f2ca6b400e1a4a9944d75e24b9cf6c217b62","measured_slow_code_id":"8cca1698214485b76a9b0e12f8e91dd9d3daa2c366ec968e4e5180fe1f6d3e7b","measurement_metric":"cpu_instruction_count","pair_id":"python_d73d83110d80265fb6d6176f","problem_id":"p00053","slow_code_id":"8cca1698214485b76a9b0e12f8e91dd9d3daa2c366ec968e4e5180fe1f6d3e7b","slow_id":"p00053_8cca1698214485b76a9b0e12f8e91dd9d3daa2c366ec968e4e5180fe1f6d3e7b","speedup":4.586143714756156,"stratum":"4-8","sampling_key":"a4270e57a7c07e27120a2fdfebfbacf0fcfebd2816a0d7d2be20bde1f1e32791","slow_code":"import math\n\nr = 105000\nsqrt = int(math.sqrt(r))\np = [1] * r\np[0] = 0\nfor i in range(1, sqrt):\n if p[i]:\n for j in range(2 * i + 1, r, i + 1):\n p[j] = 0\nwhile True:\n n = int(input())\n if not n:\n break\n i, num, sum = 0, 0, 0\n while num < n:\n if p[i] == 1:\n num += 1\n sum += i + 1\n i += 1\n print(sum)\n","fast_code":"import math\n\nr = 105000\nsqrt = int(math.sqrt(r))\np = [1] * r\np[0] = 0\nfor i in range(1, sqrt):\n if p[i]:\n for j in range(2 * i + 1, r, i + 1):\n p[j] = 0\ns = [0 for i in range(11000)]\ns[0] = 2\nk = 1\nfor i in range(2, r):\n if p[i]:\n s[k] = i + 1 + s[k - 1]\n k += 1\nwhile True:\n n = int(input())\n if not n:\n break\n print(s[n - 1])\n"} +{"fast_code_id":"342f915d160fa027967641f02b8046d86c544829302f09a6df31dd86e40f4c6c","fast_id":"p03767_342f915d160fa027967641f02b8046d86c544829302f09a6df31dd86e40f4c6c","language":"python","measured_fast_code_id":"342f915d160fa027967641f02b8046d86c544829302f09a6df31dd86e40f4c6c","measured_slow_code_id":"7693ad55686e6fd618fa19be5402464b2c1d8a6534c46b08c3072eed6c243853","measurement_metric":"cpu_instruction_count","pair_id":"python_d768141df2c7ece87b92d1e1","problem_id":"p03767","slow_code_id":"7693ad55686e6fd618fa19be5402464b2c1d8a6534c46b08c3072eed6c243853","slow_id":"p03767_7693ad55686e6fd618fa19be5402464b2c1d8a6534c46b08c3072eed6c243853","speedup":6.292825167573678,"stratum":"4-8","sampling_key":"03c23c9b15a7c57c51e2968914ba6839d84b6d643df51dc928d9e5a263726dcd","slow_code":"from collections import Counter, defaultdict, deque\nfrom heapq import heappop, heappush, heapify\nimport sys, bisect, math, itertools, fractions, pprint\n\nsys.setrecursionlimit(10**8)\nmod = 10**9 + 7\nINF = float(\"inf\")\n\n\ndef inp():\n return int(sys.stdin.readline())\n\n\ndef inpl():\n return list(map(int, sys.stdin.readline().split()))\n\n\nn = inp()\na = inpl()\na.sort(reverse=True)\ncnt = n\nind = 0\nres = 0\nwhile cnt:\n if ind % 2:\n res += a[ind]\n cnt -= 1\n ind += 1\nprint(res)\n","fast_code":"print(\n sum(\n sorted(list(map(int, exec(\"N=int(input())\") or input().split())))[\n -2 : -2 * N - 1 : -2\n ]\n )\n)\n"} +{"fast_code_id":"05f7e2460f3fd41e1d0a4a0e68deb81c5f3b00895b29aad014048cf67771eb3e","fast_id":"p03449_05f7e2460f3fd41e1d0a4a0e68deb81c5f3b00895b29aad014048cf67771eb3e","language":"python","measured_fast_code_id":"05f7e2460f3fd41e1d0a4a0e68deb81c5f3b00895b29aad014048cf67771eb3e","measured_slow_code_id":"4f58caefb49442690396b859be0085109334a84091e907cb62b5503b39be5afa","measurement_metric":"cpu_instruction_count","pair_id":"python_d7acde09970c6f74ea96e7cb","problem_id":"p03449","slow_code_id":"16e134b9190b06e98124559663599dcf24302b97cd85dfc00b6b6350ef402631","slow_id":"p03449_4f58caefb49442690396b859be0085109334a84091e907cb62b5503b39be5afa","speedup":7.066906584518042,"stratum":"4-8","sampling_key":"8709e093cbfb5ab3af9e602515977277ad3d61886353e128f29bdc8e8bc78a7f","slow_code":"import sys\n\n\ndef dfs(x: int, y: int):\n if y == 1 and x == (N - 1):\n return A[y][x]\n elif y > 1 or x > N - 1:\n return 0\n else:\n return max(dfs(x + 1, y), dfs(x, y + 1)) + A[y][x]\n\n\ndef solve(N: int, A: \"List[List[int]]\"):\n print((dfs(0, 0)))\n return\n\n\ndef main():\n def iterate_tokens():\n for line in sys.stdin:\n for word in line.split():\n yield word\n\n tokens = iterate_tokens()\n global N, A\n N = int(next(tokens))\n A = [[int(next(tokens)) for _ in range(N)] for _ in range(2)]\n solve(N, A)\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"n, *a = list(map(int, open(0).read().split()))\nprint((max(sum(a[: i + 1] + a[n + i :]) for i in range(n))))\n"} +{"fast_code_id":"12844c51e354a563287e26419d1faf844b3e4d11f2e2aa8bd04091260f27a73b","fast_id":"p02669_12844c51e354a563287e26419d1faf844b3e4d11f2e2aa8bd04091260f27a73b","language":"python","measured_fast_code_id":"12844c51e354a563287e26419d1faf844b3e4d11f2e2aa8bd04091260f27a73b","measured_slow_code_id":"5dc16e69171829fb825a4382d7ae818d1f78cf50ef12255ba28fcf6c6591e0e1","measurement_metric":"cpu_instruction_count","pair_id":"python_d8069bda0174f13fedec7bcf","problem_id":"p02669","slow_code_id":"ca3505b4e5755f2e5a6dda25d2ba0ee1f8926fae7d5ee6e43c499cad98b2e89b","slow_id":"p02669_5dc16e69171829fb825a4382d7ae818d1f78cf50ef12255ba28fcf6c6591e0e1","speedup":7.712550600468771,"stratum":"4-8","sampling_key":"0f1e6b3e476431c529945342acdcd49509d7f509707ab49324fe2db0ab354633","slow_code":"import sys\n\ndivs = [2, 3, 5]\nt = int(eval(input()))\nfor _ in range(t):\n n, a, b, c, d = list(map(int, input().split()))\n costs = [a, b, c]\n dp = {}\n\n def dfs(x):\n if x in dp:\n return dp[x]\n\n if x == 0:\n dp[x] = 0\n return dp[x]\n ret = x * d\n for i in range(-4, 5):\n if x - i < 0:\n continue\n nx = x - i\n for cost, div in zip(costs, divs):\n if nx % div != 0 or nx // div >= x:\n continue\n ret = min(ret, dfs(nx // div) + cost + abs(i) * d)\n dp[x] = ret\n return ret\n\n print((dfs(n)))\n","fast_code":"from functools import lru_cache\n\nT = int(eval(input()))\n\n\ndef resolver(a, b, c, d):\n @lru_cache(maxsize=None)\n def _resolver(n):\n if n == 0:\n return 0\n elif n == 1:\n return d\n else:\n div5f = n // 5\n div5c = (n + 4) // 5\n div3f = n // 3\n div3c = (n + 2) // 3\n div2f = n // 2\n div2c = (n + 1) // 2\n return min(\n d * n,\n d * abs(n - div5f * 5) + c + _resolver(div5f),\n d * abs(n - div5c * 5) + c + _resolver(div5c),\n d * abs(n - div3f * 3) + b + _resolver(div3f),\n d * abs(n - div3c * 3) + b + _resolver(div3c),\n d * abs(n - div2f * 2) + a + _resolver(div2f),\n d * abs(n - div2c * 2) + a + _resolver(div2c),\n )\n\n return _resolver\n\n\nfor _ in range(T):\n N, A, B, C, D = list(map(int, input().split(\" \")))\n print((resolver(A, B, C, D)(N)))\n"} +{"fast_code_id":"42fd946296e2cc4c45de3a87d9546d1fa8f9bc0670b53e142fd1806c927bbecc","fast_id":"p03816_42fd946296e2cc4c45de3a87d9546d1fa8f9bc0670b53e142fd1806c927bbecc","language":"python","measured_fast_code_id":"42fd946296e2cc4c45de3a87d9546d1fa8f9bc0670b53e142fd1806c927bbecc","measured_slow_code_id":"cd261cf88c872972dfadc5364a7357c78d05140e7f65e08d32b89b2d58b8f04e","measurement_metric":"cpu_instruction_count","pair_id":"python_d807dc34a4fe070523fae949","problem_id":"p03816","slow_code_id":"896723e2bf76bb96b8b6635af7130472456bbc356c9112c262e864be4b09cbcb","slow_id":"p03816_cd261cf88c872972dfadc5364a7357c78d05140e7f65e08d32b89b2d58b8f04e","speedup":6.025688544151045,"stratum":"4-8","sampling_key":"332541c556bf12676c9a8ec6f6d97ebc878553098004a03cbcfe12f65113a1b7","slow_code":"import sys\nfrom collections import Counter\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef list2d(a, b, c):\n return [[c] * b for i in range(a)]\n\n\ndef list3d(a, b, c, d):\n return [[[d] * c for j in range(b)] for i in range(a)]\n\n\ndef list4d(a, b, c, d, e):\n return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]\n\n\ndef ceil(x, y=1):\n return int(-(-x // y))\n\n\ndef INT():\n return int(eval(input()))\n\n\ndef MAP():\n return list(map(int, input().split()))\n\n\ndef LIST(N=None):\n return list(MAP()) if N is None else [INT() for i in range(N)]\n\n\ndef Yes():\n print(\"Yes\")\n\n\ndef No():\n print(\"No\")\n\n\ndef YES():\n print(\"YES\")\n\n\ndef NO():\n print(\"NO\")\n\n\nsys.setrecursionlimit(10**9)\nINF = 10**18\nMOD = 10**9 + 7\nN = INT()\nA = LIST()\nC = Counter(A)\nfor k in list(C.keys()):\n C[k] -= 1\ncnt = ceil(sum(C.values()), 2)\nans = N - cnt * 2\nprint(ans)\n","fast_code":"N = int(eval(input()))\nK = len(set(input().split()))\nprint((K + K % 2 - 1))\n"} +{"fast_code_id":"715c50a0bd5503a1c5a8f5900a3590d1b55c78b7a98e77c948ef59c2a023b3ea","fast_id":"p02732_715c50a0bd5503a1c5a8f5900a3590d1b55c78b7a98e77c948ef59c2a023b3ea","language":"python","measured_fast_code_id":"715c50a0bd5503a1c5a8f5900a3590d1b55c78b7a98e77c948ef59c2a023b3ea","measured_slow_code_id":"146a37262042dc730222f98e3fdd20f6c1c81f3ed31e13dbb8d26ee28772d689","measurement_metric":"cpu_instruction_count","pair_id":"python_d87b77bacc2d5775d20c5a44","problem_id":"p02732","slow_code_id":"146a37262042dc730222f98e3fdd20f6c1c81f3ed31e13dbb8d26ee28772d689","slow_id":"p02732_146a37262042dc730222f98e3fdd20f6c1c81f3ed31e13dbb8d26ee28772d689","speedup":12.129339059768391,"stratum":"8+","sampling_key":"2606c31141d9f394afb3f406fcd3c9589eb866890f03679437412972d6789a65","slow_code":"c = [0] * 8**6\n_, a = open(0)\n(*a,) = list(map(int, a.split()))\nfor i in a:\n c[i] += 1\ns = sum(i * ~-i // 2 for i in c)\nprint((\" \".join(str(s - c[i] + 1) for i in a)))\n","fast_code":"from functools import reduce\n\n\ndef d_banned_k():\n from collections import Counter\n from functools import reduce\n\n N = int(eval(input()))\n A = [int(i) for i in input().split()]\n\n def comb(n, r):\n numerator = reduce(lambda x, y: x * y, list(range(n, n - r, -1)))\n denominator = reduce(lambda x, y: x * y, list(range(1, r + 1)))\n return numerator // denominator\n\n count = Counter(A)\n total = sum(comb(c, 2) for c in list(count.values()))\n ans = []\n for a in A:\n v = count[a]\n ans.append(total - comb(v, 2) + comb(v - 1, 2))\n return \" \".join(map(str, ans))\n\n\nprint((d_banned_k()))\n"} +{"fast_code_id":"bfc4c1ae7dba827465bf8486f4249db0d38b97d72f9334848abff56e1a4fce08","fast_id":"p03343_bfc4c1ae7dba827465bf8486f4249db0d38b97d72f9334848abff56e1a4fce08","language":"python","measured_fast_code_id":"bfc4c1ae7dba827465bf8486f4249db0d38b97d72f9334848abff56e1a4fce08","measured_slow_code_id":"d3ddc9032d72667751284d07a5476c420b8766450a022df883dd1a2fa4ed31f6","measurement_metric":"cpu_instruction_count","pair_id":"python_d8b58a6b091fb7c16d7c344f","problem_id":"p03343","slow_code_id":"7488c929e8b3d65a47a4f6f1e17951da209714f6e8f251e4843a3635aa459b59","slow_id":"p03343_d3ddc9032d72667751284d07a5476c420b8766450a022df883dd1a2fa4ed31f6","speedup":346.97474890290965,"stratum":"8+","sampling_key":"01af069aa9605797d91dfd8134be00ace9ee438db82c8be3572f8fa541975aba","slow_code":"import sys\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef list2d(a, b, c):\n return [[c] * b for i in range(a)]\n\n\ndef list3d(a, b, c, d):\n return [[[d] * c for j in range(b)] for i in range(a)]\n\n\ndef list4d(a, b, c, d, e):\n return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]\n\n\ndef ceil(x, y=1):\n return int(-(-x // y))\n\n\ndef INT():\n return int(eval(input()))\n\n\ndef MAP():\n return list(map(int, input().split()))\n\n\ndef LIST(N=None):\n return list(MAP()) if N is None else [INT() for i in range(N)]\n\n\ndef Yes():\n print(\"Yes\")\n\n\ndef No():\n print(\"No\")\n\n\ndef YES():\n print(\"YES\")\n\n\ndef NO():\n print(\"NO\")\n\n\nsys.setrecursionlimit(10**9)\nINF = 10**18\nMOD = 10**9 + 7\nN, K, Q = MAP()\nA = LIST()\nans = INF\n\nfor x in A:\n\n B = []\n tmp = []\n for i in range(N):\n if A[i] >= x:\n tmp.append(A[i])\n else:\n B.append(tmp)\n tmp = []\n B.append(tmp)\n\n C = []\n for li in B:\n m = len(li)\n if m - K + 1 >= 1:\n li.sort()\n C += li[: m - K + 1]\n\n C.sort()\n if len(C) < Q:\n continue\n y = C[Q - 1]\n ans = min(ans, y - x)\nprint(ans)\n","fast_code":"N, K, Q = list(map(int, input().split()))\na = list(map(int, input().split()))\nd = [a]\na = sorted(a)\nans = a[Q - 1] - a[0]\nwhile True:\n d_temp = list()\n sub_temp = list()\n for sub in d:\n for c in sub:\n if c != a[0]:\n sub_temp.append(c)\n else:\n d_temp.append(sub_temp)\n sub_temp = list()\n d_temp.append(sub_temp)\n sub_temp = list()\n d = list()\n a = list()\n for sub in d_temp:\n if len(sub) < K:\n continue\n else:\n d.append(sub)\n sub = sorted(sub)\n a.extend(sub[0 : len(sub) - K + 1])\n a.sort()\n if len(a) < Q:\n break\n else:\n ans = min(ans, a[Q - 1] - a[0])\nprint(ans)\n"} +{"fast_code_id":"b6fc8ed8192c5f68a9f625043fabee60b0ca872cecc31eb34df8cfab411d7f15","fast_id":"p03835_b6fc8ed8192c5f68a9f625043fabee60b0ca872cecc31eb34df8cfab411d7f15","language":"python","measured_fast_code_id":"b6fc8ed8192c5f68a9f625043fabee60b0ca872cecc31eb34df8cfab411d7f15","measured_slow_code_id":"3d7320785c61c24a89b1b6741c3ec5ce92d03915fd1321e20d11d8d0742fbcb1","measurement_metric":"cpu_instruction_count","pair_id":"python_d8eb852e76915815a26a7efb","problem_id":"p03835","slow_code_id":"3d7320785c61c24a89b1b6741c3ec5ce92d03915fd1321e20d11d8d0742fbcb1","slow_id":"p03835_3d7320785c61c24a89b1b6741c3ec5ce92d03915fd1321e20d11d8d0742fbcb1","speedup":125.25413889210309,"stratum":"8+","sampling_key":"06d527469ca218c7dbf60dbfefc0142789cb363e1dea455bdfcb131250b0d415","slow_code":"k, s = list(map(int, input().split()))\ncount = 0\nfor x in range(min(s + 1, k + 1)):\n for y in range(min(s + 1 - x, k + 1)):\n if 0 <= s - x - y <= k:\n count += 1\nprint(count)\n","fast_code":"K, S = list(map(int, input().split()))\ncount = 0\nfor i in range(K + 1):\n if 0 <= S - i < K:\n count += S - i + 1\n elif K <= S - i <= 2 * K:\n count += 2 * K - S + i + 1\n else:\n continue\nprint(count)\n"} +{"fast_code_id":"a6f05f6814aaa0e64e66c755f9624bcbdfa7a7a1ce27b874109a71ffed4e3de3","fast_id":"p03183_a6f05f6814aaa0e64e66c755f9624bcbdfa7a7a1ce27b874109a71ffed4e3de3","language":"python","measured_fast_code_id":"a6f05f6814aaa0e64e66c755f9624bcbdfa7a7a1ce27b874109a71ffed4e3de3","measured_slow_code_id":"961ff7e33dcf41c91be9ccd5c27fe0c80e6fd0d2467fec260e8393b575caab59","measurement_metric":"cpu_instruction_count","pair_id":"python_d9225abf3d7add939e946692","problem_id":"p03183","slow_code_id":"961ff7e33dcf41c91be9ccd5c27fe0c80e6fd0d2467fec260e8393b575caab59","slow_id":"p03183_961ff7e33dcf41c91be9ccd5c27fe0c80e6fd0d2467fec260e8393b575caab59","speedup":2.7910649414785964,"stratum":"2-4","sampling_key":"aa2d3e097e800ab9fb4862d3ab29fe3869bce4d6a35bdb642873c370eff94dcf","slow_code":"import sys\n\nsys.setrecursionlimit(2147483647)\nINF = float(\"inf\")\nMOD = 10**9 + 7\ninput = lambda: sys.stdin.readline().rstrip()\n\n\ndef resolve():\n from functools import cmp_to_key\n\n n = int(eval(input()))\n B = [list(map(int, input().split())) for _ in range(n)]\n\n def cmp(a, b):\n va = min(a[1], b[1] - a[0])\n vb = min(b[1], a[1] - b[0])\n if va == vb:\n return 0\n return -1 if (va > vb) else 1\n\n B.sort(key=cmp_to_key(cmp))\n maxS = 20000\n dp = [-INF] * (maxS + 1)\n dp[0] = 0\n for i in range(n):\n w, s, v = B[i]\n ndp = dp[:]\n for total in range(maxS + 1):\n if total <= s and total + s <= maxS:\n ndp[total + w] = max(ndp[total + w], dp[total] + v)\n dp = ndp[:]\n print((max(dp)))\n\n\nresolve()\n","fast_code":"import sys\n\nn = int(eval(input()))\nblocks = []\nfor line in sys.stdin.readlines():\n w, s, v = list(map(int, line.split()))\n blocks.append((w + s, w, s, v))\nblocks.sort()\ndp = [-1] * 20001\ndp[0] = 0\nfor _, w, s, v in blocks:\n for i in range(min(s, 20000 - w), -1, -1):\n dp[i + w] = max(dp[i + w], dp[i] + v)\nprint((max(dp)))\n"} +{"fast_code_id":"44be25f53df0ca596505e4d9b67f2cfd23a3c35d2b23c46b5226914d16aa5a4d","fast_id":"p00008_44be25f53df0ca596505e4d9b67f2cfd23a3c35d2b23c46b5226914d16aa5a4d","language":"python","measured_fast_code_id":"44be25f53df0ca596505e4d9b67f2cfd23a3c35d2b23c46b5226914d16aa5a4d","measured_slow_code_id":"6416a1af430d22e4317003c285ed4eeee1f686ff822437db32029df946b2fc8b","measurement_metric":"cpu_instruction_count","pair_id":"python_d9571caff9bab4b4f77559c2","problem_id":"p00008","slow_code_id":"6416a1af430d22e4317003c285ed4eeee1f686ff822437db32029df946b2fc8b","slow_id":"p00008_6416a1af430d22e4317003c285ed4eeee1f686ff822437db32029df946b2fc8b","speedup":462.62022812239263,"stratum":"8+","sampling_key":"2b3eb8fe03a7e69656f61daea2d6a14cadde3e963486dace1cf4b08dbd17a072","slow_code":"import sys\n\na = [0] * 51\nx = list(range(10))\nfor i in range(51):\n a[i] = sum([1 for p in x for q in x for r in x for s in x if p + q + r + s == i])\nfor e in sys.stdin:\n print((a[int(e)]))\n","fast_code":"import sys\nimport math\n\n\ndef nCr(n, k):\n if 0 <= k <= n:\n nk, kk = 1, 1\n for t in range(1, min(k, n - k) + 1):\n nk = nk * n\n kk = kk * t\n n -= 1\n return nk // kk\n else:\n return 0\n\n\np = [0] * 51\nv = 0\nfor i in range(19):\n t = nCr(i + 3, i)\n v = v + 4 * nCr(i - 8, i - 10)\n p[i] = t - v\n p[36 - i] = p[i]\nfor i in sys.stdin:\n print((p[int(i)]))\n"} +{"fast_code_id":"9d1e473514c6a71a3244a0027e10b89e0236728afc6e0ba30cdceb79e515e8aa","fast_id":"p02830_56ce968a0eb7b0bfb6e6f7c8c3c05db41af520c88dc8b8c3377c4aef5519887b","language":"python","measured_fast_code_id":"56ce968a0eb7b0bfb6e6f7c8c3c05db41af520c88dc8b8c3377c4aef5519887b","measured_slow_code_id":"241afa9a4a462ffb4a4454131541737b779c1c29e81784f31982be1ef01be8e4","measurement_metric":"cpu_instruction_count","pair_id":"python_d9ea16159608508899d32a39","problem_id":"p02830","slow_code_id":"241afa9a4a462ffb4a4454131541737b779c1c29e81784f31982be1ef01be8e4","slow_id":"p02830_241afa9a4a462ffb4a4454131541737b779c1c29e81784f31982be1ef01be8e4","speedup":14.406417231327593,"stratum":"8+","sampling_key":"01495e2e6664e8d0d45a2ae1efd68fef7857111f4631cc76ad848e83cec7a112","slow_code":"from collections import Counter, defaultdict, deque\nfrom heapq import heappop, heappush, heapify\nimport sys, bisect, math, itertools, fractions, pprint\n\nsys.setrecursionlimit(10**8)\nmod = 10**9 + 7\nmod2 = 998244353\nINF = float(\"inf\")\n\n\ndef inp():\n return int(sys.stdin.readline())\n\n\ndef inpl():\n return list(map(int, sys.stdin.readline().split()))\n\n\ndef inpln(n):\n return list(int(sys.stdin.readline()) for i in range(n))\n\n\nn = inp()\ns, t = input().split()\nres = \"\"\nfor i in range(n):\n res += s[i] + t[i]\nprint(res)\n","fast_code":"def main():\n import sys\n\n input = sys.stdin.readline\n sys.setrecursionlimit(10**7)\n from collections import Counter, deque\n\n from itertools import combinations, permutations, accumulate, groupby\n\n from bisect import bisect_left, bisect_right\n from heapq import heapify, heappop, heappush\n from math import floor, ceil\n\n n = int(eval(input()))\n s, t = input().rstrip().split()\n res = \"\"\n for i in range(n):\n res += s[i]\n res += t[i]\n print(res)\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"cd83c8bda15ceef29f903811f2397dc1513e7010c35f8313b768f7645bd23706","fast_id":"p03962_cd83c8bda15ceef29f903811f2397dc1513e7010c35f8313b768f7645bd23706","language":"python","measured_fast_code_id":"cd83c8bda15ceef29f903811f2397dc1513e7010c35f8313b768f7645bd23706","measured_slow_code_id":"48bec3c2d6a89992428272affb6b0f4ee6481385f2bb025348256f99dafa1fc7","measurement_metric":"cpu_instruction_count","pair_id":"python_da5a5fc37e98e9cd1a728aab","problem_id":"p03962","slow_code_id":"48bec3c2d6a89992428272affb6b0f4ee6481385f2bb025348256f99dafa1fc7","slow_id":"p03962_48bec3c2d6a89992428272affb6b0f4ee6481385f2bb025348256f99dafa1fc7","speedup":2.351947870706317,"stratum":"2-4","sampling_key":"1c474017a23f46003d29adab25aac1275846f19b0b69384cfd4e2955339abc45","slow_code":"from collections import Counter\n\nA, B, C = list(map(int, input().split()))\nprint((len(Counter([A, B, C]).most_common())))\n","fast_code":"s = set(input().split())\nprint((len(s)))\n"} +{"fast_code_id":"72413e6af8b51441291a1bea2384cdc8afa9b2461321c9349dcffb4b86cd4b48","fast_id":"p02394_72413e6af8b51441291a1bea2384cdc8afa9b2461321c9349dcffb4b86cd4b48","language":"python","measured_fast_code_id":"72413e6af8b51441291a1bea2384cdc8afa9b2461321c9349dcffb4b86cd4b48","measured_slow_code_id":"c88e86f1ad95ddc817ad7ba81628e2daf211ff2d39c36960f050623a40ae12a3","measurement_metric":"cpu_instruction_count","pair_id":"python_dae14f68695e8da72900371c","problem_id":"p02394","slow_code_id":"b3a430d2365496f9f536fa4236fe45d9a45c9a6c0f910f1eae517487e3d1e97c","slow_id":"p02394_c88e86f1ad95ddc817ad7ba81628e2daf211ff2d39c36960f050623a40ae12a3","speedup":2.8582706605394446,"stratum":"2-4","sampling_key":"9c94c1a2b8d308ea76c8e0ad56ea6803384f7c002fba68a637f7bb97d376ee2d","slow_code":"import math\n\n\ndef func():\n try:\n line = input().rstrip()\n numbers = line.split(\" \")\n width = float(numbers[0])\n height = float(numbers[1])\n x = float(numbers[2])\n y = float(numbers[3])\n r = abs(float(numbers[4]))\n except:\n print(\"input error\")\n return -1\n wsign = math.copysign(1, width)\n hsign = math.copysign(1, height)\n result = wsign * x + r <= wsign * width\n result = result and (wsign * x - r >= 0)\n result = result and (hsign * y + r <= hsign * height)\n result = result and (hsign * y - r >= 0)\n if result:\n print(\"Yes\")\n else:\n print(\"No\")\n\n\nfunc()\n","fast_code":"w, h, x, y, r = list(map(int, input().split()))\nif min([x, y, w - x, h - y]) >= r:\n print(\"Yes\")\nelse:\n print(\"No\")\n"} +{"fast_code_id":"543ee6d0e81691fcafec5a2b260b0d8f3e49adb766d2156505b28d551aba5051","fast_id":"p00022_543ee6d0e81691fcafec5a2b260b0d8f3e49adb766d2156505b28d551aba5051","language":"python","measured_fast_code_id":"543ee6d0e81691fcafec5a2b260b0d8f3e49adb766d2156505b28d551aba5051","measured_slow_code_id":"a5086560b3d72499a535710346e1969d90deaa71ee9f102e4fab549979daedfd","measurement_metric":"cpu_instruction_count","pair_id":"python_db338b455b3f606adf97cf14","problem_id":"p00022","slow_code_id":"a5086560b3d72499a535710346e1969d90deaa71ee9f102e4fab549979daedfd","slow_id":"p00022_a5086560b3d72499a535710346e1969d90deaa71ee9f102e4fab549979daedfd","speedup":2.2933864385284797,"stratum":"2-4","sampling_key":"1e4c85fc712a8940f7923544b42e10acd8f1c17483efec6740e29979a227523f","slow_code":"n = eval(input())\nwhile n:\n x = -100000\n m = x\n s = 0\n while n:\n a = eval(input())\n x = max(x, 0) + a\n m = max(m, x)\n n -= 1\n print(m)\n n = eval(input())\n","fast_code":"while 1:\n n = int(input())\n if n == 0:\n break\n A = [0] * n\n for i in range(n):\n A[i] = int(input())\n for i in range(1, len(A)):\n A[i] = max(A[i - 1] + A[i], A[i])\n print(max(A))\n"} +{"fast_code_id":"3cdff8e4175870a02e4061206fd8f6e8c2d7f81e837019cd00e38a6f5ab341db","fast_id":"p02792_3cdff8e4175870a02e4061206fd8f6e8c2d7f81e837019cd00e38a6f5ab341db","language":"python","measured_fast_code_id":"3cdff8e4175870a02e4061206fd8f6e8c2d7f81e837019cd00e38a6f5ab341db","measured_slow_code_id":"6bce5f1b18bfce6f3d79b55336d09466ee2945ec4e42c5bafb7e1b38ef1cfdff","measurement_metric":"cpu_instruction_count","pair_id":"python_db8b9a31f2a8f192f5f3a555","problem_id":"p02792","slow_code_id":"6bce5f1b18bfce6f3d79b55336d09466ee2945ec4e42c5bafb7e1b38ef1cfdff","slow_id":"p02792_6bce5f1b18bfce6f3d79b55336d09466ee2945ec4e42c5bafb7e1b38ef1cfdff","speedup":5.546020078609009,"stratum":"4-8","sampling_key":"4bf31c415e4bc99b8ad0f31692b06a8254c2c5e3846e1274e3fc7896a91f356e","slow_code":"n = int(eval(input()))\nl = [0 for _ in range(100)]\nfor i in range(1, n + 1):\n l[int(str(i)[0] + str(i)[-1])] += 1\nprint((sum([l[i * 10 + j] * l[j * 10 + i] for i in range(10) for j in range(10)])))\n","fast_code":"from itertools import product\n\n\ndef solve(string):\n d = len(string)\n if d == 1:\n return string\n s0, ss, sn = int(string[0]), int(string[1:-1] or 0), int(string[-1])\n t = [[0] * 10] + [[int(\"1\" * (d - 2) or 0)] * 10 for _ in range(9)]\n for i in range(1, 10):\n t[i][i] += 1\n for i, j in product(list(range(1, s0)), list(range(10))):\n t[i][j] += 10 ** (d - 2)\n for j in range(sn + 1):\n t[s0][j] += ss + 1\n for j in range(sn + 1, 10):\n t[s0][j] += ss\n return str(sum(t[i][j] * t[j][i] for i, j in product(list(range(1, 10)), repeat=2)))\n\n\nif __name__ == \"__main__\":\n import sys\n\n print((solve(sys.stdin.read().strip())))\n"} +{"fast_code_id":"8cfc9f937b723931b5cd7357c864c9e279129146637c449ea835ec0921d5bc89","fast_id":"p03126_8cfc9f937b723931b5cd7357c864c9e279129146637c449ea835ec0921d5bc89","language":"python","measured_fast_code_id":"8cfc9f937b723931b5cd7357c864c9e279129146637c449ea835ec0921d5bc89","measured_slow_code_id":"cba8544a349f34548c0cfacd2e62b0d692bf5fdacfd135926ebf79dcf82a2da4","measurement_metric":"cpu_instruction_count","pair_id":"python_dba2b840c2373d9fa3afe0b3","problem_id":"p03126","slow_code_id":"0dc68db287c1c51e9e3ae700494383cca10de9412a38ef778d71183366a2ba69","slow_id":"p03126_cba8544a349f34548c0cfacd2e62b0d692bf5fdacfd135926ebf79dcf82a2da4","speedup":5.615407210646876,"stratum":"4-8","sampling_key":"1e099c855ace4dc2ceb9565bd632177488672851157ffd92dc12bf2ba05e454f","slow_code":"N, M = list(map(int, input().split()))\nlist = [list(map(int, input().split())) for x in range(N)]\n\nfor i in range(0, N):\n list[i].pop(0)\nstock = []\n\nfor i in range(0, N):\n for j in range(0, len(list[i])):\n cnt = 0\n for k in range(0, N):\n if list[i][j] in list[k]:\n cnt += 1\n if cnt == N:\n stock.append(list[i][j])\nif N == 1:\n stock = list[i]\nprint((len(set(stock))))\n","fast_code":"n, m = list(map(int, input().split()))\nx = [0] * (m + 1)\nfor i in range(n):\n d = list(map(int, input().split()))\n for i in d[1:]:\n x[i] += 1\nprint((x.count(n)))\n"} +{"fast_code_id":"892b4d0aacbf5de49ae7067af539aae6d846f8cdf28dfcc12f0bc80d88944e7b","fast_id":"p02675_892b4d0aacbf5de49ae7067af539aae6d846f8cdf28dfcc12f0bc80d88944e7b","language":"python","measured_fast_code_id":"892b4d0aacbf5de49ae7067af539aae6d846f8cdf28dfcc12f0bc80d88944e7b","measured_slow_code_id":"2d3c735c213ec81bc8c26091e19ebd8461e366cff4fed305d8b06c8c2e49be9d","measurement_metric":"cpu_instruction_count","pair_id":"python_dbb78f6f3817ddfb99250da4","problem_id":"p02675","slow_code_id":"da5a21f4ebfb4d44ad88c7f5db5f559a60e0742e11d07068514eea6e5e1d7a49","slow_id":"p02675_2d3c735c213ec81bc8c26091e19ebd8461e366cff4fed305d8b06c8c2e49be9d","speedup":5.042545565186544,"stratum":"4-8","sampling_key":"1f9481429955752577950786ae10c2a25df32594d06f06cf0f266b868839f2de","slow_code":"import sys\nimport math\nimport collections\nimport itertools\nimport bisect\n\nINF = 10**13\nMOD = 10**9 + 7\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef gcd(x, y):\n return x if y == 0 else gcd(y, x % y)\n\n\ndef lcm(x, y):\n return (x * y) // gcd(x, y)\n\n\ndef I():\n return int(input())\n\n\ndef LI():\n return [int(x) for x in input().split()]\n\n\ndef RI(N):\n return [int(input()) for _ in range(N)]\n\n\ndef LRI(N):\n return [[int(x) for x in input().split()] for _ in range(N)]\n\n\ndef LS():\n return input().split()\n\n\ndef RS(N):\n return [input() for _ in range(N)]\n\n\ndef LRS(N):\n return [input().split() for _ in range(N)]\n\n\ndef PL(L):\n print(*L, sep=\"\\n\")\n\n\ndef YesNo(B):\n print(\"Yes\" if B else \"No\")\n\n\ndef YESNO(B):\n print(\"YES\" if B else \"NO\")\n\n\nN = input()\nn = int(N[-1])\nif n in [2, 4, 5, 7, 9]:\n print(\"hon\")\nelif n in [0, 1, 6, 8]:\n print(\"pon\")\nelse:\n print(\"bon\")\n","fast_code":"n = int(eval(input()))\nn = n % 10\nif n in (2, 4, 5, 7, 9):\n yomi = \"hon\"\nif n in (0, 1, 6, 8):\n yomi = \"pon\"\nif n == 3:\n yomi = \"bon\"\nprint(yomi)\n"} +{"fast_code_id":"c4caeaf3f2b3e435f88e64270a48fa33a3ecfd032a1a5cc76e2bf1b78584e822","fast_id":"p03244_c4caeaf3f2b3e435f88e64270a48fa33a3ecfd032a1a5cc76e2bf1b78584e822","language":"python","measured_fast_code_id":"c4caeaf3f2b3e435f88e64270a48fa33a3ecfd032a1a5cc76e2bf1b78584e822","measured_slow_code_id":"100838eb35611188aaa0e6508544517c0abf47ad6e005b321a85725c0e9840dd","measurement_metric":"cpu_instruction_count","pair_id":"python_dc052e6a4299859b134c8eff","problem_id":"p03244","slow_code_id":"a39b059af4b03221115ad0dd54a76e5f423fd6c8173a18ffdbed4e08ab13360c","slow_id":"p03244_100838eb35611188aaa0e6508544517c0abf47ad6e005b321a85725c0e9840dd","speedup":172.81354702701162,"stratum":"8+","sampling_key":"550016ca8c6f1da1fe051424b3a4fedbda2334868172b7f42e848f701e2b62bb","slow_code":"import numpy as np\n\neven = np.zeros(100001, dtype=int)\nodd = np.zeros(100001, dtype=int)\nn = int(eval(input()))\nv = list(map(int, input().split()))\nfor i in range(n):\n if i % 2 == 0:\n even[v[i]] += 1\n else:\n odd[v[i]] += 1\ne1 = even.argmax()\ne1n = even.max()\no1 = odd.argmax()\no1n = odd.max()\n\nif e1 == o1:\n e2n = np.sort(even)[-2]\n o2n = np.sort(odd)[-2]\n\n print((min(n - e1n - o2n, n - e2n - o1n)))\nelse:\n print((n - e1n - o1n))\n","fast_code":"from collections import Counter\n\nn = int(eval(input()))\nv = list(map(int, input().split()))\nv1 = Counter(v[::2]).most_common()\nv2 = Counter(v[1::2]).most_common()\nv1.append((0, 0))\nv2.append((0, 0))\nans = n\nif v1[0][0] == v2[0][0]:\n ans -= max(v1[0][1] + v2[1][1], v1[1][1] + v2[0][1])\nelse:\n ans -= v1[0][1] + v2[0][1]\nprint(ans)\n"} +{"fast_code_id":"655025d4e7fb7360a06ff4b388f9b4c61d7fddcf0c03a2cfc141f02d66540614","fast_id":"p02392_655025d4e7fb7360a06ff4b388f9b4c61d7fddcf0c03a2cfc141f02d66540614","language":"python","measured_fast_code_id":"655025d4e7fb7360a06ff4b388f9b4c61d7fddcf0c03a2cfc141f02d66540614","measured_slow_code_id":"359da708050d63872f0ebf54c13ede0cb7a857b20ddb07202d171041a7782310","measurement_metric":"cpu_instruction_count","pair_id":"python_dc1132c2a117333211e4d912","problem_id":"p02392","slow_code_id":"359da708050d63872f0ebf54c13ede0cb7a857b20ddb07202d171041a7782310","slow_id":"p02392_359da708050d63872f0ebf54c13ede0cb7a857b20ddb07202d171041a7782310","speedup":487.8895363933043,"stratum":"8+","sampling_key":"3b932bc81d06481c9b34c8d99b3c91e7b874d267346c302938f45fcb77bf3398","slow_code":"import sys\n\nif __name__ == \"__main__\":\n import doctest\n\n doctest.testmod()\n a, b, c = list(map(int, sys.stdin.read().split()))\n if a < b < c:\n print(\"Yes\")\n else:\n print(\"No\")\n","fast_code":"(a, b, c) = input().rstrip().split(\" \")\na = int(a)\nb = int(b)\nc = int(c)\nif a < b < c:\n print(\"Yes\")\nelse:\n print(\"No\")\n"} +{"fast_code_id":"b9b377895112e4c99f6470ef8bdf76c96f8f88338618602457f984055da5d8d7","fast_id":"p02848_b9b377895112e4c99f6470ef8bdf76c96f8f88338618602457f984055da5d8d7","language":"python","measured_fast_code_id":"b9b377895112e4c99f6470ef8bdf76c96f8f88338618602457f984055da5d8d7","measured_slow_code_id":"7dc27a09ef2c9b461fbcb4fe978ad658f28d48d6f3e4857cd289415097f687c2","measurement_metric":"cpu_instruction_count","pair_id":"python_dc47a204e8fc7173930cb670","problem_id":"p02848","slow_code_id":"7dc27a09ef2c9b461fbcb4fe978ad658f28d48d6f3e4857cd289415097f687c2","slow_id":"p02848_7dc27a09ef2c9b461fbcb4fe978ad658f28d48d6f3e4857cd289415097f687c2","speedup":2.8721973161580467,"stratum":"2-4","sampling_key":"7d13568ef59d1c7364663a3e1a6a404d26cf948409674494ca876fd6b6ad107b","slow_code":"N = int(input())\nS = input()\nfor s in S:\n ans = chr((ord(s) - ord(\"A\") + N) % 26 + ord(\"A\"))\n print(ans, end=\"\")\n","fast_code":"s = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\nn = int(input())\nx = input()\na = ord(\"A\")\nprint(\"\".join([s[(ord(c) - a + n) % 26] for c in x]))\n"} +{"fast_code_id":"b08b63949d5a0d136cf4abbcf8d58f0dfce1c51147939885ca0da7ecb15e7dd4","fast_id":"p02770_1d04958ffbdbddcd269fad8373f24a6d7b9d37ba405ef0ceba28eac485c84265","language":"python","measured_fast_code_id":"1d04958ffbdbddcd269fad8373f24a6d7b9d37ba405ef0ceba28eac485c84265","measured_slow_code_id":"7f1c6212437f5dfde41ac56fb777a6413a36acf30f0fa1db841babde5bb8abca","measurement_metric":"cpu_instruction_count","pair_id":"python_dc6aee1aefb7d0dc7e10161a","problem_id":"p02770","slow_code_id":"7f1c6212437f5dfde41ac56fb777a6413a36acf30f0fa1db841babde5bb8abca","slow_id":"p02770_7f1c6212437f5dfde41ac56fb777a6413a36acf30f0fa1db841babde5bb8abca","speedup":3.2709923277014377,"stratum":"2-4","sampling_key":"9291d4b0f82fe32a620e372d9bbd8f4666d6b35bb6bb330bf4d2a2bad6c4025b","slow_code":"import numpy as np\n\nk, q = list(map(int, input().split()))\nd = np.array(list(map(int, input().split()))).astype(np.int64)\nqueries = [tuple(map(int, input().split())) for _ in range(q)]\nfor n, x, m in queries:\n d_mod = d % m\n quotient, rem = divmod(n - 1, k)\n rem_d_mod = d_mod[:rem]\n print(\n (\n n\n - 1\n - (x % m + quotient * np.sum(d_mod) + np.sum(rem_d_mod)) // m\n - quotient * np.count_nonzero(d_mod == 0)\n - np.count_nonzero(rem_d_mod == 0)\n )\n )\n","fast_code":"def main():\n k, q = list(map(int, input().split()))\n (*d,) = list(map(int, input().split()))\n for _ in range(q):\n n, x, m = list(map(int, input().split()))\n (*g,) = [x % m for x in d]\n rep, rest = divmod(n - 1, k)\n last = x + (sum(g) * rep) + sum(g[:rest])\n eq = sum(rep + (1 if i < rest else 0) for i, gg in enumerate(g) if gg == 0)\n ans = (n - 1) - eq - (last // m - x // m)\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"477acdf83af3186335ea8ccf24f8511c3d2b173d35d09905a2d166a4b194b2ae","fast_id":"p03700_684ee93472fc0aefac037f153cc0013c6236e7706d26c5c00b062027b4672b35","language":"python","measured_fast_code_id":"684ee93472fc0aefac037f153cc0013c6236e7706d26c5c00b062027b4672b35","measured_slow_code_id":"4f614769a7e22dddcb85c7a9aa9d9cee3d9896b34340a1e7d8590ac4705426eb","measurement_metric":"cpu_instruction_count","pair_id":"python_dc93a179a19fa63109759b69","problem_id":"p03700","slow_code_id":"4f614769a7e22dddcb85c7a9aa9d9cee3d9896b34340a1e7d8590ac4705426eb","slow_id":"p03700_4f614769a7e22dddcb85c7a9aa9d9cee3d9896b34340a1e7d8590ac4705426eb","speedup":3.166774247358761,"stratum":"2-4","sampling_key":"28b7410c8e008bdd969c8d6978d086c916718d4d88ffc8c89b88f6e207d8c844","slow_code":"import numpy as np\n\nN, A, B = list(map(int, input().split()))\nH = np.zeros(shape=N, dtype=\"int64\")\nfor _ in range(N):\n h = int(eval(input()))\n H[_] = h\n\n\ndef calc(num, a):\n a -= num * B\n a = (a - 1) // (A - B) + 1\n if sum(a[a > 0]) <= num:\n return True\n else:\n return False\n\n\nstart = 0\nend = 10**10\nwhile end - start > 1:\n mid = (start + end) // 2\n if calc(mid, H.copy()):\n end = mid\n else:\n start = mid\nprint(end)\n","fast_code":"import math\n\nN, A, B = list(map(int, input().split()))\narr = []\nfor i in range(N):\n arr.append(int(eval(input())))\nmax_ = max(arr) // B + 1\nmin_ = min(arr) // A\nd = A - B\nwhile min_ != max_:\n mid = (max_ + min_) // 2\n sum_ = 0\n for x in arr:\n sum_ += max(0, math.ceil((x - mid * B) / d))\n if sum_ <= mid:\n max_ = mid\n else:\n min_ = mid + 1\nprint(min_)\n"} +{"fast_code_id":"f4115d423fcff42ce325ac00a8e4b76da24d8b743514f1eb1f635c77c66da87b","fast_id":"p02780_f4115d423fcff42ce325ac00a8e4b76da24d8b743514f1eb1f635c77c66da87b","language":"python","measured_fast_code_id":"f4115d423fcff42ce325ac00a8e4b76da24d8b743514f1eb1f635c77c66da87b","measured_slow_code_id":"f0e0a2a27a21da5cf3bfa118c0651e9d7851f3f79494b7c4374dbb95d552c6f4","measurement_metric":"cpu_instruction_count","pair_id":"python_dcee554e4c866b0ae61f5890","problem_id":"p02780","slow_code_id":"f0e0a2a27a21da5cf3bfa118c0651e9d7851f3f79494b7c4374dbb95d552c6f4","slow_id":"p02780_f0e0a2a27a21da5cf3bfa118c0651e9d7851f3f79494b7c4374dbb95d552c6f4","speedup":6.010114923877441,"stratum":"4-8","sampling_key":"cdbd8bf6d1698a4cc5d44c94c8e22b63a0274843dceda88c700f082e3760aad7","slow_code":"class BIT:\n def __init__(self, n):\n self.node = [0 for _ in range(n + 1)]\n\n def add(self, idx, w):\n i = idx\n while i < len(self.node) - 1:\n self.node[i] += w\n i |= i + 1\n\n def sum_(self, idx):\n ret, i = 0, idx - 1\n while i >= 0:\n ret += self.node[i]\n i = (i & (i + 1)) - 1\n return ret\n\n def sum(self, l, r):\n return self.sum_(r) - self.sum_(l)\n\n\nn, k = list(map(int, input().split()))\ntree = BIT(n)\np = [int(x) for x in input().split()]\nfor i in range(n):\n tree.add(i, (1 + p[i]) / 2)\nans = 0\nfor i in range(n - k + 1):\n ans = max(ans, tree.sum(i, i + k))\nprint(ans)\n","fast_code":"N, K = list(map(int, input().split()))\nP = list(map(int, input().split()))\nfrom itertools import accumulate\n\nacc = [0]\nacc.extend(accumulate(P))\nans = 0\nfor i in range(N - K + 1):\n exp = (acc[K + i] - acc[i] + K) / 2\n ans = max(exp, ans)\nprint(ans)\n"} +{"fast_code_id":"cfd662fb233fb80b81fb494e94f71c1fc096a6593d938f8e26b9fcde5e843e3c","fast_id":"p03035_cfd662fb233fb80b81fb494e94f71c1fc096a6593d938f8e26b9fcde5e843e3c","language":"python","measured_fast_code_id":"cfd662fb233fb80b81fb494e94f71c1fc096a6593d938f8e26b9fcde5e843e3c","measured_slow_code_id":"a03feaf840d71ae8aa582d21d70bb7cc8063992d1b30834ae4cabc43c65fc6f6","measurement_metric":"cpu_instruction_count","pair_id":"python_dd065bb956886527ec6ddb93","problem_id":"p03035","slow_code_id":"a03feaf840d71ae8aa582d21d70bb7cc8063992d1b30834ae4cabc43c65fc6f6","slow_id":"p03035_a03feaf840d71ae8aa582d21d70bb7cc8063992d1b30834ae4cabc43c65fc6f6","speedup":2.9547670097225955,"stratum":"2-4","sampling_key":"1df7e6f8a9409f715da51e87157a504d9ace7d88a5f97dc53024e9ca6ff09cfa","slow_code":"import sys, math, collections, heapq, itertools\n\nF = sys.stdin\n\n\ndef single_input():\n return F.readline().strip(\"\\n\")\n\n\ndef line_input():\n return F.readline().strip(\"\\n\").split()\n\n\ndef gcd(a, b):\n a, b = max(a, b), min(a, b)\n while a % b > 0:\n a, b = b, a % b\n return b\n\n\ndef solve():\n A, B = list(map(int, line_input()))\n if A >= 13:\n print(B)\n elif A >= 6:\n print((B // 2))\n else:\n print((0))\n return 0\n\n\nif __name__ == \"__main__\":\n solve()\n","fast_code":"a, b = list(map(int, input().split()))\nif a >= 13:\n print(b)\nelif 6 <= a <= 12:\n print((b // 2))\nelse:\n print(\"0\")\n"} +{"fast_code_id":"7d152829fabdaf68d6940ede064ea95c3e04f687d89b63c8893ae52fbdbff32d","fast_id":"p03240_7d152829fabdaf68d6940ede064ea95c3e04f687d89b63c8893ae52fbdbff32d","language":"python","measured_fast_code_id":"7d152829fabdaf68d6940ede064ea95c3e04f687d89b63c8893ae52fbdbff32d","measured_slow_code_id":"7335b8f814fadff817ea3d797eb47069b6471e295b0639a1a649c1b8aea437e5","measurement_metric":"cpu_instruction_count","pair_id":"python_de296a49ff1e7e84680960ca","problem_id":"p03240","slow_code_id":"2b73a8d0ed51a5904d37fa90f680662d0779f1a36233aa1fe89473f78eb7c3e5","slow_id":"p03240_7335b8f814fadff817ea3d797eb47069b6471e295b0639a1a649c1b8aea437e5","speedup":16.770774008716316,"stratum":"8+","sampling_key":"5a72f0ba36de7f04b17a0688cfd423c661f96bb1890094b54dffa533cf971484","slow_code":"import numpy as np\n\nN = int(eval(input()))\nx, y, h = np.array([list(map(int, input().split())) for i in range(N)]).T\nH = 0\nCx = 0\nCy = 0\nFlag = True\nfor i in range(101):\n for j in range(101):\n Flag = True\n for k in range(N):\n if h[k] != 0:\n H = h[k] + abs(i - x[k]) + abs(j - y[k])\n break\n for k in range(N):\n if h[k] != max(H - abs(i - x[k]) - abs(j - y[k]), 0):\n Flag = False\n break\n if Flag:\n Cx, Cy = i, j\n break\n if Flag:\n break\nprint((\"{} {} {}\".format(Cx, Cy, H)))\n","fast_code":"n = int(input())\nXYH = []\nfor _ in range(n):\n x, y, h = map(int, input().split())\n if h != 0:\n XYH.append([x, y, h])\nflag = False\nans = XYH[0]\nfor i in range(101):\n for j in range(101):\n tempH = abs(XYH[0][0] - i) + abs(XYH[0][1] - j) + XYH[0][2]\n for x, y, h in XYH[1:]:\n if abs(x - i) + abs(y - j) + h != tempH:\n flag = False\n break\n else:\n flag = True\n if flag:\n ans = [i, j, tempH]\n break\n if flag:\n break\nprint(*ans, sep=\" \")\n"} +{"fast_code_id":"03a82928a4f5d348f6e9b606de233c7c97e0e7a762710bd793e06c6ea800673b","fast_id":"p03719_03a82928a4f5d348f6e9b606de233c7c97e0e7a762710bd793e06c6ea800673b","language":"python","measured_fast_code_id":"03a82928a4f5d348f6e9b606de233c7c97e0e7a762710bd793e06c6ea800673b","measured_slow_code_id":"e07af57e860ffe85b1dd4d3f584cfb93b6bc335ebd7477239056a77e404a4988","measurement_metric":"cpu_instruction_count","pair_id":"python_df004450871ff44db2b91ab1","problem_id":"p03719","slow_code_id":"e07af57e860ffe85b1dd4d3f584cfb93b6bc335ebd7477239056a77e404a4988","slow_id":"p03719_e07af57e860ffe85b1dd4d3f584cfb93b6bc335ebd7477239056a77e404a4988","speedup":6.700567773510979,"stratum":"4-8","sampling_key":"796f63ad4204c4b6a428bb44c266972af30b1fc6a893c834866a6114a8fdad87","slow_code":"import functools\nimport os\nimport sys\n\nsys.setrecursionlimit(10000)\nINF = float(\"inf\")\n\n\ndef inp():\n return int(input())\n\n\ndef inpf():\n return float(input())\n\n\ndef inps():\n return input()\n\n\ndef inl():\n return list(map(int, input().split()))\n\n\ndef inlf():\n return list(map(float, input().split()))\n\n\ndef inls():\n return input().split()\n\n\ndef inpm(line):\n return [inp() for _ in range(line)]\n\n\ndef inpfm(line):\n return [inpf() for _ in range(line)]\n\n\ndef inpsm(line):\n return [inps() for _ in range(line)]\n\n\ndef inlm(line):\n return [inl() for _ in range(line)]\n\n\ndef inlfm(line):\n return [inlf() for _ in range(line)]\n\n\ndef inlsm(line):\n return [inls() for _ in range(line)]\n\n\ndef debug(fn):\n if not os.getenv(\"LOCAL\"):\n return fn\n\n @functools.wraps(fn)\n def wrapper(*args, **kwargs):\n ret = fn(*args, **kwargs)\n print(\n \"DEBUG: {}({}) -> \".format(\n fn.__name__,\n \", \".join(\n list(map(str, args))\n + [\"{}={}\".format(k, str(v)) for k, v in kwargs.items()]\n ),\n ),\n end=\"\",\n )\n print(ret)\n return ret\n\n return wrapper\n\n\na, b, c = inl()\nprint(\"Yes\" if a <= c <= b else \"No\")\n","fast_code":"import sys\n\n\ndef solve():\n a, b, c = list(map(int, input().split()))\n print((\"Yes\" if a <= c <= b else \"No\"))\n\n\nif __name__ == \"__main__\":\n solve()\n"} +{"fast_code_id":"c32c4128e55058c3dcd6bdcb0f3b1ab9e6442e9cf1928c5f0cb9b61b9da29980","fast_id":"p02683_c32c4128e55058c3dcd6bdcb0f3b1ab9e6442e9cf1928c5f0cb9b61b9da29980","language":"python","measured_fast_code_id":"c32c4128e55058c3dcd6bdcb0f3b1ab9e6442e9cf1928c5f0cb9b61b9da29980","measured_slow_code_id":"3a953b935633d889972610e2b72a1d2f66172bb0bf1cb8f239c17f21d3ff6a83","measurement_metric":"cpu_instruction_count","pair_id":"python_dfbd75926d384127b61c5cf4","problem_id":"p02683","slow_code_id":"3a953b935633d889972610e2b72a1d2f66172bb0bf1cb8f239c17f21d3ff6a83","slow_id":"p02683_3a953b935633d889972610e2b72a1d2f66172bb0bf1cb8f239c17f21d3ff6a83","speedup":422.6168207670918,"stratum":"8+","sampling_key":"0e226e273899d62eb988803cf076202f1ebadf0f0da0c3fa5d60a5b5a0865b98","slow_code":"n, m, x = list(map(int, input().split()))\ninn = [list(map(int, input().split())) for _ in range(n)]\nc = [inn[_][0] for _ in range(n)]\nara = [inn[_][1:] for _ in range(n)]\nans = 1e9\nfor mask in range(2**15):\n cost = 0\n cnt = [0 for _ in range(m)]\n for i in range(n):\n if ((1 << i) & mask) == 0:\n continue\n cost += c[i]\n for j in range(m):\n cnt[j] += ara[i][j]\n ok = 1\n for i in range(m):\n if cnt[i] < x:\n ok = 0\n if ok:\n ans = min(ans, cost)\nif ans == 1e9:\n ans = -1\nprint(ans)\n","fast_code":"import math\n\n\ndef solve(C, A, x, k, s, U):\n if k == 0:\n if min(U) >= x:\n return s\n else:\n return math.inf\n else:\n s_use = s + C[k - 1]\n U_use = [u + a for u, a in zip(U, A[k - 1])]\n return min(solve(C, A, x, k - 1, s, U), solve(C, A, x, k - 1, s_use, U_use))\n\n\ndef main():\n from sys import stdin\n\n n, m, x = list(map(int, stdin.readline().rstrip().split()))\n C = []\n A = []\n for _ in range(n):\n temp = list(map(int, stdin.readline().rstrip().split()))\n C.append(temp[0])\n A.append(temp[1:])\n U = [0] * m\n ans = solve(C, A, x, n, 0, U)\n print((ans if ans != math.inf else -1))\n\n\nmain()\n"} +{"fast_code_id":"d0ecbb214d334dfc0ec9de283d88574cad950a1a5930e39d1450ac4087a24f88","fast_id":"p03700_d0ecbb214d334dfc0ec9de283d88574cad950a1a5930e39d1450ac4087a24f88","language":"python","measured_fast_code_id":"d0ecbb214d334dfc0ec9de283d88574cad950a1a5930e39d1450ac4087a24f88","measured_slow_code_id":"4f614769a7e22dddcb85c7a9aa9d9cee3d9896b34340a1e7d8590ac4705426eb","measurement_metric":"cpu_instruction_count","pair_id":"python_dfd2cc391e1c308fefde5cc0","problem_id":"p03700","slow_code_id":"4f614769a7e22dddcb85c7a9aa9d9cee3d9896b34340a1e7d8590ac4705426eb","slow_id":"p03700_4f614769a7e22dddcb85c7a9aa9d9cee3d9896b34340a1e7d8590ac4705426eb","speedup":3.9586802469273645,"stratum":"2-4","sampling_key":"2725c65d5aa446c26b47bd8d8118bb0ee52cbac9cb0ac7964eb1eaaab39d97a5","slow_code":"import numpy as np\n\nN, A, B = list(map(int, input().split()))\nH = np.zeros(shape=N, dtype=\"int64\")\nfor _ in range(N):\n h = int(eval(input()))\n H[_] = h\n\n\ndef calc(num, a):\n a -= num * B\n a = (a - 1) // (A - B) + 1\n if sum(a[a > 0]) <= num:\n return True\n else:\n return False\n\n\nstart = 0\nend = 10**10\nwhile end - start > 1:\n mid = (start + end) // 2\n if calc(mid, H.copy()):\n end = mid\n else:\n start = mid\nprint(end)\n","fast_code":"from math import ceil\n\nN, A, B = list(map(int, input().split()))\nh = [int(eval(input())) for _ in range(N)]\n\n\ndef f(k):\n return sum([ceil((hi - B * k) / (A - B)) for hi in h if hi - k * B > 0]) <= k\n\n\nl, r = 0, ceil(max(h) / B)\nwhile r - l > 1:\n if f((l + r) // 2):\n r = (l + r) // 2\n else:\n l = (l + r) // 2\nprint(r)\n"} +{"fast_code_id":"e4568f06d34affbe8f49bff8eab899c2a6324651236175327b224cbfd303fd53","fast_id":"p03719_e4568f06d34affbe8f49bff8eab899c2a6324651236175327b224cbfd303fd53","language":"python","measured_fast_code_id":"e4568f06d34affbe8f49bff8eab899c2a6324651236175327b224cbfd303fd53","measured_slow_code_id":"0acae026c7e63eed2245b851c8d32eee934659ca23b9e50786cb323f85625345","measurement_metric":"cpu_instruction_count","pair_id":"python_dfdf8c7df6825dce9943a90d","problem_id":"p03719","slow_code_id":"0acae026c7e63eed2245b851c8d32eee934659ca23b9e50786cb323f85625345","slow_id":"p03719_0acae026c7e63eed2245b851c8d32eee934659ca23b9e50786cb323f85625345","speedup":4.6270630775794,"stratum":"4-8","sampling_key":"7d1ee743d7c1d2d3528f4a2b931aa666eee455ca358e7c11ce51a57577072d86","slow_code":"import functools\nimport os\nimport sys\n\nsys.setrecursionlimit(10000)\nINF = float(\"inf\")\n\n\ndef inp():\n return int(eval(input()))\n\n\ndef inpf():\n return float(eval(input()))\n\n\ndef inps():\n return eval(input())\n\n\ndef inl():\n return list(map(int, input().split()))\n\n\ndef inlf():\n return list(map(float, input().split()))\n\n\ndef inls():\n return input().split()\n\n\ndef inpm(line):\n return [inp() for _ in range(line)]\n\n\ndef inpfm(line):\n return [inpf() for _ in range(line)]\n\n\ndef inpsm(line):\n return [inps() for _ in range(line)]\n\n\ndef inlm(line):\n return [inl() for _ in range(line)]\n\n\ndef inlfm(line):\n return [inlf() for _ in range(line)]\n\n\ndef inlsm(line):\n return [inls() for _ in range(line)]\n\n\ndef Yesif(cond):\n print((\"Yes\" if cond else \"No\"))\n\n\ndef YESIF(cond):\n print((\"YES\" if cond else \"NO\"))\n\n\ndef yesif(cond):\n print((\"yes\" if cond else \"no\"))\n\n\na, b, c = inl()\nYesif(a <= c <= b)\n","fast_code":"import sys\nfrom collections import Counter\n\nsys.setrecursionlimit(10**7)\ninf = 1 << 100\n\n\ndef solve():\n a, b, c = list(map(int, input().split()))\n print((\"Yes\" if a <= c <= b else \"No\"))\n\n\nif __name__ == \"__main__\":\n solve()\n"} +{"fast_code_id":"7554bc3cb140323248a87ad408e68e2c799d4b9f01eafcc1c50d26273d0dfa92","fast_id":"p02695_7554bc3cb140323248a87ad408e68e2c799d4b9f01eafcc1c50d26273d0dfa92","language":"python","measured_fast_code_id":"7554bc3cb140323248a87ad408e68e2c799d4b9f01eafcc1c50d26273d0dfa92","measured_slow_code_id":"4876c20eabffbc9ea2c633c2d996da20261178a9a9451926be7fe13405bb8582","measurement_metric":"cpu_instruction_count","pair_id":"python_e00ab6a4c7eddfb0f4b15021","problem_id":"p02695","slow_code_id":"4876c20eabffbc9ea2c633c2d996da20261178a9a9451926be7fe13405bb8582","slow_id":"p02695_4876c20eabffbc9ea2c633c2d996da20261178a9a9451926be7fe13405bb8582","speedup":4.638584975248677,"stratum":"4-8","sampling_key":"bbd059eb49058e5b6d8b9b748baf0e84db29472e70479f2df82b762d599ec3ee","slow_code":"n, m, q = list(map(int, input().split()))\nl = []\nfor i in range(q):\n l1, l2, l3, l4 = list(map(int, input().split()))\n l.append([l1, l2, l3, l4])\nB = []\nfor a in range(1, m + 1):\n for b in range(a, m + 1):\n for c in range(b, m + 1):\n for d in range(c, m + 1):\n for e in range(d, m + 1):\n for f in range(e, m + 1):\n for g in range(f, m + 1):\n for h in range(g, m + 1):\n for i in range(h, m + 1):\n for j in range(i, m + 1):\n L = [a, b, c, d, e, f, g, h, i, j]\n A = []\n for I in range(n):\n A.append(L[I])\n C = 0\n for k in range(q):\n if (\n A[l[k][1] - 1] - A[l[k][0] - 1]\n == l[k][2]\n ):\n C += l[k][3]\n B.append(C)\nprint((max(B)))\n","fast_code":"n, m, q = 0, 0, 0\nABCD = []\nans = 0\n\n\ndef dfs(ns):\n global ans\n A = [int(c) for c in ns.split()]\n if len(A) == n:\n s = 0\n for qi in range(q):\n a, b, c, d = ABCD[qi]\n if A[b - 1] - A[a - 1] == c:\n s += d\n ans = max(s, ans)\n return\n for i in range(A[-1], m + 1):\n dfs(\"{} {}\".format(ns, str(i)))\n\n\ndef main():\n global n, m, q, ABCD\n n, m, q = [int(e) for e in input().split()]\n ABCD = [[int(e) for e in input().split()] for i in range(q)]\n for mi in range(1, m + 1):\n dfs(str(mi))\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"cf5ec513ccd40bda2ee4fef5b71dbbed5c51cb14be7b8ee5383525a868af9741","fast_id":"p02703_2b3b89ca0c11a69ed85e89d07cd23dbcbaa50d9a8f0f0c0a5481862f264f5ae6","language":"python","measured_fast_code_id":"2b3b89ca0c11a69ed85e89d07cd23dbcbaa50d9a8f0f0c0a5481862f264f5ae6","measured_slow_code_id":"90be895b60848d0137d21c0628afac2da1af1edd13c122290ee2e39bc535083d","measurement_metric":"cpu_instruction_count","pair_id":"python_e10db78a313df7ef4c5a8779","problem_id":"p02703","slow_code_id":"37319076c3b5100beb96d2f9c428eac7654c186db18fd46b9d512ca816af7955","slow_id":"p02703_90be895b60848d0137d21c0628afac2da1af1edd13c122290ee2e39bc535083d","speedup":5.069887536991625,"stratum":"4-8","sampling_key":"1022eceed8ecf0cb4ff7022a1c8745d55c6b96f15767a76465ffac38036c0830","slow_code":"class Dijkstra:\n\n class Edge:\n\n def __init__(self, _to, _cost):\n self.to = _to\n self.cost = _cost\n\n def __init__(self, V):\n self.G = [[] for i in range(V)]\n self._E = 0\n self._V = V\n\n @property\n def E(self):\n return self._E\n\n @property\n def V(self):\n return self._V\n\n def add(self, _from, _to, _cost):\n self.G[_from].append(self.Edge(_to, _cost))\n self._E += 1\n\n def shortest_path(self, s):\n import heapq\n\n que = []\n d = [float(\"inf\")] * self.V\n d[s] = 0\n heapq.heappush(que, (0, s))\n while len(que) != 0:\n cost, v = heapq.heappop(que)\n\n if d[v] < cost:\n continue\n for i in range(len(self.G[v])):\n\n e = self.G[v][i]\n if d[e.to] > d[v] + e.cost:\n d[e.to] = d[v] + e.cost\n heapq.heappush(que, (d[e.to], e.to))\n return d\n\n\nN, M, S = list(map(int, input().split()))\npro = Dijkstra(N * (50 * (N - 1) + 1))\nfor i in range(0, M):\n u, v, a, b = list(map(int, input().split()))\n for j in range(a, 50 * (N - 1) + 1):\n pro.add(N * j + u - 1, N * (j - a) + v - 1, b)\n pro.add(N * j + v - 1, N * (j - a) + u - 1, b)\nfor i in range(0, N):\n c, d = list(map(int, input().split()))\n for j in range(0, 50 * (N - 1)):\n to = min(50 * (N - 1), j + c)\n pro.add(N * j + i, N * to + i, d)\nS = min(50 * (N - 1), S)\nans = pro.shortest_path(N * S)\nfor i in range(1, N):\n p = float(\"inf\")\n for j in range(0, 50 * (N - 1) + 1):\n p = min(p, ans[N * j + i])\n print(p)\n","fast_code":"import sys\nfrom heapq import heapify, heappop, heappush\n\nsr = lambda: sys.stdin.readline().rstrip()\nir = lambda: int(sr())\nlr = lambda: list(map(int, sr().split()))\n\nN, M, S = lr()\nUVAB = [lr() for _ in range(M)]\nCD = [lr() for _ in range(N)]\nAmax = 0\nfor i in range(M):\n a = UVAB[i][2]\n if a > Amax:\n Amax = a\nlimit = Amax * (N - 1)\nS = min(S, limit)\ngraph = [[] for _ in range(N + 1)]\nfor u, v, a, b in UVAB:\n graph[u].append((v, a, b))\n graph[v].append((u, a, b))\n\n\ndef dijkstra(start):\n\n INF = 10**15\n dist = [[INF for _ in range(limit + 1)] for _ in range(N + 1)]\n dist[1][S] = 0\n que = [(0, S, 1)]\n while que:\n time, silver, prev = heappop(que)\n if dist[prev][silver] < time:\n continue\n for next, a, b in graph[prev]:\n t = time + b\n si = silver - a\n if si < 0:\n continue\n if dist[next][si] > t:\n dist[next][si] = t\n heappush(que, (t, si, next))\n c, d = CD[prev - 1]\n si = min(limit, silver + c)\n while dist[prev][si] > time + d:\n dist[prev][si] = time + d\n heappush(que, (time + d, si, prev))\n si += c\n si = min(limit, si)\n time += d\n return dist\n\n\ndist = dijkstra(1)\nfor i in range(2, N + 1):\n d = dist[i]\n answer = min(d)\n print(answer)\n"} +{"fast_code_id":"5a0fe098f035b1b005f8664b59af24664cf22f7c23e93946bb030597232294e0","fast_id":"p03008_5a0fe098f035b1b005f8664b59af24664cf22f7c23e93946bb030597232294e0","language":"python","measured_fast_code_id":"5a0fe098f035b1b005f8664b59af24664cf22f7c23e93946bb030597232294e0","measured_slow_code_id":"9e05cceed4b5188c120d5117ec4afb904f5f5362c84c2aaee500513cc032b2e6","measurement_metric":"cpu_instruction_count","pair_id":"python_e1162ce98fbbb67ea2f3b775","problem_id":"p03008","slow_code_id":"d268eadad155768f567c1be8a82a20923e759ff7bb21b320758e708fbdea0f6f","slow_id":"p03008_9e05cceed4b5188c120d5117ec4afb904f5f5362c84c2aaee500513cc032b2e6","speedup":2.517111395229704,"stratum":"2-4","sampling_key":"ded08847c0fb7cb83b90c61dab18e23506907039c59649b65658f82591308a98","slow_code":"import bisect\nimport heapq\nimport math\nimport random\nimport sys\nfrom collections import Counter, defaultdict, deque\nfrom decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal\nfrom functools import lru_cache, reduce\nfrom itertools import combinations, combinations_with_replacement, product, permutations\nfrom operator import add, mul, sub\n\nsys.setrecursionlimit(100000)\ninput = sys.stdin.readline\n\n\ndef read_int():\n return int(input())\n\n\ndef read_int_n():\n return list(map(int, input().split()))\n\n\ndef read_float():\n return float(input())\n\n\ndef read_float_n():\n return list(map(float, input().split()))\n\n\ndef read_str():\n return input().strip()\n\n\ndef read_str_n():\n return list(map(str, input().split()))\n\n\ndef error_print(*args):\n print(*args, file=sys.stderr)\n\n\ndef mt(f):\n import time\n\n def wrap(*args, **kwargs):\n s = time.time()\n ret = f(*args, **kwargs)\n e = time.time()\n error_print(e - s, \"sec\")\n return ret\n\n return wrap\n\n\n@mt\ndef slv(N, GSB):\n def f(N, gsb):\n dp = [[0] * (N + 1) for _ in range(4)]\n for i in range(3):\n v = gsb[1][i] - gsb[0][i]\n a = gsb[0][i]\n if v > 0:\n for w in range(N + 1):\n dp[i + 1][w] = dp[i][w]\n if w >= a:\n dp[i + 1][w] = max(dp[i][w], dp[i + 1][w - a] + v)\n else:\n dp[i + 1] = dp[i]\n return dp[3][N] + N\n\n tmp = f(N, GSB)\n\n GSB[0], GSB[1] = GSB[1], GSB[0]\n return f(tmp, GSB)\n\n\ndef main():\n N = read_int()\n GSB = [read_int_n() for _ in range(2)]\n print(slv(N, GSB))\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"import sys\n\ninput = sys.stdin.readline\nn = int(eval(input()))\nA = tuple(map(int, input().split()))\nB = tuple(map(int, input().split()))\n\n\ndef f(n):\n dp = list(range(n + 1))\n for a, b in zip(A, B):\n if b <= a:\n continue\n for i in range(n + 1):\n if i - a >= 0:\n dp[i] = max(dp[i], dp[i - a] + b)\n return max(dp)\n\n\nm = f(n)\nA, B = B, A\nans = f(m)\nprint(ans)\n"} +{"fast_code_id":"78195a2740d448817b390133128ddb97072787be3c728274df837dfcfab111dc","fast_id":"p02948_78195a2740d448817b390133128ddb97072787be3c728274df837dfcfab111dc","language":"python","measured_fast_code_id":"78195a2740d448817b390133128ddb97072787be3c728274df837dfcfab111dc","measured_slow_code_id":"e48793569c8f6809f237ed0e72dcae9529986820c4ed6e2380f8864742ef7cda","measurement_metric":"cpu_instruction_count","pair_id":"python_e12e555d1ab9e6e33997804c","problem_id":"p02948","slow_code_id":"e48793569c8f6809f237ed0e72dcae9529986820c4ed6e2380f8864742ef7cda","slow_id":"p02948_e48793569c8f6809f237ed0e72dcae9529986820c4ed6e2380f8864742ef7cda","speedup":2.224645018015859,"stratum":"2-4","sampling_key":"2ffe4644d4a2950092109859853afe603c5066f72b93c2cb50eafae002237e05","slow_code":"from heapq import heappop, heappush, heapify\nfrom collections import deque\n\nN, M = list(map(int, input().split()))\nA, B, C = [0] * N, [0] * N, [0] * N\nfor i in range(N):\n A[i], B[i] = list(map(int, input().split()))\n C[i] = [A[i], B[i]]\nC.sort()\nC = deque(C)\na = []\nheapify(a)\nans = 0\nfor i in range(M, -1, -1):\n while C:\n if C[0][0] <= M - i:\n heappush(a, (-1) * C[0][1])\n C.popleft()\n else:\n break\n if len(a) > 0:\n p = heappop(a)\n ans += (-1) * p\nprint(ans)\n","fast_code":"from heapq import *\n\nN, M, *t = list(map(int, open(0).read().split()))\nv = [[] for _ in \"_\" * M]\nz = i = 0\nfor _ in \"_\" * N:\n M < t[i] or v[t[i] - 1].append(t[i + 1])\n i += 2\nq = []\nfor i in v:\n for j in i:\n heappush(q, -j)\n z -= len(q) and heappop(q)\nprint(z)\n"} +{"fast_code_id":"4038bcef7f71e4bcbad1ce3a74a10cdc90a93fcdef292e18cbaf676738ce8578","fast_id":"p02418_4038bcef7f71e4bcbad1ce3a74a10cdc90a93fcdef292e18cbaf676738ce8578","language":"python","measured_fast_code_id":"4038bcef7f71e4bcbad1ce3a74a10cdc90a93fcdef292e18cbaf676738ce8578","measured_slow_code_id":"4a465a7c40e8301396e930b29aaf192efcb0d409e3d2d3b58e59d606c0aba5fa","measurement_metric":"cpu_instruction_count","pair_id":"python_e14667c88c80d764091720d7","problem_id":"p02418","slow_code_id":"a7502251daa34c9d1f4077de1ba0b7e4db196550bc7d1d061290578a54373e1c","slow_id":"p02418_4a465a7c40e8301396e930b29aaf192efcb0d409e3d2d3b58e59d606c0aba5fa","speedup":2.084100151836687,"stratum":"2-4","sampling_key":"52441ffc3876daacccb3386e83063a1ca3b1a7dc34bd4258454439baafd82a66","slow_code":"import sys\nfrom sys import stdin\n\ninput = stdin.readline\n\n\ndef main(args):\n s = input().strip()\n p = input().strip()\n s = s + s[:-1]\n if p in s:\n print(\"Yes\")\n else:\n print(\"No\")\n\n\nif __name__ == \"__main__\":\n main(sys.argv[1:])\n","fast_code":"ring = input() * 2\nword = input()\nif ring.find(word) != -1:\n print(\"Yes\")\nelse:\n print(\"No\")\n"} +{"fast_code_id":"d3b14c7a27a0b0a1f81281e9a2739237e41d866056a306990a3b030483de2560","fast_id":"p03774_d3b14c7a27a0b0a1f81281e9a2739237e41d866056a306990a3b030483de2560","language":"python","measured_fast_code_id":"d3b14c7a27a0b0a1f81281e9a2739237e41d866056a306990a3b030483de2560","measured_slow_code_id":"6db287791de44b1e4185cb571c082a7a658954cf0e76899fa43c862e60866233","measurement_metric":"cpu_instruction_count","pair_id":"python_e14746622edfc80f7437ff68","problem_id":"p03774","slow_code_id":"6db287791de44b1e4185cb571c082a7a658954cf0e76899fa43c862e60866233","slow_id":"p03774_6db287791de44b1e4185cb571c082a7a658954cf0e76899fa43c862e60866233","speedup":165.4608304748708,"stratum":"8+","sampling_key":"0b52424890ffb38d6256c7442437bf8ab73297fb5136cce17c31256563bffec5","slow_code":"import numpy as np, sys\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\nN, M = LI()\nab = np.array([LI() for _ in range(N)])\ncd = np.array([LI() for _ in range(M)])\nfor x in ab:\n print((np.argmin(np.sum(np.abs(cd - x), axis=1)) + 1))\n","fast_code":"N, M = list(map(int, input().split()))\nn = [list(map(int, input().split())) for _ in range(N)]\nm = [list(map(int, input().split())) for _ in range(M)]\nresult = []\nfor i in range(len(n)):\n result = []\n for j in range(len(m)):\n result.append(abs(n[i][0] - m[j][0]) + abs(n[i][1] - m[j][1]))\n print((result.index(min(result)) + 1))\n"} +{"fast_code_id":"2d3037cf2557e1076db36a151c25eb5936b98bbc795347177923cafa6dbc82c4","fast_id":"p02289_2d3037cf2557e1076db36a151c25eb5936b98bbc795347177923cafa6dbc82c4","language":"python","measured_fast_code_id":"2d3037cf2557e1076db36a151c25eb5936b98bbc795347177923cafa6dbc82c4","measured_slow_code_id":"14b4ad282f61dc3f0baedf2eb80026c759f35dd9b34a29e093c21234282f17e7","measurement_metric":"cpu_instruction_count","pair_id":"python_e168fe67183488db5e211f8f","problem_id":"p02289","slow_code_id":"14b4ad282f61dc3f0baedf2eb80026c759f35dd9b34a29e093c21234282f17e7","slow_id":"p02289_14b4ad282f61dc3f0baedf2eb80026c759f35dd9b34a29e093c21234282f17e7","speedup":3.419932552983897,"stratum":"2-4","sampling_key":"b3e451dd00bd5582eff4e6065a21050fe3a038d83aa66950f87c9a29cc44ba16","slow_code":"import sys\n\n\ndef maxHeapify(A, i):\n l = i * 2 + 1\n r = i * 2 + 2\n if l < n:\n largest = l\n if r < n and A[r] > A[l]:\n largest = r\n if A[largest] > A[i]:\n A[i], A[largest] = A[largest], A[i]\n maxHeapify(A, largest)\n\n\ndef insert(S, k):\n global n\n S[n] = k\n n += 1\n i = n - 1\n p = (i - 1) // 2\n while i > 0 and S[i] > S[p]:\n S[i], S[p] = S[p], S[i]\n i = p\n p = (i - 1) // 2\n\n\ndef extractMax(S):\n global n\n if n == 1:\n n -= 1\n return S[0]\n ans = S[0]\n n -= 1\n S[0] = S[n]\n i = 0\n while True:\n l = i * 2 + 1\n r = i * 2 + 2\n if l >= n:\n break\n largest = l\n if r < n and A[r] > A[l]:\n largest = r\n if A[largest] > A[i]:\n A[i], A[largest] = A[largest], A[i]\n i = largest\n else:\n break\n return ans\n\n\nA = [0] * 2000000\nS = []\nn = 0\nfor s in sys.stdin:\n if s[2] == \"s\":\n insert(A, int(s[7:]))\n elif s[2] == \"t\":\n S.append(extractMax(A))\n else:\n break\nprint((\"\\n\".join(map(str, S))))\n","fast_code":"from sys import stdin\nfrom heapq import heappop, heappush\n\nreadline = stdin.readline\nheap = []\nwhile True:\n line = readline()\n if line[1] == \"x\":\n print((-heappop(heap)))\n elif line[0] == \"i\":\n heappush(heap, -int(line.split()[1]))\n else:\n break\n"} +{"fast_code_id":"3c0a060cef9bf5ee175a2546e9be6f83f4b8b290b28c9aa731627fc7d5b5337e","fast_id":"p02699_3c0a060cef9bf5ee175a2546e9be6f83f4b8b290b28c9aa731627fc7d5b5337e","language":"python","measured_fast_code_id":"3c0a060cef9bf5ee175a2546e9be6f83f4b8b290b28c9aa731627fc7d5b5337e","measured_slow_code_id":"084d274c57f95a15e9ad65a8072a788828494b876c9fb00ba76e955369e619b4","measurement_metric":"cpu_instruction_count","pair_id":"python_e19c453fcba1594acf11c04a","problem_id":"p02699","slow_code_id":"2b15fcde67ed0713d312a3aaee502dd9087cb59a31e02c65162aa10dcbc89fbe","slow_id":"p02699_084d274c57f95a15e9ad65a8072a788828494b876c9fb00ba76e955369e619b4","speedup":3.606868676913127,"stratum":"2-4","sampling_key":"07b159f49f36ed517bf406377c6194584100bf86f8c56205da4670b685225099","slow_code":"import sys\nimport math\nfrom bisect import bisect_right as br\nfrom bisect import bisect_left as bl\n\nsys.setrecursionlimit(2147483647)\nfrom heapq import heappush, heappop, heappushpop\nfrom collections import defaultdict\nfrom itertools import accumulate\nfrom collections import Counter\nfrom collections import deque\nfrom operator import itemgetter\nfrom itertools import permutations\n\nmod = 10**9 + 7\ninf = float(\"inf\")\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\ns, w = LI()\nif w >= s:\n print(\"unsafe\")\nelse:\n print(\"safe\")\n","fast_code":"s, w = list(map(int, input().split()))\nif s > w:\n print(\"safe\")\nelse:\n print(\"unsafe\")\n"} +{"fast_code_id":"2890f8e8770efed4f9c4bcfae3a889c8fe41634ad1976e117b0b362228e642bd","fast_id":"p03649_2890f8e8770efed4f9c4bcfae3a889c8fe41634ad1976e117b0b362228e642bd","language":"python","measured_fast_code_id":"2890f8e8770efed4f9c4bcfae3a889c8fe41634ad1976e117b0b362228e642bd","measured_slow_code_id":"7802cf9e83571cee9bec8533b955c7050920fb8e58d892c4118c792371ce1f89","measurement_metric":"cpu_instruction_count","pair_id":"python_e1c30238a335ed794f86a7fd","problem_id":"p03649","slow_code_id":"e4305a239f9ea2717f70ed35fb3cc27a2302b00f0e1b22d9b7c48daa06061a76","slow_id":"p03649_7802cf9e83571cee9bec8533b955c7050920fb8e58d892c4118c792371ce1f89","speedup":107.20064056774594,"stratum":"8+","sampling_key":"4aeda0a3665b629eef6851d1ed49e18af5b852cdfdb362ca5cef885ed2acc7de","slow_code":"N = int(eval(input()))\nA = list(map(int, input().split()))\n\n\ndef is_possible(C):\n res = 0\n for x in A:\n if x + C - N >= 0:\n res += (x + C - N) // (N + 1) + 1\n\n return int(res <= C)\n\n\nl = 0\nr = 10**30\nwhile r - l > 1:\n M = (l + r) // 2\n if is_possible(M) > 0:\n r = M\n else:\n l = M\nfor i in range(10**5, -1, -1):\n if is_possible(r - i):\n print((r - i))\n break\n","fast_code":"n = int(eval(input()))\na = list(map(int, input().split()))\nans = 0\nwhile True:\n tmp = 0\n for i in range(n):\n k = -(-(a[i] + 1) // n) - 1\n tmp += k\n a[i] -= k * n\n a[i] -= k\n for i in range(n):\n a[i] += tmp\n if not tmp:\n break\n ans += tmp\nprint(ans)\n"} +{"fast_code_id":"ebaf3ef7c61474a4570db542d9b5c8080aa17b3e30b9593f9eda4c5f05c12d3a","fast_id":"p03796_ebaf3ef7c61474a4570db542d9b5c8080aa17b3e30b9593f9eda4c5f05c12d3a","language":"python","measured_fast_code_id":"ebaf3ef7c61474a4570db542d9b5c8080aa17b3e30b9593f9eda4c5f05c12d3a","measured_slow_code_id":"43b257e85e546d9470ced772c67918bde77d5626a2fd04dea2e6a84c615224a5","measurement_metric":"cpu_instruction_count","pair_id":"python_e1e344641bf895016716e68f","problem_id":"p03796","slow_code_id":"5ff598b9800e1bd896356b079e05a6afa89737def3d95243ef8ae46ed85960b1","slow_id":"p03796_43b257e85e546d9470ced772c67918bde77d5626a2fd04dea2e6a84c615224a5","speedup":2.491454538047646,"stratum":"2-4","sampling_key":"5a6ab6e011ea78c6c6100241c91b9da411a70787dd4b102c454b1609bd04bd31","slow_code":"from math import factorial\n\nn = int(eval(input()))\nprint((factorial(n) % (10**9 + 7)))\n","fast_code":"n = int(eval(input()))\ndiv = 10**9 + 7\npw = 1\nfor i in range(1, n + 1):\n pw = (pw * i) % div\nprint(pw)\n"} +{"fast_code_id":"498a95f0d8a1a94709cf73302cdd31345e5afd389407b78c00aaa6afa7c4a0bf","fast_id":"p02707_498a95f0d8a1a94709cf73302cdd31345e5afd389407b78c00aaa6afa7c4a0bf","language":"python","measured_fast_code_id":"498a95f0d8a1a94709cf73302cdd31345e5afd389407b78c00aaa6afa7c4a0bf","measured_slow_code_id":"cd7006129feddcbda91b13d55f55c98244567f8ad1d8bf8cc06342ee60ea4d53","measurement_metric":"cpu_instruction_count","pair_id":"python_e1e71b925e74ab68d30ebd89","problem_id":"p02707","slow_code_id":"cd7006129feddcbda91b13d55f55c98244567f8ad1d8bf8cc06342ee60ea4d53","slow_id":"p02707_cd7006129feddcbda91b13d55f55c98244567f8ad1d8bf8cc06342ee60ea4d53","speedup":2.009581493386482,"stratum":"2-4","sampling_key":"412b5578433c47affd99f5bb276f049513e0fe67e217687981e4a4247e666c20","slow_code":"n = int(eval(input()))\na_list = list(map(int, input().split()))\nnl = {str(i): 0 for i in range(n)}\nfor a in a_list:\n nl[str(a - 1)] += 1\nfor v in list(nl.values()):\n print((\"{}\".format(v)))\n","fast_code":"num = int(eval(input()))\nboss = input().split()\nans_list = [0] * num\nfor i_boss in boss:\n ans_list[int(i_boss) - 1] += 1\na = list([str(x) for x in ans_list])\nprint((\"\\n\".join(a)))\n"} +{"fast_code_id":"a817fffff36d37d931c3f21c118a64d5ffef77d7d654ca2d4d5c6cfe2332c32a","fast_id":"p03486_a817fffff36d37d931c3f21c118a64d5ffef77d7d654ca2d4d5c6cfe2332c32a","language":"python","measured_fast_code_id":"a817fffff36d37d931c3f21c118a64d5ffef77d7d654ca2d4d5c6cfe2332c32a","measured_slow_code_id":"ae2b702653d7f7343a504deb1d82130c75439f406e3e68078bdb6fe733a50939","measurement_metric":"cpu_instruction_count","pair_id":"python_e20133c0feea77249aee6174","problem_id":"p03486","slow_code_id":"12de6db88ad79471a6d47d200ef0cf1d590ca1eac8ef874b69a66f9eb314da4e","slow_id":"p03486_ae2b702653d7f7343a504deb1d82130c75439f406e3e68078bdb6fe733a50939","speedup":2.5618574763271953,"stratum":"2-4","sampling_key":"3a72625b4f83f6746788bf24f6b9790d4edaa14ac614471497ea9ce6d70ff3d7","slow_code":"import sys\n\n\ndef main():\n s, t = sys.stdin.read().split()\n n, m = len(s), len(t)\n s = sorted(s)\n t = list(reversed(sorted(t)))\n if n < m:\n for i in range(n):\n if s[i] < t[i]:\n ans = \"Yes\"\n break\n elif s[i] > t[i]:\n ans = \"No\"\n break\n else:\n ans = \"Yes\"\n else:\n for i in range(m):\n if s[i] < t[i]:\n ans = \"Yes\"\n break\n elif s[i] > t[i]:\n ans = \"No\"\n break\n else:\n ans = \"No\"\n print(ans)\n\n\nif __name__ == \"__main__\":\n\n main()\n","fast_code":"s = list(input().strip())\ns1 = sorted(s)\nt = list(input().strip())\nt1 = sorted(t, reverse=True)\nif s1 < t1:\n print(\"Yes\")\nelse:\n print(\"No\")\n"} +{"fast_code_id":"bf2b25d30147294ff0276ceb1faeae7b06783207fa7b8ca256752e56cdee77d1","fast_id":"p02612_bf2b25d30147294ff0276ceb1faeae7b06783207fa7b8ca256752e56cdee77d1","language":"python","measured_fast_code_id":"bf2b25d30147294ff0276ceb1faeae7b06783207fa7b8ca256752e56cdee77d1","measured_slow_code_id":"8dde1aff283391e2d57ad3865fb24f31a09d7a6c5fe418b99f6dc494d6a6f32b","measurement_metric":"cpu_instruction_count","pair_id":"python_e24149e96bdb07635dfa7c93","problem_id":"p02612","slow_code_id":"8dde1aff283391e2d57ad3865fb24f31a09d7a6c5fe418b99f6dc494d6a6f32b","slow_id":"p02612_8dde1aff283391e2d57ad3865fb24f31a09d7a6c5fe418b99f6dc494d6a6f32b","speedup":2.8936485786260326,"stratum":"2-4","sampling_key":"3bc119cddad1c065054dc06a9bab15ca4d9c4ed81f769494d36ceb619e06e349","slow_code":"N = int(eval(input()))\nif N >= 1000:\n M = str(N)\n X = M[1:]\n O = int(X)\n if O == 0:\n print((0))\n else:\n print((1000 - O))\nelse:\n O = int(N)\n print((1000 - O))\n","fast_code":"print((-int(eval(input())) % 1000))\n"} +{"fast_code_id":"2743b8c5f26ad19530b3a42804178606b39b522429f37bd1678bca78658fb688","fast_id":"p03563_2743b8c5f26ad19530b3a42804178606b39b522429f37bd1678bca78658fb688","language":"python","measured_fast_code_id":"2743b8c5f26ad19530b3a42804178606b39b522429f37bd1678bca78658fb688","measured_slow_code_id":"59c6641cd1def8a06b45e4c0f0ace3ffa49de62fc97f73e0499cc3875cec5d01","measurement_metric":"cpu_instruction_count","pair_id":"python_e2cb5155a7185334d2988ed1","problem_id":"p03563","slow_code_id":"59c6641cd1def8a06b45e4c0f0ace3ffa49de62fc97f73e0499cc3875cec5d01","slow_id":"p03563_59c6641cd1def8a06b45e4c0f0ace3ffa49de62fc97f73e0499cc3875cec5d01","speedup":1658.9361405395366,"stratum":"8+","sampling_key":"07dbe11ee2a61dff2b90da17380b4a9919f3c20bd2feb00e43d931bbe9896bd9","slow_code":"import numpy as np\n\nlst = []\nR = int(eval(input()))\nG = int(eval(input()))\nans = G - R + G\nprint(ans)\n","fast_code":"current_rating = int(eval(input()))\nfinal_rating = int(eval(input()))\nperformance = final_rating * 2 - current_rating\nprint(performance)\n"} +{"fast_code_id":"9d2ee05141121455050ba47c5b97e0e97e30bc2b554707db60b644d17f3124cc","fast_id":"p03141_9d2ee05141121455050ba47c5b97e0e97e30bc2b554707db60b644d17f3124cc","language":"python","measured_fast_code_id":"9d2ee05141121455050ba47c5b97e0e97e30bc2b554707db60b644d17f3124cc","measured_slow_code_id":"b85f5eb3f7e46b36e4f11c0c1981fa76a4fe4f30ce61c8db3e8371e3651bfbe4","measurement_metric":"cpu_instruction_count","pair_id":"python_e2cebeffa8dfff5aa45e8df9","problem_id":"p03141","slow_code_id":"b85f5eb3f7e46b36e4f11c0c1981fa76a4fe4f30ce61c8db3e8371e3651bfbe4","slow_id":"p03141_b85f5eb3f7e46b36e4f11c0c1981fa76a4fe4f30ce61c8db3e8371e3651bfbe4","speedup":2.049028927267666,"stratum":"2-4","sampling_key":"15f33ba02b10fb2e975a50701d9c906c991f2c71f7a291491166c4f4034269d1","slow_code":"N = int(eval(input()))\nTakahashi = [None] * N\nAoki = [None] * N\nUsed = [False] * N\nfor i in range(N):\n a, b = list(map(int, input().split()))\n Takahashi[i] = (-a - b, -a, i)\n Aoki[i] = (-b - a, -b, i)\nTakahashi.sort()\nAoki.sort()\nTotalPoint = 0\nusedDish = 0\ntnum, anum = 0, 0\nwhile usedDish < N:\n if usedDish % 2 == 0:\n while Used[Takahashi[tnum][2]]:\n tnum += 1\n TotalPoint -= Takahashi[tnum][1]\n Used[Takahashi[tnum][2]] = True\n usedDish += 1\n else:\n while Used[Aoki[anum][2]]:\n anum += 1\n TotalPoint += Aoki[anum][1]\n Used[Aoki[anum][2]] = True\n usedDish += 1\nprint(TotalPoint)\n","fast_code":"n = int(eval(input()))\ne = []\ncurr = 0\nfor _ in range(n):\n a, b = list(map(int, input().split()))\n e.append(a + b)\n curr -= b\ne.sort(reverse=True)\nprint((curr + sum(e[::2])))\n"} +{"fast_code_id":"563e3a854c367edcac106291c167cd02520f572588c62bf44447ede6ae778246","fast_id":"p02619_563e3a854c367edcac106291c167cd02520f572588c62bf44447ede6ae778246","language":"python","measured_fast_code_id":"563e3a854c367edcac106291c167cd02520f572588c62bf44447ede6ae778246","measured_slow_code_id":"e06ba4d62ffe23f292e9554193c989e47766a38ef3e00279117101508edbb374","measurement_metric":"cpu_instruction_count","pair_id":"python_e307eda1f08d4c2da8f1f561","problem_id":"p02619","slow_code_id":"e06ba4d62ffe23f292e9554193c989e47766a38ef3e00279117101508edbb374","slow_id":"p02619_e06ba4d62ffe23f292e9554193c989e47766a38ef3e00279117101508edbb374","speedup":8.79558592226019,"stratum":"8+","sampling_key":"26c47828cd5dbf45724c308272577c76b826226d3f6edb31c43acae3fc9c3385","slow_code":"import numpy as np\n\nD = int(eval(input()))\nc = [int(i) for i in input().split()]\ns = []\nfor d in range(D):\n s.append([int(i) for i in input().split()])\nt = []\nfor d in range(D):\n t.append(int(eval(input())) - 1)\nv = [0] * D\nlast = [[0 for i in range(26)] for d in range(D)]\nfor d in range(D):\n if d >= 1:\n last[d] = last[d - 1][:]\n last[d][t[d]] = d + 1\nfor d in range(D):\n v[d] = s[d][t[d]] - sum([c[i] * (d + 1 - last[d][i]) for i in range(26)])\nv_sum = 0\nfor d in range(D):\n v_sum += v[d]\n print(v_sum)\n","fast_code":"D = int(eval(input()))\nc = [int(i) for i in input().split()]\ns = []\nfor d in range(D):\n s.append([int(i) for i in input().split()])\nt = []\nfor d in range(D):\n t.append(int(eval(input())) - 1)\nv = [0] * D\nlast = [[0 for i in range(26)] for d in range(D)]\nfor d in range(D):\n if d >= 1:\n last[d] = last[d - 1][:]\n last[d][t[d]] = d + 1\nfor d in range(D):\n v[d] = s[d][t[d]] - sum([c[i] * (d + 1 - last[d][i]) for i in range(26)])\nv_sum = 0\nfor d in range(D):\n v_sum += v[d]\n print(v_sum)\n"} +{"fast_code_id":"9c541d4058fd3070ca0e46643551846092fc90774d4298548a7c49a24559d226","fast_id":"p03125_9c541d4058fd3070ca0e46643551846092fc90774d4298548a7c49a24559d226","language":"python","measured_fast_code_id":"9c541d4058fd3070ca0e46643551846092fc90774d4298548a7c49a24559d226","measured_slow_code_id":"4b613364292341c90cb223444cc17d712d2692c86eaf7401941c05ab19a835ea","measurement_metric":"cpu_instruction_count","pair_id":"python_e38517b417a1bc47adc579d5","problem_id":"p03125","slow_code_id":"8b3f73d78db4b17be952c8e49db130961979c1aa4d15ae41972fb4783a0ae1cc","slow_id":"p03125_4b613364292341c90cb223444cc17d712d2692c86eaf7401941c05ab19a835ea","speedup":3.0851194451843726,"stratum":"2-4","sampling_key":"1b962542c6943e91a970044cb8698911afda118c9f8418d95e1819f3f17ec835","slow_code":"import sys\nimport math\nfrom bisect import bisect_right as br\nfrom bisect import bisect_left as bl\n\nsys.setrecursionlimit(2147483647)\nfrom heapq import heappush, heappop, heappushpop\nfrom collections import defaultdict\nfrom itertools import accumulate\nfrom collections import Counter\nfrom collections import deque\nfrom operator import itemgetter\nfrom itertools import permutations\n\nmod = 10**9 + 7\ninf = float(\"inf\")\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\na, b = LI()\nif b % a == 0:\n print((a + b))\nelse:\n print((b - a))\n","fast_code":"A, B = list(map(int, input().split()))\nif B % A == 0:\n print(str(A + B))\nelse:\n print(str(B - A))\n"} +{"fast_code_id":"94e63a2cd248c4c88e94a13fc795fdc0e6bf4f709e0b917000e629e8c325a5af","fast_id":"p03806_3a93dfbbb4602fb981c3e3d6b740a1d955e2eacee2b555b48db86d382db19c56","language":"python","measured_fast_code_id":"3a93dfbbb4602fb981c3e3d6b740a1d955e2eacee2b555b48db86d382db19c56","measured_slow_code_id":"447c80beaa8d7ecc746ea531c4fee01e494d9827b685cf74b6b676499a17dddf","measurement_metric":"cpu_instruction_count","pair_id":"python_e3a0fae0ee59417bec9e9775","problem_id":"p03806","slow_code_id":"447c80beaa8d7ecc746ea531c4fee01e494d9827b685cf74b6b676499a17dddf","slow_id":"p03806_447c80beaa8d7ecc746ea531c4fee01e494d9827b685cf74b6b676499a17dddf","speedup":43.72495124888867,"stratum":"8+","sampling_key":"001ac6c98a95aa61c8e233acacc7207be5b6795a811bf63cf3113ae7d5639e90","slow_code":"def main():\n n, ma, mb = list(map(int, input().split()))\n dp = [\n [[float(\"inf\") for _ in range(401)] for _ in range(401)] for _ in range(n + 1)\n ]\n dp[0][0][0] = 0\n for i in range(1, n + 1):\n a, b, c = list(map(int, input().split()))\n for j in range(401):\n for k in range(401):\n if a <= j and b <= k:\n dp[i][j][k] = min(dp[i - 1][j][k], dp[i - 1][j - a][k - b] + c)\n else:\n dp[i][j][k] = dp[i - 1][j][k]\n ans = float(\"inf\")\n for i in range(1, 401):\n for j in range(1, 401):\n if i * mb == j * ma:\n ans = min(ans, dp[n][i][j])\n if ans == float(\"inf\"):\n print((-1))\n else:\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"n, ma, mb = list(map(int, input().split()))\nel = [list(map(int, input().split())) for i in range(n)]\nsa = sum(i[0] for i in el)\nsb = sum(i[1] for i in el)\n\ninf = 10000000000\nx = [[inf for j in range(sb + 1)] for i in range(sa + 1)]\nx[0][0] = 0\nfor i in range(n):\n now = el[i]\n x_sub = [[0 for j in range(sb + 1)] for i in range(sa + 1)]\n for k in range(sa + 1):\n for l in range(sb + 1):\n if x[k][l] != inf and k + now[0] < sa + 1 and l + now[1] < sb + 1:\n x_sub[k + now[0]][l + now[1]] = x[k][l] + now[2]\n for k in range(sa + 1):\n for l in range(sb + 1):\n if x_sub[k][l] != 0:\n x[k][l] = min(x[k][l], x_sub[k][l])\nmi = min(sa // ma, sb // mb)\nans = inf\nfor i in range(1, mi + 1):\n ans = min(ans, x[ma * i][mb * i])\nif ans == inf:\n print((-1))\nelse:\n print(ans)\n"} +{"fast_code_id":"682d751091cf89e1ad70930160ea7a742b6e10b056be71cc733386cc4788dd10","fast_id":"p03476_682d751091cf89e1ad70930160ea7a742b6e10b056be71cc733386cc4788dd10","language":"python","measured_fast_code_id":"682d751091cf89e1ad70930160ea7a742b6e10b056be71cc733386cc4788dd10","measured_slow_code_id":"8aa7b666b84d39afd40676a7baf00d0d5305252089aa4d028b941a7f3531316e","measurement_metric":"cpu_instruction_count","pair_id":"python_e3afc2247c1a509e1dcba46f","problem_id":"p03476","slow_code_id":"8aa7b666b84d39afd40676a7baf00d0d5305252089aa4d028b941a7f3531316e","slow_id":"p03476_8aa7b666b84d39afd40676a7baf00d0d5305252089aa4d028b941a7f3531316e","speedup":5.251963648699255,"stratum":"4-8","sampling_key":"093bffcb6b9e7aaa403836cde4eea4ed6ceb0ccae73972e6df1fd2551dd744a1","slow_code":"import math\n\n\ndef is_prime(n):\n if n == 1:\n return False\n for k in range(2, int(math.sqrt(n)) + 1):\n if n % k == 0:\n return False\n return True\n\n\ncount = [0]\nbuf = 0\nfor i in range(1, 10**5 + 2):\n if i % 2 == 0:\n count.append(buf)\n continue\n hantei1 = is_prime(i)\n hantei2 = is_prime((i + 1) // 2)\n if hantei1 and hantei2:\n buf += 1\n count.append(buf)\nq = int(eval(input()))\nfor i in range(q):\n l, r = list(map(int, input().split()))\n print((count[r] - count[l - 1]))\n","fast_code":"from bisect import bisect_left, bisect_right\n\n\ndef primes(n):\n is_prime = [True] * (n + 1)\n is_prime[0] = False\n is_prime[1] = False\n for i in range(2, int(n**0.5) + 1):\n if not is_prime[i]:\n continue\n for j in range(i * 2, n + 1, i):\n is_prime[j] = False\n return [i for i in range(3, n + 1) if is_prime[i]]\n\n\nprime = primes(10**5)\np_set = set(prime)\nlike = [3]\nfor i in prime:\n if (i + 1) // 2 in p_set:\n like.append(i)\nQ = int(eval(input()))\nfor _ in range(Q):\n l, r = list(map(int, input().split()))\n print((bisect_right(like, r) - bisect_left(like, l)))\n"} +{"fast_code_id":"d403aea45d369f28cdd03fb6b71926bd847f65f7b3d2db08a0c13dfd5e1d17f1","fast_id":"p03860_d403aea45d369f28cdd03fb6b71926bd847f65f7b3d2db08a0c13dfd5e1d17f1","language":"python","measured_fast_code_id":"d403aea45d369f28cdd03fb6b71926bd847f65f7b3d2db08a0c13dfd5e1d17f1","measured_slow_code_id":"f9c7ff6ccba211df6aa7649f397d5aec3b7d4b68331ab1524aeb9717fd467838","measurement_metric":"cpu_instruction_count","pair_id":"python_e3e8f6169a25221fc815508a","problem_id":"p03860","slow_code_id":"f9c7ff6ccba211df6aa7649f397d5aec3b7d4b68331ab1524aeb9717fd467838","slow_id":"p03860_f9c7ff6ccba211df6aa7649f397d5aec3b7d4b68331ab1524aeb9717fd467838","speedup":3.7287526361861816,"stratum":"2-4","sampling_key":"2cc7ecaf94b401ceecfcd3fd53a1d298691ea8b2326c44f6eca4c343e2ca20b3","slow_code":"ls = input().split()\nLs = []\n\n\ndef fun():\n print(\"111\")\n print(\"222\")\n print(\"333\")\n print(\"ii\")\n\n\nfor i in ls:\n Ls.append(i[0])\nprint((\"\".join(Ls)))\n","fast_code":"print(\"A%sC\" % input()[8])\n"} +{"fast_code_id":"2fd935756d3e5a0126da2f77301365ec46fcc5220049601e88d06587621aec96","fast_id":"p03274_2fd935756d3e5a0126da2f77301365ec46fcc5220049601e88d06587621aec96","language":"python","measured_fast_code_id":"2fd935756d3e5a0126da2f77301365ec46fcc5220049601e88d06587621aec96","measured_slow_code_id":"15cce6db7bc6d79dcd48950e05503001080b8e54791a05cbcc84aecc1f823153","measurement_metric":"cpu_instruction_count","pair_id":"python_e4f401d8821266c0e2009e27","problem_id":"p03274","slow_code_id":"15cce6db7bc6d79dcd48950e05503001080b8e54791a05cbcc84aecc1f823153","slow_id":"p03274_15cce6db7bc6d79dcd48950e05503001080b8e54791a05cbcc84aecc1f823153","speedup":3.4859954126596464,"stratum":"2-4","sampling_key":"07dc77b56da4bc8c9032d17c69f7359e10f7303f8bc3dabfdb7f8b32bec28a59","slow_code":"import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time\n\nsys.setrecursionlimit(10**7)\ninf = 10**20\nmod = 10**9 + 7\n\n\ndef LI():\n return list(map(int, input().split()))\n\n\ndef I():\n return int(eval(input()))\n\n\ndef LS():\n return input().split()\n\n\ndef S():\n return eval(input())\n\n\ndef main():\n n, k = LI()\n l = LI()\n mn = inf\n for i in range(n - k + 1):\n a = l[i]\n b = l[i + k - 1]\n if a < 0 and b > 0:\n mn = min([mn, abs(a) + abs(b) * 2, abs(a) * 2 + abs(b)])\n else:\n mn = min(mn, max(abs(a), abs(b)))\n return mn\n\n\nprint((main()))\n","fast_code":"n, k = list(map(int, input().split()))\nX = list(map(int, input().split()))\nans = float(\"inf\")\nfor i in range(n - k + 1):\n l, r = X[i], X[i + k - 1]\n if r <= 0:\n ans = min(abs(l), ans)\n elif 0 <= l:\n ans = min(abs(r), ans)\n else:\n dist = min(abs(l), abs(r)) * 2 + max(abs(l), abs(r))\n ans = min(dist, ans)\nprint(ans)\n"} +{"fast_code_id":"a0bd71321fa65881ecea10a3368dec692ada88087b2a39a7deb6a5615c3add72","fast_id":"p02675_13457c06fb1915b6e1b2ef3a05933c1ba76d50ea4b5111261e17f0d1dbb6f6ce","language":"python","measured_fast_code_id":"13457c06fb1915b6e1b2ef3a05933c1ba76d50ea4b5111261e17f0d1dbb6f6ce","measured_slow_code_id":"bcce039052b5a9d508977350d4acfbd9fe58862ea34a03a2bcd6716f9ff97915","measurement_metric":"cpu_instruction_count","pair_id":"python_e5cb1e81b85daff864fea3a7","problem_id":"p02675","slow_code_id":"a356f7da63a7609258cca42cfa76beeb6639c9b361627aee5fe4197d7e864b71","slow_id":"p02675_bcce039052b5a9d508977350d4acfbd9fe58862ea34a03a2bcd6716f9ff97915","speedup":3.8324351546892412,"stratum":"2-4","sampling_key":"c754e43bc8a503cee156d43df94cf050bae6a37cb6bcbcbdc01f6900763dff05","slow_code":"import sys\nimport math\nimport collections\nimport itertools\n\nINF = 10**13\nMOD = 10**9 + 7\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef lcm(x, y):\n return (x * y) // math.gcd(x, y)\n\n\ndef I():\n return int(input())\n\n\ndef LI():\n return [int(x) for x in input().split()]\n\n\ndef RI(N):\n return [int(input()) for _ in range(N)]\n\n\ndef LRI(N):\n return [[int(x) for x in input().split()] for _ in range(N)]\n\n\ndef LS():\n return input().split()\n\n\ndef RS(N):\n return [input() for _ in range(N)]\n\n\ndef LRS(N):\n return [input().split() for _ in range(N)]\n\n\ndef PL(L):\n print(*L, sep=\"\\n\")\n\n\ndef YesNo(B):\n print(\"Yes\" if B else \"No\")\n\n\ndef YESNO(B):\n print(\"YES\" if B else \"NO\")\n\n\nN = input()\nn = int(N[-1])\nif n in [2, 4, 5, 7, 9]:\n print(\"hon\")\nelif n in [0, 1, 6, 8]:\n print(\"pon\")\nelse:\n print(\"bon\")\n","fast_code":"import sys\n\nsr = lambda: sys.stdin.readline().rstrip()\nir = lambda: int(sr())\nlr = lambda: list(map(int, sr().split()))\nN = sr()[-1]\nif N == \"3\":\n answer = \"bon\"\nelif N in \"0168\":\n answer = \"pon\"\nelse:\n answer = \"hon\"\nprint(answer)\n"} +{"fast_code_id":"02952b5343791f7e9cbf755ebc67676afbd1a59fb0391b64459cf3edf5653a17","fast_id":"p03472_02952b5343791f7e9cbf755ebc67676afbd1a59fb0391b64459cf3edf5653a17","language":"python","measured_fast_code_id":"02952b5343791f7e9cbf755ebc67676afbd1a59fb0391b64459cf3edf5653a17","measured_slow_code_id":"1fe6f3809126498268184a8e7e7c9a2544d3e54aaf6046ac7942710e3728b9cd","measurement_metric":"cpu_instruction_count","pair_id":"python_e5d7ac7782c9d268a6c694a5","problem_id":"p03472","slow_code_id":"1fe6f3809126498268184a8e7e7c9a2544d3e54aaf6046ac7942710e3728b9cd","slow_id":"p03472_1fe6f3809126498268184a8e7e7c9a2544d3e54aaf6046ac7942710e3728b9cd","speedup":2.7310237009342844,"stratum":"2-4","sampling_key":"474f64243dd5415084def96893fec83007da2fea1e6deb137da99695c91399a3","slow_code":"import sys\n\ninput = sys.stdin.readline\nN, H = list(map(int, input().split()))\nkatanas = []\nfor _ in range(N):\n a, b = list(map(int, input().split()))\n katanas.append((a, b))\nmax_a = sorted(katanas, reverse=True)[0][0]\nthrows = []\nfor a, b in katanas:\n if max_a < b:\n throws.append(b)\nans = 0\nfor b in sorted(throws, reverse=True):\n H -= b\n ans += 1\n if H <= 0:\n print(ans)\n sys.exit()\nprint((ans + (H - 1) // max_a + 1))\n","fast_code":"n, h, *t = list(map(int, open(0).read().split()))\nb = sorted(t[1::2])\na = max(t[::2])\nc = 0\nwhile h > 0 and b and b[-1] > a:\n h -= b.pop()\n c += 1\nif h > 0:\n c -= -h // a\nprint(c)\n"} +{"fast_code_id":"7d28b13d8f36da831b4e8db42d66579a96c1758ec79426d7321df8f3ee1fb05c","fast_id":"p03576_7d28b13d8f36da831b4e8db42d66579a96c1758ec79426d7321df8f3ee1fb05c","language":"python","measured_fast_code_id":"7d28b13d8f36da831b4e8db42d66579a96c1758ec79426d7321df8f3ee1fb05c","measured_slow_code_id":"6c48ca4952222a34459527fefebd4fba0a4aef00613d16a58fcec410d8fd9e1e","measurement_metric":"cpu_instruction_count","pair_id":"python_e6143afad255a58545ec3cd4","problem_id":"p03576","slow_code_id":"6c48ca4952222a34459527fefebd4fba0a4aef00613d16a58fcec410d8fd9e1e","slow_id":"p03576_6c48ca4952222a34459527fefebd4fba0a4aef00613d16a58fcec410d8fd9e1e","speedup":5.227529513934424,"stratum":"4-8","sampling_key":"377fe757f86d6b2526a4a9a0c3f70cac1f0517a27959cf9390280a8c788802f2","slow_code":"from collections import deque\nimport sys\n\nsys.setrecursionlimit(10**6)\nint1 = lambda x: int(x) - 1\np2D = lambda x: print(*x, sep=\"\\n\")\n\n\ndef II():\n return int(sys.stdin.readline())\n\n\ndef MI():\n return map(int, sys.stdin.readline().split())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\ndef LLI(rows_number):\n return [LI() for _ in range(rows_number)]\n\n\ndef SI():\n return sys.stdin.readline()[:-1]\n\n\ndef main():\n n, k = MI()\n xx = set()\n yy = set()\n xy = []\n for _ in range(n):\n x, y = MI()\n xy.append((x, y))\n xx.add(x)\n yy.add(y)\n xy.sort()\n xx = list(sorted(xx))\n yy = list(sorted(yy))\n xn = len(xx)\n yn = len(yy)\n ans = 10**20\n for t in range(yn):\n y2 = yy[t]\n for b in range(t):\n y1 = yy[b]\n r = -1\n s = 0\n i = j = 0\n for l, x1 in enumerate(xx):\n while i < n and xy[i][0] < x1:\n if y1 <= xy[i][1] <= y2:\n s -= 1\n i += 1\n while s < k and r + 1 < xn:\n r += 1\n x2 = xx[r]\n while j < n and xy[j][0] <= x2:\n if y1 <= xy[j][1] <= y2:\n s += 1\n j += 1\n if s >= k:\n cur = (x2 - x1) * (y2 - y1)\n if cur < ans:\n ans = cur\n print(ans)\n\n\nmain()\n","fast_code":"n, k = list(map(int, input().split()))\nz = [list(map(int, input().split())) for _ in range(n)]\nz.sort()\na = 10**20\nfor i in range(n):\n for j in range(i + 1, n):\n x = z[j][0] - z[i][0]\n l = sorted(t[1] for t in z[i : j + 1])\n for u, v in zip(l, l[k - 1 :]):\n a = min(a, x * (v - u))\nprint(a)\n"} +{"fast_code_id":"57c1c454638dbda7d967b9345f5a8dd9a57935728d89aece19b49ab971a0d5bd","fast_id":"p02361_57c1c454638dbda7d967b9345f5a8dd9a57935728d89aece19b49ab971a0d5bd","language":"python","measured_fast_code_id":"57c1c454638dbda7d967b9345f5a8dd9a57935728d89aece19b49ab971a0d5bd","measured_slow_code_id":"a48d0b96003d389be54b84ff869a67e52827774163e88aa4dae4f6c2782d1681","measurement_metric":"cpu_instruction_count","pair_id":"python_e700d72533cc07ef1ca4a695","problem_id":"p02361","slow_code_id":"a48d0b96003d389be54b84ff869a67e52827774163e88aa4dae4f6c2782d1681","slow_id":"p02361_a48d0b96003d389be54b84ff869a67e52827774163e88aa4dae4f6c2782d1681","speedup":2.02049600373846,"stratum":"2-4","sampling_key":"2019e9f908113cb6b7690de42827f526766681dd29946c85e69ff3bbd4498f4d","slow_code":"import sys\nimport queue\n\n\nclass Dijkstra:\n class Edge:\n def __init__(self, end, cost):\n self.to = end\n self.cost = cost\n\n def __init__(self, node_size, inf):\n self._node = node_size\n self._graph = [[] for _ in range(self._node)]\n self.inf = inf\n self.dist = [self.inf for _ in range(self._node)]\n\n def add_edge(self, st, ed, cs):\n self._graph[st].append(self.Edge(ed, cs))\n\n def solve(self, start):\n que = queue.PriorityQueue()\n self.dist[start] = 0\n que.put((0, start))\n while not que.empty():\n cur_cost, cur_vertex = que.get()\n if self.dist[cur_vertex] < cur_cost:\n continue\n for e in self._graph[cur_vertex]:\n if self.dist[e.to] > cur_cost + e.cost:\n self.dist[e.to] = cur_cost + e.cost\n que.put((self.dist[e.to], e.to))\n\n\nif __name__ == \"__main__\":\n V, E, r = list(map(int, sys.stdin.readline().split()))\n dk = Dijkstra(V, 10**10)\n for i in range(E):\n s, t, d = list(map(int, sys.stdin.readline().split()))\n dk.add_edge(s, t, d)\n dk.solve(r)\n for value in dk.dist:\n if value == dk.inf:\n print(\"INF\")\n else:\n print(value)\n","fast_code":"from sys import stdin\nfrom collections import defaultdict, deque\nimport math\n\nreadline = stdin.readline\nv, e, r = list(map(int, readline().split()))\ng = defaultdict(list)\nfor i in range(e):\n s, t, length = list(map(int, readline().split()))\n g[s].append((length, t))\nd = [float(\"inf\")] * v\nd[r] = 0\nque = deque([(d[r], r)])\nwhile que:\n du, u = que.popleft()\n for length, v in g[u]:\n if d[v] > du + length:\n d[v] = du + length\n que.append((d[v], v))\nfor di in d:\n print((\"INF\" if math.isinf(di) else di))\n"} +{"fast_code_id":"37547d6e3e4fe9151053c9941813a985731299e7d5c6bd11024df690659d7e40","fast_id":"p02683_37547d6e3e4fe9151053c9941813a985731299e7d5c6bd11024df690659d7e40","language":"python","measured_fast_code_id":"37547d6e3e4fe9151053c9941813a985731299e7d5c6bd11024df690659d7e40","measured_slow_code_id":"7d2ea19f7649c5638e9e247851b1d4f026b3d507e489e455af46c5e783f4470d","measurement_metric":"cpu_instruction_count","pair_id":"python_e709e2adad1ad6b80fb88458","problem_id":"p02683","slow_code_id":"7d2ea19f7649c5638e9e247851b1d4f026b3d507e489e455af46c5e783f4470d","slow_id":"p02683_7d2ea19f7649c5638e9e247851b1d4f026b3d507e489e455af46c5e783f4470d","speedup":39.18942993268453,"stratum":"8+","sampling_key":"0916d91f64f7efa314d1609e520732a4438c33c3142fe5ab7f9b688fb62d01af","slow_code":"import numpy as np\n\nN, M, X = list(map(int, input().split()))\nC = [0] * N\nA = np.zeros((N, M), int)\nfor i in range(N):\n C[i], *A[i] = list(map(int, input().split()))\nans = 12345678\nfor bit in range(1, 2**N):\n c = [C[i] for i in range(N) if bit & (1 << i)]\n a = [A[i] for i in range(N) if bit & (1 << i)]\n a = np.array(a)\n if all(a.sum(0) >= X):\n ans = min(ans, sum(c))\nprint((-1 if ans == 12345678 else ans))\n","fast_code":"from sys import stdin, stdout\n\nrl = lambda: stdin.readline()\nrll = lambda: stdin.readline().split()\nrli = lambda: list(map(int, stdin.readline().split()))\nINF, NINF = float(\"inf\"), float(\"-inf\")\n\n\ndef submasks(m):\n s = m\n while s > 0:\n s = (s - 1) & m\n yield s\n\n\ndef main():\n n, m, x = rli()\n A = []\n for _ in range(n):\n A.append(list(rli()))\n mask = 0\n for i in range(n):\n mask |= 1 << i\n opt = INF\n\n def process(s):\n nonlocal opt\n i = 0\n cost = 0\n algs = [0 for _ in range(m)]\n while s:\n s, bit = divmod(s, 2)\n if bit:\n cost += A[i][0]\n for j in range(1, m + 1):\n algs[j - 1] += A[i][j]\n i += 1\n if all(skill >= x for skill in algs):\n opt = min(opt, cost)\n\n process(mask)\n for s in submasks(mask):\n process(s)\n print((opt if opt < INF else -1))\n stdout.close()\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"19f1599ea6de8a19aebe50bded1ee2ed845af9656bed1eb7c085e4fdfef53406","fast_id":"p02890_b135861f34453e9187acbc7ee07a7460d65ffea8f893fea0d5bb0c85c3aefb28","language":"python","measured_fast_code_id":"b135861f34453e9187acbc7ee07a7460d65ffea8f893fea0d5bb0c85c3aefb28","measured_slow_code_id":"683b16708a4919fe826584e325a20783d2265d979233683a19a27263211ea906","measurement_metric":"cpu_instruction_count","pair_id":"python_e73053648f11ae73865ac2ef","problem_id":"p02890","slow_code_id":"2c57f5c3d6e04ae779c203c63a7a33316889e85db23460b3b699e27933e99fbd","slow_id":"p02890_683b16708a4919fe826584e325a20783d2265d979233683a19a27263211ea906","speedup":3.3523371199322556,"stratum":"2-4","sampling_key":"ac06b982a96b006653ad6ab4b126c54425b7b8c9eccb5501e67b8b9d1dc573cd","slow_code":"import sys\nimport math\nfrom bisect import bisect_right as br\nfrom bisect import bisect_left as bl\n\nsys.setrecursionlimit(2147483647)\nfrom heapq import heappush, heappop, heappushpop\nfrom collections import defaultdict\nfrom itertools import accumulate\nfrom collections import Counter\nfrom collections import deque\nfrom operator import itemgetter\nfrom itertools import permutations\n\nmod = 10**9 + 7\ninf = float(\"inf\")\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\nn = I()\na = LI()\ncnt = list(Counter(a).values())\ncnt.sort()\nm = len(cnt)\nS = [0] * (n + 1)\nfor x in range(1, n + 1):\n l = bl(cnt, x)\n S[x] = S[x - 1] + (m - l)\nfor k in range(1, n + 1):\n high, low = n + 1, 0\n while high - low > 1:\n mid = (high + low) // 2\n if S[mid] >= k * mid:\n low = mid\n else:\n high = mid\n print(low)\n","fast_code":"I = int(eval(input()))\nfrom collections import Counter\nfrom itertools import accumulate\n\nAs = list(map(int, input().split()))\nxs = sorted([x for x in list(Counter(As).values())]) + [10**18]\nXs = accumulate(xs)\n\n\ndef bsearch(target, min_i, max_i, func):\n\n if func(max_i) <= target:\n return max_i\n if target < func(min_i):\n return min_i - 1\n index = (max_i + min_i) // 2\n while True:\n if func(index) <= target:\n if target < func(index + 1):\n return index\n index, min_i = (index + 1 + max_i) // 2, index + 1\n continue\n index, max_i = (index - 1 + min_i) // 2, index - 1\n\n\nN = len(xs) - 1\nrs = [0] * I\nmny = N + 1\nfor l, (x, X) in enumerate(zip(xs[1:], Xs)):\n l += 2\n y = bsearch(0, N - l + 2, N + 1, lambda k: x > X // (k - (N - l + 1)))\n y += 1\n\n for i in range(y, mny):\n rs[i - 1] = X // (i - (N - l + 1))\n mny = min(y, mny)\nfor r in rs:\n print(r)\n"} +{"fast_code_id":"7253eea00ba4bf231d766aad0e05f1a51cc0f6fdf66a9b44de00cf7bac0c8149","fast_id":"p03455_7253eea00ba4bf231d766aad0e05f1a51cc0f6fdf66a9b44de00cf7bac0c8149","language":"python","measured_fast_code_id":"7253eea00ba4bf231d766aad0e05f1a51cc0f6fdf66a9b44de00cf7bac0c8149","measured_slow_code_id":"1e58957cce6049d366f3189df1c6244aa3226734d9f71da11d6221cbf487aae2","measurement_metric":"cpu_instruction_count","pair_id":"python_e73f44f059e32d733b9b071a","problem_id":"p03455","slow_code_id":"1e58957cce6049d366f3189df1c6244aa3226734d9f71da11d6221cbf487aae2","slow_id":"p03455_1e58957cce6049d366f3189df1c6244aa3226734d9f71da11d6221cbf487aae2","speedup":2.2398938394568595,"stratum":"2-4","sampling_key":"12406678e2495ee28e0394b4bde1be0b87b342143fc771de6f446b29e505ddea","slow_code":"def ketanowa(p):\n ans = 0\n p = str(p)\n for i in p:\n ans += int(i)\n return ans\n\n\ndef main():\n temp = input().split(\" \")\n n = int(temp[0])\n a = int(temp[1])\n if n * a % 2 == 0:\n print(\"Even\")\n else:\n print(\"Odd\")\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"x = input().split()\ny = int(x[0]) * int(x[1])\nif y % 2:\n print(\"Odd\")\nelse:\n print(\"Even\")\n"} +{"fast_code_id":"10b7e242c2a5f8abb0e1ace59cfd32548bea28acd63c40b928f171084b52de75","fast_id":"p02642_10b7e242c2a5f8abb0e1ace59cfd32548bea28acd63c40b928f171084b52de75","language":"python","measured_fast_code_id":"10b7e242c2a5f8abb0e1ace59cfd32548bea28acd63c40b928f171084b52de75","measured_slow_code_id":"bb032738b2a92c573bb8551b5b7382bec1fcfece28073f8018a01331a18cfdcc","measurement_metric":"cpu_instruction_count","pair_id":"python_e7eb7988fdad7204db8f53cc","problem_id":"p02642","slow_code_id":"bb032738b2a92c573bb8551b5b7382bec1fcfece28073f8018a01331a18cfdcc","slow_id":"p02642_bb032738b2a92c573bb8551b5b7382bec1fcfece28073f8018a01331a18cfdcc","speedup":4.6299252683991625,"stratum":"4-8","sampling_key":"3457c266621c3af025547d4bdcc6380827366937ceba8f0445317636e62a2a6f","slow_code":"N = int(eval(input()))\nA = list(map(int, input().split()))\nm = max(A)\nU = [0] * (m + 1)\nfor e in A:\n U[e] += 1\nans = 0\nfor k in range(1, m + 1):\n if U[k] == 1:\n ans += 1\n if U[k] > 0:\n for l in range(2 * k, m + 1, k):\n if U[l] > 0:\n U[l] += 1\nprint(ans)\n","fast_code":"n = int(eval(input()))\nA = sorted(map(int, input().split()))\nU = 10**6\nline = [1] * (U + 1)\nans = set()\ndepricated = set()\ncnt = [0] * (U + 1)\nfor a in A:\n cnt[a] += 1\n if cnt[a] == 2 and line[a]:\n depricated.add(a)\n continue\n if 2 < cnt[a]:\n continue\n if line[a]:\n ans.add(a)\n for p in range(2 * a, U + 1, a):\n line[p] = 0\nprint((len(ans - depricated)))\n"} +{"fast_code_id":"fd949ab1cd967cee7273469c8fc8bd1605344b0dba5564378a7d7c8b2d514d3c","fast_id":"p02556_fd949ab1cd967cee7273469c8fc8bd1605344b0dba5564378a7d7c8b2d514d3c","language":"python","measured_fast_code_id":"fd949ab1cd967cee7273469c8fc8bd1605344b0dba5564378a7d7c8b2d514d3c","measured_slow_code_id":"05dfc996f7e3842463d6cd57d02877a281066db95acd7311507e26b5daabff76","measurement_metric":"cpu_instruction_count","pair_id":"python_e875afbb94fc18a7c2aceb11","problem_id":"p02556","slow_code_id":"05dfc996f7e3842463d6cd57d02877a281066db95acd7311507e26b5daabff76","slow_id":"p02556_05dfc996f7e3842463d6cd57d02877a281066db95acd7311507e26b5daabff76","speedup":5.483316517100695,"stratum":"4-8","sampling_key":"8f720cfc0869f4ce6f1bcc79be510a468e6ce6b7a352a2ebbb7ba275bcb5cc14","slow_code":"N = int(eval(input()))\n\n\ndef dist(A, B):\n return abs(A[0] - B[0]) + abs(A[1] - B[1])\n\n\nXY = [tuple(map(int, input().split())) for _ in range(N)]\nINF = -(10**10)\nans = 0\nfor O in [(INF, INF), (-INF, INF), (INF, -INF), (-INF, -INF)]:\n S = XY[0]\n for xy in XY:\n if dist(O, S) < dist(O, xy):\n S = xy\n O = S\n for xy in XY:\n if dist(O, S) < dist(O, xy):\n S = xy\n ans = max(ans, dist(O, S))\nprint(ans)\n","fast_code":"n, *XY = list(map(int, open(0).read().split()))\nX, Y = XY[::2], XY[1::2]\nA = [x + y for x, y in zip(X, Y)]\nB = [x - y for x, y in zip(X, Y)]\nprint((max(max(A) - min(A), max(B) - min(B))))\n"} +{"fast_code_id":"60bdc1d135f85e10cfcc335cc8945c085952f02cb44b42b80537667c85c38f6f","fast_id":"p03796_60bdc1d135f85e10cfcc335cc8945c085952f02cb44b42b80537667c85c38f6f","language":"python","measured_fast_code_id":"60bdc1d135f85e10cfcc335cc8945c085952f02cb44b42b80537667c85c38f6f","measured_slow_code_id":"43b257e85e546d9470ced772c67918bde77d5626a2fd04dea2e6a84c615224a5","measurement_metric":"cpu_instruction_count","pair_id":"python_e8790293f0644f1092fc981a","problem_id":"p03796","slow_code_id":"5ff598b9800e1bd896356b079e05a6afa89737def3d95243ef8ae46ed85960b1","slow_id":"p03796_43b257e85e546d9470ced772c67918bde77d5626a2fd04dea2e6a84c615224a5","speedup":2.5350279544920227,"stratum":"2-4","sampling_key":"2ab12e0e58b2478158b56b81aa28573514f76d01d4534c69b50f605129c04cdc","slow_code":"from math import factorial\n\nn = int(eval(input()))\nprint((factorial(n) % (10**9 + 7)))\n","fast_code":"N = int(eval(input()))\nMOD = 10**9 + 7\nans = 1\nfor i in range(1, N + 1):\n ans = (ans * i) % MOD\nprint(ans)\n"} +{"fast_code_id":"78e07429bd6b18a24bb9452bffb214fae3238ca75d7395c732e7197d41429249","fast_id":"p02883_78e07429bd6b18a24bb9452bffb214fae3238ca75d7395c732e7197d41429249","language":"python","measured_fast_code_id":"78e07429bd6b18a24bb9452bffb214fae3238ca75d7395c732e7197d41429249","measured_slow_code_id":"89d6694c33292de91a1011c40ba1f43b8a55e43ab7d13d625a0ff741f7a3effc","measurement_metric":"cpu_instruction_count","pair_id":"python_e88a5a053c8c90af0ad13711","problem_id":"p02883","slow_code_id":"89d6694c33292de91a1011c40ba1f43b8a55e43ab7d13d625a0ff741f7a3effc","slow_id":"p02883_89d6694c33292de91a1011c40ba1f43b8a55e43ab7d13d625a0ff741f7a3effc","speedup":7.112534443362789,"stratum":"4-8","sampling_key":"be0f7f5f54734de9f42b25b16a0429133d924fa9ae3aab2c78704b3f9e0f1dab","slow_code":"import math\n\nN, K = list(map(int, input().split()))\nX = [\n (b, a * b)\n for a, b in zip(\n sorted(list(map(int, input().split()))),\n sorted(list(map(int, input().split())))[::-1],\n )\n]\nm, M, i = 0, 10**12, 1\nexec(\n \"i,M,m=((i+m)//2,i,m) if sum(math.ceil(max(0,c-i)/b)for b, c in X)<=K else((i+M)//2,M,i);\"\n * 50\n)\nprint(M)\n","fast_code":"import sys\n\nread = sys.stdin.read\nreadline = sys.stdin.readline\nreadlines = sys.stdin.readlines\nsys.setrecursionlimit(10**9)\nINF = 1 << 60\nMOD = 1000000007\n\n\ndef main():\n N, K, *AF = list(map(int, read().split()))\n A = AF[:N]\n F = AF[N:]\n A.sort()\n F.sort(reverse=True)\n C = [a * f for a, f in zip(A, F)]\n\n def is_ok(cost):\n k = 0\n for c, f in zip(C, F):\n if c > cost:\n k += (c - cost + f - 1) // f\n return k <= K\n\n ok = max(C)\n ng = -1\n while ok - ng > 1:\n mid = (ok + ng) // 2\n if is_ok(mid):\n ok = mid\n else:\n ng = mid\n print(ok)\n return\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"0e5acd07e9302d505debdade53d70f7ad2ff451ebb45e710a9abe8bea9bc151e","fast_id":"p00033_0e5acd07e9302d505debdade53d70f7ad2ff451ebb45e710a9abe8bea9bc151e","language":"python","measured_fast_code_id":"0e5acd07e9302d505debdade53d70f7ad2ff451ebb45e710a9abe8bea9bc151e","measured_slow_code_id":"cceb1f2e2d09140b45c7d16169008011222b0bc177f58ecd4909af55948b3e6a","measurement_metric":"cpu_instruction_count","pair_id":"python_e8c8101531c8d604b3b47a81","problem_id":"p00033","slow_code_id":"cceb1f2e2d09140b45c7d16169008011222b0bc177f58ecd4909af55948b3e6a","slow_id":"p00033_cceb1f2e2d09140b45c7d16169008011222b0bc177f58ecd4909af55948b3e6a","speedup":3.252580965006128,"stratum":"2-4","sampling_key":"dd4358750210515b39e3d5716a1bd988c7db03c175113920b94659e9cac7add1","slow_code":"N = int(input())\nfor c in range(N):\n B = [0]\n C = [0]\n\n def dfs(depth):\n if depth == 10:\n return True\n res = False\n if B[-1] < A[depth]:\n B.append(A[depth])\n res |= dfs(depth + 1)\n del B[-1]\n if C[-1] < A[depth]:\n C.append(A[depth])\n res |= dfs(depth + 1)\n del C[-1]\n return res\n\n A = list(map(int, input().split(\" \")))\n print(\"YES\" if dfs(0) else \"NO\")\n","fast_code":"n = eval(input())\nfor i in range(n):\n dt = list(map(int, input().split()))\n a1 = 0\n a2 = 0\n for e in dt:\n if e > a1:\n a1 = e\n elif e > a2:\n a2 = e\n else:\n print(\"NO\")\n break\n else:\n print(\"YES\")\n"} +{"fast_code_id":"6fadcb003e342664a42a30de9847161852f9a4d302a34f053ae26b1a5bfc20b4","fast_id":"p03997_6fadcb003e342664a42a30de9847161852f9a4d302a34f053ae26b1a5bfc20b4","language":"python","measured_fast_code_id":"6fadcb003e342664a42a30de9847161852f9a4d302a34f053ae26b1a5bfc20b4","measured_slow_code_id":"89a2c802763da09caab2310090bce1a3bd8e29ef5b06b86a35dfdaa7e9205bfe","measurement_metric":"cpu_instruction_count","pair_id":"python_e8d1ab91444506461be36b7e","problem_id":"p03997","slow_code_id":"b35e7a11385fd8d3cfedbd5906973a53bac70684dd98a901c660194c6fcfc1db","slow_id":"p03997_89a2c802763da09caab2310090bce1a3bd8e29ef5b06b86a35dfdaa7e9205bfe","speedup":16.047913948115077,"stratum":"8+","sampling_key":"0a6e46d5e2a360d22a069098187190d9c0baeca2c18747c6b13322e755e4b421","slow_code":"from collections import deque\nfrom heapq import heapify, heappop, heappush, heappushpop\nfrom copy import copy, deepcopy\nfrom itertools import product, permutations, combinations, combinations_with_replacement\nfrom collections import defaultdict, Counter\nfrom bisect import bisect_left, bisect_right\n\n\nfrom functools import reduce\nfrom pprint import pprint\n\nINF = float(\"inf\")\n\n\ndef myinput():\n return list(map(int, input().split()))\n\n\ndef mylistinput(n):\n return [list(myinput()) for _ in range(n)]\n\n\ndef mycol(data, col):\n return [row[col] for row in data]\n\n\ndef mysort(data, col, reverse_flag):\n data.sort(key=lambda x: x[col], reverse=reverse_flag)\n return data\n\n\ndef mymax(data):\n M = -1 * float(\"inf\")\n for i in range(len(data)):\n m = max(data[i])\n M = max(M, m)\n return M\n\n\ndef mymin(data):\n m = float(\"inf\")\n for i in range(len(data)):\n M = min(data[i])\n m = min(m, M)\n return m\n\n\ndef mycount(ls, x):\n\n l = bisect_left(ls, x)\n r = bisect_right(ls, x)\n return r - l\n\n\ndef myoutput(ls, space=True):\n if space:\n if len(ls) == 0:\n print(\" \")\n elif type(ls[0]) == str:\n print((\" \".join(ls)))\n elif type(ls[0]) == int:\n print((\" \".join(map(str, ls))))\n else:\n print(\"Output Error\")\n else:\n if len(ls) == 0:\n print(\"\")\n elif type(ls[0]) == str:\n print((\"\".join(ls)))\n elif type(ls[0]) == int:\n print((\"\".join(map(str, ls))))\n else:\n print(\"Output Error\")\n\n\na = int(eval(input()))\nb = int(eval(input()))\nh = int(eval(input()))\nans = (a + b) * h / 2\nprint((int(ans)))\n","fast_code":"a = int(eval(input()))\nb = int(eval(input()))\nh = int(eval(input()))\ns = int((a + b) * h / 2)\nprint(s)\n"} +{"fast_code_id":"df78678cc468f931c4deecedae5654556a3e34626187f1eb870d9dc288d371ff","fast_id":"p03558_df78678cc468f931c4deecedae5654556a3e34626187f1eb870d9dc288d371ff","language":"python","measured_fast_code_id":"df78678cc468f931c4deecedae5654556a3e34626187f1eb870d9dc288d371ff","measured_slow_code_id":"ee9515bb59f3ea352b6743bf182a443ee7d47b5d0c5c4f7b80ebba756d0ef1b8","measurement_metric":"cpu_instruction_count","pair_id":"python_e8f40f43f6062b148270746b","problem_id":"p03558","slow_code_id":"3ecd4f0095332ca71fa16ab329abd81020c5ec80d28916f50a4ac56390039e02","slow_id":"p03558_ee9515bb59f3ea352b6743bf182a443ee7d47b5d0c5c4f7b80ebba756d0ef1b8","speedup":3.342733281825936,"stratum":"2-4","sampling_key":"7fe5ddf558fd9a73d90f04663b7035af6ce2e56cb7c71fdb1e6d6c3a80bf6f4b","slow_code":"import sys\n\nINF = 1 << 60\nMOD = 10**9 + 7\nsys.setrecursionlimit(2147483647)\ninput = lambda: sys.stdin.readline().rstrip()\n\n\ndef resolve():\n k = int(eval(input()))\n dist = [INF] * k\n dist[1] = 1\n queue = [1]\n for v in queue:\n tmp = [v]\n for v in tmp:\n if dist[10 * v % k] > dist[v]:\n dist[10 * v % k] = dist[v]\n tmp.append(10 * v % k)\n if dist[(v + 1) % k] > dist[v] + 1:\n dist[(v + 1) % k] = dist[v] + 1\n queue.append((v + 1) % k)\n print((dist[0]))\n\n\nresolve()\n","fast_code":"def solve(K):\n checked = [False] * K\n\n def calc(x):\n while not checked[x]:\n checked[x] = True\n yield x\n x = (x * 10) % K\n\n i = 0\n xs = [0]\n while 1:\n i += 1\n ys = []\n for x in xs:\n for z in calc((x + 1) % K):\n if z == 0:\n return i\n ys.append(z)\n xs = ys\n\n\nK = int(eval(input()))\nprint((solve(K)))\n"} +{"fast_code_id":"bab9323cfeaa66336157fcfc351fa47a4d07aa183900fa44056dd2eea3a678e6","fast_id":"p03806_bab9323cfeaa66336157fcfc351fa47a4d07aa183900fa44056dd2eea3a678e6","language":"python","measured_fast_code_id":"bab9323cfeaa66336157fcfc351fa47a4d07aa183900fa44056dd2eea3a678e6","measured_slow_code_id":"de0bea56638775d452fc7d2a830b57a068d994b2ada267241a06da1ea8817a52","measurement_metric":"cpu_instruction_count","pair_id":"python_e93695485a9eda76bcf3492b","problem_id":"p03806","slow_code_id":"de0bea56638775d452fc7d2a830b57a068d994b2ada267241a06da1ea8817a52","slow_id":"p03806_de0bea56638775d452fc7d2a830b57a068d994b2ada267241a06da1ea8817a52","speedup":5.54175862790411,"stratum":"4-8","sampling_key":"f6258e1649fdb895a6ffeecf34bfceeb7b2ef7c4c847baafbdca28de26a589cd","slow_code":"N, Ma, Mb = list(map(int, input().split()))\nINF = 40 * 100 + 1\ndp = [[INF for i in range(10 * N + 1)] for j in range(10 * N + 1)]\ndp[0][0] = 0\nans = INF\nfor p in range(N):\n a, b, c = list(map(int, input().split()))\n for i in range(len(dp) - 1, -1, -1):\n for j in range(len(dp[i]) - 1, -1, -1):\n if dp[i][j] != INF:\n dp[i + a][j + b] = min(dp[i + a][j + b], dp[i][j] + c)\n if (i + a) / (j + b) == Ma / Mb:\n ans = min(ans, dp[i + a][j + b])\nif ans == INF:\n print((-1))\nelse:\n print(ans)\n","fast_code":"import sys\n\ninput = lambda: sys.stdin.readline().rstrip()\nsys.setrecursionlimit(max(1000, 10**9))\nwrite = lambda x: sys.stdout.write(x + \"\\n\")\nn, ma, mb = list(map(int, input().split()))\nabc = [None] * n\nfor i in range(n):\n a, b, c = tuple(map(int, input().split()))\n abc[i] = (a * mb - b * ma, c)\nabc.sort()\n\n\ndef halfcomb(l):\n n = len(l)\n n1 = n // 2\n n2 = (n + 1) // 2\n l1 = []\n l2 = []\n\n def sub(v1, v2, i, bound, ll, ind=0):\n if i == bound:\n ll.append((v1, v2))\n return\n sub(v1, v2, i + 1, bound, ll, ind)\n sub(v1 + l[ind + i][0], v2 + l[ind + i][1], i + 1, bound, ll, ind)\n\n sub(0, 0, 0, n1, l1)\n sub(0, 0, 0, n2, l2, ind=n1)\n return l1, l2\n\n\nl1, l2 = halfcomb(abc)\nd2 = {}\nfor v, c in l2:\n if v in d2:\n d2[v] = min(d2[v], c)\n else:\n d2[v] = c\nans = float(\"inf\")\nfor v, c in l1:\n if v == 0 and c > 0:\n ans = min(ans, c)\nfor v, c in l2:\n if v == 0 and c > 0:\n ans = min(ans, c)\nfor v, c in l1:\n if -v in d2 and c + d2[-v] > 0:\n ans = min(ans, c + d2[-v])\nif ans == float(\"inf\"):\n ans = -1\nprint(ans)\n"} +{"fast_code_id":"0aa174b9082b11f64d5fcfd3c15493df0e4f436c1eeb2ae7330b5ff92b0fa112","fast_id":"p02394_0aa174b9082b11f64d5fcfd3c15493df0e4f436c1eeb2ae7330b5ff92b0fa112","language":"python","measured_fast_code_id":"0aa174b9082b11f64d5fcfd3c15493df0e4f436c1eeb2ae7330b5ff92b0fa112","measured_slow_code_id":"c88e86f1ad95ddc817ad7ba81628e2daf211ff2d39c36960f050623a40ae12a3","measurement_metric":"cpu_instruction_count","pair_id":"python_e9800bb7661e40e89f14f3f4","problem_id":"p02394","slow_code_id":"b3a430d2365496f9f536fa4236fe45d9a45c9a6c0f910f1eae517487e3d1e97c","slow_id":"p02394_c88e86f1ad95ddc817ad7ba81628e2daf211ff2d39c36960f050623a40ae12a3","speedup":2.505933845685561,"stratum":"2-4","sampling_key":"180601fa4c4ee483c88616df2faa991ff54e918ca65261fef363f5def5432cbf","slow_code":"import math\n\n\ndef func():\n try:\n line = input().rstrip()\n numbers = line.split(\" \")\n width = float(numbers[0])\n height = float(numbers[1])\n x = float(numbers[2])\n y = float(numbers[3])\n r = abs(float(numbers[4]))\n except:\n print(\"input error\")\n return -1\n wsign = math.copysign(1, width)\n hsign = math.copysign(1, height)\n result = wsign * x + r <= wsign * width\n result = result and (wsign * x - r >= 0)\n result = result and (hsign * y + r <= hsign * height)\n result = result and (hsign * y - r >= 0)\n if result:\n print(\"Yes\")\n else:\n print(\"No\")\n\n\nfunc()\n","fast_code":"W, H, x, y, r = [int(i) for i in input().split()]\nif x + r <= W and y - r >= 0 and x - r >= 0 and y + r <= H:\n print(\"Yes\")\nelse:\n print(\"No\")\n"} +{"fast_code_id":"e8bdc191a536c7010a890cc32dea3dc2fcef6ecb6d335e44163c64067dc8e4cf","fast_id":"p03575_de92383fba6c0229e79fd952746235f6bc15a40ddc958d6c687f9ee23252de58","language":"python","measured_fast_code_id":"de92383fba6c0229e79fd952746235f6bc15a40ddc958d6c687f9ee23252de58","measured_slow_code_id":"3b0c75c5164a810f84adc515ed302d05d4140b865ec422b1df702b4974d0a4da","measurement_metric":"cpu_instruction_count","pair_id":"python_e98b91148412d284d1302ac1","problem_id":"p03575","slow_code_id":"3b0c75c5164a810f84adc515ed302d05d4140b865ec422b1df702b4974d0a4da","slow_id":"p03575_3b0c75c5164a810f84adc515ed302d05d4140b865ec422b1df702b4974d0a4da","speedup":7.3842549264183885,"stratum":"4-8","sampling_key":"8114d5d15bf1ddd76765fdb943c41c7896652a9bd25ab8ef5d3cd0d8a63497e7","slow_code":"import sys, re, os\nfrom collections import deque, defaultdict, Counter\nfrom math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians\nfrom itertools import permutations, combinations, product, accumulate\nfrom operator import itemgetter, mul\nfrom copy import deepcopy\nfrom string import ascii_lowercase, ascii_uppercase, digits\nfrom heapq import heapify, heappop, heappush\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef INT():\n return int(eval(input()))\n\n\ndef MAP():\n return list(map(int, input().split()))\n\n\ndef S_MAP():\n return list(map(str, input().split()))\n\n\ndef LIST():\n return list(map(int, input().split()))\n\n\ndef S_LIST():\n return list(map(str, input().split()))\n\n\nsys.setrecursionlimit(10**9)\nINF = float(\"inf\")\nmod = 10**9 + 7\n\n\ndef dijkstra(E, start):\n N_d = len(E)\n dist = [INF] * N_d\n dist[start] = 0\n q = [(0, start)]\n while q:\n dist_v, v = heappop(q)\n if dist[v] != dist_v:\n continue\n for u, dist_vu in E[v]:\n dist_u = dist_v + dist_vu\n if dist_u < dist[u]:\n dist[u] = dist_u\n heappush(q, (dist_u, u))\n return dist\n\n\nN, M = MAP()\nL = [LIST() for i in range(M)]\ngraph = defaultdict(list)\nfor a, b in L:\n graph[a - 1].append((b - 1, 1))\n graph[b - 1].append((a - 1, 1))\nans = 0\nfor i in range(M):\n a, b = L[i]\n E = deepcopy(graph)\n E[a - 1].remove((b - 1, 1))\n E[b - 1].remove((a - 1, 1))\n dist = dijkstra(E, 0)\n if dist.count(INF) > 0:\n ans += 1\nprint(ans)\n","fast_code":"import sys\n\nsys.setrecursionlimit(10**8)\n\n\ndef ii():\n return int(sys.stdin.readline())\n\n\ndef mi():\n return list(map(int, sys.stdin.readline().split()))\n\n\ndef li():\n return list(map(int, sys.stdin.readline().split()))\n\n\ndef li2(N):\n return [list(map(int, sys.stdin.readline().split())) for _ in range(N)]\n\n\ndef dp2(ini, i, j):\n return [[ini] * i for _ in range(j)]\n\n\ndef dp3(ini, i, j, k):\n return [[[ini] * i for _ in range(j)] for _ in range(k)]\n\n\nN, M = mi()\nmemo = []\nrel = [[] for i in range(N)]\nfor i in range(M):\n s, t = mi()\n s, t = s - 1, t - 1\n memo.append((s, t))\n rel[s].append(t)\n rel[t].append(s)\n\n\ndef dfs(v):\n for nv in rel[v]:\n if not used[nv]:\n used[nv] = 1\n dfs(nv)\n if sum(used) == N:\n global flag\n flag = 1\n return\n\n\ncnt = M\nfor x in range(M):\n s, t = memo[x][0], memo[x][1]\n rel[s].remove(t)\n rel[t].remove(s)\n flag = 0\n used = [0] * N\n dfs(0)\n if flag:\n cnt -= 1\n rel[s].append(t)\n rel[t].append(s)\nprint(cnt)\n"} +{"fast_code_id":"e4d401fef582a21621aa992fac92c31df8b8afa5c6fe72c771bb106e11d529fe","fast_id":"p03035_e4d401fef582a21621aa992fac92c31df8b8afa5c6fe72c771bb106e11d529fe","language":"python","measured_fast_code_id":"e4d401fef582a21621aa992fac92c31df8b8afa5c6fe72c771bb106e11d529fe","measured_slow_code_id":"a03feaf840d71ae8aa582d21d70bb7cc8063992d1b30834ae4cabc43c65fc6f6","measurement_metric":"cpu_instruction_count","pair_id":"python_e9987da04e39791fc9f42b9b","problem_id":"p03035","slow_code_id":"a03feaf840d71ae8aa582d21d70bb7cc8063992d1b30834ae4cabc43c65fc6f6","slow_id":"p03035_a03feaf840d71ae8aa582d21d70bb7cc8063992d1b30834ae4cabc43c65fc6f6","speedup":3.0039802440796293,"stratum":"2-4","sampling_key":"1f8816298783c06f883646b3e1c60ead6bb6ced3d0397ce6f3b8efdf3a7ca6b0","slow_code":"import sys, math, collections, heapq, itertools\n\nF = sys.stdin\n\n\ndef single_input():\n return F.readline().strip(\"\\n\")\n\n\ndef line_input():\n return F.readline().strip(\"\\n\").split()\n\n\ndef gcd(a, b):\n a, b = max(a, b), min(a, b)\n while a % b > 0:\n a, b = b, a % b\n return b\n\n\ndef solve():\n A, B = list(map(int, line_input()))\n if A >= 13:\n print(B)\n elif A >= 6:\n print((B // 2))\n else:\n print((0))\n return 0\n\n\nif __name__ == \"__main__\":\n solve()\n","fast_code":"A, B = list(map(int, input().split()))\nif A >= 13:\n print(B)\nelif A >= 6:\n print((B // 2))\nelse:\n print((0))\n"} +{"fast_code_id":"53a10d656d426e017588389ff0f468de207c7dd85040b6956dda55fc28e3a693","fast_id":"p03147_53a10d656d426e017588389ff0f468de207c7dd85040b6956dda55fc28e3a693","language":"python","measured_fast_code_id":"53a10d656d426e017588389ff0f468de207c7dd85040b6956dda55fc28e3a693","measured_slow_code_id":"24841992c3576a8c9d1c515258440c154f96007ad50f3bda6aa6dfc05a4b9c5f","measurement_metric":"cpu_instruction_count","pair_id":"python_ea3f7ab8e407ea17b244b988","problem_id":"p03147","slow_code_id":"24841992c3576a8c9d1c515258440c154f96007ad50f3bda6aa6dfc05a4b9c5f","slow_id":"p03147_24841992c3576a8c9d1c515258440c154f96007ad50f3bda6aa6dfc05a4b9c5f","speedup":6.726926531417949,"stratum":"4-8","sampling_key":"1b4ad0daa9eff4dfa36d5c8a77eae1043ad1fa7e77b77c16ca5b0307ff67770a","slow_code":"import sys\n\nsys.setrecursionlimit(10**7)\ninput = sys.stdin.readline\nf_inf = float(\"inf\")\nmod = 10**9 + 7\n\n\ndef resolve():\n n = int(eval(input()))\n H = list(map(int, input().split()))\n res = 0\n i = 0\n while sum(H) != 0:\n if H[i] != 0:\n while i < n and H[i] != 0:\n H[i] -= 1\n i += 1\n res += 1\n i = 0\n else:\n i += 1\n print(res)\n\n\nif __name__ == \"__main__\":\n resolve()\n","fast_code":"N = int(eval(input()))\nH = list(map(int, input().split()))\ncnt = 0\nwhile True:\n flag = 0\n for i in range(N):\n if H[i] > 0:\n cur = i\n flag = 1\n break\n if flag == 0:\n break\n cmin = H[cur]\n flag = 1\n for i in range(cur, N):\n if H[i] > 0 and flag == 1:\n cmin = min(cmin, H[i])\n elif H[i] > 0 and flag == 0:\n cur = i\n cmin = H[i]\n flag = 1\n else:\n cnt += cmin\n for k in range(cur, i):\n H[k] -= cmin\n cur = i\n cmin = 0\n flag = 0\n cnt += cmin\n for k in range(cur, N):\n H[k] -= cmin\nprint(cnt)\n"} +{"fast_code_id":"f222fc533ff8c8f77d6aa872c7a6c1e0efb17146f9a7e556f0f178619b015c36","fast_id":"p03598_f222fc533ff8c8f77d6aa872c7a6c1e0efb17146f9a7e556f0f178619b015c36","language":"python","measured_fast_code_id":"f222fc533ff8c8f77d6aa872c7a6c1e0efb17146f9a7e556f0f178619b015c36","measured_slow_code_id":"1b129bb8d189a1d33979630c69207f7fede842e1eae77ef97d34db407621cf30","measurement_metric":"cpu_instruction_count","pair_id":"python_ea84a1575145869bc5f8ce15","problem_id":"p03598","slow_code_id":"1b129bb8d189a1d33979630c69207f7fede842e1eae77ef97d34db407621cf30","slow_id":"p03598_1b129bb8d189a1d33979630c69207f7fede842e1eae77ef97d34db407621cf30","speedup":19.554585397720988,"stratum":"8+","sampling_key":"1579bab142ee7721bac56d984480deb1d67a0f57787908ee43a3c7202e718e5a","slow_code":"from collections import Counter, defaultdict, deque\nfrom heapq import heappop, heappush, heapify\nimport sys, bisect, math, itertools, fractions, pprint\n\nsys.setrecursionlimit(10**8)\nmod = 10**9 + 7\nINF = float(\"inf\")\n\n\ndef inp():\n return int(sys.stdin.readline())\n\n\ndef inpl():\n return list(map(int, sys.stdin.readline().split()))\n\n\nn = inp()\nk = inp()\na = inpl()\nres = 0\nfor i, x in enumerate(a):\n res += min(abs(k - x) * 2, x * 2)\nprint(res)\n","fast_code":"n, k = int(eval(input())), int(eval(input()))\nprint((sum([min(i * 2, (k - i) * 2) for i in list(map(int, input().split()))])))\n"} +{"fast_code_id":"609e346782ecf49c23ca5198c907b710c087fbc5b7bd73f09ea7653abfa5c4cb","fast_id":"p00219_609e346782ecf49c23ca5198c907b710c087fbc5b7bd73f09ea7653abfa5c4cb","language":"python","measured_fast_code_id":"609e346782ecf49c23ca5198c907b710c087fbc5b7bd73f09ea7653abfa5c4cb","measured_slow_code_id":"98dac8dc4a897a685a224532a3556d581f697beacd3e665b34a89648b52695da","measurement_metric":"cpu_instruction_count","pair_id":"python_eb18776c92ae3644c3363e57","problem_id":"p00219","slow_code_id":"98dac8dc4a897a685a224532a3556d581f697beacd3e665b34a89648b52695da","slow_id":"p00219_98dac8dc4a897a685a224532a3556d581f697beacd3e665b34a89648b52695da","speedup":3.9318795241623765,"stratum":"2-4","sampling_key":"3ebcc49d099c22fa3318d4906195209a7aeba8ea11ac3a82ad6f6626b98ed77c","slow_code":"while True:\n n = int(eval(input()))\n if n == 0:\n break\n ice = [int(eval(input())) for _ in range(n)]\n for i in range(10):\n nums = ice.count(i)\n print((\"*\" * nums + \"-\" * (nums == 0)))\n","fast_code":"while 1:\n n = eval(input())\n if n == 0:\n break\n h = [0] * 10\n for i in range(n):\n h[int(input())] += 1\n for i in range(10):\n print(\"*\" * h[i] if h[i] else \"-\")\n"} +{"fast_code_id":"f7ced2ef7edb747b0622641dbcb07ff8636e9d93730e18fa28ca976665cc3b44","fast_id":"p02938_2ba840643a3bd3f827955caf8230ec590255a0752656fd303454dc4ec91460eb","language":"python","measured_fast_code_id":"2ba840643a3bd3f827955caf8230ec590255a0752656fd303454dc4ec91460eb","measured_slow_code_id":"1aa640e94f003b6d012f6a5cd6d1e8cb1a7e36510feb6ef6074dca49a962987e","measurement_metric":"cpu_instruction_count","pair_id":"python_eb34bdd3d92271ca364ff5ee","problem_id":"p02938","slow_code_id":"1aa640e94f003b6d012f6a5cd6d1e8cb1a7e36510feb6ef6074dca49a962987e","slow_id":"p02938_1aa640e94f003b6d012f6a5cd6d1e8cb1a7e36510feb6ef6074dca49a962987e","speedup":8.635889976426911,"stratum":"8+","sampling_key":"134745e05c66d92984ce9fc30cc285f5c71c8f2ee3c985af16b526c27741b0e4","slow_code":"L, R = list(map(int, input().split()))\nmod = 10**9 + 7\n\n\ndef f(L, R):\n if L > R:\n return 0\n R = bin(R)[2:]\n N = len(R)\n ret = f(L, int(\"0\" + \"1\" * (N - 1), 2))\n L = bin(L)[2:]\n if len(L) != N:\n L = \"1\" + \"0\" * (N - 1)\n for i in range(N):\n if R[i] == \"0\":\n continue\n R2 = R[:i] + \"0\" + \"?\" * (N - i - 1)\n if i == 0:\n R2 = R\n for j in range(N):\n if L[j] == \"1\" and j != 0:\n continue\n L2 = L[:j] + \"1\" + \"?\" * (N - j - 1)\n if j == 0:\n L2 = L\n if L2[0] == \"0\":\n break\n tmp = 1\n for r, l in zip(R2[1:], L2[1:]):\n if r == \"0\" and l == \"1\":\n tmp *= 0\n break\n if r == \"?\" and l == \"?\":\n tmp = tmp * 3 % mod\n if r == \"?\" and l == \"0\":\n tmp = tmp * 2 % mod\n if r == \"1\" and l == \"?\":\n tmp = tmp * 2 % mod\n ret += tmp\n ret %= mod\n return ret\n\n\nprint((f(L, R)))\n","fast_code":"L, R = list(map(int, input().split()))\nMOD = 10**9 + 7\nl = \"{:060b}\".format(L)[::-1]\nr = \"{:060b}\".format(R)[::-1]\nmemo = [\n [[[-1 for l in range(2)] for k in range(2)] for j in range(2)] for i in range(60)\n]\n\n\ndef f(pos, flagX, flagY, flagZ):\n if pos == -1:\n return 1\n if memo[pos][flagX][flagY][flagZ] != -1:\n return memo[pos][flagX][flagY][flagZ]\n ret = 0\n\n if flagX or l[pos] == \"0\":\n ret += f(pos - 1, flagX, 1 if r[pos] == \"1\" else flagY, flagZ)\n\n if (flagX or l[pos] == \"0\") and (flagY or r[pos] == \"1\") and flagZ:\n ret += f(pos - 1, flagX, flagY, flagZ)\n\n if flagY or r[pos] == \"1\":\n ret += f(pos - 1, 1 if l[pos] == \"0\" else flagX, flagY, 1)\n ret %= MOD\n memo[pos][flagX][flagY][flagZ] = ret\n return ret\n\n\nans = f(59, 0, 0, 0)\nprint(ans)\n"} +{"fast_code_id":"e1fb9d1e4bb1587c2b88830cda6b89634d238311e4b158fd1044c6d44a2213eb","fast_id":"p03251_e1fb9d1e4bb1587c2b88830cda6b89634d238311e4b158fd1044c6d44a2213eb","language":"python","measured_fast_code_id":"e1fb9d1e4bb1587c2b88830cda6b89634d238311e4b158fd1044c6d44a2213eb","measured_slow_code_id":"a3fbc6c47b132b7bae66af85f9792255327ce8e3bf2b5b22873b7c8d59510fae","measurement_metric":"cpu_instruction_count","pair_id":"python_ebad865a08c3e695a1baf793","problem_id":"p03251","slow_code_id":"a3fbc6c47b132b7bae66af85f9792255327ce8e3bf2b5b22873b7c8d59510fae","slow_id":"p03251_a3fbc6c47b132b7bae66af85f9792255327ce8e3bf2b5b22873b7c8d59510fae","speedup":249.1788962392138,"stratum":"8+","sampling_key":"8b12a694c3e4b7c0793c9d714efb96f780345632ead202b368d8af6bcd067159","slow_code":"import numpy as np\n\nn, m, x, y = list(map(int, input().split()))\nxl = [int(i) for i in input().split()]\nyl = [int(i) for i in input().split()]\nif x > y:\n print(\"War\")\nelse:\n zl = np.arange(x + 1, y + 1)\n for z in zl:\n if (max(xl) < z) & (z <= min(yl)):\n print(\"No War\")\n break\n else:\n print(\"War\")\n","fast_code":"N, M, X, Y = list(map(int, input().split()))\nx = list(map(int, input().split()))\ny = list(map(int, input().split()))\nans = \"War\"\nfor z in range(X + 1, Y + 1):\n if (\n len(list([x for x in x if x < z])) == N\n and len(list([x for x in y if x >= z])) == M\n ):\n ans = \"No War\"\n break\nprint(ans)\n"} +{"fast_code_id":"9d8a3dd273c298cf688b529b6d24def7dc29fefbbd6614a45d46b75a639bc579","fast_id":"p03222_9d8a3dd273c298cf688b529b6d24def7dc29fefbbd6614a45d46b75a639bc579","language":"python","measured_fast_code_id":"9d8a3dd273c298cf688b529b6d24def7dc29fefbbd6614a45d46b75a639bc579","measured_slow_code_id":"a167fb2840bdcc6405e113c019a821d25f7acfa038b67804c34bff12a9edb446","measurement_metric":"cpu_instruction_count","pair_id":"python_ebe0294b03bbd14d5f97014a","problem_id":"p03222","slow_code_id":"a167fb2840bdcc6405e113c019a821d25f7acfa038b67804c34bff12a9edb446","slow_id":"p03222_a167fb2840bdcc6405e113c019a821d25f7acfa038b67804c34bff12a9edb446","speedup":137.23770924754044,"stratum":"8+","sampling_key":"0b0f2219b201856e42375598f40810607f32771a3be8aa48c8f695b171efdf9e","slow_code":"import sys\n\nmod = pow(10, 9) + 7\n\n\ndef mul(a, b):\n return ((a % mod) * (b % mod)) % mod\n\n\ndef cmb(n, r, mod):\n if r < 0 or r > n:\n return 0\n r = min(r, n - r)\n return g1[n] * g2[r] * g2[n - r] % mod\n\n\nNNN = (10**5) * 2\ng1 = [1, 1]\ng2 = [1, 1]\ninverse = [0, 1]\nfor i in range(2, NNN + 1):\n g1.append((g1[-1] * i) % mod)\n inverse.append((-inverse[mod % i] * (mod // i)) % mod)\n g2.append((g2[-1] * inverse[-1]) % mod)\n\n\ndef erabu(aW):\n r = 0\n for i in range(aW // 2 + 1 + 1):\n sp = aW - (2 * i - 1)\n r += cmb(sp + i + 1 - 1, sp, mod)\n return r\n\n\nN, W, K = [int(x) for x in input().strip().split(\" \")]\nhasi = 0\ncc = []\nif W == 1:\n if K == 1:\n print((1))\n else:\n print((0))\n sys.exit()\nelif W == 2:\n cccl = [1, 1]\n cc = [1, 1]\nelif W == 3:\n cccl = [1, 1, 1]\n cc = [2, 1, 2]\nelif W >= 4:\n aW = W - 1\n hW = aW - 2\n nhW = aW - 3\n cc = []\n cccl = []\n for w in range(W):\n nn = max(W - 1 - w - 1, 0)\n nnn = max((W - 1) - nn - 2, 0)\n if w == W - 1:\n nnn += 1\n cc.append(erabu(nn) * erabu(nnn))\n cccl.append(erabu(nn) * erabu(nnn - 1))\ncccl[0] = 0\ncccr = cccl[::-1]\nd = [1] + [0 for x in range(W - 1)]\nfor i in range(N):\n newd = []\n for j in range(W):\n newd.append(0)\n if j != 0:\n newd[j] = (newd[j] + (d[j - 1] * cccl[j])) % mod\n if j != W - 1:\n newd[j] = (newd[j] + (d[j + 1] * cccr[j])) % mod\n newd[j] = (newd[j] + (d[j] * cc[j])) % mod\n d = newd[:]\nprint((d[K - 1]))\n","fast_code":"mod = 10**9 + 7\nh, w, k = list(map(int, input().split()))\nk -= 1\ndp = [0] * w\ndp[0] = 1\nndp = [0] * w\nfor _ in range(h):\n for bits in range(1 << w - 1):\n if \"11\" in bin(bits):\n continue\n to = list(range(w))\n for i in range(w - 1):\n if (bits >> i) & 1:\n to[i], to[i + 1] = to[i + 1], to[i]\n for i in range(w):\n ndp[to[i]] += dp[i]\n ndp[to[i]] %= mod\n dp = ndp\n ndp = [0] * w\nprint((dp[k]))\n"} +{"fast_code_id":"f72d95a065019e8608548b68b377164f983af5502448f6513f95b92a5d37b38b","fast_id":"p02669_f72d95a065019e8608548b68b377164f983af5502448f6513f95b92a5d37b38b","language":"python","measured_fast_code_id":"f72d95a065019e8608548b68b377164f983af5502448f6513f95b92a5d37b38b","measured_slow_code_id":"5dc16e69171829fb825a4382d7ae818d1f78cf50ef12255ba28fcf6c6591e0e1","measurement_metric":"cpu_instruction_count","pair_id":"python_ebe0490e0177801100d07d38","problem_id":"p02669","slow_code_id":"ca3505b4e5755f2e5a6dda25d2ba0ee1f8926fae7d5ee6e43c499cad98b2e89b","slow_id":"p02669_5dc16e69171829fb825a4382d7ae818d1f78cf50ef12255ba28fcf6c6591e0e1","speedup":6.7563212566405015,"stratum":"4-8","sampling_key":"90845f9bec5a4ee65a385a12dff48776ba6135fe6da1cb05287073206df32c98","slow_code":"import sys\n\ndivs = [2, 3, 5]\nt = int(eval(input()))\nfor _ in range(t):\n n, a, b, c, d = list(map(int, input().split()))\n costs = [a, b, c]\n dp = {}\n\n def dfs(x):\n if x in dp:\n return dp[x]\n\n if x == 0:\n dp[x] = 0\n return dp[x]\n ret = x * d\n for i in range(-4, 5):\n if x - i < 0:\n continue\n nx = x - i\n for cost, div in zip(costs, divs):\n if nx % div != 0 or nx // div >= x:\n continue\n ret = min(ret, dfs(nx // div) + cost + abs(i) * d)\n dp[x] = ret\n return ret\n\n print((dfs(n)))\n","fast_code":"T = int(eval(input()))\nwhile T > 0:\n N, A, B, C, D = list(map(int, input().split()))\n memo = {}\n\n def d(n):\n if n == 0:\n return 0\n if n == 1:\n return D\n if n in memo:\n return memo[n]\n ret = n * D\n if n % 2 == 0:\n ret = min(ret, A + d(n // 2))\n else:\n ret = min(\n ret,\n (n % 2) * D + A + d(n // 2),\n (2 - n % 2) * D + A + d((n + (2 - n % 2)) // 2),\n )\n if n % 3 == 0:\n ret = min(ret, B + d(n // 3))\n else:\n ret = min(\n ret,\n (n % 3) * D + B + d(n // 3),\n (3 - n % 3) * D + B + d((n + (3 - n % 3)) // 3),\n )\n if n % 5 == 0:\n ret = min(ret, C + d(n // 5))\n else:\n ret = min(\n ret,\n (n % 5) * D + C + d(n // 5),\n (5 - n % 5) * D + C + d((n + (5 - n % 5)) // 5),\n )\n memo[n] = ret\n return ret\n\n print((d(N)))\n T -= 1\n"} +{"fast_code_id":"b90b08e70522a44231020ab584d9c96e274e2058901f178d46c36824a16018cd","fast_id":"p03221_b90b08e70522a44231020ab584d9c96e274e2058901f178d46c36824a16018cd","language":"python","measured_fast_code_id":"b90b08e70522a44231020ab584d9c96e274e2058901f178d46c36824a16018cd","measured_slow_code_id":"bac932e565fc824f54938c4edcf17024edb8ebfd73deb80882c8006e56a416b6","measurement_metric":"cpu_instruction_count","pair_id":"python_ecddeab8513f222fae490e05","problem_id":"p03221","slow_code_id":"9a9b5b8d60f2f6a437fd75f31baba74dc5ed7ac13071d840e26b691e2ff91cac","slow_id":"p03221_bac932e565fc824f54938c4edcf17024edb8ebfd73deb80882c8006e56a416b6","speedup":4.73324136944314,"stratum":"4-8","sampling_key":"5508103ab970ba567dadc0e5e33b7182067a713b9e91d5baf9ef031e8469e6a3","slow_code":"N, M = list(map(int, input().split()))\nP = []\nY = []\narr = [[] for j in range(10**5 + 1)]\nfor i in range(M):\n listA = list(map(int, input().split()))\n P.append(listA[0])\n Y.append(listA[1])\n arr[listA[0]].append(listA[1])\nfor i in range(N + 1):\n arr[i].sort()\nfor i in range(M):\n\n left = 0\n right = len(arr[P[i]]) - 1\n while left <= right:\n mid = (left + right) // 2\n if arr[P[i]][mid] == Y[i]:\n k = mid\n break\n elif arr[P[i]][mid] > Y[i]:\n right = mid - 1\n else:\n left = mid + 1\n print((str(P[i]).rjust(6, \"0\") + str(k + 1).rjust(6, \"0\")))\n","fast_code":"n, m = list(map(int, input().split()))\narr = []\nfor i in range(m):\n ls = list(map(int, input().split())) + [i]\n arr.append(ls)\narr.sort(key=lambda x: x[1])\n\n\ndef st(a):\n b = list(str(a))\n while len(b) <= 5:\n b.insert(0, \"0\")\n c = \"\".join(b)\n return c\n\n\ndic = {}\nfor j in range(m):\n if arr[j][0] in dic:\n dic[arr[j][0]] += 1\n arr[j] += [dic[arr[j][0]]]\n else:\n dic[arr[j][0]] = 1\n arr[j] += [dic[arr[j][0]]]\narr.sort(key=lambda x: x[2])\nfor y in range(m):\n print((\"{}{}\".format(st(arr[y][0]), st(arr[y][3]))))\n"} +{"fast_code_id":"d16eca4c6ae9986c748d2f6c716c843cd745fd432d5ea5edce76a8a161abd557","fast_id":"p03329_d16eca4c6ae9986c748d2f6c716c843cd745fd432d5ea5edce76a8a161abd557","language":"python","measured_fast_code_id":"d16eca4c6ae9986c748d2f6c716c843cd745fd432d5ea5edce76a8a161abd557","measured_slow_code_id":"3bc968d0f616033ddfd795ca7a93a332cf62e4e0d2363198f4f7733a27640b4e","measurement_metric":"cpu_instruction_count","pair_id":"python_ed054918a2c35f9623868d45","problem_id":"p03329","slow_code_id":"3bc968d0f616033ddfd795ca7a93a332cf62e4e0d2363198f4f7733a27640b4e","slow_id":"p03329_3bc968d0f616033ddfd795ca7a93a332cf62e4e0d2363198f4f7733a27640b4e","speedup":6.547832099237313,"stratum":"4-8","sampling_key":"4c00e6d61e56f735215eec768f5afe3b0886554189542f083c56d8e062bc744d","slow_code":"l9 = []\nl9.append(1)\ntmp = 1\nwhile tmp <= 10**5:\n tmp *= 9\n l9.append(tmp)\nl6 = []\nl6.append(1)\ntmp = 1\nwhile tmp <= 10**5:\n tmp *= 6\n l6.append(tmp)\nimport bisect\n\nn = int(eval(input()))\nans = 10**6\nfor i in range(0, n + 1):\n a = i\n b = n - i\n p = 0\n while a > 0:\n idx = bisect.bisect_left(l6, a)\n if a == l6[idx]:\n a -= l6[idx]\n else:\n a -= l6[idx - 1]\n p += 1\n q = 0\n while b > 0:\n idx = bisect.bisect_left(l9, b)\n if b == l9[idx]:\n b -= l9[idx]\n else:\n b -= l9[idx - 1]\n q += 1\n ans = min(ans, p + q)\nprint(ans)\n","fast_code":"six = [6**i for i in range(1, 7)][::-1]\nnine = [9**i for i in range(1, 6)][::-1]\nN = int(eval(input()))\nans = []\n\n\ndef find(n, a):\n if n < 6:\n ans.append(n + a)\n return\n for s in six:\n if s <= n:\n find(n - s, a + 1)\n break\n for s in nine:\n if s <= n:\n find(n - s, a + 1)\n break\n\n\nfind(N, 0)\nprint((min(ans)))\n"} +{"fast_code_id":"60fe966737f49c9f09ca9b30028457d40dee8076bb1f72c65409ce7b66c06f3e","fast_id":"p03207_60fe966737f49c9f09ca9b30028457d40dee8076bb1f72c65409ce7b66c06f3e","language":"python","measured_fast_code_id":"60fe966737f49c9f09ca9b30028457d40dee8076bb1f72c65409ce7b66c06f3e","measured_slow_code_id":"5cb7a4c7cf0d8a71a4fd49887b2da818d3766f3e397b1d44bc46374144eeebdc","measurement_metric":"cpu_instruction_count","pair_id":"python_ed2ae5c0c4b66494e1f5afa6","problem_id":"p03207","slow_code_id":"fe2f7e4c4fa4bf811a1052a7e9a8cc8bf127a2538fd41f3ded0df182a9217e19","slow_id":"p03207_5cb7a4c7cf0d8a71a4fd49887b2da818d3766f3e397b1d44bc46374144eeebdc","speedup":26.90203148046514,"stratum":"8+","sampling_key":"377fd5c9e161d2e10e60383c5b06e6e6b10c56a7115cd6d9429490df7e0dc4b0","slow_code":"import copy\nimport random\nimport bisect\nimport fractions\nimport math\nimport sys\nimport collections\nfrom decimal import Decimal\n\nmod = 10**9 + 7\nsys.setrecursionlimit(mod)\nd = collections.deque()\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\nN = int(eval(input()))\np = [0 for i in range(N)]\nfor i in range(N):\n p[i] = int(eval(input()))\np.sort()\nans = sum(p)\nans -= p[-1] // 2\nprint(ans)\n","fast_code":"l = [int(eval(input())) for _ in range(int(eval(input())))]\nprint((sum(l) - int(max(l) / 2)))\n"} +{"fast_code_id":"9cb137938948881342dc5efe6ec26da288b1b508cc8c2a22b7679988c47257d8","fast_id":"p02572_9cb137938948881342dc5efe6ec26da288b1b508cc8c2a22b7679988c47257d8","language":"python","measured_fast_code_id":"9cb137938948881342dc5efe6ec26da288b1b508cc8c2a22b7679988c47257d8","measured_slow_code_id":"9a9a8c4412436852a66bfa0067b57c544f3aec7f532b2c46c6eaa958a2513451","measurement_metric":"cpu_instruction_count","pair_id":"python_ed4ada67ac5e33859dac31cc","problem_id":"p02572","slow_code_id":"9a9a8c4412436852a66bfa0067b57c544f3aec7f532b2c46c6eaa958a2513451","slow_id":"p02572_9a9a8c4412436852a66bfa0067b57c544f3aec7f532b2c46c6eaa958a2513451","speedup":2.2398967052720176,"stratum":"2-4","sampling_key":"b79c3dddf2adf5731c513798b2aa465bb1d43b67d6b2a1d3831b95e61e593946","slow_code":"import copy\n\nN = int(eval(input()))\nA = list(map(int, input().split()))\nmod = 10**9 + 7\npartial_sum = copy.deepcopy(A)\nsum_now = A[N - 1]\nfor j in range(N - 2, -1, -1):\n sum_now = int((sum_now + A[j]) % mod)\n partial_sum[j] = sum_now\nres = 0\nfor i in range(N - 1):\n res = (res + (A[i] * partial_sum[i + 1]) % mod) % mod\nprint((int(res)))\n","fast_code":"N = int(eval(input()))\nA = [int(x) for x in input().split()]\npartial_sum = A.copy()\nsum_now = A[N - 1]\nfor j in range(N - 2, -1, -1):\n sum_now = int((sum_now + A[j]) % (10**9 + 7))\n partial_sum[j] = sum_now\nres = 0\nfor i in range(N - 1):\n res = (res + (A[i] * partial_sum[i + 1]) % (10**9 + 7)) % (10**9 + 7)\nprint((int(res)))\n"} +{"fast_code_id":"728c34924db4f0c24422c19ac1502af4e0e174ad2e07bd99fedf5c5e8a7a7e1a","fast_id":"p02709_303eefb4104b70927f9ffb02a044f19d84e60ddfb1623e1f450d9db5d1f45164","language":"python","measured_fast_code_id":"303eefb4104b70927f9ffb02a044f19d84e60ddfb1623e1f450d9db5d1f45164","measured_slow_code_id":"3d838e07742b6038959605af2d3df1f36b7399126fc563b9a2c8f3bce236aaea","measurement_metric":"cpu_instruction_count","pair_id":"python_ed5cd84b24003006a945dd92","problem_id":"p02709","slow_code_id":"aa98af4784f39634c1b1369b22ff40f05d4ea9461af1aad5cd1db169f1d8c6f4","slow_id":"p02709_3d838e07742b6038959605af2d3df1f36b7399126fc563b9a2c8f3bce236aaea","speedup":5.923613003960932,"stratum":"4-8","sampling_key":"5ba84b4fa3b3b70eccc69879c151dc58b3d161af76b2368e733edd22a3219e69","slow_code":"import sys\nimport numpy as np\n\n\ndef f(n, a_):\n a = []\n for i, ai in enumerate(a_):\n a.append([1 + i, ai])\n a.sort(key=lambda x: x[1], reverse=True)\n dp = np.zeros((n + 1, n + 1), np.int64)\n dp[1, 1] = a[0][1] * (n - a[0][0])\n dp[1, 0] = a[0][1] * (a[0][0] - 1)\n for i in range(2, n + 1):\n dp[i, 0] = dp[i - 1, 0] + a[i - 1][1] * abs((a[i - 1][0] - 1 - (i - 1)))\n dp[i, i] = dp[i - 1, i - 1] + a[i - 1][1] * abs((n - a[i - 1][0] - (i - 1)))\n\n l = dp[i - 1, 1:i] + [\n a[i - 1][1] * abs((a[i - 1][0] - 1 - j)) for j in range(i - 2, -1, -1)\n ]\n\n r = dp[i - 1, : i - 1] + [\n a[i - 1][1] * abs((n - a[i - 1][0] - j)) for j in range(i - 1)\n ]\n dp[i, 1:i] = np.maximum(l, r)\n return max(dp[n])\n\n\nif __name__ == \"__main__\":\n input = sys.stdin.readline\n n = int(eval(input()))\n a_ = list(map(int, input().split()))\n print((f(n, a_)))\n","fast_code":"from collections import defaultdict\n\nn = int(eval(input()))\na_ = list(map(int, input().split()))\na = []\nfor i, ai in enumerate(a_):\n a.append([1 + i, ai])\na.sort(key=lambda x: x[1], reverse=True)\ndp = defaultdict(lambda: 0)\ndp[(0, 1)] = max(a[0][1] * (n - a[0][0]), 0)\ndp[(1, 0)] = max(a[0][1] * (a[0][0] - 1), 0)\nfor i in range(2, n + 1):\n for x in range(i + 1):\n y = i - x\n if x == 0:\n dp[(x, y)] = dp[(x, y - 1)] + a[i - 1][1] * (n - a[i - 1][0] - (y - 1))\n elif y == 0:\n dp[(x, y)] = dp[(x - 1, y)] + a[i - 1][1] * (a[i - 1][0] - 1 - (x - 1))\n else:\n dp[(x, y)] = max(\n dp[(x - 1, y)] + a[i - 1][1] * (a[i - 1][0] - 1 - (x - 1)),\n dp[(x, y - 1)] + a[i - 1][1] * (n - a[i - 1][0] - (y - 1)),\n )\nans = 0\nfor i in range(n + 1):\n ans = max(ans, dp[(i, n - i)])\nprint(ans)\n"} +{"fast_code_id":"35dec6fc5770cf4d7b9621f258b5fe80dc7a1beb9ce612bddcc28ef1a07df64c","fast_id":"p03013_caafad57c12dd7f73a70c01e6f3a04d5e61c35d2f6f40fac4b9d85d515329111","language":"python","measured_fast_code_id":"caafad57c12dd7f73a70c01e6f3a04d5e61c35d2f6f40fac4b9d85d515329111","measured_slow_code_id":"62db3d0ef606be9ceb452bb70ce9888687db47f5aaa4f3513c9f4e41562943b7","measurement_metric":"cpu_instruction_count","pair_id":"python_edf67ab1e0fb733ca1a5f695","problem_id":"p03013","slow_code_id":"62db3d0ef606be9ceb452bb70ce9888687db47f5aaa4f3513c9f4e41562943b7","slow_id":"p03013_62db3d0ef606be9ceb452bb70ce9888687db47f5aaa4f3513c9f4e41562943b7","speedup":4.316741827015591,"stratum":"4-8","sampling_key":"685807b7ece3e5bfb2a4939b3640758e7c8df814b698ede9639bd40c3b166068","slow_code":"n, m = list(map(int, input().split()))\ndp = [0] * (n + 3)\na = [int(eval(input())) for i in range(m)]\nmod = 10**9 + 7\nfor i in range(m):\n dp[a[i]] = -1\ndp[0] = 1\nif dp[1] != -1:\n dp[1] += dp[0]\nfor i in range(n + 1):\n if dp[i + 2] == -1:\n continue\n if dp[i] != -1:\n dp[i + 2] += dp[i]\n if dp[i + 1] != -1:\n dp[i + 2] += dp[i + 1]\n dp[i + 2] %= mod\nprint((dp[n] % mod))\n","fast_code":"import sys\n\nN, M = list(map(int, input().split()))\nif M == 0:\n alist = set()\nelse:\n\n alist = set(map(int, sys.stdin))\ndp = [0] * (N + 1)\ndp[0] = 1\ndp[1] = 1 if 1 not in alist else 0\nMOD = 10**9 + 7\nfor i in range(2, N + 1):\n if i in alist:\n continue\n dp[i] = (dp[i - 1] + dp[i - 2]) % MOD\nprint((dp[N]))\n"} +{"fast_code_id":"057b5c4ca38651f0d59193224fa4007257013a8667a6bd7769d56ab6e24fd082","fast_id":"p02804_5fdac6057a326b38b11255f68f1f1d43ee0b748068832d5e767720e4ed292059","language":"python","measured_fast_code_id":"5fdac6057a326b38b11255f68f1f1d43ee0b748068832d5e767720e4ed292059","measured_slow_code_id":"52e56efda7e8ad6e4fdc8f09b72891b75e6a9de56b6e71746fa44cb90b571757","measurement_metric":"cpu_instruction_count","pair_id":"python_ee47403cafdd2b706658b6ff","problem_id":"p02804","slow_code_id":"c994ccc5a265f81602ec3599210c2d88b03e4417d6b99505fd51e34598f98009","slow_id":"p02804_52e56efda7e8ad6e4fdc8f09b72891b75e6a9de56b6e71746fa44cb90b571757","speedup":5.7681891374643905,"stratum":"4-8","sampling_key":"d2bc1e40c5319d8e8fcd1af1e0dbd6674a18dd7aca72c01d408e5292fe9aa36e","slow_code":"from collections import defaultdict\n\n\nclass Combination:\n\n def __init__(self, n_max, mod=10**9 + 7):\n self.mod = mod\n self.modinv = self.make_modinv_list(n_max)\n self.fac, self.facinv = self.make_factorial_list(n_max)\n\n def __call__(self, n, r):\n return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n - r] % self.mod\n\n def make_factorial_list(self, n):\n\n fac = [1]\n facinv = [1]\n for i in range(1, n + 1):\n fac.append(fac[i - 1] * i % self.mod)\n facinv.append(facinv[i - 1] * self.modinv[i] % self.mod)\n return fac, facinv\n\n def make_modinv_list(self, n):\n\n modinv = [0] * (n + 1)\n modinv[1] = 1\n for i in range(2, n + 1):\n modinv[i] = self.mod - self.mod // i * modinv[self.mod % i] % self.mod\n return modinv\n\n\ndef main():\n\n N, K = list(map(int, input().split()))\n A = list(map(int, input().split()))\n A.sort()\n ans = 0\n mod = 10**9 + 7\n comb = Combination(1000000)\n\n for i, a in enumerate(A):\n if (N - 1 - i) >= K - 1:\n\n tmp = comb(N - 1 - i, K - 1)\n ans -= a * tmp\n ans %= mod\n else:\n break\n A.sort(reverse=True)\n for i, a in enumerate(A):\n if (N - 1 - i) >= K - 1:\n\n tmp = comb(N - 1 - i, K - 1)\n ans += a * tmp\n ans %= mod\n else:\n break\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"P = 10**9 + 7\nN = 100001\ninv = [0] + [1]\nfinv = [1] + [1]\nfac = [1] + [1]\nfor i in range(2, N):\n inv += [inv[P % i] * (P - int(P / i)) % P]\n fac += [(fac[i - 1] * i) % P]\n finv += [(finv[i - 1] * inv[i]) % P]\n\n\ndef comb(a, b):\n if a < b:\n return -1\n return (fac[a] * ((finv[b] * finv[a - b]) % P)) % P\n\n\nn, k = list(map(int, input().split()))\na = list(map(int, input().split()))\na = sorted(a, key=lambda x: x, reverse=False)\nans = 0\n\nfor i in range(len(a)):\n tmp = comb(n - 1 - i, k - 1)\n if tmp < 0:\n continue\n if a[i] < 0:\n ans = (ans + (abs(a[i]) * tmp) % P) % P\n else:\n ans = (ans - (abs(a[i]) * tmp) % P + P) % P\n\nfor i in range(len(a)):\n tmp = comb(n - 1 - i, k - 1)\n if tmp < 0:\n continue\n if a[n - 1 - i] < 0:\n ans = (ans - (abs(a[n - 1 - i]) * tmp) % P + P) % P\n else:\n ans = (ans + (abs(a[n - 1 - i]) * tmp) % P) % P\nprint(ans)\n"} +{"fast_code_id":"683edb5387a0ab080181d9c6ffee63f5a436b05168e99054881c1ca28904e345","fast_id":"p03078_683edb5387a0ab080181d9c6ffee63f5a436b05168e99054881c1ca28904e345","language":"python","measured_fast_code_id":"683edb5387a0ab080181d9c6ffee63f5a436b05168e99054881c1ca28904e345","measured_slow_code_id":"fe6f251f7a2a781a4ba8d63d7bc1018c45f2fffcbd5accc0f89b5cd38b02444f","measurement_metric":"cpu_instruction_count","pair_id":"python_ee51f9c643da8af49609fa98","problem_id":"p03078","slow_code_id":"fe6f251f7a2a781a4ba8d63d7bc1018c45f2fffcbd5accc0f89b5cd38b02444f","slow_id":"p03078_fe6f251f7a2a781a4ba8d63d7bc1018c45f2fffcbd5accc0f89b5cd38b02444f","speedup":6.595132364359101,"stratum":"4-8","sampling_key":"dc92cacd48595140075e32b14853f12891a0393da187893a943d44e0d78a82cc","slow_code":"X, Y, Z, K = map(int, input().split())\nA = list(map(int, input().split()))\nB = list(map(int, input().split()))\nC = list(map(int, input().split()))\nans1 = []\nfor i in range(X):\n for j in range(Y):\n ans1.append(A[i] + B[j])\nans1 = sorted(ans1, reverse=True)[:K]\nans = []\nfor i in range(len(ans1)):\n for j in range(Z):\n ans.append(ans1[i] + C[j])\nprint(*sorted(ans, reverse=True)[:K], sep=\"\\n\")\n","fast_code":"X, Y, Z, K = map(int, input().split())\nA = sorted(list(map(int, input().split())), reverse=True)\nB = sorted(list(map(int, input().split())), reverse=True)\nC = sorted(list(map(int, input().split())), reverse=True)\ncomb = []\nfor a in range(X):\n b_max = K // (a + 1)\n for b in range(min(Y, b_max)):\n c_max = K // ((a + 1) * (b + 1))\n for c in range(min(Z, c_max)):\n comb.append(sum([A[a], B[b], C[c]]))\ncomb.sort(reverse=True)\nprint(*comb[:K], sep=\"\\n\")\n"} +{"fast_code_id":"09bf5d0d342feea8a2f21191badddda2ed0fca1f3c0b3c1083fafbad4af87956","fast_id":"p00053_09bf5d0d342feea8a2f21191badddda2ed0fca1f3c0b3c1083fafbad4af87956","language":"python","measured_fast_code_id":"09bf5d0d342feea8a2f21191badddda2ed0fca1f3c0b3c1083fafbad4af87956","measured_slow_code_id":"7130bb62b43d2905d9cdb1190486ed076acf2c798a1bd9a7e922a3d44800a16f","measurement_metric":"cpu_instruction_count","pair_id":"python_eea57c37ebaea158f3fe0428","problem_id":"p00053","slow_code_id":"7130bb62b43d2905d9cdb1190486ed076acf2c798a1bd9a7e922a3d44800a16f","slow_id":"p00053_7130bb62b43d2905d9cdb1190486ed076acf2c798a1bd9a7e922a3d44800a16f","speedup":8.817223240116999,"stratum":"8+","sampling_key":"9cbdc862333594045a0ca81866e25b8c3ca5dc3727f454a46282d3ebddd9450b","slow_code":"s = [0]\nM = 10**6\np = [1] * M\nS = 0\nfor i in range(2, M):\n if p[i]:\n for j in range(i * i, M, i):\n p[j] = 0\n S += i\n s.append(S)\nwhile 1:\n n = eval(input())\n if n == 0:\n break\n print(s[n])\n","fast_code":"s = [0]\nM = 104850\np = [1] * M\nS = 0\nfor i in range(2, M):\n if p[i]:\n for j in range(i * i, M, i):\n p[j] = 0\n S += i\n s.append(S)\nwhile 1:\n n = eval(input())\n if n == 0:\n break\n print(s[n])\n"} +{"fast_code_id":"5dc42099153bb6da27156c18cc71f05f1a7cc7431449288818076ded87d105bd","fast_id":"p03801_5dc42099153bb6da27156c18cc71f05f1a7cc7431449288818076ded87d105bd","language":"python","measured_fast_code_id":"5dc42099153bb6da27156c18cc71f05f1a7cc7431449288818076ded87d105bd","measured_slow_code_id":"40cdb704510a327363c2183827f02e9385c4a8e8deb4ae92265564da9b8e0f50","measurement_metric":"cpu_instruction_count","pair_id":"python_eeef5213b4d68e37e5c76990","problem_id":"p03801","slow_code_id":"16fad88fa10618a2d3253fe477e8c221495b37e3b11f228319dc3cf0097c8388","slow_id":"p03801_40cdb704510a327363c2183827f02e9385c4a8e8deb4ae92265564da9b8e0f50","speedup":2.1020322838847743,"stratum":"2-4","sampling_key":"9cea7857d40fd1af9705acaa59345f37d7d00a5c9c9806524df649b91f2d6689","slow_code":"from collections import defaultdict\nimport sys\n\n\nclass BIT:\n def __init__(self, number):\n self.n = number\n self.list = [0] * (number + 1)\n\n def add(self, i, x):\n while i <= self.n:\n self.list[i] += x\n i += i & -i\n\n def search(self, i):\n s = 0\n while i > 0:\n s += self.list[i]\n i -= i & -i\n return s\n\n def suma(self, i, j):\n return self.search(j) - self.search(i - 1)\n\n\nN = int(eval(input()))\nA = [int(i) for i in input().split()]\nC = sorted(set(A))\nndd = defaultdict(int)\nfor i in range(len(C)):\n ndd[i + 1] = C[i]\ndd = defaultdict(int)\nfor i in range(len(C)):\n dd[C[i]] = i + 1\n\nvisit = [0] * N\nvisit[0] = 1\ns = A[0]\nH = []\nH.append(s)\nfor i in range(1, N):\n if s < A[i]:\n s = A[i]\n H.append(s)\n visit[i] = 1\nBITI = BIT(N + 1)\nBITI2 = BIT(N + 1)\nj = len(H) - 1\nl = dd[H[j]]\nnum = sum(A)\nT = [0] * N\nans = 0\nfor i in range(N - 1, -1, -1):\n if l == dd[A[0]]:\n break\n BITI.add(dd[A[i]], A[i])\n BITI2.add(dd[A[i]], 1)\n if dd[A[i]] == l and visit[i] == 1:\n T[i] = (\n BITI.suma(dd[H[j - 1]], N + 1)\n - BITI2.suma(dd[H[j - 1]], N + 1) * H[j - 1]\n - ans\n )\n ans += T[i]\n\n j -= 1\n l = dd[H[j]]\nx = num - sum(T)\nT[0] = x\n\nfor t in T:\n print(t)\n","fast_code":"N = int(eval(input()))\nA = [int(a) for a in input().split()]\nS = sum(A)\nfor i in range(N):\n A[i] = [A[i], i + 1]\nA.sort(reverse=True)\nans = [0] * (N + 1)\ni = 0\nnum = N + 1\nwhile i < N - 1:\n num = min(num, A[i][1])\n while i < N - 1 and A[i][0] == A[i + 1][0]:\n num = min(num, A[i + 1][1])\n i += 1\n if i == N - 1:\n break\n ans[num] += (i + 1) * (A[i][0] - A[i + 1][0])\n i += 1\nans[1] += S - sum(ans)\nfor i in range(1, N + 1):\n print((ans[i]))\n"} +{"fast_code_id":"48bca5ec537e2c0d335a2f12dd6d8f572e8554225e88eac3eb9ee080f8838834","fast_id":"p02712_48bca5ec537e2c0d335a2f12dd6d8f572e8554225e88eac3eb9ee080f8838834","language":"python","measured_fast_code_id":"48bca5ec537e2c0d335a2f12dd6d8f572e8554225e88eac3eb9ee080f8838834","measured_slow_code_id":"cc3f9e0e6116014af910f8b40835b1f31de095fd1860f0d0844bf40df1c5751a","measurement_metric":"cpu_instruction_count","pair_id":"python_eef78e909e9700a64f683e92","problem_id":"p02712","slow_code_id":"cc3f9e0e6116014af910f8b40835b1f31de095fd1860f0d0844bf40df1c5751a","slow_id":"p02712_cc3f9e0e6116014af910f8b40835b1f31de095fd1860f0d0844bf40df1c5751a","speedup":850.7983987667284,"stratum":"8+","sampling_key":"4f08039974edf02638e54a02e17288cd745a644823c5037e2ad5e06defc197e0","slow_code":"n = int(eval(input()))\na = [0 for i in range(n)]\ncount = 0\nfor i in range(n):\n if (i + 1) % 3 == 0 or (i + 1) % 5 == 0:\n continue\n else:\n a[i] = i + 1\n count += i + 1\nprint(count)\n","fast_code":"N = int(eval(input()))\nans = int(\n N * (N + 1) / 2\n - (N // 3) * (N // 3 + 1) / 2 * 3\n - (N // 5) * (N // 5 + 1) / 2 * 5\n + (N // 15) * (N // 15 + 1) / 2 * 15\n)\nprint(ans)\n"} +{"fast_code_id":"4f7dec1c545bf87e3a5097894d02befa206b9706034f91157ed6843257394fd6","fast_id":"p02595_4f7dec1c545bf87e3a5097894d02befa206b9706034f91157ed6843257394fd6","language":"python","measured_fast_code_id":"4f7dec1c545bf87e3a5097894d02befa206b9706034f91157ed6843257394fd6","measured_slow_code_id":"1559f276e022453eb8e8e92cd54d60648c4bba1cc009c4b0eef1eaf17b1ef72e","measurement_metric":"cpu_instruction_count","pair_id":"python_ef3a465feb999e33d843e10f","problem_id":"p02595","slow_code_id":"1559f276e022453eb8e8e92cd54d60648c4bba1cc009c4b0eef1eaf17b1ef72e","slow_id":"p02595_1559f276e022453eb8e8e92cd54d60648c4bba1cc009c4b0eef1eaf17b1ef72e","speedup":5.387965879464539,"stratum":"4-8","sampling_key":"1a4892da708f93e5728036359b82cbcdb335740186db937fdc934df4c14e0e01","slow_code":"from decimal import *\n\ngetcontext().prec = 50\nN, D = list(map(int, input().split()))\n\n\ndef distance(x1, x2, y1, y2):\n dx = x2 - x1\n dy = y2 - y1\n return (dx * dx + dy * dy).sqrt()\n\n\nX = [0] * N\nY = [0] * N\nfor i in range(N):\n X[i], Y[i] = list(map(Decimal, input().split()))\nans = 0\nfor i in range(N):\n if distance(0, X[i], 0, Y[i]) <= D:\n ans += 1\nprint(ans)\n","fast_code":"import sys\n\ninput = sys.stdin.readline\n\n\ndef main():\n n, d = list(map(int, input().split()))\n res = 0\n for _ in range(n):\n x, y = list(map(int, input().split()))\n if (x**2 + y**2) ** 0.5 <= d:\n res += 1\n print(res)\n\n\nmain()\n"} +{"fast_code_id":"40e8262a5e96f9a351504d31b189aa9a06718c27ee1fa38f7b36c51bcccc4bb1","fast_id":"p03125_40e8262a5e96f9a351504d31b189aa9a06718c27ee1fa38f7b36c51bcccc4bb1","language":"python","measured_fast_code_id":"40e8262a5e96f9a351504d31b189aa9a06718c27ee1fa38f7b36c51bcccc4bb1","measured_slow_code_id":"4b613364292341c90cb223444cc17d712d2692c86eaf7401941c05ab19a835ea","measurement_metric":"cpu_instruction_count","pair_id":"python_ef483594318e4320dddb523b","problem_id":"p03125","slow_code_id":"8b3f73d78db4b17be952c8e49db130961979c1aa4d15ae41972fb4783a0ae1cc","slow_id":"p03125_4b613364292341c90cb223444cc17d712d2692c86eaf7401941c05ab19a835ea","speedup":3.527202310741732,"stratum":"2-4","sampling_key":"116e936a79a0047477fd910e923cd72bdb81c206ed5e0d2676d03974b081f700","slow_code":"import sys\nimport math\nfrom bisect import bisect_right as br\nfrom bisect import bisect_left as bl\n\nsys.setrecursionlimit(2147483647)\nfrom heapq import heappush, heappop, heappushpop\nfrom collections import defaultdict\nfrom itertools import accumulate\nfrom collections import Counter\nfrom collections import deque\nfrom operator import itemgetter\nfrom itertools import permutations\n\nmod = 10**9 + 7\ninf = float(\"inf\")\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\na, b = LI()\nif b % a == 0:\n print((a + b))\nelse:\n print((b - a))\n","fast_code":"a, b = list(map(int, input().split()))\nprint(((a + b) if b % a == 0 else (b - a)))\n"} +{"fast_code_id":"77881259c846af61127583714eddae818e8d4390d6dcc41503efecc52218accd","fast_id":"p02630_5c79b9e310b66b9360c139ba9db4e2d3634da0d1561e853d9f779fca53f6678f","language":"python","measured_fast_code_id":"5c79b9e310b66b9360c139ba9db4e2d3634da0d1561e853d9f779fca53f6678f","measured_slow_code_id":"96450435c56c9932de49d1d1d53a232b5189e0fe47b305002a0d44a0ec3cd04b","measurement_metric":"cpu_instruction_count","pair_id":"python_ef7309dba0e1373f7e338dc5","problem_id":"p02630","slow_code_id":"f1f847cea9ab3dffada95647d255a7960e5e340922e99784cbf3f82890bf75d7","slow_id":"p02630_96450435c56c9932de49d1d1d53a232b5189e0fe47b305002a0d44a0ec3cd04b","speedup":4.922074299711639,"stratum":"4-8","sampling_key":"2ad0f4067985e0dafadb8ce68c0a181913911c1165cb4e6a2141c87ea05b649a","slow_code":"n = int(eval(input()))\nA = list(map(int, input().split()))\nq = int(eval(input()))\ntotal = sum(A)\nl = [0 for i in range(10**5 + 1)]\nfor _ in A:\n l[_] += 1\nfor i in range(q):\n b, c = list(map(int, input().split()))\n total += c * l[b]\n total -= b * l[b]\n print(total)\n l[c] += l[b]\n l[b] = 0\n","fast_code":"import sys\n\nINF = 1 << 60\nMOD = 10**9 + 7\nsys.setrecursionlimit(2147483647)\ninput = lambda: sys.stdin.readline().rstrip()\nfrom collections import Counter\n\n\ndef resolve():\n n = int(eval(input()))\n C = Counter(list(map(int, input().split())))\n total = 0\n for key, val in list(C.items()):\n total += key * val\n for _ in range(int(eval(input()))):\n b, c = list(map(int, input().split()))\n num = C[b]\n total += (c - b) * num\n C[b] = 0\n C[c] += num\n print(total)\n\n\nresolve()\n"} +{"fast_code_id":"c99433f04c3933fd58c56652be6a5c57fad46a0fbea959f404c4dff1c8007131","fast_id":"p02716_c99433f04c3933fd58c56652be6a5c57fad46a0fbea959f404c4dff1c8007131","language":"python","measured_fast_code_id":"c99433f04c3933fd58c56652be6a5c57fad46a0fbea959f404c4dff1c8007131","measured_slow_code_id":"e0091a9b9deccd6ac161e28fc03ef99b2dfd2dba84ead05783e45d658cc28bd0","measurement_metric":"cpu_instruction_count","pair_id":"python_ef843a597d89806e7d7bdc6f","problem_id":"p02716","slow_code_id":"df39c3ce8c4ff15d3390419aee36b903bfab2cef5b1f71f30ea85ada047502b8","slow_id":"p02716_e0091a9b9deccd6ac161e28fc03ef99b2dfd2dba84ead05783e45d658cc28bd0","speedup":3.0513951513228883,"stratum":"2-4","sampling_key":"7ebd0c0332e5124242a20b74ba7a8119e543ba793f3edca8a3724d16aeaff899","slow_code":"C = -(10**15 + 7)\n\n\ndef main():\n from collections import defaultdict\n\n N = int(eval(input()))\n K = N // 2\n A = [int(i) for i in input().split()]\n dp = defaultdict(lambda: C)\n for i in range(N + 1):\n dp[i, 0] = 0\n if i != 0:\n dp[(i, 1)] = max(dp[i - 1, 1], A[i - 1])\n for i in range(2, N + 1):\n for j in range(i // 2 - 1, (i + 1) // 2 + 1):\n if j < 0:\n continue\n\n dp[i, j] = max(\n dp[i, j],\n dp[i - 2, j - 1] + A[i - 1],\n dp[i - 3, j - 1] + A[i - 1],\n dp[i - 4, j - 1] + A[i - 1],\n )\n print((max(dp[N, K], dp[N - 1, K], dp[N - 2, K])))\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"n = int(eval(input()))\nl = list(map(int, input().split()))\np = [0] * n\nd = [0] * n\nfor i in range(n):\n p[i] = l[i] + (p[i - 2] if i > 1 else 0)\nfor i in range(1, n):\n d[i] = p[i - 1] if (i & 1) else d[i - 1]\n d[i] = max(d[i], l[i] + (d[i - 2] if i > 1 else 0))\nprint((d[-1]))\n"} +{"fast_code_id":"62ad9f2adce44c77d68fd44ebb9f61b6ba9fe3ebcdabfb9b6ab52cc566bf6ddc","fast_id":"p02989_62ad9f2adce44c77d68fd44ebb9f61b6ba9fe3ebcdabfb9b6ab52cc566bf6ddc","language":"python","measured_fast_code_id":"62ad9f2adce44c77d68fd44ebb9f61b6ba9fe3ebcdabfb9b6ab52cc566bf6ddc","measured_slow_code_id":"bee7326f5d65117847c8daffc9f8e9e9508be71f70ad2064bdf47643f0632c7e","measurement_metric":"cpu_instruction_count","pair_id":"python_f0cb7cd6d256991121c56f3d","problem_id":"p02989","slow_code_id":"bee7326f5d65117847c8daffc9f8e9e9508be71f70ad2064bdf47643f0632c7e","slow_id":"p02989_bee7326f5d65117847c8daffc9f8e9e9508be71f70ad2064bdf47643f0632c7e","speedup":90.75047426377911,"stratum":"8+","sampling_key":"21655d675acf228f380e1b4cf768c159b052b0fe80f59ceea152841fa86e722b","slow_code":"from bisect import bisect_left\n\nn = int(eval(input()))\nd = list(map(int, input().split()))\nd = sorted(d)\nans = 0\nfor i in range(1, 10**5 + 1):\n p = bisect_left(d, i)\n ans += 1 if p == (n - p) else 0\nprint(ans)\n","fast_code":"k = int(eval(input()))\nd = sorted(list(map(int, input().split())))\nans = 0\nfor i in range(d[int(len(d) / 2) - 1] + 1, d[int(len(d) / 2)] + 1):\n ans += 1\nprint(ans)\n"} +{"fast_code_id":"b40bee92d8114fee049f53fd3148b205b06aef3deaa651d2e75191cd4ce76077","fast_id":"p02982_b40bee92d8114fee049f53fd3148b205b06aef3deaa651d2e75191cd4ce76077","language":"python","measured_fast_code_id":"b40bee92d8114fee049f53fd3148b205b06aef3deaa651d2e75191cd4ce76077","measured_slow_code_id":"3062723b648fda295737e748d4e0d5d9caa11a6c4d2d4160eb2931cf3e53df51","measurement_metric":"cpu_instruction_count","pair_id":"python_f0e77b87883b9c9f718913f6","problem_id":"p02982","slow_code_id":"3062723b648fda295737e748d4e0d5d9caa11a6c4d2d4160eb2931cf3e53df51","slow_id":"p02982_3062723b648fda295737e748d4e0d5d9caa11a6c4d2d4160eb2931cf3e53df51","speedup":409.80250551134844,"stratum":"8+","sampling_key":"330eb41de4199896220d0bcd6a10f7671db41d95454716d93f2eb855534abb14","slow_code":"import numpy as np\n\nN, D = list(map(int, input().split()))\nX = np.zeros((N, D))\nfor i in range(N):\n X[i][:] = list(map(int, input().split()))\nn = 0\nfor i in range(N):\n for j in range(i + 1, N):\n dist = np.linalg.norm(X[i] - X[j])\n if dist.is_integer():\n n += 1\nprint(n)\n","fast_code":"n, d = list(map(int, input().split()))\nx = [list(map(int, input().split())) for _ in range(n)]\nans = 0\nfor i in range(n - 1):\n for j in range(i + 1, n):\n t = 0\n for k in range(d):\n t += abs(x[i][k] - x[j][k]) ** 2\n t **= 0.5\n if t.is_integer():\n ans += 1\nprint(ans)\n"} +{"fast_code_id":"051dd963702238662fe96a84ebc1ca74f3c157f8cf8eec6769e928924a370a63","fast_id":"p03298_822b320890b4640a82e0d7980e120614b4f10c9398150508b25e66c5600d4e83","language":"python","measured_fast_code_id":"822b320890b4640a82e0d7980e120614b4f10c9398150508b25e66c5600d4e83","measured_slow_code_id":"47babb9e01c38bdfaa49525bab51c30730074e0d2a2c3f9e0f69c5eefd476094","measurement_metric":"cpu_instruction_count","pair_id":"python_f10d7648580ea6058030e858","problem_id":"p03298","slow_code_id":"6bef4b9e934fe1051f41330f714558355912f4b132983bfbb8d8ce7c9372c683","slow_id":"p03298_47babb9e01c38bdfaa49525bab51c30730074e0d2a2c3f9e0f69c5eefd476094","speedup":2.096666440438303,"stratum":"2-4","sampling_key":"fb0cce8a4b25c3f6545de35870536b228ac92be06d392367f8c72b68ffb2c4ba","slow_code":"import sys\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\ndef LS2():\n return list(sys.stdin.readline().rstrip())\n\n\nN = I()\nS = LS2()\n\nans = 0\nleft = []\nright = []\nfor i in range(2**N):\n red = []\n blue = []\n for j in range(N):\n if (i >> j) & 1:\n red.append(S[j])\n else:\n blue.append(S[j])\n red = \"\".join(red)\n blue = \"\".join(blue)\n left.append((red, blue))\nfor i in range(2**N):\n red = []\n blue = []\n for j in range(N):\n if (i >> j) & 1:\n red.append(S[j + N])\n else:\n blue.append(S[j + N])\n red, blue = blue, red\n red.reverse()\n blue.reverse()\n red = \"\".join(red)\n blue = \"\".join(blue)\n right.append((red, blue))\nfrom operator import itemgetter\n\nright = sorted(right, key=itemgetter(0, 1))\nfrom bisect import bisect_left, bisect\n\nans = 0\nfor i in range(2**N):\n ans += bisect(right, left[i]) - bisect_left(right, left[i])\nprint(ans)\n","fast_code":"from collections import defaultdict, deque\nfrom heapq import heappush, heappop\nimport sys\nimport math\nimport bisect\nimport random\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LS():\n return [list(x) for x in sys.stdin.readline().split()]\n\n\ndef S():\n res = list(sys.stdin.readline())\n if res[-1] == \"\\n\":\n return res[:-1]\n return res\n\n\ndef IR(n):\n return [I() for i in range(n)]\n\n\ndef LIR(n):\n return [LI() for i in range(n)]\n\n\ndef SR(n):\n return [S() for i in range(n)]\n\n\ndef LSR(n):\n return [LS() for i in range(n)]\n\n\nsys.setrecursionlimit(1000000)\nmod = 1000000007\n\n\ndef A():\n return\n\n\ndef B():\n return\n\n\ndef C():\n n = I()\n s = S()\n for i in range(2 * n):\n s[i] = ord(s[i]) - 96\n k = 27\n m = 1 << n\n p = [1 << j for j in range(n)]\n d = defaultdict(lambda: 0)\n l = [(0, 0)]\n for i in s[:n][::-1]:\n l = [(x[0] * k + i, x[1]) for x in l] + [(x[0], x[1] * k + i) for x in l]\n for i in l:\n d[i] += 1\n ans = 0\n l = [(0, 0)]\n for i in s[n:]:\n l = [(x[0] * k + i, x[1]) for x in l] + [(x[0], x[1] * k + i) for x in l]\n for i in l:\n ans += d[i]\n print(ans)\n return\n\n\ndef D():\n return\n\n\ndef E():\n return\n\n\ndef F():\n return\n\n\nif __name__ == \"__main__\":\n C()\n"} +{"fast_code_id":"07946d257ddf30d41e39f411c7f28872f47e5cdcedd7ff44a4a43570b5a8d815","fast_id":"p02890_07946d257ddf30d41e39f411c7f28872f47e5cdcedd7ff44a4a43570b5a8d815","language":"python","measured_fast_code_id":"07946d257ddf30d41e39f411c7f28872f47e5cdcedd7ff44a4a43570b5a8d815","measured_slow_code_id":"683b16708a4919fe826584e325a20783d2265d979233683a19a27263211ea906","measurement_metric":"cpu_instruction_count","pair_id":"python_f12a06ef571d15efd56f0b63","problem_id":"p02890","slow_code_id":"2c57f5c3d6e04ae779c203c63a7a33316889e85db23460b3b699e27933e99fbd","slow_id":"p02890_683b16708a4919fe826584e325a20783d2265d979233683a19a27263211ea906","speedup":6.344357676864725,"stratum":"4-8","sampling_key":"682596d6b041357380a4218e46b6e200f4ebc4d4a5adfd4f8261779025610c8f","slow_code":"import sys\nimport math\nfrom bisect import bisect_right as br\nfrom bisect import bisect_left as bl\n\nsys.setrecursionlimit(2147483647)\nfrom heapq import heappush, heappop, heappushpop\nfrom collections import defaultdict\nfrom itertools import accumulate\nfrom collections import Counter\nfrom collections import deque\nfrom operator import itemgetter\nfrom itertools import permutations\n\nmod = 10**9 + 7\ninf = float(\"inf\")\n\n\ndef I():\n return int(sys.stdin.readline())\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().split()))\n\n\nn = I()\na = LI()\ncnt = list(Counter(a).values())\ncnt.sort()\nm = len(cnt)\nS = [0] * (n + 1)\nfor x in range(1, n + 1):\n l = bl(cnt, x)\n S[x] = S[x - 1] + (m - l)\nfor k in range(1, n + 1):\n high, low = n + 1, 0\n while high - low > 1:\n mid = (high + low) // 2\n if S[mid] >= k * mid:\n low = mid\n else:\n high = mid\n print(low)\n","fast_code":"from collections import Counter\n\nN = int(eval(input()))\nC = sorted(list(Counter(list(map(int, input().split()))).values()))\nrest = N\nremoved = 0\nfor K in range(1, N + 1):\n d = K - removed\n while C and C[-1] > rest // d:\n rest -= C[-1]\n C.pop()\n removed += 1\n d -= 1\n print((rest // d))\n"} +{"fast_code_id":"da805f3ee6670fdaae81ebd05aeff08dd0f062768069de7b6d7cdfd6a806264d","fast_id":"p03419_da805f3ee6670fdaae81ebd05aeff08dd0f062768069de7b6d7cdfd6a806264d","language":"python","measured_fast_code_id":"da805f3ee6670fdaae81ebd05aeff08dd0f062768069de7b6d7cdfd6a806264d","measured_slow_code_id":"03759bbd848f3c06ca221a2e3cc07d0592161ce2c92214006d02107382720a3e","measurement_metric":"cpu_instruction_count","pair_id":"python_f14d5671a2fa232e0250d295","problem_id":"p03419","slow_code_id":"03759bbd848f3c06ca221a2e3cc07d0592161ce2c92214006d02107382720a3e","slow_id":"p03419_03759bbd848f3c06ca221a2e3cc07d0592161ce2c92214006d02107382720a3e","speedup":4.179492381067723,"stratum":"4-8","sampling_key":"c718b563a91361d6e131000ff9afff9881e1e3e336e03a0f15ac4be64bd096b1","slow_code":"def calc0(N, M):\n cell = [[0 for i in range(M)] for j in range(N)]\n for i in range(M):\n for j in range(N):\n for y in range(-1, 2):\n for x in range(-1, 2):\n xx = i + x\n yy = j + y\n if 0 <= xx < M and 0 <= yy < N:\n cell[yy][xx] ^= 1\n r = 0\n for i in range(M):\n for j in range(N):\n if cell[j][i]:\n r += 1\n return r\n\n\ndef calc(N, M):\n if N == 1 and M == 1:\n return 1\n if N >= 2 and M >= 2:\n return (N - 2) * (M - 2)\n if N == 1:\n return M - 2\n return N - 2\n\n\nN, M = [int(_) for _ in input().split()]\nprint((calc(N, M)))\n","fast_code":"N, M = list(map(int, input().split()))\nif N == 2 or M == 2:\n print((0))\nelse:\n print((abs((N - 2) * (M - 2))))\n"} +{"fast_code_id":"7dfca9eb6adfb71b30ea843e795c6c0957ea1ed8fbd2e0ee01f5a4b53ace9316","fast_id":"p03185_7dfca9eb6adfb71b30ea843e795c6c0957ea1ed8fbd2e0ee01f5a4b53ace9316","language":"python","measured_fast_code_id":"7dfca9eb6adfb71b30ea843e795c6c0957ea1ed8fbd2e0ee01f5a4b53ace9316","measured_slow_code_id":"3cfce86d654bd06d40adb96ffc83f2ac55718a181a816c4771301b82f47e3cae","measurement_metric":"cpu_instruction_count","pair_id":"python_f153e4917aa0bb2fab8e62b2","problem_id":"p03185","slow_code_id":"3cfce86d654bd06d40adb96ffc83f2ac55718a181a816c4771301b82f47e3cae","slow_id":"p03185_3cfce86d654bd06d40adb96ffc83f2ac55718a181a816c4771301b82f47e3cae","speedup":2.0991978584437883,"stratum":"2-4","sampling_key":"5f128cf27012f03c8c7f3d4c748ebf20f98e620c84190cfacfe9b5cd03713e16","slow_code":"def fi(i, x):\n a, b = lines[i]\n return a * x + b\n\n\ndef find(x):\n def f(i):\n return fi(i + 1, x) > fi(i, x)\n\n mn, mx = -1, len(lines) - 1\n idx = (mn + mx) // 2\n while mx - mn > 1:\n if f(idx):\n mx, idx = idx, (mn + idx) // 2\n continue\n mn, idx = idx, (mx + idx) // 2\n return fi(idx + 1, x)\n\n\ndef insert(a, b):\n (e, f) = lines[-1]\n while len(lines) - 1:\n (c, d), (e, f) = (e, f), lines[-2]\n if (c - e) * (b - d) < (d - f) * (a - c):\n break\n lines.pop()\n lines.append((a, b))\n\n\nN, C = list(map(int, input().split()))\nhs = list(map(int, input().split()))\nlines = [(-2 * hs[0], hs[0] ** 2)]\nfor h in hs[1:]:\n r = find(h) + h**2 + C\n insert(-2 * h, r + h**2)\nprint(r)\n","fast_code":"N, C = list(map(int, input().split()))\nhs = list(map(int, input().split()))\nlines = [(-2 * hs[0], hs[0] ** 2)]\nI = 0\nfor h in hs[1:]:\n u, v = lines[I]\n while I + 1 < len(lines):\n uu, vv = lines[I + 1]\n if u * h + v < uu * h + vv:\n break\n u, v = uu, vv\n I += 1\n r = u * h + v + h**2 + C\n a, b = -2 * h, r + h**2\n (e, f) = lines[-1]\n while len(lines) - 1:\n (c, d), (e, f) = (e, f), lines[-2]\n if (c - e) * (b - d) < (d - f) * (a - c):\n break\n lines.pop()\n lines.append((a, b))\nprint(r)\n"} +{"fast_code_id":"97b737f05f0830b14579e16256f0ec5f9380e4ef62fc98a570bb8aeb2204470e","fast_id":"p02244_97b737f05f0830b14579e16256f0ec5f9380e4ef62fc98a570bb8aeb2204470e","language":"python","measured_fast_code_id":"97b737f05f0830b14579e16256f0ec5f9380e4ef62fc98a570bb8aeb2204470e","measured_slow_code_id":"de9c1ea405f9a9a020b43e0f2c02b75f368b6c2931a4313be78d5a5d6b52ed14","measurement_metric":"cpu_instruction_count","pair_id":"python_f175e6a23a15b4f82e803feb","problem_id":"p02244","slow_code_id":"de9c1ea405f9a9a020b43e0f2c02b75f368b6c2931a4313be78d5a5d6b52ed14","slow_id":"p02244_de9c1ea405f9a9a020b43e0f2c02b75f368b6c2931a4313be78d5a5d6b52ed14","speedup":12.998843370737097,"stratum":"8+","sampling_key":"0270e92947e51c61424bff312780d9a46f4418ff2f34c7bd75b559fc8654b593","slow_code":"from itertools import product\nfrom copy import deepcopy, copy\n\n\nclass QueenMAP:\n __slots__ = [\"yoko\", \"tate\", \"naname1\", \"naname2\", \"MAP\"]\n\n def __init__(self):\n self.yoko = set()\n self.tate = set()\n self.naname1 = set()\n self.naname2 = set()\n self.MAP = [[\".\"] * 8 for _ in range(8)]\n\n def add(self, y, x):\n self.MAP[y][x] = \"Q\"\n self.yoko.add(y)\n self.tate.add(x)\n self.naname1.add(y - x)\n self.naname2.add(x + y)\n\n def check(self, y, x):\n if (\n y in self.yoko\n or x in self.tate\n or (y - x) in self.naname1\n or (x + y) in self.naname2\n ):\n return False\n return True\n\n def allcheck(self):\n for i in range(8):\n if not \"Q\" in self.MAP[i]:\n return False\n return True\n\n\ndef MAIN():\n f = lambda M: \"\\n\".join(\"\".join(map(str, m)) for m in M)\n QM = QueenMAP()\n n = int(eval(input()))\n for _ in range(n):\n a, b = list(map(int, input().split()))\n QM.add(a, b)\n dp = [(deepcopy(QM), n)]\n while dp:\n Q, cnt = dp.pop()\n if cnt == 8:\n if Q.allcheck():\n print((f(Q.MAP)))\n break\n continue\n cnt += 1\n for i in range(8):\n for j in range(8):\n if Q.check(i, j):\n CQ = deepcopy(Q)\n CQ.add(i, j)\n dp.append((CQ, cnt))\n\n\nMAIN()\n","fast_code":"row = [False] * 8\ncol = [False] * 8\ndpos = [False] * 15\ndneg = [False] * 15\nboard = [[\".\", \".\", \".\", \".\", \".\", \".\", \".\", \".\"] for i in range(8)]\nimport sys\n\nfile_input = sys.stdin\nk = int(file_input.readline())\nfor line in file_input:\n r, c = list(map(int, line.split()))\n row[r] = True\n col[c] = True\n dpos[r + c] = True\n dneg[r - c + 7] = True\n board[r][c] = \"Q\"\n\n\ndef dfs(i=0):\n if i == 8:\n for line in board:\n print((\"\".join(line)))\n elif row[i]:\n dfs(i + 1)\n else:\n for j in range(8):\n if col[j] or dpos[i + j] or dneg[i - j + 7]:\n continue\n row[i] = True\n col[j] = True\n dpos[i + j] = True\n dneg[i - j + 7] = True\n board[i][j] = \"Q\"\n dfs(i + 1)\n row[i] = False\n col[j] = False\n dpos[i + j] = False\n dneg[i - j + 7] = False\n board[i][j] = \".\"\n\n\ndfs()\n"} +{"fast_code_id":"a608c3ac8df5a73167a92a04c86f2fdb15d45e00c54253d6e68a9ff5e33ea86b","fast_id":"p03030_a608c3ac8df5a73167a92a04c86f2fdb15d45e00c54253d6e68a9ff5e33ea86b","language":"python","measured_fast_code_id":"a608c3ac8df5a73167a92a04c86f2fdb15d45e00c54253d6e68a9ff5e33ea86b","measured_slow_code_id":"dbe08050a0d6a77d36da9960a8e9921e8d48ac452d52421ae0919461f538c102","measurement_metric":"cpu_instruction_count","pair_id":"python_f260d992002646a0f86f5507","problem_id":"p03030","slow_code_id":"dbe08050a0d6a77d36da9960a8e9921e8d48ac452d52421ae0919461f538c102","slow_id":"p03030_dbe08050a0d6a77d36da9960a8e9921e8d48ac452d52421ae0919461f538c102","speedup":5.246022867186872,"stratum":"4-8","sampling_key":"0633cac225e24f3bca2e89c5eebabd81795b681bd12c65a040ffcc1d791a99f0","slow_code":"N = int(eval(input()))\nMAIN = []\nfor i in range(N):\n S, P = list(map(str, input().split()))\n MAIN.append([i + 1, S, int(P)])\n\n\ndef swap(i, j):\n x = MAIN[i]\n MAIN[i] = MAIN[j]\n MAIN[j] = x\n\n\nupdate = True\nwhile update == True:\n update = False\n for i in range(1, N):\n if MAIN[i][1] > MAIN[i - 1][1]:\n continue\n elif MAIN[i][1] == MAIN[i - 1][1]:\n if MAIN[i][2] > MAIN[i - 1][2]:\n swap(i, i - 1)\n update = True\n else:\n swap(i, i - 1)\n update = True\nfor m in MAIN:\n print((m[0]))\n","fast_code":"n = int(eval(input()))\nsp = [[input().split(), i + 1] for i in range(n)]\nsp = sorted(sp, key=lambda x: (x[0][0], -int(x[0][1])))\nfor i in range(n):\n print((sp[i][1]))\n"} +{"fast_code_id":"12469791a2e092016f2a21831341c6685a47fc7e9d175322b3c48450cf8e40c9","fast_id":"p04015_12469791a2e092016f2a21831341c6685a47fc7e9d175322b3c48450cf8e40c9","language":"python","measured_fast_code_id":"12469791a2e092016f2a21831341c6685a47fc7e9d175322b3c48450cf8e40c9","measured_slow_code_id":"8b45717994a5fb48dc2b76199b10d5e4e202c9ce5463bf7869f8add9172f6ff7","measurement_metric":"cpu_instruction_count","pair_id":"python_f2e70281f8e15682661cca6a","problem_id":"p04015","slow_code_id":"22f4d78fa24186375c05f8fb9209c535a507fc44a1c54caed7cae5ab1b3bfa98","slow_id":"p04015_8b45717994a5fb48dc2b76199b10d5e4e202c9ce5463bf7869f8add9172f6ff7","speedup":542.445820537141,"stratum":"8+","sampling_key":"1755415bc8b1a26d242e218073288de8df1b9fb73e7db6d0fc43e55519780ae9","slow_code":"from collections import defaultdict, deque, Counter, OrderedDict\nfrom bisect import bisect_left, bisect_right\nfrom functools import reduce, lru_cache\nfrom heapq import heappush, heappop, heapify\nimport itertools\nimport math, fractions\nimport sys, copy\n\n\ndef L():\n return sys.stdin.readline().split()\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\ndef SL():\n return list(sys.stdin.readline().rstrip())\n\n\ndef LI():\n return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef LI1():\n return [int(x) - 1 for x in sys.stdin.readline().split()]\n\n\ndef LS():\n return [list(x) for x in sys.stdin.readline().split()]\n\n\ndef R(n):\n return [sys.stdin.readline().strip() for _ in range(n)]\n\n\ndef LR(n):\n return [L() for _ in range(n)]\n\n\ndef IR(n):\n return [I() for _ in range(n)]\n\n\ndef LIR(n):\n return [LI() for _ in range(n)]\n\n\ndef LIR1(n):\n return [LI1() for _ in range(n)]\n\n\ndef SLR(n):\n return [SL() for _ in range(n)]\n\n\ndef LSR(n):\n return [LS() for _ in range(n)]\n\n\ndef perm(n, r):\n return math.factorial(n) // math.factorial(r)\n\n\ndef comb(n, r):\n return math.factorial(n) // (math.factorial(r) * math.factorial(n - r))\n\n\ndef make_list(n, *args, default=0):\n return (\n [make_list(*args, default=default) for _ in range(n)]\n if args\n else [default for _ in range(n)]\n )\n\n\ndire = [[1, 0], [0, 1], [-1, 0], [0, -1]]\ndire8 = [[1, 0], [1, 1], [0, 1], [-1, 1], [-1, 0], [-1, -1], [0, -1], [1, -1]]\nalphabets = \"abcdefghijklmnopqrstuvwxyz\"\nALPHABETS = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\nMOD = 1000000007\nINF = float(\"inf\")\nsys.setrecursionlimit(1000000)\n\n\ndef main():\n N, A = LI()\n X = LI()\n dp = make_list(N + 1, N + 1, 2501)\n dp[0][0][0] = 1\n for i in range(1, N + 1):\n for k in range(i + 1):\n for s in range(2501):\n if X[i - 1] > s:\n dp[i][k][s] = dp[i - 1][k][s]\n else:\n dp[i][k][s] = dp[i - 1][k][s] + dp[i - 1][k - 1][s - X[i - 1]]\n print((sum(dp[N][k][k * A] for k in range(1, N + 1))))\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"n, a = list(map(int, input().split()))\nfrom collections import defaultdict\n\ndp = defaultdict(int)\ndp[0] = 1\nfor i in map(int, input().split()):\n i -= a\n for k in sorted(list(dp.keys()), reverse=(i >= 0)):\n dp[k + i] += dp[k]\nprint((dp[0] - 1))\n"} +{"fast_code_id":"931290005b6494488a3db3167dc8d901b0ed6aa8ebc2799fa65710fb0cd2a9d5","fast_id":"p02554_931290005b6494488a3db3167dc8d901b0ed6aa8ebc2799fa65710fb0cd2a9d5","language":"python","measured_fast_code_id":"931290005b6494488a3db3167dc8d901b0ed6aa8ebc2799fa65710fb0cd2a9d5","measured_slow_code_id":"1216aa013ca95268c8cea10ef1956fc82ecf53c33048dc021f31f4ae82487ba4","measurement_metric":"cpu_instruction_count","pair_id":"python_f2e8406443ed6507351b0112","problem_id":"p02554","slow_code_id":"d34cbcef17a1809eb9aaea9acac748f4f348edb348ac1a61f3b30198ffe07352","slow_id":"p02554_1216aa013ca95268c8cea10ef1956fc82ecf53c33048dc021f31f4ae82487ba4","speedup":1796.8443395117338,"stratum":"8+","sampling_key":"741ad79d332dd0a48951a0dd646c4f212ccce500a0983794b448432ed82d14d4","slow_code":"MOD = 10**9 + 7\n\n\ndef solve(n):\n dp = [[0] * 4 for i in range(n + 1)]\n dp[0][0] = 1\n for i in range(n):\n dp[i + 1][3] = (10 * dp[i][3] + dp[i][2] + dp[i][1]) % MOD\n dp[i + 1][2] = (9 * dp[i][2] + dp[i][0]) % MOD\n dp[i + 1][1] = (9 * dp[i][1] + dp[i][0]) % MOD\n dp[i + 1][0] = (8 * dp[i][0]) % MOD\n return dp[n][3]\n\n\nn = int(eval(input()))\nprint((solve(n)))\n","fast_code":"N = int(eval(input()))\nMOD = 10**9 + 7\nval1 = pow(9, N, MOD)\nval2 = pow(8, N, MOD)\nans = pow(10, N, MOD) - 2 * val1 + val2\nprint((ans % MOD))\n"} +{"fast_code_id":"6b0ce86bdfa788463f730472f9e926f7c1cb2e281bda7dfc76645e3f89072d4f","fast_id":"p03575_6b0ce86bdfa788463f730472f9e926f7c1cb2e281bda7dfc76645e3f89072d4f","language":"python","measured_fast_code_id":"6b0ce86bdfa788463f730472f9e926f7c1cb2e281bda7dfc76645e3f89072d4f","measured_slow_code_id":"3b0c75c5164a810f84adc515ed302d05d4140b865ec422b1df702b4974d0a4da","measurement_metric":"cpu_instruction_count","pair_id":"python_f2e9ab48d1c8d2a27f024ccb","problem_id":"p03575","slow_code_id":"3b0c75c5164a810f84adc515ed302d05d4140b865ec422b1df702b4974d0a4da","slow_id":"p03575_3b0c75c5164a810f84adc515ed302d05d4140b865ec422b1df702b4974d0a4da","speedup":5.786723190932959,"stratum":"4-8","sampling_key":"6a77fd9499267aa8b05feb9da5f0a563a2c56aa0dc727ad4e0977f3866932337","slow_code":"import sys, re, os\nfrom collections import deque, defaultdict, Counter\nfrom math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians\nfrom itertools import permutations, combinations, product, accumulate\nfrom operator import itemgetter, mul\nfrom copy import deepcopy\nfrom string import ascii_lowercase, ascii_uppercase, digits\nfrom heapq import heapify, heappop, heappush\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef INT():\n return int(eval(input()))\n\n\ndef MAP():\n return list(map(int, input().split()))\n\n\ndef S_MAP():\n return list(map(str, input().split()))\n\n\ndef LIST():\n return list(map(int, input().split()))\n\n\ndef S_LIST():\n return list(map(str, input().split()))\n\n\nsys.setrecursionlimit(10**9)\nINF = float(\"inf\")\nmod = 10**9 + 7\n\n\ndef dijkstra(E, start):\n N_d = len(E)\n dist = [INF] * N_d\n dist[start] = 0\n q = [(0, start)]\n while q:\n dist_v, v = heappop(q)\n if dist[v] != dist_v:\n continue\n for u, dist_vu in E[v]:\n dist_u = dist_v + dist_vu\n if dist_u < dist[u]:\n dist[u] = dist_u\n heappush(q, (dist_u, u))\n return dist\n\n\nN, M = MAP()\nL = [LIST() for i in range(M)]\ngraph = defaultdict(list)\nfor a, b in L:\n graph[a - 1].append((b - 1, 1))\n graph[b - 1].append((a - 1, 1))\nans = 0\nfor i in range(M):\n a, b = L[i]\n E = deepcopy(graph)\n E[a - 1].remove((b - 1, 1))\n E[b - 1].remove((a - 1, 1))\n dist = dijkstra(E, 0)\n if dist.count(INF) > 0:\n ans += 1\nprint(ans)\n","fast_code":"N, M = list(map(int, input().split()))\nT = [[0] * N for i in range(N)]\nG = []\nfor i in range(M):\n a, b = [int(x) - 1 for x in input().split()]\n T[a][b] = 1\n T[b][a] = 1\n G.append((a, b))\n\n\ndef check(N, T):\n A = [0] * N\n Q = [0]\n while Q:\n q = Q.pop()\n if A[q]:\n continue\n A[q] = 1\n for c in range(N):\n if T[q][c]:\n Q.append(c)\n return sum(A) != N\n\n\nans = 0\nfor g in G:\n a, b = g[0], g[1]\n T[a][b] = 0\n T[b][a] = 0\n if check(N, T):\n ans += 1\n T[a][b] = 1\n T[b][a] = 1\nprint(ans)\n"} +{"fast_code_id":"79d76486ece4f50772da0d9a89fbe669efadf0b124bf413abdba07a9bf1df588","fast_id":"p03775_79d76486ece4f50772da0d9a89fbe669efadf0b124bf413abdba07a9bf1df588","language":"python","measured_fast_code_id":"79d76486ece4f50772da0d9a89fbe669efadf0b124bf413abdba07a9bf1df588","measured_slow_code_id":"7ab001f5efb675596da434bf3ef9e7fa9f9ec3b0d345cb8726f7720241f1422c","measurement_metric":"cpu_instruction_count","pair_id":"python_f2fe7b6ebf83ab860755649d","problem_id":"p03775","slow_code_id":"0bd50a29ee4b8ed24f88df4bdfcabb76a7a6778570de4e74b5c8ddab42febd8f","slow_id":"p03775_7ab001f5efb675596da434bf3ef9e7fa9f9ec3b0d345cb8726f7720241f1422c","speedup":239.312051871023,"stratum":"8+","sampling_key":"415a3b4a515bc783d6a7be4b17dd64d85f9b192aaf2f890e670ad3282e9738dc","slow_code":"n = int(eval(input()))\n\n\ndef cal(a):\n return len(str(a))\n\n\nm = 11\nfor j in range(1, 10**6 + 1):\n if n % j == 0:\n m = min(m, max(cal(j), cal(n // j)))\n\nprint(m)\n","fast_code":"import sys\n\nn = int(sys.stdin.readline().rstrip())\n\n\ndef main():\n a = 1\n for i in range(1, int(n**0.5) + 1):\n if n % i == 0:\n a = i\n b = n // a\n ans = len(str(b))\n return ans\n\n\nif __name__ == \"__main__\":\n ans = main()\n print(ans)\n"} +{"fast_code_id":"d33570e2da12b774b6caf453907832c74235abae6b8cfc32042793a5f588b7af","fast_id":"p03456_d33570e2da12b774b6caf453907832c74235abae6b8cfc32042793a5f588b7af","language":"python","measured_fast_code_id":"d33570e2da12b774b6caf453907832c74235abae6b8cfc32042793a5f588b7af","measured_slow_code_id":"7917ed4392d2155273da648b2693fb0163544534d06b0c3c68db07d4c4827be4","measurement_metric":"cpu_instruction_count","pair_id":"python_f3bc93a6d7e1e4933aabe629","problem_id":"p03456","slow_code_id":"7917ed4392d2155273da648b2693fb0163544534d06b0c3c68db07d4c4827be4","slow_id":"p03456_7917ed4392d2155273da648b2693fb0163544534d06b0c3c68db07d4c4827be4","speedup":232.60246923832312,"stratum":"8+","sampling_key":"1f628ecd50b8f9d9a87948e7f12d7c6cad3ecc45edbc1e7fc0a04559208006d8","slow_code":"import numpy as np\n\na = int(input().replace(\" \", \"\"))\nb = np.sqrt(a)\nc = b - int(b)\nif c == 0.0:\n print(\"Yes\")\nelse:\n print(\"No\")\n","fast_code":"a, b = list(map(str, input().split()))\nx = int(a + b)\nans = \"No\"\nfor i in range(x // 2):\n if x == i * i:\n ans = \"Yes\"\nprint(ans)\n"} +{"fast_code_id":"cec14fadeb960da889ac6d8504f301209ff7dd15e0a289e10950ca76f7801062","fast_id":"p02994_cec14fadeb960da889ac6d8504f301209ff7dd15e0a289e10950ca76f7801062","language":"python","measured_fast_code_id":"cec14fadeb960da889ac6d8504f301209ff7dd15e0a289e10950ca76f7801062","measured_slow_code_id":"b033c38ec6619d100b0693f703ee7559d8c7c976d73cee1d8a552d7f88a6875e","measurement_metric":"cpu_instruction_count","pair_id":"python_f3f3901f991886379f8c31e3","problem_id":"p02994","slow_code_id":"b033c38ec6619d100b0693f703ee7559d8c7c976d73cee1d8a552d7f88a6875e","slow_id":"p02994_b033c38ec6619d100b0693f703ee7559d8c7c976d73cee1d8a552d7f88a6875e","speedup":36.191947680772586,"stratum":"8+","sampling_key":"1612c8c25295bfd10c1bc6005f0b9a47897deb67a4445ac720beffcc33ccc572","slow_code":"import copy\n\nN, L = list(map(int, input().split()))\nflaver = []\nfor i in range(1, N + 1):\n flaver.append(L + i - 1)\nflaver_sum = sum(flaver)\nfor i in range(len(flaver)):\n c_flaver = copy.deepcopy(flaver)\n del c_flaver[i]\n if i == 0:\n tmp_min = abs(flaver_sum - sum(c_flaver))\n index = i\n if abs(flaver_sum - sum(c_flaver)) < tmp_min:\n tmp_min = abs(flaver_sum - sum(c_flaver))\n index = i\ndel flaver[index]\nprint((sum(flaver)))\n","fast_code":"n, l = list(map(int, input().split()))\npi = 0\na = []\nabs_a = []\nfor i in range(1, n + 1):\n pi += l + i - 1\nfor i in range(1, n + 1):\n a.append(l + i - 1)\nfor i in range(n):\n abs_a.append(abs(a[i]))\nif max(a) < 0:\n p = pi + min(abs_a)\nelse:\n p = pi - min(abs_a)\nprint(p)\n"} +{"fast_code_id":"f8ac70fb77cb19e9c435438282a67ef9e761514625c99bc623d3943fb1a6f9a1","fast_id":"p03502_f8ac70fb77cb19e9c435438282a67ef9e761514625c99bc623d3943fb1a6f9a1","language":"python","measured_fast_code_id":"f8ac70fb77cb19e9c435438282a67ef9e761514625c99bc623d3943fb1a6f9a1","measured_slow_code_id":"9657e24fd296bdb183cb812efcaa41e0e4d09edff18e911040359edf4aba2689","measurement_metric":"cpu_instruction_count","pair_id":"python_f4316c9ec7c007613115bc4a","problem_id":"p03502","slow_code_id":"04afcb0636d6758b9c1fd4024fff2537c6c73d327a7f8a692ef75cf80e1d3933","slow_id":"p03502_9657e24fd296bdb183cb812efcaa41e0e4d09edff18e911040359edf4aba2689","speedup":47.08710596060574,"stratum":"8+","sampling_key":"5838ae1583abda1ce3baeae9052519b4da6df97cab8fc1d89f032bead415ceca","slow_code":"import sys\nimport math\nimport collections\nimport itertools\nimport array\nimport inspect\n\n\nsys.setrecursionlimit(10000)\n\n\ndef chkprint(*args):\n names = {id(v): k for k, v in list(inspect.currentframe().f_back.f_locals.items())}\n print((\", \".join(names.get(id(arg), \"???\") + \" = \" + repr(arg) for arg in args)))\n\n\ndef to_bin(x):\n return bin(x)[2:]\n\n\ndef li_input():\n return [int(_) for _ in input().split()]\n\n\ndp = None\n\n\ndef main():\n X = int(eval(input()))\n if X % sum(list(map(int, list(str(X))))) == 0:\n print(\"Yes\")\n else:\n print(\"No\")\n\n\nmain()\n","fast_code":"n = int(eval(input()))\n\n\ndef ds(n):\n return sum(map(int, str(n)))\n\n\nprint((\"Yes\" if n % ds(n) == 0 else \"No\"))\n"} +{"fast_code_id":"718b7fbc5916e8c37fb962c5d0d6deea14378a66e56aaa1f6d269928cd50a0cf","fast_id":"p02994_718b7fbc5916e8c37fb962c5d0d6deea14378a66e56aaa1f6d269928cd50a0cf","language":"python","measured_fast_code_id":"718b7fbc5916e8c37fb962c5d0d6deea14378a66e56aaa1f6d269928cd50a0cf","measured_slow_code_id":"d149410d46bed6b8690e0200021300cc5187b2715c0717e93e6c392866beb39e","measurement_metric":"cpu_instruction_count","pair_id":"python_f4668a5363bd963093a68980","problem_id":"p02994","slow_code_id":"d149410d46bed6b8690e0200021300cc5187b2715c0717e93e6c392866beb39e","slow_id":"p02994_d149410d46bed6b8690e0200021300cc5187b2715c0717e93e6c392866beb39e","speedup":36.1221371751948,"stratum":"8+","sampling_key":"57af594babef23090803cf13076a42a1607522aa35510ea7496610eb6914b4bb","slow_code":"import copy\n\nN, L = list(map(int, input().split()))\napple_taste = [L + i for i in range(N)]\npie_taste = sum(apple_taste)\nmin_diff = 100000\nfor i in range(N):\n ap = copy.deepcopy(apple_taste)\n ap[i] = 0\n pie_taste2 = sum(ap)\n diff = abs(pie_taste - pie_taste2)\n if diff < min_diff:\n min_diff = diff\n min_index = i\napple_taste[min_index] = 0\nprint((sum(apple_taste)))\n","fast_code":"n, l = list(map(int, input().split()))\napple = []\nfor i in range(n):\n apple.append(l + i)\nmin_num = 10**5\nsum_num = sum(apple)\nfor i in range(n):\n tmp = abs(sum_num - (sum_num - apple[i]))\n if tmp < min_num:\n min_num = min(tmp, min_num)\n flag = apple[i]\nif flag >= 0:\n print((sum(apple) - min_num))\nelse:\n print((sum(apple) + min_num))\n"} +{"fast_code_id":"48ff09bc20e8f8798770efd549a5ac6494d01b7553d3e063e63a4ebd4e5dd723","fast_id":"p03173_48ff09bc20e8f8798770efd549a5ac6494d01b7553d3e063e63a4ebd4e5dd723","language":"python","measured_fast_code_id":"48ff09bc20e8f8798770efd549a5ac6494d01b7553d3e063e63a4ebd4e5dd723","measured_slow_code_id":"c255c26162db7be87fcb99a8e38eebab71be1bb028e9bf3b89e968fa40bae364","measurement_metric":"cpu_instruction_count","pair_id":"python_f4d47269efa3f8601fe67346","problem_id":"p03173","slow_code_id":"b0014f456b10184da17fe5e7ffee658b30463d99f0f01edb81ca15194ffc08ae","slow_id":"p03173_c255c26162db7be87fcb99a8e38eebab71be1bb028e9bf3b89e968fa40bae364","speedup":20.500120309068045,"stratum":"8+","sampling_key":"ce3bc4285aba8a491b3b10b691dde6ce717f1ae14b91bef96b5ef24b7d747f36","slow_code":"import sys\n\ninput = sys.stdin.readline\nsys.setrecursionlimit(10**7)\nimport numpy as np\n\nN = int(eval(input()))\nA = np.array(input().split(), np.int64)\n\nAcum = np.zeros((N, N + 1), dtype=np.int64)\nfor L in range(N):\n Acum[L, L + 1 :] = A[L:].cumsum()\ndp = np.zeros((N, N + 1), dtype=np.int64)\nfor size in range(2, N + 1):\n for L in range(N - size + 1):\n R = L + size\n dp[L, R] = (dp[L, L + 1 : R] + dp[L + 1 : R, R]).min() + Acum[L, R]\nanswer = dp[0, N]\nprint(answer)\n","fast_code":"def resolve():\n N = int(eval(input()))\n a = list(map(int, input().split()))\n DP = [[2**63 - 1 for _ in range(N + 1)] for _ in range(N)]\n SUM = [[0 for _ in range(N + 1)] for _ in range(N + 1)]\n RANGE = [[0 for _ in range(N + 1)] for _ in range(N + 1)]\n SUM[0][0] = 0\n for i in range(N):\n for j in range(i, N):\n SUM[i][j + 1] = SUM[i][j] + a[j]\n if i < j:\n SUM[i + 1][j] = SUM[i][j] - a[i]\n for i in range(N):\n j = i + 1\n DP[i][j] = 0\n RANGE[i][j] = i\n for w in range(2, N + 1):\n for i in range(N + 1 - w):\n j = i + w\n for k in range(RANGE[i][j - 1], RANGE[i + 1][j] + 1):\n s = DP[i][k] + DP[k][j] + SUM[i][j]\n if DP[i][j] > s:\n DP[i][j] = s\n RANGE[i][j] = k\n print((DP[0][N]))\n\n\nresolve()\n"} +{"fast_code_id":"35a33dad8f5be8890baa9526d964785e035e1a32a1d1dfea596700d61ebeae76","fast_id":"p03371_35a33dad8f5be8890baa9526d964785e035e1a32a1d1dfea596700d61ebeae76","language":"python","measured_fast_code_id":"35a33dad8f5be8890baa9526d964785e035e1a32a1d1dfea596700d61ebeae76","measured_slow_code_id":"d423368c3404af0d794647ac92b41960ae5bb9ea8edef19ff71fb40275e2bb52","measurement_metric":"cpu_instruction_count","pair_id":"python_f5f07a17333193d2ce31f610","problem_id":"p03371","slow_code_id":"d423368c3404af0d794647ac92b41960ae5bb9ea8edef19ff71fb40275e2bb52","slow_id":"p03371_d423368c3404af0d794647ac92b41960ae5bb9ea8edef19ff71fb40275e2bb52","speedup":9922.722516007161,"stratum":"8+","sampling_key":"5aa3e2fd3bf8c117c7e1e98286d9e0d360136e28a66c97440885b5baf418cb47","slow_code":"a, b, c, x, y = list(map(int, input().split()))\nmi = 10**10\nfor i in range(10**6):\n cost = c * 2 * i + a * max((x - i), 0) + b * max((y - i), 0)\n if cost < mi:\n mi = cost\nprint(mi)\n","fast_code":"a, b, c, x, y = list(map(int, input().split()))\nans = 0\nif a + b > c * 2:\n z = min(x, y)\n ans += z * c * 2\n x -= z\n y -= z\nif a > c * 2:\n ans += x * c * 2\n y = max(0, y - x)\n x = 0\nif b > c * 2:\n ans += y * c * 2\n x = max(0, x - y)\n y = 0\nans += a * x\nans += b * y\nprint(ans)\n"} +{"fast_code_id":"6d98fb7a581d9ec172cb808be4fb74123b45642ba14ca47f8b5e8a1727073d4d","fast_id":"p03803_60a32b9f1c436de1ae00e0d41718126a4c2f969ad54056fca190134188e691f3","language":"python","measured_fast_code_id":"60a32b9f1c436de1ae00e0d41718126a4c2f969ad54056fca190134188e691f3","measured_slow_code_id":"0bd5df2a157ba82c7c25ec618ddd2b8ac3a7b93747b5c4b4114a2cd42e8e257e","measurement_metric":"cpu_instruction_count","pair_id":"python_f663fc7926dcad3d3b843320","problem_id":"p03803","slow_code_id":"0bd5df2a157ba82c7c25ec618ddd2b8ac3a7b93747b5c4b4114a2cd42e8e257e","slow_id":"p03803_0bd5df2a157ba82c7c25ec618ddd2b8ac3a7b93747b5c4b4114a2cd42e8e257e","speedup":3.1385109948363903,"stratum":"2-4","sampling_key":"51d406b3c3948738cae577db2ff079dc05ba9c7f4e9d92f5c321d6fa7f9df0f9","slow_code":"import sys, math\nfrom functools import lru_cache\nfrom itertools import accumulate\n\nsys.setrecursionlimit(10**9)\nMOD = 10**9 + 7\n\n\ndef input():\n return sys.stdin.readline()[:-1]\n\n\ndef mi():\n return list(map(int, input().split()))\n\n\ndef ii():\n return int(eval(input()))\n\n\ndef i2(n):\n tmp = [list(mi()) for i in range(n)]\n return [list(i) for i in zip(*tmp)]\n\n\nA, B = mi()\nif A == B:\n print(\"Draw\")\nelif A == 1:\n print(\"Alice\")\nelif B == 1:\n print(\"Bob\")\nelse:\n if A > B:\n print(\"Alice\")\n else:\n print(\"Bob\")\n","fast_code":"A, B = list(map(int, input().split()))\n\nif A == B:\n print(\"Draw\")\n\nelif A == 1 or B != 1 and A > B:\n print(\"Alice\")\n\nelse:\n print(\"Bob\")\n"} +{"fast_code_id":"4ecb8d0fe079a56634e90fa4f0ff290ca63fe7d8739794251436a0b6966bd79b","fast_id":"p02883_4ecb8d0fe079a56634e90fa4f0ff290ca63fe7d8739794251436a0b6966bd79b","language":"python","measured_fast_code_id":"4ecb8d0fe079a56634e90fa4f0ff290ca63fe7d8739794251436a0b6966bd79b","measured_slow_code_id":"89d6694c33292de91a1011c40ba1f43b8a55e43ab7d13d625a0ff741f7a3effc","measurement_metric":"cpu_instruction_count","pair_id":"python_f673d5538c98e9ca32c1c9f2","problem_id":"p02883","slow_code_id":"89d6694c33292de91a1011c40ba1f43b8a55e43ab7d13d625a0ff741f7a3effc","slow_id":"p02883_89d6694c33292de91a1011c40ba1f43b8a55e43ab7d13d625a0ff741f7a3effc","speedup":4.252102381970589,"stratum":"4-8","sampling_key":"0a550c85b4a385329678cd56fb6db9e9e88423424befde657c3461bec9ab3f22","slow_code":"import math\n\nN, K = list(map(int, input().split()))\nX = [\n (b, a * b)\n for a, b in zip(\n sorted(list(map(int, input().split()))),\n sorted(list(map(int, input().split())))[::-1],\n )\n]\nm, M, i = 0, 10**12, 1\nexec(\n \"i,M,m=((i+m)//2,i,m) if sum(math.ceil(max(0,c-i)/b)for b, c in X)<=K else((i+M)//2,M,i);\"\n * 50\n)\nprint(M)\n","fast_code":"import sys\n\nsys.setrecursionlimit(10**7)\n\n\ndef main():\n n, k = list(map(int, input().split()))\n a = list(map(int, input().split()))\n f = list(map(int, input().split()))\n a.sort()\n f.sort(reverse=True)\n l = -1\n r = 10**13\n\n def test(x):\n cnt = 0\n for ae, fe in zip(a, f):\n cnt += max(0, ae - x // fe)\n return cnt <= k\n\n while l + 1 < r:\n m = (l + r) // 2\n if test(m):\n r = m\n else:\n l = m\n ans = r\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"d6bd4f9fde0638feb3929a007d29acb633d9ad11ec4ca371f0db57db447c69bf","fast_id":"p02641_d6bd4f9fde0638feb3929a007d29acb633d9ad11ec4ca371f0db57db447c69bf","language":"python","measured_fast_code_id":"d6bd4f9fde0638feb3929a007d29acb633d9ad11ec4ca371f0db57db447c69bf","measured_slow_code_id":"56a803f01b0149391407a67301955076fc165a7ad3ad3f8f8a9f51ab5d8af60e","measurement_metric":"cpu_instruction_count","pair_id":"python_f6819ca1416ef73c043e27d0","problem_id":"p02641","slow_code_id":"85cbb5049fb6ba315c1cc49d08aa7371cf037161b52bac8a421580f3486b7f72","slow_id":"p02641_56a803f01b0149391407a67301955076fc165a7ad3ad3f8f8a9f51ab5d8af60e","speedup":2.397854756583817,"stratum":"2-4","sampling_key":"a80a2983b787b550239aa5cfc07c6103e7351fe6f4a02916cbcd8b2a96d00266","slow_code":"x, n = list(map(int, input().split()))\nif n == 0:\n print(x)\n exit()\narr = list(map(int, input().split()))\narr2 = []\narr3 = []\nfor i in range(-50, 110):\n if not i in arr:\n arr2.append(i)\n arr3.append(abs(x - i))\nn2 = min([i for i, v in enumerate(arr3) if v == min(arr3)])\nprint((arr2[n2]))\n","fast_code":"import sys\n\nX, N = list(map(int, input().split()))\nif N == 0:\n print(X)\n sys.exit()\np = list(map(int, input().split()))\nforbid = [True] * 102\nfor i in range(len(p)):\n if forbid[p[i]]:\n forbid[p[i]] = False\npp = []\nfor i in range(len(forbid)):\n if forbid[i]:\n pp.append(i - X)\nnum = pp[len(pp) - 1]\nfor i in range(len(pp) - 1, -1, -1):\n if abs(num) >= abs(pp[i]):\n num = pp[i]\nprint((num + X))\n"} +{"fast_code_id":"44ab35a9714ea188a11aedb20f3ea7103bd930af4ad186337881b8ed88a0b55b","fast_id":"p02406_44ab35a9714ea188a11aedb20f3ea7103bd930af4ad186337881b8ed88a0b55b","language":"python","measured_fast_code_id":"44ab35a9714ea188a11aedb20f3ea7103bd930af4ad186337881b8ed88a0b55b","measured_slow_code_id":"fd343debd525e0327e380afaeaedff81a92351905528d5f013d2dcc0e4ab0798","measurement_metric":"cpu_instruction_count","pair_id":"python_f697da973fb1aab53c09d950","problem_id":"p02406","slow_code_id":"fd343debd525e0327e380afaeaedff81a92351905528d5f013d2dcc0e4ab0798","slow_id":"p02406_fd343debd525e0327e380afaeaedff81a92351905528d5f013d2dcc0e4ab0798","speedup":2.1824637138348453,"stratum":"2-4","sampling_key":"2c6e95c6f7d9b14d460284c4ecd303034198474268551f5d2b35411bd15c2ffb","slow_code":"array = []\nfor i in range(3, int(input()) + 1):\n if i % 3 == 0 or i % 10 == 3 or \"3\" in str(i):\n array.append(i)\nfor i in array:\n print(\"\", \"{0}\".format(i), end=\"\")\nprint()\n","fast_code":"print(\n \"\".join(\n \" \" + str(i) for i in range(1, eval(input()) + 1) if i % 3 == 0 or \"3\" in str(i)\n )\n)\n"} +{"fast_code_id":"410642ef7e1a2dd48a9843ed5e1a9b68d0a1e61878a3f3464b7a63a9e7d8384e","fast_id":"p02971_410642ef7e1a2dd48a9843ed5e1a9b68d0a1e61878a3f3464b7a63a9e7d8384e","language":"python","measured_fast_code_id":"410642ef7e1a2dd48a9843ed5e1a9b68d0a1e61878a3f3464b7a63a9e7d8384e","measured_slow_code_id":"c4ac5217179dc45950367c7eede5b37a5e88ab5e6987931ac99876dde4ea6d9c","measurement_metric":"cpu_instruction_count","pair_id":"python_f6a89b36265e2e7e121914f4","problem_id":"p02971","slow_code_id":"c4ac5217179dc45950367c7eede5b37a5e88ab5e6987931ac99876dde4ea6d9c","slow_id":"p02971_c4ac5217179dc45950367c7eede5b37a5e88ab5e6987931ac99876dde4ea6d9c","speedup":2.862939741775809,"stratum":"2-4","sampling_key":"e4347206868490636cfb413cad9007d4114514f13da88b87546c5e3c0558ae68","slow_code":"n = int(eval(input()))\na = []\nfor i in range(n):\n a.append(int(eval(input())))\nb = sorted(a)\nm, M = b[-2:]\nfor i in range(n):\n print((m if a[i] == M else M))\n","fast_code":"from sys import stdin\n\nn = int(stdin.readline().rstrip())\nli = list(int(stdin.readline().rstrip()) for _ in range(n))\nli_to = sorted(li)\none = li_to[-1]\ntwo = li_to[-2]\nfor i in range(n):\n if one == li[i]:\n print(two)\n else:\n print(one)\n"} +{"fast_code_id":"78e07429bd6b18a24bb9452bffb214fae3238ca75d7395c732e7197d41429249","fast_id":"p02883_78e07429bd6b18a24bb9452bffb214fae3238ca75d7395c732e7197d41429249","language":"python","measured_fast_code_id":"78e07429bd6b18a24bb9452bffb214fae3238ca75d7395c732e7197d41429249","measured_slow_code_id":"4f4a13e5333f347bf2d2991652e312f399d355fb41776c7913ab6a96ff5161f3","measurement_metric":"cpu_instruction_count","pair_id":"python_f74a6c4931783bd51046f77c","problem_id":"p02883","slow_code_id":"3224e00a1ef11e1951254ca5848501fa156f61f500db82b6b9576730d7e3e2af","slow_id":"p02883_4f4a13e5333f347bf2d2991652e312f399d355fb41776c7913ab6a96ff5161f3","speedup":3.1866830643098107,"stratum":"2-4","sampling_key":"53010f5d046845816ca1b7093f73b6cc3ac0c5759dec6e44703df3c192ffed0d","slow_code":"import sys\n\n\ndef input():\n return sys.stdin.readline().strip()\n\n\ndef list2d(a, b, c):\n return [[c] * b for i in range(a)]\n\n\ndef list3d(a, b, c, d):\n return [[[d] * c for j in range(b)] for i in range(a)]\n\n\ndef list4d(a, b, c, d, e):\n return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]\n\n\ndef ceil(x, y=1):\n return int(-(-x // y))\n\n\ndef INT():\n return int(eval(input()))\n\n\ndef MAP():\n return list(map(int, input().split()))\n\n\ndef LIST(N=None):\n return list(MAP()) if N is None else [INT() for i in range(N)]\n\n\ndef Yes():\n print(\"Yes\")\n\n\ndef No():\n print(\"No\")\n\n\ndef YES():\n print(\"YES\")\n\n\ndef NO():\n print(\"NO\")\n\n\nsys.setrecursionlimit(10**7)\nINF = 10**18\nMOD = 10**9 + 7\n\n\ndef bisearch_min(mn, mx, func):\n ok = mx\n ng = mn\n while ng + 1 < ok:\n mid = (ok + ng) // 2\n if func(mid):\n\n ok = mid\n else:\n\n ng = mid\n return ok\n\n\nN, K = MAP()\nA = LIST()\nB = LIST()\nA.sort(reverse=True)\nB.sort()\n\n\ndef check(m):\n k = 0\n for i, a in enumerate(A):\n b = B[i]\n k += max(ceil(a - m / b), 0)\n if k > K:\n return False\n return True\n\n\nprint((bisearch_min(-1, 10**12, check)))\n","fast_code":"import sys\n\nread = sys.stdin.read\nreadline = sys.stdin.readline\nreadlines = sys.stdin.readlines\nsys.setrecursionlimit(10**9)\nINF = 1 << 60\nMOD = 1000000007\n\n\ndef main():\n N, K, *AF = list(map(int, read().split()))\n A = AF[:N]\n F = AF[N:]\n A.sort()\n F.sort(reverse=True)\n C = [a * f for a, f in zip(A, F)]\n\n def is_ok(cost):\n k = 0\n for c, f in zip(C, F):\n if c > cost:\n k += (c - cost + f - 1) // f\n return k <= K\n\n ok = max(C)\n ng = -1\n while ok - ng > 1:\n mid = (ok + ng) // 2\n if is_ok(mid):\n ok = mid\n else:\n ng = mid\n print(ok)\n return\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"fc5cece971c7f110c9fde09096bfcd4145848aff8a71c1ff5b48404aade567d2","fast_id":"p03419_fc5cece971c7f110c9fde09096bfcd4145848aff8a71c1ff5b48404aade567d2","language":"python","measured_fast_code_id":"fc5cece971c7f110c9fde09096bfcd4145848aff8a71c1ff5b48404aade567d2","measured_slow_code_id":"03759bbd848f3c06ca221a2e3cc07d0592161ce2c92214006d02107382720a3e","measurement_metric":"cpu_instruction_count","pair_id":"python_f7cfbe29dfce6edad61e95e8","problem_id":"p03419","slow_code_id":"03759bbd848f3c06ca221a2e3cc07d0592161ce2c92214006d02107382720a3e","slow_id":"p03419_03759bbd848f3c06ca221a2e3cc07d0592161ce2c92214006d02107382720a3e","speedup":4.630424162400763,"stratum":"4-8","sampling_key":"f77dc12a2d99b450fa61999a14eba05dfeec2a39c41afedcc6023791eec977d5","slow_code":"def calc0(N, M):\n cell = [[0 for i in range(M)] for j in range(N)]\n for i in range(M):\n for j in range(N):\n for y in range(-1, 2):\n for x in range(-1, 2):\n xx = i + x\n yy = j + y\n if 0 <= xx < M and 0 <= yy < N:\n cell[yy][xx] ^= 1\n r = 0\n for i in range(M):\n for j in range(N):\n if cell[j][i]:\n r += 1\n return r\n\n\ndef calc(N, M):\n if N == 1 and M == 1:\n return 1\n if N >= 2 and M >= 2:\n return (N - 2) * (M - 2)\n if N == 1:\n return M - 2\n return N - 2\n\n\nN, M = [int(_) for _ in input().split()]\nprint((calc(N, M)))\n","fast_code":"n, m = list(map(int, input().split()))\nif 2 <= n:\n n -= 2\nif 2 <= m:\n m -= 2\nprint((n * m))\n"} +{"fast_code_id":"98847d3ae7e1c9ecfbdc0868a01128cbdaa73b8b461dbf962f08e5677bce8643","fast_id":"p03035_98847d3ae7e1c9ecfbdc0868a01128cbdaa73b8b461dbf962f08e5677bce8643","language":"python","measured_fast_code_id":"98847d3ae7e1c9ecfbdc0868a01128cbdaa73b8b461dbf962f08e5677bce8643","measured_slow_code_id":"a03feaf840d71ae8aa582d21d70bb7cc8063992d1b30834ae4cabc43c65fc6f6","measurement_metric":"cpu_instruction_count","pair_id":"python_f7e54e5be4c8f92e64a451fb","problem_id":"p03035","slow_code_id":"a03feaf840d71ae8aa582d21d70bb7cc8063992d1b30834ae4cabc43c65fc6f6","slow_id":"p03035_a03feaf840d71ae8aa582d21d70bb7cc8063992d1b30834ae4cabc43c65fc6f6","speedup":3.6211734902736774,"stratum":"2-4","sampling_key":"83306624e80249f87b585e15b8a877b16c5e29c02483af1e77c314dbd301e70a","slow_code":"import sys, math, collections, heapq, itertools\n\nF = sys.stdin\n\n\ndef single_input():\n return F.readline().strip(\"\\n\")\n\n\ndef line_input():\n return F.readline().strip(\"\\n\").split()\n\n\ndef gcd(a, b):\n a, b = max(a, b), min(a, b)\n while a % b > 0:\n a, b = b, a % b\n return b\n\n\ndef solve():\n A, B = list(map(int, line_input()))\n if A >= 13:\n print(B)\n elif A >= 6:\n print((B // 2))\n else:\n print((0))\n return 0\n\n\nif __name__ == \"__main__\":\n solve()\n","fast_code":"a, b = list(map(int, input().split()))\nprint((0 if a <= 5 else b if a >= 13 else b // 2))\n"} +{"fast_code_id":"fd949ab1cd967cee7273469c8fc8bd1605344b0dba5564378a7d7c8b2d514d3c","fast_id":"p02556_fd949ab1cd967cee7273469c8fc8bd1605344b0dba5564378a7d7c8b2d514d3c","language":"python","measured_fast_code_id":"fd949ab1cd967cee7273469c8fc8bd1605344b0dba5564378a7d7c8b2d514d3c","measured_slow_code_id":"c67db545e03815f18cc607c747105c6530daf1f7a0583db740cf0e580c68ee61","measurement_metric":"cpu_instruction_count","pair_id":"python_f7ed062d693aff6a8a9ea939","problem_id":"p02556","slow_code_id":"c67db545e03815f18cc607c747105c6530daf1f7a0583db740cf0e580c68ee61","slow_id":"p02556_c67db545e03815f18cc607c747105c6530daf1f7a0583db740cf0e580c68ee61","speedup":4.334296648063026,"stratum":"4-8","sampling_key":"db5f18bfd6afa3c1becc9af6d4b968ef7b105b0cfba7cecc4e0ee20fbde3a089","slow_code":"input = __import__(\"sys\").stdin.readline\n\n\ndef getdist(a, b):\n return abs(a[0] - b[0]) + abs(a[1] - b[1])\n\n\nn = int(eval(input()))\ns = []\nfor _ in range(n):\n s.append([*list(map(int, input().split()))])\nans = 0\nsx = sorted(s)\nsy = sorted(s, key=lambda x: x[1])\nans = max(ans, getdist(sx[-1], sx[-2]))\nans = max(ans, getdist(sx[0], sx[1]))\nans = max(ans, getdist(sy[-1], sy[-2]))\nans = max(ans, getdist(sy[0], sy[1]))\n\n\ndef ff1(x):\n return x[0] + x[1]\n\n\ndef ff2(x):\n return x[0] - x[1]\n\n\nf1 = sorted(s, key=ff1)\nf2 = sorted(s, key=ff2)\nans = max(ans, getdist(f1[0], f1[-1]))\nans = max(ans, getdist(f1[0], f1[1]))\nans = max(ans, getdist(f1[-1], f1[-2]))\nans = max(ans, getdist(f2[0], f2[-1]))\nans = max(ans, getdist(f2[0], f2[1]))\nans = max(ans, getdist(f2[-1], f2[-2]))\n\n\ndef ff1(x):\n return abs(x[0] + x[1])\n\n\ndef ff2(x):\n return abs(x[0] - x[1])\n\n\nf1 = sorted(s, key=ff1)\nf2 = sorted(s, key=ff2)\nans = max(ans, getdist(f1[0], f1[-1]))\nans = max(ans, getdist(f1[0], f1[1]))\nans = max(ans, getdist(f1[-1], f1[-2]))\nans = max(ans, getdist(f2[0], f2[-1]))\nans = max(ans, getdist(f2[0], f2[1]))\nans = max(ans, getdist(f2[-1], f2[-2]))\nprint(ans)\n","fast_code":"n, *XY = list(map(int, open(0).read().split()))\nX, Y = XY[::2], XY[1::2]\nA = [x + y for x, y in zip(X, Y)]\nB = [x - y for x, y in zip(X, Y)]\nprint((max(max(A) - min(A), max(B) - min(B))))\n"} +{"fast_code_id":"446c1847691f0ecb04da97bcbe66d24dd0c1eeed40c2c18f97ed77e5facef6c0","fast_id":"p03221_1e233513c032390ccc2d445bbda82aa67312f6ef0e85198df39820cae157c054","language":"python","measured_fast_code_id":"1e233513c032390ccc2d445bbda82aa67312f6ef0e85198df39820cae157c054","measured_slow_code_id":"bac932e565fc824f54938c4edcf17024edb8ebfd73deb80882c8006e56a416b6","measurement_metric":"cpu_instruction_count","pair_id":"python_f7f9c04dac1b7992bf8cc8df","problem_id":"p03221","slow_code_id":"9a9b5b8d60f2f6a437fd75f31baba74dc5ed7ac13071d840e26b691e2ff91cac","slow_id":"p03221_bac932e565fc824f54938c4edcf17024edb8ebfd73deb80882c8006e56a416b6","speedup":7.129024043715674,"stratum":"4-8","sampling_key":"4ee82ee528108253225fba2515ae4e4e4f31da1b86f59919b5e4ec5cc6396803","slow_code":"N, M = list(map(int, input().split()))\nP = []\nY = []\narr = [[] for j in range(10**5 + 1)]\nfor i in range(M):\n listA = list(map(int, input().split()))\n P.append(listA[0])\n Y.append(listA[1])\n arr[listA[0]].append(listA[1])\nfor i in range(N + 1):\n arr[i].sort()\nfor i in range(M):\n\n left = 0\n right = len(arr[P[i]]) - 1\n while left <= right:\n mid = (left + right) // 2\n if arr[P[i]][mid] == Y[i]:\n k = mid\n break\n elif arr[P[i]][mid] > Y[i]:\n right = mid - 1\n else:\n left = mid + 1\n print((str(P[i]).rjust(6, \"0\") + str(k + 1).rjust(6, \"0\")))\n","fast_code":"N, M = list(map(int, input().split()))\nPY = [[i, 0] + list(map(int, input().split())) for i in range(M)]\n\nPY.sort(key=lambda x: (x[2], x[3]))\np = -1\nnum = 1\nfor i, py in enumerate(PY):\n if p != py[2]:\n p = py[2]\n num = 1\n PY[i][1] = num\n else:\n num += 1\n PY[i][1] = num\nPY.sort(key=lambda x: x[0])\nfor py in PY:\n print((\"{:0=6}{:0=6}\".format(py[2], py[1])))\n"} +{"fast_code_id":"a75a9a87acf5a5f6a58790db00e966d1036a519dbf1387b78da30d5ab2b9434f","fast_id":"p02934_a75a9a87acf5a5f6a58790db00e966d1036a519dbf1387b78da30d5ab2b9434f","language":"python","measured_fast_code_id":"a75a9a87acf5a5f6a58790db00e966d1036a519dbf1387b78da30d5ab2b9434f","measured_slow_code_id":"085acbea4b5df909b4c8404a10101cc5523564869b3b17a29531909ce9117992","measurement_metric":"cpu_instruction_count","pair_id":"python_f835e91f81a3463295874816","problem_id":"p02934","slow_code_id":"085acbea4b5df909b4c8404a10101cc5523564869b3b17a29531909ce9117992","slow_id":"p02934_085acbea4b5df909b4c8404a10101cc5523564869b3b17a29531909ce9117992","speedup":7.567007537986467,"stratum":"4-8","sampling_key":"5322f1bb442d4f7dc1c7493f478af05a117cb1bbc5c46933a3d052223d71d708","slow_code":"n = int(eval(input()))\nlist = list(map(int, input().split()))\nproduct_list = [1] * n\nfor i in range(len(list)):\n for j in range(len(list)):\n if i != j:\n product_list[i] *= list[j]\nproduct_sum = 0\nfor i in range(len(list)):\n product_sum += product_list[i]\ntotal_product = product_list[0] * list[0]\nprint((total_product / product_sum))\n","fast_code":"from functools import reduce\n\neval(input())\na = [int(i) for i in input().split()]\nprint((1 / reduce(lambda x, y: x + 1 / y, [0] + a)))\n"} +{"fast_code_id":"b4826e91253fe6570252ac9e9333745f7f06aa94a31244644ffd8e29e08965e1","fast_id":"p02935_b4826e91253fe6570252ac9e9333745f7f06aa94a31244644ffd8e29e08965e1","language":"python","measured_fast_code_id":"b4826e91253fe6570252ac9e9333745f7f06aa94a31244644ffd8e29e08965e1","measured_slow_code_id":"4fce74aca7d1608f14c76b9fb92532f43bd52c914832f66cdc3ddf21b1636b9b","measurement_metric":"cpu_instruction_count","pair_id":"python_f86d776d503fa4bd1773b8f5","problem_id":"p02935","slow_code_id":"4fce74aca7d1608f14c76b9fb92532f43bd52c914832f66cdc3ddf21b1636b9b","slow_id":"p02935_4fce74aca7d1608f14c76b9fb92532f43bd52c914832f66cdc3ddf21b1636b9b","speedup":587.7742392362107,"stratum":"8+","sampling_key":"04ec7229c8d7f264ae8e6e83da3866c8922cea55ee1927af1797fbaf0e855142","slow_code":"import numpy as np\n\nn = int(eval(input()))\nlista = list(map(int, input().split()))\nlista.sort()\nfor i in range(n - 1):\n lista.append((lista[0] + lista[1]) / 2)\n lista.pop(0)\n lista.pop(0)\n lista.sort()\nprint((lista[0]))\n","fast_code":"import bisect\n\n\ndef main():\n N = int(eval(input()))\n v = sorted(list(map(int, input().split())))\n while len(v) > 1:\n num1 = v.pop(0)\n num2 = v.pop(0)\n avg = (num1 + num2) / 2\n idx = bisect.bisect(v, avg)\n v.insert(idx, avg)\n print((v[0]))\n\n\nmain()\n"} +{"fast_code_id":"053e2cef6d2b126f51a668e5b1be024e3c54bfe23aa85674a248c6509ae6b46f","fast_id":"p03486_053e2cef6d2b126f51a668e5b1be024e3c54bfe23aa85674a248c6509ae6b46f","language":"python","measured_fast_code_id":"053e2cef6d2b126f51a668e5b1be024e3c54bfe23aa85674a248c6509ae6b46f","measured_slow_code_id":"ae2b702653d7f7343a504deb1d82130c75439f406e3e68078bdb6fe733a50939","measurement_metric":"cpu_instruction_count","pair_id":"python_f8965ea9de56c2e51ac658f4","problem_id":"p03486","slow_code_id":"12de6db88ad79471a6d47d200ef0cf1d590ca1eac8ef874b69a66f9eb314da4e","slow_id":"p03486_ae2b702653d7f7343a504deb1d82130c75439f406e3e68078bdb6fe733a50939","speedup":2.9548633725403137,"stratum":"2-4","sampling_key":"b114d54de9c7ebd7d295bde4aeabd3a657f981cb59a00862c763d3021c4a7911","slow_code":"import sys\n\n\ndef main():\n s, t = sys.stdin.read().split()\n n, m = len(s), len(t)\n s = sorted(s)\n t = list(reversed(sorted(t)))\n if n < m:\n for i in range(n):\n if s[i] < t[i]:\n ans = \"Yes\"\n break\n elif s[i] > t[i]:\n ans = \"No\"\n break\n else:\n ans = \"Yes\"\n else:\n for i in range(m):\n if s[i] < t[i]:\n ans = \"Yes\"\n break\n elif s[i] > t[i]:\n ans = \"No\"\n break\n else:\n ans = \"No\"\n print(ans)\n\n\nif __name__ == \"__main__\":\n\n main()\n","fast_code":"s = sorted(list(input().strip()))\nt = sorted(list(input().strip()), reverse=True)\nif s < t:\n print(\"Yes\")\nelse:\n print(\"No\")\n"} +{"fast_code_id":"19fd1e448348c447fd2ac56d3303ce5bd225f65c9ba7896e4a6dbd81b312bc50","fast_id":"p02724_19fd1e448348c447fd2ac56d3303ce5bd225f65c9ba7896e4a6dbd81b312bc50","language":"python","measured_fast_code_id":"19fd1e448348c447fd2ac56d3303ce5bd225f65c9ba7896e4a6dbd81b312bc50","measured_slow_code_id":"07c5a845a98dce83f42c711c0408dc4dad947c9351918518d0af13bec53b52eb","measurement_metric":"cpu_instruction_count","pair_id":"python_f8c0720417e054321c665239","problem_id":"p02724","slow_code_id":"07c5a845a98dce83f42c711c0408dc4dad947c9351918518d0af13bec53b52eb","slow_id":"p02724_07c5a845a98dce83f42c711c0408dc4dad947c9351918518d0af13bec53b52eb","speedup":728.9863793228742,"stratum":"8+","sampling_key":"a5ec051bf71b332ac1130861edc0bbd04e88c1ca0a35bb9548310591fd1b4aa9","slow_code":"def main():\n x = int(eval(input()))\n ans = 0\n while x >= 500:\n x -= 500\n ans += 1000\n while x >= 5:\n x -= 5\n ans += 5\n print(ans)\n\n\nmain()\n","fast_code":"n = int(eval(input()))\ngg = 0\ngg += (n // 500) * 1000\nn = n - (n // 500) * 500\ngg += (n // 5) * 5\nprint(gg)\n"} +{"fast_code_id":"8eee5876adb81ae42ad96b3317874379ed91dc38265c72d607658861316866dc","fast_id":"p03018_8eee5876adb81ae42ad96b3317874379ed91dc38265c72d607658861316866dc","language":"python","measured_fast_code_id":"8eee5876adb81ae42ad96b3317874379ed91dc38265c72d607658861316866dc","measured_slow_code_id":"fd183fde5f0186430550c6be0aa80d56ff2f1f20b47f308b4adea537159d9065","measurement_metric":"cpu_instruction_count","pair_id":"python_f91cc419b3530932360a8e4b","problem_id":"p03018","slow_code_id":"fd183fde5f0186430550c6be0aa80d56ff2f1f20b47f308b4adea537159d9065","slow_id":"p03018_fd183fde5f0186430550c6be0aa80d56ff2f1f20b47f308b4adea537159d9065","speedup":2.2906747312389135,"stratum":"2-4","sampling_key":"a5f57ae8876e3da435d39d95987b078dae251287579f2b945d65b3a857c43eb4","slow_code":"s = input().replace(\"BC\", \"D\")\na = []\nb = \"\"\nfor c in s:\n if c == \"B\" or c == \"C\":\n a.append(b)\n b = \"\"\n else:\n b += c\na.append(b)\nans = 0\nfor i in a:\n ac = 0\n for j in i:\n if j == \"A\":\n ac += 1\n else:\n ans += ac\nprint(ans)\n","fast_code":"def main():\n S = input().replace(\"BC\", \"1\")\n ans = 0\n a = 0\n for s in S:\n if s == \"A\":\n a += 1\n elif s == \"1\":\n ans += a\n else:\n a = 0\n print(ans)\n\n\nmain()\n"} +{"fast_code_id":"ddc904ed4f0cd4b39153ffc2495e7ff359f267ec09c6188344beefc9065e1ed3","fast_id":"p02406_ddc904ed4f0cd4b39153ffc2495e7ff359f267ec09c6188344beefc9065e1ed3","language":"python","measured_fast_code_id":"ddc904ed4f0cd4b39153ffc2495e7ff359f267ec09c6188344beefc9065e1ed3","measured_slow_code_id":"0abf5eee2b023be682585a58149c3eb24fc8df3bf70d3811f032e25298261bbc","measurement_metric":"cpu_instruction_count","pair_id":"python_f9876a57d6d2a881afaecdfa","problem_id":"p02406","slow_code_id":"0abf5eee2b023be682585a58149c3eb24fc8df3bf70d3811f032e25298261bbc","slow_id":"p02406_0abf5eee2b023be682585a58149c3eb24fc8df3bf70d3811f032e25298261bbc","speedup":2.4030247622519374,"stratum":"2-4","sampling_key":"46492bc46887471e4b97701d407932c1f3ffb9ec4790fa1c027cc5351fd06521","slow_code":"def call_filter(x):\n if x % 3 == 0:\n return True\n while x > 0:\n if x % 10 == 3:\n return True\n x = int(x / 10)\n return False\n\n\ndef call(n):\n for i in [x for x in range(1, n + 1) if call_filter(x)]:\n print(\" {}\".format(i), end=\"\")\n print()\n\n\nn = int(input())\ncall(n)\n","fast_code":"print(\n (\n \"\".join(\n [\n \" \" + str(i)\n for i in range(1, int(eval(input())) + 1)\n if i % 3 == 0 or \"3\" in str(i)\n ]\n )\n )\n)\n"} +{"fast_code_id":"d67346144063c9953ad7327a7dfaf60402f48a7da255ded5c6f0b445f7367bb1","fast_id":"p02763_1e6d65d067e83926ee7675a54e4d88003ee8389df73ca8f9b388e5a0712825ce","language":"python","measured_fast_code_id":"1e6d65d067e83926ee7675a54e4d88003ee8389df73ca8f9b388e5a0712825ce","measured_slow_code_id":"f48f6f3e37812c17b5337b9141da770a977eb3ae11af352f28286963282fd6ed","measurement_metric":"cpu_instruction_count","pair_id":"python_f99ee7e0a6ee24af38e890a2","problem_id":"p02763","slow_code_id":"4fa4a65e4a0df3861053325cb01fa333b2482712b297bcf1214920d237936687","slow_id":"p02763_f48f6f3e37812c17b5337b9141da770a977eb3ae11af352f28286963282fd6ed","speedup":5.99764071296696,"stratum":"4-8","sampling_key":"f64c417bccc7a741d16d9fd58985a5c8d98e2d1230b0a2fbe2b3fc78ec29e793","slow_code":"import sys\n\ninput = sys.stdin.readline\n\n\nclass Bit:\n def __init__(self, n):\n self.n = n\n self.tree = [0] * (n + 1)\n self.el = [0] * (n + 1)\n self.depth = n.bit_length() - 1\n\n def sum(self, i):\n s = 0\n i -= 1\n while i >= 0:\n s += self.tree[i]\n i = (i & (i + 1)) - 1\n return s\n\n def add(self, i, x):\n self.el[i] += x\n while i < self.n:\n self.tree[i] += x\n i |= i + 1\n\n def get(self, i, j=None):\n if j is None:\n return self.el[i]\n if i == 0:\n return self.sum(j)\n return self.sum(j) - self.sum(i)\n\n def lower_bound(self, x, equal=False):\n sum_ = 0\n pos = -1\n if not equal:\n for i in range(self.depth, -1, -1):\n k = pos + (1 << i)\n if k < self.n and sum_ + self.tree[k] < x:\n sum_ += self.tree[k]\n pos += 1 << i\n if equal:\n for i in range(self.depth, -1, -1):\n k = pos + (1 << i)\n if k < self.n and sum_ + self.tree[k] <= x:\n sum_ += self.tree[k]\n pos += 1 << i\n return pos, sum_\n\n def __getitem__(self, s):\n return self.el[s]\n\n def __iter__(self):\n for s in self.el[: self.n]:\n yield s\n\n def __str__(self):\n text1 = \" \".join([\"element: \"] + list(map(str, self)))\n text2 = \" \".join(\n [\"cumsum(1-indexed): \"]\n + list(str(self.sum(i)) for i in range(1, self.n + 1))\n )\n return \"\\n\".join((text1, text2))\n\n\nimport string\n\nN = int(eval(input()))\nS = input().strip()\nQ = int(eval(input()))\nB = [Bit(N) for _ in range(26)]\nabc = string.ascii_lowercase\nabc2 = dict()\nfor i, s in enumerate(abc):\n abc2[s] = i\nfor i, s in enumerate(S):\n B[abc2[s]].add(i, 1)\nfor _ in range(Q):\n q = list(input().split())\n if q[0] == \"1\":\n a = int(q[1]) - 1\n b = q[2]\n for i in range(26):\n if B[i].el[a] == 1:\n B[i].add(a, -1)\n B[abc2[b]].add(a, 1)\n if q[0] == \"2\":\n a = int(q[1]) - 1\n b = int(q[2]) - 1\n res = 0\n for i in range(26):\n res += B[i].get(a, b + 1) > 0\n print(res)\n","fast_code":"import sys\n\niim = lambda: map(int, input().rstrip().split())\n\n\ndef popcnt2(n):\n a = (\n 0,\n 1,\n 1,\n 2,\n 1,\n 2,\n 2,\n 3,\n 1,\n 2,\n 2,\n 3,\n 2,\n 3,\n 3,\n 4,\n 1,\n 2,\n 2,\n 3,\n 2,\n 3,\n 3,\n 4,\n 2,\n 3,\n 3,\n 4,\n 3,\n 4,\n 4,\n 5,\n 1,\n 2,\n 2,\n 3,\n 2,\n 3,\n 3,\n 4,\n 2,\n 3,\n 3,\n 4,\n 3,\n 4,\n 4,\n 5,\n 2,\n 3,\n 3,\n 4,\n 3,\n 4,\n 4,\n 5,\n 3,\n 4,\n 4,\n 5,\n 4,\n 5,\n 5,\n 6,\n 1,\n 2,\n 2,\n 3,\n 2,\n 3,\n 3,\n 4,\n 2,\n 3,\n 3,\n 4,\n 3,\n 4,\n 4,\n 5,\n 2,\n 3,\n 3,\n 4,\n 3,\n 4,\n 4,\n 5,\n 3,\n 4,\n 4,\n 5,\n 4,\n 5,\n 5,\n 6,\n 2,\n 3,\n 3,\n 4,\n 3,\n 4,\n 4,\n 5,\n 3,\n 4,\n 4,\n 5,\n 4,\n 5,\n 5,\n 6,\n 3,\n 4,\n 4,\n 5,\n 4,\n 5,\n 5,\n 6,\n 4,\n 5,\n 5,\n 6,\n 5,\n 6,\n 6,\n 7,\n 1,\n 2,\n 2,\n 3,\n 2,\n 3,\n 3,\n 4,\n 2,\n 3,\n 3,\n 4,\n 3,\n 4,\n 4,\n 5,\n 2,\n 3,\n 3,\n 4,\n 3,\n 4,\n 4,\n 5,\n 3,\n 4,\n 4,\n 5,\n 4,\n 5,\n 5,\n 6,\n 2,\n 3,\n 3,\n 4,\n 3,\n 4,\n 4,\n 5,\n 3,\n 4,\n 4,\n 5,\n 4,\n 5,\n 5,\n 6,\n 3,\n 4,\n 4,\n 5,\n 4,\n 5,\n 5,\n 6,\n 4,\n 5,\n 5,\n 6,\n 5,\n 6,\n 6,\n 7,\n 2,\n 3,\n 3,\n 4,\n 3,\n 4,\n 4,\n 5,\n 3,\n 4,\n 4,\n 5,\n 4,\n 5,\n 5,\n 6,\n 3,\n 4,\n 4,\n 5,\n 4,\n 5,\n 5,\n 6,\n 4,\n 5,\n 5,\n 6,\n 5,\n 6,\n 6,\n 7,\n 3,\n 4,\n 4,\n 5,\n 4,\n 5,\n 5,\n 6,\n 4,\n 5,\n 5,\n 6,\n 5,\n 6,\n 6,\n 7,\n 4,\n 5,\n 5,\n 6,\n 5,\n 6,\n 6,\n 7,\n 5,\n 6,\n 6,\n 7,\n 6,\n 7,\n 7,\n 8,\n )\n ans = 0\n while n:\n ans += a[n & 0xFF]\n n >>= 8\n return ans\n\n\ndef resolve():\n N = int(input())\n S = list(input())\n Q = int(input())\n ln = N.bit_length() + 1\n c0 = ord(\"a\")\n smap = [1 << (i - c0) for i in range(c0, ord(\"z\") + 1)]\n T = [None] * ln\n T[0] = [smap[ord(S[i]) - c0] for i in range(N)]\n if N & 1:\n T[0].append(0)\n N += 1\n t0, n2 = T[0], N\n for i in range(1, ln):\n n1 = n2 = n2 >> 1\n if n2 & 1:\n n2 += 1\n ti = T[i] = [0] * n2\n for j in range(n1):\n j2 = j << 1\n d1, d2 = t0[j2], t0[j2 + 1]\n ti[j] = d1 | d2\n t0 = ti\n\n ans = []\n for cmd, i, j in (line.split() for line in sys.stdin):\n i = int(i) - 1\n if cmd == \"1\":\n if S[i] == j:\n continue\n S[i] = j\n t0 = T[0]\n t0[i] = smap[ord(j) - c0]\n for i1 in range(1, ln):\n ti = T[i1]\n j1 = i >> 1\n ti[j1] = t0[i] | t0[i ^ 1]\n i, t0 = j1, ti\n\n elif cmd == \"2\":\n j = int(j) - 1\n d1 = 0\n for i1 in range(ln):\n ti = T[i1]\n if not i < j:\n if i == j:\n d1 |= ti[i]\n break\n if i & 1:\n d1 |= ti[i]\n i += 1\n if j & 1 == 0:\n d1 |= ti[j]\n j -= 1\n i >>= 1\n j >>= 1\n ans.append(popcnt2(d1))\n print(*ans, sep=\"\\n\")\n\n\nif __name__ == \"__main__\":\n resolve()\n"} +{"fast_code_id":"dec70d9929970770ab4b866b423a9d708353800784f03f8e9964ad63ad6dd8e2","fast_id":"p03371_dec70d9929970770ab4b866b423a9d708353800784f03f8e9964ad63ad6dd8e2","language":"python","measured_fast_code_id":"dec70d9929970770ab4b866b423a9d708353800784f03f8e9964ad63ad6dd8e2","measured_slow_code_id":"d423368c3404af0d794647ac92b41960ae5bb9ea8edef19ff71fb40275e2bb52","measurement_metric":"cpu_instruction_count","pair_id":"python_fa425141937b9288d47f4a37","problem_id":"p03371","slow_code_id":"d423368c3404af0d794647ac92b41960ae5bb9ea8edef19ff71fb40275e2bb52","slow_id":"p03371_d423368c3404af0d794647ac92b41960ae5bb9ea8edef19ff71fb40275e2bb52","speedup":11580.086089350836,"stratum":"8+","sampling_key":"545cd1f0366e75d31bad9f0f1e2797dae84c52d0741dd3820da011f09d2620b6","slow_code":"a, b, c, x, y = list(map(int, input().split()))\nmi = 10**10\nfor i in range(10**6):\n cost = c * 2 * i + a * max((x - i), 0) + b * max((y - i), 0)\n if cost < mi:\n mi = cost\nprint(mi)\n","fast_code":"a, b, c, x, y = list(map(int, input().split()))\nab = c * 2\nif a + b > ab:\n t = ab * min(x, y)\n d = max(x, y) - min(x, y)\n if x > y:\n dd = a * d\n else:\n dd = b * d\n print((t + ab * d if dd > ab * d else t + dd))\nelse:\n print((a * x + b * y))\n"} +{"fast_code_id":"02952b5343791f7e9cbf755ebc67676afbd1a59fb0391b64459cf3edf5653a17","fast_id":"p03472_02952b5343791f7e9cbf755ebc67676afbd1a59fb0391b64459cf3edf5653a17","language":"python","measured_fast_code_id":"02952b5343791f7e9cbf755ebc67676afbd1a59fb0391b64459cf3edf5653a17","measured_slow_code_id":"0789ae9ad831ab5813576bdfc89180cd38032d647a484b2243690be0a9591bf1","measurement_metric":"cpu_instruction_count","pair_id":"python_fae4ddc59f5643e48168d08d","problem_id":"p03472","slow_code_id":"58ca7d2969e78880fa1ce15e0d4bb73469edf3592d83f87bf58a9e602bb788dc","slow_id":"p03472_0789ae9ad831ab5813576bdfc89180cd38032d647a484b2243690be0a9591bf1","speedup":52.281151685858305,"stratum":"8+","sampling_key":"b518c29c26902432eb20fb9b3903fa7f1b3c002d63a9392b14d9617168f58ba9","slow_code":"import sys\nimport math\nimport numpy as np\n\nn, h = list(map(int, sys.stdin.readline().strip().split(\" \")))\na = []\nb = []\nfor _ in range(n):\n _a, _b = list(map(int, sys.stdin.readline().strip().split(\" \")))\n a.append(_a)\n b.append(_b)\nmax_a = max(a)\ncnt = 0\nb = np.asarray(sorted(b))\nb = b[b > max_a]\nwhile h > 0 and len(b) > 0:\n cnt += 1\n h -= b[-1]\n b = b[:-1]\nif h > 0:\n cnt += math.ceil(h / max_a)\nprint(cnt)\n","fast_code":"n, h, *t = list(map(int, open(0).read().split()))\nb = sorted(t[1::2])\na = max(t[::2])\nc = 0\nwhile h > 0 and b and b[-1] > a:\n h -= b.pop()\n c += 1\nif h > 0:\n c -= -h // a\nprint(c)\n"} +{"fast_code_id":"9164aae6c8839a29a40c85ad8ba3bfc05c8440fc08a285145380122a94d7f972","fast_id":"p02725_9164aae6c8839a29a40c85ad8ba3bfc05c8440fc08a285145380122a94d7f972","language":"python","measured_fast_code_id":"9164aae6c8839a29a40c85ad8ba3bfc05c8440fc08a285145380122a94d7f972","measured_slow_code_id":"91accdad635aaade3cd21a1cbe15f0f073859089779275b1b10043afbdc41816","measurement_metric":"cpu_instruction_count","pair_id":"python_fafc219138bfce2ee998a63b","problem_id":"p02725","slow_code_id":"91accdad635aaade3cd21a1cbe15f0f073859089779275b1b10043afbdc41816","slow_id":"p02725_91accdad635aaade3cd21a1cbe15f0f073859089779275b1b10043afbdc41816","speedup":12.657527348126896,"stratum":"8+","sampling_key":"cc04760578a3fdf1374736e41092e6440cca70da73e2dcdfa7d112cb92357639","slow_code":"import numpy as np\n\nK, N = list(map(int, input().split()))\nA = list(map(int, input().split()))\nA.append(K + A[0])\nD = np.diff(A)\nprint((int(K) - np.max(D)))\n","fast_code":"from sys import stdin\n\ninp = stdin.readline\nn, k = [int(x) for x in inp().strip().split()]\narray = [int(x) for x in inp().strip().split()]\ndistance = [0] * (k * 2)\nfor i in range(k - 1):\n distance[i] = array[i + 1] - array[i]\ndistance[k - 1] = n - array[k - 1] + array[0]\ndistance[2 * k - 1] = n - array[k - 1] + array[0]\nfor i in range(k - 1):\n distance[k + i] = array[i + 1] - array[i]\nminimum = 999999999\ncount = 0\ntotal = 0\ncountLimit = k - 1\nfor i in range(k * 2):\n if count < countLimit:\n total += distance[i]\n count += 1\n else:\n if minimum > total:\n minimum = total\n total += distance[i]\n total -= distance[i - countLimit]\nprint(minimum)\n"} +{"fast_code_id":"284acad32f039b02d479f3e10e518b3399b8810722821631f54eb37aa1b6351e","fast_id":"p02995_284acad32f039b02d479f3e10e518b3399b8810722821631f54eb37aa1b6351e","language":"python","measured_fast_code_id":"284acad32f039b02d479f3e10e518b3399b8810722821631f54eb37aa1b6351e","measured_slow_code_id":"c2f5bc360099cc643a35a40406bd46a274a8a5ff8b8696ae88a7e38cfd81242e","measurement_metric":"cpu_instruction_count","pair_id":"python_fb1348b90e7ff8ae6d3dc12c","problem_id":"p02995","slow_code_id":"13e5da75774e374f0ecc4a7f6f857dc7a5cfdcb8d1ce9b650399f2172f149df2","slow_id":"p02995_c2f5bc360099cc643a35a40406bd46a274a8a5ff8b8696ae88a7e38cfd81242e","speedup":2.5087040667452922,"stratum":"2-4","sampling_key":"66b8ba984455ef3532461f5b8e07d5c30af0cec865604badbcf11745e02f475a","slow_code":"import sys\n\nsys.setrecursionlimit(10**7)\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\ndef MI():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef LI2():\n return list(map(int, sys.stdin.readline().rstrip()))\n\n\ndef S():\n return sys.stdin.readline().rstrip()\n\n\ndef LS():\n return list(sys.stdin.readline().rstrip().split())\n\n\ndef LS2():\n return list(sys.stdin.readline().rstrip())\n\n\nA, B, C, D = MI()\nfrom math import gcd\n\n\ndef f(n):\n return n - n // C - n // D + n // ((C * D) // gcd(C, D))\n\n\nprint((f(B) - f(A - 1)))\n","fast_code":"import math as m\n\nA, B, C, D = list(map(int, input().split()))\nA -= 1\ng = C * D // m.gcd(C, D)\nx = B // C - A // C\ny = B // D - A // D\nz = B // g - A // g\nprint((B - A - x - y + z))\n"} +{"fast_code_id":"9f205f7f14f8a8391a0e84e5bbc9266ac57a944177527cfa1158bad6b697fbee","fast_id":"p04014_9f205f7f14f8a8391a0e84e5bbc9266ac57a944177527cfa1158bad6b697fbee","language":"python","measured_fast_code_id":"9f205f7f14f8a8391a0e84e5bbc9266ac57a944177527cfa1158bad6b697fbee","measured_slow_code_id":"38f05af6b73665280db9ec2a605f799d5a3a653696a22897da46868ca5707313","measurement_metric":"cpu_instruction_count","pair_id":"python_fb4b5adfd88882f5a31be58c","problem_id":"p04014","slow_code_id":"38f05af6b73665280db9ec2a605f799d5a3a653696a22897da46868ca5707313","slow_id":"p04014_38f05af6b73665280db9ec2a605f799d5a3a653696a22897da46868ca5707313","speedup":3.761586469670643,"stratum":"2-4","sampling_key":"145b78c86c0a571cd36b6aa69c9f1d0a4bd61709e4bce45554daea58d311ab24","slow_code":"from collections import defaultdict, Counter\nfrom itertools import product, groupby, count, permutations, combinations\nfrom math import pi, sqrt, floor\nfrom collections import deque\nfrom bisect import bisect, bisect_left, bisect_right\nfrom string import ascii_lowercase\nfrom functools import lru_cache\nimport sys\n\nsys.setrecursionlimit(10000)\nINF = float(\"inf\")\nYES, Yes, yes, NO, No, no = \"YES\", \"Yes\", \"yes\", \"NO\", \"No\", \"no\"\ndy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]\ndy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]\n\n\ndef inside(y, x, H, W):\n return 0 <= y < H and 0 <= x < W\n\n\ndef ceil(a, b):\n return (a + b - 1) // b\n\n\ndef f(b, n):\n if n < b:\n return n\n return f(b, n // b) + n % b\n\n\ndef main():\n N = int(eval(input()))\n S = int(eval(input()))\n if N == S:\n print((N + 1))\n return\n if N < S:\n print((-1))\n return\n ans = INF\n for b in range(2, int(sqrt(N)) + 1):\n if f(b, N) == S:\n ans = min(ans, b)\n bs = set()\n t = N - S\n for i in range(1, int(sqrt(N)) + 1):\n if t % i == 0:\n bs.add(i + 1)\n bs.add((t // i) + 1)\n for b in bs:\n if b == 1:\n continue\n if f(b, N) == S:\n ans = min(ans, b)\n if ans == INF:\n print((-1))\n else:\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"import sys\n\nn = int(eval(input()))\ns = int(eval(input()))\n\n\ndef f(b, n):\n if n < b:\n return n\n else:\n return f(b, n // b) + n % b\n\n\nif s == n:\n print((n + 1))\n sys.exit(0)\nif n < s:\n print((-1))\n sys.exit(0)\nans = None\nfor i in range(2, n):\n if i * i > n:\n break\n if f(i, n) == s:\n ans = i\n break\nfor i in range(1, n):\n if i * i > n:\n break\n if (n - s) % i == 0:\n b = (n - s) // i + 1\n if f(b, n) == s:\n if ans is None:\n ans = (n - s) // i + 1\n else:\n ans = min((ans, (n - s) // i + 1))\nif ans is None:\n print((-1))\nelse:\n print(ans)\n"} +{"fast_code_id":"fb84a22e95d451c0bdf495f056a7ae120b5eff63ca18b6c3e73cb9397286a4e8","fast_id":"p03774_fb84a22e95d451c0bdf495f056a7ae120b5eff63ca18b6c3e73cb9397286a4e8","language":"python","measured_fast_code_id":"fb84a22e95d451c0bdf495f056a7ae120b5eff63ca18b6c3e73cb9397286a4e8","measured_slow_code_id":"4ab93e91c9006f8793ec4a581894d15fcba322003404950855ee770b9ed45cb3","measurement_metric":"cpu_instruction_count","pair_id":"python_fc3c09e7f7254f3320485dd6","problem_id":"p03774","slow_code_id":"4ab93e91c9006f8793ec4a581894d15fcba322003404950855ee770b9ed45cb3","slow_id":"p03774_4ab93e91c9006f8793ec4a581894d15fcba322003404950855ee770b9ed45cb3","speedup":175.0166313884244,"stratum":"8+","sampling_key":"066a317ec8bd5546b15be1a38301e3f4d90452346071521601d6a6c11d4a7af9","slow_code":"import numpy as np\n\nN, M = list(map(int, input().split()))\nab = []\nfor i in range(N):\n tmp = list(map(int, input().split()))\n ab.append(tmp)\nab = np.array(ab)\ndist = np.full([N, M], np.inf)\nfor m in range(M):\n tmp = np.array(list(map(int, input().split())))\n for n in range(N):\n dist[n, m] = np.abs(ab[n] - tmp).sum()\ndist = dist.astype(\"int\")\nfor d in dist:\n print((d.argmin() + 1))\n","fast_code":"n, m = list(map(int, input().split()))\nab = [list(map(int, input().split())) for _ in range(n)]\ncd = [list(map(int, input().split())) for _ in range(m)]\nfor i in range(n):\n s = 0\n t = float(\"inf\")\n for j in range(m):\n p = abs(ab[i][0] - cd[j][0]) + abs(ab[i][1] - cd[j][1])\n if p < t:\n s = j + 1\n t = p\n print(s)\n"} +{"fast_code_id":"2ce5e490bcfdab8ab7aebeb3c1a35cba3e3d5ba9a02c0729090e10f62b20b9a3","fast_id":"p03786_2ce5e490bcfdab8ab7aebeb3c1a35cba3e3d5ba9a02c0729090e10f62b20b9a3","language":"python","measured_fast_code_id":"2ce5e490bcfdab8ab7aebeb3c1a35cba3e3d5ba9a02c0729090e10f62b20b9a3","measured_slow_code_id":"9c47b5351287e97e1c5de7875f912e9de0349c4286a89e13a6aa097ca0c9f946","measurement_metric":"cpu_instruction_count","pair_id":"python_fc898751c656cb07b4709455","problem_id":"p03786","slow_code_id":"9c47b5351287e97e1c5de7875f912e9de0349c4286a89e13a6aa097ca0c9f946","slow_id":"p03786_9c47b5351287e97e1c5de7875f912e9de0349c4286a89e13a6aa097ca0c9f946","speedup":140.04250266695007,"stratum":"8+","sampling_key":"0cc95b2f98eab994f0fe42fb139380e91bb90eb596c7e14447fb979825d7baec","slow_code":"n = int(eval(input()))\na = list(map(int, input().split()))\nimport numpy as np\n\na = sorted(a)\ncum = np.cumsum(a)\ncum = list(reversed(cum))\na = list(reversed(a))\nans = 1\nfor i in range(1, n):\n if a[i - 1] <= cum[i] * 2:\n ans += 1\n else:\n break\nprint(ans)\n","fast_code":"from itertools import accumulate\n\nN = int(eval(input()))\nA = list(map(int, input().split()))\nA.sort()\na = list(accumulate(A))\nanswer = N\nfor i in range(N - 1):\n if a[i] * 2 < A[i + 1]:\n answer = N - (i + 1)\nprint(answer)\n"} +{"fast_code_id":"8f465dc84ab15b8aef381f4c98e2aba2570613e45cefdc8621ec0f0e3adbdb41","fast_id":"p03030_8f465dc84ab15b8aef381f4c98e2aba2570613e45cefdc8621ec0f0e3adbdb41","language":"python","measured_fast_code_id":"8f465dc84ab15b8aef381f4c98e2aba2570613e45cefdc8621ec0f0e3adbdb41","measured_slow_code_id":"dbe08050a0d6a77d36da9960a8e9921e8d48ac452d52421ae0919461f538c102","measurement_metric":"cpu_instruction_count","pair_id":"python_fd2eba2809015de76e11f8db","problem_id":"p03030","slow_code_id":"dbe08050a0d6a77d36da9960a8e9921e8d48ac452d52421ae0919461f538c102","slow_id":"p03030_dbe08050a0d6a77d36da9960a8e9921e8d48ac452d52421ae0919461f538c102","speedup":6.127582894880668,"stratum":"4-8","sampling_key":"9a100a33eb57aa0bb85e3ad6ac535da120993420ccac1d2c750ca3b661e97400","slow_code":"N = int(eval(input()))\nMAIN = []\nfor i in range(N):\n S, P = list(map(str, input().split()))\n MAIN.append([i + 1, S, int(P)])\n\n\ndef swap(i, j):\n x = MAIN[i]\n MAIN[i] = MAIN[j]\n MAIN[j] = x\n\n\nupdate = True\nwhile update == True:\n update = False\n for i in range(1, N):\n if MAIN[i][1] > MAIN[i - 1][1]:\n continue\n elif MAIN[i][1] == MAIN[i - 1][1]:\n if MAIN[i][2] > MAIN[i - 1][2]:\n swap(i, i - 1)\n update = True\n else:\n swap(i, i - 1)\n update = True\nfor m in MAIN:\n print((m[0]))\n","fast_code":"N = int(eval(input()))\nl = []\nfor i in range(N):\n s, p = input().split(\" \")\n l.append([s, -int(p), i + 1])\nl.sort()\nfor s, p, i in l:\n print(i)\n"} +{"fast_code_id":"81ba19638c3fa3be36bbc77a262785df5f9ab1a2eca76741fbb3b3e72f63c6fe","fast_id":"p02394_81ba19638c3fa3be36bbc77a262785df5f9ab1a2eca76741fbb3b3e72f63c6fe","language":"python","measured_fast_code_id":"81ba19638c3fa3be36bbc77a262785df5f9ab1a2eca76741fbb3b3e72f63c6fe","measured_slow_code_id":"c88e86f1ad95ddc817ad7ba81628e2daf211ff2d39c36960f050623a40ae12a3","measurement_metric":"cpu_instruction_count","pair_id":"python_fd3279bd4f9f6f41e0bff1aa","problem_id":"p02394","slow_code_id":"b3a430d2365496f9f536fa4236fe45d9a45c9a6c0f910f1eae517487e3d1e97c","slow_id":"p02394_c88e86f1ad95ddc817ad7ba81628e2daf211ff2d39c36960f050623a40ae12a3","speedup":2.7474910662304146,"stratum":"2-4","sampling_key":"0b5c12db6aabae9853fd80c7da28c73bedf497e593b5d72b44fbace2a25254dd","slow_code":"import math\n\n\ndef func():\n try:\n line = input().rstrip()\n numbers = line.split(\" \")\n width = float(numbers[0])\n height = float(numbers[1])\n x = float(numbers[2])\n y = float(numbers[3])\n r = abs(float(numbers[4]))\n except:\n print(\"input error\")\n return -1\n wsign = math.copysign(1, width)\n hsign = math.copysign(1, height)\n result = wsign * x + r <= wsign * width\n result = result and (wsign * x - r >= 0)\n result = result and (hsign * y + r <= hsign * height)\n result = result and (hsign * y - r >= 0)\n if result:\n print(\"Yes\")\n else:\n print(\"No\")\n\n\nfunc()\n","fast_code":"w, h, x, y, r = list(map(int, input().split()))\nif 0 <= x - r and x + r <= w and 0 <= y - r and y + r <= h:\n print(\"Yes\")\nelse:\n print(\"No\")\n"} +{"fast_code_id":"385f918e70558d30ce24cedf0de5f4a96a7aad60475bd5eec62a4ce0ebe4edee","fast_id":"p02881_385f918e70558d30ce24cedf0de5f4a96a7aad60475bd5eec62a4ce0ebe4edee","language":"python","measured_fast_code_id":"385f918e70558d30ce24cedf0de5f4a96a7aad60475bd5eec62a4ce0ebe4edee","measured_slow_code_id":"ad00789e3ab1c0171663b647d60fcdd74ea599f9c2e60c34e58bfd4b7e51ca2d","measurement_metric":"cpu_instruction_count","pair_id":"python_fd501d0df27f3b6984142963","problem_id":"p02881","slow_code_id":"b7459fe662666f4f818a58ffdb7be6fbc3203ac3a68cd69948b5c91f1dd6d73e","slow_id":"p02881_ad00789e3ab1c0171663b647d60fcdd74ea599f9c2e60c34e58bfd4b7e51ca2d","speedup":7.449160294929298,"stratum":"4-8","sampling_key":"cb6d3787f2a5d8ab1bbc645bf072ea88cfa8994124cb51af1423dcdbf11f3a4a","slow_code":"import sys\n\nsys.setrecursionlimit(10**7)\nf_inf = float(\"inf\")\nmod = 10**9 + 7\n\n\ndef make_divisors(n):\n divisors = []\n for i in range(1, int(pow(n, 0.5)) + 1):\n if n % i == 0:\n divisors.append(i)\n if i != n // i:\n divisors.append(n // i)\n divisors.sort()\n return divisors\n\n\ndef resolve():\n n = int(eval(input()))\n div = make_divisors(n)\n res = f_inf\n for i in div:\n cost = i + n // i - 2\n res = min(res, cost)\n print(res)\n\n\nif __name__ == \"__main__\":\n resolve()\n","fast_code":"N = int(eval(input()))\nx = int(N**0.5)\nfor i in range(x, 0, -1):\n if N % i == 0:\n y = N // i\n break\nans = N // y + y - 2\nprint(ans)\n"} +{"fast_code_id":"16771a04e6276b491192dc984b7d0363d20dc7ef3d6fad47bf439b11ebe5f507","fast_id":"p03775_16771a04e6276b491192dc984b7d0363d20dc7ef3d6fad47bf439b11ebe5f507","language":"python","measured_fast_code_id":"16771a04e6276b491192dc984b7d0363d20dc7ef3d6fad47bf439b11ebe5f507","measured_slow_code_id":"7ab001f5efb675596da434bf3ef9e7fa9f9ec3b0d345cb8726f7720241f1422c","measurement_metric":"cpu_instruction_count","pair_id":"python_fd5f1714abbe60b8859e6ea7","problem_id":"p03775","slow_code_id":"0bd50a29ee4b8ed24f88df4bdfcabb76a7a6778570de4e74b5c8ddab42febd8f","slow_id":"p03775_7ab001f5efb675596da434bf3ef9e7fa9f9ec3b0d345cb8726f7720241f1422c","speedup":485.3782684790623,"stratum":"8+","sampling_key":"79292d96215b834b24690a4ab1ac438c4b90dba4e3338911833ab1e3875c7e86","slow_code":"n = int(eval(input()))\n\n\ndef cal(a):\n return len(str(a))\n\n\nm = 11\nfor j in range(1, 10**6 + 1):\n if n % j == 0:\n m = min(m, max(cal(j), cal(n // j)))\n\nprint(m)\n","fast_code":"n = int(eval(input()))\nif n == 6983776800:\n print((5))\n exit()\n\n\ndef prime_factorize(n):\n a = []\n while n % 2 == 0:\n a.append(2)\n n //= 2\n f = 3\n while f**2 <= n:\n if n % f == 0:\n a.append(f)\n n //= f\n else:\n f += 2\n if n != 1:\n a.append(n)\n return a\n\n\nF = prime_factorize(n)\nA, B = 1, 1\nfor i in F[::-1]:\n if A <= B:\n A *= i\n else:\n B *= i\nprint((max(len(str(A)), len(str(B)))))\n"} +{"fast_code_id":"d397cb53eb3fb7f421b1fcb9442a451912871ff835552daf246a8dcb0e84ce5a","fast_id":"p02549_d397cb53eb3fb7f421b1fcb9442a451912871ff835552daf246a8dcb0e84ce5a","language":"python","measured_fast_code_id":"d397cb53eb3fb7f421b1fcb9442a451912871ff835552daf246a8dcb0e84ce5a","measured_slow_code_id":"44c9516e92f38f09d76b47812276c2878e77eeefdb8dab9cc1137c27ddfc7b8e","measurement_metric":"cpu_instruction_count","pair_id":"python_fdb6aa43a1ae5df667dbf7a7","problem_id":"p02549","slow_code_id":"44c9516e92f38f09d76b47812276c2878e77eeefdb8dab9cc1137c27ddfc7b8e","slow_id":"p02549_44c9516e92f38f09d76b47812276c2878e77eeefdb8dab9cc1137c27ddfc7b8e","speedup":2.92087228275828,"stratum":"2-4","sampling_key":"1277a192aef496d7963c959721173ee30a1101ddb395fd12653fc9b70c483db2","slow_code":"mod = 998244353\nn, k = list(map(int, input().split()))\nK = [list(map(int, input().split())) for i in range(k)]\ndp = [0] * (n + 5)\ndp[1] = 1\ndp2 = [0] * (n + 5)\nfor i in range(1, n + 1):\n dp[i] = (dp[i] + dp2[i] + dp2[i - 1]) % mod\n dp2[i] = (dp2[i] + dp2[i - 1]) % mod\n for l, r in K:\n dp2[min(i + l, n + 2)] += dp[i]\n dp2[min(i + l, n + 2)] %= mod\n dp2[min(i + r + 1, n + 2)] -= dp[i]\n dp2[min(i + r + 1, n + 2)] %= mod\nprint((dp[n] % mod))\n","fast_code":"import sys\n\nread = sys.stdin.read\nreadline = sys.stdin.readline\nreadlines = sys.stdin.readlines\nsys.setrecursionlimit(10**9)\nINF = 1 << 60\nMOD = 998244353\n\n\ndef main():\n N, K, *LR = list(map(int, read().split()))\n interval = [(l, r) for l, r in zip(*[iter(LR)] * 2)]\n dp = [0] * (N + 2)\n dp[1] = 1\n dp[2] = -1\n for i in range(1, N + 1):\n dp[i] = (dp[i] + dp[i - 1]) % MOD\n cur = dp[i]\n for l, r in interval:\n if i + l <= N:\n dp[i + l] += cur\n dp[min(i + r + 1, N + 1)] -= cur\n print((dp[N]))\n return\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"3372f4f601315791f5fa5074c8f91306b596e20abda63ec14629d9dee61e0933","fast_id":"p03294_3372f4f601315791f5fa5074c8f91306b596e20abda63ec14629d9dee61e0933","language":"python","measured_fast_code_id":"3372f4f601315791f5fa5074c8f91306b596e20abda63ec14629d9dee61e0933","measured_slow_code_id":"903eeef9634137cfb57a141032f40a40109222781b0b845c860573558de2a657","measurement_metric":"cpu_instruction_count","pair_id":"python_fdb917740461f1c7152f6a02","problem_id":"p03294","slow_code_id":"903eeef9634137cfb57a141032f40a40109222781b0b845c860573558de2a657","slow_id":"p03294_903eeef9634137cfb57a141032f40a40109222781b0b845c860573558de2a657","speedup":6.424526616716904,"stratum":"4-8","sampling_key":"209157bd7c5869ea41e605c0825ac19c032b569a7cf9ae3a57e1c0b643406283","slow_code":"def gcd(a, b):\n return a if b == 0 else gcd(b, a % b)\n\n\ndef lcm(a, b):\n return a * b // gcd(a, b)\n\n\nN = int(eval(input()))\nA = list(map(int, input().split()))\nl = 0\nfor i in range(1, len(A)):\n l = lcm(A[i - 1], A[i])\nans = l - 1\nans = sum(A) - len(A)\nprint(ans)\n","fast_code":"n = int(eval(input()))\na = list(map(int, input().split()))\nans = sum(a) - n\nprint(ans)\n"} +{"fast_code_id":"fd4275ac3015ea43f72a1112abea3ec7c08ff8d05ed2fd2ca2ec2233de5584a7","fast_id":"p03609_21358a205e41dd5670feb6094f107d9424855faf88240b45951435064ca31e34","language":"python","measured_fast_code_id":"21358a205e41dd5670feb6094f107d9424855faf88240b45951435064ca31e34","measured_slow_code_id":"05c7cfa6f7e3edd14d82845ed4d2e91cd4b96ef2bf5eba445a2670d95ff174d0","measurement_metric":"cpu_instruction_count","pair_id":"python_fdf77794c893291d3a0afba9","problem_id":"p03609","slow_code_id":"05c7cfa6f7e3edd14d82845ed4d2e91cd4b96ef2bf5eba445a2670d95ff174d0","slow_id":"p03609_05c7cfa6f7e3edd14d82845ed4d2e91cd4b96ef2bf5eba445a2670d95ff174d0","speedup":499.79510607796874,"stratum":"8+","sampling_key":"3444383dce788f45118cf1133f92eb18df88b954fa50b68cdaaddef2f6c85b4b","slow_code":"import numpy as np\n\nx, t = list(map(int, input().split()))\nprint((max(x - t, 0)))\n","fast_code":"import sys\n\nsys.setrecursionlimit(10**7)\n\n\ndef I():\n return int(sys.stdin.readline().rstrip())\n\n\ndef MI():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef LI():\n return list(map(int, sys.stdin.readline().rstrip().split()))\n\n\ndef LI2():\n return list(map(int, sys.stdin.readline().rstrip()))\n\n\ndef S():\n return sys.stdin.readline().rstrip()\n\n\ndef LS():\n return list(sys.stdin.readline().rstrip().split())\n\n\ndef LS2():\n return list(sys.stdin.readline().rstrip())\n\n\nX, t = MI()\nprint((max(0, X - t)))\n"} +{"fast_code_id":"46d5e13d5ee73381d9edbaa5ce879fa747d9ae74e5e035474c2d621e154c6e6e","fast_id":"p02922_08173dc7c11027f0eed162aa363c1a786f81ea8654ddd1eac0ed7859fb6b50d8","language":"python","measured_fast_code_id":"08173dc7c11027f0eed162aa363c1a786f81ea8654ddd1eac0ed7859fb6b50d8","measured_slow_code_id":"00e867b7d2095675b21d44aa0203e42270e0c7d7b6d93feade6e801e5b2a696c","measurement_metric":"cpu_instruction_count","pair_id":"python_fe32902956aa84a98f191407","problem_id":"p02922","slow_code_id":"00e867b7d2095675b21d44aa0203e42270e0c7d7b6d93feade6e801e5b2a696c","slow_id":"p02922_00e867b7d2095675b21d44aa0203e42270e0c7d7b6d93feade6e801e5b2a696c","speedup":4.622853502329994,"stratum":"4-8","sampling_key":"8814d8f400f7ee5a66ea424c84440998d2fe6ee80b845ee1e002111a1e2ad7b9","slow_code":"from copy import deepcopy\nfrom math import ceil\n\nif __name__ == \"__main__\":\n a = list(map(int, input().split()))\n n = deepcopy(a[0])\n i = 1\n if a[0] == a[1]:\n print(i)\n elif a[1] == 1:\n print((0))\n elif a[0] >= a[1]:\n print(i)\n else:\n while True:\n i += 1\n n += a[0] - 1\n if n >= a[1]:\n print(i)\n break\n","fast_code":"import sys\n\n\ndef solve(A: int, B: int):\n p = 1\n ans = 0\n while True:\n if p >= B:\n print(ans)\n break\n p -= 1\n p += A\n ans += 1\n return\n\n\ndef main():\n def iterate_tokens():\n for line in sys.stdin:\n for word in line.split():\n yield word\n\n tokens = iterate_tokens()\n A = int(next(tokens))\n B = int(next(tokens))\n solve(A, B)\n\n\nif __name__ == \"__main__\":\n main()\n"} +{"fast_code_id":"bade334d850baa79c30c63b127211354a56f0a74387511e74bb04b26a2ac47b2","fast_id":"p03558_bade334d850baa79c30c63b127211354a56f0a74387511e74bb04b26a2ac47b2","language":"python","measured_fast_code_id":"bade334d850baa79c30c63b127211354a56f0a74387511e74bb04b26a2ac47b2","measured_slow_code_id":"a6ab1e7b677625266935289606a7abd16dc62e68b6da222665ed94a9d754971b","measurement_metric":"cpu_instruction_count","pair_id":"python_fe54feeeab6bd55bb9c54411","problem_id":"p03558","slow_code_id":"6f4ff4c6772818e0e2780e53df6176c3d102137c5941272af3d3b78fead790fc","slow_id":"p03558_a6ab1e7b677625266935289606a7abd16dc62e68b6da222665ed94a9d754971b","speedup":3.9598596737148304,"stratum":"2-4","sampling_key":"1506955e296a95e1db43a0473df16c1d40c96c1de9c1fbaa59ae94f22c750c09","slow_code":"from collections import deque\n\nINF = 10**9\nk = int(eval(input()))\n\nG = [((10 * i % k, 0), ((i + 1) % k, 1)) for i in range(k)]\ns = 1\n\ndist = [INF] * k\nS = deque([s])\nT = deque()\ndist[s] = 0\nd = 0\nwhile S:\n while S:\n v = S.popleft()\n for w, c in G[v]:\n if d + c < dist[w]:\n dist[w] = d + c\n if c:\n T.append(w)\n else:\n S.append(w)\n S, T = T, S\n d += 1\nprint((dist[0] + 1))\n","fast_code":"from collections import deque\n\n\ndef solve(K):\n checked = [99999999999] * (K + 1)\n queue = deque()\n queue.append((1, 1))\n checked[1] = 1\n while queue:\n x, n = queue.popleft()\n if x == 0:\n return n\n _ = (x * 10) % K\n if n < checked[_]:\n queue.appendleft((_, n))\n checked[_] = n\n _ = (x + 1) % K\n if n + 1 < checked[_]:\n queue.append((_, n + 1))\n checked[_] = n + 1\n return None\n\n\nK = int(eval(input()))\nprint((solve(K)))\n"} +{"fast_code_id":"fac6663288e36d34bc40af158b96cb2e3bfeb4e851c1db0ad7779aa4e646f6ac","fast_id":"p00100_fac6663288e36d34bc40af158b96cb2e3bfeb4e851c1db0ad7779aa4e646f6ac","language":"python","measured_fast_code_id":"fac6663288e36d34bc40af158b96cb2e3bfeb4e851c1db0ad7779aa4e646f6ac","measured_slow_code_id":"cef1778ac31a96be11bbaf1627cf2c94f88d5ea9907d28e19f44f8b7a1d378a1","measurement_metric":"cpu_instruction_count","pair_id":"python_febb9d6c5d967880ac936be1","problem_id":"p00100","slow_code_id":"90eeb5d17013d087aa6085c705f90d8dd3710ca805802ad063fb9a202bdd752c","slow_id":"p00100_cef1778ac31a96be11bbaf1627cf2c94f88d5ea9907d28e19f44f8b7a1d378a1","speedup":3.2721169548260822,"stratum":"2-4","sampling_key":"1018522b00e3b473f78da731b60b62ee865bb066ee4b6f74d0bb47287e974315","slow_code":"employeeSalesList = []\n\n\ndef resetDataset():\n del employeeSalesList[0 : len(employeeSalesList) + 1]\n\n\ndef readDataCount():\n return int(eval(input()))\n\n\ndef searchEmployeeSales(employeeId):\n for data in employeeSalesList:\n if data[0] == employeeId:\n return data\n newData = [employeeId, 0]\n employeeSalesList.append(newData)\n return newData\n\n\nanswerList = []\n\n\ndef printEmployeeOfDataset():\n found = False\n for data in employeeSalesList:\n if data[1] >= 1000000:\n answerList.append(data[0])\n found = True\n if not found:\n answerList.append(\"NA\")\n\n\nresetDataset()\ndataCount = readDataCount()\nwhile dataCount > 0:\n for _ in range(dataCount):\n employeeId, price, volume = list(map(int, input().split(\" \")))\n employeeSales = searchEmployeeSales(employeeId)\n employeeSales[1] += price * volume\n printEmployeeOfDataset()\n resetDataset()\n dataCount = readDataCount()\nfor row in answerList:\n print(row)\n","fast_code":"while True:\n n = int(eval(input()))\n if n == 0:\n break\n d = dict()\n sep = []\n for _ in range(n):\n i, p, q = list(map(int, input().split()))\n if i in d:\n d[i] += p * q\n else:\n d[i] = p * q\n sep.append(i)\n tmp = list([x for x in list(d.items()) if x[1] >= 1000000])\n if len(tmp):\n tmp = {t[0]: t[1] for t in tmp}\n for s in sep:\n if s in tmp:\n print(s)\n else:\n print(\"NA\")\n"} +{"fast_code_id":"e92009d8908cb72c0df058417869fe81199b8d2607e4de16cc6ce07b4bff470f","fast_id":"p02264_e92009d8908cb72c0df058417869fe81199b8d2607e4de16cc6ce07b4bff470f","language":"python","measured_fast_code_id":"e92009d8908cb72c0df058417869fe81199b8d2607e4de16cc6ce07b4bff470f","measured_slow_code_id":"a1340768971238fb58507a0f8ca6f200e92420bac7eb4c6dd5fbd6b4ec30302d","measurement_metric":"cpu_instruction_count","pair_id":"python_fedce34c262a9cf1113421bb","problem_id":"p02264","slow_code_id":"a1340768971238fb58507a0f8ca6f200e92420bac7eb4c6dd5fbd6b4ec30302d","slow_id":"p02264_a1340768971238fb58507a0f8ca6f200e92420bac7eb4c6dd5fbd6b4ec30302d","speedup":2.6230767415352694,"stratum":"2-4","sampling_key":"c111dd632678d73f7e63fa0be62e6739af808864576ea3bed37b41c0c6047454","slow_code":"class Queue:\n def __init__(self, n):\n self.values = [None] * n\n self.n = n\n self.s = 0\n self.t = 0\n\n def next(self, p):\n ret = p + 1\n if ret >= self.n:\n ret = 0\n return ret\n\n def enqueue(self, x):\n if self.next(self.s) == self.t:\n raise Exception(\"Overflow\")\n self.values[self.s] = x\n self.s = self.next(self.s)\n\n def dequeue(self):\n if self.s == self.t:\n raise Exception(\"Underflow\")\n ret = self.values[self.t]\n self.t = self.next(self.t)\n return ret\n\n\nn, q = list(map(int, input().split(\" \")))\nqueue = Queue(n + 1)\nfor _ in range(n):\n name, time = input().split(\" \")\n time = int(time)\n queue.enqueue((name, time))\ncompleted = []\ncur = 0\nwhile len(completed) < n:\n name, time = queue.dequeue()\n res = time - q\n if res <= 0:\n cur += time\n completed.append((name, cur))\n else:\n cur += q\n queue.enqueue((name, res))\nfor name, time in completed:\n print(name, time)\n","fast_code":"from collections import deque\n\nn, q = map(int, input().split())\nf = lambda a, b: (a, int(b))\ndq = deque(f(*input().split()) for _ in range(n))\ncnt = 0\nans = []\nwhile dq:\n s, t = dq.popleft()\n if t <= q:\n cnt += t\n ans.append(f\"{s} {cnt}\")\n else:\n cnt += q\n dq.append((s, t - q))\nprint(*ans, sep=\"\\n\")\n"} +{"fast_code_id":"4552d6918b293d4e3923d22cae6f6b3d7971edd1b0499db41458e6e81cf27648","fast_id":"p02244_4552d6918b293d4e3923d22cae6f6b3d7971edd1b0499db41458e6e81cf27648","language":"python","measured_fast_code_id":"4552d6918b293d4e3923d22cae6f6b3d7971edd1b0499db41458e6e81cf27648","measured_slow_code_id":"94ec109ccd8bd9441b7a500ac9b67e1cafa7fd6c57f646835c6b0dc73a712deb","measurement_metric":"cpu_instruction_count","pair_id":"python_fee2bdf3fe7e5cc980cda13f","problem_id":"p02244","slow_code_id":"94ec109ccd8bd9441b7a500ac9b67e1cafa7fd6c57f646835c6b0dc73a712deb","slow_id":"p02244_94ec109ccd8bd9441b7a500ac9b67e1cafa7fd6c57f646835c6b0dc73a712deb","speedup":3.551726469815089,"stratum":"2-4","sampling_key":"0b668243b03f7962747250455ff9c2ce66380ebb45b78616b4be6908cca630c9","slow_code":"from functools import lru_cache\n\ncc = [[\".\" for i in range(8)] for j in range(8)]\n\n\ndef check(cc, a, b):\n ss = list(zip(*cc))\n if \"Q\" in cc[a]:\n return False\n if \"Q\" in ss[b]:\n return False\n d = []\n for i in range(8):\n for j in range(8):\n try:\n if j + abs(a - i) == b:\n d.append(cc[i][j])\n if j - abs(a - i) == b:\n d.append(cc[i][j])\n except IndexError:\n continue\n if \"Q\" in d:\n return False\n return True\n\n\ndef chess(s, queen):\n if queen == 8:\n return s\n for i in range(8):\n for j in range(8):\n if check(s, i, j):\n sol = s\n sol[i][j] = \"Q\"\n if chess(sol, queen + 1) != [[]]:\n return sol\n else:\n sol[i][j] = \".\"\n return [[]]\n\n\nk = int(eval(input()))\nfor i in range(k):\n a, b = [int(x) for x in input().split()]\n cc[a][b] = \"Q\"\nans = chess(cc, k)\nprint((\"\\n\".join(list([\"\".join(x) for x in ans]))))\n","fast_code":"from itertools import permutations\n\n\ndef check(queen):\n for r1, c1 in queen:\n if any(\n (r1 != r2 or c1 != c2)\n and (r1 == r2 or c1 == c2 or r1 + c1 == r2 + c2 or r1 - c1 == r2 - c2)\n for r2, c2 in queen\n ):\n return False\n return True\n\n\nN = int(input())\nQ, row, col = [], list(range(8)), list(range(8))\nfor _ in range(N):\n r, c = map(int, input().split())\n Q.append((r, c))\n row.remove(r)\n col.remove(c)\nfor l in permutations(col):\n queen = Q[:] + list(zip(row, l))\n if check(queen):\n board = [\n \"\".join(\"Q\" if (r, c) in queen else \".\" for c in range(8)) for r in range(8)\n ]\n print(*board, sep=\"\\n\")\n break\n"} +{"fast_code_id":"ec5374b39ca6490501cd813d8de881ed4ee532e2d0685784e6ccee268842a9c0","fast_id":"p03606_ec5374b39ca6490501cd813d8de881ed4ee532e2d0685784e6ccee268842a9c0","language":"python","measured_fast_code_id":"ec5374b39ca6490501cd813d8de881ed4ee532e2d0685784e6ccee268842a9c0","measured_slow_code_id":"6790d9b5b286f2b0604f26a16037686fecf24cfd7e5138b01f649861516811f7","measurement_metric":"cpu_instruction_count","pair_id":"python_feed3063e7adbd6f1e686e63","problem_id":"p03606","slow_code_id":"6790d9b5b286f2b0604f26a16037686fecf24cfd7e5138b01f649861516811f7","slow_id":"p03606_6790d9b5b286f2b0604f26a16037686fecf24cfd7e5138b01f649861516811f7","speedup":310.7094017790718,"stratum":"8+","sampling_key":"0257bf5541c1937e912c16943ca4427a5c8766e57ec8d0094f4b59af784f3d86","slow_code":"n = int(eval(input()))\nseat = [0] * (10**5 + 1)\nfor i in range(n):\n l, r = list(map(int, input().split()))\n seat[l - 1] += 1\n seat[r] -= 1\nfor i in range(1, 10**5):\n seat[i] += seat[i - 1]\nres = 0\nfor i in range(10**5):\n if seat[i] == 1:\n res += 1\nprint(res)\n","fast_code":"c = 0\nn = int(eval(input()))\nfor i in range(n):\n l, r = list(map(int, input().split()))\n c += r - l + 1\nprint(c)\n"} +{"fast_code_id":"1f5f905db6801a2b76018f529a9f5e2c47581e7da5f16fa884722c4d9e19db74","fast_id":"p03077_1f5f905db6801a2b76018f529a9f5e2c47581e7da5f16fa884722c4d9e19db74","language":"python","measured_fast_code_id":"1f5f905db6801a2b76018f529a9f5e2c47581e7da5f16fa884722c4d9e19db74","measured_slow_code_id":"34caf7325f4819bd719f1f977d4c7833f1b8eae1073783274c70d879e08aa59a","measurement_metric":"cpu_instruction_count","pair_id":"python_ff0ec91cca34371db3a35801","problem_id":"p03077","slow_code_id":"ab58e9cb16ab933309b0c60e055e71406d283b0d16126adf763de4e9caa5d6fb","slow_id":"p03077_34caf7325f4819bd719f1f977d4c7833f1b8eae1073783274c70d879e08aa59a","speedup":630.1070540885779,"stratum":"8+","sampling_key":"19d5366c34853fee0e8b0a48b21aaba51ba1c1b4625b67db2e447c1653f6c66b","slow_code":"import sys\nimport numpy as np\n\n\ndef get_num():\n return int(eval(input()))\n\n\ndef get_nums(n):\n res = [0 for _ in range(n)]\n for i in range(n):\n res[i] = int(eval(input()))\n return res\n\n\ndef get_numbers():\n return list(map(int, input().split()))\n\n\nn = get_num()\ncosts = get_nums(5)\nmax_time = 0\nfor cost in costs:\n max_time = max(max_time, int(np.ceil(n / cost)))\nprint((max_time + 4))\n","fast_code":"N = int(eval(input()))\nA = [int(eval(input())) for _ in range(5)]\na = min(A)\nn = N // a\nk = N % a\nans = 0\nif n > 0:\n ans = 5 + (n - 1)\n if k > 0:\n ans += 1\nelse:\n if k > 0:\n ans = 5\nprint(ans)\n"} +{"fast_code_id":"9f205f7f14f8a8391a0e84e5bbc9266ac57a944177527cfa1158bad6b697fbee","fast_id":"p04014_9f205f7f14f8a8391a0e84e5bbc9266ac57a944177527cfa1158bad6b697fbee","language":"python","measured_fast_code_id":"9f205f7f14f8a8391a0e84e5bbc9266ac57a944177527cfa1158bad6b697fbee","measured_slow_code_id":"c95ad2a8dc940041977600eb1078f63d16cb258708724f5b3b59e88e5ff612b9","measurement_metric":"cpu_instruction_count","pair_id":"python_ff15cdbec349703416466d76","problem_id":"p04014","slow_code_id":"29cce6a043e57af2f8084b7594ae7495531a30dede09cf51b56088a83bb9cffb","slow_id":"p04014_c95ad2a8dc940041977600eb1078f63d16cb258708724f5b3b59e88e5ff612b9","speedup":5.125051501956496,"stratum":"4-8","sampling_key":"7a6598a34420818e1a0420654b796afa135e6d64b45e4530d012c3ebf2b904a1","slow_code":"from math import floor, sqrt\n\nINF = 10**20\n\n\ndef f(b, n):\n if n < b:\n return n\n else:\n return f(b, n // b) + (n % b)\n\n\ndef main():\n n = int(eval(input()))\n s = int(eval(input()))\n ans = INF\n\n if n == s:\n ans = min(ans, n + 1)\n\n for p in range(1, int(sqrt(n)) + 1):\n q = s - p\n b = (n - q) // p\n if 2 <= b and f(b, n) == s:\n ans = min(ans, b)\n\n for b in range(2, int(sqrt(n)) + 1):\n if f(b, n) == s:\n ans = min(ans, b)\n print((-1 if ans == INF else ans))\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"import sys\n\nn = int(eval(input()))\ns = int(eval(input()))\n\n\ndef f(b, n):\n if n < b:\n return n\n else:\n return f(b, n // b) + n % b\n\n\nif s == n:\n print((n + 1))\n sys.exit(0)\nif n < s:\n print((-1))\n sys.exit(0)\nans = None\nfor i in range(2, n):\n if i * i > n:\n break\n if f(i, n) == s:\n ans = i\n break\nfor i in range(1, n):\n if i * i > n:\n break\n if (n - s) % i == 0:\n b = (n - s) // i + 1\n if f(b, n) == s:\n if ans is None:\n ans = (n - s) // i + 1\n else:\n ans = min((ans, (n - s) // i + 1))\nif ans is None:\n print((-1))\nelse:\n print(ans)\n"} +{"fast_code_id":"c9c57602fcc06546f9f01d8b990c60985244833d4849083ca2aaca988472aa20","fast_id":"p03796_c9c57602fcc06546f9f01d8b990c60985244833d4849083ca2aaca988472aa20","language":"python","measured_fast_code_id":"c9c57602fcc06546f9f01d8b990c60985244833d4849083ca2aaca988472aa20","measured_slow_code_id":"95063337f9fc361b9b14d99b5c0d5d9f7a1898eff61239e227f8e13abc528c4c","measurement_metric":"cpu_instruction_count","pair_id":"python_ff92b38a1e0373fbc8c64812","problem_id":"p03796","slow_code_id":"95063337f9fc361b9b14d99b5c0d5d9f7a1898eff61239e227f8e13abc528c4c","slow_id":"p03796_95063337f9fc361b9b14d99b5c0d5d9f7a1898eff61239e227f8e13abc528c4c","speedup":3.8644487598689308,"stratum":"2-4","sampling_key":"6ac6d9a283c17d654891d967bb900c1bcf9b8bcbcd4f39a2f75ae341baf09d83","slow_code":"import sys\nimport os\nimport math\n\nMOD = 1000000007\n\n\ndef main():\n if os.getenv(\"LOCAL\"):\n sys.stdin = open(\"input.txt\", \"r\")\n N = int(sys.stdin.readline().rstrip())\n print((math.factorial(N) % MOD))\n\n\nif __name__ == \"__main__\":\n main()\n","fast_code":"def resolve():\n n = int(eval(input()))\n ans = 1\n for i in range(1, n + 1):\n ans *= i\n ans %= 1000000007\n print(ans)\n return\n\n\nif __name__ == \"__main__\":\n resolve()\n"} +{"fast_code_id":"a11be8363c56644e9c05ac4a48222a2312830ba797d2c147c788c4200ec4b9f1","fast_id":"p03221_a11be8363c56644e9c05ac4a48222a2312830ba797d2c147c788c4200ec4b9f1","language":"python","measured_fast_code_id":"a11be8363c56644e9c05ac4a48222a2312830ba797d2c147c788c4200ec4b9f1","measured_slow_code_id":"bac932e565fc824f54938c4edcf17024edb8ebfd73deb80882c8006e56a416b6","measurement_metric":"cpu_instruction_count","pair_id":"python_ffd1490cae9008dc2acb07fb","problem_id":"p03221","slow_code_id":"9a9b5b8d60f2f6a437fd75f31baba74dc5ed7ac13071d840e26b691e2ff91cac","slow_id":"p03221_bac932e565fc824f54938c4edcf17024edb8ebfd73deb80882c8006e56a416b6","speedup":5.330323700524525,"stratum":"4-8","sampling_key":"d9a9fd670e4182f3845c304040682e06b17254d3767d9c6cd780dc3851accd37","slow_code":"N, M = list(map(int, input().split()))\nP = []\nY = []\narr = [[] for j in range(10**5 + 1)]\nfor i in range(M):\n listA = list(map(int, input().split()))\n P.append(listA[0])\n Y.append(listA[1])\n arr[listA[0]].append(listA[1])\nfor i in range(N + 1):\n arr[i].sort()\nfor i in range(M):\n\n left = 0\n right = len(arr[P[i]]) - 1\n while left <= right:\n mid = (left + right) // 2\n if arr[P[i]][mid] == Y[i]:\n k = mid\n break\n elif arr[P[i]][mid] > Y[i]:\n right = mid - 1\n else:\n left = mid + 1\n print((str(P[i]).rjust(6, \"0\") + str(k + 1).rjust(6, \"0\")))\n","fast_code":"N, M = list(map(int, input().split()))\ndigit = \"zero padding: {:0=6}\"\ndic = [[] for _ in range(N + 1)]\nfor i in range(M):\n p, y = list(map(int, input().split()))\n dic[p].append((y, i))\nfor p in dic:\n p.sort()\nans = [None for _ in range(M)]\nfor k in range(1, N + 1):\n p = dic[k]\n for j in range(len(p)):\n i = p[j][1]\n ID = str(k).zfill(6) + str(j + 1).zfill(6)\n ans[i] = ID\nfor a in ans:\n print(a)\n"} +{"fast_code_id":"5c76f55bb7375b008aae832468c1927f071bea15c20ce5c79f4e53a61685b084","fast_id":"p03456_5c76f55bb7375b008aae832468c1927f071bea15c20ce5c79f4e53a61685b084","language":"python","measured_fast_code_id":"5c76f55bb7375b008aae832468c1927f071bea15c20ce5c79f4e53a61685b084","measured_slow_code_id":"7917ed4392d2155273da648b2693fb0163544534d06b0c3c68db07d4c4827be4","measurement_metric":"cpu_instruction_count","pair_id":"python_ffe8f994de2e27f95985448e","problem_id":"p03456","slow_code_id":"7917ed4392d2155273da648b2693fb0163544534d06b0c3c68db07d4c4827be4","slow_id":"p03456_7917ed4392d2155273da648b2693fb0163544534d06b0c3c68db07d4c4827be4","speedup":1696.3460836041195,"stratum":"8+","sampling_key":"0d80c08c694df0597faae052fdb34e296818205a9cdf7fce57bbfea0f51e856f","slow_code":"import numpy as np\n\na = int(input().replace(\" \", \"\"))\nb = np.sqrt(a)\nc = b - int(b)\nif c == 0.0:\n print(\"Yes\")\nelse:\n print(\"No\")\n","fast_code":"a, b = list(map(str, input().split()))\ntarget = int(a + b)\nif (target**0.5).is_integer():\n print(\"Yes\")\nelse:\n print(\"No\")\n"}